motion 12.7.3 → 12.7.5-alpha.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.
Files changed (174) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/debug.js +22 -14
  3. package/dist/cjs/index.js +4113 -3624
  4. package/dist/cjs/mini.js +403 -324
  5. package/dist/cjs/react-client.js +3151 -3245
  6. package/dist/cjs/react-m.js +169 -166
  7. package/dist/cjs/react-mini.js +330 -251
  8. package/dist/es/framer-motion/dist/es/animation/animate/sequence.mjs +1 -1
  9. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +81 -9
  10. package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +11 -30
  11. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +1 -1
  12. package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +1 -1
  13. package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +3 -3
  14. package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +2 -2
  15. package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +1 -1
  16. package/dist/es/framer-motion/dist/es/animation/utils/stagger.mjs +1 -1
  17. package/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +26 -23
  18. package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +1 -1
  19. package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +2 -2
  20. package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +2 -2
  21. package/dist/es/framer-motion/dist/es/gestures/focus.mjs +1 -1
  22. package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +1 -1
  23. package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +1 -1
  24. package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +3 -3
  25. package/dist/es/framer-motion/dist/es/projection/geometry/delta-apply.mjs +1 -1
  26. package/dist/es/framer-motion/dist/es/projection/geometry/delta-calc.mjs +1 -1
  27. package/dist/es/framer-motion/dist/es/projection/geometry/delta-remove.mjs +2 -2
  28. package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +3 -5
  29. package/dist/es/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +1 -1
  30. package/dist/es/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +2 -2
  31. package/dist/es/framer-motion/dist/es/projection/styles/scale-correction.mjs +1 -1
  32. package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +7 -7
  33. package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +1 -1
  34. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +17 -0
  35. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +23 -0
  36. package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +6 -82
  37. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +3 -3
  38. package/dist/es/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +29 -0
  39. package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +3 -3
  40. package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +4 -4
  41. package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +3 -3
  42. package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +2 -2
  43. package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +1 -1
  44. package/dist/es/framer-motion/dist/es/render/svg/utils/path.mjs +1 -1
  45. package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +1 -1
  46. package/dist/es/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +1 -1
  47. package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
  48. package/dist/es/framer-motion/dist/es/utils/delay.mjs +1 -1
  49. package/dist/es/framer-motion/dist/es/utils/transform.mjs +1 -1
  50. package/dist/es/framer-motion/dist/es/utils/use-cycle.mjs +1 -1
  51. package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +4 -4
  52. package/dist/es/framer-motion/dist/es/value/use-spring.mjs +2 -2
  53. package/dist/es/framer-motion/dist/es/value/use-will-change/get-will-change-name.mjs +2 -2
  54. package/dist/es/motion/lib/index.mjs +109 -26
  55. package/dist/es/motion/lib/react.mjs +108 -32
  56. package/dist/es/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +179 -0
  57. package/dist/es/motion-dom/dist/es/animation/GroupAnimation.mjs +6 -15
  58. package/dist/es/{framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs → motion-dom/dist/es/animation/JSAnimation.mjs} +108 -156
  59. package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +64 -67
  60. package/dist/es/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +65 -0
  61. package/dist/es/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +14 -0
  62. package/dist/es/{framer-motion/dist/es/animation/animators → motion-dom/dist/es/animation}/drivers/driver-frameloop.mjs +2 -2
  63. package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/keyframes.mjs +5 -5
  64. package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/spring/find.mjs +1 -1
  65. package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/spring/index.mjs +5 -6
  66. package/dist/es/{framer-motion/dist/es/render/dom → motion-dom/dist/es/animation/keyframes}/DOMKeyframesResolver.mjs +9 -8
  67. package/dist/es/{framer-motion/dist/es/render/utils → motion-dom/dist/es/animation/keyframes}/KeyframesResolver.mjs +28 -35
  68. package/dist/es/motion-dom/dist/es/animation/keyframes/get-final.mjs +3 -4
  69. package/dist/es/{framer-motion/dist/es/utils → motion-dom/dist/es/animation/keyframes}/offsets/fill.mjs +2 -2
  70. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +11 -0
  71. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +7 -0
  72. package/dist/es/{framer-motion/dist/es/animation → motion-dom/dist/es/animation/keyframes}/utils/is-none.mjs +1 -1
  73. package/dist/es/{framer-motion/dist/es/render/html → motion-dom/dist/es/animation/keyframes}/utils/make-none-animatable.mjs +1 -1
  74. package/dist/es/{framer-motion/dist/es/render/dom → motion-dom/dist/es/animation/keyframes}/utils/unit-conversion.mjs +2 -2
  75. package/dist/es/motion-dom/dist/es/animation/utils/WithPromise.mjs +28 -0
  76. package/dist/es/motion-dom/dist/es/animation/utils/active-animations.mjs +9 -0
  77. package/dist/es/{framer-motion/dist/es/animation/animators → motion-dom/dist/es/animation}/utils/can-animate.mjs +3 -3
  78. package/dist/es/{framer-motion/dist/es/render/dom → motion-dom/dist/es/animation}/utils/css-variables-conversion.mjs +2 -2
  79. package/dist/es/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +18 -0
  80. package/dist/es/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +1 -1
  81. package/dist/es/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +5 -3
  82. package/dist/es/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +6 -4
  83. package/dist/es/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +39 -0
  84. package/dist/es/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +2 -1
  85. package/dist/es/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +20 -0
  86. package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +2 -1
  87. package/dist/es/motion-dom/dist/es/frameloop/order.mjs +1 -0
  88. package/dist/es/motion-dom/dist/es/render/dom/is-css-var.mjs +3 -0
  89. package/dist/es/motion-dom/dist/es/render/dom/style-computed.mjs +10 -0
  90. package/dist/es/motion-dom/dist/es/render/dom/style-set.mjs +9 -0
  91. package/dist/es/{framer-motion/dist/es/render/html → motion-dom/dist/es/render}/utils/keys-transform.mjs +1 -1
  92. package/dist/es/{framer-motion/dist/es/render/dom → motion-dom/dist/es}/scroll/observe.mjs +1 -1
  93. package/dist/es/motion-dom/dist/es/stats/index.mjs +2 -0
  94. package/dist/es/{framer-motion → motion-dom}/dist/es/utils/interpolate.mjs +4 -3
  95. package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/color.mjs +3 -3
  96. package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/complex.mjs +5 -5
  97. package/dist/es/motion-dom/dist/es/value/index.mjs +3 -1
  98. package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/color/rgba.mjs +2 -2
  99. package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types}/dimensions.mjs +3 -3
  100. package/dist/es/{framer-motion/dist/es/render/dom/value-types/type-int.mjs → motion-dom/dist/es/value/types/int.mjs} +1 -1
  101. package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types/maps}/defaults.mjs +2 -2
  102. package/dist/es/{framer-motion/dist/es/render/dom/value-types/number-browser.mjs → motion-dom/dist/es/value/types/maps/number.mjs} +13 -3
  103. package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types/maps}/transform.mjs +2 -2
  104. package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/numbers/index.mjs +1 -1
  105. package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/numbers/units.mjs +3 -2
  106. package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types/utils}/animatable-none.mjs +4 -4
  107. package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types/utils}/find.mjs +4 -4
  108. package/dist/es/motion-dom/dist/es/view/index.mjs +64 -0
  109. package/dist/es/motion-dom/dist/es/view/queue.mjs +52 -0
  110. package/dist/es/motion-dom/dist/es/view/start.mjs +155 -0
  111. package/dist/es/motion-dom/dist/es/view/utils/choose-layer-type.mjs +11 -0
  112. package/dist/es/motion-dom/dist/es/view/utils/css.mjs +32 -0
  113. package/dist/es/motion-dom/dist/es/view/utils/get-layer-name.mjs +8 -0
  114. package/dist/es/motion-dom/dist/es/view/utils/get-view-animations.mjs +12 -0
  115. package/dist/es/motion-dom/dist/es/view/utils/has-target.mjs +5 -0
  116. package/dist/es/{framer-motion → motion-utils}/dist/es/easing/cubic-bezier.mjs +1 -1
  117. package/dist/es/{framer-motion → motion-utils}/dist/es/easing/steps.mjs +1 -1
  118. package/dist/es/{framer-motion → motion-utils}/dist/es/easing/utils/get-easing-for-segment.mjs +1 -1
  119. package/dist/es/{framer-motion → motion-utils}/dist/es/easing/utils/map.mjs +7 -4
  120. package/dist/es/motion-utils/dist/es/global-config.mjs +1 -4
  121. package/dist/es/motion-utils/dist/es/warn-once.mjs +4 -1
  122. package/dist/motion.dev.js +4108 -3619
  123. package/dist/motion.js +1 -1
  124. package/package.json +3 -3
  125. package/dist/es/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +0 -324
  126. package/dist/es/framer-motion/dist/es/animation/animators/BaseAnimation.mjs +0 -120
  127. package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +0 -5
  128. package/dist/es/framer-motion/dist/es/render/dom/value-types/number.mjs +0 -18
  129. package/dist/es/framer-motion/dist/es/utils/use-instant-transition-state.mjs +0 -5
  130. package/dist/es/motion-dom/dist/es/animation/keyframes/hydrate.mjs +0 -26
  131. package/dist/es/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs +0 -6
  132. package/dist/es/motion-dom/dist/es/render/dom/style.mjs +0 -15
  133. /package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/inertia.mjs +0 -0
  134. /package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/spring/defaults.mjs +0 -0
  135. /package/dist/es/{framer-motion → motion-dom}/dist/es/animation/generators/utils/velocity.mjs +0 -0
  136. /package/dist/es/{framer-motion/dist/es/utils → motion-dom/dist/es/animation/keyframes}/offsets/default.mjs +0 -0
  137. /package/dist/es/{framer-motion/dist/es/utils → motion-dom/dist/es/animation/keyframes}/offsets/time.mjs +0 -0
  138. /package/dist/es/{framer-motion → motion-dom}/dist/es/animation/utils/is-animatable.mjs +0 -0
  139. /package/dist/es/{framer-motion/dist/es/render/dom → motion-dom/dist/es/animation}/utils/is-css-variable.mjs +0 -0
  140. /package/dist/es/{framer-motion/dist/es/animation/animators → motion-dom/dist/es/animation/waapi}/utils/accelerated-values.mjs +0 -0
  141. /package/dist/es/{framer-motion/dist/es/render/html/utils → motion-dom/dist/es/render/dom}/parse-transform.mjs +0 -0
  142. /package/dist/es/{framer-motion/dist/es/render/html → motion-dom/dist/es/render}/utils/keys-position.mjs +0 -0
  143. /package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/immediate.mjs +0 -0
  144. /package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/index.mjs +0 -0
  145. /package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/number.mjs +0 -0
  146. /package/dist/es/{framer-motion → motion-dom}/dist/es/utils/mix/visibility.mjs +0 -0
  147. /package/dist/es/{framer-motion/dist/es/render/dom/value-types/type-auto.mjs → motion-dom/dist/es/value/types/auto.mjs} +0 -0
  148. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/color/hex.mjs +0 -0
  149. /package/dist/es/{framer-motion/dist/es/utils → motion-dom/dist/es/value/types/color}/hsla-to-rgba.mjs +0 -0
  150. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/color/hsla.mjs +0 -0
  151. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/color/index.mjs +0 -0
  152. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/color/utils.mjs +0 -0
  153. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/complex/filter.mjs +0 -0
  154. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/complex/index.mjs +0 -0
  155. /package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types}/test.mjs +0 -0
  156. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/utils/color-regex.mjs +0 -0
  157. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/utils/float-regex.mjs +0 -0
  158. /package/dist/es/{framer-motion/dist/es/render/dom/value-types → motion-dom/dist/es/value/types/utils}/get-as-type.mjs +0 -0
  159. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/utils/is-nullish.mjs +0 -0
  160. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/utils/sanitize.mjs +0 -0
  161. /package/dist/es/{framer-motion → motion-dom}/dist/es/value/types/utils/single-color-regex.mjs +0 -0
  162. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/clamp.mjs +0 -0
  163. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/anticipate.mjs +0 -0
  164. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/back.mjs +0 -0
  165. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/circ.mjs +0 -0
  166. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/ease.mjs +0 -0
  167. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/modifiers/mirror.mjs +0 -0
  168. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/modifiers/reverse.mjs +0 -0
  169. /package/dist/es/{motion-dom/dist/es → motion-utils/dist/es/easing}/utils/is-bezier-definition.mjs +0 -0
  170. /package/dist/es/{framer-motion → motion-utils}/dist/es/easing/utils/is-easing-array.mjs +0 -0
  171. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/is-numerical-string.mjs +0 -0
  172. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/is-zero-value-string.mjs +0 -0
  173. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/pipe.mjs +0 -0
  174. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/wrap.mjs +0 -0
@@ -36,11 +36,6 @@ export { resolveMotionValue } from '../../framer-motion/dist/es/value/utils/reso
36
36
  export { useReducedMotion } from '../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs';
37
37
  export { useReducedMotionConfig } from '../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs';
38
38
  export { MotionGlobalConfig } from '../../motion-utils/dist/es/global-config.mjs';
39
- export { invariant } from '../../motion-utils/dist/es/errors.mjs';
40
- export { noop } from '../../motion-utils/dist/es/noop.mjs';
41
- export { progress } from '../../motion-utils/dist/es/progress.mjs';
42
- export { AcceleratedAnimation } from '../../framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs';
43
- export { animateValue } from '../../framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs';
44
39
  export { animationControls } from '../../framer-motion/dist/es/animation/hooks/animation-controls.mjs';
45
40
  export { useAnimate } from '../../framer-motion/dist/es/animation/hooks/use-animate.mjs';
46
41
  export { useAnimateMini } from '../../framer-motion/dist/es/animation/hooks/use-animate-style.mjs';
@@ -64,11 +59,6 @@ export { useAnimationFrame } from '../../framer-motion/dist/es/utils/use-animati
64
59
  export { useCycle } from '../../framer-motion/dist/es/utils/use-cycle.mjs';
65
60
  export { useInView } from '../../framer-motion/dist/es/utils/use-in-view.mjs';
66
61
  export { disableInstantTransitions, useInstantTransition } from '../../framer-motion/dist/es/utils/use-instant-transition.mjs';
67
- export { color } from '../../framer-motion/dist/es/value/types/color/index.mjs';
68
- export { complex } from '../../framer-motion/dist/es/value/types/complex/index.mjs';
69
- export { px } from '../../framer-motion/dist/es/value/types/numbers/units.mjs';
70
- export { spring } from '../../framer-motion/dist/es/animation/generators/spring/index.mjs';
71
- export { findSpring } from '../../framer-motion/dist/es/animation/generators/spring/find.mjs';
72
62
  export { optimizedAppearDataAttribute } from '../../framer-motion/dist/es/animation/optimized-appear/data-id.mjs';
73
63
  export { startOptimizedAppearAnimation } from '../../framer-motion/dist/es/animation/optimized-appear/start.mjs';
74
64
  export { LayoutGroupContext } from '../../framer-motion/dist/es/context/LayoutGroupContext.mjs';
@@ -82,35 +72,121 @@ export { AnimateSharedLayout } from '../../framer-motion/dist/es/components/Anim
82
72
  export { DeprecatedLayoutGroupContext } from '../../framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs';
83
73
  export { useInvertedScale as useDeprecatedInvertedScale } from '../../framer-motion/dist/es/value/use-inverted-scale.mjs';
84
74
  export { delay } from '../../framer-motion/dist/es/utils/delay.mjs';
85
- export { MotionValue, motionValue } from '../../motion-dom/dist/es/value/index.mjs';
86
- export { cancelFrame, frame, frameData } from '../../motion-dom/dist/es/frameloop/frame.mjs';
87
- export { cancelSync, sync } from '../../motion-dom/dist/es/frameloop/index-legacy.mjs';
88
- export { hover } from '../../motion-dom/dist/es/gestures/hover.mjs';
89
- export { isDragActive } from '../../motion-dom/dist/es/gestures/drag/state/is-active.mjs';
90
- export { press } from '../../motion-dom/dist/es/gestures/press/index.mjs';
91
- export { time } from '../../motion-dom/dist/es/frameloop/sync-time.mjs';
92
75
  export { animate, createScopedAnimate } from '../../framer-motion/dist/es/animation/animate/index.mjs';
93
76
  export { animateMini } from '../../framer-motion/dist/es/animation/animators/waapi/animate-style.mjs';
94
77
  export { scroll } from '../../framer-motion/dist/es/render/dom/scroll/index.mjs';
95
78
  export { scrollInfo } from '../../framer-motion/dist/es/render/dom/scroll/track.mjs';
96
79
  export { inView } from '../../framer-motion/dist/es/render/dom/viewport/index.mjs';
97
- export { inertia } from '../../framer-motion/dist/es/animation/generators/inertia.mjs';
98
- export { keyframes } from '../../framer-motion/dist/es/animation/generators/keyframes.mjs';
99
80
  export { stagger } from '../../framer-motion/dist/es/animation/utils/stagger.mjs';
100
- export { clamp } from '../../framer-motion/dist/es/utils/clamp.mjs';
101
- export { mix } from '../../framer-motion/dist/es/utils/mix/index.mjs';
102
- export { pipe } from '../../framer-motion/dist/es/utils/pipe.mjs';
103
81
  export { transform } from '../../framer-motion/dist/es/utils/transform.mjs';
104
- export { wrap } from '../../framer-motion/dist/es/utils/wrap.mjs';
105
- export { anticipate } from '../../framer-motion/dist/es/easing/anticipate.mjs';
106
- export { backIn, backInOut, backOut } from '../../framer-motion/dist/es/easing/back.mjs';
107
- export { circIn, circInOut, circOut } from '../../framer-motion/dist/es/easing/circ.mjs';
108
- export { cubicBezier } from '../../framer-motion/dist/es/easing/cubic-bezier.mjs';
109
- export { easeIn, easeInOut, easeOut } from '../../framer-motion/dist/es/easing/ease.mjs';
110
- export { mirrorEasing } from '../../framer-motion/dist/es/easing/modifiers/mirror.mjs';
111
- export { reverseEasing } from '../../framer-motion/dist/es/easing/modifiers/reverse.mjs';
112
- export { steps } from '../../framer-motion/dist/es/easing/steps.mjs';
113
82
  export { distance, distance2D } from '../../framer-motion/dist/es/utils/distance.mjs';
114
- export { interpolate } from '../../framer-motion/dist/es/utils/interpolate.mjs';
83
+ export { addUniqueItem, moveItem, removeItem } from '../../motion-utils/dist/es/array.mjs';
84
+ export { clamp } from '../../motion-utils/dist/es/clamp.mjs';
85
+ export { invariant, warning } from '../../motion-utils/dist/es/errors.mjs';
86
+ export { isNumericalString } from '../../motion-utils/dist/es/is-numerical-string.mjs';
87
+ export { isZeroValueString } from '../../motion-utils/dist/es/is-zero-value-string.mjs';
88
+ export { memo } from '../../motion-utils/dist/es/memo.mjs';
89
+ export { noop } from '../../motion-utils/dist/es/noop.mjs';
90
+ export { pipe } from '../../motion-utils/dist/es/pipe.mjs';
91
+ export { progress } from '../../motion-utils/dist/es/progress.mjs';
92
+ export { SubscriptionManager } from '../../motion-utils/dist/es/subscription-manager.mjs';
93
+ export { millisecondsToSeconds, secondsToMilliseconds } from '../../motion-utils/dist/es/time-conversion.mjs';
94
+ export { velocityPerSecond } from '../../motion-utils/dist/es/velocity-per-second.mjs';
95
+ export { hasWarned, warnOnce } from '../../motion-utils/dist/es/warn-once.mjs';
96
+ export { wrap } from '../../motion-utils/dist/es/wrap.mjs';
97
+ export { anticipate } from '../../motion-utils/dist/es/easing/anticipate.mjs';
98
+ export { backIn, backInOut, backOut } from '../../motion-utils/dist/es/easing/back.mjs';
99
+ export { circIn, circInOut, circOut } from '../../motion-utils/dist/es/easing/circ.mjs';
100
+ export { cubicBezier } from '../../motion-utils/dist/es/easing/cubic-bezier.mjs';
101
+ export { easeIn, easeInOut, easeOut } from '../../motion-utils/dist/es/easing/ease.mjs';
102
+ export { mirrorEasing } from '../../motion-utils/dist/es/easing/modifiers/mirror.mjs';
103
+ export { reverseEasing } from '../../motion-utils/dist/es/easing/modifiers/reverse.mjs';
104
+ export { steps } from '../../motion-utils/dist/es/easing/steps.mjs';
105
+ export { getEasingForSegment } from '../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs';
106
+ export { isBezierDefinition } from '../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs';
107
+ export { isEasingArray } from '../../motion-utils/dist/es/easing/utils/is-easing-array.mjs';
108
+ export { easingDefinitionToFunction } from '../../motion-utils/dist/es/easing/utils/map.mjs';
109
+ export { AsyncMotionValueAnimation } from '../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs';
110
+ export { GroupAnimation } from '../../motion-dom/dist/es/animation/GroupAnimation.mjs';
111
+ export { GroupAnimationWithThen } from '../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs';
112
+ export { JSAnimation, animateValue } from '../../motion-dom/dist/es/animation/JSAnimation.mjs';
113
+ export { NativeAnimation } from '../../motion-dom/dist/es/animation/NativeAnimation.mjs';
114
+ export { NativeAnimationExtended } from '../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs';
115
+ export { NativeAnimationWrapper } from '../../motion-dom/dist/es/animation/NativeAnimationWrapper.mjs';
116
+ export { animationMapKey, getAnimationMap } from '../../motion-dom/dist/es/animation/utils/active-animations.mjs';
117
+ export { getVariableValue, parseCSSVariable } from '../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs';
118
+ export { getValueTransition } from '../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
119
+ export { isCSSVariableName, isCSSVariableToken } from '../../motion-dom/dist/es/animation/utils/is-css-variable.mjs';
120
+ export { inertia } from '../../motion-dom/dist/es/animation/generators/inertia.mjs';
121
+ export { defaultEasing, keyframes } from '../../motion-dom/dist/es/animation/generators/keyframes.mjs';
122
+ export { spring } from '../../motion-dom/dist/es/animation/generators/spring/index.mjs';
123
+ export { calcGeneratorDuration, maxGeneratorDuration } from '../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs';
124
+ export { createGeneratorEasing } from '../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs';
125
+ export { isGenerator } from '../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs';
126
+ export { DOMKeyframesResolver } from '../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs';
127
+ export { KeyframeResolver, flushKeyframeResolvers } from '../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs';
128
+ export { defaultOffset } from '../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs';
129
+ export { fillOffset } from '../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs';
130
+ export { convertOffsetToTimes } from '../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs';
131
+ export { applyPxDefaults } from '../../motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs';
132
+ export { fillWildcards } from '../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs';
133
+ export { cubicBezierAsString } from '../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs';
134
+ export { isWaapiSupportedEasing } from '../../motion-dom/dist/es/animation/waapi/easing/is-supported.mjs';
135
+ export { mapEasingToNativeEasing } from '../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs';
136
+ export { supportedWaapiEasing } from '../../motion-dom/dist/es/animation/waapi/easing/supported.mjs';
137
+ export { startWaapiAnimation } from '../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs';
138
+ export { supportsPartialKeyframes } from '../../motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs';
139
+ export { supportsBrowserAnimation } from '../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs';
140
+ export { acceleratedValues } from '../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs';
141
+ export { generateLinearEasing } from '../../motion-dom/dist/es/animation/waapi/utils/linear.mjs';
142
+ export { createRenderBatcher } from '../../motion-dom/dist/es/frameloop/batcher.mjs';
143
+ export { cancelMicrotask, microtask } from '../../motion-dom/dist/es/frameloop/microtask.mjs';
144
+ export { time } from '../../motion-dom/dist/es/frameloop/sync-time.mjs';
145
+ export { isDragActive, isDragging } from '../../motion-dom/dist/es/gestures/drag/state/is-active.mjs';
146
+ export { setDragLock } from '../../motion-dom/dist/es/gestures/drag/state/set-active.mjs';
147
+ export { hover } from '../../motion-dom/dist/es/gestures/hover.mjs';
148
+ export { press } from '../../motion-dom/dist/es/gestures/press/index.mjs';
149
+ export { isNodeOrChild } from '../../motion-dom/dist/es/gestures/utils/is-node-or-child.mjs';
150
+ export { isPrimaryPointer } from '../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs';
151
+ export { parseValueFromTransform, readTransformValue } from '../../motion-dom/dist/es/render/dom/parse-transform.mjs';
152
+ export { getComputedStyle } from '../../motion-dom/dist/es/render/dom/style-computed.mjs';
153
+ export { setStyle } from '../../motion-dom/dist/es/render/dom/style-set.mjs';
154
+ export { positionalKeys } from '../../motion-dom/dist/es/render/utils/keys-position.mjs';
155
+ export { transformPropOrder, transformProps } from '../../motion-dom/dist/es/render/utils/keys-transform.mjs';
156
+ export { observeTimeline } from '../../motion-dom/dist/es/scroll/observe.mjs';
157
+ export { recordStats } from '../../motion-dom/dist/es/stats/index.mjs';
158
+ export { activeAnimations } from '../../motion-dom/dist/es/stats/animation-count.mjs';
159
+ export { statsBuffer } from '../../motion-dom/dist/es/stats/buffer.mjs';
160
+ export { interpolate } from '../../motion-dom/dist/es/utils/interpolate.mjs';
161
+ export { mix } from '../../motion-dom/dist/es/utils/mix/index.mjs';
162
+ export { mixColor, mixLinearColor } from '../../motion-dom/dist/es/utils/mix/color.mjs';
163
+ export { getMixer, mixArray, mixComplex, mixObject } from '../../motion-dom/dist/es/utils/mix/complex.mjs';
164
+ export { mixImmediate } from '../../motion-dom/dist/es/utils/mix/immediate.mjs';
165
+ export { mixNumber } from '../../motion-dom/dist/es/utils/mix/number.mjs';
166
+ export { invisibleValues, mixVisibility } from '../../motion-dom/dist/es/utils/mix/visibility.mjs';
167
+ export { resolveElements } from '../../motion-dom/dist/es/utils/resolve-elements.mjs';
168
+ export { supportsFlags } from '../../motion-dom/dist/es/utils/supports/flags.mjs';
169
+ export { supportsLinearEasing } from '../../motion-dom/dist/es/utils/supports/linear-easing.mjs';
170
+ export { supportsScrollTimeline } from '../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs';
171
+ export { MotionValue, collectMotionValues, motionValue } from '../../motion-dom/dist/es/value/index.mjs';
172
+ export { color } from '../../motion-dom/dist/es/value/types/color/index.mjs';
173
+ export { hex } from '../../motion-dom/dist/es/value/types/color/hex.mjs';
174
+ export { hsla } from '../../motion-dom/dist/es/value/types/color/hsla.mjs';
175
+ export { hslaToRgba } from '../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs';
176
+ export { rgbUnit, rgba } from '../../motion-dom/dist/es/value/types/color/rgba.mjs';
177
+ export { analyseComplexValue, complex } from '../../motion-dom/dist/es/value/types/complex/index.mjs';
178
+ export { dimensionValueTypes, findDimensionValueType } from '../../motion-dom/dist/es/value/types/dimensions.mjs';
179
+ export { defaultValueTypes, getDefaultValueType } from '../../motion-dom/dist/es/value/types/maps/defaults.mjs';
180
+ export { numberValueTypes } from '../../motion-dom/dist/es/value/types/maps/number.mjs';
181
+ export { transformValueTypes } from '../../motion-dom/dist/es/value/types/maps/transform.mjs';
182
+ export { alpha, number, scale } from '../../motion-dom/dist/es/value/types/numbers/index.mjs';
183
+ export { degrees, percent, progressPercentage, px, vh, vw } from '../../motion-dom/dist/es/value/types/numbers/units.mjs';
184
+ export { testValueType } from '../../motion-dom/dist/es/value/types/test.mjs';
185
+ export { getAnimatableNone } from '../../motion-dom/dist/es/value/types/utils/animatable-none.mjs';
186
+ export { findValueType } from '../../motion-dom/dist/es/value/types/utils/find.mjs';
187
+ export { getValueAsType } from '../../motion-dom/dist/es/value/types/utils/get-as-type.mjs';
188
+ export { ViewTransitionBuilder, animateView } from '../../motion-dom/dist/es/view/index.mjs';
189
+ export { cancelSync, sync } from '../../motion-dom/dist/es/frameloop/index-legacy.mjs';
190
+ export { cancelFrame, frame, frameData, frameSteps } from '../../motion-dom/dist/es/frameloop/frame.mjs';
115
191
  import * as namespace from '../../framer-motion/dist/es/components/Reorder/namespace.mjs';
116
192
  export { namespace as Reorder };
@@ -0,0 +1,179 @@
1
+ import { time } from '../frameloop/sync-time.mjs';
2
+ import { JSAnimation } from './JSAnimation.mjs';
3
+ import { getFinalKeyframe } from './keyframes/get-final.mjs';
4
+ import { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';
5
+ import { NativeAnimationExtended } from './NativeAnimationExtended.mjs';
6
+ import { canAnimate } from './utils/can-animate.mjs';
7
+ import { WithPromise } from './utils/WithPromise.mjs';
8
+ import { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';
9
+ import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
10
+ import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
11
+
12
+ /**
13
+ * Maximum time allowed between an animation being created and it being
14
+ * resolved for us to use the latter as the start time.
15
+ *
16
+ * This is to ensure that while we prefer to "start" an animation as soon
17
+ * as it's triggered, we also want to avoid a visual jump if there's a big delay
18
+ * between these two moments.
19
+ */
20
+ const MAX_RESOLVE_DELAY = 40;
21
+ class AsyncMotionValueAnimation extends WithPromise {
22
+ constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) {
23
+ super();
24
+ /**
25
+ * Bound to support return animation.stop pattern
26
+ */
27
+ this.stop = () => {
28
+ if (this._animation) {
29
+ this._animation.stop();
30
+ this.stopTimeline?.();
31
+ }
32
+ else {
33
+ this.keyframeResolver?.cancel();
34
+ }
35
+ };
36
+ this.createdAt = time.now();
37
+ const optionsWithDefaults = {
38
+ autoplay,
39
+ delay,
40
+ type,
41
+ repeat,
42
+ repeatDelay,
43
+ repeatType,
44
+ name,
45
+ motionValue,
46
+ element,
47
+ ...options,
48
+ };
49
+ const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;
50
+ this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);
51
+ this.keyframeResolver?.scheduleResolve();
52
+ }
53
+ onKeyframesResolved(keyframes, finalKeyframe, options, sync) {
54
+ this.keyframeResolver = undefined;
55
+ const { name, type, velocity, delay, isHandoff, onUpdate, onComplete } = options;
56
+ this.resolvedAt = time.now();
57
+ /**
58
+ * If we can't animate this value with the resolved keyframes
59
+ * then we should complete it immediately.
60
+ */
61
+ if (!canAnimate(keyframes, name, type, velocity)) {
62
+ if (MotionGlobalConfig.instantAnimations || !delay) {
63
+ onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));
64
+ }
65
+ keyframes[0] = keyframes[keyframes.length - 1];
66
+ options.duration = 0;
67
+ options.repeat = 0;
68
+ }
69
+ /**
70
+ * Resolve startTime for the animation.
71
+ *
72
+ * This method uses the createdAt and resolvedAt to calculate the
73
+ * animation startTime. *Ideally*, we would use the createdAt time as t=0
74
+ * as the following frame would then be the first frame of the animation in
75
+ * progress, which would feel snappier.
76
+ *
77
+ * However, if there's a delay (main thread work) between the creation of
78
+ * the animation and the first commited frame, we prefer to use resolvedAt
79
+ * to avoid a sudden jump into the animation.
80
+ */
81
+ const startTime = sync
82
+ ? !this.resolvedAt
83
+ ? this.createdAt
84
+ : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY
85
+ ? this.resolvedAt
86
+ : this.createdAt
87
+ : undefined;
88
+ const resolvedOptions = {
89
+ startTime,
90
+ finalKeyframe,
91
+ ...options,
92
+ keyframes,
93
+ };
94
+ /**
95
+ * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via
96
+ * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the
97
+ * optimised animation.
98
+ */
99
+ const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)
100
+ ? new NativeAnimationExtended({
101
+ ...resolvedOptions,
102
+ element: resolvedOptions.motionValue.owner.current,
103
+ })
104
+ : new JSAnimation(resolvedOptions);
105
+ animation.finished
106
+ .then(() => {
107
+ onComplete?.();
108
+ this.notifyFinished();
109
+ })
110
+ .catch(noop);
111
+ if (this.pendingTimeline) {
112
+ this.stopTimeline = animation.attachTimeline(this.pendingTimeline);
113
+ this.pendingTimeline = undefined;
114
+ }
115
+ this._animation = animation;
116
+ }
117
+ get finished() {
118
+ if (!this._animation) {
119
+ return this._finished;
120
+ }
121
+ else {
122
+ return this.animation.finished;
123
+ }
124
+ }
125
+ then(onResolve, _onReject) {
126
+ return this.finished.finally(onResolve).then(() => { });
127
+ }
128
+ get animation() {
129
+ if (!this._animation) {
130
+ flushKeyframeResolvers();
131
+ }
132
+ return this._animation;
133
+ }
134
+ get duration() {
135
+ return this.animation.duration;
136
+ }
137
+ get time() {
138
+ return this.animation.time;
139
+ }
140
+ set time(newTime) {
141
+ this.animation.time = newTime;
142
+ }
143
+ get speed() {
144
+ return this.animation.speed;
145
+ }
146
+ get state() {
147
+ return this.animation.state;
148
+ }
149
+ set speed(newSpeed) {
150
+ this.animation.speed = newSpeed;
151
+ }
152
+ get startTime() {
153
+ return this.animation.startTime;
154
+ }
155
+ attachTimeline(timeline) {
156
+ if (this._animation) {
157
+ this.stopTimeline = this.animation.attachTimeline(timeline);
158
+ }
159
+ else {
160
+ this.pendingTimeline = timeline;
161
+ }
162
+ return () => this.stop();
163
+ }
164
+ play() {
165
+ this.animation.play();
166
+ }
167
+ pause() {
168
+ this.animation.pause();
169
+ }
170
+ complete() {
171
+ console.log("async animation complete");
172
+ this.animation.complete();
173
+ }
174
+ cancel() {
175
+ this.animation.cancel();
176
+ }
177
+ }
178
+
179
+ export { AsyncMotionValueAnimation };
@@ -1,8 +1,6 @@
1
- import { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';
2
-
3
1
  class GroupAnimation {
4
2
  constructor(animations) {
5
- // Bound to accomodate common `return animation.stop` pattern
3
+ // Bound to accomadate common `return animation.stop` pattern
6
4
  this.stop = () => this.runAll("stop");
7
5
  this.animations = animations.filter(Boolean);
8
6
  }
@@ -20,15 +18,8 @@ class GroupAnimation {
20
18
  this.animations[i][propName] = newValue;
21
19
  }
22
20
  }
23
- attachTimeline(timeline, fallback) {
24
- const subscriptions = this.animations.map((animation) => {
25
- if (supportsScrollTimeline() && animation.attachTimeline) {
26
- return animation.attachTimeline(timeline);
27
- }
28
- else if (typeof fallback === "function") {
29
- return fallback(animation);
30
- }
31
- });
21
+ attachTimeline(timeline) {
22
+ const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));
32
23
  return () => {
33
24
  subscriptions.forEach((cancel, i) => {
34
25
  cancel && cancel();
@@ -48,6 +39,9 @@ class GroupAnimation {
48
39
  set speed(speed) {
49
40
  this.setAll("speed", speed);
50
41
  }
42
+ get state() {
43
+ return this.getAll("state");
44
+ }
51
45
  get startTime() {
52
46
  return this.getAll("startTime");
53
47
  }
@@ -61,9 +55,6 @@ class GroupAnimation {
61
55
  runAll(methodName) {
62
56
  this.animations.forEach((controls) => controls[methodName]());
63
57
  }
64
- flatten() {
65
- this.runAll("flatten");
66
- }
67
58
  play() {
68
59
  this.runAll("play");
69
60
  }