@nethesis/phone-island 1.1.4 → 1.1.5
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/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/distance.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js.map +1 -0
- package/dist/node_modules/motion-utils/dist/es/easing/circ.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/errors.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/errors.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +3 -3
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/utils/distance.mjs.js.map +0 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js.map +0 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js.map +0 -1
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/distance.mjs.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-visual-element.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs"],"sourcesContent":["\"use client\";\nimport { optimizedAppearDataAttribute } from 'motion-dom';\nimport { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n\nexport { useVisualElement };\n//# sourceMappingURL=use-visual-element.mjs.map\n"],"names":["getClosestProjectingNode","visualElement","options","allowProjection","parent","Component","visualState","props","createVisualElement","ProjectionNodeConstructor","isSVG","lazyContext","useContext","LazyContext","presenceContext","PresenceContext","motionConfig","MotionConfigContext","reducedMotionConfig","reducedMotion","skipAnimations","visualElementRef","useRef","hasMountedOnce","current","blockInitialAnimation","initial","manuallyAnimateOnMount","initialLayoutGroupConfig","SwitchLayoutGroupContext","type","initialPromotionConfig","layoutId","layout","drag","dragConstraints","layoutScroll","layoutRoot","layoutAnchor","layoutCrossfade","projection","latestValues","undefined","setOptions","alwaysMeasureLayout","Boolean","isRefObject","animationType","crossfade","isMounted","update","optimisedAppearId","optimizedAppearDataAttribute","wantsHandoff","window","MotionHandoffIsComplete","MotionHasOptimisedAnimation","MotionIsMounted","animationState","animateChanges","MotionHandoffMarkAsComplete","enteringChildren"],"mappings":"+hBA4OA,SAAAA,EAAAC,GAOI,GAAAA,EAEA,WAAAA,EAAAC,QAAAC,6BAEIH,EAAAC,EAAAG,OACR,0BA9NM,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,wDAcFC,EAAAC,aAAAC,EAAAA,aACAC,EAAAF,aAAAG,EAAAA,iBACAC,EAAAJ,aAAAK,EAAAA,qBACAC,EAAAF,EAAAG,cACAC,EAAAJ,EAAAI,eAEAC,EAAAC,SAAA,MAQAC,EAAAD,UAAA,oBASAD,EAAAG,SAAAhB,IACIa,EAAAG,QAAAhB,EAAAH,EAAA,kDAKIoB,wBAAAX,IAEI,IADAA,EAAAY,gFAcJL,EAAAG,QAAAG,wBAAA,IAIR,MAAA1B,EAAAoB,EAAAG,QAMAI,EAAAhB,aAAAiB,EAAAA,2BAEA5B,GAIIA,EAAAA,aAAAA,GAAA,SAAAA,EAAA6B,MAAA,QAAA7B,EAAA6B,MA0FR,SAAA7B,EAAAM,EAAAE,EAAAsB,GAMI,MAAAC,SAAAA,EAAAC,OAAAA,EAAAC,KAAAA,EAAAC,gBAAAA,EAAAC,aAAAA,EAAAC,WAAAA,EAAAC,aAAAA,EAAAC,gBAAAA,GAAAhC,EAWAN,EAAAuC,WAAA/B,IAAAA,EAAAR,EAAAwC,aAAAlC,EAGQmC,8BAAAA,eAIRzC,EAAAuC,WAAAG,WAAA,qBAGIC,oBAAAC,QAAAX,IAAAC,GAAAW,EAAAA,YAAAX,mBAUAY,cAAA,iBAAAd,EAAAA,EAAA,gCAEAe,UAAAT,8CAKR,mBA5HI,MAAAU,EAAA3B,UAAA,6BAMIrB,GAAAgD,EAAAzB,SACIvB,EAAAiD,OAAA3C,EAAAO,KAQR,MAAAqC,EAAA5C,EAAA6C,EAAAA,8BAEAC,EAAA/B,EAAAA,OAAAuB,QAAAM,IAGQ,oBAAAG,SAAAA,OAAAC,0BAAAJ,IACAG,OAAAE,8BAAAL,IAwDR,wCAhDI5B,EAAAC,SAAA,EAEAvB,IAEAgD,EAAAzB,SAAA,EACA8B,OAAAG,iBAAA,8EAgBIxD,EAAAyD,eAAAC,qCAKJ1D,kCAGIA,EAAAyD,eAAAC,iBAGJN,EAAA7B,8BAGQ8B,OAAAM,8BAAAT,KAGJE,EAAA7B,SAAA,GAOJvB,EAAA4D,sBAAAnB,KAGJzC,CACJ"}
|
|
1
|
+
{"version":3,"file":"use-visual-element.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs"],"sourcesContent":["\"use client\";\nimport { optimizedAppearDataAttribute } from 'motion-dom';\nimport { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n useInsertionEffect(() => {\n /**\n * Skip the update if the visual element was created with these props.\n * This isn't gated on the layout effect below having run, as a hidden\n * <Activity> runs insertion effects but not layout effects, and\n * props from renders made while hidden must still reach the element.\n */\n if (visualElement && visualElement.props !== props) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n /**\n * Layout effects re-run when a hidden Suspense/Activity boundary is\n * revealed, but passive effects only re-run if this component re-renders\n * (not the case for memoized elements). Replay animations on every\n * reconnection. Must be declared before the effect that sets hasMountedOnce.\n */\n useIsomorphicLayoutEffect(() => {\n if (!hasMountedOnce.current || !visualElement)\n return;\n visualElement.animationState?.animateChanges();\n visualElement.enteringChildren = undefined;\n }, []);\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n const projection = (visualElement.projection =\n new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)));\n projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n /**\n * This node will take over from its layoutId's current lead, so snapshot\n * the lead now, while rendering. By the time the lead unmounts (or this\n * node mounts) React may already have committed DOM changes that come\n * before it in the tree, like a sibling changing height, and a snapshot\n * taken then starts the animation from a position never seen on screen.\n *\n * If React discards this render (e.g. it suspends), nothing else\n * completes the update, so check it after the next frame as an\n * unmounting node does.\n */\n const lead = projection.getStack()?.lead;\n if (lead && !projection.root.isUpdateBlocked()) {\n lead.willUpdate();\n lead.scheduleCheckAfterUnmount();\n }\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n\nexport { useVisualElement };\n//# sourceMappingURL=use-visual-element.mjs.map\n"],"names":["getClosestProjectingNode","visualElement","options","allowProjection","parent","Component","visualState","props","createVisualElement","ProjectionNodeConstructor","isSVG","lazyContext","useContext","LazyContext","presenceContext","PresenceContext","motionConfig","MotionConfigContext","reducedMotionConfig","reducedMotion","skipAnimations","visualElementRef","useRef","hasMountedOnce","current","blockInitialAnimation","initial","manuallyAnimateOnMount","initialLayoutGroupConfig","SwitchLayoutGroupContext","type","initialPromotionConfig","layoutId","layout","drag","dragConstraints","layoutScroll","layoutRoot","layoutAnchor","layoutCrossfade","projection","undefined","alwaysMeasureLayout","Boolean","isRefObject","animationType","crossfade","update","optimisedAppearId","optimizedAppearDataAttribute","wantsHandoff","window","MotionHandoffIsComplete","MotionHasOptimisedAnimation","animationState","animateChanges","enteringChildren","MotionIsMounted","MotionHandoffMarkAsComplete"],"mappings":"+hBA2QA,SAAAA,EAAAC,GAOI,GAAAA,EAEA,WAAAA,EAAAC,QAAAC,6BAEIH,EAAAC,EAAAG,OACR,0BA7PM,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,wDAcFC,EAAAC,aAAAC,EAAAA,aACAC,EAAAF,aAAAG,EAAAA,iBACAC,EAAAJ,aAAAK,EAAAA,qBACAC,EAAAF,EAAAG,cACAC,EAAAJ,EAAAI,eAEAC,EAAAC,SAAA,MAQAC,EAAAD,UAAA,oBASAD,EAAAG,SAAAhB,IACIa,EAAAG,QAAAhB,EAAAH,EAAA,kDAKIoB,wBAAAX,IAEI,IADAA,EAAAY,gFAcJL,EAAAG,QAAAG,wBAAA,IAIR,MAAA1B,EAAAoB,EAAAG,QAMAI,EAAAhB,aAAAiB,EAAAA,2BAEA5B,GAIIA,EAAAA,aAAAA,GAAA,SAAAA,EAAA6B,MAAA,QAAA7B,EAAA6B,MAuGR,SAAA7B,EAAAM,EAAAE,EAAAsB,GAMI,MAAAC,SAAAA,EAAAC,OAAAA,EAAAC,KAAAA,EAAAC,gBAAAA,EAAAC,aAAAA,EAAAC,WAAAA,EAAAC,aAAAA,EAAAC,gBAAAA,GAAAhC,EAWAiC,EAAAvC,EAAAuC,gEAIYC,iDAORC,oBAAAC,QAAAT,IAAAC,GAAAS,EAAAA,YAAAT,mBAUAU,cAAA,iBAAAZ,EAAAA,EAAA,gCAEAa,UAAAP,sJAsBR,6DAnJYtC,EAAA8C,OAAAxC,EAAAO,KAQR,MAAAkC,EAAAzC,EAAA0C,EAAAA,8BAEAC,EAAA5B,EAAAA,OAAAqB,QAAAK,IAGQ,oBAAAG,SAAAA,OAAAC,0BAAAJ,IACAG,OAAAE,8BAAAL,IAoER,wCA1DIzB,EAAAC,SAAAvB,IAEAA,EAAAqD,gBAAAC,iBACAtD,EAAAuD,sBAAAf,yCAQAlB,EAAAC,SAAA,EAEAvB,IAEAkD,OAAAM,iBAAA,8EAgBIxD,EAAAqD,eAAAC,qCAKJtD,kCAGIA,EAAAqD,eAAAC,iBAGJL,EAAA1B,8BAGQ2B,OAAAO,8BAAAV,KAGJE,EAAA1B,SAAA,GAOJvB,EAAAuD,sBAAAf,KAGJxC,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=new Set(["animate","exit","variants","initial","style","values","
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);exports.isValidMotionProp=function(a){return a.startsWith("while")||a.startsWith("drag")&&"draggable"!==a||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||t.has(a)};
|
|
2
2
|
//# sourceMappingURL=valid-prop.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valid-prop.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs"],"sourcesContent":["/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"
|
|
1
|
+
{"version":3,"file":"valid-prop.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs"],"sourcesContent":["/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n\nexport { isValidMotionProp };\n//# sourceMappingURL=valid-prop.mjs.map\n"],"names":["validMotionProps","Set","key","startsWith","has"],"mappings":"oEAQA,MAAMA,EAAmB,IAAIC,IAAuB,CAChD,UACA,OACA,WACA,UACA,QACA,SACA,aACA,oBACA,SACA,UACA,wBACA,mBACA,sBACA,WACA,cACA,SACA,YACA,2BACA,kBACA,sBACA,SACA,SACA,eACA,aACA,kBACA,kBACA,kBACA,YACA,eACA,uCAWE,SAA4BC,GAC9B,OACIA,EAAIC,WAAW,UACdD,EAAIC,WAAW,SAAmB,cAARD,GAC3BA,EAAIC,WAAW,WACfD,EAAIC,WAAW,UACfD,EAAIC,WAAW,UACfD,EAAIC,WAAW,aACfH,EAAiBI,IAAIF,EAE7B"}
|
package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../motion/features/animations.mjs.js"),s=require("../../../motion/features/drag.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../motion/features/animations.mjs.js"),s=require("../../../motion/features/drag.mjs.js"),t=require("../../../motion/features/gestures.mjs.js"),r=require("../../../motion/features/layout.mjs.js");const o=Object.assign({},e.animations,t.gestureAnimations,s.drag,r.layout);exports.featureBundle=o;
|
|
2
2
|
//# sourceMappingURL=feature-bundle.mjs.js.map
|
package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-bundle.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs"],"sourcesContent":["import { animations } from '../../../motion/features/animations.mjs';\nimport { drag } from '../../../motion/features/drag.mjs';\nimport { gestureAnimations } from '../../../motion/features/gestures.mjs';\nimport { layout } from '../../../motion/features/layout.mjs';\n\nconst featureBundle = {
|
|
1
|
+
{"version":3,"file":"feature-bundle.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs"],"sourcesContent":["import { animations } from '../../../motion/features/animations.mjs';\nimport { drag } from '../../../motion/features/drag.mjs';\nimport { gestureAnimations } from '../../../motion/features/gestures.mjs';\nimport { layout } from '../../../motion/features/layout.mjs';\n\nconst featureBundle = /* @__PURE__ */ Object.assign({}, animations, gestureAnimations, drag, layout);\n\nexport { featureBundle };\n//# sourceMappingURL=feature-bundle.mjs.map\n"],"names":["featureBundle","Object","assign","animations","gestureAnimations","drag","layout"],"mappings":"4RAKaA,MAAAA,EAAgCC,OAAOC,OAChD,CAAA,EACAC,EAAAA,WACAC,EAAAA,kBACAC,EAAAA,KACAC,EAAMA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),r=require("../svg/use-props.mjs.js"),t=require("./utils/filter-props.mjs.js"),i=require("./utils/is-svg-component.mjs.js"),o=require("../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs.js");exports.useRender=function(u,n,l,{latestValues:p},m,j=!1,a){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),r=require("../svg/use-props.mjs.js"),t=require("./utils/filter-props.mjs.js"),i=require("./utils/is-svg-component.mjs.js"),o=require("../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs.js");exports.useRender=function(u,n,l,{latestValues:p},m,j=!1,a,c){const d=(a??i.isSVGComponent(u)?r.useSVGProps:s.useHTMLProps)(n,p,m,u),f=t.filterProps(n,"string"==typeof u,j,c),q=u!==e.Fragment?{...f,...d,ref:l}:{},{children:v}=n,g=e.useMemo(()=>o.isMotionValue(v)?v.get():v,[v]);return e.createElement(u,{...q,children:g})};
|
|
2
2
|
//# sourceMappingURL=use-render.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-render.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs"],"sourcesContent":["\"use client\";\nimport { isMotionValue } from 'motion-dom';\nimport { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nfunction useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n\nexport { useRender };\n//# sourceMappingURL=use-render.mjs.map\n"],"names":["
|
|
1
|
+
{"version":3,"file":"use-render.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs"],"sourcesContent":["\"use client\";\nimport { isMotionValue } from 'motion-dom';\nimport { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nfunction useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n\nexport { useRender };\n//# sourceMappingURL=use-render.mjs.map\n"],"names":["Component","props","ref","latestValues","isStatic","forwardMotionProps","isSVG","isValidProp","visualProps","isSVGComponent","useSVGProps","useHTMLProps","filteredProps","filterProps","children","renderedChildren","useMemo","isMotionValue","get","elementProps"],"mappings":"gWAeM,SAAAA,EAAAC,EAAAC,GAAAC,aAAAA,GAAAC,EAAAC,GAAAC,EAAAA,EAAAC,GAeF,MAGAC,GAHAF,GAAAG,EAAAA,eAAAT,GAAAU,EAAAA,YAAAC,gBAGAV,EAAAE,EAAAC,EAAAJ,GAMAY,EAAAC,EAAAA,YAAAZ,EAAA,iBAAAD,EAAAK,EAAAE,0CAcAO,SAAAA,GAAAb,EACAc,EAAAC,EAAAA,QAAA,IAAAC,EAAAA,cAAAH,GAAAA,EAAAI,MAAAJ,GAAAA,iCAMIK,EACAL,SAAAC,GAER"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../../motion/utils/valid-prop.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../../motion/utils/valid-prop.mjs.js"),i=require("../../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs.js");function t(i,t){return i.startsWith("on")?!o.isValidMotionProp(i):t?.(i)??!o.isValidMotionProp(i)}exports.filterProps=function(s,e,r,n){const a={};for(const l in s)"values"===l&&"object"==typeof s.values||i.isMotionValue(s[l])||(t(l,n)||!0===r&&o.isValidMotionProp(l)||!e&&!o.isValidMotionProp(l)||s.draggable&&l.startsWith("onDrag"))&&(a[l]=s[l]);return a};
|
|
2
2
|
//# sourceMappingURL=filter-props.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-props.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs"],"sourcesContent":["import { isMotionValue } from 'motion-dom';\nimport { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\
|
|
1
|
+
{"version":3,"file":"filter-props.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs"],"sourcesContent":["import { isMotionValue } from 'motion-dom';\nimport { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nfunction filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps };\n//# sourceMappingURL=filter-props.mjs.map\n"],"names":["shouldForward","key","isValidProp","startsWith","isValidMotionProp","props","isDom","forwardMotionProps","filteredProps","values","isMotionValue"],"mappings":"kNAKA,SAASA,EAAcC,EAAaC,GAChC,OAAOD,EAAIE,WAAW,OACfC,EAAAA,kBAAkBH,GACnBC,IAAcD,KAASG,EAAiBA,kBAACH,EACnD,qBAEM,SACFI,EACAC,EACAC,EACAL,GAEA,MAAMM,EAA6B,CAAA,EAEnC,IAAK,MAAMP,KAAOI,EAQF,WAARJ,GAA4C,iBAAjBI,EAAMI,QAEjCC,gBAAcL,EAAMJ,MAGpBD,EAAcC,EAAKC,KACK,IAAvBK,GAA+BH,oBAAkBH,KAChDK,IAAUF,EAAAA,kBAAkBH,IAE7BI,EAAsC,WACnCJ,EAAIE,WAAW,aAEnBK,EAAcP,GACVI,EAAMJ,IAIlB,OAAOO,CACX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),t=require("./utils/create-render-state.mjs.js"),r=require("../../../../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),t=require("./utils/create-render-state.mjs.js"),r=require("../../../../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js"),u=require("../../../../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.js");exports.useSVGProps=function(i,o,l,n){const a=e.useMemo(()=>{const e=t.createSvgRenderState();return r.buildSVGAttrs(e,o,u.isSVGTag(n),i.transformTemplate,i.style),{...e.attrs,style:{...e.style}}},[o]);if(i.style){const e={};return s.copyRawValuesOnly(e,i.style,i),{...a,style:{...e,...a.style}}}return a};
|
|
2
2
|
//# sourceMappingURL=use-props.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-props.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs"],"sourcesContent":["\"use client\";\nimport { buildSVGAttrs, isSVGTag } from 'motion-dom';\nimport { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const
|
|
1
|
+
{"version":3,"file":"use-props.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs"],"sourcesContent":["\"use client\";\nimport { buildSVGAttrs, isSVGTag } from 'motion-dom';\nimport { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n /**\n * Build a fresh style each render rather than writing back into\n * the memoised visualProps, which would carry the previous\n * render's raw styles over (and above) the latest ones.\n */\n const style = {};\n copyRawValuesOnly(style, props.style, props);\n return { ...visualProps, style: { ...style, ...visualProps.style } };\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n//# sourceMappingURL=use-props.mjs.map\n"],"names":["props","visualState","_isStatic","Component","visualProps","useMemo","state","createSvgRenderState","buildSVGAttrs","isSVGTag","transformTemplate","style"],"mappings":"0WASM,SAAAA,EAAAC,EAAAC,EAAAC,GAMF,MAAAC,EAAAC,EAAAA,QAAA,KACI,MAAAC,EAAAC,EAAAA,8BAEAC,gBAAAF,EAAAL,EAAAQ,WAAAN,GAAAH,EAAAU,kBAAAV,EAAAW,mBAUIA,MAAA,IAAAL,EAAAK,SAER,CAAAV,IAEA,GAAAD,EAAAW,MAAA,YAQI,wCAAA,IAAAP,EAAAO,MAAA,IAAAA,KAAAP,EAAAO,QAGJ,OAAAP,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("./JSAnimation.mjs.js"),i=require("./keyframes/get-final.mjs.js"),n=require("./keyframes/KeyframesResolver.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("./JSAnimation.mjs.js"),i=require("./keyframes/get-final.mjs.js"),n=require("./keyframes/KeyframesResolver.mjs.js"),a=require("./NativeAnimationExtended.mjs.js"),s=require("./utils/can-animate.mjs.js"),r=require("./utils/make-animation-instant.mjs.js"),o=require("./utils/resolve-start-time.mjs.js"),m=require("./utils/WithPromise.mjs.js"),l=require("./waapi/supports/waapi.mjs.js"),h=require("./waapi/transforms/TransformAnimation.mjs.js"),u=require("../../../../motion-utils/dist/es/global-config.mjs.js");class p extends m.WithPromise{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=e.time.now();const{keyframes:i,name:a,motionValue:s,element:r}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const m=r?.KeyframeResolver||n.KeyframeResolver;this.keyframeResolver=new m(i,(e,t,i)=>this.onKeyframesResolved(e,t,o,!i),a,s,r),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(n,m,p,y){this.keyframeResolver=void 0;const{name:d,type:f,velocity:c,delay:v,isHandoff:j,onUpdate:T}=p;this.resolvedAt=e.time.now();let A=!0;s.canAnimate(n,d,f,c)||(A=!1,!u.MotionGlobalConfig.instantAnimations&&v||T?.(i.getFinalKeyframe(n,p,m)),n[0]=n[n.length-1],r.makeAnimationInstant(p),p.repeat=0);const{onComplete:g}=p;p.finalKeyframe=m,p.keyframes=n,p.onComplete=()=>{g?.(),this.notifyFinished()};const k=A&&!j&&l.supportsBrowserAnimation(p),R=!k&&h.canGroupTransform(p);let q;if(y&&(k||R||this.resolvedAt!==this.createdAt)&&(p.startTime??(p.startTime=o.resolveStartTime(this.createdAt,this.resolvedAt))),k){p.element=p.motionValue?.owner?.current;try{q=new a.NativeAnimationExtended(p)}catch{q=new t.JSAnimation(p)}}else q=R?new h.TransformAnimation(p):new t.JSAnimation(p);this.pendingTimeline&&(this.stopTimeline=q.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=q}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),n.flushKeyframeResolvers()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}exports.AsyncMotionValueAnimation=p;
|
|
2
2
|
//# sourceMappingURL=AsyncMotionValueAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncMotionValueAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs"],"sourcesContent":["import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n"],"names":["AsyncMotionValueAnimation","WithPromise","constructor","autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element","options","super","this","stop","_animation","stopTimeline","keyframeResolver","cancel","createdAt","time","now","optionsWithDefaults","KeyframeResolver","resolvedKeyframes","finalKeyframe","forced","onKeyframesResolved","scheduleResolve","sync","undefined","velocity","isHandoff","onUpdate","resolvedAt","canAnimateValue","canAnimate","MotionGlobalConfig","instantAnimations","getFinalKeyframe","length","makeAnimationInstant","resolvedOptions","startTime","useWaapi","supportsBrowserAnimation","owner","current","animation","NativeAnimationExtended","JSAnimation","finished","then","notifyFinished","catch","noop","pendingTimeline","attachTimeline","_finished","onResolve","_onReject","finally","resume","flushKeyframeResolvers","duration","iterationDuration","newTime","speed","state","newSpeed","timeline","play","pause","complete"],"mappings":"0kBAoCM,MAAOA,UACDC,EAAAA,YAeRC,WAAAA,EAAYC,SACRA,GAAW,EAAIC,MACfA,EAAQ,EAACC,KACTA,EAAO,YAAWC,OAClBA,EAAS,EAACC,YACVA,EAAc,EAACC,WACfA,EAAa,OAAMC,UACnBA,EAASC,KACTA,EAAIC,YACJA,EAAWC,QACXA,KACGC,IAEHC,QA8NJC,KAAAC,KAAO,KACCD,KAAKE,aACLF,KAAKE,WAAWD,OAChBD,KAAKG,kBAGTH,KAAKI,kBAAkBC,UAlOvBL,KAAKM,UAAYC,OAAKC,MAEtB,MAAMC,EAAkD,CACpDrB,WACAC,QACAC,OACAC,SACAC,cACAC,aACAE,OACAC,cACAC,aACGC,GAGDY,EACFb,GAASa,kBAAoBA,mBAEjCV,KAAKI,iBAAmB,IAAIM,EACxBhB,EACA,CACIiB,EACAC,EACAC,IAEAb,KAAKc,oBACDH,EACAC,EACAH,GACCI,GAETlB,EACAC,EACAC,GAEJG,KAAKI,kBAAkBW,iBAC3B,CAEAD,mBAAAA,CACIpB,EACAkB,EACAd,EACAkB,GAEAhB,KAAKI,sBAAmBa,EAExB,MAAMtB,KAAEA,EAAIL,KAAEA,EAAI4B,SAAEA,EAAQ7B,MAAEA,EAAK8B,UAAEA,EAASC,SAAEA,GAAatB,EAC7DE,KAAKqB,WAAad,OAAKC,MAMvB,IAAIc,GAAkB,EACjBC,EAAUA,WAAC7B,EAAWC,EAAML,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5B,KAAO8C,CAC1B,CAEA,SAAIC,GACA,OAAOtD,KAAKmC,UAAUmB,KAC1B,CAEA,SAAIC,GACA,OAAOvD,KAAKmC,UAAUoB,KAC1B,CAEA,SAAID,CAAME,GACNxD,KAAKmC,UAAUmB,MAAQE,CAC3B,CAEA,aAAI1B,GACA,OAAO9B,KAAKmC,UAAUL,SAC1B,CAEAc,cAAAA,CAAea,GAOX,OANIzD,KAAKE,WACLF,KAAKG,aAAeH,KAAKmC,UAAUS,eAAea,GAElDzD,KAAK2C,gBAAkBc,EAGpB,IAAMzD,KAAKC,MACtB,CAEAyD,IAAAA,GACI1D,KAAKmC,UAAUuB,MACnB,CAEAC,KAAAA,GACI3D,KAAKmC,UAAUwB,OACnB,CAEAC,QAAAA,GACI5D,KAAKmC,UAAUyB,UACnB,CAEAvD,MAAAA,GACQL,KAAKE,YACLF,KAAKmC,UAAU9B,SAGnBL,KAAKI,kBAAkBC,QAC3B"}
|
|
1
|
+
{"version":3,"file":"AsyncMotionValueAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs"],"sourcesContent":["import { MotionGlobalConfig } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\nimport { canGroupTransform, TransformAnimation } from './waapi/transforms/TransformAnimation.mjs';\n\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor(options) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const { keyframes, name, motionValue, element } = options;\n /**\n * animateMotionValue builds a fresh options object per value, so\n * it's completed in place as keyframes resolve rather than copied.\n */\n const optionsWithDefaults = options;\n optionsWithDefaults.autoplay ?? (optionsWithDefaults.autoplay = true);\n optionsWithDefaults.delay ?? (optionsWithDefaults.delay = 0);\n optionsWithDefaults.type ?? (optionsWithDefaults.type = \"keyframes\");\n optionsWithDefaults.repeat ?? (optionsWithDefaults.repeat = 0);\n optionsWithDefaults.repeatDelay ?? (optionsWithDefaults.repeatDelay = 0);\n optionsWithDefaults.repeatType ?? (optionsWithDefaults.repeatType = \"loop\");\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n const { onComplete } = options;\n options.finalKeyframe = finalKeyframe;\n options.keyframes = keyframes;\n /**\n * JSAnimation and NativeAnimation call onComplete exactly when\n * their own `finished` resolves, so this replaces a promise chain\n * per value with a callback.\n */\n options.onComplete = () => {\n onComplete?.();\n this.notifyFinished();\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue && !isHandoff && supportsBrowserAnimation(options);\n /**\n * Independent transforms (x, scale etc) on an HTML element are\n * composed into one WAAPI transform animation per element.\n */\n const isGroupedTransform = !useWaapi && canGroupTransform(options);\n /**\n * Resolve startTime for the animation. A startTime passed in options\n * (an optimised appear handoff syncing to its WAAPI animation) takes\n * precedence.\n *\n * *Ideally*, we would use the createdAt time as t=0 as the following\n * frame would then be the first frame of the animation in progress,\n * which would feel snappier. If keyframes resolved on a later frame,\n * and long after creation, we start from then instead.\n *\n * If they resolved immediately, a JSAnimation picks its own start\n * time and resolves it the same way on its first frame, so every\n * animation started in that moment stays in sync. WAAPI has no frame\n * of ours to do that on.\n */\n if (sync &&\n (useWaapi ||\n isGroupedTransform ||\n this.resolvedAt !== this.createdAt)) {\n options.startTime ?? (options.startTime = resolveStartTime(this.createdAt, this.resolvedAt));\n }\n let animation;\n if (useWaapi) {\n /**\n * The resolver needed the VisualElement, WAAPI needs the DOM\n * element. JSAnimation reads neither, so this is safe to\n * leave in place if we fall back to it.\n */\n options.element = options.motionValue?.owner?.current;\n try {\n animation = new NativeAnimationExtended(options);\n }\n catch {\n animation = new JSAnimation(options);\n }\n }\n else if (isGroupedTransform) {\n animation = new TransformAnimation(options);\n }\n else {\n animation = new JSAnimation(options);\n }\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n return this._animation ? this._animation.finished : super.finished;\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n /**\n * The value now, if the animation runs on the compositor.\n */\n liveValue() {\n return this._animation?.liveValue?.();\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n"],"names":["AsyncMotionValueAnimation","WithPromise","constructor","options","super","this","stop","_animation","stopTimeline","keyframeResolver","cancel","createdAt","time","now","keyframes","name","motionValue","element","optionsWithDefaults","autoplay","delay","type","repeat","repeatDelay","repeatType","KeyframeResolver","resolvedKeyframes","finalKeyframe","forced","onKeyframesResolved","scheduleResolve","sync","undefined","velocity","isHandoff","onUpdate","resolvedAt","canAnimateValue","canAnimate","MotionGlobalConfig","instantAnimations","getFinalKeyframe","length","makeAnimationInstant","onComplete","notifyFinished","useWaapi","supportsBrowserAnimation","isGroupedTransform","canGroupTransform","animation","startTime","resolveStartTime","owner","current","NativeAnimationExtended","JSAnimation","TransformAnimation","pendingTimeline","attachTimeline","finished","then","onResolve","_onReject","finally","liveValue","resume","flushKeyframeResolvers","duration","iterationDuration","newTime","speed","state","newSpeed","timeline","play","pause","complete"],"mappings":"ynBAgCM,MAAOA,UACDC,EAAAA,YAeRC,WAAAA,CAAYC,GACRC,QAqPJC,KAAAC,KAAO,KACCD,KAAKE,aACLF,KAAKE,WAAWD,OAChBD,KAAKG,kBAG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Q,cAAAA,CAAee,GAOX,OANIrE,KAAKE,WACLF,KAAKG,aAAeH,KAAK6C,UAAUS,eAAee,GAElDrE,KAAKqD,gBAAkBgB,EAGpB,IAAMrE,KAAKC,MACtB,CAEAqE,IAAAA,GACItE,KAAK6C,UAAUyB,MACnB,CAEAC,KAAAA,GACIvE,KAAK6C,UAAU0B,OACnB,CAEAC,QAAAA,GACIxE,KAAK6C,UAAU2B,UACnB,CAEAnE,MAAAA,GACQL,KAAKE,YACLF,KAAK6C,UAAUxC,SAGnBL,KAAKI,kBAAkBC,QAC3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../frameloop/sync-time.mjs.js"),e=require("../utils/mix/index.mjs.js"),i=require("./drivers/frame.mjs.js"),s=require("./generators/inertia.mjs.js"),r=require("./generators/keyframes.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../frameloop/sync-time.mjs.js"),e=require("../utils/mix/index.mjs.js"),i=require("./drivers/frame.mjs.js"),s=require("./generators/inertia.mjs.js"),r=require("./generators/keyframes.mjs.js"),a=require("./generators/utils/calc-duration.mjs.js"),n=require("./generators/utils/velocity.mjs.js"),o=require("./keyframes/get-final.mjs.js"),h=require("./utils/replace-transition-type.mjs.js"),l=require("./utils/resolve-start-time.mjs.js"),m=require("./utils/notify-inspector.mjs.js"),d=require("./utils/WithPromise.mjs.js"),u=require("../../../../motion-utils/dist/es/errors.mjs.js"),p=require("../../../../motion-utils/dist/es/pipe.mjs.js"),c=require("../../../../motion-utils/dist/es/time-conversion.mjs.js"),T=require("../../../../motion-utils/dist/es/clamp.mjs.js");const y=t=>t/100,v=t=>Math.round(1e4*t)/1e4;class f extends d.WithPromise{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==t.time.now()&&this.tick(t.time.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause(),m.notifyAnimationStart(this,this.options)}initAnimation(){const{options:t}=this;h.replaceTransitionType(t);const{type:i=r.keyframes,repeat:s=0,repeatDelay:n=0,repeatType:o,velocity:l=0}=t;let{keyframes:m}=t;const d=i||r.keyframes;"production"!==process.env.NODE_ENV&&d!==r.keyframes&&u.invariant(m.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${m}`,"spring-two-frames"),d!==r.keyframes&&"number"!=typeof m[0]&&(this.mixKeyframes=p.pipe(y,e.mix(m[0],m[1])),m=[0,100]);const c=d(m===t.keyframes?t:{...t,keyframes:m});"mirror"===o&&(this.mirroredGenerator=d({...t,keyframes:[...m].reverse(),velocity:-l})),null===c.calculatedDuration&&(c.calculatedDuration=a.calcGeneratorDuration(c));const{calculatedDuration:T}=c;this.calculatedDuration=T,this.resolvedDuration=T+n,this.totalDuration=this.resolvedDuration*(s+1)-n,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:n=0,keyframes:h,type:m,onUpdate:d,finalKeyframe:u}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=l.resolveStartTime(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const p=this.currentTime-n*(this.playbackSpeed>=0?1:-1),c=this.playbackSpeed>=0?p<0:p>r;this.currentTime=Math.max(p,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);const T=this.generate(this.currentTime,c);let{done:y}=T;c||null===a||(y=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const v=null===this.holdTime&&("finished"===this.state||"running"===this.state&&y);return v&&m!==s.inertia&&(T.value=o.getFinalKeyframe(h,this.options,u,this.speed)),d&&d(T.value),v&&this.finish(),T}at(t){return this.holdTime??v((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:i,totalDuration:r}=this,a=this.at(t)-(i.delay||0);return a>=r&&i.type!==s.inertia?o.getFinalKeyframe(i.keyframes,i,e?void 0:i.finalKeyframe):this.generate(Math.max(a,0),a<0).value}generate(t,e){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:n}=this,{keyframes:o,repeat:h,repeatType:l,repeatDelay:m}=this.options;let d,u=t,p=i;if(h){const e=Math.min(t,s)/n;let i=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&i--,i=Math.min(i,h+1);Boolean(i%2)&&("reverse"===l?(r=1-r,m&&(r-=m/n)):"mirror"===l&&(p=a)),u=T.clamp(0,1,r)*n}return e?(this.delayState.value=o[0],d=this.delayState):d=p.next(u),r&&!e&&(d.value=r(d.value)),d}then(t,e){return this.finished.then(t,e)}get duration(){return c.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c.millisecondsToSeconds(t)}get time(){return c.millisecondsToSeconds(this.currentTime)}set time(t){t=c.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return n.calcGeneratorVelocity(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){const i=this.playbackSpeed!==e;i&&this.driver&&this.updateTime(t.time.now()),this.playbackSpeed=e,i&&this.driver&&(this.time=c.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=i.frameloopDriver,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=s)),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(t.time.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}exports.JSAnimation=f,exports.round=v;
|
|
2
2
|
//# sourceMappingURL=JSAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","value","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","animationTime","Math","round","sample","next","delay","onUpdate","finalKeyframe","speed","min","timeWithoutDelay","isInDelayPhase","max","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","isAnimationFinished","inertia","getFinalKeyframe","finish","then","resolve","reject","finished","duration","millisecondsToSeconds","iterationDuration","newTime","secondsToMilliseconds","driver","start","getGeneratorVelocity","t","current","s","newSpeed","hasChanged","frameloopDriver","onPlay","updateFinished","complete","notifyFinished","onComplete","cancel","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"mvBA4BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAEnD,MAAOC,UACDC,EAAAA,YA2DRC,WAAAA,CAAYC,GACRC,QAzDJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQnBF,KAAAG,WAAY,EAeZH,KAAAI,YAAsB,EAKtBJ,KAAAK,SAA0B,KAK1BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC,CACpCC,MAAM,EACNC,WAAOC,GA8YXV,KAAAW,KAAO,KACH,MAAMC,YAAEA,GAAgBZ,KAAKF,QACzBc,GAAeA,EAAYC,YAAcC,EAAIA,KAACC,OAC9Cf,KAAKgB,KAAKF,OAAKC,OAGnBf,KAAKG,WAAY,EACE,SAAfH,KAAKC,QACTD,KAAKiB,WACLjB,KAAKF,QAAQoB,aAjZblB,KAAKF,QAAUA,EACfE,KAAKmB,gBACLnB,KAAKoB,QAEoB,IAArBtB,EAAQuB,UAAoBrB,KAAKsB,OACzC,CAEAH,aAAAA,GACI,MAAMrB,QAAEA,GAAYE,KAEpBuB,EAAqBA,sBAACzB,GAEtB,MAAM0B,KACFA,EAAOC,EAAkBA,UAAAC,OACzBA,EAAS,EAACC,YACVA,EAAc,EAACC,WACfA,EAAUC,SACVA,EAAW,GACX/B,EACJ,IAAI2B,UAAEK,GAAchC,EAEpB,MAAMiC,EACDP,GAA6BC,YAGL,eAAzBO,QAAQC,IAAIC,UACZH,IAAqBI,EAAAA,WAErBC,YACIN,EAAUO,QAAU,EACpB,gGAAgGP,IAChG,qBAKJC,IAAqBI,EAAAA,WACG,iBAAjBV,EAAU,KAEjBzB,KA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YAAS1E,EAClB,CAEA2C,MAAAA,CAAOgD,GAEH,OADArG,KAAKE,UAAY,EACVF,KAAKgB,KAAKqF,GAAY,EACjC,CAEAC,cAAAA,CAAeC,GAQX,OAPIvG,KAAKF,QAAQ0G,eACbxG,KAAKF,QAAQ0B,KAAO,YACpBxB,KAAKF,QAAQ2G,KAAO,SACpBzG,KAAKmB,iBAGTnB,KAAKoF,QAAQzE,OACN4F,EAASG,QAAQ1G,KAC5B"}
|
|
1
|
+
{"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { calcGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nconst round = (value) => Math.round(value * 10000) / 10000;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n notifyAnimationStart(this, this.options);\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory(keyframes$1 === options.keyframes\n ? options\n : { ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, calculatedDuration } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, type, onUpdate, finalKeyframe, } = this.options;\n if (this.startTime === this.pendingStartTime) {\n this.startTime = resolveStartTime(this.startTime, timestamp);\n }\n this.pendingStartTime = undefined;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n const state = this.generate(this.currentTime, isInDelayPhase);\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * This animation's time, including delay, at a timestamp.\n */\n at(timestamp) {\n return (this.holdTime ??\n round((timestamp - this.startTime) * this.playbackSpeed));\n }\n /**\n * The value at a timestamp, without changing this animation's state.\n * If resolved, it ends at the last resolved keyframe, which is in the\n * same unit as the others, rather than at finalKeyframe.\n */\n sampleAt(timestamp, resolved) {\n const { options, totalDuration } = this;\n const t = this.at(timestamp) - (options.delay || 0);\n return t >= totalDuration && options.type !== inertia\n ? getFinalKeyframe(options.keyframes, options, resolved ? undefined : options.finalKeyframe)\n : this.generate(Math.max(t, 0), t < 0).value;\n }\n /**\n * The generator's state `currentTime` ms after the delay, without\n * changing the animation's own state.\n */\n generate(currentTime, isInDelayPhase) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, } = this;\n const { keyframes, repeat, repeatType, repeatDelay } = this.options;\n let elapsed = currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n return calcGeneratorVelocity(this.generator, this.currentTime, this.options.velocity);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime / (this.playbackSpeed || 1);\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? (this.pendingStartTime = now);\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue, round };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","round","value","Math","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","notifyAnimationStart","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","animationTime","sample","next","delay","onUpdate","finalKeyframe","pendingStartTime","resolveStartTime","speed","min","timeWithoutDelay","isInDelayPhase","max","generate","isAnimationFinished","inertia","getFinalKeyframe","finish","at","sampleAt","resolved","t","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","then","resolve","reject","finished","duration","millisecondsToSeconds","iterationDuration","newTime","secondsToMilliseconds","driver","start","getGeneratorVelocity","calcGeneratorVelocity","newSpeed","hasChanged","frameloopDriver","onPlay","updateFinished","complete","notifyFinished","onComplete","cancel","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"+0BA8BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAE5CC,EAASC,GAAkBC,KAAKF,MAAc,IAARC,GAAiB,IAE9D,MAAOE,UACDC,EAAAA,YAgERC,WAAAA,CAAYC,GACRC,QA9DJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQjBF,KAAAG,WAAY,EAoBdH,KAAAI,YAAsB,EAKpBJ,KAAAK,SAA0B,KAK5BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC,CACpCC,MAAM,EACNf,WAAOgB,GAwbXT,KAAAU,KAAO,KACH,MAAMC,YAAEA,GAAgBX,KAAKF,QACzBa,GAAeA,EAAYC,YAAcC,EAAIA,KAACC,OAC9Cd,KAAKe,KAAKF,OAAKC,OAGnBd,KAAKG,WAAY,EACE,SAAfH,KAAKC,QACTD,KAAKgB,WACLhB,KAAKF,QAAQmB,aA3bbjB,KAAKF,QAAUA,EACfE,KAAKkB,gBACLlB,KAAKmB,QAEoB,IAArBrB,EAAQsB,UAAoBpB,KAAKqB,QAErCC,EAAAA,qBAAqBtB,KAAMA,KAAKF,QACpC,CAEAoB,aAAAA,GACI,MAAMpB,QAA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|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../render/dom/style-set.mjs.js"),t=require("../utils/supports/scroll-timeline.mjs.js"),e=require("./keyframes/get-final.mjs.js"),s=require("./utils/WithPromise.mjs.js"),n=require("./waapi/start-waapi-animation.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../render/dom/style-set.mjs.js"),t=require("../utils/supports/scroll-timeline.mjs.js"),e=require("./keyframes/get-final.mjs.js"),s=require("./utils/WithPromise.mjs.js"),n=require("./utils/notify-inspector.mjs.js"),a=require("./waapi/start-waapi-animation.mjs.js"),o=require("./waapi/utils/apply-generator.mjs.js"),m=require("../../../../motion-utils/dist/es/errors.mjs.js"),l=require("../../../../motion-utils/dist/es/time-conversion.mjs.js"),r=require("../../../../motion-utils/dist/es/noop.mjs.js");class h extends s.WithPromise{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:l,keyframes:r,pseudoElement:h,allowFlatten:u=!1,finalKeyframe:p,onComplete:d}=t;this.isPseudoElement=Boolean(h),this.allowFlatten=u,this.options=t,m.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=o.applyGeneratorOptions(t);this.animation=a.startWaapiAnimation(s,l,r,c,h),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!h){const t=e.getFinalKeyframe(r,this.options,p,this.speed);this.updateMotionValue&&this.updateMotionValue(t),i.setStyle(s,l,t),this.animation.cancel()}d?.(),this.notifyFinished()},n.notifyAnimationStart(this,t,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(i){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){const i=this.options?.element;!this.isPseudoElement&&i?.isConnected&&this.animation.commitStyles?.()}get duration(){const i=this.animation.effect?.getComputedTiming?.().duration||0;return l.millisecondsToSeconds(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+l.millisecondsToSeconds(i)}get time(){return l.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(i){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=l.secondsToMilliseconds(i),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(i){this.manualStartTime=this.animation.startTime=i}attachTimeline({timeline:i,onAttach:e,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,i&&t.supportsScrollTimeline()?(this.animation.timeline=i,e?.(this.animation),r.noop):s(this)}}exports.NativeAnimation=h;
|
|
2
2
|
//# sourceMappingURL=NativeAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","rangeStart","rangeEnd","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"2hBA4BM,MAAOA,UACDC,EAAAA,YAyBRC,WAAAA,CAAYC,GAGR,GAFAC,QAlBMC,KAAAC,aAA8B,KAMhCD,KAAAE,WAAY,EASVF,KAAAG,gBAAiC,MAKlCL,EAAS,OAEd,MAAMM,QACFA,EAAOC,KACPA,EAAIC,UACJA,EAASC,cACTA,EAAaC,aACbA,GAAe,EAAKC,cACpBA,EAAaC,WACbA,GACAZ,EAEJE,KAAKW,gBAAkBC,QAAQL,GAE/BP,KAAKQ,aAAeA,EACpBR,KAAKF,QAAUA,EAEfe,EAASA,UACmB,iBAAjBf,EAAQgB,KACf,sDACA,eAGJ,MAAMC,EAAaC,wBAAsBlB,GAEzCE,KAAKiB,UAAYC,EAAAA,oBACbd,EACAC,EACAC,EACAS,EACAR,IAGwB,IAAxBQ,EAAWI,UACXnB,KAAKiB,UAAUG,QAGnBpB,KAAKiB,UAAUI,SAAW,KAGtB,GAFArB,KAAKC,aAAeD,KAAKsB,MAEpBf,EAAe,CAChB,MAAMgB,EAAWC,EAAgBA,iBAC7BlB,EACAN,KAAKF,QACLW,EACAT,KAAKyB,OAELzB,KAAK0B,mBACL1B,KAAK0B,kBAAkBH,GAU3BI,EAAAA,SAASvB,EAASC,EAAMkB,GAExBvB,KAAKiB,UAAUW,QACnB,CAEAlB,MACAV,KAAK6B,iBA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AUiC,aAAeC,CAClC,CAEA,SAAIpB,GACA,OAA6B,OAAtB/B,KAAKC,aACN,WACAD,KAAKiB,UAAUmC,SACzB,CAEA,aAAIC,GACA,OAAOrD,KAAKG,iBAAmBwC,OAAO3C,KAAKiB,UAAUoC,UACzD,CAEA,aAAIA,CAAUC,GACVtD,KAAKG,gBAAkBH,KAAKiB,UAAUoC,UAAYC,CACtD,CAKAC,cAAAA,EAAeC,SACXA,EAAQC,WACRA,EAAUC,SACVA,EAAQC,QACRA,IAQA,OANI3D,KAAKQ,cACLR,KAAKiB,UAAUuB,QAAQoB,aAAa,CAAEC,OAAQ,WAGlD7D,KAAKiB,UAAUI,SAAW,KAEtBmC,GAAYM,EAAAA,0BACZ9D,KAAKiB,UAAUuC,SAAWA,EAEtBC,IAAazD,KAAKiB,UAAkBwC,WAAaA,GACjDC,IAAW1D,KAAKiB,UAAkByC,SAAWA,GAE1CK,QAEAJ,EAAQ3D,KAEvB"}
|
|
1
|
+
{"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n notifyAnimationStart(this, options, transition);\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n /**\n * Before its finish event, a finished animation (an instant one is\n * as soon as it starts) is still showing its end, so it's stopped\n * like a running one. Otherwise that event would apply its end\n * over whatever animates the value next.\n */\n if (this.state === \"idle\" || this.finishedTime !== null)\n return;\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement) {\n this.animation.onfinish = null;\n this.cancel();\n }\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, onAttach, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n onAttach?.(this.animation);\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","notifyAnimationStart","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","onAttach","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"wkBA6BM,MAAOA,UACDC,EAAAA,YAyBRC,WAAAA,CAAYC,GAGR,GAFAC,QAlBMC,KAAAC,aAA8B,KAMhCD,KAAAE,WAAY,EASVF,KAAAG,gBAAiC,MAKlCL,EAAS,OAEd,MAAMM,QACFA,EAAOC,KACPA,EAAIC,UACJA,EAASC,cACTA,EAAaC,aACbA,GAAe,EAAKC,cACpBA,EAAaC,WACbA,GACAZ,EAEJE,KAAKW,gBAAkBC,QAAQL,GAE/BP,KAAKQ,aAAeA,EACpBR,KAAKF,QAAUA,EAEfe,EAASA,UACmB,iBAAjBf,EAAQgB,KACf,sDACA,eAGJ,MAAMC,EAAaC,wBAAsBlB,GAEzCE,KAAKiB,UAAYC,EAAAA,oBACbd,EACAC,EACAC,EACAS,EACAR,IAGwB,IAAxBQ,EAAWI,UACXnB,KAAKiB,UAAUG,QAGnBpB,KAAKiB,UAAUI,SAAW,KAGtB,GAFArB,KAAKC,aAAeD,KAAKsB,MAEpBf,EAAe,CAChB,MAAMgB,EAAWC,EAAgBA,iBAC7BlB,EACAN,KAAKF,QACLW,EACAT,KAAKyB,OAELzB,KAAK0B,mBACL1B,KAAK0B,kBAAkBH,GAU3BI,EAAAA,SAASvB,EAASC,EAAMkB,GAExBvB,KAAKiB,UAAUW,QACnB,CAEAlB,MACAV,KAAK6B,kBAGTC,EAAAA,qBAAqB9B,KAAMF,EAASiB,EACxC,CAIAgB,IAAAA,GACQ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A,SAAIpB,GACA,OAA6B,OAAtBhC,KAAKC,aACN,WACAD,KAAKiB,UAAUoC,SACzB,CAEA,aAAIC,GACA,OAAOtD,KAAKG,iBAAmByC,OAAO5C,KAAKiB,UAAUqC,UACzD,CAEA,aAAIA,CAAUC,GACVvD,KAAKG,gBAAkBH,KAAKiB,UAAUqC,UAAYC,CACtD,CAKAC,cAAAA,EAAeC,SACXA,EAAQC,SACRA,EAAQC,QACRA,IAQA,OANI3D,KAAKQ,cACLR,KAAKiB,UAAUwB,QAAQmB,aAAa,CAAEC,OAAQ,WAGlD7D,KAAKiB,UAAUI,SAAW,KAEtBoC,GAAYK,EAAAA,0BACZ9D,KAAKiB,UAAUwC,SAAWA,EAC1BC,IAAW1D,KAAKiB,WAET8C,QAEAJ,EAAQ3D,KAEvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),s=require("./JSAnimation.mjs.js"),i=require("./NativeAnimation.mjs.js"),a=require("./utils/replace-transition-type.mjs.js"),n=require("./waapi/utils/unsupported-easing.mjs.js"),r=require("../../../../motion-utils/dist/es/clamp.mjs.js");class o extends i.NativeAnimation{constructor(e){n.replaceStringEasing(e),a.replaceTransitionType(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}elapsed(){return"running"===this.state?(e.time.now()-this.startTime)*this.speed:1e3*this.time}sample(e){if(!this.sampler){const{motionValue:e,onUpdate:t,onComplete:i,onPlay:a,onStop:n,element:r,...o}=this.options;this.sampler=new s.JSAnimation({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){const{state:e}=this;if("running"===e||"paused"===e)return this.sample(this.elapsed())}updateMotionValue(e){const{motionValue:s,element:i,name:a}=this.options;if(!s)return;if(void 0!==e)return void s.set(e);const{speed:n}=this,o=this.elapsed(),p="running"===this.state&&n?r.clamp(0,10,o):0,l=this.sample(o);i&&a&&t.setStyle(i,a,l),s.setWithVelocity(this.sample(o-p*Math.sign(n)),l,p/Math.abs(n||1))}}exports.NativeAnimationExtended=o,exports.sampleDelta=10;
|
|
2
2
|
//# sourceMappingURL=NativeAnimationExtended.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n *
|
|
1
|
+
{"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * The animation's time now, in ms. Wall-clock rather than WAAPI's\n * currentTime while running, as under CPU load currentTime may not\n * reflect the actual elapsed time, causing incorrect sampling and\n * visual jumps.\n */\n elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000;\n }\n /**\n * The value at a time, from a renderless JS animation.\n */\n sample(sampleTime) {\n if (!this.sampler) {\n const { motionValue, onUpdate, onComplete, onPlay, onStop, element, ...options } = this.options;\n /**\n * Stop it straight away so its driver doesn't run every frame.\n * It can still be sampled.\n */\n this.sampler = new JSAnimation({ ...options, autoplay: false });\n this.sampler.stop();\n }\n return this.sampler.sample(Math.max(0, sampleTime)).value;\n }\n /**\n * The value now, as WAAPI doesn't set the motion value while it runs.\n */\n liveValue() {\n const { state } = this;\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed());\n }\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * sample a renderless JS animation twice to calculate its current\n * value, \"previous\" value, and therefore allow Motion to calculate\n * velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, element, name } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const { speed } = this;\n const sampleTime = this.elapsed();\n const delta = this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0;\n const current = this.sample(sampleTime);\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(this.sample(sampleTime - delta * Math.sign(speed)), current, delta / Math.abs(speed || 1));\n }\n}\n\nexport { NativeAnimationExtended, sampleDelta };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n"],"names":["NativeAnimationExtended","NativeAnimation","constructor","options","replaceStringEasing","replaceTransitionType","super","undefined","startTime","autoplay","this","elapsed","state","time","now","speed","sample","sampleTime","sampler","motionValue","onUpdate","onComplete","onPlay","onStop","element","JSAnimation","stop","Math","max","value","liveValue","updateMotionValue","name","set","delta","clamp","current","setStyle","setWithVelocity","sign","abs"],"mappings":"2YAmBM,MAAOA,UAEHC,EAAAA,gBAGNC,WAAAA,CAAYC,GAURC,EAAmBA,oBAACD,GASpBE,EAAqBA,sBAACF,GAEtBG,MAAMH,QAOoBI,IAAtBJ,EAAQK,YAAgD,IAArBL,EAAQM,WAC3CC,KAAKF,UAAYL,EAAQK,WAG7BE,KAAKP,QAAUA,CACnB,CAUQQ,OAAAA,GACJ,MAAsB,YAAfD,KAAKE,OACLC,EAAAA,KAAKC,MAAQJ,KAAKF,WAAaE,KAAKK,MACzB,IAAZL,KAAKG,IACf,CAKQG,MAAAA,CAAOC,GACX,IAAKP,KAAKQ,QAAS,CACf,MAAMC,YACFA,EAAWC,SACXA,EAAQC,WACRA,EAAUC,OACVA,EAAMC,OACNA,EAAMC,QACNA,KACGrB,GACHO,KAAKP,QAMTO,KAAKQ,QAAU,IAAIO,cAAY,IAAKtB,EAASM,UAAU,IACvDC,KAAKQ,QAAQQ,MACjB,CAEA,OAAOhB,KAAKQ,QAAQF,OAAOW,KAAKC,IAAI,EAAGX,IAAaY,KACxD,CAKAC,SAAAA,GACI,MAAMlB,MAAEA,GAAUF,KAElB,GAAc,YAAVE,GAAiC,WAAVA,EACvB,OAAOF,KAAKM,OAAON,KAAKC,UAEhC,CAUAoB,iBAAAA,CAAkBF,GACd,MAAMV,YAAEA,EAAWK,QAAEA,EAAOQ,KAAEA,GAAStB,KAAKP,QAE5C,IAAKgB,EAAa,OAElB,QAAcZ,IAAVsB,EAEA,YADAV,EAAYc,IAAIJ,GAIpB,MAAMd,MAAEA,GAAUL,KACZO,EAAaP,KAAKC,UAClBuB,EACa,YAAfxB,KAAKE,OAAuBG,EACtBoB,EAAKA,MAAC,EAnHG,GAmHalB,GACtB,EACJmB,EAAU1B,KAAKM,OAAOC,GAOxBO,GAAWQ,GAAMK,EAAAA,SAASb,EAASQ,EAAMI,GAE7CjB,EAAYmB,gBACR5B,KAAKM,OAAOC,EAAaiB,EAAQP,KAAKY,KAAKxB,IAC3CqB,EACAF,EAAQP,KAAKa,IAAIzB,GAAS,GAElC,wDAnIuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame-data.mjs.js"),a=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const s=({timestamp:e})=>t(e);return{start:(e=!0)=>a.frame.update(s,e),stop:()=>a.cancelFrame(s),now:()=>r.frameData.isProcessing?r.frameData.timestamp:e.time.now()}};
|
|
2
2
|
//# sourceMappingURL=frame.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData
|
|
1
|
+
{"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\nimport { cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n"],"names":["update","passTimestamp","timestamp","start","keepAlive","frame","stop","cancelFrame","now","frameData","isProcessing","time"],"mappings":"uOAKwCA,IACpC,MAAMC,EAAgBA,EAAGC,eAA2BF,EAAOE,GAE3D,MAAO,CACHC,MAAOA,CAACC,GAAY,IAASC,EAAKA,MAACL,OAAOC,EAAeG,GACzDE,KAAMA,IAAMC,EAAWA,YAACN,GAKxBO,IAAKA,IAAOC,EAAAA,UAAUC,aAAeD,EAASA,UAACP,UAAYS,EAAIA,KAACH"}
|