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