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.
Files changed (409) hide show
  1. package/dist/cjs/mini.js +7 -1063
  2. package/dist/es/debug.mjs +1 -0
  3. package/dist/es/index.mjs +1 -0
  4. package/dist/es/mini.mjs +1 -0
  5. package/dist/es/react-client.mjs +2 -0
  6. package/dist/es/react-m.mjs +2 -0
  7. package/dist/es/react-mini.mjs +2 -0
  8. package/dist/es/react.mjs +2 -0
  9. package/dist/motion.js +1 -1
  10. package/mini/package.json +1 -1
  11. package/package.json +11 -11
  12. package/react/package.json +1 -1
  13. package/react-client/package.json +1 -1
  14. package/react-m/package.json +1 -1
  15. package/dist/es/framer-motion/dist/es/animation/animate/index.mjs +0 -34
  16. package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +0 -19
  17. package/dist/es/framer-motion/dist/es/animation/animate/sequence.mjs +0 -14
  18. package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +0 -11
  19. package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +0 -52
  20. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +0 -112
  21. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +0 -13
  22. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -12
  23. package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -12
  24. package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +0 -80
  25. package/dist/es/framer-motion/dist/es/animation/hooks/use-animate-style.mjs +0 -17
  26. package/dist/es/framer-motion/dist/es/animation/hooks/use-animate.mjs +0 -17
  27. package/dist/es/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +0 -64
  28. package/dist/es/framer-motion/dist/es/animation/hooks/use-animation.mjs +0 -41
  29. package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -102
  30. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -85
  31. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +0 -65
  32. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element.mjs +0 -26
  33. package/dist/es/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -6
  34. package/dist/es/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -7
  35. package/dist/es/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +0 -38
  36. package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +0 -171
  37. package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +0 -8
  38. package/dist/es/framer-motion/dist/es/animation/optimized-appear/store.mjs +0 -4
  39. package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +0 -256
  40. package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -5
  41. package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -23
  42. package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -31
  43. package/dist/es/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -13
  44. package/dist/es/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -14
  45. package/dist/es/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -45
  46. package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -40
  47. package/dist/es/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -7
  48. package/dist/es/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -5
  49. package/dist/es/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -5
  50. package/dist/es/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -10
  51. package/dist/es/framer-motion/dist/es/animation/utils/stagger.mjs +0 -26
  52. package/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +0 -87
  53. package/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +0 -64
  54. package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +0 -166
  55. package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs +0 -9
  56. package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +0 -70
  57. package/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs +0 -14
  58. package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +0 -15
  59. package/dist/es/framer-motion/dist/es/components/LayoutGroup/index.mjs +0 -32
  60. package/dist/es/framer-motion/dist/es/components/LazyMotion/index.mjs +0 -68
  61. package/dist/es/framer-motion/dist/es/components/MotionConfig/index.mjs +0 -48
  62. package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +0 -53
  63. package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +0 -34
  64. package/dist/es/framer-motion/dist/es/components/Reorder/namespace.mjs +0 -2
  65. package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +0 -24
  66. package/dist/es/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -10
  67. package/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs +0 -6
  68. package/dist/es/framer-motion/dist/es/context/LazyContext.mjs +0 -6
  69. package/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs +0 -13
  70. package/dist/es/framer-motion/dist/es/context/MotionContext/create.mjs +0 -13
  71. package/dist/es/framer-motion/dist/es/context/MotionContext/index.mjs +0 -6
  72. package/dist/es/framer-motion/dist/es/context/MotionContext/utils.mjs +0 -17
  73. package/dist/es/framer-motion/dist/es/context/PresenceContext.mjs +0 -10
  74. package/dist/es/framer-motion/dist/es/context/ReorderContext.mjs +0 -6
  75. package/dist/es/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +0 -9
  76. package/dist/es/framer-motion/dist/es/events/add-dom-event.mjs +0 -6
  77. package/dist/es/framer-motion/dist/es/events/add-pointer-event.mjs +0 -8
  78. package/dist/es/framer-motion/dist/es/events/event-info.mjs +0 -15
  79. package/dist/es/framer-motion/dist/es/events/use-dom-event.mjs +0 -34
  80. package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +0 -479
  81. package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +0 -27
  82. package/dist/es/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +0 -88
  83. package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +0 -129
  84. package/dist/es/framer-motion/dist/es/gestures/focus.mjs +0 -41
  85. package/dist/es/framer-motion/dist/es/gestures/hover.mjs +0 -30
  86. package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +0 -156
  87. package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +0 -50
  88. package/dist/es/framer-motion/dist/es/gestures/press.mjs +0 -33
  89. package/dist/es/framer-motion/dist/es/motion/features/Feature.mjs +0 -9
  90. package/dist/es/framer-motion/dist/es/motion/features/animation/exit.mjs +0 -36
  91. package/dist/es/framer-motion/dist/es/motion/features/animation/index.mjs +0 -40
  92. package/dist/es/framer-motion/dist/es/motion/features/animations.mjs +0 -13
  93. package/dist/es/framer-motion/dist/es/motion/features/definitions.mjs +0 -28
  94. package/dist/es/framer-motion/dist/es/motion/features/drag.mjs +0 -17
  95. package/dist/es/framer-motion/dist/es/motion/features/gestures.mjs +0 -21
  96. package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +0 -135
  97. package/dist/es/framer-motion/dist/es/motion/features/layout.mjs +0 -11
  98. package/dist/es/framer-motion/dist/es/motion/features/load-features.mjs +0 -12
  99. package/dist/es/framer-motion/dist/es/motion/features/viewport/index.mjs +0 -72
  100. package/dist/es/framer-motion/dist/es/motion/features/viewport/observers.mjs +0 -49
  101. package/dist/es/framer-motion/dist/es/motion/index.mjs +0 -101
  102. package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -11
  103. package/dist/es/framer-motion/dist/es/motion/utils/is-motion-component.mjs +0 -12
  104. package/dist/es/framer-motion/dist/es/motion/utils/symbol.mjs +0 -3
  105. package/dist/es/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +0 -17
  106. package/dist/es/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +0 -38
  107. package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +0 -133
  108. package/dist/es/framer-motion/dist/es/motion/utils/use-visual-state.mjs +0 -79
  109. package/dist/es/framer-motion/dist/es/motion/utils/valid-prop.mjs +0 -57
  110. package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +0 -91
  111. package/dist/es/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -33
  112. package/dist/es/framer-motion/dist/es/projection/geometry/copy.mjs +0 -31
  113. package/dist/es/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -119
  114. package/dist/es/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -52
  115. package/dist/es/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -54
  116. package/dist/es/framer-motion/dist/es/projection/geometry/models.mjs +0 -17
  117. package/dist/es/framer-motion/dist/es/projection/geometry/utils.mjs +0 -31
  118. package/dist/es/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -13
  119. package/dist/es/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -27
  120. package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +0 -1605
  121. package/dist/es/framer-motion/dist/es/projection/node/group.mjs +0 -24
  122. package/dist/es/framer-motion/dist/es/projection/node/state.mjs +0 -19
  123. package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +0 -112
  124. package/dist/es/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -41
  125. package/dist/es/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -35
  126. package/dist/es/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -13
  127. package/dist/es/framer-motion/dist/es/projection/styles/transform.mjs +0 -49
  128. package/dist/es/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +0 -14
  129. package/dist/es/framer-motion/dist/es/projection/use-reset-projection.mjs +0 -14
  130. package/dist/es/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -5
  131. package/dist/es/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -26
  132. package/dist/es/framer-motion/dist/es/projection/utils/measure.mjs +0 -17
  133. package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +0 -478
  134. package/dist/es/framer-motion/dist/es/render/components/create-factory.mjs +0 -23
  135. package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +0 -38
  136. package/dist/es/framer-motion/dist/es/render/components/m/create.mjs +0 -6
  137. package/dist/es/framer-motion/dist/es/render/components/m/elements.mjs +0 -227
  138. package/dist/es/framer-motion/dist/es/render/components/m/proxy.mjs +0 -6
  139. package/dist/es/framer-motion/dist/es/render/components/motion/create.mjs +0 -15
  140. package/dist/es/framer-motion/dist/es/render/components/motion/elements.mjs +0 -194
  141. package/dist/es/framer-motion/dist/es/render/components/motion/proxy.mjs +0 -6
  142. package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -43
  143. package/dist/es/framer-motion/dist/es/render/dom/create-visual-element.mjs +0 -14
  144. package/dist/es/framer-motion/dist/es/render/dom/features-animation.mjs +0 -14
  145. package/dist/es/framer-motion/dist/es/render/dom/features-max.mjs +0 -14
  146. package/dist/es/framer-motion/dist/es/render/dom/features-min.mjs +0 -12
  147. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +0 -17
  148. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +0 -23
  149. package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +0 -14
  150. package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -56
  151. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -45
  152. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -60
  153. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -47
  154. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -35
  155. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -20
  156. package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -48
  157. package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -81
  158. package/dist/es/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +0 -30
  159. package/dist/es/framer-motion/dist/es/render/dom/use-render.mjs +0 -33
  160. package/dist/es/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -6
  161. package/dist/es/framer-motion/dist/es/render/dom/utils/filter-props.mjs +0 -59
  162. package/dist/es/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +0 -30
  163. package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -43
  164. package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -44
  165. package/dist/es/framer-motion/dist/es/render/html/config-motion.mjs +0 -12
  166. package/dist/es/framer-motion/dist/es/render/html/use-props.mjs +0 -57
  167. package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -65
  168. package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -62
  169. package/dist/es/framer-motion/dist/es/render/html/utils/create-render-state.mjs +0 -8
  170. package/dist/es/framer-motion/dist/es/render/html/utils/render.mjs +0 -9
  171. package/dist/es/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -19
  172. package/dist/es/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -41
  173. package/dist/es/framer-motion/dist/es/render/store.mjs +0 -3
  174. package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -45
  175. package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +0 -12
  176. package/dist/es/framer-motion/dist/es/render/svg/lowercase-elements.mjs +0 -33
  177. package/dist/es/framer-motion/dist/es/render/svg/use-props.mjs +0 -24
  178. package/dist/es/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -57
  179. package/dist/es/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -30
  180. package/dist/es/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +0 -8
  181. package/dist/es/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -3
  182. package/dist/es/framer-motion/dist/es/render/svg/utils/path.mjs +0 -32
  183. package/dist/es/framer-motion/dist/es/render/svg/utils/render.mjs +0 -12
  184. package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -19
  185. package/dist/es/framer-motion/dist/es/render/utils/animation-state.mjs +0 -342
  186. package/dist/es/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -3
  187. package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -24
  188. package/dist/es/framer-motion/dist/es/render/utils/get-variant-context.mjs +0 -28
  189. package/dist/es/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -13
  190. package/dist/es/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -8
  191. package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +0 -51
  192. package/dist/es/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -8
  193. package/dist/es/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -36
  194. package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +0 -31
  195. package/dist/es/framer-motion/dist/es/render/utils/variant-props.mjs +0 -12
  196. package/dist/es/framer-motion/dist/es/utils/delay.mjs +0 -24
  197. package/dist/es/framer-motion/dist/es/utils/distance.mjs +0 -9
  198. package/dist/es/framer-motion/dist/es/utils/get-context-window.mjs +0 -6
  199. package/dist/es/framer-motion/dist/es/utils/is-browser.mjs +0 -3
  200. package/dist/es/framer-motion/dist/es/utils/is-ref-object.mjs +0 -7
  201. package/dist/es/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -19
  202. package/dist/es/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -5
  203. package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +0 -19
  204. package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +0 -47
  205. package/dist/es/framer-motion/dist/es/utils/shallow-compare.mjs +0 -14
  206. package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +0 -21
  207. package/dist/es/framer-motion/dist/es/utils/use-constant.mjs +0 -18
  208. package/dist/es/framer-motion/dist/es/utils/use-cycle.mjs +0 -47
  209. package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +0 -19
  210. package/dist/es/framer-motion/dist/es/utils/use-in-view.mjs +0 -23
  211. package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +0 -41
  212. package/dist/es/framer-motion/dist/es/utils/use-is-mounted.mjs +0 -15
  213. package/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +0 -6
  214. package/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs +0 -13
  215. package/dist/es/framer-motion/dist/es/utils/use-unmount-effect.mjs +0 -7
  216. package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +0 -14
  217. package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +0 -14
  218. package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +0 -37
  219. package/dist/es/framer-motion/dist/es/value/use-computed.mjs +0 -19
  220. package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +0 -52
  221. package/dist/es/framer-motion/dist/es/value/use-motion-template.mjs +0 -45
  222. package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +0 -38
  223. package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +0 -39
  224. package/dist/es/framer-motion/dist/es/value/use-spring.mjs +0 -22
  225. package/dist/es/framer-motion/dist/es/value/use-time.mjs +0 -10
  226. package/dist/es/framer-motion/dist/es/value/use-transform.mjs +0 -29
  227. package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +0 -35
  228. package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +0 -21
  229. package/dist/es/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -20
  230. package/dist/es/framer-motion/dist/es/value/use-will-change/index.mjs +0 -8
  231. package/dist/es/framer-motion/dist/es/value/use-will-change/is.mjs +0 -7
  232. package/dist/es/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -12
  233. package/dist/es/motion/lib/debug.mjs +0 -1
  234. package/dist/es/motion/lib/index.mjs +0 -131
  235. package/dist/es/motion/lib/mini.mjs +0 -2
  236. package/dist/es/motion/lib/react-client.mjs +0 -3
  237. package/dist/es/motion/lib/react-m.mjs +0 -3
  238. package/dist/es/motion/lib/react-mini.mjs +0 -2
  239. package/dist/es/motion/lib/react.mjs +0 -204
  240. package/dist/es/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +0 -175
  241. package/dist/es/motion-dom/dist/es/animation/GroupAnimation.mjs +0 -72
  242. package/dist/es/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs +0 -9
  243. package/dist/es/motion-dom/dist/es/animation/JSAnimation.mjs +0 -348
  244. package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +0 -158
  245. package/dist/es/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +0 -65
  246. package/dist/es/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +0 -14
  247. package/dist/es/motion-dom/dist/es/animation/drivers/frame.mjs +0 -17
  248. package/dist/es/motion-dom/dist/es/animation/generators/inertia.mjs +0 -87
  249. package/dist/es/motion-dom/dist/es/animation/generators/keyframes.mjs +0 -51
  250. package/dist/es/motion-dom/dist/es/animation/generators/spring/defaults.mjs +0 -27
  251. package/dist/es/motion-dom/dist/es/animation/generators/spring/find.mjs +0 -86
  252. package/dist/es/motion-dom/dist/es/animation/generators/spring/index.mjs +0 -176
  253. package/dist/es/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +0 -17
  254. package/dist/es/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +0 -19
  255. package/dist/es/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +0 -5
  256. package/dist/es/motion-dom/dist/es/animation/generators/utils/velocity.mjs +0 -9
  257. package/dist/es/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +0 -131
  258. package/dist/es/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs +0 -147
  259. package/dist/es/motion-dom/dist/es/animation/keyframes/get-final.mjs +0 -11
  260. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/default.mjs +0 -9
  261. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs +0 -12
  262. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/time.mjs +0 -5
  263. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +0 -11
  264. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +0 -7
  265. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs +0 -15
  266. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs +0 -30
  267. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs +0 -36
  268. package/dist/es/motion-dom/dist/es/animation/utils/WithPromise.mjs +0 -26
  269. package/dist/es/motion-dom/dist/es/animation/utils/active-animations.mjs +0 -9
  270. package/dist/es/motion-dom/dist/es/animation/utils/can-animate.mjs +0 -42
  271. package/dist/es/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs +0 -42
  272. package/dist/es/motion-dom/dist/es/animation/utils/get-value-transition.mjs +0 -7
  273. package/dist/es/motion-dom/dist/es/animation/utils/is-animatable.mjs +0 -30
  274. package/dist/es/motion-dom/dist/es/animation/utils/is-css-variable.mjs +0 -15
  275. package/dist/es/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +0 -18
  276. package/dist/es/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs +0 -3
  277. package/dist/es/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +0 -14
  278. package/dist/es/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +0 -28
  279. package/dist/es/motion-dom/dist/es/animation/waapi/easing/supported.mjs +0 -15
  280. package/dist/es/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +0 -39
  281. package/dist/es/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +0 -13
  282. package/dist/es/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +0 -37
  283. package/dist/es/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs +0 -14
  284. package/dist/es/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +0 -15
  285. package/dist/es/motion-dom/dist/es/animation/waapi/utils/linear.mjs +0 -12
  286. package/dist/es/motion-dom/dist/es/animation/waapi/utils/px-values.mjs +0 -39
  287. package/dist/es/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +0 -20
  288. package/dist/es/motion-dom/dist/es/effects/MotionValueState.mjs +0 -47
  289. package/dist/es/motion-dom/dist/es/effects/attr/index.mjs +0 -41
  290. package/dist/es/motion-dom/dist/es/effects/prop/index.mjs +0 -9
  291. package/dist/es/motion-dom/dist/es/effects/style/index.mjs +0 -52
  292. package/dist/es/motion-dom/dist/es/effects/style/transform.mjs +0 -38
  293. package/dist/es/motion-dom/dist/es/effects/svg/index.mjs +0 -41
  294. package/dist/es/motion-dom/dist/es/effects/utils/create-dom-effect.mjs +0 -18
  295. package/dist/es/motion-dom/dist/es/effects/utils/create-effect.mjs +0 -21
  296. package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +0 -71
  297. package/dist/es/motion-dom/dist/es/frameloop/frame.mjs +0 -6
  298. package/dist/es/motion-dom/dist/es/frameloop/index-legacy.mjs +0 -20
  299. package/dist/es/motion-dom/dist/es/frameloop/microtask.mjs +0 -6
  300. package/dist/es/motion-dom/dist/es/frameloop/order.mjs +0 -12
  301. package/dist/es/motion-dom/dist/es/frameloop/render-step.mjs +0 -92
  302. package/dist/es/motion-dom/dist/es/frameloop/sync-time.mjs +0 -31
  303. package/dist/es/motion-dom/dist/es/gestures/drag/state/is-active.mjs +0 -9
  304. package/dist/es/motion-dom/dist/es/gestures/drag/state/set-active.mjs +0 -28
  305. package/dist/es/motion-dom/dist/es/gestures/hover.mjs +0 -37
  306. package/dist/es/motion-dom/dist/es/gestures/press/index.mjs +0 -83
  307. package/dist/es/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +0 -13
  308. package/dist/es/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +0 -38
  309. package/dist/es/motion-dom/dist/es/gestures/press/utils/state.mjs +0 -3
  310. package/dist/es/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +0 -20
  311. package/dist/es/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +0 -18
  312. package/dist/es/motion-dom/dist/es/gestures/utils/setup.mjs +0 -15
  313. package/dist/es/motion-dom/dist/es/render/dom/is-css-var.mjs +0 -3
  314. package/dist/es/motion-dom/dist/es/render/dom/parse-transform.mjs +0 -83
  315. package/dist/es/motion-dom/dist/es/render/dom/style-computed.mjs +0 -10
  316. package/dist/es/motion-dom/dist/es/render/dom/style-set.mjs +0 -9
  317. package/dist/es/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs +0 -5
  318. package/dist/es/motion-dom/dist/es/render/utils/keys-position.mjs +0 -13
  319. package/dist/es/motion-dom/dist/es/render/utils/keys-transform.mjs +0 -28
  320. package/dist/es/motion-dom/dist/es/resize/handle-element.mjs +0 -63
  321. package/dist/es/motion-dom/dist/es/resize/handle-window.mjs +0 -31
  322. package/dist/es/motion-dom/dist/es/resize/index.mjs +0 -8
  323. package/dist/es/motion-dom/dist/es/scroll/observe.mjs +0 -18
  324. package/dist/es/motion-dom/dist/es/stats/animation-count.mjs +0 -7
  325. package/dist/es/motion-dom/dist/es/stats/buffer.mjs +0 -6
  326. package/dist/es/motion-dom/dist/es/stats/index.mjs +0 -117
  327. package/dist/es/motion-dom/dist/es/utils/interpolate.mjs +0 -79
  328. package/dist/es/motion-dom/dist/es/utils/is-html-element.mjs +0 -11
  329. package/dist/es/motion-dom/dist/es/utils/is-svg-element.mjs +0 -11
  330. package/dist/es/motion-dom/dist/es/utils/is-svg-svg-element.mjs +0 -11
  331. package/dist/es/motion-dom/dist/es/utils/mix/color.mjs +0 -47
  332. package/dist/es/motion-dom/dist/es/utils/mix/complex.mjs +0 -93
  333. package/dist/es/motion-dom/dist/es/utils/mix/immediate.mjs +0 -5
  334. package/dist/es/motion-dom/dist/es/utils/mix/index.mjs +0 -14
  335. package/dist/es/motion-dom/dist/es/utils/mix/number.mjs +0 -26
  336. package/dist/es/motion-dom/dist/es/utils/mix/visibility.mjs +0 -16
  337. package/dist/es/motion-dom/dist/es/utils/resolve-elements.mjs +0 -17
  338. package/dist/es/motion-dom/dist/es/utils/supports/flags.mjs +0 -7
  339. package/dist/es/motion-dom/dist/es/utils/supports/linear-easing.mjs +0 -15
  340. package/dist/es/motion-dom/dist/es/utils/supports/memo.mjs +0 -9
  341. package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +0 -5
  342. package/dist/es/motion-dom/dist/es/utils/transform.mjs +0 -14
  343. package/dist/es/motion-dom/dist/es/value/index.mjs +0 -329
  344. package/dist/es/motion-dom/dist/es/value/map-value.mjs +0 -46
  345. package/dist/es/motion-dom/dist/es/value/spring-value.mjs +0 -72
  346. package/dist/es/motion-dom/dist/es/value/subscribe-value.mjs +0 -13
  347. package/dist/es/motion-dom/dist/es/value/transform-value.mjs +0 -35
  348. package/dist/es/motion-dom/dist/es/value/types/auto.mjs +0 -9
  349. package/dist/es/motion-dom/dist/es/value/types/color/hex.mjs +0 -40
  350. package/dist/es/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs +0 -42
  351. package/dist/es/motion-dom/dist/es/value/types/color/hsla.mjs +0 -22
  352. package/dist/es/motion-dom/dist/es/value/types/color/index.mjs +0 -32
  353. package/dist/es/motion-dom/dist/es/value/types/color/rgba.mjs +0 -25
  354. package/dist/es/motion-dom/dist/es/value/types/color/utils.mjs +0 -29
  355. package/dist/es/motion-dom/dist/es/value/types/complex/filter.mjs +0 -30
  356. package/dist/es/motion-dom/dist/es/value/types/complex/index.mjs +0 -91
  357. package/dist/es/motion-dom/dist/es/value/types/dimensions.mjs +0 -15
  358. package/dist/es/motion-dom/dist/es/value/types/int.mjs +0 -8
  359. package/dist/es/motion-dom/dist/es/value/types/maps/defaults.mjs +0 -30
  360. package/dist/es/motion-dom/dist/es/value/types/maps/number.mjs +0 -50
  361. package/dist/es/motion-dom/dist/es/value/types/maps/transform.mjs +0 -31
  362. package/dist/es/motion-dom/dist/es/value/types/numbers/index.mjs +0 -17
  363. package/dist/es/motion-dom/dist/es/value/types/numbers/units.mjs +0 -18
  364. package/dist/es/motion-dom/dist/es/value/types/test.mjs +0 -6
  365. package/dist/es/motion-dom/dist/es/value/types/utils/animatable-none.mjs +0 -15
  366. package/dist/es/motion-dom/dist/es/value/types/utils/color-regex.mjs +0 -3
  367. package/dist/es/motion-dom/dist/es/value/types/utils/find.mjs +0 -15
  368. package/dist/es/motion-dom/dist/es/value/types/utils/float-regex.mjs +0 -3
  369. package/dist/es/motion-dom/dist/es/value/types/utils/get-as-type.mjs +0 -10
  370. package/dist/es/motion-dom/dist/es/value/types/utils/is-nullish.mjs +0 -5
  371. package/dist/es/motion-dom/dist/es/value/types/utils/sanitize.mjs +0 -5
  372. package/dist/es/motion-dom/dist/es/value/types/utils/single-color-regex.mjs +0 -3
  373. package/dist/es/motion-dom/dist/es/value/utils/is-motion-value.mjs +0 -3
  374. package/dist/es/motion-dom/dist/es/view/index.mjs +0 -64
  375. package/dist/es/motion-dom/dist/es/view/queue.mjs +0 -52
  376. package/dist/es/motion-dom/dist/es/view/start.mjs +0 -155
  377. package/dist/es/motion-dom/dist/es/view/utils/choose-layer-type.mjs +0 -11
  378. package/dist/es/motion-dom/dist/es/view/utils/css.mjs +0 -32
  379. package/dist/es/motion-dom/dist/es/view/utils/get-layer-name.mjs +0 -8
  380. package/dist/es/motion-dom/dist/es/view/utils/get-view-animations.mjs +0 -12
  381. package/dist/es/motion-dom/dist/es/view/utils/has-target.mjs +0 -5
  382. package/dist/es/motion-utils/dist/es/array.mjs +0 -21
  383. package/dist/es/motion-utils/dist/es/clamp.mjs +0 -9
  384. package/dist/es/motion-utils/dist/es/easing/anticipate.mjs +0 -5
  385. package/dist/es/motion-utils/dist/es/easing/back.mjs +0 -9
  386. package/dist/es/motion-utils/dist/es/easing/circ.mjs +0 -8
  387. package/dist/es/motion-utils/dist/es/easing/cubic-bezier.mjs +0 -51
  388. package/dist/es/motion-utils/dist/es/easing/ease.mjs +0 -7
  389. package/dist/es/motion-utils/dist/es/easing/modifiers/mirror.mjs +0 -5
  390. package/dist/es/motion-utils/dist/es/easing/modifiers/reverse.mjs +0 -5
  391. package/dist/es/motion-utils/dist/es/easing/steps.mjs +0 -15
  392. package/dist/es/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +0 -8
  393. package/dist/es/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +0 -3
  394. package/dist/es/motion-utils/dist/es/easing/utils/is-easing-array.mjs +0 -5
  395. package/dist/es/motion-utils/dist/es/easing/utils/map.mjs +0 -41
  396. package/dist/es/motion-utils/dist/es/errors.mjs +0 -16
  397. package/dist/es/motion-utils/dist/es/global-config.mjs +0 -3
  398. package/dist/es/motion-utils/dist/es/is-numerical-string.mjs +0 -6
  399. package/dist/es/motion-utils/dist/es/is-object.mjs +0 -5
  400. package/dist/es/motion-utils/dist/es/is-zero-value-string.mjs +0 -6
  401. package/dist/es/motion-utils/dist/es/memo.mjs +0 -11
  402. package/dist/es/motion-utils/dist/es/noop.mjs +0 -4
  403. package/dist/es/motion-utils/dist/es/pipe.mjs +0 -11
  404. package/dist/es/motion-utils/dist/es/progress.mjs +0 -19
  405. package/dist/es/motion-utils/dist/es/subscription-manager.mjs +0 -40
  406. package/dist/es/motion-utils/dist/es/time-conversion.mjs +0 -12
  407. package/dist/es/motion-utils/dist/es/velocity-per-second.mjs +0 -11
  408. package/dist/es/motion-utils/dist/es/warn-once.mjs +0 -14
  409. package/dist/es/motion-utils/dist/es/wrap.mjs +0 -6
@@ -1,19 +0,0 @@
1
- import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';
2
- import { resolveElements } from '../../../../../motion-dom/dist/es/utils/resolve-elements.mjs';
3
-
4
- function resolveSubjects(subject, keyframes, scope, selectorCache) {
5
- if (typeof subject === "string" && isDOMKeyframes(keyframes)) {
6
- return resolveElements(subject, scope, selectorCache);
7
- }
8
- else if (subject instanceof NodeList) {
9
- return Array.from(subject);
10
- }
11
- else if (Array.isArray(subject)) {
12
- return subject;
13
- }
14
- else {
15
- return [subject];
16
- }
17
- }
18
-
19
- export { resolveSubjects };
@@ -1,14 +0,0 @@
1
- import { createAnimationsFromSequence } from '../sequence/create.mjs';
2
- import { animateSubject } from './subject.mjs';
3
- import { spring } from '../../../../../motion-dom/dist/es/animation/generators/spring/index.mjs';
4
-
5
- function animateSequence(sequence, options, scope) {
6
- const animations = [];
7
- const animationDefinitions = createAnimationsFromSequence(sequence, options, scope, { spring });
8
- animationDefinitions.forEach(({ keyframes, transition }, subject) => {
9
- animations.push(...animateSubject(subject, keyframes, transition));
10
- });
11
- return animations;
12
- }
13
-
14
- export { animateSequence };
@@ -1,11 +0,0 @@
1
- import { animateMotionValue } from '../interfaces/motion-value.mjs';
2
- import { isMotionValue } from '../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs';
3
- import { motionValue } from '../../../../../motion-dom/dist/es/value/index.mjs';
4
-
5
- function animateSingleValue(value, keyframes, options) {
6
- const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
7
- motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options));
8
- return motionValue$1.animation;
9
- }
10
-
11
- export { animateSingleValue };
@@ -1,52 +0,0 @@
1
- import { visualElementStore } from '../../render/store.mjs';
2
- import { animateTarget } from '../interfaces/visual-element-target.mjs';
3
- import { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs';
4
- import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';
5
- import { resolveSubjects } from './resolve-subjects.mjs';
6
- import { animateSingleValue } from './single-value.mjs';
7
- import { invariant } from '../../../../../motion-utils/dist/es/errors.mjs';
8
- import { isMotionValue } from '../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs';
9
-
10
- function isSingleValue(subject, keyframes) {
11
- return (isMotionValue(subject) ||
12
- typeof subject === "number" ||
13
- (typeof subject === "string" && !isDOMKeyframes(keyframes)));
14
- }
15
- /**
16
- * Implementation
17
- */
18
- function animateSubject(subject, keyframes, options, scope) {
19
- const animations = [];
20
- if (isSingleValue(subject, keyframes)) {
21
- animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)
22
- ? keyframes.default || keyframes
23
- : keyframes, options ? options.default || options : options));
24
- }
25
- else {
26
- const subjects = resolveSubjects(subject, keyframes, scope);
27
- const numSubjects = subjects.length;
28
- invariant(Boolean(numSubjects), "No valid elements provided.");
29
- for (let i = 0; i < numSubjects; i++) {
30
- const thisSubject = subjects[i];
31
- const createVisualElement = thisSubject instanceof Element
32
- ? createDOMVisualElement
33
- : createObjectVisualElement;
34
- if (!visualElementStore.has(thisSubject)) {
35
- createVisualElement(thisSubject);
36
- }
37
- const visualElement = visualElementStore.get(thisSubject);
38
- const transition = { ...options };
39
- /**
40
- * Resolve stagger function if provided.
41
- */
42
- if ("delay" in transition &&
43
- typeof transition.delay === "function") {
44
- transition.delay = transition.delay(i, numSubjects);
45
- }
46
- animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));
47
- }
48
- }
49
- return animations;
50
- }
51
-
52
- export { animateSubject };
@@ -1,112 +0,0 @@
1
- import { resolveElements } from '../../../../../../motion-dom/dist/es/utils/resolve-elements.mjs';
2
- import { invariant } from '../../../../../../motion-utils/dist/es/errors.mjs';
3
- import { getValueTransition } from '../../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
4
- import { getAnimationMap, animationMapKey } from '../../../../../../motion-dom/dist/es/animation/utils/active-animations.mjs';
5
- import { getComputedStyle } from '../../../../../../motion-dom/dist/es/render/dom/style-computed.mjs';
6
- import { fillWildcards } from '../../../../../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs';
7
- import { applyPxDefaults } from '../../../../../../motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs';
8
- import { NativeAnimation } from '../../../../../../motion-dom/dist/es/animation/NativeAnimation.mjs';
9
- import { secondsToMilliseconds } from '../../../../../../motion-utils/dist/es/time-conversion.mjs';
10
-
11
- function animateElements(elementOrSelector, keyframes, options, scope) {
12
- const elements = resolveElements(elementOrSelector, scope);
13
- const numElements = elements.length;
14
- invariant(Boolean(numElements), "No valid element provided.");
15
- /**
16
- * WAAPI doesn't support interrupting animations.
17
- *
18
- * Therefore, starting animations requires a three-step process:
19
- * 1. Stop existing animations (write styles to DOM)
20
- * 2. Resolve keyframes (read styles from DOM)
21
- * 3. Create new animations (write styles to DOM)
22
- *
23
- * The hybrid `animate()` function uses AsyncAnimation to resolve
24
- * keyframes before creating new animations, which removes style
25
- * thrashing. Here, we have much stricter filesize constraints.
26
- * Therefore we do this in a synchronous way that ensures that
27
- * at least within `animate()` calls there is no style thrashing.
28
- *
29
- * In the motion-native-animate-mini-interrupt benchmark this
30
- * was 80% faster than a single loop.
31
- */
32
- const animationDefinitions = [];
33
- /**
34
- * Step 1: Build options and stop existing animations (write)
35
- */
36
- for (let i = 0; i < numElements; i++) {
37
- const element = elements[i];
38
- const elementTransition = { ...options };
39
- /**
40
- * Resolve stagger function if provided.
41
- */
42
- if (typeof elementTransition.delay === "function") {
43
- elementTransition.delay = elementTransition.delay(i, numElements);
44
- }
45
- for (const valueName in keyframes) {
46
- let valueKeyframes = keyframes[valueName];
47
- if (!Array.isArray(valueKeyframes)) {
48
- valueKeyframes = [valueKeyframes];
49
- }
50
- const valueOptions = {
51
- ...getValueTransition(elementTransition, valueName),
52
- };
53
- valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));
54
- valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));
55
- /**
56
- * If there's an existing animation playing on this element then stop it
57
- * before creating a new one.
58
- */
59
- const map = getAnimationMap(element);
60
- const key = animationMapKey(valueName, valueOptions.pseudoElement || "");
61
- const currentAnimation = map.get(key);
62
- currentAnimation && currentAnimation.stop();
63
- animationDefinitions.push({
64
- map,
65
- key,
66
- unresolvedKeyframes: valueKeyframes,
67
- options: {
68
- ...valueOptions,
69
- element,
70
- name: valueName,
71
- allowFlatten: !elementTransition.type && !elementTransition.ease,
72
- },
73
- });
74
- }
75
- }
76
- /**
77
- * Step 2: Resolve keyframes (read)
78
- */
79
- for (let i = 0; i < animationDefinitions.length; i++) {
80
- const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];
81
- const { element, name, pseudoElement } = animationOptions;
82
- if (!pseudoElement && unresolvedKeyframes[0] === null) {
83
- unresolvedKeyframes[0] = getComputedStyle(element, name);
84
- }
85
- fillWildcards(unresolvedKeyframes);
86
- applyPxDefaults(unresolvedKeyframes, name);
87
- /**
88
- * If we only have one keyframe, explicitly read the initial keyframe
89
- * from the computed style. This is to ensure consistency with WAAPI behaviour
90
- * for restarting animations, for instance .play() after finish, when it
91
- * has one vs two keyframes.
92
- */
93
- if (!pseudoElement && unresolvedKeyframes.length < 2) {
94
- unresolvedKeyframes.unshift(getComputedStyle(element, name));
95
- }
96
- animationOptions.keyframes = unresolvedKeyframes;
97
- }
98
- /**
99
- * Step 3: Create new animations (write)
100
- */
101
- const animations = [];
102
- for (let i = 0; i < animationDefinitions.length; i++) {
103
- const { map, key, options: animationOptions } = animationDefinitions[i];
104
- const animation = new NativeAnimation(animationOptions);
105
- map.set(key, animation);
106
- animation.finished.finally(() => map.delete(key));
107
- animations.push(animation);
108
- }
109
- return animations;
110
- }
111
-
112
- export { animateElements };
@@ -1,13 +0,0 @@
1
- import { createAnimationsFromSequence } from '../../sequence/create.mjs';
2
- import { animateElements } from './animate-elements.mjs';
3
- import { GroupAnimationWithThen } from '../../../../../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs';
4
-
5
- function animateSequence(definition, options) {
6
- const animations = [];
7
- createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => {
8
- animations.push(...animateElements(element, keyframes, transition));
9
- });
10
- return new GroupAnimationWithThen(animations);
11
- }
12
-
13
- export { animateSequence };
@@ -1,12 +0,0 @@
1
- import { animateElements } from './animate-elements.mjs';
2
- import { GroupAnimationWithThen } from '../../../../../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs';
3
-
4
- const createScopedWaapiAnimate = (scope) => {
5
- function scopedAnimate(elementOrSelector, keyframes, options) {
6
- return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));
7
- }
8
- return scopedAnimate;
9
- };
10
- const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();
11
-
12
- export { animateMini, createScopedWaapiAnimate };
@@ -1,12 +0,0 @@
1
- const isNotNull = (value) => value !== null;
2
- function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) {
3
- const resolvedKeyframes = keyframes.filter(isNotNull);
4
- const index = repeat && repeatType !== "loop" && repeat % 2 === 1
5
- ? 0
6
- : resolvedKeyframes.length - 1;
7
- return !index || finalKeyframe === undefined
8
- ? resolvedKeyframes[index]
9
- : finalKeyframe;
10
- }
11
-
12
- export { getFinalKeyframe };
@@ -1,80 +0,0 @@
1
- import { setTarget } from '../../render/utils/setters.mjs';
2
- import { animateVisualElement } from '../interfaces/visual-element.mjs';
3
- import { invariant } from '../../../../../motion-utils/dist/es/errors.mjs';
4
-
5
- function stopAnimation(visualElement) {
6
- visualElement.values.forEach((value) => value.stop());
7
- }
8
- function setVariants(visualElement, variantLabels) {
9
- const reversedLabels = [...variantLabels].reverse();
10
- reversedLabels.forEach((key) => {
11
- const variant = visualElement.getVariant(key);
12
- variant && setTarget(visualElement, variant);
13
- if (visualElement.variantChildren) {
14
- visualElement.variantChildren.forEach((child) => {
15
- setVariants(child, variantLabels);
16
- });
17
- }
18
- });
19
- }
20
- function setValues(visualElement, definition) {
21
- if (Array.isArray(definition)) {
22
- return setVariants(visualElement, definition);
23
- }
24
- else if (typeof definition === "string") {
25
- return setVariants(visualElement, [definition]);
26
- }
27
- else {
28
- setTarget(visualElement, definition);
29
- }
30
- }
31
- /**
32
- * @public
33
- */
34
- function animationControls() {
35
- /**
36
- * Track whether the host component has mounted.
37
- */
38
- let hasMounted = false;
39
- /**
40
- * A collection of linked component animation controls.
41
- */
42
- const subscribers = new Set();
43
- const controls = {
44
- subscribe(visualElement) {
45
- subscribers.add(visualElement);
46
- return () => void subscribers.delete(visualElement);
47
- },
48
- start(definition, transitionOverride) {
49
- invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");
50
- const animations = [];
51
- subscribers.forEach((visualElement) => {
52
- animations.push(animateVisualElement(visualElement, definition, {
53
- transitionOverride,
54
- }));
55
- });
56
- return Promise.all(animations);
57
- },
58
- set(definition) {
59
- invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.");
60
- return subscribers.forEach((visualElement) => {
61
- setValues(visualElement, definition);
62
- });
63
- },
64
- stop() {
65
- subscribers.forEach((visualElement) => {
66
- stopAnimation(visualElement);
67
- });
68
- },
69
- mount() {
70
- hasMounted = true;
71
- return () => {
72
- hasMounted = false;
73
- controls.stop();
74
- };
75
- },
76
- };
77
- return controls;
78
- }
79
-
80
- export { animationControls, setValues };
@@ -1,17 +0,0 @@
1
- import { useConstant } from '../../utils/use-constant.mjs';
2
- import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';
3
- import { createScopedWaapiAnimate } from '../animators/waapi/animate-style.mjs';
4
-
5
- function useAnimateMini() {
6
- const scope = useConstant(() => ({
7
- current: null, // Will be hydrated by React
8
- animations: [],
9
- }));
10
- const animate = useConstant(() => createScopedWaapiAnimate(scope));
11
- useUnmountEffect(() => {
12
- scope.animations.forEach((animation) => animation.stop());
13
- });
14
- return [scope, animate];
15
- }
16
-
17
- export { useAnimateMini };
@@ -1,17 +0,0 @@
1
- import { useConstant } from '../../utils/use-constant.mjs';
2
- import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';
3
- import { createScopedAnimate } from '../animate/index.mjs';
4
-
5
- function useAnimate() {
6
- const scope = useConstant(() => ({
7
- current: null, // Will be hydrated by React
8
- animations: [],
9
- }));
10
- const animate = useConstant(() => createScopedAnimate(scope));
11
- useUnmountEffect(() => {
12
- scope.animations.forEach((animation) => animation.stop());
13
- });
14
- return [scope, animate];
15
- }
16
-
17
- export { useAnimate };
@@ -1,64 +0,0 @@
1
- import { useState, useLayoutEffect } from 'react';
2
- import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';
3
- import { createBox } from '../../projection/geometry/models.mjs';
4
- import { VisualElement } from '../../render/VisualElement.mjs';
5
- import { useConstant } from '../../utils/use-constant.mjs';
6
- import { animateVisualElement } from '../interfaces/visual-element.mjs';
7
-
8
- const createObject = () => ({});
9
- class StateVisualElement extends VisualElement {
10
- constructor() {
11
- super(...arguments);
12
- this.measureInstanceViewportBox = createBox;
13
- }
14
- build() { }
15
- resetTransform() { }
16
- restoreTransform() { }
17
- removeValueFromRenderState() { }
18
- renderInstance() { }
19
- scrapeMotionValuesFromProps() {
20
- return createObject();
21
- }
22
- getBaseTargetFromProps() {
23
- return undefined;
24
- }
25
- readValueFromInstance(_state, key, options) {
26
- return options.initialState[key] || 0;
27
- }
28
- sortInstanceNodePosition() {
29
- return 0;
30
- }
31
- }
32
- const useVisualState = makeUseVisualState({
33
- scrapeMotionValuesFromProps: createObject,
34
- createRenderState: createObject,
35
- });
36
- /**
37
- * This is not an officially supported API and may be removed
38
- * on any version.
39
- */
40
- function useAnimatedState(initialState) {
41
- const [animationState, setAnimationState] = useState(initialState);
42
- const visualState = useVisualState({}, false);
43
- const element = useConstant(() => {
44
- return new StateVisualElement({
45
- props: {
46
- onUpdate: (v) => {
47
- setAnimationState({ ...v });
48
- },
49
- },
50
- visualState,
51
- presenceContext: null,
52
- }, { initialState });
53
- });
54
- useLayoutEffect(() => {
55
- element.mount({});
56
- return () => element.unmount();
57
- }, [element]);
58
- const startAnimation = useConstant(() => (animationDefinition) => {
59
- return animateVisualElement(element, animationDefinition);
60
- });
61
- return [animationState, startAnimation];
62
- }
63
-
64
- export { useAnimatedState };
@@ -1,41 +0,0 @@
1
- import { useConstant } from '../../utils/use-constant.mjs';
2
- import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';
3
- import { animationControls } from './animation-controls.mjs';
4
-
5
- /**
6
- * Creates `LegacyAnimationControls`, which can be used to manually start, stop
7
- * and sequence animations on one or more components.
8
- *
9
- * The returned `LegacyAnimationControls` should be passed to the `animate` property
10
- * of the components you want to animate.
11
- *
12
- * These components can then be animated with the `start` method.
13
- *
14
- * ```jsx
15
- * import * as React from 'react'
16
- * import { motion, useAnimation } from 'framer-motion'
17
- *
18
- * export function MyComponent(props) {
19
- * const controls = useAnimation()
20
- *
21
- * controls.start({
22
- * x: 100,
23
- * transition: { duration: 0.5 },
24
- * })
25
- *
26
- * return <motion.div animate={controls} />
27
- * }
28
- * ```
29
- *
30
- * @returns Animation controller with `start` and `stop` methods
31
- *
32
- * @public
33
- */
34
- function useAnimationControls() {
35
- const controls = useConstant(animationControls);
36
- useIsomorphicLayoutEffect(controls.mount, []);
37
- return controls;
38
- }
39
- const useAnimation = useAnimationControls;
40
-
41
- export { useAnimation, useAnimationControls };
@@ -1,102 +0,0 @@
1
- import { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';
2
- import { getDefaultTransition } from '../utils/default-transitions.mjs';
3
- import { isTransitionDefined } from '../utils/is-transition-defined.mjs';
4
- import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
5
- import { secondsToMilliseconds } from '../../../../../motion-utils/dist/es/time-conversion.mjs';
6
- import { MotionGlobalConfig } from '../../../../../motion-utils/dist/es/global-config.mjs';
7
- import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
8
- import { JSAnimation } from '../../../../../motion-dom/dist/es/animation/JSAnimation.mjs';
9
- import { AsyncMotionValueAnimation } from '../../../../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs';
10
-
11
- const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
12
- const valueTransition = getValueTransition(transition, name) || {};
13
- /**
14
- * Most transition values are currently completely overwritten by value-specific
15
- * transitions. In the future it'd be nicer to blend these transitions. But for now
16
- * delay actually does inherit from the root transition if not value-specific.
17
- */
18
- const delay = valueTransition.delay || transition.delay || 0;
19
- /**
20
- * Elapsed isn't a public transition option but can be passed through from
21
- * optimized appear effects in milliseconds.
22
- */
23
- let { elapsed = 0 } = transition;
24
- elapsed = elapsed - secondsToMilliseconds(delay);
25
- const options = {
26
- keyframes: Array.isArray(target) ? target : [null, target],
27
- ease: "easeOut",
28
- velocity: value.getVelocity(),
29
- ...valueTransition,
30
- delay: -elapsed,
31
- onUpdate: (v) => {
32
- value.set(v);
33
- valueTransition.onUpdate && valueTransition.onUpdate(v);
34
- },
35
- onComplete: () => {
36
- onComplete();
37
- valueTransition.onComplete && valueTransition.onComplete();
38
- },
39
- name,
40
- motionValue: value,
41
- element: isHandoff ? undefined : element,
42
- };
43
- /**
44
- * If there's no transition defined for this value, we can generate
45
- * unique transition settings for this value.
46
- */
47
- if (!isTransitionDefined(valueTransition)) {
48
- Object.assign(options, getDefaultTransition(name, options));
49
- }
50
- /**
51
- * Both WAAPI and our internal animation functions use durations
52
- * as defined by milliseconds, while our external API defines them
53
- * as seconds.
54
- */
55
- options.duration && (options.duration = secondsToMilliseconds(options.duration));
56
- options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));
57
- /**
58
- * Support deprecated way to set initial value. Prefer keyframe syntax.
59
- */
60
- if (options.from !== undefined) {
61
- options.keyframes[0] = options.from;
62
- }
63
- let shouldSkip = false;
64
- if (options.type === false ||
65
- (options.duration === 0 && !options.repeatDelay)) {
66
- options.duration = 0;
67
- if (options.delay === 0) {
68
- shouldSkip = true;
69
- }
70
- }
71
- if (MotionGlobalConfig.instantAnimations ||
72
- MotionGlobalConfig.skipAnimations) {
73
- shouldSkip = true;
74
- options.duration = 0;
75
- options.delay = 0;
76
- }
77
- /**
78
- * If the transition type or easing has been explicitly set by the user
79
- * then we don't want to allow flattening the animation.
80
- */
81
- options.allowFlatten = !valueTransition.type && !valueTransition.ease;
82
- /**
83
- * If we can or must skip creating the animation, and apply only
84
- * the final keyframe, do so. We also check once keyframes are resolved but
85
- * this early check prevents the need to create an animation at all.
86
- */
87
- if (shouldSkip && !isHandoff && value.get() !== undefined) {
88
- const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);
89
- if (finalKeyframe !== undefined) {
90
- frame.update(() => {
91
- options.onUpdate(finalKeyframe);
92
- options.onComplete();
93
- });
94
- return;
95
- }
96
- }
97
- return valueTransition.isSync
98
- ? new JSAnimation(options)
99
- : new AsyncMotionValueAnimation(options);
100
- };
101
-
102
- export { animateMotionValue };
@@ -1,85 +0,0 @@
1
- import { setTarget } from '../../render/utils/setters.mjs';
2
- import { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';
3
- import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';
4
- import { animateMotionValue } from './motion-value.mjs';
5
- import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
6
- import { frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
7
- import { positionalKeys } from '../../../../../motion-dom/dist/es/render/utils/keys-position.mjs';
8
-
9
- /**
10
- * Decide whether we should block this animation. Previously, we achieved this
11
- * just by checking whether the key was listed in protectedKeys, but this
12
- * posed problems if an animation was triggered by afterChildren and protectedKeys
13
- * had been set to true in the meantime.
14
- */
15
- function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
16
- const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
17
- needsAnimating[key] = false;
18
- return shouldBlock;
19
- }
20
- function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {
21
- let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;
22
- if (transitionOverride)
23
- transition = transitionOverride;
24
- const animations = [];
25
- const animationTypeState = type &&
26
- visualElement.animationState &&
27
- visualElement.animationState.getState()[type];
28
- for (const key in target) {
29
- const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);
30
- const valueTarget = target[key];
31
- if (valueTarget === undefined ||
32
- (animationTypeState &&
33
- shouldBlockAnimation(animationTypeState, key))) {
34
- continue;
35
- }
36
- const valueTransition = {
37
- delay,
38
- ...getValueTransition(transition || {}, key),
39
- };
40
- /**
41
- * If the value is already at the defined target, skip the animation.
42
- */
43
- const currentValue = value.get();
44
- if (currentValue !== undefined &&
45
- !value.isAnimating &&
46
- !Array.isArray(valueTarget) &&
47
- valueTarget === currentValue &&
48
- !valueTransition.velocity) {
49
- continue;
50
- }
51
- /**
52
- * If this is the first time a value is being animated, check
53
- * to see if we're handling off from an existing animation.
54
- */
55
- let isHandoff = false;
56
- if (window.MotionHandoffAnimation) {
57
- const appearId = getOptimisedAppearId(visualElement);
58
- if (appearId) {
59
- const startTime = window.MotionHandoffAnimation(appearId, key, frame);
60
- if (startTime !== null) {
61
- valueTransition.startTime = startTime;
62
- isHandoff = true;
63
- }
64
- }
65
- }
66
- addValueToWillChange(visualElement, key);
67
- value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)
68
- ? { type: false }
69
- : valueTransition, visualElement, isHandoff));
70
- const animation = value.animation;
71
- if (animation) {
72
- animations.push(animation);
73
- }
74
- }
75
- if (transitionEnd) {
76
- Promise.all(animations).then(() => {
77
- frame.update(() => {
78
- transitionEnd && setTarget(visualElement, transitionEnd);
79
- });
80
- });
81
- }
82
- return animations;
83
- }
84
-
85
- export { animateTarget };