motion 12.18.0 → 12.18.2
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/mini.js +7 -1063
- package/dist/es/debug.mjs +1 -0
- package/dist/es/index.mjs +1 -0
- package/dist/es/mini.mjs +1 -0
- package/dist/es/react-client.mjs +2 -0
- package/dist/es/react-m.mjs +2 -0
- package/dist/es/react-mini.mjs +2 -0
- package/dist/es/react.mjs +2 -0
- package/dist/motion.js +1 -1
- package/mini/package.json +1 -1
- package/package.json +11 -11
- package/react/package.json +1 -1
- package/react-client/package.json +1 -1
- package/react-m/package.json +1 -1
- package/dist/es/framer-motion/dist/es/animation/animate/index.mjs +0 -34
- package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +0 -19
- package/dist/es/framer-motion/dist/es/animation/animate/sequence.mjs +0 -14
- package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +0 -11
- package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +0 -52
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +0 -112
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +0 -13
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -12
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -12
- package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +0 -80
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animate-style.mjs +0 -17
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animate.mjs +0 -17
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +0 -64
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animation.mjs +0 -41
- package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -102
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -85
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +0 -65
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element.mjs +0 -26
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -6
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -7
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +0 -38
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +0 -171
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +0 -8
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/store.mjs +0 -4
- package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +0 -256
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -23
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -31
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -13
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -14
- package/dist/es/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -45
- package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -40
- package/dist/es/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -7
- package/dist/es/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -10
- package/dist/es/framer-motion/dist/es/animation/utils/stagger.mjs +0 -26
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +0 -87
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +0 -64
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +0 -166
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs +0 -9
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +0 -70
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs +0 -14
- package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +0 -15
- package/dist/es/framer-motion/dist/es/components/LayoutGroup/index.mjs +0 -32
- package/dist/es/framer-motion/dist/es/components/LazyMotion/index.mjs +0 -68
- package/dist/es/framer-motion/dist/es/components/MotionConfig/index.mjs +0 -48
- package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +0 -53
- package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +0 -34
- package/dist/es/framer-motion/dist/es/components/Reorder/namespace.mjs +0 -2
- package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +0 -24
- package/dist/es/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -10
- package/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/LazyContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs +0 -13
- package/dist/es/framer-motion/dist/es/context/MotionContext/create.mjs +0 -13
- package/dist/es/framer-motion/dist/es/context/MotionContext/index.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/MotionContext/utils.mjs +0 -17
- package/dist/es/framer-motion/dist/es/context/PresenceContext.mjs +0 -10
- package/dist/es/framer-motion/dist/es/context/ReorderContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +0 -9
- package/dist/es/framer-motion/dist/es/events/add-dom-event.mjs +0 -6
- package/dist/es/framer-motion/dist/es/events/add-pointer-event.mjs +0 -8
- package/dist/es/framer-motion/dist/es/events/event-info.mjs +0 -15
- package/dist/es/framer-motion/dist/es/events/use-dom-event.mjs +0 -34
- package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +0 -479
- package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +0 -27
- package/dist/es/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +0 -88
- package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +0 -129
- package/dist/es/framer-motion/dist/es/gestures/focus.mjs +0 -41
- package/dist/es/framer-motion/dist/es/gestures/hover.mjs +0 -30
- package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +0 -156
- package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +0 -50
- package/dist/es/framer-motion/dist/es/gestures/press.mjs +0 -33
- package/dist/es/framer-motion/dist/es/motion/features/Feature.mjs +0 -9
- package/dist/es/framer-motion/dist/es/motion/features/animation/exit.mjs +0 -36
- package/dist/es/framer-motion/dist/es/motion/features/animation/index.mjs +0 -40
- package/dist/es/framer-motion/dist/es/motion/features/animations.mjs +0 -13
- package/dist/es/framer-motion/dist/es/motion/features/definitions.mjs +0 -28
- package/dist/es/framer-motion/dist/es/motion/features/drag.mjs +0 -17
- package/dist/es/framer-motion/dist/es/motion/features/gestures.mjs +0 -21
- package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +0 -135
- package/dist/es/framer-motion/dist/es/motion/features/layout.mjs +0 -11
- package/dist/es/framer-motion/dist/es/motion/features/load-features.mjs +0 -12
- package/dist/es/framer-motion/dist/es/motion/features/viewport/index.mjs +0 -72
- package/dist/es/framer-motion/dist/es/motion/features/viewport/observers.mjs +0 -49
- package/dist/es/framer-motion/dist/es/motion/index.mjs +0 -101
- package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -11
- package/dist/es/framer-motion/dist/es/motion/utils/is-motion-component.mjs +0 -12
- package/dist/es/framer-motion/dist/es/motion/utils/symbol.mjs +0 -3
- package/dist/es/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +0 -17
- package/dist/es/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +0 -38
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +0 -133
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-state.mjs +0 -79
- package/dist/es/framer-motion/dist/es/motion/utils/valid-prop.mjs +0 -57
- package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +0 -91
- package/dist/es/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -33
- package/dist/es/framer-motion/dist/es/projection/geometry/copy.mjs +0 -31
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -119
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -52
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -54
- package/dist/es/framer-motion/dist/es/projection/geometry/models.mjs +0 -17
- package/dist/es/framer-motion/dist/es/projection/geometry/utils.mjs +0 -31
- package/dist/es/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -13
- package/dist/es/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -27
- package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +0 -1605
- package/dist/es/framer-motion/dist/es/projection/node/group.mjs +0 -24
- package/dist/es/framer-motion/dist/es/projection/node/state.mjs +0 -19
- package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +0 -112
- package/dist/es/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -41
- package/dist/es/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -35
- package/dist/es/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -13
- package/dist/es/framer-motion/dist/es/projection/styles/transform.mjs +0 -49
- package/dist/es/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +0 -14
- package/dist/es/framer-motion/dist/es/projection/use-reset-projection.mjs +0 -14
- package/dist/es/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -5
- package/dist/es/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -26
- package/dist/es/framer-motion/dist/es/projection/utils/measure.mjs +0 -17
- package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +0 -478
- package/dist/es/framer-motion/dist/es/render/components/create-factory.mjs +0 -23
- package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +0 -38
- package/dist/es/framer-motion/dist/es/render/components/m/create.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/components/m/elements.mjs +0 -227
- package/dist/es/framer-motion/dist/es/render/components/m/proxy.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/components/motion/create.mjs +0 -15
- package/dist/es/framer-motion/dist/es/render/components/motion/elements.mjs +0 -194
- package/dist/es/framer-motion/dist/es/render/components/motion/proxy.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -43
- package/dist/es/framer-motion/dist/es/render/dom/create-visual-element.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-animation.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-max.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-min.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +0 -17
- package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +0 -23
- package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -56
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -45
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -60
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -47
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -35
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -20
- package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -48
- package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -81
- package/dist/es/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/dom/use-render.mjs +0 -33
- package/dist/es/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/dom/utils/filter-props.mjs +0 -59
- package/dist/es/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -43
- package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -44
- package/dist/es/framer-motion/dist/es/render/html/config-motion.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/html/use-props.mjs +0 -57
- package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -65
- package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -62
- package/dist/es/framer-motion/dist/es/render/html/utils/create-render-state.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/html/utils/render.mjs +0 -9
- package/dist/es/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -19
- package/dist/es/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -41
- package/dist/es/framer-motion/dist/es/render/store.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -45
- package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/svg/lowercase-elements.mjs +0 -33
- package/dist/es/framer-motion/dist/es/render/svg/use-props.mjs +0 -24
- package/dist/es/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -57
- package/dist/es/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/svg/utils/path.mjs +0 -32
- package/dist/es/framer-motion/dist/es/render/svg/utils/render.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -19
- package/dist/es/framer-motion/dist/es/render/utils/animation-state.mjs +0 -342
- package/dist/es/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -24
- package/dist/es/framer-motion/dist/es/render/utils/get-variant-context.mjs +0 -28
- package/dist/es/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -13
- package/dist/es/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +0 -51
- package/dist/es/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -36
- package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +0 -31
- package/dist/es/framer-motion/dist/es/render/utils/variant-props.mjs +0 -12
- package/dist/es/framer-motion/dist/es/utils/delay.mjs +0 -24
- package/dist/es/framer-motion/dist/es/utils/distance.mjs +0 -9
- package/dist/es/framer-motion/dist/es/utils/get-context-window.mjs +0 -6
- package/dist/es/framer-motion/dist/es/utils/is-browser.mjs +0 -3
- package/dist/es/framer-motion/dist/es/utils/is-ref-object.mjs +0 -7
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -5
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +0 -47
- package/dist/es/framer-motion/dist/es/utils/shallow-compare.mjs +0 -14
- package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +0 -21
- package/dist/es/framer-motion/dist/es/utils/use-constant.mjs +0 -18
- package/dist/es/framer-motion/dist/es/utils/use-cycle.mjs +0 -47
- package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/use-in-view.mjs +0 -23
- package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +0 -41
- package/dist/es/framer-motion/dist/es/utils/use-is-mounted.mjs +0 -15
- package/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +0 -6
- package/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs +0 -13
- package/dist/es/framer-motion/dist/es/utils/use-unmount-effect.mjs +0 -7
- package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +0 -14
- package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +0 -14
- package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +0 -37
- package/dist/es/framer-motion/dist/es/value/use-computed.mjs +0 -19
- package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +0 -52
- package/dist/es/framer-motion/dist/es/value/use-motion-template.mjs +0 -45
- package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +0 -38
- package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +0 -39
- package/dist/es/framer-motion/dist/es/value/use-spring.mjs +0 -22
- package/dist/es/framer-motion/dist/es/value/use-time.mjs +0 -10
- package/dist/es/framer-motion/dist/es/value/use-transform.mjs +0 -29
- package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +0 -35
- package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +0 -21
- package/dist/es/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -20
- package/dist/es/framer-motion/dist/es/value/use-will-change/index.mjs +0 -8
- package/dist/es/framer-motion/dist/es/value/use-will-change/is.mjs +0 -7
- package/dist/es/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -12
- package/dist/es/motion/lib/debug.mjs +0 -1
- package/dist/es/motion/lib/index.mjs +0 -131
- package/dist/es/motion/lib/mini.mjs +0 -2
- package/dist/es/motion/lib/react-client.mjs +0 -3
- package/dist/es/motion/lib/react-m.mjs +0 -3
- package/dist/es/motion/lib/react-mini.mjs +0 -2
- package/dist/es/motion/lib/react.mjs +0 -204
- package/dist/es/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +0 -175
- package/dist/es/motion-dom/dist/es/animation/GroupAnimation.mjs +0 -72
- package/dist/es/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/JSAnimation.mjs +0 -348
- package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +0 -158
- package/dist/es/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +0 -65
- package/dist/es/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/drivers/frame.mjs +0 -17
- package/dist/es/motion-dom/dist/es/animation/generators/inertia.mjs +0 -87
- package/dist/es/motion-dom/dist/es/animation/generators/keyframes.mjs +0 -51
- package/dist/es/motion-dom/dist/es/animation/generators/spring/defaults.mjs +0 -27
- package/dist/es/motion-dom/dist/es/animation/generators/spring/find.mjs +0 -86
- package/dist/es/motion-dom/dist/es/animation/generators/spring/index.mjs +0 -176
- package/dist/es/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +0 -17
- package/dist/es/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +0 -19
- package/dist/es/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +0 -5
- package/dist/es/motion-dom/dist/es/animation/generators/utils/velocity.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +0 -131
- package/dist/es/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs +0 -147
- package/dist/es/motion-dom/dist/es/animation/keyframes/get-final.mjs +0 -11
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/default.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs +0 -12
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/time.mjs +0 -5
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +0 -11
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +0 -7
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs +0 -30
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs +0 -36
- package/dist/es/motion-dom/dist/es/animation/utils/WithPromise.mjs +0 -26
- package/dist/es/motion-dom/dist/es/animation/utils/active-animations.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/utils/can-animate.mjs +0 -42
- package/dist/es/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs +0 -42
- package/dist/es/motion-dom/dist/es/animation/utils/get-value-transition.mjs +0 -7
- package/dist/es/motion-dom/dist/es/animation/utils/is-animatable.mjs +0 -30
- package/dist/es/motion-dom/dist/es/animation/utils/is-css-variable.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +0 -18
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs +0 -3
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +0 -28
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/supported.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +0 -39
- package/dist/es/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +0 -13
- package/dist/es/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +0 -37
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/linear.mjs +0 -12
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/px-values.mjs +0 -39
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +0 -20
- package/dist/es/motion-dom/dist/es/effects/MotionValueState.mjs +0 -47
- package/dist/es/motion-dom/dist/es/effects/attr/index.mjs +0 -41
- package/dist/es/motion-dom/dist/es/effects/prop/index.mjs +0 -9
- package/dist/es/motion-dom/dist/es/effects/style/index.mjs +0 -52
- package/dist/es/motion-dom/dist/es/effects/style/transform.mjs +0 -38
- package/dist/es/motion-dom/dist/es/effects/svg/index.mjs +0 -41
- package/dist/es/motion-dom/dist/es/effects/utils/create-dom-effect.mjs +0 -18
- package/dist/es/motion-dom/dist/es/effects/utils/create-effect.mjs +0 -21
- package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +0 -71
- package/dist/es/motion-dom/dist/es/frameloop/frame.mjs +0 -6
- package/dist/es/motion-dom/dist/es/frameloop/index-legacy.mjs +0 -20
- package/dist/es/motion-dom/dist/es/frameloop/microtask.mjs +0 -6
- package/dist/es/motion-dom/dist/es/frameloop/order.mjs +0 -12
- package/dist/es/motion-dom/dist/es/frameloop/render-step.mjs +0 -92
- package/dist/es/motion-dom/dist/es/frameloop/sync-time.mjs +0 -31
- package/dist/es/motion-dom/dist/es/gestures/drag/state/is-active.mjs +0 -9
- package/dist/es/motion-dom/dist/es/gestures/drag/state/set-active.mjs +0 -28
- package/dist/es/motion-dom/dist/es/gestures/hover.mjs +0 -37
- package/dist/es/motion-dom/dist/es/gestures/press/index.mjs +0 -83
- package/dist/es/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +0 -13
- package/dist/es/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +0 -38
- package/dist/es/motion-dom/dist/es/gestures/press/utils/state.mjs +0 -3
- package/dist/es/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +0 -20
- package/dist/es/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +0 -18
- package/dist/es/motion-dom/dist/es/gestures/utils/setup.mjs +0 -15
- package/dist/es/motion-dom/dist/es/render/dom/is-css-var.mjs +0 -3
- package/dist/es/motion-dom/dist/es/render/dom/parse-transform.mjs +0 -83
- package/dist/es/motion-dom/dist/es/render/dom/style-computed.mjs +0 -10
- package/dist/es/motion-dom/dist/es/render/dom/style-set.mjs +0 -9
- package/dist/es/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs +0 -5
- package/dist/es/motion-dom/dist/es/render/utils/keys-position.mjs +0 -13
- package/dist/es/motion-dom/dist/es/render/utils/keys-transform.mjs +0 -28
- package/dist/es/motion-dom/dist/es/resize/handle-element.mjs +0 -63
- package/dist/es/motion-dom/dist/es/resize/handle-window.mjs +0 -31
- package/dist/es/motion-dom/dist/es/resize/index.mjs +0 -8
- package/dist/es/motion-dom/dist/es/scroll/observe.mjs +0 -18
- package/dist/es/motion-dom/dist/es/stats/animation-count.mjs +0 -7
- package/dist/es/motion-dom/dist/es/stats/buffer.mjs +0 -6
- package/dist/es/motion-dom/dist/es/stats/index.mjs +0 -117
- package/dist/es/motion-dom/dist/es/utils/interpolate.mjs +0 -79
- package/dist/es/motion-dom/dist/es/utils/is-html-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/is-svg-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/is-svg-svg-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/mix/color.mjs +0 -47
- package/dist/es/motion-dom/dist/es/utils/mix/complex.mjs +0 -93
- package/dist/es/motion-dom/dist/es/utils/mix/immediate.mjs +0 -5
- package/dist/es/motion-dom/dist/es/utils/mix/index.mjs +0 -14
- package/dist/es/motion-dom/dist/es/utils/mix/number.mjs +0 -26
- package/dist/es/motion-dom/dist/es/utils/mix/visibility.mjs +0 -16
- package/dist/es/motion-dom/dist/es/utils/resolve-elements.mjs +0 -17
- package/dist/es/motion-dom/dist/es/utils/supports/flags.mjs +0 -7
- package/dist/es/motion-dom/dist/es/utils/supports/linear-easing.mjs +0 -15
- package/dist/es/motion-dom/dist/es/utils/supports/memo.mjs +0 -9
- package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +0 -5
- package/dist/es/motion-dom/dist/es/utils/transform.mjs +0 -14
- package/dist/es/motion-dom/dist/es/value/index.mjs +0 -329
- package/dist/es/motion-dom/dist/es/value/map-value.mjs +0 -46
- package/dist/es/motion-dom/dist/es/value/spring-value.mjs +0 -72
- package/dist/es/motion-dom/dist/es/value/subscribe-value.mjs +0 -13
- package/dist/es/motion-dom/dist/es/value/transform-value.mjs +0 -35
- package/dist/es/motion-dom/dist/es/value/types/auto.mjs +0 -9
- package/dist/es/motion-dom/dist/es/value/types/color/hex.mjs +0 -40
- package/dist/es/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs +0 -42
- package/dist/es/motion-dom/dist/es/value/types/color/hsla.mjs +0 -22
- package/dist/es/motion-dom/dist/es/value/types/color/index.mjs +0 -32
- package/dist/es/motion-dom/dist/es/value/types/color/rgba.mjs +0 -25
- package/dist/es/motion-dom/dist/es/value/types/color/utils.mjs +0 -29
- package/dist/es/motion-dom/dist/es/value/types/complex/filter.mjs +0 -30
- package/dist/es/motion-dom/dist/es/value/types/complex/index.mjs +0 -91
- package/dist/es/motion-dom/dist/es/value/types/dimensions.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/int.mjs +0 -8
- package/dist/es/motion-dom/dist/es/value/types/maps/defaults.mjs +0 -30
- package/dist/es/motion-dom/dist/es/value/types/maps/number.mjs +0 -50
- package/dist/es/motion-dom/dist/es/value/types/maps/transform.mjs +0 -31
- package/dist/es/motion-dom/dist/es/value/types/numbers/index.mjs +0 -17
- package/dist/es/motion-dom/dist/es/value/types/numbers/units.mjs +0 -18
- package/dist/es/motion-dom/dist/es/value/types/test.mjs +0 -6
- package/dist/es/motion-dom/dist/es/value/types/utils/animatable-none.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/utils/color-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/types/utils/find.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/utils/float-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/types/utils/get-as-type.mjs +0 -10
- package/dist/es/motion-dom/dist/es/value/types/utils/is-nullish.mjs +0 -5
- package/dist/es/motion-dom/dist/es/value/types/utils/sanitize.mjs +0 -5
- package/dist/es/motion-dom/dist/es/value/types/utils/single-color-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/utils/is-motion-value.mjs +0 -3
- package/dist/es/motion-dom/dist/es/view/index.mjs +0 -64
- package/dist/es/motion-dom/dist/es/view/queue.mjs +0 -52
- package/dist/es/motion-dom/dist/es/view/start.mjs +0 -155
- package/dist/es/motion-dom/dist/es/view/utils/choose-layer-type.mjs +0 -11
- package/dist/es/motion-dom/dist/es/view/utils/css.mjs +0 -32
- package/dist/es/motion-dom/dist/es/view/utils/get-layer-name.mjs +0 -8
- package/dist/es/motion-dom/dist/es/view/utils/get-view-animations.mjs +0 -12
- package/dist/es/motion-dom/dist/es/view/utils/has-target.mjs +0 -5
- package/dist/es/motion-utils/dist/es/array.mjs +0 -21
- package/dist/es/motion-utils/dist/es/clamp.mjs +0 -9
- package/dist/es/motion-utils/dist/es/easing/anticipate.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/back.mjs +0 -9
- package/dist/es/motion-utils/dist/es/easing/circ.mjs +0 -8
- package/dist/es/motion-utils/dist/es/easing/cubic-bezier.mjs +0 -51
- package/dist/es/motion-utils/dist/es/easing/ease.mjs +0 -7
- package/dist/es/motion-utils/dist/es/easing/modifiers/mirror.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/modifiers/reverse.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/steps.mjs +0 -15
- package/dist/es/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +0 -8
- package/dist/es/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +0 -3
- package/dist/es/motion-utils/dist/es/easing/utils/is-easing-array.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/utils/map.mjs +0 -41
- package/dist/es/motion-utils/dist/es/errors.mjs +0 -16
- package/dist/es/motion-utils/dist/es/global-config.mjs +0 -3
- package/dist/es/motion-utils/dist/es/is-numerical-string.mjs +0 -6
- package/dist/es/motion-utils/dist/es/is-object.mjs +0 -5
- package/dist/es/motion-utils/dist/es/is-zero-value-string.mjs +0 -6
- package/dist/es/motion-utils/dist/es/memo.mjs +0 -11
- package/dist/es/motion-utils/dist/es/noop.mjs +0 -4
- package/dist/es/motion-utils/dist/es/pipe.mjs +0 -11
- package/dist/es/motion-utils/dist/es/progress.mjs +0 -19
- package/dist/es/motion-utils/dist/es/subscription-manager.mjs +0 -40
- package/dist/es/motion-utils/dist/es/time-conversion.mjs +0 -12
- package/dist/es/motion-utils/dist/es/velocity-per-second.mjs +0 -11
- package/dist/es/motion-utils/dist/es/warn-once.mjs +0 -14
- package/dist/es/motion-utils/dist/es/wrap.mjs +0 -6
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
import { featureDefinitions } from '../motion/features/definitions.mjs';
|
|
2
|
-
import { createBox } from '../projection/geometry/models.mjs';
|
|
3
|
-
import { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';
|
|
4
|
-
import { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';
|
|
5
|
-
import { visualElementStore } from './store.mjs';
|
|
6
|
-
import { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';
|
|
7
|
-
import { updateMotionValuesFromProps } from './utils/motion-values.mjs';
|
|
8
|
-
import { resolveVariantFromProps } from './utils/resolve-variants.mjs';
|
|
9
|
-
import { KeyframeResolver } from '../../../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs';
|
|
10
|
-
import { time } from '../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
|
|
11
|
-
import { frame, cancelFrame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
12
|
-
import { isMotionValue } from '../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs';
|
|
13
|
-
import { warnOnce } from '../../../../motion-utils/dist/es/warn-once.mjs';
|
|
14
|
-
import { transformProps } from '../../../../motion-dom/dist/es/render/utils/keys-transform.mjs';
|
|
15
|
-
import { motionValue } from '../../../../motion-dom/dist/es/value/index.mjs';
|
|
16
|
-
import { isNumericalString } from '../../../../motion-utils/dist/es/is-numerical-string.mjs';
|
|
17
|
-
import { isZeroValueString } from '../../../../motion-utils/dist/es/is-zero-value-string.mjs';
|
|
18
|
-
import { findValueType } from '../../../../motion-dom/dist/es/value/types/utils/find.mjs';
|
|
19
|
-
import { complex } from '../../../../motion-dom/dist/es/value/types/complex/index.mjs';
|
|
20
|
-
import { getAnimatableNone } from '../../../../motion-dom/dist/es/value/types/utils/animatable-none.mjs';
|
|
21
|
-
import { SubscriptionManager } from '../../../../motion-utils/dist/es/subscription-manager.mjs';
|
|
22
|
-
|
|
23
|
-
const propEventHandlers = [
|
|
24
|
-
"AnimationStart",
|
|
25
|
-
"AnimationComplete",
|
|
26
|
-
"Update",
|
|
27
|
-
"BeforeLayoutMeasure",
|
|
28
|
-
"LayoutMeasure",
|
|
29
|
-
"LayoutAnimationStart",
|
|
30
|
-
"LayoutAnimationComplete",
|
|
31
|
-
];
|
|
32
|
-
/**
|
|
33
|
-
* A VisualElement is an imperative abstraction around UI elements such as
|
|
34
|
-
* HTMLElement, SVGElement, Three.Object3D etc.
|
|
35
|
-
*/
|
|
36
|
-
class VisualElement {
|
|
37
|
-
/**
|
|
38
|
-
* This method takes React props and returns found MotionValues. For example, HTML
|
|
39
|
-
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
40
|
-
*
|
|
41
|
-
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
42
|
-
* intended to be one.
|
|
43
|
-
*/
|
|
44
|
-
scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {
|
|
48
|
-
/**
|
|
49
|
-
* A reference to the current underlying Instance, e.g. a HTMLElement
|
|
50
|
-
* or Three.Mesh etc.
|
|
51
|
-
*/
|
|
52
|
-
this.current = null;
|
|
53
|
-
/**
|
|
54
|
-
* A set containing references to this VisualElement's children.
|
|
55
|
-
*/
|
|
56
|
-
this.children = new Set();
|
|
57
|
-
/**
|
|
58
|
-
* Determine what role this visual element should take in the variant tree.
|
|
59
|
-
*/
|
|
60
|
-
this.isVariantNode = false;
|
|
61
|
-
this.isControllingVariants = false;
|
|
62
|
-
/**
|
|
63
|
-
* Decides whether this VisualElement should animate in reduced motion
|
|
64
|
-
* mode.
|
|
65
|
-
*
|
|
66
|
-
* TODO: This is currently set on every individual VisualElement but feels
|
|
67
|
-
* like it could be set globally.
|
|
68
|
-
*/
|
|
69
|
-
this.shouldReduceMotion = null;
|
|
70
|
-
/**
|
|
71
|
-
* A map of all motion values attached to this visual element. Motion
|
|
72
|
-
* values are source of truth for any given animated value. A motion
|
|
73
|
-
* value might be provided externally by the component via props.
|
|
74
|
-
*/
|
|
75
|
-
this.values = new Map();
|
|
76
|
-
this.KeyframeResolver = KeyframeResolver;
|
|
77
|
-
/**
|
|
78
|
-
* Cleanup functions for active features (hover/tap/exit etc)
|
|
79
|
-
*/
|
|
80
|
-
this.features = {};
|
|
81
|
-
/**
|
|
82
|
-
* A map of every subscription that binds the provided or generated
|
|
83
|
-
* motion values onChange listeners to this visual element.
|
|
84
|
-
*/
|
|
85
|
-
this.valueSubscriptions = new Map();
|
|
86
|
-
/**
|
|
87
|
-
* A reference to the previously-provided motion values as returned
|
|
88
|
-
* from scrapeMotionValuesFromProps. We use the keys in here to determine
|
|
89
|
-
* if any motion values need to be removed after props are updated.
|
|
90
|
-
*/
|
|
91
|
-
this.prevMotionValues = {};
|
|
92
|
-
/**
|
|
93
|
-
* An object containing a SubscriptionManager for each active event.
|
|
94
|
-
*/
|
|
95
|
-
this.events = {};
|
|
96
|
-
/**
|
|
97
|
-
* An object containing an unsubscribe function for each prop event subscription.
|
|
98
|
-
* For example, every "Update" event can have multiple subscribers via
|
|
99
|
-
* VisualElement.on(), but only one of those can be defined via the onUpdate prop.
|
|
100
|
-
*/
|
|
101
|
-
this.propEventSubscriptions = {};
|
|
102
|
-
this.notifyUpdate = () => this.notify("Update", this.latestValues);
|
|
103
|
-
this.render = () => {
|
|
104
|
-
if (!this.current)
|
|
105
|
-
return;
|
|
106
|
-
this.triggerBuild();
|
|
107
|
-
this.renderInstance(this.current, this.renderState, this.props.style, this.projection);
|
|
108
|
-
};
|
|
109
|
-
this.renderScheduledAt = 0.0;
|
|
110
|
-
this.scheduleRender = () => {
|
|
111
|
-
const now = time.now();
|
|
112
|
-
if (this.renderScheduledAt < now) {
|
|
113
|
-
this.renderScheduledAt = now;
|
|
114
|
-
frame.render(this.render, false, true);
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const { latestValues, renderState } = visualState;
|
|
118
|
-
this.latestValues = latestValues;
|
|
119
|
-
this.baseTarget = { ...latestValues };
|
|
120
|
-
this.initialValues = props.initial ? { ...latestValues } : {};
|
|
121
|
-
this.renderState = renderState;
|
|
122
|
-
this.parent = parent;
|
|
123
|
-
this.props = props;
|
|
124
|
-
this.presenceContext = presenceContext;
|
|
125
|
-
this.depth = parent ? parent.depth + 1 : 0;
|
|
126
|
-
this.reducedMotionConfig = reducedMotionConfig;
|
|
127
|
-
this.options = options;
|
|
128
|
-
this.blockInitialAnimation = Boolean(blockInitialAnimation);
|
|
129
|
-
this.isControllingVariants = isControllingVariants(props);
|
|
130
|
-
this.isVariantNode = isVariantNode(props);
|
|
131
|
-
if (this.isVariantNode) {
|
|
132
|
-
this.variantChildren = new Set();
|
|
133
|
-
}
|
|
134
|
-
this.manuallyAnimateOnMount = Boolean(parent && parent.current);
|
|
135
|
-
/**
|
|
136
|
-
* Any motion values that are provided to the element when created
|
|
137
|
-
* aren't yet bound to the element, as this would technically be impure.
|
|
138
|
-
* However, we iterate through the motion values and set them to the
|
|
139
|
-
* initial values for this component.
|
|
140
|
-
*
|
|
141
|
-
* TODO: This is impure and we should look at changing this to run on mount.
|
|
142
|
-
* Doing so will break some tests but this isn't necessarily a breaking change,
|
|
143
|
-
* more a reflection of the test.
|
|
144
|
-
*/
|
|
145
|
-
const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);
|
|
146
|
-
for (const key in initialMotionValues) {
|
|
147
|
-
const value = initialMotionValues[key];
|
|
148
|
-
if (latestValues[key] !== undefined && isMotionValue(value)) {
|
|
149
|
-
value.set(latestValues[key], false);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
mount(instance) {
|
|
154
|
-
this.current = instance;
|
|
155
|
-
visualElementStore.set(instance, this);
|
|
156
|
-
if (this.projection && !this.projection.instance) {
|
|
157
|
-
this.projection.mount(instance);
|
|
158
|
-
}
|
|
159
|
-
if (this.parent && this.isVariantNode && !this.isControllingVariants) {
|
|
160
|
-
this.removeFromVariantTree = this.parent.addVariantChild(this);
|
|
161
|
-
}
|
|
162
|
-
this.values.forEach((value, key) => this.bindToMotionValue(key, value));
|
|
163
|
-
if (!hasReducedMotionListener.current) {
|
|
164
|
-
initPrefersReducedMotion();
|
|
165
|
-
}
|
|
166
|
-
this.shouldReduceMotion =
|
|
167
|
-
this.reducedMotionConfig === "never"
|
|
168
|
-
? false
|
|
169
|
-
: this.reducedMotionConfig === "always"
|
|
170
|
-
? true
|
|
171
|
-
: prefersReducedMotion.current;
|
|
172
|
-
if (process.env.NODE_ENV !== "production") {
|
|
173
|
-
warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.");
|
|
174
|
-
}
|
|
175
|
-
if (this.parent)
|
|
176
|
-
this.parent.children.add(this);
|
|
177
|
-
this.update(this.props, this.presenceContext);
|
|
178
|
-
}
|
|
179
|
-
unmount() {
|
|
180
|
-
this.projection && this.projection.unmount();
|
|
181
|
-
cancelFrame(this.notifyUpdate);
|
|
182
|
-
cancelFrame(this.render);
|
|
183
|
-
this.valueSubscriptions.forEach((remove) => remove());
|
|
184
|
-
this.valueSubscriptions.clear();
|
|
185
|
-
this.removeFromVariantTree && this.removeFromVariantTree();
|
|
186
|
-
this.parent && this.parent.children.delete(this);
|
|
187
|
-
for (const key in this.events) {
|
|
188
|
-
this.events[key].clear();
|
|
189
|
-
}
|
|
190
|
-
for (const key in this.features) {
|
|
191
|
-
const feature = this.features[key];
|
|
192
|
-
if (feature) {
|
|
193
|
-
feature.unmount();
|
|
194
|
-
feature.isMounted = false;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
this.current = null;
|
|
198
|
-
}
|
|
199
|
-
bindToMotionValue(key, value) {
|
|
200
|
-
if (this.valueSubscriptions.has(key)) {
|
|
201
|
-
this.valueSubscriptions.get(key)();
|
|
202
|
-
}
|
|
203
|
-
const valueIsTransform = transformProps.has(key);
|
|
204
|
-
if (valueIsTransform && this.onBindTransform) {
|
|
205
|
-
this.onBindTransform();
|
|
206
|
-
}
|
|
207
|
-
const removeOnChange = value.on("change", (latestValue) => {
|
|
208
|
-
this.latestValues[key] = latestValue;
|
|
209
|
-
this.props.onUpdate && frame.preRender(this.notifyUpdate);
|
|
210
|
-
if (valueIsTransform && this.projection) {
|
|
211
|
-
this.projection.isTransformDirty = true;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
|
|
215
|
-
let removeSyncCheck;
|
|
216
|
-
if (window.MotionCheckAppearSync) {
|
|
217
|
-
removeSyncCheck = window.MotionCheckAppearSync(this, key, value);
|
|
218
|
-
}
|
|
219
|
-
this.valueSubscriptions.set(key, () => {
|
|
220
|
-
removeOnChange();
|
|
221
|
-
removeOnRenderRequest();
|
|
222
|
-
if (removeSyncCheck)
|
|
223
|
-
removeSyncCheck();
|
|
224
|
-
if (value.owner)
|
|
225
|
-
value.stop();
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
sortNodePosition(other) {
|
|
229
|
-
/**
|
|
230
|
-
* If these nodes aren't even of the same type we can't compare their depth.
|
|
231
|
-
*/
|
|
232
|
-
if (!this.current ||
|
|
233
|
-
!this.sortInstanceNodePosition ||
|
|
234
|
-
this.type !== other.type) {
|
|
235
|
-
return 0;
|
|
236
|
-
}
|
|
237
|
-
return this.sortInstanceNodePosition(this.current, other.current);
|
|
238
|
-
}
|
|
239
|
-
updateFeatures() {
|
|
240
|
-
let key = "animation";
|
|
241
|
-
for (key in featureDefinitions) {
|
|
242
|
-
const featureDefinition = featureDefinitions[key];
|
|
243
|
-
if (!featureDefinition)
|
|
244
|
-
continue;
|
|
245
|
-
const { isEnabled, Feature: FeatureConstructor } = featureDefinition;
|
|
246
|
-
/**
|
|
247
|
-
* If this feature is enabled but not active, make a new instance.
|
|
248
|
-
*/
|
|
249
|
-
if (!this.features[key] &&
|
|
250
|
-
FeatureConstructor &&
|
|
251
|
-
isEnabled(this.props)) {
|
|
252
|
-
this.features[key] = new FeatureConstructor(this);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* If we have a feature, mount or update it.
|
|
256
|
-
*/
|
|
257
|
-
if (this.features[key]) {
|
|
258
|
-
const feature = this.features[key];
|
|
259
|
-
if (feature.isMounted) {
|
|
260
|
-
feature.update();
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
feature.mount();
|
|
264
|
-
feature.isMounted = true;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
triggerBuild() {
|
|
270
|
-
this.build(this.renderState, this.latestValues, this.props);
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Measure the current viewport box with or without transforms.
|
|
274
|
-
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
275
|
-
* removed with a re-render to work.
|
|
276
|
-
*/
|
|
277
|
-
measureViewportBox() {
|
|
278
|
-
return this.current
|
|
279
|
-
? this.measureInstanceViewportBox(this.current, this.props)
|
|
280
|
-
: createBox();
|
|
281
|
-
}
|
|
282
|
-
getStaticValue(key) {
|
|
283
|
-
return this.latestValues[key];
|
|
284
|
-
}
|
|
285
|
-
setStaticValue(key, value) {
|
|
286
|
-
this.latestValues[key] = value;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Update the provided props. Ensure any newly-added motion values are
|
|
290
|
-
* added to our map, old ones removed, and listeners updated.
|
|
291
|
-
*/
|
|
292
|
-
update(props, presenceContext) {
|
|
293
|
-
if (props.transformTemplate || this.props.transformTemplate) {
|
|
294
|
-
this.scheduleRender();
|
|
295
|
-
}
|
|
296
|
-
this.prevProps = this.props;
|
|
297
|
-
this.props = props;
|
|
298
|
-
this.prevPresenceContext = this.presenceContext;
|
|
299
|
-
this.presenceContext = presenceContext;
|
|
300
|
-
/**
|
|
301
|
-
* Update prop event handlers ie onAnimationStart, onAnimationComplete
|
|
302
|
-
*/
|
|
303
|
-
for (let i = 0; i < propEventHandlers.length; i++) {
|
|
304
|
-
const key = propEventHandlers[i];
|
|
305
|
-
if (this.propEventSubscriptions[key]) {
|
|
306
|
-
this.propEventSubscriptions[key]();
|
|
307
|
-
delete this.propEventSubscriptions[key];
|
|
308
|
-
}
|
|
309
|
-
const listenerName = ("on" + key);
|
|
310
|
-
const listener = props[listenerName];
|
|
311
|
-
if (listener) {
|
|
312
|
-
this.propEventSubscriptions[key] = this.on(key, listener);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);
|
|
316
|
-
if (this.handleChildMotionValue) {
|
|
317
|
-
this.handleChildMotionValue();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
getProps() {
|
|
321
|
-
return this.props;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Returns the variant definition with a given name.
|
|
325
|
-
*/
|
|
326
|
-
getVariant(name) {
|
|
327
|
-
return this.props.variants ? this.props.variants[name] : undefined;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Returns the defined default transition on this component.
|
|
331
|
-
*/
|
|
332
|
-
getDefaultTransition() {
|
|
333
|
-
return this.props.transition;
|
|
334
|
-
}
|
|
335
|
-
getTransformPagePoint() {
|
|
336
|
-
return this.props.transformPagePoint;
|
|
337
|
-
}
|
|
338
|
-
getClosestVariantNode() {
|
|
339
|
-
return this.isVariantNode
|
|
340
|
-
? this
|
|
341
|
-
: this.parent
|
|
342
|
-
? this.parent.getClosestVariantNode()
|
|
343
|
-
: undefined;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Add a child visual element to our set of children.
|
|
347
|
-
*/
|
|
348
|
-
addVariantChild(child) {
|
|
349
|
-
const closestVariantNode = this.getClosestVariantNode();
|
|
350
|
-
if (closestVariantNode) {
|
|
351
|
-
closestVariantNode.variantChildren &&
|
|
352
|
-
closestVariantNode.variantChildren.add(child);
|
|
353
|
-
return () => closestVariantNode.variantChildren.delete(child);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Add a motion value and bind it to this visual element.
|
|
358
|
-
*/
|
|
359
|
-
addValue(key, value) {
|
|
360
|
-
// Remove existing value if it exists
|
|
361
|
-
const existingValue = this.values.get(key);
|
|
362
|
-
if (value !== existingValue) {
|
|
363
|
-
if (existingValue)
|
|
364
|
-
this.removeValue(key);
|
|
365
|
-
this.bindToMotionValue(key, value);
|
|
366
|
-
this.values.set(key, value);
|
|
367
|
-
this.latestValues[key] = value.get();
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Remove a motion value and unbind any active subscriptions.
|
|
372
|
-
*/
|
|
373
|
-
removeValue(key) {
|
|
374
|
-
this.values.delete(key);
|
|
375
|
-
const unsubscribe = this.valueSubscriptions.get(key);
|
|
376
|
-
if (unsubscribe) {
|
|
377
|
-
unsubscribe();
|
|
378
|
-
this.valueSubscriptions.delete(key);
|
|
379
|
-
}
|
|
380
|
-
delete this.latestValues[key];
|
|
381
|
-
this.removeValueFromRenderState(key, this.renderState);
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Check whether we have a motion value for this key
|
|
385
|
-
*/
|
|
386
|
-
hasValue(key) {
|
|
387
|
-
return this.values.has(key);
|
|
388
|
-
}
|
|
389
|
-
getValue(key, defaultValue) {
|
|
390
|
-
if (this.props.values && this.props.values[key]) {
|
|
391
|
-
return this.props.values[key];
|
|
392
|
-
}
|
|
393
|
-
let value = this.values.get(key);
|
|
394
|
-
if (value === undefined && defaultValue !== undefined) {
|
|
395
|
-
value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });
|
|
396
|
-
this.addValue(key, value);
|
|
397
|
-
}
|
|
398
|
-
return value;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* If we're trying to animate to a previously unencountered value,
|
|
402
|
-
* we need to check for it in our state and as a last resort read it
|
|
403
|
-
* directly from the instance (which might have performance implications).
|
|
404
|
-
*/
|
|
405
|
-
readValue(key, target) {
|
|
406
|
-
let value = this.latestValues[key] !== undefined || !this.current
|
|
407
|
-
? this.latestValues[key]
|
|
408
|
-
: this.getBaseTargetFromProps(this.props, key) ??
|
|
409
|
-
this.readValueFromInstance(this.current, key, this.options);
|
|
410
|
-
if (value !== undefined && value !== null) {
|
|
411
|
-
if (typeof value === "string" &&
|
|
412
|
-
(isNumericalString(value) || isZeroValueString(value))) {
|
|
413
|
-
// If this is a number read as a string, ie "0" or "200", convert it to a number
|
|
414
|
-
value = parseFloat(value);
|
|
415
|
-
}
|
|
416
|
-
else if (!findValueType(value) && complex.test(target)) {
|
|
417
|
-
value = getAnimatableNone(key, target);
|
|
418
|
-
}
|
|
419
|
-
this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);
|
|
420
|
-
}
|
|
421
|
-
return isMotionValue(value) ? value.get() : value;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Set the base target to later animate back to. This is currently
|
|
425
|
-
* only hydrated on creation and when we first read a value.
|
|
426
|
-
*/
|
|
427
|
-
setBaseTarget(key, value) {
|
|
428
|
-
this.baseTarget[key] = value;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Find the base target for a value thats been removed from all animation
|
|
432
|
-
* props.
|
|
433
|
-
*/
|
|
434
|
-
getBaseTarget(key) {
|
|
435
|
-
const { initial } = this.props;
|
|
436
|
-
let valueFromInitial;
|
|
437
|
-
if (typeof initial === "string" || typeof initial === "object") {
|
|
438
|
-
const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);
|
|
439
|
-
if (variant) {
|
|
440
|
-
valueFromInitial = variant[key];
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* If this value still exists in the current initial variant, read that.
|
|
445
|
-
*/
|
|
446
|
-
if (initial && valueFromInitial !== undefined) {
|
|
447
|
-
return valueFromInitial;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Alternatively, if this VisualElement config has defined a getBaseTarget
|
|
451
|
-
* so we can read the value from an alternative source, try that.
|
|
452
|
-
*/
|
|
453
|
-
const target = this.getBaseTargetFromProps(this.props, key);
|
|
454
|
-
if (target !== undefined && !isMotionValue(target))
|
|
455
|
-
return target;
|
|
456
|
-
/**
|
|
457
|
-
* If the value was initially defined on initial, but it doesn't any more,
|
|
458
|
-
* return undefined. Otherwise return the value as initially read from the DOM.
|
|
459
|
-
*/
|
|
460
|
-
return this.initialValues[key] !== undefined &&
|
|
461
|
-
valueFromInitial === undefined
|
|
462
|
-
? undefined
|
|
463
|
-
: this.baseTarget[key];
|
|
464
|
-
}
|
|
465
|
-
on(eventName, callback) {
|
|
466
|
-
if (!this.events[eventName]) {
|
|
467
|
-
this.events[eventName] = new SubscriptionManager();
|
|
468
|
-
}
|
|
469
|
-
return this.events[eventName].add(callback);
|
|
470
|
-
}
|
|
471
|
-
notify(eventName, ...args) {
|
|
472
|
-
if (this.events[eventName]) {
|
|
473
|
-
this.events[eventName].notify(...args);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export { VisualElement };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRendererMotionComponent } from '../../motion/index.mjs';
|
|
2
|
-
import { createUseRender } from '../dom/use-render.mjs';
|
|
3
|
-
import { isSVGComponent } from '../dom/utils/is-svg-component.mjs';
|
|
4
|
-
import { htmlMotionConfig } from '../html/config-motion.mjs';
|
|
5
|
-
import { svgMotionConfig } from '../svg/config-motion.mjs';
|
|
6
|
-
|
|
7
|
-
function createMotionComponentFactory(preloadedFeatures, createVisualElement) {
|
|
8
|
-
return function createMotionComponent(Component, { forwardMotionProps } = { forwardMotionProps: false }) {
|
|
9
|
-
const baseConfig = isSVGComponent(Component)
|
|
10
|
-
? svgMotionConfig
|
|
11
|
-
: htmlMotionConfig;
|
|
12
|
-
const config = {
|
|
13
|
-
...baseConfig,
|
|
14
|
-
preloadedFeatures,
|
|
15
|
-
useRender: createUseRender(forwardMotionProps),
|
|
16
|
-
createVisualElement,
|
|
17
|
-
Component,
|
|
18
|
-
};
|
|
19
|
-
return createRendererMotionComponent(config);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { createMotionComponentFactory };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { warnOnce } from '../../../../../motion-utils/dist/es/warn-once.mjs';
|
|
2
|
-
|
|
3
|
-
function createDOMMotionComponentProxy(componentFactory) {
|
|
4
|
-
if (typeof Proxy === "undefined") {
|
|
5
|
-
return componentFactory;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
|
|
9
|
-
* Rather than generating them anew every render.
|
|
10
|
-
*/
|
|
11
|
-
const componentCache = new Map();
|
|
12
|
-
const deprecatedFactoryFunction = (...args) => {
|
|
13
|
-
if (process.env.NODE_ENV !== "production") {
|
|
14
|
-
warnOnce(false, "motion() is deprecated. Use motion.create() instead.");
|
|
15
|
-
}
|
|
16
|
-
return componentFactory(...args);
|
|
17
|
-
};
|
|
18
|
-
return new Proxy(deprecatedFactoryFunction, {
|
|
19
|
-
/**
|
|
20
|
-
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
21
|
-
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
22
|
-
* DOM component with that name.
|
|
23
|
-
*/
|
|
24
|
-
get: (_target, key) => {
|
|
25
|
-
if (key === "create")
|
|
26
|
-
return componentFactory;
|
|
27
|
-
/**
|
|
28
|
-
* If this element doesn't exist in the component cache, create it and cache.
|
|
29
|
-
*/
|
|
30
|
-
if (!componentCache.has(key)) {
|
|
31
|
-
componentCache.set(key, componentFactory(key));
|
|
32
|
-
}
|
|
33
|
-
return componentCache.get(key);
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { createDOMMotionComponentProxy };
|