motion 12.18.0 → 12.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/mini.js +7 -1063
- package/dist/es/debug.mjs +1 -0
- package/dist/es/index.mjs +1 -0
- package/dist/es/mini.mjs +1 -0
- package/dist/es/react-client.mjs +2 -0
- package/dist/es/react-m.mjs +2 -0
- package/dist/es/react-mini.mjs +2 -0
- package/dist/es/react.mjs +2 -0
- package/dist/motion.js +1 -1
- package/mini/package.json +1 -1
- package/package.json +11 -11
- package/react/package.json +1 -1
- package/react-client/package.json +1 -1
- package/react-m/package.json +1 -1
- package/dist/es/framer-motion/dist/es/animation/animate/index.mjs +0 -34
- package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +0 -19
- package/dist/es/framer-motion/dist/es/animation/animate/sequence.mjs +0 -14
- package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +0 -11
- package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +0 -52
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +0 -112
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +0 -13
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -12
- package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -12
- package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +0 -80
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animate-style.mjs +0 -17
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animate.mjs +0 -17
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +0 -64
- package/dist/es/framer-motion/dist/es/animation/hooks/use-animation.mjs +0 -41
- package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -102
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -85
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +0 -65
- package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element.mjs +0 -26
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -6
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -7
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +0 -38
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +0 -171
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +0 -8
- package/dist/es/framer-motion/dist/es/animation/optimized-appear/store.mjs +0 -4
- package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +0 -256
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -23
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -31
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -13
- package/dist/es/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -14
- package/dist/es/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -45
- package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -40
- package/dist/es/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -7
- package/dist/es/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -5
- package/dist/es/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -10
- package/dist/es/framer-motion/dist/es/animation/utils/stagger.mjs +0 -26
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +0 -87
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +0 -64
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +0 -166
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs +0 -9
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +0 -70
- package/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs +0 -14
- package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +0 -15
- package/dist/es/framer-motion/dist/es/components/LayoutGroup/index.mjs +0 -32
- package/dist/es/framer-motion/dist/es/components/LazyMotion/index.mjs +0 -68
- package/dist/es/framer-motion/dist/es/components/MotionConfig/index.mjs +0 -48
- package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +0 -53
- package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +0 -34
- package/dist/es/framer-motion/dist/es/components/Reorder/namespace.mjs +0 -2
- package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +0 -24
- package/dist/es/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -10
- package/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/LazyContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs +0 -13
- package/dist/es/framer-motion/dist/es/context/MotionContext/create.mjs +0 -13
- package/dist/es/framer-motion/dist/es/context/MotionContext/index.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/MotionContext/utils.mjs +0 -17
- package/dist/es/framer-motion/dist/es/context/PresenceContext.mjs +0 -10
- package/dist/es/framer-motion/dist/es/context/ReorderContext.mjs +0 -6
- package/dist/es/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +0 -9
- package/dist/es/framer-motion/dist/es/events/add-dom-event.mjs +0 -6
- package/dist/es/framer-motion/dist/es/events/add-pointer-event.mjs +0 -8
- package/dist/es/framer-motion/dist/es/events/event-info.mjs +0 -15
- package/dist/es/framer-motion/dist/es/events/use-dom-event.mjs +0 -34
- package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +0 -479
- package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +0 -27
- package/dist/es/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +0 -88
- package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +0 -129
- package/dist/es/framer-motion/dist/es/gestures/focus.mjs +0 -41
- package/dist/es/framer-motion/dist/es/gestures/hover.mjs +0 -30
- package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +0 -156
- package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +0 -50
- package/dist/es/framer-motion/dist/es/gestures/press.mjs +0 -33
- package/dist/es/framer-motion/dist/es/motion/features/Feature.mjs +0 -9
- package/dist/es/framer-motion/dist/es/motion/features/animation/exit.mjs +0 -36
- package/dist/es/framer-motion/dist/es/motion/features/animation/index.mjs +0 -40
- package/dist/es/framer-motion/dist/es/motion/features/animations.mjs +0 -13
- package/dist/es/framer-motion/dist/es/motion/features/definitions.mjs +0 -28
- package/dist/es/framer-motion/dist/es/motion/features/drag.mjs +0 -17
- package/dist/es/framer-motion/dist/es/motion/features/gestures.mjs +0 -21
- package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +0 -135
- package/dist/es/framer-motion/dist/es/motion/features/layout.mjs +0 -11
- package/dist/es/framer-motion/dist/es/motion/features/load-features.mjs +0 -12
- package/dist/es/framer-motion/dist/es/motion/features/viewport/index.mjs +0 -72
- package/dist/es/framer-motion/dist/es/motion/features/viewport/observers.mjs +0 -49
- package/dist/es/framer-motion/dist/es/motion/index.mjs +0 -101
- package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -11
- package/dist/es/framer-motion/dist/es/motion/utils/is-motion-component.mjs +0 -12
- package/dist/es/framer-motion/dist/es/motion/utils/symbol.mjs +0 -3
- package/dist/es/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +0 -17
- package/dist/es/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +0 -38
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +0 -133
- package/dist/es/framer-motion/dist/es/motion/utils/use-visual-state.mjs +0 -79
- package/dist/es/framer-motion/dist/es/motion/utils/valid-prop.mjs +0 -57
- package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +0 -91
- package/dist/es/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -33
- package/dist/es/framer-motion/dist/es/projection/geometry/copy.mjs +0 -31
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -119
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -52
- package/dist/es/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -54
- package/dist/es/framer-motion/dist/es/projection/geometry/models.mjs +0 -17
- package/dist/es/framer-motion/dist/es/projection/geometry/utils.mjs +0 -31
- package/dist/es/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -13
- package/dist/es/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -27
- package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +0 -1605
- package/dist/es/framer-motion/dist/es/projection/node/group.mjs +0 -24
- package/dist/es/framer-motion/dist/es/projection/node/state.mjs +0 -19
- package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +0 -112
- package/dist/es/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -41
- package/dist/es/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -35
- package/dist/es/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -13
- package/dist/es/framer-motion/dist/es/projection/styles/transform.mjs +0 -49
- package/dist/es/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +0 -14
- package/dist/es/framer-motion/dist/es/projection/use-reset-projection.mjs +0 -14
- package/dist/es/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -5
- package/dist/es/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -26
- package/dist/es/framer-motion/dist/es/projection/utils/measure.mjs +0 -17
- package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +0 -478
- package/dist/es/framer-motion/dist/es/render/components/create-factory.mjs +0 -23
- package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +0 -38
- package/dist/es/framer-motion/dist/es/render/components/m/create.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/components/m/elements.mjs +0 -227
- package/dist/es/framer-motion/dist/es/render/components/m/proxy.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/components/motion/create.mjs +0 -15
- package/dist/es/framer-motion/dist/es/render/components/motion/elements.mjs +0 -194
- package/dist/es/framer-motion/dist/es/render/components/motion/proxy.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -43
- package/dist/es/framer-motion/dist/es/render/dom/create-visual-element.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-animation.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-max.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/features-min.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +0 -17
- package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +0 -23
- package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +0 -14
- package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -56
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -45
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -60
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -47
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -35
- package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -20
- package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -48
- package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -81
- package/dist/es/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/dom/use-render.mjs +0 -33
- package/dist/es/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -6
- package/dist/es/framer-motion/dist/es/render/dom/utils/filter-props.mjs +0 -59
- package/dist/es/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -43
- package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -44
- package/dist/es/framer-motion/dist/es/render/html/config-motion.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/html/use-props.mjs +0 -57
- package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -65
- package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -62
- package/dist/es/framer-motion/dist/es/render/html/utils/create-render-state.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/html/utils/render.mjs +0 -9
- package/dist/es/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -19
- package/dist/es/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -41
- package/dist/es/framer-motion/dist/es/render/store.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -45
- package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/svg/lowercase-elements.mjs +0 -33
- package/dist/es/framer-motion/dist/es/render/svg/use-props.mjs +0 -24
- package/dist/es/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -57
- package/dist/es/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -30
- package/dist/es/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/svg/utils/path.mjs +0 -32
- package/dist/es/framer-motion/dist/es/render/svg/utils/render.mjs +0 -12
- package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -19
- package/dist/es/framer-motion/dist/es/render/utils/animation-state.mjs +0 -342
- package/dist/es/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -3
- package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -24
- package/dist/es/framer-motion/dist/es/render/utils/get-variant-context.mjs +0 -28
- package/dist/es/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -13
- package/dist/es/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +0 -51
- package/dist/es/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -8
- package/dist/es/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -36
- package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +0 -31
- package/dist/es/framer-motion/dist/es/render/utils/variant-props.mjs +0 -12
- package/dist/es/framer-motion/dist/es/utils/delay.mjs +0 -24
- package/dist/es/framer-motion/dist/es/utils/distance.mjs +0 -9
- package/dist/es/framer-motion/dist/es/utils/get-context-window.mjs +0 -6
- package/dist/es/framer-motion/dist/es/utils/is-browser.mjs +0 -3
- package/dist/es/framer-motion/dist/es/utils/is-ref-object.mjs +0 -7
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -5
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +0 -47
- package/dist/es/framer-motion/dist/es/utils/shallow-compare.mjs +0 -14
- package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +0 -21
- package/dist/es/framer-motion/dist/es/utils/use-constant.mjs +0 -18
- package/dist/es/framer-motion/dist/es/utils/use-cycle.mjs +0 -47
- package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +0 -19
- package/dist/es/framer-motion/dist/es/utils/use-in-view.mjs +0 -23
- package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +0 -41
- package/dist/es/framer-motion/dist/es/utils/use-is-mounted.mjs +0 -15
- package/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +0 -6
- package/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs +0 -13
- package/dist/es/framer-motion/dist/es/utils/use-unmount-effect.mjs +0 -7
- package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +0 -14
- package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +0 -14
- package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +0 -37
- package/dist/es/framer-motion/dist/es/value/use-computed.mjs +0 -19
- package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +0 -52
- package/dist/es/framer-motion/dist/es/value/use-motion-template.mjs +0 -45
- package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +0 -38
- package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +0 -39
- package/dist/es/framer-motion/dist/es/value/use-spring.mjs +0 -22
- package/dist/es/framer-motion/dist/es/value/use-time.mjs +0 -10
- package/dist/es/framer-motion/dist/es/value/use-transform.mjs +0 -29
- package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +0 -35
- package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +0 -21
- package/dist/es/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -20
- package/dist/es/framer-motion/dist/es/value/use-will-change/index.mjs +0 -8
- package/dist/es/framer-motion/dist/es/value/use-will-change/is.mjs +0 -7
- package/dist/es/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -12
- package/dist/es/motion/lib/debug.mjs +0 -1
- package/dist/es/motion/lib/index.mjs +0 -131
- package/dist/es/motion/lib/mini.mjs +0 -2
- package/dist/es/motion/lib/react-client.mjs +0 -3
- package/dist/es/motion/lib/react-m.mjs +0 -3
- package/dist/es/motion/lib/react-mini.mjs +0 -2
- package/dist/es/motion/lib/react.mjs +0 -204
- package/dist/es/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +0 -175
- package/dist/es/motion-dom/dist/es/animation/GroupAnimation.mjs +0 -72
- package/dist/es/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/JSAnimation.mjs +0 -348
- package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +0 -158
- package/dist/es/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +0 -65
- package/dist/es/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/drivers/frame.mjs +0 -17
- package/dist/es/motion-dom/dist/es/animation/generators/inertia.mjs +0 -87
- package/dist/es/motion-dom/dist/es/animation/generators/keyframes.mjs +0 -51
- package/dist/es/motion-dom/dist/es/animation/generators/spring/defaults.mjs +0 -27
- package/dist/es/motion-dom/dist/es/animation/generators/spring/find.mjs +0 -86
- package/dist/es/motion-dom/dist/es/animation/generators/spring/index.mjs +0 -176
- package/dist/es/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +0 -17
- package/dist/es/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +0 -19
- package/dist/es/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +0 -5
- package/dist/es/motion-dom/dist/es/animation/generators/utils/velocity.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +0 -131
- package/dist/es/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs +0 -147
- package/dist/es/motion-dom/dist/es/animation/keyframes/get-final.mjs +0 -11
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/default.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs +0 -12
- package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/time.mjs +0 -5
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +0 -11
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +0 -7
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs +0 -30
- package/dist/es/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs +0 -36
- package/dist/es/motion-dom/dist/es/animation/utils/WithPromise.mjs +0 -26
- package/dist/es/motion-dom/dist/es/animation/utils/active-animations.mjs +0 -9
- package/dist/es/motion-dom/dist/es/animation/utils/can-animate.mjs +0 -42
- package/dist/es/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs +0 -42
- package/dist/es/motion-dom/dist/es/animation/utils/get-value-transition.mjs +0 -7
- package/dist/es/motion-dom/dist/es/animation/utils/is-animatable.mjs +0 -30
- package/dist/es/motion-dom/dist/es/animation/utils/is-css-variable.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +0 -18
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs +0 -3
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +0 -28
- package/dist/es/motion-dom/dist/es/animation/waapi/easing/supported.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +0 -39
- package/dist/es/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +0 -13
- package/dist/es/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +0 -37
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs +0 -14
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +0 -15
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/linear.mjs +0 -12
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/px-values.mjs +0 -39
- package/dist/es/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +0 -20
- package/dist/es/motion-dom/dist/es/effects/MotionValueState.mjs +0 -47
- package/dist/es/motion-dom/dist/es/effects/attr/index.mjs +0 -41
- package/dist/es/motion-dom/dist/es/effects/prop/index.mjs +0 -9
- package/dist/es/motion-dom/dist/es/effects/style/index.mjs +0 -52
- package/dist/es/motion-dom/dist/es/effects/style/transform.mjs +0 -38
- package/dist/es/motion-dom/dist/es/effects/svg/index.mjs +0 -41
- package/dist/es/motion-dom/dist/es/effects/utils/create-dom-effect.mjs +0 -18
- package/dist/es/motion-dom/dist/es/effects/utils/create-effect.mjs +0 -21
- package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +0 -71
- package/dist/es/motion-dom/dist/es/frameloop/frame.mjs +0 -6
- package/dist/es/motion-dom/dist/es/frameloop/index-legacy.mjs +0 -20
- package/dist/es/motion-dom/dist/es/frameloop/microtask.mjs +0 -6
- package/dist/es/motion-dom/dist/es/frameloop/order.mjs +0 -12
- package/dist/es/motion-dom/dist/es/frameloop/render-step.mjs +0 -92
- package/dist/es/motion-dom/dist/es/frameloop/sync-time.mjs +0 -31
- package/dist/es/motion-dom/dist/es/gestures/drag/state/is-active.mjs +0 -9
- package/dist/es/motion-dom/dist/es/gestures/drag/state/set-active.mjs +0 -28
- package/dist/es/motion-dom/dist/es/gestures/hover.mjs +0 -37
- package/dist/es/motion-dom/dist/es/gestures/press/index.mjs +0 -83
- package/dist/es/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +0 -13
- package/dist/es/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +0 -38
- package/dist/es/motion-dom/dist/es/gestures/press/utils/state.mjs +0 -3
- package/dist/es/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +0 -20
- package/dist/es/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +0 -18
- package/dist/es/motion-dom/dist/es/gestures/utils/setup.mjs +0 -15
- package/dist/es/motion-dom/dist/es/render/dom/is-css-var.mjs +0 -3
- package/dist/es/motion-dom/dist/es/render/dom/parse-transform.mjs +0 -83
- package/dist/es/motion-dom/dist/es/render/dom/style-computed.mjs +0 -10
- package/dist/es/motion-dom/dist/es/render/dom/style-set.mjs +0 -9
- package/dist/es/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs +0 -5
- package/dist/es/motion-dom/dist/es/render/utils/keys-position.mjs +0 -13
- package/dist/es/motion-dom/dist/es/render/utils/keys-transform.mjs +0 -28
- package/dist/es/motion-dom/dist/es/resize/handle-element.mjs +0 -63
- package/dist/es/motion-dom/dist/es/resize/handle-window.mjs +0 -31
- package/dist/es/motion-dom/dist/es/resize/index.mjs +0 -8
- package/dist/es/motion-dom/dist/es/scroll/observe.mjs +0 -18
- package/dist/es/motion-dom/dist/es/stats/animation-count.mjs +0 -7
- package/dist/es/motion-dom/dist/es/stats/buffer.mjs +0 -6
- package/dist/es/motion-dom/dist/es/stats/index.mjs +0 -117
- package/dist/es/motion-dom/dist/es/utils/interpolate.mjs +0 -79
- package/dist/es/motion-dom/dist/es/utils/is-html-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/is-svg-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/is-svg-svg-element.mjs +0 -11
- package/dist/es/motion-dom/dist/es/utils/mix/color.mjs +0 -47
- package/dist/es/motion-dom/dist/es/utils/mix/complex.mjs +0 -93
- package/dist/es/motion-dom/dist/es/utils/mix/immediate.mjs +0 -5
- package/dist/es/motion-dom/dist/es/utils/mix/index.mjs +0 -14
- package/dist/es/motion-dom/dist/es/utils/mix/number.mjs +0 -26
- package/dist/es/motion-dom/dist/es/utils/mix/visibility.mjs +0 -16
- package/dist/es/motion-dom/dist/es/utils/resolve-elements.mjs +0 -17
- package/dist/es/motion-dom/dist/es/utils/supports/flags.mjs +0 -7
- package/dist/es/motion-dom/dist/es/utils/supports/linear-easing.mjs +0 -15
- package/dist/es/motion-dom/dist/es/utils/supports/memo.mjs +0 -9
- package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +0 -5
- package/dist/es/motion-dom/dist/es/utils/transform.mjs +0 -14
- package/dist/es/motion-dom/dist/es/value/index.mjs +0 -329
- package/dist/es/motion-dom/dist/es/value/map-value.mjs +0 -46
- package/dist/es/motion-dom/dist/es/value/spring-value.mjs +0 -72
- package/dist/es/motion-dom/dist/es/value/subscribe-value.mjs +0 -13
- package/dist/es/motion-dom/dist/es/value/transform-value.mjs +0 -35
- package/dist/es/motion-dom/dist/es/value/types/auto.mjs +0 -9
- package/dist/es/motion-dom/dist/es/value/types/color/hex.mjs +0 -40
- package/dist/es/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs +0 -42
- package/dist/es/motion-dom/dist/es/value/types/color/hsla.mjs +0 -22
- package/dist/es/motion-dom/dist/es/value/types/color/index.mjs +0 -32
- package/dist/es/motion-dom/dist/es/value/types/color/rgba.mjs +0 -25
- package/dist/es/motion-dom/dist/es/value/types/color/utils.mjs +0 -29
- package/dist/es/motion-dom/dist/es/value/types/complex/filter.mjs +0 -30
- package/dist/es/motion-dom/dist/es/value/types/complex/index.mjs +0 -91
- package/dist/es/motion-dom/dist/es/value/types/dimensions.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/int.mjs +0 -8
- package/dist/es/motion-dom/dist/es/value/types/maps/defaults.mjs +0 -30
- package/dist/es/motion-dom/dist/es/value/types/maps/number.mjs +0 -50
- package/dist/es/motion-dom/dist/es/value/types/maps/transform.mjs +0 -31
- package/dist/es/motion-dom/dist/es/value/types/numbers/index.mjs +0 -17
- package/dist/es/motion-dom/dist/es/value/types/numbers/units.mjs +0 -18
- package/dist/es/motion-dom/dist/es/value/types/test.mjs +0 -6
- package/dist/es/motion-dom/dist/es/value/types/utils/animatable-none.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/utils/color-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/types/utils/find.mjs +0 -15
- package/dist/es/motion-dom/dist/es/value/types/utils/float-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/types/utils/get-as-type.mjs +0 -10
- package/dist/es/motion-dom/dist/es/value/types/utils/is-nullish.mjs +0 -5
- package/dist/es/motion-dom/dist/es/value/types/utils/sanitize.mjs +0 -5
- package/dist/es/motion-dom/dist/es/value/types/utils/single-color-regex.mjs +0 -3
- package/dist/es/motion-dom/dist/es/value/utils/is-motion-value.mjs +0 -3
- package/dist/es/motion-dom/dist/es/view/index.mjs +0 -64
- package/dist/es/motion-dom/dist/es/view/queue.mjs +0 -52
- package/dist/es/motion-dom/dist/es/view/start.mjs +0 -155
- package/dist/es/motion-dom/dist/es/view/utils/choose-layer-type.mjs +0 -11
- package/dist/es/motion-dom/dist/es/view/utils/css.mjs +0 -32
- package/dist/es/motion-dom/dist/es/view/utils/get-layer-name.mjs +0 -8
- package/dist/es/motion-dom/dist/es/view/utils/get-view-animations.mjs +0 -12
- package/dist/es/motion-dom/dist/es/view/utils/has-target.mjs +0 -5
- package/dist/es/motion-utils/dist/es/array.mjs +0 -21
- package/dist/es/motion-utils/dist/es/clamp.mjs +0 -9
- package/dist/es/motion-utils/dist/es/easing/anticipate.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/back.mjs +0 -9
- package/dist/es/motion-utils/dist/es/easing/circ.mjs +0 -8
- package/dist/es/motion-utils/dist/es/easing/cubic-bezier.mjs +0 -51
- package/dist/es/motion-utils/dist/es/easing/ease.mjs +0 -7
- package/dist/es/motion-utils/dist/es/easing/modifiers/mirror.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/modifiers/reverse.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/steps.mjs +0 -15
- package/dist/es/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +0 -8
- package/dist/es/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +0 -3
- package/dist/es/motion-utils/dist/es/easing/utils/is-easing-array.mjs +0 -5
- package/dist/es/motion-utils/dist/es/easing/utils/map.mjs +0 -41
- package/dist/es/motion-utils/dist/es/errors.mjs +0 -16
- package/dist/es/motion-utils/dist/es/global-config.mjs +0 -3
- package/dist/es/motion-utils/dist/es/is-numerical-string.mjs +0 -6
- package/dist/es/motion-utils/dist/es/is-object.mjs +0 -5
- package/dist/es/motion-utils/dist/es/is-zero-value-string.mjs +0 -6
- package/dist/es/motion-utils/dist/es/memo.mjs +0 -11
- package/dist/es/motion-utils/dist/es/noop.mjs +0 -4
- package/dist/es/motion-utils/dist/es/pipe.mjs +0 -11
- package/dist/es/motion-utils/dist/es/progress.mjs +0 -19
- package/dist/es/motion-utils/dist/es/subscription-manager.mjs +0 -40
- package/dist/es/motion-utils/dist/es/time-conversion.mjs +0 -12
- package/dist/es/motion-utils/dist/es/velocity-per-second.mjs +0 -11
- package/dist/es/motion-utils/dist/es/warn-once.mjs +0 -14
- package/dist/es/motion-utils/dist/es/wrap.mjs +0 -6
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { calcLength } from '../../../projection/geometry/delta-calc.mjs';
|
|
2
|
-
import { mixNumber } from '../../../../../../motion-dom/dist/es/utils/mix/number.mjs';
|
|
3
|
-
import { progress } from '../../../../../../motion-utils/dist/es/progress.mjs';
|
|
4
|
-
import { clamp } from '../../../../../../motion-utils/dist/es/clamp.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Apply constraints to a point. These constraints are both physical along an
|
|
8
|
-
* axis, and an elastic factor that determines how much to constrain the point
|
|
9
|
-
* by if it does lie outside the defined parameters.
|
|
10
|
-
*/
|
|
11
|
-
function applyConstraints(point, { min, max }, elastic) {
|
|
12
|
-
if (min !== undefined && point < min) {
|
|
13
|
-
// If we have a min point defined, and this is outside of that, constrain
|
|
14
|
-
point = elastic
|
|
15
|
-
? mixNumber(min, point, elastic.min)
|
|
16
|
-
: Math.max(point, min);
|
|
17
|
-
}
|
|
18
|
-
else if (max !== undefined && point > max) {
|
|
19
|
-
// If we have a max point defined, and this is outside of that, constrain
|
|
20
|
-
point = elastic
|
|
21
|
-
? mixNumber(max, point, elastic.max)
|
|
22
|
-
: Math.min(point, max);
|
|
23
|
-
}
|
|
24
|
-
return point;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Calculate constraints in terms of the viewport when defined relatively to the
|
|
28
|
-
* measured axis. This is measured from the nearest edge, so a max constraint of 200
|
|
29
|
-
* on an axis with a max value of 300 would return a constraint of 500 - axis length
|
|
30
|
-
*/
|
|
31
|
-
function calcRelativeAxisConstraints(axis, min, max) {
|
|
32
|
-
return {
|
|
33
|
-
min: min !== undefined ? axis.min + min : undefined,
|
|
34
|
-
max: max !== undefined
|
|
35
|
-
? axis.max + max - (axis.max - axis.min)
|
|
36
|
-
: undefined,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Calculate constraints in terms of the viewport when
|
|
41
|
-
* defined relatively to the measured bounding box.
|
|
42
|
-
*/
|
|
43
|
-
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
44
|
-
return {
|
|
45
|
-
x: calcRelativeAxisConstraints(layoutBox.x, left, right),
|
|
46
|
-
y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Calculate viewport constraints when defined as another viewport-relative axis
|
|
51
|
-
*/
|
|
52
|
-
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
|
|
53
|
-
let min = constraintsAxis.min - layoutAxis.min;
|
|
54
|
-
let max = constraintsAxis.max - layoutAxis.max;
|
|
55
|
-
// If the constraints axis is actually smaller than the layout axis then we can
|
|
56
|
-
// flip the constraints
|
|
57
|
-
if (constraintsAxis.max - constraintsAxis.min <
|
|
58
|
-
layoutAxis.max - layoutAxis.min) {
|
|
59
|
-
[min, max] = [max, min];
|
|
60
|
-
}
|
|
61
|
-
return { min, max };
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Calculate viewport constraints when defined as another viewport-relative box
|
|
65
|
-
*/
|
|
66
|
-
function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
67
|
-
return {
|
|
68
|
-
x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
|
|
69
|
-
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Calculate a transform origin relative to the source axis, between 0-1, that results
|
|
74
|
-
* in an asthetically pleasing scale/transform needed to project from source to target.
|
|
75
|
-
*/
|
|
76
|
-
function calcOrigin(source, target) {
|
|
77
|
-
let origin = 0.5;
|
|
78
|
-
const sourceLength = calcLength(source);
|
|
79
|
-
const targetLength = calcLength(target);
|
|
80
|
-
if (targetLength > sourceLength) {
|
|
81
|
-
origin = progress(target.min, target.max - sourceLength, source.min);
|
|
82
|
-
}
|
|
83
|
-
else if (sourceLength > targetLength) {
|
|
84
|
-
origin = progress(source.min, source.max - targetLength, target.min);
|
|
85
|
-
}
|
|
86
|
-
return clamp(0, 1, origin);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Rebase the calculated viewport constraints relative to the layout.min point.
|
|
90
|
-
*/
|
|
91
|
-
function rebaseAxisConstraints(layout, constraints) {
|
|
92
|
-
const relativeConstraints = {};
|
|
93
|
-
if (constraints.min !== undefined) {
|
|
94
|
-
relativeConstraints.min = constraints.min - layout.min;
|
|
95
|
-
}
|
|
96
|
-
if (constraints.max !== undefined) {
|
|
97
|
-
relativeConstraints.max = constraints.max - layout.min;
|
|
98
|
-
}
|
|
99
|
-
return relativeConstraints;
|
|
100
|
-
}
|
|
101
|
-
const defaultElastic = 0.35;
|
|
102
|
-
/**
|
|
103
|
-
* Accepts a dragElastic prop and returns resolved elastic values for each axis.
|
|
104
|
-
*/
|
|
105
|
-
function resolveDragElastic(dragElastic = defaultElastic) {
|
|
106
|
-
if (dragElastic === false) {
|
|
107
|
-
dragElastic = 0;
|
|
108
|
-
}
|
|
109
|
-
else if (dragElastic === true) {
|
|
110
|
-
dragElastic = defaultElastic;
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
x: resolveAxisElastic(dragElastic, "left", "right"),
|
|
114
|
-
y: resolveAxisElastic(dragElastic, "top", "bottom"),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
|
|
118
|
-
return {
|
|
119
|
-
min: resolvePointElastic(dragElastic, minLabel),
|
|
120
|
-
max: resolvePointElastic(dragElastic, maxLabel),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function resolvePointElastic(dragElastic, label) {
|
|
124
|
-
return typeof dragElastic === "number"
|
|
125
|
-
? dragElastic
|
|
126
|
-
: dragElastic[label] || 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { addDomEvent } from '../events/add-dom-event.mjs';
|
|
2
|
-
import { Feature } from '../motion/features/Feature.mjs';
|
|
3
|
-
import { pipe } from '../../../../motion-utils/dist/es/pipe.mjs';
|
|
4
|
-
|
|
5
|
-
class FocusGesture extends Feature {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.isActive = false;
|
|
9
|
-
}
|
|
10
|
-
onFocus() {
|
|
11
|
-
let isFocusVisible = false;
|
|
12
|
-
/**
|
|
13
|
-
* If this element doesn't match focus-visible then don't
|
|
14
|
-
* apply whileHover. But, if matches throws that focus-visible
|
|
15
|
-
* is not a valid selector then in that browser outline styles will be applied
|
|
16
|
-
* to the element by default and we want to match that behaviour with whileFocus.
|
|
17
|
-
*/
|
|
18
|
-
try {
|
|
19
|
-
isFocusVisible = this.node.current.matches(":focus-visible");
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
isFocusVisible = true;
|
|
23
|
-
}
|
|
24
|
-
if (!isFocusVisible || !this.node.animationState)
|
|
25
|
-
return;
|
|
26
|
-
this.node.animationState.setActive("whileFocus", true);
|
|
27
|
-
this.isActive = true;
|
|
28
|
-
}
|
|
29
|
-
onBlur() {
|
|
30
|
-
if (!this.isActive || !this.node.animationState)
|
|
31
|
-
return;
|
|
32
|
-
this.node.animationState.setActive("whileFocus", false);
|
|
33
|
-
this.isActive = false;
|
|
34
|
-
}
|
|
35
|
-
mount() {
|
|
36
|
-
this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur()));
|
|
37
|
-
}
|
|
38
|
-
unmount() { }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { FocusGesture };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { extractEventInfo } from '../events/event-info.mjs';
|
|
2
|
-
import { Feature } from '../motion/features/Feature.mjs';
|
|
3
|
-
import { hover } from '../../../../motion-dom/dist/es/gestures/hover.mjs';
|
|
4
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
|
-
|
|
6
|
-
function handleHoverEvent(node, event, lifecycle) {
|
|
7
|
-
const { props } = node;
|
|
8
|
-
if (node.animationState && props.whileHover) {
|
|
9
|
-
node.animationState.setActive("whileHover", lifecycle === "Start");
|
|
10
|
-
}
|
|
11
|
-
const eventName = ("onHover" + lifecycle);
|
|
12
|
-
const callback = props[eventName];
|
|
13
|
-
if (callback) {
|
|
14
|
-
frame.postRender(() => callback(event, extractEventInfo(event)));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
class HoverGesture extends Feature {
|
|
18
|
-
mount() {
|
|
19
|
-
const { current } = this.node;
|
|
20
|
-
if (!current)
|
|
21
|
-
return;
|
|
22
|
-
this.unmount = hover(current, (_element, startEvent) => {
|
|
23
|
-
handleHoverEvent(this.node, startEvent, "Start");
|
|
24
|
-
return (endEvent) => handleHoverEvent(this.node, endEvent, "End");
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
unmount() { }
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { HoverGesture };
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
|
2
|
-
import { extractEventInfo } from '../../events/event-info.mjs';
|
|
3
|
-
import { distance2D } from '../../utils/distance.mjs';
|
|
4
|
-
import { frame, cancelFrame, frameData } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
|
-
import { isPrimaryPointer } from '../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs';
|
|
6
|
-
import { pipe } from '../../../../../motion-utils/dist/es/pipe.mjs';
|
|
7
|
-
import { secondsToMilliseconds, millisecondsToSeconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
class PanSession {
|
|
13
|
-
constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false, } = {}) {
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
this.startEvent = null;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
this.lastMoveEvent = null;
|
|
22
|
-
/**
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
this.lastMoveEventInfo = null;
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
this.handlers = {};
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
this.contextWindow = window;
|
|
34
|
-
this.updatePoint = () => {
|
|
35
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
36
|
-
return;
|
|
37
|
-
const info = getPanInfo(this.lastMoveEventInfo, this.history);
|
|
38
|
-
const isPanStarted = this.startEvent !== null;
|
|
39
|
-
// Only start panning if the offset is larger than 3 pixels. If we make it
|
|
40
|
-
// any larger than this we'll want to reset the pointer history
|
|
41
|
-
// on the first update to avoid visual snapping to the cursoe.
|
|
42
|
-
const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;
|
|
43
|
-
if (!isPanStarted && !isDistancePastThreshold)
|
|
44
|
-
return;
|
|
45
|
-
const { point } = info;
|
|
46
|
-
const { timestamp } = frameData;
|
|
47
|
-
this.history.push({ ...point, timestamp });
|
|
48
|
-
const { onStart, onMove } = this.handlers;
|
|
49
|
-
if (!isPanStarted) {
|
|
50
|
-
onStart && onStart(this.lastMoveEvent, info);
|
|
51
|
-
this.startEvent = this.lastMoveEvent;
|
|
52
|
-
}
|
|
53
|
-
onMove && onMove(this.lastMoveEvent, info);
|
|
54
|
-
};
|
|
55
|
-
this.handlePointerMove = (event, info) => {
|
|
56
|
-
this.lastMoveEvent = event;
|
|
57
|
-
this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
|
|
58
|
-
// Throttle mouse move event to once per frame
|
|
59
|
-
frame.update(this.updatePoint, true);
|
|
60
|
-
};
|
|
61
|
-
this.handlePointerUp = (event, info) => {
|
|
62
|
-
this.end();
|
|
63
|
-
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
|
|
64
|
-
if (this.dragSnapToOrigin)
|
|
65
|
-
resumeAnimation && resumeAnimation();
|
|
66
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
67
|
-
return;
|
|
68
|
-
const panInfo = getPanInfo(event.type === "pointercancel"
|
|
69
|
-
? this.lastMoveEventInfo
|
|
70
|
-
: transformPoint(info, this.transformPagePoint), this.history);
|
|
71
|
-
if (this.startEvent && onEnd) {
|
|
72
|
-
onEnd(event, panInfo);
|
|
73
|
-
}
|
|
74
|
-
onSessionEnd && onSessionEnd(event, panInfo);
|
|
75
|
-
};
|
|
76
|
-
// If we have more than one touch, don't start detecting this gesture
|
|
77
|
-
if (!isPrimaryPointer(event))
|
|
78
|
-
return;
|
|
79
|
-
this.dragSnapToOrigin = dragSnapToOrigin;
|
|
80
|
-
this.handlers = handlers;
|
|
81
|
-
this.transformPagePoint = transformPagePoint;
|
|
82
|
-
this.contextWindow = contextWindow || window;
|
|
83
|
-
const info = extractEventInfo(event);
|
|
84
|
-
const initialInfo = transformPoint(info, this.transformPagePoint);
|
|
85
|
-
const { point } = initialInfo;
|
|
86
|
-
const { timestamp } = frameData;
|
|
87
|
-
this.history = [{ ...point, timestamp }];
|
|
88
|
-
const { onSessionStart } = handlers;
|
|
89
|
-
onSessionStart &&
|
|
90
|
-
onSessionStart(event, getPanInfo(initialInfo, this.history));
|
|
91
|
-
this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
92
|
-
}
|
|
93
|
-
updateHandlers(handlers) {
|
|
94
|
-
this.handlers = handlers;
|
|
95
|
-
}
|
|
96
|
-
end() {
|
|
97
|
-
this.removeListeners && this.removeListeners();
|
|
98
|
-
cancelFrame(this.updatePoint);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function transformPoint(info, transformPagePoint) {
|
|
102
|
-
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
|
|
103
|
-
}
|
|
104
|
-
function subtractPoint(a, b) {
|
|
105
|
-
return { x: a.x - b.x, y: a.y - b.y };
|
|
106
|
-
}
|
|
107
|
-
function getPanInfo({ point }, history) {
|
|
108
|
-
return {
|
|
109
|
-
point,
|
|
110
|
-
delta: subtractPoint(point, lastDevicePoint(history)),
|
|
111
|
-
offset: subtractPoint(point, startDevicePoint(history)),
|
|
112
|
-
velocity: getVelocity(history, 0.1),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function startDevicePoint(history) {
|
|
116
|
-
return history[0];
|
|
117
|
-
}
|
|
118
|
-
function lastDevicePoint(history) {
|
|
119
|
-
return history[history.length - 1];
|
|
120
|
-
}
|
|
121
|
-
function getVelocity(history, timeDelta) {
|
|
122
|
-
if (history.length < 2) {
|
|
123
|
-
return { x: 0, y: 0 };
|
|
124
|
-
}
|
|
125
|
-
let i = history.length - 1;
|
|
126
|
-
let timestampedPoint = null;
|
|
127
|
-
const lastPoint = lastDevicePoint(history);
|
|
128
|
-
while (i >= 0) {
|
|
129
|
-
timestampedPoint = history[i];
|
|
130
|
-
if (lastPoint.timestamp - timestampedPoint.timestamp >
|
|
131
|
-
secondsToMilliseconds(timeDelta)) {
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
i--;
|
|
135
|
-
}
|
|
136
|
-
if (!timestampedPoint) {
|
|
137
|
-
return { x: 0, y: 0 };
|
|
138
|
-
}
|
|
139
|
-
const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
140
|
-
if (time === 0) {
|
|
141
|
-
return { x: 0, y: 0 };
|
|
142
|
-
}
|
|
143
|
-
const currentVelocity = {
|
|
144
|
-
x: (lastPoint.x - timestampedPoint.x) / time,
|
|
145
|
-
y: (lastPoint.y - timestampedPoint.y) / time,
|
|
146
|
-
};
|
|
147
|
-
if (currentVelocity.x === Infinity) {
|
|
148
|
-
currentVelocity.x = 0;
|
|
149
|
-
}
|
|
150
|
-
if (currentVelocity.y === Infinity) {
|
|
151
|
-
currentVelocity.y = 0;
|
|
152
|
-
}
|
|
153
|
-
return currentVelocity;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export { PanSession };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
|
2
|
-
import { Feature } from '../../motion/features/Feature.mjs';
|
|
3
|
-
import { getContextWindow } from '../../utils/get-context-window.mjs';
|
|
4
|
-
import { PanSession } from './PanSession.mjs';
|
|
5
|
-
import { noop } from '../../../../../motion-utils/dist/es/noop.mjs';
|
|
6
|
-
import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
7
|
-
|
|
8
|
-
const asyncHandler = (handler) => (event, info) => {
|
|
9
|
-
if (handler) {
|
|
10
|
-
frame.postRender(() => handler(event, info));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
class PanGesture extends Feature {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.removePointerDownListener = noop;
|
|
17
|
-
}
|
|
18
|
-
onPointerDown(pointerDownEvent) {
|
|
19
|
-
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
|
|
20
|
-
transformPagePoint: this.node.getTransformPagePoint(),
|
|
21
|
-
contextWindow: getContextWindow(this.node),
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
createPanHandlers() {
|
|
25
|
-
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
|
|
26
|
-
return {
|
|
27
|
-
onSessionStart: asyncHandler(onPanSessionStart),
|
|
28
|
-
onStart: asyncHandler(onPanStart),
|
|
29
|
-
onMove: onPan,
|
|
30
|
-
onEnd: (event, info) => {
|
|
31
|
-
delete this.session;
|
|
32
|
-
if (onPanEnd) {
|
|
33
|
-
frame.postRender(() => onPanEnd(event, info));
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
mount() {
|
|
39
|
-
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
|
|
40
|
-
}
|
|
41
|
-
update() {
|
|
42
|
-
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
43
|
-
}
|
|
44
|
-
unmount() {
|
|
45
|
-
this.removePointerDownListener();
|
|
46
|
-
this.session && this.session.end();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { PanGesture };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { extractEventInfo } from '../events/event-info.mjs';
|
|
2
|
-
import { Feature } from '../motion/features/Feature.mjs';
|
|
3
|
-
import { press } from '../../../../motion-dom/dist/es/gestures/press/index.mjs';
|
|
4
|
-
import { frame } from '../../../../motion-dom/dist/es/frameloop/frame.mjs';
|
|
5
|
-
|
|
6
|
-
function handlePressEvent(node, event, lifecycle) {
|
|
7
|
-
const { props } = node;
|
|
8
|
-
if (node.current instanceof HTMLButtonElement && node.current.disabled) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if (node.animationState && props.whileTap) {
|
|
12
|
-
node.animationState.setActive("whileTap", lifecycle === "Start");
|
|
13
|
-
}
|
|
14
|
-
const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle));
|
|
15
|
-
const callback = props[eventName];
|
|
16
|
-
if (callback) {
|
|
17
|
-
frame.postRender(() => callback(event, extractEventInfo(event)));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class PressGesture extends Feature {
|
|
21
|
-
mount() {
|
|
22
|
-
const { current } = this.node;
|
|
23
|
-
if (!current)
|
|
24
|
-
return;
|
|
25
|
-
this.unmount = press(current, (_element, startEvent) => {
|
|
26
|
-
handlePressEvent(this.node, startEvent, "Start");
|
|
27
|
-
return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel");
|
|
28
|
-
}, { useGlobalTarget: this.node.props.globalTapTarget });
|
|
29
|
-
}
|
|
30
|
-
unmount() { }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { PressGesture };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Feature } from '../Feature.mjs';
|
|
2
|
-
|
|
3
|
-
let id = 0;
|
|
4
|
-
class ExitAnimationFeature extends Feature {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.id = id++;
|
|
8
|
-
}
|
|
9
|
-
update() {
|
|
10
|
-
if (!this.node.presenceContext)
|
|
11
|
-
return;
|
|
12
|
-
const { isPresent, onExitComplete } = this.node.presenceContext;
|
|
13
|
-
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
|
|
14
|
-
if (!this.node.animationState || isPresent === prevIsPresent) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
|
|
18
|
-
if (onExitComplete && !isPresent) {
|
|
19
|
-
exitAnimation.then(() => {
|
|
20
|
-
onExitComplete(this.id);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
mount() {
|
|
25
|
-
const { register, onExitComplete } = this.node.presenceContext || {};
|
|
26
|
-
if (onExitComplete) {
|
|
27
|
-
onExitComplete(this.id);
|
|
28
|
-
}
|
|
29
|
-
if (register) {
|
|
30
|
-
this.unmount = register(this.id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
unmount() { }
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { ExitAnimationFeature };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';
|
|
2
|
-
import { createAnimationState } from '../../../render/utils/animation-state.mjs';
|
|
3
|
-
import { Feature } from '../Feature.mjs';
|
|
4
|
-
|
|
5
|
-
class AnimationFeature extends Feature {
|
|
6
|
-
/**
|
|
7
|
-
* We dynamically generate the AnimationState manager as it contains a reference
|
|
8
|
-
* to the underlying animation library. We only want to load that if we load this,
|
|
9
|
-
* so people can optionally code split it out using the `m` component.
|
|
10
|
-
*/
|
|
11
|
-
constructor(node) {
|
|
12
|
-
super(node);
|
|
13
|
-
node.animationState || (node.animationState = createAnimationState(node));
|
|
14
|
-
}
|
|
15
|
-
updateAnimationControlsSubscription() {
|
|
16
|
-
const { animate } = this.node.getProps();
|
|
17
|
-
if (isAnimationControls(animate)) {
|
|
18
|
-
this.unmountControls = animate.subscribe(this.node);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
23
|
-
*/
|
|
24
|
-
mount() {
|
|
25
|
-
this.updateAnimationControlsSubscription();
|
|
26
|
-
}
|
|
27
|
-
update() {
|
|
28
|
-
const { animate } = this.node.getProps();
|
|
29
|
-
const { animate: prevAnimate } = this.node.prevProps || {};
|
|
30
|
-
if (animate !== prevAnimate) {
|
|
31
|
-
this.updateAnimationControlsSubscription();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
unmount() {
|
|
35
|
-
this.node.animationState.reset();
|
|
36
|
-
this.unmountControls?.();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { AnimationFeature };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AnimationFeature } from './animation/index.mjs';
|
|
2
|
-
import { ExitAnimationFeature } from './animation/exit.mjs';
|
|
3
|
-
|
|
4
|
-
const animations = {
|
|
5
|
-
animation: {
|
|
6
|
-
Feature: AnimationFeature,
|
|
7
|
-
},
|
|
8
|
-
exit: {
|
|
9
|
-
Feature: ExitAnimationFeature,
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { animations };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const featureProps = {
|
|
2
|
-
animation: [
|
|
3
|
-
"animate",
|
|
4
|
-
"variants",
|
|
5
|
-
"whileHover",
|
|
6
|
-
"whileTap",
|
|
7
|
-
"exit",
|
|
8
|
-
"whileInView",
|
|
9
|
-
"whileFocus",
|
|
10
|
-
"whileDrag",
|
|
11
|
-
],
|
|
12
|
-
exit: ["exit"],
|
|
13
|
-
drag: ["drag", "dragControls"],
|
|
14
|
-
focus: ["whileFocus"],
|
|
15
|
-
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
16
|
-
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
17
|
-
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
18
|
-
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
19
|
-
layout: ["layout", "layoutId"],
|
|
20
|
-
};
|
|
21
|
-
const featureDefinitions = {};
|
|
22
|
-
for (const key in featureProps) {
|
|
23
|
-
featureDefinitions[key] = {
|
|
24
|
-
isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { featureDefinitions };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DragGesture } from '../../gestures/drag/index.mjs';
|
|
2
|
-
import { PanGesture } from '../../gestures/pan/index.mjs';
|
|
3
|
-
import { MeasureLayout } from './layout/MeasureLayout.mjs';
|
|
4
|
-
import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';
|
|
5
|
-
|
|
6
|
-
const drag = {
|
|
7
|
-
pan: {
|
|
8
|
-
Feature: PanGesture,
|
|
9
|
-
},
|
|
10
|
-
drag: {
|
|
11
|
-
Feature: DragGesture,
|
|
12
|
-
ProjectionNode: HTMLProjectionNode,
|
|
13
|
-
MeasureLayout,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { drag };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { HoverGesture } from '../../gestures/hover.mjs';
|
|
2
|
-
import { FocusGesture } from '../../gestures/focus.mjs';
|
|
3
|
-
import { PressGesture } from '../../gestures/press.mjs';
|
|
4
|
-
import { InViewFeature } from './viewport/index.mjs';
|
|
5
|
-
|
|
6
|
-
const gestureAnimations = {
|
|
7
|
-
inView: {
|
|
8
|
-
Feature: InViewFeature,
|
|
9
|
-
},
|
|
10
|
-
tap: {
|
|
11
|
-
Feature: PressGesture,
|
|
12
|
-
},
|
|
13
|
-
focus: {
|
|
14
|
-
Feature: FocusGesture,
|
|
15
|
-
},
|
|
16
|
-
hover: {
|
|
17
|
-
Feature: HoverGesture,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { gestureAnimations };
|