motion-v 1.7.6 → 1.8.0
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/cjs/index.js +368 -135
- package/dist/es/animation/hooks/animation-controls.mjs +1 -1
- package/dist/es/animation/hooks/use-animate.mjs +1 -1
- package/dist/es/components/motion/use-motion-state.d.ts +697 -697
- package/dist/es/components/reorder/Group.vue.mjs +13 -3
- package/dist/es/components/reorder/Item.vue.mjs +28 -12
- package/dist/es/components/reorder/auto-scroll.d.ts +2 -0
- package/dist/es/components/reorder/auto-scroll.mjs +99 -0
- package/dist/es/components/reorder/context.d.ts +1 -0
- package/dist/es/components/reorder/index.d.ts +2792 -2792
- package/dist/es/components/reorder/utils.d.ts +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animate/index.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/create.mjs +4 -4
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/animation/mix-values.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/node/create-projection-node.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/shared/stack.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/VisualElement.mjs +13 -7
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/index.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/info.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/track.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +12 -0
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/flat-tree.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/utils/delay.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +1 -1
- package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/errors.mjs +2 -1
- package/dist/es/features/animation/animation.mjs +4 -4
- package/dist/es/features/gestures/drag/VisualElementDragControls.mjs +9 -4
- package/dist/es/features/gestures/drag/index.mjs +1 -1
- package/dist/es/features/gestures/drag/utils/constraints.mjs +2 -2
- package/dist/es/features/gestures/focus/index.mjs +1 -1
- package/dist/es/features/gestures/in-view/index.mjs +1 -1
- package/dist/es/features/gestures/pan/PanSession.d.ts +46 -1
- package/dist/es/features/gestures/pan/PanSession.mjs +95 -5
- package/dist/es/features/gestures/pan/index.mjs +1 -1
- package/dist/es/features/layout/config.mjs +2 -2
- package/dist/es/features/layout/layout.mjs +2 -2
- package/dist/es/features/layout/projection.mjs +2 -2
- package/dist/es/index.mjs +36 -36
- package/dist/es/state/create-visual-element.mjs +2 -2
- package/dist/es/state/motion-state.mjs +1 -1
- package/dist/es/utils/use-in-view.mjs +1 -1
- package/dist/es/value/use-scroll.d.ts +4 -4
- package/dist/es/value/use-scroll.mjs +1 -1
- package/dist/es/value/use-time.d.ts +1 -1
- package/package.json +2 -2
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animate/sequence.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animate/single-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/events/add-dom-event.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/motion/features/definitions.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/copy.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/models.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/geometry/utils.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/node/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/styles/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/projection/utils/measure.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/html/utils/render.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/store.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/path.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/render.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/setters.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/render/utils/variant-props.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/utils/distance.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/utils/is-browser.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/value/use-will-change/is.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@12.23.26 → framer-motion@12.25.0}/external/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/array.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/clamp.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/anticipate.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/back.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/circ.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/cubic-bezier.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/ease.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/modifiers/mirror.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/modifiers/reverse.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/steps.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/utils/is-easing-array.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/easing/utils/map.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/format-error-message.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/global-config.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/is-numerical-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/is-object.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/is-zero-value-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/memo.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/noop.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/pipe.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/progress.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/subscription-manager.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/time-conversion.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/velocity-per-second.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/warn-once.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@12.23.6 → motion-utils@12.24.10}/external/motion-utils/dist/es/wrap.mjs +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
4
|
const motionDom = require("motion-dom");
|
|
4
5
|
const vue = require("vue");
|
|
@@ -36,7 +37,7 @@ exports.warning = () => {
|
|
|
36
37
|
};
|
|
37
38
|
exports.invariant = () => {
|
|
38
39
|
};
|
|
39
|
-
if (process.env.NODE_ENV !== "production") {
|
|
40
|
+
if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.NODE_ENV) !== "production") {
|
|
40
41
|
exports.warning = (check, message, errorCode) => {
|
|
41
42
|
if (!check && typeof console !== "undefined") {
|
|
42
43
|
console.warn(formatErrorMessage(message, errorCode));
|
|
@@ -916,7 +917,7 @@ class VisualElement {
|
|
|
916
917
|
}
|
|
917
918
|
}
|
|
918
919
|
mount(instance) {
|
|
919
|
-
var
|
|
920
|
+
var _a2;
|
|
920
921
|
this.current = instance;
|
|
921
922
|
visualElementStore.set(instance, this);
|
|
922
923
|
if (this.projection && !this.projection.instance) {
|
|
@@ -926,25 +927,31 @@ class VisualElement {
|
|
|
926
927
|
this.removeFromVariantTree = this.parent.addVariantChild(this);
|
|
927
928
|
}
|
|
928
929
|
this.values.forEach((value, key) => this.bindToMotionValue(key, value));
|
|
929
|
-
if (
|
|
930
|
-
|
|
930
|
+
if (this.reducedMotionConfig === "never") {
|
|
931
|
+
this.shouldReduceMotion = false;
|
|
932
|
+
} else if (this.reducedMotionConfig === "always") {
|
|
933
|
+
this.shouldReduceMotion = true;
|
|
934
|
+
} else {
|
|
935
|
+
if (!hasReducedMotionListener.current) {
|
|
936
|
+
initPrefersReducedMotion();
|
|
937
|
+
}
|
|
938
|
+
this.shouldReduceMotion = prefersReducedMotion.current;
|
|
931
939
|
}
|
|
932
|
-
this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current;
|
|
933
940
|
if (process.env.NODE_ENV !== "production") {
|
|
934
941
|
warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled");
|
|
935
942
|
}
|
|
936
|
-
(
|
|
943
|
+
(_a2 = this.parent) == null ? void 0 : _a2.addChild(this);
|
|
937
944
|
this.update(this.props, this.presenceContext);
|
|
938
945
|
}
|
|
939
946
|
unmount() {
|
|
940
|
-
var
|
|
947
|
+
var _a2;
|
|
941
948
|
this.projection && this.projection.unmount();
|
|
942
949
|
motionDom.cancelFrame(this.notifyUpdate);
|
|
943
950
|
motionDom.cancelFrame(this.render);
|
|
944
951
|
this.valueSubscriptions.forEach((remove) => remove());
|
|
945
952
|
this.valueSubscriptions.clear();
|
|
946
953
|
this.removeFromVariantTree && this.removeFromVariantTree();
|
|
947
|
-
(
|
|
954
|
+
(_a2 = this.parent) == null ? void 0 : _a2.removeChild(this);
|
|
948
955
|
for (const key in this.events) {
|
|
949
956
|
this.events[key].clear();
|
|
950
957
|
}
|
|
@@ -1170,11 +1177,11 @@ class VisualElement {
|
|
|
1170
1177
|
* props.
|
|
1171
1178
|
*/
|
|
1172
1179
|
getBaseTarget(key) {
|
|
1173
|
-
var
|
|
1180
|
+
var _a2;
|
|
1174
1181
|
const { initial } = this.props;
|
|
1175
1182
|
let valueFromInitial;
|
|
1176
1183
|
if (typeof initial === "string" || typeof initial === "object") {
|
|
1177
|
-
const variant = resolveVariantFromProps(this.props, initial, (
|
|
1184
|
+
const variant = resolveVariantFromProps(this.props, initial, (_a2 = this.presenceContext) == null ? void 0 : _a2.custom);
|
|
1178
1185
|
if (variant) {
|
|
1179
1186
|
valueFromInitial = variant[key];
|
|
1180
1187
|
}
|
|
@@ -1387,11 +1394,11 @@ function isForcedMotionValue(key, { layout, layoutId }) {
|
|
|
1387
1394
|
return motionDom.transformProps.has(key) || key.startsWith("origin") || (layout || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
1388
1395
|
}
|
|
1389
1396
|
function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
|
|
1390
|
-
var
|
|
1397
|
+
var _a2;
|
|
1391
1398
|
const { style: style2 } = props;
|
|
1392
1399
|
const newValues = {};
|
|
1393
1400
|
for (const key in style2) {
|
|
1394
|
-
if (motionDom.isMotionValue(style2[key]) || prevProps.style && motionDom.isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((
|
|
1401
|
+
if (motionDom.isMotionValue(style2[key]) || prevProps.style && motionDom.isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a2 = visualElement == null ? void 0 : visualElement.getValue(key)) == null ? void 0 : _a2.liveStyle) !== void 0) {
|
|
1395
1402
|
newValues[key] = style2[key];
|
|
1396
1403
|
}
|
|
1397
1404
|
}
|
|
@@ -1407,9 +1414,9 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
1407
1414
|
this.renderInstance = renderHTML;
|
|
1408
1415
|
}
|
|
1409
1416
|
readValueFromInstance(instance, key) {
|
|
1410
|
-
var
|
|
1417
|
+
var _a2;
|
|
1411
1418
|
if (motionDom.transformProps.has(key)) {
|
|
1412
|
-
return ((
|
|
1419
|
+
return ((_a2 = this.projection) == null ? void 0 : _a2.isProjecting) ? motionDom.defaultTransformValue(key) : motionDom.readTransformValue(instance, key);
|
|
1413
1420
|
} else {
|
|
1414
1421
|
const computedStyle = getComputedStyle$1(instance);
|
|
1415
1422
|
const value = (motionDom.isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
|
|
@@ -1478,6 +1485,12 @@ function buildSVGPath$1(attrs, length, spacing = 1, offset = 0, useDashCase = tr
|
|
|
1478
1485
|
const pathSpacing = motionDom.px.transform(spacing);
|
|
1479
1486
|
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
1480
1487
|
}
|
|
1488
|
+
const cssMotionPathProperties = [
|
|
1489
|
+
"offsetDistance",
|
|
1490
|
+
"offsetPath",
|
|
1491
|
+
"offsetRotate",
|
|
1492
|
+
"offsetAnchor"
|
|
1493
|
+
];
|
|
1481
1494
|
function buildSVGAttrs(state, {
|
|
1482
1495
|
attrX,
|
|
1483
1496
|
attrY,
|
|
@@ -1510,6 +1523,12 @@ function buildSVGAttrs(state, {
|
|
|
1510
1523
|
style2.transformBox = (styleProp == null ? void 0 : styleProp.transformBox) ?? "fill-box";
|
|
1511
1524
|
delete attrs.transformBox;
|
|
1512
1525
|
}
|
|
1526
|
+
for (const key of cssMotionPathProperties) {
|
|
1527
|
+
if (attrs[key] !== void 0) {
|
|
1528
|
+
style2[key] = attrs[key];
|
|
1529
|
+
delete attrs[key];
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1513
1532
|
if (attrX !== void 0)
|
|
1514
1533
|
attrs.x = attrX;
|
|
1515
1534
|
if (attrY !== void 0)
|
|
@@ -2015,7 +2034,7 @@ function scrollInfo(onScroll, { container = document.scrollingElement, ...option
|
|
|
2015
2034
|
const listener = scrollListeners.get(container);
|
|
2016
2035
|
motionDom.frame.read(listener, false, true);
|
|
2017
2036
|
return () => {
|
|
2018
|
-
var
|
|
2037
|
+
var _a2;
|
|
2019
2038
|
motionDom.cancelFrame(listener);
|
|
2020
2039
|
const currentHandlers = onScrollHandlers.get(container);
|
|
2021
2040
|
if (!currentHandlers)
|
|
@@ -2027,7 +2046,7 @@ function scrollInfo(onScroll, { container = document.scrollingElement, ...option
|
|
|
2027
2046
|
scrollListeners.delete(container);
|
|
2028
2047
|
if (scrollListener) {
|
|
2029
2048
|
getEventTarget(container).removeEventListener("scroll", scrollListener);
|
|
2030
|
-
(
|
|
2049
|
+
(_a2 = resizeListeners.get(container)) == null ? void 0 : _a2();
|
|
2031
2050
|
window.removeEventListener("resize", scrollListener);
|
|
2032
2051
|
}
|
|
2033
2052
|
};
|
|
@@ -2722,13 +2741,21 @@ function calcOrigin(source, target) {
|
|
|
2722
2741
|
function isHTMLElement(value) {
|
|
2723
2742
|
return typeof value === "object" && value !== null && "nodeType" in value;
|
|
2724
2743
|
}
|
|
2744
|
+
const overflowStyles$1 = /* @__PURE__ */ new Set(["auto", "scroll"]);
|
|
2725
2745
|
class PanSession {
|
|
2726
|
-
constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {
|
|
2746
|
+
constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, element } = {}) {
|
|
2727
2747
|
this.startEvent = null;
|
|
2728
2748
|
this.lastMoveEvent = null;
|
|
2729
2749
|
this.lastMoveEventInfo = null;
|
|
2730
2750
|
this.handlers = {};
|
|
2731
2751
|
this.contextWindow = window;
|
|
2752
|
+
this.scrollPositions = /* @__PURE__ */ new Map();
|
|
2753
|
+
this.onElementScroll = (event2) => {
|
|
2754
|
+
this.handleScroll(event2.target);
|
|
2755
|
+
};
|
|
2756
|
+
this.onWindowScroll = () => {
|
|
2757
|
+
this.handleScroll(window);
|
|
2758
|
+
};
|
|
2732
2759
|
this.updatePoint = () => {
|
|
2733
2760
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2734
2761
|
return;
|
|
@@ -2755,8 +2782,9 @@ class PanSession {
|
|
|
2755
2782
|
this.handlePointerUp = (event2, info2) => {
|
|
2756
2783
|
this.end();
|
|
2757
2784
|
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
|
|
2758
|
-
if (this.dragSnapToOrigin)
|
|
2785
|
+
if (this.dragSnapToOrigin || !this.startEvent) {
|
|
2759
2786
|
resumeAnimation && resumeAnimation();
|
|
2787
|
+
}
|
|
2760
2788
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2761
2789
|
return;
|
|
2762
2790
|
const panInfo = getPanInfo(
|
|
@@ -2798,12 +2826,93 @@ class PanSession {
|
|
|
2798
2826
|
this.handlePointerUp
|
|
2799
2827
|
)
|
|
2800
2828
|
);
|
|
2829
|
+
if (element) {
|
|
2830
|
+
this.startScrollTracking(element);
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
/**
|
|
2834
|
+
* Check if element has scrollable overflow
|
|
2835
|
+
*/
|
|
2836
|
+
isScrollable(node) {
|
|
2837
|
+
const style2 = window.getComputedStyle(node);
|
|
2838
|
+
return style2.overflow === "auto" || style2.overflow === "scroll" || style2.overflowX === "auto" || style2.overflowX === "scroll" || style2.overflowY === "auto" || style2.overflowY === "scroll";
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* Start tracking scroll on ancestors and window.
|
|
2842
|
+
*/
|
|
2843
|
+
/**
|
|
2844
|
+
* Start tracking scroll on ancestors and window.
|
|
2845
|
+
*/
|
|
2846
|
+
startScrollTracking(element) {
|
|
2847
|
+
let current = element.parentElement;
|
|
2848
|
+
while (current) {
|
|
2849
|
+
const style2 = getComputedStyle(current);
|
|
2850
|
+
if (overflowStyles$1.has(style2.overflowX) || overflowStyles$1.has(style2.overflowY)) {
|
|
2851
|
+
this.scrollPositions.set(current, {
|
|
2852
|
+
x: current.scrollLeft,
|
|
2853
|
+
y: current.scrollTop
|
|
2854
|
+
});
|
|
2855
|
+
}
|
|
2856
|
+
current = current.parentElement;
|
|
2857
|
+
}
|
|
2858
|
+
this.scrollPositions.set(window, {
|
|
2859
|
+
x: window.scrollX,
|
|
2860
|
+
y: window.scrollY
|
|
2861
|
+
});
|
|
2862
|
+
window.addEventListener("scroll", this.onElementScroll, {
|
|
2863
|
+
capture: true,
|
|
2864
|
+
passive: true
|
|
2865
|
+
});
|
|
2866
|
+
window.addEventListener("scroll", this.onWindowScroll, {
|
|
2867
|
+
passive: true
|
|
2868
|
+
});
|
|
2869
|
+
this.removeScrollListeners = () => {
|
|
2870
|
+
window.removeEventListener("scroll", this.onElementScroll, {
|
|
2871
|
+
capture: true
|
|
2872
|
+
});
|
|
2873
|
+
window.removeEventListener("scroll", this.onWindowScroll);
|
|
2874
|
+
};
|
|
2875
|
+
}
|
|
2876
|
+
/**
|
|
2877
|
+
* Handle scroll compensation during drag.
|
|
2878
|
+
*
|
|
2879
|
+
* For element scroll: adjusts history origin since pageX/pageY doesn't change.
|
|
2880
|
+
* For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
|
|
2881
|
+
*/
|
|
2882
|
+
handleScroll(target) {
|
|
2883
|
+
const initial = this.scrollPositions.get(target);
|
|
2884
|
+
if (!initial)
|
|
2885
|
+
return;
|
|
2886
|
+
const isWindow = target === window;
|
|
2887
|
+
const current = isWindow ? { x: window.scrollX, y: window.scrollY } : {
|
|
2888
|
+
x: target.scrollLeft,
|
|
2889
|
+
y: target.scrollTop
|
|
2890
|
+
};
|
|
2891
|
+
const delta = { x: current.x - initial.x, y: current.y - initial.y };
|
|
2892
|
+
if (delta.x === 0 && delta.y === 0)
|
|
2893
|
+
return;
|
|
2894
|
+
if (isWindow) {
|
|
2895
|
+
if (this.lastMoveEventInfo) {
|
|
2896
|
+
this.lastMoveEventInfo.point.x += delta.x;
|
|
2897
|
+
this.lastMoveEventInfo.point.y += delta.y;
|
|
2898
|
+
}
|
|
2899
|
+
} else {
|
|
2900
|
+
if (this.history.length > 0) {
|
|
2901
|
+
this.history[0].x -= delta.x;
|
|
2902
|
+
this.history[0].y -= delta.y;
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
this.scrollPositions.set(target, current);
|
|
2906
|
+
motionDom.frame.update(this.updatePoint, true);
|
|
2801
2907
|
}
|
|
2802
2908
|
updateHandlers(handlers) {
|
|
2803
2909
|
this.handlers = handlers;
|
|
2804
2910
|
}
|
|
2805
2911
|
end() {
|
|
2912
|
+
var _a2;
|
|
2806
2913
|
this.removeListeners && this.removeListeners();
|
|
2914
|
+
(_a2 = this.removeScrollListeners) == null ? void 0 : _a2.call(this);
|
|
2915
|
+
this.scrollPositions.clear();
|
|
2807
2916
|
motionDom.cancelFrame(this.updatePoint);
|
|
2808
2917
|
}
|
|
2809
2918
|
}
|
|
@@ -2926,8 +3035,8 @@ function measurePageBox(element, rootProjectionNode2, transformPagePoint) {
|
|
|
2926
3035
|
return viewportBox;
|
|
2927
3036
|
}
|
|
2928
3037
|
function isPresent(visualElement) {
|
|
2929
|
-
var
|
|
2930
|
-
return (
|
|
3038
|
+
var _a2;
|
|
3039
|
+
return (_a2 = visualElement.projection) == null ? void 0 : _a2.isPresent;
|
|
2931
3040
|
}
|
|
2932
3041
|
const elementDragControls = /* @__PURE__ */ new WeakMap();
|
|
2933
3042
|
class VisualElementDragControls {
|
|
@@ -2943,13 +3052,17 @@ class VisualElementDragControls {
|
|
|
2943
3052
|
}
|
|
2944
3053
|
start(originEvent, { snapToCursor = false } = {}) {
|
|
2945
3054
|
const onSessionStart = (event) => {
|
|
2946
|
-
|
|
2947
|
-
|
|
3055
|
+
if (snapToCursor) {
|
|
3056
|
+
this.stopAnimation();
|
|
3057
|
+
} else {
|
|
3058
|
+
this.pauseAnimation();
|
|
3059
|
+
}
|
|
2948
3060
|
if (snapToCursor) {
|
|
2949
3061
|
this.snapToCursor(extractEventInfo(event, "page").point);
|
|
2950
3062
|
}
|
|
2951
3063
|
};
|
|
2952
3064
|
const onStart = (event, info) => {
|
|
3065
|
+
this.stopAnimation();
|
|
2953
3066
|
const { drag, dragPropagation, onDragStart } = this.getProps();
|
|
2954
3067
|
if (drag && !dragPropagation) {
|
|
2955
3068
|
if (this.openGlobalLock)
|
|
@@ -3011,8 +3124,8 @@ class VisualElementDragControls {
|
|
|
3011
3124
|
const onSessionEnd = (event, info) => this.stop(event, info);
|
|
3012
3125
|
const resumeAnimation = () => eachAxis$1(
|
|
3013
3126
|
(axis) => {
|
|
3014
|
-
var
|
|
3015
|
-
return this.getAnimationState(axis) === "paused" && ((
|
|
3127
|
+
var _a2;
|
|
3128
|
+
return this.getAnimationState(axis) === "paused" && ((_a2 = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a2.play());
|
|
3016
3129
|
}
|
|
3017
3130
|
);
|
|
3018
3131
|
const { dragSnapToOrigin } = this.getProps();
|
|
@@ -3028,7 +3141,8 @@ class VisualElementDragControls {
|
|
|
3028
3141
|
{
|
|
3029
3142
|
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
3030
3143
|
dragSnapToOrigin,
|
|
3031
|
-
contextWindow: getContextWindow(this.visualElement)
|
|
3144
|
+
contextWindow: getContextWindow(this.visualElement),
|
|
3145
|
+
element: this.visualElement.current
|
|
3032
3146
|
}
|
|
3033
3147
|
);
|
|
3034
3148
|
}
|
|
@@ -3076,9 +3190,9 @@ class VisualElementDragControls {
|
|
|
3076
3190
|
axisValue.set(next);
|
|
3077
3191
|
}
|
|
3078
3192
|
resolveConstraints() {
|
|
3079
|
-
var
|
|
3193
|
+
var _a2;
|
|
3080
3194
|
const { dragConstraints, dragElastic } = this.getProps();
|
|
3081
|
-
const layout = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (
|
|
3195
|
+
const layout = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a2 = this.visualElement.projection) == null ? void 0 : _a2.layout;
|
|
3082
3196
|
const prevConstraints = this.constraints;
|
|
3083
3197
|
if (dragConstraints && isHTMLElement(dragConstraints)) {
|
|
3084
3198
|
if (!this.constraints) {
|
|
@@ -3193,13 +3307,13 @@ class VisualElementDragControls {
|
|
|
3193
3307
|
}
|
|
3194
3308
|
pauseAnimation() {
|
|
3195
3309
|
eachAxis$1((axis) => {
|
|
3196
|
-
var
|
|
3197
|
-
return (
|
|
3310
|
+
var _a2;
|
|
3311
|
+
return (_a2 = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a2.pause();
|
|
3198
3312
|
});
|
|
3199
3313
|
}
|
|
3200
3314
|
getAnimationState(axis) {
|
|
3201
|
-
var
|
|
3202
|
-
return (
|
|
3315
|
+
var _a2;
|
|
3316
|
+
return (_a2 = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a2.state;
|
|
3203
3317
|
}
|
|
3204
3318
|
/**
|
|
3205
3319
|
* Drag works differently depending on which props are provided.
|
|
@@ -3415,16 +3529,16 @@ class LayoutFeature extends Feature {
|
|
|
3415
3529
|
this.didUpdate();
|
|
3416
3530
|
}
|
|
3417
3531
|
didUpdate() {
|
|
3418
|
-
var
|
|
3532
|
+
var _a2, _b;
|
|
3419
3533
|
if (!hasLayoutUpdate)
|
|
3420
3534
|
return;
|
|
3421
3535
|
if (this.state.options.layout || this.state.options.layoutId || this.state.options.drag) {
|
|
3422
3536
|
hasLayoutUpdate = false;
|
|
3423
|
-
(_b = (
|
|
3537
|
+
(_b = (_a2 = this.state.visualElement.projection) == null ? void 0 : _a2.root) == null ? void 0 : _b.didUpdate();
|
|
3424
3538
|
}
|
|
3425
3539
|
}
|
|
3426
3540
|
mount() {
|
|
3427
|
-
var
|
|
3541
|
+
var _a2;
|
|
3428
3542
|
const options = this.state.options;
|
|
3429
3543
|
const layoutGroup = this.state.options.layoutGroup;
|
|
3430
3544
|
if (options.layout || options.layoutId) {
|
|
@@ -3436,7 +3550,7 @@ class LayoutFeature extends Feature {
|
|
|
3436
3550
|
stack.prevLead.willUpdate();
|
|
3437
3551
|
hasLayoutUpdate = true;
|
|
3438
3552
|
}
|
|
3439
|
-
(
|
|
3553
|
+
(_a2 = layoutGroup == null ? void 0 : layoutGroup.group) == null ? void 0 : _a2.add(projection);
|
|
3440
3554
|
}
|
|
3441
3555
|
globalProjectionState.hasEverUpdated = true;
|
|
3442
3556
|
}
|
|
@@ -3566,8 +3680,8 @@ class FeatureManager {
|
|
|
3566
3680
|
}
|
|
3567
3681
|
beforeMount() {
|
|
3568
3682
|
this.features.forEach((feature) => {
|
|
3569
|
-
var
|
|
3570
|
-
return (
|
|
3683
|
+
var _a2;
|
|
3684
|
+
return (_a2 = feature.beforeMount) == null ? void 0 : _a2.call(feature);
|
|
3571
3685
|
});
|
|
3572
3686
|
}
|
|
3573
3687
|
unmount(unMountChildren = false) {
|
|
@@ -3575,14 +3689,14 @@ class FeatureManager {
|
|
|
3575
3689
|
}
|
|
3576
3690
|
update() {
|
|
3577
3691
|
this.features.forEach((feature) => {
|
|
3578
|
-
var
|
|
3579
|
-
return (
|
|
3692
|
+
var _a2;
|
|
3693
|
+
return (_a2 = feature.update) == null ? void 0 : _a2.call(feature);
|
|
3580
3694
|
});
|
|
3581
3695
|
}
|
|
3582
3696
|
beforeUpdate(options) {
|
|
3583
3697
|
this.features.forEach((feature) => {
|
|
3584
|
-
var
|
|
3585
|
-
return (
|
|
3698
|
+
var _a2;
|
|
3699
|
+
return (_a2 = feature.beforeUpdate) == null ? void 0 : _a2.call(feature, options);
|
|
3586
3700
|
});
|
|
3587
3701
|
}
|
|
3588
3702
|
beforeUnmount() {
|
|
@@ -3671,7 +3785,7 @@ const style = {
|
|
|
3671
3785
|
}
|
|
3672
3786
|
};
|
|
3673
3787
|
function createStyles(keyframes) {
|
|
3674
|
-
var
|
|
3788
|
+
var _a2;
|
|
3675
3789
|
const initialKeyframes = {};
|
|
3676
3790
|
const transforms2 = [];
|
|
3677
3791
|
for (let key in keyframes) {
|
|
@@ -3685,7 +3799,7 @@ function createStyles(keyframes) {
|
|
|
3685
3799
|
let initialKeyframe = Array.isArray(value) ? value[0] : value;
|
|
3686
3800
|
const definition = transformDefinitions.get(key);
|
|
3687
3801
|
if (definition) {
|
|
3688
|
-
initialKeyframe = isNumber(value) ? (
|
|
3802
|
+
initialKeyframe = isNumber(value) ? (_a2 = definition.toDefaultUnit) == null ? void 0 : _a2.call(definition, value) : value;
|
|
3689
3803
|
transforms2.push([key, initialKeyframe]);
|
|
3690
3804
|
} else {
|
|
3691
3805
|
initialKeyframes[key] = initialKeyframe;
|
|
@@ -3791,7 +3905,7 @@ function calcChildStagger(children, child, delayChildren, staggerChildren = 0, s
|
|
|
3791
3905
|
const STATE_TYPES = ["initial", "animate", "whileInView", "whileHover", "whilePress", "whileDrag", "whileFocus", "exit"];
|
|
3792
3906
|
class AnimationFeature extends Feature {
|
|
3793
3907
|
constructor(state) {
|
|
3794
|
-
var
|
|
3908
|
+
var _a2, _b;
|
|
3795
3909
|
super(state);
|
|
3796
3910
|
this.animateUpdates = ({
|
|
3797
3911
|
controlActiveState,
|
|
@@ -3823,7 +3937,7 @@ class AnimationFeature extends Feature {
|
|
|
3823
3937
|
};
|
|
3824
3938
|
this.state.visualElement = createVisualElement(this.state.options.as, {
|
|
3825
3939
|
presenceContext: null,
|
|
3826
|
-
parent: (
|
|
3940
|
+
parent: (_a2 = this.state.parent) == null ? void 0 : _a2.visualElement,
|
|
3827
3941
|
props: {
|
|
3828
3942
|
...this.state.options,
|
|
3829
3943
|
whileTap: this.state.options.whilePress
|
|
@@ -3864,19 +3978,19 @@ class AnimationFeature extends Feature {
|
|
|
3864
3978
|
const animationTarget2 = { ...this.state.target };
|
|
3865
3979
|
const element = this.state.element;
|
|
3866
3980
|
const finishAnimation2 = (animationPromise) => {
|
|
3867
|
-
var
|
|
3981
|
+
var _a2, _b;
|
|
3868
3982
|
if (isExit) {
|
|
3869
3983
|
this.state.isExiting = true;
|
|
3870
3984
|
}
|
|
3871
3985
|
element.dispatchEvent(motionEvent("motionstart", animationTarget2));
|
|
3872
|
-
(_b = (
|
|
3986
|
+
(_b = (_a2 = this.state.options).onAnimationStart) == null ? void 0 : _b.call(_a2, animationTarget2);
|
|
3873
3987
|
animationPromise.then(() => {
|
|
3874
|
-
var
|
|
3988
|
+
var _a3, _b2;
|
|
3875
3989
|
if (isExit) {
|
|
3876
3990
|
this.state.isExiting = false;
|
|
3877
3991
|
}
|
|
3878
3992
|
element.dispatchEvent(motionEvent("motioncomplete", animationTarget2, isExit));
|
|
3879
|
-
(_b2 = (
|
|
3993
|
+
(_b2 = (_a3 = this.state.options).onAnimationComplete) == null ? void 0 : _b2.call(_a3, animationTarget2);
|
|
3880
3994
|
}).catch(noop);
|
|
3881
3995
|
};
|
|
3882
3996
|
const getAnimationPromise = () => {
|
|
@@ -3890,9 +4004,9 @@ class AnimationFeature extends Feature {
|
|
|
3890
4004
|
* Setup child animations
|
|
3891
4005
|
*/
|
|
3892
4006
|
setupChildAnimations(transition, controlActiveState) {
|
|
3893
|
-
var
|
|
4007
|
+
var _a2;
|
|
3894
4008
|
const visualElement = this.state.visualElement;
|
|
3895
|
-
if (!((
|
|
4009
|
+
if (!((_a2 = visualElement.variantChildren) == null ? void 0 : _a2.size) || !controlActiveState)
|
|
3896
4010
|
return { getChildAnimations: () => Promise.resolve() };
|
|
3897
4011
|
const { staggerChildren = 0, staggerDirection = 1, delayChildren = 0 } = transition || {};
|
|
3898
4012
|
const numChildren = visualElement.variantChildren.size;
|
|
@@ -3914,19 +4028,19 @@ class AnimationFeature extends Feature {
|
|
|
3914
4028
|
createAnimationFactories(prevTarget, animationOptions, controlDelay) {
|
|
3915
4029
|
const factories = [];
|
|
3916
4030
|
Object.keys(this.state.target).forEach((key) => {
|
|
3917
|
-
var
|
|
4031
|
+
var _a2;
|
|
3918
4032
|
if (!hasChanged(prevTarget[key], this.state.target[key]))
|
|
3919
4033
|
return;
|
|
3920
|
-
(
|
|
4034
|
+
(_a2 = this.state.baseTarget)[key] ?? (_a2[key] = style.get(this.state.element, key));
|
|
3921
4035
|
const keyValue = this.state.target[key] === "none" && core.isDef(transformResetValue[key]) ? transformResetValue[key] : this.state.target[key];
|
|
3922
4036
|
factories.push(() => {
|
|
3923
|
-
var
|
|
4037
|
+
var _a3;
|
|
3924
4038
|
return animate(
|
|
3925
4039
|
this.state.element,
|
|
3926
4040
|
{ [key]: keyValue },
|
|
3927
4041
|
{
|
|
3928
4042
|
...(animationOptions == null ? void 0 : animationOptions[key]) || animationOptions,
|
|
3929
|
-
delay: (((
|
|
4043
|
+
delay: (((_a3 = animationOptions == null ? void 0 : animationOptions[key]) == null ? void 0 : _a3.delay) || (animationOptions == null ? void 0 : animationOptions.delay) || 0) + controlDelay
|
|
3930
4044
|
}
|
|
3931
4045
|
);
|
|
3932
4046
|
});
|
|
@@ -3973,7 +4087,7 @@ class AnimationFeature extends Feature {
|
|
|
3973
4087
|
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
3974
4088
|
*/
|
|
3975
4089
|
mount() {
|
|
3976
|
-
var
|
|
4090
|
+
var _a2, _b;
|
|
3977
4091
|
const { element } = this.state;
|
|
3978
4092
|
mountedStates.set(element, this.state);
|
|
3979
4093
|
if (!visualElementStore.get(element)) {
|
|
@@ -3985,7 +4099,7 @@ class AnimationFeature extends Feature {
|
|
|
3985
4099
|
const visualElement = this.state.visualElement;
|
|
3986
4100
|
const parentVisualElement = visualElement.parent;
|
|
3987
4101
|
visualElement.enteringChildren = void 0;
|
|
3988
|
-
if (((
|
|
4102
|
+
if (((_a2 = this.state.parent) == null ? void 0 : _a2.isMounted()) && !visualElement.isControllingVariants && ((_b = parentVisualElement == null ? void 0 : parentVisualElement.enteringChildren) == null ? void 0 : _b.has(visualElement))) {
|
|
3989
4103
|
const { delayChildren } = this.state.parent.finalTransition || {};
|
|
3990
4104
|
this.animateUpdates({
|
|
3991
4105
|
controlActiveState: this.state.parent.activeStates,
|
|
@@ -4001,8 +4115,8 @@ class AnimationFeature extends Feature {
|
|
|
4001
4115
|
}
|
|
4002
4116
|
}
|
|
4003
4117
|
unmount() {
|
|
4004
|
-
var
|
|
4005
|
-
(
|
|
4118
|
+
var _a2;
|
|
4119
|
+
(_a2 = this.unmountControls) == null ? void 0 : _a2.call(this);
|
|
4006
4120
|
}
|
|
4007
4121
|
}
|
|
4008
4122
|
class FocusGesture extends Feature {
|
|
@@ -4737,12 +4851,12 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
4737
4851
|
};
|
|
4738
4852
|
}
|
|
4739
4853
|
measurePageBox() {
|
|
4740
|
-
var
|
|
4854
|
+
var _a2;
|
|
4741
4855
|
const { visualElement } = this.options;
|
|
4742
4856
|
if (!visualElement)
|
|
4743
4857
|
return createBox$1();
|
|
4744
4858
|
const box = visualElement.measureViewportBox();
|
|
4745
|
-
const wasInScrollRoot = ((
|
|
4859
|
+
const wasInScrollRoot = ((_a2 = this.scroll) == null ? void 0 : _a2.wasRoot) || this.path.some(checkNodeWasScrollRoot);
|
|
4746
4860
|
if (!wasInScrollRoot) {
|
|
4747
4861
|
const { scroll: scroll2 } = this.root;
|
|
4748
4862
|
if (scroll2) {
|
|
@@ -4753,10 +4867,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
4753
4867
|
return box;
|
|
4754
4868
|
}
|
|
4755
4869
|
removeElementScroll(box) {
|
|
4756
|
-
var
|
|
4870
|
+
var _a2;
|
|
4757
4871
|
const boxWithoutScroll = createBox$1();
|
|
4758
4872
|
copyBoxInto(boxWithoutScroll, box);
|
|
4759
|
-
if ((
|
|
4873
|
+
if ((_a2 = this.scroll) == null ? void 0 : _a2.wasRoot) {
|
|
4760
4874
|
return boxWithoutScroll;
|
|
4761
4875
|
}
|
|
4762
4876
|
for (let i = 0; i < this.path.length; i++) {
|
|
@@ -4841,13 +4955,13 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
4841
4955
|
}
|
|
4842
4956
|
}
|
|
4843
4957
|
resolveTargetDelta(forceRecalculation = false) {
|
|
4844
|
-
var
|
|
4958
|
+
var _a2;
|
|
4845
4959
|
const lead = this.getLead();
|
|
4846
4960
|
this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
|
|
4847
4961
|
this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
|
|
4848
4962
|
this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
|
|
4849
4963
|
const isShared = Boolean(this.resumingFrom) || this !== lead;
|
|
4850
|
-
const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((
|
|
4964
|
+
const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a2 = this.parent) == null ? void 0 : _a2.isProjectionDirty) || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize);
|
|
4851
4965
|
if (canSkip)
|
|
4852
4966
|
return;
|
|
4853
4967
|
const { layout, layoutId } = this.options;
|
|
@@ -4922,11 +5036,11 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
4922
5036
|
this.relativeParent = this.relativeTarget = void 0;
|
|
4923
5037
|
}
|
|
4924
5038
|
calcProjection() {
|
|
4925
|
-
var
|
|
5039
|
+
var _a2;
|
|
4926
5040
|
const lead = this.getLead();
|
|
4927
5041
|
const isShared = Boolean(this.resumingFrom) || this !== lead;
|
|
4928
5042
|
let canSkip = true;
|
|
4929
|
-
if (this.isProjectionDirty || ((
|
|
5043
|
+
if (this.isProjectionDirty || ((_a2 = this.parent) == null ? void 0 : _a2.isProjectionDirty)) {
|
|
4930
5044
|
canSkip = false;
|
|
4931
5045
|
}
|
|
4932
5046
|
if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) {
|
|
@@ -4983,8 +5097,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
4983
5097
|
this.isVisible = true;
|
|
4984
5098
|
}
|
|
4985
5099
|
scheduleRender(notifyAll = true) {
|
|
4986
|
-
var
|
|
4987
|
-
(
|
|
5100
|
+
var _a2;
|
|
5101
|
+
(_a2 = this.options.visualElement) == null ? void 0 : _a2.scheduleRender();
|
|
4988
5102
|
if (notifyAll) {
|
|
4989
5103
|
const stack = this.getStack();
|
|
4990
5104
|
stack && stack.scheduleRender();
|
|
@@ -5042,9 +5156,9 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
5042
5156
|
this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
5043
5157
|
}
|
|
5044
5158
|
startAnimation(options) {
|
|
5045
|
-
var
|
|
5159
|
+
var _a2, _b, _c;
|
|
5046
5160
|
this.notifyListeners("animationStart");
|
|
5047
|
-
(
|
|
5161
|
+
(_a2 = this.currentAnimation) == null ? void 0 : _a2.stop();
|
|
5048
5162
|
(_c = (_b = this.resumingFrom) == null ? void 0 : _b.currentAnimation) == null ? void 0 : _c.stop();
|
|
5049
5163
|
if (this.pendingAnimation) {
|
|
5050
5164
|
motionDom.cancelFrame(this.pendingAnimation);
|
|
@@ -5129,14 +5243,14 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
5129
5243
|
return stack ? stack.lead === this : true;
|
|
5130
5244
|
}
|
|
5131
5245
|
getLead() {
|
|
5132
|
-
var
|
|
5246
|
+
var _a2;
|
|
5133
5247
|
const { layoutId } = this.options;
|
|
5134
|
-
return layoutId ? ((
|
|
5248
|
+
return layoutId ? ((_a2 = this.getStack()) == null ? void 0 : _a2.lead) || this : this;
|
|
5135
5249
|
}
|
|
5136
5250
|
getPrevLead() {
|
|
5137
|
-
var
|
|
5251
|
+
var _a2;
|
|
5138
5252
|
const { layoutId } = this.options;
|
|
5139
|
-
return layoutId ? (
|
|
5253
|
+
return layoutId ? (_a2 = this.getStack()) == null ? void 0 : _a2.prevLead : void 0;
|
|
5140
5254
|
}
|
|
5141
5255
|
getStack() {
|
|
5142
5256
|
const { layoutId } = this.options;
|
|
@@ -5261,8 +5375,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
5261
5375
|
// Only run on root
|
|
5262
5376
|
resetTree() {
|
|
5263
5377
|
this.root.nodes.forEach((node) => {
|
|
5264
|
-
var
|
|
5265
|
-
return (
|
|
5378
|
+
var _a2;
|
|
5379
|
+
return (_a2 = node.currentAnimation) == null ? void 0 : _a2.stop();
|
|
5266
5380
|
});
|
|
5267
5381
|
this.root.nodes.forEach(clearMeasurements);
|
|
5268
5382
|
this.root.sharedNodes.clear();
|
|
@@ -5273,8 +5387,8 @@ function updateLayout(node) {
|
|
|
5273
5387
|
node.updateLayout();
|
|
5274
5388
|
}
|
|
5275
5389
|
function notifyLayoutUpdate(node) {
|
|
5276
|
-
var
|
|
5277
|
-
const snapshot = ((
|
|
5390
|
+
var _a2;
|
|
5391
|
+
const snapshot = ((_a2 = node.resumeFrom) == null ? void 0 : _a2.snapshot) || node.snapshot;
|
|
5278
5392
|
if (node.isLead() && node.layout && snapshot && node.hasListeners("didUpdate")) {
|
|
5279
5393
|
const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
|
|
5280
5394
|
const { animationType } = node.options;
|
|
@@ -5424,8 +5538,8 @@ function shouldAnimatePositionOnly(animationType, snapshot, layout) {
|
|
|
5424
5538
|
return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2);
|
|
5425
5539
|
}
|
|
5426
5540
|
function checkNodeWasScrollRoot(node) {
|
|
5427
|
-
var
|
|
5428
|
-
return node !== node.root && ((
|
|
5541
|
+
var _a2;
|
|
5542
|
+
return node !== node.root && ((_a2 = node.scroll) == null ? void 0 : _a2.wasRoot);
|
|
5429
5543
|
}
|
|
5430
5544
|
function addDomEvent(target, eventName, handler, options = { passive: true }) {
|
|
5431
5545
|
target.addEventListener(eventName, handler, options);
|
|
@@ -5497,8 +5611,8 @@ class ProjectionFeature extends Feature {
|
|
|
5497
5611
|
layoutScroll: options.layoutScroll,
|
|
5498
5612
|
crossfade: options.crossfade,
|
|
5499
5613
|
onExitComplete: () => {
|
|
5500
|
-
var
|
|
5501
|
-
if (!((
|
|
5614
|
+
var _a2;
|
|
5615
|
+
if (!((_a2 = this.state.visualElement.projection) == null ? void 0 : _a2.isPresent)) {
|
|
5502
5616
|
this.state.element.dispatchEvent(motionEvent("motioncomplete", this.state.target, true));
|
|
5503
5617
|
}
|
|
5504
5618
|
}
|
|
@@ -5508,8 +5622,8 @@ class ProjectionFeature extends Feature {
|
|
|
5508
5622
|
this.setOptions();
|
|
5509
5623
|
}
|
|
5510
5624
|
mount() {
|
|
5511
|
-
var
|
|
5512
|
-
(
|
|
5625
|
+
var _a2;
|
|
5626
|
+
(_a2 = this.state.visualElement.projection) == null ? void 0 : _a2.mount(this.state.element);
|
|
5513
5627
|
}
|
|
5514
5628
|
}
|
|
5515
5629
|
const domMax = [
|
|
@@ -5537,7 +5651,7 @@ const mountedStates = /* @__PURE__ */ new WeakMap();
|
|
|
5537
5651
|
let id = 0;
|
|
5538
5652
|
class MotionState {
|
|
5539
5653
|
constructor(options, parent) {
|
|
5540
|
-
var
|
|
5654
|
+
var _a2;
|
|
5541
5655
|
this.element = null;
|
|
5542
5656
|
this.isExiting = false;
|
|
5543
5657
|
this.children = /* @__PURE__ */ new Set();
|
|
@@ -5551,7 +5665,7 @@ class MotionState {
|
|
|
5551
5665
|
this.id = `motion-state-${id++}`;
|
|
5552
5666
|
this.options = options;
|
|
5553
5667
|
this.parent = parent;
|
|
5554
|
-
(
|
|
5668
|
+
(_a2 = parent == null ? void 0 : parent.children) == null ? void 0 : _a2.add(this);
|
|
5555
5669
|
const initial = options.initial === void 0 && options.variants ? this.context.initial : options.initial;
|
|
5556
5670
|
const initialVariantSource = initial === false ? ["initial", "animate"] : ["initial"];
|
|
5557
5671
|
this.initTarget(initialVariantSource);
|
|
@@ -5563,8 +5677,8 @@ class MotionState {
|
|
|
5563
5677
|
if (!this._context) {
|
|
5564
5678
|
const handler = {
|
|
5565
5679
|
get: (target, prop) => {
|
|
5566
|
-
var
|
|
5567
|
-
return isVariantLabels(this.options[prop]) ? this.options[prop] : (
|
|
5680
|
+
var _a2;
|
|
5681
|
+
return isVariantLabels(this.options[prop]) ? this.options[prop] : (_a2 = this.parent) == null ? void 0 : _a2.context[prop];
|
|
5568
5682
|
}
|
|
5569
5683
|
};
|
|
5570
5684
|
this._context = new Proxy({}, handler);
|
|
@@ -5573,8 +5687,8 @@ class MotionState {
|
|
|
5573
5687
|
}
|
|
5574
5688
|
// Initialize animation target values
|
|
5575
5689
|
initTarget(initialVariantSource) {
|
|
5576
|
-
var
|
|
5577
|
-
const custom = this.options.custom ?? ((
|
|
5690
|
+
var _a2;
|
|
5691
|
+
const custom = this.options.custom ?? ((_a2 = this.options.animatePresenceContext) == null ? void 0 : _a2.custom);
|
|
5578
5692
|
this.baseTarget = initialVariantSource.reduce((acc, variant) => {
|
|
5579
5693
|
return {
|
|
5580
5694
|
...acc,
|
|
@@ -5585,9 +5699,9 @@ class MotionState {
|
|
|
5585
5699
|
}
|
|
5586
5700
|
// Update visual element with new options
|
|
5587
5701
|
updateOptions(options) {
|
|
5588
|
-
var
|
|
5702
|
+
var _a2;
|
|
5589
5703
|
this.options = options;
|
|
5590
|
-
(
|
|
5704
|
+
(_a2 = this.visualElement) == null ? void 0 : _a2.update({
|
|
5591
5705
|
...this.options,
|
|
5592
5706
|
whileTap: this.options.whilePress
|
|
5593
5707
|
}, null);
|
|
@@ -5598,7 +5712,7 @@ class MotionState {
|
|
|
5598
5712
|
}
|
|
5599
5713
|
// Mount motion state to DOM element, handles parent-child relationships
|
|
5600
5714
|
mount(element, options, notAnimate = false) {
|
|
5601
|
-
var
|
|
5715
|
+
var _a2;
|
|
5602
5716
|
heyListen.invariant(
|
|
5603
5717
|
Boolean(element),
|
|
5604
5718
|
"Animation state must be mounted with valid Element"
|
|
@@ -5607,14 +5721,14 @@ class MotionState {
|
|
|
5607
5721
|
this.updateOptions(options);
|
|
5608
5722
|
this.featureManager.mount();
|
|
5609
5723
|
if (!notAnimate && this.options.animate) {
|
|
5610
|
-
(
|
|
5724
|
+
(_a2 = this.startAnimation) == null ? void 0 : _a2.call(this);
|
|
5611
5725
|
}
|
|
5612
5726
|
}
|
|
5613
5727
|
clearAnimation() {
|
|
5614
|
-
var
|
|
5728
|
+
var _a2, _b;
|
|
5615
5729
|
this.currentProcess && motionDom.cancelFrame(this.currentProcess);
|
|
5616
5730
|
this.currentProcess = null;
|
|
5617
|
-
(_b = (
|
|
5731
|
+
(_b = (_a2 = this.visualElement) == null ? void 0 : _a2.variantChildren) == null ? void 0 : _b.forEach((child) => {
|
|
5618
5732
|
child.state.clearAnimation();
|
|
5619
5733
|
});
|
|
5620
5734
|
}
|
|
@@ -5632,11 +5746,11 @@ class MotionState {
|
|
|
5632
5746
|
}
|
|
5633
5747
|
unmount(unMountChildren = false) {
|
|
5634
5748
|
const unmountState = () => {
|
|
5635
|
-
var
|
|
5749
|
+
var _a2, _b, _c;
|
|
5636
5750
|
if (unMountChildren) {
|
|
5637
5751
|
Array.from(this.children).forEach(this.unmountChild);
|
|
5638
5752
|
}
|
|
5639
|
-
(_b = (
|
|
5753
|
+
(_b = (_a2 = this.parent) == null ? void 0 : _a2.children) == null ? void 0 : _b.delete(this);
|
|
5640
5754
|
mountedStates.delete(this.element);
|
|
5641
5755
|
this.featureManager.unmount(unMountChildren);
|
|
5642
5756
|
(_c = this.visualElement) == null ? void 0 : _c.unmount();
|
|
@@ -5659,11 +5773,11 @@ class MotionState {
|
|
|
5659
5773
|
}
|
|
5660
5774
|
// Set animation state active status and propagate to children
|
|
5661
5775
|
setActive(name, isActive, isAnimate = true) {
|
|
5662
|
-
var
|
|
5776
|
+
var _a2;
|
|
5663
5777
|
if (!this.element || this.activeStates[name] === isActive)
|
|
5664
5778
|
return;
|
|
5665
5779
|
this.activeStates[name] = isActive;
|
|
5666
|
-
(
|
|
5780
|
+
(_a2 = this.visualElement.variantChildren) == null ? void 0 : _a2.forEach((child) => {
|
|
5667
5781
|
child.state.setActive(name, isActive, false);
|
|
5668
5782
|
});
|
|
5669
5783
|
if (isAnimate) {
|
|
@@ -5681,7 +5795,7 @@ class MotionState {
|
|
|
5681
5795
|
}
|
|
5682
5796
|
}
|
|
5683
5797
|
function useMotionState(props) {
|
|
5684
|
-
var
|
|
5798
|
+
var _a2;
|
|
5685
5799
|
const parentState = injectMotion(null);
|
|
5686
5800
|
const layoutGroup = injectLayoutGroup({});
|
|
5687
5801
|
const config = useMotionConfig();
|
|
@@ -5690,7 +5804,7 @@ function useMotionState(props) {
|
|
|
5690
5804
|
features: vue.ref([]),
|
|
5691
5805
|
strict: false
|
|
5692
5806
|
});
|
|
5693
|
-
if (process.env.NODE_ENV !== "production" && ((
|
|
5807
|
+
if (process.env.NODE_ENV !== "production" && ((_a2 = props.features) == null ? void 0 : _a2.length) && lazyMotionContext.strict) {
|
|
5694
5808
|
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
5695
5809
|
props.ignoreStrict ? heyListen.warning(false, strictMessage) : heyListen.invariant(false, strictMessage);
|
|
5696
5810
|
}
|
|
@@ -5725,7 +5839,7 @@ function useMotionState(props) {
|
|
|
5725
5839
|
);
|
|
5726
5840
|
provideMotion(state);
|
|
5727
5841
|
function getAttrs() {
|
|
5728
|
-
var
|
|
5842
|
+
var _a3;
|
|
5729
5843
|
const isSVG = state.type === "svg";
|
|
5730
5844
|
const attrsProps = { ...attrs };
|
|
5731
5845
|
Object.keys(attrs).forEach((key) => {
|
|
@@ -5734,7 +5848,7 @@ function useMotionState(props) {
|
|
|
5734
5848
|
});
|
|
5735
5849
|
let styleProps = {
|
|
5736
5850
|
...props.style,
|
|
5737
|
-
...isSVG ? {} : ((
|
|
5851
|
+
...isSVG ? {} : ((_a3 = state.visualElement) == null ? void 0 : _a3.latestValues) || state.baseTarget
|
|
5738
5852
|
};
|
|
5739
5853
|
if (isSVG) {
|
|
5740
5854
|
const { attrs: attrs2, style: style22 } = convertSvgStyleToAttributes({
|
|
@@ -5880,8 +5994,8 @@ const MotionComponentProps = {
|
|
|
5880
5994
|
"onPanEnd": { type: Function }
|
|
5881
5995
|
};
|
|
5882
5996
|
function checkMotionIsHidden(instance) {
|
|
5883
|
-
var
|
|
5884
|
-
const isHidden = ((
|
|
5997
|
+
var _a2;
|
|
5998
|
+
const isHidden = ((_a2 = getMotionElement(instance.$el)) == null ? void 0 : _a2.style.display) === "none";
|
|
5885
5999
|
const hasTransition = instance.$.vnode.transition;
|
|
5886
6000
|
return hasTransition && isHidden;
|
|
5887
6001
|
}
|
|
@@ -5901,7 +6015,7 @@ function renderSlotFragments(fragments) {
|
|
|
5901
6015
|
}
|
|
5902
6016
|
const SELF_CLOSING_TAGS = ["area", "img", "input"];
|
|
5903
6017
|
function handlePrimitiveAndSlot(asTag, allAttrs, slots) {
|
|
5904
|
-
var
|
|
6018
|
+
var _a2, _b;
|
|
5905
6019
|
if (typeof asTag === "string" && SELF_CLOSING_TAGS.includes(asTag)) {
|
|
5906
6020
|
return vue.h(asTag, allAttrs);
|
|
5907
6021
|
}
|
|
@@ -5913,7 +6027,7 @@ function handlePrimitiveAndSlot(asTag, allAttrs, slots) {
|
|
|
5913
6027
|
if (firstNonCommentChildrenIndex === -1)
|
|
5914
6028
|
return childrens;
|
|
5915
6029
|
const firstNonCommentChildren = childrens[firstNonCommentChildrenIndex];
|
|
5916
|
-
(
|
|
6030
|
+
(_a2 = firstNonCommentChildren.props) == null ? true : delete _a2.ref;
|
|
5917
6031
|
const mergedProps = firstNonCommentChildren.props ? vue.mergeProps(allAttrs, firstNonCommentChildren.props) : allAttrs;
|
|
5918
6032
|
if (allAttrs.class && ((_b = firstNonCommentChildren.props) == null ? void 0 : _b.class))
|
|
5919
6033
|
delete firstNonCommentChildren.props.class;
|
|
@@ -5932,10 +6046,10 @@ function handlePrimitiveAndSlot(asTag, allAttrs, slots) {
|
|
|
5932
6046
|
return null;
|
|
5933
6047
|
}
|
|
5934
6048
|
function createMotionComponent(component, options = {}) {
|
|
5935
|
-
var
|
|
6049
|
+
var _a2;
|
|
5936
6050
|
const isString = typeof component === "string";
|
|
5937
6051
|
const name = isString ? component : component.name || "";
|
|
5938
|
-
const componentCache = ((
|
|
6052
|
+
const componentCache = ((_a2 = options.features) == null ? void 0 : _a2.length) > 0 ? componentMaxCache : componentMiniCache;
|
|
5939
6053
|
if (isString && (componentCache == null ? void 0 : componentCache.has(component))) {
|
|
5940
6054
|
return componentCache.get(component);
|
|
5941
6055
|
}
|
|
@@ -6107,21 +6221,21 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6107
6221
|
exitDom.clear();
|
|
6108
6222
|
});
|
|
6109
6223
|
function exit(el, done) {
|
|
6110
|
-
var
|
|
6224
|
+
var _a2;
|
|
6111
6225
|
const motionEl = findMotionElement(el);
|
|
6112
6226
|
const state = mountedStates.get(motionEl);
|
|
6113
6227
|
if (!state) {
|
|
6114
6228
|
done();
|
|
6115
6229
|
if (exitDom.size === 0) {
|
|
6116
|
-
(
|
|
6230
|
+
(_a2 = props.onExitComplete) == null ? void 0 : _a2.call(props);
|
|
6117
6231
|
}
|
|
6118
6232
|
return;
|
|
6119
6233
|
}
|
|
6120
6234
|
const doneCallback = function(e) {
|
|
6121
|
-
var
|
|
6235
|
+
var _a3, _b, _c, _d;
|
|
6122
6236
|
if (!motionEl.isConnected)
|
|
6123
6237
|
return;
|
|
6124
|
-
if ((
|
|
6238
|
+
if ((_a3 = e == null ? void 0 : e.detail) == null ? void 0 : _a3.isExit) {
|
|
6125
6239
|
const projection = state.visualElement.projection;
|
|
6126
6240
|
if (((_b = state.options) == null ? void 0 : _b.layoutId) && ((_c = projection.currentAnimation) == null ? void 0 : _c.state) === "running" && !state.options.exit) {
|
|
6127
6241
|
return;
|
|
@@ -6305,7 +6419,9 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6305
6419
|
vue.onBeforeUpdate(() => {
|
|
6306
6420
|
order2 = [];
|
|
6307
6421
|
});
|
|
6422
|
+
const groupRef = useDomRef();
|
|
6308
6423
|
reorderContextProvider({
|
|
6424
|
+
groupRef,
|
|
6309
6425
|
axis,
|
|
6310
6426
|
registerItem: (value, layout) => {
|
|
6311
6427
|
const idx = order2.findIndex((entry) => value === entry.value);
|
|
@@ -6317,13 +6433,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6317
6433
|
order2.sort(compareMin);
|
|
6318
6434
|
},
|
|
6319
6435
|
updateOrder: (item, offset, velocity) => {
|
|
6320
|
-
var
|
|
6436
|
+
var _a2;
|
|
6321
6437
|
if (isReordering)
|
|
6322
6438
|
return;
|
|
6323
6439
|
const newOrder = checkReorder(order2, item, offset, velocity);
|
|
6324
6440
|
if (order2 !== newOrder) {
|
|
6325
6441
|
isReordering = true;
|
|
6326
|
-
(
|
|
6442
|
+
(_a2 = props["onUpdate:values"]) == null ? void 0 : _a2.call(
|
|
6327
6443
|
props,
|
|
6328
6444
|
newOrder.map(getValue).filter((value) => props.values.includes(value))
|
|
6329
6445
|
);
|
|
@@ -6335,11 +6451,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6335
6451
|
const { axis: axis2, values, "onUpdate:values": onUpdateValues, ...rest } = props;
|
|
6336
6452
|
return {
|
|
6337
6453
|
...attrs,
|
|
6338
|
-
...rest
|
|
6454
|
+
...rest,
|
|
6455
|
+
style: {
|
|
6456
|
+
overflowAnchor: "none",
|
|
6457
|
+
...rest.style
|
|
6458
|
+
}
|
|
6339
6459
|
};
|
|
6340
6460
|
}
|
|
6341
6461
|
return (_ctx, _cache) => {
|
|
6342
|
-
return vue.openBlock(), vue.createBlock(vue.unref(Motion), vue.
|
|
6462
|
+
return vue.openBlock(), vue.createBlock(vue.unref(Motion), vue.mergeProps(bindProps(), {
|
|
6463
|
+
ref_key: "groupRef",
|
|
6464
|
+
ref: groupRef
|
|
6465
|
+
}), {
|
|
6343
6466
|
default: vue.withCtx(() => [
|
|
6344
6467
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
6345
6468
|
vue.createTextVNode(" " + vue.toDisplayString(warning()), 1)
|
|
@@ -6549,6 +6672,101 @@ function useVelocity(value) {
|
|
|
6549
6672
|
});
|
|
6550
6673
|
return velocity;
|
|
6551
6674
|
}
|
|
6675
|
+
const threshold = 50;
|
|
6676
|
+
const maxSpeed = 25;
|
|
6677
|
+
const overflowStyles = /* @__PURE__ */ new Set(["auto", "scroll"]);
|
|
6678
|
+
const initialScrollLimits = /* @__PURE__ */ new WeakMap();
|
|
6679
|
+
const activeScrollEdge = /* @__PURE__ */ new WeakMap();
|
|
6680
|
+
let currentGroupElement = null;
|
|
6681
|
+
function resetAutoScrollState() {
|
|
6682
|
+
if (currentGroupElement) {
|
|
6683
|
+
const scrollableAncestor = findScrollableAncestor(
|
|
6684
|
+
currentGroupElement,
|
|
6685
|
+
"y"
|
|
6686
|
+
);
|
|
6687
|
+
if (scrollableAncestor) {
|
|
6688
|
+
activeScrollEdge.delete(scrollableAncestor);
|
|
6689
|
+
initialScrollLimits.delete(scrollableAncestor);
|
|
6690
|
+
}
|
|
6691
|
+
const scrollableAncestorX = findScrollableAncestor(
|
|
6692
|
+
currentGroupElement,
|
|
6693
|
+
"x"
|
|
6694
|
+
);
|
|
6695
|
+
if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {
|
|
6696
|
+
activeScrollEdge.delete(scrollableAncestorX);
|
|
6697
|
+
initialScrollLimits.delete(scrollableAncestorX);
|
|
6698
|
+
}
|
|
6699
|
+
currentGroupElement = null;
|
|
6700
|
+
}
|
|
6701
|
+
}
|
|
6702
|
+
function isScrollableElement(element, axis) {
|
|
6703
|
+
const style2 = getComputedStyle(element);
|
|
6704
|
+
const overflow = axis === "x" ? style2.overflowX : style2.overflowY;
|
|
6705
|
+
return overflowStyles.has(overflow);
|
|
6706
|
+
}
|
|
6707
|
+
function findScrollableAncestor(element, axis) {
|
|
6708
|
+
let current = element == null ? void 0 : element.parentElement;
|
|
6709
|
+
while (current) {
|
|
6710
|
+
if (isScrollableElement(current, axis)) {
|
|
6711
|
+
return current;
|
|
6712
|
+
}
|
|
6713
|
+
current = current.parentElement;
|
|
6714
|
+
}
|
|
6715
|
+
return null;
|
|
6716
|
+
}
|
|
6717
|
+
function getScrollAmount(pointerPosition, scrollElement, axis) {
|
|
6718
|
+
const rect = scrollElement.getBoundingClientRect();
|
|
6719
|
+
const start = axis === "x" ? rect.left : rect.top;
|
|
6720
|
+
const end = axis === "x" ? rect.right : rect.bottom;
|
|
6721
|
+
const distanceFromStart = pointerPosition - start;
|
|
6722
|
+
const distanceFromEnd = end - pointerPosition;
|
|
6723
|
+
if (distanceFromStart < threshold) {
|
|
6724
|
+
const intensity = 1 - distanceFromStart / threshold;
|
|
6725
|
+
return { amount: -maxSpeed * intensity * intensity, edge: "start" };
|
|
6726
|
+
} else if (distanceFromEnd < threshold) {
|
|
6727
|
+
const intensity = 1 - distanceFromEnd / threshold;
|
|
6728
|
+
return { amount: maxSpeed * intensity * intensity, edge: "end" };
|
|
6729
|
+
}
|
|
6730
|
+
return { amount: 0, edge: null };
|
|
6731
|
+
}
|
|
6732
|
+
function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) {
|
|
6733
|
+
if (!groupElement)
|
|
6734
|
+
return;
|
|
6735
|
+
currentGroupElement = groupElement;
|
|
6736
|
+
const scrollableAncestor = findScrollableAncestor(groupElement, axis);
|
|
6737
|
+
if (!scrollableAncestor)
|
|
6738
|
+
return;
|
|
6739
|
+
const { amount: scrollAmount, edge } = getScrollAmount(
|
|
6740
|
+
pointerPosition,
|
|
6741
|
+
scrollableAncestor,
|
|
6742
|
+
axis
|
|
6743
|
+
);
|
|
6744
|
+
if (edge === null) {
|
|
6745
|
+
activeScrollEdge.delete(scrollableAncestor);
|
|
6746
|
+
initialScrollLimits.delete(scrollableAncestor);
|
|
6747
|
+
return;
|
|
6748
|
+
}
|
|
6749
|
+
const currentActiveEdge = activeScrollEdge.get(scrollableAncestor);
|
|
6750
|
+
if (currentActiveEdge !== edge) {
|
|
6751
|
+
const shouldStart = edge === "start" && velocity < 0 || edge === "end" && velocity > 0;
|
|
6752
|
+
if (!shouldStart)
|
|
6753
|
+
return;
|
|
6754
|
+
activeScrollEdge.set(scrollableAncestor, edge);
|
|
6755
|
+
const maxScroll = axis === "x" ? scrollableAncestor.scrollWidth - scrollableAncestor.clientWidth : scrollableAncestor.scrollHeight - scrollableAncestor.clientHeight;
|
|
6756
|
+
initialScrollLimits.set(scrollableAncestor, maxScroll);
|
|
6757
|
+
}
|
|
6758
|
+
if (scrollAmount > 0) {
|
|
6759
|
+
const initialLimit = initialScrollLimits.get(scrollableAncestor);
|
|
6760
|
+
const currentScroll = axis === "x" ? scrollableAncestor.scrollLeft : scrollableAncestor.scrollTop;
|
|
6761
|
+
if (currentScroll >= initialLimit)
|
|
6762
|
+
return;
|
|
6763
|
+
}
|
|
6764
|
+
if (axis === "x") {
|
|
6765
|
+
scrollableAncestor.scrollLeft += scrollAmount;
|
|
6766
|
+
} else {
|
|
6767
|
+
scrollableAncestor.scrollTop += scrollAmount;
|
|
6768
|
+
}
|
|
6769
|
+
}
|
|
6552
6770
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
6553
6771
|
...{
|
|
6554
6772
|
name: "ReorderItem",
|
|
@@ -6626,19 +6844,19 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6626
6844
|
onBlur: {}
|
|
6627
6845
|
},
|
|
6628
6846
|
setup(__props) {
|
|
6629
|
-
var
|
|
6847
|
+
var _a2, _b;
|
|
6630
6848
|
const props = __props;
|
|
6631
6849
|
const { style: style2 } = vue.toRefs(props);
|
|
6632
6850
|
const context = useReorderContext(null);
|
|
6633
6851
|
const point2 = {
|
|
6634
|
-
x: useDefaultMotionValue((
|
|
6852
|
+
x: useDefaultMotionValue((_a2 = style2.value) == null ? void 0 : _a2.x),
|
|
6635
6853
|
y: useDefaultMotionValue((_b = style2.value) == null ? void 0 : _b.y)
|
|
6636
6854
|
};
|
|
6637
6855
|
const zIndex = useTransform([point2.x, point2.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
|
|
6638
6856
|
function warning() {
|
|
6639
6857
|
heyListen.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group");
|
|
6640
6858
|
}
|
|
6641
|
-
const { axis, registerItem, updateOrder } = context || {};
|
|
6859
|
+
const { axis, registerItem, updateOrder, groupRef } = context || {};
|
|
6642
6860
|
const attrs = vue.useAttrs();
|
|
6643
6861
|
function bindProps() {
|
|
6644
6862
|
const { value, ...rest } = props;
|
|
@@ -6660,21 +6878,36 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
6660
6878
|
return axis.value;
|
|
6661
6879
|
});
|
|
6662
6880
|
const isDragging = vue.ref(false);
|
|
6881
|
+
function handleDrag(event, gesturePoint) {
|
|
6882
|
+
const { velocity, point: pointerPoint } = gesturePoint;
|
|
6883
|
+
const offset = point2[axis.value].get();
|
|
6884
|
+
updateOrder(props.value, offset, velocity[axis.value]);
|
|
6885
|
+
autoScrollIfNeeded(
|
|
6886
|
+
groupRef.value,
|
|
6887
|
+
pointerPoint[axis.value],
|
|
6888
|
+
axis.value,
|
|
6889
|
+
velocity[axis.value]
|
|
6890
|
+
);
|
|
6891
|
+
props.onDrag && props.onDrag(event, gesturePoint);
|
|
6892
|
+
}
|
|
6893
|
+
function handleDragEnd(event, gesturePoint) {
|
|
6894
|
+
isDragging.value = false;
|
|
6895
|
+
resetAutoScrollState();
|
|
6896
|
+
props.onDragEnd && props.onDragEnd(event, gesturePoint);
|
|
6897
|
+
}
|
|
6898
|
+
function handleDragStart(event, gesturePoint) {
|
|
6899
|
+
var _a3;
|
|
6900
|
+
isDragging.value = true;
|
|
6901
|
+
(_a3 = props.onDragStart) == null ? void 0 : _a3.call(props, event, gesturePoint);
|
|
6902
|
+
}
|
|
6663
6903
|
return (_ctx, _cache) => {
|
|
6664
6904
|
return vue.openBlock(), vue.createBlock(vue.unref(Motion), vue.mergeProps(bindProps(), {
|
|
6665
6905
|
drag: drag.value,
|
|
6666
6906
|
"drag-snap-to-origin": true,
|
|
6667
|
-
onDrag:
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
_ctx.onDrag && _ctx.onDrag(event, gesturePoint);
|
|
6672
|
-
}),
|
|
6673
|
-
onDragEnd: _cache[1] || (_cache[1] = (event, gesturePoint) => {
|
|
6674
|
-
isDragging.value = false;
|
|
6675
|
-
_ctx.onDragEnd && _ctx.onDragEnd(event, gesturePoint);
|
|
6676
|
-
}),
|
|
6677
|
-
onLayoutMeasure: _cache[2] || (_cache[2] = (measured) => vue.unref(registerItem)(_ctx.value, measured))
|
|
6907
|
+
onDrag: handleDrag,
|
|
6908
|
+
onDragEnd: handleDragEnd,
|
|
6909
|
+
onDragStart: handleDragStart,
|
|
6910
|
+
onLayoutMeasure: _cache[0] || (_cache[0] = (measured) => vue.unref(registerItem)(_ctx.value, measured))
|
|
6678
6911
|
}), {
|
|
6679
6912
|
default: vue.withCtx(() => [
|
|
6680
6913
|
vue.renderSlot(_ctx.$slots, "default", { isDragging: isDragging.value }),
|
|
@@ -6738,8 +6971,8 @@ const LazyMotion = vue.defineComponent({
|
|
|
6738
6971
|
strict: props.strict
|
|
6739
6972
|
});
|
|
6740
6973
|
return () => {
|
|
6741
|
-
var
|
|
6742
|
-
return (
|
|
6974
|
+
var _a2;
|
|
6975
|
+
return (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
|
|
6743
6976
|
};
|
|
6744
6977
|
}
|
|
6745
6978
|
});
|