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,155 +0,0 @@
|
|
|
1
|
-
import { GroupAnimation } from '../animation/GroupAnimation.mjs';
|
|
2
|
-
import { NativeAnimation } from '../animation/NativeAnimation.mjs';
|
|
3
|
-
import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs';
|
|
4
|
-
import { getValueTransition } from '../animation/utils/get-value-transition.mjs';
|
|
5
|
-
import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs';
|
|
6
|
-
import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs';
|
|
7
|
-
import { chooseLayerType } from './utils/choose-layer-type.mjs';
|
|
8
|
-
import { css } from './utils/css.mjs';
|
|
9
|
-
import { getLayerName } from './utils/get-layer-name.mjs';
|
|
10
|
-
import { getViewAnimations } from './utils/get-view-animations.mjs';
|
|
11
|
-
import { hasTarget } from './utils/has-target.mjs';
|
|
12
|
-
import { secondsToMilliseconds } from '../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
13
|
-
|
|
14
|
-
const definitionNames = ["layout", "enter", "exit", "new", "old"];
|
|
15
|
-
function startViewAnimation(builder) {
|
|
16
|
-
const { update, targets, options: defaultOptions } = builder;
|
|
17
|
-
if (!document.startViewTransition) {
|
|
18
|
-
return new Promise(async (resolve) => {
|
|
19
|
-
await update();
|
|
20
|
-
resolve(new GroupAnimation([]));
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
// TODO: Go over existing targets and ensure they all have ids
|
|
24
|
-
/**
|
|
25
|
-
* If we don't have any animations defined for the root target,
|
|
26
|
-
* remove it from being captured.
|
|
27
|
-
*/
|
|
28
|
-
if (!hasTarget("root", targets)) {
|
|
29
|
-
css.set(":root", {
|
|
30
|
-
"view-transition-name": "none",
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Set the timing curve to linear for all view transition layers.
|
|
35
|
-
* This gets baked into the keyframes, which can't be changed
|
|
36
|
-
* without breaking the generated animation.
|
|
37
|
-
*
|
|
38
|
-
* This allows us to set easing via updateTiming - which can be changed.
|
|
39
|
-
*/
|
|
40
|
-
css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" });
|
|
41
|
-
css.commit(); // Write
|
|
42
|
-
const transition = document.startViewTransition(async () => {
|
|
43
|
-
await update();
|
|
44
|
-
// TODO: Go over new targets and ensure they all have ids
|
|
45
|
-
});
|
|
46
|
-
transition.finished.finally(() => {
|
|
47
|
-
css.remove(); // Write
|
|
48
|
-
});
|
|
49
|
-
return new Promise((resolve) => {
|
|
50
|
-
transition.ready.then(() => {
|
|
51
|
-
const generatedViewAnimations = getViewAnimations();
|
|
52
|
-
const animations = [];
|
|
53
|
-
/**
|
|
54
|
-
* Create animations for each of our explicitly-defined subjects.
|
|
55
|
-
*/
|
|
56
|
-
targets.forEach((definition, target) => {
|
|
57
|
-
// TODO: If target is not "root", resolve elements
|
|
58
|
-
// and iterate over each
|
|
59
|
-
for (const key of definitionNames) {
|
|
60
|
-
if (!definition[key])
|
|
61
|
-
continue;
|
|
62
|
-
const { keyframes, options } = definition[key];
|
|
63
|
-
for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {
|
|
64
|
-
if (!valueKeyframes)
|
|
65
|
-
continue;
|
|
66
|
-
const valueOptions = {
|
|
67
|
-
...getValueTransition(defaultOptions, valueName),
|
|
68
|
-
...getValueTransition(options, valueName),
|
|
69
|
-
};
|
|
70
|
-
const type = chooseLayerType(key);
|
|
71
|
-
/**
|
|
72
|
-
* If this is an opacity animation, and keyframes are not an array,
|
|
73
|
-
* we need to convert them into an array and set an initial value.
|
|
74
|
-
*/
|
|
75
|
-
if (valueName === "opacity" &&
|
|
76
|
-
!Array.isArray(valueKeyframes)) {
|
|
77
|
-
const initialValue = type === "new" ? 0 : 1;
|
|
78
|
-
valueKeyframes = [initialValue, valueKeyframes];
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Resolve stagger function if provided.
|
|
82
|
-
*/
|
|
83
|
-
if (typeof valueOptions.delay === "function") {
|
|
84
|
-
valueOptions.delay = valueOptions.delay(0, 1);
|
|
85
|
-
}
|
|
86
|
-
valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));
|
|
87
|
-
valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));
|
|
88
|
-
const animation = new NativeAnimation({
|
|
89
|
-
...valueOptions,
|
|
90
|
-
element: document.documentElement,
|
|
91
|
-
name: valueName,
|
|
92
|
-
pseudoElement: `::view-transition-${type}(${target})`,
|
|
93
|
-
keyframes: valueKeyframes,
|
|
94
|
-
});
|
|
95
|
-
animations.push(animation);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
/**
|
|
100
|
-
* Handle browser generated animations
|
|
101
|
-
*/
|
|
102
|
-
for (const animation of generatedViewAnimations) {
|
|
103
|
-
if (animation.playState === "finished")
|
|
104
|
-
continue;
|
|
105
|
-
const { effect } = animation;
|
|
106
|
-
if (!effect || !(effect instanceof KeyframeEffect))
|
|
107
|
-
continue;
|
|
108
|
-
const { pseudoElement } = effect;
|
|
109
|
-
if (!pseudoElement)
|
|
110
|
-
continue;
|
|
111
|
-
const name = getLayerName(pseudoElement);
|
|
112
|
-
if (!name)
|
|
113
|
-
continue;
|
|
114
|
-
const targetDefinition = targets.get(name.layer);
|
|
115
|
-
if (!targetDefinition) {
|
|
116
|
-
/**
|
|
117
|
-
* If transition name is group then update the timing of the animation
|
|
118
|
-
* whereas if it's old or new then we could possibly replace it using
|
|
119
|
-
* the above method.
|
|
120
|
-
*/
|
|
121
|
-
const transitionName = name.type === "group" ? "layout" : "";
|
|
122
|
-
let animationTransition = {
|
|
123
|
-
...getValueTransition(defaultOptions, transitionName),
|
|
124
|
-
};
|
|
125
|
-
animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));
|
|
126
|
-
animationTransition =
|
|
127
|
-
applyGeneratorOptions(animationTransition);
|
|
128
|
-
const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);
|
|
129
|
-
effect.updateTiming({
|
|
130
|
-
delay: secondsToMilliseconds(animationTransition.delay ?? 0),
|
|
131
|
-
duration: animationTransition.duration,
|
|
132
|
-
easing,
|
|
133
|
-
});
|
|
134
|
-
animations.push(new NativeAnimationWrapper(animation));
|
|
135
|
-
}
|
|
136
|
-
else if (hasOpacity(targetDefinition, "enter") &&
|
|
137
|
-
hasOpacity(targetDefinition, "exit") &&
|
|
138
|
-
effect
|
|
139
|
-
.getKeyframes()
|
|
140
|
-
.some((keyframe) => keyframe.mixBlendMode)) {
|
|
141
|
-
animations.push(new NativeAnimationWrapper(animation));
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
animation.cancel();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
resolve(new GroupAnimation(animations));
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function hasOpacity(target, key) {
|
|
152
|
-
return target?.[key]?.keyframes.opacity;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export { startViewAnimation };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function chooseLayerType(valueName) {
|
|
2
|
-
if (valueName === "layout")
|
|
3
|
-
return "group";
|
|
4
|
-
if (valueName === "enter" || valueName === "new")
|
|
5
|
-
return "new";
|
|
6
|
-
if (valueName === "exit" || valueName === "old")
|
|
7
|
-
return "old";
|
|
8
|
-
return "group";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { chooseLayerType };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
let pendingRules = {};
|
|
2
|
-
let style = null;
|
|
3
|
-
const css = {
|
|
4
|
-
set: (selector, values) => {
|
|
5
|
-
pendingRules[selector] = values;
|
|
6
|
-
},
|
|
7
|
-
commit: () => {
|
|
8
|
-
if (!style) {
|
|
9
|
-
style = document.createElement("style");
|
|
10
|
-
style.id = "motion-view";
|
|
11
|
-
}
|
|
12
|
-
let cssText = "";
|
|
13
|
-
for (const selector in pendingRules) {
|
|
14
|
-
const rule = pendingRules[selector];
|
|
15
|
-
cssText += `${selector} {\n`;
|
|
16
|
-
for (const [property, value] of Object.entries(rule)) {
|
|
17
|
-
cssText += ` ${property}: ${value};\n`;
|
|
18
|
-
}
|
|
19
|
-
cssText += "}\n";
|
|
20
|
-
}
|
|
21
|
-
style.textContent = cssText;
|
|
22
|
-
document.head.appendChild(style);
|
|
23
|
-
pendingRules = {};
|
|
24
|
-
},
|
|
25
|
-
remove: () => {
|
|
26
|
-
if (style && style.parentElement) {
|
|
27
|
-
style.parentElement.removeChild(style);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { css };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
function filterViewAnimations(animation) {
|
|
2
|
-
const { effect } = animation;
|
|
3
|
-
if (!effect)
|
|
4
|
-
return false;
|
|
5
|
-
return (effect.target === document.documentElement &&
|
|
6
|
-
effect.pseudoElement?.startsWith("::view-transition"));
|
|
7
|
-
}
|
|
8
|
-
function getViewAnimations() {
|
|
9
|
-
return document.getAnimations().filter(filterViewAnimations);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { getViewAnimations };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
function addUniqueItem(arr, item) {
|
|
2
|
-
if (arr.indexOf(item) === -1)
|
|
3
|
-
arr.push(item);
|
|
4
|
-
}
|
|
5
|
-
function removeItem(arr, item) {
|
|
6
|
-
const index = arr.indexOf(item);
|
|
7
|
-
if (index > -1)
|
|
8
|
-
arr.splice(index, 1);
|
|
9
|
-
}
|
|
10
|
-
// Adapted from array-move
|
|
11
|
-
function moveItem([...arr], fromIndex, toIndex) {
|
|
12
|
-
const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;
|
|
13
|
-
if (startIndex >= 0 && startIndex < arr.length) {
|
|
14
|
-
const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;
|
|
15
|
-
const [item] = arr.splice(fromIndex, 1);
|
|
16
|
-
arr.splice(endIndex, 0, item);
|
|
17
|
-
}
|
|
18
|
-
return arr;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { addUniqueItem, moveItem, removeItem };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { cubicBezier } from './cubic-bezier.mjs';
|
|
2
|
-
import { mirrorEasing } from './modifiers/mirror.mjs';
|
|
3
|
-
import { reverseEasing } from './modifiers/reverse.mjs';
|
|
4
|
-
|
|
5
|
-
const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);
|
|
6
|
-
const backIn = /*@__PURE__*/ reverseEasing(backOut);
|
|
7
|
-
const backInOut = /*@__PURE__*/ mirrorEasing(backIn);
|
|
8
|
-
|
|
9
|
-
export { backIn, backInOut, backOut };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { mirrorEasing } from './modifiers/mirror.mjs';
|
|
2
|
-
import { reverseEasing } from './modifiers/reverse.mjs';
|
|
3
|
-
|
|
4
|
-
const circIn = (p) => 1 - Math.sin(Math.acos(p));
|
|
5
|
-
const circOut = reverseEasing(circIn);
|
|
6
|
-
const circInOut = mirrorEasing(circIn);
|
|
7
|
-
|
|
8
|
-
export { circIn, circInOut, circOut };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { noop } from '../noop.mjs';
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
Bezier function generator
|
|
5
|
-
This has been modified from Gaëtan Renaudeau's BezierEasing
|
|
6
|
-
https://github.com/gre/bezier-easing/blob/master/src/index.js
|
|
7
|
-
https://github.com/gre/bezier-easing/blob/master/LICENSE
|
|
8
|
-
|
|
9
|
-
I've removed the newtonRaphsonIterate algo because in benchmarking it
|
|
10
|
-
wasn't noticiably faster than binarySubdivision, indeed removing it
|
|
11
|
-
usually improved times, depending on the curve.
|
|
12
|
-
I also removed the lookup table, as for the added bundle size and loop we're
|
|
13
|
-
only cutting ~4 or so subdivision iterations. I bumped the max iterations up
|
|
14
|
-
to 12 to compensate and this still tended to be faster for no perceivable
|
|
15
|
-
loss in accuracy.
|
|
16
|
-
Usage
|
|
17
|
-
const easeOut = cubicBezier(.17,.67,.83,.67);
|
|
18
|
-
const x = easeOut(0.5); // returns 0.627...
|
|
19
|
-
*/
|
|
20
|
-
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
|
21
|
-
const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *
|
|
22
|
-
t;
|
|
23
|
-
const subdivisionPrecision = 0.0000001;
|
|
24
|
-
const subdivisionMaxIterations = 12;
|
|
25
|
-
function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
|
|
26
|
-
let currentX;
|
|
27
|
-
let currentT;
|
|
28
|
-
let i = 0;
|
|
29
|
-
do {
|
|
30
|
-
currentT = lowerBound + (upperBound - lowerBound) / 2.0;
|
|
31
|
-
currentX = calcBezier(currentT, mX1, mX2) - x;
|
|
32
|
-
if (currentX > 0.0) {
|
|
33
|
-
upperBound = currentT;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
lowerBound = currentT;
|
|
37
|
-
}
|
|
38
|
-
} while (Math.abs(currentX) > subdivisionPrecision &&
|
|
39
|
-
++i < subdivisionMaxIterations);
|
|
40
|
-
return currentT;
|
|
41
|
-
}
|
|
42
|
-
function cubicBezier(mX1, mY1, mX2, mY2) {
|
|
43
|
-
// If this is a linear gradient, return linear easing
|
|
44
|
-
if (mX1 === mY1 && mX2 === mY2)
|
|
45
|
-
return noop;
|
|
46
|
-
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
|
|
47
|
-
// If animation is at start/end, return t without easing
|
|
48
|
-
return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { cubicBezier };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { cubicBezier } from './cubic-bezier.mjs';
|
|
2
|
-
|
|
3
|
-
const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);
|
|
4
|
-
const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);
|
|
5
|
-
const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);
|
|
6
|
-
|
|
7
|
-
export { easeIn, easeInOut, easeOut };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Accepts an easing function and returns a new one that outputs mirrored values for
|
|
2
|
-
// the second half of the animation. Turns easeIn into easeInOut.
|
|
3
|
-
const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
|
|
4
|
-
|
|
5
|
-
export { mirrorEasing };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { clamp } from '../clamp.mjs';
|
|
2
|
-
|
|
3
|
-
function steps(numSteps, direction = "end") {
|
|
4
|
-
return (progress) => {
|
|
5
|
-
progress =
|
|
6
|
-
direction === "end"
|
|
7
|
-
? Math.min(progress, 0.999)
|
|
8
|
-
: Math.max(progress, 0.001);
|
|
9
|
-
const expanded = progress * numSteps;
|
|
10
|
-
const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
|
|
11
|
-
return clamp(0, 1, rounded / numSteps);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { steps };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { invariant } from '../../errors.mjs';
|
|
2
|
-
import { noop } from '../../noop.mjs';
|
|
3
|
-
import { anticipate } from '../anticipate.mjs';
|
|
4
|
-
import { backIn, backInOut, backOut } from '../back.mjs';
|
|
5
|
-
import { circIn, circInOut, circOut } from '../circ.mjs';
|
|
6
|
-
import { cubicBezier } from '../cubic-bezier.mjs';
|
|
7
|
-
import { easeIn, easeInOut, easeOut } from '../ease.mjs';
|
|
8
|
-
import { isBezierDefinition } from './is-bezier-definition.mjs';
|
|
9
|
-
|
|
10
|
-
const easingLookup = {
|
|
11
|
-
linear: noop,
|
|
12
|
-
easeIn,
|
|
13
|
-
easeInOut,
|
|
14
|
-
easeOut,
|
|
15
|
-
circIn,
|
|
16
|
-
circInOut,
|
|
17
|
-
circOut,
|
|
18
|
-
backIn,
|
|
19
|
-
backInOut,
|
|
20
|
-
backOut,
|
|
21
|
-
anticipate,
|
|
22
|
-
};
|
|
23
|
-
const isValidEasing = (easing) => {
|
|
24
|
-
return typeof easing === "string";
|
|
25
|
-
};
|
|
26
|
-
const easingDefinitionToFunction = (definition) => {
|
|
27
|
-
if (isBezierDefinition(definition)) {
|
|
28
|
-
// If cubic bezier definition, create bezier curve
|
|
29
|
-
invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
|
|
30
|
-
const [x1, y1, x2, y2] = definition;
|
|
31
|
-
return cubicBezier(x1, y1, x2, y2);
|
|
32
|
-
}
|
|
33
|
-
else if (isValidEasing(definition)) {
|
|
34
|
-
// Else lookup from table
|
|
35
|
-
invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);
|
|
36
|
-
return easingLookup[definition];
|
|
37
|
-
}
|
|
38
|
-
return definition;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { easingDefinitionToFunction };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
let warning = () => { };
|
|
2
|
-
let invariant = () => { };
|
|
3
|
-
if (process.env.NODE_ENV !== "production") {
|
|
4
|
-
warning = (check, message) => {
|
|
5
|
-
if (!check && typeof console !== "undefined") {
|
|
6
|
-
console.warn(message);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
invariant = (check, message) => {
|
|
10
|
-
if (!check) {
|
|
11
|
-
throw new Error(message);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { invariant, warning };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pipe
|
|
3
|
-
* Compose other transformers to run linearily
|
|
4
|
-
* pipe(min(20), max(40))
|
|
5
|
-
* @param {...functions} transformers
|
|
6
|
-
* @return {function}
|
|
7
|
-
*/
|
|
8
|
-
const combineFunctions = (a, b) => (v) => b(a(v));
|
|
9
|
-
const pipe = (...transformers) => transformers.reduce(combineFunctions);
|
|
10
|
-
|
|
11
|
-
export { pipe };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Progress within given range
|
|
3
|
-
|
|
4
|
-
Given a lower limit and an upper limit, we return the progress
|
|
5
|
-
(expressed as a number 0-1) represented by the given value, and
|
|
6
|
-
limit that progress to within 0-1.
|
|
7
|
-
|
|
8
|
-
@param [number]: Lower limit
|
|
9
|
-
@param [number]: Upper limit
|
|
10
|
-
@param [number]: Value to find progress within given range
|
|
11
|
-
@return [number]: Progress of value within range as expressed 0-1
|
|
12
|
-
*/
|
|
13
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
14
|
-
const progress = (from, to, value) => {
|
|
15
|
-
const toFromDifference = to - from;
|
|
16
|
-
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { progress };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { addUniqueItem, removeItem } from './array.mjs';
|
|
2
|
-
|
|
3
|
-
class SubscriptionManager {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.subscriptions = [];
|
|
6
|
-
}
|
|
7
|
-
add(handler) {
|
|
8
|
-
addUniqueItem(this.subscriptions, handler);
|
|
9
|
-
return () => removeItem(this.subscriptions, handler);
|
|
10
|
-
}
|
|
11
|
-
notify(a, b, c) {
|
|
12
|
-
const numSubscriptions = this.subscriptions.length;
|
|
13
|
-
if (!numSubscriptions)
|
|
14
|
-
return;
|
|
15
|
-
if (numSubscriptions === 1) {
|
|
16
|
-
/**
|
|
17
|
-
* If there's only a single handler we can just call it without invoking a loop.
|
|
18
|
-
*/
|
|
19
|
-
this.subscriptions[0](a, b, c);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
for (let i = 0; i < numSubscriptions; i++) {
|
|
23
|
-
/**
|
|
24
|
-
* Check whether the handler exists before firing as it's possible
|
|
25
|
-
* the subscriptions were modified during this loop running.
|
|
26
|
-
*/
|
|
27
|
-
const handler = this.subscriptions[i];
|
|
28
|
-
handler && handler(a, b, c);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
getSize() {
|
|
33
|
-
return this.subscriptions.length;
|
|
34
|
-
}
|
|
35
|
-
clear() {
|
|
36
|
-
this.subscriptions.length = 0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { SubscriptionManager };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts seconds to milliseconds
|
|
3
|
-
*
|
|
4
|
-
* @param seconds - Time in seconds.
|
|
5
|
-
* @return milliseconds - Converted time in milliseconds.
|
|
6
|
-
*/
|
|
7
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
8
|
-
const secondsToMilliseconds = (seconds) => seconds * 1000;
|
|
9
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
10
|
-
const millisecondsToSeconds = (milliseconds) => milliseconds / 1000;
|
|
11
|
-
|
|
12
|
-
export { millisecondsToSeconds, secondsToMilliseconds };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Convert velocity into velocity per second
|
|
3
|
-
|
|
4
|
-
@param [number]: Unit per frame
|
|
5
|
-
@param [number]: Frame duration in ms
|
|
6
|
-
*/
|
|
7
|
-
function velocityPerSecond(velocity, frameDuration) {
|
|
8
|
-
return frameDuration ? velocity * (1000 / frameDuration) : 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { velocityPerSecond };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const warned = new Set();
|
|
2
|
-
function hasWarned(message) {
|
|
3
|
-
return warned.has(message);
|
|
4
|
-
}
|
|
5
|
-
function warnOnce(condition, message, element) {
|
|
6
|
-
if (condition || warned.has(message))
|
|
7
|
-
return;
|
|
8
|
-
console.warn(message);
|
|
9
|
-
if (element)
|
|
10
|
-
console.warn(element);
|
|
11
|
-
warned.add(message);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { hasWarned, warnOnce };
|