@vkzstudio/muza-ui 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.js +19 -19
- package/dist/components/Button/ButtonLoader.d.ts +7 -0
- package/dist/components/Button/ButtonLoader.d.ts.map +1 -0
- package/dist/components/Button/ButtonLoader.js +40 -0
- package/dist/components/Button/buttonVariants.d.ts.map +1 -1
- package/dist/components/Button/buttonVariants.js +0 -1
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.d.ts +1 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +39 -28
- package/dist/components/ReorderableTable/ReorderableTable.js +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +1 -1
- package/dist/components/TextEditor/EditorToolbar.d.ts +18 -0
- package/dist/components/TextEditor/EditorToolbar.d.ts.map +1 -0
- package/dist/components/TextEditor/EditorToolbar.js +175 -0
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts +52 -0
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts.map +1 -0
- package/dist/components/TextEditor/LinkBubbleMenu.js +97 -0
- package/dist/components/TextEditor/TextEditor.d.ts +134 -0
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -0
- package/dist/components/TextEditor/TextEditor.js +240 -0
- package/dist/components/TextEditor/TextEditor.stories.d.ts +51 -0
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -0
- package/dist/components/TextEditor/ToolbarButton.d.ts +38 -0
- package/dist/components/TextEditor/ToolbarButton.d.ts.map +1 -0
- package/dist/components/TextEditor/ToolbarButton.js +68 -0
- package/dist/components/TextEditor/ToolbarSeparator.d.ts +22 -0
- package/dist/components/TextEditor/ToolbarSeparator.d.ts.map +1 -0
- package/dist/components/TextEditor/ToolbarSeparator.js +23 -0
- package/dist/components/TextEditor/index.d.ts +4 -0
- package/dist/components/TextEditor/index.d.ts.map +1 -0
- package/dist/components/TextEditor/useLinkEditor.d.ts +37 -0
- package/dist/components/TextEditor/useLinkEditor.d.ts.map +1 -0
- package/dist/components/TextEditor/useLinkEditor.js +32 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +140 -132
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/@popperjs/core/lib/createPopper.js +122 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/contains.js +18 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +23 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +37 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +32 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +7 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +10 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +17 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +9 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +13 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +10 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +35 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +18 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +10 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +21 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindow.js +12 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +11 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +9 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +20 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +7 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +8 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +7 -0
- package/dist/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +16 -0
- package/dist/node_modules/@popperjs/core/lib/enums.js +31 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +47 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/arrow.js +37 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +99 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +26 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js +74 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js +44 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js +31 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +19 -0
- package/dist/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +54 -0
- package/dist/node_modules/@popperjs/core/lib/popper.js +27 -0
- package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +27 -0
- package/dist/node_modules/@popperjs/core/lib/utils/computeOffsets.js +54 -0
- package/dist/node_modules/@popperjs/core/lib/utils/debounce.js +13 -0
- package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js +33 -0
- package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +8 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getAltAxis.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getBasePlacement.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +11 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +14 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +12 -0
- package/dist/node_modules/@popperjs/core/lib/utils/getVariation.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/utils/math.js +6 -0
- package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js +15 -0
- package/dist/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +7 -0
- package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js +31 -0
- package/dist/node_modules/@popperjs/core/lib/utils/rectToClientRect.js +11 -0
- package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js +9 -0
- package/dist/node_modules/@popperjs/core/lib/utils/within.js +12 -0
- package/dist/node_modules/@tiptap/core/dist/index.js +2857 -0
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +45 -0
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +76 -0
- package/dist/node_modules/@tiptap/extension-bubble-menu/dist/index.js +129 -0
- package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js +55 -0
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +54 -0
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +136 -0
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +10 -0
- package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js +21 -0
- package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js +25 -0
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +56 -0
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +55 -0
- package/dist/node_modules/@tiptap/extension-history/dist/index.js +36 -0
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +59 -0
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +75 -0
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +272 -0
- package/dist/node_modules/@tiptap/extension-list-item/dist/index.js +34 -0
- package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js +73 -0
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +34 -0
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +53 -0
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +64 -0
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +9 -0
- package/dist/node_modules/@tiptap/react/dist/index.js +709 -0
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +30 -0
- package/dist/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/animation/animate/subject.js +24 -24
- package/dist/node_modules/framer-motion/dist/es/animation/sequence/create.js +61 -56
- package/dist/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.js +8 -8
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +32 -30
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +22 -22
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +34 -32
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +34 -26
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +30 -25
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +64 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +2 -2
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +3 -3
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +100 -89
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +11 -7
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +2 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +106 -59
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +5 -5
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +18 -6
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +27 -42
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +4 -4
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +49 -49
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -13
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +41 -40
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +13 -13
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -6
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +12 -12
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +3 -3
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +7 -7
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +5 -5
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +26 -18
- package/dist/node_modules/linkifyjs/dist/linkify.js +707 -0
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +33 -30
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +17 -17
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +20 -19
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/motion-value.js +13 -13
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-target.js +11 -11
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +24 -20
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/default-transitions.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +7 -3
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/animation/mix-values.js +2 -2
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-apply.js +4 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-calc.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/delta-remove.js +6 -6
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/DocumentProjectionNode.js +7 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/create-projection-node.js +149 -149
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +60 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-border-radius.js +1 -1
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/scale-box-shadow.js +2 -2
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/VisualElement.js +58 -50
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/dom/DOMVisualElement.js +7 -6
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/animation-state.js +31 -31
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-controlling-variants.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/motion-values.js +6 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/setters.js +4 -4
- package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/delay.js +2 -2
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +8 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +62 -42
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/errors.js +10 -9
- package/dist/node_modules/orderedmap/dist/index.js +103 -0
- package/dist/node_modules/prosemirror-commands/dist/index.js +388 -0
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +86 -0
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +204 -0
- package/dist/node_modules/prosemirror-history/dist/index.js +248 -0
- package/dist/node_modules/prosemirror-keymap/dist/index.js +62 -0
- package/dist/node_modules/prosemirror-model/dist/index.js +2733 -0
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +88 -0
- package/dist/node_modules/prosemirror-state/dist/index.js +822 -0
- package/dist/node_modules/prosemirror-transform/dist/index.js +1520 -0
- package/dist/node_modules/prosemirror-view/dist/index.js +3794 -0
- package/dist/node_modules/rope-sequence/dist/index.js +100 -0
- package/dist/node_modules/tippy.js/dist/tippy.esm.js +813 -0
- package/dist/node_modules/w3c-keyname/index.js +93 -0
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +18 -0
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +18 -0
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +18 -0
- package/dist/translations/types.d.ts +22 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/package.json +17 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animate/single-value.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -58
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -38
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -29
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -31
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -7
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element-variant.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/interfaces/visual-element.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/data-id.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/optimized-appear/get-appear-id.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/calc-child-stagger.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation/animators/waapi → motion-dom/dist/es/animation}/utils/get-final-keyframe.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/animation/utils/is-transition-defined.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/events/add-dom-event.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/conversion.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/copy.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/models.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/geometry/utils.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/HTMLProjectionNode.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/node/state.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/styles/transform.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/compare-by-depth.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/each-axis.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/render → motion-dom/dist/es/projection}/utils/flat-tree.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/has-transform.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/projection/utils/measure.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/motion/features → motion-dom/dist/es/render}/Feature.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/html/utils/render.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/object/ObjectVisualElement.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/store.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/camel-case-attrs.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/is-svg-tag.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/svg/utils/render.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/get-variant-context.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-animation-controls.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/animation → motion-dom/dist/es/render}/utils/is-keyframes-target.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/is-variant-label.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/reduced-motion/state.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-dynamic-variants.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/resolve-variants.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es → motion-dom/dist/es/render}/utils/shallow-compare.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/render/utils/variant-props.js +0 -0
- /package/dist/node_modules/{framer-motion/dist/es/value/use-will-change → motion-dom/dist/es/value/will-change}/add-will-change.js +0 -0
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { ReorderContext as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { useConstant as
|
|
6
|
-
import { useMotionValue as
|
|
7
|
-
import { useTransform as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as V, useContext as O } from "react";
|
|
3
|
+
import { ReorderContext as T } from "../../context/ReorderContext.js";
|
|
4
|
+
import { motion as b } from "../../render/components/motion/proxy.js";
|
|
5
|
+
import { useConstant as j } from "../../utils/use-constant.js";
|
|
6
|
+
import { useMotionValue as w } from "../../value/use-motion-value.js";
|
|
7
|
+
import { useTransform as z } from "../../value/use-transform.js";
|
|
8
|
+
import { autoScrollIfNeeded as A, resetAutoScrollState as B } from "./utils/auto-scroll.js";
|
|
9
|
+
import { isMotionValue as D } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
|
|
10
|
+
import { invariant as G } from "../../../../../motion-utils/dist/es/errors.js";
|
|
11
|
+
function a(i, e = 0) {
|
|
12
|
+
return D(i) ? i : w(e);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
x:
|
|
16
|
-
y:
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
const { axis:
|
|
20
|
-
return
|
|
21
|
-
const { velocity:
|
|
22
|
-
|
|
23
|
-
},
|
|
14
|
+
function L({ children: i, style: e = {}, value: m, as: c = "li", onDrag: u, onDragEnd: f, layout: d = !0, ...l }, x) {
|
|
15
|
+
const y = j(() => b[c]), s = O(T), n = {
|
|
16
|
+
x: a(e.x),
|
|
17
|
+
y: a(e.y)
|
|
18
|
+
}, R = z([n.x, n.y], ([o, t]) => o || t ? 1 : "unset");
|
|
19
|
+
G(!!s, "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
|
|
20
|
+
const { axis: r, registerItem: g, updateOrder: I, groupRef: C } = s;
|
|
21
|
+
return h(y, { drag: r, ...l, dragSnapToOrigin: !0, style: { ...e, x: n.x, y: n.y, zIndex: R }, layout: d, onDrag: (o, t) => {
|
|
22
|
+
const { velocity: p, point: S } = t, M = n[r].get();
|
|
23
|
+
I(m, M, p[r]), A(C.current, S[r], r, p[r]), u && u(o, t);
|
|
24
|
+
}, onDragEnd: (o, t) => {
|
|
25
|
+
B(), f && f(o, t);
|
|
26
|
+
}, onLayoutMeasure: (o) => {
|
|
27
|
+
g(m, o);
|
|
28
|
+
}, ref: x, ignoreStrict: !0, children: i });
|
|
24
29
|
}
|
|
25
|
-
const
|
|
30
|
+
const Q = /* @__PURE__ */ V(L);
|
|
26
31
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
Q as ReorderItem,
|
|
33
|
+
L as ReorderItemComponent
|
|
29
34
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const g = /* @__PURE__ */ new Set(["auto", "scroll"]), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let i = null;
|
|
3
|
+
function p() {
|
|
4
|
+
if (i) {
|
|
5
|
+
const o = f(i, "y");
|
|
6
|
+
o && (d.delete(o), u.delete(o));
|
|
7
|
+
const l = f(i, "x");
|
|
8
|
+
l && l !== o && (d.delete(l), u.delete(l)), i = null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function m(o, l) {
|
|
12
|
+
const t = getComputedStyle(o), n = l === "x" ? t.overflowX : t.overflowY;
|
|
13
|
+
return g.has(n);
|
|
14
|
+
}
|
|
15
|
+
function f(o, l) {
|
|
16
|
+
let t = o == null ? void 0 : o.parentElement;
|
|
17
|
+
for (; t; ) {
|
|
18
|
+
if (m(t, l))
|
|
19
|
+
return t;
|
|
20
|
+
t = t.parentElement;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function w(o, l, t) {
|
|
25
|
+
const n = l.getBoundingClientRect(), e = t === "x" ? n.left : n.top, a = t === "x" ? n.right : n.bottom, c = o - e, r = a - o;
|
|
26
|
+
if (c < 50) {
|
|
27
|
+
const s = 1 - c / 50;
|
|
28
|
+
return { amount: -25 * s * s, edge: "start" };
|
|
29
|
+
} else if (r < 50) {
|
|
30
|
+
const s = 1 - r / 50;
|
|
31
|
+
return { amount: 25 * s * s, edge: "end" };
|
|
32
|
+
}
|
|
33
|
+
return { amount: 0, edge: null };
|
|
34
|
+
}
|
|
35
|
+
function A(o, l, t, n) {
|
|
36
|
+
if (!o)
|
|
37
|
+
return;
|
|
38
|
+
i = o;
|
|
39
|
+
const e = f(o, t);
|
|
40
|
+
if (!e)
|
|
41
|
+
return;
|
|
42
|
+
const a = l - (t === "x" ? window.scrollX : window.scrollY), { amount: c, edge: r } = w(a, e, t);
|
|
43
|
+
if (r === null) {
|
|
44
|
+
d.delete(e), u.delete(e);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (d.get(e) !== r) {
|
|
48
|
+
if (!(r === "start" && n < 0 || r === "end" && n > 0))
|
|
49
|
+
return;
|
|
50
|
+
d.set(e, r);
|
|
51
|
+
const h = t === "x" ? e.scrollWidth - e.clientWidth : e.scrollHeight - e.clientHeight;
|
|
52
|
+
u.set(e, h);
|
|
53
|
+
}
|
|
54
|
+
if (c > 0) {
|
|
55
|
+
const S = u.get(e);
|
|
56
|
+
if ((t === "x" ? e.scrollLeft : e.scrollTop) >= S)
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
t === "x" ? e.scrollLeft += c : e.scrollTop += c;
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
A as autoScrollIfNeeded,
|
|
63
|
+
p as resetAutoScrollState
|
|
64
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isControllingVariants as r } from "
|
|
2
|
-
import { isVariantLabel as e } from "
|
|
1
|
+
import { isControllingVariants as r } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
|
|
2
|
+
import { isVariantLabel as e } from "../../../../../motion-dom/dist/es/render/utils/is-variant-label.js";
|
|
3
3
|
function o(i, a) {
|
|
4
4
|
if (r(i)) {
|
|
5
5
|
const { initial: n, animate: t } = i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { addPointerInfo as d } from "./event-info.js";
|
|
2
|
+
import { addDomEvent as e } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
3
3
|
function f(o, r, t, n) {
|
|
4
|
-
return
|
|
4
|
+
return e(o, r, d(t), n);
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
7
|
f as addPointerEvent
|
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { extractEventInfo as k } from "../../events/event-info.js";
|
|
5
|
-
import { convertBoxToBoundingBox as j, convertBoundingBoxToBox as T } from "../../projection/geometry/conversion.js";
|
|
6
|
-
import { calcLength as w } from "../../projection/geometry/delta-calc.js";
|
|
7
|
-
import { createBox as b } from "../../projection/geometry/models.js";
|
|
8
|
-
import { eachAxis as h } from "../../projection/utils/each-axis.js";
|
|
9
|
-
import { measurePageBox as I } from "../../projection/utils/measure.js";
|
|
10
|
-
import { getContextWindow as R } from "../../utils/get-context-window.js";
|
|
1
|
+
import { addPointerEvent as M } from "../../events/add-pointer-event.js";
|
|
2
|
+
import { extractEventInfo as S } from "../../events/event-info.js";
|
|
3
|
+
import { getContextWindow as k } from "../../utils/get-context-window.js";
|
|
11
4
|
import { isRefObject as D } from "../../utils/is-ref-object.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { PanSession as B } from "../pan/PanSession.js";
|
|
6
|
+
import { applyConstraints as j, calcRelativeConstraints as b, resolveDragElastic as T, calcViewportConstraints as w, defaultElastic as I, rebaseAxisConstraints as R, calcOrigin as W } from "./utils/constraints.js";
|
|
7
|
+
import { createBox as O } from "../../../../../motion-dom/dist/es/projection/geometry/models.js";
|
|
8
|
+
import { eachAxis as h } from "../../../../../motion-dom/dist/es/projection/utils/each-axis.js";
|
|
15
9
|
import { frame as y } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
16
|
-
import { invariant as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
10
|
+
import { invariant as K } from "../../../../../motion-utils/dist/es/errors.js";
|
|
11
|
+
import { measurePageBox as U } from "../../../../../motion-dom/dist/es/projection/utils/measure.js";
|
|
12
|
+
import { convertBoxToBoundingBox as z, convertBoundingBoxToBox as _ } from "../../../../../motion-dom/dist/es/projection/geometry/conversion.js";
|
|
13
|
+
import { addValueToWillChange as x } from "../../../../../motion-dom/dist/es/value/will-change/add-will-change.js";
|
|
14
|
+
import { animateMotionValue as F } from "../../../../../motion-dom/dist/es/animation/interfaces/motion-value.js";
|
|
15
|
+
import { addDomEvent as N } from "../../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
16
|
+
import { setDragLock as $ } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
|
|
17
|
+
import { percent as q } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
|
|
18
|
+
import { calcLength as G } from "../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
19
19
|
import { mixNumber as L } from "../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import { isElementKeyboardAccessible as H } from "../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js";
|
|
21
|
+
const J = /* @__PURE__ */ new WeakMap();
|
|
22
|
+
class Et {
|
|
22
23
|
constructor(t) {
|
|
23
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic =
|
|
24
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = O(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = t;
|
|
24
25
|
}
|
|
25
26
|
start(t, { snapToCursor: s = !1, distanceThreshold: n } = {}) {
|
|
26
27
|
const { presenceContext: i } = this.visualElement;
|
|
27
28
|
if (i && i.isPresent === !1)
|
|
28
29
|
return;
|
|
29
|
-
const r = (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const r = (o) => {
|
|
31
|
+
s ? (this.stopAnimation(), this.snapToCursor(S(o).point)) : this.pauseAnimation();
|
|
32
|
+
}, e = (o, c) => {
|
|
33
|
+
this.stopAnimation();
|
|
33
34
|
const { drag: f, dragPropagation: d, onDragStart: v } = this.getProps();
|
|
34
|
-
if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock =
|
|
35
|
+
if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = $(f), !this.openDragLock))
|
|
35
36
|
return;
|
|
36
|
-
this.latestPointerEvent =
|
|
37
|
-
let P = this.getAxisMotionValue(
|
|
38
|
-
if (
|
|
37
|
+
this.latestPointerEvent = o, this.latestPanInfo = c, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), h((g) => {
|
|
38
|
+
let P = this.getAxisMotionValue(g).get() || 0;
|
|
39
|
+
if (q.test(P)) {
|
|
39
40
|
const { projection: C } = this.visualElement;
|
|
40
41
|
if (C && C.layout) {
|
|
41
|
-
const V = C.layout.layoutBox[
|
|
42
|
-
V && (P =
|
|
42
|
+
const V = C.layout.layoutBox[g];
|
|
43
|
+
V && (P = G(V) * (parseFloat(P) / 100));
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
this.originPoint[
|
|
46
|
-
}), v && y.postRender(() => v(
|
|
46
|
+
this.originPoint[g] = P;
|
|
47
|
+
}), v && y.postRender(() => v(o, c)), x(this.visualElement, "transform");
|
|
47
48
|
const { animationState: E } = this.visualElement;
|
|
48
49
|
E && E.setActive("whileDrag", !0);
|
|
49
|
-
},
|
|
50
|
-
this.latestPointerEvent =
|
|
50
|
+
}, a = (o, c) => {
|
|
51
|
+
this.latestPointerEvent = o, this.latestPanInfo = c;
|
|
51
52
|
const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: v, onDrag: E } = this.getProps();
|
|
52
53
|
if (!f && !this.openDragLock)
|
|
53
54
|
return;
|
|
54
|
-
const { offset:
|
|
55
|
+
const { offset: g } = c;
|
|
55
56
|
if (d && this.currentDirection === null) {
|
|
56
|
-
this.currentDirection =
|
|
57
|
+
this.currentDirection = Q(g), this.currentDirection !== null && v && v(this.currentDirection);
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
this.updateAxis("x",
|
|
60
|
-
},
|
|
61
|
-
this.latestPointerEvent =
|
|
62
|
-
},
|
|
63
|
-
var
|
|
64
|
-
return this.getAnimationState(
|
|
60
|
+
this.updateAxis("x", c.point, g), this.updateAxis("y", c.point, g), this.visualElement.render(), E && E(o, c);
|
|
61
|
+
}, l = (o, c) => {
|
|
62
|
+
this.latestPointerEvent = o, this.latestPanInfo = c, this.stop(o, c), this.latestPointerEvent = null, this.latestPanInfo = null;
|
|
63
|
+
}, m = () => h((o) => {
|
|
64
|
+
var c;
|
|
65
|
+
return this.getAnimationState(o) === "paused" && ((c = this.getAxisMotionValue(o).animation) == null ? void 0 : c.play());
|
|
65
66
|
}), { dragSnapToOrigin: u } = this.getProps();
|
|
66
|
-
this.panSession = new
|
|
67
|
+
this.panSession = new B(t, {
|
|
67
68
|
onSessionStart: r,
|
|
68
69
|
onStart: e,
|
|
69
|
-
onMove:
|
|
70
|
-
onSessionEnd:
|
|
71
|
-
resumeAnimation:
|
|
70
|
+
onMove: a,
|
|
71
|
+
onSessionEnd: l,
|
|
72
|
+
resumeAnimation: m
|
|
72
73
|
}, {
|
|
73
74
|
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
74
75
|
dragSnapToOrigin: u,
|
|
75
76
|
distanceThreshold: n,
|
|
76
|
-
contextWindow:
|
|
77
|
+
contextWindow: k(this.visualElement),
|
|
78
|
+
element: this.visualElement.current
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
81
|
/**
|
|
@@ -85,8 +87,8 @@ class dt {
|
|
|
85
87
|
return;
|
|
86
88
|
const { velocity: e } = i;
|
|
87
89
|
this.startAnimation(e);
|
|
88
|
-
const { onDragEnd:
|
|
89
|
-
|
|
90
|
+
const { onDragEnd: a } = this.getProps();
|
|
91
|
+
a && y.postRender(() => a(n, i));
|
|
90
92
|
}
|
|
91
93
|
/**
|
|
92
94
|
* @internal
|
|
@@ -94,23 +96,32 @@ class dt {
|
|
|
94
96
|
cancel() {
|
|
95
97
|
this.isDragging = !1;
|
|
96
98
|
const { projection: t, animationState: s } = this.visualElement;
|
|
97
|
-
t && (t.isAnimationBlocked = !1), this.
|
|
99
|
+
t && (t.isAnimationBlocked = !1), this.endPanSession();
|
|
98
100
|
const { dragPropagation: n } = this.getProps();
|
|
99
101
|
!n && this.openDragLock && (this.openDragLock(), this.openDragLock = null), s && s.setActive("whileDrag", !1);
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Clean up the pan session without modifying other drag state.
|
|
105
|
+
* This is used during unmount to ensure event listeners are removed
|
|
106
|
+
* without affecting projection animations or drag locks.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
endPanSession() {
|
|
110
|
+
this.panSession && this.panSession.end(), this.panSession = void 0;
|
|
111
|
+
}
|
|
101
112
|
updateAxis(t, s, n) {
|
|
102
113
|
const { drag: i } = this.getProps();
|
|
103
114
|
if (!n || !A(t, i, this.currentDirection))
|
|
104
115
|
return;
|
|
105
116
|
const r = this.getAxisMotionValue(t);
|
|
106
117
|
let e = this.originPoint[t] + n[t];
|
|
107
|
-
this.constraints && this.constraints[t] && (e =
|
|
118
|
+
this.constraints && this.constraints[t] && (e = j(e, this.constraints[t], this.elastic[t])), r.set(e);
|
|
108
119
|
}
|
|
109
120
|
resolveConstraints() {
|
|
110
121
|
var r;
|
|
111
122
|
const { dragConstraints: t, dragElastic: s } = this.getProps(), n = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (r = this.visualElement.projection) == null ? void 0 : r.layout, i = this.constraints;
|
|
112
|
-
t && D(t) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : t && n ? this.constraints =
|
|
113
|
-
this.constraints !== !1 && this.getAxisMotionValue(e) && (this.constraints[e] =
|
|
123
|
+
t && D(t) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : t && n ? this.constraints = b(n.layoutBox, t) : this.constraints = !1, this.elastic = T(s), i !== this.constraints && n && this.constraints && !this.hasMutatedConstraints && h((e) => {
|
|
124
|
+
this.constraints !== !1 && this.getAxisMotionValue(e) && (this.constraints[e] = R(n.layoutBox[e], this.constraints[e]));
|
|
114
125
|
});
|
|
115
126
|
}
|
|
116
127
|
resolveRefConstraints() {
|
|
@@ -118,42 +129,42 @@ class dt {
|
|
|
118
129
|
if (!t || !D(t))
|
|
119
130
|
return !1;
|
|
120
131
|
const n = t.current;
|
|
121
|
-
|
|
132
|
+
K(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
122
133
|
const { projection: i } = this.visualElement;
|
|
123
134
|
if (!i || !i.layout)
|
|
124
135
|
return !1;
|
|
125
|
-
const r =
|
|
126
|
-
let e =
|
|
136
|
+
const r = U(n, i.root, this.visualElement.getTransformPagePoint());
|
|
137
|
+
let e = w(i.layout.layoutBox, r);
|
|
127
138
|
if (s) {
|
|
128
|
-
const
|
|
129
|
-
this.hasMutatedConstraints = !!
|
|
139
|
+
const a = s(z(e));
|
|
140
|
+
this.hasMutatedConstraints = !!a, a && (e = _(a));
|
|
130
141
|
}
|
|
131
142
|
return e;
|
|
132
143
|
}
|
|
133
144
|
startAnimation(t) {
|
|
134
|
-
const { drag: s, dragMomentum: n, dragElastic: i, dragTransition: r, dragSnapToOrigin: e, onDragTransitionEnd:
|
|
145
|
+
const { drag: s, dragMomentum: n, dragElastic: i, dragTransition: r, dragSnapToOrigin: e, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, m = h((u) => {
|
|
135
146
|
if (!A(u, s, this.currentDirection))
|
|
136
147
|
return;
|
|
137
|
-
let
|
|
138
|
-
e && (
|
|
139
|
-
const
|
|
148
|
+
let o = l && l[u] || {};
|
|
149
|
+
e && (o = { min: 0, max: 0 });
|
|
150
|
+
const c = i ? 200 : 1e6, f = i ? 40 : 1e7, d = {
|
|
140
151
|
type: "inertia",
|
|
141
152
|
velocity: n ? t[u] : 0,
|
|
142
|
-
bounceStiffness:
|
|
153
|
+
bounceStiffness: c,
|
|
143
154
|
bounceDamping: f,
|
|
144
155
|
timeConstant: 750,
|
|
145
156
|
restDelta: 1,
|
|
146
157
|
restSpeed: 10,
|
|
147
158
|
...r,
|
|
148
|
-
...
|
|
159
|
+
...o
|
|
149
160
|
};
|
|
150
161
|
return this.startAxisValueAnimation(u, d);
|
|
151
162
|
});
|
|
152
|
-
return Promise.all(
|
|
163
|
+
return Promise.all(m).then(a);
|
|
153
164
|
}
|
|
154
165
|
startAxisValueAnimation(t, s) {
|
|
155
166
|
const n = this.getAxisMotionValue(t);
|
|
156
|
-
return x(this.visualElement, t), n.start(
|
|
167
|
+
return x(this.visualElement, t), n.start(F(t, n, 0, s, this.visualElement, !1));
|
|
157
168
|
}
|
|
158
169
|
stopAnimation() {
|
|
159
170
|
h((t) => this.getAxisMotionValue(t).stop());
|
|
@@ -185,8 +196,8 @@ class dt {
|
|
|
185
196
|
return;
|
|
186
197
|
const { projection: i } = this.visualElement, r = this.getAxisMotionValue(s);
|
|
187
198
|
if (i && i.layout) {
|
|
188
|
-
const { min: e, max:
|
|
189
|
-
r.set(t[s] - L(e,
|
|
199
|
+
const { min: e, max: a } = i.layout.layoutBox[s], l = r.get() || 0;
|
|
200
|
+
r.set(t[s] - L(e, a, 0.5) + l);
|
|
190
201
|
}
|
|
191
202
|
});
|
|
192
203
|
}
|
|
@@ -204,44 +215,44 @@ class dt {
|
|
|
204
215
|
this.stopAnimation();
|
|
205
216
|
const i = { x: 0, y: 0 };
|
|
206
217
|
h((e) => {
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
i[e] =
|
|
218
|
+
const a = this.getAxisMotionValue(e);
|
|
219
|
+
if (a && this.constraints !== !1) {
|
|
220
|
+
const l = a.get();
|
|
221
|
+
i[e] = W({ min: l, max: l }, this.constraints[e]);
|
|
211
222
|
}
|
|
212
223
|
});
|
|
213
224
|
const { transformTemplate: r } = this.visualElement.getProps();
|
|
214
225
|
this.visualElement.current.style.transform = r ? r({}, "") : "none", n.root && n.root.updateScroll(), n.updateLayout(), this.resolveConstraints(), h((e) => {
|
|
215
226
|
if (!A(e, t, null))
|
|
216
227
|
return;
|
|
217
|
-
const
|
|
218
|
-
|
|
228
|
+
const a = this.getAxisMotionValue(e), { min: l, max: m } = this.constraints[e];
|
|
229
|
+
a.set(L(l, m, i[e]));
|
|
219
230
|
});
|
|
220
231
|
}
|
|
221
232
|
addListeners() {
|
|
222
233
|
if (!this.visualElement.current)
|
|
223
234
|
return;
|
|
224
|
-
|
|
225
|
-
const t = this.visualElement.current, s =
|
|
226
|
-
const { drag:
|
|
227
|
-
|
|
235
|
+
J.set(this.visualElement, this);
|
|
236
|
+
const t = this.visualElement.current, s = M(t, "pointerdown", (l) => {
|
|
237
|
+
const { drag: m, dragListener: u = !0 } = this.getProps(), o = l.target, c = o !== t && H(o);
|
|
238
|
+
m && u && !c && this.start(l);
|
|
228
239
|
}), n = () => {
|
|
229
|
-
const { dragConstraints:
|
|
230
|
-
D(
|
|
240
|
+
const { dragConstraints: l } = this.getProps();
|
|
241
|
+
D(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
231
242
|
}, { projection: i } = this.visualElement, r = i.addEventListener("measure", n);
|
|
232
243
|
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), y.read(n);
|
|
233
|
-
const e =
|
|
234
|
-
this.isDragging &&
|
|
235
|
-
const
|
|
236
|
-
|
|
244
|
+
const e = N(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: m }) => {
|
|
245
|
+
this.isDragging && m && (h((u) => {
|
|
246
|
+
const o = this.getAxisMotionValue(u);
|
|
247
|
+
o && (this.originPoint[u] += l[u].translate, o.set(o.get() + l[u].translate));
|
|
237
248
|
}), this.visualElement.render());
|
|
238
249
|
}));
|
|
239
250
|
return () => {
|
|
240
|
-
e(), s(), r(),
|
|
251
|
+
e(), s(), r(), a && a();
|
|
241
252
|
};
|
|
242
253
|
}
|
|
243
254
|
getProps() {
|
|
244
|
-
const t = this.visualElement.getProps(), { drag: s = !1, dragDirectionLock: n = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: e =
|
|
255
|
+
const t = this.visualElement.getProps(), { drag: s = !1, dragDirectionLock: n = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: e = I, dragMomentum: a = !0 } = t;
|
|
245
256
|
return {
|
|
246
257
|
...t,
|
|
247
258
|
drag: s,
|
|
@@ -249,18 +260,18 @@ class dt {
|
|
|
249
260
|
dragPropagation: i,
|
|
250
261
|
dragConstraints: r,
|
|
251
262
|
dragElastic: e,
|
|
252
|
-
dragMomentum:
|
|
263
|
+
dragMomentum: a
|
|
253
264
|
};
|
|
254
265
|
}
|
|
255
266
|
}
|
|
256
267
|
function A(p, t, s) {
|
|
257
268
|
return (t === !0 || t === p) && (s === null || s === p);
|
|
258
269
|
}
|
|
259
|
-
function
|
|
270
|
+
function Q(p, t = 10) {
|
|
260
271
|
let s = null;
|
|
261
272
|
return Math.abs(p.y) > t ? s = "y" : Math.abs(p.x) > t && (s = "x"), s;
|
|
262
273
|
}
|
|
263
274
|
export {
|
|
264
|
-
|
|
265
|
-
|
|
275
|
+
Et as VisualElementDragControls,
|
|
276
|
+
J as elementDragControls
|
|
266
277
|
};
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { Feature as s } from "../../motion/features/Feature.js";
|
|
2
1
|
import { VisualElementDragControls as t } from "./VisualElementDragControls.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { Feature as e } from "../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
+
import { noop as s } from "../../../../../motion-utils/dist/es/noop.js";
|
|
4
|
+
class m extends e {
|
|
5
5
|
constructor(o) {
|
|
6
|
-
super(o), this.removeGroupControls =
|
|
6
|
+
super(o), this.removeGroupControls = s, this.removeListeners = s, this.controls = new t(o);
|
|
7
7
|
}
|
|
8
8
|
mount() {
|
|
9
9
|
const { dragControls: o } = this.node.getProps();
|
|
10
|
-
o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() ||
|
|
10
|
+
o && (this.removeGroupControls = o.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || s;
|
|
11
|
+
}
|
|
12
|
+
update() {
|
|
13
|
+
const { dragControls: o } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
|
|
14
|
+
o !== r && (this.removeGroupControls(), o && (this.removeGroupControls = o.subscribe(this.controls)));
|
|
11
15
|
}
|
|
12
16
|
unmount() {
|
|
13
|
-
this.removeGroupControls(), this.removeListeners();
|
|
17
|
+
this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
export {
|
|
17
|
-
|
|
21
|
+
m as DragGesture
|
|
18
22
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mixNumber as r } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
2
|
+
import { calcLength as t } from "../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
3
3
|
import { progress as u } from "../../../../../../motion-utils/dist/es/progress.js";
|
|
4
4
|
import { clamp as C } from "../../../../../../motion-utils/dist/es/clamp.js";
|
|
5
5
|
function a(n, { min: e, max: m }, i) {
|
|
6
|
-
return e !== void 0 && n < e ? n = i ?
|
|
6
|
+
return e !== void 0 && n < e ? n = i ? r(e, n, i.min) : Math.max(n, e) : m !== void 0 && n > m && (n = i ? r(m, n, i.max) : Math.min(n, m)), n;
|
|
7
7
|
}
|
|
8
8
|
function o(n, e, m) {
|
|
9
9
|
return {
|
|
@@ -29,7 +29,7 @@ function w(n, e) {
|
|
|
29
29
|
}
|
|
30
30
|
function y(n, e) {
|
|
31
31
|
let m = 0.5;
|
|
32
|
-
const i =
|
|
32
|
+
const i = t(n), f = t(e);
|
|
33
33
|
return f > i ? m = u(e.min, e.max - i, n.min) : i > f && (m = u(n.min, n.max - f, e.min)), C(0, 1, m);
|
|
34
34
|
}
|
|
35
35
|
function M(n, e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Feature as i } from "../motion/features/Feature.js";
|
|
1
|
+
import { Feature as i } from "../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
2
|
import { pipe as s } from "../../../../motion-utils/dist/es/pipe.js";
|
|
3
|
+
import { addDomEvent as e } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
4
4
|
class a extends i {
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments), this.isActive = !1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extractEventInfo as m } from "../events/event-info.js";
|
|
2
|
-
import { Feature as s } from "
|
|
2
|
+
import { Feature as s } from "../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
3
|
import { hover as u } from "../../../../motion-dom/dist/es/gestures/hover.js";
|
|
4
4
|
import { frame as c } from "../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
5
5
|
function a(e, t, r) {
|