@code0-tech/pictor 0.18.3 → 1.1.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 (464) hide show
  1. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +6 -0
  2. package/dist/_virtual/rolldown_runtime.js +18 -0
  3. package/dist/assets/Alert.style.css +1 -0
  4. package/dist/assets/Aurora.style.css +1 -0
  5. package/dist/assets/Avatar.style.css +1 -0
  6. package/dist/assets/Badge.style.css +1 -0
  7. package/dist/assets/Breadcrumb.style.css +1 -0
  8. package/dist/assets/Button.style.css +1 -0
  9. package/dist/assets/ButtonGroup.style.css +1 -0
  10. package/dist/assets/Card.style.css +1 -0
  11. package/dist/assets/Chart.style.css +1 -0
  12. package/dist/assets/Col.style.css +1 -0
  13. package/dist/assets/ColorInput.style.css +1 -0
  14. package/dist/assets/Command.style.css +1 -0
  15. package/dist/assets/Container.style.css +1 -0
  16. package/dist/assets/ContextMenu.style.css +1 -0
  17. package/dist/assets/DataTable.style.css +1 -0
  18. package/dist/assets/DateInput.style.css +1 -0
  19. package/dist/assets/Dialog.style.css +1 -0
  20. package/dist/assets/Editor.styles.css +1 -0
  21. package/dist/assets/EditorInput.style.css +1 -0
  22. package/dist/assets/FileInput.style.css +1 -0
  23. package/dist/assets/FileTabs.style.css +1 -0
  24. package/dist/assets/FullScreen.style.css +1 -0
  25. package/dist/assets/Gantt.style.css +1 -0
  26. package/dist/assets/Icon.style.css +1 -0
  27. package/dist/assets/Input.style.css +1 -0
  28. package/dist/assets/InputWrapper.style.css +1 -0
  29. package/dist/assets/JsonView.style.css +1 -0
  30. package/dist/assets/Layout.style.css +1 -0
  31. package/dist/assets/Menu.style.css +1 -0
  32. package/dist/assets/Progress.style.css +1 -0
  33. package/dist/assets/Quote.style.css +1 -0
  34. package/dist/assets/Resizable.style.css +1 -0
  35. package/dist/assets/Row.style.css +1 -0
  36. package/dist/assets/ScrollArea.style.css +1 -0
  37. package/dist/assets/SegmentedControl.style.css +1 -0
  38. package/dist/assets/SelectInput.style.css +1 -0
  39. package/dist/assets/Tab.style.css +1 -0
  40. package/dist/assets/Text.style.css +1 -0
  41. package/dist/assets/Toast.style.css +1 -0
  42. package/dist/assets/Tooltip.style.css +1 -0
  43. package/dist/components/alert/Alert.js +34 -41
  44. package/dist/components/aurora/Aurora.js +27 -22
  45. package/dist/components/avatar/Avatar.js +57 -55
  46. package/dist/components/badge/Badge.js +58 -64
  47. package/dist/components/breadcrumb/Breadcrumb.js +16 -20
  48. package/dist/components/button/Button.js +24 -31
  49. package/dist/components/button-group/ButtonGroup.js +29 -31
  50. package/dist/components/card/Card.js +30 -44
  51. package/dist/components/card/CardSection.js +21 -29
  52. package/dist/components/chart/Chart.js +138 -153
  53. package/dist/components/chart/LineChart.js +75 -74
  54. package/dist/components/chart/index.js +3 -8
  55. package/dist/components/col/Col.js +19 -29
  56. package/dist/components/command/Command.js +101 -134
  57. package/dist/components/container/Container.js +19 -23
  58. package/dist/components/context-menu/ContextMenu.d.ts +1 -1
  59. package/dist/components/context-menu/ContextMenu.js +119 -125
  60. package/dist/components/data-table/DataTable.js +53 -63
  61. package/dist/components/data-table/DataTableColumn.js +18 -22
  62. package/dist/components/data-table/DataTableFilterInput.js +208 -205
  63. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +59 -48
  64. package/dist/components/data-table/DataTableHeader.js +34 -38
  65. package/dist/components/data-table/DataTablePagination.js +62 -74
  66. package/dist/components/data-table/index.js +7 -22
  67. package/dist/components/dialog/Dialog.js +107 -102
  68. package/dist/components/editor/Editor.js +352 -322
  69. package/dist/components/file-tabs/FileTabs.js +78 -73
  70. package/dist/components/file-tabs/FileTabs.service.js +85 -87
  71. package/dist/components/file-tabs/FileTabs.view.js +0 -1
  72. package/dist/components/file-tabs/index.js +3 -9
  73. package/dist/components/flex/Flex.js +19 -23
  74. package/dist/components/form/CheckboxInput.js +73 -76
  75. package/dist/components/form/ColorInput.js +378 -353
  76. package/dist/components/form/DateInput.js +315 -265
  77. package/dist/components/form/EditorInput.js +597 -579
  78. package/dist/components/form/EmailInput.js +30 -23
  79. package/dist/components/form/FileInput.js +93 -123
  80. package/dist/components/form/Input.js +64 -57
  81. package/dist/components/form/Input.utils.js +25 -37
  82. package/dist/components/form/InputDescription.js +11 -11
  83. package/dist/components/form/InputLabel.js +18 -22
  84. package/dist/components/form/InputMessage.js +17 -17
  85. package/dist/components/form/InputWrapper.js +56 -65
  86. package/dist/components/form/NumberInput.js +41 -20
  87. package/dist/components/form/PasswordInput.js +71 -54
  88. package/dist/components/form/PinInput.js +50 -65
  89. package/dist/components/form/RadioGroup.js +42 -50
  90. package/dist/components/form/RadioInput.js +31 -29
  91. package/dist/components/form/SelectInput.js +69 -92
  92. package/dist/components/form/SwitchInput.js +17 -18
  93. package/dist/components/form/TagInput.js +108 -122
  94. package/dist/components/form/TextAreaInput.js +24 -21
  95. package/dist/components/form/TextInput.js +30 -22
  96. package/dist/components/form/index.js +22 -87
  97. package/dist/components/form/useForm.js +87 -88
  98. package/dist/components/fullscreen/FullScreen.js +28 -27
  99. package/dist/components/gantt/Gantt.js +100 -98
  100. package/dist/components/gantt/GanttGroup.js +210 -194
  101. package/dist/components/gantt/GanttHeader.js +79 -81
  102. package/dist/components/gantt/GanttItem.js +19 -22
  103. package/dist/components/icon/Icon.d.ts +6 -4
  104. package/dist/components/icon/Icon.js +53 -42
  105. package/dist/components/icon/codezero/codezero.js +10 -0
  106. package/dist/components/icon/codezero/gls.js +9 -0
  107. package/dist/components/icon/codezero/index.js +17 -13
  108. package/dist/components/json-view/JsonView.js +120 -109
  109. package/dist/components/layout/Layout.js +101 -78
  110. package/dist/components/menu/Menu.js +135 -141
  111. package/dist/components/progress/ProgressCircle.js +60 -48
  112. package/dist/components/progress/ProgressLinear.js +39 -42
  113. package/dist/components/quote/Quote.js +52 -43
  114. package/dist/components/resizable/Resizable.js +36 -33
  115. package/dist/components/row/Row.js +19 -23
  116. package/dist/components/scroll-area/ScrollArea.js +66 -76
  117. package/dist/components/segmented-control/SegmentedControl.d.ts +2 -2
  118. package/dist/components/segmented-control/SegmentedControl.js +46 -26
  119. package/dist/components/spacing/Spacing.js +16 -23
  120. package/dist/components/tab/Tab.js +73 -40
  121. package/dist/components/text/Text.js +19 -25
  122. package/dist/components/toast/Toast.d.ts +1 -1
  123. package/dist/components/toast/Toast.js +104 -83
  124. package/dist/components/tooltip/Tooltip.js +66 -60
  125. package/dist/index.js +76 -261
  126. package/dist/node_modules/@lezer/common/dist/index.js +778 -143
  127. package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
  128. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +55 -55
  129. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -32
  130. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +57 -46
  131. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -16
  132. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +8 -11
  133. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +4 -5
  134. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +4 -5
  135. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +7 -8
  136. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -11
  137. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +4 -5
  138. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +12 -14
  139. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +4 -5
  140. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +4 -5
  141. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +5 -7
  142. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +8 -13
  143. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +252 -281
  144. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +19 -21
  145. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +57 -67
  146. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +24 -27
  147. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +16 -19
  148. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -124
  149. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +39 -42
  150. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +22 -27
  151. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +36 -44
  152. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +22 -32
  153. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +6 -12
  154. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +47 -37
  155. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +12 -16
  156. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +10 -20
  157. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +58 -59
  158. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +7 -11
  159. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -13
  160. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +42 -43
  161. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +19 -18
  162. package/dist/node_modules/framer-motion/dist/es/motion/index.js +64 -58
  163. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +2 -4
  164. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -20
  165. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +53 -62
  166. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +45 -49
  167. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +4 -38
  168. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +7 -17
  169. package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +3 -0
  170. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +10 -12
  171. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +5 -7
  172. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -10
  173. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +18 -15
  174. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +14 -18
  175. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +4 -23
  176. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +8 -9
  177. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +20 -23
  178. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +6 -8
  179. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +27 -29
  180. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +23 -21
  181. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +8 -9
  182. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +5 -7
  183. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +5 -8
  184. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +2 -4
  185. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +2 -4
  186. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +3 -5
  187. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +11 -0
  188. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +20 -25
  189. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +6 -7
  190. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +5 -6
  191. package/dist/node_modules/motion/dist/es/react.js +196 -0
  192. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +104 -111
  193. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +126 -143
  194. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +81 -105
  195. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +25 -37
  196. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +7 -9
  197. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +10 -16
  198. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +29 -36
  199. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +18 -28
  200. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +156 -170
  201. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +6 -12
  202. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -12
  203. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +3 -5
  204. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +6 -8
  205. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +42 -45
  206. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +52 -57
  207. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +22 -27
  208. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +18 -21
  209. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +58 -67
  210. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +61 -70
  211. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +5 -7
  212. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +5 -7
  213. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +9 -11
  214. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +3 -5
  215. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +3 -6
  216. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +4 -6
  217. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +15 -15
  218. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +32 -35
  219. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +3 -6
  220. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +4 -6
  221. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +19 -26
  222. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +4 -6
  223. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +14 -21
  224. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +21 -29
  225. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +25 -22
  226. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +5 -7
  227. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +3 -7
  228. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +4 -8
  229. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +15 -19
  230. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +3 -5
  231. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +12 -14
  232. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -9
  233. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +2 -4
  234. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +8 -11
  235. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +32 -14
  236. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +16 -20
  237. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +21 -32
  238. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +7 -11
  239. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +5 -7
  240. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +5 -9
  241. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +5 -9
  242. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +12 -14
  243. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +3 -5
  244. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -26
  245. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +4 -9
  246. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +3 -5
  247. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +10 -20
  248. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +29 -42
  249. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +11 -13
  250. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +6 -9
  251. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +8 -10
  252. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +32 -36
  253. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +32 -32
  254. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +16 -15
  255. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +23 -24
  256. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +2 -4
  257. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +2 -4
  258. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +2 -4
  259. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +13 -11
  260. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +20 -29
  261. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +34 -22
  262. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +7 -11
  263. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +41 -53
  264. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +28 -38
  265. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +23 -21
  266. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +15 -17
  267. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +18 -26
  268. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +10 -12
  269. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +19 -24
  270. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +554 -592
  271. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +4 -14
  272. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +48 -52
  273. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +10 -20
  274. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +11 -16
  275. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +14 -20
  276. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +9 -12
  277. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +2 -4
  278. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +3 -5
  279. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +16 -18
  280. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +11 -15
  281. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +8 -11
  282. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +6 -9
  283. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +198 -260
  284. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +25 -27
  285. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +2 -4
  286. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +49 -60
  287. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +4 -6
  288. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +3 -5
  289. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +35 -35
  290. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +25 -28
  291. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +33 -37
  292. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +5 -11
  293. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +8 -12
  294. package/dist/node_modules/motion-dom/dist/es/render/store.js +2 -4
  295. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +37 -39
  296. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +18 -30
  297. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +25 -27
  298. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +2 -4
  299. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +11 -13
  300. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +6 -10
  301. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +11 -14
  302. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +128 -138
  303. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +16 -19
  304. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +3 -5
  305. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +8 -11
  306. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +5 -8
  307. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +2 -4
  308. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +3 -5
  309. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +10 -12
  310. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +20 -23
  311. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +18 -24
  312. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +8 -14
  313. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +2 -5
  314. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +5 -7
  315. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +16 -18
  316. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +14 -18
  317. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +7 -13
  318. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +10 -13
  319. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +31 -35
  320. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +18 -21
  321. package/dist/node_modules/motion-dom/dist/es/resize/index.js +5 -7
  322. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +5 -0
  323. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +7 -0
  324. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +9 -11
  325. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +29 -40
  326. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +4 -6
  327. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +4 -6
  328. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +4 -6
  329. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +26 -27
  330. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +44 -45
  331. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +3 -5
  332. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +5 -7
  333. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +2 -4
  334. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +4 -7
  335. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +11 -14
  336. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +2 -4
  337. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +9 -11
  338. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +6 -8
  339. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +3 -5
  340. package/dist/node_modules/motion-dom/dist/es/value/index.js +89 -211
  341. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +4 -6
  342. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +15 -17
  343. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +17 -20
  344. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +9 -11
  345. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +12 -14
  346. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +12 -15
  347. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +13 -17
  348. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +22 -22
  349. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +43 -44
  350. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -10
  351. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +14 -9
  352. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +5 -7
  353. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +22 -27
  354. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +61 -69
  355. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +29 -36
  356. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +12 -16
  357. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +10 -17
  358. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +2 -4
  359. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +9 -11
  360. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +2 -4
  361. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +10 -8
  362. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +2 -4
  363. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +2 -4
  364. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +3 -5
  365. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +2 -4
  366. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +2 -4
  367. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +2 -4
  368. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +4 -6
  369. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +10 -13
  370. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +4 -6
  371. package/dist/node_modules/motion-utils/dist/es/array.js +6 -9
  372. package/dist/node_modules/motion-utils/dist/es/clamp.js +2 -4
  373. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +3 -5
  374. package/dist/node_modules/motion-utils/dist/es/easing/back.js +5 -9
  375. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +4 -8
  376. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +14 -17
  377. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +3 -7
  378. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +2 -4
  379. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +2 -4
  380. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +2 -4
  381. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +2 -4
  382. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +28 -31
  383. package/dist/node_modules/motion-utils/dist/es/errors.js +7 -13
  384. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +3 -5
  385. package/dist/node_modules/motion-utils/dist/es/global-config.js +2 -4
  386. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +2 -4
  387. package/dist/node_modules/motion-utils/dist/es/is-object.js +2 -4
  388. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +2 -4
  389. package/dist/node_modules/motion-utils/dist/es/memo.js +5 -7
  390. package/dist/node_modules/motion-utils/dist/es/noop.js +2 -4
  391. package/dist/node_modules/motion-utils/dist/es/pipe.js +2 -4
  392. package/dist/node_modules/motion-utils/dist/es/progress.js +4 -6
  393. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +23 -28
  394. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +2 -5
  395. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +2 -4
  396. package/dist/node_modules/motion-utils/dist/es/warn-once.js +5 -7
  397. package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
  398. package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
  399. package/dist/node_modules/prettier/standalone.js +3444 -2415
  400. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -21
  401. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +18 -14
  402. package/dist/node_modules/react/compiler-runtime.js +8 -10
  403. package/dist/utils/arrayService.js +0 -1
  404. package/dist/utils/color.js +46 -41
  405. package/dist/utils/component.js +60 -129
  406. package/dist/utils/contextStore.js +48 -58
  407. package/dist/utils/index.d.ts +1 -0
  408. package/dist/utils/index.js +7 -18
  409. package/dist/utils/motion.d.ts +55 -0
  410. package/dist/utils/motion.js +87 -0
  411. package/dist/utils/reactiveArrayService.js +80 -76
  412. package/dist/utils/size.js +14 -26
  413. package/dist/utils/utils.js +0 -1
  414. package/dist/utils/view.js +27 -24
  415. package/dist/vite-env.d.js +0 -1
  416. package/package.json +30 -25
  417. package/dist/_virtual/compiler-runtime.js +0 -5
  418. package/dist/_virtual/compiler-runtime2.js +0 -4
  419. package/dist/_virtual/react-compiler-runtime.development.js +0 -4
  420. package/dist/_virtual/react-compiler-runtime.production.js +0 -4
  421. package/dist/assets/components/alert/Alert.style.css +0 -1
  422. package/dist/assets/components/aurora/Aurora.style.css +0 -1
  423. package/dist/assets/components/avatar/Avatar.style.css +0 -1
  424. package/dist/assets/components/badge/Badge.style.css +0 -1
  425. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
  426. package/dist/assets/components/button/Button.style.css +0 -1
  427. package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
  428. package/dist/assets/components/card/Card.style.css +0 -1
  429. package/dist/assets/components/chart/Chart.style.css +0 -1
  430. package/dist/assets/components/col/Col.style.css +0 -1
  431. package/dist/assets/components/command/Command.style.css +0 -1
  432. package/dist/assets/components/container/Container.style.css +0 -1
  433. package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
  434. package/dist/assets/components/data-table/DataTable.style.css +0 -1
  435. package/dist/assets/components/dialog/Dialog.style.css +0 -1
  436. package/dist/assets/components/editor/Editor.styles.css +0 -1
  437. package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
  438. package/dist/assets/components/form/ColorInput.style.css +0 -1
  439. package/dist/assets/components/form/DateInput.style.css +0 -1
  440. package/dist/assets/components/form/EditorInput.style.css +0 -1
  441. package/dist/assets/components/form/FileInput.style.css +0 -1
  442. package/dist/assets/components/form/Input.style.css +0 -1
  443. package/dist/assets/components/form/InputWrapper.style.css +0 -1
  444. package/dist/assets/components/form/SelectInput.style.css +0 -1
  445. package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
  446. package/dist/assets/components/gantt/Gantt.style.css +0 -1
  447. package/dist/assets/components/icon/Icon.style.css +0 -1
  448. package/dist/assets/components/json-view/JsonView.style.css +0 -1
  449. package/dist/assets/components/layout/Layout.style.css +0 -1
  450. package/dist/assets/components/menu/Menu.style.css +0 -1
  451. package/dist/assets/components/progress/Progress.style.css +0 -1
  452. package/dist/assets/components/quote/Quote.style.css +0 -1
  453. package/dist/assets/components/resizable/Resizable.style.css +0 -1
  454. package/dist/assets/components/row/Row.style.css +0 -1
  455. package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
  456. package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
  457. package/dist/assets/components/tab/Tab.style.css +0 -1
  458. package/dist/assets/components/text/Text.style.css +0 -1
  459. package/dist/assets/components/toast/Toast.style.css +0 -1
  460. package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
  461. package/dist/components/icon/codezero/codezero.svg.js +0 -5
  462. package/dist/components/icon/codezero/gls.svg.js +0 -5
  463. /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
  464. /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
@@ -1,263 +1,201 @@
1
- import { KeyframeResolver as M } from "../animation/keyframes/KeyframesResolver.js";
2
- import { NativeAnimation as S } from "../animation/NativeAnimation.js";
3
- import { acceleratedValues as b } from "../animation/waapi/utils/accelerated-values.js";
4
- import { microtask as T } from "../frameloop/microtask.js";
5
- import { time as w } from "../frameloop/sync-time.js";
6
- import { createBox as P } from "../projection/geometry/models.js";
7
- import { motionValue as F } from "../value/index.js";
8
- import { complex as A } from "../value/types/complex/index.js";
9
- import { getAnimatableNone as B } from "../value/types/utils/animatable-none.js";
10
- import { findValueType as R } from "../value/types/utils/find.js";
11
- import { isMotionValue as u } from "../value/utils/is-motion-value.js";
12
- import { visualElementStore as N } from "./store.js";
13
- import { isControllingVariants as E, isVariantNode as x } from "./utils/is-controlling-variants.js";
14
- import { transformProps as j } from "./utils/keys-transform.js";
15
- import { updateMotionValuesFromProps as y } from "./utils/motion-values.js";
16
- import { initPrefersReducedMotion as I } from "./utils/reduced-motion/index.js";
17
- import { resolveVariantFromProps as D } from "./utils/resolve-variants.js";
18
- import { hasReducedMotionListener as L, prefersReducedMotion as U } from "./utils/reduced-motion/state.js";
19
- import { frame as v, cancelFrame as g } from "../frameloop/frame.js";
20
- import { warnOnce as O } from "../../../../motion-utils/dist/es/warn-once.js";
21
- import { secondsToMilliseconds as _ } from "../../../../motion-utils/dist/es/time-conversion.js";
22
- import { isNumericalString as H } from "../../../../motion-utils/dist/es/is-numerical-string.js";
23
- import { isZeroValueString as K } from "../../../../motion-utils/dist/es/is-zero-value-string.js";
24
- import { SubscriptionManager as Y } from "../../../../motion-utils/dist/es/subscription-manager.js";
25
- const C = [
26
- "AnimationStart",
27
- "AnimationComplete",
28
- "Update",
29
- "BeforeLayoutMeasure",
30
- "LayoutMeasure",
31
- "LayoutAnimationStart",
32
- "LayoutAnimationComplete"
33
- ];
34
- let l = {};
35
- function ft(m) {
36
- l = m;
1
+ import { isNumericalString } from "../../../../motion-utils/dist/es/is-numerical-string.js";
2
+ import { isZeroValueString } from "../../../../motion-utils/dist/es/is-zero-value-string.js";
3
+ import { SubscriptionManager } from "../../../../motion-utils/dist/es/subscription-manager.js";
4
+ import { secondsToMilliseconds } from "../../../../motion-utils/dist/es/time-conversion.js";
5
+ import { warnOnce } from "../../../../motion-utils/dist/es/warn-once.js";
6
+ import { cancelFrame, frame } from "../frameloop/frame.js";
7
+ import { time } from "../frameloop/sync-time.js";
8
+ import { complex } from "../value/types/complex/index.js";
9
+ import { transformProps } from "./utils/keys-transform.js";
10
+ import { KeyframeResolver } from "../animation/keyframes/KeyframesResolver.js";
11
+ import { NativeAnimation } from "../animation/NativeAnimation.js";
12
+ import { acceleratedValues } from "../animation/waapi/utils/accelerated-values.js";
13
+ import { motionValue } from "../value/index.js";
14
+ import { resolveVariantFromProps } from "./utils/resolve-variants.js";
15
+ import { isMotionValue } from "../value/utils/is-motion-value.js";
16
+ import { getAnimatableNone } from "../value/types/utils/animatable-none.js";
17
+ import { microtask } from "../frameloop/microtask.js";
18
+ import { findValueType } from "../value/types/utils/find.js";
19
+ import { createBox } from "../projection/geometry/models.js";
20
+ import { visualElementStore } from "./store.js";
21
+ import { isControllingVariants, isVariantNode } from "./utils/is-controlling-variants.js";
22
+ import { updateMotionValuesFromProps } from "./utils/motion-values.js";
23
+ import { hasReducedMotionListener, prefersReducedMotion } from "./utils/reduced-motion/state.js";
24
+ import { initPrefersReducedMotion } from "./utils/reduced-motion/index.js";
25
+ var propEventHandlers = [
26
+ "AnimationStart",
27
+ "AnimationComplete",
28
+ "Update",
29
+ "BeforeLayoutMeasure",
30
+ "LayoutMeasure",
31
+ "LayoutAnimationStart",
32
+ "LayoutAnimationComplete"
33
+ ], featureDefinitions = {};
34
+ function setFeatureDefinitions(e) {
35
+ featureDefinitions = e;
37
36
  }
38
- function mt() {
39
- return l;
37
+ function getFeatureDefinitions() {
38
+ return featureDefinitions;
40
39
  }
41
- class Vt {
42
- /**
43
- * This method takes React props and returns found MotionValues. For example, HTML
44
- * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
45
- *
46
- * This isn't an abstract method as it needs calling in the constructor, but it is
47
- * intended to be one.
48
- */
49
- scrapeMotionValuesFromProps(t, e, i) {
50
- return {};
51
- }
52
- constructor({ parent: t, props: e, presenceContext: i, reducedMotionConfig: s, skipAnimations: n, blockInitialAnimation: r, visualState: d }, p = {}) {
53
- this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.shouldSkipAnimations = !1, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = M, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.hasBeenMounted = !1, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
54
- this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
55
- }, this.renderScheduledAt = 0, this.scheduleRender = () => {
56
- const a = w.now();
57
- this.renderScheduledAt < a && (this.renderScheduledAt = a, v.render(this.render, !1, !0));
58
- };
59
- const { latestValues: o, renderState: c } = d;
60
- this.latestValues = o, this.baseTarget = { ...o }, this.initialValues = e.initial ? { ...o } : {}, this.renderState = c, this.parent = t, this.props = e, this.presenceContext = i, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = s, this.skipAnimationsConfig = n, this.options = p, this.blockInitialAnimation = !!r, this.isControllingVariants = E(e), this.isVariantNode = x(e), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
61
- const { willChange: f, ...h } = this.scrapeMotionValuesFromProps(e, {}, this);
62
- for (const a in h) {
63
- const V = h[a];
64
- o[a] !== void 0 && u(V) && V.set(o[a]);
65
- }
66
- }
67
- mount(t) {
68
- if (this.hasBeenMounted)
69
- for (const e in this.initialValues)
70
- this.values.get(e)?.jump(this.initialValues[e]), this.latestValues[e] = this.initialValues[e];
71
- this.current = t, N.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((e, i) => this.bindToMotionValue(i, e)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (L.current || I(), this.shouldReduceMotion = U.current), process.env.NODE_ENV !== "production" && O(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.shouldSkipAnimations = this.skipAnimationsConfig ?? !1, this.parent?.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = !0;
72
- }
73
- unmount() {
74
- this.projection && this.projection.unmount(), g(this.notifyUpdate), g(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
75
- for (const t in this.events)
76
- this.events[t].clear();
77
- for (const t in this.features) {
78
- const e = this.features[t];
79
- e && (e.unmount(), e.isMounted = !1);
80
- }
81
- this.current = null;
82
- }
83
- addChild(t) {
84
- this.children.add(t), this.enteringChildren ?? (this.enteringChildren = /* @__PURE__ */ new Set()), this.enteringChildren.add(t);
85
- }
86
- removeChild(t) {
87
- this.children.delete(t), this.enteringChildren && this.enteringChildren.delete(t);
88
- }
89
- bindToMotionValue(t, e) {
90
- if (this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)(), e.accelerate && b.has(t) && this.current instanceof HTMLElement) {
91
- const { factory: r, keyframes: d, times: p, ease: o, duration: c } = e.accelerate, f = new S({
92
- element: this.current,
93
- name: t,
94
- keyframes: d,
95
- times: p,
96
- ease: o,
97
- duration: _(c)
98
- }), h = r(f);
99
- this.valueSubscriptions.set(t, () => {
100
- h(), f.cancel();
101
- });
102
- return;
103
- }
104
- const i = j.has(t);
105
- i && this.onBindTransform && this.onBindTransform();
106
- const s = e.on("change", (r) => {
107
- this.latestValues[t] = r, this.props.onUpdate && v.preRender(this.notifyUpdate), i && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
108
- });
109
- let n;
110
- typeof window < "u" && window.MotionCheckAppearSync && (n = window.MotionCheckAppearSync(this, t, e)), this.valueSubscriptions.set(t, () => {
111
- s(), n && n();
112
- });
113
- }
114
- sortNodePosition(t) {
115
- return !this.current || !this.sortInstanceNodePosition || this.type !== t.type ? 0 : this.sortInstanceNodePosition(this.current, t.current);
116
- }
117
- updateFeatures() {
118
- let t = "animation";
119
- for (t in l) {
120
- const e = l[t];
121
- if (!e)
122
- continue;
123
- const { isEnabled: i, Feature: s } = e;
124
- if (!this.features[t] && s && i(this.props) && (this.features[t] = new s(this)), this.features[t]) {
125
- const n = this.features[t];
126
- n.isMounted ? n.update() : (n.mount(), n.isMounted = !0);
127
- }
128
- }
129
- }
130
- triggerBuild() {
131
- this.build(this.renderState, this.latestValues, this.props);
132
- }
133
- /**
134
- * Measure the current viewport box with or without transforms.
135
- * Only measures axis-aligned boxes, rotate and skew must be manually
136
- * removed with a re-render to work.
137
- */
138
- measureViewportBox() {
139
- return this.current ? this.measureInstanceViewportBox(this.current, this.props) : P();
140
- }
141
- getStaticValue(t) {
142
- return this.latestValues[t];
143
- }
144
- setStaticValue(t, e) {
145
- this.latestValues[t] = e;
146
- }
147
- /**
148
- * Update the provided props. Ensure any newly-added motion values are
149
- * added to our map, old ones removed, and listeners updated.
150
- */
151
- update(t, e) {
152
- (t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = e;
153
- for (let i = 0; i < C.length; i++) {
154
- const s = C[i];
155
- this.propEventSubscriptions[s] && (this.propEventSubscriptions[s](), delete this.propEventSubscriptions[s]);
156
- const n = "on" + s, r = t[n];
157
- r && (this.propEventSubscriptions[s] = this.on(s, r));
158
- }
159
- this.prevMotionValues = y(this, this.scrapeMotionValuesFromProps(t, this.prevProps || {}, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
160
- }
161
- getProps() {
162
- return this.props;
163
- }
164
- /**
165
- * Returns the variant definition with a given name.
166
- */
167
- getVariant(t) {
168
- return this.props.variants ? this.props.variants[t] : void 0;
169
- }
170
- /**
171
- * Returns the defined default transition on this component.
172
- */
173
- getDefaultTransition() {
174
- return this.props.transition;
175
- }
176
- getTransformPagePoint() {
177
- return this.props.transformPagePoint;
178
- }
179
- getClosestVariantNode() {
180
- return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
181
- }
182
- /**
183
- * Add a child visual element to our set of children.
184
- */
185
- addVariantChild(t) {
186
- const e = this.getClosestVariantNode();
187
- if (e)
188
- return e.variantChildren && e.variantChildren.add(t), () => e.variantChildren.delete(t);
189
- }
190
- /**
191
- * Add a motion value and bind it to this visual element.
192
- */
193
- addValue(t, e) {
194
- const i = this.values.get(t);
195
- e !== i && (i && this.removeValue(t), this.bindToMotionValue(t, e), this.values.set(t, e), this.latestValues[t] = e.get());
196
- }
197
- /**
198
- * Remove a motion value and unbind any active subscriptions.
199
- */
200
- removeValue(t) {
201
- this.values.delete(t);
202
- const e = this.valueSubscriptions.get(t);
203
- e && (e(), this.valueSubscriptions.delete(t)), delete this.latestValues[t], this.removeValueFromRenderState(t, this.renderState);
204
- }
205
- /**
206
- * Check whether we have a motion value for this key
207
- */
208
- hasValue(t) {
209
- return this.values.has(t);
210
- }
211
- getValue(t, e) {
212
- if (this.props.values && this.props.values[t])
213
- return this.props.values[t];
214
- let i = this.values.get(t);
215
- return i === void 0 && e !== void 0 && (i = F(e === null ? void 0 : e, { owner: this }), this.addValue(t, i)), i;
216
- }
217
- /**
218
- * If we're trying to animate to a previously unencountered value,
219
- * we need to check for it in our state and as a last resort read it
220
- * directly from the instance (which might have performance implications).
221
- */
222
- readValue(t, e) {
223
- let i = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : this.getBaseTargetFromProps(this.props, t) ?? this.readValueFromInstance(this.current, t, this.options);
224
- return i != null && (typeof i == "string" && (H(i) || K(i)) ? i = parseFloat(i) : !R(i) && A.test(e) && (i = B(t, e)), this.setBaseTarget(t, u(i) ? i.get() : i)), u(i) ? i.get() : i;
225
- }
226
- /**
227
- * Set the base target to later animate back to. This is currently
228
- * only hydrated on creation and when we first read a value.
229
- */
230
- setBaseTarget(t, e) {
231
- this.baseTarget[t] = e;
232
- }
233
- /**
234
- * Find the base target for a value thats been removed from all animation
235
- * props.
236
- */
237
- getBaseTarget(t) {
238
- const { initial: e } = this.props;
239
- let i;
240
- if (typeof e == "string" || typeof e == "object") {
241
- const n = D(this.props, e, this.presenceContext?.custom);
242
- n && (i = n[t]);
243
- }
244
- if (e && i !== void 0)
245
- return i;
246
- const s = this.getBaseTargetFromProps(this.props, t);
247
- return s !== void 0 && !u(s) ? s : this.initialValues[t] !== void 0 && i === void 0 ? void 0 : this.baseTarget[t];
248
- }
249
- on(t, e) {
250
- return this.events[t] || (this.events[t] = new Y()), this.events[t].add(e);
251
- }
252
- notify(t, ...e) {
253
- this.events[t] && this.events[t].notify(...e);
254
- }
255
- scheduleRenderMicrotask() {
256
- T.render(this.render);
257
- }
258
- }
259
- export {
260
- Vt as VisualElement,
261
- mt as getFeatureDefinitions,
262
- ft as setFeatureDefinitions
40
+ var VisualElement = class {
41
+ scrapeMotionValuesFromProps(e, y, b) {
42
+ return {};
43
+ }
44
+ constructor({ parent: e, props: y, presenceContext: b, reducedMotionConfig: x, skipAnimations: S, blockInitialAnimation: C, visualState: E }, D = {}) {
45
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.shouldSkipAnimations = !1, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.hasBeenMounted = !1, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
46
+ this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
47
+ }, this.renderScheduledAt = 0, this.scheduleRender = () => {
48
+ let e = time.now();
49
+ this.renderScheduledAt < e && (this.renderScheduledAt = e, frame.render(this.render, !1, !0));
50
+ };
51
+ let { latestValues: O, renderState: k } = E;
52
+ this.latestValues = O, this.baseTarget = { ...O }, this.initialValues = y.initial ? { ...O } : {}, this.renderState = k, this.parent = e, this.props = y, this.presenceContext = b, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = x, this.skipAnimationsConfig = S, this.options = D, this.blockInitialAnimation = !!C, this.isControllingVariants = isControllingVariants(y), this.isVariantNode = isVariantNode(y), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
53
+ let { willChange: A, ...j } = this.scrapeMotionValuesFromProps(y, {}, this);
54
+ for (let e in j) {
55
+ let y = j[e];
56
+ O[e] !== void 0 && isMotionValue(y) && y.set(O[e]);
57
+ }
58
+ }
59
+ mount(e) {
60
+ if (this.hasBeenMounted) for (let e in this.initialValues) this.values.get(e)?.jump(this.initialValues[e]), this.latestValues[e] = this.initialValues[e];
61
+ this.current = e, visualElementStore.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((e, y) => this.bindToMotionValue(y, e)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (hasReducedMotionListener.current || initPrefersReducedMotion(), this.shouldReduceMotion = prefersReducedMotion.current), process.env.NODE_ENV !== "production" && warnOnce(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.shouldSkipAnimations = this.skipAnimationsConfig ?? !1, this.parent?.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = !0;
62
+ }
63
+ unmount() {
64
+ for (let e in this.projection && this.projection.unmount(), cancelFrame(this.notifyUpdate), cancelFrame(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this), this.events) this.events[e].clear();
65
+ for (let e in this.features) {
66
+ let y = this.features[e];
67
+ y && (y.unmount(), y.isMounted = !1);
68
+ }
69
+ this.current = null;
70
+ }
71
+ addChild(e) {
72
+ this.children.add(e), this.enteringChildren ??= /* @__PURE__ */ new Set(), this.enteringChildren.add(e);
73
+ }
74
+ removeChild(e) {
75
+ this.children.delete(e), this.enteringChildren && this.enteringChildren.delete(e);
76
+ }
77
+ bindToMotionValue(e, y) {
78
+ if (this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)(), y.accelerate && acceleratedValues.has(e) && this.current instanceof HTMLElement) {
79
+ let { factory: b, keyframes: S, times: C, ease: w, duration: T } = y.accelerate, E = new NativeAnimation({
80
+ element: this.current,
81
+ name: e,
82
+ keyframes: S,
83
+ times: C,
84
+ ease: w,
85
+ duration: secondsToMilliseconds(T)
86
+ }), D = b(E);
87
+ this.valueSubscriptions.set(e, () => {
88
+ D(), E.cancel();
89
+ });
90
+ return;
91
+ }
92
+ let b = transformProps.has(e);
93
+ b && this.onBindTransform && this.onBindTransform();
94
+ let S = y.on("change", (y) => {
95
+ this.latestValues[e] = y, this.props.onUpdate && frame.preRender(this.notifyUpdate), b && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
96
+ }), C;
97
+ typeof window < "u" && window.MotionCheckAppearSync && (C = window.MotionCheckAppearSync(this, e, y)), this.valueSubscriptions.set(e, () => {
98
+ S(), C && C();
99
+ });
100
+ }
101
+ sortNodePosition(e) {
102
+ return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
103
+ }
104
+ updateFeatures() {
105
+ let e = "animation";
106
+ for (e in featureDefinitions) {
107
+ let y = featureDefinitions[e];
108
+ if (!y) continue;
109
+ let { isEnabled: b, Feature: x } = y;
110
+ if (!this.features[e] && x && b(this.props) && (this.features[e] = new x(this)), this.features[e]) {
111
+ let y = this.features[e];
112
+ y.isMounted ? y.update() : (y.mount(), y.isMounted = !0);
113
+ }
114
+ }
115
+ }
116
+ triggerBuild() {
117
+ this.build(this.renderState, this.latestValues, this.props);
118
+ }
119
+ measureViewportBox() {
120
+ return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox();
121
+ }
122
+ getStaticValue(e) {
123
+ return this.latestValues[e];
124
+ }
125
+ setStaticValue(e, y) {
126
+ this.latestValues[e] = y;
127
+ }
128
+ update(e, y) {
129
+ (e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = y;
130
+ for (let y = 0; y < propEventHandlers.length; y++) {
131
+ let b = propEventHandlers[y];
132
+ this.propEventSubscriptions[b] && (this.propEventSubscriptions[b](), delete this.propEventSubscriptions[b]);
133
+ let x = e["on" + b];
134
+ x && (this.propEventSubscriptions[b] = this.on(b, x));
135
+ }
136
+ this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(e, this.prevProps || {}, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
137
+ }
138
+ getProps() {
139
+ return this.props;
140
+ }
141
+ getVariant(e) {
142
+ return this.props.variants ? this.props.variants[e] : void 0;
143
+ }
144
+ getDefaultTransition() {
145
+ return this.props.transition;
146
+ }
147
+ getTransformPagePoint() {
148
+ return this.props.transformPagePoint;
149
+ }
150
+ getClosestVariantNode() {
151
+ return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
152
+ }
153
+ addVariantChild(e) {
154
+ let y = this.getClosestVariantNode();
155
+ if (y) return y.variantChildren && y.variantChildren.add(e), () => y.variantChildren.delete(e);
156
+ }
157
+ addValue(e, y) {
158
+ let b = this.values.get(e);
159
+ y !== b && (b && this.removeValue(e), this.bindToMotionValue(e, y), this.values.set(e, y), this.latestValues[e] = y.get());
160
+ }
161
+ removeValue(e) {
162
+ this.values.delete(e);
163
+ let y = this.valueSubscriptions.get(e);
164
+ y && (y(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
165
+ }
166
+ hasValue(e) {
167
+ return this.values.has(e);
168
+ }
169
+ getValue(e, y) {
170
+ if (this.props.values && this.props.values[e]) return this.props.values[e];
171
+ let b = this.values.get(e);
172
+ return b === void 0 && y !== void 0 && (b = motionValue(y === null ? void 0 : y, { owner: this }), this.addValue(e, b)), b;
173
+ }
174
+ readValue(b, x) {
175
+ let S = this.latestValues[b] !== void 0 || !this.current ? this.latestValues[b] : this.getBaseTargetFromProps(this.props, b) ?? this.readValueFromInstance(this.current, b, this.options);
176
+ return S != null && (typeof S == "string" && (isNumericalString(S) || isZeroValueString(S)) ? S = parseFloat(S) : !findValueType(S) && complex.test(x) && (S = getAnimatableNone(b, x)), this.setBaseTarget(b, isMotionValue(S) ? S.get() : S)), isMotionValue(S) ? S.get() : S;
177
+ }
178
+ setBaseTarget(e, y) {
179
+ this.baseTarget[e] = y;
180
+ }
181
+ getBaseTarget(e) {
182
+ let { initial: y } = this.props, b;
183
+ if (typeof y == "string" || typeof y == "object") {
184
+ let x = resolveVariantFromProps(this.props, y, this.presenceContext?.custom);
185
+ x && (b = x[e]);
186
+ }
187
+ if (y && b !== void 0) return b;
188
+ let x = this.getBaseTargetFromProps(this.props, e);
189
+ return x !== void 0 && !isMotionValue(x) ? x : this.initialValues[e] !== void 0 && b === void 0 ? void 0 : this.baseTarget[e];
190
+ }
191
+ on(e, y) {
192
+ return this.events[e] || (this.events[e] = new SubscriptionManager()), this.events[e].add(y);
193
+ }
194
+ notify(e, ...y) {
195
+ this.events[e] && this.events[e].notify(...y);
196
+ }
197
+ scheduleRenderMicrotask() {
198
+ microtask.render(this.render);
199
+ }
263
200
  };
201
+ export { VisualElement, getFeatureDefinitions, setFeatureDefinitions };
@@ -1,28 +1,26 @@
1
- import { isMotionValue as r } from "../../value/utils/is-motion-value.js";
2
- import { DOMKeyframesResolver as o } from "../../animation/keyframes/DOMKeyframesResolver.js";
3
- import { VisualElement as s } from "../VisualElement.js";
4
- class a extends s {
5
- constructor() {
6
- super(...arguments), this.KeyframeResolver = o;
7
- }
8
- sortInstanceNodePosition(e, t) {
9
- return e.compareDocumentPosition(t) & 2 ? 1 : -1;
10
- }
11
- getBaseTargetFromProps(e, t) {
12
- const i = e.style;
13
- return i ? i[t] : void 0;
14
- }
15
- removeValueFromRenderState(e, { vars: t, style: i }) {
16
- delete t[e], delete i[e];
17
- }
18
- handleChildMotionValue() {
19
- this.childSubscription && (this.childSubscription(), delete this.childSubscription);
20
- const { children: e } = this.props;
21
- r(e) && (this.childSubscription = e.on("change", (t) => {
22
- this.current && (this.current.textContent = `${t}`);
23
- }));
24
- }
25
- }
26
- export {
27
- a as DOMVisualElement
1
+ import { isMotionValue } from "../../value/utils/is-motion-value.js";
2
+ import { DOMKeyframesResolver } from "../../animation/keyframes/DOMKeyframesResolver.js";
3
+ import { VisualElement } from "../VisualElement.js";
4
+ var DOMVisualElement = class extends VisualElement {
5
+ constructor() {
6
+ super(...arguments), this.KeyframeResolver = DOMKeyframesResolver;
7
+ }
8
+ sortInstanceNodePosition(e, n) {
9
+ return e.compareDocumentPosition(n) & 2 ? 1 : -1;
10
+ }
11
+ getBaseTargetFromProps(e, n) {
12
+ let r = e.style;
13
+ return r ? r[n] : void 0;
14
+ }
15
+ removeValueFromRenderState(e, { vars: n, style: r }) {
16
+ delete n[e], delete r[e];
17
+ }
18
+ handleChildMotionValue() {
19
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
20
+ let { children: n } = this.props;
21
+ isMotionValue(n) && (this.childSubscription = n.on("change", (e) => {
22
+ this.current && (this.current.textContent = `${e}`);
23
+ }));
24
+ }
28
25
  };
26
+ export { DOMVisualElement };
@@ -1,4 +1,2 @@
1
- const s = (t) => t.startsWith("--");
2
- export {
3
- s as isCSSVar
4
- };
1
+ var isCSSVar = (e) => e.startsWith("--");
2
+ export { isCSSVar };