@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,209 +1,225 @@
1
- import { jsxs as L, jsx as v, Fragment as et } from "react/jsx-runtime";
2
- import p from "react";
3
- import "../../utils/contextStore.js";
4
- import "merge-props";
5
- import { withAlpha as I, hashToColor as A } from "../../utils/color.js";
6
- import { GanttItem as rt } from "./GanttItem.js";
7
- import { GanttHeader as nt } from "./GanttHeader.js";
8
- const ot = 3, st = (h) => {
9
- const l = Math.pow(10, Math.floor(Math.log10(h))), u = h / l;
10
- return (u < 1.5 ? 1 : u < 3 ? 2 : u < 7 ? 5 : 10) * l;
11
- }, it = (h) => {
12
- const {
13
- items: l,
14
- stepWidth: u = "50px",
15
- rowHeight: W = "50px",
16
- step: i = 1,
17
- start: f = 1,
18
- end: $ = 999999999,
19
- hideScaling: T = !1,
20
- children: y
21
- } = h, E = p.useRef(null), [D, N] = p.useState(0), [V, F] = p.useState(void 0), [S, H] = p.useState({
22
- scrollLeft: 0,
23
- clientWidth: 0,
24
- scrollWidth: 0
25
- }), m = p.useMemo(() => parseInt(u), [u]), O = $ - f, P = Math.ceil(O / i), {
26
- avgDuration: j,
27
- itemMinStart: G,
28
- itemMaxEnd: w
29
- } = p.useMemo(() => {
30
- if (!l || l.length === 0)
31
- return {
32
- avgDuration: i,
33
- itemMinStart: f,
34
- itemMaxEnd: $
35
- };
36
- let r = 0, e = 0, t = 1 / 0, n = -1 / 0;
37
- for (let o = 0; o < l.length; o++) {
38
- const c = l[o];
39
- c.start < t && (t = c.start), c.end > n && (n = c.end), c.type !== "group" && (r += c.end - c.start, e++);
40
- }
41
- return {
42
- avgDuration: e === 0 ? i : r / e,
43
- itemMinStart: t,
44
- itemMaxEnd: n
45
- };
46
- }, [l, f, $, i]), {
47
- effTime: M,
48
- invEffTime: b,
49
- inGap: z
50
- } = p.useMemo(() => {
51
- const r = ot * i, e = [], t = (l ?? []).map((s) => [s.start, s.end]).sort((s, a) => s[0] - a[0]);
52
- for (const [s, a] of t) {
53
- const d = e[e.length - 1];
54
- d && s <= d[1] ? d[1] = Math.max(d[1], a) : e.push([s, a]);
55
- }
56
- const n = [];
57
- let o = 0;
58
- for (let s = 1; s < e.length; s++) {
59
- const a = e[s - 1][1], d = e[s][0];
60
- if (d - a <= r) continue;
61
- const tt = Math.round((a - o + r - f) / i), R = f + tt * i, k = d - o - R;
62
- n.push({
63
- gapStart: a,
64
- gapEnd: d,
65
- effGapEnd: R,
66
- remove: k
67
- }), o += k;
68
- }
69
- return {
70
- effTime: (s) => {
71
- let a = s;
72
- for (const d of n)
73
- s >= d.gapEnd ? a -= d.remove : s > d.gapStart && (a = Math.min(a, d.effGapEnd));
74
- return a;
75
- },
76
- invEffTime: (s) => {
77
- let a = s;
78
- for (const d of n)
79
- s >= d.effGapEnd && (a += d.remove);
80
- return a;
81
- },
82
- inGap: (s) => n.some((a) => s > a.gapStart && s < a.gapEnd)
83
- };
84
- }, [l, i, f]), x = (r, e) => {
85
- const t = Math.max(f, M(r)), n = M(e), o = (t - f) / i * m, c = (n - t) / i * m;
86
- return {
87
- left: o,
88
- width: c
89
- };
90
- }, U = l && l.length > 0 ? Math.ceil((M(w) - f) / i) : P, X = Math.ceil(D / m), g = Math.max(X, U + 2), {
91
- headerTicks: q,
92
- headerInterval: B
93
- } = p.useMemo(() => {
94
- const r = st(i * 3), e = [];
95
- if (!(r > 0)) return {
96
- headerTicks: e,
97
- headerInterval: 1
98
- };
99
- const t = b(f + g * i), n = Math.ceil(f / r) * r;
100
- for (let o = 0; n + o * r <= t; o++) {
101
- const c = n + o * r;
102
- z(c) || e.push({
103
- time: c,
104
- left: (M(c) - f) / i * m
105
- });
106
- }
107
- return {
108
- headerTicks: e,
109
- headerInterval: r
110
- };
111
- }, [M, b, z, f, i, g, m]);
112
- p.useEffect(() => {
113
- const r = () => {
114
- N(E.current?.offsetWidth ?? 0);
115
- };
116
- r();
117
- const e = E.current;
118
- return e?.addEventListener("resize", r), window.addEventListener("resize", r), () => {
119
- window.removeEventListener("resize", r), e?.removeEventListener("resize", r);
120
- };
121
- }, []), p.useEffect(() => {
122
- const r = E.current;
123
- if (!r) return;
124
- const e = r.closest("[data-radix-scroll-area-viewport]");
125
- if (!e) return;
126
- const t = () => H({
127
- scrollLeft: e.scrollLeft,
128
- clientWidth: e.clientWidth,
129
- scrollWidth: e.scrollWidth
130
- });
131
- t(), e.addEventListener("scroll", t, {
132
- passive: !0
133
- }), window.addEventListener("resize", t);
134
- const n = new ResizeObserver(t);
135
- return n.observe(e), n.observe(r), () => {
136
- e.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect();
137
- };
138
- }, []);
139
- const J = S.scrollLeft > 1, K = S.scrollLeft + S.clientWidth < S.scrollWidth - 1, Q = l?.length ? l.sort((r, e) => r.start - e.start).reduce((r, e) => {
140
- const t = r.find((n) => !n.some((o) => !(e.end <= o.start || e.start >= o.end)));
141
- return t ? (t.push(e), r) : [...r, [e]];
142
- }, []) : [], Y = p.useMemo(() => ({
143
- display: "grid",
144
- gridTemplateColumns: `repeat(${g}, ${u})`,
145
- minWidth: "100%",
146
- gridColumn: "1 / -1",
147
- position: "relative"
148
- }), [g, u]), Z = p.useMemo(() => ({
149
- gridColumn: "1 / -1",
150
- minHeight: W,
151
- position: "relative",
152
- backgroundColor: "transparent"
153
- }), [W]), _ = p.useMemo(() => Array.from({
154
- length: Math.max(0, g - 1)
155
- }), [g]);
156
- return /* @__PURE__ */ L("div", { "data-gantt-id": h.id, id: h.id, ref: E, style: Y, children: [
157
- !T && /* @__PURE__ */ v(nt, { ticks: q, interval: B, avgDuration: j, stepWidth: u, canScrollLeft: J, canScrollRight: K }),
158
- Q.map((r, e) => /* @__PURE__ */ L(p.Fragment, { children: [
159
- /* @__PURE__ */ L("div", { style: Z, children: [
160
- _.map((t, n) => /* @__PURE__ */ v("div", { style: {
161
- position: "absolute",
162
- left: (n + 1) * m,
163
- top: 0,
164
- bottom: 0,
165
- width: "0px",
166
- borderLeft: `1px dashed rgba(255, 255, 255, ${T ? 0.05 : 0.1})`
167
- } }, `grid-${n}`)),
168
- T && /* @__PURE__ */ L(et, { children: [
169
- /* @__PURE__ */ v("div", { className: "gantt__group-wrapper", style: {
170
- backgroundImage: `
1
+ import { hashToColor, withAlpha } from "../../utils/color.js";
2
+ import "../../utils/index.js";
3
+ import { GanttItem } from "./GanttItem.js";
4
+ import { GanttHeader } from "./GanttHeader.js";
5
+ import React from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ var MAX_GAP_COLUMNS = 3, niceInterval = (n) => {
8
+ let r = 10 ** Math.floor(Math.log10(n)), i = n / r;
9
+ return (i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10) * r;
10
+ };
11
+ const GanttGroup = (d) => {
12
+ let { items: f, stepWidth: p = "50px", rowHeight: m = "50px", step: h = 1, start: g = 1, end: _ = 999999999, hideScaling: v = !1, children: y } = d, b = React.useRef(null), [x, S] = React.useState(0), [C, w] = React.useState(void 0), [T, E] = React.useState({
13
+ scrollLeft: 0,
14
+ clientWidth: 0,
15
+ scrollWidth: 0
16
+ }), D = React.useMemo(() => parseInt(p), [p]), O = _ - g, k = Math.ceil(O / h);
17
+ k * D;
18
+ let { avgDuration: A, itemMinStart: j, itemMaxEnd: M } = React.useMemo(() => {
19
+ if (!f || f.length === 0) return {
20
+ avgDuration: h,
21
+ itemMinStart: g,
22
+ itemMaxEnd: _
23
+ };
24
+ let n = 0, r = 0, i = Infinity, a = -Infinity;
25
+ for (let o = 0; o < f.length; o++) {
26
+ let s = f[o];
27
+ s.start < i && (i = s.start), s.end > a && (a = s.end), s.type !== "group" && (n += s.end - s.start, r++);
28
+ }
29
+ return {
30
+ avgDuration: r === 0 ? h : n / r,
31
+ itemMinStart: i,
32
+ itemMaxEnd: a
33
+ };
34
+ }, [
35
+ f,
36
+ g,
37
+ _,
38
+ h
39
+ ]), { effTime: N, invEffTime: P, inGap: F } = React.useMemo(() => {
40
+ let n = MAX_GAP_COLUMNS * h, r = [], i = (f ?? []).map((n) => [n.start, n.end]).sort((n, r) => n[0] - r[0]);
41
+ for (let [n, a] of i) {
42
+ let i = r[r.length - 1];
43
+ i && n <= i[1] ? i[1] = Math.max(i[1], a) : r.push([n, a]);
44
+ }
45
+ let a = [], o = 0;
46
+ for (let i = 1; i < r.length; i++) {
47
+ let s = r[i - 1][1], c = r[i][0];
48
+ if (c - s <= n) continue;
49
+ let l = g + Math.round((s - o + n - g) / h) * h, u = c - o - l;
50
+ a.push({
51
+ gapStart: s,
52
+ gapEnd: c,
53
+ effGapEnd: l,
54
+ remove: u
55
+ }), o += u;
56
+ }
57
+ return {
58
+ effTime: (n) => {
59
+ let r = n;
60
+ for (let i of a) n >= i.gapEnd ? r -= i.remove : n > i.gapStart && (r = Math.min(r, i.effGapEnd));
61
+ return r;
62
+ },
63
+ invEffTime: (n) => {
64
+ let r = n;
65
+ for (let i of a) n >= i.effGapEnd && (r += i.remove);
66
+ return r;
67
+ },
68
+ inGap: (n) => a.some((r) => n > r.gapStart && n < r.gapEnd)
69
+ };
70
+ }, [
71
+ f,
72
+ h,
73
+ g
74
+ ]), I = (n, r) => {
75
+ let i = Math.max(g, N(n)), a = N(r);
76
+ return {
77
+ left: (i - g) / h * D,
78
+ width: (a - i) / h * D
79
+ };
80
+ }, L = f && f.length > 0 ? Math.ceil((N(M) - g) / h) : k, R = Math.ceil(x / D), z = Math.max(R, L + 2), { headerTicks: B, headerInterval: V } = React.useMemo(() => {
81
+ let n = niceInterval(h * 3), r = [];
82
+ if (!(n > 0)) return {
83
+ headerTicks: r,
84
+ headerInterval: 1
85
+ };
86
+ let i = P(g + z * h), a = Math.ceil(g / n) * n;
87
+ for (let o = 0; a + o * n <= i; o++) {
88
+ let i = a + o * n;
89
+ F(i) || r.push({
90
+ time: i,
91
+ left: (N(i) - g) / h * D
92
+ });
93
+ }
94
+ return {
95
+ headerTicks: r,
96
+ headerInterval: n
97
+ };
98
+ }, [
99
+ N,
100
+ P,
101
+ F,
102
+ g,
103
+ h,
104
+ z,
105
+ D
106
+ ]);
107
+ React.useEffect(() => {
108
+ let n = () => {
109
+ S(b.current?.offsetWidth ?? 0);
110
+ };
111
+ n();
112
+ let r = b.current;
113
+ return r?.addEventListener("resize", n), window.addEventListener("resize", n), () => {
114
+ window.removeEventListener("resize", n), r?.removeEventListener("resize", n);
115
+ };
116
+ }, []), React.useEffect(() => {
117
+ let n = b.current;
118
+ if (!n) return;
119
+ let r = n.closest("[data-radix-scroll-area-viewport]");
120
+ if (!r) return;
121
+ let i = () => E({
122
+ scrollLeft: r.scrollLeft,
123
+ clientWidth: r.clientWidth,
124
+ scrollWidth: r.scrollWidth
125
+ });
126
+ i(), r.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i);
127
+ let a = new ResizeObserver(i);
128
+ return a.observe(r), a.observe(n), () => {
129
+ r.removeEventListener("scroll", i), window.removeEventListener("resize", i), a.disconnect();
130
+ };
131
+ }, []);
132
+ let H = T.scrollLeft > 1, U = T.scrollLeft + T.clientWidth < T.scrollWidth - 1, W = f?.length ? f.sort((n, r) => n.start - r.start).reduce((n, r) => {
133
+ let i = n.find((n) => !n.some((n) => !(r.end <= n.start || r.start >= n.end)));
134
+ return i ? (i.push(r), n) : [...n, [r]];
135
+ }, []) : [], G = React.useMemo(() => ({
136
+ display: "grid",
137
+ gridTemplateColumns: `repeat(${z}, ${p})`,
138
+ minWidth: "100%",
139
+ gridColumn: "1 / -1",
140
+ position: "relative"
141
+ }), [z, p]), K = React.useMemo(() => ({
142
+ gridColumn: "1 / -1",
143
+ minHeight: m,
144
+ position: "relative",
145
+ backgroundColor: "transparent"
146
+ }), [m]), q = React.useMemo(() => Array.from({ length: Math.max(0, z - 1) }), [z]);
147
+ return /* @__PURE__ */ jsxs("div", {
148
+ "data-gantt-id": d.id,
149
+ id: d.id,
150
+ ref: b,
151
+ style: G,
152
+ children: [!v && /* @__PURE__ */ jsx(GanttHeader, {
153
+ ticks: B,
154
+ interval: V,
155
+ avgDuration: A,
156
+ stepWidth: p,
157
+ canScrollLeft: H,
158
+ canScrollRight: U
159
+ }), W.map((a, u) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsxs("div", {
160
+ style: K,
161
+ children: [
162
+ q.map((n, r) => /* @__PURE__ */ jsx("div", { style: {
163
+ position: "absolute",
164
+ left: (r + 1) * D,
165
+ top: 0,
166
+ bottom: 0,
167
+ width: "0px",
168
+ borderLeft: `1px dashed rgba(255, 255, 255, ${v ? .05 : .1})`
169
+ } }, `grid-${r}`)),
170
+ v && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
171
+ className: "gantt__group-wrapper",
172
+ style: {
173
+ backgroundImage: `
171
174
  linear-gradient(to right, transparent, #070514),
172
175
  repeating-linear-gradient(
173
176
  45deg,
174
177
  transparent,
175
178
  transparent 2px,
176
- ${I(A(h.id.replace("target", "source")), 0.5)} 4px
179
+ ${withAlpha(hashToColor(d.id.replace("target", "source")), .5)} 4px
177
180
  )
178
181
  `,
179
- left: `${x(G, G + i).left}px`,
180
- width: `${x(G, G + i).width}px`
181
- } }),
182
- /* @__PURE__ */ v("div", { className: "gantt__group-wrapper", style: {
183
- backgroundImage: `
182
+ left: `${I(j, j + h).left}px`,
183
+ width: `${I(j, j + h).width}px`
184
+ }
185
+ }), /* @__PURE__ */ jsx("div", {
186
+ className: "gantt__group-wrapper",
187
+ style: {
188
+ backgroundImage: `
184
189
  linear-gradient(to left, transparent, #070514),
185
190
  repeating-linear-gradient(
186
191
  45deg,
187
192
  transparent,
188
193
  transparent 2px,
189
- ${I(A(h.id.replace("target", "source")), 0.5)} 4px
194
+ ${withAlpha(hashToColor(d.id.replace("target", "source")), .5)} 4px
190
195
  )
191
196
  `,
192
- left: `${x(w - i, w).left}px`,
193
- width: `${x(w - i, w).width}px`
194
- } })
195
- ] }),
196
- r.map((t, n) => {
197
- const o = x(t.start, t.end);
198
- return o.width > 0 && /* @__PURE__ */ v(rt, { id: t.id, w: `${o.width}px`, left: `${o.left}px`, onClick: () => {
199
- t.type == "group" && F((C) => t.id === C ? void 0 : t.id);
200
- }, children: y?.(t, n) }, t.id);
201
- })
202
- ] }, `row-${e}`),
203
- r.map((t, n) => t.type === "group" && V === t.id && /* @__PURE__ */ v(it, { children: y, id: `group-target-${n}`, start: Math.min(...t.data.items.map((o) => o.start)) - Math.min(...t.data.items.map((o) => o.start)) / (t.data.firstGroupStep * t.data.step) * (t.data.groupStep * t.data.step), step: t.data.groupStep * t.data.step, stepWidth: u, rowHeight: W, items: t.data.items }, `group-target-${n}`))
204
- ] }, `row-frag-${e}`))
205
- ] });
206
- };
207
- export {
208
- it as GanttGroup
197
+ left: `${I(M - h, M).left}px`,
198
+ width: `${I(M - h, M).width}px`
199
+ }
200
+ })] }),
201
+ a.map((n, r) => {
202
+ let a = I(n.start, n.end);
203
+ return a.width > 0 && /* @__PURE__ */ jsx(GanttItem, {
204
+ id: n.id,
205
+ w: `${a.width}px`,
206
+ left: `${a.left}px`,
207
+ onClick: () => {
208
+ n.type == "group" && w((r) => n.id === r ? void 0 : n.id);
209
+ },
210
+ children: y?.(n, r)
211
+ }, n.id);
212
+ })
213
+ ]
214
+ }, `row-${u}`), a.map((n, r) => n.type === "group" && C === n.id && /* @__PURE__ */ jsx(GanttGroup, {
215
+ children: y,
216
+ id: `group-target-${r}`,
217
+ start: Math.min(...n.data.items.map((n) => n.start)) - Math.min(...n.data.items.map((n) => n.start)) / (n.data.firstGroupStep * n.data.step) * (n.data.groupStep * n.data.step),
218
+ step: n.data.groupStep * n.data.step,
219
+ stepWidth: p,
220
+ rowHeight: m,
221
+ items: n.data.items
222
+ }, `group-target-${r}`))] }, `row-frag-${u}`))]
223
+ });
209
224
  };
225
+ export { GanttGroup };
@@ -1,82 +1,80 @@
1
- import { jsx as a, jsxs as L } from "react/jsx-runtime";
2
- import { c as z } from "../../_virtual/compiler-runtime.js";
3
- import "../../utils/contextStore.js";
4
- import "react";
5
- import { mergeComponentProps as I } from "../../utils/component.js";
6
- import "js-md5";
7
- import { Text as $ } from "../text/Text.js";
8
- import { IconChevronLeft as W, IconChevronRight as w } from "@tabler/icons-react";
9
- const J = (t) => {
10
- const e = z.c(33);
11
- let s, n, l, c, i, o, m;
12
- if (e[0] !== t) {
13
- const {
14
- avgDuration: r,
15
- stepWidth: N,
16
- canScrollLeft: v,
17
- canScrollRight: R,
18
- ticks: C,
19
- interval: b,
20
- ...F
21
- } = t;
22
- i = N, s = v, n = R, m = C;
23
- let p;
24
- e[8] !== r ? (p = k(r), e[8] = r, e[9] = p) : p = e[9], c = p;
25
- let x;
26
- e[10] !== b ? (x = (M) => {
27
- const {
28
- value: T,
29
- unit: S
30
- } = k(M), j = Math.max(0, Math.ceil(-Math.log10(b / y(S))));
31
- return `${parseFloat(T.toFixed(j))}${S}`;
32
- }, e[10] = b, e[11] = x) : x = e[11], l = x, o = I("gantt__header", F), e[0] = t, e[1] = s, e[2] = n, e[3] = l, e[4] = c, e[5] = i, e[6] = o, e[7] = m;
33
- } else
34
- s = e[1], n = e[2], l = e[3], c = e[4], i = e[5], o = e[6], m = e[7];
35
- let h;
36
- e[12] !== s ? (h = s && /* @__PURE__ */ a("div", { className: "gantt__header-scroll gantt__header-scroll--left", children: /* @__PURE__ */ a(W, { size: 16 }) }), e[12] = s, e[13] = h) : h = e[13];
37
- let d;
38
- e[14] !== c.unit ? (d = /* @__PURE__ */ a("div", { className: "gantt__header-label-column", children: /* @__PURE__ */ L($, { className: "gantt__header-label", children: [
39
- "Range in ",
40
- c.unit
41
- ] }) }), e[14] = c.unit, e[15] = d) : d = e[15];
42
- let f;
43
- e[16] !== h || e[17] !== d ? (f = /* @__PURE__ */ L("div", { className: "gantt__header-start", children: [
44
- h,
45
- d
46
- ] }), e[16] = h, e[17] = d, e[18] = f) : f = e[18];
47
- let _;
48
- if (e[19] !== l || e[20] !== i || e[21] !== m) {
49
- let r;
50
- e[23] !== l || e[24] !== i ? (r = (N) => {
51
- const {
52
- time: v,
53
- left: R
54
- } = N;
55
- return /* @__PURE__ */ a("div", { className: "gantt__header-column", style: {
56
- left: R,
57
- width: i
58
- }, children: /* @__PURE__ */ a($, { children: l(v) }) }, `header-${v}`);
59
- }, e[23] = l, e[24] = i, e[25] = r) : r = e[25], _ = m.map(r), e[19] = l, e[20] = i, e[21] = m, e[22] = _;
60
- } else
61
- _ = e[22];
62
- let g;
63
- e[26] !== n ? (g = n && /* @__PURE__ */ a("div", { className: "gantt__header-scroll gantt__header-scroll--right", children: /* @__PURE__ */ a(w, { size: 16 }) }), e[26] = n, e[27] = g) : g = e[27];
64
- let u;
65
- return e[28] !== o || e[29] !== f || e[30] !== _ || e[31] !== g ? (u = /* @__PURE__ */ L("div", { ...o, children: [
66
- f,
67
- _,
68
- g
69
- ] }), e[28] = o, e[29] = f, e[30] = _, e[31] = g, e[32] = u) : u = e[32], u;
70
- }, k = (t) => t > 5e5 ? {
71
- value: t / 1e6,
72
- unit: "s"
73
- } : t > 500 ? {
74
- value: t / 1e3,
75
- unit: "ms"
76
- } : {
77
- value: t,
78
- unit: "μs"
79
- }, y = (t) => t === "s" ? 1e6 : t === "ms" ? 1e3 : 1;
80
- export {
81
- J as GanttHeader
1
+ import { require_compiler_runtime } from "../../node_modules/react/compiler-runtime.js";
2
+ import { mergeComponentProps } from "../../utils/component.js";
3
+ import "../../utils/index.js";
4
+ import { Text } from "../text/Text.js";
5
+ import React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
8
+ var import_compiler_runtime = require_compiler_runtime();
9
+ const GanttHeader = (e) => {
10
+ let a = (0, import_compiler_runtime.c)(33), d, f, p, m, h, g, _;
11
+ if (a[0] !== e) {
12
+ let { avgDuration: i, stepWidth: o, canScrollLeft: s, canScrollRight: c, ticks: l, interval: u, ...v } = e;
13
+ h = o, d = s, f = c, _ = l;
14
+ let y;
15
+ a[8] === i ? y = a[9] : (y = getTimelineLabel(i), a[8] = i, a[9] = y), m = y;
16
+ let b;
17
+ a[10] === u ? b = a[11] : (b = (e) => {
18
+ let { value: r, unit: i } = getTimelineLabel(e), a = Math.max(0, Math.ceil(-Math.log10(u / unitFactor(i))));
19
+ return `${parseFloat(r.toFixed(a))}${i}`;
20
+ }, a[10] = u, a[11] = b), p = b, g = mergeComponentProps("gantt__header", v), a[0] = e, a[1] = d, a[2] = f, a[3] = p, a[4] = m, a[5] = h, a[6] = g, a[7] = _;
21
+ } else d = a[1], f = a[2], p = a[3], m = a[4], h = a[5], g = a[6], _ = a[7];
22
+ let v;
23
+ a[12] === d ? v = a[13] : (v = d && /* @__PURE__ */ jsx("div", {
24
+ className: "gantt__header-scroll gantt__header-scroll--left",
25
+ children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 16 })
26
+ }), a[12] = d, a[13] = v);
27
+ let y;
28
+ a[14] === m.unit ? y = a[15] : (y = /* @__PURE__ */ jsx("div", {
29
+ className: "gantt__header-label-column",
30
+ children: /* @__PURE__ */ jsxs(Text, {
31
+ className: "gantt__header-label",
32
+ children: ["Range in ", m.unit]
33
+ })
34
+ }), a[14] = m.unit, a[15] = y);
35
+ let b;
36
+ a[16] !== v || a[17] !== y ? (b = /* @__PURE__ */ jsxs("div", {
37
+ className: "gantt__header-start",
38
+ children: [v, y]
39
+ }), a[16] = v, a[17] = y, a[18] = b) : b = a[18];
40
+ let x;
41
+ if (a[19] !== p || a[20] !== h || a[21] !== _) {
42
+ let e;
43
+ a[23] !== p || a[24] !== h ? (e = (e) => {
44
+ let { time: r, left: a } = e;
45
+ return /* @__PURE__ */ jsx("div", {
46
+ className: "gantt__header-column",
47
+ style: {
48
+ left: a,
49
+ width: h
50
+ },
51
+ children: /* @__PURE__ */ jsx(Text, { children: p(r) })
52
+ }, `header-${r}`);
53
+ }, a[23] = p, a[24] = h, a[25] = e) : e = a[25], x = _.map(e), a[19] = p, a[20] = h, a[21] = _, a[22] = x;
54
+ } else x = a[22];
55
+ let S;
56
+ a[26] === f ? S = a[27] : (S = f && /* @__PURE__ */ jsx("div", {
57
+ className: "gantt__header-scroll gantt__header-scroll--right",
58
+ children: /* @__PURE__ */ jsx(IconChevronRight, { size: 16 })
59
+ }), a[26] = f, a[27] = S);
60
+ let C;
61
+ return a[28] !== g || a[29] !== b || a[30] !== x || a[31] !== S ? (C = /* @__PURE__ */ jsxs("div", {
62
+ ...g,
63
+ children: [
64
+ b,
65
+ x,
66
+ S
67
+ ]
68
+ }), a[28] = g, a[29] = b, a[30] = x, a[31] = S, a[32] = C) : C = a[32], C;
82
69
  };
70
+ var getTimelineLabel = (e) => e > 5e5 ? {
71
+ value: e / 1e6,
72
+ unit: "s"
73
+ } : e > 500 ? {
74
+ value: e / 1e3,
75
+ unit: "ms"
76
+ } : {
77
+ value: e,
78
+ unit: "μs"
79
+ }, unitFactor = (e) => e === "s" ? 1e6 : e === "ms" ? 1e3 : 1;
80
+ export { GanttHeader };
@@ -1,23 +1,20 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { c as d } from "../../_virtual/compiler-runtime.js";
3
- import "../../utils/contextStore.js";
4
- import "react";
5
- import { mergeComponentProps as p } from "../../utils/component.js";
6
- import "js-md5";
7
- const _ = (n) => {
8
- const t = d.c(10);
9
- let e, i, r, o;
10
- if (t[0] !== n) {
11
- const {
12
- children: c,
13
- ...l
14
- } = n;
15
- e = c, i = l.id, r = l.id, o = p("gantt__item", l), t[0] = n, t[1] = e, t[2] = i, t[3] = r, t[4] = o;
16
- } else
17
- e = t[1], i = t[2], r = t[3], o = t[4];
18
- let m;
19
- return t[5] !== e || t[6] !== i || t[7] !== r || t[8] !== o ? (m = /* @__PURE__ */ s("div", { "data-gantt-id": r, ...o, children: e }, i), t[5] = e, t[6] = i, t[7] = r, t[8] = o, t[9] = m) : m = t[9], m;
20
- };
21
- export {
22
- _ as GanttItem
1
+ import { require_compiler_runtime } from "../../node_modules/react/compiler-runtime.js";
2
+ import { mergeComponentProps } from "../../utils/component.js";
3
+ import "../../utils/index.js";
4
+ import React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var import_compiler_runtime = require_compiler_runtime();
7
+ const GanttItem = (e) => {
8
+ let n = (0, import_compiler_runtime.c)(10), a, o, s, c;
9
+ if (n[0] !== e) {
10
+ let { children: r, ...i } = e;
11
+ a = r, o = i.id, s = i.id, c = mergeComponentProps("gantt__item", i), n[0] = e, n[1] = a, n[2] = o, n[3] = s, n[4] = c;
12
+ } else a = n[1], o = n[2], s = n[3], c = n[4];
13
+ let l;
14
+ return n[5] !== a || n[6] !== o || n[7] !== s || n[8] !== c ? (l = /* @__PURE__ */ jsx("div", {
15
+ "data-gantt-id": s,
16
+ ...c,
17
+ children: a
18
+ }, o), n[5] = a, n[6] = o, n[7] = s, n[8] = c, n[9] = l) : l = n[9], l;
23
19
  };
20
+ export { GanttItem };