motion-v 0.5.0-beta.2 → 0.5.1
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 +1580 -613
- package/dist/es/animation/use-animate.mjs +1 -1
- package/dist/es/components/AnimatePresence.vue.mjs +1 -4
- package/dist/es/components/Motion.vue.mjs +65 -19
- package/dist/es/components/presence.mjs +2 -3
- package/dist/es/events/add-pointer-event.mjs +8 -0
- package/dist/es/events/event-info.mjs +16 -0
- package/dist/es/events/utils/is-primary-pointer.mjs +10 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/GroupPlaybackControls.mjs +3 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +2 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +4 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +7 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +8 -2
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/linear.mjs +1 -2
- package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/generators/spring/defaults.mjs +32 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/spring/find.mjs +9 -16
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/spring/index.mjs +46 -17
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/create.mjs +23 -2
- package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +6 -0
- package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +8 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/cubic-bezier.mjs +2 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/map.mjs +2 -2
- package/dist/es/external/.pnpm/framer-motion@11.15.0/external/framer-motion/dist/es/events/add-dom-event.mjs +7 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/frame.mjs +2 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/render-step.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/animation/mix-values.mjs +2 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/create-projection-node.mjs +2 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +15 -0
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/index.mjs +13 -6
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/viewport/index.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -14
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/interpolate.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/color.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/index.mjs +1 -1
- package/dist/es/features/feature-manager.mjs +26 -7
- package/dist/es/features/feature.mjs +10 -0
- package/dist/es/features/gestures/drag/VisualElementDragControls.mjs +450 -0
- package/dist/es/features/gestures/drag/index.mjs +26 -0
- package/dist/es/features/gestures/drag/lock.mjs +42 -0
- package/dist/es/features/gestures/drag/utils/constraints.mjs +93 -0
- package/dist/es/features/gestures/drag/utils/is.mjs +6 -0
- package/dist/es/features/gestures/hover/index.mjs +40 -0
- package/dist/es/features/gestures/in-view/index.mjs +39 -0
- package/dist/es/features/gestures/pan/PanSession.mjs +150 -0
- package/dist/es/features/gestures/pan/index.mjs +69 -0
- package/dist/es/features/gestures/press/index.mjs +51 -0
- package/dist/es/features/layout/config.mjs +2 -2
- package/dist/es/features/layout/layout.mjs +24 -51
- package/dist/es/features/layout/projection.mjs +39 -0
- package/dist/es/features/svg.mjs +1 -1
- package/dist/es/index.mjs +41 -31
- package/dist/es/projection/conversion.mjs +31 -0
- package/dist/es/projection/geometry/delta-apply.mjs +7 -0
- package/dist/es/projection/geometry/delta-calc.mjs +6 -0
- package/dist/es/projection/geometry/models.mjs +11 -0
- package/dist/es/projection/utils/each-axis.mjs +6 -0
- package/dist/es/projection/utils/measure.mjs +20 -0
- package/dist/es/state/animate-variants-children.mjs +1 -1
- package/dist/es/state/create-visual-element.mjs +2 -2
- package/dist/es/state/motion-state.mjs +24 -7
- package/dist/es/state/utils/is-present.mjs +7 -0
- package/dist/es/state/utils.mjs +0 -3
- package/dist/es/utils/clamp.mjs +10 -0
- package/dist/es/utils/get-context-window.mjs +6 -0
- package/dist/es/utils/mix/number.mjs +6 -0
- package/dist/es/utils/progress.mjs +7 -0
- package/dist/es/utils/time-conversion.mjs +8 -0
- package/dist/es/utils/use-animation-frame.mjs +1 -1
- package/dist/es/utils/use-in-view.mjs +1 -1
- package/dist/es/value/types/numbers/units.mjs +11 -0
- package/dist/es/value/use-combine-values.mjs +2 -2
- package/dist/es/value/use-computed.mjs +1 -1
- package/dist/es/value/use-scroll.mjs +3 -3
- package/dist/es/value/use-spring.mjs +5 -6
- package/dist/es/value/use-time.mjs +1 -1
- package/dist/es/value/use-transform.mjs +1 -1
- package/dist/es/value/use-velocity.mjs +2 -2
- package/dist/es/value/use-will-change/add-will-change.mjs +10 -0
- package/dist/es/value/use-will-change/is.mjs +7 -0
- package/dist/src/animation/animation-controls.d.ts +7 -0
- package/dist/src/animation/types.d.ts +12 -0
- package/dist/src/animation/use-animation.d.ts +0 -0
- package/dist/src/components/AnimatePresence.d.ts +1 -1
- package/dist/src/events/add-dom-event.d.ts +1 -0
- package/dist/src/events/add-pointer-event.d.ts +2 -0
- package/dist/src/events/event-info.d.ts +4 -0
- package/dist/src/events/index.d.ts +5 -0
- package/dist/src/events/types.d.ts +5 -0
- package/dist/src/events/utils/index.d.ts +1 -0
- package/dist/src/events/utils/is-primary-pointer.d.ts +1 -0
- package/dist/src/features/feature-manager.d.ts +3 -0
- package/dist/src/features/feature.d.ts +6 -3
- package/dist/src/features/gestures/drag/VisualElementDragControls.d.ts +57 -0
- package/dist/src/features/gestures/drag/index.d.ts +8 -10
- package/dist/src/features/gestures/drag/lock.d.ts +4 -0
- package/dist/src/features/gestures/drag/types.d.ts +149 -70
- package/dist/src/features/gestures/drag/use-drag-controls.d.ts +73 -0
- package/dist/src/features/gestures/drag/utils/constraints.d.ts +55 -0
- package/dist/src/features/gestures/drag/utils/is.d.ts +1 -0
- package/dist/src/features/gestures/hover/index.d.ts +7 -0
- package/dist/src/features/gestures/hover/types.d.ts +8 -0
- package/dist/src/features/gestures/in-view/index.d.ts +7 -0
- package/dist/src/features/gestures/in-view/types.d.ts +18 -0
- package/dist/src/features/gestures/pan/PanSession.d.ts +139 -0
- package/dist/src/features/gestures/pan/index.d.ts +16 -0
- package/dist/src/features/gestures/pan/types.d.ts +7 -0
- package/dist/src/features/gestures/press/index.d.ts +9 -0
- package/dist/src/features/gestures/press/types.d.ts +13 -0
- package/dist/src/features/index.d.ts +1 -1
- package/dist/src/features/layout/layout.d.ts +3 -2
- package/dist/src/features/layout/projection.d.ts +7 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/projection/conversion.d.ts +14 -0
- package/dist/src/projection/geometry/delta-apply.d.ts +2 -0
- package/dist/src/projection/geometry/delta-calc.d.ts +2 -0
- package/dist/src/projection/geometry/models.d.ts +3 -0
- package/dist/src/projection/node/types.d.ts +16 -0
- package/dist/src/projection/utils/each-axis.d.ts +3 -0
- package/dist/src/projection/utils/measure.d.ts +3 -0
- package/dist/src/render/utils/setters.d.ts +3 -0
- package/dist/src/state/motion-state.d.ts +6 -3
- package/dist/src/state/utils/is-present.d.ts +2 -0
- package/dist/src/state/utils.d.ts +0 -1
- package/dist/src/types/framer-motion.d.ts +0 -78
- package/dist/src/types/state.d.ts +10 -23
- package/dist/src/utils/clamp.d.ts +1 -0
- package/dist/src/utils/get-context-window.d.ts +2 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/mix/number.d.ts +1 -0
- package/dist/src/utils/noop.d.ts +1 -0
- package/dist/src/utils/progress.d.ts +1 -0
- package/dist/src/utils/time-conversion.d.ts +8 -0
- package/dist/src/value/types/numbers/units.d.ts +30 -0
- package/dist/src/value/use-will-change/add-will-change.d.ts +2 -0
- package/dist/src/value/use-will-change/is.d.ts +2 -0
- package/dist/src/value/use-will-change/types.d.ts +4 -0
- package/package.json +5 -3
- package/dist/es/external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +0 -23
- package/dist/es/external/.pnpm/hey-listen@1.0.8/external/hey-listen/dist/hey-listen.es.mjs +0 -20
- package/dist/es/features/events.mjs +0 -69
- package/dist/es/features/gestures/base.mjs +0 -19
- package/dist/es/features/gestures/hover.mjs +0 -46
- package/dist/es/features/gestures/in-view.mjs +0 -39
- package/dist/es/features/gestures/press.mjs +0 -37
- package/dist/es/utils/events.mjs +0 -8
- package/dist/src/features/events.d.ts +0 -6
- package/dist/src/features/gestures/hover.d.ts +0 -10
- package/dist/src/features/gestures/in-view.d.ts +0 -8
- package/dist/src/features/gestures/press.d.ts +0 -8
- /package/dist/es/{external/.pnpm/framer-motion@11.11.11/external/framer-motion/dist/es/events → events}/add-dom-event.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/sequence.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animate/single-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/easing.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/attach-timeline.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/memo-supports.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-flags.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-linear-easing.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/inertia.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/keyframes.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/is-generator.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/generators/utils/velocity.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/get-value-transition.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-animatable.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-none.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/animation/utils/stagger.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/anticipate.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/back.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/circ.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/ease.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/modifiers/mirror.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/modifiers/reverse.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/steps.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/create-generator-easing.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/easing/utils/is-easing-array.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/batcher.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/index-legacy.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/microtask.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/frameloop/sync-time.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/motion/features/definitions.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/copy.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/models.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/geometry/utils.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/node/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/shared/stack.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/styles/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/projection/utils/measure.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/VisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/handle-window.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/resize/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/supports.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/defaults.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/find.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/number.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/test.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/dom/value-types/type-int.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/render.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/html/utils/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/store.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/path.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/render.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/setters.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/render/utils/variant-props.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/GlobalConfig.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/array.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/clamp.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/delay.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/distance.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/hsla-to-rgba.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-browser.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-numerical-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/is-zero-value-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/memo.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/immediate.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/number.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/mix/visibility.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/default.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/fill.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/offsets/time.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/pipe.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/progress.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/resolve-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/subscription-manager.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/time-conversion.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/velocity-per-second.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/warn-once.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/utils/wrap.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/hex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/hsla.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/rgba.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/color/utils.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/complex/filter.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/complex/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/numbers/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/numbers/units.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/color-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/float-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/is-nullish.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/sanitize.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/use-will-change/is.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/utils/is-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11 → framer-motion@11.15.0}/external/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11/external/framer-motion/dist/es/utils → motion-utils@11.14.3/external/motion-utils/dist/es}/errors.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.11.11/external/framer-motion/dist/es/utils → motion-utils@11.14.3/external/motion-utils/dist/es}/noop.mjs +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
+
const heyListen = require("hey-listen");
|
|
5
|
+
const motionDom = require("motion-dom");
|
|
6
|
+
const noop = (any) => any;
|
|
7
|
+
let warning = noop;
|
|
8
|
+
exports.invariant = noop;
|
|
9
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10
|
+
warning = (check, message) => {
|
|
11
|
+
if (!check && typeof console !== "undefined") {
|
|
12
|
+
console.warn(message);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.invariant = (check, message) => {
|
|
16
|
+
if (!check) {
|
|
17
|
+
throw new Error(message);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
4
21
|
function addUniqueItem$1(arr, item) {
|
|
5
22
|
if (arr.indexOf(item) === -1)
|
|
6
23
|
arr.push(item);
|
|
@@ -52,7 +69,6 @@ const MotionGlobalConfig = {
|
|
|
52
69
|
skipAnimations: false,
|
|
53
70
|
useManualTiming: false
|
|
54
71
|
};
|
|
55
|
-
const noop$1 = (any) => any;
|
|
56
72
|
function createRenderStep(runNextFrame) {
|
|
57
73
|
let thisFrame = /* @__PURE__ */ new Set();
|
|
58
74
|
let nextFrame = /* @__PURE__ */ new Set();
|
|
@@ -102,8 +118,8 @@ function createRenderStep(runNextFrame) {
|
|
|
102
118
|
}
|
|
103
119
|
isProcessing = true;
|
|
104
120
|
[thisFrame, nextFrame] = [nextFrame, thisFrame];
|
|
105
|
-
nextFrame.clear();
|
|
106
121
|
thisFrame.forEach(triggerCallback);
|
|
122
|
+
thisFrame.clear();
|
|
107
123
|
isProcessing = false;
|
|
108
124
|
if (flushNextFrame) {
|
|
109
125
|
flushNextFrame = false;
|
|
@@ -183,7 +199,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
183
199
|
};
|
|
184
200
|
return { schedule, cancel, state: state2, steps: steps2 };
|
|
185
201
|
}
|
|
186
|
-
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop
|
|
202
|
+
const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
187
203
|
let now;
|
|
188
204
|
function clearTime() {
|
|
189
205
|
now = void 0;
|
|
@@ -217,7 +233,7 @@ class MotionValue {
|
|
|
217
233
|
* @internal
|
|
218
234
|
*/
|
|
219
235
|
constructor(init, options = {}) {
|
|
220
|
-
this.version = "11.
|
|
236
|
+
this.version = "11.15.0";
|
|
221
237
|
this.canTrackVelocity = null;
|
|
222
238
|
this.events = {};
|
|
223
239
|
this.updateAndNotify = (v, render = true) => {
|
|
@@ -540,6 +556,9 @@ class GroupPlaybackControls {
|
|
|
540
556
|
runAll(methodName) {
|
|
541
557
|
this.animations.forEach((controls) => controls[methodName]());
|
|
542
558
|
}
|
|
559
|
+
flatten() {
|
|
560
|
+
this.runAll("flatten");
|
|
561
|
+
}
|
|
543
562
|
play() {
|
|
544
563
|
this.runAll("play");
|
|
545
564
|
}
|
|
@@ -553,46 +572,69 @@ class GroupPlaybackControls {
|
|
|
553
572
|
this.runAll("complete");
|
|
554
573
|
}
|
|
555
574
|
}
|
|
556
|
-
const
|
|
557
|
-
const
|
|
575
|
+
const progress$1 = (from, to, value) => {
|
|
576
|
+
const toFromDifference = to - from;
|
|
577
|
+
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
578
|
+
};
|
|
579
|
+
const generateLinearEasing = (easing, duration, resolution = 10) => {
|
|
580
|
+
let points = "";
|
|
581
|
+
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
582
|
+
for (let i = 0; i < numPoints; i++) {
|
|
583
|
+
points += easing(progress$1(0, numPoints - 1, i)) + ", ";
|
|
584
|
+
}
|
|
585
|
+
return `linear(${points.substring(0, points.length - 2)})`;
|
|
586
|
+
};
|
|
587
|
+
const secondsToMilliseconds$1 = (seconds) => seconds * 1e3;
|
|
588
|
+
const millisecondsToSeconds$1 = (milliseconds) => milliseconds / 1e3;
|
|
558
589
|
const velocitySampleDuration = 5;
|
|
559
590
|
function calcGeneratorVelocity(resolveValue, t, current) {
|
|
560
591
|
const prevT = Math.max(t - velocitySampleDuration, 0);
|
|
561
592
|
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
|
562
593
|
}
|
|
563
|
-
|
|
564
|
-
exports.invariant = noop$1;
|
|
565
|
-
if (process.env.NODE_ENV !== "production") {
|
|
566
|
-
exports.warning = (check, message) => {
|
|
567
|
-
if (!check && typeof console !== "undefined") {
|
|
568
|
-
console.warn(message);
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
exports.invariant = (check, message) => {
|
|
572
|
-
if (!check) {
|
|
573
|
-
throw new Error(message);
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
const clamp = (min, max, v) => {
|
|
594
|
+
const clamp$1 = (min, max, v) => {
|
|
578
595
|
if (v > max)
|
|
579
596
|
return max;
|
|
580
597
|
if (v < min)
|
|
581
598
|
return min;
|
|
582
599
|
return v;
|
|
583
600
|
};
|
|
601
|
+
const springDefaults = {
|
|
602
|
+
// Default spring physics
|
|
603
|
+
stiffness: 100,
|
|
604
|
+
damping: 10,
|
|
605
|
+
mass: 1,
|
|
606
|
+
velocity: 0,
|
|
607
|
+
// Default duration/bounce-based options
|
|
608
|
+
duration: 800,
|
|
609
|
+
// in ms
|
|
610
|
+
bounce: 0.3,
|
|
611
|
+
visualDuration: 0.3,
|
|
612
|
+
// in seconds
|
|
613
|
+
// Rest thresholds
|
|
614
|
+
restSpeed: {
|
|
615
|
+
granular: 0.01,
|
|
616
|
+
default: 2
|
|
617
|
+
},
|
|
618
|
+
restDelta: {
|
|
619
|
+
granular: 5e-3,
|
|
620
|
+
default: 0.5
|
|
621
|
+
},
|
|
622
|
+
// Limits
|
|
623
|
+
minDuration: 0.01,
|
|
624
|
+
// in seconds
|
|
625
|
+
maxDuration: 10,
|
|
626
|
+
// in seconds
|
|
627
|
+
minDamping: 0.05,
|
|
628
|
+
maxDamping: 1
|
|
629
|
+
};
|
|
584
630
|
const safeMin = 1e-3;
|
|
585
|
-
|
|
586
|
-
const maxDuration$1 = 10;
|
|
587
|
-
const minDamping = 0.05;
|
|
588
|
-
const maxDamping = 1;
|
|
589
|
-
function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
|
|
631
|
+
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) {
|
|
590
632
|
let envelope;
|
|
591
633
|
let derivative;
|
|
592
|
-
|
|
634
|
+
warning(duration <= secondsToMilliseconds$1(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
|
|
593
635
|
let dampingRatio = 1 - bounce;
|
|
594
|
-
dampingRatio = clamp(minDamping, maxDamping, dampingRatio);
|
|
595
|
-
duration = clamp(minDuration, maxDuration
|
|
636
|
+
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
|
|
637
|
+
duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds$1(duration));
|
|
596
638
|
if (dampingRatio < 1) {
|
|
597
639
|
envelope = (undampedFreq2) => {
|
|
598
640
|
const exponentialDecay = undampedFreq2 * dampingRatio;
|
|
@@ -626,11 +668,11 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
|
|
|
626
668
|
}
|
|
627
669
|
const initialGuess = 5 / duration;
|
|
628
670
|
const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
|
|
629
|
-
duration = secondsToMilliseconds(duration);
|
|
671
|
+
duration = secondsToMilliseconds$1(duration);
|
|
630
672
|
if (isNaN(undampedFreq)) {
|
|
631
673
|
return {
|
|
632
|
-
stiffness:
|
|
633
|
-
damping:
|
|
674
|
+
stiffness: springDefaults.stiffness,
|
|
675
|
+
damping: springDefaults.damping,
|
|
634
676
|
duration
|
|
635
677
|
};
|
|
636
678
|
} else {
|
|
@@ -653,6 +695,17 @@ function approximateRoot(envelope, derivative, initialGuess) {
|
|
|
653
695
|
function calcAngularFreq(undampedFreq, dampingRatio) {
|
|
654
696
|
return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
|
|
655
697
|
}
|
|
698
|
+
const maxGeneratorDuration = 2e4;
|
|
699
|
+
function calcGeneratorDuration(generator) {
|
|
700
|
+
let duration = 0;
|
|
701
|
+
const timeStep = 50;
|
|
702
|
+
let state2 = generator.next(duration);
|
|
703
|
+
while (!state2.done && duration < maxGeneratorDuration) {
|
|
704
|
+
duration += timeStep;
|
|
705
|
+
state2 = generator.next(duration);
|
|
706
|
+
}
|
|
707
|
+
return duration >= maxGeneratorDuration ? Infinity : duration;
|
|
708
|
+
}
|
|
656
709
|
const durationKeys = ["duration", "bounce"];
|
|
657
710
|
const physicsKeys = ["stiffness", "damping", "mass"];
|
|
658
711
|
function isSpringType(options, keys2) {
|
|
@@ -660,39 +713,58 @@ function isSpringType(options, keys2) {
|
|
|
660
713
|
}
|
|
661
714
|
function getSpringOptions(options) {
|
|
662
715
|
let springOptions = {
|
|
663
|
-
velocity:
|
|
664
|
-
stiffness:
|
|
665
|
-
damping:
|
|
666
|
-
mass:
|
|
716
|
+
velocity: springDefaults.velocity,
|
|
717
|
+
stiffness: springDefaults.stiffness,
|
|
718
|
+
damping: springDefaults.damping,
|
|
719
|
+
mass: springDefaults.mass,
|
|
667
720
|
isResolvedFromDuration: false,
|
|
668
721
|
...options
|
|
669
722
|
};
|
|
670
723
|
if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
724
|
+
if (options.visualDuration) {
|
|
725
|
+
const visualDuration = options.visualDuration;
|
|
726
|
+
const root = 2 * Math.PI / (visualDuration * 1.2);
|
|
727
|
+
const stiffness = root * root;
|
|
728
|
+
const damping = 2 * clamp$1(0.05, 1, 1 - options.bounce) * Math.sqrt(stiffness);
|
|
729
|
+
springOptions = {
|
|
730
|
+
...springOptions,
|
|
731
|
+
mass: springDefaults.mass,
|
|
732
|
+
stiffness,
|
|
733
|
+
damping
|
|
734
|
+
};
|
|
735
|
+
} else {
|
|
736
|
+
const derived = findSpring(options);
|
|
737
|
+
springOptions = {
|
|
738
|
+
...springOptions,
|
|
739
|
+
...derived,
|
|
740
|
+
mass: springDefaults.mass
|
|
741
|
+
};
|
|
742
|
+
springOptions.isResolvedFromDuration = true;
|
|
743
|
+
}
|
|
678
744
|
}
|
|
679
745
|
return springOptions;
|
|
680
746
|
}
|
|
681
|
-
function spring(
|
|
682
|
-
const
|
|
683
|
-
|
|
747
|
+
function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {
|
|
748
|
+
const options = typeof optionsOrVisualDuration !== "object" ? {
|
|
749
|
+
visualDuration: optionsOrVisualDuration,
|
|
750
|
+
keyframes: [0, 1],
|
|
751
|
+
bounce
|
|
752
|
+
} : optionsOrVisualDuration;
|
|
753
|
+
let { restSpeed, restDelta } = options;
|
|
754
|
+
const origin = options.keyframes[0];
|
|
755
|
+
const target = options.keyframes[options.keyframes.length - 1];
|
|
684
756
|
const state2 = { done: false, value: origin };
|
|
685
757
|
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
|
|
686
758
|
...options,
|
|
687
|
-
velocity: -millisecondsToSeconds(options.velocity || 0)
|
|
759
|
+
velocity: -millisecondsToSeconds$1(options.velocity || 0)
|
|
688
760
|
});
|
|
689
761
|
const initialVelocity = velocity || 0;
|
|
690
762
|
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
|
|
691
763
|
const initialDelta = target - origin;
|
|
692
|
-
const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));
|
|
764
|
+
const undampedAngularFreq = millisecondsToSeconds$1(Math.sqrt(stiffness / mass));
|
|
693
765
|
const isGranularScale = Math.abs(initialDelta) < 5;
|
|
694
|
-
restSpeed || (restSpeed = isGranularScale ?
|
|
695
|
-
restDelta || (restDelta = isGranularScale ?
|
|
766
|
+
restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default);
|
|
767
|
+
restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default);
|
|
696
768
|
let resolveSpring;
|
|
697
769
|
if (dampingRatio < 1) {
|
|
698
770
|
const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
|
|
@@ -710,14 +782,14 @@ function spring({ keyframes: keyframes2, restDelta, restSpeed, ...options }) {
|
|
|
710
782
|
return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq;
|
|
711
783
|
};
|
|
712
784
|
}
|
|
713
|
-
|
|
785
|
+
const generator = {
|
|
714
786
|
calculatedDuration: isResolvedFromDuration ? duration || null : null,
|
|
715
787
|
next: (t) => {
|
|
716
788
|
const current = resolveSpring(t);
|
|
717
789
|
if (!isResolvedFromDuration) {
|
|
718
790
|
let currentVelocity = 0;
|
|
719
791
|
if (dampingRatio < 1) {
|
|
720
|
-
currentVelocity = t === 0 ? secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
792
|
+
currentVelocity = t === 0 ? secondsToMilliseconds$1(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
721
793
|
}
|
|
722
794
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
|
|
723
795
|
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
@@ -727,19 +799,14 @@ function spring({ keyframes: keyframes2, restDelta, restSpeed, ...options }) {
|
|
|
727
799
|
}
|
|
728
800
|
state2.value = state2.done ? target : current;
|
|
729
801
|
return state2;
|
|
802
|
+
},
|
|
803
|
+
toString: () => {
|
|
804
|
+
const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
|
|
805
|
+
const easing = generateLinearEasing((progress2) => generator.next(calculatedDuration * progress2).value, calculatedDuration, 30);
|
|
806
|
+
return calculatedDuration + "ms " + easing;
|
|
730
807
|
}
|
|
731
808
|
};
|
|
732
|
-
|
|
733
|
-
const maxGeneratorDuration = 2e4;
|
|
734
|
-
function calcGeneratorDuration(generator) {
|
|
735
|
-
let duration = 0;
|
|
736
|
-
const timeStep = 50;
|
|
737
|
-
let state2 = generator.next(duration);
|
|
738
|
-
while (!state2.done && duration < maxGeneratorDuration) {
|
|
739
|
-
duration += timeStep;
|
|
740
|
-
state2 = generator.next(duration);
|
|
741
|
-
}
|
|
742
|
-
return duration >= maxGeneratorDuration ? Infinity : duration;
|
|
809
|
+
return generator;
|
|
743
810
|
}
|
|
744
811
|
function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
745
812
|
const generator = createGenerator({ ...options, keyframes: [0, scale2] });
|
|
@@ -747,21 +814,17 @@ function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
|
747
814
|
return {
|
|
748
815
|
type: "keyframes",
|
|
749
816
|
ease: (progress2) => generator.next(duration * progress2).value / scale2,
|
|
750
|
-
duration: millisecondsToSeconds(duration)
|
|
817
|
+
duration: millisecondsToSeconds$1(duration)
|
|
751
818
|
};
|
|
752
819
|
}
|
|
753
|
-
const mixNumber$
|
|
820
|
+
const mixNumber$2 = (from, to, progress2) => {
|
|
754
821
|
return from + (to - from) * progress2;
|
|
755
822
|
};
|
|
756
|
-
const progress = (from, to, value) => {
|
|
757
|
-
const toFromDifference = to - from;
|
|
758
|
-
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
759
|
-
};
|
|
760
823
|
function fillOffset(offset, remaining) {
|
|
761
824
|
const min = offset[offset.length - 1];
|
|
762
825
|
for (let i = 1; i <= remaining; i++) {
|
|
763
|
-
const offsetProgress = progress(0, remaining, i);
|
|
764
|
-
offset.push(mixNumber$
|
|
826
|
+
const offsetProgress = progress$1(0, remaining, i);
|
|
827
|
+
offset.push(mixNumber$2(min, 1, offsetProgress));
|
|
765
828
|
}
|
|
766
829
|
}
|
|
767
830
|
function defaultOffset$1(arr) {
|
|
@@ -770,31 +833,12 @@ function defaultOffset$1(arr) {
|
|
|
770
833
|
return offset;
|
|
771
834
|
}
|
|
772
835
|
const isMotionValue$1 = (value) => Boolean(value && value.getVelocity);
|
|
773
|
-
function resolveElements(elements, scope, selectorCache) {
|
|
774
|
-
var _a;
|
|
775
|
-
if (typeof elements === "string") {
|
|
776
|
-
let root = document;
|
|
777
|
-
if (scope) {
|
|
778
|
-
exports.invariant(Boolean(scope.current), "Scope provided, but no element detected.");
|
|
779
|
-
root = scope.current;
|
|
780
|
-
}
|
|
781
|
-
if (selectorCache) {
|
|
782
|
-
(_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : selectorCache[elements] = root.querySelectorAll(elements);
|
|
783
|
-
elements = selectorCache[elements];
|
|
784
|
-
} else {
|
|
785
|
-
elements = root.querySelectorAll(elements);
|
|
786
|
-
}
|
|
787
|
-
} else if (elements instanceof Element) {
|
|
788
|
-
elements = [elements];
|
|
789
|
-
}
|
|
790
|
-
return Array.from(elements || []);
|
|
791
|
-
}
|
|
792
836
|
function isDOMKeyframes(keyframes2) {
|
|
793
837
|
return typeof keyframes2 === "object" && !Array.isArray(keyframes2);
|
|
794
838
|
}
|
|
795
839
|
function resolveSubjects(subject, keyframes2, scope, selectorCache) {
|
|
796
840
|
if (typeof subject === "string" && isDOMKeyframes(keyframes2)) {
|
|
797
|
-
return resolveElements(subject, scope, selectorCache);
|
|
841
|
+
return motionDom.resolveElements(subject, scope, selectorCache);
|
|
798
842
|
} else if (subject instanceof NodeList) {
|
|
799
843
|
return Array.from(subject);
|
|
800
844
|
} else if (Array.isArray(subject)) {
|
|
@@ -842,7 +886,7 @@ function addKeyframes(sequence, keyframes2, easing, offset, startTime, endTime)
|
|
|
842
886
|
for (let i = 0; i < keyframes2.length; i++) {
|
|
843
887
|
sequence.push({
|
|
844
888
|
value: keyframes2[i],
|
|
845
|
-
at: mixNumber$
|
|
889
|
+
at: mixNumber$2(startTime, endTime, offset[i]),
|
|
846
890
|
easing: getEasingForSegment(easing, i)
|
|
847
891
|
});
|
|
848
892
|
}
|
|
@@ -858,7 +902,16 @@ function compareByTime(a, b) {
|
|
|
858
902
|
return a.at - b.at;
|
|
859
903
|
}
|
|
860
904
|
}
|
|
905
|
+
function normalizeTimes(times, repeat) {
|
|
906
|
+
for (let i = 0; i < times.length; i++) {
|
|
907
|
+
times[i] = times[i] / (repeat + 1);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
function calculateRepeatDuration(duration, repeat, _repeatDelay) {
|
|
911
|
+
return duration * (repeat + 1);
|
|
912
|
+
}
|
|
861
913
|
const defaultSegmentEasing = "easeInOut";
|
|
914
|
+
const MAX_REPEAT = 20;
|
|
862
915
|
function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators2) {
|
|
863
916
|
const defaultDuration = defaultTransition.duration || 0.3;
|
|
864
917
|
const animationDefinitions = /* @__PURE__ */ new Map();
|
|
@@ -884,7 +937,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
884
937
|
let maxDuration2 = 0;
|
|
885
938
|
const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
|
|
886
939
|
const valueKeyframesAsList = keyframesAsList(valueKeyframes);
|
|
887
|
-
const { delay: delay2 = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", ...remainingTransition } = valueTransition;
|
|
940
|
+
const { delay: delay2 = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
|
|
888
941
|
let { ease: ease2 = defaultTransition.ease || "easeOut", duration } = valueTransition;
|
|
889
942
|
const calculatedDelay = typeof delay2 === "function" ? delay2(elementIndex, numSubjects) : delay2;
|
|
890
943
|
const numKeyframes = valueKeyframesAsList.length;
|
|
@@ -897,7 +950,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
897
950
|
}
|
|
898
951
|
const springTransition = { ...remainingTransition };
|
|
899
952
|
if (duration !== void 0) {
|
|
900
|
-
springTransition.duration = secondsToMilliseconds(duration);
|
|
953
|
+
springTransition.duration = secondsToMilliseconds$1(duration);
|
|
901
954
|
}
|
|
902
955
|
const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
|
|
903
956
|
ease2 = springEasing.ease;
|
|
@@ -905,13 +958,29 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
905
958
|
}
|
|
906
959
|
duration !== null && duration !== void 0 ? duration : duration = defaultDuration;
|
|
907
960
|
const startTime = currentTime + calculatedDelay;
|
|
908
|
-
const targetTime = startTime + duration;
|
|
909
961
|
if (times.length === 1 && times[0] === 0) {
|
|
910
962
|
times[1] = 1;
|
|
911
963
|
}
|
|
912
964
|
const remainder = times.length - valueKeyframesAsList.length;
|
|
913
965
|
remainder > 0 && fillOffset(times, remainder);
|
|
914
966
|
valueKeyframesAsList.length === 1 && valueKeyframesAsList.unshift(null);
|
|
967
|
+
if (repeat) {
|
|
968
|
+
exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
|
|
969
|
+
duration = calculateRepeatDuration(duration, repeat);
|
|
970
|
+
const originalKeyframes = [...valueKeyframesAsList];
|
|
971
|
+
const originalTimes = [...times];
|
|
972
|
+
ease2 = Array.isArray(ease2) ? [...ease2] : [ease2];
|
|
973
|
+
const originalEase = [...ease2];
|
|
974
|
+
for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
|
|
975
|
+
valueKeyframesAsList.push(...originalKeyframes);
|
|
976
|
+
for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
|
|
977
|
+
times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
|
|
978
|
+
ease2.push(keyframeIndex === 0 ? "linear" : getEasingForSegment(originalEase, keyframeIndex - 1));
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
normalizeTimes(times, repeat);
|
|
982
|
+
}
|
|
983
|
+
const targetTime = startTime + duration;
|
|
915
984
|
addKeyframes(valueSequence, valueKeyframesAsList, ease2, times, startTime, targetTime);
|
|
916
985
|
maxDuration2 = Math.max(calculatedDelay + duration, maxDuration2);
|
|
917
986
|
totalDuration = Math.max(targetTime, totalDuration);
|
|
@@ -945,7 +1014,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
945
1014
|
for (let i = 0; i < valueSequence.length; i++) {
|
|
946
1015
|
const { at, value, easing } = valueSequence[i];
|
|
947
1016
|
keyframes2.push(value);
|
|
948
|
-
valueOffset.push(progress(0, totalDuration, at));
|
|
1017
|
+
valueOffset.push(progress$1(0, totalDuration, at));
|
|
949
1018
|
valueEasing.push(easing || "easeOut");
|
|
950
1019
|
}
|
|
951
1020
|
if (valueOffset[0] !== 0) {
|
|
@@ -1075,7 +1144,7 @@ function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
|
|
|
1075
1144
|
}
|
|
1076
1145
|
function cubicBezier(mX1, mY1, mX2, mY2) {
|
|
1077
1146
|
if (mX1 === mY1 && mX2 === mY2)
|
|
1078
|
-
return noop
|
|
1147
|
+
return noop;
|
|
1079
1148
|
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
|
|
1080
1149
|
return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
|
|
1081
1150
|
}
|
|
@@ -1140,26 +1209,26 @@ const number = {
|
|
|
1140
1209
|
};
|
|
1141
1210
|
const alpha = {
|
|
1142
1211
|
...number,
|
|
1143
|
-
transform: (v) => clamp(0, 1, v)
|
|
1212
|
+
transform: (v) => clamp$1(0, 1, v)
|
|
1144
1213
|
};
|
|
1145
1214
|
const scale = {
|
|
1146
1215
|
...number,
|
|
1147
1216
|
default: 1
|
|
1148
1217
|
};
|
|
1149
|
-
const createUnitType = (unit) => ({
|
|
1218
|
+
const createUnitType$1 = (unit) => ({
|
|
1150
1219
|
test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
|
|
1151
1220
|
parse: parseFloat,
|
|
1152
1221
|
transform: (v) => `${v}${unit}`
|
|
1153
1222
|
});
|
|
1154
|
-
const degrees = /* @__PURE__ */ createUnitType("deg");
|
|
1155
|
-
const percent = /* @__PURE__ */ createUnitType("%");
|
|
1156
|
-
const px = /* @__PURE__ */ createUnitType("px");
|
|
1157
|
-
const vh = /* @__PURE__ */ createUnitType("vh");
|
|
1158
|
-
const vw = /* @__PURE__ */ createUnitType("vw");
|
|
1223
|
+
const degrees = /* @__PURE__ */ createUnitType$1("deg");
|
|
1224
|
+
const percent$1 = /* @__PURE__ */ createUnitType$1("%");
|
|
1225
|
+
const px = /* @__PURE__ */ createUnitType$1("px");
|
|
1226
|
+
const vh = /* @__PURE__ */ createUnitType$1("vh");
|
|
1227
|
+
const vw = /* @__PURE__ */ createUnitType$1("vw");
|
|
1159
1228
|
const progressPercentage = {
|
|
1160
|
-
...percent,
|
|
1161
|
-
parse: (v) => percent.parse(v) / 100,
|
|
1162
|
-
transform: (v) => percent.transform(v * 100)
|
|
1229
|
+
...percent$1,
|
|
1230
|
+
parse: (v) => percent$1.parse(v) / 100,
|
|
1231
|
+
transform: (v) => percent$1.transform(v * 100)
|
|
1163
1232
|
};
|
|
1164
1233
|
const positionalKeys = /* @__PURE__ */ new Set([
|
|
1165
1234
|
"width",
|
|
@@ -1222,7 +1291,7 @@ const auto = {
|
|
|
1222
1291
|
test: (v) => v === "auto",
|
|
1223
1292
|
parse: (v) => v
|
|
1224
1293
|
};
|
|
1225
|
-
const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];
|
|
1294
|
+
const dimensionValueTypes = [number, px, percent$1, degrees, vw, vh, auto];
|
|
1226
1295
|
const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));
|
|
1227
1296
|
const toResolve = /* @__PURE__ */ new Set();
|
|
1228
1297
|
let isScheduled = false;
|
|
@@ -1372,7 +1441,7 @@ const splitColor = (aName, bName, cName) => (v) => {
|
|
|
1372
1441
|
alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1
|
|
1373
1442
|
};
|
|
1374
1443
|
};
|
|
1375
|
-
const clampRgbUnit = (v) => clamp(0, 255, v);
|
|
1444
|
+
const clampRgbUnit = (v) => clamp$1(0, 255, v);
|
|
1376
1445
|
const rgbUnit = {
|
|
1377
1446
|
...number,
|
|
1378
1447
|
transform: (v) => Math.round(clampRgbUnit(v))
|
|
@@ -1418,7 +1487,7 @@ const hsla = {
|
|
|
1418
1487
|
test: /* @__PURE__ */ isColorString("hsl", "hue"),
|
|
1419
1488
|
parse: /* @__PURE__ */ splitColor("hue", "saturation", "lightness"),
|
|
1420
1489
|
transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {
|
|
1421
|
-
return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")";
|
|
1490
|
+
return "hsla(" + Math.round(hue) + ", " + percent$1.transform(sanitize(saturation)) + ", " + percent$1.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")";
|
|
1422
1491
|
}
|
|
1423
1492
|
};
|
|
1424
1493
|
const color = {
|
|
@@ -1774,7 +1843,7 @@ function canAnimate(keyframes2, name, type, velocity) {
|
|
|
1774
1843
|
const targetKeyframe = keyframes2[keyframes2.length - 1];
|
|
1775
1844
|
const isOriginAnimatable = isAnimatable(originKeyframe, name);
|
|
1776
1845
|
const isTargetAnimatable = isAnimatable(targetKeyframe, name);
|
|
1777
|
-
|
|
1846
|
+
warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`);
|
|
1778
1847
|
if (!isOriginAnimatable || !isTargetAnimatable) {
|
|
1779
1848
|
return false;
|
|
1780
1849
|
}
|
|
@@ -1862,6 +1931,10 @@ class BaseAnimation {
|
|
|
1862
1931
|
then(resolve, reject) {
|
|
1863
1932
|
return this.currentFinishedPromise.then(resolve, reject);
|
|
1864
1933
|
}
|
|
1934
|
+
flatten() {
|
|
1935
|
+
this.options.type = "keyframes";
|
|
1936
|
+
this.options.ease = "linear";
|
|
1937
|
+
}
|
|
1865
1938
|
updateFinishedPromise() {
|
|
1866
1939
|
this.currentFinishedPromise = new Promise((resolve) => {
|
|
1867
1940
|
this.resolveFinishedPromise = resolve;
|
|
@@ -1935,7 +2008,7 @@ const easeOut = /* @__PURE__ */ cubicBezier(0, 0, 0.58, 1);
|
|
|
1935
2008
|
const easeInOut = /* @__PURE__ */ cubicBezier(0.42, 0, 0.58, 1);
|
|
1936
2009
|
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
|
|
1937
2010
|
const easingLookup = {
|
|
1938
|
-
linear: noop
|
|
2011
|
+
linear: noop,
|
|
1939
2012
|
easeIn,
|
|
1940
2013
|
easeInOut,
|
|
1941
2014
|
easeOut,
|
|
@@ -2008,7 +2081,7 @@ const colorTypes = [hex, rgba, hsla];
|
|
|
2008
2081
|
const getColorType = (v) => colorTypes.find((type) => type.test(v));
|
|
2009
2082
|
function asRGBA(color2) {
|
|
2010
2083
|
const type = getColorType(color2);
|
|
2011
|
-
|
|
2084
|
+
warning(Boolean(type), `'${color2}' is not an animatable color. Use the equivalent color code instead.`);
|
|
2012
2085
|
if (!Boolean(type))
|
|
2013
2086
|
return false;
|
|
2014
2087
|
let model = type.parse(color2);
|
|
@@ -2028,7 +2101,7 @@ const mixColor = (from, to) => {
|
|
|
2028
2101
|
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
|
|
2029
2102
|
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
|
|
2030
2103
|
blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
|
|
2031
|
-
blended.alpha = mixNumber$
|
|
2104
|
+
blended.alpha = mixNumber$2(fromRGBA.alpha, toRGBA.alpha, v);
|
|
2032
2105
|
return rgba.transform(blended);
|
|
2033
2106
|
};
|
|
2034
2107
|
};
|
|
@@ -2040,12 +2113,12 @@ function mixVisibility(origin, target) {
|
|
|
2040
2113
|
return (p) => p >= 1 ? target : origin;
|
|
2041
2114
|
}
|
|
2042
2115
|
}
|
|
2043
|
-
function mixNumber(a, b) {
|
|
2044
|
-
return (p) => mixNumber$
|
|
2116
|
+
function mixNumber$1(a, b) {
|
|
2117
|
+
return (p) => mixNumber$2(a, b, p);
|
|
2045
2118
|
}
|
|
2046
2119
|
function getMixer$1(a) {
|
|
2047
2120
|
if (typeof a === "number") {
|
|
2048
|
-
return mixNumber;
|
|
2121
|
+
return mixNumber$1;
|
|
2049
2122
|
} else if (typeof a === "string") {
|
|
2050
2123
|
return isCSSVariableToken(a) ? mixImmediate : color.test(a) ? mixColor : mixComplex;
|
|
2051
2124
|
} else if (Array.isArray(a)) {
|
|
@@ -2105,13 +2178,13 @@ const mixComplex = (origin, target) => {
|
|
|
2105
2178
|
}
|
|
2106
2179
|
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
|
|
2107
2180
|
} else {
|
|
2108
|
-
|
|
2181
|
+
warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
|
|
2109
2182
|
return mixImmediate(origin, target);
|
|
2110
2183
|
}
|
|
2111
2184
|
};
|
|
2112
2185
|
function mix(from, to, p) {
|
|
2113
2186
|
if (typeof from === "number" && typeof to === "number" && typeof p === "number") {
|
|
2114
|
-
return mixNumber$
|
|
2187
|
+
return mixNumber$2(from, to, p);
|
|
2115
2188
|
}
|
|
2116
2189
|
const mixer = getMixer$1(from);
|
|
2117
2190
|
return mixer(from, to);
|
|
@@ -2123,7 +2196,7 @@ function createMixers(output, ease2, customMixer) {
|
|
|
2123
2196
|
for (let i = 0; i < numMixers; i++) {
|
|
2124
2197
|
let mixer = mixerFactory(output[i], output[i + 1]);
|
|
2125
2198
|
if (ease2) {
|
|
2126
|
-
const easingFunction = Array.isArray(ease2) ? ease2[i] || noop
|
|
2199
|
+
const easingFunction = Array.isArray(ease2) ? ease2[i] || noop : ease2;
|
|
2127
2200
|
mixer = pipe(easingFunction, mixer);
|
|
2128
2201
|
}
|
|
2129
2202
|
mixers.push(mixer);
|
|
@@ -2151,10 +2224,10 @@ function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer
|
|
|
2151
2224
|
break;
|
|
2152
2225
|
}
|
|
2153
2226
|
}
|
|
2154
|
-
const progressInRange = progress(input[i], input[i + 1], v);
|
|
2227
|
+
const progressInRange = progress$1(input[i], input[i + 1], v);
|
|
2155
2228
|
return mixers[i](progressInRange);
|
|
2156
2229
|
};
|
|
2157
|
-
return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator;
|
|
2230
|
+
return isClamp ? (v) => interpolator(clamp$1(input[0], input[inputLength - 1], v)) : interpolator;
|
|
2158
2231
|
}
|
|
2159
2232
|
function convertOffsetToTimes(offset, duration) {
|
|
2160
2233
|
return offset.map((o) => o * duration);
|
|
@@ -2231,6 +2304,12 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2231
2304
|
this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2, element);
|
|
2232
2305
|
this.resolver.scheduleResolve();
|
|
2233
2306
|
}
|
|
2307
|
+
flatten() {
|
|
2308
|
+
super.flatten();
|
|
2309
|
+
if (this._resolved) {
|
|
2310
|
+
Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2234
2313
|
initPlayback(keyframes$1) {
|
|
2235
2314
|
const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = this.options;
|
|
2236
2315
|
const generatorFactory = isGenerator(type) ? type : generators[type] || keyframes;
|
|
@@ -2325,7 +2404,7 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2325
2404
|
frameGenerator = mirroredGenerator;
|
|
2326
2405
|
}
|
|
2327
2406
|
}
|
|
2328
|
-
elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;
|
|
2407
|
+
elapsed = clamp$1(0, 1, iterationProgress) * resolvedDuration;
|
|
2329
2408
|
}
|
|
2330
2409
|
const state2 = isInDelayPhase ? { done: false, value: keyframes2[0] } : frameGenerator.next(elapsed);
|
|
2331
2410
|
if (mapPercentToKeyframes) {
|
|
@@ -2349,13 +2428,13 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2349
2428
|
}
|
|
2350
2429
|
get duration() {
|
|
2351
2430
|
const { resolved } = this;
|
|
2352
|
-
return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
|
|
2431
|
+
return resolved ? millisecondsToSeconds$1(resolved.calculatedDuration) : 0;
|
|
2353
2432
|
}
|
|
2354
2433
|
get time() {
|
|
2355
|
-
return millisecondsToSeconds(this.currentTime);
|
|
2434
|
+
return millisecondsToSeconds$1(this.currentTime);
|
|
2356
2435
|
}
|
|
2357
2436
|
set time(newTime) {
|
|
2358
|
-
newTime = secondsToMilliseconds(newTime);
|
|
2437
|
+
newTime = secondsToMilliseconds$1(newTime);
|
|
2359
2438
|
this.currentTime = newTime;
|
|
2360
2439
|
if (this.holdTime !== null || this.speed === 0) {
|
|
2361
2440
|
this.holdTime = newTime;
|
|
@@ -2370,7 +2449,7 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2370
2449
|
const hasChanged2 = this.playbackSpeed !== newSpeed;
|
|
2371
2450
|
this.playbackSpeed = newSpeed;
|
|
2372
2451
|
if (hasChanged2) {
|
|
2373
|
-
this.time = millisecondsToSeconds(this.currentTime);
|
|
2452
|
+
this.time = millisecondsToSeconds$1(this.currentTime);
|
|
2374
2453
|
}
|
|
2375
2454
|
}
|
|
2376
2455
|
play() {
|
|
@@ -2464,15 +2543,6 @@ const acceleratedValues = /* @__PURE__ */ new Set([
|
|
|
2464
2543
|
// or until we implement support for linear() easing.
|
|
2465
2544
|
// "background-color"
|
|
2466
2545
|
]);
|
|
2467
|
-
const resolution = 10;
|
|
2468
|
-
const generateLinearEasing = (easing, duration) => {
|
|
2469
|
-
let points = "";
|
|
2470
|
-
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
2471
|
-
for (let i = 0; i < numPoints; i++) {
|
|
2472
|
-
points += easing(progress(0, numPoints - 1, i)) + ", ";
|
|
2473
|
-
}
|
|
2474
|
-
return `linear(${points.substring(0, points.length - 2)})`;
|
|
2475
|
-
};
|
|
2476
2546
|
const supportsFlags = {
|
|
2477
2547
|
linearEasing: void 0
|
|
2478
2548
|
};
|
|
@@ -2519,7 +2589,7 @@ function mapEasingToNativeEasing(easing, duration) {
|
|
|
2519
2589
|
return supportedWaapiEasing[easing];
|
|
2520
2590
|
}
|
|
2521
2591
|
}
|
|
2522
|
-
function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2, times } = {}) {
|
|
2592
|
+
function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2 = "easeInOut", times } = {}) {
|
|
2523
2593
|
const keyframeOptions = { [valueName]: keyframes2 };
|
|
2524
2594
|
if (times)
|
|
2525
2595
|
keyframeOptions.offset = times;
|
|
@@ -2632,21 +2702,21 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2632
2702
|
if (!resolved)
|
|
2633
2703
|
return 0;
|
|
2634
2704
|
const { duration } = resolved;
|
|
2635
|
-
return millisecondsToSeconds(duration);
|
|
2705
|
+
return millisecondsToSeconds$1(duration);
|
|
2636
2706
|
}
|
|
2637
2707
|
get time() {
|
|
2638
2708
|
const { resolved } = this;
|
|
2639
2709
|
if (!resolved)
|
|
2640
2710
|
return 0;
|
|
2641
2711
|
const { animation } = resolved;
|
|
2642
|
-
return millisecondsToSeconds(animation.currentTime || 0);
|
|
2712
|
+
return millisecondsToSeconds$1(animation.currentTime || 0);
|
|
2643
2713
|
}
|
|
2644
2714
|
set time(newTime) {
|
|
2645
2715
|
const { resolved } = this;
|
|
2646
2716
|
if (!resolved)
|
|
2647
2717
|
return;
|
|
2648
2718
|
const { animation } = resolved;
|
|
2649
|
-
animation.currentTime = secondsToMilliseconds(newTime);
|
|
2719
|
+
animation.currentTime = secondsToMilliseconds$1(newTime);
|
|
2650
2720
|
}
|
|
2651
2721
|
get speed() {
|
|
2652
2722
|
const { resolved } = this;
|
|
@@ -2686,11 +2756,11 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2686
2756
|
} else {
|
|
2687
2757
|
const { resolved } = this;
|
|
2688
2758
|
if (!resolved)
|
|
2689
|
-
return noop
|
|
2759
|
+
return noop;
|
|
2690
2760
|
const { animation } = resolved;
|
|
2691
2761
|
attachTimeline(animation, timeline);
|
|
2692
2762
|
}
|
|
2693
|
-
return noop
|
|
2763
|
+
return noop;
|
|
2694
2764
|
}
|
|
2695
2765
|
play() {
|
|
2696
2766
|
if (this.isStopped)
|
|
@@ -2736,7 +2806,7 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2736
2806
|
times,
|
|
2737
2807
|
isGenerator: true
|
|
2738
2808
|
});
|
|
2739
|
-
const sampleTime = secondsToMilliseconds(this.time);
|
|
2809
|
+
const sampleTime = secondsToMilliseconds$1(this.time);
|
|
2740
2810
|
motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
2741
2811
|
}
|
|
2742
2812
|
const { onStop } = this.options;
|
|
@@ -2771,7 +2841,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
2771
2841
|
const valueTransition = getValueTransition(transition, name) || {};
|
|
2772
2842
|
const delay2 = valueTransition.delay || transition.delay || 0;
|
|
2773
2843
|
let { elapsed = 0 } = transition;
|
|
2774
|
-
elapsed = elapsed - secondsToMilliseconds(delay2);
|
|
2844
|
+
elapsed = elapsed - secondsToMilliseconds$1(delay2);
|
|
2775
2845
|
let options = {
|
|
2776
2846
|
keyframes: Array.isArray(target) ? target : [null, target],
|
|
2777
2847
|
ease: "easeOut",
|
|
@@ -2797,10 +2867,10 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
2797
2867
|
};
|
|
2798
2868
|
}
|
|
2799
2869
|
if (options.duration) {
|
|
2800
|
-
options.duration = secondsToMilliseconds(options.duration);
|
|
2870
|
+
options.duration = secondsToMilliseconds$1(options.duration);
|
|
2801
2871
|
}
|
|
2802
2872
|
if (options.repeatDelay) {
|
|
2803
|
-
options.repeatDelay = secondsToMilliseconds(options.repeatDelay);
|
|
2873
|
+
options.repeatDelay = secondsToMilliseconds$1(options.repeatDelay);
|
|
2804
2874
|
}
|
|
2805
2875
|
if (options.from !== void 0) {
|
|
2806
2876
|
options.keyframes[0] = options.from;
|
|
@@ -2885,12 +2955,12 @@ const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId
|
|
|
2885
2955
|
function getOptimisedAppearId(visualElement) {
|
|
2886
2956
|
return visualElement.props[optimizedAppearDataAttribute];
|
|
2887
2957
|
}
|
|
2888
|
-
function isWillChangeMotionValue(value) {
|
|
2958
|
+
function isWillChangeMotionValue$1(value) {
|
|
2889
2959
|
return Boolean(isMotionValue$1(value) && value.add);
|
|
2890
2960
|
}
|
|
2891
|
-
function addValueToWillChange(visualElement, key) {
|
|
2961
|
+
function addValueToWillChange$1(visualElement, key) {
|
|
2892
2962
|
const willChange = visualElement.getValue("willChange");
|
|
2893
|
-
if (isWillChangeMotionValue(willChange)) {
|
|
2963
|
+
if (isWillChangeMotionValue$1(willChange)) {
|
|
2894
2964
|
return willChange.add(key);
|
|
2895
2965
|
}
|
|
2896
2966
|
}
|
|
@@ -2927,7 +2997,7 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
|
|
|
2927
2997
|
}
|
|
2928
2998
|
}
|
|
2929
2999
|
}
|
|
2930
|
-
addValueToWillChange(visualElement, key);
|
|
3000
|
+
addValueToWillChange$1(visualElement, key);
|
|
2931
3001
|
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key) ? { type: false } : valueTransition, visualElement, isHandoff));
|
|
2932
3002
|
const animation = value.animation;
|
|
2933
3003
|
if (animation) {
|
|
@@ -3019,7 +3089,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
3019
3089
|
if (isMotionValue$1(nextValue)) {
|
|
3020
3090
|
element.addValue(key, nextValue);
|
|
3021
3091
|
if (process.env.NODE_ENV === "development") {
|
|
3022
|
-
warnOnce(nextValue.version === "11.
|
|
3092
|
+
warnOnce(nextValue.version === "11.15.0", `Attempting to mix Motion versions ${nextValue.version} with 11.15.0 may not work as expected.`);
|
|
3023
3093
|
}
|
|
3024
3094
|
} else if (isMotionValue$1(prevValue)) {
|
|
3025
3095
|
element.addValue(key, motionValue(nextValue, { owner: element }));
|
|
@@ -3081,10 +3151,10 @@ const createDelta = () => ({
|
|
|
3081
3151
|
x: createAxisDelta(),
|
|
3082
3152
|
y: createAxisDelta()
|
|
3083
3153
|
});
|
|
3084
|
-
const createAxis = () => ({ min: 0, max: 0 });
|
|
3085
|
-
const createBox = () => ({
|
|
3086
|
-
x: createAxis(),
|
|
3087
|
-
y: createAxis()
|
|
3154
|
+
const createAxis$1 = () => ({ min: 0, max: 0 });
|
|
3155
|
+
const createBox$1 = () => ({
|
|
3156
|
+
x: createAxis$1(),
|
|
3157
|
+
y: createAxis$1()
|
|
3088
3158
|
});
|
|
3089
3159
|
const propEventHandlers = [
|
|
3090
3160
|
"AnimationStart",
|
|
@@ -3264,7 +3334,7 @@ class VisualElement {
|
|
|
3264
3334
|
* removed with a re-render to work.
|
|
3265
3335
|
*/
|
|
3266
3336
|
measureViewportBox() {
|
|
3267
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox();
|
|
3337
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox$1();
|
|
3268
3338
|
}
|
|
3269
3339
|
getStaticValue(key) {
|
|
3270
3340
|
return this.latestValues[key];
|
|
@@ -3449,6 +3519,20 @@ class DOMVisualElement extends VisualElement {
|
|
|
3449
3519
|
delete vars[key];
|
|
3450
3520
|
delete style2[key];
|
|
3451
3521
|
}
|
|
3522
|
+
handleChildMotionValue() {
|
|
3523
|
+
if (this.childSubscription) {
|
|
3524
|
+
this.childSubscription();
|
|
3525
|
+
delete this.childSubscription;
|
|
3526
|
+
}
|
|
3527
|
+
const { children } = this.props;
|
|
3528
|
+
if (isMotionValue$1(children)) {
|
|
3529
|
+
this.childSubscription = children.on("change", (latest) => {
|
|
3530
|
+
if (this.current) {
|
|
3531
|
+
this.current.textContent = `${latest}`;
|
|
3532
|
+
}
|
|
3533
|
+
});
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3452
3536
|
}
|
|
3453
3537
|
const getValueAsType = (value, type) => {
|
|
3454
3538
|
return type && typeof value === "number" ? type.transform(value) : value;
|
|
@@ -3528,12 +3612,12 @@ function buildHTMLStyles(state2, latestValues, transformTemplate) {
|
|
|
3528
3612
|
style2.transformOrigin = `${originX} ${originY} ${originZ}`;
|
|
3529
3613
|
}
|
|
3530
3614
|
}
|
|
3531
|
-
function calcOrigin(origin, offset, size) {
|
|
3615
|
+
function calcOrigin$1(origin, offset, size) {
|
|
3532
3616
|
return typeof origin === "string" ? origin : px.transform(offset + size * origin);
|
|
3533
3617
|
}
|
|
3534
3618
|
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
3535
|
-
const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
|
|
3536
|
-
const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
|
|
3619
|
+
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width);
|
|
3620
|
+
const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
3537
3621
|
return `${pxOriginX} ${pxOriginY}`;
|
|
3538
3622
|
}
|
|
3539
3623
|
const dashKeys = {
|
|
@@ -3635,7 +3719,7 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
3635
3719
|
super(...arguments);
|
|
3636
3720
|
this.type = "svg";
|
|
3637
3721
|
this.isSVGTag = false;
|
|
3638
|
-
this.measureInstanceViewportBox = createBox;
|
|
3722
|
+
this.measureInstanceViewportBox = createBox$1;
|
|
3639
3723
|
}
|
|
3640
3724
|
getBaseTargetFromProps(props, key) {
|
|
3641
3725
|
return props[key];
|
|
@@ -3662,17 +3746,17 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
3662
3746
|
super.mount(instance);
|
|
3663
3747
|
}
|
|
3664
3748
|
}
|
|
3665
|
-
function convertBoundingBoxToBox({ top, left, right, bottom }) {
|
|
3749
|
+
function convertBoundingBoxToBox$1({ top, left, right, bottom }) {
|
|
3666
3750
|
return {
|
|
3667
3751
|
x: { min: left, max: right },
|
|
3668
3752
|
y: { min: top, max: bottom }
|
|
3669
3753
|
};
|
|
3670
3754
|
}
|
|
3671
|
-
function transformBoxPoints(point2,
|
|
3672
|
-
if (!
|
|
3755
|
+
function transformBoxPoints$1(point2, transformPoint2) {
|
|
3756
|
+
if (!transformPoint2)
|
|
3673
3757
|
return point2;
|
|
3674
|
-
const topLeft =
|
|
3675
|
-
const bottomRight =
|
|
3758
|
+
const topLeft = transformPoint2({ x: point2.left, y: point2.top });
|
|
3759
|
+
const bottomRight = transformPoint2({ x: point2.right, y: point2.bottom });
|
|
3676
3760
|
return {
|
|
3677
3761
|
top: topLeft.y,
|
|
3678
3762
|
left: topLeft.x,
|
|
@@ -3752,20 +3836,20 @@ function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {
|
|
|
3752
3836
|
treeScale.y = 1;
|
|
3753
3837
|
}
|
|
3754
3838
|
}
|
|
3755
|
-
function translateAxis(axis, distance2) {
|
|
3839
|
+
function translateAxis$1(axis, distance2) {
|
|
3756
3840
|
axis.min = axis.min + distance2;
|
|
3757
3841
|
axis.max = axis.max + distance2;
|
|
3758
3842
|
}
|
|
3759
3843
|
function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {
|
|
3760
|
-
const originPoint = mixNumber$
|
|
3844
|
+
const originPoint = mixNumber$2(axis.min, axis.max, axisOrigin);
|
|
3761
3845
|
applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);
|
|
3762
3846
|
}
|
|
3763
3847
|
function transformBox(box, transform2) {
|
|
3764
3848
|
transformAxis(box.x, transform2.x, transform2.scaleX, transform2.scale, transform2.originX);
|
|
3765
3849
|
transformAxis(box.y, transform2.y, transform2.scaleY, transform2.scale, transform2.originY);
|
|
3766
3850
|
}
|
|
3767
|
-
function measureViewportBox(instance,
|
|
3768
|
-
return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(),
|
|
3851
|
+
function measureViewportBox$1(instance, transformPoint2) {
|
|
3852
|
+
return convertBoundingBoxToBox$1(transformBoxPoints$1(instance.getBoundingClientRect(), transformPoint2));
|
|
3769
3853
|
}
|
|
3770
3854
|
function getComputedStyle$1(element) {
|
|
3771
3855
|
return window.getComputedStyle(element);
|
|
@@ -3787,7 +3871,7 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
3787
3871
|
}
|
|
3788
3872
|
}
|
|
3789
3873
|
measureInstanceViewportBox(instance, { transformPagePoint }) {
|
|
3790
|
-
return measureViewportBox(instance, transformPagePoint);
|
|
3874
|
+
return measureViewportBox$1(instance, transformPagePoint);
|
|
3791
3875
|
}
|
|
3792
3876
|
build(renderState, latestValues, props) {
|
|
3793
3877
|
buildHTMLStyles(renderState, latestValues, props.transformTemplate);
|
|
@@ -3795,19 +3879,6 @@ class HTMLVisualElement extends DOMVisualElement {
|
|
|
3795
3879
|
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
3796
3880
|
return scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
3797
3881
|
}
|
|
3798
|
-
handleChildMotionValue() {
|
|
3799
|
-
if (this.childSubscription) {
|
|
3800
|
-
this.childSubscription();
|
|
3801
|
-
delete this.childSubscription;
|
|
3802
|
-
}
|
|
3803
|
-
const { children } = this.props;
|
|
3804
|
-
if (isMotionValue$1(children)) {
|
|
3805
|
-
this.childSubscription = children.on("change", (latest) => {
|
|
3806
|
-
if (this.current)
|
|
3807
|
-
this.current.textContent = `${latest}`;
|
|
3808
|
-
});
|
|
3809
|
-
}
|
|
3810
|
-
}
|
|
3811
3882
|
}
|
|
3812
3883
|
function isObjectKey(key, object) {
|
|
3813
3884
|
return key in object;
|
|
@@ -3833,7 +3904,7 @@ class ObjectVisualElement extends VisualElement {
|
|
|
3833
3904
|
delete renderState.output[key];
|
|
3834
3905
|
}
|
|
3835
3906
|
measureInstanceViewportBox() {
|
|
3836
|
-
return createBox();
|
|
3907
|
+
return createBox$1();
|
|
3837
3908
|
}
|
|
3838
3909
|
build(renderState, latestValues) {
|
|
3839
3910
|
Object.assign(renderState.output, latestValues);
|
|
@@ -3992,7 +4063,7 @@ class NativeAnimation {
|
|
|
3992
4063
|
if (isGenerator(options.type)) {
|
|
3993
4064
|
const generatorOptions = createGeneratorEasing(options, 100, options.type);
|
|
3994
4065
|
options.ease = supportsLinearEasing() ? generatorOptions.ease : defaultEasing;
|
|
3995
|
-
options.duration = secondsToMilliseconds(generatorOptions.duration);
|
|
4066
|
+
options.duration = secondsToMilliseconds$1(generatorOptions.duration);
|
|
3996
4067
|
options.type = "keyframes";
|
|
3997
4068
|
} else {
|
|
3998
4069
|
options.ease = options.ease || defaultEasing;
|
|
@@ -4021,18 +4092,18 @@ class NativeAnimation {
|
|
|
4021
4092
|
}
|
|
4022
4093
|
}
|
|
4023
4094
|
get duration() {
|
|
4024
|
-
return millisecondsToSeconds(this.options.duration || 300);
|
|
4095
|
+
return millisecondsToSeconds$1(this.options.duration || 300);
|
|
4025
4096
|
}
|
|
4026
4097
|
get time() {
|
|
4027
4098
|
var _a;
|
|
4028
4099
|
if (this.animation) {
|
|
4029
|
-
return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
|
|
4100
|
+
return millisecondsToSeconds$1(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
|
|
4030
4101
|
}
|
|
4031
4102
|
return 0;
|
|
4032
4103
|
}
|
|
4033
4104
|
set time(newTime) {
|
|
4034
4105
|
if (this.animation) {
|
|
4035
|
-
this.animation.currentTime = secondsToMilliseconds(newTime);
|
|
4106
|
+
this.animation.currentTime = secondsToMilliseconds$1(newTime);
|
|
4036
4107
|
}
|
|
4037
4108
|
}
|
|
4038
4109
|
get speed() {
|
|
@@ -4049,6 +4120,12 @@ class NativeAnimation {
|
|
|
4049
4120
|
get startTime() {
|
|
4050
4121
|
return this.animation ? this.animation.startTime : null;
|
|
4051
4122
|
}
|
|
4123
|
+
flatten() {
|
|
4124
|
+
var _a;
|
|
4125
|
+
if (!this.animation)
|
|
4126
|
+
return;
|
|
4127
|
+
(_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
|
|
4128
|
+
}
|
|
4052
4129
|
play() {
|
|
4053
4130
|
if (this.state === "finished") {
|
|
4054
4131
|
this.updateFinishedPromise();
|
|
@@ -4096,11 +4173,11 @@ class NativeAnimation {
|
|
|
4096
4173
|
} else {
|
|
4097
4174
|
attachTimeline(this.animation, timeline);
|
|
4098
4175
|
}
|
|
4099
|
-
return noop
|
|
4176
|
+
return noop;
|
|
4100
4177
|
}
|
|
4101
4178
|
}
|
|
4102
4179
|
function animateElements(elementOrSelector, keyframes2, options, scope) {
|
|
4103
|
-
const elements = resolveElements(elementOrSelector, scope);
|
|
4180
|
+
const elements = motionDom.resolveElements(elementOrSelector, scope);
|
|
4104
4181
|
const numElements = elements.length;
|
|
4105
4182
|
exports.invariant(Boolean(numElements), "No valid element provided.");
|
|
4106
4183
|
const animations = [];
|
|
@@ -4113,10 +4190,10 @@ function animateElements(elementOrSelector, keyframes2, options, scope) {
|
|
|
4113
4190
|
for (const valueName in keyframes2) {
|
|
4114
4191
|
const valueKeyframes = keyframes2[valueName];
|
|
4115
4192
|
const valueOptions = {
|
|
4116
|
-
...getValueTransition(
|
|
4193
|
+
...getValueTransition(elementTransition, valueName)
|
|
4117
4194
|
};
|
|
4118
|
-
valueOptions.duration = valueOptions.duration ? secondsToMilliseconds(valueOptions.duration) : valueOptions.duration;
|
|
4119
|
-
valueOptions.delay = secondsToMilliseconds(valueOptions.delay || 0);
|
|
4195
|
+
valueOptions.duration = valueOptions.duration ? secondsToMilliseconds$1(valueOptions.duration) : valueOptions.duration;
|
|
4196
|
+
valueOptions.delay = secondsToMilliseconds$1(valueOptions.delay || 0);
|
|
4120
4197
|
animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
|
|
4121
4198
|
}
|
|
4122
4199
|
}
|
|
@@ -4167,7 +4244,7 @@ function createResizeObserver() {
|
|
|
4167
4244
|
function resizeElement(target, handler) {
|
|
4168
4245
|
if (!observer)
|
|
4169
4246
|
createResizeObserver();
|
|
4170
|
-
const elements = resolveElements(target);
|
|
4247
|
+
const elements = motionDom.resolveElements(target);
|
|
4171
4248
|
elements.forEach((element) => {
|
|
4172
4249
|
let elementHandlers = resizeHandlers.get(element);
|
|
4173
4250
|
if (!elementHandlers) {
|
|
@@ -4254,7 +4331,7 @@ function updateAxisInfo(element, axisName, info, time2) {
|
|
|
4254
4331
|
axis.offset.length = 0;
|
|
4255
4332
|
axis.offset[0] = 0;
|
|
4256
4333
|
axis.offset[1] = axis.scrollLength;
|
|
4257
|
-
axis.progress = progress(0, axis.scrollLength, axis.current);
|
|
4334
|
+
axis.progress = progress$1(0, axis.scrollLength, axis.current);
|
|
4258
4335
|
const elapsed = time2 - prevTime;
|
|
4259
4336
|
axis.velocity = elapsed > maxElapsed ? 0 : velocityPerSecond(axis.current - prev, elapsed);
|
|
4260
4337
|
}
|
|
@@ -4537,6 +4614,7 @@ function scrollFunction(onScroll, options) {
|
|
|
4537
4614
|
}
|
|
4538
4615
|
}
|
|
4539
4616
|
function scrollAnimation(animation, options) {
|
|
4617
|
+
animation.flatten();
|
|
4540
4618
|
if (needsElementTracking(options)) {
|
|
4541
4619
|
animation.pause();
|
|
4542
4620
|
return scrollInfo((info) => {
|
|
@@ -4544,12 +4622,16 @@ function scrollAnimation(animation, options) {
|
|
|
4544
4622
|
}, options);
|
|
4545
4623
|
} else {
|
|
4546
4624
|
const timeline = getTimeline(options);
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4625
|
+
if (animation.attachTimeline) {
|
|
4626
|
+
return animation.attachTimeline(timeline, (valueAnimation) => {
|
|
4627
|
+
valueAnimation.pause();
|
|
4628
|
+
return observeTimeline((progress2) => {
|
|
4629
|
+
valueAnimation.time = valueAnimation.duration * progress2;
|
|
4630
|
+
}, timeline);
|
|
4631
|
+
});
|
|
4632
|
+
} else {
|
|
4633
|
+
return noop;
|
|
4634
|
+
}
|
|
4553
4635
|
}
|
|
4554
4636
|
}
|
|
4555
4637
|
function scroll(onScroll, { axis = "y", ...options } = {}) {
|
|
@@ -4561,7 +4643,7 @@ const thresholds = {
|
|
|
4561
4643
|
all: 1
|
|
4562
4644
|
};
|
|
4563
4645
|
function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) {
|
|
4564
|
-
const elements = resolveElements(elementOrSelector);
|
|
4646
|
+
const elements = motionDom.resolveElements(elementOrSelector);
|
|
4565
4647
|
const activeIntersections = /* @__PURE__ */ new WeakMap();
|
|
4566
4648
|
const onIntersectionChange = (entries) => {
|
|
4567
4649
|
entries.forEach((entry) => {
|
|
@@ -4594,7 +4676,7 @@ function steps(numSteps, direction = "end") {
|
|
|
4594
4676
|
progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3);
|
|
4595
4677
|
const expanded = progress2 * numSteps;
|
|
4596
4678
|
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
|
|
4597
|
-
return clamp(0, 1, rounded / numSteps);
|
|
4679
|
+
return clamp$1(0, 1, rounded / numSteps);
|
|
4598
4680
|
};
|
|
4599
4681
|
}
|
|
4600
4682
|
function getOriginIndex(from, total) {
|
|
@@ -4648,7 +4730,7 @@ function delay(callback, timeout) {
|
|
|
4648
4730
|
return () => cancelFrame(checkElapsed);
|
|
4649
4731
|
}
|
|
4650
4732
|
function delayInSeconds(callback, timeout) {
|
|
4651
|
-
return delay(callback, secondsToMilliseconds(timeout));
|
|
4733
|
+
return delay(callback, secondsToMilliseconds$1(timeout));
|
|
4652
4734
|
}
|
|
4653
4735
|
const distance = (a, b) => Math.abs(a - b);
|
|
4654
4736
|
function distance2D(a, b) {
|
|
@@ -4720,6 +4802,13 @@ function useAnimationFrame(callback) {
|
|
|
4720
4802
|
vue.onUnmounted(() => cancel());
|
|
4721
4803
|
frame.update(provideTimeSinceStart, true);
|
|
4722
4804
|
}
|
|
4805
|
+
const secondsToMilliseconds = (seconds) => seconds * 1e3;
|
|
4806
|
+
function millisecondsToSeconds(milliseconds) {
|
|
4807
|
+
return milliseconds / 1e3;
|
|
4808
|
+
}
|
|
4809
|
+
function getContextWindow({ current }) {
|
|
4810
|
+
return current ? current.ownerDocument.defaultView : null;
|
|
4811
|
+
}
|
|
4723
4812
|
const [injectMotion, provideMotion] = createContext("Motion");
|
|
4724
4813
|
const [injectLayoutGroup, provideLayoutGroup] = createContext("LayoutGroup");
|
|
4725
4814
|
function shouldInheritGroup(inherit) {
|
|
@@ -4766,8 +4855,6 @@ function getOptions(options, key) {
|
|
|
4766
4855
|
function isCssVar(name) {
|
|
4767
4856
|
return name == null ? void 0 : name.startsWith("--");
|
|
4768
4857
|
}
|
|
4769
|
-
function noop() {
|
|
4770
|
-
}
|
|
4771
4858
|
const noopReturn = (v) => v;
|
|
4772
4859
|
function isNumber(value) {
|
|
4773
4860
|
return typeof value === "number";
|
|
@@ -5065,244 +5152,1156 @@ const Primitive = vue.defineComponent({
|
|
|
5065
5152
|
return () => vue.h(Slot, attrs, { default: slots.default });
|
|
5066
5153
|
}
|
|
5067
5154
|
});
|
|
5068
|
-
var warning = function() {
|
|
5069
|
-
};
|
|
5070
|
-
var invariant = function() {
|
|
5071
|
-
};
|
|
5072
|
-
if (process.env.NODE_ENV !== "production") {
|
|
5073
|
-
warning = function(check, message) {
|
|
5074
|
-
if (!check && typeof console !== "undefined") {
|
|
5075
|
-
console.warn(message);
|
|
5076
|
-
}
|
|
5077
|
-
};
|
|
5078
|
-
invariant = function(check, message) {
|
|
5079
|
-
if (!check) {
|
|
5080
|
-
throw new Error(message);
|
|
5081
|
-
}
|
|
5082
|
-
};
|
|
5083
|
-
}
|
|
5084
5155
|
class Feature {
|
|
5085
5156
|
constructor(state2) {
|
|
5086
5157
|
this.state = state2;
|
|
5087
5158
|
}
|
|
5088
|
-
|
|
5089
|
-
}
|
|
5090
|
-
}
|
|
5091
|
-
class EventFeature extends Feature {
|
|
5092
|
-
constructor() {
|
|
5093
|
-
super(...arguments);
|
|
5094
|
-
this.handlers = {};
|
|
5159
|
+
beforeMount() {
|
|
5095
5160
|
}
|
|
5096
5161
|
mount() {
|
|
5097
|
-
const element = this.state.element;
|
|
5098
|
-
if (!element)
|
|
5099
|
-
return;
|
|
5100
|
-
this.handlers.motionstart = (event) => {
|
|
5101
|
-
var _a, _b;
|
|
5102
|
-
const target = event.detail.target;
|
|
5103
|
-
(_b = (_a = this.state.getOptions()).onMotionStart) == null ? void 0 : _b.call(_a, target);
|
|
5104
|
-
};
|
|
5105
|
-
this.handlers.motioncomplete = (event) => {
|
|
5106
|
-
var _a, _b;
|
|
5107
|
-
const target = event.detail.target;
|
|
5108
|
-
(_b = (_a = this.state.getOptions()).onMotionComplete) == null ? void 0 : _b.call(_a, target);
|
|
5109
|
-
};
|
|
5110
|
-
this.handlers.hoverstart = (event) => {
|
|
5111
|
-
var _a, _b;
|
|
5112
|
-
const e = event.detail;
|
|
5113
|
-
(_b = (_a = this.state.getOptions()).onHoverStart) == null ? void 0 : _b.call(_a, e);
|
|
5114
|
-
};
|
|
5115
|
-
this.handlers.hoverend = (event) => {
|
|
5116
|
-
var _a, _b;
|
|
5117
|
-
const e = event.detail;
|
|
5118
|
-
(_b = (_a = this.state.getOptions()).onHoverEnd) == null ? void 0 : _b.call(_a, e);
|
|
5119
|
-
};
|
|
5120
|
-
this.handlers.pressstart = (event) => {
|
|
5121
|
-
var _a, _b;
|
|
5122
|
-
const e = event.detail;
|
|
5123
|
-
(_b = (_a = this.state.getOptions()).onPressStart) == null ? void 0 : _b.call(_a, e);
|
|
5124
|
-
};
|
|
5125
|
-
this.handlers.pressend = (event) => {
|
|
5126
|
-
var _a, _b;
|
|
5127
|
-
const e = event.detail;
|
|
5128
|
-
(_b = (_a = this.state.getOptions()).onPressEnd) == null ? void 0 : _b.call(_a, e);
|
|
5129
|
-
};
|
|
5130
|
-
this.handlers.viewenter = (event) => {
|
|
5131
|
-
var _a, _b;
|
|
5132
|
-
const target = event.detail.target;
|
|
5133
|
-
(_b = (_a = this.state.getOptions()).onViewEnter) == null ? void 0 : _b.call(_a, target);
|
|
5134
|
-
};
|
|
5135
|
-
this.handlers.viewleave = (event) => {
|
|
5136
|
-
var _a, _b;
|
|
5137
|
-
const target = event.detail.target;
|
|
5138
|
-
(_b = (_a = this.state.getOptions()).onViewLeave) == null ? void 0 : _b.call(_a, target);
|
|
5139
|
-
};
|
|
5140
|
-
Object.entries(this.handlers).forEach(([event, handler]) => {
|
|
5141
|
-
element.addEventListener(event, handler);
|
|
5142
|
-
});
|
|
5143
5162
|
}
|
|
5144
5163
|
unmount() {
|
|
5145
|
-
const element = this.state.element;
|
|
5146
|
-
if (!element)
|
|
5147
|
-
return;
|
|
5148
|
-
Object.entries(this.handlers).forEach(([event, handler]) => {
|
|
5149
|
-
if (handler) {
|
|
5150
|
-
element.removeEventListener(event, handler);
|
|
5151
|
-
delete this.handlers[event];
|
|
5152
|
-
}
|
|
5153
|
-
});
|
|
5154
5164
|
}
|
|
5155
|
-
|
|
5156
|
-
function dispatchPointerEvent(element, name, event) {
|
|
5157
|
-
element.dispatchEvent(
|
|
5158
|
-
new CustomEvent(name, { detail: { originalEvent: event } })
|
|
5159
|
-
);
|
|
5160
|
-
}
|
|
5161
|
-
class BaseGesture extends Feature {
|
|
5162
|
-
updateGestureSubscriptions() {
|
|
5163
|
-
const isActive = this.isActive();
|
|
5164
|
-
if (isActive && !this.removeGestureSubscriptions) {
|
|
5165
|
-
this.removeGestureSubscriptions = this.subscribeEvents();
|
|
5166
|
-
} else if (!isActive && this.removeGestureSubscriptions) {
|
|
5167
|
-
this.removeGestureSubscriptions();
|
|
5168
|
-
this.removeGestureSubscriptions = void 0;
|
|
5169
|
-
}
|
|
5165
|
+
update() {
|
|
5170
5166
|
}
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5167
|
+
beforeUpdate() {
|
|
5168
|
+
}
|
|
5169
|
+
beforeUnmount() {
|
|
5174
5170
|
}
|
|
5175
5171
|
}
|
|
5176
|
-
function
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5172
|
+
function handleHoverEvent$1(state2, event, lifecycle) {
|
|
5173
|
+
const props = state2.options;
|
|
5174
|
+
if (props.hover) {
|
|
5175
|
+
state2.setActive("hover", lifecycle === "Start");
|
|
5176
|
+
}
|
|
5177
|
+
const eventName = `onHover${lifecycle}`;
|
|
5178
|
+
const callback = props[eventName];
|
|
5179
|
+
if (callback) {
|
|
5180
|
+
frame.postRender(() => callback(event, extractEventInfo$1(event)));
|
|
5181
|
+
}
|
|
5183
5182
|
}
|
|
5184
|
-
class HoverGesture extends
|
|
5183
|
+
class HoverGesture extends Feature {
|
|
5185
5184
|
isActive() {
|
|
5186
5185
|
return Boolean(this.state.getOptions().hover);
|
|
5187
5186
|
}
|
|
5188
5187
|
constructor(state2) {
|
|
5189
5188
|
super(state2);
|
|
5190
|
-
this.subscribeEvents = () => {
|
|
5191
|
-
const element = this.state.element;
|
|
5192
|
-
const onEnter = mouseEvent(element, "hoverstart", () => {
|
|
5193
|
-
this.state.setActive("hover", true);
|
|
5194
|
-
});
|
|
5195
|
-
const onLeave = mouseEvent(element, "hoverend", () => {
|
|
5196
|
-
var _a;
|
|
5197
|
-
this.state.setActive("hover", false);
|
|
5198
|
-
(_a = this.state.visualElement.variantChildren) == null ? void 0 : _a.forEach((child) => {
|
|
5199
|
-
child.state.setActive("hover", false);
|
|
5200
|
-
});
|
|
5201
|
-
});
|
|
5202
|
-
element.addEventListener("pointerenter", onEnter);
|
|
5203
|
-
element.addEventListener("pointerleave", onLeave);
|
|
5204
|
-
return () => {
|
|
5205
|
-
element.removeEventListener("pointerenter", onEnter);
|
|
5206
|
-
element.removeEventListener("pointerleave", onLeave);
|
|
5207
|
-
};
|
|
5208
|
-
};
|
|
5209
5189
|
}
|
|
5210
5190
|
mount() {
|
|
5211
|
-
this.
|
|
5191
|
+
const element = this.state.element;
|
|
5192
|
+
if (!element)
|
|
5193
|
+
return;
|
|
5194
|
+
this.unmount = motionDom.hover(
|
|
5195
|
+
element,
|
|
5196
|
+
(startEvent) => {
|
|
5197
|
+
handleHoverEvent$1(this.state, startEvent, "Start");
|
|
5198
|
+
return (endEvent) => {
|
|
5199
|
+
handleHoverEvent$1(this.state, endEvent, "End");
|
|
5200
|
+
};
|
|
5201
|
+
}
|
|
5202
|
+
);
|
|
5212
5203
|
}
|
|
5213
|
-
|
|
5214
|
-
|
|
5204
|
+
}
|
|
5205
|
+
function extractEventInfo$1(event) {
|
|
5206
|
+
return {
|
|
5207
|
+
point: {
|
|
5208
|
+
x: event.pageX,
|
|
5209
|
+
y: event.pageY
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
5212
|
+
}
|
|
5213
|
+
function handlePressEvent(state2, event, lifecycle) {
|
|
5214
|
+
const props = state2.options;
|
|
5215
|
+
if (props.press) {
|
|
5216
|
+
state2.setActive("press", lifecycle === "Start");
|
|
5217
|
+
}
|
|
5218
|
+
const eventName = `onPress${lifecycle === "End" ? "" : lifecycle}`;
|
|
5219
|
+
const callback = props[eventName];
|
|
5220
|
+
if (callback) {
|
|
5221
|
+
frame.postRender(() => callback(event, extractEventInfo$1(event)));
|
|
5215
5222
|
}
|
|
5216
5223
|
}
|
|
5217
|
-
class PressGesture extends
|
|
5224
|
+
class PressGesture extends Feature {
|
|
5218
5225
|
isActive() {
|
|
5219
|
-
return Boolean(this.state.
|
|
5226
|
+
return Boolean(this.state.options.press);
|
|
5220
5227
|
}
|
|
5221
5228
|
constructor(state2) {
|
|
5222
5229
|
super(state2);
|
|
5223
|
-
this.subscribeEvents = () => {
|
|
5224
|
-
const element = this.state.element;
|
|
5225
|
-
const onPointerUp = (event) => {
|
|
5226
|
-
this.state.setActive("press", false);
|
|
5227
|
-
dispatchPointerEvent(element, "pressend", event);
|
|
5228
|
-
window.removeEventListener("pointerup", onPointerUp);
|
|
5229
|
-
};
|
|
5230
|
-
const onPointerDown = (event) => {
|
|
5231
|
-
this.state.setActive("press", true);
|
|
5232
|
-
dispatchPointerEvent(element, "pressstart", event);
|
|
5233
|
-
window.addEventListener("pointerup", onPointerUp);
|
|
5234
|
-
};
|
|
5235
|
-
element.addEventListener("pointerdown", onPointerDown);
|
|
5236
|
-
return () => {
|
|
5237
|
-
element.removeEventListener("pointerdown", onPointerDown);
|
|
5238
|
-
window.removeEventListener("pointerup", onPointerUp);
|
|
5239
|
-
};
|
|
5240
|
-
};
|
|
5241
5230
|
}
|
|
5242
5231
|
mount() {
|
|
5243
|
-
this.
|
|
5232
|
+
const element = this.state.element;
|
|
5233
|
+
if (!element)
|
|
5234
|
+
return;
|
|
5235
|
+
this.unmount = motionDom.press(
|
|
5236
|
+
element,
|
|
5237
|
+
(startEvent) => {
|
|
5238
|
+
handlePressEvent(this.state, startEvent, "Start");
|
|
5239
|
+
return (endEvent, { success }) => handlePressEvent(
|
|
5240
|
+
this.state,
|
|
5241
|
+
endEvent,
|
|
5242
|
+
success ? "End" : "Cancel"
|
|
5243
|
+
);
|
|
5244
|
+
},
|
|
5245
|
+
{ useGlobalTarget: this.state.options.globalPressTarget }
|
|
5246
|
+
);
|
|
5244
5247
|
}
|
|
5245
|
-
|
|
5246
|
-
|
|
5248
|
+
}
|
|
5249
|
+
function handleHoverEvent(state2, entry, lifecycle) {
|
|
5250
|
+
const props = state2.options;
|
|
5251
|
+
if (props.inView) {
|
|
5252
|
+
state2.setActive("inView", lifecycle === "Enter");
|
|
5253
|
+
}
|
|
5254
|
+
const eventName = `onViewport${lifecycle}`;
|
|
5255
|
+
const callback = props[eventName];
|
|
5256
|
+
if (callback) {
|
|
5257
|
+
frame.postRender(() => callback(entry));
|
|
5247
5258
|
}
|
|
5248
5259
|
}
|
|
5249
|
-
class InViewGesture extends
|
|
5260
|
+
class InViewGesture extends Feature {
|
|
5250
5261
|
isActive() {
|
|
5251
5262
|
return Boolean(this.state.getOptions().inView);
|
|
5252
5263
|
}
|
|
5253
5264
|
constructor(state2) {
|
|
5254
5265
|
super(state2);
|
|
5255
|
-
this.subscribeEvents = () => {
|
|
5256
|
-
var _a;
|
|
5257
|
-
const element = this.state.element;
|
|
5258
|
-
const { once, ...viewOptions } = ((_a = this.state.getOptions()) == null ? void 0 : _a.inViewOptions) || {};
|
|
5259
|
-
return inView(element, (enterEntry) => {
|
|
5260
|
-
var _a2;
|
|
5261
|
-
this.state.setActive("inView", true);
|
|
5262
|
-
(_a2 = this.state.visualElement.variantChildren) == null ? void 0 : _a2.forEach((child) => {
|
|
5263
|
-
child.state.setActive("inView", true);
|
|
5264
|
-
});
|
|
5265
|
-
dispatchPointerEvent(element, "viewenter", enterEntry);
|
|
5266
|
-
if (!once) {
|
|
5267
|
-
return (leaveEntry) => {
|
|
5268
|
-
this.state.setActive("inView", false);
|
|
5269
|
-
dispatchPointerEvent(element, "viewleave", leaveEntry);
|
|
5270
|
-
};
|
|
5271
|
-
}
|
|
5272
|
-
}, viewOptions);
|
|
5273
|
-
};
|
|
5274
|
-
}
|
|
5275
|
-
mount() {
|
|
5276
|
-
this.updateGestureSubscriptions();
|
|
5277
|
-
}
|
|
5278
|
-
update() {
|
|
5279
|
-
this.updateGestureSubscriptions();
|
|
5280
5266
|
}
|
|
5281
|
-
}
|
|
5282
|
-
function isSVGElement(element) {
|
|
5283
|
-
return element instanceof SVGElement && element.tagName !== "svg";
|
|
5284
|
-
}
|
|
5285
|
-
class SVGFeature extends Feature {
|
|
5286
5267
|
mount() {
|
|
5287
|
-
const
|
|
5288
|
-
if (!
|
|
5268
|
+
const element = this.state.element;
|
|
5269
|
+
if (!element)
|
|
5289
5270
|
return;
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
visualElement.renderState.dimensions = {
|
|
5297
|
-
x: 0,
|
|
5298
|
-
y: 0,
|
|
5299
|
-
width: 0,
|
|
5300
|
-
height: 0
|
|
5271
|
+
this.unmount = inView(
|
|
5272
|
+
element,
|
|
5273
|
+
(entry) => {
|
|
5274
|
+
handleHoverEvent(this.state, entry, "Enter");
|
|
5275
|
+
return (endEvent) => {
|
|
5276
|
+
handleHoverEvent(this.state, entry, "Leave");
|
|
5301
5277
|
};
|
|
5302
5278
|
}
|
|
5303
|
-
|
|
5304
|
-
}
|
|
5305
|
-
|
|
5279
|
+
);
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
function isPrimaryPointer(event) {
|
|
5283
|
+
if (event.pointerType === "mouse") {
|
|
5284
|
+
return typeof event.button !== "number" || event.button <= 0;
|
|
5285
|
+
} else {
|
|
5286
|
+
return event.isPrimary !== false;
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
function addPointerEvent(target, eventName, handler, options) {
|
|
5290
|
+
return addDomEvent$1(target, eventName, addPointerInfo(handler), options);
|
|
5291
|
+
}
|
|
5292
|
+
function extractEventInfo(event, pointType = "page") {
|
|
5293
|
+
return {
|
|
5294
|
+
point: {
|
|
5295
|
+
x: event[`${pointType}X`],
|
|
5296
|
+
y: event[`${pointType}Y`]
|
|
5297
|
+
}
|
|
5298
|
+
};
|
|
5299
|
+
}
|
|
5300
|
+
function addPointerInfo(handler) {
|
|
5301
|
+
return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
|
|
5302
|
+
}
|
|
5303
|
+
function addDomEvent$1(target, eventName, handler, options = { passive: true }) {
|
|
5304
|
+
target.addEventListener(eventName, handler, options);
|
|
5305
|
+
return () => target.removeEventListener(eventName, handler);
|
|
5306
|
+
}
|
|
5307
|
+
function createLock(name) {
|
|
5308
|
+
let lock = null;
|
|
5309
|
+
return () => {
|
|
5310
|
+
const openLock = () => {
|
|
5311
|
+
lock = null;
|
|
5312
|
+
};
|
|
5313
|
+
if (lock === null) {
|
|
5314
|
+
lock = name;
|
|
5315
|
+
return openLock;
|
|
5316
|
+
}
|
|
5317
|
+
return false;
|
|
5318
|
+
};
|
|
5319
|
+
}
|
|
5320
|
+
const globalHorizontalLock = createLock("dragHorizontal");
|
|
5321
|
+
const globalVerticalLock = createLock("dragVertical");
|
|
5322
|
+
function getGlobalLock(drag) {
|
|
5323
|
+
let lock = false;
|
|
5324
|
+
if (drag === "y") {
|
|
5325
|
+
lock = globalVerticalLock();
|
|
5326
|
+
} else if (drag === "x") {
|
|
5327
|
+
lock = globalHorizontalLock();
|
|
5328
|
+
} else {
|
|
5329
|
+
const openHorizontal = globalHorizontalLock();
|
|
5330
|
+
const openVertical = globalVerticalLock();
|
|
5331
|
+
if (openHorizontal && openVertical) {
|
|
5332
|
+
lock = () => {
|
|
5333
|
+
openHorizontal();
|
|
5334
|
+
openVertical();
|
|
5335
|
+
};
|
|
5336
|
+
} else {
|
|
5337
|
+
if (openHorizontal)
|
|
5338
|
+
openHorizontal();
|
|
5339
|
+
if (openVertical)
|
|
5340
|
+
openVertical();
|
|
5341
|
+
}
|
|
5342
|
+
}
|
|
5343
|
+
return lock;
|
|
5344
|
+
}
|
|
5345
|
+
function calcLength$1(axis) {
|
|
5346
|
+
return axis.max - axis.min;
|
|
5347
|
+
}
|
|
5348
|
+
function clamp(min, max, v) {
|
|
5349
|
+
if (v > max)
|
|
5350
|
+
return max;
|
|
5351
|
+
if (v < min)
|
|
5352
|
+
return min;
|
|
5353
|
+
return v;
|
|
5354
|
+
}
|
|
5355
|
+
function mixNumber(from, to, progress2) {
|
|
5356
|
+
return from + (to - from) * progress2;
|
|
5357
|
+
}
|
|
5358
|
+
function progress(from, to, value) {
|
|
5359
|
+
const toFromDifference = to - from;
|
|
5360
|
+
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
5361
|
+
}
|
|
5362
|
+
function applyConstraints(point2, { min, max }, elastic) {
|
|
5363
|
+
if (min !== void 0 && point2 < min) {
|
|
5364
|
+
point2 = elastic ? mixNumber(min, point2, elastic.min) : Math.max(point2, min);
|
|
5365
|
+
} else if (max !== void 0 && point2 > max) {
|
|
5366
|
+
point2 = elastic ? mixNumber(max, point2, elastic.max) : Math.min(point2, max);
|
|
5367
|
+
}
|
|
5368
|
+
return point2;
|
|
5369
|
+
}
|
|
5370
|
+
const defaultElastic = 0.35;
|
|
5371
|
+
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
5372
|
+
return {
|
|
5373
|
+
x: calcRelativeAxisConstraints(layoutBox.x, left, right),
|
|
5374
|
+
y: calcRelativeAxisConstraints(layoutBox.y, top, bottom)
|
|
5375
|
+
};
|
|
5376
|
+
}
|
|
5377
|
+
function calcRelativeAxisConstraints(axis, min, max) {
|
|
5378
|
+
return {
|
|
5379
|
+
min: min !== void 0 ? axis.min + min : void 0,
|
|
5380
|
+
max: max !== void 0 ? axis.max + max - (axis.max - axis.min) : void 0
|
|
5381
|
+
};
|
|
5382
|
+
}
|
|
5383
|
+
function resolveDragElastic(dragElastic = defaultElastic) {
|
|
5384
|
+
if (dragElastic === false) {
|
|
5385
|
+
dragElastic = 0;
|
|
5386
|
+
} else if (dragElastic === true) {
|
|
5387
|
+
dragElastic = defaultElastic;
|
|
5388
|
+
}
|
|
5389
|
+
return {
|
|
5390
|
+
x: resolveAxisElastic(dragElastic, "left", "right"),
|
|
5391
|
+
y: resolveAxisElastic(dragElastic, "top", "bottom")
|
|
5392
|
+
};
|
|
5393
|
+
}
|
|
5394
|
+
function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
|
|
5395
|
+
return {
|
|
5396
|
+
min: resolvePointElastic(dragElastic, minLabel),
|
|
5397
|
+
max: resolvePointElastic(dragElastic, maxLabel)
|
|
5398
|
+
};
|
|
5399
|
+
}
|
|
5400
|
+
function resolvePointElastic(dragElastic, label) {
|
|
5401
|
+
return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0;
|
|
5402
|
+
}
|
|
5403
|
+
function rebaseAxisConstraints(layout, constraints) {
|
|
5404
|
+
const relativeConstraints = {};
|
|
5405
|
+
if (constraints.min !== void 0) {
|
|
5406
|
+
relativeConstraints.min = constraints.min - layout.min;
|
|
5407
|
+
}
|
|
5408
|
+
if (constraints.max !== void 0) {
|
|
5409
|
+
relativeConstraints.max = constraints.max - layout.min;
|
|
5410
|
+
}
|
|
5411
|
+
return relativeConstraints;
|
|
5412
|
+
}
|
|
5413
|
+
function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
5414
|
+
return {
|
|
5415
|
+
x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
|
|
5416
|
+
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
|
|
5417
|
+
};
|
|
5418
|
+
}
|
|
5419
|
+
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
|
|
5420
|
+
let min = constraintsAxis.min - layoutAxis.min;
|
|
5421
|
+
let max = constraintsAxis.max - layoutAxis.max;
|
|
5422
|
+
if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) {
|
|
5423
|
+
[min, max] = [max, min];
|
|
5424
|
+
}
|
|
5425
|
+
return { min, max };
|
|
5426
|
+
}
|
|
5427
|
+
function calcOrigin(source, target) {
|
|
5428
|
+
let origin = 0.5;
|
|
5429
|
+
const sourceLength = calcLength$1(source);
|
|
5430
|
+
const targetLength = calcLength$1(target);
|
|
5431
|
+
if (targetLength > sourceLength) {
|
|
5432
|
+
origin = progress(target.min, target.max - sourceLength, source.min);
|
|
5433
|
+
} else if (sourceLength > targetLength) {
|
|
5434
|
+
origin = progress(source.min, source.max - targetLength, target.min);
|
|
5435
|
+
}
|
|
5436
|
+
return clamp(0, 1, origin);
|
|
5437
|
+
}
|
|
5438
|
+
function isHTMLElement(value) {
|
|
5439
|
+
return typeof value === "object" && value !== null && "nodeType" in value;
|
|
5440
|
+
}
|
|
5441
|
+
class PanSession {
|
|
5442
|
+
constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {
|
|
5443
|
+
this.startEvent = null;
|
|
5444
|
+
this.lastMoveEvent = null;
|
|
5445
|
+
this.lastMoveEventInfo = null;
|
|
5446
|
+
this.handlers = {};
|
|
5447
|
+
this.contextWindow = window;
|
|
5448
|
+
this.updatePoint = () => {
|
|
5449
|
+
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
5450
|
+
return;
|
|
5451
|
+
const info2 = getPanInfo(this.lastMoveEventInfo, this.history);
|
|
5452
|
+
const isPanStarted = this.startEvent !== null;
|
|
5453
|
+
const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3;
|
|
5454
|
+
if (!isPanStarted && !isDistancePastThreshold)
|
|
5455
|
+
return;
|
|
5456
|
+
const { point: point3 } = info2;
|
|
5457
|
+
const { timestamp: timestamp2 } = frameData;
|
|
5458
|
+
this.history.push({ ...point3, timestamp: timestamp2 });
|
|
5459
|
+
const { onStart, onMove } = this.handlers;
|
|
5460
|
+
if (!isPanStarted) {
|
|
5461
|
+
onStart && onStart(this.lastMoveEvent, info2);
|
|
5462
|
+
this.startEvent = this.lastMoveEvent;
|
|
5463
|
+
}
|
|
5464
|
+
onMove && onMove(this.lastMoveEvent, info2);
|
|
5465
|
+
};
|
|
5466
|
+
this.handlePointerMove = (event2, info2) => {
|
|
5467
|
+
this.lastMoveEvent = event2;
|
|
5468
|
+
this.lastMoveEventInfo = transformPoint(info2, this.transformPagePoint);
|
|
5469
|
+
frame.update(this.updatePoint, true);
|
|
5470
|
+
};
|
|
5471
|
+
this.handlePointerUp = (event2, info2) => {
|
|
5472
|
+
this.end();
|
|
5473
|
+
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
|
|
5474
|
+
if (this.dragSnapToOrigin)
|
|
5475
|
+
resumeAnimation && resumeAnimation();
|
|
5476
|
+
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
5477
|
+
return;
|
|
5478
|
+
const panInfo = getPanInfo(
|
|
5479
|
+
event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint),
|
|
5480
|
+
this.history
|
|
5481
|
+
);
|
|
5482
|
+
if (this.startEvent && onEnd) {
|
|
5483
|
+
onEnd(event2, panInfo);
|
|
5484
|
+
}
|
|
5485
|
+
onSessionEnd && onSessionEnd(event2, panInfo);
|
|
5486
|
+
};
|
|
5487
|
+
if (!isPrimaryPointer(event))
|
|
5488
|
+
return;
|
|
5489
|
+
this.dragSnapToOrigin = dragSnapToOrigin;
|
|
5490
|
+
this.handlers = handlers;
|
|
5491
|
+
this.transformPagePoint = transformPagePoint;
|
|
5492
|
+
this.contextWindow = contextWindow || window;
|
|
5493
|
+
const info = extractEventInfo(event);
|
|
5494
|
+
const initialInfo = transformPoint(info, this.transformPagePoint);
|
|
5495
|
+
const { point: point2 } = initialInfo;
|
|
5496
|
+
const { timestamp } = frameData;
|
|
5497
|
+
this.history = [{ ...point2, timestamp }];
|
|
5498
|
+
const { onSessionStart } = handlers;
|
|
5499
|
+
onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
|
|
5500
|
+
this.removeListeners = pipe(
|
|
5501
|
+
addPointerEvent(
|
|
5502
|
+
this.contextWindow,
|
|
5503
|
+
"pointermove",
|
|
5504
|
+
this.handlePointerMove
|
|
5505
|
+
),
|
|
5506
|
+
addPointerEvent(
|
|
5507
|
+
this.contextWindow,
|
|
5508
|
+
"pointerup",
|
|
5509
|
+
this.handlePointerUp
|
|
5510
|
+
),
|
|
5511
|
+
addPointerEvent(
|
|
5512
|
+
this.contextWindow,
|
|
5513
|
+
"pointercancel",
|
|
5514
|
+
this.handlePointerUp
|
|
5515
|
+
)
|
|
5516
|
+
);
|
|
5517
|
+
}
|
|
5518
|
+
updateHandlers(handlers) {
|
|
5519
|
+
this.handlers = handlers;
|
|
5520
|
+
}
|
|
5521
|
+
end() {
|
|
5522
|
+
this.removeListeners && this.removeListeners();
|
|
5523
|
+
cancelFrame(this.updatePoint);
|
|
5524
|
+
}
|
|
5525
|
+
}
|
|
5526
|
+
function transformPoint(info, transformPagePoint) {
|
|
5527
|
+
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
|
|
5528
|
+
}
|
|
5529
|
+
function subtractPoint(a, b) {
|
|
5530
|
+
return { x: a.x - b.x, y: a.y - b.y };
|
|
5531
|
+
}
|
|
5532
|
+
function getPanInfo({ point: point2 }, history) {
|
|
5533
|
+
return {
|
|
5534
|
+
point: point2,
|
|
5535
|
+
delta: subtractPoint(point2, lastDevicePoint(history)),
|
|
5536
|
+
offset: subtractPoint(point2, startDevicePoint(history)),
|
|
5537
|
+
velocity: getVelocity(history, 0.1)
|
|
5538
|
+
};
|
|
5539
|
+
}
|
|
5540
|
+
function startDevicePoint(history) {
|
|
5541
|
+
return history[0];
|
|
5542
|
+
}
|
|
5543
|
+
function lastDevicePoint(history) {
|
|
5544
|
+
return history[history.length - 1];
|
|
5545
|
+
}
|
|
5546
|
+
function getVelocity(history, timeDelta) {
|
|
5547
|
+
if (history.length < 2) {
|
|
5548
|
+
return { x: 0, y: 0 };
|
|
5549
|
+
}
|
|
5550
|
+
let i = history.length - 1;
|
|
5551
|
+
let timestampedPoint = null;
|
|
5552
|
+
const lastPoint = lastDevicePoint(history);
|
|
5553
|
+
while (i >= 0) {
|
|
5554
|
+
timestampedPoint = history[i];
|
|
5555
|
+
if (lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta)) {
|
|
5556
|
+
break;
|
|
5557
|
+
}
|
|
5558
|
+
i--;
|
|
5559
|
+
}
|
|
5560
|
+
if (!timestampedPoint) {
|
|
5561
|
+
return { x: 0, y: 0 };
|
|
5562
|
+
}
|
|
5563
|
+
const time2 = millisecondsToSeconds(
|
|
5564
|
+
lastPoint.timestamp - timestampedPoint.timestamp
|
|
5565
|
+
);
|
|
5566
|
+
if (time2 === 0) {
|
|
5567
|
+
return { x: 0, y: 0 };
|
|
5568
|
+
}
|
|
5569
|
+
const currentVelocity = {
|
|
5570
|
+
x: (lastPoint.x - timestampedPoint.x) / time2,
|
|
5571
|
+
y: (lastPoint.y - timestampedPoint.y) / time2
|
|
5572
|
+
};
|
|
5573
|
+
if (currentVelocity.x === Infinity) {
|
|
5574
|
+
currentVelocity.x = 0;
|
|
5575
|
+
}
|
|
5576
|
+
if (currentVelocity.y === Infinity) {
|
|
5577
|
+
currentVelocity.y = 0;
|
|
5578
|
+
}
|
|
5579
|
+
return currentVelocity;
|
|
5580
|
+
}
|
|
5581
|
+
const createAxis = () => ({ min: 0, max: 0 });
|
|
5582
|
+
function createBox() {
|
|
5583
|
+
return {
|
|
5584
|
+
x: createAxis(),
|
|
5585
|
+
y: createAxis()
|
|
5586
|
+
};
|
|
5587
|
+
}
|
|
5588
|
+
function eachAxis$1(callback) {
|
|
5589
|
+
return [callback("x"), callback("y")];
|
|
5590
|
+
}
|
|
5591
|
+
function createUnitType(unit) {
|
|
5592
|
+
return {
|
|
5593
|
+
test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
|
|
5594
|
+
parse: parseFloat,
|
|
5595
|
+
transform: (v) => `${v}${unit}`
|
|
5596
|
+
};
|
|
5597
|
+
}
|
|
5598
|
+
const percent = /* @__PURE__ */ createUnitType("%");
|
|
5599
|
+
function isWillChangeMotionValue(value) {
|
|
5600
|
+
return Boolean(isMotionValue(value) && value.add);
|
|
5601
|
+
}
|
|
5602
|
+
function addValueToWillChange(visualElement, key) {
|
|
5603
|
+
const willChange = visualElement.getValue("willChange");
|
|
5604
|
+
if (isWillChangeMotionValue(willChange)) {
|
|
5605
|
+
return willChange.add(key);
|
|
5606
|
+
}
|
|
5607
|
+
}
|
|
5608
|
+
function convertBoundingBoxToBox({
|
|
5609
|
+
top,
|
|
5610
|
+
left,
|
|
5611
|
+
right,
|
|
5612
|
+
bottom
|
|
5613
|
+
}) {
|
|
5614
|
+
return {
|
|
5615
|
+
x: { min: left, max: right },
|
|
5616
|
+
y: { min: top, max: bottom }
|
|
5617
|
+
};
|
|
5618
|
+
}
|
|
5619
|
+
function transformBoxPoints(point2, transformPoint2) {
|
|
5620
|
+
if (!transformPoint2)
|
|
5621
|
+
return point2;
|
|
5622
|
+
const topLeft = transformPoint2({ x: point2.left, y: point2.top });
|
|
5623
|
+
const bottomRight = transformPoint2({ x: point2.right, y: point2.bottom });
|
|
5624
|
+
return {
|
|
5625
|
+
top: topLeft.y,
|
|
5626
|
+
left: topLeft.x,
|
|
5627
|
+
bottom: bottomRight.y,
|
|
5628
|
+
right: bottomRight.x
|
|
5629
|
+
};
|
|
5630
|
+
}
|
|
5631
|
+
function convertBoxToBoundingBox({ x, y }) {
|
|
5632
|
+
return { top: y.min, right: x.max, bottom: y.max, left: x.min };
|
|
5633
|
+
}
|
|
5634
|
+
function translateAxis(axis, distance2) {
|
|
5635
|
+
axis.min = axis.min + distance2;
|
|
5636
|
+
axis.max = axis.max + distance2;
|
|
5637
|
+
}
|
|
5638
|
+
function measureViewportBox(instance, transformPoint2) {
|
|
5639
|
+
return convertBoundingBoxToBox(
|
|
5640
|
+
transformBoxPoints(instance.getBoundingClientRect(), transformPoint2)
|
|
5641
|
+
);
|
|
5642
|
+
}
|
|
5643
|
+
function measurePageBox(element, rootProjectionNode2, transformPagePoint) {
|
|
5644
|
+
const viewportBox = measureViewportBox(element, transformPagePoint);
|
|
5645
|
+
const { scroll: scroll2 } = rootProjectionNode2;
|
|
5646
|
+
if (scroll2) {
|
|
5647
|
+
translateAxis(viewportBox.x, scroll2.offset.x);
|
|
5648
|
+
translateAxis(viewportBox.y, scroll2.offset.y);
|
|
5649
|
+
}
|
|
5650
|
+
return viewportBox;
|
|
5651
|
+
}
|
|
5652
|
+
const doneCallbacks = /* @__PURE__ */ new WeakMap();
|
|
5653
|
+
vue.ref(/* @__PURE__ */ new WeakMap());
|
|
5654
|
+
function removeDoneCallback(element) {
|
|
5655
|
+
const prevDoneCallback = doneCallbacks.get(element);
|
|
5656
|
+
if (prevDoneCallback) {
|
|
5657
|
+
element.removeEventListener("motioncomplete", prevDoneCallback);
|
|
5658
|
+
}
|
|
5659
|
+
doneCallbacks.delete(element);
|
|
5660
|
+
}
|
|
5661
|
+
const [injectAnimatePresence, provideAnimatePresence] = createContext("AnimatePresenceContext");
|
|
5662
|
+
function isPresent(visualElement) {
|
|
5663
|
+
return !doneCallbacks.has(visualElement.current);
|
|
5664
|
+
}
|
|
5665
|
+
const elementDragControls = /* @__PURE__ */ new WeakMap();
|
|
5666
|
+
class VisualElementDragControls {
|
|
5667
|
+
constructor(visualElement) {
|
|
5668
|
+
this.openGlobalLock = null;
|
|
5669
|
+
this.isDragging = false;
|
|
5670
|
+
this.currentDirection = null;
|
|
5671
|
+
this.originPoint = { x: 0, y: 0 };
|
|
5672
|
+
this.constraints = false;
|
|
5673
|
+
this.hasMutatedConstraints = false;
|
|
5674
|
+
this.elastic = createBox();
|
|
5675
|
+
this.visualElement = visualElement;
|
|
5676
|
+
}
|
|
5677
|
+
start(originEvent, { snapToCursor = false } = {}) {
|
|
5678
|
+
if (!isPresent(this.visualElement))
|
|
5679
|
+
return;
|
|
5680
|
+
const onSessionStart = (event) => {
|
|
5681
|
+
const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps();
|
|
5682
|
+
dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation();
|
|
5683
|
+
if (snapToCursor) {
|
|
5684
|
+
this.snapToCursor(extractEventInfo(event, "page").point);
|
|
5685
|
+
}
|
|
5686
|
+
};
|
|
5687
|
+
const onStart = (event, info) => {
|
|
5688
|
+
const { drag, dragPropagation, onDragStart } = this.getProps();
|
|
5689
|
+
if (drag && !dragPropagation) {
|
|
5690
|
+
if (this.openGlobalLock)
|
|
5691
|
+
this.openGlobalLock();
|
|
5692
|
+
this.openGlobalLock = getGlobalLock(drag);
|
|
5693
|
+
if (!this.openGlobalLock)
|
|
5694
|
+
return;
|
|
5695
|
+
}
|
|
5696
|
+
this.isDragging = true;
|
|
5697
|
+
this.currentDirection = null;
|
|
5698
|
+
this.resolveConstraints();
|
|
5699
|
+
if (this.visualElement.projection) {
|
|
5700
|
+
this.visualElement.projection.isAnimationBlocked = true;
|
|
5701
|
+
this.visualElement.projection.target = void 0;
|
|
5702
|
+
}
|
|
5703
|
+
eachAxis$1((axis) => {
|
|
5704
|
+
let current = this.getAxisMotionValue(axis).get() || 0;
|
|
5705
|
+
if (percent.test(current)) {
|
|
5706
|
+
const { projection } = this.visualElement;
|
|
5707
|
+
if (projection && projection.layout) {
|
|
5708
|
+
const measuredAxis = projection.layout.layoutBox[axis];
|
|
5709
|
+
if (measuredAxis) {
|
|
5710
|
+
const length = calcLength$1(measuredAxis);
|
|
5711
|
+
current = length * (parseFloat(current) / 100);
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
}
|
|
5715
|
+
this.originPoint[axis] = current;
|
|
5716
|
+
});
|
|
5717
|
+
if (onDragStart) {
|
|
5718
|
+
frame.postRender(() => onDragStart(event, info));
|
|
5719
|
+
}
|
|
5720
|
+
addValueToWillChange(this.visualElement, "transform");
|
|
5721
|
+
const state2 = this.visualElement.state;
|
|
5722
|
+
state2.setActive("whileDrag", true);
|
|
5723
|
+
};
|
|
5724
|
+
const onMove = (event, info) => {
|
|
5725
|
+
const {
|
|
5726
|
+
dragPropagation,
|
|
5727
|
+
dragDirectionLock,
|
|
5728
|
+
onDirectionLock,
|
|
5729
|
+
onDrag
|
|
5730
|
+
} = this.getProps();
|
|
5731
|
+
if (!dragPropagation && !this.openGlobalLock)
|
|
5732
|
+
return;
|
|
5733
|
+
const { offset } = info;
|
|
5734
|
+
if (dragDirectionLock && this.currentDirection === null) {
|
|
5735
|
+
this.currentDirection = getCurrentDirection(offset);
|
|
5736
|
+
if (this.currentDirection !== null) {
|
|
5737
|
+
onDirectionLock && onDirectionLock(this.currentDirection);
|
|
5738
|
+
}
|
|
5739
|
+
return;
|
|
5740
|
+
}
|
|
5741
|
+
this.updateAxis("x", info.point, offset);
|
|
5742
|
+
this.updateAxis("y", info.point, offset);
|
|
5743
|
+
this.visualElement.render();
|
|
5744
|
+
onDrag && onDrag(event, info);
|
|
5745
|
+
};
|
|
5746
|
+
const onSessionEnd = (event, info) => this.stop(event, info);
|
|
5747
|
+
const resumeAnimation = () => eachAxis$1(
|
|
5748
|
+
(axis) => {
|
|
5749
|
+
var _a;
|
|
5750
|
+
return this.getAnimationState(axis) === "paused" && ((_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.play());
|
|
5751
|
+
}
|
|
5752
|
+
);
|
|
5753
|
+
const { dragSnapToOrigin } = this.getProps();
|
|
5754
|
+
this.panSession = new PanSession(
|
|
5755
|
+
originEvent,
|
|
5756
|
+
{
|
|
5757
|
+
onSessionStart,
|
|
5758
|
+
onStart,
|
|
5759
|
+
onMove,
|
|
5760
|
+
onSessionEnd,
|
|
5761
|
+
resumeAnimation
|
|
5762
|
+
},
|
|
5763
|
+
{
|
|
5764
|
+
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
5765
|
+
dragSnapToOrigin,
|
|
5766
|
+
contextWindow: getContextWindow(this.visualElement)
|
|
5767
|
+
}
|
|
5768
|
+
);
|
|
5769
|
+
}
|
|
5770
|
+
stop(event, info) {
|
|
5771
|
+
const isDragging = this.isDragging;
|
|
5772
|
+
this.cancel();
|
|
5773
|
+
if (!isDragging)
|
|
5774
|
+
return;
|
|
5775
|
+
const { velocity } = info;
|
|
5776
|
+
this.startAnimation(velocity);
|
|
5777
|
+
const { onDragEnd } = this.getProps();
|
|
5778
|
+
if (onDragEnd) {
|
|
5779
|
+
frame.postRender(() => onDragEnd(event, info));
|
|
5780
|
+
}
|
|
5781
|
+
}
|
|
5782
|
+
cancel() {
|
|
5783
|
+
this.isDragging = false;
|
|
5784
|
+
const { projection, animationState } = this.visualElement;
|
|
5785
|
+
if (projection) {
|
|
5786
|
+
projection.isAnimationBlocked = false;
|
|
5787
|
+
}
|
|
5788
|
+
this.panSession && this.panSession.end();
|
|
5789
|
+
this.panSession = void 0;
|
|
5790
|
+
const { dragPropagation } = this.getProps();
|
|
5791
|
+
if (!dragPropagation && this.openGlobalLock) {
|
|
5792
|
+
this.openGlobalLock();
|
|
5793
|
+
this.openGlobalLock = null;
|
|
5794
|
+
}
|
|
5795
|
+
const state2 = this.visualElement.state;
|
|
5796
|
+
state2.setActive("whileDrag", false);
|
|
5797
|
+
}
|
|
5798
|
+
updateAxis(axis, _point, offset) {
|
|
5799
|
+
const { drag } = this.getProps();
|
|
5800
|
+
if (!offset || !shouldDrag(axis, drag, this.currentDirection))
|
|
5801
|
+
return;
|
|
5802
|
+
const axisValue = this.getAxisMotionValue(axis);
|
|
5803
|
+
let next = this.originPoint[axis] + offset[axis];
|
|
5804
|
+
if (this.constraints && this.constraints[axis]) {
|
|
5805
|
+
next = applyConstraints(
|
|
5806
|
+
next,
|
|
5807
|
+
this.constraints[axis],
|
|
5808
|
+
this.elastic[axis]
|
|
5809
|
+
);
|
|
5810
|
+
}
|
|
5811
|
+
axisValue.set(next);
|
|
5812
|
+
}
|
|
5813
|
+
resolveConstraints() {
|
|
5814
|
+
var _a;
|
|
5815
|
+
const { dragConstraints, dragElastic } = this.getProps();
|
|
5816
|
+
const layout = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a = this.visualElement.projection) == null ? void 0 : _a.layout;
|
|
5817
|
+
const prevConstraints = this.constraints;
|
|
5818
|
+
if (dragConstraints && isHTMLElement(dragConstraints)) {
|
|
5819
|
+
if (!this.constraints) {
|
|
5820
|
+
this.constraints = this.resolveRefConstraints();
|
|
5821
|
+
}
|
|
5822
|
+
} else {
|
|
5823
|
+
if (dragConstraints && layout) {
|
|
5824
|
+
this.constraints = calcRelativeConstraints(
|
|
5825
|
+
layout.layoutBox,
|
|
5826
|
+
dragConstraints
|
|
5827
|
+
);
|
|
5828
|
+
} else {
|
|
5829
|
+
this.constraints = false;
|
|
5830
|
+
}
|
|
5831
|
+
}
|
|
5832
|
+
this.elastic = resolveDragElastic(dragElastic);
|
|
5833
|
+
if (prevConstraints !== this.constraints && layout && this.constraints && !this.hasMutatedConstraints) {
|
|
5834
|
+
eachAxis$1((axis) => {
|
|
5835
|
+
if (this.constraints !== false && this.getAxisMotionValue(axis)) {
|
|
5836
|
+
this.constraints[axis] = rebaseAxisConstraints(
|
|
5837
|
+
layout.layoutBox[axis],
|
|
5838
|
+
this.constraints[axis]
|
|
5839
|
+
);
|
|
5840
|
+
}
|
|
5841
|
+
});
|
|
5842
|
+
}
|
|
5843
|
+
}
|
|
5844
|
+
resolveRefConstraints() {
|
|
5845
|
+
const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
|
|
5846
|
+
if (!constraints || !isHTMLElement(constraints))
|
|
5847
|
+
return false;
|
|
5848
|
+
const constraintsElement = constraints;
|
|
5849
|
+
heyListen.invariant(
|
|
5850
|
+
constraintsElement !== null,
|
|
5851
|
+
"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."
|
|
5852
|
+
);
|
|
5853
|
+
const { projection } = this.visualElement;
|
|
5854
|
+
if (!projection || !projection.layout)
|
|
5855
|
+
return false;
|
|
5856
|
+
const constraintsBox = measurePageBox(
|
|
5857
|
+
constraintsElement,
|
|
5858
|
+
projection.root,
|
|
5859
|
+
this.visualElement.getTransformPagePoint()
|
|
5860
|
+
);
|
|
5861
|
+
let measuredConstraints = calcViewportConstraints(
|
|
5862
|
+
projection.layout.layoutBox,
|
|
5863
|
+
constraintsBox
|
|
5864
|
+
);
|
|
5865
|
+
if (onMeasureDragConstraints) {
|
|
5866
|
+
const userConstraints = onMeasureDragConstraints(
|
|
5867
|
+
convertBoxToBoundingBox(measuredConstraints)
|
|
5868
|
+
);
|
|
5869
|
+
this.hasMutatedConstraints = !!userConstraints;
|
|
5870
|
+
if (userConstraints) {
|
|
5871
|
+
measuredConstraints = convertBoundingBoxToBox(userConstraints);
|
|
5872
|
+
}
|
|
5873
|
+
}
|
|
5874
|
+
return measuredConstraints;
|
|
5875
|
+
}
|
|
5876
|
+
startAnimation(velocity) {
|
|
5877
|
+
const {
|
|
5878
|
+
drag,
|
|
5879
|
+
dragMomentum,
|
|
5880
|
+
dragElastic,
|
|
5881
|
+
dragTransition,
|
|
5882
|
+
dragSnapToOrigin,
|
|
5883
|
+
onDragTransitionEnd
|
|
5884
|
+
} = this.getProps();
|
|
5885
|
+
const constraints = this.constraints || {};
|
|
5886
|
+
const momentumAnimations = eachAxis$1((axis) => {
|
|
5887
|
+
if (!shouldDrag(axis, drag, this.currentDirection)) {
|
|
5888
|
+
return;
|
|
5889
|
+
}
|
|
5890
|
+
let transition = constraints && constraints[axis] || {};
|
|
5891
|
+
if (dragSnapToOrigin)
|
|
5892
|
+
transition = { min: 0, max: 0 };
|
|
5893
|
+
const bounceStiffness = dragElastic ? 200 : 1e6;
|
|
5894
|
+
const bounceDamping = dragElastic ? 40 : 1e7;
|
|
5895
|
+
const inertia2 = {
|
|
5896
|
+
type: "inertia",
|
|
5897
|
+
velocity: dragMomentum ? velocity[axis] : 0,
|
|
5898
|
+
bounceStiffness,
|
|
5899
|
+
bounceDamping,
|
|
5900
|
+
timeConstant: 750,
|
|
5901
|
+
restDelta: 1,
|
|
5902
|
+
restSpeed: 10,
|
|
5903
|
+
...dragTransition,
|
|
5904
|
+
...transition
|
|
5905
|
+
};
|
|
5906
|
+
return this.startAxisValueAnimation(axis, inertia2);
|
|
5907
|
+
});
|
|
5908
|
+
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
|
|
5909
|
+
}
|
|
5910
|
+
startAxisValueAnimation(axis, transition) {
|
|
5911
|
+
const axisValue = this.getAxisMotionValue(axis);
|
|
5912
|
+
addValueToWillChange(this.visualElement, axis);
|
|
5913
|
+
return axisValue.start(
|
|
5914
|
+
animateMotionValue(
|
|
5915
|
+
axis,
|
|
5916
|
+
axisValue,
|
|
5917
|
+
0,
|
|
5918
|
+
transition,
|
|
5919
|
+
this.visualElement,
|
|
5920
|
+
false
|
|
5921
|
+
)
|
|
5922
|
+
);
|
|
5923
|
+
}
|
|
5924
|
+
stopAnimation() {
|
|
5925
|
+
if (!isPresent(this.visualElement))
|
|
5926
|
+
return;
|
|
5927
|
+
eachAxis$1((axis) => this.getAxisMotionValue(axis).stop());
|
|
5928
|
+
}
|
|
5929
|
+
pauseAnimation() {
|
|
5930
|
+
eachAxis$1((axis) => {
|
|
5931
|
+
var _a;
|
|
5932
|
+
return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.pause();
|
|
5933
|
+
});
|
|
5934
|
+
}
|
|
5935
|
+
getAnimationState(axis) {
|
|
5936
|
+
var _a;
|
|
5937
|
+
return (_a = this.getAxisMotionValue(axis).animation) == null ? void 0 : _a.state;
|
|
5938
|
+
}
|
|
5939
|
+
/**
|
|
5940
|
+
* Drag works differently depending on which props are provided.
|
|
5941
|
+
*
|
|
5942
|
+
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
5943
|
+
* - Otherwise, we apply the delta to the x/y motion values.
|
|
5944
|
+
*/
|
|
5945
|
+
getAxisMotionValue(axis) {
|
|
5946
|
+
const dragKey = `_drag${axis.toUpperCase()}`;
|
|
5947
|
+
const props = this.visualElement.getProps();
|
|
5948
|
+
const externalMotionValue = props[dragKey];
|
|
5949
|
+
return externalMotionValue || this.visualElement.getValue(
|
|
5950
|
+
axis,
|
|
5951
|
+
(props.initial ? props.initial[axis] : void 0) || 0
|
|
5952
|
+
);
|
|
5953
|
+
}
|
|
5954
|
+
snapToCursor(point2) {
|
|
5955
|
+
eachAxis$1((axis) => {
|
|
5956
|
+
const { drag } = this.getProps();
|
|
5957
|
+
if (!shouldDrag(axis, drag, this.currentDirection))
|
|
5958
|
+
return;
|
|
5959
|
+
const { projection } = this.visualElement;
|
|
5960
|
+
const axisValue = this.getAxisMotionValue(axis);
|
|
5961
|
+
if (projection && projection.layout) {
|
|
5962
|
+
const { min, max } = projection.layout.layoutBox[axis];
|
|
5963
|
+
axisValue.set(point2[axis] - mixNumber(min, max, 0.5));
|
|
5964
|
+
}
|
|
5965
|
+
});
|
|
5966
|
+
}
|
|
5967
|
+
/**
|
|
5968
|
+
* When the viewport resizes we want to check if the measured constraints
|
|
5969
|
+
* have changed and, if so, reposition the element within those new constraints
|
|
5970
|
+
* relative to where it was before the resize.
|
|
5971
|
+
*/
|
|
5972
|
+
scalePositionWithinConstraints() {
|
|
5973
|
+
if (!this.visualElement.current)
|
|
5974
|
+
return;
|
|
5975
|
+
const { drag, dragConstraints } = this.getProps();
|
|
5976
|
+
const { projection } = this.visualElement;
|
|
5977
|
+
if (!isHTMLElement(dragConstraints) || !projection || !this.constraints)
|
|
5978
|
+
return;
|
|
5979
|
+
this.stopAnimation();
|
|
5980
|
+
const boxProgress = { x: 0, y: 0 };
|
|
5981
|
+
eachAxis$1((axis) => {
|
|
5982
|
+
const axisValue = this.getAxisMotionValue(axis);
|
|
5983
|
+
if (axisValue && this.constraints !== false) {
|
|
5984
|
+
const latest = axisValue.get();
|
|
5985
|
+
boxProgress[axis] = calcOrigin(
|
|
5986
|
+
{ min: latest, max: latest },
|
|
5987
|
+
this.constraints[axis]
|
|
5988
|
+
);
|
|
5989
|
+
}
|
|
5990
|
+
});
|
|
5991
|
+
const { transformTemplate } = this.visualElement.getProps();
|
|
5992
|
+
this.visualElement.current.style.transform = transformTemplate ? transformTemplate({}, "") : "none";
|
|
5993
|
+
projection.root && projection.root.updateScroll();
|
|
5994
|
+
projection.updateLayout();
|
|
5995
|
+
this.resolveConstraints();
|
|
5996
|
+
eachAxis$1((axis) => {
|
|
5997
|
+
if (!shouldDrag(axis, drag, null))
|
|
5998
|
+
return;
|
|
5999
|
+
const axisValue = this.getAxisMotionValue(axis);
|
|
6000
|
+
const { min, max } = this.constraints[axis];
|
|
6001
|
+
axisValue.set(mixNumber(min, max, boxProgress[axis]));
|
|
6002
|
+
});
|
|
6003
|
+
}
|
|
6004
|
+
addListeners() {
|
|
6005
|
+
if (!this.visualElement.current)
|
|
6006
|
+
return;
|
|
6007
|
+
elementDragControls.set(this.visualElement, this);
|
|
6008
|
+
const element = this.visualElement.current;
|
|
6009
|
+
const stopPointerListener = addPointerEvent(
|
|
6010
|
+
element,
|
|
6011
|
+
"pointerdown",
|
|
6012
|
+
(event) => {
|
|
6013
|
+
const { drag, dragListener = true } = this.getProps();
|
|
6014
|
+
drag && dragListener && this.start(event);
|
|
6015
|
+
}
|
|
6016
|
+
);
|
|
6017
|
+
const measureDragConstraints = () => {
|
|
6018
|
+
const { dragConstraints } = this.getProps();
|
|
6019
|
+
if (isHTMLElement(dragConstraints)) {
|
|
6020
|
+
this.constraints = this.resolveRefConstraints();
|
|
6021
|
+
}
|
|
6022
|
+
};
|
|
6023
|
+
const { projection } = this.visualElement;
|
|
6024
|
+
const stopMeasureLayoutListener = projection.addEventListener(
|
|
6025
|
+
"measure",
|
|
6026
|
+
measureDragConstraints
|
|
6027
|
+
);
|
|
6028
|
+
if (projection && !projection.layout) {
|
|
6029
|
+
projection.root && projection.root.updateScroll();
|
|
6030
|
+
projection.updateLayout();
|
|
6031
|
+
}
|
|
6032
|
+
frame.read(measureDragConstraints);
|
|
6033
|
+
const stopResizeListener = addDomEvent$1(window, "resize", () => this.scalePositionWithinConstraints());
|
|
6034
|
+
const stopLayoutUpdateListener = projection.addEventListener(
|
|
6035
|
+
"didUpdate",
|
|
6036
|
+
({ delta, hasLayoutChanged }) => {
|
|
6037
|
+
if (this.isDragging && hasLayoutChanged) {
|
|
6038
|
+
eachAxis$1((axis) => {
|
|
6039
|
+
const motionValue2 = this.getAxisMotionValue(axis);
|
|
6040
|
+
if (!motionValue2)
|
|
6041
|
+
return;
|
|
6042
|
+
this.originPoint[axis] += delta[axis].translate;
|
|
6043
|
+
motionValue2.set(
|
|
6044
|
+
motionValue2.get() + delta[axis].translate
|
|
6045
|
+
);
|
|
6046
|
+
});
|
|
6047
|
+
this.visualElement.render();
|
|
6048
|
+
}
|
|
6049
|
+
}
|
|
6050
|
+
);
|
|
6051
|
+
return () => {
|
|
6052
|
+
stopResizeListener();
|
|
6053
|
+
stopPointerListener();
|
|
6054
|
+
stopMeasureLayoutListener();
|
|
6055
|
+
stopLayoutUpdateListener && stopLayoutUpdateListener();
|
|
6056
|
+
};
|
|
6057
|
+
}
|
|
6058
|
+
getProps() {
|
|
6059
|
+
const props = this.visualElement.getProps();
|
|
6060
|
+
const {
|
|
6061
|
+
drag = false,
|
|
6062
|
+
dragDirectionLock = false,
|
|
6063
|
+
dragPropagation = false,
|
|
6064
|
+
dragConstraints = false,
|
|
6065
|
+
dragElastic = defaultElastic,
|
|
6066
|
+
dragMomentum = true
|
|
6067
|
+
} = props;
|
|
6068
|
+
return {
|
|
6069
|
+
...props,
|
|
6070
|
+
drag,
|
|
6071
|
+
dragDirectionLock,
|
|
6072
|
+
dragPropagation,
|
|
6073
|
+
dragConstraints,
|
|
6074
|
+
dragElastic,
|
|
6075
|
+
dragMomentum
|
|
6076
|
+
};
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
6079
|
+
function shouldDrag(direction, drag, currentDirection) {
|
|
6080
|
+
return (drag === true || drag === direction) && (currentDirection === null || currentDirection === direction);
|
|
6081
|
+
}
|
|
6082
|
+
function getCurrentDirection(offset, lockThreshold = 10) {
|
|
6083
|
+
let direction = null;
|
|
6084
|
+
if (Math.abs(offset.y) > lockThreshold) {
|
|
6085
|
+
direction = "y";
|
|
6086
|
+
} else if (Math.abs(offset.x) > lockThreshold) {
|
|
6087
|
+
direction = "x";
|
|
6088
|
+
}
|
|
6089
|
+
return direction;
|
|
6090
|
+
}
|
|
6091
|
+
class DragGesture extends Feature {
|
|
6092
|
+
constructor(state2) {
|
|
6093
|
+
super(state2);
|
|
6094
|
+
this.removeGroupControls = noop;
|
|
6095
|
+
this.removeListeners = noop;
|
|
6096
|
+
this.controls = new VisualElementDragControls(state2.visualElement);
|
|
6097
|
+
}
|
|
6098
|
+
mount() {
|
|
6099
|
+
const { dragControls } = this.state.options;
|
|
6100
|
+
if (dragControls) {
|
|
6101
|
+
this.removeGroupControls = dragControls.subscribe(this.controls);
|
|
6102
|
+
}
|
|
6103
|
+
this.removeListeners = this.controls.addListeners() || noop;
|
|
6104
|
+
}
|
|
6105
|
+
unmount() {
|
|
6106
|
+
this.removeGroupControls();
|
|
6107
|
+
this.removeListeners();
|
|
6108
|
+
}
|
|
6109
|
+
}
|
|
6110
|
+
function isSVGElement(element) {
|
|
6111
|
+
return element instanceof SVGElement && element.tagName !== "svg";
|
|
6112
|
+
}
|
|
6113
|
+
class SVGFeature extends Feature {
|
|
6114
|
+
mount() {
|
|
6115
|
+
const instance = this.state.element;
|
|
6116
|
+
if (!isSVGElement(instance)) {
|
|
6117
|
+
return;
|
|
6118
|
+
}
|
|
6119
|
+
const visualElement = this.state.visualElement;
|
|
6120
|
+
frame.read(() => {
|
|
6121
|
+
try {
|
|
6122
|
+
visualElement.renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect();
|
|
6123
|
+
} catch (e) {
|
|
6124
|
+
visualElement.renderState.dimensions = {
|
|
6125
|
+
x: 0,
|
|
6126
|
+
y: 0,
|
|
6127
|
+
width: 0,
|
|
6128
|
+
height: 0
|
|
6129
|
+
};
|
|
6130
|
+
}
|
|
6131
|
+
});
|
|
6132
|
+
}
|
|
6133
|
+
unmount() {
|
|
6134
|
+
}
|
|
6135
|
+
}
|
|
6136
|
+
function pixelsToPercent(pixels, axis) {
|
|
6137
|
+
if (axis.max === axis.min)
|
|
6138
|
+
return 0;
|
|
6139
|
+
return pixels / (axis.max - axis.min) * 100;
|
|
6140
|
+
}
|
|
6141
|
+
const correctBorderRadius = {
|
|
6142
|
+
correct: (latest, node) => {
|
|
6143
|
+
if (!node.target)
|
|
6144
|
+
return latest;
|
|
6145
|
+
if (typeof latest === "string") {
|
|
6146
|
+
if (px.test(latest)) {
|
|
6147
|
+
latest = parseFloat(latest);
|
|
6148
|
+
} else {
|
|
6149
|
+
return latest;
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
const x = pixelsToPercent(latest, node.target.x);
|
|
6153
|
+
const y = pixelsToPercent(latest, node.target.y);
|
|
6154
|
+
return `${x}% ${y}%`;
|
|
6155
|
+
}
|
|
6156
|
+
};
|
|
6157
|
+
const correctBoxShadow = {
|
|
6158
|
+
correct: (latest, { treeScale, projectionDelta }) => {
|
|
6159
|
+
const original = latest;
|
|
6160
|
+
const shadow = complex.parse(latest);
|
|
6161
|
+
if (shadow.length > 5)
|
|
6162
|
+
return original;
|
|
6163
|
+
const template = complex.createTransformer(latest);
|
|
6164
|
+
const offset = typeof shadow[0] !== "number" ? 1 : 0;
|
|
6165
|
+
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
6166
|
+
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
6167
|
+
shadow[0 + offset] /= xScale;
|
|
6168
|
+
shadow[1 + offset] /= yScale;
|
|
6169
|
+
const averageScale = mixNumber$2(xScale, yScale, 0.5);
|
|
6170
|
+
if (typeof shadow[2 + offset] === "number")
|
|
6171
|
+
shadow[2 + offset] /= averageScale;
|
|
6172
|
+
if (typeof shadow[3 + offset] === "number")
|
|
6173
|
+
shadow[3 + offset] /= averageScale;
|
|
6174
|
+
return template(shadow);
|
|
6175
|
+
}
|
|
6176
|
+
};
|
|
6177
|
+
const defaultScaleCorrector = {
|
|
6178
|
+
borderRadius: {
|
|
6179
|
+
...correctBorderRadius,
|
|
6180
|
+
applyTo: [
|
|
6181
|
+
"borderTopLeftRadius",
|
|
6182
|
+
"borderTopRightRadius",
|
|
6183
|
+
"borderBottomLeftRadius",
|
|
6184
|
+
"borderBottomRightRadius"
|
|
6185
|
+
]
|
|
6186
|
+
},
|
|
6187
|
+
borderTopLeftRadius: correctBorderRadius,
|
|
6188
|
+
borderTopRightRadius: correctBorderRadius,
|
|
6189
|
+
borderBottomLeftRadius: correctBorderRadius,
|
|
6190
|
+
borderBottomRightRadius: correctBorderRadius,
|
|
6191
|
+
boxShadow: correctBoxShadow
|
|
6192
|
+
};
|
|
6193
|
+
const globalProjectionState = {
|
|
6194
|
+
/**
|
|
6195
|
+
* Global flag as to whether the tree has animated since the last time
|
|
6196
|
+
* we resized the window
|
|
6197
|
+
*/
|
|
6198
|
+
hasAnimatedSinceResize: true,
|
|
6199
|
+
/**
|
|
6200
|
+
* We set this to true once, on the first update. Any nodes added to the tree beyond that
|
|
6201
|
+
* update will be given a `data-projection-id` attribute.
|
|
6202
|
+
*/
|
|
6203
|
+
hasEverUpdated: false
|
|
6204
|
+
};
|
|
6205
|
+
class LayoutFeature extends Feature {
|
|
6206
|
+
constructor(state2) {
|
|
6207
|
+
super(state2);
|
|
6208
|
+
addScaleCorrector(defaultScaleCorrector);
|
|
6209
|
+
}
|
|
6210
|
+
beforeUpdate() {
|
|
6211
|
+
var _a;
|
|
6212
|
+
(_a = this.state.visualElement.projection) == null ? void 0 : _a.willUpdate();
|
|
6213
|
+
}
|
|
6214
|
+
update() {
|
|
6215
|
+
var _a, _b;
|
|
6216
|
+
(_a = this.state.visualElement.projection) == null ? void 0 : _a.setOptions(this.state.options);
|
|
6217
|
+
(_b = this.state.visualElement.projection) == null ? void 0 : _b.root.didUpdate();
|
|
6218
|
+
}
|
|
6219
|
+
beforeMount() {
|
|
6220
|
+
}
|
|
6221
|
+
mount() {
|
|
6222
|
+
var _a;
|
|
6223
|
+
const options = this.state.options;
|
|
6224
|
+
const layoutGroup = this.state.options.layoutGroup;
|
|
6225
|
+
if (options.layout || options.layoutId) {
|
|
6226
|
+
const projection = this.state.visualElement.projection;
|
|
6227
|
+
if (projection) {
|
|
6228
|
+
(_a = layoutGroup == null ? void 0 : layoutGroup.group) == null ? void 0 : _a.add(projection);
|
|
6229
|
+
}
|
|
6230
|
+
globalProjectionState.hasEverUpdated = true;
|
|
6231
|
+
projection == null ? void 0 : projection.root.didUpdate();
|
|
6232
|
+
}
|
|
6233
|
+
}
|
|
6234
|
+
beforeUnmount() {
|
|
6235
|
+
if (this.state.visualElement.projection) {
|
|
6236
|
+
this.state.visualElement.projection.willUpdate();
|
|
6237
|
+
}
|
|
6238
|
+
}
|
|
6239
|
+
unmount() {
|
|
6240
|
+
if (this.state.visualElement.projection) {
|
|
6241
|
+
this.state.visualElement.projection.unmount();
|
|
6242
|
+
const layoutGroup = this.state.options.layoutGroup;
|
|
6243
|
+
if (layoutGroup == null ? void 0 : layoutGroup.group)
|
|
6244
|
+
layoutGroup.group.remove(this.state.visualElement.projection);
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
function asyncHandler(handler) {
|
|
6249
|
+
return (event, info) => {
|
|
6250
|
+
if (handler) {
|
|
6251
|
+
frame.postRender(() => handler(event, info));
|
|
6252
|
+
}
|
|
6253
|
+
};
|
|
6254
|
+
}
|
|
6255
|
+
class PanGesture extends Feature {
|
|
6256
|
+
constructor() {
|
|
6257
|
+
super(...arguments);
|
|
6258
|
+
this.removePointerDownListener = noop;
|
|
6259
|
+
}
|
|
6260
|
+
onPointerDown(pointerDownEvent) {
|
|
6261
|
+
this.session = new PanSession(
|
|
6262
|
+
pointerDownEvent,
|
|
6263
|
+
this.createPanHandlers(),
|
|
6264
|
+
{
|
|
6265
|
+
transformPagePoint: this.state.visualElement.getTransformPagePoint(),
|
|
6266
|
+
contextWindow: getContextWindow(this.state.visualElement)
|
|
6267
|
+
}
|
|
6268
|
+
);
|
|
6269
|
+
}
|
|
6270
|
+
createPanHandlers() {
|
|
6271
|
+
return {
|
|
6272
|
+
onSessionStart: asyncHandler((_, info) => {
|
|
6273
|
+
const { onPanSessionStart } = this.state.options;
|
|
6274
|
+
onPanSessionStart && onPanSessionStart(_, info);
|
|
6275
|
+
}),
|
|
6276
|
+
onStart: asyncHandler((_, info) => {
|
|
6277
|
+
const { onPanStart } = this.state.options;
|
|
6278
|
+
onPanStart && onPanStart(_, info);
|
|
6279
|
+
}),
|
|
6280
|
+
onMove: (event, info) => {
|
|
6281
|
+
const { onPan } = this.state.options;
|
|
6282
|
+
onPan && onPan(event, info);
|
|
6283
|
+
},
|
|
6284
|
+
onEnd: (event, info) => {
|
|
6285
|
+
const { onPanEnd } = this.state.options;
|
|
6286
|
+
delete this.session;
|
|
6287
|
+
if (onPanEnd) {
|
|
6288
|
+
frame.postRender(() => onPanEnd(event, info));
|
|
6289
|
+
}
|
|
6290
|
+
}
|
|
6291
|
+
};
|
|
6292
|
+
}
|
|
6293
|
+
mount() {
|
|
6294
|
+
this.removePointerDownListener = addPointerEvent(
|
|
6295
|
+
this.state.element,
|
|
6296
|
+
"pointerdown",
|
|
6297
|
+
this.onPointerDown.bind(this)
|
|
6298
|
+
);
|
|
6299
|
+
}
|
|
6300
|
+
update() {
|
|
6301
|
+
}
|
|
6302
|
+
unmount() {
|
|
6303
|
+
this.removePointerDownListener();
|
|
6304
|
+
this.session && this.session.end();
|
|
5306
6305
|
}
|
|
5307
6306
|
}
|
|
5308
6307
|
const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"];
|
|
@@ -5311,15 +6310,15 @@ const asNumber = (value) => typeof value === "string" ? parseFloat(value) : valu
|
|
|
5311
6310
|
const isPx = (value) => typeof value === "number" || px.test(value);
|
|
5312
6311
|
function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember) {
|
|
5313
6312
|
if (shouldCrossfadeOpacity) {
|
|
5314
|
-
target.opacity = mixNumber$
|
|
6313
|
+
target.opacity = mixNumber$2(
|
|
5315
6314
|
0,
|
|
5316
6315
|
// TODO Reinstate this if only child
|
|
5317
6316
|
lead.opacity !== void 0 ? lead.opacity : 1,
|
|
5318
6317
|
easeCrossfadeIn(progress2)
|
|
5319
6318
|
);
|
|
5320
|
-
target.opacityExit = mixNumber$
|
|
6319
|
+
target.opacityExit = mixNumber$2(follow.opacity !== void 0 ? follow.opacity : 1, 0, easeCrossfadeOut(progress2));
|
|
5321
6320
|
} else if (isOnlyMember) {
|
|
5322
|
-
target.opacity = mixNumber$
|
|
6321
|
+
target.opacity = mixNumber$2(follow.opacity !== void 0 ? follow.opacity : 1, lead.opacity !== void 0 ? lead.opacity : 1, progress2);
|
|
5323
6322
|
}
|
|
5324
6323
|
for (let i = 0; i < numBorders; i++) {
|
|
5325
6324
|
const borderLabel = `border${borders[i]}Radius`;
|
|
@@ -5331,8 +6330,8 @@ function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOn
|
|
|
5331
6330
|
leadRadius || (leadRadius = 0);
|
|
5332
6331
|
const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius);
|
|
5333
6332
|
if (canMix) {
|
|
5334
|
-
target[borderLabel] = Math.max(mixNumber$
|
|
5335
|
-
if (percent.test(leadRadius) || percent.test(followRadius)) {
|
|
6333
|
+
target[borderLabel] = Math.max(mixNumber$2(asNumber(followRadius), asNumber(leadRadius), progress2), 0);
|
|
6334
|
+
if (percent$1.test(leadRadius) || percent$1.test(followRadius)) {
|
|
5336
6335
|
target[borderLabel] += "%";
|
|
5337
6336
|
}
|
|
5338
6337
|
} else {
|
|
@@ -5340,21 +6339,21 @@ function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOn
|
|
|
5340
6339
|
}
|
|
5341
6340
|
}
|
|
5342
6341
|
if (follow.rotate || lead.rotate) {
|
|
5343
|
-
target.rotate = mixNumber$
|
|
6342
|
+
target.rotate = mixNumber$2(follow.rotate || 0, lead.rotate || 0, progress2);
|
|
5344
6343
|
}
|
|
5345
6344
|
}
|
|
5346
6345
|
function getRadius(values, radiusName) {
|
|
5347
6346
|
return values[radiusName] !== void 0 ? values[radiusName] : values.borderRadius;
|
|
5348
6347
|
}
|
|
5349
6348
|
const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut);
|
|
5350
|
-
const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop
|
|
6349
|
+
const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop);
|
|
5351
6350
|
function compress(min, max, easing) {
|
|
5352
6351
|
return (p) => {
|
|
5353
6352
|
if (p < min)
|
|
5354
6353
|
return 0;
|
|
5355
6354
|
if (p > max)
|
|
5356
6355
|
return 1;
|
|
5357
|
-
return easing(progress(min, max, p));
|
|
6356
|
+
return easing(progress$1(min, max, p));
|
|
5358
6357
|
};
|
|
5359
6358
|
}
|
|
5360
6359
|
function copyAxisInto(axis, originAxis) {
|
|
@@ -5385,9 +6384,9 @@ function isNear(value, target, maxDistance) {
|
|
|
5385
6384
|
}
|
|
5386
6385
|
function calcAxisDelta(delta, source, target, origin = 0.5) {
|
|
5387
6386
|
delta.origin = origin;
|
|
5388
|
-
delta.originPoint = mixNumber$
|
|
6387
|
+
delta.originPoint = mixNumber$2(source.min, source.max, delta.origin);
|
|
5389
6388
|
delta.scale = calcLength(target) / calcLength(source);
|
|
5390
|
-
delta.translate = mixNumber$
|
|
6389
|
+
delta.translate = mixNumber$2(target.min, target.max, delta.origin) - delta.originPoint;
|
|
5391
6390
|
if (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX || isNaN(delta.scale)) {
|
|
5392
6391
|
delta.scale = 1;
|
|
5393
6392
|
}
|
|
@@ -5424,14 +6423,14 @@ function removePointDelta(point2, translate, scale2, originPoint, boxScale) {
|
|
|
5424
6423
|
return point2;
|
|
5425
6424
|
}
|
|
5426
6425
|
function removeAxisDelta(axis, translate = 0, scale2 = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {
|
|
5427
|
-
if (percent.test(translate)) {
|
|
6426
|
+
if (percent$1.test(translate)) {
|
|
5428
6427
|
translate = parseFloat(translate);
|
|
5429
|
-
const relativeProgress = mixNumber$
|
|
6428
|
+
const relativeProgress = mixNumber$2(sourceAxis.min, sourceAxis.max, translate / 100);
|
|
5430
6429
|
translate = relativeProgress - sourceAxis.min;
|
|
5431
6430
|
}
|
|
5432
6431
|
if (typeof translate !== "number")
|
|
5433
6432
|
return;
|
|
5434
|
-
let originPoint = mixNumber$
|
|
6433
|
+
let originPoint = mixNumber$2(originAxis.min, originAxis.max, origin);
|
|
5435
6434
|
if (axis === originAxis)
|
|
5436
6435
|
originPoint -= translate;
|
|
5437
6436
|
axis.min = removePointDelta(axis.min, translate, scale2, originPoint, boxScale);
|
|
@@ -5620,18 +6619,6 @@ function resolveMotionValue(value) {
|
|
|
5620
6619
|
const unwrappedValue = isMotionValue$1(value) ? value.get() : value;
|
|
5621
6620
|
return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue;
|
|
5622
6621
|
}
|
|
5623
|
-
const globalProjectionState = {
|
|
5624
|
-
/**
|
|
5625
|
-
* Global flag as to whether the tree has animated since the last time
|
|
5626
|
-
* we resized the window
|
|
5627
|
-
*/
|
|
5628
|
-
hasAnimatedSinceResize: true,
|
|
5629
|
-
/**
|
|
5630
|
-
* We set this to true once, on the first update. Any nodes added to the tree beyond that
|
|
5631
|
-
* update will be given a `data-projection-id` attribute.
|
|
5632
|
-
*/
|
|
5633
|
-
hasEverUpdated: false
|
|
5634
|
-
};
|
|
5635
6622
|
const { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);
|
|
5636
6623
|
const metrics = {
|
|
5637
6624
|
type: "projectionFrame",
|
|
@@ -5898,7 +6885,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
5898
6885
|
this.nodes.forEach(notifyLayoutUpdate);
|
|
5899
6886
|
this.clearAllSnapshots();
|
|
5900
6887
|
const now2 = time.now();
|
|
5901
|
-
frameData.delta = clamp(0, 1e3 / 60, now2 - frameData.timestamp);
|
|
6888
|
+
frameData.delta = clamp$1(0, 1e3 / 60, now2 - frameData.timestamp);
|
|
5902
6889
|
frameData.timestamp = now2;
|
|
5903
6890
|
frameData.isProcessing = true;
|
|
5904
6891
|
frameSteps.update.process(frameData);
|
|
@@ -5954,7 +6941,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
5954
6941
|
}
|
|
5955
6942
|
const prevLayout = this.layout;
|
|
5956
6943
|
this.layout = this.measure(false);
|
|
5957
|
-
this.layoutCorrected = createBox();
|
|
6944
|
+
this.layoutCorrected = createBox$1();
|
|
5958
6945
|
this.isLayoutDirty = false;
|
|
5959
6946
|
this.projectionDelta = void 0;
|
|
5960
6947
|
this.notifyListeners("measure", this.layout.layoutBox);
|
|
@@ -6010,21 +6997,21 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6010
6997
|
var _a;
|
|
6011
6998
|
const { visualElement } = this.options;
|
|
6012
6999
|
if (!visualElement)
|
|
6013
|
-
return createBox();
|
|
7000
|
+
return createBox$1();
|
|
6014
7001
|
const box = visualElement.measureViewportBox();
|
|
6015
7002
|
const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot);
|
|
6016
7003
|
if (!wasInScrollRoot) {
|
|
6017
7004
|
const { scroll: scroll2 } = this.root;
|
|
6018
7005
|
if (scroll2) {
|
|
6019
|
-
translateAxis(box.x, scroll2.offset.x);
|
|
6020
|
-
translateAxis(box.y, scroll2.offset.y);
|
|
7006
|
+
translateAxis$1(box.x, scroll2.offset.x);
|
|
7007
|
+
translateAxis$1(box.y, scroll2.offset.y);
|
|
6021
7008
|
}
|
|
6022
7009
|
}
|
|
6023
7010
|
return box;
|
|
6024
7011
|
}
|
|
6025
7012
|
removeElementScroll(box) {
|
|
6026
7013
|
var _a;
|
|
6027
|
-
const boxWithoutScroll = createBox();
|
|
7014
|
+
const boxWithoutScroll = createBox$1();
|
|
6028
7015
|
copyBoxInto(boxWithoutScroll, box);
|
|
6029
7016
|
if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) {
|
|
6030
7017
|
return boxWithoutScroll;
|
|
@@ -6036,14 +7023,14 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6036
7023
|
if (scroll2.wasRoot) {
|
|
6037
7024
|
copyBoxInto(boxWithoutScroll, box);
|
|
6038
7025
|
}
|
|
6039
|
-
translateAxis(boxWithoutScroll.x, scroll2.offset.x);
|
|
6040
|
-
translateAxis(boxWithoutScroll.y, scroll2.offset.y);
|
|
7026
|
+
translateAxis$1(boxWithoutScroll.x, scroll2.offset.x);
|
|
7027
|
+
translateAxis$1(boxWithoutScroll.y, scroll2.offset.y);
|
|
6041
7028
|
}
|
|
6042
7029
|
}
|
|
6043
7030
|
return boxWithoutScroll;
|
|
6044
7031
|
}
|
|
6045
7032
|
applyTransform(box, transformOnly = false) {
|
|
6046
|
-
const withTransforms = createBox();
|
|
7033
|
+
const withTransforms = createBox$1();
|
|
6047
7034
|
copyBoxInto(withTransforms, box);
|
|
6048
7035
|
for (let i = 0; i < this.path.length; i++) {
|
|
6049
7036
|
const node = this.path[i];
|
|
@@ -6063,7 +7050,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6063
7050
|
return withTransforms;
|
|
6064
7051
|
}
|
|
6065
7052
|
removeTransform(box) {
|
|
6066
|
-
const boxWithoutTransform = createBox();
|
|
7053
|
+
const boxWithoutTransform = createBox$1();
|
|
6067
7054
|
copyBoxInto(boxWithoutTransform, box);
|
|
6068
7055
|
for (let i = 0; i < this.path.length; i++) {
|
|
6069
7056
|
const node = this.path[i];
|
|
@@ -6072,7 +7059,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6072
7059
|
if (!hasTransform(node.latestValues))
|
|
6073
7060
|
continue;
|
|
6074
7061
|
hasScale(node.latestValues) && node.updateSnapshot();
|
|
6075
|
-
const sourceBox = createBox();
|
|
7062
|
+
const sourceBox = createBox$1();
|
|
6076
7063
|
const nodeBox = node.measurePageBox();
|
|
6077
7064
|
copyBoxInto(sourceBox, nodeBox);
|
|
6078
7065
|
removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : void 0, sourceBox);
|
|
@@ -6129,8 +7116,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6129
7116
|
if (relativeParent && relativeParent.layout && this.animationProgress !== 1) {
|
|
6130
7117
|
this.relativeParent = relativeParent;
|
|
6131
7118
|
this.forceRelativeParentToResolveTarget();
|
|
6132
|
-
this.relativeTarget = createBox();
|
|
6133
|
-
this.relativeTargetOrigin = createBox();
|
|
7119
|
+
this.relativeTarget = createBox$1();
|
|
7120
|
+
this.relativeTargetOrigin = createBox$1();
|
|
6134
7121
|
calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
|
|
6135
7122
|
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
|
|
6136
7123
|
} else {
|
|
@@ -6140,8 +7127,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6140
7127
|
if (!this.relativeTarget && !this.targetDelta)
|
|
6141
7128
|
return;
|
|
6142
7129
|
if (!this.target) {
|
|
6143
|
-
this.target = createBox();
|
|
6144
|
-
this.targetWithTransforms = createBox();
|
|
7130
|
+
this.target = createBox$1();
|
|
7131
|
+
this.targetWithTransforms = createBox$1();
|
|
6145
7132
|
}
|
|
6146
7133
|
if (this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target) {
|
|
6147
7134
|
this.forceRelativeParentToResolveTarget();
|
|
@@ -6162,8 +7149,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6162
7149
|
if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) {
|
|
6163
7150
|
this.relativeParent = relativeParent;
|
|
6164
7151
|
this.forceRelativeParentToResolveTarget();
|
|
6165
|
-
this.relativeTarget = createBox();
|
|
6166
|
-
this.relativeTargetOrigin = createBox();
|
|
7152
|
+
this.relativeTarget = createBox$1();
|
|
7153
|
+
this.relativeTargetOrigin = createBox$1();
|
|
6167
7154
|
calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
|
|
6168
7155
|
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
|
|
6169
7156
|
} else {
|
|
@@ -6216,7 +7203,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6216
7203
|
applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
|
|
6217
7204
|
if (lead.layout && !lead.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
|
|
6218
7205
|
lead.target = lead.layout.layoutBox;
|
|
6219
|
-
lead.targetWithTransforms = createBox();
|
|
7206
|
+
lead.targetWithTransforms = createBox$1();
|
|
6220
7207
|
}
|
|
6221
7208
|
const { target } = lead;
|
|
6222
7209
|
if (!target) {
|
|
@@ -6273,7 +7260,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6273
7260
|
this.relativeTarget = this.relativeTargetOrigin = void 0;
|
|
6274
7261
|
}
|
|
6275
7262
|
this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
|
|
6276
|
-
const relativeLayout = createBox();
|
|
7263
|
+
const relativeLayout = createBox$1();
|
|
6277
7264
|
const snapshotSource = snapshot ? snapshot.source : void 0;
|
|
6278
7265
|
const layoutSource = this.layout ? this.layout.source : void 0;
|
|
6279
7266
|
const isSharedLayoutAnimation = snapshotSource !== layoutSource;
|
|
@@ -6294,7 +7281,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6294
7281
|
this.isProjectionDirty = false;
|
|
6295
7282
|
}
|
|
6296
7283
|
if (!prevRelativeTarget)
|
|
6297
|
-
prevRelativeTarget = createBox();
|
|
7284
|
+
prevRelativeTarget = createBox$1();
|
|
6298
7285
|
copyBoxInto(prevRelativeTarget, this.relativeTarget);
|
|
6299
7286
|
}
|
|
6300
7287
|
if (isSharedLayoutAnimation) {
|
|
@@ -6359,7 +7346,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6359
7346
|
if (!targetWithTransforms || !target || !layout)
|
|
6360
7347
|
return;
|
|
6361
7348
|
if (this !== lead && this.layout && layout && shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {
|
|
6362
|
-
target = this.target || createBox();
|
|
7349
|
+
target = this.target || createBox$1();
|
|
6363
7350
|
const xLength = calcLength(this.layout.layoutBox.x);
|
|
6364
7351
|
target.x.min = lead.target.x.min;
|
|
6365
7352
|
target.x.max = target.x.min + xLength;
|
|
@@ -6569,9 +7556,9 @@ function notifyLayoutUpdate(node) {
|
|
|
6569
7556
|
if (relativeParent && !relativeParent.resumeFrom) {
|
|
6570
7557
|
const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
|
|
6571
7558
|
if (parentSnapshot && parentLayout) {
|
|
6572
|
-
const relativeSnapshot = createBox();
|
|
7559
|
+
const relativeSnapshot = createBox$1();
|
|
6573
7560
|
calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
|
|
6574
|
-
const relativeLayout = createBox();
|
|
7561
|
+
const relativeLayout = createBox$1();
|
|
6575
7562
|
calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
|
|
6576
7563
|
if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
|
|
6577
7564
|
hasRelativeTargetChanged = true;
|
|
@@ -6647,14 +7634,14 @@ function removeLeadSnapshots(stack) {
|
|
|
6647
7634
|
stack.removeLeadSnapshot();
|
|
6648
7635
|
}
|
|
6649
7636
|
function mixAxisDelta(output, delta, p) {
|
|
6650
|
-
output.translate = mixNumber$
|
|
6651
|
-
output.scale = mixNumber$
|
|
7637
|
+
output.translate = mixNumber$2(delta.translate, 0, p);
|
|
7638
|
+
output.scale = mixNumber$2(delta.scale, 1, p);
|
|
6652
7639
|
output.origin = delta.origin;
|
|
6653
7640
|
output.originPoint = delta.originPoint;
|
|
6654
7641
|
}
|
|
6655
7642
|
function mixAxis(output, from, to, p) {
|
|
6656
|
-
output.min = mixNumber$
|
|
6657
|
-
output.max = mixNumber$
|
|
7643
|
+
output.min = mixNumber$2(from.min, to.min, p);
|
|
7644
|
+
output.max = mixNumber$2(from.max, to.max, p);
|
|
6658
7645
|
}
|
|
6659
7646
|
function mixBox(output, from, to, p) {
|
|
6660
7647
|
mixAxis(output.x, from.x, to.x, p);
|
|
@@ -6668,7 +7655,7 @@ const defaultLayoutTransition = {
|
|
|
6668
7655
|
ease: [0.4, 0, 0.1, 1]
|
|
6669
7656
|
};
|
|
6670
7657
|
const userAgentContains = (string) => typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(string);
|
|
6671
|
-
const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") ? Math.round : noop
|
|
7658
|
+
const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") ? Math.round : noop;
|
|
6672
7659
|
function roundAxis(axis) {
|
|
6673
7660
|
axis.min = roundPoint(axis.min);
|
|
6674
7661
|
axis.max = roundPoint(axis.max);
|
|
@@ -6723,127 +7710,35 @@ function getClosestProjectingNode(visualElement) {
|
|
|
6723
7710
|
return void 0;
|
|
6724
7711
|
return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
|
|
6725
7712
|
}
|
|
6726
|
-
|
|
6727
|
-
if (axis.max === axis.min)
|
|
6728
|
-
return 0;
|
|
6729
|
-
return pixels / (axis.max - axis.min) * 100;
|
|
6730
|
-
}
|
|
6731
|
-
const correctBorderRadius = {
|
|
6732
|
-
correct: (latest, node) => {
|
|
6733
|
-
if (!node.target)
|
|
6734
|
-
return latest;
|
|
6735
|
-
if (typeof latest === "string") {
|
|
6736
|
-
if (px.test(latest)) {
|
|
6737
|
-
latest = parseFloat(latest);
|
|
6738
|
-
} else {
|
|
6739
|
-
return latest;
|
|
6740
|
-
}
|
|
6741
|
-
}
|
|
6742
|
-
const x = pixelsToPercent(latest, node.target.x);
|
|
6743
|
-
const y = pixelsToPercent(latest, node.target.y);
|
|
6744
|
-
return `${x}% ${y}%`;
|
|
6745
|
-
}
|
|
6746
|
-
};
|
|
6747
|
-
const correctBoxShadow = {
|
|
6748
|
-
correct: (latest, { treeScale, projectionDelta }) => {
|
|
6749
|
-
const original = latest;
|
|
6750
|
-
const shadow = complex.parse(latest);
|
|
6751
|
-
if (shadow.length > 5)
|
|
6752
|
-
return original;
|
|
6753
|
-
const template = complex.createTransformer(latest);
|
|
6754
|
-
const offset = typeof shadow[0] !== "number" ? 1 : 0;
|
|
6755
|
-
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
6756
|
-
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
6757
|
-
shadow[0 + offset] /= xScale;
|
|
6758
|
-
shadow[1 + offset] /= yScale;
|
|
6759
|
-
const averageScale = mixNumber$1(xScale, yScale, 0.5);
|
|
6760
|
-
if (typeof shadow[2 + offset] === "number")
|
|
6761
|
-
shadow[2 + offset] /= averageScale;
|
|
6762
|
-
if (typeof shadow[3 + offset] === "number")
|
|
6763
|
-
shadow[3 + offset] /= averageScale;
|
|
6764
|
-
return template(shadow);
|
|
6765
|
-
}
|
|
6766
|
-
};
|
|
6767
|
-
const defaultScaleCorrector = {
|
|
6768
|
-
borderRadius: {
|
|
6769
|
-
...correctBorderRadius,
|
|
6770
|
-
applyTo: [
|
|
6771
|
-
"borderTopLeftRadius",
|
|
6772
|
-
"borderTopRightRadius",
|
|
6773
|
-
"borderBottomLeftRadius",
|
|
6774
|
-
"borderBottomRightRadius"
|
|
6775
|
-
]
|
|
6776
|
-
},
|
|
6777
|
-
borderTopLeftRadius: correctBorderRadius,
|
|
6778
|
-
borderTopRightRadius: correctBorderRadius,
|
|
6779
|
-
borderBottomLeftRadius: correctBorderRadius,
|
|
6780
|
-
borderBottomRightRadius: correctBorderRadius,
|
|
6781
|
-
boxShadow: correctBoxShadow
|
|
6782
|
-
};
|
|
6783
|
-
class LayoutFeature extends Feature {
|
|
7713
|
+
class ProjectionFeature extends Feature {
|
|
6784
7714
|
constructor(state2) {
|
|
6785
7715
|
super(state2);
|
|
6786
|
-
|
|
6787
|
-
const visualElement = this.state.visualElement;
|
|
6788
|
-
if (options.layout || options.layoutId) {
|
|
6789
|
-
addScaleCorrector(defaultScaleCorrector);
|
|
6790
|
-
this.layoutGroup = injectLayoutGroup({});
|
|
6791
|
-
vue.onBeforeMount(() => {
|
|
6792
|
-
visualElement.projection = new HTMLProjectionNode(
|
|
6793
|
-
visualElement.latestValues,
|
|
6794
|
-
options["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(visualElement.parent)
|
|
6795
|
-
);
|
|
6796
|
-
visualElement.projection.setOptions({
|
|
6797
|
-
layout: options.layout,
|
|
6798
|
-
layoutId: options.layoutId,
|
|
6799
|
-
// TODO: drag
|
|
6800
|
-
alwaysMeasureLayout: false,
|
|
6801
|
-
visualElement,
|
|
6802
|
-
animationType: typeof options.layout === "string" ? options.layout : "both",
|
|
6803
|
-
// initialPromotionConfig
|
|
6804
|
-
layoutRoot: options.layoutRoot,
|
|
6805
|
-
layoutScroll: options.layoutScroll
|
|
6806
|
-
});
|
|
6807
|
-
});
|
|
6808
|
-
vue.onBeforeUpdate(() => {
|
|
6809
|
-
var _a;
|
|
6810
|
-
(_a = visualElement.projection) == null ? void 0 : _a.willUpdate();
|
|
6811
|
-
});
|
|
6812
|
-
vue.onUpdated(() => {
|
|
6813
|
-
var _a;
|
|
6814
|
-
(_a = visualElement.projection) == null ? void 0 : _a.root.didUpdate();
|
|
6815
|
-
});
|
|
6816
|
-
vue.onBeforeUnmount(() => {
|
|
6817
|
-
if (visualElement.projection) {
|
|
6818
|
-
visualElement.projection.willUpdate();
|
|
6819
|
-
}
|
|
6820
|
-
});
|
|
6821
|
-
}
|
|
7716
|
+
addScaleCorrector(defaultScaleCorrector);
|
|
6822
7717
|
}
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
7718
|
+
initProjection() {
|
|
7719
|
+
const options = this.state.options;
|
|
7720
|
+
this.state.visualElement.projection = new HTMLProjectionNode(
|
|
7721
|
+
this.state.visualElement.latestValues,
|
|
7722
|
+
options["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(this.state.visualElement.parent)
|
|
7723
|
+
);
|
|
7724
|
+
this.state.visualElement.projection.setOptions({
|
|
7725
|
+
layout: options.layout,
|
|
7726
|
+
layoutId: options.layoutId,
|
|
7727
|
+
// TODO: drag
|
|
7728
|
+
alwaysMeasureLayout: false,
|
|
7729
|
+
visualElement: this.state.visualElement,
|
|
7730
|
+
animationType: typeof options.layout === "string" ? options.layout : "both",
|
|
7731
|
+
// initialPromotionConfig
|
|
7732
|
+
layoutRoot: options.layoutRoot,
|
|
7733
|
+
layoutScroll: options.layoutScroll
|
|
7734
|
+
});
|
|
6826
7735
|
}
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
const options = this.state.getOptions();
|
|
6830
|
-
if (options.layout || options.layoutId) {
|
|
6831
|
-
const projection = this.state.visualElement.projection;
|
|
6832
|
-
if (projection) {
|
|
6833
|
-
(_b = (_a = this.layoutGroup) == null ? void 0 : _a.group) == null ? void 0 : _b.add(projection);
|
|
6834
|
-
}
|
|
6835
|
-
globalProjectionState.hasEverUpdated = true;
|
|
6836
|
-
projection == null ? void 0 : projection.mount(this.state.element);
|
|
6837
|
-
projection == null ? void 0 : projection.root.didUpdate();
|
|
6838
|
-
}
|
|
7736
|
+
beforeMount() {
|
|
7737
|
+
this.initProjection();
|
|
6839
7738
|
}
|
|
6840
|
-
|
|
7739
|
+
mount() {
|
|
6841
7740
|
var _a;
|
|
6842
|
-
|
|
6843
|
-
this.state.visualElement.projection.unmount();
|
|
6844
|
-
if ((_a = this.layoutGroup) == null ? void 0 : _a.group)
|
|
6845
|
-
this.layoutGroup.group.remove(this.state.visualElement.projection);
|
|
6846
|
-
}
|
|
7741
|
+
(_a = this.state.visualElement.projection) == null ? void 0 : _a.mount(this.state.element);
|
|
6847
7742
|
}
|
|
6848
7743
|
}
|
|
6849
7744
|
class FeatureManager {
|
|
@@ -6854,18 +7749,35 @@ class FeatureManager {
|
|
|
6854
7749
|
new PressGesture(state2),
|
|
6855
7750
|
new InViewGesture(state2),
|
|
6856
7751
|
new SVGFeature(state2),
|
|
6857
|
-
new
|
|
6858
|
-
new
|
|
7752
|
+
new LayoutFeature(state2),
|
|
7753
|
+
new ProjectionFeature(state2),
|
|
7754
|
+
new PanGesture(state2),
|
|
7755
|
+
new DragGesture(state2)
|
|
6859
7756
|
];
|
|
6860
7757
|
}
|
|
6861
7758
|
mount() {
|
|
6862
7759
|
this.features.forEach((feature) => feature.mount());
|
|
6863
7760
|
}
|
|
7761
|
+
beforeMount() {
|
|
7762
|
+
this.features.forEach((feature) => {
|
|
7763
|
+
var _a;
|
|
7764
|
+
return (_a = feature.beforeMount) == null ? void 0 : _a.call(feature);
|
|
7765
|
+
});
|
|
7766
|
+
}
|
|
6864
7767
|
unmount() {
|
|
6865
7768
|
this.features.forEach((feature) => feature.unmount());
|
|
6866
7769
|
}
|
|
6867
7770
|
update() {
|
|
6868
|
-
this.features.forEach((feature) =>
|
|
7771
|
+
this.features.forEach((feature) => {
|
|
7772
|
+
var _a;
|
|
7773
|
+
return (_a = feature.update) == null ? void 0 : _a.call(feature);
|
|
7774
|
+
});
|
|
7775
|
+
}
|
|
7776
|
+
beforeUpdate() {
|
|
7777
|
+
this.features.forEach((feature) => feature.beforeUpdate());
|
|
7778
|
+
}
|
|
7779
|
+
beforeUnmount() {
|
|
7780
|
+
this.features.forEach((feature) => feature.beforeUnmount());
|
|
6869
7781
|
}
|
|
6870
7782
|
}
|
|
6871
7783
|
let scheduled;
|
|
@@ -6964,7 +7876,7 @@ function animateVariantsChildren(state2, activeState) {
|
|
|
6964
7876
|
getAnimations: () => Promise.all(animationFactories.map((factory) => factory()))
|
|
6965
7877
|
};
|
|
6966
7878
|
}
|
|
6967
|
-
const STATE_TYPES = ["initial", "animate", "inView", "hover", "press", "
|
|
7879
|
+
const STATE_TYPES = ["initial", "animate", "inView", "hover", "press", "whileDrag", "exit"];
|
|
6968
7880
|
const mountedStates = /* @__PURE__ */ new WeakMap();
|
|
6969
7881
|
let id = 0;
|
|
6970
7882
|
class MotionState {
|
|
@@ -7024,16 +7936,20 @@ class MotionState {
|
|
|
7024
7936
|
return isDef(this.options.initial) ? this.options.initial : this.context.initial;
|
|
7025
7937
|
}
|
|
7026
7938
|
updateOptions() {
|
|
7027
|
-
var _a;
|
|
7028
7939
|
this.visualElement.update({
|
|
7029
7940
|
...this.options,
|
|
7030
7941
|
whileHover: this.options.hover,
|
|
7031
7942
|
whileTap: this.options.press,
|
|
7032
7943
|
whileInView: this.options.inView
|
|
7033
|
-
},
|
|
7944
|
+
}, {
|
|
7945
|
+
isPresent: !doneCallbacks.has(this.element)
|
|
7946
|
+
});
|
|
7947
|
+
}
|
|
7948
|
+
beforeMount() {
|
|
7949
|
+
this.featureManager.beforeMount();
|
|
7034
7950
|
}
|
|
7035
7951
|
mount(element, options) {
|
|
7036
|
-
invariant(
|
|
7952
|
+
heyListen.invariant(
|
|
7037
7953
|
Boolean(element),
|
|
7038
7954
|
"Animation state must be mounted with valid Element"
|
|
7039
7955
|
);
|
|
@@ -7058,6 +7974,9 @@ class MotionState {
|
|
|
7058
7974
|
this.featureManager.mount();
|
|
7059
7975
|
scheduleAnimation(this);
|
|
7060
7976
|
}
|
|
7977
|
+
beforeUnmount() {
|
|
7978
|
+
this.featureManager.beforeUnmount();
|
|
7979
|
+
}
|
|
7061
7980
|
unmount() {
|
|
7062
7981
|
var _a;
|
|
7063
7982
|
mountedStates.delete(this.element);
|
|
@@ -7065,6 +7984,9 @@ class MotionState {
|
|
|
7065
7984
|
(_a = visualElementStore.get(this.element)) == null ? void 0 : _a.unmount();
|
|
7066
7985
|
this.featureManager.unmount();
|
|
7067
7986
|
}
|
|
7987
|
+
beforeUpdate() {
|
|
7988
|
+
this.featureManager.beforeUpdate();
|
|
7989
|
+
}
|
|
7068
7990
|
update(options) {
|
|
7069
7991
|
this.options = options;
|
|
7070
7992
|
this.updateOptions();
|
|
@@ -7072,9 +7994,13 @@ class MotionState {
|
|
|
7072
7994
|
scheduleAnimation(this);
|
|
7073
7995
|
}
|
|
7074
7996
|
setActive(name, isActive) {
|
|
7997
|
+
var _a;
|
|
7075
7998
|
if (!this.element || this.activeStates[name] === isActive)
|
|
7076
7999
|
return;
|
|
7077
8000
|
this.activeStates[name] = isActive;
|
|
8001
|
+
(_a = this.visualElement.variantChildren) == null ? void 0 : _a.forEach((child) => {
|
|
8002
|
+
child.state.setActive(name, isActive);
|
|
8003
|
+
});
|
|
7078
8004
|
scheduleAnimation(this);
|
|
7079
8005
|
}
|
|
7080
8006
|
*animateUpdates() {
|
|
@@ -7190,16 +8116,6 @@ class MotionState {
|
|
|
7190
8116
|
return this.options;
|
|
7191
8117
|
}
|
|
7192
8118
|
}
|
|
7193
|
-
const doneCallbacks = /* @__PURE__ */ new WeakMap();
|
|
7194
|
-
const unPresenceDom = vue.ref(/* @__PURE__ */ new WeakMap());
|
|
7195
|
-
function removeDoneCallback(element) {
|
|
7196
|
-
const prevDoneCallback = doneCallbacks.get(element);
|
|
7197
|
-
if (prevDoneCallback) {
|
|
7198
|
-
element.removeEventListener("motioncomplete", prevDoneCallback);
|
|
7199
|
-
}
|
|
7200
|
-
doneCallbacks.delete(element);
|
|
7201
|
-
}
|
|
7202
|
-
const [injectAnimatePresence, provideAnimatePresence] = createContext("AnimatePresenceContext");
|
|
7203
8119
|
function getMotionElement(el) {
|
|
7204
8120
|
if ((el == null ? void 0 : el.nodeType) === 3 || (el == null ? void 0 : el.nodeType) === 8)
|
|
7205
8121
|
return getMotionElement(el.nextSibling);
|
|
@@ -7215,10 +8131,6 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7215
8131
|
as: {},
|
|
7216
8132
|
asChild: { type: Boolean },
|
|
7217
8133
|
custom: {},
|
|
7218
|
-
inViewOptions: {},
|
|
7219
|
-
inView: {},
|
|
7220
|
-
press: {},
|
|
7221
|
-
hover: {},
|
|
7222
8134
|
initial: { type: [String, Object, Boolean] },
|
|
7223
8135
|
animate: {},
|
|
7224
8136
|
exit: {},
|
|
@@ -7226,19 +8138,44 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7226
8138
|
style: {},
|
|
7227
8139
|
transformTemplate: { type: Function },
|
|
7228
8140
|
transition: {},
|
|
7229
|
-
|
|
7230
|
-
onMotionComplete: { type: Function },
|
|
7231
|
-
onHoverStart: { type: Function },
|
|
7232
|
-
onHoverEnd: { type: Function },
|
|
7233
|
-
onPressStart: { type: Function },
|
|
7234
|
-
onPressEnd: { type: Function },
|
|
7235
|
-
onViewEnter: { type: Function },
|
|
7236
|
-
onViewLeave: { type: Function },
|
|
8141
|
+
layoutGroup: {},
|
|
7237
8142
|
layout: { type: [Boolean, String] },
|
|
7238
8143
|
layoutId: {},
|
|
7239
8144
|
layoutScroll: { type: Boolean },
|
|
7240
8145
|
layoutRoot: { type: Boolean },
|
|
7241
|
-
"data-framer-portal-id": {}
|
|
8146
|
+
"data-framer-portal-id": {},
|
|
8147
|
+
globalPressTarget: { type: Boolean },
|
|
8148
|
+
press: {},
|
|
8149
|
+
onPressStart: { type: Function },
|
|
8150
|
+
onPress: { type: Function },
|
|
8151
|
+
onPressCancel: { type: Function },
|
|
8152
|
+
hover: {},
|
|
8153
|
+
onHoverStart: { type: Function },
|
|
8154
|
+
onHoverEnd: { type: Function },
|
|
8155
|
+
inViewOptions: {},
|
|
8156
|
+
inView: {},
|
|
8157
|
+
onViewportEnter: { type: Function },
|
|
8158
|
+
onViewportLeave: { type: Function },
|
|
8159
|
+
drag: { type: [Boolean, String] },
|
|
8160
|
+
dragSnapToOrigin: { type: Boolean },
|
|
8161
|
+
dragDirectionLock: { type: Boolean },
|
|
8162
|
+
dragPropagation: { type: Boolean },
|
|
8163
|
+
dragConstraints: { type: [Boolean, Object] },
|
|
8164
|
+
dragElastic: { type: [Boolean, Number, Object] },
|
|
8165
|
+
dragMomentum: { type: Boolean },
|
|
8166
|
+
dragTransition: {},
|
|
8167
|
+
dragListener: { type: Boolean },
|
|
8168
|
+
dragControls: {},
|
|
8169
|
+
onDragStart: { type: Function },
|
|
8170
|
+
onDragEnd: { type: Function },
|
|
8171
|
+
onDrag: { type: Function },
|
|
8172
|
+
onDirectionLock: { type: Function },
|
|
8173
|
+
onDragTransitionEnd: { type: Function },
|
|
8174
|
+
onMeasureDragConstraints: { type: Function },
|
|
8175
|
+
onPanSessionStart: { type: Function },
|
|
8176
|
+
onPanStart: { type: Function },
|
|
8177
|
+
onPan: { type: Function },
|
|
8178
|
+
onPanEnd: { type: Function }
|
|
7242
8179
|
}, {
|
|
7243
8180
|
as: "div",
|
|
7244
8181
|
asChild: false,
|
|
@@ -7249,7 +8186,10 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7249
8186
|
layout: false,
|
|
7250
8187
|
layoutId: void 0,
|
|
7251
8188
|
layoutScroll: false,
|
|
7252
|
-
layoutRoot: false
|
|
8189
|
+
layoutRoot: false,
|
|
8190
|
+
dragListener: true,
|
|
8191
|
+
dragElastic: 0.2,
|
|
8192
|
+
dragMomentum: true
|
|
7253
8193
|
}),
|
|
7254
8194
|
setup(__props) {
|
|
7255
8195
|
const props = __props;
|
|
@@ -7260,23 +8200,34 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7260
8200
|
const state2 = new MotionState(
|
|
7261
8201
|
{
|
|
7262
8202
|
...attrs,
|
|
7263
|
-
...props
|
|
8203
|
+
...props,
|
|
8204
|
+
layoutGroup
|
|
7264
8205
|
},
|
|
7265
8206
|
parentState
|
|
7266
8207
|
);
|
|
7267
8208
|
provideMotion(state2);
|
|
7268
8209
|
const instance = vue.getCurrentInstance().proxy;
|
|
8210
|
+
vue.onBeforeMount(() => {
|
|
8211
|
+
state2.beforeMount();
|
|
8212
|
+
});
|
|
7269
8213
|
vue.onMounted(() => {
|
|
7270
8214
|
state2.mount(getMotionElement(instance.$el), {
|
|
7271
8215
|
...attrs,
|
|
7272
8216
|
...props,
|
|
8217
|
+
layoutGroup,
|
|
7273
8218
|
initial: presenceInitial.value === false ? presenceInitial.value : props.initial === true ? void 0 : props.initial
|
|
7274
8219
|
});
|
|
7275
8220
|
});
|
|
8221
|
+
vue.onBeforeUnmount(() => {
|
|
8222
|
+
state2.beforeUnmount();
|
|
8223
|
+
});
|
|
7276
8224
|
vue.onUnmounted(() => {
|
|
7277
8225
|
if (safeUnmount(getMotionElement(instance.$el)))
|
|
7278
8226
|
state2.unmount();
|
|
7279
8227
|
});
|
|
8228
|
+
vue.onBeforeUpdate(() => {
|
|
8229
|
+
state2.beforeUpdate();
|
|
8230
|
+
});
|
|
7280
8231
|
vue.onUpdated(() => {
|
|
7281
8232
|
state2.update({
|
|
7282
8233
|
...attrs,
|
|
@@ -7298,12 +8249,23 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7298
8249
|
if (isSVG) {
|
|
7299
8250
|
const { attributes, style: style2 } = convertSvgStyleToAttributes(state2.target);
|
|
7300
8251
|
Object.assign(attrsProps, attributes);
|
|
7301
|
-
Object.assign(styleProps, style2
|
|
8252
|
+
Object.assign(styleProps, style2);
|
|
7302
8253
|
}
|
|
7303
8254
|
if (!state2.isMounted()) {
|
|
7304
|
-
Object.assign(styleProps, state2.target
|
|
8255
|
+
Object.assign(styleProps, state2.target);
|
|
8256
|
+
}
|
|
8257
|
+
if (props.drag && props.dragListener !== false) {
|
|
8258
|
+
Object.assign(styleProps, {
|
|
8259
|
+
userSelect: "none",
|
|
8260
|
+
WebkitUserSelect: "none",
|
|
8261
|
+
WebkitTouchCallout: "none",
|
|
8262
|
+
touchAction: props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`
|
|
8263
|
+
});
|
|
7305
8264
|
}
|
|
7306
|
-
styleProps = createStyles(
|
|
8265
|
+
styleProps = createStyles({
|
|
8266
|
+
...styleProps,
|
|
8267
|
+
...props.style
|
|
8268
|
+
});
|
|
7307
8269
|
attrsProps.style = styleProps;
|
|
7308
8270
|
return attrsProps;
|
|
7309
8271
|
}
|
|
@@ -7456,12 +8418,10 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7456
8418
|
}
|
|
7457
8419
|
removeDoneCallback(el);
|
|
7458
8420
|
state2.setActive("exit", false);
|
|
7459
|
-
unPresenceDom.value.delete(el);
|
|
7460
8421
|
}
|
|
7461
8422
|
const layoutGroup = useLayoutGroup(props);
|
|
7462
8423
|
const { addPopStyle, removePopStyle } = usePopLayout(props);
|
|
7463
8424
|
function exit(el, done) {
|
|
7464
|
-
unPresenceDom.value.set(el, true);
|
|
7465
8425
|
const state2 = mountedStates.get(el);
|
|
7466
8426
|
if (!state2) {
|
|
7467
8427
|
return done();
|
|
@@ -7473,7 +8433,6 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7473
8433
|
removePopStyle(state2);
|
|
7474
8434
|
if ((_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.isExit) {
|
|
7475
8435
|
removeDoneCallback(el);
|
|
7476
|
-
unPresenceDom.value.delete(el);
|
|
7477
8436
|
(_b = state2.visualElement.projection) == null ? void 0 : _b.willUpdate();
|
|
7478
8437
|
(_c = layoutGroup.forceRender) == null ? void 0 : _c.call(layoutGroup);
|
|
7479
8438
|
done();
|
|
@@ -7639,13 +8598,12 @@ function useSpring(source, config = {}) {
|
|
|
7639
8598
|
});
|
|
7640
8599
|
};
|
|
7641
8600
|
vue.watch(() => JSON.stringify(config), () => {
|
|
7642
|
-
|
|
8601
|
+
value.attach((v, set) => {
|
|
7643
8602
|
latestValue = v;
|
|
7644
8603
|
latestSetter = set;
|
|
7645
8604
|
frame.update(startAnimation);
|
|
7646
8605
|
return value.get();
|
|
7647
8606
|
}, stopAnimation);
|
|
7648
|
-
vue.onBeforeUnmount(() => cleanup());
|
|
7649
8607
|
}, { immediate: true });
|
|
7650
8608
|
if (isMotionValue(source)) {
|
|
7651
8609
|
source.on("change", (v) => {
|
|
@@ -7655,7 +8613,7 @@ function useSpring(source, config = {}) {
|
|
|
7655
8613
|
return value;
|
|
7656
8614
|
}
|
|
7657
8615
|
function refWarning(name, ref) {
|
|
7658
|
-
warning(
|
|
8616
|
+
heyListen.warning(
|
|
7659
8617
|
Boolean(!ref || ref.value),
|
|
7660
8618
|
`You have defined a ${name} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref.`
|
|
7661
8619
|
);
|
|
@@ -7765,6 +8723,10 @@ function useAnimate() {
|
|
|
7765
8723
|
});
|
|
7766
8724
|
return [domProxy, animate2];
|
|
7767
8725
|
}
|
|
8726
|
+
Object.defineProperty(exports, "isDragActive", {
|
|
8727
|
+
enumerable: true,
|
|
8728
|
+
get: () => motionDom.isDragActive
|
|
8729
|
+
});
|
|
7768
8730
|
exports.AnimatePresence = _sfc_main$1;
|
|
7769
8731
|
exports.LayoutGroup = _sfc_main;
|
|
7770
8732
|
exports.Motion = _sfc_main$2;
|
|
@@ -7780,7 +8742,7 @@ exports.cancelSync = cancelSync;
|
|
|
7780
8742
|
exports.circIn = circIn;
|
|
7781
8743
|
exports.circInOut = circInOut;
|
|
7782
8744
|
exports.circOut = circOut;
|
|
7783
|
-
exports.clamp = clamp;
|
|
8745
|
+
exports.clamp = clamp$1;
|
|
7784
8746
|
exports.components = components;
|
|
7785
8747
|
exports.createContext = createContext;
|
|
7786
8748
|
exports.createScopedAnimate = createScopedAnimate;
|
|
@@ -7794,6 +8756,7 @@ exports.easeOut = easeOut;
|
|
|
7794
8756
|
exports.frame = frame;
|
|
7795
8757
|
exports.frameData = frameData;
|
|
7796
8758
|
exports.frameSteps = frameSteps;
|
|
8759
|
+
exports.getContextWindow = getContextWindow;
|
|
7797
8760
|
exports.inView = inView;
|
|
7798
8761
|
exports.inertia = inertia;
|
|
7799
8762
|
exports.injectLayoutGroup = injectLayoutGroup;
|
|
@@ -7801,22 +8764,26 @@ exports.injectMotion = injectMotion;
|
|
|
7801
8764
|
exports.interpolate = interpolate;
|
|
7802
8765
|
exports.isMotionValue = isMotionValue;
|
|
7803
8766
|
exports.keyframes = keyframes;
|
|
8767
|
+
exports.millisecondsToSeconds = millisecondsToSeconds;
|
|
7804
8768
|
exports.mirrorEasing = mirrorEasing;
|
|
7805
8769
|
exports.mix = mix;
|
|
7806
8770
|
exports.motionValue = motionValue;
|
|
8771
|
+
exports.noop = noop;
|
|
7807
8772
|
exports.pipe = pipe;
|
|
7808
|
-
exports.progress = progress;
|
|
8773
|
+
exports.progress = progress$1;
|
|
7809
8774
|
exports.provideLayoutGroup = provideLayoutGroup;
|
|
7810
8775
|
exports.provideMotion = provideMotion;
|
|
7811
8776
|
exports.reverseEasing = reverseEasing;
|
|
7812
8777
|
exports.scroll = scroll;
|
|
7813
8778
|
exports.scrollInfo = scrollInfo;
|
|
8779
|
+
exports.secondsToMilliseconds = secondsToMilliseconds;
|
|
7814
8780
|
exports.shouldInheritGroup = shouldInheritGroup;
|
|
7815
8781
|
exports.shouldInheritId = shouldInheritId;
|
|
7816
8782
|
exports.spring = spring;
|
|
7817
8783
|
exports.stagger = stagger;
|
|
7818
8784
|
exports.steps = steps;
|
|
7819
8785
|
exports.sync = sync;
|
|
8786
|
+
exports.time = time;
|
|
7820
8787
|
exports.transform = transform;
|
|
7821
8788
|
exports.useAnimate = useAnimate;
|
|
7822
8789
|
exports.useAnimationFrame = useAnimationFrame;
|