@code0-tech/pictor 0.9.2 → 0.10.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 (292) hide show
  1. package/dist/assets/components/island/Island.style.css +1 -0
  2. package/dist/assets/components/resizable/Resizable.style.css +1 -1
  3. package/dist/components/breadcrumb/Breadcrumb.js +7 -7
  4. package/dist/components/button/Button.js +11 -11
  5. package/dist/components/data-table/DataTable.js +15 -15
  6. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
  7. package/dist/components/editor/Editor.js +13 -13
  8. package/dist/components/form/CheckboxInput.js +4 -4
  9. package/dist/components/form/EmailInput.js +9 -9
  10. package/dist/components/form/InputContentEditable.hook.js +11 -11
  11. package/dist/components/form/InputWrapper.js +15 -15
  12. package/dist/components/form/NumberInput.js +9 -9
  13. package/dist/components/form/PasswordInput.js +4 -4
  14. package/dist/components/form/SwitchInput.js +7 -7
  15. package/dist/components/form/TextAreaInput.js +6 -6
  16. package/dist/components/form/TextInput.js +6 -6
  17. package/dist/components/form/useForm.js +2 -2
  18. package/dist/components/fullscreen/FullScreen.js +2 -2
  19. package/dist/components/gantt/GanttGroup.js +15 -15
  20. package/dist/components/island/Island.d.ts +6 -0
  21. package/dist/components/island/Island.hook.d.ts +19 -0
  22. package/dist/components/island/Island.hook.js +58 -0
  23. package/dist/components/island/Island.js +71 -0
  24. package/dist/components/progress/Progress.js +18 -18
  25. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -0
  26. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
  27. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
  28. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
  29. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
  30. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
  31. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
  32. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
  33. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
  34. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
  35. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
  36. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +285 -0
  37. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +22 -0
  38. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +67 -0
  39. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +28 -0
  40. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +21 -0
  41. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -0
  42. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +43 -0
  43. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +29 -0
  44. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +45 -0
  45. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +33 -0
  46. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
  47. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +39 -0
  48. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
  49. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
  50. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +60 -0
  51. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
  52. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +14 -0
  53. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +45 -0
  54. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +21 -0
  55. package/dist/node_modules/framer-motion/dist/es/motion/index.js +62 -0
  56. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
  57. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +21 -0
  58. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +65 -0
  59. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +52 -0
  60. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
  61. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +18 -0
  62. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
  63. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
  64. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +10 -0
  65. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +16 -0
  66. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +21 -0
  67. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +24 -0
  68. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
  69. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +27 -0
  70. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
  71. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
  72. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +22 -0
  73. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
  74. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
  75. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +9 -0
  76. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +4 -0
  77. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
  78. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
  79. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +8 -0
  80. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
  81. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +112 -0
  82. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +144 -0
  83. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +106 -0
  84. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +38 -0
  85. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
  86. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
  87. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +37 -0
  88. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +30 -0
  89. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +178 -0
  90. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +13 -0
  91. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -0
  92. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
  93. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
  94. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +46 -0
  95. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +59 -0
  96. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +29 -0
  97. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
  98. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +68 -0
  99. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +74 -0
  100. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +8 -0
  101. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +8 -0
  102. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
  103. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
  104. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +7 -0
  105. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +7 -0
  106. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +16 -0
  107. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +37 -0
  108. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +6 -0
  109. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
  110. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
  111. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +7 -0
  112. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +23 -0
  113. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
  114. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +22 -0
  115. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +8 -0
  116. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +7 -0
  117. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +9 -0
  118. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +21 -0
  119. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +6 -0
  120. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +16 -0
  121. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
  122. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
  123. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +12 -0
  124. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
  125. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +21 -0
  126. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +33 -0
  127. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
  128. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +8 -0
  129. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +10 -0
  130. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +10 -0
  131. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +17 -0
  132. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +6 -0
  133. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -0
  134. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
  135. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
  136. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
  137. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +43 -0
  138. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +15 -0
  139. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
  140. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +11 -0
  141. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +38 -0
  142. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +34 -0
  143. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
  144. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +27 -0
  145. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
  146. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +4 -0
  147. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +4 -0
  148. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +12 -0
  149. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +32 -0
  150. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +25 -0
  151. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +14 -0
  152. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +53 -0
  153. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +38 -0
  154. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +25 -0
  155. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +18 -0
  156. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
  157. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
  158. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +25 -0
  159. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +618 -0
  160. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
  161. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +53 -0
  162. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +21 -0
  163. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +16 -0
  164. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
  165. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +13 -0
  166. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
  167. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
  168. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +19 -0
  169. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
  170. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +13 -0
  171. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +10 -0
  172. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +263 -0
  173. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +28 -0
  174. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
  175. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +65 -0
  176. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
  177. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
  178. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +37 -0
  179. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
  180. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +38 -0
  181. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +12 -0
  182. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +13 -0
  183. package/dist/node_modules/motion-dom/dist/es/render/store.js +4 -0
  184. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
  185. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
  186. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
  187. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
  188. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
  189. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +11 -0
  190. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
  191. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +143 -0
  192. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +20 -0
  193. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
  194. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
  195. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
  196. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +4 -0
  197. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
  198. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
  199. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +23 -0
  200. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +25 -0
  201. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
  202. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +5 -0
  203. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
  204. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +20 -0
  205. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +21 -0
  206. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +14 -0
  207. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +13 -0
  208. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +39 -0
  209. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +23 -0
  210. package/dist/node_modules/motion-dom/dist/es/resize/index.js +8 -0
  211. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +12 -0
  212. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +42 -0
  213. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
  214. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
  215. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
  216. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +29 -0
  217. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +51 -0
  218. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
  219. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +8 -0
  220. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +4 -0
  221. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +8 -0
  222. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +15 -0
  223. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
  224. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
  225. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
  226. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
  227. package/dist/node_modules/motion-dom/dist/es/value/index.js +212 -0
  228. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
  229. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +19 -0
  230. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +22 -0
  231. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +12 -0
  232. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +15 -0
  233. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +16 -0
  234. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +18 -0
  235. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +24 -0
  236. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +51 -0
  237. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -0
  238. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +9 -0
  239. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
  240. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +27 -0
  241. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
  242. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
  243. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +17 -0
  244. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +17 -0
  245. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
  246. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +12 -0
  247. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
  248. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +8 -0
  249. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
  250. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +4 -0
  251. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
  252. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
  253. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
  254. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
  255. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
  256. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +14 -0
  257. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
  258. package/dist/node_modules/motion-utils/dist/es/array.js +11 -0
  259. package/dist/node_modules/motion-utils/dist/es/clamp.js +4 -0
  260. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
  261. package/dist/node_modules/motion-utils/dist/es/easing/back.js +9 -0
  262. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +8 -0
  263. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +19 -0
  264. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +7 -0
  265. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
  266. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
  267. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
  268. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +4 -0
  269. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +32 -0
  270. package/dist/node_modules/motion-utils/dist/es/errors.js +14 -0
  271. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
  272. package/dist/node_modules/motion-utils/dist/es/global-config.js +4 -0
  273. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
  274. package/dist/node_modules/motion-utils/dist/es/is-object.js +4 -0
  275. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
  276. package/dist/node_modules/motion-utils/dist/es/memo.js +8 -0
  277. package/dist/node_modules/motion-utils/dist/es/noop.js +4 -0
  278. package/dist/node_modules/motion-utils/dist/es/pipe.js +4 -0
  279. package/dist/node_modules/motion-utils/dist/es/progress.js +7 -0
  280. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +29 -0
  281. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +5 -0
  282. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
  283. package/dist/node_modules/motion-utils/dist/es/warn-once.js +8 -0
  284. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
  285. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
  286. package/dist/utils/reactiveArrayService.js +4 -4
  287. package/package.json +9 -6
  288. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -25
  289. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +0 -81
  290. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +0 -55
  291. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +0 -32
  292. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +0 -58
@@ -0,0 +1,618 @@
1
+ import { animateSingleValue as lt } from "../../animation/animate/single-value.js";
2
+ import { getOptimisedAppearId as ht } from "../../animation/optimized-appear/get-appear-id.js";
3
+ import { getValueTransition as ut } from "../../animation/utils/get-value-transition.js";
4
+ import { microtask as ct } from "../../frameloop/microtask.js";
5
+ import { time as ft } from "../../frameloop/sync-time.js";
6
+ import { scaleCorrectors as z } from "../styles/scale-correction.js";
7
+ import { delay as dt } from "../../utils/delay.js";
8
+ import { isSVGElement as mt } from "../../utils/is-svg-element.js";
9
+ import { isSVGSVGElement as pt } from "../../utils/is-svg-svg-element.js";
10
+ import { mixNumber as L } from "../../utils/mix/number.js";
11
+ import { motionValue as yt } from "../../value/index.js";
12
+ import { resolveMotionValue as C } from "../../value/utils/resolve-motion-value.js";
13
+ import { mixValues as gt } from "../animation/mix-values.js";
14
+ import { copyBoxInto as p, copyAxisDeltaInto as W, copyAxisInto as vt } from "../geometry/copy.js";
15
+ import { translateAxis as R, transformBox as F, applyBoxDelta as Tt, applyTreeDeltas as xt } from "../geometry/delta-apply.js";
16
+ import { calcLength as j, calcRelativeBox as Dt, calcRelativePosition as U, calcBoxDelta as w, isNear as Pt } from "../geometry/delta-calc.js";
17
+ import { removeBoxTransforms as N } from "../geometry/delta-remove.js";
18
+ import { createBox as f, createDelta as k } from "../geometry/models.js";
19
+ import { boxEqualsRounded as it, isDeltaZero as st, axisDeltaEquals as H, boxEquals as Bt, aspectRatio as G } from "../geometry/utils.js";
20
+ import { NodeStack as St } from "../shared/stack.js";
21
+ import { buildProjectionTransform as At } from "../styles/transform.js";
22
+ import { eachAxis as q } from "../utils/each-axis.js";
23
+ import { FlatTree as Rt } from "../utils/flat-tree.js";
24
+ import { hasTransform as V, hasScale as X, has2DTranslate as Vt } from "../utils/has-transform.js";
25
+ import { globalProjectionState as O } from "./state.js";
26
+ import { frame as E, cancelFrame as Y, frameSteps as I, frameData as y } from "../../frameloop/frame.js";
27
+ import { SubscriptionManager as jt } from "../../../../../motion-utils/dist/es/subscription-manager.js";
28
+ import { clamp as kt } from "../../../../../motion-utils/dist/es/clamp.js";
29
+ import { noop as Lt } from "../../../../../motion-utils/dist/es/noop.js";
30
+ const M = ["", "X", "Y", "Z"], Et = 1e3;
31
+ let wt = 0;
32
+ function b(e, l, h, c) {
33
+ const { latestValues: m } = l;
34
+ m[e] && (h[e] = m[e], l.setStaticValue(e, 0), c && (c[e] = 0));
35
+ }
36
+ function ot(e) {
37
+ if (e.hasCheckedOptimisedAppear = !0, e.root === e)
38
+ return;
39
+ const { visualElement: l } = e.options;
40
+ if (!l)
41
+ return;
42
+ const h = ht(l);
43
+ if (window.MotionHasOptimisedAnimation(h, "transform")) {
44
+ const { layout: m, layoutId: B } = e.options;
45
+ window.MotionCancelOptimisedAnimation(h, "transform", E, !(m || B));
46
+ }
47
+ const { parent: c } = e;
48
+ c && !c.hasCheckedOptimisedAppear && ot(c);
49
+ }
50
+ function Re({ attachResizeListener: e, defaultParent: l, measureScroll: h, checkIsScrollRoot: c, resetTransform: m }) {
51
+ return class {
52
+ constructor(t = {}, i = l?.()) {
53
+ this.id = wt++, this.animationId = 0, this.animationCommitId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.layoutVersion = 0, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
54
+ this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
55
+ }, this.updateProjection = () => {
56
+ this.projectionUpdateScheduled = !1, this.nodes.forEach(Ft), this.nodes.forEach(Wt), this.nodes.forEach(Nt), this.nodes.forEach(Ot);
57
+ }, this.resolvedRelativeTargetAt = 0, this.linkedParentVersion = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = t, this.root = i ? i.root || i : this, this.path = i ? [...i.path, i] : [], this.parent = i, this.depth = i ? i.depth + 1 : 0;
58
+ for (let s = 0; s < this.path.length; s++)
59
+ this.path[s].shouldResetTransform = !0;
60
+ this.root === this && (this.nodes = new Rt());
61
+ }
62
+ addEventListener(t, i) {
63
+ return this.eventHandlers.has(t) || this.eventHandlers.set(t, new jt()), this.eventHandlers.get(t).add(i);
64
+ }
65
+ notifyListeners(t, ...i) {
66
+ const s = this.eventHandlers.get(t);
67
+ s && s.notify(...i);
68
+ }
69
+ hasListeners(t) {
70
+ return this.eventHandlers.has(t);
71
+ }
72
+ /**
73
+ * Lifecycles
74
+ */
75
+ mount(t) {
76
+ if (this.instance)
77
+ return;
78
+ this.isSVG = mt(t) && !pt(t), this.instance = t;
79
+ const { layoutId: i, layout: s, visualElement: o } = this.options;
80
+ if (o && !o.current && o.mount(t), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (s || i) && (this.isLayoutDirty = !0), e) {
81
+ let a, r = 0;
82
+ const n = () => this.root.updateBlockedByResize = !1;
83
+ E.read(() => {
84
+ r = window.innerWidth;
85
+ }), e(t, () => {
86
+ const u = window.innerWidth;
87
+ u !== r && (r = u, this.root.updateBlockedByResize = !0, a && a(), a = dt(n, 250), O.hasAnimatedSinceResize && (O.hasAnimatedSinceResize = !1, this.nodes.forEach(J)));
88
+ });
89
+ }
90
+ i && this.root.registerSharedNode(i, this), this.options.animate !== !1 && o && (i || s) && this.addEventListener("didUpdate", ({ delta: a, hasLayoutChanged: r, hasRelativeLayoutChanged: n, layout: u }) => {
91
+ if (this.isTreeAnimationBlocked()) {
92
+ this.target = void 0, this.relativeTarget = void 0;
93
+ return;
94
+ }
95
+ const d = this.options.transition || o.getDefaultTransition() || Yt, { onLayoutAnimationStart: g, onLayoutAnimationComplete: x } = o.getProps(), S = !this.targetLayout || !it(this.targetLayout, u), v = !r && n;
96
+ if (this.options.layoutRoot || this.resumeFrom || v || r && (S || !this.currentAnimation)) {
97
+ this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0);
98
+ const D = {
99
+ ...ut(d, "layout"),
100
+ onPlay: g,
101
+ onComplete: x
102
+ };
103
+ (o.shouldReduceMotion || this.options.layoutRoot) && (D.delay = 0, D.type = !1), this.startAnimation(D), this.setAnimationOrigin(a, v, D.path);
104
+ } else
105
+ r || J(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
106
+ this.targetLayout = u;
107
+ });
108
+ }
109
+ unmount() {
110
+ this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
111
+ const t = this.getStack();
112
+ t && t.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, this.eventHandlers.clear(), Y(this.updateProjection);
113
+ }
114
+ // only on the root
115
+ blockUpdate() {
116
+ this.updateManuallyBlocked = !0;
117
+ }
118
+ unblockUpdate() {
119
+ this.updateManuallyBlocked = !1;
120
+ }
121
+ isUpdateBlocked() {
122
+ return this.updateManuallyBlocked || this.updateBlockedByResize;
123
+ }
124
+ isTreeAnimationBlocked() {
125
+ return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || !1;
126
+ }
127
+ // Note: currently only running on root node
128
+ startUpdate() {
129
+ this.isUpdateBlocked() || (this.isUpdating = !0, this.nodes && this.nodes.forEach(Ht), this.animationId++);
130
+ }
131
+ getTransformTemplate() {
132
+ const { visualElement: t } = this.options;
133
+ return t && t.getProps().transformTemplate;
134
+ }
135
+ willUpdate(t = !0) {
136
+ if (this.root.hasTreeAnimated = !0, this.root.isUpdateBlocked()) {
137
+ this.options.onExitComplete && this.options.onExitComplete();
138
+ return;
139
+ }
140
+ if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && ot(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty)
141
+ return;
142
+ this.isLayoutDirty = !0;
143
+ for (let a = 0; a < this.path.length; a++) {
144
+ const r = this.path[a];
145
+ r.shouldResetTransform = !0, (typeof r.latestValues.x == "string" || typeof r.latestValues.y == "string") && (r.isLayoutDirty = !0), r.updateScroll("snapshot"), r.options.layoutRoot && r.willUpdate(!1);
146
+ }
147
+ const { layoutId: i, layout: s } = this.options;
148
+ if (i === void 0 && !s)
149
+ return;
150
+ const o = this.getTransformTemplate();
151
+ this.prevTransformTemplateValue = o ? o(this.latestValues, "") : void 0, this.updateSnapshot(), t && this.notifyListeners("willUpdate");
152
+ }
153
+ update() {
154
+ if (this.updateScheduled = !1, this.isUpdateBlocked()) {
155
+ const s = this.updateBlockedByResize;
156
+ this.unblockUpdate(), this.updateBlockedByResize = !1, this.clearAllSnapshots(), s && this.nodes.forEach(Mt), this.nodes.forEach($);
157
+ return;
158
+ }
159
+ if (this.animationId <= this.animationCommitId) {
160
+ this.nodes.forEach(Z);
161
+ return;
162
+ }
163
+ this.animationCommitId = this.animationId, this.isUpdating ? (this.isUpdating = !1, this.nodes.forEach(bt), this.nodes.forEach(zt), this.nodes.forEach(Ut), this.nodes.forEach(Ct)) : this.nodes.forEach(Z), this.clearAllSnapshots();
164
+ const i = ft.now();
165
+ y.delta = kt(0, 1e3 / 60, i - y.timestamp), y.timestamp = i, y.isProcessing = !0, I.update.process(y), I.preRender.process(y), I.render.process(y), y.isProcessing = !1;
166
+ }
167
+ didUpdate() {
168
+ this.updateScheduled || (this.updateScheduled = !0, ct.read(this.scheduleUpdate));
169
+ }
170
+ clearAllSnapshots() {
171
+ this.nodes.forEach(It), this.sharedNodes.forEach(Gt);
172
+ }
173
+ scheduleUpdateProjection() {
174
+ this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, E.preRender(this.updateProjection, !1, !0));
175
+ }
176
+ scheduleCheckAfterUnmount() {
177
+ E.postRender(() => {
178
+ this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
179
+ });
180
+ }
181
+ /**
182
+ * Update measurements
183
+ */
184
+ updateSnapshot() {
185
+ this.snapshot || !this.instance || (this.snapshot = this.measure(), this.snapshot && !j(this.snapshot.measuredBox.x) && !j(this.snapshot.measuredBox.y) && (this.snapshot = void 0));
186
+ }
187
+ updateLayout() {
188
+ if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))
189
+ return;
190
+ if (this.resumeFrom && !this.resumeFrom.instance)
191
+ for (let s = 0; s < this.path.length; s++)
192
+ this.path[s].updateScroll();
193
+ const t = this.layout;
194
+ this.layout = this.measure(!1), this.layoutVersion++, this.layoutCorrected || (this.layoutCorrected = f()), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
195
+ const { visualElement: i } = this.options;
196
+ i && i.notify("LayoutMeasure", this.layout.layoutBox, t ? t.layoutBox : void 0);
197
+ }
198
+ updateScroll(t = "measure") {
199
+ let i = !!(this.options.layoutScroll && this.instance);
200
+ if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === t && (i = !1), i && this.instance) {
201
+ const s = c(this.instance);
202
+ this.scroll = {
203
+ animationId: this.root.animationId,
204
+ phase: t,
205
+ isRoot: s,
206
+ offset: h(this.instance),
207
+ wasRoot: this.scroll ? this.scroll.isRoot : s
208
+ };
209
+ }
210
+ }
211
+ resetTransform() {
212
+ if (!m)
213
+ return;
214
+ const t = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, i = this.projectionDelta && !st(this.projectionDelta), s = this.getTransformTemplate(), o = s ? s(this.latestValues, "") : void 0, a = o !== this.prevTransformTemplateValue;
215
+ t && this.instance && (i || V(this.latestValues) || a) && (m(this.instance, o), this.shouldResetTransform = !1, this.scheduleRender());
216
+ }
217
+ measure(t = !0) {
218
+ const i = this.measurePageBox();
219
+ let s = this.removeElementScroll(i);
220
+ return t && (s = this.removeTransform(s)), $t(s), {
221
+ animationId: this.root.animationId,
222
+ measuredBox: i,
223
+ layoutBox: s,
224
+ latestValues: {},
225
+ source: this.id
226
+ };
227
+ }
228
+ measurePageBox() {
229
+ const { visualElement: t } = this.options;
230
+ if (!t)
231
+ return f();
232
+ const i = t.measureViewportBox();
233
+ if (!(this.scroll?.wasRoot || this.path.some(Zt))) {
234
+ const { scroll: o } = this.root;
235
+ o && (R(i.x, o.offset.x), R(i.y, o.offset.y));
236
+ }
237
+ return i;
238
+ }
239
+ removeElementScroll(t) {
240
+ const i = f();
241
+ if (p(i, t), this.scroll?.wasRoot)
242
+ return i;
243
+ for (let s = 0; s < this.path.length; s++) {
244
+ const o = this.path[s], { scroll: a, options: r } = o;
245
+ o !== this.root && a && r.layoutScroll && (a.wasRoot && p(i, t), R(i.x, a.offset.x), R(i.y, a.offset.y));
246
+ }
247
+ return i;
248
+ }
249
+ applyTransform(t, i = !1, s) {
250
+ const o = s || f();
251
+ p(o, t);
252
+ for (let a = 0; a < this.path.length; a++) {
253
+ const r = this.path[a];
254
+ !i && r.options.layoutScroll && r.scroll && r !== r.root && (R(o.x, -r.scroll.offset.x), R(o.y, -r.scroll.offset.y)), V(r.latestValues) && F(o, r.latestValues, r.layout?.layoutBox);
255
+ }
256
+ return V(this.latestValues) && F(o, this.latestValues, this.layout?.layoutBox), o;
257
+ }
258
+ removeTransform(t) {
259
+ const i = f();
260
+ p(i, t);
261
+ for (let s = 0; s < this.path.length; s++) {
262
+ const o = this.path[s];
263
+ if (!V(o.latestValues))
264
+ continue;
265
+ let a;
266
+ o.instance && (X(o.latestValues) && o.updateSnapshot(), a = f(), p(a, o.measurePageBox())), N(i, o.latestValues, o.snapshot?.layoutBox, a);
267
+ }
268
+ return V(this.latestValues) && N(i, this.latestValues), i;
269
+ }
270
+ setTargetDelta(t) {
271
+ this.targetDelta = t, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
272
+ }
273
+ setOptions(t) {
274
+ this.options = {
275
+ ...this.options,
276
+ ...t,
277
+ crossfade: t.crossfade !== void 0 ? t.crossfade : !0
278
+ };
279
+ }
280
+ clearMeasurements() {
281
+ this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = !1;
282
+ }
283
+ forceRelativeParentToResolveTarget() {
284
+ this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== y.timestamp && this.relativeParent.resolveTargetDelta(!0);
285
+ }
286
+ resolveTargetDelta(t = !1) {
287
+ const i = this.getLead();
288
+ this.isProjectionDirty || (this.isProjectionDirty = i.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = i.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = i.isSharedProjectionDirty);
289
+ const s = !!this.resumingFrom || this !== i;
290
+ if (!(t || s && this.isSharedProjectionDirty || this.isProjectionDirty || this.parent?.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
291
+ return;
292
+ const { layout: a, layoutId: r } = this.options;
293
+ if (!this.layout || !(a || r))
294
+ return;
295
+ this.resolvedRelativeTargetAt = y.timestamp;
296
+ const n = this.getClosestProjectingParent();
297
+ n && this.linkedParentVersion !== n.layoutVersion && !n.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (this.options.layoutAnchor !== !1 && n && n.layout ? this.createRelativeTarget(n, this.layout.layoutBox, n.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = f(), this.targetWithTransforms = f()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), Dt(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || void 0)) : this.targetDelta ? (this.resumingFrom ? this.applyTransform(this.layout.layoutBox, !1, this.target) : p(this.target, this.layout.layoutBox), Tt(this.target, this.targetDelta)) : p(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.options.layoutAnchor !== !1 && n && !!n.resumingFrom == !!this.resumingFrom && !n.options.layoutScroll && n.target && this.animationProgress !== 1 ? this.createRelativeTarget(n, this.target, n.target) : this.relativeParent = this.relativeTarget = void 0));
298
+ }
299
+ getClosestProjectingParent() {
300
+ if (!(!this.parent || X(this.parent.latestValues) || Vt(this.parent.latestValues)))
301
+ return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
302
+ }
303
+ isProjecting() {
304
+ return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
305
+ }
306
+ createRelativeTarget(t, i, s) {
307
+ this.relativeParent = t, this.linkedParentVersion = t.layoutVersion, this.forceRelativeParentToResolveTarget(), this.relativeTarget = f(), this.relativeTargetOrigin = f(), U(this.relativeTargetOrigin, i, s, this.options.layoutAnchor || void 0), p(this.relativeTarget, this.relativeTargetOrigin);
308
+ }
309
+ removeRelativeTarget() {
310
+ this.relativeParent = this.relativeTarget = void 0;
311
+ }
312
+ calcProjection() {
313
+ const t = this.getLead(), i = !!this.resumingFrom || this !== t;
314
+ let s = !0;
315
+ if ((this.isProjectionDirty || this.parent?.isProjectionDirty) && (s = !1), i && (this.isSharedProjectionDirty || this.isTransformDirty) && (s = !1), this.resolvedRelativeTargetAt === y.timestamp && (s = !1), s)
316
+ return;
317
+ const { layout: o, layoutId: a } = this.options;
318
+ if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(o || a))
319
+ return;
320
+ p(this.layoutCorrected, this.layout.layoutBox);
321
+ const r = this.treeScale.x, n = this.treeScale.y;
322
+ xt(this.layoutCorrected, this.treeScale, this.path, i), t.layout && !t.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (t.target = t.layout.layoutBox, t.targetWithTransforms = f());
323
+ const { target: u } = t;
324
+ if (!u) {
325
+ this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
326
+ return;
327
+ }
328
+ !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (W(this.prevProjectionDelta.x, this.projectionDelta.x), W(this.prevProjectionDelta.y, this.projectionDelta.y)), w(this.projectionDelta, this.layoutCorrected, u, this.latestValues), (this.treeScale.x !== r || this.treeScale.y !== n || !H(this.projectionDelta.x, this.prevProjectionDelta.x) || !H(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", u));
329
+ }
330
+ hide() {
331
+ this.isVisible = !1;
332
+ }
333
+ show() {
334
+ this.isVisible = !0;
335
+ }
336
+ scheduleRender(t = !0) {
337
+ if (this.options.visualElement?.scheduleRender(), t) {
338
+ const i = this.getStack();
339
+ i && i.scheduleRender();
340
+ }
341
+ this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
342
+ }
343
+ createProjectionDeltas() {
344
+ this.prevProjectionDelta = k(), this.projectionDelta = k(), this.projectionDeltaWithTransform = k();
345
+ }
346
+ setAnimationOrigin(t, i = !1, s) {
347
+ const o = this.snapshot, a = o ? o.latestValues : {}, r = { ...this.latestValues }, n = k();
348
+ (!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !i;
349
+ const u = f(), d = o ? o.source : void 0, g = this.layout ? this.layout.source : void 0, x = d !== g, S = this.getStack(), v = !S || S.members.length <= 1, D = !!(x && !v && this.options.crossfade === !0 && !this.path.some(Xt));
350
+ this.animationProgress = 0;
351
+ let T;
352
+ const rt = s?.interpolateProjection(t);
353
+ this.mixTargetDelta = (nt) => {
354
+ const P = nt / 1e3, A = rt?.(P);
355
+ A ? (n.x.translate = A.x, n.x.scale = L(t.x.scale, 1, P), n.x.origin = t.x.origin, n.x.originPoint = t.x.originPoint, n.y.translate = A.y, n.y.scale = L(t.y.scale, 1, P), n.y.origin = t.y.origin, n.y.originPoint = t.y.originPoint) : (K(n.x, t.x, P), K(n.y, t.y, P)), this.setTargetDelta(n), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (U(u, this.layout.layoutBox, this.relativeParent.layout.layoutBox, this.options.layoutAnchor || void 0), qt(this.relativeTarget, this.relativeTargetOrigin, u, P), T && Bt(this.relativeTarget, T) && (this.isProjectionDirty = !1), T || (T = f()), p(T, this.relativeTarget)), x && (this.animationValues = r, gt(r, a, this.latestValues, P, D, v)), A && A.rotate !== void 0 && (this.animationValues || (this.animationValues = r), this.animationValues.pathRotation = A.rotate), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = P;
356
+ }, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
357
+ }
358
+ startAnimation(t) {
359
+ this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation && (Y(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = E.update(() => {
360
+ O.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = yt(0)), this.motionValue.jump(0, !1), this.currentAnimation = lt(this.motionValue, [0, 1e3], {
361
+ ...t,
362
+ velocity: 0,
363
+ isSync: !0,
364
+ onUpdate: (i) => {
365
+ this.mixTargetDelta(i), t.onUpdate && t.onUpdate(i);
366
+ },
367
+ onStop: () => {
368
+ },
369
+ onComplete: () => {
370
+ t.onComplete && t.onComplete(), this.completeAnimation();
371
+ }
372
+ }), this.resumingFrom && (this.resumingFrom.currentAnimation = this.currentAnimation), this.pendingAnimation = void 0;
373
+ });
374
+ }
375
+ completeAnimation() {
376
+ this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0);
377
+ const t = this.getStack();
378
+ t && t.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
379
+ }
380
+ finishAnimation() {
381
+ this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(Et), this.currentAnimation.stop()), this.completeAnimation();
382
+ }
383
+ applyTransformsToTarget() {
384
+ const t = this.getLead();
385
+ let { targetWithTransforms: i, target: s, layout: o, latestValues: a } = t;
386
+ if (!(!i || !s || !o)) {
387
+ if (this !== t && this.layout && o && at(this.options.animationType, this.layout.layoutBox, o.layoutBox)) {
388
+ s = this.target || f();
389
+ const r = j(this.layout.layoutBox.x);
390
+ s.x.min = t.target.x.min, s.x.max = s.x.min + r;
391
+ const n = j(this.layout.layoutBox.y);
392
+ s.y.min = t.target.y.min, s.y.max = s.y.min + n;
393
+ }
394
+ p(i, s), F(i, a), w(this.projectionDeltaWithTransform, this.layoutCorrected, i, a);
395
+ }
396
+ }
397
+ registerSharedNode(t, i) {
398
+ this.sharedNodes.has(t) || this.sharedNodes.set(t, new St()), this.sharedNodes.get(t).add(i);
399
+ const o = i.options.initialPromotionConfig;
400
+ i.promote({
401
+ transition: o ? o.transition : void 0,
402
+ preserveFollowOpacity: o && o.shouldPreserveFollowOpacity ? o.shouldPreserveFollowOpacity(i) : void 0
403
+ });
404
+ }
405
+ isLead() {
406
+ const t = this.getStack();
407
+ return t ? t.lead === this : !0;
408
+ }
409
+ getLead() {
410
+ const { layoutId: t } = this.options;
411
+ return t ? this.getStack()?.lead || this : this;
412
+ }
413
+ getPrevLead() {
414
+ const { layoutId: t } = this.options;
415
+ return t ? this.getStack()?.prevLead : void 0;
416
+ }
417
+ getStack() {
418
+ const { layoutId: t } = this.options;
419
+ if (t)
420
+ return this.root.sharedNodes.get(t);
421
+ }
422
+ promote({ needsReset: t, transition: i, preserveFollowOpacity: s } = {}) {
423
+ const o = this.getStack();
424
+ o && o.promote(this, s), t && (this.projectionDelta = void 0, this.needsReset = !0), i && this.setOptions({ transition: i });
425
+ }
426
+ relegate() {
427
+ const t = this.getStack();
428
+ return t ? t.relegate(this) : !1;
429
+ }
430
+ resetSkewAndRotation() {
431
+ const { visualElement: t } = this.options;
432
+ if (!t)
433
+ return;
434
+ let i = !1;
435
+ const { latestValues: s } = t;
436
+ if ((s.z || s.rotate || s.rotateX || s.rotateY || s.rotateZ || s.skewX || s.skewY) && (i = !0), !i)
437
+ return;
438
+ const o = {};
439
+ s.z && b("z", t, o, this.animationValues);
440
+ for (let a = 0; a < M.length; a++)
441
+ b(`rotate${M[a]}`, t, o, this.animationValues), b(`skew${M[a]}`, t, o, this.animationValues);
442
+ t.render();
443
+ for (const a in o)
444
+ t.setStaticValue(a, o[a]), this.animationValues && (this.animationValues[a] = o[a]);
445
+ t.scheduleRender();
446
+ }
447
+ applyProjectionStyles(t, i) {
448
+ if (!this.instance || this.isSVG)
449
+ return;
450
+ if (!this.isVisible) {
451
+ t.visibility = "hidden";
452
+ return;
453
+ }
454
+ const s = this.getTransformTemplate();
455
+ if (this.needsReset) {
456
+ this.needsReset = !1, t.visibility = "", t.opacity = "", t.pointerEvents = C(i?.pointerEvents) || "", t.transform = s ? s(this.latestValues, "") : "none";
457
+ return;
458
+ }
459
+ const o = this.getLead();
460
+ if (!this.projectionDelta || !this.layout || !o.target) {
461
+ this.options.layoutId && (t.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, t.pointerEvents = C(i?.pointerEvents) || ""), this.hasProjected && !V(this.latestValues) && (t.transform = s ? s({}, "") : "none", this.hasProjected = !1);
462
+ return;
463
+ }
464
+ t.visibility = "";
465
+ const a = o.animationValues || o.latestValues;
466
+ this.applyTransformsToTarget();
467
+ let r = At(this.projectionDeltaWithTransform, this.treeScale, a);
468
+ s && (r = s(a, r)), t.transform = r;
469
+ const { x: n, y: u } = this.projectionDelta;
470
+ t.transformOrigin = `${n.origin * 100}% ${u.origin * 100}% 0`, o.animationValues ? t.opacity = o === this ? a.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : a.opacityExit : t.opacity = o === this ? a.opacity !== void 0 ? a.opacity : "" : a.opacityExit !== void 0 ? a.opacityExit : 0;
471
+ for (const d in z) {
472
+ if (a[d] === void 0)
473
+ continue;
474
+ const { correct: g, applyTo: x, isCSSVariable: S } = z[d], v = r === "none" ? a[d] : g(a[d], o);
475
+ if (x) {
476
+ const D = x.length;
477
+ for (let T = 0; T < D; T++)
478
+ t[x[T]] = v;
479
+ } else
480
+ S ? this.options.visualElement.renderState.vars[d] = v : t[d] = v;
481
+ }
482
+ this.options.layoutId && (t.pointerEvents = o === this ? C(i?.pointerEvents) || "" : "none");
483
+ }
484
+ clearSnapshot() {
485
+ this.resumeFrom = this.snapshot = void 0;
486
+ }
487
+ // Only run on root
488
+ resetTree() {
489
+ this.root.nodes.forEach((t) => t.currentAnimation?.stop()), this.root.nodes.forEach($), this.root.sharedNodes.clear();
490
+ }
491
+ };
492
+ }
493
+ function Ut(e) {
494
+ e.updateLayout();
495
+ }
496
+ function Ct(e) {
497
+ const l = e.resumeFrom?.snapshot || e.snapshot;
498
+ if (e.isLead() && e.layout && l && e.hasListeners("didUpdate")) {
499
+ const { layoutBox: h, measuredBox: c } = e.layout, { animationType: m } = e.options, B = l.source !== e.layout.source;
500
+ if (m === "size")
501
+ q((a) => {
502
+ const r = B ? l.measuredBox[a] : l.layoutBox[a], n = j(r);
503
+ r.min = h[a].min, r.max = r.min + n;
504
+ });
505
+ else if (m === "x" || m === "y") {
506
+ const a = m === "x" ? "y" : "x";
507
+ vt(B ? l.measuredBox[a] : l.layoutBox[a], h[a]);
508
+ } else at(m, l.layoutBox, h) && q((a) => {
509
+ const r = B ? l.measuredBox[a] : l.layoutBox[a], n = j(h[a]);
510
+ r.max = r.min + n, e.relativeTarget && !e.currentAnimation && (e.isProjectionDirty = !0, e.relativeTarget[a].max = e.relativeTarget[a].min + n);
511
+ });
512
+ const t = k();
513
+ w(t, h, l.layoutBox);
514
+ const i = k();
515
+ B ? w(i, e.applyTransform(c, !0), l.measuredBox) : w(i, h, l.layoutBox);
516
+ const s = !st(t);
517
+ let o = !1;
518
+ if (!e.resumeFrom) {
519
+ const a = e.getClosestProjectingParent();
520
+ if (a && !a.resumeFrom) {
521
+ const { snapshot: r, layout: n } = a;
522
+ if (r && n) {
523
+ const u = e.options.layoutAnchor || void 0, d = f();
524
+ U(d, l.layoutBox, r.layoutBox, u);
525
+ const g = f();
526
+ U(g, h, n.layoutBox, u), it(d, g) || (o = !0), a.options.layoutRoot && (e.relativeTarget = g, e.relativeTargetOrigin = d, e.relativeParent = a);
527
+ }
528
+ }
529
+ }
530
+ e.notifyListeners("didUpdate", {
531
+ layout: h,
532
+ snapshot: l,
533
+ delta: i,
534
+ layoutDelta: t,
535
+ hasLayoutChanged: s,
536
+ hasRelativeLayoutChanged: o
537
+ });
538
+ } else if (e.isLead()) {
539
+ const { onExitComplete: h } = e.options;
540
+ h && h();
541
+ }
542
+ e.options.transition = void 0;
543
+ }
544
+ function Ft(e) {
545
+ e.parent && (e.isProjecting() || (e.isProjectionDirty = e.parent.isProjectionDirty), e.isSharedProjectionDirty || (e.isSharedProjectionDirty = !!(e.isProjectionDirty || e.parent.isProjectionDirty || e.parent.isSharedProjectionDirty)), e.isTransformDirty || (e.isTransformDirty = e.parent.isTransformDirty));
546
+ }
547
+ function Ot(e) {
548
+ e.isProjectionDirty = e.isSharedProjectionDirty = e.isTransformDirty = !1;
549
+ }
550
+ function It(e) {
551
+ e.clearSnapshot();
552
+ }
553
+ function $(e) {
554
+ e.clearMeasurements();
555
+ }
556
+ function Mt(e) {
557
+ e.isLayoutDirty = !0, e.updateLayout();
558
+ }
559
+ function Z(e) {
560
+ e.isLayoutDirty = !1;
561
+ }
562
+ function bt(e) {
563
+ e.isAnimationBlocked && e.layout && !e.isLayoutDirty && (e.snapshot = e.layout, e.isLayoutDirty = !0);
564
+ }
565
+ function zt(e) {
566
+ const { visualElement: l } = e.options;
567
+ l && l.getProps().onBeforeLayoutMeasure && l.notify("BeforeLayoutMeasure"), e.resetTransform();
568
+ }
569
+ function J(e) {
570
+ e.finishAnimation(), e.targetDelta = e.relativeTarget = e.target = void 0, e.isProjectionDirty = !0;
571
+ }
572
+ function Wt(e) {
573
+ e.resolveTargetDelta();
574
+ }
575
+ function Nt(e) {
576
+ e.calcProjection();
577
+ }
578
+ function Ht(e) {
579
+ e.resetSkewAndRotation();
580
+ }
581
+ function Gt(e) {
582
+ e.removeLeadSnapshot();
583
+ }
584
+ function K(e, l, h) {
585
+ e.translate = L(l.translate, 0, h), e.scale = L(l.scale, 1, h), e.origin = l.origin, e.originPoint = l.originPoint;
586
+ }
587
+ function Q(e, l, h, c) {
588
+ e.min = L(l.min, h.min, c), e.max = L(l.max, h.max, c);
589
+ }
590
+ function qt(e, l, h, c) {
591
+ Q(e.x, l.x, h.x, c), Q(e.y, l.y, h.y, c);
592
+ }
593
+ function Xt(e) {
594
+ return e.animationValues && e.animationValues.opacityExit !== void 0;
595
+ }
596
+ const Yt = {
597
+ duration: 0.45,
598
+ ease: [0.4, 0, 0.1, 1]
599
+ }, _ = (e) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(e), tt = _("applewebkit/") && !_("chrome/") ? Math.round : Lt;
600
+ function et(e) {
601
+ e.min = tt(e.min), e.max = tt(e.max);
602
+ }
603
+ function $t(e) {
604
+ et(e.x), et(e.y);
605
+ }
606
+ function at(e, l, h) {
607
+ return e === "position" || e === "preserve-aspect" && !Pt(G(l), G(h), 0.2);
608
+ }
609
+ function Zt(e) {
610
+ return e !== e.root && e.scroll?.wasRoot;
611
+ }
612
+ export {
613
+ Ot as cleanDirtyNodes,
614
+ Re as createProjectionNode,
615
+ Q as mixAxis,
616
+ qt as mixBox,
617
+ Ft as propagateDirtyNodes
618
+ };
@@ -0,0 +1,15 @@
1
+ const e = {
2
+ /**
3
+ * Global flag as to whether the tree has animated since the last time
4
+ * we resized the window
5
+ */
6
+ hasAnimatedSinceResize: !0,
7
+ /**
8
+ * We set this to true once, on the first update. Any nodes added to the tree beyond that
9
+ * update will be given a `data-projection-id` attribute.
10
+ */
11
+ hasEverUpdated: !1
12
+ };
13
+ export {
14
+ e as globalProjectionState
15
+ };