motion 12.18.1 → 12.19.0
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.dev.js +2 -2
- 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,18 +0,0 @@
|
|
|
1
|
-
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
|
2
|
-
|
|
3
|
-
function observeTimeline(update, timeline) {
|
|
4
|
-
let prevProgress;
|
|
5
|
-
const onFrame = () => {
|
|
6
|
-
const { currentTime } = timeline;
|
|
7
|
-
const percentage = currentTime === null ? 0 : currentTime.value;
|
|
8
|
-
const progress = percentage / 100;
|
|
9
|
-
if (prevProgress !== progress) {
|
|
10
|
-
update(progress);
|
|
11
|
-
}
|
|
12
|
-
prevProgress = progress;
|
|
13
|
-
};
|
|
14
|
-
frame.preUpdate(onFrame, true);
|
|
15
|
-
return () => cancelFrame(onFrame);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { observeTimeline };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { activeAnimations } from './animation-count.mjs';
|
|
2
|
-
import { statsBuffer } from './buffer.mjs';
|
|
3
|
-
import { frame, cancelFrame, frameData } from '../frameloop/frame.mjs';
|
|
4
|
-
|
|
5
|
-
function record() {
|
|
6
|
-
const { value } = statsBuffer;
|
|
7
|
-
if (value === null) {
|
|
8
|
-
cancelFrame(record);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
value.frameloop.rate.push(frameData.delta);
|
|
12
|
-
value.animations.mainThread.push(activeAnimations.mainThread);
|
|
13
|
-
value.animations.waapi.push(activeAnimations.waapi);
|
|
14
|
-
value.animations.layout.push(activeAnimations.layout);
|
|
15
|
-
}
|
|
16
|
-
function mean(values) {
|
|
17
|
-
return values.reduce((acc, value) => acc + value, 0) / values.length;
|
|
18
|
-
}
|
|
19
|
-
function summarise(values, calcAverage = mean) {
|
|
20
|
-
if (values.length === 0) {
|
|
21
|
-
return {
|
|
22
|
-
min: 0,
|
|
23
|
-
max: 0,
|
|
24
|
-
avg: 0,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
min: Math.min(...values),
|
|
29
|
-
max: Math.max(...values),
|
|
30
|
-
avg: calcAverage(values),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const msToFps = (ms) => Math.round(1000 / ms);
|
|
34
|
-
function clearStatsBuffer() {
|
|
35
|
-
statsBuffer.value = null;
|
|
36
|
-
statsBuffer.addProjectionMetrics = null;
|
|
37
|
-
}
|
|
38
|
-
function reportStats() {
|
|
39
|
-
const { value } = statsBuffer;
|
|
40
|
-
if (!value) {
|
|
41
|
-
throw new Error("Stats are not being measured");
|
|
42
|
-
}
|
|
43
|
-
clearStatsBuffer();
|
|
44
|
-
cancelFrame(record);
|
|
45
|
-
const summary = {
|
|
46
|
-
frameloop: {
|
|
47
|
-
setup: summarise(value.frameloop.setup),
|
|
48
|
-
rate: summarise(value.frameloop.rate),
|
|
49
|
-
read: summarise(value.frameloop.read),
|
|
50
|
-
resolveKeyframes: summarise(value.frameloop.resolveKeyframes),
|
|
51
|
-
preUpdate: summarise(value.frameloop.preUpdate),
|
|
52
|
-
update: summarise(value.frameloop.update),
|
|
53
|
-
preRender: summarise(value.frameloop.preRender),
|
|
54
|
-
render: summarise(value.frameloop.render),
|
|
55
|
-
postRender: summarise(value.frameloop.postRender),
|
|
56
|
-
},
|
|
57
|
-
animations: {
|
|
58
|
-
mainThread: summarise(value.animations.mainThread),
|
|
59
|
-
waapi: summarise(value.animations.waapi),
|
|
60
|
-
layout: summarise(value.animations.layout),
|
|
61
|
-
},
|
|
62
|
-
layoutProjection: {
|
|
63
|
-
nodes: summarise(value.layoutProjection.nodes),
|
|
64
|
-
calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas),
|
|
65
|
-
calculatedProjections: summarise(value.layoutProjection.calculatedProjections),
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Convert the rate to FPS
|
|
70
|
-
*/
|
|
71
|
-
const { rate } = summary.frameloop;
|
|
72
|
-
rate.min = msToFps(rate.min);
|
|
73
|
-
rate.max = msToFps(rate.max);
|
|
74
|
-
rate.avg = msToFps(rate.avg);
|
|
75
|
-
[rate.min, rate.max] = [rate.max, rate.min];
|
|
76
|
-
return summary;
|
|
77
|
-
}
|
|
78
|
-
function recordStats() {
|
|
79
|
-
if (statsBuffer.value) {
|
|
80
|
-
clearStatsBuffer();
|
|
81
|
-
throw new Error("Stats are already being measured");
|
|
82
|
-
}
|
|
83
|
-
const newStatsBuffer = statsBuffer;
|
|
84
|
-
newStatsBuffer.value = {
|
|
85
|
-
frameloop: {
|
|
86
|
-
setup: [],
|
|
87
|
-
rate: [],
|
|
88
|
-
read: [],
|
|
89
|
-
resolveKeyframes: [],
|
|
90
|
-
preUpdate: [],
|
|
91
|
-
update: [],
|
|
92
|
-
preRender: [],
|
|
93
|
-
render: [],
|
|
94
|
-
postRender: [],
|
|
95
|
-
},
|
|
96
|
-
animations: {
|
|
97
|
-
mainThread: [],
|
|
98
|
-
waapi: [],
|
|
99
|
-
layout: [],
|
|
100
|
-
},
|
|
101
|
-
layoutProjection: {
|
|
102
|
-
nodes: [],
|
|
103
|
-
calculatedTargetDeltas: [],
|
|
104
|
-
calculatedProjections: [],
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
newStatsBuffer.addProjectionMetrics = (metrics) => {
|
|
108
|
-
const { layoutProjection } = newStatsBuffer.value;
|
|
109
|
-
layoutProjection.nodes.push(metrics.nodes);
|
|
110
|
-
layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas);
|
|
111
|
-
layoutProjection.calculatedProjections.push(metrics.calculatedProjections);
|
|
112
|
-
};
|
|
113
|
-
frame.postRender(record, true);
|
|
114
|
-
return reportStats;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export { recordStats };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { mix } from './mix/index.mjs';
|
|
2
|
-
import { invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
3
|
-
import { clamp } from '../../../../motion-utils/dist/es/clamp.mjs';
|
|
4
|
-
import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
|
|
5
|
-
import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
|
|
6
|
-
import { pipe } from '../../../../motion-utils/dist/es/pipe.mjs';
|
|
7
|
-
import { progress } from '../../../../motion-utils/dist/es/progress.mjs';
|
|
8
|
-
|
|
9
|
-
function createMixers(output, ease, customMixer) {
|
|
10
|
-
const mixers = [];
|
|
11
|
-
const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;
|
|
12
|
-
const numMixers = output.length - 1;
|
|
13
|
-
for (let i = 0; i < numMixers; i++) {
|
|
14
|
-
let mixer = mixerFactory(output[i], output[i + 1]);
|
|
15
|
-
if (ease) {
|
|
16
|
-
const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;
|
|
17
|
-
mixer = pipe(easingFunction, mixer);
|
|
18
|
-
}
|
|
19
|
-
mixers.push(mixer);
|
|
20
|
-
}
|
|
21
|
-
return mixers;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Create a function that maps from a numerical input array to a generic output array.
|
|
25
|
-
*
|
|
26
|
-
* Accepts:
|
|
27
|
-
* - Numbers
|
|
28
|
-
* - Colors (hex, hsl, hsla, rgb, rgba)
|
|
29
|
-
* - Complex (combinations of one or more numbers or strings)
|
|
30
|
-
*
|
|
31
|
-
* ```jsx
|
|
32
|
-
* const mixColor = interpolate([0, 1], ['#fff', '#000'])
|
|
33
|
-
*
|
|
34
|
-
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* TODO Revisit this approach once we've moved to data models for values,
|
|
38
|
-
* probably not needed to pregenerate mixer functions.
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
|
|
43
|
-
const inputLength = input.length;
|
|
44
|
-
invariant(inputLength === output.length, "Both input and output ranges must be the same length");
|
|
45
|
-
/**
|
|
46
|
-
* If we're only provided a single input, we can just make a function
|
|
47
|
-
* that returns the output.
|
|
48
|
-
*/
|
|
49
|
-
if (inputLength === 1)
|
|
50
|
-
return () => output[0];
|
|
51
|
-
if (inputLength === 2 && output[0] === output[1])
|
|
52
|
-
return () => output[1];
|
|
53
|
-
const isZeroDeltaRange = input[0] === input[1];
|
|
54
|
-
// If input runs highest -> lowest, reverse both arrays
|
|
55
|
-
if (input[0] > input[inputLength - 1]) {
|
|
56
|
-
input = [...input].reverse();
|
|
57
|
-
output = [...output].reverse();
|
|
58
|
-
}
|
|
59
|
-
const mixers = createMixers(output, ease, mixer);
|
|
60
|
-
const numMixers = mixers.length;
|
|
61
|
-
const interpolator = (v) => {
|
|
62
|
-
if (isZeroDeltaRange && v < input[0])
|
|
63
|
-
return output[0];
|
|
64
|
-
let i = 0;
|
|
65
|
-
if (numMixers > 1) {
|
|
66
|
-
for (; i < input.length - 2; i++) {
|
|
67
|
-
if (v < input[i + 1])
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const progressInRange = progress(input[i], input[i + 1], v);
|
|
72
|
-
return mixers[i](progressInRange);
|
|
73
|
-
};
|
|
74
|
-
return isClamp
|
|
75
|
-
? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))
|
|
76
|
-
: interpolator;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { interpolate };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isObject } from '../../../../motion-utils/dist/es/is-object.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if an element is an HTML element in a way
|
|
5
|
-
* that works across iframes
|
|
6
|
-
*/
|
|
7
|
-
function isHTMLElement(element) {
|
|
8
|
-
return isObject(element) && "offsetHeight" in element;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { isHTMLElement };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isObject } from '../../../../motion-utils/dist/es/is-object.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if an element is an SVG element in a way
|
|
5
|
-
* that works across iframes
|
|
6
|
-
*/
|
|
7
|
-
function isSVGElement(element) {
|
|
8
|
-
return isObject(element) && "ownerSVGElement" in element;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { isSVGElement };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isSVGElement } from './is-svg-element.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if an element is specifically an SVGSVGElement (the root SVG element)
|
|
5
|
-
* in a way that works across iframes
|
|
6
|
-
*/
|
|
7
|
-
function isSVGSVGElement(element) {
|
|
8
|
-
return isSVGElement(element) && element.tagName === "svg";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { isSVGSVGElement };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { hex } from '../../value/types/color/hex.mjs';
|
|
2
|
-
import { hsla } from '../../value/types/color/hsla.mjs';
|
|
3
|
-
import { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';
|
|
4
|
-
import { rgba } from '../../value/types/color/rgba.mjs';
|
|
5
|
-
import { mixImmediate } from './immediate.mjs';
|
|
6
|
-
import { mixNumber } from './number.mjs';
|
|
7
|
-
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
8
|
-
|
|
9
|
-
// Linear color space blending
|
|
10
|
-
// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw
|
|
11
|
-
// Demonstrated http://codepen.io/osublake/pen/xGVVaN
|
|
12
|
-
const mixLinearColor = (from, to, v) => {
|
|
13
|
-
const fromExpo = from * from;
|
|
14
|
-
const expo = v * (to * to - fromExpo) + fromExpo;
|
|
15
|
-
return expo < 0 ? 0 : Math.sqrt(expo);
|
|
16
|
-
};
|
|
17
|
-
const colorTypes = [hex, rgba, hsla];
|
|
18
|
-
const getColorType = (v) => colorTypes.find((type) => type.test(v));
|
|
19
|
-
function asRGBA(color) {
|
|
20
|
-
const type = getColorType(color);
|
|
21
|
-
warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);
|
|
22
|
-
if (!Boolean(type))
|
|
23
|
-
return false;
|
|
24
|
-
let model = type.parse(color);
|
|
25
|
-
if (type === hsla) {
|
|
26
|
-
// TODO Remove this cast - needed since Motion's stricter typing
|
|
27
|
-
model = hslaToRgba(model);
|
|
28
|
-
}
|
|
29
|
-
return model;
|
|
30
|
-
}
|
|
31
|
-
const mixColor = (from, to) => {
|
|
32
|
-
const fromRGBA = asRGBA(from);
|
|
33
|
-
const toRGBA = asRGBA(to);
|
|
34
|
-
if (!fromRGBA || !toRGBA) {
|
|
35
|
-
return mixImmediate(from, to);
|
|
36
|
-
}
|
|
37
|
-
const blended = { ...fromRGBA };
|
|
38
|
-
return (v) => {
|
|
39
|
-
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
|
|
40
|
-
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
|
|
41
|
-
blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
|
|
42
|
-
blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);
|
|
43
|
-
return rgba.transform(blended);
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { mixColor, mixLinearColor };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';
|
|
2
|
-
import { color } from '../../value/types/color/index.mjs';
|
|
3
|
-
import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';
|
|
4
|
-
import { mixColor } from './color.mjs';
|
|
5
|
-
import { mixImmediate } from './immediate.mjs';
|
|
6
|
-
import { mixNumber as mixNumber$1 } from './number.mjs';
|
|
7
|
-
import { invisibleValues, mixVisibility } from './visibility.mjs';
|
|
8
|
-
import { pipe } from '../../../../../motion-utils/dist/es/pipe.mjs';
|
|
9
|
-
import { warning } from '../../../../../motion-utils/dist/es/errors.mjs';
|
|
10
|
-
|
|
11
|
-
function mixNumber(a, b) {
|
|
12
|
-
return (p) => mixNumber$1(a, b, p);
|
|
13
|
-
}
|
|
14
|
-
function getMixer(a) {
|
|
15
|
-
if (typeof a === "number") {
|
|
16
|
-
return mixNumber;
|
|
17
|
-
}
|
|
18
|
-
else if (typeof a === "string") {
|
|
19
|
-
return isCSSVariableToken(a)
|
|
20
|
-
? mixImmediate
|
|
21
|
-
: color.test(a)
|
|
22
|
-
? mixColor
|
|
23
|
-
: mixComplex;
|
|
24
|
-
}
|
|
25
|
-
else if (Array.isArray(a)) {
|
|
26
|
-
return mixArray;
|
|
27
|
-
}
|
|
28
|
-
else if (typeof a === "object") {
|
|
29
|
-
return color.test(a) ? mixColor : mixObject;
|
|
30
|
-
}
|
|
31
|
-
return mixImmediate;
|
|
32
|
-
}
|
|
33
|
-
function mixArray(a, b) {
|
|
34
|
-
const output = [...a];
|
|
35
|
-
const numValues = output.length;
|
|
36
|
-
const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));
|
|
37
|
-
return (p) => {
|
|
38
|
-
for (let i = 0; i < numValues; i++) {
|
|
39
|
-
output[i] = blendValue[i](p);
|
|
40
|
-
}
|
|
41
|
-
return output;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function mixObject(a, b) {
|
|
45
|
-
const output = { ...a, ...b };
|
|
46
|
-
const blendValue = {};
|
|
47
|
-
for (const key in output) {
|
|
48
|
-
if (a[key] !== undefined && b[key] !== undefined) {
|
|
49
|
-
blendValue[key] = getMixer(a[key])(a[key], b[key]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return (v) => {
|
|
53
|
-
for (const key in blendValue) {
|
|
54
|
-
output[key] = blendValue[key](v);
|
|
55
|
-
}
|
|
56
|
-
return output;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function matchOrder(origin, target) {
|
|
60
|
-
const orderedOrigin = [];
|
|
61
|
-
const pointers = { color: 0, var: 0, number: 0 };
|
|
62
|
-
for (let i = 0; i < target.values.length; i++) {
|
|
63
|
-
const type = target.types[i];
|
|
64
|
-
const originIndex = origin.indexes[type][pointers[type]];
|
|
65
|
-
const originValue = origin.values[originIndex] ?? 0;
|
|
66
|
-
orderedOrigin[i] = originValue;
|
|
67
|
-
pointers[type]++;
|
|
68
|
-
}
|
|
69
|
-
return orderedOrigin;
|
|
70
|
-
}
|
|
71
|
-
const mixComplex = (origin, target) => {
|
|
72
|
-
const template = complex.createTransformer(target);
|
|
73
|
-
const originStats = analyseComplexValue(origin);
|
|
74
|
-
const targetStats = analyseComplexValue(target);
|
|
75
|
-
const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&
|
|
76
|
-
originStats.indexes.color.length === targetStats.indexes.color.length &&
|
|
77
|
-
originStats.indexes.number.length >= targetStats.indexes.number.length;
|
|
78
|
-
if (canInterpolate) {
|
|
79
|
-
if ((invisibleValues.has(origin) &&
|
|
80
|
-
!targetStats.values.length) ||
|
|
81
|
-
(invisibleValues.has(target) &&
|
|
82
|
-
!originStats.values.length)) {
|
|
83
|
-
return mixVisibility(origin, target);
|
|
84
|
-
}
|
|
85
|
-
return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
|
|
89
|
-
return mixImmediate(origin, target);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export { getMixer, mixArray, mixComplex, mixObject };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getMixer } from './complex.mjs';
|
|
2
|
-
import { mixNumber } from './number.mjs';
|
|
3
|
-
|
|
4
|
-
function mix(from, to, p) {
|
|
5
|
-
if (typeof from === "number" &&
|
|
6
|
-
typeof to === "number" &&
|
|
7
|
-
typeof p === "number") {
|
|
8
|
-
return mixNumber(from, to, p);
|
|
9
|
-
}
|
|
10
|
-
const mixer = getMixer(from);
|
|
11
|
-
return mixer(from, to);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { mix };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Value in range from progress
|
|
3
|
-
|
|
4
|
-
Given a lower limit and an upper limit, we return the value within
|
|
5
|
-
that range as expressed by progress (usually a number from 0 to 1)
|
|
6
|
-
|
|
7
|
-
So progress = 0.5 would change
|
|
8
|
-
|
|
9
|
-
from -------- to
|
|
10
|
-
|
|
11
|
-
to
|
|
12
|
-
|
|
13
|
-
from ---- to
|
|
14
|
-
|
|
15
|
-
E.g. from = 10, to = 20, progress = 0.5 => 15
|
|
16
|
-
|
|
17
|
-
@param [number]: Lower limit of range
|
|
18
|
-
@param [number]: Upper limit of range
|
|
19
|
-
@param [number]: The progress between lower and upper limits expressed 0-1
|
|
20
|
-
@return [number]: Value as calculated from progress within range (not limited within range)
|
|
21
|
-
*/
|
|
22
|
-
const mixNumber = (from, to, progress) => {
|
|
23
|
-
return from + (to - from) * progress;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { mixNumber };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const invisibleValues = new Set(["none", "hidden"]);
|
|
2
|
-
/**
|
|
3
|
-
* Returns a function that, when provided a progress value between 0 and 1,
|
|
4
|
-
* will return the "none" or "hidden" string only when the progress is that of
|
|
5
|
-
* the origin or target.
|
|
6
|
-
*/
|
|
7
|
-
function mixVisibility(origin, target) {
|
|
8
|
-
if (invisibleValues.has(origin)) {
|
|
9
|
-
return (p) => (p <= 0 ? origin : target);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return (p) => (p >= 1 ? target : origin);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { invisibleValues, mixVisibility };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function resolveElements(elementOrSelector, scope, selectorCache) {
|
|
2
|
-
if (elementOrSelector instanceof EventTarget) {
|
|
3
|
-
return [elementOrSelector];
|
|
4
|
-
}
|
|
5
|
-
else if (typeof elementOrSelector === "string") {
|
|
6
|
-
let root = document;
|
|
7
|
-
if (scope) {
|
|
8
|
-
root = scope.current;
|
|
9
|
-
}
|
|
10
|
-
const elements = selectorCache?.[elementOrSelector] ??
|
|
11
|
-
root.querySelectorAll(elementOrSelector);
|
|
12
|
-
return elements ? Array.from(elements) : [];
|
|
13
|
-
}
|
|
14
|
-
return Array.from(elementOrSelector);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { resolveElements };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { memoSupports } from './memo.mjs';
|
|
2
|
-
|
|
3
|
-
const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {
|
|
4
|
-
try {
|
|
5
|
-
document
|
|
6
|
-
.createElement("div")
|
|
7
|
-
.animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
8
|
-
}
|
|
9
|
-
catch (e) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return true;
|
|
13
|
-
}, "linearEasing");
|
|
14
|
-
|
|
15
|
-
export { supportsLinearEasing };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { supportsFlags } from './flags.mjs';
|
|
2
|
-
import { memo } from '../../../../../motion-utils/dist/es/memo.mjs';
|
|
3
|
-
|
|
4
|
-
function memoSupports(callback, supportsFlag) {
|
|
5
|
-
const memoized = memo(callback);
|
|
6
|
-
return () => supportsFlags[supportsFlag] ?? memoized();
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { memoSupports };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { interpolate } from './interpolate.mjs';
|
|
2
|
-
|
|
3
|
-
function transform(...args) {
|
|
4
|
-
const useImmediate = !Array.isArray(args[0]);
|
|
5
|
-
const argOffset = useImmediate ? 0 : -1;
|
|
6
|
-
const inputValue = args[0 + argOffset];
|
|
7
|
-
const inputRange = args[1 + argOffset];
|
|
8
|
-
const outputRange = args[2 + argOffset];
|
|
9
|
-
const options = args[3 + argOffset];
|
|
10
|
-
const interpolator = interpolate(inputRange, outputRange, options);
|
|
11
|
-
return useImmediate ? interpolator(inputValue) : interpolator;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { transform };
|