motion 12.18.1 → 12.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) 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.dev.js +2 -2
  10. package/dist/motion.js +1 -1
  11. package/mini/package.json +1 -1
  12. package/package.json +11 -11
  13. package/react/package.json +1 -1
  14. package/react-client/package.json +1 -1
  15. package/react-m/package.json +1 -1
  16. package/dist/es/framer-motion/dist/es/animation/animate/index.mjs +0 -34
  17. package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +0 -19
  18. package/dist/es/framer-motion/dist/es/animation/animate/sequence.mjs +0 -14
  19. package/dist/es/framer-motion/dist/es/animation/animate/single-value.mjs +0 -11
  20. package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +0 -52
  21. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +0 -112
  22. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs +0 -13
  23. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs +0 -12
  24. package/dist/es/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +0 -12
  25. package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +0 -80
  26. package/dist/es/framer-motion/dist/es/animation/hooks/use-animate-style.mjs +0 -17
  27. package/dist/es/framer-motion/dist/es/animation/hooks/use-animate.mjs +0 -17
  28. package/dist/es/framer-motion/dist/es/animation/hooks/use-animated-state.mjs +0 -64
  29. package/dist/es/framer-motion/dist/es/animation/hooks/use-animation.mjs +0 -41
  30. package/dist/es/framer-motion/dist/es/animation/interfaces/motion-value.mjs +0 -102
  31. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +0 -85
  32. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +0 -65
  33. package/dist/es/framer-motion/dist/es/animation/interfaces/visual-element.mjs +0 -26
  34. package/dist/es/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +0 -6
  35. package/dist/es/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs +0 -7
  36. package/dist/es/framer-motion/dist/es/animation/optimized-appear/handoff.mjs +0 -38
  37. package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +0 -171
  38. package/dist/es/framer-motion/dist/es/animation/optimized-appear/store-id.mjs +0 -8
  39. package/dist/es/framer-motion/dist/es/animation/optimized-appear/store.mjs +0 -4
  40. package/dist/es/framer-motion/dist/es/animation/sequence/create.mjs +0 -256
  41. package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +0 -5
  42. package/dist/es/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs +0 -23
  43. package/dist/es/framer-motion/dist/es/animation/sequence/utils/edit.mjs +0 -31
  44. package/dist/es/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs +0 -13
  45. package/dist/es/framer-motion/dist/es/animation/sequence/utils/sort.mjs +0 -14
  46. package/dist/es/framer-motion/dist/es/animation/utils/create-visual-element.mjs +0 -45
  47. package/dist/es/framer-motion/dist/es/animation/utils/default-transitions.mjs +0 -40
  48. package/dist/es/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +0 -7
  49. package/dist/es/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs +0 -5
  50. package/dist/es/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +0 -5
  51. package/dist/es/framer-motion/dist/es/animation/utils/is-transition-defined.mjs +0 -10
  52. package/dist/es/framer-motion/dist/es/animation/utils/stagger.mjs +0 -26
  53. package/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs +0 -87
  54. package/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs +0 -64
  55. package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +0 -166
  56. package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs +0 -9
  57. package/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +0 -70
  58. package/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs +0 -14
  59. package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +0 -15
  60. package/dist/es/framer-motion/dist/es/components/LayoutGroup/index.mjs +0 -32
  61. package/dist/es/framer-motion/dist/es/components/LazyMotion/index.mjs +0 -68
  62. package/dist/es/framer-motion/dist/es/components/MotionConfig/index.mjs +0 -48
  63. package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +0 -53
  64. package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +0 -34
  65. package/dist/es/framer-motion/dist/es/components/Reorder/namespace.mjs +0 -2
  66. package/dist/es/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs +0 -24
  67. package/dist/es/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -10
  68. package/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs +0 -6
  69. package/dist/es/framer-motion/dist/es/context/LazyContext.mjs +0 -6
  70. package/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs +0 -13
  71. package/dist/es/framer-motion/dist/es/context/MotionContext/create.mjs +0 -13
  72. package/dist/es/framer-motion/dist/es/context/MotionContext/index.mjs +0 -6
  73. package/dist/es/framer-motion/dist/es/context/MotionContext/utils.mjs +0 -17
  74. package/dist/es/framer-motion/dist/es/context/PresenceContext.mjs +0 -10
  75. package/dist/es/framer-motion/dist/es/context/ReorderContext.mjs +0 -6
  76. package/dist/es/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +0 -9
  77. package/dist/es/framer-motion/dist/es/events/add-dom-event.mjs +0 -6
  78. package/dist/es/framer-motion/dist/es/events/add-pointer-event.mjs +0 -8
  79. package/dist/es/framer-motion/dist/es/events/event-info.mjs +0 -15
  80. package/dist/es/framer-motion/dist/es/events/use-dom-event.mjs +0 -34
  81. package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +0 -479
  82. package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +0 -27
  83. package/dist/es/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs +0 -88
  84. package/dist/es/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +0 -129
  85. package/dist/es/framer-motion/dist/es/gestures/focus.mjs +0 -41
  86. package/dist/es/framer-motion/dist/es/gestures/hover.mjs +0 -30
  87. package/dist/es/framer-motion/dist/es/gestures/pan/PanSession.mjs +0 -156
  88. package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +0 -50
  89. package/dist/es/framer-motion/dist/es/gestures/press.mjs +0 -33
  90. package/dist/es/framer-motion/dist/es/motion/features/Feature.mjs +0 -9
  91. package/dist/es/framer-motion/dist/es/motion/features/animation/exit.mjs +0 -36
  92. package/dist/es/framer-motion/dist/es/motion/features/animation/index.mjs +0 -40
  93. package/dist/es/framer-motion/dist/es/motion/features/animations.mjs +0 -13
  94. package/dist/es/framer-motion/dist/es/motion/features/definitions.mjs +0 -28
  95. package/dist/es/framer-motion/dist/es/motion/features/drag.mjs +0 -17
  96. package/dist/es/framer-motion/dist/es/motion/features/gestures.mjs +0 -21
  97. package/dist/es/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +0 -135
  98. package/dist/es/framer-motion/dist/es/motion/features/layout.mjs +0 -11
  99. package/dist/es/framer-motion/dist/es/motion/features/load-features.mjs +0 -12
  100. package/dist/es/framer-motion/dist/es/motion/features/viewport/index.mjs +0 -72
  101. package/dist/es/framer-motion/dist/es/motion/features/viewport/observers.mjs +0 -49
  102. package/dist/es/framer-motion/dist/es/motion/index.mjs +0 -101
  103. package/dist/es/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +0 -11
  104. package/dist/es/framer-motion/dist/es/motion/utils/is-motion-component.mjs +0 -12
  105. package/dist/es/framer-motion/dist/es/motion/utils/symbol.mjs +0 -3
  106. package/dist/es/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs +0 -17
  107. package/dist/es/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +0 -38
  108. package/dist/es/framer-motion/dist/es/motion/utils/use-visual-element.mjs +0 -133
  109. package/dist/es/framer-motion/dist/es/motion/utils/use-visual-state.mjs +0 -79
  110. package/dist/es/framer-motion/dist/es/motion/utils/valid-prop.mjs +0 -57
  111. package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +0 -91
  112. package/dist/es/framer-motion/dist/es/projection/geometry/conversion.mjs +0 -33
  113. package/dist/es/framer-motion/dist/es/projection/geometry/copy.mjs +0 -31
  114. package/dist/es/framer-motion/dist/es/projection/geometry/delta-apply.mjs +0 -119
  115. package/dist/es/framer-motion/dist/es/projection/geometry/delta-calc.mjs +0 -52
  116. package/dist/es/framer-motion/dist/es/projection/geometry/delta-remove.mjs +0 -54
  117. package/dist/es/framer-motion/dist/es/projection/geometry/models.mjs +0 -17
  118. package/dist/es/framer-motion/dist/es/projection/geometry/utils.mjs +0 -31
  119. package/dist/es/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +0 -13
  120. package/dist/es/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +0 -27
  121. package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +0 -1605
  122. package/dist/es/framer-motion/dist/es/projection/node/group.mjs +0 -24
  123. package/dist/es/framer-motion/dist/es/projection/node/state.mjs +0 -19
  124. package/dist/es/framer-motion/dist/es/projection/shared/stack.mjs +0 -112
  125. package/dist/es/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +0 -41
  126. package/dist/es/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +0 -35
  127. package/dist/es/framer-motion/dist/es/projection/styles/scale-correction.mjs +0 -13
  128. package/dist/es/framer-motion/dist/es/projection/styles/transform.mjs +0 -49
  129. package/dist/es/framer-motion/dist/es/projection/use-instant-layout-transition.mjs +0 -14
  130. package/dist/es/framer-motion/dist/es/projection/use-reset-projection.mjs +0 -14
  131. package/dist/es/framer-motion/dist/es/projection/utils/each-axis.mjs +0 -5
  132. package/dist/es/framer-motion/dist/es/projection/utils/has-transform.mjs +0 -26
  133. package/dist/es/framer-motion/dist/es/projection/utils/measure.mjs +0 -17
  134. package/dist/es/framer-motion/dist/es/render/VisualElement.mjs +0 -478
  135. package/dist/es/framer-motion/dist/es/render/components/create-factory.mjs +0 -23
  136. package/dist/es/framer-motion/dist/es/render/components/create-proxy.mjs +0 -38
  137. package/dist/es/framer-motion/dist/es/render/components/m/create.mjs +0 -6
  138. package/dist/es/framer-motion/dist/es/render/components/m/elements.mjs +0 -227
  139. package/dist/es/framer-motion/dist/es/render/components/m/proxy.mjs +0 -6
  140. package/dist/es/framer-motion/dist/es/render/components/motion/create.mjs +0 -15
  141. package/dist/es/framer-motion/dist/es/render/components/motion/elements.mjs +0 -194
  142. package/dist/es/framer-motion/dist/es/render/components/motion/proxy.mjs +0 -6
  143. package/dist/es/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +0 -43
  144. package/dist/es/framer-motion/dist/es/render/dom/create-visual-element.mjs +0 -14
  145. package/dist/es/framer-motion/dist/es/render/dom/features-animation.mjs +0 -14
  146. package/dist/es/framer-motion/dist/es/render/dom/features-max.mjs +0 -14
  147. package/dist/es/framer-motion/dist/es/render/dom/features-min.mjs +0 -12
  148. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs +0 -17
  149. package/dist/es/framer-motion/dist/es/render/dom/scroll/attach-function.mjs +0 -23
  150. package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +0 -14
  151. package/dist/es/framer-motion/dist/es/render/dom/scroll/info.mjs +0 -56
  152. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs +0 -45
  153. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs +0 -60
  154. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs +0 -47
  155. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs +0 -35
  156. package/dist/es/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs +0 -20
  157. package/dist/es/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs +0 -48
  158. package/dist/es/framer-motion/dist/es/render/dom/scroll/track.mjs +0 -81
  159. package/dist/es/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs +0 -30
  160. package/dist/es/framer-motion/dist/es/render/dom/use-render.mjs +0 -33
  161. package/dist/es/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +0 -6
  162. package/dist/es/framer-motion/dist/es/render/dom/utils/filter-props.mjs +0 -59
  163. package/dist/es/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +0 -30
  164. package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +0 -43
  165. package/dist/es/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +0 -44
  166. package/dist/es/framer-motion/dist/es/render/html/config-motion.mjs +0 -12
  167. package/dist/es/framer-motion/dist/es/render/html/use-props.mjs +0 -57
  168. package/dist/es/framer-motion/dist/es/render/html/utils/build-styles.mjs +0 -65
  169. package/dist/es/framer-motion/dist/es/render/html/utils/build-transform.mjs +0 -62
  170. package/dist/es/framer-motion/dist/es/render/html/utils/create-render-state.mjs +0 -8
  171. package/dist/es/framer-motion/dist/es/render/html/utils/render.mjs +0 -9
  172. package/dist/es/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +0 -19
  173. package/dist/es/framer-motion/dist/es/render/object/ObjectVisualElement.mjs +0 -41
  174. package/dist/es/framer-motion/dist/es/render/store.mjs +0 -3
  175. package/dist/es/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +0 -45
  176. package/dist/es/framer-motion/dist/es/render/svg/config-motion.mjs +0 -12
  177. package/dist/es/framer-motion/dist/es/render/svg/lowercase-elements.mjs +0 -33
  178. package/dist/es/framer-motion/dist/es/render/svg/use-props.mjs +0 -24
  179. package/dist/es/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +0 -57
  180. package/dist/es/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +0 -30
  181. package/dist/es/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +0 -8
  182. package/dist/es/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +0 -3
  183. package/dist/es/framer-motion/dist/es/render/svg/utils/path.mjs +0 -32
  184. package/dist/es/framer-motion/dist/es/render/svg/utils/render.mjs +0 -12
  185. package/dist/es/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +0 -19
  186. package/dist/es/framer-motion/dist/es/render/utils/animation-state.mjs +0 -342
  187. package/dist/es/framer-motion/dist/es/render/utils/compare-by-depth.mjs +0 -3
  188. package/dist/es/framer-motion/dist/es/render/utils/flat-tree.mjs +0 -24
  189. package/dist/es/framer-motion/dist/es/render/utils/get-variant-context.mjs +0 -28
  190. package/dist/es/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +0 -13
  191. package/dist/es/framer-motion/dist/es/render/utils/is-variant-label.mjs +0 -8
  192. package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +0 -51
  193. package/dist/es/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +0 -8
  194. package/dist/es/framer-motion/dist/es/render/utils/resolve-variants.mjs +0 -36
  195. package/dist/es/framer-motion/dist/es/render/utils/setters.mjs +0 -31
  196. package/dist/es/framer-motion/dist/es/render/utils/variant-props.mjs +0 -12
  197. package/dist/es/framer-motion/dist/es/utils/delay.mjs +0 -24
  198. package/dist/es/framer-motion/dist/es/utils/distance.mjs +0 -9
  199. package/dist/es/framer-motion/dist/es/utils/get-context-window.mjs +0 -6
  200. package/dist/es/framer-motion/dist/es/utils/is-browser.mjs +0 -3
  201. package/dist/es/framer-motion/dist/es/utils/is-ref-object.mjs +0 -7
  202. package/dist/es/framer-motion/dist/es/utils/reduced-motion/index.mjs +0 -19
  203. package/dist/es/framer-motion/dist/es/utils/reduced-motion/state.mjs +0 -5
  204. package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs +0 -19
  205. package/dist/es/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs +0 -47
  206. package/dist/es/framer-motion/dist/es/utils/shallow-compare.mjs +0 -14
  207. package/dist/es/framer-motion/dist/es/utils/use-animation-frame.mjs +0 -21
  208. package/dist/es/framer-motion/dist/es/utils/use-constant.mjs +0 -18
  209. package/dist/es/framer-motion/dist/es/utils/use-cycle.mjs +0 -47
  210. package/dist/es/framer-motion/dist/es/utils/use-force-update.mjs +0 -19
  211. package/dist/es/framer-motion/dist/es/utils/use-in-view.mjs +0 -23
  212. package/dist/es/framer-motion/dist/es/utils/use-instant-transition.mjs +0 -41
  213. package/dist/es/framer-motion/dist/es/utils/use-is-mounted.mjs +0 -15
  214. package/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +0 -6
  215. package/dist/es/framer-motion/dist/es/utils/use-motion-value-event.mjs +0 -13
  216. package/dist/es/framer-motion/dist/es/utils/use-unmount-effect.mjs +0 -7
  217. package/dist/es/framer-motion/dist/es/value/scroll/use-element-scroll.mjs +0 -14
  218. package/dist/es/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs +0 -14
  219. package/dist/es/framer-motion/dist/es/value/use-combine-values.mjs +0 -37
  220. package/dist/es/framer-motion/dist/es/value/use-computed.mjs +0 -19
  221. package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +0 -52
  222. package/dist/es/framer-motion/dist/es/value/use-motion-template.mjs +0 -45
  223. package/dist/es/framer-motion/dist/es/value/use-motion-value.mjs +0 -38
  224. package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +0 -39
  225. package/dist/es/framer-motion/dist/es/value/use-spring.mjs +0 -22
  226. package/dist/es/framer-motion/dist/es/value/use-time.mjs +0 -10
  227. package/dist/es/framer-motion/dist/es/value/use-transform.mjs +0 -29
  228. package/dist/es/framer-motion/dist/es/value/use-velocity.mjs +0 -35
  229. package/dist/es/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs +0 -21
  230. package/dist/es/framer-motion/dist/es/value/use-will-change/add-will-change.mjs +0 -20
  231. package/dist/es/framer-motion/dist/es/value/use-will-change/index.mjs +0 -8
  232. package/dist/es/framer-motion/dist/es/value/use-will-change/is.mjs +0 -7
  233. package/dist/es/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +0 -12
  234. package/dist/es/motion/lib/debug.mjs +0 -1
  235. package/dist/es/motion/lib/index.mjs +0 -131
  236. package/dist/es/motion/lib/mini.mjs +0 -2
  237. package/dist/es/motion/lib/react-client.mjs +0 -3
  238. package/dist/es/motion/lib/react-m.mjs +0 -3
  239. package/dist/es/motion/lib/react-mini.mjs +0 -2
  240. package/dist/es/motion/lib/react.mjs +0 -204
  241. package/dist/es/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs +0 -175
  242. package/dist/es/motion-dom/dist/es/animation/GroupAnimation.mjs +0 -72
  243. package/dist/es/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs +0 -9
  244. package/dist/es/motion-dom/dist/es/animation/JSAnimation.mjs +0 -348
  245. package/dist/es/motion-dom/dist/es/animation/NativeAnimation.mjs +0 -158
  246. package/dist/es/motion-dom/dist/es/animation/NativeAnimationExtended.mjs +0 -65
  247. package/dist/es/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs +0 -14
  248. package/dist/es/motion-dom/dist/es/animation/drivers/frame.mjs +0 -17
  249. package/dist/es/motion-dom/dist/es/animation/generators/inertia.mjs +0 -87
  250. package/dist/es/motion-dom/dist/es/animation/generators/keyframes.mjs +0 -51
  251. package/dist/es/motion-dom/dist/es/animation/generators/spring/defaults.mjs +0 -27
  252. package/dist/es/motion-dom/dist/es/animation/generators/spring/find.mjs +0 -86
  253. package/dist/es/motion-dom/dist/es/animation/generators/spring/index.mjs +0 -176
  254. package/dist/es/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs +0 -17
  255. package/dist/es/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs +0 -19
  256. package/dist/es/motion-dom/dist/es/animation/generators/utils/is-generator.mjs +0 -5
  257. package/dist/es/motion-dom/dist/es/animation/generators/utils/velocity.mjs +0 -9
  258. package/dist/es/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs +0 -131
  259. package/dist/es/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs +0 -147
  260. package/dist/es/motion-dom/dist/es/animation/keyframes/get-final.mjs +0 -11
  261. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/default.mjs +0 -9
  262. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs +0 -12
  263. package/dist/es/motion-dom/dist/es/animation/keyframes/offsets/time.mjs +0 -5
  264. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs +0 -11
  265. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs +0 -7
  266. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs +0 -15
  267. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs +0 -30
  268. package/dist/es/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs +0 -36
  269. package/dist/es/motion-dom/dist/es/animation/utils/WithPromise.mjs +0 -26
  270. package/dist/es/motion-dom/dist/es/animation/utils/active-animations.mjs +0 -9
  271. package/dist/es/motion-dom/dist/es/animation/utils/can-animate.mjs +0 -42
  272. package/dist/es/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs +0 -42
  273. package/dist/es/motion-dom/dist/es/animation/utils/get-value-transition.mjs +0 -7
  274. package/dist/es/motion-dom/dist/es/animation/utils/is-animatable.mjs +0 -30
  275. package/dist/es/motion-dom/dist/es/animation/utils/is-css-variable.mjs +0 -15
  276. package/dist/es/motion-dom/dist/es/animation/utils/replace-transition-type.mjs +0 -18
  277. package/dist/es/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs +0 -3
  278. package/dist/es/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs +0 -14
  279. package/dist/es/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs +0 -28
  280. package/dist/es/motion-dom/dist/es/animation/waapi/easing/supported.mjs +0 -15
  281. package/dist/es/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs +0 -39
  282. package/dist/es/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs +0 -13
  283. package/dist/es/motion-dom/dist/es/animation/waapi/supports/waapi.mjs +0 -37
  284. package/dist/es/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs +0 -14
  285. package/dist/es/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs +0 -15
  286. package/dist/es/motion-dom/dist/es/animation/waapi/utils/linear.mjs +0 -12
  287. package/dist/es/motion-dom/dist/es/animation/waapi/utils/px-values.mjs +0 -39
  288. package/dist/es/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs +0 -20
  289. package/dist/es/motion-dom/dist/es/effects/MotionValueState.mjs +0 -47
  290. package/dist/es/motion-dom/dist/es/effects/attr/index.mjs +0 -41
  291. package/dist/es/motion-dom/dist/es/effects/prop/index.mjs +0 -9
  292. package/dist/es/motion-dom/dist/es/effects/style/index.mjs +0 -52
  293. package/dist/es/motion-dom/dist/es/effects/style/transform.mjs +0 -38
  294. package/dist/es/motion-dom/dist/es/effects/svg/index.mjs +0 -41
  295. package/dist/es/motion-dom/dist/es/effects/utils/create-dom-effect.mjs +0 -18
  296. package/dist/es/motion-dom/dist/es/effects/utils/create-effect.mjs +0 -21
  297. package/dist/es/motion-dom/dist/es/frameloop/batcher.mjs +0 -71
  298. package/dist/es/motion-dom/dist/es/frameloop/frame.mjs +0 -6
  299. package/dist/es/motion-dom/dist/es/frameloop/index-legacy.mjs +0 -20
  300. package/dist/es/motion-dom/dist/es/frameloop/microtask.mjs +0 -6
  301. package/dist/es/motion-dom/dist/es/frameloop/order.mjs +0 -12
  302. package/dist/es/motion-dom/dist/es/frameloop/render-step.mjs +0 -92
  303. package/dist/es/motion-dom/dist/es/frameloop/sync-time.mjs +0 -31
  304. package/dist/es/motion-dom/dist/es/gestures/drag/state/is-active.mjs +0 -9
  305. package/dist/es/motion-dom/dist/es/gestures/drag/state/set-active.mjs +0 -28
  306. package/dist/es/motion-dom/dist/es/gestures/hover.mjs +0 -37
  307. package/dist/es/motion-dom/dist/es/gestures/press/index.mjs +0 -83
  308. package/dist/es/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs +0 -13
  309. package/dist/es/motion-dom/dist/es/gestures/press/utils/keyboard.mjs +0 -38
  310. package/dist/es/motion-dom/dist/es/gestures/press/utils/state.mjs +0 -3
  311. package/dist/es/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs +0 -20
  312. package/dist/es/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs +0 -18
  313. package/dist/es/motion-dom/dist/es/gestures/utils/setup.mjs +0 -15
  314. package/dist/es/motion-dom/dist/es/render/dom/is-css-var.mjs +0 -3
  315. package/dist/es/motion-dom/dist/es/render/dom/parse-transform.mjs +0 -83
  316. package/dist/es/motion-dom/dist/es/render/dom/style-computed.mjs +0 -10
  317. package/dist/es/motion-dom/dist/es/render/dom/style-set.mjs +0 -9
  318. package/dist/es/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs +0 -5
  319. package/dist/es/motion-dom/dist/es/render/utils/keys-position.mjs +0 -13
  320. package/dist/es/motion-dom/dist/es/render/utils/keys-transform.mjs +0 -28
  321. package/dist/es/motion-dom/dist/es/resize/handle-element.mjs +0 -63
  322. package/dist/es/motion-dom/dist/es/resize/handle-window.mjs +0 -31
  323. package/dist/es/motion-dom/dist/es/resize/index.mjs +0 -8
  324. package/dist/es/motion-dom/dist/es/scroll/observe.mjs +0 -18
  325. package/dist/es/motion-dom/dist/es/stats/animation-count.mjs +0 -7
  326. package/dist/es/motion-dom/dist/es/stats/buffer.mjs +0 -6
  327. package/dist/es/motion-dom/dist/es/stats/index.mjs +0 -117
  328. package/dist/es/motion-dom/dist/es/utils/interpolate.mjs +0 -79
  329. package/dist/es/motion-dom/dist/es/utils/is-html-element.mjs +0 -11
  330. package/dist/es/motion-dom/dist/es/utils/is-svg-element.mjs +0 -11
  331. package/dist/es/motion-dom/dist/es/utils/is-svg-svg-element.mjs +0 -11
  332. package/dist/es/motion-dom/dist/es/utils/mix/color.mjs +0 -47
  333. package/dist/es/motion-dom/dist/es/utils/mix/complex.mjs +0 -93
  334. package/dist/es/motion-dom/dist/es/utils/mix/immediate.mjs +0 -5
  335. package/dist/es/motion-dom/dist/es/utils/mix/index.mjs +0 -14
  336. package/dist/es/motion-dom/dist/es/utils/mix/number.mjs +0 -26
  337. package/dist/es/motion-dom/dist/es/utils/mix/visibility.mjs +0 -16
  338. package/dist/es/motion-dom/dist/es/utils/resolve-elements.mjs +0 -17
  339. package/dist/es/motion-dom/dist/es/utils/supports/flags.mjs +0 -7
  340. package/dist/es/motion-dom/dist/es/utils/supports/linear-easing.mjs +0 -15
  341. package/dist/es/motion-dom/dist/es/utils/supports/memo.mjs +0 -9
  342. package/dist/es/motion-dom/dist/es/utils/supports/scroll-timeline.mjs +0 -5
  343. package/dist/es/motion-dom/dist/es/utils/transform.mjs +0 -14
  344. package/dist/es/motion-dom/dist/es/value/index.mjs +0 -329
  345. package/dist/es/motion-dom/dist/es/value/map-value.mjs +0 -46
  346. package/dist/es/motion-dom/dist/es/value/spring-value.mjs +0 -72
  347. package/dist/es/motion-dom/dist/es/value/subscribe-value.mjs +0 -13
  348. package/dist/es/motion-dom/dist/es/value/transform-value.mjs +0 -35
  349. package/dist/es/motion-dom/dist/es/value/types/auto.mjs +0 -9
  350. package/dist/es/motion-dom/dist/es/value/types/color/hex.mjs +0 -40
  351. package/dist/es/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs +0 -42
  352. package/dist/es/motion-dom/dist/es/value/types/color/hsla.mjs +0 -22
  353. package/dist/es/motion-dom/dist/es/value/types/color/index.mjs +0 -32
  354. package/dist/es/motion-dom/dist/es/value/types/color/rgba.mjs +0 -25
  355. package/dist/es/motion-dom/dist/es/value/types/color/utils.mjs +0 -29
  356. package/dist/es/motion-dom/dist/es/value/types/complex/filter.mjs +0 -30
  357. package/dist/es/motion-dom/dist/es/value/types/complex/index.mjs +0 -91
  358. package/dist/es/motion-dom/dist/es/value/types/dimensions.mjs +0 -15
  359. package/dist/es/motion-dom/dist/es/value/types/int.mjs +0 -8
  360. package/dist/es/motion-dom/dist/es/value/types/maps/defaults.mjs +0 -30
  361. package/dist/es/motion-dom/dist/es/value/types/maps/number.mjs +0 -50
  362. package/dist/es/motion-dom/dist/es/value/types/maps/transform.mjs +0 -31
  363. package/dist/es/motion-dom/dist/es/value/types/numbers/index.mjs +0 -17
  364. package/dist/es/motion-dom/dist/es/value/types/numbers/units.mjs +0 -18
  365. package/dist/es/motion-dom/dist/es/value/types/test.mjs +0 -6
  366. package/dist/es/motion-dom/dist/es/value/types/utils/animatable-none.mjs +0 -15
  367. package/dist/es/motion-dom/dist/es/value/types/utils/color-regex.mjs +0 -3
  368. package/dist/es/motion-dom/dist/es/value/types/utils/find.mjs +0 -15
  369. package/dist/es/motion-dom/dist/es/value/types/utils/float-regex.mjs +0 -3
  370. package/dist/es/motion-dom/dist/es/value/types/utils/get-as-type.mjs +0 -10
  371. package/dist/es/motion-dom/dist/es/value/types/utils/is-nullish.mjs +0 -5
  372. package/dist/es/motion-dom/dist/es/value/types/utils/sanitize.mjs +0 -5
  373. package/dist/es/motion-dom/dist/es/value/types/utils/single-color-regex.mjs +0 -3
  374. package/dist/es/motion-dom/dist/es/value/utils/is-motion-value.mjs +0 -3
  375. package/dist/es/motion-dom/dist/es/view/index.mjs +0 -64
  376. package/dist/es/motion-dom/dist/es/view/queue.mjs +0 -52
  377. package/dist/es/motion-dom/dist/es/view/start.mjs +0 -155
  378. package/dist/es/motion-dom/dist/es/view/utils/choose-layer-type.mjs +0 -11
  379. package/dist/es/motion-dom/dist/es/view/utils/css.mjs +0 -32
  380. package/dist/es/motion-dom/dist/es/view/utils/get-layer-name.mjs +0 -8
  381. package/dist/es/motion-dom/dist/es/view/utils/get-view-animations.mjs +0 -12
  382. package/dist/es/motion-dom/dist/es/view/utils/has-target.mjs +0 -5
  383. package/dist/es/motion-utils/dist/es/array.mjs +0 -21
  384. package/dist/es/motion-utils/dist/es/clamp.mjs +0 -9
  385. package/dist/es/motion-utils/dist/es/easing/anticipate.mjs +0 -5
  386. package/dist/es/motion-utils/dist/es/easing/back.mjs +0 -9
  387. package/dist/es/motion-utils/dist/es/easing/circ.mjs +0 -8
  388. package/dist/es/motion-utils/dist/es/easing/cubic-bezier.mjs +0 -51
  389. package/dist/es/motion-utils/dist/es/easing/ease.mjs +0 -7
  390. package/dist/es/motion-utils/dist/es/easing/modifiers/mirror.mjs +0 -5
  391. package/dist/es/motion-utils/dist/es/easing/modifiers/reverse.mjs +0 -5
  392. package/dist/es/motion-utils/dist/es/easing/steps.mjs +0 -15
  393. package/dist/es/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs +0 -8
  394. package/dist/es/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs +0 -3
  395. package/dist/es/motion-utils/dist/es/easing/utils/is-easing-array.mjs +0 -5
  396. package/dist/es/motion-utils/dist/es/easing/utils/map.mjs +0 -41
  397. package/dist/es/motion-utils/dist/es/errors.mjs +0 -16
  398. package/dist/es/motion-utils/dist/es/global-config.mjs +0 -3
  399. package/dist/es/motion-utils/dist/es/is-numerical-string.mjs +0 -6
  400. package/dist/es/motion-utils/dist/es/is-object.mjs +0 -5
  401. package/dist/es/motion-utils/dist/es/is-zero-value-string.mjs +0 -6
  402. package/dist/es/motion-utils/dist/es/memo.mjs +0 -11
  403. package/dist/es/motion-utils/dist/es/noop.mjs +0 -4
  404. package/dist/es/motion-utils/dist/es/pipe.mjs +0 -11
  405. package/dist/es/motion-utils/dist/es/progress.mjs +0 -19
  406. package/dist/es/motion-utils/dist/es/subscription-manager.mjs +0 -40
  407. package/dist/es/motion-utils/dist/es/time-conversion.mjs +0 -12
  408. package/dist/es/motion-utils/dist/es/velocity-per-second.mjs +0 -11
  409. package/dist/es/motion-utils/dist/es/warn-once.mjs +0 -14
  410. package/dist/es/motion-utils/dist/es/wrap.mjs +0 -6
@@ -1,18 +0,0 @@
1
- import { inertia } from '../generators/inertia.mjs';
2
- import { keyframes } from '../generators/keyframes.mjs';
3
- import { spring } from '../generators/spring/index.mjs';
4
-
5
- const transitionTypeMap = {
6
- decay: inertia,
7
- inertia,
8
- tween: keyframes,
9
- keyframes: keyframes,
10
- spring,
11
- };
12
- function replaceTransitionType(transition) {
13
- if (typeof transition.type === "string") {
14
- transition.type = transitionTypeMap[transition.type];
15
- }
16
- }
17
-
18
- export { replaceTransitionType };
@@ -1,3 +0,0 @@
1
- const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
2
-
3
- export { cubicBezierAsString };
@@ -1,14 +0,0 @@
1
- import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
2
- import { supportedWaapiEasing } from './supported.mjs';
3
- import { isBezierDefinition } from '../../../../../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs';
4
-
5
- function isWaapiSupportedEasing(easing) {
6
- return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
7
- !easing ||
8
- (typeof easing === "string" &&
9
- (easing in supportedWaapiEasing || supportsLinearEasing())) ||
10
- isBezierDefinition(easing) ||
11
- (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
12
- }
13
-
14
- export { isWaapiSupportedEasing };
@@ -1,28 +0,0 @@
1
- import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
2
- import { generateLinearEasing } from '../utils/linear.mjs';
3
- import { cubicBezierAsString } from './cubic-bezier.mjs';
4
- import { supportedWaapiEasing } from './supported.mjs';
5
- import { isBezierDefinition } from '../../../../../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs';
6
-
7
- function mapEasingToNativeEasing(easing, duration) {
8
- if (!easing) {
9
- return undefined;
10
- }
11
- else if (typeof easing === "function") {
12
- return supportsLinearEasing()
13
- ? generateLinearEasing(easing, duration)
14
- : "ease-out";
15
- }
16
- else if (isBezierDefinition(easing)) {
17
- return cubicBezierAsString(easing);
18
- }
19
- else if (Array.isArray(easing)) {
20
- return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||
21
- supportedWaapiEasing.easeOut);
22
- }
23
- else {
24
- return supportedWaapiEasing[easing];
25
- }
26
- }
27
-
28
- export { mapEasingToNativeEasing };
@@ -1,15 +0,0 @@
1
- import { cubicBezierAsString } from './cubic-bezier.mjs';
2
-
3
- const supportedWaapiEasing = {
4
- linear: "linear",
5
- ease: "ease",
6
- easeIn: "ease-in",
7
- easeOut: "ease-out",
8
- easeInOut: "ease-in-out",
9
- circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),
10
- circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),
11
- backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
12
- backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
13
- };
14
-
15
- export { supportedWaapiEasing };
@@ -1,39 +0,0 @@
1
- import { activeAnimations } from '../../stats/animation-count.mjs';
2
- import { statsBuffer } from '../../stats/buffer.mjs';
3
- import { mapEasingToNativeEasing } from './easing/map-easing.mjs';
4
-
5
- function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) {
6
- const keyframeOptions = {
7
- [valueName]: keyframes,
8
- };
9
- if (times)
10
- keyframeOptions.offset = times;
11
- const easing = mapEasingToNativeEasing(ease, duration);
12
- /**
13
- * If this is an easing array, apply to keyframes, not animation as a whole
14
- */
15
- if (Array.isArray(easing))
16
- keyframeOptions.easing = easing;
17
- if (statsBuffer.value) {
18
- activeAnimations.waapi++;
19
- }
20
- const options = {
21
- delay,
22
- duration,
23
- easing: !Array.isArray(easing) ? easing : "linear",
24
- fill: "both",
25
- iterations: repeat + 1,
26
- direction: repeatType === "reverse" ? "alternate" : "normal",
27
- };
28
- if (pseudoElement)
29
- options.pseudoElement = pseudoElement;
30
- const animation = element.animate(keyframeOptions, options);
31
- if (statsBuffer.value) {
32
- animation.finished.finally(() => {
33
- activeAnimations.waapi--;
34
- });
35
- }
36
- return animation;
37
- }
38
-
39
- export { startWaapiAnimation };
@@ -1,13 +0,0 @@
1
- import { memo } from '../../../../../../motion-utils/dist/es/memo.mjs';
2
-
3
- const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {
4
- try {
5
- document.createElement("div").animate({ opacity: [1] });
6
- }
7
- catch (e) {
8
- return false;
9
- }
10
- return true;
11
- });
12
-
13
- export { supportsPartialKeyframes };
@@ -1,37 +0,0 @@
1
- import { isHTMLElement } from '../../../utils/is-html-element.mjs';
2
- import { memo } from '../../../../../../motion-utils/dist/es/memo.mjs';
3
-
4
- /**
5
- * A list of values that can be hardware-accelerated.
6
- */
7
- const acceleratedValues = new Set([
8
- "opacity",
9
- "clipPath",
10
- "filter",
11
- "transform",
12
- // TODO: Could be re-enabled now we have support for linear() easing
13
- // "background-color"
14
- ]);
15
- const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
16
- function supportsBrowserAnimation(options) {
17
- const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
18
- if (!isHTMLElement(motionValue?.owner?.current)) {
19
- return false;
20
- }
21
- const { onUpdate, transformTemplate } = motionValue.owner.getProps();
22
- return (supportsWaapi() &&
23
- name &&
24
- acceleratedValues.has(name) &&
25
- (name !== "transform" || !transformTemplate) &&
26
- /**
27
- * If we're outputting values to onUpdate then we can't use WAAPI as there's
28
- * no way to read the value from WAAPI every frame.
29
- */
30
- !onUpdate &&
31
- !repeatDelay &&
32
- repeatType !== "mirror" &&
33
- damping !== 0 &&
34
- type !== "inertia");
35
- }
36
-
37
- export { supportsBrowserAnimation };
@@ -1,14 +0,0 @@
1
- /**
2
- * A list of values that can be hardware-accelerated.
3
- */
4
- const acceleratedValues = new Set([
5
- "opacity",
6
- "clipPath",
7
- "filter",
8
- "transform",
9
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
10
- // or until we implement support for linear() easing.
11
- // "background-color"
12
- ]);
13
-
14
- export { acceleratedValues };
@@ -1,15 +0,0 @@
1
- import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
2
- import { isGenerator } from '../../generators/utils/is-generator.mjs';
3
-
4
- function applyGeneratorOptions({ type, ...options }) {
5
- if (isGenerator(type) && supportsLinearEasing()) {
6
- return type.applyToOptions(options);
7
- }
8
- else {
9
- options.duration ?? (options.duration = 300);
10
- options.ease ?? (options.ease = "easeOut");
11
- }
12
- return options;
13
- }
14
-
15
- export { applyGeneratorOptions };
@@ -1,12 +0,0 @@
1
- const generateLinearEasing = (easing, duration, // as milliseconds
2
- resolution = 10 // as milliseconds
3
- ) => {
4
- let points = "";
5
- const numPoints = Math.max(Math.round(duration / resolution), 2);
6
- for (let i = 0; i < numPoints; i++) {
7
- points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", ";
8
- }
9
- return `linear(${points.substring(0, points.length - 2)})`;
10
- };
11
-
12
- export { generateLinearEasing };
@@ -1,39 +0,0 @@
1
- const pxValues = new Set([
2
- // Border props
3
- "borderWidth",
4
- "borderTopWidth",
5
- "borderRightWidth",
6
- "borderBottomWidth",
7
- "borderLeftWidth",
8
- "borderRadius",
9
- "radius",
10
- "borderTopLeftRadius",
11
- "borderTopRightRadius",
12
- "borderBottomRightRadius",
13
- "borderBottomLeftRadius",
14
- // Positioning props
15
- "width",
16
- "maxWidth",
17
- "height",
18
- "maxHeight",
19
- "top",
20
- "right",
21
- "bottom",
22
- "left",
23
- // Spacing props
24
- "padding",
25
- "paddingTop",
26
- "paddingRight",
27
- "paddingBottom",
28
- "paddingLeft",
29
- "margin",
30
- "marginTop",
31
- "marginRight",
32
- "marginBottom",
33
- "marginLeft",
34
- // Misc
35
- "backgroundPositionX",
36
- "backgroundPositionY",
37
- ]);
38
-
39
- export { pxValues };
@@ -1,20 +0,0 @@
1
- import { anticipate } from '../../../../../../motion-utils/dist/es/easing/anticipate.mjs';
2
- import { backInOut } from '../../../../../../motion-utils/dist/es/easing/back.mjs';
3
- import { circInOut } from '../../../../../../motion-utils/dist/es/easing/circ.mjs';
4
-
5
- const unsupportedEasingFunctions = {
6
- anticipate,
7
- backInOut,
8
- circInOut,
9
- };
10
- function isUnsupportedEase(key) {
11
- return key in unsupportedEasingFunctions;
12
- }
13
- function replaceStringEasing(transition) {
14
- if (typeof transition.ease === "string" &&
15
- isUnsupportedEase(transition.ease)) {
16
- transition.ease = unsupportedEasingFunctions[transition.ease];
17
- }
18
- }
19
-
20
- export { replaceStringEasing };
@@ -1,47 +0,0 @@
1
- import { frame, cancelFrame } from '../frameloop/frame.mjs';
2
- import { numberValueTypes } from '../value/types/maps/number.mjs';
3
- import { getValueAsType } from '../value/types/utils/get-as-type.mjs';
4
-
5
- class MotionValueState {
6
- constructor() {
7
- this.latest = {};
8
- this.values = new Map();
9
- }
10
- set(name, value, render, computed, useDefaultValueType = true) {
11
- const existingValue = this.values.get(name);
12
- if (existingValue) {
13
- existingValue.onRemove();
14
- }
15
- const onChange = () => {
16
- const v = value.get();
17
- if (useDefaultValueType) {
18
- this.latest[name] = getValueAsType(v, numberValueTypes[name]);
19
- }
20
- else {
21
- this.latest[name] = v;
22
- }
23
- render && frame.render(render);
24
- };
25
- onChange();
26
- const cancelOnChange = value.on("change", onChange);
27
- computed && value.addDependent(computed);
28
- const remove = () => {
29
- cancelOnChange();
30
- render && cancelFrame(render);
31
- this.values.delete(name);
32
- computed && value.removeDependent(computed);
33
- };
34
- this.values.set(name, { value, onRemove: remove });
35
- return remove;
36
- }
37
- get(name) {
38
- return this.values.get(name)?.value;
39
- }
40
- destroy() {
41
- for (const value of this.values.values()) {
42
- value.onRemove();
43
- }
44
- }
45
- }
46
-
47
- export { MotionValueState };
@@ -1,41 +0,0 @@
1
- import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';
2
- import { createSelectorEffect } from '../utils/create-dom-effect.mjs';
3
- import { createEffect } from '../utils/create-effect.mjs';
4
-
5
- function canSetAsProperty(element, name) {
6
- if (!(name in element))
7
- return false;
8
- const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||
9
- Object.getOwnPropertyDescriptor(element, name);
10
- // Check if it has a setter
11
- return descriptor && typeof descriptor.set === "function";
12
- }
13
- const addAttrValue = (element, state, key, value) => {
14
- const isProp = canSetAsProperty(element, key);
15
- const name = isProp
16
- ? key
17
- : key.startsWith("data") || key.startsWith("aria")
18
- ? camelToDash(key)
19
- : key;
20
- /**
21
- * Set attribute directly via property if available
22
- */
23
- const render = isProp
24
- ? () => {
25
- element[name] = state.latest[key];
26
- }
27
- : () => {
28
- const v = state.latest[key];
29
- if (v === null || v === undefined) {
30
- element.removeAttribute(name);
31
- }
32
- else {
33
- element.setAttribute(name, String(v));
34
- }
35
- };
36
- return state.set(key, value, render);
37
- };
38
- const attrEffect = /*@__PURE__*/ createSelectorEffect(
39
- /*@__PURE__*/ createEffect(addAttrValue));
40
-
41
- export { addAttrValue, attrEffect };
@@ -1,9 +0,0 @@
1
- import { createEffect } from '../utils/create-effect.mjs';
2
-
3
- const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => {
4
- return state.set(key, value, () => {
5
- subject[key] = state.latest[key];
6
- }, undefined, false);
7
- });
8
-
9
- export { propEffect };
@@ -1,52 +0,0 @@
1
- import { isCSSVar } from '../../render/dom/is-css-var.mjs';
2
- import { transformProps } from '../../render/utils/keys-transform.mjs';
3
- import { isHTMLElement } from '../../utils/is-html-element.mjs';
4
- import { MotionValue } from '../../value/index.mjs';
5
- import { createSelectorEffect } from '../utils/create-dom-effect.mjs';
6
- import { createEffect } from '../utils/create-effect.mjs';
7
- import { buildTransform } from './transform.mjs';
8
-
9
- const originProps = new Set(["originX", "originY", "originZ"]);
10
- const addStyleValue = (element, state, key, value) => {
11
- let render = undefined;
12
- let computed = undefined;
13
- if (transformProps.has(key)) {
14
- if (!state.get("transform")) {
15
- // If this is an HTML element, we need to set the transform-box to fill-box
16
- // to normalise the transform relative to the element's bounding box
17
- if (!isHTMLElement(element) && !state.get("transformBox")) {
18
- addStyleValue(element, state, "transformBox", new MotionValue("fill-box"));
19
- }
20
- state.set("transform", new MotionValue("none"), () => {
21
- element.style.transform = buildTransform(state);
22
- });
23
- }
24
- computed = state.get("transform");
25
- }
26
- else if (originProps.has(key)) {
27
- if (!state.get("transformOrigin")) {
28
- state.set("transformOrigin", new MotionValue(""), () => {
29
- const originX = state.latest.originX ?? "50%";
30
- const originY = state.latest.originY ?? "50%";
31
- const originZ = state.latest.originZ ?? 0;
32
- element.style.transformOrigin = `${originX} ${originY} ${originZ}`;
33
- });
34
- }
35
- computed = state.get("transformOrigin");
36
- }
37
- else if (isCSSVar(key)) {
38
- render = () => {
39
- element.style.setProperty(key, state.latest[key]);
40
- };
41
- }
42
- else {
43
- render = () => {
44
- element.style[key] = state.latest[key];
45
- };
46
- }
47
- return state.set(key, value, render, computed);
48
- };
49
- const styleEffect = /*@__PURE__*/ createSelectorEffect(
50
- /*@__PURE__*/ createEffect(addStyleValue));
51
-
52
- export { addStyleValue, styleEffect };
@@ -1,38 +0,0 @@
1
- import { transformPropOrder } from '../../render/utils/keys-transform.mjs';
2
-
3
- const translateAlias = {
4
- x: "translateX",
5
- y: "translateY",
6
- z: "translateZ",
7
- transformPerspective: "perspective",
8
- };
9
- function buildTransform(state) {
10
- let transform = "";
11
- let transformIsDefault = true;
12
- /**
13
- * Loop over all possible transforms in order, adding the ones that
14
- * are present to the transform string.
15
- */
16
- for (let i = 0; i < transformPropOrder.length; i++) {
17
- const key = transformPropOrder[i];
18
- const value = state.latest[key];
19
- if (value === undefined)
20
- continue;
21
- let valueIsDefault = true;
22
- if (typeof value === "number") {
23
- valueIsDefault = value === (key.startsWith("scale") ? 1 : 0);
24
- }
25
- else {
26
- valueIsDefault = parseFloat(value) === 0;
27
- }
28
- if (!valueIsDefault) {
29
- transformIsDefault = false;
30
- const transformName = translateAlias[key] || key;
31
- const valueToRender = state.latest[key];
32
- transform += `${transformName}(${valueToRender}) `;
33
- }
34
- }
35
- return transformIsDefault ? "none" : transform.trim();
36
- }
37
-
38
- export { buildTransform };
@@ -1,41 +0,0 @@
1
- import { MotionValue } from '../../value/index.mjs';
2
- import { px } from '../../value/types/numbers/units.mjs';
3
- import { addAttrValue } from '../attr/index.mjs';
4
- import { addStyleValue } from '../style/index.mjs';
5
- import { createSelectorEffect } from '../utils/create-dom-effect.mjs';
6
- import { createEffect } from '../utils/create-effect.mjs';
7
- import { frame } from '../../frameloop/frame.mjs';
8
-
9
- const toPx = px.transform;
10
- function addSVGPathValue(element, state, key, value) {
11
- frame.render(() => element.setAttribute("pathLength", "1"));
12
- if (key === "pathOffset") {
13
- return state.set(key, value, () => element.setAttribute("stroke-dashoffset", toPx(-state.latest[key])));
14
- }
15
- else {
16
- if (!state.get("stroke-dasharray")) {
17
- state.set("stroke-dasharray", new MotionValue("1 1"), () => {
18
- const { pathLength = 1, pathSpacing } = state.latest;
19
- element.setAttribute("stroke-dasharray", `${toPx(pathLength)} ${toPx(pathSpacing ?? 1 - Number(pathLength))}`);
20
- });
21
- }
22
- return state.set(key, value, undefined, state.get("stroke-dasharray"));
23
- }
24
- }
25
- const addSVGValue = (element, state, key, value) => {
26
- if (key.startsWith("path")) {
27
- return addSVGPathValue(element, state, key, value);
28
- }
29
- else if (key.startsWith("attr")) {
30
- return addAttrValue(element, state, convertAttrKey(key), value);
31
- }
32
- const handler = key in element.style ? addStyleValue : addAttrValue;
33
- return handler(element, state, key, value);
34
- };
35
- const svgEffect = /*@__PURE__*/ createSelectorEffect(
36
- /*@__PURE__*/ createEffect(addSVGValue));
37
- function convertAttrKey(key) {
38
- return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase());
39
- }
40
-
41
- export { svgEffect };
@@ -1,18 +0,0 @@
1
- import { resolveElements } from '../../utils/resolve-elements.mjs';
2
-
3
- function createSelectorEffect(subjectEffect) {
4
- return (subject, values) => {
5
- const elements = resolveElements(subject);
6
- const subscriptions = [];
7
- for (const element of elements) {
8
- const remove = subjectEffect(element, values);
9
- subscriptions.push(remove);
10
- }
11
- return () => {
12
- for (const remove of subscriptions)
13
- remove();
14
- };
15
- };
16
- }
17
-
18
- export { createSelectorEffect };
@@ -1,21 +0,0 @@
1
- import { MotionValueState } from '../MotionValueState.mjs';
2
-
3
- function createEffect(addValue) {
4
- const stateCache = new WeakMap();
5
- const subscriptions = [];
6
- return (subject, values) => {
7
- const state = stateCache.get(subject) ?? new MotionValueState();
8
- stateCache.set(subject, state);
9
- for (const key in values) {
10
- const value = values[key];
11
- const remove = addValue(subject, state, key, value);
12
- subscriptions.push(remove);
13
- }
14
- return () => {
15
- for (const cancel of subscriptions)
16
- cancel();
17
- };
18
- };
19
- }
20
-
21
- export { createEffect };
@@ -1,71 +0,0 @@
1
- import { stepsOrder } from './order.mjs';
2
- import { createRenderStep } from './render-step.mjs';
3
- import { MotionGlobalConfig } from '../../../../motion-utils/dist/es/global-config.mjs';
4
-
5
- const maxElapsed = 40;
6
- function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
7
- let runNextFrame = false;
8
- let useDefaultElapsed = true;
9
- const state = {
10
- delta: 0.0,
11
- timestamp: 0.0,
12
- isProcessing: false,
13
- };
14
- const flagRunNextFrame = () => (runNextFrame = true);
15
- const steps = stepsOrder.reduce((acc, key) => {
16
- acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);
17
- return acc;
18
- }, {});
19
- const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;
20
- const processBatch = () => {
21
- const timestamp = MotionGlobalConfig.useManualTiming
22
- ? state.timestamp
23
- : performance.now();
24
- runNextFrame = false;
25
- if (!MotionGlobalConfig.useManualTiming) {
26
- state.delta = useDefaultElapsed
27
- ? 1000 / 60
28
- : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);
29
- }
30
- state.timestamp = timestamp;
31
- state.isProcessing = true;
32
- // Unrolled render loop for better per-frame performance
33
- setup.process(state);
34
- read.process(state);
35
- resolveKeyframes.process(state);
36
- preUpdate.process(state);
37
- update.process(state);
38
- preRender.process(state);
39
- render.process(state);
40
- postRender.process(state);
41
- state.isProcessing = false;
42
- if (runNextFrame && allowKeepAlive) {
43
- useDefaultElapsed = false;
44
- scheduleNextBatch(processBatch);
45
- }
46
- };
47
- const wake = () => {
48
- runNextFrame = true;
49
- useDefaultElapsed = true;
50
- if (!state.isProcessing) {
51
- scheduleNextBatch(processBatch);
52
- }
53
- };
54
- const schedule = stepsOrder.reduce((acc, key) => {
55
- const step = steps[key];
56
- acc[key] = (process, keepAlive = false, immediate = false) => {
57
- if (!runNextFrame)
58
- wake();
59
- return step.schedule(process, keepAlive, immediate);
60
- };
61
- return acc;
62
- }, {});
63
- const cancel = (process) => {
64
- for (let i = 0; i < stepsOrder.length; i++) {
65
- steps[stepsOrder[i]].cancel(process);
66
- }
67
- };
68
- return { schedule, cancel, state, steps };
69
- }
70
-
71
- export { createRenderBatcher };
@@ -1,6 +0,0 @@
1
- import { createRenderBatcher } from './batcher.mjs';
2
- import { noop } from '../../../../motion-utils/dist/es/noop.mjs';
3
-
4
- const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
5
-
6
- export { cancelFrame, frame, frameData, frameSteps };
@@ -1,20 +0,0 @@
1
- import { stepsOrder } from './order.mjs';
2
- import { frame, cancelFrame } from './frame.mjs';
3
-
4
- /**
5
- * @deprecated
6
- *
7
- * Import as `frame` instead.
8
- */
9
- const sync = frame;
10
- /**
11
- * @deprecated
12
- *
13
- * Use cancelFrame(callback) instead.
14
- */
15
- const cancelSync = stepsOrder.reduce((acc, key) => {
16
- acc[key] = (process) => cancelFrame(process);
17
- return acc;
18
- }, {});
19
-
20
- export { cancelSync, sync };