@redvars/peacock 4.0.0 → 4.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 (408) hide show
  1. package/dist/{BaseField-CAog9TIc.js → BaseField-BMumJpkW.js} +6 -3
  2. package/dist/BaseField-BMumJpkW.js.map +1 -0
  3. package/dist/{BaseInput-CcMfg1Y2.js → BaseInput-mWdyYv27.js} +6 -3
  4. package/dist/BaseInput-mWdyYv27.js.map +1 -0
  5. package/dist/accordion.js.map +1 -1
  6. package/dist/ai-badge.js +2 -2
  7. package/dist/ai-summary.js +2 -2
  8. package/dist/alert.js +2 -2
  9. package/dist/anchor-nav.js +2 -2
  10. package/dist/app-shell.js +2 -2
  11. package/dist/assistant-panel.js +2 -2
  12. package/dist/assistant-step.js +2 -2
  13. package/dist/assistant-steps.js +2 -2
  14. package/dist/avatar-group.js +2 -2
  15. package/dist/banner.js +2 -2
  16. package/dist/{base-button-Do2TUy8M.js → base-button-BJMGMcMv.js} +3 -1
  17. package/dist/base-button-BJMGMcMv.js.map +1 -0
  18. package/dist/{base-progress-BiLlZVHJ.js → base-progress-CvLVSjuy.js} +4 -2
  19. package/dist/base-progress-CvLVSjuy.js.map +1 -0
  20. package/dist/bottom-sheet.js +2 -2
  21. package/dist/breadcrumb.js +2 -2
  22. package/dist/button-group.js +4 -4
  23. package/dist/button.js +3 -3
  24. package/dist/calendar.js +2 -2
  25. package/dist/canvas-base-BTQMEVn_.js +788 -0
  26. package/dist/canvas-base-BTQMEVn_.js.map +1 -0
  27. package/dist/canvas-link-CtgsALq4.js +54 -0
  28. package/dist/canvas-link-CtgsALq4.js.map +1 -0
  29. package/dist/{cartesian-chart-C-f1frt0.js → cartesian-chart-DM1FC_XT.js} +3 -2
  30. package/dist/cartesian-chart-DM1FC_XT.js.map +1 -0
  31. package/dist/{cb-group-base-DeuCVx3a.js → cb-group-base-B6fa4Lll.js} +2 -2
  32. package/dist/{cb-group-base-DeuCVx3a.js.map → cb-group-base-B6fa4Lll.js.map} +1 -1
  33. package/dist/cb-group.js +3 -3
  34. package/dist/cb-rule.js +3 -3
  35. package/dist/chart-area.js +5 -4
  36. package/dist/chart-area.js.map +1 -1
  37. package/dist/chart-bar.js +5 -4
  38. package/dist/chart-bar.js.map +1 -1
  39. package/dist/chart-base-Dhxuw_Mw.js +833 -0
  40. package/dist/chart-base-Dhxuw_Mw.js.map +1 -0
  41. package/dist/chart-doughnut.js +4 -3
  42. package/dist/chart-doughnut.js.map +1 -1
  43. package/dist/chart-line.js +5 -4
  44. package/dist/chart-line.js.map +1 -1
  45. package/dist/chart-pie.js +4 -3
  46. package/dist/chart-pie.js.map +1 -1
  47. package/dist/chat-message.js +2 -2
  48. package/dist/chat-thread.js +2 -2
  49. package/dist/checkbox-group.js +4 -4
  50. package/dist/checkbox.js +4 -4
  51. package/dist/chip-set.js +3 -3
  52. package/dist/chip.js +4 -4
  53. package/dist/circular-progress.js +3 -3
  54. package/dist/citation.js +2 -2
  55. package/dist/code-editor.js +5 -4
  56. package/dist/code-editor.js.map +1 -1
  57. package/dist/code-highlighter.js +2 -2
  58. package/dist/color-field.js +5 -5
  59. package/dist/color-picker.js +2 -2
  60. package/dist/command-palette.js +2 -2
  61. package/dist/comment-composer.js +5 -5
  62. package/dist/condition-builder.js +3 -3
  63. package/dist/confirm-dialog.js +2 -2
  64. package/dist/copy-button.js +2 -2
  65. package/dist/currency-field.js +5 -5
  66. package/dist/custom-elements-jsdocs.json +2115 -336
  67. package/dist/custom-elements.json +19483 -615
  68. package/dist/date-field.js +6 -6
  69. package/dist/date-picker.js +4 -2
  70. package/dist/date-picker.js.map +1 -1
  71. package/dist/date-range-field.js +6 -6
  72. package/dist/datetime-field.js +6 -6
  73. package/dist/dependency-map-layout-5KUueabk.js +1390 -0
  74. package/dist/dependency-map-layout-5KUueabk.js.map +1 -0
  75. package/dist/dependency-map.js +1605 -0
  76. package/dist/dependency-map.js.map +1 -0
  77. package/dist/description-item.js +2 -2
  78. package/dist/description-list.js +2 -2
  79. package/dist/diagram-2r11KySs.js +2029 -0
  80. package/dist/diagram-2r11KySs.js.map +1 -0
  81. package/dist/diagram-controls.js +345 -0
  82. package/dist/diagram-controls.js.map +1 -0
  83. package/dist/diagram-minimap.js +216 -0
  84. package/dist/diagram-minimap.js.map +1 -0
  85. package/dist/diagram.js +20 -0
  86. package/dist/diagram.js.map +1 -0
  87. package/dist/diff-viewer.js +2 -2
  88. package/dist/discussion-activity.js +2 -2
  89. package/dist/discussion-comment.js +2 -2
  90. package/dist/discussion.js +5 -5
  91. package/dist/{document-editor-BO7QPbO5.js → document-editor-BnEugM3E.js} +2 -2
  92. package/dist/{document-editor-BO7QPbO5.js.map → document-editor-BnEugM3E.js.map} +1 -1
  93. package/dist/document-editor.js +3 -3
  94. package/dist/draft-card.js +2 -2
  95. package/dist/erd.js +2021 -0
  96. package/dist/erd.js.map +1 -0
  97. package/dist/fab.js +4 -4
  98. package/dist/field.js +257 -43
  99. package/dist/field.js.map +1 -1
  100. package/dist/file-upload.js +37 -15
  101. package/dist/file-upload.js.map +1 -1
  102. package/dist/filter-bar.js +2 -2
  103. package/dist/flow.js +27 -970
  104. package/dist/flow.js.map +1 -1
  105. package/dist/focus-ring.js +2 -0
  106. package/dist/focus-ring.js.map +1 -1
  107. package/dist/{form-associated-D3Tn33s_.js → form-associated-BHbg72PG.js} +3 -1
  108. package/dist/{form-associated-D3Tn33s_.js.map → form-associated-BHbg72PG.js.map} +1 -1
  109. package/dist/{form-submitter-DWwv6K9-.js → form-submitter-beG1CXAn.js} +7 -1
  110. package/dist/{form-submitter-DWwv6K9-.js.map → form-submitter-beG1CXAn.js.map} +1 -1
  111. package/dist/form.js +2 -2
  112. package/dist/{generative-view-DmtpDobn.js → generative-view-BgOcLRXr.js} +13 -13
  113. package/dist/generative-view-BgOcLRXr.js.map +1 -0
  114. package/dist/generative-view.js +3 -3
  115. package/dist/geometry-INg82Lxq.js +305 -0
  116. package/dist/geometry-INg82Lxq.js.map +1 -0
  117. package/dist/history-YbTSQZHj.js +45 -0
  118. package/dist/history-YbTSQZHj.js.map +1 -0
  119. package/dist/host-CZK7xhzh.js +40 -0
  120. package/dist/host-CZK7xhzh.js.map +1 -0
  121. package/dist/html-editor.js +5 -5
  122. package/dist/{hyperlink-DhE9RlVS.js → hyperlink-DycWPKwU.js} +10 -1
  123. package/dist/hyperlink-DycWPKwU.js.map +1 -0
  124. package/dist/{i18n-controller-urcQKYGe.js → i18n-controller-Cp43HjJl.js} +2 -2
  125. package/dist/{i18n-controller-urcQKYGe.js.map → i18n-controller-Cp43HjJl.js.map} +1 -1
  126. package/dist/icon-button.js +4 -4
  127. package/dist/image.js +2 -2
  128. package/dist/index.js +37 -18
  129. package/dist/index.js.map +1 -1
  130. package/dist/inline-edit.js +2 -2
  131. package/dist/input.js +4 -4
  132. package/dist/json-viewer.js +2 -2
  133. package/dist/kanban.js +2 -2
  134. package/dist/kbd.js +2 -2
  135. package/dist/linear-progress.js +3 -3
  136. package/dist/link-button.js +2 -2
  137. package/dist/list-item.js +2 -2
  138. package/dist/list.js +2 -2
  139. package/dist/listbox.js +3 -3
  140. package/dist/loader-full.js +13 -13
  141. package/dist/loader.js +44 -15
  142. package/dist/loader.js.map +1 -1
  143. package/dist/markdown-editor.js +5 -5
  144. package/dist/markers-BFmh1OCz.js +46 -0
  145. package/dist/markers-BFmh1OCz.js.map +1 -0
  146. package/dist/measure-controller-Dmc5hZKg.js +89 -0
  147. package/dist/measure-controller-Dmc5hZKg.js.map +1 -0
  148. package/dist/mention-input.js +6 -5
  149. package/dist/mention-input.js.map +1 -1
  150. package/dist/menu-item.js +3 -2
  151. package/dist/menu-item.js.map +1 -1
  152. package/dist/menu.js +2 -2
  153. package/dist/modal.js +2 -2
  154. package/dist/navigation-bar.js +2 -2
  155. package/dist/navigation-drawer.js +2 -2
  156. package/dist/navigation-rail.js +2 -2
  157. package/dist/notification-center.js +2 -2
  158. package/dist/number-field.js +6 -5
  159. package/dist/number-field.js.map +1 -1
  160. package/dist/option.js +2 -2
  161. package/dist/page-header.js +2 -2
  162. package/dist/pagination.js +2 -2
  163. package/dist/password-field.js +5 -5
  164. package/dist/password-rules.js +2 -2
  165. package/dist/phone-field.js +5 -5
  166. package/dist/{picker-field-B4DtcJfL.js → picker-field-dTlIMAQn.js} +3 -3
  167. package/dist/{picker-field-B4DtcJfL.js.map → picker-field-dTlIMAQn.js.map} +1 -1
  168. package/dist/pin-input.js +5 -5
  169. package/dist/presence-indicator.js +2 -2
  170. package/dist/prompt-input.js +5 -5
  171. package/dist/radio-group.js +1 -0
  172. package/dist/radio-group.js.map +1 -1
  173. package/dist/radio.js +5 -5
  174. package/dist/radio.js.map +1 -1
  175. package/dist/rating.js +5 -4
  176. package/dist/rating.js.map +1 -1
  177. package/dist/redvars-loader.js +2 -2
  178. package/dist/relative-time.js +2 -2
  179. package/dist/resizable-panels.js +2 -2
  180. package/dist/{rich-text-input-DLICqof1.js → rich-text-input-DM_BOzgk.js} +3 -3
  181. package/dist/{rich-text-input-DLICqof1.js.map → rich-text-input-DM_BOzgk.js.map} +1 -1
  182. package/dist/ripple.js +2 -0
  183. package/dist/ripple.js.map +1 -1
  184. package/dist/{schema-hMt-NRLk.js → schema-B8g30A_n.js} +2 -2
  185. package/dist/{schema-hMt-NRLk.js.map → schema-B8g30A_n.js.map} +1 -1
  186. package/dist/search.js +4 -4
  187. package/dist/segmented-button-group.js +1 -1
  188. package/dist/select.js +7 -7
  189. package/dist/side-sheet.js +2 -2
  190. package/dist/signature-pad.js +5 -4
  191. package/dist/signature-pad.js.map +1 -1
  192. package/dist/slider.js +5 -4
  193. package/dist/slider.js.map +1 -1
  194. package/dist/snackbar.js +2 -2
  195. package/dist/sparkline.js +2 -2
  196. package/dist/split-button.js +2 -2
  197. package/dist/src/__internal/diagram/canvas-base.d.ts +105 -0
  198. package/dist/src/__internal/diagram/canvas-link.d.ts +21 -0
  199. package/dist/src/__internal/diagram/geometry.d.ts +49 -0
  200. package/dist/src/__internal/diagram/history.d.ts +17 -0
  201. package/dist/src/__internal/diagram/host.d.ts +45 -0
  202. package/dist/src/__internal/diagram/markers.d.ts +16 -0
  203. package/dist/src/__internal/diagram/measure-controller.d.ts +32 -0
  204. package/dist/src/__internal/diagram/motion.d.ts +22 -0
  205. package/dist/src/__internal/diagram/selection.d.ts +20 -0
  206. package/dist/src/__internal/diagram/types.d.ts +39 -0
  207. package/dist/src/__internal/diagram/viewport-controller.d.ts +89 -0
  208. package/dist/src/__internal/i18n/strings.d.ts +149 -0
  209. package/dist/src/__internal/toggle-base.d.ts +8 -0
  210. package/dist/src/__internal/utils/deprecate.d.ts +3 -3
  211. package/dist/src/accordion/accordion.d.ts +1 -0
  212. package/dist/src/code-editor/code-editor.d.ts +1 -0
  213. package/dist/src/date-picker/date-picker.d.ts +2 -0
  214. package/dist/src/dependency-map/dependency-map-layout.d.ts +48 -0
  215. package/dist/src/dependency-map/dependency-map.d.ts +241 -0
  216. package/dist/src/dependency-map/index.d.ts +2 -0
  217. package/dist/src/diagram/diagram.d.ts +300 -0
  218. package/dist/src/diagram/flow.d.ts +53 -0
  219. package/dist/src/diagram/index.d.ts +4 -0
  220. package/dist/src/diagram-controls/diagram-controls.d.ts +46 -0
  221. package/dist/src/diagram-controls/index.d.ts +1 -0
  222. package/dist/src/diagram-minimap/diagram-minimap.d.ts +39 -0
  223. package/dist/src/diagram-minimap/index.d.ts +1 -0
  224. package/dist/src/erd/erd-layout.d.ts +27 -0
  225. package/dist/src/erd/erd.d.ts +266 -0
  226. package/dist/src/erd/index.d.ts +2 -0
  227. package/dist/src/field/field.d.ts +38 -1
  228. package/dist/src/file-upload/file-upload.d.ts +3 -1
  229. package/dist/src/focus-ring/focus-ring.d.ts +2 -0
  230. package/dist/src/index.d.ts +15 -2
  231. package/dist/src/input/BaseField.d.ts +3 -0
  232. package/dist/src/input/BaseInput.d.ts +3 -0
  233. package/dist/src/menu/menu-item/menu-item.d.ts +1 -0
  234. package/dist/src/number-field/number-field.d.ts +4 -0
  235. package/dist/src/progress/base-progress.d.ts +3 -0
  236. package/dist/src/radio/radio-group.d.ts +1 -0
  237. package/dist/src/rating/rating.d.ts +1 -0
  238. package/dist/src/ripple/ripple.d.ts +2 -0
  239. package/dist/src/signature-pad/signature-pad.d.ts +1 -0
  240. package/dist/src/slider/slider.d.ts +1 -0
  241. package/dist/src/switch/switch.d.ts +1 -0
  242. package/dist/src/tabs/tab.d.ts +2 -0
  243. package/dist/src/tabs/tabs.d.ts +1 -0
  244. package/dist/src/textarea/textarea.d.ts +1 -0
  245. package/dist/src/time-picker/time-picker.d.ts +2 -0
  246. package/dist/src/transfer-list/transfer-list.d.ts +1 -0
  247. package/dist/src/tree-chart/index.d.ts +2 -0
  248. package/dist/src/tree-chart/tree-chart-layout.d.ts +49 -0
  249. package/dist/src/tree-chart/tree-chart.d.ts +221 -0
  250. package/dist/src/workflow/index.d.ts +2 -0
  251. package/dist/src/workflow/workflow-format.d.ts +5 -0
  252. package/dist/src/workflow/workflow-model.d.ts +194 -0
  253. package/dist/src/workflow/workflow.d.ts +313 -0
  254. package/dist/src/workflow-timeline/index.d.ts +1 -0
  255. package/dist/src/workflow-timeline/workflow-timeline.d.ts +41 -0
  256. package/dist/stat.js +2 -2
  257. package/dist/status-indicator.js +2 -2
  258. package/dist/step.js +2 -2
  259. package/dist/stepper.js +2 -2
  260. package/dist/{strings-DmbqMTfs.js → strings-BJPuhKJk.js} +163 -1
  261. package/dist/{strings-DmbqMTfs.js.map → strings-BJPuhKJk.js.map} +1 -1
  262. package/dist/sub-menu.js +2 -2
  263. package/dist/svg.js +2 -2
  264. package/dist/switch.js +5 -4
  265. package/dist/switch.js.map +1 -1
  266. package/dist/tab.js +1 -0
  267. package/dist/tab.js.map +1 -1
  268. package/dist/table.js +2 -2
  269. package/dist/tabs.js +1 -0
  270. package/dist/tabs.js.map +1 -1
  271. package/dist/test/diagram-controls.test.d.ts +1 -0
  272. package/dist/test/diagram-geometry.test.d.ts +1 -0
  273. package/dist/test/diagram.test.d.ts +1 -0
  274. package/dist/test/erd.test.d.ts +1 -0
  275. package/dist/test/toggle-label.test.d.ts +1 -0
  276. package/dist/test/tree-chart.test.d.ts +1 -0
  277. package/dist/test/workflow-debug.test.d.ts +1 -0
  278. package/dist/test/workflow.test.d.ts +1 -0
  279. package/dist/textarea.js +7 -5
  280. package/dist/textarea.js.map +1 -1
  281. package/dist/time-field.js +6 -6
  282. package/dist/time-picker.js +4 -2
  283. package/dist/time-picker.js.map +1 -1
  284. package/dist/timeline-item.js +2 -2
  285. package/dist/timeline.js +2 -2
  286. package/dist/{toggle-base-BQO5pjrU.js → toggle-base-BlaHalfS.js} +19 -3
  287. package/dist/toggle-base-BlaHalfS.js.map +1 -0
  288. package/dist/tour.js +2 -2
  289. package/dist/transfer-list.js +5 -4
  290. package/dist/transfer-list.js.map +1 -1
  291. package/dist/{chart-base-B-gOg2Di.js → transform-CxeQFXXB.js} +9 -839
  292. package/dist/transform-CxeQFXXB.js.map +1 -0
  293. package/dist/tree-chart.js +1986 -0
  294. package/dist/tree-chart.js.map +1 -0
  295. package/dist/tree-item.js +2 -2
  296. package/dist/tree.js +2 -2
  297. package/dist/tsconfig.tsbuildinfo +1 -1
  298. package/dist/typing-indicator.js +2 -2
  299. package/dist/url-field.js +5 -5
  300. package/dist/user-menu.js +2 -2
  301. package/dist/virtual-list.js +2 -2
  302. package/dist/workflow-format-BsyveyeC.js +34 -0
  303. package/dist/workflow-format-BsyveyeC.js.map +1 -0
  304. package/dist/workflow-model-CauduOG2.js +330 -0
  305. package/dist/workflow-model-CauduOG2.js.map +1 -0
  306. package/dist/workflow-timeline.js +354 -0
  307. package/dist/workflow-timeline.js.map +1 -0
  308. package/dist/workflow.js +3337 -0
  309. package/dist/workflow.js.map +1 -0
  310. package/dist/workspace-switcher.js +2 -2
  311. package/package.json +1 -1
  312. package/readme.md +44 -2
  313. package/src/LoaderUtils.ts +9 -2
  314. package/src/__internal/diagram/canvas-base.ts +410 -0
  315. package/src/__internal/diagram/canvas-link.ts +66 -0
  316. package/src/__internal/diagram/geometry.ts +372 -0
  317. package/src/__internal/diagram/history.ts +49 -0
  318. package/src/__internal/diagram/host.ts +76 -0
  319. package/src/__internal/diagram/markers.ts +56 -0
  320. package/src/__internal/diagram/measure-controller.ts +104 -0
  321. package/src/__internal/diagram/motion.ts +89 -0
  322. package/src/__internal/diagram/selection.ts +69 -0
  323. package/src/__internal/diagram/types.ts +56 -0
  324. package/src/__internal/diagram/viewport-controller.ts +494 -0
  325. package/src/__internal/i18n/strings.ts +201 -0
  326. package/src/__internal/mixins/field.ts +3 -0
  327. package/src/__internal/mixins/form-associated.ts +2 -0
  328. package/src/__internal/mixins/form-submitter.ts +6 -0
  329. package/src/__internal/mixins/hyperlink.ts +10 -0
  330. package/src/__internal/toggle-base.ts +16 -0
  331. package/src/__internal/utils/deprecate.ts +5 -4
  332. package/src/accordion/accordion.ts +1 -0
  333. package/src/button/base-button/base-button.ts +2 -0
  334. package/src/code-editor/code-editor.ts +1 -0
  335. package/src/date-picker/date-picker.ts +2 -0
  336. package/src/dependency-map/dependency-map-layout.ts +505 -0
  337. package/src/dependency-map/dependency-map.scss +626 -0
  338. package/src/dependency-map/dependency-map.ts +1280 -0
  339. package/src/dependency-map/index.ts +16 -0
  340. package/src/diagram/diagram.scss +513 -0
  341. package/src/diagram/diagram.ts +1852 -0
  342. package/src/diagram/flow.ts +81 -0
  343. package/src/diagram/index.ts +44 -0
  344. package/src/diagram-controls/diagram-controls.scss +68 -0
  345. package/src/diagram-controls/diagram-controls.ts +255 -0
  346. package/src/diagram-controls/index.ts +1 -0
  347. package/src/diagram-minimap/diagram-minimap.scss +41 -0
  348. package/src/diagram-minimap/diagram-minimap.ts +149 -0
  349. package/src/diagram-minimap/index.ts +1 -0
  350. package/src/erd/erd-layout.ts +92 -0
  351. package/src/erd/erd.scss +636 -0
  352. package/src/erd/erd.ts +1728 -0
  353. package/src/erd/index.ts +17 -0
  354. package/src/field/field.scss +197 -23
  355. package/src/field/field.ts +109 -16
  356. package/src/file-upload/file-upload.scss +37 -10
  357. package/src/file-upload/file-upload.ts +3 -1
  358. package/src/focus-ring/focus-ring.ts +2 -0
  359. package/src/generative-view/catalog.generated.ts +12 -11
  360. package/src/index.ts +121 -2
  361. package/src/input/BaseField.ts +3 -0
  362. package/src/input/BaseInput.ts +3 -0
  363. package/src/loader.ts +25 -0
  364. package/src/mention-input/mention-input.scss +2 -0
  365. package/src/menu/menu-item/menu-item.ts +1 -0
  366. package/src/number-field/number-field.ts +4 -0
  367. package/src/progress/base-progress.ts +3 -0
  368. package/src/radio/radio-group.ts +1 -0
  369. package/src/radio/radio.ts +1 -1
  370. package/src/rating/rating.ts +1 -0
  371. package/src/ripple/ripple.ts +2 -0
  372. package/src/signature-pad/signature-pad.ts +1 -0
  373. package/src/slider/slider.ts +1 -0
  374. package/src/switch/switch.ts +1 -0
  375. package/src/tabs/tab.ts +2 -0
  376. package/src/tabs/tabs.ts +1 -0
  377. package/src/textarea/textarea.scss +2 -0
  378. package/src/textarea/textarea.ts +1 -0
  379. package/src/time-picker/time-picker.ts +2 -0
  380. package/src/transfer-list/transfer-list.ts +1 -0
  381. package/src/tree-chart/index.ts +13 -0
  382. package/src/tree-chart/tree-chart-layout.ts +185 -0
  383. package/src/tree-chart/tree-chart.scss +377 -0
  384. package/src/tree-chart/tree-chart.ts +1170 -0
  385. package/src/workflow/index.ts +35 -0
  386. package/src/workflow/workflow-format.ts +29 -0
  387. package/src/workflow/workflow-model.ts +583 -0
  388. package/src/workflow/workflow.scss +1164 -0
  389. package/src/workflow/workflow.ts +2674 -0
  390. package/src/workflow-timeline/index.ts +1 -0
  391. package/src/workflow-timeline/workflow-timeline.scss +128 -0
  392. package/src/workflow-timeline/workflow-timeline.ts +238 -0
  393. package/dist/BaseField-CAog9TIc.js.map +0 -1
  394. package/dist/BaseInput-CcMfg1Y2.js.map +0 -1
  395. package/dist/base-button-Do2TUy8M.js.map +0 -1
  396. package/dist/base-progress-BiLlZVHJ.js.map +0 -1
  397. package/dist/cartesian-chart-C-f1frt0.js.map +0 -1
  398. package/dist/chart-base-B-gOg2Di.js.map +0 -1
  399. package/dist/generative-view-DmtpDobn.js.map +0 -1
  400. package/dist/hyperlink-DhE9RlVS.js.map +0 -1
  401. package/dist/src/flow/flow.d.ts +0 -178
  402. package/dist/src/flow/index.d.ts +0 -2
  403. package/dist/toggle-base-BQO5pjrU.js.map +0 -1
  404. package/src/button/button-group/readme.md +0 -23
  405. package/src/flow/flow.scss +0 -215
  406. package/src/flow/flow.ts +0 -958
  407. package/src/flow/index.ts +0 -10
  408. /package/dist/test/{flow.test.d.ts → dependency-map.test.d.ts} +0 -0
@@ -0,0 +1,505 @@
1
+ import {
2
+ forceCollide,
3
+ forceLink,
4
+ forceManyBody,
5
+ forceSimulation,
6
+ forceX,
7
+ forceY,
8
+ type SimulationLinkDatum,
9
+ type SimulationNodeDatum,
10
+ } from 'd3';
11
+ import type { DiagramPoint } from '@/__internal/diagram/types.js';
12
+
13
+ export interface MapLayoutNode {
14
+ id: string;
15
+ /** Nodes in the same group are pulled together. */
16
+ group?: string;
17
+ /** A fixed position (pinned by the app or by dragging). */
18
+ pinned?: DiagramPoint;
19
+ }
20
+
21
+ export interface MapLayoutEdge {
22
+ source: string;
23
+ target: string;
24
+ }
25
+
26
+ export interface MapLayoutOptions {
27
+ /** Card size used for spacing. */
28
+ nodeWidth: number;
29
+ nodeHeight: number;
30
+ /** Earlier positions to start from, so a live update moves as little as possible. */
31
+ previous?: Map<string, DiagramPoint>;
32
+ /** The node at the centre of a radial layout. */
33
+ center?: string;
34
+ }
35
+
36
+ type SimNode = SimulationNodeDatum & { id: string; group?: string };
37
+
38
+ /** Room a group box takes around its nodes, matching how the map draws groups. */
39
+ export const GROUP_PADDING = { x: 28, top: 44, bottom: 28 };
40
+
41
+ /**
42
+ * Moves whole groups (and nodes outside any group) apart until no group box overlaps another
43
+ * group box or a loose node. Groups with a pinned node stay where they are.
44
+ */
45
+ function separateGroups(
46
+ result: Map<string, DiagramPoint>,
47
+ nodes: MapLayoutNode[],
48
+ options: MapLayoutOptions,
49
+ ) {
50
+ const clusters = new Map<string, MapLayoutNode[]>();
51
+ for (const n of nodes) {
52
+ const key = n.group ? `g:${n.group}` : `n:${n.id}`;
53
+ clusters.set(key, [...(clusters.get(key) ?? []), n]);
54
+ }
55
+ if (![...clusters.keys()].some(k => k.startsWith('g:'))) return;
56
+ const gap = 24;
57
+ const hw = options.nodeWidth / 2;
58
+ const hh = options.nodeHeight / 2;
59
+ const items = [...clusters].map(([key, members]) => ({
60
+ group: key.startsWith('g:'),
61
+ fixed: members.some(m => m.pinned),
62
+ members,
63
+ }));
64
+ const box = (item: (typeof items)[number]) => {
65
+ const pad = item.group ? GROUP_PADDING : { x: 0, top: 0, bottom: 0 };
66
+ const ps = item.members.map(m => result.get(m.id) ?? { x: 0, y: 0 });
67
+ return {
68
+ x1: Math.min(...ps.map(p => p.x)) - hw - pad.x - gap / 2,
69
+ x2: Math.max(...ps.map(p => p.x)) + hw + pad.x + gap / 2,
70
+ y1: Math.min(...ps.map(p => p.y)) - hh - pad.top - gap / 2,
71
+ y2: Math.max(...ps.map(p => p.y)) + hh + pad.bottom + gap / 2,
72
+ };
73
+ };
74
+ const shift = (item: (typeof items)[number], dx: number, dy: number) => {
75
+ for (const m of item.members) {
76
+ const p = result.get(m.id);
77
+ if (p) result.set(m.id, { x: p.x + dx, y: p.y + dy });
78
+ }
79
+ };
80
+ // Pushes one overlapping pair apart along the axis that needs the smaller move.
81
+ const resolve = (a: (typeof items)[number], b: (typeof items)[number]) => {
82
+ const ba = box(a);
83
+ const bb = box(b);
84
+ const ox = Math.min(ba.x2, bb.x2) - Math.max(ba.x1, bb.x1);
85
+ const oy = Math.min(ba.y2, bb.y2) - Math.max(ba.y1, bb.y1);
86
+ if (ox <= 0 || oy <= 0) return false;
87
+ const horizontal = ox < oy;
88
+ const ca = horizontal ? ba.x1 + ba.x2 : ba.y1 + ba.y2;
89
+ const cb = horizontal ? bb.x1 + bb.x2 : bb.y1 + bb.y2;
90
+ const dir = ca <= cb ? -1 : 1;
91
+ const amount = (horizontal ? ox : oy) + 1;
92
+ let shareA = 0.5;
93
+ if (a.fixed) shareA = 0;
94
+ else if (b.fixed) shareA = 1;
95
+ const da = dir * amount * shareA;
96
+ const db = -dir * amount * (1 - shareA);
97
+ shift(a, horizontal ? da : 0, horizontal ? 0 : da);
98
+ shift(b, horizontal ? db : 0, horizontal ? 0 : db);
99
+ return true;
100
+ };
101
+ for (let round = 0; round < 60; round += 1) {
102
+ let moved = false;
103
+ for (let i = 0; i < items.length; i += 1) {
104
+ for (let j = i + 1; j < items.length; j += 1) {
105
+ const a = items[i];
106
+ const b = items[j];
107
+ if ((a.group || b.group) && !(a.fixed && b.fixed) && resolve(a, b))
108
+ moved = true;
109
+ }
110
+ }
111
+ if (!moved) break;
112
+ }
113
+ }
114
+
115
+ /**
116
+ * An organic layout: connected nodes attract, all nodes repel, nodes of a group drift together.
117
+ * Starts from `previous` positions when given, so live updates are stable. Deterministic for the
118
+ * same input (no random start).
119
+ */
120
+ export function forceLayout(
121
+ nodes: MapLayoutNode[],
122
+ edges: MapLayoutEdge[],
123
+ options: MapLayoutOptions,
124
+ ): Map<string, DiagramPoint> {
125
+ const known = options.previous ?? new Map();
126
+ const sim: SimNode[] = nodes.map((n, i) => {
127
+ const { pinned } = n;
128
+ const prev = known.get(n.id);
129
+ const start = pinned ?? prev;
130
+ // A golden-angle spiral for nodes without a position.
131
+ const angle = i * 2.399963;
132
+ const radius = 40 * Math.sqrt(i + 1);
133
+ return {
134
+ id: n.id,
135
+ group: n.group,
136
+ x: start?.x ?? Math.cos(angle) * radius,
137
+ y: start?.y ?? Math.sin(angle) * radius,
138
+ fx: pinned?.x,
139
+ fy: pinned?.y,
140
+ };
141
+ });
142
+ const byId = new Map(sim.map(n => [n.id, n]));
143
+ const links: SimulationLinkDatum<SimNode>[] = edges
144
+ .filter(
145
+ e => byId.has(e.source) && byId.has(e.target) && e.source !== e.target,
146
+ )
147
+ .map(e => ({ source: e.source, target: e.target }));
148
+
149
+ // Group centres on a ring, so groups settle apart from each other.
150
+ const groups = [
151
+ ...new Set(nodes.map(n => n.group).filter((g): g is string => !!g)),
152
+ ];
153
+ const ring = Math.max(260, groups.length * 110);
154
+ const groupCenter = new Map(
155
+ groups.map((g, i) => {
156
+ const a = (i / Math.max(groups.length, 1)) * Math.PI * 2;
157
+ return [g, { x: Math.cos(a) * ring, y: Math.sin(a) * ring }];
158
+ }),
159
+ );
160
+ const spread = Math.hypot(options.nodeWidth, options.nodeHeight);
161
+
162
+ const simulation = forceSimulation(sim)
163
+ .force(
164
+ 'link',
165
+ forceLink<SimNode, SimulationLinkDatum<SimNode>>(links)
166
+ .id(d => d.id)
167
+ .distance(spread * 1.1)
168
+ .strength(0.35),
169
+ )
170
+ .force('charge', forceManyBody<SimNode>().strength(-spread * 4))
171
+ .force('collide', forceCollide<SimNode>(spread / 2 + 8))
172
+ .force(
173
+ 'x',
174
+ forceX<SimNode>(d =>
175
+ d.group ? (groupCenter.get(d.group)?.x ?? 0) : 0,
176
+ ).strength(d => (d.group ? 0.12 : 0.03)),
177
+ )
178
+ .force(
179
+ 'y',
180
+ forceY<SimNode>(d =>
181
+ d.group ? (groupCenter.get(d.group)?.y ?? 0) : 0,
182
+ ).strength(d => (d.group ? 0.12 : 0.03)),
183
+ )
184
+ .stop();
185
+ // Warm starts need fewer ticks.
186
+ const ticks = known.size ? 120 : 300;
187
+ simulation.alpha(known.size ? 0.4 : 1);
188
+ for (let i = 0; i < ticks; i += 1) simulation.tick();
189
+ const result = new Map(sim.map(n => [n.id, { x: n.x ?? 0, y: n.y ?? 0 }]));
190
+ separateGroups(result, nodes, options);
191
+ return result;
192
+ }
193
+
194
+ /**
195
+ * A layered layout, upstream on the left and downstream on the right: each node goes one column
196
+ * after its furthest caller, and nodes in a column are ordered to keep lines short (barycentre
197
+ * sweeps). Cycles are broken at the edge that closes them.
198
+ */
199
+ export function layeredLayout(
200
+ nodes: MapLayoutNode[],
201
+ edges: MapLayoutEdge[],
202
+ options: MapLayoutOptions,
203
+ ): Map<string, DiagramPoint> {
204
+ const ids = new Set(nodes.map(n => n.id));
205
+ const out = new Map<string, string[]>();
206
+ const incoming = new Map<string, string[]>();
207
+ for (const id of ids) {
208
+ out.set(id, []);
209
+ incoming.set(id, []);
210
+ }
211
+ // Drop the edges that close a cycle, found with a depth-first search.
212
+ const state = new Map<string, 0 | 1 | 2>();
213
+ const kept: MapLayoutEdge[] = [];
214
+ const adjacency = new Map<string, string[]>();
215
+ for (const e of edges) {
216
+ if (ids.has(e.source) && ids.has(e.target) && e.source !== e.target) {
217
+ adjacency.set(e.source, [...(adjacency.get(e.source) ?? []), e.target]);
218
+ }
219
+ }
220
+ const visit = (id: string) => {
221
+ state.set(id, 1);
222
+ for (const next of adjacency.get(id) ?? []) {
223
+ if (state.get(next) === 1) {
224
+ // A back edge: skip it.
225
+ } else {
226
+ kept.push({ source: id, target: next });
227
+ if (!state.get(next)) visit(next);
228
+ }
229
+ }
230
+ state.set(id, 2);
231
+ };
232
+ for (const n of nodes) if (!state.get(n.id)) visit(n.id);
233
+ for (const e of kept) {
234
+ out.get(e.source)?.push(e.target);
235
+ incoming.get(e.target)?.push(e.source);
236
+ }
237
+
238
+ // Longest path from the sources gives each node its column.
239
+ const rank = new Map<string, number>();
240
+ const rankOf = (id: string, seen = new Set<string>()): number => {
241
+ const known = rank.get(id);
242
+ if (known !== undefined) return known;
243
+ if (seen.has(id)) return 0;
244
+ seen.add(id);
245
+ const callers = incoming.get(id) ?? [];
246
+ const r = callers.length
247
+ ? Math.max(...callers.map(c => rankOf(c, seen) + 1))
248
+ : 0;
249
+ rank.set(id, r);
250
+ return r;
251
+ };
252
+ for (const n of nodes) rankOf(n.id);
253
+ const columns: string[][] = [];
254
+ for (const n of nodes) {
255
+ const r = rank.get(n.id) ?? 0;
256
+ (columns[r] = columns[r] ?? []).push(n.id);
257
+ }
258
+
259
+ // Order each column by the average position of its neighbours, sweeping both ways.
260
+ const position = new Map<string, number>();
261
+ const index = () =>
262
+ columns.forEach(col => col.forEach((id, i) => position.set(id, i)));
263
+ index();
264
+ const barycentre = (id: string, neighbours: string[]) =>
265
+ neighbours.length
266
+ ? neighbours.reduce((s, n) => s + (position.get(n) ?? 0), 0) /
267
+ neighbours.length
268
+ : (position.get(id) ?? 0);
269
+ for (let sweep = 0; sweep < 4; sweep += 1) {
270
+ const forward = sweep % 2 === 0;
271
+ const order = forward ? columns.keys() : [...columns.keys()].reverse();
272
+ for (const c of order) {
273
+ const col = columns[c];
274
+ if (col) {
275
+ col.sort(
276
+ (a, b) =>
277
+ barycentre(
278
+ a,
279
+ forward ? (incoming.get(a) ?? []) : (out.get(a) ?? []),
280
+ ) -
281
+ barycentre(
282
+ b,
283
+ forward ? (incoming.get(b) ?? []) : (out.get(b) ?? []),
284
+ ),
285
+ );
286
+ col.forEach((id, i) => position.set(id, i));
287
+ }
288
+ }
289
+ }
290
+
291
+ const colGap = options.nodeWidth + 120;
292
+ const rowGap = options.nodeHeight + 40;
293
+ const result = new Map<string, DiagramPoint>();
294
+ const groupOf = new Map(nodes.map(n => [n.id, n.group ?? '']));
295
+ const lanes = [...new Set(nodes.map(n => n.group ?? ''))];
296
+ if (lanes.length < 2) {
297
+ columns.forEach((col, c) => {
298
+ const height = (col.length - 1) * rowGap;
299
+ col.forEach((id, i) =>
300
+ result.set(id, { x: c * colGap, y: i * rowGap - height / 2 }),
301
+ );
302
+ });
303
+ } else {
304
+ // Groups become horizontal lanes, so their boxes never overlap. Lanes are ordered by where
305
+ // their nodes sit on average, which keeps the barycentre order as far as possible.
306
+ const avg = (lane: string) => {
307
+ const ps = nodes
308
+ .filter(n => (n.group ?? '') === lane)
309
+ .map(
310
+ n =>
311
+ (position.get(n.id) ?? 0) /
312
+ Math.max(1, (columns[rank.get(n.id) ?? 0] ?? []).length),
313
+ );
314
+ return ps.reduce((s, p) => s + p, 0) / Math.max(1, ps.length);
315
+ };
316
+ lanes.sort((a, b) => avg(a) - avg(b));
317
+ let top = 0;
318
+ for (const lane of lanes) {
319
+ const perColumn = columns.map(col =>
320
+ (col ?? []).filter(id => groupOf.get(id) === lane),
321
+ );
322
+ const rows = Math.max(...perColumn.map(c => c.length));
323
+ const height = (rows - 1) * rowGap;
324
+ const laneTop = top;
325
+ perColumn.forEach((col, c) => {
326
+ const offset = (height - (col.length - 1) * rowGap) / 2;
327
+ col.forEach((id, i) =>
328
+ result.set(id, { x: c * colGap, y: laneTop + offset + i * rowGap }),
329
+ );
330
+ });
331
+ const boxed = lane ? GROUP_PADDING.top + GROUP_PADDING.bottom : 0;
332
+ top += height + rowGap + boxed + 24;
333
+ }
334
+ }
335
+ for (const n of nodes) if (n.pinned) result.set(n.id, n.pinned);
336
+ return result;
337
+ }
338
+
339
+ /**
340
+ * A radial layout around `center`: rings by the number of hops (either direction), with each
341
+ * ring's nodes ordered to sit near the node that reached them. Unreached nodes go on an outer ring.
342
+ */
343
+ export function radialLayout(
344
+ nodes: MapLayoutNode[],
345
+ edges: MapLayoutEdge[],
346
+ options: MapLayoutOptions,
347
+ ): Map<string, DiagramPoint> {
348
+ const ids = nodes.map(n => n.id);
349
+ const center =
350
+ options.center && ids.includes(options.center) ? options.center : ids[0];
351
+ const neighbours = new Map<string, string[]>(ids.map(id => [id, []]));
352
+ for (const e of edges) {
353
+ if (
354
+ neighbours.has(e.source) &&
355
+ neighbours.has(e.target) &&
356
+ e.source !== e.target
357
+ ) {
358
+ neighbours.get(e.source)?.push(e.target);
359
+ neighbours.get(e.target)?.push(e.source);
360
+ }
361
+ }
362
+ const hop = new Map<string, number>();
363
+ const parent = new Map<string, string>();
364
+ const rings: string[][] = [];
365
+ if (center) {
366
+ hop.set(center, 0);
367
+ rings[0] = [center];
368
+ const queue = [center];
369
+ while (queue.length) {
370
+ const id = queue.shift() as string;
371
+ const h = hop.get(id) ?? 0;
372
+ for (const n of neighbours.get(id) ?? []) {
373
+ if (!hop.has(n)) {
374
+ hop.set(n, h + 1);
375
+ parent.set(n, id);
376
+ (rings[h + 1] = rings[h + 1] ?? []).push(n);
377
+ queue.push(n);
378
+ }
379
+ }
380
+ }
381
+ }
382
+ const rest = ids.filter(id => !hop.has(id));
383
+
384
+ // Each node gets a slice of the circle sized by the leaves below it in the BFS tree, and its
385
+ // children share that slice, so branches fan out without crossing.
386
+ const children = new Map<string, string[]>();
387
+ for (const [child, p] of parent)
388
+ children.set(p, [...(children.get(p) ?? []), child]);
389
+ const leaves = new Map<string, number>();
390
+ const countLeaves = (id: string): number => {
391
+ const kids = children.get(id) ?? [];
392
+ const n = kids.length ? kids.reduce((s, k) => s + countLeaves(k), 0) : 1;
393
+ leaves.set(id, n);
394
+ return n;
395
+ };
396
+ const angle = new Map<string, number>();
397
+ const assign = (id: string, from: number, to: number) => {
398
+ angle.set(id, (from + to) / 2);
399
+ const kids = children.get(id) ?? [];
400
+ const total = kids.reduce((s, k) => s + (leaves.get(k) ?? 1), 0);
401
+ let at = from;
402
+ for (const k of kids) {
403
+ const span = ((to - from) * (leaves.get(k) ?? 1)) / total;
404
+ assign(k, at, at + span);
405
+ at += span;
406
+ }
407
+ };
408
+ if (center) {
409
+ countLeaves(center);
410
+ assign(center, -Math.PI / 2, (Math.PI * 3) / 2);
411
+ }
412
+
413
+ // Each ring is far enough out for its nodes to fit side by side.
414
+ const step = Math.max(options.nodeWidth, options.nodeHeight * 3) + 40;
415
+ const radii: number[] = [0];
416
+ rings.forEach((ring, r) => {
417
+ if (r > 0) {
418
+ const room = options.nodeWidth + 24;
419
+ const fit = (ring.length * room) / (Math.PI * 2);
420
+ // The tightest pair of neighbours on the ring decides how far out it must go.
421
+ const as = ring.map(id => angle.get(id) ?? 0).sort((a, b) => a - b);
422
+ let tightest = Math.PI * 2;
423
+ for (let i = 1; i < as.length; i += 1)
424
+ tightest = Math.min(tightest, as[i] - as[i - 1]);
425
+ const spread = as.length > 1 ? room / Math.max(tightest, 0.05) : 0;
426
+ const prev = radii[r - 1];
427
+ radii[r] = Math.max(prev + step, fit, Math.min(spread, prev + step * 3));
428
+ }
429
+ });
430
+ const result = new Map<string, DiagramPoint>();
431
+ for (const [id, h] of hop) {
432
+ const a = angle.get(id) ?? 0;
433
+ const radius = radii[h] ?? 0;
434
+ result.set(
435
+ id,
436
+ h ? { x: Math.cos(a) * radius, y: Math.sin(a) * radius } : { x: 0, y: 0 },
437
+ );
438
+ }
439
+ if (rest.length) {
440
+ const outer = Math.max(
441
+ (radii[radii.length - 1] ?? 0) + step,
442
+ (rest.length * (options.nodeWidth + 24)) / (Math.PI * 2),
443
+ );
444
+ rest.forEach((id, i) => {
445
+ const a = (i / rest.length) * Math.PI * 2 - Math.PI / 2;
446
+ result.set(id, { x: Math.cos(a) * outer, y: Math.sin(a) * outer });
447
+ });
448
+ }
449
+ for (const n of nodes) if (n.pinned) result.set(n.id, n.pinned);
450
+ return result;
451
+ }
452
+
453
+ /** Ids reachable from `start` along edges: `upstream` follows edges backwards (who depends on it). */
454
+ export function reachable(
455
+ start: string,
456
+ edges: MapLayoutEdge[],
457
+ direction: 'upstream' | 'downstream',
458
+ ): Set<string> {
459
+ const next = new Map<string, string[]>();
460
+ for (const e of edges) {
461
+ const [from, to] =
462
+ direction === 'downstream' ? [e.source, e.target] : [e.target, e.source];
463
+ next.set(from, [...(next.get(from) ?? []), to]);
464
+ }
465
+ const seen = new Set([start]);
466
+ const queue = [start];
467
+ while (queue.length) {
468
+ const id = queue.shift() as string;
469
+ for (const n of next.get(id) ?? []) {
470
+ if (!seen.has(n)) {
471
+ seen.add(n);
472
+ queue.push(n);
473
+ }
474
+ }
475
+ }
476
+ return seen;
477
+ }
478
+
479
+ /** Ids within `hops` steps of `start`, in either direction. */
480
+ export function withinHops(
481
+ start: string,
482
+ edges: MapLayoutEdge[],
483
+ hops: number,
484
+ ): Set<string> {
485
+ const neighbours = new Map<string, string[]>();
486
+ for (const e of edges) {
487
+ neighbours.set(e.source, [...(neighbours.get(e.source) ?? []), e.target]);
488
+ neighbours.set(e.target, [...(neighbours.get(e.target) ?? []), e.source]);
489
+ }
490
+ const seen = new Map([[start, 0]]);
491
+ const queue = [start];
492
+ while (queue.length) {
493
+ const id = queue.shift() as string;
494
+ const h = seen.get(id) ?? 0;
495
+ if (h < hops) {
496
+ for (const n of neighbours.get(id) ?? []) {
497
+ if (!seen.has(n)) {
498
+ seen.set(n, h + 1);
499
+ queue.push(n);
500
+ }
501
+ }
502
+ }
503
+ }
504
+ return new Set(seen.keys());
505
+ }