motion-v 0.11.0 → 0.11.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 +260 -158
- package/dist/es/animation/hooks/animation-controls.mjs +1 -1
- package/dist/es/animation/hooks/use-animate.mjs +1 -1
- package/dist/es/components/RowValue.d.ts +3 -1
- package/dist/es/components/animate-presence/AnimatePresence.d.ts +1 -1
- package/dist/es/components/animate-presence/use-pop-layout.mjs +1 -1
- package/dist/es/components/motion/Motion.d.ts +4 -2
- package/dist/es/components/motion-config/MotionConfig.d.ts +2 -2
- package/dist/es/components/reorder/Item.d.ts +6 -6
- package/dist/es/components/reorder/utils.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animate/index.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +14 -11
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +7 -7
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +8 -8
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +4 -4
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/index.mjs +4 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/utils/style.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +2 -2
- package/dist/es/external/.pnpm/framer-motion@12.4.10/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +6 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/spring/find.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/spring/index.mjs +4 -4
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/interfaces/motion-value.mjs +4 -4
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/create.mjs +5 -5
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/cubic-bezier.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/utils/map.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/batcher.mjs +6 -18
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/frame.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/index-legacy.mjs +1 -1
- package/dist/es/external/.pnpm/framer-motion@12.4.10/external/framer-motion/dist/es/frameloop/order.mjs +17 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/render-step.mjs +8 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/animation/mix-values.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/node/create-projection-node.mjs +22 -35
- package/dist/es/external/.pnpm/framer-motion@12.4.10/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +14 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/VisualElement.mjs +6 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/resize/handle-element.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/index.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/info.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/viewport/index.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +12 -0
- package/dist/es/external/.pnpm/framer-motion@12.4.10/external/framer-motion/dist/es/render/svg/utils/measure.mjs +15 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/external/.pnpm/framer-motion@12.4.10/external/framer-motion/dist/es/stats/buffer.mjs +7 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/delay.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/interpolate.mjs +3 -3
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/color.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/offsets/fill.mjs +2 -2
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/index.mjs +1 -1
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +2 -2
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs +3 -3
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/waapi/utils/linear.mjs +2 -2
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/hover.mjs +11 -11
- package/dist/es/external/.pnpm/motion-dom@12.4.10/external/motion-dom/dist/es/gestures/press/index.mjs +74 -0
- package/dist/es/external/.pnpm/motion-dom@12.4.10/external/motion-dom/dist/es/gestures/utils/capture-pointer.mjs +12 -0
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/resolve-elements.mjs +1 -1
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/supports/memo.mjs +2 -2
- package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +2 -2
- package/dist/es/external/.pnpm/{motion-utils@11.16.0 → motion-utils@12.4.10}/external/motion-utils/dist/es/memo.mjs +1 -0
- package/dist/es/external/.pnpm/motion-utils@12.4.10/external/motion-utils/dist/es/noop.mjs +4 -0
- package/dist/es/external/.pnpm/{motion-utils@11.16.0 → motion-utils@12.4.10}/external/motion-utils/dist/es/progress.mjs +1 -1
- package/dist/es/external/.pnpm/motion-utils@12.4.10/external/motion-utils/dist/es/time-conversion.mjs +6 -0
- package/dist/es/features/gestures/drag/VisualElementDragControls.mjs +2 -2
- package/dist/es/features/gestures/drag/index.mjs +2 -2
- package/dist/es/features/gestures/focus/index.mjs +1 -1
- package/dist/es/features/gestures/hover/index.mjs +5 -5
- package/dist/es/features/gestures/in-view/index.mjs +4 -4
- package/dist/es/features/gestures/pan/PanSession.mjs +3 -3
- package/dist/es/features/gestures/pan/index.mjs +3 -3
- package/dist/es/features/gestures/press/index.mjs +4 -4
- package/dist/es/features/layout/config.mjs +2 -2
- package/dist/es/features/layout/layout.mjs +2 -2
- package/dist/es/features/layout/projection.mjs +2 -2
- package/dist/es/features/svg.mjs +1 -1
- package/dist/es/index.mjs +38 -34
- package/dist/es/state/animate-updates.mjs +9 -5
- package/dist/es/state/create-visual-element.mjs +2 -2
- package/dist/es/state/motion-state.d.ts +10 -0
- package/dist/es/state/motion-state.mjs +21 -4
- package/dist/es/utils/use-animation-frame.mjs +1 -1
- package/dist/es/utils/use-in-view.mjs +1 -1
- 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 +2 -2
- package/dist/es/value/use-spring.d.ts +2 -1
- package/dist/es/value/use-spring.mjs +12 -6
- package/dist/es/value/use-time.mjs +1 -1
- package/dist/es/value/use-transform.mjs +12 -4
- package/dist/es/value/use-velocity.mjs +2 -2
- package/package.json +5 -16
- package/dist/es/external/.pnpm/framer-motion@11.16.6/external/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +0 -6
- package/dist/es/external/.pnpm/framer-motion@11.16.6/external/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -8
- package/dist/es/external/.pnpm/motion-dom@11.16.4/external/motion-dom/dist/es/gestures/press/index.mjs +0 -51
- package/dist/es/external/.pnpm/motion-utils@11.16.0/external/motion-utils/dist/es/noop.mjs +0 -4
- package/dist/es/external/.pnpm/motion-utils@11.16.0/external/motion-utils/dist/es/time-conversion.mjs +0 -6
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animate/sequence.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animate/single-value.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/utils/accelerated-values.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/inertia.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/keyframes.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/spring/defaults.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/generators/utils/velocity.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-animatable.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-none.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/animation/utils/stagger.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/anticipate.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/back.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/circ.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/ease.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/modifiers/mirror.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/modifiers/reverse.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/steps.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/easing/utils/is-easing-array.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/events/add-dom-event.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/microtask.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/frameloop/sync-time.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/motion/features/definitions.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/copy.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/models.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/geometry/utils.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/node/state.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/shared/stack.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/styles/transform.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/projection/utils/measure.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/resize/handle-window.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/resize/index.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/observe.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/defaults.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/find.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/number-browser.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/number.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/test.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/transform.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/dom/value-types/type-int.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/keys-position.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/keys-transform.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/render.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/store.mjs +0 -0
- package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +1 -1
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/path.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/render.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/KeyframesResolver.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/setters.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/render/utils/variant-props.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/GlobalConfig.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/array.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/clamp.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/distance.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/hsla-to-rgba.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/is-browser.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/is-numerical-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/is-zero-value-string.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/immediate.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/number.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/mix/visibility.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/offsets/default.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/offsets/time.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/pipe.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/resolve-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/subscription-manager.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/transform.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/velocity-per-second.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/warn-once.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/utils/wrap.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/color/hex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/color/hsla.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/color/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/color/rgba.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/color/utils.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/complex/filter.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/complex/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/numbers/index.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/numbers/units.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/utils/color-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/utils/float-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/utils/is-nullish.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/utils/sanitize.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/types/utils/single-color-regex.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/use-will-change/is.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/utils/is-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{framer-motion@11.16.6 → framer-motion@12.4.10}/external/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/controls/BaseGroup.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/controls/Group.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/utils/get-value-transition.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/animation/waapi/utils/easing.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/drag/state/is-active.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/press/utils/state.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/gestures/utils/setup.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/is-bezier-definition.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/supports/flags.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-dom@11.16.4 → motion-dom@12.4.10}/external/motion-dom/dist/es/utils/supports/linear-easing.mjs +0 -0
- /package/dist/es/external/.pnpm/{motion-utils@11.16.0 → motion-utils@12.4.10}/external/motion-utils/dist/es/errors.mjs +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const core = require("@vueuse/core");
|
|
5
5
|
const heyListen = require("hey-listen");
|
|
6
|
-
const noop = (any) => any;
|
|
6
|
+
const noop = /* @__NO_SIDE_EFFECTS__ */ (any) => any;
|
|
7
7
|
let warning = noop;
|
|
8
8
|
exports.invariant = noop;
|
|
9
9
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -18,6 +18,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
// @__NO_SIDE_EFFECTS__
|
|
21
22
|
function memo(callback) {
|
|
22
23
|
let result;
|
|
23
24
|
return () => {
|
|
@@ -26,13 +27,13 @@ function memo(callback) {
|
|
|
26
27
|
return result;
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
const progress$1 = (from, to, value) => {
|
|
30
|
+
const progress$1 = /* @__NO_SIDE_EFFECTS__ */ (from, to, value) => {
|
|
30
31
|
const toFromDifference = to - from;
|
|
31
32
|
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
32
33
|
};
|
|
33
|
-
const secondsToMilliseconds$1 = (seconds) => seconds * 1e3;
|
|
34
|
-
const millisecondsToSeconds$1 = (milliseconds) => milliseconds / 1e3;
|
|
35
|
-
const supportsScrollTimeline = memo(() => window.ScrollTimeline !== void 0);
|
|
34
|
+
const secondsToMilliseconds$1 = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3;
|
|
35
|
+
const millisecondsToSeconds$1 = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3;
|
|
36
|
+
const supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== void 0);
|
|
36
37
|
class BaseGroupPlaybackControls {
|
|
37
38
|
constructor(animations) {
|
|
38
39
|
this.stop = () => this.runAll("stop");
|
|
@@ -135,7 +136,7 @@ function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
|
135
136
|
ease: (progress2) => {
|
|
136
137
|
return generator.next(duration * progress2).value / scale2;
|
|
137
138
|
},
|
|
138
|
-
duration: millisecondsToSeconds$1(duration)
|
|
139
|
+
duration: /* @__PURE__ */ millisecondsToSeconds$1(duration)
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
function isGenerator(type) {
|
|
@@ -152,18 +153,18 @@ class NativeAnimationControls {
|
|
|
152
153
|
get duration() {
|
|
153
154
|
var _a, _b, _c;
|
|
154
155
|
const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) || ((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) || 300;
|
|
155
|
-
return millisecondsToSeconds$1(Number(durationInMs));
|
|
156
|
+
return /* @__PURE__ */ millisecondsToSeconds$1(Number(durationInMs));
|
|
156
157
|
}
|
|
157
158
|
get time() {
|
|
158
159
|
var _a;
|
|
159
160
|
if (this.animation) {
|
|
160
|
-
return millisecondsToSeconds$1(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
|
|
161
|
+
return /* @__PURE__ */ millisecondsToSeconds$1(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
|
|
161
162
|
}
|
|
162
163
|
return 0;
|
|
163
164
|
}
|
|
164
165
|
set time(newTime) {
|
|
165
166
|
if (this.animation) {
|
|
166
|
-
this.animation.currentTime = secondsToMilliseconds$1(newTime);
|
|
167
|
+
this.animation.currentTime = /* @__PURE__ */ secondsToMilliseconds$1(newTime);
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
get speed() {
|
|
@@ -224,7 +225,7 @@ const supportsFlags = {
|
|
|
224
225
|
linearEasing: void 0
|
|
225
226
|
};
|
|
226
227
|
function memoSupports(callback, supportsFlag) {
|
|
227
|
-
const memoized = memo(callback);
|
|
228
|
+
const memoized = /* @__PURE__ */ memo(callback);
|
|
228
229
|
return () => {
|
|
229
230
|
var _a;
|
|
230
231
|
return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized();
|
|
@@ -242,7 +243,7 @@ const generateLinearEasing = (easing, duration, resolution = 10) => {
|
|
|
242
243
|
let points = "";
|
|
243
244
|
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
244
245
|
for (let i = 0; i < numPoints; i++) {
|
|
245
|
-
points += easing(progress$1(0, numPoints - 1, i)) + ", ";
|
|
246
|
+
points += easing(/* @__PURE__ */ progress$1(0, numPoints - 1, i)) + ", ";
|
|
246
247
|
}
|
|
247
248
|
return `linear(${points.substring(0, points.length - 2)})`;
|
|
248
249
|
};
|
|
@@ -283,7 +284,7 @@ function isDragActive() {
|
|
|
283
284
|
}
|
|
284
285
|
function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
285
286
|
var _a;
|
|
286
|
-
if (elementOrSelector instanceof
|
|
287
|
+
if (elementOrSelector instanceof EventTarget) {
|
|
287
288
|
return [elementOrSelector];
|
|
288
289
|
} else if (typeof elementOrSelector === "string") {
|
|
289
290
|
let root = document;
|
|
@@ -306,31 +307,40 @@ function setupGesture(elementOrSelector, options) {
|
|
|
306
307
|
const cancel = () => gestureAbortController.abort();
|
|
307
308
|
return [elements, eventOptions, cancel];
|
|
308
309
|
}
|
|
309
|
-
function
|
|
310
|
-
return (event
|
|
311
|
-
if (event.pointerType === "touch" || isDragActive())
|
|
312
|
-
return;
|
|
313
|
-
callback(event);
|
|
314
|
-
};
|
|
310
|
+
function isValidHover(event) {
|
|
311
|
+
return !(event.pointerType === "touch" || isDragActive());
|
|
315
312
|
}
|
|
316
313
|
function hover(elementOrSelector, onHoverStart, options = {}) {
|
|
317
314
|
const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);
|
|
318
|
-
const onPointerEnter =
|
|
315
|
+
const onPointerEnter = (enterEvent) => {
|
|
316
|
+
if (!isValidHover(enterEvent))
|
|
317
|
+
return;
|
|
319
318
|
const { target } = enterEvent;
|
|
320
|
-
const onHoverEnd = onHoverStart(enterEvent);
|
|
319
|
+
const onHoverEnd = onHoverStart(target, enterEvent);
|
|
321
320
|
if (typeof onHoverEnd !== "function" || !target)
|
|
322
321
|
return;
|
|
323
|
-
const onPointerLeave =
|
|
322
|
+
const onPointerLeave = (leaveEvent) => {
|
|
323
|
+
if (!isValidHover(leaveEvent))
|
|
324
|
+
return;
|
|
324
325
|
onHoverEnd(leaveEvent);
|
|
325
326
|
target.removeEventListener("pointerleave", onPointerLeave);
|
|
326
|
-
}
|
|
327
|
+
};
|
|
327
328
|
target.addEventListener("pointerleave", onPointerLeave, eventOptions);
|
|
328
|
-
}
|
|
329
|
+
};
|
|
329
330
|
elements.forEach((element) => {
|
|
330
331
|
element.addEventListener("pointerenter", onPointerEnter, eventOptions);
|
|
331
332
|
});
|
|
332
333
|
return cancel;
|
|
333
334
|
}
|
|
335
|
+
function capturePointer(event, action) {
|
|
336
|
+
const actionName = `${action}PointerCapture`;
|
|
337
|
+
if (event.target instanceof Element && actionName in event.target && event.pointerId !== void 0) {
|
|
338
|
+
try {
|
|
339
|
+
event.target[actionName](event.pointerId);
|
|
340
|
+
} catch (e) {
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
334
344
|
const isNodeOrChild = (parent, child) => {
|
|
335
345
|
if (!child) {
|
|
336
346
|
return false;
|
|
@@ -389,44 +399,66 @@ const enableKeyboardPress = (focusEvent, eventOptions) => {
|
|
|
389
399
|
function isValidPressEvent(event) {
|
|
390
400
|
return isPrimaryPointer$1(event) && !isDragActive();
|
|
391
401
|
}
|
|
392
|
-
function press(
|
|
393
|
-
const [
|
|
402
|
+
function press(targetOrSelector, onPressStart, options = {}) {
|
|
403
|
+
const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);
|
|
394
404
|
const startPress = (startEvent) => {
|
|
395
|
-
const
|
|
396
|
-
if (!isValidPressEvent(startEvent) || isPressing.has(
|
|
405
|
+
const target = startEvent.currentTarget;
|
|
406
|
+
if (!target || !isValidPressEvent(startEvent) || isPressing.has(target))
|
|
397
407
|
return;
|
|
398
|
-
isPressing.add(
|
|
399
|
-
|
|
408
|
+
isPressing.add(target);
|
|
409
|
+
capturePointer(startEvent, "set");
|
|
410
|
+
const onPressEnd = onPressStart(target, startEvent);
|
|
400
411
|
const onPointerEnd = (endEvent, success) => {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
412
|
+
target.removeEventListener("pointerup", onPointerUp);
|
|
413
|
+
target.removeEventListener("pointercancel", onPointerCancel);
|
|
414
|
+
capturePointer(endEvent, "release");
|
|
415
|
+
if (!isValidPressEvent(endEvent) || !isPressing.has(target)) {
|
|
404
416
|
return;
|
|
405
417
|
}
|
|
406
|
-
isPressing.delete(
|
|
418
|
+
isPressing.delete(target);
|
|
407
419
|
if (typeof onPressEnd === "function") {
|
|
408
420
|
onPressEnd(endEvent, { success });
|
|
409
421
|
}
|
|
410
422
|
};
|
|
411
423
|
const onPointerUp = (upEvent) => {
|
|
412
|
-
|
|
424
|
+
const isOutside = !upEvent.isTrusted ? false : checkOutside(upEvent, target instanceof Element ? target.getBoundingClientRect() : {
|
|
425
|
+
left: 0,
|
|
426
|
+
top: 0,
|
|
427
|
+
right: window.innerWidth,
|
|
428
|
+
bottom: window.innerHeight
|
|
429
|
+
});
|
|
430
|
+
if (isOutside) {
|
|
431
|
+
onPointerEnd(upEvent, false);
|
|
432
|
+
} else {
|
|
433
|
+
onPointerEnd(upEvent, !(target instanceof Element) || isNodeOrChild(target, upEvent.target));
|
|
434
|
+
}
|
|
413
435
|
};
|
|
414
436
|
const onPointerCancel = (cancelEvent) => {
|
|
415
437
|
onPointerEnd(cancelEvent, false);
|
|
416
438
|
};
|
|
417
|
-
|
|
418
|
-
|
|
439
|
+
target.addEventListener("pointerup", onPointerUp, eventOptions);
|
|
440
|
+
target.addEventListener("pointercancel", onPointerCancel, eventOptions);
|
|
441
|
+
target.addEventListener("lostpointercapture", onPointerCancel, eventOptions);
|
|
419
442
|
};
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
443
|
+
targets.forEach((target) => {
|
|
444
|
+
target = options.useGlobalTarget ? window : target;
|
|
445
|
+
let canAddKeyboardAccessibility = false;
|
|
446
|
+
if (target instanceof HTMLElement) {
|
|
447
|
+
canAddKeyboardAccessibility = true;
|
|
448
|
+
if (!isElementKeyboardAccessible(target) && target.getAttribute("tabindex") === null) {
|
|
449
|
+
target.tabIndex = 0;
|
|
450
|
+
}
|
|
423
451
|
}
|
|
424
|
-
const target = options.useGlobalTarget ? window : element;
|
|
425
452
|
target.addEventListener("pointerdown", startPress, eventOptions);
|
|
426
|
-
|
|
453
|
+
if (canAddKeyboardAccessibility) {
|
|
454
|
+
target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions);
|
|
455
|
+
}
|
|
427
456
|
});
|
|
428
457
|
return cancelEvents;
|
|
429
458
|
}
|
|
459
|
+
function checkOutside(event, rect) {
|
|
460
|
+
return event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom;
|
|
461
|
+
}
|
|
430
462
|
const clamp$1 = (min, max, v) => {
|
|
431
463
|
if (v > max)
|
|
432
464
|
return max;
|
|
@@ -475,10 +507,10 @@ const safeMin = 1e-3;
|
|
|
475
507
|
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) {
|
|
476
508
|
let envelope;
|
|
477
509
|
let derivative;
|
|
478
|
-
warning(duration <= secondsToMilliseconds$1(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
|
|
510
|
+
warning(duration <= /* @__PURE__ */ secondsToMilliseconds$1(springDefaults.maxDuration), "Spring duration must be 10 seconds or less");
|
|
479
511
|
let dampingRatio = 1 - bounce;
|
|
480
512
|
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
|
|
481
|
-
duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds$1(duration));
|
|
513
|
+
duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds$1(duration));
|
|
482
514
|
if (dampingRatio < 1) {
|
|
483
515
|
envelope = (undampedFreq2) => {
|
|
484
516
|
const exponentialDecay = undampedFreq2 * dampingRatio;
|
|
@@ -512,7 +544,7 @@ function findSpring({ duration = springDefaults.duration, bounce = springDefault
|
|
|
512
544
|
}
|
|
513
545
|
const initialGuess = 5 / duration;
|
|
514
546
|
const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
|
|
515
|
-
duration = secondsToMilliseconds$1(duration);
|
|
547
|
+
duration = /* @__PURE__ */ secondsToMilliseconds$1(duration);
|
|
516
548
|
if (isNaN(undampedFreq)) {
|
|
517
549
|
return {
|
|
518
550
|
stiffness: springDefaults.stiffness,
|
|
@@ -589,12 +621,12 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
589
621
|
const state2 = { done: false, value: origin };
|
|
590
622
|
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
|
|
591
623
|
...options,
|
|
592
|
-
velocity:
|
|
624
|
+
velocity: -/* @__PURE__ */ millisecondsToSeconds$1(options.velocity || 0)
|
|
593
625
|
});
|
|
594
626
|
const initialVelocity = velocity || 0;
|
|
595
627
|
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
|
|
596
628
|
const initialDelta = target - origin;
|
|
597
|
-
const undampedAngularFreq = millisecondsToSeconds$1(Math.sqrt(stiffness / mass));
|
|
629
|
+
const undampedAngularFreq = /* @__PURE__ */ millisecondsToSeconds$1(Math.sqrt(stiffness / mass));
|
|
598
630
|
const isGranularScale = Math.abs(initialDelta) < 5;
|
|
599
631
|
restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default);
|
|
600
632
|
restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default);
|
|
@@ -622,7 +654,7 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
622
654
|
if (!isResolvedFromDuration) {
|
|
623
655
|
let currentVelocity = 0;
|
|
624
656
|
if (dampingRatio < 1) {
|
|
625
|
-
currentVelocity = t === 0 ? secondsToMilliseconds$1(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
657
|
+
currentVelocity = t === 0 ? /* @__PURE__ */ secondsToMilliseconds$1(initialVelocity) : calcGeneratorVelocity(resolveSpring, t, current);
|
|
626
658
|
}
|
|
627
659
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
|
|
628
660
|
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
@@ -657,7 +689,7 @@ const mixNumber$2 = (from, to, progress2) => {
|
|
|
657
689
|
function fillOffset(offset, remaining) {
|
|
658
690
|
const min = offset[offset.length - 1];
|
|
659
691
|
for (let i = 1; i <= remaining; i++) {
|
|
660
|
-
const offsetProgress = progress$1(0, remaining, i);
|
|
692
|
+
const offsetProgress = /* @__PURE__ */ progress$1(0, remaining, i);
|
|
661
693
|
offset.push(mixNumber$2(min, 1, offsetProgress));
|
|
662
694
|
}
|
|
663
695
|
}
|
|
@@ -780,7 +812,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
780
812
|
}
|
|
781
813
|
const springTransition = { ...remainingTransition };
|
|
782
814
|
if (duration !== void 0) {
|
|
783
|
-
springTransition.duration = secondsToMilliseconds$1(duration);
|
|
815
|
+
springTransition.duration = /* @__PURE__ */ secondsToMilliseconds$1(duration);
|
|
784
816
|
}
|
|
785
817
|
const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
|
|
786
818
|
ease2 = springEasing.ease;
|
|
@@ -844,7 +876,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
|
|
|
844
876
|
for (let i = 0; i < valueSequence.length; i++) {
|
|
845
877
|
const { at, value, easing } = valueSequence[i];
|
|
846
878
|
keyframes2.push(value);
|
|
847
|
-
valueOffset.push(progress$1(0, totalDuration, at));
|
|
879
|
+
valueOffset.push(/* @__PURE__ */ progress$1(0, totalDuration, at));
|
|
848
880
|
valueEasing.push(easing || "easeOut");
|
|
849
881
|
}
|
|
850
882
|
if (valueOffset[0] !== 0) {
|
|
@@ -938,7 +970,25 @@ const MotionGlobalConfig = {
|
|
|
938
970
|
skipAnimations: false,
|
|
939
971
|
useManualTiming: false
|
|
940
972
|
};
|
|
941
|
-
|
|
973
|
+
const stepsOrder = [
|
|
974
|
+
"read",
|
|
975
|
+
// Read
|
|
976
|
+
"resolveKeyframes",
|
|
977
|
+
// Write/Read/Write/Read
|
|
978
|
+
"update",
|
|
979
|
+
// Compute
|
|
980
|
+
"preRender",
|
|
981
|
+
// Compute
|
|
982
|
+
"render",
|
|
983
|
+
// Write
|
|
984
|
+
"postRender"
|
|
985
|
+
// Compute
|
|
986
|
+
];
|
|
987
|
+
const statsBuffer = {
|
|
988
|
+
value: null,
|
|
989
|
+
addProjectionMetrics: null
|
|
990
|
+
};
|
|
991
|
+
function createRenderStep(runNextFrame, stepName) {
|
|
942
992
|
let thisFrame = /* @__PURE__ */ new Set();
|
|
943
993
|
let nextFrame = /* @__PURE__ */ new Set();
|
|
944
994
|
let isProcessing = false;
|
|
@@ -949,11 +999,13 @@ function createRenderStep(runNextFrame) {
|
|
|
949
999
|
timestamp: 0,
|
|
950
1000
|
isProcessing: false
|
|
951
1001
|
};
|
|
1002
|
+
let numCalls = 0;
|
|
952
1003
|
function triggerCallback(callback) {
|
|
953
1004
|
if (toKeepAlive.has(callback)) {
|
|
954
1005
|
step.schedule(callback);
|
|
955
1006
|
runNextFrame();
|
|
956
1007
|
}
|
|
1008
|
+
numCalls++;
|
|
957
1009
|
callback(latestFrameData);
|
|
958
1010
|
}
|
|
959
1011
|
const step = {
|
|
@@ -988,6 +1040,10 @@ function createRenderStep(runNextFrame) {
|
|
|
988
1040
|
isProcessing = true;
|
|
989
1041
|
[thisFrame, nextFrame] = [nextFrame, thisFrame];
|
|
990
1042
|
thisFrame.forEach(triggerCallback);
|
|
1043
|
+
if (stepName && statsBuffer.value) {
|
|
1044
|
+
statsBuffer.value.frameloop[stepName].push(numCalls);
|
|
1045
|
+
}
|
|
1046
|
+
numCalls = 0;
|
|
991
1047
|
thisFrame.clear();
|
|
992
1048
|
isProcessing = false;
|
|
993
1049
|
if (flushNextFrame) {
|
|
@@ -998,20 +1054,6 @@ function createRenderStep(runNextFrame) {
|
|
|
998
1054
|
};
|
|
999
1055
|
return step;
|
|
1000
1056
|
}
|
|
1001
|
-
const stepsOrder = [
|
|
1002
|
-
"read",
|
|
1003
|
-
// Read
|
|
1004
|
-
"resolveKeyframes",
|
|
1005
|
-
// Write/Read/Write/Read
|
|
1006
|
-
"update",
|
|
1007
|
-
// Compute
|
|
1008
|
-
"preRender",
|
|
1009
|
-
// Compute
|
|
1010
|
-
"render",
|
|
1011
|
-
// Write
|
|
1012
|
-
"postRender"
|
|
1013
|
-
// Compute
|
|
1014
|
-
];
|
|
1015
1057
|
const maxElapsed$1 = 40;
|
|
1016
1058
|
function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
1017
1059
|
let runNextFrame = false;
|
|
@@ -1023,14 +1065,16 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
1023
1065
|
};
|
|
1024
1066
|
const flagRunNextFrame = () => runNextFrame = true;
|
|
1025
1067
|
const steps2 = stepsOrder.reduce((acc, key) => {
|
|
1026
|
-
acc[key] = createRenderStep(flagRunNextFrame);
|
|
1068
|
+
acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : void 0);
|
|
1027
1069
|
return acc;
|
|
1028
1070
|
}, {});
|
|
1029
1071
|
const { read, resolveKeyframes, update, preRender, render, postRender } = steps2;
|
|
1030
1072
|
const processBatch = () => {
|
|
1031
1073
|
const timestamp = performance.now();
|
|
1032
1074
|
runNextFrame = false;
|
|
1033
|
-
|
|
1075
|
+
{
|
|
1076
|
+
state2.delta = useDefaultElapsed ? 1e3 / 60 : Math.max(Math.min(timestamp - state2.timestamp, maxElapsed$1), 1);
|
|
1077
|
+
}
|
|
1034
1078
|
state2.timestamp = timestamp;
|
|
1035
1079
|
state2.isProcessing = true;
|
|
1036
1080
|
read.process(state2);
|
|
@@ -1137,7 +1181,7 @@ class MotionValue {
|
|
|
1137
1181
|
* @internal
|
|
1138
1182
|
*/
|
|
1139
1183
|
constructor(init, options = {}) {
|
|
1140
|
-
this.version = "
|
|
1184
|
+
this.version = "12.4.10";
|
|
1141
1185
|
this.canTrackVelocity = null;
|
|
1142
1186
|
this.events = {};
|
|
1143
1187
|
this.updateAndNotify = (v, render = true) => {
|
|
@@ -2222,8 +2266,8 @@ class BaseAnimation {
|
|
|
2222
2266
|
const { name, type, velocity, delay: delay2, onComplete, onUpdate, isGenerator: isGenerator2 } = this.options;
|
|
2223
2267
|
if (!isGenerator2 && !canAnimate(keyframes2, name, type, velocity)) {
|
|
2224
2268
|
if (!delay2) {
|
|
2225
|
-
onUpdate
|
|
2226
|
-
onComplete
|
|
2269
|
+
onUpdate && onUpdate(getFinalKeyframe(keyframes2, this.options, finalKeyframe));
|
|
2270
|
+
onComplete && onComplete();
|
|
2227
2271
|
this.resolveFinishedPromise();
|
|
2228
2272
|
return;
|
|
2229
2273
|
} else {
|
|
@@ -2545,7 +2589,7 @@ function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer
|
|
|
2545
2589
|
break;
|
|
2546
2590
|
}
|
|
2547
2591
|
}
|
|
2548
|
-
const progressInRange = progress$1(input[i], input[i + 1], v);
|
|
2592
|
+
const progressInRange = /* @__PURE__ */ progress$1(input[i], input[i + 1], v);
|
|
2549
2593
|
return mixers[i](progressInRange);
|
|
2550
2594
|
};
|
|
2551
2595
|
return isClamp ? (v) => interpolator(clamp$1(input[0], input[inputLength - 1], v)) : interpolator;
|
|
@@ -2636,10 +2680,10 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2636
2680
|
const generatorFactory = isGenerator(type) ? type : generators[type] || keyframes;
|
|
2637
2681
|
let mapPercentToKeyframes;
|
|
2638
2682
|
let mirroredGenerator;
|
|
2683
|
+
if (process.env.NODE_ENV !== "production" && generatorFactory !== keyframes) {
|
|
2684
|
+
exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);
|
|
2685
|
+
}
|
|
2639
2686
|
if (generatorFactory !== keyframes && typeof keyframes$1[0] !== "number") {
|
|
2640
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2641
|
-
exports.invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);
|
|
2642
|
-
}
|
|
2643
2687
|
mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));
|
|
2644
2688
|
keyframes$1 = [0, 100];
|
|
2645
2689
|
}
|
|
@@ -2749,13 +2793,13 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2749
2793
|
}
|
|
2750
2794
|
get duration() {
|
|
2751
2795
|
const { resolved } = this;
|
|
2752
|
-
return resolved ? millisecondsToSeconds$1(resolved.calculatedDuration) : 0;
|
|
2796
|
+
return resolved ? /* @__PURE__ */ millisecondsToSeconds$1(resolved.calculatedDuration) : 0;
|
|
2753
2797
|
}
|
|
2754
2798
|
get time() {
|
|
2755
|
-
return millisecondsToSeconds$1(this.currentTime);
|
|
2799
|
+
return /* @__PURE__ */ millisecondsToSeconds$1(this.currentTime);
|
|
2756
2800
|
}
|
|
2757
2801
|
set time(newTime) {
|
|
2758
|
-
newTime = secondsToMilliseconds$1(newTime);
|
|
2802
|
+
newTime = /* @__PURE__ */ secondsToMilliseconds$1(newTime);
|
|
2759
2803
|
this.currentTime = newTime;
|
|
2760
2804
|
if (this.holdTime !== null || this.speed === 0) {
|
|
2761
2805
|
this.holdTime = newTime;
|
|
@@ -2770,7 +2814,7 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
2770
2814
|
const hasChanged2 = this.playbackSpeed !== newSpeed;
|
|
2771
2815
|
this.playbackSpeed = newSpeed;
|
|
2772
2816
|
if (hasChanged2) {
|
|
2773
|
-
this.time = millisecondsToSeconds$1(this.currentTime);
|
|
2817
|
+
this.time = /* @__PURE__ */ millisecondsToSeconds$1(this.currentTime);
|
|
2774
2818
|
}
|
|
2775
2819
|
}
|
|
2776
2820
|
play() {
|
|
@@ -2871,7 +2915,7 @@ function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0
|
|
|
2871
2915
|
const easing = mapEasingToNativeEasing(ease2, duration);
|
|
2872
2916
|
if (Array.isArray(easing))
|
|
2873
2917
|
keyframeOptions.easing = easing;
|
|
2874
|
-
|
|
2918
|
+
const animation = element.animate(keyframeOptions, {
|
|
2875
2919
|
delay: delay2,
|
|
2876
2920
|
duration,
|
|
2877
2921
|
easing: !Array.isArray(easing) ? easing : "linear",
|
|
@@ -2879,6 +2923,7 @@ function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0
|
|
|
2879
2923
|
iterations: repeat + 1,
|
|
2880
2924
|
direction: repeatType === "reverse" ? "alternate" : "normal"
|
|
2881
2925
|
});
|
|
2926
|
+
return animation;
|
|
2882
2927
|
}
|
|
2883
2928
|
const supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
2884
2929
|
const sampleDelta = 10;
|
|
@@ -2925,9 +2970,8 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2925
2970
|
this.resolver.scheduleResolve();
|
|
2926
2971
|
}
|
|
2927
2972
|
initPlayback(keyframes2, finalKeyframe) {
|
|
2928
|
-
var _a;
|
|
2929
2973
|
let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options;
|
|
2930
|
-
if (!
|
|
2974
|
+
if (!motionValue2.owner || !motionValue2.owner.current) {
|
|
2931
2975
|
return false;
|
|
2932
2976
|
}
|
|
2933
2977
|
if (typeof ease2 === "string" && supportsLinearEasing() && isUnsupportedEase(ease2)) {
|
|
@@ -2973,21 +3017,21 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
2973
3017
|
if (!resolved)
|
|
2974
3018
|
return 0;
|
|
2975
3019
|
const { duration } = resolved;
|
|
2976
|
-
return millisecondsToSeconds$1(duration);
|
|
3020
|
+
return /* @__PURE__ */ millisecondsToSeconds$1(duration);
|
|
2977
3021
|
}
|
|
2978
3022
|
get time() {
|
|
2979
3023
|
const { resolved } = this;
|
|
2980
3024
|
if (!resolved)
|
|
2981
3025
|
return 0;
|
|
2982
3026
|
const { animation } = resolved;
|
|
2983
|
-
return millisecondsToSeconds$1(animation.currentTime || 0);
|
|
3027
|
+
return /* @__PURE__ */ millisecondsToSeconds$1(animation.currentTime || 0);
|
|
2984
3028
|
}
|
|
2985
3029
|
set time(newTime) {
|
|
2986
3030
|
const { resolved } = this;
|
|
2987
3031
|
if (!resolved)
|
|
2988
3032
|
return;
|
|
2989
3033
|
const { animation } = resolved;
|
|
2990
|
-
animation.currentTime = secondsToMilliseconds$1(newTime);
|
|
3034
|
+
animation.currentTime = /* @__PURE__ */ secondsToMilliseconds$1(newTime);
|
|
2991
3035
|
}
|
|
2992
3036
|
get speed() {
|
|
2993
3037
|
const { resolved } = this;
|
|
@@ -3077,7 +3121,7 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
3077
3121
|
times,
|
|
3078
3122
|
isGenerator: true
|
|
3079
3123
|
});
|
|
3080
|
-
const sampleTime = secondsToMilliseconds$1(this.time);
|
|
3124
|
+
const sampleTime = /* @__PURE__ */ secondsToMilliseconds$1(this.time);
|
|
3081
3125
|
motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
3082
3126
|
}
|
|
3083
3127
|
const { onStop } = this.options;
|
|
@@ -3098,11 +3142,15 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
3098
3142
|
}
|
|
3099
3143
|
static supports(options) {
|
|
3100
3144
|
const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options;
|
|
3101
|
-
|
|
3145
|
+
if (!motionValue2 || !motionValue2.owner || !(motionValue2.owner.current instanceof HTMLElement)) {
|
|
3146
|
+
return false;
|
|
3147
|
+
}
|
|
3148
|
+
const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
|
|
3149
|
+
return supportsWaapi() && name && acceleratedValues.has(name) && /**
|
|
3102
3150
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
3103
3151
|
* no way to read the value from WAAPI every frame.
|
|
3104
3152
|
*/
|
|
3105
|
-
!
|
|
3153
|
+
!onUpdate && !transformTemplate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia";
|
|
3106
3154
|
}
|
|
3107
3155
|
}
|
|
3108
3156
|
const underDampedSpring = {
|
|
@@ -3141,7 +3189,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
3141
3189
|
const valueTransition = getValueTransition$1(transition, name) || {};
|
|
3142
3190
|
const delay2 = valueTransition.delay || transition.delay || 0;
|
|
3143
3191
|
let { elapsed = 0 } = transition;
|
|
3144
|
-
elapsed = elapsed - secondsToMilliseconds$1(delay2);
|
|
3192
|
+
elapsed = elapsed - /* @__PURE__ */ secondsToMilliseconds$1(delay2);
|
|
3145
3193
|
let options = {
|
|
3146
3194
|
keyframes: Array.isArray(target) ? target : [null, target],
|
|
3147
3195
|
ease: "easeOut",
|
|
@@ -3167,10 +3215,10 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
3167
3215
|
};
|
|
3168
3216
|
}
|
|
3169
3217
|
if (options.duration) {
|
|
3170
|
-
options.duration = secondsToMilliseconds$1(options.duration);
|
|
3218
|
+
options.duration = /* @__PURE__ */ secondsToMilliseconds$1(options.duration);
|
|
3171
3219
|
}
|
|
3172
3220
|
if (options.repeatDelay) {
|
|
3173
|
-
options.repeatDelay = secondsToMilliseconds$1(options.repeatDelay);
|
|
3221
|
+
options.repeatDelay = /* @__PURE__ */ secondsToMilliseconds$1(options.repeatDelay);
|
|
3174
3222
|
}
|
|
3175
3223
|
if (options.from !== void 0) {
|
|
3176
3224
|
options.keyframes[0] = options.from;
|
|
@@ -3338,7 +3386,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
3338
3386
|
if (isMotionValue$1(nextValue)) {
|
|
3339
3387
|
element.addValue(key, nextValue);
|
|
3340
3388
|
if (process.env.NODE_ENV === "development") {
|
|
3341
|
-
warnOnce(nextValue.version === "
|
|
3389
|
+
warnOnce(nextValue.version === "12.4.10", `Attempting to mix Motion versions ${nextValue.version} with 12.4.10 may not work as expected.`);
|
|
3342
3390
|
}
|
|
3343
3391
|
} else if (isMotionValue$1(prevValue)) {
|
|
3344
3392
|
element.addValue(key, motionValue(nextValue, { owner: element }));
|
|
@@ -3410,7 +3458,8 @@ class VisualElement {
|
|
|
3410
3458
|
frame.render(this.render, false, true);
|
|
3411
3459
|
}
|
|
3412
3460
|
};
|
|
3413
|
-
const { latestValues, renderState } = visualState;
|
|
3461
|
+
const { latestValues, renderState, onUpdate } = visualState;
|
|
3462
|
+
this.onUpdate = onUpdate;
|
|
3414
3463
|
this.latestValues = latestValues;
|
|
3415
3464
|
this.baseTarget = { ...latestValues };
|
|
3416
3465
|
this.initialValues = props.initial ? { ...latestValues } : {};
|
|
@@ -3458,7 +3507,6 @@ class VisualElement {
|
|
|
3458
3507
|
this.update(this.props, this.presenceContext);
|
|
3459
3508
|
}
|
|
3460
3509
|
unmount() {
|
|
3461
|
-
visualElementStore.delete(this.current);
|
|
3462
3510
|
this.projection && this.projection.unmount();
|
|
3463
3511
|
cancelFrame(this.notifyUpdate);
|
|
3464
3512
|
cancelFrame(this.render);
|
|
@@ -3483,6 +3531,9 @@ class VisualElement {
|
|
|
3483
3531
|
this.valueSubscriptions.get(key)();
|
|
3484
3532
|
}
|
|
3485
3533
|
const valueIsTransform = transformProps.has(key);
|
|
3534
|
+
if (valueIsTransform && this.onBindTransform) {
|
|
3535
|
+
this.onBindTransform();
|
|
3536
|
+
}
|
|
3486
3537
|
const removeOnChange = value.on("change", (latestValue) => {
|
|
3487
3538
|
this.latestValues[key] = latestValue;
|
|
3488
3539
|
this.props.onUpdate && frame.preRender(this.notifyUpdate);
|
|
@@ -3576,6 +3627,7 @@ class VisualElement {
|
|
|
3576
3627
|
if (this.handleChildMotionValue) {
|
|
3577
3628
|
this.handleChildMotionValue();
|
|
3578
3629
|
}
|
|
3630
|
+
this.onUpdate && this.onUpdate(this);
|
|
3579
3631
|
}
|
|
3580
3632
|
getProps() {
|
|
3581
3633
|
return this.props;
|
|
@@ -3818,14 +3870,6 @@ function buildHTMLStyles(state2, latestValues, transformTemplate) {
|
|
|
3818
3870
|
style2.transformOrigin = `${originX} ${originY} ${originZ}`;
|
|
3819
3871
|
}
|
|
3820
3872
|
}
|
|
3821
|
-
function calcOrigin$1(origin, offset, size) {
|
|
3822
|
-
return typeof origin === "string" ? origin : px.transform(offset + size * origin);
|
|
3823
|
-
}
|
|
3824
|
-
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
3825
|
-
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width);
|
|
3826
|
-
const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
3827
|
-
return `${pxOriginX} ${pxOriginY}`;
|
|
3828
|
-
}
|
|
3829
3873
|
const dashKeys = {
|
|
3830
3874
|
offset: "stroke-dashoffset",
|
|
3831
3875
|
array: "stroke-dasharray"
|
|
@@ -3842,6 +3886,14 @@ function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true
|
|
|
3842
3886
|
const pathSpacing = px.transform(spacing);
|
|
3843
3887
|
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
3844
3888
|
}
|
|
3889
|
+
function calcOrigin$1(origin, offset, size) {
|
|
3890
|
+
return typeof origin === "string" ? origin : px.transform(offset + size * origin);
|
|
3891
|
+
}
|
|
3892
|
+
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
3893
|
+
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width);
|
|
3894
|
+
const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
3895
|
+
return `${pxOriginX} ${pxOriginY}`;
|
|
3896
|
+
}
|
|
3845
3897
|
function buildSVGAttrs(state2, {
|
|
3846
3898
|
attrX,
|
|
3847
3899
|
attrY,
|
|
@@ -3908,6 +3960,18 @@ const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
|
3908
3960
|
"lengthAdjust"
|
|
3909
3961
|
]);
|
|
3910
3962
|
const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg";
|
|
3963
|
+
function updateSVGDimensions(instance, renderState) {
|
|
3964
|
+
try {
|
|
3965
|
+
renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect();
|
|
3966
|
+
} catch (e) {
|
|
3967
|
+
renderState.dimensions = {
|
|
3968
|
+
x: 0,
|
|
3969
|
+
y: 0,
|
|
3970
|
+
width: 0,
|
|
3971
|
+
height: 0
|
|
3972
|
+
};
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3911
3975
|
function renderHTML(element, { style: style2, vars }, styleProp, projection) {
|
|
3912
3976
|
Object.assign(element.style, style2, projection && projection.getProjectionStyles(styleProp));
|
|
3913
3977
|
for (const key in vars) {
|
|
@@ -3922,7 +3986,12 @@ function renderSVG(element, renderState, _styleProp, projection) {
|
|
|
3922
3986
|
}
|
|
3923
3987
|
const scaleCorrectors = {};
|
|
3924
3988
|
function addScaleCorrector(correctors) {
|
|
3925
|
-
|
|
3989
|
+
for (const key in correctors) {
|
|
3990
|
+
scaleCorrectors[key] = correctors[key];
|
|
3991
|
+
if (isCSSVariableName(key)) {
|
|
3992
|
+
scaleCorrectors[key].isCSSVariable = true;
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3926
3995
|
}
|
|
3927
3996
|
function isForcedMotionValue(key, { layout, layoutId }) {
|
|
3928
3997
|
return transformProps.has(key) || key.startsWith("origin") || (layout || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
@@ -3954,6 +4023,11 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
3954
4023
|
this.type = "svg";
|
|
3955
4024
|
this.isSVGTag = false;
|
|
3956
4025
|
this.measureInstanceViewportBox = createBox$1;
|
|
4026
|
+
this.updateDimensions = () => {
|
|
4027
|
+
if (this.current && !this.renderState.dimensions) {
|
|
4028
|
+
updateSVGDimensions(this.current, this.renderState);
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
3957
4031
|
}
|
|
3958
4032
|
getBaseTargetFromProps(props, key) {
|
|
3959
4033
|
return props[key];
|
|
@@ -3969,6 +4043,11 @@ class SVGVisualElement extends DOMVisualElement {
|
|
|
3969
4043
|
scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
3970
4044
|
return scrapeMotionValuesFromProps(props, prevProps, visualElement);
|
|
3971
4045
|
}
|
|
4046
|
+
onBindTransform() {
|
|
4047
|
+
if (this.current && !this.renderState.dimensions) {
|
|
4048
|
+
frame.postRender(this.updateDimensions);
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
3972
4051
|
build(renderState, latestValues, props) {
|
|
3973
4052
|
buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate);
|
|
3974
4053
|
}
|
|
@@ -4225,7 +4304,7 @@ function animateSequence(sequence, options, scope) {
|
|
|
4225
4304
|
return animations;
|
|
4226
4305
|
}
|
|
4227
4306
|
function isSequence(value) {
|
|
4228
|
-
return Array.isArray(value) && Array.isArray
|
|
4307
|
+
return Array.isArray(value) && value.some(Array.isArray);
|
|
4229
4308
|
}
|
|
4230
4309
|
function createScopedAnimate(scope) {
|
|
4231
4310
|
function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {
|
|
@@ -4245,7 +4324,7 @@ function createScopedAnimate(scope) {
|
|
|
4245
4324
|
}
|
|
4246
4325
|
const animate = createScopedAnimate();
|
|
4247
4326
|
function setCSSVar(element, name, value) {
|
|
4248
|
-
element.style.setProperty(
|
|
4327
|
+
element.style.setProperty(name, value);
|
|
4249
4328
|
}
|
|
4250
4329
|
function setStyle(element, name, value) {
|
|
4251
4330
|
element.style[name] = value;
|
|
@@ -4294,7 +4373,7 @@ class NativeAnimation extends NativeAnimationControls {
|
|
|
4294
4373
|
if (isGenerator(options.type)) {
|
|
4295
4374
|
const generatorOptions = createGeneratorEasing(options, 100, options.type);
|
|
4296
4375
|
options.ease = supportsLinearEasing() ? generatorOptions.ease : defaultEasing;
|
|
4297
|
-
options.duration = secondsToMilliseconds$1(generatorOptions.duration);
|
|
4376
|
+
options.duration = /* @__PURE__ */ secondsToMilliseconds$1(generatorOptions.duration);
|
|
4298
4377
|
options.type = "keyframes";
|
|
4299
4378
|
} else {
|
|
4300
4379
|
options.ease = options.ease || defaultEasing;
|
|
@@ -4309,8 +4388,8 @@ class NativeAnimation extends NativeAnimationControls {
|
|
|
4309
4388
|
this.options = options;
|
|
4310
4389
|
this.updateFinishedPromise();
|
|
4311
4390
|
this.removeAnimation = () => {
|
|
4312
|
-
|
|
4313
|
-
|
|
4391
|
+
const elementState = state.get(element);
|
|
4392
|
+
elementState && elementState.delete(valueName);
|
|
4314
4393
|
};
|
|
4315
4394
|
};
|
|
4316
4395
|
if (!supportsWaapi()) {
|
|
@@ -4367,8 +4446,8 @@ function animateElements(elementOrSelector, keyframes2, options, scope) {
|
|
|
4367
4446
|
const valueOptions = {
|
|
4368
4447
|
...getValueTransition$1(elementTransition, valueName)
|
|
4369
4448
|
};
|
|
4370
|
-
valueOptions.duration = valueOptions.duration ? secondsToMilliseconds$1(valueOptions.duration) : valueOptions.duration;
|
|
4371
|
-
valueOptions.delay = secondsToMilliseconds$1(valueOptions.delay || 0);
|
|
4449
|
+
valueOptions.duration = valueOptions.duration ? /* @__PURE__ */ secondsToMilliseconds$1(valueOptions.duration) : valueOptions.duration;
|
|
4450
|
+
valueOptions.delay = /* @__PURE__ */ secondsToMilliseconds$1(valueOptions.delay || 0);
|
|
4372
4451
|
animations.push(new NativeAnimation(element, valueName, valueKeyframes, valueOptions));
|
|
4373
4452
|
}
|
|
4374
4453
|
}
|
|
@@ -4520,7 +4599,7 @@ function updateAxisInfo(element, axisName, info, time2) {
|
|
|
4520
4599
|
axis.offset.length = 0;
|
|
4521
4600
|
axis.offset[0] = 0;
|
|
4522
4601
|
axis.offset[1] = axis.scrollLength;
|
|
4523
|
-
axis.progress = progress$1(0, axis.scrollLength, axis.current);
|
|
4602
|
+
axis.progress = /* @__PURE__ */ progress$1(0, axis.scrollLength, axis.current);
|
|
4524
4603
|
const elapsed = time2 - prevTime;
|
|
4525
4604
|
axis.velocity = elapsed > maxElapsed ? 0 : velocityPerSecond(axis.current - prev, elapsed);
|
|
4526
4605
|
}
|
|
@@ -4826,7 +4905,7 @@ function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount =
|
|
|
4826
4905
|
if (entry.isIntersecting === Boolean(onEnd))
|
|
4827
4906
|
return;
|
|
4828
4907
|
if (entry.isIntersecting) {
|
|
4829
|
-
const newOnEnd = onStart(entry);
|
|
4908
|
+
const newOnEnd = onStart(entry.target, entry);
|
|
4830
4909
|
if (typeof newOnEnd === "function") {
|
|
4831
4910
|
activeIntersections.set(entry.target, newOnEnd);
|
|
4832
4911
|
} else {
|
|
@@ -4888,7 +4967,7 @@ function delay$1(callback, timeout) {
|
|
|
4888
4967
|
return () => cancelFrame(checkElapsed);
|
|
4889
4968
|
}
|
|
4890
4969
|
function delayInSeconds(callback, timeout) {
|
|
4891
|
-
return delay$1(callback, secondsToMilliseconds$1(timeout));
|
|
4970
|
+
return delay$1(callback, /* @__PURE__ */ secondsToMilliseconds$1(timeout));
|
|
4892
4971
|
}
|
|
4893
4972
|
const distance = (a, b) => Math.abs(a - b);
|
|
4894
4973
|
function distance2D(a, b) {
|
|
@@ -5397,7 +5476,7 @@ function handleHoverEvent$1(state2, event, lifecycle) {
|
|
|
5397
5476
|
}
|
|
5398
5477
|
class HoverGesture extends Feature {
|
|
5399
5478
|
isActive() {
|
|
5400
|
-
return Boolean(this.state.getOptions().
|
|
5479
|
+
return Boolean(this.state.getOptions().whileHover);
|
|
5401
5480
|
}
|
|
5402
5481
|
constructor(state2) {
|
|
5403
5482
|
super(state2);
|
|
@@ -5408,7 +5487,7 @@ class HoverGesture extends Feature {
|
|
|
5408
5487
|
return;
|
|
5409
5488
|
this.unmount = hover(
|
|
5410
5489
|
element,
|
|
5411
|
-
(startEvent) => {
|
|
5490
|
+
(el, startEvent) => {
|
|
5412
5491
|
handleHoverEvent$1(this.state, startEvent, "Start");
|
|
5413
5492
|
return (endEvent) => {
|
|
5414
5493
|
handleHoverEvent$1(this.state, endEvent, "End");
|
|
@@ -5449,7 +5528,7 @@ class PressGesture extends Feature {
|
|
|
5449
5528
|
return;
|
|
5450
5529
|
this.unmount = press(
|
|
5451
5530
|
element,
|
|
5452
|
-
(startEvent) => {
|
|
5531
|
+
(el, startEvent) => {
|
|
5453
5532
|
handlePressEvent(this.state, startEvent, "Start");
|
|
5454
5533
|
return (endEvent, { success }) => handlePressEvent(
|
|
5455
5534
|
this.state,
|
|
@@ -5474,7 +5553,7 @@ function handleHoverEvent(state2, entry, lifecycle) {
|
|
|
5474
5553
|
}
|
|
5475
5554
|
class InViewGesture extends Feature {
|
|
5476
5555
|
isActive() {
|
|
5477
|
-
return Boolean(this.state.getOptions().
|
|
5556
|
+
return Boolean(this.state.getOptions().whileInView);
|
|
5478
5557
|
}
|
|
5479
5558
|
constructor(state2) {
|
|
5480
5559
|
super(state2);
|
|
@@ -5487,7 +5566,7 @@ class InViewGesture extends Feature {
|
|
|
5487
5566
|
const { once, ...viewOptions } = this.state.getOptions().inViewOptions || {};
|
|
5488
5567
|
this.unmount = inView(
|
|
5489
5568
|
element,
|
|
5490
|
-
(entry) => {
|
|
5569
|
+
(_, entry) => {
|
|
5491
5570
|
handleHoverEvent(this.state, entry, "Enter");
|
|
5492
5571
|
if (!once) {
|
|
5493
5572
|
return (endEvent) => {
|
|
@@ -6626,7 +6705,7 @@ function compress(min, max, easing) {
|
|
|
6626
6705
|
return 0;
|
|
6627
6706
|
if (p > max)
|
|
6628
6707
|
return 1;
|
|
6629
|
-
return easing(progress$1(min, max, p));
|
|
6708
|
+
return easing(/* @__PURE__ */ progress$1(min, max, p));
|
|
6630
6709
|
};
|
|
6631
6710
|
}
|
|
6632
6711
|
function copyAxisInto(axis, originAxis) {
|
|
@@ -6868,13 +6947,6 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
|
|
|
6868
6947
|
function eachAxis(callback) {
|
|
6869
6948
|
return [callback("x"), callback("y")];
|
|
6870
6949
|
}
|
|
6871
|
-
const metrics = {
|
|
6872
|
-
type: "projectionFrame",
|
|
6873
|
-
totalNodes: 0,
|
|
6874
|
-
resolvedTargetDeltas: 0,
|
|
6875
|
-
recalculatedProjection: 0
|
|
6876
|
-
};
|
|
6877
|
-
const isDebug = typeof window !== "undefined" && window.MotionDebug !== void 0;
|
|
6878
6950
|
const transformAxes = ["", "X", "Y", "Z"];
|
|
6879
6951
|
const hiddenVisibility = { visibility: "hidden" };
|
|
6880
6952
|
const animationTarget = 1e3;
|
|
@@ -6940,16 +7012,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
6940
7012
|
};
|
|
6941
7013
|
this.updateProjection = () => {
|
|
6942
7014
|
this.projectionUpdateScheduled = false;
|
|
6943
|
-
if (isDebug) {
|
|
6944
|
-
metrics.totalNodes = metrics.resolvedTargetDeltas = metrics.recalculatedProjection = 0;
|
|
6945
|
-
}
|
|
6946
7015
|
this.nodes.forEach(propagateDirtyNodes);
|
|
6947
7016
|
this.nodes.forEach(resolveTargetDelta);
|
|
6948
7017
|
this.nodes.forEach(calcProjection);
|
|
6949
7018
|
this.nodes.forEach(cleanDirtyNodes);
|
|
6950
|
-
if (isDebug) {
|
|
6951
|
-
window.MotionDebug.record(metrics);
|
|
6952
|
-
}
|
|
6953
7019
|
};
|
|
6954
7020
|
this.resolvedRelativeTargetAt = 0;
|
|
6955
7021
|
this.hasProjected = false;
|
|
@@ -7014,7 +7080,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7014
7080
|
this.root.registerSharedNode(layoutId, this);
|
|
7015
7081
|
}
|
|
7016
7082
|
if (this.options.animate !== false && visualElement && (layoutId || layout)) {
|
|
7017
|
-
this.addEventListener("didUpdate", ({ delta, hasLayoutChanged,
|
|
7083
|
+
this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout }) => {
|
|
7018
7084
|
if (this.isTreeAnimationBlocked()) {
|
|
7019
7085
|
this.target = void 0;
|
|
7020
7086
|
this.relativeTarget = void 0;
|
|
@@ -7022,9 +7088,9 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7022
7088
|
}
|
|
7023
7089
|
const layoutTransition = this.options.transition || visualElement.getDefaultTransition() || defaultLayoutTransition;
|
|
7024
7090
|
const { onLayoutAnimationStart, onLayoutAnimationComplete } = visualElement.getProps();
|
|
7025
|
-
const
|
|
7026
|
-
const hasOnlyRelativeTargetChanged = !hasLayoutChanged &&
|
|
7027
|
-
if (this.options.layoutRoot || this.resumeFrom
|
|
7091
|
+
const hasTargetChanged = !this.targetLayout || !boxEqualsRounded(this.targetLayout, newLayout);
|
|
7092
|
+
const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;
|
|
7093
|
+
if (this.options.layoutRoot || this.resumeFrom || hasOnlyRelativeTargetChanged || hasLayoutChanged && (hasTargetChanged || !this.currentAnimation)) {
|
|
7028
7094
|
if (this.resumeFrom) {
|
|
7029
7095
|
this.resumingFrom = this.resumeFrom;
|
|
7030
7096
|
this.resumingFrom.resumingFrom = void 0;
|
|
@@ -7173,6 +7239,9 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7173
7239
|
if (this.snapshot || !this.instance)
|
|
7174
7240
|
return;
|
|
7175
7241
|
this.snapshot = this.measure();
|
|
7242
|
+
if (this.snapshot && !calcLength(this.snapshot.measuredBox.x) && !calcLength(this.snapshot.measuredBox.y)) {
|
|
7243
|
+
this.snapshot = void 0;
|
|
7244
|
+
}
|
|
7176
7245
|
}
|
|
7177
7246
|
updateLayout() {
|
|
7178
7247
|
if (!this.instance)
|
|
@@ -7405,9 +7474,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7405
7474
|
this.relativeParent = this.relativeTarget = void 0;
|
|
7406
7475
|
}
|
|
7407
7476
|
}
|
|
7408
|
-
if (isDebug) {
|
|
7409
|
-
metrics.resolvedTargetDeltas++;
|
|
7410
|
-
}
|
|
7411
7477
|
}
|
|
7412
7478
|
getClosestProjectingParent() {
|
|
7413
7479
|
if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) {
|
|
@@ -7473,9 +7539,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7473
7539
|
this.scheduleRender();
|
|
7474
7540
|
this.notifyListeners("projectionUpdate", target);
|
|
7475
7541
|
}
|
|
7476
|
-
if (isDebug) {
|
|
7477
|
-
metrics.recalculatedProjection++;
|
|
7478
|
-
}
|
|
7479
7542
|
}
|
|
7480
7543
|
hide() {
|
|
7481
7544
|
this.isVisible = false;
|
|
@@ -7560,6 +7623,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7560
7623
|
this.mixTargetDelta(latest);
|
|
7561
7624
|
options.onUpdate && options.onUpdate(latest);
|
|
7562
7625
|
},
|
|
7626
|
+
onStop: () => {
|
|
7627
|
+
},
|
|
7563
7628
|
onComplete: () => {
|
|
7564
7629
|
options.onComplete && options.onComplete();
|
|
7565
7630
|
this.completeAnimation();
|
|
@@ -7731,7 +7796,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7731
7796
|
for (const key in scaleCorrectors) {
|
|
7732
7797
|
if (valuesToRender[key] === void 0)
|
|
7733
7798
|
continue;
|
|
7734
|
-
const { correct, applyTo } = scaleCorrectors[key];
|
|
7799
|
+
const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];
|
|
7735
7800
|
const corrected = styles.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead);
|
|
7736
7801
|
if (applyTo) {
|
|
7737
7802
|
const num = applyTo.length;
|
|
@@ -7739,7 +7804,11 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
7739
7804
|
styles[applyTo[i]] = corrected;
|
|
7740
7805
|
}
|
|
7741
7806
|
} else {
|
|
7742
|
-
|
|
7807
|
+
if (isCSSVariable) {
|
|
7808
|
+
this.options.visualElement.renderState.vars[key] = corrected;
|
|
7809
|
+
} else {
|
|
7810
|
+
styles[key] = corrected;
|
|
7811
|
+
}
|
|
7743
7812
|
}
|
|
7744
7813
|
}
|
|
7745
7814
|
if (this.options.layoutId) {
|
|
@@ -7798,7 +7867,7 @@ function notifyLayoutUpdate(node) {
|
|
|
7798
7867
|
calcBoxDelta(visualDelta, layout, snapshot.layoutBox);
|
|
7799
7868
|
}
|
|
7800
7869
|
const hasLayoutChanged = !isDeltaZero(layoutDelta);
|
|
7801
|
-
let
|
|
7870
|
+
let hasRelativeLayoutChanged = false;
|
|
7802
7871
|
if (!node.resumeFrom) {
|
|
7803
7872
|
const relativeParent = node.getClosestProjectingParent();
|
|
7804
7873
|
if (relativeParent && !relativeParent.resumeFrom) {
|
|
@@ -7809,7 +7878,7 @@ function notifyLayoutUpdate(node) {
|
|
|
7809
7878
|
const relativeLayout = createBox$1();
|
|
7810
7879
|
calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
|
|
7811
7880
|
if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
|
|
7812
|
-
|
|
7881
|
+
hasRelativeLayoutChanged = true;
|
|
7813
7882
|
}
|
|
7814
7883
|
if (relativeParent.options.layoutRoot) {
|
|
7815
7884
|
node.relativeTarget = relativeLayout;
|
|
@@ -7825,7 +7894,7 @@ function notifyLayoutUpdate(node) {
|
|
|
7825
7894
|
delta: visualDelta,
|
|
7826
7895
|
layoutDelta,
|
|
7827
7896
|
hasLayoutChanged,
|
|
7828
|
-
|
|
7897
|
+
hasRelativeLayoutChanged
|
|
7829
7898
|
});
|
|
7830
7899
|
} else if (node.isLead()) {
|
|
7831
7900
|
const { onExitComplete } = node.options;
|
|
@@ -7834,9 +7903,6 @@ function notifyLayoutUpdate(node) {
|
|
|
7834
7903
|
node.options.transition = void 0;
|
|
7835
7904
|
}
|
|
7836
7905
|
function propagateDirtyNodes(node) {
|
|
7837
|
-
if (isDebug) {
|
|
7838
|
-
metrics.totalNodes++;
|
|
7839
|
-
}
|
|
7840
7906
|
if (!node.parent)
|
|
7841
7907
|
return;
|
|
7842
7908
|
if (!node.isProjecting()) {
|
|
@@ -8160,8 +8226,12 @@ function resolveStateAnimation(controlActiveState, transition) {
|
|
|
8160
8226
|
STATE_TYPES.forEach((name) => {
|
|
8161
8227
|
if (!this.activeStates[name] || isAnimationControls(this.options[name]))
|
|
8162
8228
|
return;
|
|
8163
|
-
const definition =
|
|
8164
|
-
|
|
8229
|
+
const definition = this.options[name];
|
|
8230
|
+
let variant = core.isDef(definition) ? resolveVariant(definition, this.options.variants, this.options.custom) : void 0;
|
|
8231
|
+
if (this.visualElement.isVariantNode) {
|
|
8232
|
+
const controlVariant = resolveVariant(this.context[name], this.options.variants, this.options.custom);
|
|
8233
|
+
variant = controlVariant ? Object.assign(controlVariant || {}, variant) : variant;
|
|
8234
|
+
}
|
|
8165
8235
|
if (!variant)
|
|
8166
8236
|
return;
|
|
8167
8237
|
Object.assign(transition, variant.transition);
|
|
@@ -8259,6 +8329,7 @@ class MotionState {
|
|
|
8259
8329
|
initial: true,
|
|
8260
8330
|
animate: true
|
|
8261
8331
|
};
|
|
8332
|
+
this.currentProcess = null;
|
|
8262
8333
|
this._context = null;
|
|
8263
8334
|
this.animateUpdates = animateUpdates;
|
|
8264
8335
|
this.id = `motion-state-${id++}`;
|
|
@@ -8344,7 +8415,7 @@ class MotionState {
|
|
|
8344
8415
|
this.updateOptions();
|
|
8345
8416
|
this.featureManager.mount();
|
|
8346
8417
|
if (!notAnimate && this.options.animate) {
|
|
8347
|
-
this.
|
|
8418
|
+
this.startAnimation();
|
|
8348
8419
|
}
|
|
8349
8420
|
if (this.options.layoutId) {
|
|
8350
8421
|
mountedLayoutIds.add(this.options.layoutId);
|
|
@@ -8353,6 +8424,22 @@ class MotionState {
|
|
|
8353
8424
|
});
|
|
8354
8425
|
}
|
|
8355
8426
|
}
|
|
8427
|
+
clearAnimation() {
|
|
8428
|
+
var _a;
|
|
8429
|
+
this.currentProcess && cancelFrame(this.currentProcess);
|
|
8430
|
+
this.currentProcess = null;
|
|
8431
|
+
(_a = this.visualElement.variantChildren) == null ? void 0 : _a.forEach((child) => {
|
|
8432
|
+
child.state.clearAnimation();
|
|
8433
|
+
});
|
|
8434
|
+
}
|
|
8435
|
+
// update trigger animation
|
|
8436
|
+
startAnimation() {
|
|
8437
|
+
this.clearAnimation();
|
|
8438
|
+
this.currentProcess = frame.render(() => {
|
|
8439
|
+
this.currentProcess = null;
|
|
8440
|
+
this.animateUpdates();
|
|
8441
|
+
});
|
|
8442
|
+
}
|
|
8356
8443
|
// Called before unmounting, executes in child-to-parent order
|
|
8357
8444
|
beforeUnmount() {
|
|
8358
8445
|
this.featureManager.beforeUnmount();
|
|
@@ -8394,7 +8481,7 @@ class MotionState {
|
|
|
8394
8481
|
this.updateOptions();
|
|
8395
8482
|
this.featureManager.update();
|
|
8396
8483
|
if (hasAnimateChange) {
|
|
8397
|
-
this.
|
|
8484
|
+
this.startAnimation();
|
|
8398
8485
|
}
|
|
8399
8486
|
}
|
|
8400
8487
|
// Set animation state active status and propagate to children
|
|
@@ -9095,11 +9182,18 @@ function useTransform(input, inputRangeOrTransformer, outputRange, options) {
|
|
|
9095
9182
|
if (typeof input === "function") {
|
|
9096
9183
|
return useComputed(input);
|
|
9097
9184
|
}
|
|
9098
|
-
const transformer =
|
|
9185
|
+
const transformer = vue.computed(() => {
|
|
9186
|
+
return typeof inputRangeOrTransformer === "function" ? inputRangeOrTransformer : transform(vue.isRef(inputRangeOrTransformer) ? inputRangeOrTransformer.value : inputRangeOrTransformer, outputRange, options);
|
|
9187
|
+
});
|
|
9099
9188
|
return Array.isArray(input) ? useListTransform(
|
|
9100
9189
|
input,
|
|
9101
9190
|
transformer
|
|
9102
|
-
) : useListTransform([input], ([latest]) =>
|
|
9191
|
+
) : useListTransform([input], ([latest]) => {
|
|
9192
|
+
if (vue.isRef(transformer)) {
|
|
9193
|
+
return transformer.value(latest);
|
|
9194
|
+
}
|
|
9195
|
+
return transformer(latest);
|
|
9196
|
+
});
|
|
9103
9197
|
}
|
|
9104
9198
|
function useListTransform(values, transformer) {
|
|
9105
9199
|
const latest = [];
|
|
@@ -9109,7 +9203,7 @@ function useListTransform(values, transformer) {
|
|
|
9109
9203
|
for (let i = 0; i < numValues; i++) {
|
|
9110
9204
|
latest[i] = values[i].get();
|
|
9111
9205
|
}
|
|
9112
|
-
return transformer(latest);
|
|
9206
|
+
return vue.isRef(transformer) ? transformer.value(latest) : transformer(latest);
|
|
9113
9207
|
});
|
|
9114
9208
|
subscribe(values);
|
|
9115
9209
|
return value;
|
|
@@ -9168,17 +9262,23 @@ function useSpring(source, config = {}) {
|
|
|
9168
9262
|
animation.sample(frameData.delta);
|
|
9169
9263
|
}
|
|
9170
9264
|
stopAnimation2();
|
|
9265
|
+
const springConfig = vue.isRef(config) ? config.value : config;
|
|
9171
9266
|
activeSpringAnimation = animateValue({
|
|
9172
9267
|
keyframes: [value.get(), latestValue],
|
|
9173
9268
|
velocity: value.getVelocity(),
|
|
9174
9269
|
type: "spring",
|
|
9175
9270
|
restDelta: 1e-3,
|
|
9176
9271
|
restSpeed: 0.01,
|
|
9177
|
-
...
|
|
9272
|
+
...springConfig,
|
|
9178
9273
|
onUpdate: latestSetter
|
|
9179
9274
|
});
|
|
9180
9275
|
};
|
|
9181
|
-
vue.watch(() =>
|
|
9276
|
+
vue.watch(() => {
|
|
9277
|
+
if (vue.isRef(config)) {
|
|
9278
|
+
return config.value;
|
|
9279
|
+
}
|
|
9280
|
+
return config;
|
|
9281
|
+
}, () => {
|
|
9182
9282
|
value.attach((v, set) => {
|
|
9183
9283
|
latestValue = v;
|
|
9184
9284
|
latestSetter = set;
|
|
@@ -9711,6 +9811,7 @@ exports.frame = frame;
|
|
|
9711
9811
|
exports.frameData = frameData;
|
|
9712
9812
|
exports.frameSteps = frameSteps;
|
|
9713
9813
|
exports.getContextWindow = getContextWindow;
|
|
9814
|
+
exports.hover = hover;
|
|
9714
9815
|
exports.inView = inView;
|
|
9715
9816
|
exports.inertia = inertia;
|
|
9716
9817
|
exports.injectLayoutGroup = injectLayoutGroup;
|
|
@@ -9727,6 +9828,7 @@ exports.motionValue = motionValue;
|
|
|
9727
9828
|
exports.mountedStates = mountedStates;
|
|
9728
9829
|
exports.noop = noop;
|
|
9729
9830
|
exports.pipe = pipe;
|
|
9831
|
+
exports.press = press;
|
|
9730
9832
|
exports.progress = progress$1;
|
|
9731
9833
|
exports.provideLayoutGroup = provideLayoutGroup;
|
|
9732
9834
|
exports.provideMotion = provideMotion;
|