framer-motion 12.23.26 → 12.23.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +2 -1
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/debug.js +1 -0
- package/dist/cjs/debug.js.map +1 -0
- package/dist/cjs/dom-mini.js +1 -0
- package/dist/cjs/dom-mini.js.map +1 -0
- package/dist/cjs/dom.js +1 -0
- package/dist/cjs/dom.js.map +1 -0
- package/dist/cjs/{feature-bundle-kvRbMDEA.js → feature-bundle-Dt2VtvSZ.js} +3 -2
- package/dist/cjs/feature-bundle-Dt2VtvSZ.js.map +1 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/m.js +1 -0
- package/dist/cjs/m.js.map +1 -0
- package/dist/cjs/mini.js +1 -0
- package/dist/cjs/mini.js.map +1 -0
- package/dist/dom-mini.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/animation/animate/index.mjs +1 -0
- package/dist/es/animation/animate/index.mjs.map +1 -0
- package/dist/es/animation/animate/resolve-subjects.mjs +1 -0
- package/dist/es/animation/animate/resolve-subjects.mjs.map +1 -0
- package/dist/es/animation/animate/sequence.mjs +1 -0
- package/dist/es/animation/animate/sequence.mjs.map +1 -0
- package/dist/es/animation/animate/single-value.mjs +1 -0
- package/dist/es/animation/animate/single-value.mjs.map +1 -0
- package/dist/es/animation/animate/subject.mjs +1 -0
- package/dist/es/animation/animate/subject.mjs.map +1 -0
- package/dist/es/animation/animators/waapi/animate-elements.mjs +1 -0
- package/dist/es/animation/animators/waapi/animate-elements.mjs.map +1 -0
- package/dist/es/animation/animators/waapi/animate-sequence.mjs +1 -0
- package/dist/es/animation/animators/waapi/animate-sequence.mjs.map +1 -0
- package/dist/es/animation/animators/waapi/animate-style.mjs +1 -0
- package/dist/es/animation/animators/waapi/animate-style.mjs.map +1 -0
- package/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +1 -0
- package/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs.map +1 -0
- package/dist/es/animation/hooks/animation-controls.mjs +1 -0
- package/dist/es/animation/hooks/animation-controls.mjs.map +1 -0
- package/dist/es/animation/hooks/use-animate-style.mjs +1 -0
- package/dist/es/animation/hooks/use-animate-style.mjs.map +1 -0
- package/dist/es/animation/hooks/use-animate.mjs +1 -0
- package/dist/es/animation/hooks/use-animate.mjs.map +1 -0
- package/dist/es/animation/hooks/use-animated-state.mjs +1 -0
- package/dist/es/animation/hooks/use-animated-state.mjs.map +1 -0
- package/dist/es/animation/hooks/use-animation.mjs +1 -0
- package/dist/es/animation/hooks/use-animation.mjs.map +1 -0
- package/dist/es/animation/interfaces/motion-value.mjs +1 -0
- package/dist/es/animation/interfaces/motion-value.mjs.map +1 -0
- package/dist/es/animation/interfaces/visual-element-target.mjs +1 -0
- package/dist/es/animation/interfaces/visual-element-target.mjs.map +1 -0
- package/dist/es/animation/interfaces/visual-element-variant.mjs +1 -0
- package/dist/es/animation/interfaces/visual-element-variant.mjs.map +1 -0
- package/dist/es/animation/interfaces/visual-element.mjs +1 -0
- package/dist/es/animation/interfaces/visual-element.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/data-id.mjs +1 -0
- package/dist/es/animation/optimized-appear/data-id.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/get-appear-id.mjs +1 -0
- package/dist/es/animation/optimized-appear/get-appear-id.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/handoff.mjs +1 -0
- package/dist/es/animation/optimized-appear/handoff.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/start.mjs +1 -0
- package/dist/es/animation/optimized-appear/start.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/store-id.mjs +1 -0
- package/dist/es/animation/optimized-appear/store-id.mjs.map +1 -0
- package/dist/es/animation/optimized-appear/store.mjs +1 -0
- package/dist/es/animation/optimized-appear/store.mjs.map +1 -0
- package/dist/es/animation/sequence/create.mjs +1 -0
- package/dist/es/animation/sequence/create.mjs.map +1 -0
- package/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +1 -0
- package/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map +1 -0
- package/dist/es/animation/sequence/utils/calc-time.mjs +1 -0
- package/dist/es/animation/sequence/utils/calc-time.mjs.map +1 -0
- package/dist/es/animation/sequence/utils/edit.mjs +1 -0
- package/dist/es/animation/sequence/utils/edit.mjs.map +1 -0
- package/dist/es/animation/sequence/utils/normalize-times.mjs +1 -0
- package/dist/es/animation/sequence/utils/normalize-times.mjs.map +1 -0
- package/dist/es/animation/sequence/utils/sort.mjs +1 -0
- package/dist/es/animation/sequence/utils/sort.mjs.map +1 -0
- package/dist/es/animation/utils/calc-child-stagger.mjs +1 -0
- package/dist/es/animation/utils/calc-child-stagger.mjs.map +1 -0
- package/dist/es/animation/utils/create-visual-element.mjs +1 -0
- package/dist/es/animation/utils/create-visual-element.mjs.map +1 -0
- package/dist/es/animation/utils/default-transitions.mjs +1 -0
- package/dist/es/animation/utils/default-transitions.mjs.map +1 -0
- package/dist/es/animation/utils/is-animation-controls.mjs +1 -0
- package/dist/es/animation/utils/is-animation-controls.mjs.map +1 -0
- package/dist/es/animation/utils/is-dom-keyframes.mjs +1 -0
- package/dist/es/animation/utils/is-dom-keyframes.mjs.map +1 -0
- package/dist/es/animation/utils/is-keyframes-target.mjs +1 -0
- package/dist/es/animation/utils/is-keyframes-target.mjs.map +1 -0
- package/dist/es/animation/utils/is-transition-defined.mjs +1 -0
- package/dist/es/animation/utils/is-transition-defined.mjs.map +1 -0
- package/dist/es/client.mjs +1 -0
- package/dist/es/client.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/PopChild.mjs +1 -0
- package/dist/es/components/AnimatePresence/PopChild.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/PresenceChild.mjs +1 -0
- package/dist/es/components/AnimatePresence/PresenceChild.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/index.mjs +1 -0
- package/dist/es/components/AnimatePresence/index.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/use-presence-data.mjs +1 -0
- package/dist/es/components/AnimatePresence/use-presence-data.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/use-presence.mjs +1 -0
- package/dist/es/components/AnimatePresence/use-presence.mjs.map +1 -0
- package/dist/es/components/AnimatePresence/utils.mjs +1 -0
- package/dist/es/components/AnimatePresence/utils.mjs.map +1 -0
- package/dist/es/components/AnimateSharedLayout.mjs +1 -0
- package/dist/es/components/AnimateSharedLayout.mjs.map +1 -0
- package/dist/es/components/LayoutGroup/index.mjs +1 -0
- package/dist/es/components/LayoutGroup/index.mjs.map +1 -0
- package/dist/es/components/LazyMotion/index.mjs +1 -0
- package/dist/es/components/LazyMotion/index.mjs.map +1 -0
- package/dist/es/components/MotionConfig/index.mjs +1 -0
- package/dist/es/components/MotionConfig/index.mjs.map +1 -0
- package/dist/es/components/Reorder/Group.mjs +1 -0
- package/dist/es/components/Reorder/Group.mjs.map +1 -0
- package/dist/es/components/Reorder/Item.mjs +1 -0
- package/dist/es/components/Reorder/Item.mjs.map +1 -0
- package/dist/es/components/Reorder/namespace.mjs +1 -0
- package/dist/es/components/Reorder/namespace.mjs.map +1 -0
- package/dist/es/components/Reorder/utils/check-reorder.mjs +1 -0
- package/dist/es/components/Reorder/utils/check-reorder.mjs.map +1 -0
- package/dist/es/context/DeprecatedLayoutGroupContext.mjs +1 -0
- package/dist/es/context/DeprecatedLayoutGroupContext.mjs.map +1 -0
- package/dist/es/context/LayoutGroupContext.mjs +1 -0
- package/dist/es/context/LayoutGroupContext.mjs.map +1 -0
- package/dist/es/context/LazyContext.mjs +1 -0
- package/dist/es/context/LazyContext.mjs.map +1 -0
- package/dist/es/context/MotionConfigContext.mjs +1 -0
- package/dist/es/context/MotionConfigContext.mjs.map +1 -0
- package/dist/es/context/MotionContext/create.mjs +1 -0
- package/dist/es/context/MotionContext/create.mjs.map +1 -0
- package/dist/es/context/MotionContext/index.mjs +1 -0
- package/dist/es/context/MotionContext/index.mjs.map +1 -0
- package/dist/es/context/MotionContext/utils.mjs +1 -0
- package/dist/es/context/MotionContext/utils.mjs.map +1 -0
- package/dist/es/context/PresenceContext.mjs +1 -0
- package/dist/es/context/PresenceContext.mjs.map +1 -0
- package/dist/es/context/ReorderContext.mjs +1 -0
- package/dist/es/context/ReorderContext.mjs.map +1 -0
- package/dist/es/context/SwitchLayoutGroupContext.mjs +1 -0
- package/dist/es/context/SwitchLayoutGroupContext.mjs.map +1 -0
- package/dist/es/debug.mjs +1 -0
- package/dist/es/debug.mjs.map +1 -0
- package/dist/es/dom-mini.mjs +1 -0
- package/dist/es/dom-mini.mjs.map +1 -0
- package/dist/es/dom.mjs +1 -0
- package/dist/es/dom.mjs.map +1 -0
- package/dist/es/events/add-dom-event.mjs +1 -0
- package/dist/es/events/add-dom-event.mjs.map +1 -0
- package/dist/es/events/add-pointer-event.mjs +1 -0
- package/dist/es/events/add-pointer-event.mjs.map +1 -0
- package/dist/es/events/event-info.mjs +1 -0
- package/dist/es/events/event-info.mjs.map +1 -0
- package/dist/es/events/use-dom-event.mjs +1 -0
- package/dist/es/events/use-dom-event.mjs.map +1 -0
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -0
- package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -0
- package/dist/es/gestures/drag/index.mjs +1 -0
- package/dist/es/gestures/drag/index.mjs.map +1 -0
- package/dist/es/gestures/drag/use-drag-controls.mjs +1 -0
- package/dist/es/gestures/drag/use-drag-controls.mjs.map +1 -0
- package/dist/es/gestures/drag/utils/constraints.mjs +1 -0
- package/dist/es/gestures/drag/utils/constraints.mjs.map +1 -0
- package/dist/es/gestures/focus.mjs +1 -0
- package/dist/es/gestures/focus.mjs.map +1 -0
- package/dist/es/gestures/hover.mjs +1 -0
- package/dist/es/gestures/hover.mjs.map +1 -0
- package/dist/es/gestures/pan/PanSession.mjs +1 -0
- package/dist/es/gestures/pan/PanSession.mjs.map +1 -0
- package/dist/es/gestures/pan/index.mjs +1 -0
- package/dist/es/gestures/pan/index.mjs.map +1 -0
- package/dist/es/gestures/press.mjs +1 -0
- package/dist/es/gestures/press.mjs.map +1 -0
- package/dist/es/index.mjs +1 -0
- package/dist/es/index.mjs.map +1 -0
- package/dist/es/m.mjs +1 -0
- package/dist/es/m.mjs.map +1 -0
- package/dist/es/mini.mjs +1 -0
- package/dist/es/mini.mjs.map +1 -0
- package/dist/es/motion/features/Feature.mjs +1 -0
- package/dist/es/motion/features/Feature.mjs.map +1 -0
- package/dist/es/motion/features/animation/exit.mjs +1 -0
- package/dist/es/motion/features/animation/exit.mjs.map +1 -0
- package/dist/es/motion/features/animation/index.mjs +1 -0
- package/dist/es/motion/features/animation/index.mjs.map +1 -0
- package/dist/es/motion/features/animations.mjs +1 -0
- package/dist/es/motion/features/animations.mjs.map +1 -0
- package/dist/es/motion/features/definitions.mjs +1 -0
- package/dist/es/motion/features/definitions.mjs.map +1 -0
- package/dist/es/motion/features/drag.mjs +1 -0
- package/dist/es/motion/features/drag.mjs.map +1 -0
- package/dist/es/motion/features/gestures.mjs +1 -0
- package/dist/es/motion/features/gestures.mjs.map +1 -0
- package/dist/es/motion/features/layout/MeasureLayout.mjs +1 -0
- package/dist/es/motion/features/layout/MeasureLayout.mjs.map +1 -0
- package/dist/es/motion/features/layout.mjs +1 -0
- package/dist/es/motion/features/layout.mjs.map +1 -0
- package/dist/es/motion/features/load-features.mjs +1 -0
- package/dist/es/motion/features/load-features.mjs.map +1 -0
- package/dist/es/motion/features/viewport/index.mjs +1 -0
- package/dist/es/motion/features/viewport/index.mjs.map +1 -0
- package/dist/es/motion/features/viewport/observers.mjs +1 -0
- package/dist/es/motion/features/viewport/observers.mjs.map +1 -0
- package/dist/es/motion/index.mjs +1 -0
- package/dist/es/motion/index.mjs.map +1 -0
- package/dist/es/motion/utils/is-forced-motion-value.mjs +1 -0
- package/dist/es/motion/utils/is-forced-motion-value.mjs.map +1 -0
- package/dist/es/motion/utils/is-motion-component.mjs +1 -0
- package/dist/es/motion/utils/is-motion-component.mjs.map +1 -0
- package/dist/es/motion/utils/symbol.mjs +1 -0
- package/dist/es/motion/utils/symbol.mjs.map +1 -0
- package/dist/es/motion/utils/unwrap-motion-component.mjs +1 -0
- package/dist/es/motion/utils/unwrap-motion-component.mjs.map +1 -0
- package/dist/es/motion/utils/use-motion-ref.mjs +1 -0
- package/dist/es/motion/utils/use-motion-ref.mjs.map +1 -0
- package/dist/es/motion/utils/use-visual-element.mjs +1 -0
- package/dist/es/motion/utils/use-visual-element.mjs.map +1 -0
- package/dist/es/motion/utils/use-visual-state.mjs +1 -0
- package/dist/es/motion/utils/use-visual-state.mjs.map +1 -0
- package/dist/es/motion/utils/valid-prop.mjs +1 -0
- package/dist/es/motion/utils/valid-prop.mjs.map +1 -0
- package/dist/es/projection/animation/mix-values.mjs +1 -0
- package/dist/es/projection/animation/mix-values.mjs.map +1 -0
- package/dist/es/projection/geometry/conversion.mjs +1 -0
- package/dist/es/projection/geometry/conversion.mjs.map +1 -0
- package/dist/es/projection/geometry/copy.mjs +1 -0
- package/dist/es/projection/geometry/copy.mjs.map +1 -0
- package/dist/es/projection/geometry/delta-apply.mjs +2 -1
- package/dist/es/projection/geometry/delta-apply.mjs.map +1 -0
- package/dist/es/projection/geometry/delta-calc.mjs +1 -0
- package/dist/es/projection/geometry/delta-calc.mjs.map +1 -0
- package/dist/es/projection/geometry/delta-remove.mjs +1 -0
- package/dist/es/projection/geometry/delta-remove.mjs.map +1 -0
- package/dist/es/projection/geometry/models.mjs +1 -0
- package/dist/es/projection/geometry/models.mjs.map +1 -0
- package/dist/es/projection/geometry/utils.mjs +1 -0
- package/dist/es/projection/geometry/utils.mjs.map +1 -0
- package/dist/es/projection/node/DocumentProjectionNode.mjs +1 -0
- package/dist/es/projection/node/DocumentProjectionNode.mjs.map +1 -0
- package/dist/es/projection/node/HTMLProjectionNode.mjs +1 -0
- package/dist/es/projection/node/HTMLProjectionNode.mjs.map +1 -0
- package/dist/es/projection/node/create-projection-node.mjs +2 -1
- package/dist/es/projection/node/create-projection-node.mjs.map +1 -0
- package/dist/es/projection/node/group.mjs +1 -0
- package/dist/es/projection/node/group.mjs.map +1 -0
- package/dist/es/projection/node/state.mjs +1 -0
- package/dist/es/projection/node/state.mjs.map +1 -0
- package/dist/es/projection/shared/stack.mjs +1 -0
- package/dist/es/projection/shared/stack.mjs.map +1 -0
- package/dist/es/projection/styles/scale-border-radius.mjs +1 -0
- package/dist/es/projection/styles/scale-border-radius.mjs.map +1 -0
- package/dist/es/projection/styles/scale-box-shadow.mjs +1 -0
- package/dist/es/projection/styles/scale-box-shadow.mjs.map +1 -0
- package/dist/es/projection/styles/scale-correction.mjs +1 -0
- package/dist/es/projection/styles/scale-correction.mjs.map +1 -0
- package/dist/es/projection/styles/transform.mjs +1 -0
- package/dist/es/projection/styles/transform.mjs.map +1 -0
- package/dist/es/projection/use-instant-layout-transition.mjs +1 -0
- package/dist/es/projection/use-instant-layout-transition.mjs.map +1 -0
- package/dist/es/projection/use-reset-projection.mjs +1 -0
- package/dist/es/projection/use-reset-projection.mjs.map +1 -0
- package/dist/es/projection/utils/each-axis.mjs +1 -0
- package/dist/es/projection/utils/each-axis.mjs.map +1 -0
- package/dist/es/projection/utils/has-transform.mjs +1 -0
- package/dist/es/projection/utils/has-transform.mjs.map +1 -0
- package/dist/es/projection/utils/measure.mjs +1 -0
- package/dist/es/projection/utils/measure.mjs.map +1 -0
- package/dist/es/projection.mjs +1 -0
- package/dist/es/projection.mjs.map +1 -0
- package/dist/es/render/VisualElement.mjs +1 -0
- package/dist/es/render/VisualElement.mjs.map +1 -0
- package/dist/es/render/components/create-proxy.mjs +1 -0
- package/dist/es/render/components/create-proxy.mjs.map +1 -0
- package/dist/es/render/components/m/create.mjs +1 -0
- package/dist/es/render/components/m/create.mjs.map +1 -0
- package/dist/es/render/components/m/elements.mjs +1 -0
- package/dist/es/render/components/m/elements.mjs.map +1 -0
- package/dist/es/render/components/m/proxy.mjs +1 -0
- package/dist/es/render/components/m/proxy.mjs.map +1 -0
- package/dist/es/render/components/motion/create.mjs +1 -0
- package/dist/es/render/components/motion/create.mjs.map +1 -0
- package/dist/es/render/components/motion/elements.mjs +1 -0
- package/dist/es/render/components/motion/elements.mjs.map +1 -0
- package/dist/es/render/components/motion/feature-bundle.mjs +1 -0
- package/dist/es/render/components/motion/feature-bundle.mjs.map +1 -0
- package/dist/es/render/components/motion/proxy.mjs +1 -0
- package/dist/es/render/components/motion/proxy.mjs.map +1 -0
- package/dist/es/render/dom/DOMVisualElement.mjs +1 -0
- package/dist/es/render/dom/DOMVisualElement.mjs.map +1 -0
- package/dist/es/render/dom/create-visual-element.mjs +1 -0
- package/dist/es/render/dom/create-visual-element.mjs.map +1 -0
- package/dist/es/render/dom/features-animation.mjs +1 -0
- package/dist/es/render/dom/features-animation.mjs.map +1 -0
- package/dist/es/render/dom/features-max.mjs +1 -0
- package/dist/es/render/dom/features-max.mjs.map +1 -0
- package/dist/es/render/dom/features-min.mjs +1 -0
- package/dist/es/render/dom/features-min.mjs.map +1 -0
- package/dist/es/render/dom/scroll/attach-animation.mjs +1 -0
- package/dist/es/render/dom/scroll/attach-animation.mjs.map +1 -0
- package/dist/es/render/dom/scroll/attach-function.mjs +1 -0
- package/dist/es/render/dom/scroll/attach-function.mjs.map +1 -0
- package/dist/es/render/dom/scroll/index.mjs +1 -0
- package/dist/es/render/dom/scroll/index.mjs.map +1 -0
- package/dist/es/render/dom/scroll/info.mjs +1 -0
- package/dist/es/render/dom/scroll/info.mjs.map +1 -0
- package/dist/es/render/dom/scroll/offsets/edge.mjs +1 -0
- package/dist/es/render/dom/scroll/offsets/edge.mjs.map +1 -0
- package/dist/es/render/dom/scroll/offsets/index.mjs +1 -0
- package/dist/es/render/dom/scroll/offsets/index.mjs.map +1 -0
- package/dist/es/render/dom/scroll/offsets/inset.mjs +1 -0
- package/dist/es/render/dom/scroll/offsets/inset.mjs.map +1 -0
- package/dist/es/render/dom/scroll/offsets/offset.mjs +1 -0
- package/dist/es/render/dom/scroll/offsets/offset.mjs.map +1 -0
- package/dist/es/render/dom/scroll/offsets/presets.mjs +1 -0
- package/dist/es/render/dom/scroll/offsets/presets.mjs.map +1 -0
- package/dist/es/render/dom/scroll/on-scroll-handler.mjs +1 -0
- package/dist/es/render/dom/scroll/on-scroll-handler.mjs.map +1 -0
- package/dist/es/render/dom/scroll/track.mjs +1 -0
- package/dist/es/render/dom/scroll/track.mjs.map +1 -0
- package/dist/es/render/dom/scroll/utils/get-timeline.mjs +1 -0
- package/dist/es/render/dom/scroll/utils/get-timeline.mjs.map +1 -0
- package/dist/es/render/dom/use-render.mjs +1 -0
- package/dist/es/render/dom/use-render.mjs.map +1 -0
- package/dist/es/render/dom/utils/camel-to-dash.mjs +1 -0
- package/dist/es/render/dom/utils/camel-to-dash.mjs.map +1 -0
- package/dist/es/render/dom/utils/filter-props.mjs +1 -0
- package/dist/es/render/dom/utils/filter-props.mjs.map +1 -0
- package/dist/es/render/dom/utils/is-svg-component.mjs +1 -0
- package/dist/es/render/dom/utils/is-svg-component.mjs.map +1 -0
- package/dist/es/render/dom/viewport/index.mjs +1 -0
- package/dist/es/render/dom/viewport/index.mjs.map +1 -0
- package/dist/es/render/html/HTMLVisualElement.mjs +1 -0
- package/dist/es/render/html/HTMLVisualElement.mjs.map +1 -0
- package/dist/es/render/html/use-html-visual-state.mjs +1 -0
- package/dist/es/render/html/use-html-visual-state.mjs.map +1 -0
- package/dist/es/render/html/use-props.mjs +1 -0
- package/dist/es/render/html/use-props.mjs.map +1 -0
- package/dist/es/render/html/utils/build-styles.mjs +1 -0
- package/dist/es/render/html/utils/build-styles.mjs.map +1 -0
- package/dist/es/render/html/utils/build-transform.mjs +1 -0
- package/dist/es/render/html/utils/build-transform.mjs.map +1 -0
- package/dist/es/render/html/utils/create-render-state.mjs +1 -0
- package/dist/es/render/html/utils/create-render-state.mjs.map +1 -0
- package/dist/es/render/html/utils/render.mjs +1 -0
- package/dist/es/render/html/utils/render.mjs.map +1 -0
- package/dist/es/render/html/utils/scrape-motion-values.mjs +1 -0
- package/dist/es/render/html/utils/scrape-motion-values.mjs.map +1 -0
- package/dist/es/render/object/ObjectVisualElement.mjs +1 -0
- package/dist/es/render/object/ObjectVisualElement.mjs.map +1 -0
- package/dist/es/render/store.mjs +1 -0
- package/dist/es/render/store.mjs.map +1 -0
- package/dist/es/render/svg/SVGVisualElement.mjs +1 -0
- package/dist/es/render/svg/SVGVisualElement.mjs.map +1 -0
- package/dist/es/render/svg/lowercase-elements.mjs +1 -0
- package/dist/es/render/svg/lowercase-elements.mjs.map +1 -0
- package/dist/es/render/svg/use-props.mjs +1 -0
- package/dist/es/render/svg/use-props.mjs.map +1 -0
- package/dist/es/render/svg/use-svg-visual-state.mjs +1 -0
- package/dist/es/render/svg/use-svg-visual-state.mjs.map +1 -0
- package/dist/es/render/svg/utils/build-attrs.mjs +1 -0
- package/dist/es/render/svg/utils/build-attrs.mjs.map +1 -0
- package/dist/es/render/svg/utils/camel-case-attrs.mjs +1 -0
- package/dist/es/render/svg/utils/camel-case-attrs.mjs.map +1 -0
- package/dist/es/render/svg/utils/create-render-state.mjs +1 -0
- package/dist/es/render/svg/utils/create-render-state.mjs.map +1 -0
- package/dist/es/render/svg/utils/is-svg-tag.mjs +1 -0
- package/dist/es/render/svg/utils/is-svg-tag.mjs.map +1 -0
- package/dist/es/render/svg/utils/path.mjs +1 -0
- package/dist/es/render/svg/utils/path.mjs.map +1 -0
- package/dist/es/render/svg/utils/render.mjs +1 -0
- package/dist/es/render/svg/utils/render.mjs.map +1 -0
- package/dist/es/render/svg/utils/scrape-motion-values.mjs +1 -0
- package/dist/es/render/svg/utils/scrape-motion-values.mjs.map +1 -0
- package/dist/es/render/utils/animation-state.mjs +1 -0
- package/dist/es/render/utils/animation-state.mjs.map +1 -0
- package/dist/es/render/utils/compare-by-depth.mjs +1 -0
- package/dist/es/render/utils/compare-by-depth.mjs.map +1 -0
- package/dist/es/render/utils/flat-tree.mjs +1 -0
- package/dist/es/render/utils/flat-tree.mjs.map +1 -0
- package/dist/es/render/utils/get-variant-context.mjs +1 -0
- package/dist/es/render/utils/get-variant-context.mjs.map +1 -0
- package/dist/es/render/utils/is-controlling-variants.mjs +1 -0
- package/dist/es/render/utils/is-controlling-variants.mjs.map +1 -0
- package/dist/es/render/utils/is-variant-label.mjs +1 -0
- package/dist/es/render/utils/is-variant-label.mjs.map +1 -0
- package/dist/es/render/utils/motion-values.mjs +1 -0
- package/dist/es/render/utils/motion-values.mjs.map +1 -0
- package/dist/es/render/utils/resolve-dynamic-variants.mjs +1 -0
- package/dist/es/render/utils/resolve-dynamic-variants.mjs.map +1 -0
- package/dist/es/render/utils/resolve-variants.mjs +1 -0
- package/dist/es/render/utils/resolve-variants.mjs.map +1 -0
- package/dist/es/render/utils/setters.mjs +1 -0
- package/dist/es/render/utils/setters.mjs.map +1 -0
- package/dist/es/render/utils/variant-props.mjs +1 -0
- package/dist/es/render/utils/variant-props.mjs.map +1 -0
- package/dist/es/utils/delay.mjs +1 -0
- package/dist/es/utils/delay.mjs.map +1 -0
- package/dist/es/utils/distance.mjs +1 -0
- package/dist/es/utils/distance.mjs.map +1 -0
- package/dist/es/utils/get-context-window.mjs +1 -0
- package/dist/es/utils/get-context-window.mjs.map +1 -0
- package/dist/es/utils/is-browser.mjs +1 -0
- package/dist/es/utils/is-browser.mjs.map +1 -0
- package/dist/es/utils/is-ref-object.mjs +1 -0
- package/dist/es/utils/is-ref-object.mjs.map +1 -0
- package/dist/es/utils/reduced-motion/index.mjs +1 -0
- package/dist/es/utils/reduced-motion/index.mjs.map +1 -0
- package/dist/es/utils/reduced-motion/state.mjs +1 -0
- package/dist/es/utils/reduced-motion/state.mjs.map +1 -0
- package/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +1 -0
- package/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map +1 -0
- package/dist/es/utils/reduced-motion/use-reduced-motion.mjs +1 -0
- package/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map +1 -0
- package/dist/es/utils/shallow-compare.mjs +1 -0
- package/dist/es/utils/shallow-compare.mjs.map +1 -0
- package/dist/es/utils/use-animation-frame.mjs +1 -0
- package/dist/es/utils/use-animation-frame.mjs.map +1 -0
- package/dist/es/utils/use-composed-ref.mjs +1 -0
- package/dist/es/utils/use-composed-ref.mjs.map +1 -0
- package/dist/es/utils/use-constant.mjs +1 -0
- package/dist/es/utils/use-constant.mjs.map +1 -0
- package/dist/es/utils/use-cycle.mjs +1 -0
- package/dist/es/utils/use-cycle.mjs.map +1 -0
- package/dist/es/utils/use-force-update.mjs +1 -0
- package/dist/es/utils/use-force-update.mjs.map +1 -0
- package/dist/es/utils/use-in-view.mjs +1 -0
- package/dist/es/utils/use-in-view.mjs.map +1 -0
- package/dist/es/utils/use-instant-transition.mjs +1 -0
- package/dist/es/utils/use-instant-transition.mjs.map +1 -0
- package/dist/es/utils/use-is-mounted.mjs +1 -0
- package/dist/es/utils/use-is-mounted.mjs.map +1 -0
- package/dist/es/utils/use-isomorphic-effect.mjs +1 -0
- package/dist/es/utils/use-isomorphic-effect.mjs.map +1 -0
- package/dist/es/utils/use-motion-value-event.mjs +1 -0
- package/dist/es/utils/use-motion-value-event.mjs.map +1 -0
- package/dist/es/utils/use-page-in-view.mjs +1 -0
- package/dist/es/utils/use-page-in-view.mjs.map +1 -0
- package/dist/es/utils/use-unmount-effect.mjs +1 -0
- package/dist/es/utils/use-unmount-effect.mjs.map +1 -0
- package/dist/es/value/scroll/use-element-scroll.mjs +1 -0
- package/dist/es/value/scroll/use-element-scroll.mjs.map +1 -0
- package/dist/es/value/scroll/use-viewport-scroll.mjs +1 -0
- package/dist/es/value/scroll/use-viewport-scroll.mjs.map +1 -0
- package/dist/es/value/use-combine-values.mjs +1 -0
- package/dist/es/value/use-combine-values.mjs.map +1 -0
- package/dist/es/value/use-computed.mjs +1 -0
- package/dist/es/value/use-computed.mjs.map +1 -0
- package/dist/es/value/use-inverted-scale.mjs +1 -0
- package/dist/es/value/use-inverted-scale.mjs.map +1 -0
- package/dist/es/value/use-motion-template.mjs +1 -0
- package/dist/es/value/use-motion-template.mjs.map +1 -0
- package/dist/es/value/use-motion-value.mjs +1 -0
- package/dist/es/value/use-motion-value.mjs.map +1 -0
- package/dist/es/value/use-scroll.mjs +1 -0
- package/dist/es/value/use-scroll.mjs.map +1 -0
- package/dist/es/value/use-spring.mjs +1 -0
- package/dist/es/value/use-spring.mjs.map +1 -0
- package/dist/es/value/use-time.mjs +1 -0
- package/dist/es/value/use-time.mjs.map +1 -0
- package/dist/es/value/use-transform.mjs +1 -0
- package/dist/es/value/use-transform.mjs.map +1 -0
- package/dist/es/value/use-velocity.mjs +1 -0
- package/dist/es/value/use-velocity.mjs.map +1 -0
- package/dist/es/value/use-will-change/WillChangeMotionValue.mjs +1 -0
- package/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map +1 -0
- package/dist/es/value/use-will-change/add-will-change.mjs +1 -0
- package/dist/es/value/use-will-change/add-will-change.mjs.map +1 -0
- package/dist/es/value/use-will-change/index.mjs +1 -0
- package/dist/es/value/use-will-change/index.mjs.map +1 -0
- package/dist/es/value/use-will-change/is.mjs +1 -0
- package/dist/es/value/use-will-change/is.mjs.map +1 -0
- package/dist/es/value/utils/resolve-motion-value.mjs +1 -0
- package/dist/es/value/utils/resolve-motion-value.mjs.map +1 -0
- package/dist/framer-motion.dev.js +28 -5
- package/dist/framer-motion.js +1 -1
- package/dist/m.d.ts +1 -1
- package/dist/mini.js +1 -1
- package/dist/size-rollup-animate.js +2 -1
- package/dist/size-rollup-animate.js.map +1 -0
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -0
- package/dist/size-rollup-m.js.map +1 -0
- package/dist/size-rollup-motion.js +2 -1
- package/dist/size-rollup-motion.js.map +1 -0
- package/dist/size-rollup-scroll.js +2 -1
- package/dist/size-rollup-scroll.js.map +1 -0
- package/dist/size-rollup-waapi-animate.js +2 -1
- package/dist/size-rollup-waapi-animate.js.map +1 -0
- package/dist/types/client.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/{types.d-DagZKalS.d.ts → types.d-C8SDx5n-.d.ts} +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisualElement.mjs","sources":["../../../src/render/VisualElement.ts"],"sourcesContent":["import {\n cancelFrame,\n complex,\n findValueType,\n frame,\n getAnimatableNone,\n isMotionValue,\n KeyframeResolver,\n microtask,\n motionValue,\n time,\n transformProps,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport type { Box } from \"motion-utils\"\nimport {\n isNumericalString,\n isZeroValueString,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport {\n MotionConfigContext,\n ReducedMotionConfig,\n} from \"../context/MotionConfigContext\"\nimport type { PresenceContextProps } from \"../context/PresenceContext\"\nimport { featureDefinitions } from \"../motion/features/definitions\"\nimport { Feature } from \"../motion/features/Feature\"\nimport { FeatureDefinitions } from \"../motion/features/types\"\nimport { MotionProps, MotionStyle } from \"../motion/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { IProjectionNode } from \"../projection/node/types\"\nimport { initPrefersReducedMotion } from \"../utils/reduced-motion\"\nimport {\n hasReducedMotionListener,\n prefersReducedMotion,\n} from \"../utils/reduced-motion/state\"\nimport { visualElementStore } from \"./store\"\nimport {\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionProps & Partial<MotionConfigContext>\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionProps,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionProps\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: IProjectionNode\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionProps,\n _prevProps: MotionProps,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set<VisualElement>()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set<VisualElement>\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set<VisualElement>\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: IProjectionNode\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map<string, MotionValue>()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionProps\n prevProps?: MotionProps\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature<Instance>\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map<string, VoidFunction>()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager<any>\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions<Instance, RenderState>,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value)\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n if (value.owner) value.stop()\n })\n }\n\n sortNodePosition(other: VisualElement<Instance>) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n this.props.style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props: MotionProps, presenceContext: PresenceContextProps | null) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n"],"names":["checkIsControllingVariants","checkIsVariantNode"],"mappings":";;;;;;;;;;;AAoDA,MAAM,iBAAiB,GAAG;IACtB,gBAAgB;IAChB,mBAAmB;IACnB,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,yBAAyB;CACnB,CAAA;AAEV;;;AAGG;MACmB,aAAa,CAAA;AA2F/B;;;;;;AAMG;AACH,IAAA,2BAA2B,CACvB,MAAmB,EACnB,UAAuB,EACvB,cAA6B,EAAA;AAI7B,QAAA,OAAO,EAAE,CAAA;KACZ;AA2KD,IAAA,WAAA,CACI,EACI,MAAM,EACN,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AAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,mBAAmB,EAAE,CAAA;SACrD;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;KAC9C;AAED,IAAA,MAAM,CACF,SAAoB,EACpB,GAAG,IAAS,EAAA;AAEZ,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;SACzC;KACJ;IAED,uBAAuB,GAAA;AACnB,QAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KAChC;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-proxy.mjs","sources":["../../../../src/render/components/create-proxy.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps<Props> = React.PropsWithoutRef<Props & MotionProps> &\n React.RefAttributes<SVGElement | HTMLElement>\nexport type CustomDomComponent<Props> = React.ComponentType<\n ComponentProps<Props>\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map<string, any>()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n"],"names":[],"mappings":";;;AAqBgB,SAAA,iBAAiB,CAC7B,iBAAmC,EACnC,mBAAyC,EAAA;AAEzC,IAAA,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AAC9B,QAAA,OAAO,qBAAoC,CAAA;KAC9C;AAED;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAe,CAAA;AAE7C,IAAA,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,OAAgC,KAAI;QACpE,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACtB,CAAA;AACL,KAAC,CAAA;AAED;;AAEG;AACH,IAAA,MAAM,yBAAyB,GAAG,CAC9B,SAAiB,EACjB,OAAgC,KAChC;QACA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,YAAA,QAAQ,CACJ,KAAK,EACL,sDAAsD,CACzD,CAAA;SACJ;AACD,QAAA,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AACtC,KAAC,CAAA;AAED,IAAA,OAAO,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACxC;;;;AAIG;AACH,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,GAAW,KAAI;YAC1B,IAAI,GAAG,KAAK,QAAQ;AAAE,gBAAA,OAAO,OAAO,CAAA;AAEpC;;AAEG;YACH,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1B,gBAAA,cAAc,CAAC,GAAG,CACd,GAAG,EACH,qBAAqB,CACjB,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,mBAAmB,CACtB,CACJ,CAAA;aACJ;AAED,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAE,CAAA;SAClC;AACJ,KAAA,CAAgB,CAAA;AACrB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/m/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAO,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AACpD;;;;"}
|
|
@@ -225,3 +225,4 @@ const MotionTextPath =
|
|
|
225
225
|
/*@__PURE__*/ createMinimalMotionComponent("textPath");
|
|
226
226
|
|
|
227
227
|
export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview };
|
|
228
|
+
//# sourceMappingURL=elements.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACU;AACA;;AAET;AACS;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;;AAET;AACS;AACA;AACA;;AAET;AACS;;AAET;AACS;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;;AAEA;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AAEJ;;AAEG;;AAEC;AACS;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;;AAET;;AAEA;;AAEA;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACS;;AAET;;AAEA;;AAEA;;AAEA;;AAEA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/m/proxy.ts"],"sourcesContent":["import { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n"],"names":[],"mappings":";;MAEa,CAAC,iBAAiB,iBAAiB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/motion/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement<Props, TagName>\n )\n}\n"],"names":[],"mappings":";;;;AAMgB,SAAA,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,aAAa,EACb,sBAA6D,CAChE,CAAA;AACL;;;;"}
|
|
@@ -192,3 +192,4 @@ const MotionRadialGradient =
|
|
|
192
192
|
const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath");
|
|
193
193
|
|
|
194
194
|
export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview };
|
|
195
|
+
//# sourceMappingURL=elements.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/motion/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACU;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEb;;AAEG;AACU;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;;AAIT;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACS;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;;AAET;;AAEA;AACS;;AAET;;AAEA;;AAEA;AACS;;AAET;;AAEA;;AAEA;;AAEA;AACS;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-bundle.mjs","sources":["../../../../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAKa,MAAA,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/motion/proxy.ts"],"sourcesContent":["import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n"],"names":[],"mappings":";;;;AAIO,MAAM,MAAM,iBAAiB,iBAAiB,CACjD,aAAa,EACb,sBAAsB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOMVisualElement.mjs","sources":["../../../../src/render/dom/DOMVisualElement.ts"],"sourcesContent":["import {\n AnyResolvedKeyframe,\n DOMKeyframesResolver,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { MotionProps, MotionStyle } from \"../../motion/types\"\nimport { DOMVisualElementOptions } from \"../dom/types\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { VisualElement } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement<Instance, State, Options> {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionProps,\n key: string\n ): AnyResolvedKeyframe | MotionValue<any> | undefined {\n return props.style\n ? (props.style[key as keyof MotionStyle] as string)\n : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n"],"names":[],"mappings":";;;AAWM,MAAgB,gBAIpB,SAAQ,aAAuC,CAAA;AAJjD,IAAA,WAAA,GAAA;;QA+BI,IAAgB,CAAA,gBAAA,GAAG,oBAAoB,CAAA;KAkB1C;IA5CG,wBAAwB,CAAC,CAAW,EAAE,CAAW,EAAA;AAC7C;;;;AAIG;AACH,QAAA,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;KACnD;IAED,sBAAsB,CAClB,KAAkB,EAClB,GAAW,EAAA;QAEX,OAAO,KAAK,CAAC,KAAK;AACd,cAAG,KAAK,CAAC,KAAK,CAAC,GAAwB,CAAY;cACjD,SAAS,CAAA;KAClB;AAED,IAAA,0BAA0B,CACtB,GAAW,EACX,EAAE,IAAI,EAAE,KAAK,EAAmB,EAAA;AAEhC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;AAChB,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;KACpB;IAKD,sBAAsB,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE,CAAA;YACxB,OAAO,IAAI,CAAC,iBAAiB,CAAA;SAChC;AAED,QAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;AAC/B,QAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AACzB,YAAA,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAI;AACtD,gBAAA,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,CAAG,EAAA,MAAM,EAAE,CAAA;iBACzC;AACL,aAAC,CAAC,CAAA;SACL;KACJ;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/render/dom/create-visual-element.ts"],"sourcesContent":["import { ComponentType, Fragment } from \"react\"\nimport { HTMLVisualElement } from \"../html/HTMLVisualElement\"\nimport { SVGVisualElement } from \"../svg/SVGVisualElement\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType<React.PropsWithChildren<unknown>>,\n options: VisualElementOptions<HTMLElement | SVGElement>\n) => {\n return isSVGComponent(Component)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n"],"names":[],"mappings":";;;;;MAMa,sBAAsB,GAAwB,CACvD,SAAmE,EACnE,OAAuD,KACvD;IACA,OAAO,cAAc,CAAC,SAAS,CAAC;AAC5B,UAAE,IAAI,gBAAgB,CAAC,OAAO,CAAC;AAC/B,UAAE,IAAI,iBAAiB,CAAC,OAAO,EAAE;YAC3B,eAAe,EAAE,SAAS,KAAK,QAAQ;AAC1C,SAAA,CAAC,CAAA;AACZ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features-animation.mjs","sources":["../../../../src/render/dom/features-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACU;AACT;AACA;AACA;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features-max.mjs","sources":["../../../../src/render/dom/features-max.ts"],"sourcesContent":["\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACU;AACT;AACA;AACA;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features-min.mjs","sources":["../../../../src/render/dom/features-min.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACU;AACT;AACA;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach-animation.mjs","sources":["../../../../../src/render/dom/scroll/attach-animation.ts"],"sourcesContent":["import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\nexport function attachToAnimation(\n animation: AnimationPlaybackControls,\n options: ScrollOptionsWithDefaults\n) {\n const timeline = getTimeline(options)\n\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause()\n\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress\n }, timeline)\n },\n })\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,iBAAiB,CAC7B,SAAoC,EACpC,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAErC,OAAO,SAAS,CAAC,cAAc,CAAC;QAC5B,QAAQ,EAAE,OAAO,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ;AAC/C,QAAA,OAAO,EAAE,CAAC,cAAc,KAAI;YACxB,cAAc,CAAC,KAAK,EAAE,CAAA;AAEtB,YAAA,OAAO,eAAe,CAAC,CAAC,QAAQ,KAAI;AAChC,gBAAA,cAAc,CAAC,IAAI;AACf,oBAAA,cAAc,CAAC,iBAAiB,GAAG,QAAQ,CAAA;aAClD,EAAE,QAAQ,CAAC,CAAA;SACf;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach-function.mjs","sources":["../../../../../src/render/dom/scroll/attach-function.ts"],"sourcesContent":["import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n return onScroll.length === 2\n}\n\nexport function attachToFunction(\n onScroll: OnScroll,\n options: ScrollOptionsWithDefaults\n) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis!].progress, info)\n }, options)\n } else {\n return observeTimeline(onScroll, getTimeline(options))\n }\n}\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACH,SAAS,kBAAkB,CAAC,QAAkB,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAA;AAChC,CAAC;AAEe,SAAA,gBAAgB,CAC5B,QAAkB,EAClB,OAAkC,EAAA;AAElC,IAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE;AAC9B,QAAA,OAAO,UAAU,CAAC,CAAC,IAAI,KAAI;AACvB,YAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;SAC/C,EAAE,OAAO,CAAC,CAAA;KACd;SAAM;QACH,OAAO,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;KACzD;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/scroll/index.ts"],"sourcesContent":["import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n"],"names":[],"mappings":";;;;SAMgB,MAAM,CAClB,QAA8C,EAC9C,EACI,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,GAAG,OAAO,KACK,EAAE,EAAA;AAErB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB,CAAA;IAE3C,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAA;IAE3D,OAAO,OAAO,QAAQ,KAAK,UAAU;AACjC,UAAE,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AACjD,UAAE,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;AAC1D;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info.mjs","sources":["../../../../../src/render/dom/scroll/info.ts"],"sourcesContent":["import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n})\n\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n} as const\n\nfunction updateAxisInfo(\n element: Element,\n axisName: \"x\" | \"y\",\n info: ScrollInfo,\n time: number\n) {\n const axis = info[axisName]\n const { length, position } = keys[axisName]\n\n const prev = axis.current\n const prevTime = info.time\n\n axis.current = element[`scroll${position}`]\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n axis.offset.length = 0\n axis.offset[0] = 0\n axis.offset[1] = axis.scrollLength\n axis.progress = progress(0, axis.scrollLength, axis.current)\n\n const elapsed = time - prevTime\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n element: Element,\n info: ScrollInfo,\n time: number\n) {\n updateAxisInfo(element, \"x\", info, time)\n updateAxisInfo(element, \"y\", info, time)\n info.time = time\n}\n"],"names":[],"mappings":";;AAGA;;AAEG;AACH,MAAM,UAAU,GAAG,EAAE,CAAA;AAErB,MAAM,cAAc,GAAG,OAAuB;AAC1C,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,YAAY,EAAE,CAAC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AC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAA;AAClC,IAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;AAE5D,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,CAAA;AAC/B,IAAA,IAAI,CAAC,QAAQ;AACT,QAAA,OAAO,GAAG,UAAU;AAChB,cAAE,CAAC;cACD,iBAAiB,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC;SAEe,gBAAgB,CAC5B,OAAgB,EAChB,IAAgB,EAChB,IAAY,EAAA;IAEZ,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACxC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,IAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;AACpB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/edge.ts"],"sourcesContent":["import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record<NamedEdges, number> = {\n start: 0,\n center: 0.5,\n end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n let delta = 0\n\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge as NamedEdges]\n }\n\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge)\n\n if (edge.endsWith(\"px\")) {\n delta = asNumber\n } else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100\n } else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth\n } else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight\n } else {\n edge = asNumber\n }\n }\n\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge\n }\n\n return inset + delta\n}\n"],"names":[],"mappings":"AAEa,MAAA,UAAU,GAA+B;AAClD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,GAAG,EAAE,CAAC;EACT;AAEK,SAAU,WAAW,CAAC,IAAU,EAAE,MAAc,EAAE,KAAK,GAAG,CAAC,EAAA;IAC7D,IAAI,KAAK,GAAG,CAAC,CAAA;AAEb;;;AAGG;AACH,IAAA,IAAI,IAAI,IAAI,UAAU,EAAE;AACpB,QAAA,IAAI,GAAG,UAAU,CAAC,IAAkB,CAAC,CAAA;KACxC;AAED;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;AAEjC,QAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACrB,KAAK,GAAG,QAAQ,CAAA;SACnB;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,IAAI,GAAG,QAAQ,GAAG,GAAG,CAAA;SACxB;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAA;SAClE;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAA;SACnE;aAAM;YACH,IAAI,GAAG,QAAQ,CAAA;SAClB;KACJ;AAED;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;KACxB;IAED,OAAO,KAAK,GAAG,KAAK,CAAA;AACxB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/index.ts"],"sourcesContent":["import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? (target as SVGGraphicsElement).getBBox()\n : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n container: Element,\n info: ScrollInfo,\n options: ScrollInfoOptions\n) {\n const { offset: offsetDefinition = ScrollOffset.All } = options\n const { target = container, axis = \"y\" } = options\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n const inset = target !== container ? calcInset(target, container) : point\n\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize =\n target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target)\n\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n }\n\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0\n\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate\n\n const numOffsets = offsetDefinition.length\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(\n offsetDefinition[i],\n containerSize[lengthLabel],\n targetSize[lengthLabel],\n inset[axis]\n )\n\n if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n hasChanged = true\n }\n\n info[axis].offset[i] = offset\n }\n\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(\n info[axis].offset,\n defaultOffset(offsetDefinition),\n { clamp: false }\n )\n\n info[axis].interpolatorOffsets = [...info[axis].offset]\n }\n\n info[axis].progress = clamp(\n 0,\n 1,\n info[axis].interpolate!(info[axis].current)\n )\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AAE5B,SAAS,aAAa,CAAC,MAAe,EAAA;IAClC,OAAO,SAAS,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK;AAClD,UAAG,MAA6B,CAAC,OAAO,EAAE;AAC1C,UAAE,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,CAAA;AACpE,CAAC;SAEe,cAAc,CAC1B,SAAkB,EAClB,IAAgB,EAChB,OAA0B,EAAA;IAE1B,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,OAAO,CAAA;IAC/D,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;AAClD,IAAA,MAAM,WAAW,GAAG,IAAI,KAAK,GAAG,GAAG,QAAQ,GAAG,OAAO,CAAA;AAErD,IAAA,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAA;AAEzE;;;;AAIG;AACH,IAAA,MAAM,UAAU,GACZ,MAAM,KAAK,SAAS;AAChB,UAAE,EAAE,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE;AAClE,UA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AC,QAAQ,GAAG,KAAK,CACvB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,IAAI,CAAC,CAAC,WAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAC9C,CAAA;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/inset.ts"],"sourcesContent":["import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n const inset = { x: 0, y: 0 }\n\n let current: Element | null = element\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft\n inset.y += current.offsetTop\n current = current.offsetParent\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of <svg /> tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on <svg />. Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for <svg /> is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect()\n current = current.parentElement!\n const parentBoundingBox = current.getBoundingClientRect()\n inset.x += svgBoundingBox.left - parentBoundingBox.left\n inset.y += svgBoundingBox.top - parentBoundingBox.top\n } else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox()\n inset.x += x\n inset.y += y\n\n let svg: SVGElement | null = null\n let parent: SVGElement = current.parentNode as SVGElement\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent\n }\n parent = current.parentNode as SVGElement\n }\n current = svg\n } else {\n break\n }\n }\n\n return inset\n}\n"],"names":[],"mappings":";;AAEgB,SAAA,SAAS,CAAC,OAAgB,EAAE,SAAkB,EAAA;IAC1D,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;IAE5B,IAAI,OAAO,GAAmB,OAAO,CAAA;AACrC,IAAA,OAAO,OAAO,IAAI,OAAO,KAAK,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AA;AAChB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/offset.ts"],"sourcesContent":["import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n offset: Edge | Intersection | ProgressIntersection,\n containerLength: number,\n targetLength: number,\n targetInset: number\n) {\n let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n Array.isArray(offset) ? offset : defaultOffset\n\n let targetPoint = 0\n let containerPoint = 0\n\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset]\n } else if (typeof offset === \"string\") {\n offset = offset.trim() as EdgeString\n\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n } else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n }\n }\n\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n return targetPoint - containerPoint\n}\n"],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAE5C,SAAU,aAAa,CACzB,MAAkD,EAClD,eAAuB,EACvB,YAAoB,EACpB,WAAmB,EAAA;AAEnB,IAAA,IAAI,gBAAgB,GAChB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,aAAa,CAAA;IAElD,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,IAAI,cAAc,GAAG,CAAC,CAAA;AAEtB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B;;;;AAIG;AACH,QAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACtC;AAAM,SAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACnC,QAAA,MAAM,GAAG,MAAM,CAAC,IAAI,EAAgB,CAAA;AAEpC,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAA6B,CAAA;SACnE;aAAM;AACH;;;;AAIG;AACH,YAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAiC,CAAC,GAAG,MAAM,GAAG,CAAA,CAAA,CAAG,CAAC,CAAA;SAC5F;KACJ;AAED,IAAA,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IACzE,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA;IAElE,OAAO,WAAW,GAAG,cAAc,CAAA;AACvC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/presets.ts"],"sourcesContent":["import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record<string, ProgressIntersection[]> = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n}\n"],"names":[],"mappings":"AAEa,MAAA,YAAY,GAA2C;AAClE,IAAA,KAAK,EAAE;QACL,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-scroll-handler.mjs","sources":["../../../../../src/render/dom/scroll/on-scroll-handler.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n OnScrollHandler,\n OnScrollInfo,\n ScrollInfo,\n ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n container: Element,\n target: Element = container,\n info: ScrollInfo\n) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0\n info.y.targetOffset = 0\n if (target !== container) {\n let node = target as HTMLElement\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft\n info.y.targetOffset += node.offsetTop\n node = node.offsetParent as HTMLElement\n }\n }\n\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight\n info.x.containerLength = container.clientWidth\n info.y.containerLength = container.clientHeight\n\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(\n getComputedStyle(container).position !== \"static\",\n \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n )\n }\n }\n}\n\nexport function createOnScrollHandler(\n element: Element,\n onScroll: OnScrollInfo,\n info: ScrollInfo,\n options: ScrollInfoOptions = {}\n): OnScrollHandler {\n return {\n measure: (time) => {\n measure(element, options.target, info)\n updateScrollInfo(element, info, time)\n\n if (options.offset || options.target) {\n resolveOffsets(element, info, options)\n }\n },\n notify: () => onScroll(info),\n }\n}\n"],"names":[],"mappings":";;;;AAUA,SAAS,OAAO,CACZ,SAAkB,EAClB,MAAkB,GAAA,SAAS,EAC3B,IAAgB,EAAA;AAEhB;;AAEG;AACH,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAA;AACvB,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAA;AACvB,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,IAAI,IAAI,GAAG,MAAqB,CAAA;AAChC,QAAA,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAA;YACtC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAA;AACrC,YAAA,IAAI,GAAG,IAAI,CAAC,YAA2B,CAAA;SAC1C;KACJ;IAED,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;IAClE,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;IACpE,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,WAAW,CAAA;IAC9C,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;AAE/C;;;AAGG;IACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACvC,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE;AAC7C,YAAA,QAAQ,CACJ,gBAAgB,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,EACjD,sJAAsJ,CACzJ,CAAA;SACJ;KACJ;AACL,CAAC;AAEK,SAAU,qBAAqB,CACjC,OAAgB,EAChB,QAAsB,EACtB,IAAgB,EAChB,OAAA,GAA6B,EAAE,EAAA;IAE/B,OAAO;AACH,QAAA,OAAO,EAAE,CAAC,IAAI,KAAI;YACd,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AACtC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;YAErC,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE;AAClC,gBAAA,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;aACzC;SACJ;AACD,QAAA,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC;KAC/B,CAAA;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.mjs","sources":["../../../../../src/render/dom/scroll/track.ts"],"sourcesContent":["import { cancelFrame, frame, frameData, resize } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap<Element, VoidFunction>()\nconst resizeListeners = new WeakMap<Element, VoidFunction>()\nconst onScrollHandlers = new WeakMap<Element, Set<OnScrollHandler>>()\n\nexport type ScrollTargets = Array<HTMLElement>\n\nconst getEventTarget = (element: Element) =>\n element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n onScroll: OnScrollInfo,\n {\n container = document.scrollingElement as Element,\n ...options\n }: ScrollInfoOptions = {}\n) {\n if (!container) return noop as VoidFunction\n\n let containerHandlers = onScrollHandlers.get(container)\n\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set()\n onScrollHandlers.set(container, containerHandlers)\n }\n\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo()\n const containerHandler = createOnScrollHandler(\n container,\n onScroll,\n info,\n options\n )\n containerHandlers.add(containerHandler)\n\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp)\n }\n\n frame.preUpdate(notifyAll)\n }\n\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify()\n }\n }\n\n const listener = () => frame.read(measureAll)\n\n scrollListeners.set(container, listener)\n\n const target = getEventTarget(container)\n window.addEventListener(\"resize\", listener, { passive: true })\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener))\n }\n\n target.addEventListener(\"scroll\", listener, { passive: true })\n\n listener()\n }\n\n const listener = scrollListeners.get(container)!\n frame.read(listener, false, true)\n\n return () => {\n cancelFrame(listener)\n\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container)\n if (!currentHandlers) return\n\n currentHandlers.delete(containerHandler)\n\n if (currentHandlers.size) return\n\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container)\n scrollListeners.delete(container)\n\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\n \"scroll\",\n scrollListener\n )\n resizeListeners.get(container)?.()\n window.removeEventListener(\"resize\", scrollListener)\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAA;AAC5D,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAA;AAC5D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAiC,CAAA;AAIrE,MAAM,cAAc,GAAG,CAAC,OAAgB,KACpC,OAAO,KAAK,QAAQ,CAAC,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAA;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AAE,cAAc,CAAC,CAAA;SACvD;AACL,KAAC,CAAA;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/get-timeline.ts"],"sourcesContent":["import { ProgressTimeline, supportsScrollTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map<Element | \"self\", { x?: ProgressTimeline; y?: ProgressTimeline }>\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n const containerCache = timelineCache.get(container) ?? new Map()\n timelineCache.set(container, containerCache)\n\n const targetKey = options.target ?? \"self\"\n const targetCache = containerCache.get(targetKey) ?? {}\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n !options.target && supportsScrollTimeline()\n ? new ScrollTimeline({ source: container, axis } as any)\n : scrollTimelineFallback({ container, ...options })\n }\n\n return targetCache[axisKey]!\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B,CAAA;AAEH,SAAS,sBAAsB,CAAC,OAAkC,EAAA;AAC9D,IAAA,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AAEhC,IAAA,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI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../../../../src/render/dom/use-render.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n props: MotionProps,\n ref: React.Ref<HTMLElement | SVGElement>,\n {\n latestValues,\n }: VisualState<HTMLElement | SVGElement, HTMLRenderState | SVGRenderState>,\n isStatic: boolean,\n forwardMotionProps: boolean = false\n) {\n const useVisualProps = isSVGComponent(Component)\n ? useSVGProps\n : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\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(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement<any>(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n"],"names":[],"mappings":";;;;;;;;;AA2BI;AACI;;AAGJ;AAMA;;AAQA;;;;AAIG;AACH;AACA;;AAMI;AACA;AACH;AACL;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camel-to-dash.mjs","sources":["../../../../../src/render/dom/utils/camel-to-dash.ts"],"sourcesContent":["/**\n * Convert camelCase to dash-case properties.\n */\nexport const camelToDash = (str: string) =>\n str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase()\n"],"names":[],"mappings":"AAAA;;AAEG;MACU,WAAW,GAAG,CAAC,GAAW,KACnC,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,WAAW;;;;"}
|