react-moveable
Advanced tools
Comparing version 0.53.2 to 0.54.0
@@ -6,2 +6,17 @@ # Change Log | ||
## [0.53.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.53.1...react-moveable@0.53.2) (2023-07-04) | ||
### :bug: Bug Fix | ||
* support individual transform #969 ([1b58541](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1b585412ea1c909bfbdcf094ecdde21024d895a0)) | ||
* support react18 strict mode #962 ([710f019](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/710f0190bd072804a224e715e353ff55e3427095)) | ||
### :mega: Other | ||
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d)) | ||
## [0.53.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.52.1...react-moveable@0.53.1) (2023-07-02) | ||
@@ -8,0 +23,0 @@ |
@@ -25,3 +25,3 @@ export declare const MOVEABLE_ABLES: readonly [{ | ||
name: string; | ||
props: readonly ["target", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "requestStyles"]; | ||
props: readonly ["target", "dragTargetSelf", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "requestStyles"]; | ||
events: readonly ["changeTargets"]; | ||
@@ -32,3 +32,3 @@ }, { | ||
props: readonly ["snappable", "snapContainer", "snapDirections", "elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight", "isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines", "snapDigit", "snapThreshold", "snapRenderThreshold", "snapRotationThreshold", "snapRotationDegrees", "horizontalGuidelines", "verticalGuidelines", "elementGuidelines", "bounds", "innerBounds", "snapDistFormat", "maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"]; | ||
events: readonly ["snap"]; | ||
events: readonly ["snap", "bound"]; | ||
css: string[]; | ||
@@ -382,4 +382,4 @@ render(moveable: import("../types").MoveableManagerInterface<import("../types").SnappableProps, import("../types").SnappableState>, React: import("../types").Renderer): any[]; | ||
}]; | ||
export declare const MOVEABLE_EVENTS: ("dragStart" | "render" | "drag" | "dragEnd" | "pinchStart" | "pinch" | "pinchEnd" | "dragGroupStart" | "dragGroup" | "dragGroupEnd" | "pinchGroupStart" | "pinchGroup" | "pinchGroupEnd" | "scale" | "snap" | "resizeStart" | "beforeResize" | "resize" | "resizeEnd" | "resizeGroupStart" | "beforeResizeGroup" | "resizeGroup" | "resizeGroupEnd" | "rotateStart" | "beforeRotate" | "rotate" | "rotateEnd" | "rotateGroupStart" | "beforeRotateGroup" | "rotateGroup" | "rotateGroupEnd" | "scaleStart" | "beforeScale" | "scaleEnd" | "scaleGroupStart" | "beforeScaleGroup" | "scaleGroup" | "scaleGroupEnd" | "warpStart" | "warp" | "warpEnd" | "click" | "clickGroup" | "scroll" | "scrollGroup" | "changeTargets" | "clip" | "round" | "clipStart" | "clipEnd" | "dragOriginStart" | "dragOrigin" | "dragOriginEnd" | "roundStart" | "roundEnd" | "roundGroupStart" | "roundGroup" | "roundGroupEnd" | "beforeRenderStart" | "beforeRender" | "beforeRenderEnd" | "beforeRenderGroupStart" | "beforeRenderGroup" | "beforeRenderGroupEnd" | "renderStart" | "renderEnd" | "renderGroupStart" | "renderGroup" | "renderGroupEnd")[]; | ||
export declare const MOVEABLE_PROPS: ("props" | "className" | "pinchable" | "rotatable" | "resizable" | "scalable" | "ables" | "target" | "dragTarget" | "dragContainer" | "container" | "warpSelf" | "rootContainer" | "viewContainer" | "useResizeObserver" | "useMutationObserver" | "zoom" | "transformOrigin" | "pinchThreshold" | "pinchOutside" | "triggerAblesSimultaneously" | "checkInput" | "cspNonce" | "translateZ" | "hideDefaultLines" | "stopPropagation" | "preventDefault" | "preventClickEventOnDrag" | "dragFocusedInput" | "preventClickDefault" | "persistData" | "useAccuratePosition" | "linePadding" | "controlPadding" | "firstRenderState" | "requestStyles" | "flushSync" | "dragArea" | "passDragArea" | "origin" | "svgOrigin" | "padding" | "defaultGroupRotate" | "useDefaultGroupRotate" | "defaultGroupOrigin" | "targetGroups" | "groupable" | "hideChildMoveableDefaultLines" | "groupableProps" | "draggable" | "throttleDrag" | "throttleDragRotate" | "hideThrottleDragRotateLine" | "startDragRotate" | "edgeDraggable" | "originDraggable" | "originRelative" | "rotationPosition" | "rotateAroundControls" | "resolveAblesWithRotatable" | "throttleRotate" | "rotationTarget" | "renderDirections" | "edge" | "displayAroundControls" | "throttleResize" | "keepRatio" | "keepRatioFinally" | "resizeFormat" | "checkResizableError" | "throttleScale" | "warpable" | "individualGroupable" | "individualGroupableProps" | "snappable" | "snapContainer" | "snapDirections" | "elementSnapDirections" | "snapGap" | "snapThreshold" | "snapRenderThreshold" | "snapDigit" | "isDisplayGridGuidelines" | "snapRotationThreshold" | "snapRotationDegrees" | "snapGridWidth" | "snapGridHeight" | "isDisplaySnapDigit" | "isDisplayInnerSnapDigit" | "horizontalGuidelines" | "verticalGuidelines" | "elementGuidelines" | "maxSnapElementGuidelineDistance" | "maxSnapElementGapDistance" | "bounds" | "innerBounds" | "snapDistFormat" | "scrollable" | "scrollContainer" | "scrollThreshold" | "scrollThrottleTime" | "getScrollPosition" | "scrollOptions" | "clippable" | "customClipPath" | "defaultClipPath" | "clipRelative" | "dragWithClip" | "clipArea" | "clipTargetBounds" | "clipVerticalGuidelines" | "clipHorizontalGuidelines" | "clipSnapThreshold" | "roundable" | "roundRelative" | "minRoundControls" | "maxRoundControls" | "roundClickable" | "isDisplayShadowRoundControls" | "roundPadding" | "clickable")[]; | ||
export declare const MOVEABLE_REACT_EVENTS: ("onResizeStart" | "onBeforeResize" | "onResize" | "onResizeEnd" | "onResizeGroupStart" | "onBeforeResizeGroup" | "onResizeGroup" | "onResizeGroupEnd" | "onScaleStart" | "onBeforeScale" | "onScale" | "onScaleEnd" | "onScaleGroupStart" | "onBeforeScaleGroup" | "onScaleGroup" | "onScaleGroupEnd" | "onRotateStart" | "onBeforeRotate" | "onRotate" | "onRotateEnd" | "onRotateGroupStart" | "onBeforeRotateGroup" | "onRotateGroup" | "onRotateGroupEnd" | "onPinchStart" | "onPinch" | "onPinchEnd" | "onPinchGroupStart" | "onPinchGroup" | "onPinchGroupEnd" | "onDragStart" | "onDrag" | "onDragEnd" | "onDragGroupStart" | "onDragGroup" | "onDragGroupEnd" | "onDragOriginStart" | "onDragOrigin" | "onDragOriginEnd" | "onWarpStart" | "onWarp" | "onWarpEnd" | "onSnap" | "onScroll" | "onScrollGroup" | "onClipStart" | "onClip" | "onClipEnd" | "onRoundStart" | "onRound" | "onRoundEnd" | "onRoundGroupStart" | "onRoundGroup" | "onRoundGroupEnd" | "onBeforeRenderStart" | "onBeforeRender" | "onBeforeRenderEnd" | "onBeforeRenderGroupStart" | "onBeforeRenderGroup" | "onBeforeRenderGroupEnd" | "onClick" | "onClickGroup" | "onRenderStart" | "onRender" | "onRenderEnd" | "onRenderGroupStart" | "onRenderGroup" | "onRenderGroupEnd" | "onChangeTargets")[]; | ||
export declare const MOVEABLE_EVENTS: ("dragStart" | "render" | "drag" | "dragEnd" | "pinchStart" | "pinch" | "pinchEnd" | "dragGroupStart" | "dragGroup" | "dragGroupEnd" | "pinchGroupStart" | "pinchGroup" | "pinchGroupEnd" | "scale" | "snap" | "bound" | "resizeStart" | "beforeResize" | "resize" | "resizeEnd" | "resizeGroupStart" | "beforeResizeGroup" | "resizeGroup" | "resizeGroupEnd" | "rotateStart" | "beforeRotate" | "rotate" | "rotateEnd" | "rotateGroupStart" | "beforeRotateGroup" | "rotateGroup" | "rotateGroupEnd" | "scaleStart" | "beforeScale" | "scaleEnd" | "scaleGroupStart" | "beforeScaleGroup" | "scaleGroup" | "scaleGroupEnd" | "warpStart" | "warp" | "warpEnd" | "click" | "clickGroup" | "scroll" | "scrollGroup" | "changeTargets" | "clip" | "round" | "clipStart" | "clipEnd" | "dragOriginStart" | "dragOrigin" | "dragOriginEnd" | "roundStart" | "roundEnd" | "roundGroupStart" | "roundGroup" | "roundGroupEnd" | "beforeRenderStart" | "beforeRender" | "beforeRenderEnd" | "beforeRenderGroupStart" | "beforeRenderGroup" | "beforeRenderGroupEnd" | "renderStart" | "renderEnd" | "renderGroupStart" | "renderGroup" | "renderGroupEnd")[]; | ||
export declare const MOVEABLE_PROPS: ("props" | "className" | "pinchable" | "rotatable" | "resizable" | "scalable" | "ables" | "target" | "dragTarget" | "dragTargetSelf" | "dragContainer" | "container" | "warpSelf" | "rootContainer" | "viewContainer" | "useResizeObserver" | "useMutationObserver" | "zoom" | "transformOrigin" | "pinchThreshold" | "pinchOutside" | "triggerAblesSimultaneously" | "checkInput" | "cspNonce" | "translateZ" | "hideDefaultLines" | "stopPropagation" | "preventDefault" | "preventClickEventOnDrag" | "dragFocusedInput" | "preventClickDefault" | "persistData" | "useAccuratePosition" | "linePadding" | "controlPadding" | "firstRenderState" | "requestStyles" | "flushSync" | "dragArea" | "passDragArea" | "origin" | "svgOrigin" | "padding" | "defaultGroupRotate" | "useDefaultGroupRotate" | "defaultGroupOrigin" | "targetGroups" | "groupable" | "hideChildMoveableDefaultLines" | "groupableProps" | "draggable" | "throttleDrag" | "throttleDragRotate" | "hideThrottleDragRotateLine" | "startDragRotate" | "edgeDraggable" | "originDraggable" | "originRelative" | "rotationPosition" | "rotateAroundControls" | "resolveAblesWithRotatable" | "throttleRotate" | "rotationTarget" | "renderDirections" | "edge" | "displayAroundControls" | "throttleResize" | "keepRatio" | "keepRatioFinally" | "resizeFormat" | "checkResizableError" | "throttleScale" | "warpable" | "individualGroupable" | "individualGroupableProps" | "snappable" | "snapContainer" | "snapDirections" | "elementSnapDirections" | "snapGap" | "snapThreshold" | "snapRenderThreshold" | "snapDigit" | "isDisplayGridGuidelines" | "snapRotationThreshold" | "snapRotationDegrees" | "snapGridWidth" | "snapGridHeight" | "isDisplaySnapDigit" | "isDisplayInnerSnapDigit" | "horizontalGuidelines" | "verticalGuidelines" | "elementGuidelines" | "maxSnapElementGuidelineDistance" | "maxSnapElementGapDistance" | "bounds" | "innerBounds" | "snapDistFormat" | "scrollable" | "scrollContainer" | "scrollThreshold" | "scrollThrottleTime" | "getScrollPosition" | "scrollOptions" | "clippable" | "customClipPath" | "defaultClipPath" | "clipRelative" | "dragWithClip" | "clipArea" | "clipTargetBounds" | "clipVerticalGuidelines" | "clipHorizontalGuidelines" | "clipSnapThreshold" | "roundable" | "roundRelative" | "minRoundControls" | "maxRoundControls" | "roundClickable" | "isDisplayShadowRoundControls" | "roundPadding" | "clickable")[]; | ||
export declare const MOVEABLE_REACT_EVENTS: ("onResizeStart" | "onBeforeResize" | "onResize" | "onResizeEnd" | "onResizeGroupStart" | "onBeforeResizeGroup" | "onResizeGroup" | "onResizeGroupEnd" | "onScaleStart" | "onBeforeScale" | "onScale" | "onScaleEnd" | "onScaleGroupStart" | "onBeforeScaleGroup" | "onScaleGroup" | "onScaleGroupEnd" | "onRotateStart" | "onBeforeRotate" | "onRotate" | "onRotateEnd" | "onRotateGroupStart" | "onBeforeRotateGroup" | "onRotateGroup" | "onRotateGroupEnd" | "onPinchStart" | "onPinch" | "onPinchEnd" | "onPinchGroupStart" | "onPinchGroup" | "onPinchGroupEnd" | "onDragStart" | "onDrag" | "onDragEnd" | "onDragGroupStart" | "onDragGroup" | "onDragGroupEnd" | "onDragOriginStart" | "onDragOrigin" | "onDragOriginEnd" | "onWarpStart" | "onWarp" | "onWarpEnd" | "onSnap" | "onBound" | "onScroll" | "onScrollGroup" | "onClipStart" | "onClip" | "onClipEnd" | "onRoundStart" | "onRound" | "onRoundEnd" | "onRoundGroupStart" | "onRoundGroup" | "onRoundGroupEnd" | "onBeforeRenderStart" | "onBeforeRender" | "onBeforeRenderEnd" | "onBeforeRenderGroupStart" | "onBeforeRenderGroup" | "onBeforeRenderGroupEnd" | "onClick" | "onClickGroup" | "onRenderStart" | "onRender" | "onRenderEnd" | "onRenderGroupStart" | "onRenderGroup" | "onRenderGroupEnd" | "onChangeTargets")[]; |
declare const _default: { | ||
name: string; | ||
props: readonly ["target", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "requestStyles"]; | ||
props: readonly ["target", "dragTargetSelf", "dragTarget", "dragContainer", "container", "warpSelf", "rootContainer", "useResizeObserver", "useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables", "className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously", "checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync", "stopPropagation", "preventClickEventOnDrag", "preventClickDefault", "viewContainer", "persistData", "useAccuratePosition", "firstRenderState", "linePadding", "controlPadding", "preventDefault", "requestStyles"]; | ||
events: readonly ["changeTargets"]; | ||
}; | ||
export default _default; |
@@ -39,3 +39,3 @@ import { Renderer, SnappableProps, SnappableState, ScalableProps, RotatableProps, RectInfo, MoveableManagerInterface, MoveableGroupInterface } from "../types"; | ||
props: readonly ["snappable", "snapContainer", "snapDirections", "elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight", "isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines", "snapDigit", "snapThreshold", "snapRenderThreshold", "snapRotationThreshold", "snapRotationDegrees", "horizontalGuidelines", "verticalGuidelines", "elementGuidelines", "bounds", "innerBounds", "snapDistFormat", "maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"]; | ||
events: readonly ["snap"]; | ||
events: readonly ["snap", "bound"]; | ||
css: string[]; | ||
@@ -97,3 +97,3 @@ render(moveable: MoveableManagerInterface<SnappableProps, SnappableState>, React: Renderer): any[]; | ||
/** | ||
* You can specify the snap directions of elements. (default: { left: true, top: true, right: true, bottom: true }) | ||
* You can specify the snap directions of elements. (default: { left: true, ftrue, right: true, bottom: true }) | ||
* @name Moveable.Snappable#elementSnapDirections | ||
@@ -100,0 +100,0 @@ * @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Snappable.html#.SnappableOptions} |
@@ -32,4 +32,10 @@ import { SnappableProps, DraggableProps, RotatableProps, MoveableManagerInterface } from "../../types"; | ||
export declare function checkInnerBoundPoses(moveable: MoveableManagerInterface<SnappableProps>): { | ||
boundMap: { | ||
left: boolean; | ||
top: boolean; | ||
right: boolean; | ||
bottom: boolean; | ||
}; | ||
horizontal: number[]; | ||
vertical: number[]; | ||
}; |
import { MoveableClientRect, MoveableManagerInterface, SnapDirectionPoses, SnapDirections, SnappableProps, SnappableState } from "../../types"; | ||
export declare const VERTICAL_NAMES: readonly ["left", "right", "center"]; | ||
export declare const HORIZONTAL_NAMES: readonly ["top", "bottom", "middle"]; | ||
export declare const SNAP_SKIP_NAMES_MAP: { | ||
left: string; | ||
right: string; | ||
center: string; | ||
top: string; | ||
bottom: string; | ||
middle: string; | ||
}; | ||
export declare const VERTICAL_NAMES_MAP: { | ||
@@ -14,2 +22,8 @@ readonly start: "left"; | ||
}; | ||
export declare function getInitialBounds(): { | ||
left: boolean; | ||
top: boolean; | ||
right: boolean; | ||
bottom: boolean; | ||
}; | ||
export declare function hasGuidelines(moveable: MoveableManagerInterface<any, any>, ableName: string): moveable is MoveableManagerInterface<SnappableProps, SnappableState>; | ||
@@ -16,0 +30,0 @@ export declare function getSnapDirections(snapDirections: SnapDirections | boolean | undefined): SnapDirections; |
@@ -25,2 +25,3 @@ import MoveableManager from "./MoveableManager"; | ||
dragTarget: string | HTMLElement | SVGElement | (() => HTMLElement | SVGElement) | import("./types").MoveableRefObject<HTMLElement | SVGElement> | null; | ||
dragTargetSelf: boolean; | ||
dragContainer: string | Window | HTMLElement | (() => HTMLElement) | import("./types").MoveableRefObject<HTMLElement> | null; | ||
@@ -27,0 +28,0 @@ container: HTMLElement | SVGElement | null; |
@@ -183,3 +183,3 @@ import { IObject } from "@daybrush/utils"; | ||
export declare function isDeepArrayEquals(arr1: any[], arr2: any[]): boolean; | ||
export declare function watchValue<T>(store: Record<string, any>, property: string, nextValue: T, valueKey: (value: T) => string | number): T; | ||
export declare function watchValue<T>(moveable: any, property: string, nextValue: T, valueKey: (value: T) => string | number, defaultValue?: T): T; | ||
export declare function sign(value: number): 1 | -1; | ||
@@ -186,0 +186,0 @@ export declare function abs(value: number): number; |
{ | ||
"name": "react-moveable", | ||
"version": "0.53.2", | ||
"version": "0.54.0", | ||
"description": "A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/moveable.cjs.js", |
@@ -5,2 +5,3 @@ export default { | ||
"target", | ||
"dragTargetSelf", | ||
"dragTarget", | ||
@@ -7,0 +8,0 @@ "dragContainer", |
@@ -205,2 +205,3 @@ import { getRad, throttle } from "@daybrush/utils"; | ||
boundInfos.push({ | ||
direction: "start", | ||
isBound: true, | ||
@@ -213,2 +214,3 @@ offset: minPos - startBoundPos, | ||
boundInfos.push({ | ||
direction: "end", | ||
isBound: true, | ||
@@ -215,0 +217,0 @@ offset: maxPos - endBoundPos, |
@@ -13,3 +13,3 @@ import { convertUnitSize, isNumber, isObject, throttle } from "@daybrush/utils"; | ||
splitSnapDirectionPoses, getSnapDirections, | ||
HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP, calculateContainerPos, | ||
HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP, calculateContainerPos, SNAP_SKIP_NAMES_MAP, | ||
} from "./utils"; | ||
@@ -242,2 +242,3 @@ | ||
direction: "", | ||
elementDirection: "", | ||
}); | ||
@@ -379,2 +380,4 @@ }); | ||
vertical, | ||
horizontalNames, | ||
verticalNames, | ||
} = splitSnapDirectionPoses({ | ||
@@ -394,3 +397,3 @@ top: topValue, | ||
vertical.forEach(pos => { | ||
vertical.forEach((pos, i) => { | ||
nextGuidelines.push({ | ||
@@ -404,14 +407,19 @@ type: "vertical", element, pos: [ | ||
elementRect: snapRect, | ||
elementDirection: SNAP_SKIP_NAMES_MAP[verticalNames[i]] || verticalNames[i], | ||
direction: "", | ||
}); | ||
}); | ||
horizontal.forEach(pos => { | ||
horizontal.forEach((pos, i) => { | ||
nextGuidelines.push({ | ||
type: "horizontal", element, pos: [ | ||
type: "horizontal", | ||
element, | ||
pos: [ | ||
rectLeft, | ||
throttle(pos, 0.1), | ||
], size: width, | ||
], | ||
size: width, | ||
sizes, | ||
className, | ||
elementRect: snapRect, | ||
elementDirection: SNAP_SKIP_NAMES_MAP[horizontalNames[i]] || horizontalNames[i], | ||
direction: "", | ||
@@ -418,0 +426,0 @@ }); |
@@ -9,3 +9,3 @@ import { average, getRad, throttle } from "@daybrush/utils"; | ||
import { TINY_NUM } from "../../consts"; | ||
import { solveLineConstants } from "./utils"; | ||
import { getInitialBounds, solveLineConstants } from "./utils"; | ||
@@ -542,5 +542,7 @@ function isStartLine(dot: number[], line: number[][]) { | ||
const innerBounds = moveable.props.innerBounds; | ||
const boundMap = getInitialBounds(); | ||
if (!innerBounds) { | ||
return { | ||
boundMap, | ||
vertical: [], | ||
@@ -568,8 +570,2 @@ horizontal: [], | ||
const boundMap = { | ||
top: false, | ||
bottom: false, | ||
left: false, | ||
right: false, | ||
}; | ||
@@ -610,2 +606,3 @@ lineInfos.forEach(lineInfo => { | ||
return { | ||
boundMap, | ||
horizontal: horizontalPoses, | ||
@@ -612,0 +609,0 @@ vertical: verticalPoses, |
@@ -14,2 +14,11 @@ import { TINY_NUM } from "@daybrush/utils"; | ||
export const HORIZONTAL_NAMES = ["top", "bottom", "middle"] as const; | ||
export const SNAP_SKIP_NAMES_MAP = { | ||
"left": "start", | ||
"right": "end", | ||
"center": "center", | ||
"top": "start", | ||
"bottom": "end", | ||
"middle": "center", | ||
}; | ||
export const VERTICAL_NAMES_MAP = { | ||
@@ -27,2 +36,13 @@ start: "left", | ||
export function getInitialBounds() { | ||
return { | ||
left: false, | ||
top: false, | ||
right: false, | ||
bottom: false, | ||
}; | ||
} | ||
export function hasGuidelines( | ||
@@ -29,0 +49,0 @@ moveable: MoveableManagerInterface<any, any>, |
@@ -230,10 +230,17 @@ import { Able, MoveableManagerInterface, MoveableGroupInterface } from "../types"; | ||
const targets: Array<HTMLElement | SVGElement> = []; | ||
const dragTarget = moveable.props.dragTarget; | ||
const props = moveable.props; | ||
const dragArea = props.dragArea; | ||
const target = moveable.state.target; | ||
const dragTarget = props.dragTarget; | ||
targets.push(controlBox); | ||
if (!moveable.props.dragArea || dragTarget) { | ||
if (!dragArea || dragTarget) { | ||
targets.push(moveableTarget); | ||
} | ||
if (!dragArea && dragTarget && target && moveableTarget !== target && props.dragTargetSelf) { | ||
targets.push(target); | ||
} | ||
return getAbleGesto(moveable, targets, "targetAbles", eventAffix, { | ||
@@ -240,0 +247,0 @@ dragStart: checkMoveableTarget(moveable), |
@@ -1,1 +0,1 @@ | ||
{"generatedAt":1688303600284,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"monorepo":"Lerna","packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen-typescript","reactDocgenTypescriptOptions":{"shouldExtractLiteralValuesFromEnum":true}},"features":{"interactionsDebugger":true,"previewMdx2":true},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-coverage":{"version":"0.0.8"},"@storybook/addon-storyshots":{"version":"6.5.16"},"@storybook/addons":{"version":"6.5.16"},"@storybook/jest":{"version":null},"@storybook/mdx2-csf":{"version":"0.0.4"},"@storybook/react":{"version":"6.5.16"},"@storybook/test-runner":{"version":"0.9.4"},"@storybook/testing-library":{"version":"0.0.13"}},"framework":{"name":"react"},"addons":{"@storybook/addon-google-analytics":{"version":"6.2.9"},"@storybook/addon-docs":{"options":{"configureJSX":true},"version":"6.5.16"},"storybook-addon-preview":{"version":"2.3.0"},"@storybook/addon-controls":{"version":"6.5.16"},"@storybook/addon-viewport":{"version":"6.5.16"},"storybook-dark-mode":{"version":"1.1.2"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":null},"@storybook/addon-interactions":{"version":"6.5.16"}}} | ||
{"generatedAt":1688879679071,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"monorepo":"Lerna","packageManager":{"type":"yarn","version":"1.22.19"},"typescriptOptions":{"reactDocgen":"react-docgen-typescript","reactDocgenTypescriptOptions":{"shouldExtractLiteralValuesFromEnum":true}},"features":{"interactionsDebugger":true,"previewMdx2":true},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/addon-coverage":{"version":"0.0.8"},"@storybook/addon-storyshots":{"version":"6.5.16"},"@storybook/addons":{"version":"6.5.16"},"@storybook/jest":{"version":null},"@storybook/mdx2-csf":{"version":"0.0.4"},"@storybook/react":{"version":"6.5.16"},"@storybook/test-runner":{"version":"0.9.4"},"@storybook/testing-library":{"version":"0.0.13"}},"framework":{"name":"react"},"addons":{"@storybook/addon-google-analytics":{"version":"6.2.9"},"@storybook/addon-docs":{"options":{"configureJSX":true},"version":"6.5.16"},"storybook-addon-preview":{"version":"2.3.0"},"@storybook/addon-controls":{"version":"6.5.16"},"@storybook/addon-viewport":{"version":"6.5.16"},"storybook-dark-mode":{"version":"1.1.2"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-essentials":{"version":null},"@storybook/addon-interactions":{"version":"6.5.16"}}} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4832771
150
57448