dishui 0.0.106 → 0.0.110

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 (388) hide show
  1. package/dist/.release-verified.json +3 -2
  2. package/dist/components/Accordion/index.js.map +1 -1
  3. package/dist/components/Avatar/index.js.map +1 -1
  4. package/dist/components/Badge/index.js.map +1 -1
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/ButtonMenu/index.js.map +1 -1
  7. package/dist/components/Card/Metric2.js.map +1 -1
  8. package/dist/components/Card/Ticket2.js.map +1 -1
  9. package/dist/components/Card/index.js.map +1 -1
  10. package/dist/components/Chart/Chart.js.map +1 -1
  11. package/dist/components/Checkbox/index.js.map +1 -1
  12. package/dist/components/ChoicePicker/index.js.map +1 -1
  13. package/dist/components/Column/index.js.map +1 -1
  14. package/dist/components/ConfirmDialog/index.js.map +1 -1
  15. package/dist/components/DateTimeInput/index.js.map +1 -1
  16. package/dist/components/Demo/index.js.map +1 -1
  17. package/dist/components/Demo/source.js.map +1 -1
  18. package/dist/components/Divider/index.js.map +1 -1
  19. package/dist/components/EmptyState/index.js.map +1 -1
  20. package/dist/components/Field/index.js.map +1 -1
  21. package/dist/components/FileUploader/DropZone.js.map +1 -1
  22. package/dist/components/FileUploader/FileItem.js.map +1 -1
  23. package/dist/components/FileUploader/FileUploader.js.map +1 -1
  24. package/dist/components/FileUploader/UploadQueue.js.map +1 -1
  25. package/dist/components/GroupButton/index.js.map +1 -1
  26. package/dist/components/GroupedTable/index.js.map +1 -1
  27. package/dist/components/Icon/index.js.map +1 -1
  28. package/dist/components/Image/index.js.map +1 -1
  29. package/dist/components/Input/index.js.map +1 -1
  30. package/dist/components/Label/index.js.map +1 -1
  31. package/dist/components/Layout/index.js.map +1 -1
  32. package/dist/components/LayoutSuite/DashboardSuite.js.map +1 -1
  33. package/dist/components/LayoutSuite/index.js.map +1 -1
  34. package/dist/components/List/index.js.map +1 -1
  35. package/dist/components/Markdown/Markdown.js.map +1 -1
  36. package/dist/components/Markdown/codeThemes.js.map +1 -1
  37. package/dist/components/Markdown/markdownComponents.js.map +1 -1
  38. package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
  39. package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
  40. package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
  41. package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
  42. package/dist/components/Modal/focusScope.js.map +1 -1
  43. package/dist/components/Modal/index.js.map +1 -1
  44. package/dist/components/MultipleChoice/index.js.map +1 -1
  45. package/dist/components/NavigationList/index.js.map +1 -1
  46. package/dist/components/Page/Float2.js.map +1 -1
  47. package/dist/components/Page/index.js.map +1 -1
  48. package/dist/components/Page/resize2.js.map +1 -1
  49. package/dist/components/PageHeader/index.js.map +1 -1
  50. package/dist/components/PagePanel/index.js.map +1 -1
  51. package/dist/components/ProtectedRoute/index.js.map +1 -1
  52. package/dist/components/Resizable/ResizeGrip.js.map +1 -1
  53. package/dist/components/Resizable/index.js.map +1 -1
  54. package/dist/components/Resizable/useResize.js.map +1 -1
  55. package/dist/components/Row/index.js.map +1 -1
  56. package/dist/components/Section/index.js.map +1 -1
  57. package/dist/components/Select/index.js.map +1 -1
  58. package/dist/components/SidebarToggleButton/index.js.map +1 -1
  59. package/dist/components/Skeleton/index.js.map +1 -1
  60. package/dist/components/Slider/index.js.map +1 -1
  61. package/dist/components/Switch/index.js.map +1 -1
  62. package/dist/components/Tab/index.js.map +1 -1
  63. package/dist/components/Table/index.js.map +1 -1
  64. package/dist/components/Tabs/index.js.map +1 -1
  65. package/dist/components/Tabs/tabNavigation.js.map +1 -1
  66. package/dist/components/Text/index.js.map +1 -1
  67. package/dist/components/Textarea/index.js.map +1 -1
  68. package/dist/components/Tooltip/index.js.map +1 -1
  69. package/dist/components/Tree/Tree.js.map +1 -1
  70. package/dist/components/ai/AgentChat/index.js.map +1 -1
  71. package/dist/components/ai/AgentRunCard/index.js.map +1 -1
  72. package/dist/components/ai/AgentScreen/index.js.map +1 -1
  73. package/dist/components/ai/ApprovalCard/index.js.map +1 -1
  74. package/dist/components/ai/CodeView/index.js.map +1 -1
  75. package/dist/components/ai/CommandSearch/index.js.map +1 -1
  76. package/dist/components/ai/ContextCards/index.js.map +1 -1
  77. package/dist/components/ai/DiffTable/index.js.map +1 -1
  78. package/dist/components/ai/FilterTable/index.js.map +1 -1
  79. package/dist/components/ai/FineTuneCard/index.js.map +1 -1
  80. package/dist/components/ai/InsightCards/index.js.map +1 -1
  81. package/dist/components/ai/IssueCard/index.js.map +1 -1
  82. package/dist/components/ai/LoadingState/index.js.map +1 -1
  83. package/dist/components/ai/PromptBar/index.js.map +1 -1
  84. package/dist/components/ai/RecommendationCard/index.js.map +1 -1
  85. package/dist/components/ai/RecordsTable/index.js.map +1 -1
  86. package/dist/components/ai/SelectionActions/index.js.map +1 -1
  87. package/dist/components/ai/StateFlow/index.js.map +1 -1
  88. package/dist/components/ai/StreamingText/index.js.map +1 -1
  89. package/dist/components/ai/TaskRows/index.js.map +1 -1
  90. package/dist/components/ai/Thinking/index.js.map +1 -1
  91. package/dist/components/ai/ToolChips/index.js.map +1 -1
  92. package/dist/components/ai/shared.js.map +1 -1
  93. package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
  94. package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
  95. package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
  96. package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
  97. package/dist/components/pro/Calendar/Calendar.js +165 -160
  98. package/dist/components/pro/Calendar/Calendar.js.map +1 -1
  99. package/dist/components/pro/Calendar/hooks/useCalendarDrag.js.map +1 -1
  100. package/dist/components/pro/Calendar/hooks/useCalendarState.js +31 -31
  101. package/dist/components/pro/Calendar/hooks/useCalendarState.js.map +1 -1
  102. package/dist/components/pro/Calendar/utils.js.map +1 -1
  103. package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
  104. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
  105. package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
  106. package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
  107. package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
  108. package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
  109. package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
  110. package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
  111. package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
  112. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
  113. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +65 -59
  114. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
  115. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
  116. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
  117. package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
  118. package/dist/components/pro/CodeEditor/themes.js.map +1 -1
  119. package/dist/components/pro/CodeEditor/utils.js.map +1 -1
  120. package/dist/components/pro/DataTable/DataTable.js.map +1 -1
  121. package/dist/components/pro/DataTable/Filters.js.map +1 -1
  122. package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
  123. package/dist/components/pro/DataTable/PivotView.js.map +1 -1
  124. package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
  125. package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
  126. package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
  127. package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
  128. package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
  129. package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
  130. package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
  131. package/dist/components/pro/DataTable/extension.js.map +1 -1
  132. package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
  133. package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
  134. package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
  135. package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
  136. package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
  137. package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
  138. package/dist/components/pro/DataTable/useDataTableModel.js +119 -104
  139. package/dist/components/pro/DataTable/useDataTableModel.js.map +1 -1
  140. package/dist/components/pro/DataTable/utils.js.map +1 -1
  141. package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
  142. package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
  143. package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
  144. package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
  145. package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
  146. package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
  147. package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
  148. package/dist/components/pro/Flow/Flow.js.map +1 -1
  149. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  150. package/dist/components/pro/Flow/archify/build.js.map +1 -1
  151. package/dist/components/pro/Flow/archify/convert.js.map +1 -1
  152. package/dist/components/pro/Flow/archify/palette.js.map +1 -1
  153. package/dist/components/pro/Flow/archify/presets.js.map +1 -1
  154. package/dist/components/pro/Flow/archify/spec.js.map +1 -1
  155. package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
  156. package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
  157. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
  158. package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
  159. package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
  160. package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
  161. package/dist/components/pro/Flow/constants.js.map +1 -1
  162. package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
  163. package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
  164. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  165. package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
  166. package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
  167. package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
  168. package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
  169. package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
  170. package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
  171. package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
  172. package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
  173. package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
  174. package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
  175. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
  176. package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
  177. package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
  178. package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
  179. package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
  180. package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
  181. package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
  182. package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
  183. package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
  184. package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
  185. package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
  186. package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
  187. package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
  188. package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
  189. package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
  190. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
  191. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  192. package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
  193. package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
  194. package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
  195. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  196. package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
  197. package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
  198. package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
  199. package/dist/components/pro/Flow/nodes/chartGeometryBudget.js.map +1 -1
  200. package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
  201. package/dist/components/pro/Flow/nodes/demandRender.js.map +1 -1
  202. package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
  203. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  204. package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
  205. package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
  206. package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
  207. package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
  208. package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
  209. package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
  210. package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
  211. package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
  212. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  213. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  214. package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
  215. package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
  216. package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
  217. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  218. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  219. package/dist/components/pro/Flow/types.js.map +1 -1
  220. package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
  221. package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
  222. package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
  223. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
  224. package/dist/components/pro/Gantt/Gantt.js.map +1 -1
  225. package/dist/components/pro/Gantt/hooks/useGanttDrag.js.map +1 -1
  226. package/dist/components/pro/Gantt/hooks/useGanttState.js +79 -71
  227. package/dist/components/pro/Gantt/hooks/useGanttState.js.map +1 -1
  228. package/dist/components/pro/Gantt/utils.js.map +1 -1
  229. package/dist/components/pro/Kanban/Kanban.js.map +1 -1
  230. package/dist/components/pro/Kanban/Swimlanes.js.map +1 -1
  231. package/dist/components/pro/Kanban/useKanbanDrag.js.map +1 -1
  232. package/dist/components/pro/Kanban/utils.js.map +1 -1
  233. package/dist/components/pro/RichTextEditor/AIRewrite.d.ts +1 -0
  234. package/dist/components/pro/RichTextEditor/AIRewrite.js +109 -88
  235. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  236. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  237. package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
  238. package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
  239. package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
  240. package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
  241. package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
  242. package/dist/components/pro/RichTextEditor/RichTextEditor.js +133 -132
  243. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  244. package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
  245. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  246. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  247. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  248. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
  249. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  250. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  251. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  252. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js.map +1 -1
  253. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
  254. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
  255. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
  256. package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
  257. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
  258. package/dist/components/pro/RichTextEditor/extensions/ResizableImage.js.map +1 -1
  259. package/dist/components/pro/RichTextEditor/extensions/legacyMermaid.js.map +1 -1
  260. package/dist/components/pro/RichTextEditor/types.d.ts +2 -0
  261. package/dist/components/pro/RichTextEditor/types.js.map +1 -1
  262. package/dist/components/pro/Sprite/Molly/animations.d.ts +6 -0
  263. package/dist/components/pro/Sprite/Molly/animations.js +52 -0
  264. package/dist/components/pro/Sprite/Molly/animations.js.map +1 -0
  265. package/dist/components/pro/Sprite/Molly/events.d.ts +2 -0
  266. package/dist/components/pro/Sprite/Molly/events.js +46 -0
  267. package/dist/components/pro/Sprite/Molly/events.js.map +1 -0
  268. package/dist/components/pro/Sprite/Molly/index.d.ts +1 -0
  269. package/dist/components/pro/Sprite/Molly/index.js +12 -0
  270. package/dist/components/pro/Sprite/Molly/index.js.map +1 -0
  271. package/dist/components/pro/Sprite/Molly/legFlexion.d.ts +3 -0
  272. package/dist/components/pro/Sprite/Molly/legFlexion.js +48 -0
  273. package/dist/components/pro/Sprite/Molly/legFlexion.js.map +1 -0
  274. package/dist/components/pro/Sprite/Molly/locomotion.d.ts +4 -0
  275. package/dist/components/pro/Sprite/Molly/locomotion.js +51 -0
  276. package/dist/components/pro/Sprite/Molly/locomotion.js.map +1 -0
  277. package/dist/components/pro/Sprite/Molly/model.d.ts +23 -0
  278. package/dist/components/pro/Sprite/Molly/model.js +614 -0
  279. package/dist/components/pro/Sprite/Molly/model.js.map +1 -0
  280. package/dist/components/pro/Sprite/Molly/rig.d.ts +25 -0
  281. package/dist/components/pro/Sprite/Molly/rig.js +102 -0
  282. package/dist/components/pro/Sprite/Molly/rig.js.map +1 -0
  283. package/dist/components/pro/Sprite/Ruby/animations.d.ts +6 -0
  284. package/dist/components/pro/Sprite/Ruby/animations.js +58 -0
  285. package/dist/components/pro/Sprite/Ruby/animations.js.map +1 -0
  286. package/dist/components/pro/Sprite/Ruby/events.d.ts +2 -0
  287. package/dist/components/pro/Sprite/Ruby/events.js +46 -0
  288. package/dist/components/pro/Sprite/Ruby/events.js.map +1 -0
  289. package/dist/components/pro/Sprite/Ruby/index.d.ts +1 -0
  290. package/dist/components/pro/Sprite/Ruby/index.js +12 -0
  291. package/dist/components/pro/Sprite/Ruby/index.js.map +1 -0
  292. package/dist/components/pro/Sprite/Ruby/locomotion.d.ts +4 -0
  293. package/dist/components/pro/Sprite/Ruby/locomotion.js +41 -0
  294. package/dist/components/pro/Sprite/Ruby/locomotion.js.map +1 -0
  295. package/dist/components/pro/Sprite/Ruby/model.d.ts +23 -0
  296. package/dist/components/pro/Sprite/Ruby/model.js +605 -0
  297. package/dist/components/pro/Sprite/Ruby/model.js.map +1 -0
  298. package/dist/components/pro/Sprite/Ruby/rig.d.ts +26 -0
  299. package/dist/components/pro/Sprite/Ruby/rig.js +112 -0
  300. package/dist/components/pro/Sprite/Ruby/rig.js.map +1 -0
  301. package/dist/components/pro/Sprite/Sprite.d.ts +23 -0
  302. package/dist/components/pro/Sprite/Sprite2.js +224 -0
  303. package/dist/components/pro/Sprite/Sprite2.js.map +1 -0
  304. package/dist/components/pro/Sprite/actions.d.ts +3 -0
  305. package/dist/components/pro/Sprite/actions.js +16 -0
  306. package/dist/components/pro/Sprite/actions.js.map +1 -0
  307. package/dist/components/pro/Sprite/createSpriteScene.d.ts +4 -0
  308. package/dist/components/pro/Sprite/createSpriteScene.js +14 -0
  309. package/dist/components/pro/Sprite/createSpriteScene.js.map +1 -0
  310. package/dist/components/pro/Sprite/index.d.ts +4 -0
  311. package/dist/components/pro/Sprite/shared/animation.d.ts +33 -0
  312. package/dist/components/pro/Sprite/shared/animation.js +39 -0
  313. package/dist/components/pro/Sprite/shared/animation.js.map +1 -0
  314. package/dist/components/pro/Sprite/shared/createSpriteStage.d.ts +14 -0
  315. package/dist/components/pro/Sprite/shared/createSpriteStage.js +127 -0
  316. package/dist/components/pro/Sprite/shared/createSpriteStage.js.map +1 -0
  317. package/dist/components/pro/Sprite/shared/events.d.ts +5 -0
  318. package/dist/components/pro/Sprite/shared/events.js +21 -0
  319. package/dist/components/pro/Sprite/shared/events.js.map +1 -0
  320. package/dist/components/pro/Sprite/shared/face.d.ts +15 -0
  321. package/dist/components/pro/Sprite/shared/face.js +33 -0
  322. package/dist/components/pro/Sprite/shared/face.js.map +1 -0
  323. package/dist/components/pro/Sprite/shared/faceSurface.d.ts +6 -0
  324. package/dist/components/pro/Sprite/shared/faceSurface.js +66 -0
  325. package/dist/components/pro/Sprite/shared/faceSurface.js.map +1 -0
  326. package/dist/components/pro/Sprite/shared/gait.d.ts +5 -0
  327. package/dist/components/pro/Sprite/shared/gait.js +19 -0
  328. package/dist/components/pro/Sprite/shared/gait.js.map +1 -0
  329. package/dist/components/pro/Sprite/shared/geometry.d.ts +8 -0
  330. package/dist/components/pro/Sprite/shared/geometry.js +59 -0
  331. package/dist/components/pro/Sprite/shared/geometry.js.map +1 -0
  332. package/dist/components/pro/Sprite/shared/magicEffect.d.ts +27 -0
  333. package/dist/components/pro/Sprite/shared/magicEffect.js +61 -0
  334. package/dist/components/pro/Sprite/shared/magicEffect.js.map +1 -0
  335. package/dist/components/pro/Sprite/shared/playback.d.ts +8 -0
  336. package/dist/components/pro/Sprite/shared/playback.js +74 -0
  337. package/dist/components/pro/Sprite/shared/playback.js.map +1 -0
  338. package/dist/components/pro/Sprite/shared/rig.d.ts +6 -0
  339. package/dist/components/pro/Sprite/shared/rig.js +48 -0
  340. package/dist/components/pro/Sprite/shared/rig.js.map +1 -0
  341. package/dist/components/pro/Sprite/shared/scene.d.ts +9 -0
  342. package/dist/components/pro/Sprite/shared/scene.js +21 -0
  343. package/dist/components/pro/Sprite/shared/scene.js.map +1 -0
  344. package/dist/components/pro/Sprite/shared/sculptor.d.ts +14 -0
  345. package/dist/components/pro/Sprite/shared/sculptor.js +78 -0
  346. package/dist/components/pro/Sprite/shared/sculptor.js.map +1 -0
  347. package/dist/components/pro/Sprite/shared/speechBubble.d.ts +15 -0
  348. package/dist/components/pro/Sprite/shared/speechBubble.js +129 -0
  349. package/dist/components/pro/Sprite/shared/speechBubble.js.map +1 -0
  350. package/dist/components/pro/Sprite/types.d.ts +40 -0
  351. package/dist/contexts/AppContext.js.map +1 -1
  352. package/dist/contexts/authentication.js.map +1 -1
  353. package/dist/data-table.js +3 -3
  354. package/dist/data-table.js.map +1 -1
  355. package/dist/dishui.css +1 -1
  356. package/dist/hooks/useClickOutside.js.map +1 -1
  357. package/dist/hooks/useContainerElement.js.map +1 -1
  358. package/dist/hooks/useControllableState.js.map +1 -1
  359. package/dist/hooks/useCopyToClipboard.js.map +1 -1
  360. package/dist/hooks/useDebounce.js.map +1 -1
  361. package/dist/hooks/useDraggable.js.map +1 -1
  362. package/dist/hooks/useTableColumns.js.map +1 -1
  363. package/dist/hooks/useTableData.js.map +1 -1
  364. package/dist/index-nostyled.d.ts +2 -0
  365. package/dist/index.d.ts +2 -0
  366. package/dist/index.js +116 -115
  367. package/dist/layouts/MainLayout.js.map +1 -1
  368. package/dist/layouts/Navbar.js.map +1 -1
  369. package/dist/layouts/Sidebar.js.map +1 -1
  370. package/dist/layouts/headbar/Headbar.js.map +1 -1
  371. package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
  372. package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
  373. package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
  374. package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
  375. package/dist/sprite.js +2 -0
  376. package/dist/styles/themeStyles.js.map +1 -1
  377. package/dist/utils/cn.js.map +1 -1
  378. package/dist/utils/flexLayout.js.map +1 -1
  379. package/dist/utils/i18n.js.map +1 -1
  380. package/dist/utils/menu.js.map +1 -1
  381. package/dist/utils/rehype-code-meta.js.map +1 -1
  382. package/dist/utils/remark-code-meta.js.map +1 -1
  383. package/dist/utils/routerBuilder.js.map +1 -1
  384. package/dist/utils/safeStorage.js.map +1 -1
  385. package/dist/utils/selection.js +29 -20
  386. package/dist/utils/selection.js.map +1 -1
  387. package/dist/utils/themes.js.map +1 -1
  388. package/package.json +15 -11
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","names":[],"sources":["../../../../../src/components/pro/Flow/archify/build.ts"],"sourcesContent":["/**\n * Shared helpers for building a Flow `FlowDocument` from an Archify spec.\n *\n * The converters reproduce Archify's fixed grid/lane geometry (coordinates\n * copied from the reference renderers) so an imported diagram matches the\n * artifact screenshots. Everything is emitted as native Flow nodes/edges/lines\n * with literal Archify colors, so the result is fully editable afterwards.\n */\n\nimport type {\n FlowNode,\n FlowEdge,\n FlowNodeData,\n FlowEdgeData,\n FlowEdgeLineStyle,\n} from '../types';\nimport type { ArchifySide } from './spec';\nimport { ARCHIFY_LANE_STROKE, ARCHIFY_TEXT_MUTED } from './palette';\n\nlet _seq = 0;\nfunction uid(prefix: string): string {\n _seq += 1;\n return `${prefix}_${_seq.toString(36)}_${Math.floor(Math.random() * 1e6).toString(36)}`;\n}\n\nexport interface BuildNodeOptions {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n label: string;\n sublabel?: string;\n tag?: string;\n fill: string;\n stroke: string;\n text: string;\n sub?: string;\n fontSize?: number;\n borderStyle?: FlowNodeData['borderStyle'];\n strokeWidth?: number;\n zIndex?: number;\n}\n\n/** Build a rounded-rect card node in the Archify style. */\nexport function card(opts: BuildNodeOptions): FlowNode {\n return {\n id: opts.id,\n type: 'shapeRoundRect',\n position: { x: opts.x, y: opts.y },\n width: opts.width,\n height: opts.height,\n zIndex: opts.zIndex ?? 2,\n data: {\n label: opts.label,\n sublabel: opts.sublabel,\n sublabelColor: opts.sub ?? ARCHIFY_TEXT_MUTED,\n tag: opts.tag,\n fill: opts.fill,\n stroke: opts.stroke,\n strokeWidth: opts.strokeWidth ?? 1.75,\n color: opts.text,\n labelColor: opts.text,\n fontSize: opts.fontSize ?? 13,\n borderStyle: opts.borderStyle ?? 'solid',\n attributes: [],\n },\n };\n}\n\nexport interface BuildGroupOptions {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n label: string;\n stroke?: string;\n fill?: string;\n borderStyle?: FlowNodeData['borderStyle'];\n labelColor?: string;\n zIndex?: number;\n}\n\n/**\n * Build a boundary / lane / phase frame as a group rectangle. Rendered behind\n * the cards (low zIndex) with a dashed outline and a top-left label.\n */\nexport function frame(opts: BuildGroupOptions): FlowNode {\n return {\n id: opts.id,\n type: 'geometryGroup',\n position: { x: opts.x, y: opts.y },\n width: opts.width,\n height: opts.height,\n zIndex: opts.zIndex ?? 0,\n data: {\n label: opts.label,\n fill: opts.fill ?? 'transparent',\n stroke: opts.stroke ?? ARCHIFY_LANE_STROKE,\n strokeWidth: 1.25,\n color: opts.labelColor ?? ARCHIFY_TEXT_MUTED,\n labelColor: opts.labelColor ?? ARCHIFY_TEXT_MUTED,\n fontSize: 12,\n isGroup: true,\n borderStyle: opts.borderStyle ?? 'dashed',\n groupLabelPlacement: 'top',\n groupLabelAlign: 'start',\n groupLabelBgMode: 'text',\n attributes: [],\n },\n };\n}\n\nexport interface BuildEdgeOptions {\n id?: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n label?: string;\n color: string;\n width?: number;\n lineStyle?: FlowEdgeLineStyle;\n animated?: boolean;\n waypoints?: Array<{ x: number; y: number }>;\n markerEnd?: FlowEdgeData['markerEnd'];\n}\n\n/** Build a smoothstep edge in the Archify style (optionally trace-animated). */\nexport function edge(opts: BuildEdgeOptions): FlowEdge {\n return {\n id: opts.id ?? uid('edge'),\n source: opts.source,\n target: opts.target,\n sourceHandle: opts.sourceHandle,\n targetHandle: opts.targetHandle,\n type: 'smoothstep',\n data: {\n strokeColor: opts.color,\n strokeWidth: opts.width ?? 1.75,\n lineStyle: opts.lineStyle ?? 'solid',\n markerEnd: opts.markerEnd ?? 'arrowclosed',\n labelText: opts.label,\n labelFontSize: 11,\n animated: opts.animated ?? false,\n waypoints: opts.waypoints,\n },\n };\n}\n\n/**\n * Map an Archify side to the nearest Flow handle id (center of that side).\n * Flow handles are `t_/b_/l_/r_` with offsets 1/6..5/6; the center is 3/6.\n */\nexport function sideHandle(side?: ArchifySide): string | undefined {\n switch (side) {\n case 'top':\n return `t_${3 / 6}`;\n case 'bottom':\n return `b_${3 / 6}`;\n case 'left':\n return `l_${3 / 6}`;\n case 'right':\n return `r_${3 / 6}`;\n default:\n return undefined;\n }\n}\n\nexport { uid };\n"],"mappings":";;AAmBA,IAAI,IAAO;AACX,SAAS,EAAI,GAAwB;CAEnC,OADA,KAAQ,GACD,GAAG,EAAO,GAAG,EAAK,SAAS,EAAE,EAAE,GAAG,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE;AACtF;AAsBA,SAAgB,EAAK,GAAkC;CACrD,OAAO;EACL,IAAI,EAAK;EACT,MAAM;EACN,UAAU;GAAE,GAAG,EAAK;GAAG,GAAG,EAAK;EAAE;EACjC,OAAO,EAAK;EACZ,QAAQ,EAAK;EACb,QAAQ,EAAK,UAAU;EACvB,MAAM;GACJ,OAAO,EAAK;GACZ,UA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{"version":3,"file":"build.js","names":["_seq","uid","prefix","card","opts","frame","edge","sideHandle","side"],"sources":["../../../../../src/components/pro/Flow/archify/build.ts"],"sourcesContent":["/**\n * Shared helpers for building a Flow `FlowDocument` from an Archify spec.\n *\n * The converters reproduce Archify's fixed grid/lane geometry (coordinates\n * copied from the reference renderers) so an imported diagram matches the\n * artifact screenshots. Everything is emitted as native Flow nodes/edges/lines\n * with literal Archify colors, so the result is fully editable afterwards.\n */\n\nimport type {\n FlowNode,\n FlowEdge,\n FlowNodeData,\n FlowEdgeData,\n FlowEdgeLineStyle,\n} from '../types';\nimport type { ArchifySide } from './spec';\nimport { ARCHIFY_LANE_STROKE, ARCHIFY_TEXT_MUTED } from './palette';\n\nlet _seq = 0;\nfunction uid(prefix: string): string {\n _seq += 1;\n return `${prefix}_${_seq.toString(36)}_${Math.floor(Math.random() * 1e6).toString(36)}`;\n}\n\nexport interface BuildNodeOptions {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n label: string;\n sublabel?: string;\n tag?: string;\n fill: string;\n stroke: string;\n text: string;\n sub?: string;\n fontSize?: number;\n borderStyle?: FlowNodeData['borderStyle'];\n strokeWidth?: number;\n zIndex?: number;\n}\n\n/** Build a rounded-rect card node in the Archify style. */\nexport function card(opts: BuildNodeOptions): FlowNode {\n return {\n id: opts.id,\n type: 'shapeRoundRect',\n position: { x: opts.x, y: opts.y },\n width: opts.width,\n height: opts.height,\n zIndex: opts.zIndex ?? 2,\n data: {\n label: opts.label,\n sublabel: opts.sublabel,\n sublabelColor: opts.sub ?? ARCHIFY_TEXT_MUTED,\n tag: opts.tag,\n fill: opts.fill,\n stroke: opts.stroke,\n strokeWidth: opts.strokeWidth ?? 1.75,\n color: opts.text,\n labelColor: opts.text,\n fontSize: opts.fontSize ?? 13,\n borderStyle: opts.borderStyle ?? 'solid',\n attributes: [],\n },\n };\n}\n\nexport interface BuildGroupOptions {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n label: string;\n stroke?: string;\n fill?: string;\n borderStyle?: FlowNodeData['borderStyle'];\n labelColor?: string;\n zIndex?: number;\n}\n\n/**\n * Build a boundary / lane / phase frame as a group rectangle. Rendered behind\n * the cards (low zIndex) with a dashed outline and a top-left label.\n */\nexport function frame(opts: BuildGroupOptions): FlowNode {\n return {\n id: opts.id,\n type: 'geometryGroup',\n position: { x: opts.x, y: opts.y },\n width: opts.width,\n height: opts.height,\n zIndex: opts.zIndex ?? 0,\n data: {\n label: opts.label,\n fill: opts.fill ?? 'transparent',\n stroke: opts.stroke ?? ARCHIFY_LANE_STROKE,\n strokeWidth: 1.25,\n color: opts.labelColor ?? ARCHIFY_TEXT_MUTED,\n labelColor: opts.labelColor ?? ARCHIFY_TEXT_MUTED,\n fontSize: 12,\n isGroup: true,\n borderStyle: opts.borderStyle ?? 'dashed',\n groupLabelPlacement: 'top',\n groupLabelAlign: 'start',\n groupLabelBgMode: 'text',\n attributes: [],\n },\n };\n}\n\nexport interface BuildEdgeOptions {\n id?: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n label?: string;\n color: string;\n width?: number;\n lineStyle?: FlowEdgeLineStyle;\n animated?: boolean;\n waypoints?: Array<{ x: number; y: number }>;\n markerEnd?: FlowEdgeData['markerEnd'];\n}\n\n/** Build a smoothstep edge in the Archify style (optionally trace-animated). */\nexport function edge(opts: BuildEdgeOptions): FlowEdge {\n return {\n id: opts.id ?? uid('edge'),\n source: opts.source,\n target: opts.target,\n sourceHandle: opts.sourceHandle,\n targetHandle: opts.targetHandle,\n type: 'smoothstep',\n data: {\n strokeColor: opts.color,\n strokeWidth: opts.width ?? 1.75,\n lineStyle: opts.lineStyle ?? 'solid',\n markerEnd: opts.markerEnd ?? 'arrowclosed',\n labelText: opts.label,\n labelFontSize: 11,\n animated: opts.animated ?? false,\n waypoints: opts.waypoints,\n },\n };\n}\n\n/**\n * Map an Archify side to the nearest Flow handle id (center of that side).\n * Flow handles are `t_/b_/l_/r_` with offsets 1/6..5/6; the center is 3/6.\n */\nexport function sideHandle(side?: ArchifySide): string | undefined {\n switch (side) {\n case 'top':\n return `t_${3 / 6}`;\n case 'bottom':\n return `b_${3 / 6}`;\n case 'left':\n return `l_${3 / 6}`;\n case 'right':\n return `r_${3 / 6}`;\n default:\n return undefined;\n }\n}\n\nexport { uid };\n"],"mappings":";;AAmBA,IAAIA,IAAO;AACX,SAASC,EAAI,GAAwB;CAEnC,OADA,KAAQ,GACD,GAAGC,EAAO,GAAGF,EAAK,SAAS,EAAE,EAAE,GAAG,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE;AACtF;AAsBA,SAAgBG,EAAK,GAAkC;CACrD,OAAO;EACL,IAAIC,EAAK;EACT,MAAM;EACN,UAAU;GAAE,GAAGA,EAAK;GAAG,GAAGA,EAAK;EAAE;EACjC,OAAOA,EAAK;EACZ,QAAQA,EAAK;EACb,QAAQA,EAAK,UAAU;EACvB,MAAM;GACJ,OAAOA,EAAK;GACZ,UAAUA,EAAK;GACf,eAAeA,EAAK,OAAA;GACpB,KAAKA,EAAK;GACV,MAAMA,EAAK;GACX,QAAQA,EAAK;GACb,aAAaA,EAAK,eAAe;GACjC,OAAOA,EAAK;GACZ,YAAYA,EAAK;GACjB,UAAUA,EAAK,YAAY;GAC3B,aAAaA,EAAK,eAAe;GACjC,YAAY,CAAC;EACf;CACF;AACF;AAoBA,SAAgBC,EAAM,GAAmC;CACvD,OAAO;EACL,IAAID,EAAK;EACT,MAAM;EACN,UAAU;GAAE,GAAGA,EAAK;GAAG,GAAGA,EAAK;EAAE;EACjC,OAAOA,EAAK;EACZ,QAAQA,EAAK;EACb,QAAQA,EAAK,UAAU;EACvB,MAAM;GACJ,OAAOA,EAAK;GACZ,MAAMA,EAAK,QAAQ;GACnB,QAAQA,EAAK,UAAA;GACb,aAAa;GACb,OAAOA,EAAK,cAAA;GACZ,YAAYA,EAAK,cAAA;GACjB,UAAU;GACV,SAAS;GACT,aAAaA,EAAK,eAAe;GACjC,qBAAqB;GACrB,iBAAiB;GACjB,kBAAkB;GAClB,YAAY,CAAC;EACf;CACF;AACF;AAkBA,SAAgBE,EAAK,GAAkC;CACrD,OAAO;EACL,IAAIF,EAAK,MAAMH,EAAI,MAAM;EACzB,QAAQG,EAAK;EACb,QAAQA,EAAK;EACb,cAAcA,EAAK;EACnB,cAAcA,EAAK;EACnB,MAAM;EACN,MAAM;GACJ,aAAaA,EAAK;GAClB,aAAaA,EAAK,SAAS;GAC3B,WAAWA,EAAK,aAAa;GAC7B,WAAWA,EAAK,aAAa;GAC7B,WAAWA,EAAK;GAChB,eAAe;GACf,UAAUA,EAAK,YAAY;GAC3B,WAAWA,EAAK;EAClB;CACF;AACF;AAMA,SAAgBG,EAAW,GAAwC;CACjE,QAAQC,GAAR;EACE,KAAK,OACH,OAAO,KAAK,IAAI;EAClB,KAAK,UACH,OAAO,KAAK,IAAI;EAClB,KAAK,QACH,OAAO,KAAK,IAAI;EAClB,KAAK,SACH,OAAO,KAAK,IAAI;EAClB,SACE;CACJ;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"convert.js","names":[],"sources":["../../../../../src/components/pro/Flow/archify/convert.ts"],"sourcesContent":["/**\n * Convert an Archify spec into a native Flow `FlowDocument`.\n *\n * One converter per diagram type reproduces Archify's fixed layout geometry\n * (constants copied from the reference renderers) so the imported diagram\n * matches the reference artifact, then emits editable Flow nodes/edges/lines.\n *\n * When `meta.animation === \"trace\"`, edges are marked `animated` so the Flow\n * presentation / preview mode plays the traveling gradient pulse.\n */\n\nimport type { FlowDocument, FlowNode, FlowEdge, FlowLine } from '../types';\nimport { ROOT_CANVAS_ID } from '../constants';\nimport type {\n ArchifySpec,\n ArchifyArchitectureSpec,\n ArchifyWorkflowSpec,\n ArchifySequenceSpec,\n ArchifyDataflowSpec,\n ArchifyLifecycleSpec,\n} from './spec';\nimport {\n ARCHIFY_LANE_STROKE,\n ARCHIFY_TEXT_MUTED,\n componentStyle,\n stateStyle,\n variantEdgeStyle,\n messageEdgeStyle,\n} from './palette';\nimport { card, frame, edge, sideHandle, uid } from './build';\n\nfunction isTrace(spec: ArchifySpec): boolean {\n return spec.meta?.animation === 'trace';\n}\n\n/* ========================================================================== */\n/* Architecture */\n/* ========================================================================== */\n\nconst ARCH_GRID = { origin: [40, 80], cols: 4, gapX: 30, gapY: 40, cellW: 130, cellH: 64 };\n\nfunction convertArchitecture(spec: ArchifyArchitectureSpec): FlowDocument {\n const trace = isTrace(spec);\n const grid = { ...ARCH_GRID, ...spec.layout };\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const rect = new Map<string, { x: number; y: number; w: number; h: number }>();\n\n for (const c of spec.components) {\n let x: number;\n let y: number;\n if (Array.isArray(c.pos)) {\n [x, y] = c.pos;\n } else if (Number.isInteger(c.row) && Number.isInteger(c.col)) {\n const stepX = grid.cellW + grid.gapX;\n const stepY = grid.cellH + grid.gapY;\n x = grid.origin[0] + (c.col ?? 0) * stepX;\n y = grid.origin[1] + (c.row ?? 0) * stepY;\n } else {\n x = grid.origin[0];\n y = grid.origin[1];\n }\n const w = c.size?.[0] ?? grid.cellW;\n const h = c.size?.[1] ?? grid.cellH;\n rect.set(c.id, { x, y, w, h });\n const style = componentStyle(c.type);\n nodes.push(\n card({\n id: c.id,\n x,\n y,\n width: w,\n height: h,\n label: c.label,\n sublabel: c.sublabel,\n tag: c.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n }),\n );\n }\n\n // Boundaries wrap their member components with padding, rendered behind.\n for (const [i, b] of (spec.boundaries ?? []).entries()) {\n const members = b.wraps.map((id) => rect.get(id)).filter(Boolean) as Array<{\n x: number;\n y: number;\n w: number;\n h: number;\n }>;\n if (members.length === 0) continue;\n const pad = b.pad ?? 26;\n const minX = Math.min(...members.map((m) => m.x)) - pad;\n const minY = Math.min(...members.map((m) => m.y)) - pad - 14;\n const maxX = Math.max(...members.map((m) => m.x + m.w)) + pad;\n const maxY = Math.max(...members.map((m) => m.y + m.h)) + pad;\n nodes.push(\n frame({\n id: `boundary_${i}_${uid('b')}`,\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n label: b.label,\n stroke: b.kind === 'security-group' ? '#fb7185' : ARCHIFY_LANE_STROKE,\n borderStyle: 'dashed',\n labelColor: b.kind === 'security-group' ? '#fb7185' : ARCHIFY_TEXT_MUTED,\n zIndex: -10 + i,\n }),\n );\n }\n\n for (const conn of spec.connections ?? []) {\n const style = variantEdgeStyle(conn.variant);\n edges.push(\n edge({\n id: conn.id,\n source: conn.from,\n target: conn.to,\n sourceHandle: sideHandle(conn.fromSide),\n targetHandle: sideHandle(conn.toSide),\n label: conn.label,\n color: style.color,\n width: conn.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace,\n waypoints: conn.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Workflow */\n/* ========================================================================== */\n\nconst WF = {\n laneX: 40,\n laneY: 52,\n laneW: 640,\n laneH: 104,\n laneGap: 20,\n laneTitleH: 30,\n colXs: [88, 220, 300, 430, 500, 625],\n nodeW: 92,\n nodeH: 52,\n};\n\nfunction convertWorkflow(spec: ArchifyWorkflowSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const laneIndex = new Map(spec.lanes.map((l, i) => [l.id, i]));\n const laneTop = (id: string) =>\n WF.laneY + (laneIndex.get(id) ?? 0) * (WF.laneH + WF.laneGap);\n\n // Lane frames (behind everything).\n for (const lane of spec.lanes) {\n const top = laneTop(lane.id);\n nodes.push(\n frame({\n id: `lane_${lane.id}`,\n x: WF.laneX,\n y: top,\n width: WF.laneW,\n height: WF.laneH,\n label: lane.label,\n stroke: lane.variant === 'exception' ? '#fb7185' : ARCHIFY_LANE_STROKE,\n labelColor: lane.variant === 'exception' ? '#fb7185' : ARCHIFY_TEXT_MUTED,\n zIndex: -20,\n }),\n );\n }\n\n // Phase bands (thin frames spanning columns, drawn just above lanes).\n for (const [i, phase] of (spec.phases ?? []).entries()) {\n const x0 = WF.colXs[phase.fromCol] - WF.nodeW / 2 - 12;\n const x1 = WF.colXs[phase.toCol] + WF.nodeW / 2 + 12;\n nodes.push(\n frame({\n id: `phase_${phase.id}`,\n x: x0,\n y: WF.laneY - 34,\n width: x1 - x0,\n height: 26,\n label: phase.label,\n stroke: variantEdgeStyle(phase.variant).color,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'none',\n zIndex: -15 + i,\n }),\n );\n }\n\n // Workflow groups (nested emphasis frames inside a lane).\n for (const [i, g] of (spec.groups ?? []).entries()) {\n const top = laneTop(g.lane);\n const x0 = WF.colXs[g.fromCol] - WF.nodeW / 2 - 8;\n const x1 = WF.colXs[g.toCol] + WF.nodeW / 2 + 8;\n nodes.push(\n frame({\n id: `wfgroup_${g.id}`,\n x: x0,\n y: top + WF.laneTitleH - 6,\n width: x1 - x0,\n height: WF.laneH - WF.laneTitleH,\n label: g.label,\n stroke: variantEdgeStyle(g.variant).color,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -12 + i,\n }),\n );\n }\n\n for (const n of spec.nodes) {\n const width = n.width ?? WF.nodeW;\n const height = n.height ?? (n.tag ? 68 : WF.nodeH);\n const cx = WF.colXs[n.col] ?? WF.colXs[WF.colXs.length - 1];\n const contentH = WF.laneH - WF.laneTitleH;\n const y = laneTop(n.lane) + WF.laneTitleH + (contentH - height) / 2 + (n.yOffset ?? 0);\n const style = componentStyle(n.type);\n nodes.push(\n card({\n id: n.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: n.label,\n sublabel: n.sublabel,\n tag: n.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n const mainPath = new Set<string>();\n const mp = spec.mainPath ?? [];\n for (let i = 0; i < mp.length - 1; i++) mainPath.add(`${mp[i]}->${mp[i + 1]}`);\n\n for (const e of spec.edges) {\n const onMain = mainPath.has(`${e.from}->${e.to}`);\n const style = variantEdgeStyle(e.variant ?? (onMain ? 'emphasis' : 'default'));\n edges.push(\n edge({\n id: e.id,\n source: e.from,\n target: e.to,\n sourceHandle: sideHandle(e.fromSide),\n targetHandle: sideHandle(e.toSide),\n label: e.label,\n color: e.role === 'error' ? '#fb7185' : style.color,\n width: e.width ?? style.width,\n lineStyle: e.role === 'error' ? 'dashed' : style.lineStyle,\n animated: trace && onMain,\n waypoints: e.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Sequence */\n/* ========================================================================== */\n\nfunction convertSequence(spec: ArchifySequenceSpec): FlowDocument {\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n const lines: FlowLine[] = [];\n\n const viewBox = spec.meta.viewBox ?? [920, 760];\n const sideMargin = 62;\n const participantW = 86;\n const colGap = 108;\n const topY = 72;\n const participantH = 54;\n const lifelineTop = 142;\n const lifelineBottom = viewBox[1] - 65;\n\n const cx = (i: number) => sideMargin + i * colGap;\n const partX = new Map<string, number>();\n\n spec.participants.forEach((p, i) => {\n const x = cx(i);\n partX.set(p.id, x);\n const style = componentStyle(p.type);\n nodes.push(\n card({\n id: p.id,\n x: x - participantW / 2,\n y: topY,\n width: participantW,\n height: participantH,\n label: p.label,\n sublabel: p.sublabel,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 11,\n zIndex: 5,\n }),\n );\n // Lifeline (dashed vertical guide beneath each participant).\n lines.push({\n id: `lifeline_${p.id}`,\n type: 'straight',\n points: [\n { x, y: lifelineTop },\n { x, y: lifelineBottom },\n ],\n strokeColor: ARCHIFY_LANE_STROKE,\n strokeWidth: 1,\n lineStyle: 'dashed',\n markerEnd: 'none',\n zIndex: -5,\n });\n });\n\n // Segment frames (labelled bands over ranges of the timeline).\n for (const [i, seg] of (spec.segments ?? []).entries()) {\n nodes.push(\n frame({\n id: `segment_${i}`,\n x: 48,\n y: seg.from,\n width: viewBox[0] - 96,\n height: seg.to - seg.from,\n label: seg.label,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n // Activation bars (thin vertical rects on a participant lifeline).\n for (const [i, act] of (spec.activations ?? []).entries()) {\n const x = partX.get(act.participant);\n if (x === undefined) continue;\n const style = componentStyle(act.type ?? 'backend');\n nodes.push({\n id: `activation_${i}_${act.participant}`,\n type: 'shapeRect',\n position: { x: x - 5, y: act.from },\n width: 10,\n height: Math.max(6, act.to - act.from),\n zIndex: 1,\n data: {\n label: '',\n fill: style.fill,\n stroke: style.stroke,\n strokeWidth: 1,\n color: style.text,\n fontSize: 10,\n borderStyle: 'solid',\n attributes: [],\n },\n });\n }\n\n // Messages become horizontal arrow lines at their y with a label above.\n for (const m of spec.messages) {\n const fromX = partX.get(m.from);\n const toX = partX.get(m.to);\n if (fromX === undefined || toX === undefined) continue;\n const dir = toX > fromX ? 1 : -1;\n const start = fromX + dir * 7;\n const end = toX - dir * 7;\n const style = messageEdgeStyle(m.variant);\n lines.push({\n id: m.id ?? uid('msg'),\n type: 'arrow',\n points: [\n { x: start, y: m.y },\n { x: end, y: m.y },\n ],\n strokeColor: style.color,\n strokeWidth: style.width,\n lineStyle: style.lineStyle,\n markerEnd: m.variant === 'return' ? 'arrow' : 'arrowclosed',\n zIndex: 3,\n });\n // Label as a tiny transparent text node centered above the arrow.\n nodes.push({\n id: `mlabel_${m.id ?? uid('m')}`,\n type: 'textLabel',\n position: { x: (start + end) / 2 - 70, y: m.y - 22 },\n width: 140,\n height: 16,\n zIndex: 4,\n data: {\n label: m.label,\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: style.color,\n labelColor: style.color,\n fontSize: 11,\n attributes: [],\n },\n });\n }\n\n return wrap(nodes, edges, lines, spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Dataflow */\n/* ========================================================================== */\n\nconst DF = {\n stageY: 46,\n stageH: 36,\n stageBottomPad: 74,\n leftX: 100,\n colGap: 215,\n stageW: 168,\n nodeW: 112,\n nodeH: 58,\n rowYs: [128, 242, 356, 470, 584],\n};\n\nconst stageX = (i: number) => DF.leftX + i * DF.colGap;\n\nfunction convertDataflow(spec: ArchifyDataflowSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const viewBox = spec.meta.viewBox ?? [940, 720];\n\n // Stage frames (tall vertical bands).\n for (const [i, stage] of spec.stages.entries()) {\n nodes.push(\n frame({\n id: `stage_${i}`,\n x: stageX(i) - DF.stageW / 2,\n y: DF.stageY,\n width: DF.stageW,\n height: viewBox[1] - DF.stageY - DF.stageBottomPad,\n label: stage.label,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n for (const n of spec.nodes) {\n const width = n.width ?? DF.nodeW;\n const height = n.height ?? DF.nodeH;\n const cx = stageX(n.stage);\n const y = (DF.rowYs[n.row] ?? DF.rowYs[DF.rowYs.length - 1]) + (n.yOffset ?? 0);\n const style = componentStyle(n.type);\n nodes.push(\n card({\n id: n.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: n.label,\n sublabel: n.sublabel,\n tag: n.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n for (const f of spec.flows) {\n const style = variantEdgeStyle(f.variant);\n edges.push(\n edge({\n id: f.id,\n source: f.from,\n target: f.to,\n sourceHandle: sideHandle(f.fromSide),\n targetHandle: sideHandle(f.toSide),\n label: f.label,\n color: style.color,\n width: f.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace && f.variant === 'emphasis',\n waypoints: f.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Lifecycle */\n/* ========================================================================== */\n\nconst LC = {\n phaseY: 126,\n eventY: 278,\n outcomeY: 450,\n phaseW: 118,\n phaseH: 62,\n eventW: 126,\n eventH: 58,\n outcomeW: 118,\n outcomeH: 58,\n phaseXs: [94, 248, 402, 556, 710],\n eventXs: [402, 556, 710],\n outcomeXs: [402, 556, 710],\n};\n\nfunction lifecycleBand(lane: string): 'phase' | 'event' | 'outcome' {\n if (lane === 'main') return 'phase';\n if (lane === 'terminal') return 'outcome';\n return 'event';\n}\n\nfunction convertLifecycle(spec: ArchifyLifecycleSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const viewBox = spec.meta.viewBox ?? [980, 660];\n\n // Band frames give the three horizontal groupings some structure.\n const laneLabel = new Map(spec.lanes.map((l) => [l.id, l.label]));\n const bandRows: Array<{ band: 'phase' | 'event' | 'outcome'; y: number; h: number; label: string }> = [\n { band: 'phase', y: LC.phaseY - 26, h: LC.phaseH + 40, label: laneLabel.get('main') ?? 'Lifecycle phases' },\n { band: 'event', y: LC.eventY - 26, h: LC.eventH + 40, label: 'Interruptions + Recovery' },\n { band: 'outcome', y: LC.outcomeY - 26, h: LC.outcomeH + 40, label: laneLabel.get('terminal') ?? 'Terminal exits' },\n ];\n for (const [i, b] of bandRows.entries()) {\n nodes.push(\n frame({\n id: `band_${b.band}`,\n x: 40,\n y: b.y,\n width: viewBox[0] - 80,\n height: b.h,\n label: `0${i + 1} / ${b.label}`,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n for (const s of spec.states) {\n const band = lifecycleBand(s.lane);\n const isPhase = band === 'phase';\n const isOutcome = band === 'outcome';\n const width = s.width ?? (isPhase ? LC.phaseW : isOutcome ? LC.outcomeW : LC.eventW);\n const height = s.height ?? (isPhase ? LC.phaseH : isOutcome ? LC.outcomeH : LC.eventH);\n const xs = isPhase ? LC.phaseXs : isOutcome ? LC.outcomeXs : LC.eventXs;\n const cx = xs[s.col] ?? xs[xs.length - 1];\n const y = (isPhase ? LC.phaseY : isOutcome ? LC.outcomeY : LC.eventY) + (s.yOffset ?? 0);\n const style = stateStyle(s.type);\n nodes.push(\n card({\n id: s.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: s.label,\n sublabel: s.sublabel,\n tag: s.tag ?? s.step,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n // Order states along the main lane to build the primary rail. Archify draws\n // this rail decoratively (not as explicit transitions), so synthesize edges\n // between consecutive phase states, connecting right-to-left across columns.\n const mainStates = spec.states\n .filter((s) => s.lane === 'main')\n .sort((a, b) => a.col - b.col);\n const explicitPairs = new Set(spec.transitions.map((t) => `${t.from}->${t.to}`));\n for (let i = 0; i < mainStates.length - 1; i++) {\n const from = mainStates[i];\n const to = mainStates[i + 1];\n // Skip if the author already provided this exact transition.\n if (explicitPairs.has(`${from.id}->${to.id}`)) continue;\n edges.push(\n edge({\n id: `mainrail_${from.id}_${to.id}`,\n source: from.id,\n target: to.id,\n sourceHandle: sideHandle('right'),\n targetHandle: sideHandle('left'),\n label: undefined,\n color: variantEdgeStyle('emphasis').color,\n width: 2.2,\n lineStyle: 'solid',\n animated: trace,\n }),\n );\n }\n\n const mainPairs = new Set<string>();\n for (let i = 0; i < mainStates.length - 1; i++) {\n mainPairs.add(`${mainStates[i].id}->${mainStates[i + 1].id}`);\n }\n\n for (const t of spec.transitions) {\n const style = variantEdgeStyle(t.variant);\n const onMain = mainPairs.has(`${t.from}->${t.to}`);\n edges.push(\n edge({\n id: t.id,\n source: t.from,\n target: t.to,\n sourceHandle: sideHandle(t.fromSide),\n targetHandle: sideHandle(t.toSide),\n label: t.label,\n color: style.color,\n width: t.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace && onMain,\n waypoints: t.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n\nfunction wrap(\n nodes: FlowNode[],\n edges: FlowEdge[],\n lines: FlowLine[],\n title?: string,\n): FlowDocument {\n return {\n canvases: {\n [ROOT_CANVAS_ID]: { nodes, edges, lines },\n },\n stack: [ROOT_CANVAS_ID],\n title,\n };\n}\n\n/** Convert any supported Archify spec into a Flow document. */\nexport function archifyToFlowDocument(spec: ArchifySpec): FlowDocument {\n switch (spec.diagram_type) {\n case 'architecture':\n return convertArchitecture(spec);\n case 'workflow':\n return convertWorkflow(spec);\n case 'sequence':\n return convertSequence(spec);\n case 'dataflow':\n return convertDataflow(spec);\n case 'lifecycle':\n return convertLifecycle(spec);\n default:\n return wrap([], [], []);\n }\n}\n"],"mappings":";;;;AA+BA,SAAS,EAAQ,GAA4B;CAC3C,OAAO,EAAK,MAAM,cAAc;AAClC;AAMA,IAAM,IAAY;CAAE,QAAQ,CAAC,IAAI,EAAE;CAAG,MAAM;CAAG,MAAM;CAAI,MAAM;CAAI,OAAO;CAAK,OAAO;AAAG;AAEzF,SAAS,EAAoB,GAA6C;CACxE,IAAM,IAAQ,EAAQ,CAAI,GACpB,IAAO;EAAE,GAAG;EAAW,GAAG,EAAK;CAAO,GACtC,IAAoB,CAAC,GACrB,IAAoB,CAAC,GAErB,oBAAO,IAAI,IAA4D;CAE7E,KAAK,IAAM,KAAK,EAAK,YAAY;EAC/B,IAAI,GACA;EACJ,IAAI,MAAM,QAAQ,EAAE,GAAG,GACrB,CAAC,GAAG,KAAK,EAAE;OACN,IAAI,OAAO,UAAU,EAAE,GAAG,KAAK,OAAO,UAAU,EAAE,GAAG,GAAG;GAC7D,IAAM,IAAQ,EAAK,QAAQ,EAAK,MAC1B,IAAQ,EAAK,QAAQ,EAAK;GAEhC,AADA,IAAI,EAAK,OAA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AIA,SAAS,EACP,GACA,GACA,GACA,GACc;CACd,OAAO;EACL,UAAU,GACP,IAAiB;GAAE;GAAO;GAAO;EAAM,EAC1C;EACA,OAAO,CAAC,CAAc;EACtB;CACF;AACF;AAGA,SAAgB,EAAsB,GAAiC;CACrE,QAAQ,EAAK,cAAb;EACE,KAAK,gBACH,OAAO,EAAoB,CAAI;EACjC,KAAK,YACH,OAAO,EAAgB,CAAI;EAC7B,KAAK,YACH,OAAO,EAAgB,CAAI;EAC7B,KAAK,YACH,OAAO,EAAgB,CAAI;EAC7B,KAAK,aACH,OAAO,EAAiB,CAAI;EAC9B,SACE,OAAO,EAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1B;AACF"}
1
+ {"version":3,"file":"convert.js","names":["isTrace","spec","ARCH_GRID","convertArchitecture","trace","grid","nodes","edges","rect","c","x","y","stepX","stepY","w","h","style","componentStyle","card","i","b","members","id","pad","minX","m","minY","maxX","maxY","frame","uid","ARCHIFY_LANE_STROKE","ARCHIFY_TEXT_MUTED","conn","variantEdgeStyle","edge","sideHandle","wrap","WF","convertWorkflow","laneIndex","l","laneTop","lane","top","phase","x0","x1","g","n","width","height","cx","contentH","mainPath","mp","e","onMain","convertSequence","lines","viewBox","lifelineBottom","partX","p","seg","act","fromX","toX","dir","start","end","messageEdgeStyle","DF","stageX","convertDataflow","stage","f","LC","lifecycleBand","convertLifecycle","laneLabel","bandRows","s","band","isPhase","isOutcome","xs","stateStyle","mainStates","a","explicitPairs","t","from","to","mainPairs","ROOT_CANVAS_ID","archifyToFlowDocument"],"sources":["../../../../../src/components/pro/Flow/archify/convert.ts"],"sourcesContent":["/**\n * Convert an Archify spec into a native Flow `FlowDocument`.\n *\n * One converter per diagram type reproduces Archify's fixed layout geometry\n * (constants copied from the reference renderers) so the imported diagram\n * matches the reference artifact, then emits editable Flow nodes/edges/lines.\n *\n * When `meta.animation === \"trace\"`, edges are marked `animated` so the Flow\n * presentation / preview mode plays the traveling gradient pulse.\n */\n\nimport type { FlowDocument, FlowNode, FlowEdge, FlowLine } from '../types';\nimport { ROOT_CANVAS_ID } from '../constants';\nimport type {\n ArchifySpec,\n ArchifyArchitectureSpec,\n ArchifyWorkflowSpec,\n ArchifySequenceSpec,\n ArchifyDataflowSpec,\n ArchifyLifecycleSpec,\n} from './spec';\nimport {\n ARCHIFY_LANE_STROKE,\n ARCHIFY_TEXT_MUTED,\n componentStyle,\n stateStyle,\n variantEdgeStyle,\n messageEdgeStyle,\n} from './palette';\nimport { card, frame, edge, sideHandle, uid } from './build';\n\nfunction isTrace(spec: ArchifySpec): boolean {\n return spec.meta?.animation === 'trace';\n}\n\n/* ========================================================================== */\n/* Architecture */\n/* ========================================================================== */\n\nconst ARCH_GRID = { origin: [40, 80], cols: 4, gapX: 30, gapY: 40, cellW: 130, cellH: 64 };\n\nfunction convertArchitecture(spec: ArchifyArchitectureSpec): FlowDocument {\n const trace = isTrace(spec);\n const grid = { ...ARCH_GRID, ...spec.layout };\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const rect = new Map<string, { x: number; y: number; w: number; h: number }>();\n\n for (const c of spec.components) {\n let x: number;\n let y: number;\n if (Array.isArray(c.pos)) {\n [x, y] = c.pos;\n } else if (Number.isInteger(c.row) && Number.isInteger(c.col)) {\n const stepX = grid.cellW + grid.gapX;\n const stepY = grid.cellH + grid.gapY;\n x = grid.origin[0] + (c.col ?? 0) * stepX;\n y = grid.origin[1] + (c.row ?? 0) * stepY;\n } else {\n x = grid.origin[0];\n y = grid.origin[1];\n }\n const w = c.size?.[0] ?? grid.cellW;\n const h = c.size?.[1] ?? grid.cellH;\n rect.set(c.id, { x, y, w, h });\n const style = componentStyle(c.type);\n nodes.push(\n card({\n id: c.id,\n x,\n y,\n width: w,\n height: h,\n label: c.label,\n sublabel: c.sublabel,\n tag: c.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n }),\n );\n }\n\n // Boundaries wrap their member components with padding, rendered behind.\n for (const [i, b] of (spec.boundaries ?? []).entries()) {\n const members = b.wraps.map((id) => rect.get(id)).filter(Boolean) as Array<{\n x: number;\n y: number;\n w: number;\n h: number;\n }>;\n if (members.length === 0) continue;\n const pad = b.pad ?? 26;\n const minX = Math.min(...members.map((m) => m.x)) - pad;\n const minY = Math.min(...members.map((m) => m.y)) - pad - 14;\n const maxX = Math.max(...members.map((m) => m.x + m.w)) + pad;\n const maxY = Math.max(...members.map((m) => m.y + m.h)) + pad;\n nodes.push(\n frame({\n id: `boundary_${i}_${uid('b')}`,\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n label: b.label,\n stroke: b.kind === 'security-group' ? '#fb7185' : ARCHIFY_LANE_STROKE,\n borderStyle: 'dashed',\n labelColor: b.kind === 'security-group' ? '#fb7185' : ARCHIFY_TEXT_MUTED,\n zIndex: -10 + i,\n }),\n );\n }\n\n for (const conn of spec.connections ?? []) {\n const style = variantEdgeStyle(conn.variant);\n edges.push(\n edge({\n id: conn.id,\n source: conn.from,\n target: conn.to,\n sourceHandle: sideHandle(conn.fromSide),\n targetHandle: sideHandle(conn.toSide),\n label: conn.label,\n color: style.color,\n width: conn.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace,\n waypoints: conn.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Workflow */\n/* ========================================================================== */\n\nconst WF = {\n laneX: 40,\n laneY: 52,\n laneW: 640,\n laneH: 104,\n laneGap: 20,\n laneTitleH: 30,\n colXs: [88, 220, 300, 430, 500, 625],\n nodeW: 92,\n nodeH: 52,\n};\n\nfunction convertWorkflow(spec: ArchifyWorkflowSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const laneIndex = new Map(spec.lanes.map((l, i) => [l.id, i]));\n const laneTop = (id: string) =>\n WF.laneY + (laneIndex.get(id) ?? 0) * (WF.laneH + WF.laneGap);\n\n // Lane frames (behind everything).\n for (const lane of spec.lanes) {\n const top = laneTop(lane.id);\n nodes.push(\n frame({\n id: `lane_${lane.id}`,\n x: WF.laneX,\n y: top,\n width: WF.laneW,\n height: WF.laneH,\n label: lane.label,\n stroke: lane.variant === 'exception' ? '#fb7185' : ARCHIFY_LANE_STROKE,\n labelColor: lane.variant === 'exception' ? '#fb7185' : ARCHIFY_TEXT_MUTED,\n zIndex: -20,\n }),\n );\n }\n\n // Phase bands (thin frames spanning columns, drawn just above lanes).\n for (const [i, phase] of (spec.phases ?? []).entries()) {\n const x0 = WF.colXs[phase.fromCol] - WF.nodeW / 2 - 12;\n const x1 = WF.colXs[phase.toCol] + WF.nodeW / 2 + 12;\n nodes.push(\n frame({\n id: `phase_${phase.id}`,\n x: x0,\n y: WF.laneY - 34,\n width: x1 - x0,\n height: 26,\n label: phase.label,\n stroke: variantEdgeStyle(phase.variant).color,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'none',\n zIndex: -15 + i,\n }),\n );\n }\n\n // Workflow groups (nested emphasis frames inside a lane).\n for (const [i, g] of (spec.groups ?? []).entries()) {\n const top = laneTop(g.lane);\n const x0 = WF.colXs[g.fromCol] - WF.nodeW / 2 - 8;\n const x1 = WF.colXs[g.toCol] + WF.nodeW / 2 + 8;\n nodes.push(\n frame({\n id: `wfgroup_${g.id}`,\n x: x0,\n y: top + WF.laneTitleH - 6,\n width: x1 - x0,\n height: WF.laneH - WF.laneTitleH,\n label: g.label,\n stroke: variantEdgeStyle(g.variant).color,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -12 + i,\n }),\n );\n }\n\n for (const n of spec.nodes) {\n const width = n.width ?? WF.nodeW;\n const height = n.height ?? (n.tag ? 68 : WF.nodeH);\n const cx = WF.colXs[n.col] ?? WF.colXs[WF.colXs.length - 1];\n const contentH = WF.laneH - WF.laneTitleH;\n const y = laneTop(n.lane) + WF.laneTitleH + (contentH - height) / 2 + (n.yOffset ?? 0);\n const style = componentStyle(n.type);\n nodes.push(\n card({\n id: n.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: n.label,\n sublabel: n.sublabel,\n tag: n.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n const mainPath = new Set<string>();\n const mp = spec.mainPath ?? [];\n for (let i = 0; i < mp.length - 1; i++) mainPath.add(`${mp[i]}->${mp[i + 1]}`);\n\n for (const e of spec.edges) {\n const onMain = mainPath.has(`${e.from}->${e.to}`);\n const style = variantEdgeStyle(e.variant ?? (onMain ? 'emphasis' : 'default'));\n edges.push(\n edge({\n id: e.id,\n source: e.from,\n target: e.to,\n sourceHandle: sideHandle(e.fromSide),\n targetHandle: sideHandle(e.toSide),\n label: e.label,\n color: e.role === 'error' ? '#fb7185' : style.color,\n width: e.width ?? style.width,\n lineStyle: e.role === 'error' ? 'dashed' : style.lineStyle,\n animated: trace && onMain,\n waypoints: e.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Sequence */\n/* ========================================================================== */\n\nfunction convertSequence(spec: ArchifySequenceSpec): FlowDocument {\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n const lines: FlowLine[] = [];\n\n const viewBox = spec.meta.viewBox ?? [920, 760];\n const sideMargin = 62;\n const participantW = 86;\n const colGap = 108;\n const topY = 72;\n const participantH = 54;\n const lifelineTop = 142;\n const lifelineBottom = viewBox[1] - 65;\n\n const cx = (i: number) => sideMargin + i * colGap;\n const partX = new Map<string, number>();\n\n spec.participants.forEach((p, i) => {\n const x = cx(i);\n partX.set(p.id, x);\n const style = componentStyle(p.type);\n nodes.push(\n card({\n id: p.id,\n x: x - participantW / 2,\n y: topY,\n width: participantW,\n height: participantH,\n label: p.label,\n sublabel: p.sublabel,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 11,\n zIndex: 5,\n }),\n );\n // Lifeline (dashed vertical guide beneath each participant).\n lines.push({\n id: `lifeline_${p.id}`,\n type: 'straight',\n points: [\n { x, y: lifelineTop },\n { x, y: lifelineBottom },\n ],\n strokeColor: ARCHIFY_LANE_STROKE,\n strokeWidth: 1,\n lineStyle: 'dashed',\n markerEnd: 'none',\n zIndex: -5,\n });\n });\n\n // Segment frames (labelled bands over ranges of the timeline).\n for (const [i, seg] of (spec.segments ?? []).entries()) {\n nodes.push(\n frame({\n id: `segment_${i}`,\n x: 48,\n y: seg.from,\n width: viewBox[0] - 96,\n height: seg.to - seg.from,\n label: seg.label,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n // Activation bars (thin vertical rects on a participant lifeline).\n for (const [i, act] of (spec.activations ?? []).entries()) {\n const x = partX.get(act.participant);\n if (x === undefined) continue;\n const style = componentStyle(act.type ?? 'backend');\n nodes.push({\n id: `activation_${i}_${act.participant}`,\n type: 'shapeRect',\n position: { x: x - 5, y: act.from },\n width: 10,\n height: Math.max(6, act.to - act.from),\n zIndex: 1,\n data: {\n label: '',\n fill: style.fill,\n stroke: style.stroke,\n strokeWidth: 1,\n color: style.text,\n fontSize: 10,\n borderStyle: 'solid',\n attributes: [],\n },\n });\n }\n\n // Messages become horizontal arrow lines at their y with a label above.\n for (const m of spec.messages) {\n const fromX = partX.get(m.from);\n const toX = partX.get(m.to);\n if (fromX === undefined || toX === undefined) continue;\n const dir = toX > fromX ? 1 : -1;\n const start = fromX + dir * 7;\n const end = toX - dir * 7;\n const style = messageEdgeStyle(m.variant);\n lines.push({\n id: m.id ?? uid('msg'),\n type: 'arrow',\n points: [\n { x: start, y: m.y },\n { x: end, y: m.y },\n ],\n strokeColor: style.color,\n strokeWidth: style.width,\n lineStyle: style.lineStyle,\n markerEnd: m.variant === 'return' ? 'arrow' : 'arrowclosed',\n zIndex: 3,\n });\n // Label as a tiny transparent text node centered above the arrow.\n nodes.push({\n id: `mlabel_${m.id ?? uid('m')}`,\n type: 'textLabel',\n position: { x: (start + end) / 2 - 70, y: m.y - 22 },\n width: 140,\n height: 16,\n zIndex: 4,\n data: {\n label: m.label,\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: style.color,\n labelColor: style.color,\n fontSize: 11,\n attributes: [],\n },\n });\n }\n\n return wrap(nodes, edges, lines, spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Dataflow */\n/* ========================================================================== */\n\nconst DF = {\n stageY: 46,\n stageH: 36,\n stageBottomPad: 74,\n leftX: 100,\n colGap: 215,\n stageW: 168,\n nodeW: 112,\n nodeH: 58,\n rowYs: [128, 242, 356, 470, 584],\n};\n\nconst stageX = (i: number) => DF.leftX + i * DF.colGap;\n\nfunction convertDataflow(spec: ArchifyDataflowSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const viewBox = spec.meta.viewBox ?? [940, 720];\n\n // Stage frames (tall vertical bands).\n for (const [i, stage] of spec.stages.entries()) {\n nodes.push(\n frame({\n id: `stage_${i}`,\n x: stageX(i) - DF.stageW / 2,\n y: DF.stageY,\n width: DF.stageW,\n height: viewBox[1] - DF.stageY - DF.stageBottomPad,\n label: stage.label,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n for (const n of spec.nodes) {\n const width = n.width ?? DF.nodeW;\n const height = n.height ?? DF.nodeH;\n const cx = stageX(n.stage);\n const y = (DF.rowYs[n.row] ?? DF.rowYs[DF.rowYs.length - 1]) + (n.yOffset ?? 0);\n const style = componentStyle(n.type);\n nodes.push(\n card({\n id: n.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: n.label,\n sublabel: n.sublabel,\n tag: n.tag,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n for (const f of spec.flows) {\n const style = variantEdgeStyle(f.variant);\n edges.push(\n edge({\n id: f.id,\n source: f.from,\n target: f.to,\n sourceHandle: sideHandle(f.fromSide),\n targetHandle: sideHandle(f.toSide),\n label: f.label,\n color: style.color,\n width: f.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace && f.variant === 'emphasis',\n waypoints: f.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n/* Lifecycle */\n/* ========================================================================== */\n\nconst LC = {\n phaseY: 126,\n eventY: 278,\n outcomeY: 450,\n phaseW: 118,\n phaseH: 62,\n eventW: 126,\n eventH: 58,\n outcomeW: 118,\n outcomeH: 58,\n phaseXs: [94, 248, 402, 556, 710],\n eventXs: [402, 556, 710],\n outcomeXs: [402, 556, 710],\n};\n\nfunction lifecycleBand(lane: string): 'phase' | 'event' | 'outcome' {\n if (lane === 'main') return 'phase';\n if (lane === 'terminal') return 'outcome';\n return 'event';\n}\n\nfunction convertLifecycle(spec: ArchifyLifecycleSpec): FlowDocument {\n const trace = isTrace(spec);\n const nodes: FlowNode[] = [];\n const edges: FlowEdge[] = [];\n\n const viewBox = spec.meta.viewBox ?? [980, 660];\n\n // Band frames give the three horizontal groupings some structure.\n const laneLabel = new Map(spec.lanes.map((l) => [l.id, l.label]));\n const bandRows: Array<{ band: 'phase' | 'event' | 'outcome'; y: number; h: number; label: string }> = [\n { band: 'phase', y: LC.phaseY - 26, h: LC.phaseH + 40, label: laneLabel.get('main') ?? 'Lifecycle phases' },\n { band: 'event', y: LC.eventY - 26, h: LC.eventH + 40, label: 'Interruptions + Recovery' },\n { band: 'outcome', y: LC.outcomeY - 26, h: LC.outcomeH + 40, label: laneLabel.get('terminal') ?? 'Terminal exits' },\n ];\n for (const [i, b] of bandRows.entries()) {\n nodes.push(\n frame({\n id: `band_${b.band}`,\n x: 40,\n y: b.y,\n width: viewBox[0] - 80,\n height: b.h,\n label: `0${i + 1} / ${b.label}`,\n stroke: ARCHIFY_LANE_STROKE,\n labelColor: ARCHIFY_TEXT_MUTED,\n borderStyle: 'dashed',\n zIndex: -10,\n }),\n );\n }\n\n for (const s of spec.states) {\n const band = lifecycleBand(s.lane);\n const isPhase = band === 'phase';\n const isOutcome = band === 'outcome';\n const width = s.width ?? (isPhase ? LC.phaseW : isOutcome ? LC.outcomeW : LC.eventW);\n const height = s.height ?? (isPhase ? LC.phaseH : isOutcome ? LC.outcomeH : LC.eventH);\n const xs = isPhase ? LC.phaseXs : isOutcome ? LC.outcomeXs : LC.eventXs;\n const cx = xs[s.col] ?? xs[xs.length - 1];\n const y = (isPhase ? LC.phaseY : isOutcome ? LC.outcomeY : LC.eventY) + (s.yOffset ?? 0);\n const style = stateStyle(s.type);\n nodes.push(\n card({\n id: s.id,\n x: cx - width / 2,\n y,\n width,\n height,\n label: s.label,\n sublabel: s.sublabel,\n tag: s.tag ?? s.step,\n fill: style.fill,\n stroke: style.stroke,\n text: style.text,\n sub: style.sub,\n fontSize: 12,\n }),\n );\n }\n\n // Order states along the main lane to build the primary rail. Archify draws\n // this rail decoratively (not as explicit transitions), so synthesize edges\n // between consecutive phase states, connecting right-to-left across columns.\n const mainStates = spec.states\n .filter((s) => s.lane === 'main')\n .sort((a, b) => a.col - b.col);\n const explicitPairs = new Set(spec.transitions.map((t) => `${t.from}->${t.to}`));\n for (let i = 0; i < mainStates.length - 1; i++) {\n const from = mainStates[i];\n const to = mainStates[i + 1];\n // Skip if the author already provided this exact transition.\n if (explicitPairs.has(`${from.id}->${to.id}`)) continue;\n edges.push(\n edge({\n id: `mainrail_${from.id}_${to.id}`,\n source: from.id,\n target: to.id,\n sourceHandle: sideHandle('right'),\n targetHandle: sideHandle('left'),\n label: undefined,\n color: variantEdgeStyle('emphasis').color,\n width: 2.2,\n lineStyle: 'solid',\n animated: trace,\n }),\n );\n }\n\n const mainPairs = new Set<string>();\n for (let i = 0; i < mainStates.length - 1; i++) {\n mainPairs.add(`${mainStates[i].id}->${mainStates[i + 1].id}`);\n }\n\n for (const t of spec.transitions) {\n const style = variantEdgeStyle(t.variant);\n const onMain = mainPairs.has(`${t.from}->${t.to}`);\n edges.push(\n edge({\n id: t.id,\n source: t.from,\n target: t.to,\n sourceHandle: sideHandle(t.fromSide),\n targetHandle: sideHandle(t.toSide),\n label: t.label,\n color: style.color,\n width: t.width ?? style.width,\n lineStyle: style.lineStyle,\n animated: trace && onMain,\n waypoints: t.via?.map(([x, y]) => ({ x, y })),\n }),\n );\n }\n\n return wrap(nodes, edges, [], spec.meta.title);\n}\n\n/* ========================================================================== */\n\nfunction wrap(\n nodes: FlowNode[],\n edges: FlowEdge[],\n lines: FlowLine[],\n title?: string,\n): FlowDocument {\n return {\n canvases: {\n [ROOT_CANVAS_ID]: { nodes, edges, lines },\n },\n stack: [ROOT_CANVAS_ID],\n title,\n };\n}\n\n/** Convert any supported Archify spec into a Flow document. */\nexport function archifyToFlowDocument(spec: ArchifySpec): FlowDocument {\n switch (spec.diagram_type) {\n case 'architecture':\n return convertArchitecture(spec);\n case 'workflow':\n return convertWorkflow(spec);\n case 'sequence':\n return convertSequence(spec);\n case 'dataflow':\n return convertDataflow(spec);\n case 'lifecycle':\n return convertLifecycle(spec);\n default:\n return wrap([], [], []);\n }\n}\n"],"mappings":";;;;AA+BA,SAASA,EAAQ,GAA4B;CAC3C,OAAOC,EAAK,MAAM,cAAc;AAClC;AAMA,IAAMC,IAAY;CAAE,QAAQ,CAAC,IAAI,EAAE;CAAG,MAAM;CAAG,MAAM;CAAI,MAAM;CAAI,OAAO;CAAK,OAAO;AAAG;AAEzF,SAASC,EAAoB,GAA6C;CACxE,IAAMC,IAAQJ,EAAQC,CAAI,GACpBI,IAAO;EAAE,GAAGH;EAAW,GAAGD,EAAK;CAAO,GACtCK,IAAoB,CAAC,GACrBC,IAAoB,CAAC,GAErBC,oBAAO,IAAI,IAA4D;CA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ACA,GACA,GACA,GACc;CACd,OAAO;EACL,UAAU,GACP0D,IAAiB;GAAE;GAAO;GAAO;EAAM,EAC1C;EACA,OAAO,CAACA,CAAc;EACtB;CACF;AACF;AAGA,SAAgBC,EAAsB,GAAiC;CACrE,QAAQ/F,EAAK,cAAb;EACE,KAAK,gBACH,OAAOE,EAAoBF,CAAI;EACjC,KAAK,YACH,OAAOsC,EAAgBtC,CAAI;EAC7B,KAAK,YACH,OAAOyD,EAAgBzD,CAAI;EAC7B,KAAK,YACH,OAAOyE,EAAgBzE,CAAI;EAC7B,KAAK,aACH,OAAO8E,EAAiB9E,CAAI;EAC9B,SACE,OAAOoC,EAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC1B;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"palette.js","names":[],"sources":["../../../../../src/components/pro/Flow/archify/palette.ts"],"sourcesContent":["/**\n * Archify color palette + styling helpers.\n *\n * Mirrors the `classic` dark theme in archify's `assets/template.html` so an\n * imported spec looks like the reference artifact: dark navy canvas, semantic\n * component cards (frontend/backend/database/cloud/security/messagebus/external),\n * and relationship variants (emphasis = green rail, security = rose dashed,\n * dashed = muted). Lifecycle state kinds are mapped onto the same accents.\n *\n * Colors are stored as literal hex on the produced FlowDocument (not theme\n * tokens) so the imported diagram keeps the archify look regardless of the\n * active DishUI theme.\n */\n\nimport type { ArchifyComponentType, ArchifyStateType, ArchifyVariant } from './spec';\nimport type { FlowEdgeLineStyle } from '../types';\n\n/** The dark canvas backdrop archify uses (`--bg`). */\nexport const ARCHIFY_BG = '#020617';\n/** Grid dot / lane stroke color (`--grid`). */\nexport const ARCHIFY_GRID = '#1e293b';\n\nexport const ARCHIFY_TEXT = '#ffffff';\nexport const ARCHIFY_TEXT_MUTED = '#94a3b8';\nexport const ARCHIFY_TEXT_DIM = '#64748b';\n\nexport const ARCHIFY_LANE_STROKE = '#334155';\nexport const ARCHIFY_LANE_FILL = 'transparent';\n\nexport const ARCHIFY_ARROW = '#64748b';\nexport const ARCHIFY_ARROW_EMPHASIS = '#34d399';\nexport const ARCHIFY_ARROW_SECURITY = '#fb7185';\n\nexport interface SemanticStyle {\n /** Card fill (opaque approximation of archify's translucent fill on #020617). */\n fill: string;\n /** Card border / accent stroke. */\n stroke: string;\n /** Title text color (archify keeps titles near-white). */\n text: string;\n /** Muted sub-label / tag text. */\n sub: string;\n}\n\n/**\n * Semantic component styling. archify fills are translucent over #020617; the\n * hexes below are those fills pre-composited on the dark backdrop so PixiJS can\n * paint them as solid colors while looking identical.\n */\nexport const COMPONENT_STYLES: Record<ArchifyComponentType, SemanticStyle> = {\n frontend: { fill: '#07222c', stroke: '#22d3ee', text: '#e6feff', sub: '#7bc6d4' },\n backend: { fill: '#052e26', stroke: '#34d399', text: '#e7fff5', sub: '#79c9ad' },\n database: { fill: '#1e123a', stroke: '#a78bfa', text: '#f1ecff', sub: '#b4a0e6' },\n cloud: { fill: '#2a1c0a', stroke: '#fbbf24', text: '#fff6e2', sub: '#d9b878' },\n security: { fill: '#320d21', stroke: '#fb7185', text: '#ffe9ef', sub: '#e59aab' },\n messagebus: { fill: '#2a1a0c', stroke: '#fb923c', text: '#fff1e3', sub: '#dcab7f' },\n external: { fill: '#111a2b', stroke: '#94a3b8', text: '#eef2f8', sub: '#9aa8bd' },\n};\n\n/**\n * Lifecycle state kinds mapped onto semantic accents so the state machine reads\n * with the same color grammar as the other diagram types.\n */\nexport const STATE_STYLES: Record<ArchifyStateType, SemanticStyle> = {\n start: COMPONENT_STYLES.frontend,\n active: COMPONENT_STYLES.backend,\n waiting: COMPONENT_STYLES.cloud,\n decision: COMPONENT_STYLES.security,\n success: COMPONENT_STYLES.database,\n failure: COMPONENT_STYLES.security,\n neutral: COMPONENT_STYLES.external,\n external: COMPONENT_STYLES.external,\n};\n\nexport function componentStyle(type: ArchifyComponentType): SemanticStyle {\n return COMPONENT_STYLES[type] ?? COMPONENT_STYLES.external;\n}\n\nexport function stateStyle(type: ArchifyStateType): SemanticStyle {\n return STATE_STYLES[type] ?? STATE_STYLES.neutral;\n}\n\nexport interface EdgeStyle {\n color: string;\n width: number;\n lineStyle: FlowEdgeLineStyle;\n}\n\n/** Resolve a relationship variant to an edge stroke color / width / dash. */\nexport function variantEdgeStyle(variant?: ArchifyVariant, baseWidth = 1.75): EdgeStyle {\n switch (variant) {\n case 'emphasis':\n return { color: ARCHIFY_ARROW_EMPHASIS, width: baseWidth + 0.75, lineStyle: 'solid' };\n case 'security':\n return { color: ARCHIFY_ARROW_SECURITY, width: baseWidth, lineStyle: 'dashed' };\n case 'dashed':\n return { color: ARCHIFY_ARROW, width: baseWidth, lineStyle: 'dashed' };\n case 'default':\n default:\n return { color: ARCHIFY_ARROW, width: baseWidth, lineStyle: 'solid' };\n }\n}\n\n/**\n * Sequence messages have an extra `return` variant (a quiet dashed reply). Map\n * it here; everything else reuses the shared variant styling.\n */\nexport function messageEdgeStyle(variant?: string): EdgeStyle {\n if (variant === 'return') {\n return { color: ARCHIFY_TEXT_DIM, width: 1.5, lineStyle: 'dashed' };\n }\n return variantEdgeStyle(variant as ArchifyVariant | undefined);\n}\n\n/** Card accent dot colors (used when we surface archify `cards` as legend). */\nexport const CARD_DOT_COLORS: Record<string, string> = {\n cyan: '#22d3ee',\n emerald: '#34d399',\n violet: '#a78bfa',\n amber: '#fbbf24',\n rose: '#fb7185',\n orange: '#fb923c',\n slate: '#94a3b8',\n};\n"],"mappings":";AAkBA,IAAa,IAAa,WAEb,IAAe,WAGf,IAAqB,WACrB,IAAmB,WAEnB,IAAsB,WAGtB,IAAgB,WAChB,IAAyB,WACzB,IAAyB,WAkBzB,IAAgE;CAC3E,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAChF,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAC/E,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAChF,OAAO;EAAE,MA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","componentStyle","type","stateStyle","variantEdgeStyle","variant","baseWidth","messageEdgeStyle"],"sources":["../../../../../src/components/pro/Flow/archify/palette.ts"],"sourcesContent":["/**\n * Archify color palette + styling helpers.\n *\n * Mirrors the `classic` dark theme in archify's `assets/template.html` so an\n * imported spec looks like the reference artifact: dark navy canvas, semantic\n * component cards (frontend/backend/database/cloud/security/messagebus/external),\n * and relationship variants (emphasis = green rail, security = rose dashed,\n * dashed = muted). Lifecycle state kinds are mapped onto the same accents.\n *\n * Colors are stored as literal hex on the produced FlowDocument (not theme\n * tokens) so the imported diagram keeps the archify look regardless of the\n * active DishUI theme.\n */\n\nimport type { ArchifyComponentType, ArchifyStateType, ArchifyVariant } from './spec';\nimport type { FlowEdgeLineStyle } from '../types';\n\n/** The dark canvas backdrop archify uses (`--bg`). */\nexport const ARCHIFY_BG = '#020617';\n/** Grid dot / lane stroke color (`--grid`). */\nexport const ARCHIFY_GRID = '#1e293b';\n\nexport const ARCHIFY_TEXT = '#ffffff';\nexport const ARCHIFY_TEXT_MUTED = '#94a3b8';\nexport const ARCHIFY_TEXT_DIM = '#64748b';\n\nexport const ARCHIFY_LANE_STROKE = '#334155';\nexport const ARCHIFY_LANE_FILL = 'transparent';\n\nexport const ARCHIFY_ARROW = '#64748b';\nexport const ARCHIFY_ARROW_EMPHASIS = '#34d399';\nexport const ARCHIFY_ARROW_SECURITY = '#fb7185';\n\nexport interface SemanticStyle {\n /** Card fill (opaque approximation of archify's translucent fill on #020617). */\n fill: string;\n /** Card border / accent stroke. */\n stroke: string;\n /** Title text color (archify keeps titles near-white). */\n text: string;\n /** Muted sub-label / tag text. */\n sub: string;\n}\n\n/**\n * Semantic component styling. archify fills are translucent over #020617; the\n * hexes below are those fills pre-composited on the dark backdrop so PixiJS can\n * paint them as solid colors while looking identical.\n */\nexport const COMPONENT_STYLES: Record<ArchifyComponentType, SemanticStyle> = {\n frontend: { fill: '#07222c', stroke: '#22d3ee', text: '#e6feff', sub: '#7bc6d4' },\n backend: { fill: '#052e26', stroke: '#34d399', text: '#e7fff5', sub: '#79c9ad' },\n database: { fill: '#1e123a', stroke: '#a78bfa', text: '#f1ecff', sub: '#b4a0e6' },\n cloud: { fill: '#2a1c0a', stroke: '#fbbf24', text: '#fff6e2', sub: '#d9b878' },\n security: { fill: '#320d21', stroke: '#fb7185', text: '#ffe9ef', sub: '#e59aab' },\n messagebus: { fill: '#2a1a0c', stroke: '#fb923c', text: '#fff1e3', sub: '#dcab7f' },\n external: { fill: '#111a2b', stroke: '#94a3b8', text: '#eef2f8', sub: '#9aa8bd' },\n};\n\n/**\n * Lifecycle state kinds mapped onto semantic accents so the state machine reads\n * with the same color grammar as the other diagram types.\n */\nexport const STATE_STYLES: Record<ArchifyStateType, SemanticStyle> = {\n start: COMPONENT_STYLES.frontend,\n active: COMPONENT_STYLES.backend,\n waiting: COMPONENT_STYLES.cloud,\n decision: COMPONENT_STYLES.security,\n success: COMPONENT_STYLES.database,\n failure: COMPONENT_STYLES.security,\n neutral: COMPONENT_STYLES.external,\n external: COMPONENT_STYLES.external,\n};\n\nexport function componentStyle(type: ArchifyComponentType): SemanticStyle {\n return COMPONENT_STYLES[type] ?? COMPONENT_STYLES.external;\n}\n\nexport function stateStyle(type: ArchifyStateType): SemanticStyle {\n return STATE_STYLES[type] ?? STATE_STYLES.neutral;\n}\n\nexport interface EdgeStyle {\n color: string;\n width: number;\n lineStyle: FlowEdgeLineStyle;\n}\n\n/** Resolve a relationship variant to an edge stroke color / width / dash. */\nexport function variantEdgeStyle(variant?: ArchifyVariant, baseWidth = 1.75): EdgeStyle {\n switch (variant) {\n case 'emphasis':\n return { color: ARCHIFY_ARROW_EMPHASIS, width: baseWidth + 0.75, lineStyle: 'solid' };\n case 'security':\n return { color: ARCHIFY_ARROW_SECURITY, width: baseWidth, lineStyle: 'dashed' };\n case 'dashed':\n return { color: ARCHIFY_ARROW, width: baseWidth, lineStyle: 'dashed' };\n case 'default':\n default:\n return { color: ARCHIFY_ARROW, width: baseWidth, lineStyle: 'solid' };\n }\n}\n\n/**\n * Sequence messages have an extra `return` variant (a quiet dashed reply). Map\n * it here; everything else reuses the shared variant styling.\n */\nexport function messageEdgeStyle(variant?: string): EdgeStyle {\n if (variant === 'return') {\n return { color: ARCHIFY_TEXT_DIM, width: 1.5, lineStyle: 'dashed' };\n }\n return variantEdgeStyle(variant as ArchifyVariant | undefined);\n}\n\n/** Card accent dot colors (used when we surface archify `cards` as legend). */\nexport const CARD_DOT_COLORS: Record<string, string> = {\n cyan: '#22d3ee',\n emerald: '#34d399',\n violet: '#a78bfa',\n amber: '#fbbf24',\n rose: '#fb7185',\n orange: '#fb923c',\n slate: '#94a3b8',\n};\n"],"mappings":";AAkBA,IAAaA,IAAa,WAEbC,IAAe,WAGfC,IAAqB,WACrBC,IAAmB,WAEnBC,IAAsB,WAGtBC,IAAgB,WAChBC,IAAyB,WACzBC,IAAyB,WAkBzBC,IAAgE;CAC3E,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAChF,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAC/E,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAChF,OAAO;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAC7E,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAChF,YAAY;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;CAClF,UAAU;EAAE,MAAM;EAAW,QAAQ;EAAW,MAAM;EAAW,KAAK;CAAU;AAClF,GAMaC,IAAwD;CACnE,OAAOD,EAAiB;CACxB,QAAQA,EAAiB;CACzB,SAASA,EAAiB;CAC1B,UAAUA,EAAiB;CAC3B,SAASA,EAAiB;CAC1B,SAASA,EAAiB;CAC1B,SAASA,EAAiB;CAC1B,UAAUA,EAAiB;AAC7B;AAEA,SAAgBE,EAAe,GAA2C;CACxE,OAAOF,EAAiBG,MAASH,EAAiB;AACpD;AAEA,SAAgBI,EAAW,GAAuC;CAChE,OAAOH,EAAaE,MAASF,EAAa;AAC5C;AASA,SAAgBI,EAAiB,GAA0B,IAAY,MAAiB;CACtF,QAAQC,GAAR;EACE,KAAK,YACH,OAAO;GAAE,OAAOR;GAAwB,OAAOS,IAAY;GAAM,WAAW;EAAQ;EACtF,KAAK,YACH,OAAO;GAAE,OAAOR;GAAwB,OAAOQ;GAAW,WAAW;EAAS;EAChF,KAAK,UACH,OAAO;GAAE,OAAOV;GAAe,OAAOU;GAAW,WAAW;EAAS;EAEvE,SACE,OAAO;GAAE,OAAOV;GAAe,OAAOU;GAAW,WAAW;EAAQ;CACxE;AACF;AAMA,SAAgBC,EAAiB,GAA6B;CAI5D,OAHIF,MAAY,WACP;EAAE,OAAOX;EAAkB,OAAO;EAAK,WAAW;CAAS,IAE7DU,EAAiBC,CAAqC;AAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","names":[],"sources":["../../../../../src/components/pro/Flow/archify/presets.ts"],"sourcesContent":["/**\n * Archify styling helpers for hand-drawn diagrams.\n *\n * These let the Inspector recolor any ordinary shape to Archify's semantic card\n * palette (frontend / backend / database / cloud / security / messagebus /\n * external) and let the toolbar apply that palette across a whole canvas. No\n * dedicated node types are introduced — every regular shape can adopt the look.\n */\n\nimport type { FlowNodeData } from '../types';\nimport type { ArchifyComponentType } from './spec';\nimport { COMPONENT_STYLES } from './palette';\n\n/** The seven semantic component kinds, in Archify's legend order. */\nexport const ARCHIFY_COMPONENT_ORDER: ArchifyComponentType[] = [\n 'frontend',\n 'backend',\n 'database',\n 'cloud',\n 'security',\n 'messagebus',\n 'external',\n];\n\n/** Human labels for the semantic kinds (used in swatch tooltips). */\nexport const ARCHIFY_COMPONENT_LABELS: Record<ArchifyComponentType, string> = {\n frontend: 'Frontend',\n backend: 'Backend',\n database: 'Database',\n cloud: 'Cloud',\n security: 'Security',\n messagebus: 'Message bus',\n external: 'External',\n};\n\n/**\n * Apply an Archify semantic style to a node's data, returning the fields to\n * merge. Recolors fill / stroke / label / sublabel while leaving text content\n * and geometry untouched, so any existing shape can adopt the Archify look.\n */\nexport function archifyStylePatch(type: ArchifyComponentType): Partial<FlowNodeData> {\n const s = COMPONENT_STYLES[type];\n return {\n fill: s.fill,\n stroke: s.stroke,\n color: s.text,\n labelColor: s.text,\n sublabelColor: s.sub,\n strokeWidth: 1.75,\n borderStyle: 'solid',\n };\n}\n\n/**\n * Infer the closest Archify semantic kind for an arbitrary node from its\n * current stroke color, so \"apply Archify style\" can recolor a hand-drawn\n * diagram without the user tagging every node. Falls back to `external`.\n */\nexport function inferComponentType(data: FlowNodeData): ArchifyComponentType {\n const stroke = (data.stroke ?? '').toLowerCase();\n for (const type of ARCHIFY_COMPONENT_ORDER) {\n if (COMPONENT_STYLES[type].stroke.toLowerCase() === stroke) return type;\n }\n return 'external';\n}\n"],"mappings":";;AAcA,IAAa,IAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAGa,IAAiE;CAC5E,UAAU;CACV,SAAS;CACT,UAAU;CACV,OAAO;CACP,UAAU;CACV,YAAY;CACZ,UAAU;AACZ;AAOA,SAAgB,EAAkB,GAAmD;CACnF,IAAM,IAAI,EAAiB;CAC3B,OAAO;EACL,MAAM,EAAE;EACR,QAAQ,EAAE;EACV,OAAO,EAAE;EACT,YAAY,EAAE;EACd,eAAe,EAAE;EACjB,aAAa;EACb,aAAa;CACf;AACF;AAOA,SAAgB,EAAmB,GAA0C;CAC3E,IAAM,KAAU,EAAK,UAAU,GAAA,CAAI,YAAY;CAC/C,KAAK,IAAM,KAAQ,GACjB,IAAI,EAAiB,EAAK,CAAC,OAAO,YAAY,MAAM,GAAQ,OAAO;CAErE,OAAO;AACT"}
1
+ {"version":3,"file":"presets.js","names":["ARCHIFY_COMPONENT_ORDER","ARCHIFY_COMPONENT_LABELS","archifyStylePatch","s","COMPONENT_STYLES","type","inferComponentType","stroke","data"],"sources":["../../../../../src/components/pro/Flow/archify/presets.ts"],"sourcesContent":["/**\n * Archify styling helpers for hand-drawn diagrams.\n *\n * These let the Inspector recolor any ordinary shape to Archify's semantic card\n * palette (frontend / backend / database / cloud / security / messagebus /\n * external) and let the toolbar apply that palette across a whole canvas. No\n * dedicated node types are introduced — every regular shape can adopt the look.\n */\n\nimport type { FlowNodeData } from '../types';\nimport type { ArchifyComponentType } from './spec';\nimport { COMPONENT_STYLES } from './palette';\n\n/** The seven semantic component kinds, in Archify's legend order. */\nexport const ARCHIFY_COMPONENT_ORDER: ArchifyComponentType[] = [\n 'frontend',\n 'backend',\n 'database',\n 'cloud',\n 'security',\n 'messagebus',\n 'external',\n];\n\n/** Human labels for the semantic kinds (used in swatch tooltips). */\nexport const ARCHIFY_COMPONENT_LABELS: Record<ArchifyComponentType, string> = {\n frontend: 'Frontend',\n backend: 'Backend',\n database: 'Database',\n cloud: 'Cloud',\n security: 'Security',\n messagebus: 'Message bus',\n external: 'External',\n};\n\n/**\n * Apply an Archify semantic style to a node's data, returning the fields to\n * merge. Recolors fill / stroke / label / sublabel while leaving text content\n * and geometry untouched, so any existing shape can adopt the Archify look.\n */\nexport function archifyStylePatch(type: ArchifyComponentType): Partial<FlowNodeData> {\n const s = COMPONENT_STYLES[type];\n return {\n fill: s.fill,\n stroke: s.stroke,\n color: s.text,\n labelColor: s.text,\n sublabelColor: s.sub,\n strokeWidth: 1.75,\n borderStyle: 'solid',\n };\n}\n\n/**\n * Infer the closest Archify semantic kind for an arbitrary node from its\n * current stroke color, so \"apply Archify style\" can recolor a hand-drawn\n * diagram without the user tagging every node. Falls back to `external`.\n */\nexport function inferComponentType(data: FlowNodeData): ArchifyComponentType {\n const stroke = (data.stroke ?? '').toLowerCase();\n for (const type of ARCHIFY_COMPONENT_ORDER) {\n if (COMPONENT_STYLES[type].stroke.toLowerCase() === stroke) return type;\n }\n return 'external';\n}\n"],"mappings":";;AAcA,IAAaA,IAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAGaC,IAAiE;CAC5E,UAAU;CACV,SAAS;CACT,UAAU;CACV,OAAO;CACP,UAAU;CACV,YAAY;CACZ,UAAU;AACZ;AAOA,SAAgBC,EAAkB,GAAmD;CACnF,IAAMC,IAAIC,EAAiBC;CAC3B,OAAO;EACL,MAAMF,EAAE;EACR,QAAQA,EAAE;EACV,OAAOA,EAAE;EACT,YAAYA,EAAE;EACd,eAAeA,EAAE;EACjB,aAAa;EACb,aAAa;CACf;AACF;AAOA,SAAgBG,EAAmB,GAA0C;CAC3E,IAAMC,KAAUC,EAAK,UAAU,GAAA,CAAI,YAAY;CAC/C,KAAK,IAAMH,KAAQL,GACjB,IAAII,EAAiBC,EAAK,CAAC,OAAO,YAAY,MAAME,GAAQ,OAAOF;CAErE,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","names":[],"sources":["../../../../../src/components/pro/Flow/archify/spec.ts"],"sourcesContent":["/**\n * Archify diagram specification types.\n *\n * These mirror the JSON schemas shipped with the `archify` skill\n * (architecture / workflow / sequence / dataflow / lifecycle). A spec of any of\n * these five types can be converted into a native Flow `FlowDocument` by the\n * converters in this folder, which reproduce archify's grid/lane layout,\n * semantic styling, and optional \"trace\" motion (played in presentation mode).\n *\n * Only the fields the converters actually use are typed strictly; unknown\n * fields are tolerated so newer specs still import.\n */\n\n/** Semantic component type shared by architecture / workflow / sequence / dataflow. */\nexport type ArchifyComponentType =\n | 'frontend'\n | 'backend'\n | 'database'\n | 'cloud'\n | 'security'\n | 'messagebus'\n | 'external';\n\n/** Lifecycle state kinds. */\nexport type ArchifyStateType =\n | 'start'\n | 'active'\n | 'waiting'\n | 'decision'\n | 'success'\n | 'failure'\n | 'neutral'\n | 'external';\n\n/** Relationship / edge visual variant. */\nexport type ArchifyVariant = 'default' | 'emphasis' | 'security' | 'dashed';\n\n/** Side an edge leaves / enters a node from. */\nexport type ArchifySide = 'left' | 'right' | 'top' | 'bottom';\n\nexport type ArchifyDiagramType =\n | 'architecture'\n | 'workflow'\n | 'sequence'\n | 'dataflow'\n | 'lifecycle';\n\nexport interface ArchifyMeta {\n title: string;\n subtitle?: string;\n animation?: 'trace' | 'none';\n quality_profile?: 'standard' | 'showcase';\n visual_preset?: 'classic' | 'signal-flow' | 'blueprint' | 'editorial';\n /** Explicit [width, height] authoring canvas. */\n viewBox?: [number, number];\n column_fit?: 'fixed' | 'spread';\n [key: string]: unknown;\n}\n\nexport interface ArchifyCard {\n dot: 'cyan' | 'emerald' | 'violet' | 'amber' | 'rose' | 'orange' | 'slate';\n title: string;\n items: string[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Architecture */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyArchComponent {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n /** Explicit top-left position [x, y] in authoring units. */\n pos?: [number, number];\n /** Explicit [width, height]. */\n size?: [number, number];\n /** Grid placement fallback. */\n row?: number;\n col?: number;\n}\n\nexport interface ArchifyBoundary {\n kind: 'region' | 'security-group';\n label: string;\n wraps: string[];\n pad?: number;\n}\n\nexport interface ArchifyConnection {\n id?: string;\n from: string;\n to: string;\n label?: string;\n variant?: ArchifyVariant;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n route?: string;\n via?: Array<[number, number]>;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n width?: number;\n}\n\nexport interface ArchifyArchitectureSpec {\n schema_version: 1;\n diagram_type: 'architecture';\n meta: ArchifyMeta;\n layout?: {\n mode: 'grid';\n origin?: [number, number];\n cols?: number;\n gapX?: number;\n gapY?: number;\n cellW?: number;\n cellH?: number;\n };\n components: ArchifyArchComponent[];\n boundaries?: ArchifyBoundary[];\n connections?: ArchifyConnection[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Workflow */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyLane {\n id: string;\n label: string;\n variant?: 'normal' | 'exception';\n}\n\nexport interface ArchifyPhase {\n id: string;\n label: string;\n fromCol: number;\n toCol: number;\n variant?: ArchifyVariant;\n}\n\nexport interface ArchifyWorkflowGroup {\n id: string;\n label: string;\n lane: string;\n fromCol: number;\n toCol: number;\n variant?: ArchifyVariant;\n}\n\nexport interface ArchifyWorkflowNode {\n id: string;\n lane: string;\n col: number;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyWorkflowEdge {\n id?: string;\n from: string;\n to: string;\n label?: string;\n variant?: ArchifyVariant;\n role?: 'main' | 'branch' | 'async' | 'return' | 'error';\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n route?: string;\n via?: Array<[number, number]>;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n channelX?: number;\n channelY?: number;\n width?: number;\n}\n\nexport interface ArchifyWorkflowSpec {\n schema_version: 1;\n diagram_type: 'workflow';\n meta: ArchifyMeta;\n lanes: ArchifyLane[];\n phases?: ArchifyPhase[];\n groups?: ArchifyWorkflowGroup[];\n mainPath?: string[];\n nodes: ArchifyWorkflowNode[];\n edges: ArchifyWorkflowEdge[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Sequence */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyParticipant {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n brand?: unknown;\n}\n\nexport interface ArchifySegment {\n from: number;\n to: number;\n label: string;\n}\n\nexport interface ArchifyMessage {\n id?: string;\n from: string;\n to: string;\n y: number;\n label: string;\n variant?: 'default' | 'emphasis' | 'security' | 'dashed' | 'return';\n note?: string;\n}\n\nexport interface ArchifyActivation {\n participant: string;\n from: number;\n to: number;\n type?: ArchifyComponentType;\n}\n\nexport interface ArchifySequenceSpec {\n schema_version: 1;\n diagram_type: 'sequence';\n meta: ArchifyMeta;\n participants: ArchifyParticipant[];\n segments?: ArchifySegment[];\n messages: ArchifyMessage[];\n activations?: ArchifyActivation[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Dataflow */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyStage {\n label: string;\n}\n\nexport interface ArchifyDataflowNode {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n stage: number;\n row: number;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyFlow {\n id?: string;\n from: string;\n to: string;\n label: string;\n classification?: string;\n variant?: ArchifyVariant;\n route?: string;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n channelX?: number;\n channelY?: number;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n via?: Array<[number, number]>;\n width?: number;\n}\n\nexport interface ArchifyDataflowSpec {\n schema_version: 1;\n diagram_type: 'dataflow';\n meta: ArchifyMeta;\n stages: ArchifyStage[];\n nodes: ArchifyDataflowNode[];\n flows: ArchifyFlow[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Lifecycle */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyLifecycleLane {\n id: string;\n label: string;\n}\n\nexport interface ArchifyState {\n id: string;\n type: ArchifyStateType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n step?: string;\n lane: string;\n col: number;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyTransition {\n id?: string;\n from: string;\n to: string;\n label?: string;\n note?: string;\n variant?: ArchifyVariant;\n route?: string;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n channelX?: number;\n channelY?: number;\n cornerRadius?: number;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n via?: Array<[number, number]>;\n width?: number;\n}\n\nexport interface ArchifyLifecycleSpec {\n schema_version: 1;\n diagram_type: 'lifecycle';\n meta: ArchifyMeta;\n lanes: ArchifyLifecycleLane[];\n states: ArchifyState[];\n transitions: ArchifyTransition[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n\nexport type ArchifySpec =\n | ArchifyArchitectureSpec\n | ArchifyWorkflowSpec\n | ArchifySequenceSpec\n | ArchifyDataflowSpec\n | ArchifyLifecycleSpec;\n\n/** Narrow an unknown value to an ArchifySpec if it looks like one. */\nexport function isArchifySpec(value: unknown): value is ArchifySpec {\n if (!value || typeof value !== 'object') return false;\n const v = value as Record<string, unknown>;\n const type = v.diagram_type;\n return (\n v.schema_version === 1 &&\n (type === 'architecture' ||\n type === 'workflow' ||\n type === 'sequence' ||\n type === 'dataflow' ||\n type === 'lifecycle')\n );\n}\n"],"mappings":";AAyWA,SAAgB,EAAc,GAAsC;CAClE,IAAI,CAAC,KAAS,OAAO,KAAU,UAAU,OAAO;CAChD,IAAM,IAAI,GACJ,IAAO,EAAE;CACf,OACE,EAAE,mBAAmB,MACpB,MAAS,kBACR,MAAS,cACT,MAAS,cACT,MAAS,cACT,MAAS;AAEf"}
1
+ {"version":3,"file":"spec.js","names":["isArchifySpec","value","v","type"],"sources":["../../../../../src/components/pro/Flow/archify/spec.ts"],"sourcesContent":["/**\n * Archify diagram specification types.\n *\n * These mirror the JSON schemas shipped with the `archify` skill\n * (architecture / workflow / sequence / dataflow / lifecycle). A spec of any of\n * these five types can be converted into a native Flow `FlowDocument` by the\n * converters in this folder, which reproduce archify's grid/lane layout,\n * semantic styling, and optional \"trace\" motion (played in presentation mode).\n *\n * Only the fields the converters actually use are typed strictly; unknown\n * fields are tolerated so newer specs still import.\n */\n\n/** Semantic component type shared by architecture / workflow / sequence / dataflow. */\nexport type ArchifyComponentType =\n | 'frontend'\n | 'backend'\n | 'database'\n | 'cloud'\n | 'security'\n | 'messagebus'\n | 'external';\n\n/** Lifecycle state kinds. */\nexport type ArchifyStateType =\n | 'start'\n | 'active'\n | 'waiting'\n | 'decision'\n | 'success'\n | 'failure'\n | 'neutral'\n | 'external';\n\n/** Relationship / edge visual variant. */\nexport type ArchifyVariant = 'default' | 'emphasis' | 'security' | 'dashed';\n\n/** Side an edge leaves / enters a node from. */\nexport type ArchifySide = 'left' | 'right' | 'top' | 'bottom';\n\nexport type ArchifyDiagramType =\n | 'architecture'\n | 'workflow'\n | 'sequence'\n | 'dataflow'\n | 'lifecycle';\n\nexport interface ArchifyMeta {\n title: string;\n subtitle?: string;\n animation?: 'trace' | 'none';\n quality_profile?: 'standard' | 'showcase';\n visual_preset?: 'classic' | 'signal-flow' | 'blueprint' | 'editorial';\n /** Explicit [width, height] authoring canvas. */\n viewBox?: [number, number];\n column_fit?: 'fixed' | 'spread';\n [key: string]: unknown;\n}\n\nexport interface ArchifyCard {\n dot: 'cyan' | 'emerald' | 'violet' | 'amber' | 'rose' | 'orange' | 'slate';\n title: string;\n items: string[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Architecture */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyArchComponent {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n /** Explicit top-left position [x, y] in authoring units. */\n pos?: [number, number];\n /** Explicit [width, height]. */\n size?: [number, number];\n /** Grid placement fallback. */\n row?: number;\n col?: number;\n}\n\nexport interface ArchifyBoundary {\n kind: 'region' | 'security-group';\n label: string;\n wraps: string[];\n pad?: number;\n}\n\nexport interface ArchifyConnection {\n id?: string;\n from: string;\n to: string;\n label?: string;\n variant?: ArchifyVariant;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n route?: string;\n via?: Array<[number, number]>;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n width?: number;\n}\n\nexport interface ArchifyArchitectureSpec {\n schema_version: 1;\n diagram_type: 'architecture';\n meta: ArchifyMeta;\n layout?: {\n mode: 'grid';\n origin?: [number, number];\n cols?: number;\n gapX?: number;\n gapY?: number;\n cellW?: number;\n cellH?: number;\n };\n components: ArchifyArchComponent[];\n boundaries?: ArchifyBoundary[];\n connections?: ArchifyConnection[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Workflow */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyLane {\n id: string;\n label: string;\n variant?: 'normal' | 'exception';\n}\n\nexport interface ArchifyPhase {\n id: string;\n label: string;\n fromCol: number;\n toCol: number;\n variant?: ArchifyVariant;\n}\n\nexport interface ArchifyWorkflowGroup {\n id: string;\n label: string;\n lane: string;\n fromCol: number;\n toCol: number;\n variant?: ArchifyVariant;\n}\n\nexport interface ArchifyWorkflowNode {\n id: string;\n lane: string;\n col: number;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyWorkflowEdge {\n id?: string;\n from: string;\n to: string;\n label?: string;\n variant?: ArchifyVariant;\n role?: 'main' | 'branch' | 'async' | 'return' | 'error';\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n route?: string;\n via?: Array<[number, number]>;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n channelX?: number;\n channelY?: number;\n width?: number;\n}\n\nexport interface ArchifyWorkflowSpec {\n schema_version: 1;\n diagram_type: 'workflow';\n meta: ArchifyMeta;\n lanes: ArchifyLane[];\n phases?: ArchifyPhase[];\n groups?: ArchifyWorkflowGroup[];\n mainPath?: string[];\n nodes: ArchifyWorkflowNode[];\n edges: ArchifyWorkflowEdge[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Sequence */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyParticipant {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n brand?: unknown;\n}\n\nexport interface ArchifySegment {\n from: number;\n to: number;\n label: string;\n}\n\nexport interface ArchifyMessage {\n id?: string;\n from: string;\n to: string;\n y: number;\n label: string;\n variant?: 'default' | 'emphasis' | 'security' | 'dashed' | 'return';\n note?: string;\n}\n\nexport interface ArchifyActivation {\n participant: string;\n from: number;\n to: number;\n type?: ArchifyComponentType;\n}\n\nexport interface ArchifySequenceSpec {\n schema_version: 1;\n diagram_type: 'sequence';\n meta: ArchifyMeta;\n participants: ArchifyParticipant[];\n segments?: ArchifySegment[];\n messages: ArchifyMessage[];\n activations?: ArchifyActivation[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Dataflow */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyStage {\n label: string;\n}\n\nexport interface ArchifyDataflowNode {\n id: string;\n type: ArchifyComponentType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n stage: number;\n row: number;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyFlow {\n id?: string;\n from: string;\n to: string;\n label: string;\n classification?: string;\n variant?: ArchifyVariant;\n route?: string;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n channelX?: number;\n channelY?: number;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n via?: Array<[number, number]>;\n width?: number;\n}\n\nexport interface ArchifyDataflowSpec {\n schema_version: 1;\n diagram_type: 'dataflow';\n meta: ArchifyMeta;\n stages: ArchifyStage[];\n nodes: ArchifyDataflowNode[];\n flows: ArchifyFlow[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Lifecycle */\n/* -------------------------------------------------------------------------- */\n\nexport interface ArchifyLifecycleLane {\n id: string;\n label: string;\n}\n\nexport interface ArchifyState {\n id: string;\n type: ArchifyStateType;\n label: string;\n sublabel?: string;\n tag?: string;\n brand?: unknown;\n step?: string;\n lane: string;\n col: number;\n width?: number;\n height?: number;\n yOffset?: number;\n}\n\nexport interface ArchifyTransition {\n id?: string;\n from: string;\n to: string;\n label?: string;\n note?: string;\n variant?: ArchifyVariant;\n route?: string;\n fromSide?: ArchifySide;\n toSide?: ArchifySide;\n channelX?: number;\n channelY?: number;\n cornerRadius?: number;\n labelAt?: [number, number];\n labelDx?: number;\n labelDy?: number;\n via?: Array<[number, number]>;\n width?: number;\n}\n\nexport interface ArchifyLifecycleSpec {\n schema_version: 1;\n diagram_type: 'lifecycle';\n meta: ArchifyMeta;\n lanes: ArchifyLifecycleLane[];\n states: ArchifyState[];\n transitions: ArchifyTransition[];\n cards?: ArchifyCard[];\n}\n\n/* -------------------------------------------------------------------------- */\n\nexport type ArchifySpec =\n | ArchifyArchitectureSpec\n | ArchifyWorkflowSpec\n | ArchifySequenceSpec\n | ArchifyDataflowSpec\n | ArchifyLifecycleSpec;\n\n/** Narrow an unknown value to an ArchifySpec if it looks like one. */\nexport function isArchifySpec(value: unknown): value is ArchifySpec {\n if (!value || typeof value !== 'object') return false;\n const v = value as Record<string, unknown>;\n const type = v.diagram_type;\n return (\n v.schema_version === 1 &&\n (type === 'architecture' ||\n type === 'workflow' ||\n type === 'sequence' ||\n type === 'dataflow' ||\n type === 'lifecycle')\n );\n}\n"],"mappings":";AAyWA,SAAgBA,EAAc,GAAsC;CAClE,IAAI,CAACC,KAAS,OAAOA,KAAU,UAAU,OAAO;CAChD,IAAMC,IAAID,GACJE,IAAOD,EAAE;CACf,OACEA,EAAE,mBAAmB,MACpBC,MAAS,kBACRA,MAAS,cACTA,MAAS,cACTA,MAAS,cACTA,MAAS;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlignmentGuides.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/AlignmentGuides.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { AlignGuide } from '../hooks/useAlignmentGuides';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders alignment guide lines (dashed) on the canvas.\n */\nexport class AlignmentGuidesRenderer {\n private gfx: Graphics;\n\n constructor(parent: Container) {\n this.gfx = new Graphics();\n this.gfx.label = 'alignment-guides';\n parent.addChild(this.gfx);\n }\n\n update(guides: AlignGuide[], screenW: number, screenH: number, viewport: ViewportState): void {\n this.gfx.clear();\n if (guides.length === 0) return;\n\n for (const guide of guides) {\n if (guide.type === 'vertical') {\n this.gfx.moveTo(guide.position, -10000).lineTo(guide.position, 10000);\n } else {\n this.gfx.moveTo(-10000, guide.position).lineTo(10000, guide.position);\n }\n }\n this.gfx.stroke({ color: 0xf97316, width: 1, alpha: 0.6 });\n }\n\n clear(): void {\n this.gfx.clear();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAOA,IAAa,IAAb,MAAqC;CACnC;CAEA,YAAY,GAAmB;EAG7B,AAFA,KAAK,MAAM,IAAI,EAAS,GACxB,KAAK,IAAI,QAAQ,oBACjB,EAAO,SAAS,KAAK,GAAG;CAC1B;CAEA,OAAO,GAAsB,GAAiB,GAAiB,GAA+B;EAC5F,SAAK,IAAI,MAAM,GACX,EAAO,WAAW,GAEtB;QAAK,IAAM,KAAS,GAClB,AAAI,EAAM,SAAS,aACjB,KAAK,IAAI,OAAO,EAAM,UAAU,IAAM,CAAC,CAAC,OAAO,EAAM,UAAU,GAAK,IAEpE,KAAK,IAAI,OAAO,MAAQ,EAAM,QAAQ,CAAC,CAAC,OAAO,KAAO,EAAM,QAAQ;GAGxE,KAAK,IAAI,OAAO;IAAE,OAAO;IAAU,OAAO;IAAG,OAAO;GAAI,CAAC;EAHe;CAI1E;CAEA,QAAc;EACZ,KAAK,IAAI,MAAM;CACjB;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
1
+ {"version":3,"file":"AlignmentGuides.js","names":["AlignmentGuidesRenderer","Graphics","parent","guides","guide"],"sources":["../../../../../src/components/pro/Flow/canvas/AlignmentGuides.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { AlignGuide } from '../hooks/useAlignmentGuides';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders alignment guide lines (dashed) on the canvas.\n */\nexport class AlignmentGuidesRenderer {\n private gfx: Graphics;\n\n constructor(parent: Container) {\n this.gfx = new Graphics();\n this.gfx.label = 'alignment-guides';\n parent.addChild(this.gfx);\n }\n\n update(guides: AlignGuide[], screenW: number, screenH: number, viewport: ViewportState): void {\n this.gfx.clear();\n if (guides.length === 0) return;\n\n for (const guide of guides) {\n if (guide.type === 'vertical') {\n this.gfx.moveTo(guide.position, -10000).lineTo(guide.position, 10000);\n } else {\n this.gfx.moveTo(-10000, guide.position).lineTo(10000, guide.position);\n }\n }\n this.gfx.stroke({ color: 0xf97316, width: 1, alpha: 0.6 });\n }\n\n clear(): void {\n this.gfx.clear();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAOA,IAAaA,IAAb,MAAqC;CACnC;CAEA,YAAY,GAAmB;EAG7B,AAFA,KAAK,MAAM,IAAIC,EAAS,GACxB,KAAK,IAAI,QAAQ,oBACjBC,EAAO,SAAS,KAAK,GAAG;CAC1B;CAEA,OAAO,GAAsB,GAAiB,GAAiB,GAA+B;EAE5F,IADA,KAAK,IAAI,MAAM,GACXC,EAAO,WAAW,GAEtB;QAAK,IAAMC,KAASD,GAClB,AAAIC,EAAM,SAAS,aACjB,KAAK,IAAI,OAAOA,EAAM,UAAU,IAAM,CAAC,CAAC,OAAOA,EAAM,UAAU,GAAK,IAEpE,KAAK,IAAI,OAAO,MAAQA,EAAM,QAAQ,CAAC,CAAC,OAAO,KAAOA,EAAM,QAAQ;GAGxE,KAAK,IAAI,OAAO;IAAE,OAAO;IAAU,OAAO;IAAG,OAAO;GAAI,CAAC;EAHe;CAI1E;CAEA,QAAc;EACZ,KAAK,IAAI,MAAM;CACjB;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"GridRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/GridRenderer.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders a dot grid on the canvas that adjusts to viewport pan/zoom.\n */\nexport class GridRenderer {\n private gfx: Graphics;\n private _gridSize: number;\n private _visible: boolean;\n private _dotColor = 0xd1d5db;\n // Cache of the last render inputs so we can skip redrawing when nothing\n // changed. Redrawing thousands of dots every frame (60fps) is the main\n // source of low-zoom jitter/stutter.\n private _last: { ox: number; oy: number; zoom: number; w: number; h: number; grid: number; vis: boolean; color: number } | null = null;\n\n constructor(parent: Container, gridSize = 20, visible = true) {\n this._gridSize = gridSize;\n this._visible = visible;\n this.gfx = new Graphics();\n this.gfx.label = 'grid';\n parent.addChildAt(this.gfx, 0);\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.gfx.visible = v;\n }\n\n set gridSize(s: number) {\n this._gridSize = Math.max(5, s);\n }\n\n /** Grid dot color, derived from the active theme's foreground. */\n set dotColor(c: number) {\n this._dotColor = c;\n }\n\n update(viewport: ViewportState, screenW: number, screenH: number): void {\n if (!this._visible) return;\n\n const { x: ox, y: oy, zoom } = viewport;\n\n // Skip the redraw entirely if nothing that affects the grid changed.\n const last = this._last;\n if (\n last &&\n last.ox === ox && last.oy === oy && last.zoom === zoom &&\n last.w === screenW && last.h === screenH &&\n last.grid === this._gridSize && last.vis === this._visible &&\n last.color === this._dotColor\n ) {\n return;\n }\n this._last = { ox, oy, zoom, w: screenW, h: screenH, grid: this._gridSize, vis: this._visible, color: this._dotColor };\n\n const g = this.gfx;\n g.clear();\n\n // Adaptive spacing: multiply the base grid step by a power of two until the\n // on-screen spacing is comfortably large. Without this, low zoom levels\n // (e.g. 25%–45%) produce tens of thousands of dots per frame.\n const MIN_SCREEN_STEP = 12;\n let step = this._gridSize * zoom;\n if (step <= 0) return;\n let mul = 1;\n while (step * mul < MIN_SCREEN_STEP) {\n mul *= 2;\n }\n step *= mul;\n\n // Hard cap on total dot count as a final safety net.\n const MAX_DOTS = 6000;\n const cols = Math.ceil(screenW / step) + 1;\n const rows = Math.ceil(screenH / step) + 1;\n if (cols * rows > MAX_DOTS) return;\n\n const dotRadius = Math.max(0.8, Math.min(1.6, zoom * 0.8));\n const dotColor = this._dotColor;\n const dotAlpha = Math.min(0.6, Math.max(0.2, zoom * 0.4));\n\n const startX = ox % step;\n const startY = oy % step;\n\n g.setFillStyle({ color: dotColor, alpha: dotAlpha });\n for (let x = startX; x < screenW; x += step) {\n for (let y = startY; y < screenH; y += step) {\n g.circle(x, y, dotRadius);\n }\n }\n g.fill();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAMA,IAAa,IAAb,MAA0B;CACxB;CACA;CACA;CACA,YAAoB;CAIpB,QAAkI;CAElI,YAAY,GAAmB,IAAW,IAAI,IAAU,IAAM;EAK5D,AAJA,KAAK,YAAY,GACjB,KAAK,WAAW,GAChB,KAAK,MAAM,IAAI,EAAS,GACxB,KAAK,IAAI,QAAQ,QACjB,EAAO,WAAW,KAAK,KAAK,CAAC;CAC/B;CAEA,IAAI,QAAQ,GAAY;EAEtB,AADA,KAAK,WAAW,GAChB,KAAK,IAAI,UAAU;CACrB;CAEA,IAAI,SAAS,GAAW;EACtB,KAAK,YAAY,KAAK,IAAI,GAAG,CAAC;CAChC;CAGA,IAAI,SAAS,GAAW;EACtB,KAAK,YAAY;CACnB;CAEA,OAAO,GAAyB,GAAiB,GAAuB;EACtE,IAAI,CAAC,KAAK,UAAU;EAEpB,IAAM,EAAE,GAAG,GAAI,GAAG,GAAI,YAAS,GAGzB,IAAO,KAAK;EAClB,IACE,KACA,EAAK,OAAO,KAAM,EAAK,OAAO,KAAM,EAAK,SAAS,KAClD,EAAK,MAAM,KAAW,EAAK,MAAM,KACjC,EAAK,SAAS,KAAK,aAAa,EAAK,QAAQ,KAAK,YAClD,EAAK,UAAU,KAAK,WAEpB;EAEF,KAAK,QAAQ;GAAE;GAAI;GAAI;GAAM,GAAG;GAAS,GAAG;GAAS,MAAM,KAAK;GAAW,KAAK,KAAK;GAAU,OAAO,KAAK;EAAU;EAErH,IAAM,IAAI,KAAK;EACf,EAAE,MAAM;EAKR,IACI,IAAO,KAAK,YAAY;EAC5B,IAAI,KAAQ,GAAG;EACf,IAAI,IAAM;EACV,OAAO,IAAO,IAAM,KAClB,KAAO;EAQT,IANA,KAAQ,IAIK,KAAK,KAAK,IAAU,CAAI,IAAI,MAC5B,KAAK,KAAK,IAAU,CAAI,IAAI,KACvB,KAAU;EAE5B,IAAM,IAAY,KAAK,IAAI,IAAK,KAAK,IAAI,KAAK,IAAO,EAAG,CAAC,GACnD,IAAW,KAAK,WAChB,IAAW,KAAK,IAAI,IAAK,KAAK,IAAI,IAAK,IAAO,EAAG,CAAC,GAElD,IAAS,IAAK,GACd,IAAS,IAAK;EAEpB,EAAE,aAAa;GAAE,OAAO;GAAU,OAAO;EAAS,CAAC;EACnD,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAS,KAAK,GACrC,KAAK,IAAI,IAAI,GAAQ,IAAI,GAAS,KAAK,GACrC,EAAE,OAAO,GAAG,GAAG,CAAS;EAG5B,EAAE,KAAK;CACT;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
1
+ {"version":3,"file":"GridRenderer.js","names":["GridRenderer","gridSize","visible","Graphics","parent","v","s","c","ox","oy","viewport","last","zoom","screenW","screenH","g","step","mul","dotRadius","dotColor","dotAlpha","startX","startY","x","y"],"sources":["../../../../../src/components/pro/Flow/canvas/GridRenderer.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\nimport type { ViewportState } from '../types';\n\n/**\n * Renders a dot grid on the canvas that adjusts to viewport pan/zoom.\n */\nexport class GridRenderer {\n private gfx: Graphics;\n private _gridSize: number;\n private _visible: boolean;\n private _dotColor = 0xd1d5db;\n // Cache of the last render inputs so we can skip redrawing when nothing\n // changed. Redrawing thousands of dots every frame (60fps) is the main\n // source of low-zoom jitter/stutter.\n private _last: { ox: number; oy: number; zoom: number; w: number; h: number; grid: number; vis: boolean; color: number } | null = null;\n\n constructor(parent: Container, gridSize = 20, visible = true) {\n this._gridSize = gridSize;\n this._visible = visible;\n this.gfx = new Graphics();\n this.gfx.label = 'grid';\n parent.addChildAt(this.gfx, 0);\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.gfx.visible = v;\n }\n\n set gridSize(s: number) {\n this._gridSize = Math.max(5, s);\n }\n\n /** Grid dot color, derived from the active theme's foreground. */\n set dotColor(c: number) {\n this._dotColor = c;\n }\n\n update(viewport: ViewportState, screenW: number, screenH: number): void {\n if (!this._visible) return;\n\n const { x: ox, y: oy, zoom } = viewport;\n\n // Skip the redraw entirely if nothing that affects the grid changed.\n const last = this._last;\n if (\n last &&\n last.ox === ox && last.oy === oy && last.zoom === zoom &&\n last.w === screenW && last.h === screenH &&\n last.grid === this._gridSize && last.vis === this._visible &&\n last.color === this._dotColor\n ) {\n return;\n }\n this._last = { ox, oy, zoom, w: screenW, h: screenH, grid: this._gridSize, vis: this._visible, color: this._dotColor };\n\n const g = this.gfx;\n g.clear();\n\n // Adaptive spacing: multiply the base grid step by a power of two until the\n // on-screen spacing is comfortably large. Without this, low zoom levels\n // (e.g. 25%–45%) produce tens of thousands of dots per frame.\n const MIN_SCREEN_STEP = 12;\n let step = this._gridSize * zoom;\n if (step <= 0) return;\n let mul = 1;\n while (step * mul < MIN_SCREEN_STEP) {\n mul *= 2;\n }\n step *= mul;\n\n // Hard cap on total dot count as a final safety net.\n const MAX_DOTS = 6000;\n const cols = Math.ceil(screenW / step) + 1;\n const rows = Math.ceil(screenH / step) + 1;\n if (cols * rows > MAX_DOTS) return;\n\n const dotRadius = Math.max(0.8, Math.min(1.6, zoom * 0.8));\n const dotColor = this._dotColor;\n const dotAlpha = Math.min(0.6, Math.max(0.2, zoom * 0.4));\n\n const startX = ox % step;\n const startY = oy % step;\n\n g.setFillStyle({ color: dotColor, alpha: dotAlpha });\n for (let x = startX; x < screenW; x += step) {\n for (let y = startY; y < screenH; y += step) {\n g.circle(x, y, dotRadius);\n }\n }\n g.fill();\n }\n\n destroy(): void {\n this.gfx.destroy();\n }\n}\n"],"mappings":";;AAMA,IAAaA,IAAb,MAA0B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GACnDO,IAAW,KAAK,WAChBC,IAAW,KAAK,IAAI,IAAK,KAAK,IAAI,IAAKR,IAAO,EAAG,CAAC,GAElDS,IAASb,IAAKQ,GACdM,IAASb,IAAKO;EAEpB,EAAE,aAAa;GAAE,OAAOG;GAAU,OAAOC;EAAS,CAAC;EACnD,KAAK,IAAIG,IAAIF,GAAQE,IAAIV,GAAS,KAAKG,GACrC,KAAK,IAAIQ,IAAIF,GAAQE,IAAIV,GAAS,KAAKE,GACrC,EAAE,OAAOO,GAAGC,GAAGN,CAAS;EAG5B,EAAE,KAAK;CACT;CAEA,UAAgB;EACd,KAAK,IAAI,QAAQ;CACnB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"MiniMapRenderer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/MiniMapRenderer.ts"],"sourcesContent":["import { Graphics, Container, Application } from 'pixi.js';\nimport type { FlowNode, FlowEdge, ViewportState } from '../types';\nimport { resolveThemeColor } from '../utils/themeColor';\n\n/**\n * Renders a small minimap in a separate canvas element.\n * Shows node positions as colored rectangles and a viewport rectangle.\n */\nexport class MiniMapRenderer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private _visible = true;\n\n // Last-computed world→minimap transform, used to invert minimap clicks\n // back into world coordinates for click-to-navigate.\n private _transform: { scale: number; ox: number; oy: number; wMinX: number; wMinY: number } | null = null;\n\n constructor(canvas: HTMLCanvasElement) {\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d')!;\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.canvas.style.display = v ? 'block' : 'none';\n }\n\n /**\n * Convert a point in minimap *canvas pixel* space (0..canvas.width /\n * 0..canvas.height) into world coordinates. Returns null if the minimap has\n * not been rendered yet (no transform available).\n */\n minimapToWorld(px: number, py: number): { x: number; y: number } | null {\n const t = this._transform;\n if (!t) return null;\n return {\n x: (px - t.ox) / t.scale + t.wMinX,\n y: (py - t.oy) / t.scale + t.wMinY,\n };\n }\n\n /** Canvas backing size, so callers can map CSS pixels → canvas pixels. */\n get size(): { width: number; height: number } {\n return { width: this.canvas.width, height: this.canvas.height };\n }\n\n update(\n nodes: FlowNode[],\n viewport: ViewportState,\n screenW: number,\n screenH: number,\n ): void {\n if (!this._visible || nodes.length === 0) {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n return;\n }\n\n const cw = this.canvas.width;\n const ch = this.canvas.height;\n this.ctx.clearRect(0, 0, cw, ch);\n\n // Current viewport rect in world coords.\n const viewX = -viewport.x / viewport.zoom;\n const viewY = -viewport.y / viewport.zoom;\n const viewW = screenW / viewport.zoom;\n const viewH = screenH / viewport.zoom;\n\n // Compute world bounds of the content.\n let wMinX = Infinity, wMinY = Infinity, wMaxX = -Infinity, wMaxY = -Infinity;\n for (const n of nodes) {\n wMinX = Math.min(wMinX, n.position.x);\n wMinY = Math.min(wMinY, n.position.y);\n wMaxX = Math.max(wMaxX, n.position.x + n.width);\n wMaxY = Math.max(wMaxY, n.position.y + n.height);\n }\n\n const padding = 50;\n wMinX -= padding;\n wMinY -= padding;\n wMaxX += padding;\n wMaxY += padding;\n\n // Include the viewport rect in the fitted bounds so the blue box always\n // stays visible and proportional (instead of overflowing when zoomed out).\n wMinX = Math.min(wMinX, viewX);\n wMinY = Math.min(wMinY, viewY);\n wMaxX = Math.max(wMaxX, viewX + viewW);\n wMaxY = Math.max(wMaxY, viewY + viewH);\n\n const ww = wMaxX - wMinX;\n const wh = wMaxY - wMinY;\n const scale = Math.min(cw / ww, ch / wh);\n const ox = (cw - ww * scale) / 2;\n const oy = (ch - wh * scale) / 2;\n\n // Remember the transform so minimap clicks can be inverted to world space.\n this._transform = { scale, ox, oy, wMinX, wMinY };\n\n // Draw nodes\n for (const n of nodes) {\n const x = ox + (n.position.x - wMinX) * scale;\n const y = oy + (n.position.y - wMinY) * scale;\n const w = n.width * scale;\n const h = n.height * scale;\n\n this.ctx.fillStyle = n.data.fill === 'transparent' ? '#e5e7eb' : resolveThemeColor(n.data.fill, '#e5e7eb');\n this.ctx.fillRect(x, y, Math.max(w, 2), Math.max(h, 2));\n this.ctx.strokeStyle = n.data.stroke === 'transparent' ? '#9ca3af' : resolveThemeColor(n.data.stroke, '#9ca3af');\n this.ctx.lineWidth = 0.5;\n this.ctx.strokeRect(x, y, Math.max(w, 2), Math.max(h, 2));\n }\n\n // Draw viewport rectangle\n const vpX = ox + (viewX - wMinX) * scale;\n const vpY = oy + (viewY - wMinY) * scale;\n const vpW = viewW * scale;\n const vpH = viewH * scale;\n\n this.ctx.fillStyle = 'rgba(59, 130, 246, 0.12)';\n this.ctx.fillRect(vpX, vpY, vpW, vpH);\n this.ctx.strokeStyle = '#3b82f6';\n this.ctx.lineWidth = 1.5;\n this.ctx.strokeRect(vpX, vpY, vpW, vpH);\n }\n\n destroy(): void {\n // Canvas element lifecycle managed by React\n }\n}\n"],"mappings":";;AAQA,IAAa,IAAb,MAA6B;CAC3B;CACA;CACA,WAAmB;CAInB,aAAqG;CAErG,YAAY,GAA2B;EAErC,AADA,KAAK,SAAS,GACd,KAAK,MAAM,EAAO,WAAW,IAAI;CACnC;CAEA,IAAI,QAAQ,GAAY;EAEtB,AADA,KAAK,WAAW,GAChB,KAAK,OAAO,MAAM,UAAU,IAAI,UAAU;CAC5C;CAOA,eAAe,GAAY,GAA6C;EACtE,IAAM,IAAI,KAAK;EAEf,OADK,IACE;GACL,IAAI,IAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;GAC7B,IAAI,IAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;EAC/B,IAJe;CAKjB;CAGA,IAAI,OAA0C;EAC5C,OAAO;GAAE,OAAO,KAAK,OAAO;GAAO,QAAQ,KAAK,OAAO;EAAO;CAChE;CAEA,OACE,GACA,GACA,GACA,GACM;EACN,IAAI,CAAC,KAAK,YAAY,EAAM,WAAW,GAAG;GACxC,KAAK,IAAI,UAAU,GAAG,GAAG,KAAK,OAAO,OAAO,KAAK,OAAO,MAAM;GAC9D;EACF;EAEA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G,KAAK,IAAI,SAAS,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC,GACtD,KAAK,IAAI,cAAc,EAAE,KAAK,WAAW,gBAAgB,YAAY,EAAkB,EAAE,KAAK,QAAQ,SAAS,GAC/G,KAAK,IAAI,YAAY,IACrB,KAAK,IAAI,WAAW,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;EAC1D;EAGA,IAAM,IAAM,KAAM,IAAQ,KAAS,GAC7B,IAAM,KAAM,IAAQ,KAAS,GAC7B,IAAM,IAAQ,GACd,IAAM,IAAQ;EAMpB,AAJA,KAAK,IAAI,YAAY,4BACrB,KAAK,IAAI,SAAS,GAAK,GAAK,GAAK,CAAG,GACpC,KAAK,IAAI,cAAc,WACvB,KAAK,IAAI,YAAY,KACrB,KAAK,IAAI,WAAW,GAAK,GAAK,GAAK,CAAG;CACxC;CAEA,UAAgB,CAEhB;AACF"}
1
+ {"version":3,"file":"MiniMapRenderer.js","names":["MiniMapRenderer","canvas","v","t","px","py","nodes","cw","ch","viewX","viewport","viewY","viewW","screenW","viewH","screenH","wMinX","wMinY","wMaxX","wMaxY","n","ww","wh","scale","ox","oy","x","y","w","h","resolveThemeColor","vpX","vpY","vpW","vpH"],"sources":["../../../../../src/components/pro/Flow/canvas/MiniMapRenderer.ts"],"sourcesContent":["import { Graphics, Container, Application } from 'pixi.js';\nimport type { FlowNode, FlowEdge, ViewportState } from '../types';\nimport { resolveThemeColor } from '../utils/themeColor';\n\n/**\n * Renders a small minimap in a separate canvas element.\n * Shows node positions as colored rectangles and a viewport rectangle.\n */\nexport class MiniMapRenderer {\n private canvas: HTMLCanvasElement;\n private ctx: CanvasRenderingContext2D;\n private _visible = true;\n\n // Last-computed world→minimap transform, used to invert minimap clicks\n // back into world coordinates for click-to-navigate.\n private _transform: { scale: number; ox: number; oy: number; wMinX: number; wMinY: number } | null = null;\n\n constructor(canvas: HTMLCanvasElement) {\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d')!;\n }\n\n set visible(v: boolean) {\n this._visible = v;\n this.canvas.style.display = v ? 'block' : 'none';\n }\n\n /**\n * Convert a point in minimap *canvas pixel* space (0..canvas.width /\n * 0..canvas.height) into world coordinates. Returns null if the minimap has\n * not been rendered yet (no transform available).\n */\n minimapToWorld(px: number, py: number): { x: number; y: number } | null {\n const t = this._transform;\n if (!t) return null;\n return {\n x: (px - t.ox) / t.scale + t.wMinX,\n y: (py - t.oy) / t.scale + t.wMinY,\n };\n }\n\n /** Canvas backing size, so callers can map CSS pixels → canvas pixels. */\n get size(): { width: number; height: number } {\n return { width: this.canvas.width, height: this.canvas.height };\n }\n\n update(\n nodes: FlowNode[],\n viewport: ViewportState,\n screenW: number,\n screenH: number,\n ): void {\n if (!this._visible || nodes.length === 0) {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n return;\n }\n\n const cw = this.canvas.width;\n const ch = this.canvas.height;\n this.ctx.clearRect(0, 0, cw, ch);\n\n // Current viewport rect in world coords.\n const viewX = -viewport.x / viewport.zoom;\n const viewY = -viewport.y / viewport.zoom;\n const viewW = screenW / viewport.zoom;\n const viewH = screenH / viewport.zoom;\n\n // Compute world bounds of the content.\n let wMinX = Infinity, wMinY = Infinity, wMaxX = -Infinity, wMaxY = -Infinity;\n for (const n of nodes) {\n wMinX = Math.min(wMinX, n.position.x);\n wMinY = Math.min(wMinY, n.position.y);\n wMaxX = Math.max(wMaxX, n.position.x + n.width);\n wMaxY = Math.max(wMaxY, n.position.y + n.height);\n }\n\n const padding = 50;\n wMinX -= padding;\n wMinY -= padding;\n wMaxX += padding;\n wMaxY += padding;\n\n // Include the viewport rect in the fitted bounds so the blue box always\n // stays visible and proportional (instead of overflowing when zoomed out).\n wMinX = Math.min(wMinX, viewX);\n wMinY = Math.min(wMinY, viewY);\n wMaxX = Math.max(wMaxX, viewX + viewW);\n wMaxY = Math.max(wMaxY, viewY + viewH);\n\n const ww = wMaxX - wMinX;\n const wh = wMaxY - wMinY;\n const scale = Math.min(cw / ww, ch / wh);\n const ox = (cw - ww * scale) / 2;\n const oy = (ch - wh * scale) / 2;\n\n // Remember the transform so minimap clicks can be inverted to world space.\n this._transform = { scale, ox, oy, wMinX, wMinY };\n\n // Draw nodes\n for (const n of nodes) {\n const x = ox + (n.position.x - wMinX) * scale;\n const y = oy + (n.position.y - wMinY) * scale;\n const w = n.width * scale;\n const h = n.height * scale;\n\n this.ctx.fillStyle = n.data.fill === 'transparent' ? '#e5e7eb' : resolveThemeColor(n.data.fill, '#e5e7eb');\n this.ctx.fillRect(x, y, Math.max(w, 2), Math.max(h, 2));\n this.ctx.strokeStyle = n.data.stroke === 'transparent' ? '#9ca3af' : resolveThemeColor(n.data.stroke, '#9ca3af');\n this.ctx.lineWidth = 0.5;\n this.ctx.strokeRect(x, y, Math.max(w, 2), Math.max(h, 2));\n }\n\n // Draw viewport rectangle\n const vpX = ox + (viewX - wMinX) * scale;\n const vpY = oy + (viewY - wMinY) * scale;\n const vpW = viewW * scale;\n const vpH = viewH * scale;\n\n this.ctx.fillStyle = 'rgba(59, 130, 246, 0.12)';\n this.ctx.fillRect(vpX, vpY, vpW, vpH);\n this.ctx.strokeStyle = '#3b82f6';\n this.ctx.lineWidth = 1.5;\n this.ctx.strokeRect(vpX, vpY, vpW, vpH);\n }\n\n destroy(): void {\n // Canvas element lifecycle managed by React\n }\n}\n"],"mappings":";;AAQA,IAAaA,IAAb,MAA6B;CAC3B;CACA;CACA,WAAmB;CAInB,aAAqG;CAErG,YAAY,GAA2B;EAErC,AADA,KAAK,SAASC,GACd,KAAK,MAAMA,EAAO,WAAW,IAAI;CACnC;CAEA,IAAI,QAAQ,GAAY;EAEtB,AADA,KAAK,WAAWC,GAChB,KAAK,OAAO,MAAM,UAAUA,IAAI,UAAU;CAC5C;CAOA,eAAe,GAAY,GAA6C;EACtE,IAAMC,IAAI,KAAK;EAEf,OADKA,IACE;GACL,IA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M,IAAQ,KAAK,IAAIhB,IAAKc,GAAIb,IAAKc,CAAE,GACjCE,KAAMjB,IAAKc,IAAKE,KAAS,GACzBE,KAAMjB,IAAKc,IAAKC,KAAS;EAG/B,KAAK,aAAa;GAAE;GAAO;GAAI;GAAI;GAAO;EAAM;EAGhD,KAAK,IAAM,KAAKjB,GAAO;GACrB,IAAMoB,IAAIF,KAAM,EAAE,SAAS,IAAIR,KAASO,GAClCI,IAAIF,KAAM,EAAE,SAAS,IAAIR,KAASM,GAClCK,IAAI,EAAE,QAAQL,GACdM,IAAI,EAAE,SAASN;GAMrB,AAJA,KAAK,IAAI,YAAY,EAAE,KAAK,SAAS,gBAAgB,YAAYO,EAAkB,EAAE,KAAK,MAAM,SAAS,GACzG,KAAK,IAAI,SAASJ,GAAGC,GAAG,KAAK,IAAIC,GAAG,CAAC,GAAG,KAAK,IAAIC,GAAG,CAAC,CAAC,GACtD,KAAK,IAAI,cAAc,EAAE,KAAK,WAAW,gBAAgB,YAAYC,EAAkB,EAAE,KAAK,QAAQ,SAAS,GAC/G,KAAK,IAAI,YAAY,IACrB,KAAK,IAAI,WAAWJ,GAAGC,GAAG,KAAK,IAAIC,GAAG,CAAC,GAAG,KAAK,IAAIC,GAAG,CAAC,CAAC;EAC1D;EAGA,IAAME,IAAMP,KAAMf,IAAQO,KAASO,GAC7BS,IAAMP,KAAMd,IAAQM,KAASM,GAC7BU,IAAMrB,IAAQW,GACdW,IAAMpB,IAAQS;EAMpB,AAJA,KAAK,IAAI,YAAY,4BACrB,KAAK,IAAI,SAASQ,GAAKC,GAAKC,GAAKC,CAAG,GACpC,KAAK,IAAI,cAAc,WACvB,KAAK,IAAI,YAAY,KACrB,KAAK,IAAI,WAAWH,GAAKC,GAAKC,GAAKC,CAAG;CACxC;CAEA,UAAgB,CAEhB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PixiApp.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/PixiApp.ts"],"sourcesContent":["import { Application, Container } from 'pixi.js';\n\nexport interface PixiAppOptions {\n canvas: HTMLCanvasElement;\n backgroundColor?: number;\n antialias?: boolean;\n resolution?: number;\n autoDensity?: boolean;\n width?: number;\n height?: number;\n}\n\n/**\n * Wraps PixiJS Application lifecycle: init, resize, destroy.\n * The world container holds all flow content and is transformed for pan/zoom.\n */\nexport class PixiApp {\n app: Application;\n world: Container;\n private _destroyed = false;\n private _initialized = false;\n\n constructor() {\n this.app = new Application();\n this.world = new Container({ label: 'world' });\n }\n\n async init(options: PixiAppOptions): Promise<void> {\n if (this._destroyed) return;\n await this.app.init({\n canvas: options.canvas,\n background: options.backgroundColor ?? 0xf8f9fa,\n antialias: options.antialias ?? true,\n resolution: options.resolution ?? (window.devicePixelRatio || 1),\n autoDensity: options.autoDensity ?? true,\n width: options.width,\n height: options.height,\n });\n if (this._destroyed) return;\n this._initialized = true;\n this.app.stage.addChild(this.world);\n this.app.stage.eventMode = 'static';\n this.app.stage.hitArea = this.app.screen;\n }\n\n resize(width: number, height: number): void {\n if (this._destroyed || !this._initialized) return;\n this.app.renderer.resize(width, height);\n this.app.stage.hitArea = this.app.screen;\n }\n\n /** Update the canvas backdrop color (e.g. when the DishUI theme changes). */\n setBackgroundColor(color: number): void {\n if (this._destroyed || !this._initialized) return;\n this.app.renderer.background.color = color;\n }\n\n /**\n * Export the current scene to a PNG data URL.\n *\n * Reading the WebGL canvas directly with `canvas.toDataURL()` returns a black\n * image because PixiJS does not preserve the drawing buffer between frames.\n * The renderer's `extract` plugin re-renders the target into an offscreen\n * canvas, which is the reliable way to snapshot the scene.\n */\n async exportPNG(backgroundColor?: number): Promise<string | null> {\n if (this._destroyed || !this._initialized) return null;\n const renderer = this.app.renderer as unknown as {\n extract?: {\n canvas: (target: unknown) => HTMLCanvasElement | OffscreenCanvas;\n };\n };\n if (!renderer || !renderer.extract) return null;\n\n // Force a fresh render so the extract reflects the latest state.\n this.app.render();\n\n let out: HTMLCanvasElement | OffscreenCanvas;\n try {\n out = renderer.extract.canvas(this.app.stage);\n } catch {\n return null;\n }\n\n const w = (out as HTMLCanvasElement).width;\n const h = (out as HTMLCanvasElement).height;\n if (!w || !h) return null;\n\n // Composite onto an opaque background so transparent areas aren't black.\n const composite = document.createElement('canvas');\n composite.width = w;\n composite.height = h;\n const ctx = composite.getContext('2d');\n if (!ctx) {\n return typeof (out as HTMLCanvasElement).toDataURL === 'function'\n ? (out as HTMLCanvasElement).toDataURL('image/png')\n : null;\n }\n ctx.fillStyle = backgroundColor !== undefined\n ? `#${backgroundColor.toString(16).padStart(6, '0')}`\n : '#ffffff';\n ctx.fillRect(0, 0, w, h);\n ctx.drawImage(out as CanvasImageSource, 0, 0);\n return composite.toDataURL('image/png');\n }\n\n /**\n * Export a specific world-space rectangle to a PNG data URL, cropped exactly\n * to that rectangle (used for per-anchor slide capture).\n *\n * Uses the extract system's `frame` option to render precisely the given\n * region of the `world` container in world coordinates, independent of the\n * current pan/zoom. This guarantees the output is exactly the anchor's\n * framed content — no screen-space cropping or transform juggling.\n */\n async exportRegionPNG(\n rect: { x: number; y: number; w: number; h: number },\n options?: { scale?: number; backgroundColor?: number },\n ): Promise<{ dataUrl: string; width: number; height: number } | null> {\n if (this._destroyed || !this._initialized) return null;\n const { Rectangle } = await import('pixi.js');\n const renderer = this.app.renderer as unknown as {\n extract?: {\n canvas: (options: unknown) => HTMLCanvasElement | OffscreenCanvas;\n };\n };\n if (!renderer || !renderer.extract) return null;\n\n const scale = Math.max(0.1, options?.scale ?? 2);\n\n // Temporarily reset the world transform to identity so the `frame` (given in\n // world coordinates) maps 1:1 to the anchor content, independent of the\n // current pan/zoom. Restored immediately after extraction.\n const prev = {\n x: this.world.position.x,\n y: this.world.position.y,\n sx: this.world.scale.x,\n sy: this.world.scale.y,\n };\n this.world.position.set(0, 0);\n this.world.scale.set(1, 1);\n\n let out: HTMLCanvasElement | OffscreenCanvas;\n try {\n // Fresh render so the extract reflects the latest scene state.\n this.app.render();\n out = renderer.extract.canvas({\n target: this.world,\n // Frame is in the target's LOCAL (world) coordinates.\n frame: new Rectangle(rect.x, rect.y, rect.w, rect.h),\n resolution: scale,\n antialias: true,\n });\n } catch {\n this.world.position.set(prev.x, prev.y);\n this.world.scale.set(prev.sx, prev.sy);\n this.app.render();\n return null;\n }\n\n // Restore the interactive viewport transform immediately.\n this.world.position.set(prev.x, prev.y);\n this.world.scale.set(prev.sx, prev.sy);\n this.app.render();\n\n const w = (out as HTMLCanvasElement).width;\n const h = (out as HTMLCanvasElement).height;\n if (!w || !h) return null;\n\n // Composite onto an opaque background so transparent areas aren't black.\n const composite = document.createElement('canvas');\n composite.width = w;\n composite.height = h;\n const ctx = composite.getContext('2d');\n if (!ctx) {\n const url = typeof (out as HTMLCanvasElement).toDataURL === 'function'\n ? (out as HTMLCanvasElement).toDataURL('image/png')\n : null;\n return url ? { dataUrl: url, width: w, height: h } : null;\n }\n ctx.fillStyle = options?.backgroundColor !== undefined\n ? `#${options.backgroundColor.toString(16).padStart(6, '0')}`\n : '#ffffff';\n ctx.fillRect(0, 0, w, h);\n ctx.drawImage(out as CanvasImageSource, 0, 0);\n return { dataUrl: composite.toDataURL('image/png'), width: w, height: h };\n }\n\n destroy(): void {\n if (this._destroyed) return;\n this._destroyed = true;\n if (!this._initialized) return;\n // 先销毁舞台子树:此时渲染器的纹理池仍存活,Text.destroy() 才能把\n // 纹理安全归还到池中。若先销毁渲染器,后续 Text.unload 会向已清空的\n // 池归还纹理,触发 \"Cannot read properties of undefined (reading 'push')\"\n // (TexturePool.returnTexture)。随后 React 卸载 FlowCanvas 子树时对\n // 已销毁对象的二次 destroy() 也会因池被清空而崩溃。\n try {\n this.app.stage.destroy({ children: true, texture: true });\n } catch {\n // ignore partial teardown issues\n }\n try {\n this.app.destroy(false);\n } catch {\n // PixiJS may throw if internal state is partially torn down\n }\n }\n\n get destroyed(): boolean {\n return this._destroyed;\n }\n}\n"],"mappings":";;AAgBA,IAAa,IAAb,MAAqB;CACnB;CACA;CACA,aAAqB;CACrB,eAAuB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AAK,IAAI,EAAK,EAAE,GACrC,KAAK,IAAI,OAAO;EAEhB,IAAM,IAAK,EAA0B,OAC/B,IAAK,EAA0B;EACrC,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;EAGrB,IAAM,IAAY,SAAS,cAAc,QAAQ;EAEjD,AADA,EAAU,QAAQ,GAClB,EAAU,SAAS;EACnB,IAAM,IAAM,EAAU,WAAW,IAAI;EACrC,IAAI,CAAC,GAAK;GACR,IAAM,IAAM,OAAQ,EAA0B,aAAc,aACvD,EAA0B,UAAU,WAAW,IAChD;GACJ,OAAO,IAAM;IAAE,SAAS;IAAK,OAAO;IAAG,QAAQ;GAAE,IAAI;EACvD;EAMA,OALA,EAAI,YAAY,GAAS,oBAAoB,KAAA,IAEzC,YADA,IAAI,EAAQ,gBAAgB,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,KAE5D,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GACvB,EAAI,UAAU,GAA0B,GAAG,CAAC,GACrC;GAAE,SAAS,EAAU,UAAU,WAAW;GAAG,OAAO;GAAG,QAAQ;EAAE;CAC1E;CAEA,UAAgB;EACV,UAAK,eACT,KAAK,aAAa,IACb,KAAK,eAMV;OAAI;IACF,KAAK,IAAI,MAAM,QAAQ;KAAE,UAAU;KAAM,SAAS;IAAK,CAAC;GAC1D,QAAQ,CAER;GACA,IAAI;IACF,KAAK,IAAI,QAAQ,EAAK;GACxB,QAAQ,CAER;EALA;CAMF;CAEA,IAAI,YAAqB;EACvB,OAAO,KAAK;CACd;AACF"}
1
+ {"version":3,"file":"PixiApp.js","names":["PixiApp","Application","Container","options","width","height","color","renderer","out","w","h","composite","ctx","backgroundColor","scale","prev","Rectangle","rect","url"],"sources":["../../../../../src/components/pro/Flow/canvas/PixiApp.ts"],"sourcesContent":["import { Application, Container } from 'pixi.js';\n\nexport interface PixiAppOptions {\n canvas: HTMLCanvasElement;\n backgroundColor?: number;\n antialias?: boolean;\n resolution?: number;\n autoDensity?: boolean;\n width?: number;\n height?: number;\n}\n\n/**\n * Wraps PixiJS Application lifecycle: init, resize, destroy.\n * The world container holds all flow content and is transformed for pan/zoom.\n */\nexport class PixiApp {\n app: Application;\n world: Container;\n private _destroyed = false;\n private _initialized = false;\n\n constructor() {\n this.app = new Application();\n this.world = new Container({ label: 'world' });\n }\n\n async init(options: PixiAppOptions): Promise<void> {\n if (this._destroyed) return;\n await this.app.init({\n canvas: options.canvas,\n background: options.backgroundColor ?? 0xf8f9fa,\n antialias: options.antialias ?? true,\n resolution: options.resolution ?? (window.devicePixelRatio || 1),\n autoDensity: options.autoDensity ?? true,\n width: options.width,\n height: options.height,\n });\n if (this._destroyed) return;\n this._initialized = true;\n this.app.stage.addChild(this.world);\n this.app.stage.eventMode = 'static';\n this.app.stage.hitArea = this.app.screen;\n }\n\n resize(width: number, height: number): void {\n if (this._destroyed || !this._initialized) return;\n this.app.renderer.resize(width, height);\n this.app.stage.hitArea = this.app.screen;\n }\n\n /** Update the canvas backdrop color (e.g. when the DishUI theme changes). */\n setBackgroundColor(color: number): void {\n if (this._destroyed || !this._initialized) return;\n this.app.renderer.background.color = color;\n }\n\n /**\n * Export the current scene to a PNG data URL.\n *\n * Reading the WebGL canvas directly with `canvas.toDataURL()` returns a black\n * image because PixiJS does not preserve the drawing buffer between frames.\n * The renderer's `extract` plugin re-renders the target into an offscreen\n * canvas, which is the reliable way to snapshot the scene.\n */\n async exportPNG(backgroundColor?: number): Promise<string | null> {\n if (this._destroyed || !this._initialized) return null;\n const renderer = this.app.renderer as unknown as {\n extract?: {\n canvas: (target: unknown) => HTMLCanvasElement | OffscreenCanvas;\n };\n };\n if (!renderer || !renderer.extract) return null;\n\n // Force a fresh render so the extract reflects the latest state.\n this.app.render();\n\n let out: HTMLCanvasElement | OffscreenCanvas;\n try {\n out = renderer.extract.canvas(this.app.stage);\n } catch {\n return null;\n }\n\n const w = (out as HTMLCanvasElement).width;\n const h = (out as HTMLCanvasElement).height;\n if (!w || !h) return null;\n\n // Composite onto an opaque background so transparent areas aren't black.\n const composite = document.createElement('canvas');\n composite.width = w;\n composite.height = h;\n const ctx = composite.getContext('2d');\n if (!ctx) {\n return typeof (out as HTMLCanvasElement).toDataURL === 'function'\n ? (out as HTMLCanvasElement).toDataURL('image/png')\n : null;\n }\n ctx.fillStyle = backgroundColor !== undefined\n ? `#${backgroundColor.toString(16).padStart(6, '0')}`\n : '#ffffff';\n ctx.fillRect(0, 0, w, h);\n ctx.drawImage(out as CanvasImageSource, 0, 0);\n return composite.toDataURL('image/png');\n }\n\n /**\n * Export a specific world-space rectangle to a PNG data URL, cropped exactly\n * to that rectangle (used for per-anchor slide capture).\n *\n * Uses the extract system's `frame` option to render precisely the given\n * region of the `world` container in world coordinates, independent of the\n * current pan/zoom. This guarantees the output is exactly the anchor's\n * framed content — no screen-space cropping or transform juggling.\n */\n async exportRegionPNG(\n rect: { x: number; y: number; w: number; h: number },\n options?: { scale?: number; backgroundColor?: number },\n ): Promise<{ dataUrl: string; width: number; height: number } | null> {\n if (this._destroyed || !this._initialized) return null;\n const { Rectangle } = await import('pixi.js');\n const renderer = this.app.renderer as unknown as {\n extract?: {\n canvas: (options: unknown) => HTMLCanvasElement | OffscreenCanvas;\n };\n };\n if (!renderer || !renderer.extract) return null;\n\n const scale = Math.max(0.1, options?.scale ?? 2);\n\n // Temporarily reset the world transform to identity so the `frame` (given in\n // world coordinates) maps 1:1 to the anchor content, independent of the\n // current pan/zoom. Restored immediately after extraction.\n const prev = {\n x: this.world.position.x,\n y: this.world.position.y,\n sx: this.world.scale.x,\n sy: this.world.scale.y,\n };\n this.world.position.set(0, 0);\n this.world.scale.set(1, 1);\n\n let out: HTMLCanvasElement | OffscreenCanvas;\n try {\n // Fresh render so the extract reflects the latest scene state.\n this.app.render();\n out = renderer.extract.canvas({\n target: this.world,\n // Frame is in the target's LOCAL (world) coordinates.\n frame: new Rectangle(rect.x, rect.y, rect.w, rect.h),\n resolution: scale,\n antialias: true,\n });\n } catch {\n this.world.position.set(prev.x, prev.y);\n this.world.scale.set(prev.sx, prev.sy);\n this.app.render();\n return null;\n }\n\n // Restore the interactive viewport transform immediately.\n this.world.position.set(prev.x, prev.y);\n this.world.scale.set(prev.sx, prev.sy);\n this.app.render();\n\n const w = (out as HTMLCanvasElement).width;\n const h = (out as HTMLCanvasElement).height;\n if (!w || !h) return null;\n\n // Composite onto an opaque background so transparent areas aren't black.\n const composite = document.createElement('canvas');\n composite.width = w;\n composite.height = h;\n const ctx = composite.getContext('2d');\n if (!ctx) {\n const url = typeof (out as HTMLCanvasElement).toDataURL === 'function'\n ? (out as HTMLCanvasElement).toDataURL('image/png')\n : null;\n return url ? { dataUrl: url, width: w, height: h } : null;\n }\n ctx.fillStyle = options?.backgroundColor !== undefined\n ? `#${options.backgroundColor.toString(16).padStart(6, '0')}`\n : '#ffffff';\n ctx.fillRect(0, 0, w, h);\n ctx.drawImage(out as CanvasImageSource, 0, 0);\n return { dataUrl: composite.toDataURL('image/png'), width: w, height: h };\n }\n\n destroy(): void {\n if (this._destroyed) return;\n this._destroyed = true;\n if (!this._initialized) return;\n // 先销毁舞台子树:此时渲染器的纹理池仍存活,Text.destroy() 才能把\n // 纹理安全归还到池中。若先销毁渲染器,后续 Text.unload 会向已清空的\n // 池归还纹理,触发 \"Cannot read properties of undefined (reading 'push')\"\n // (TexturePool.returnTexture)。随后 React 卸载 FlowCanvas 子树时对\n // 已销毁对象的二次 destroy() 也会因池被清空而崩溃。\n try {\n this.app.stage.destroy({ children: true, texture: true });\n } catch {\n // ignore partial teardown issues\n }\n try {\n this.app.destroy(false);\n } catch {\n // PixiJS may throw if internal state is partially torn down\n }\n }\n\n get destroyed(): boolean {\n return this._destroyed;\n }\n}\n"],"mappings":";;AAgBA,IAAaA,IAAb,MAAqB;CACnB;CACA;CACA,aAAqB;CACrB,eAAuB;CAEvB,cAAc;EAEZ,AADA,KAAK,MAAM,IAAIC,EAAY,GAC3B,KAAK,QAAQ,IAAIC,EAAU,EAAE,OAAO,QAAQ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C,KAAK,IAAI,OAAO;EAEhB,IAAMN,IAAKD,EAA0B,OAC/BE,IAAKF,EAA0B;EACrC,IAAI,CAACC,KAAK,CAACC,GAAG,OAAO;EAGrB,IAAMC,IAAY,SAAS,cAAc,QAAQ;EAEjD,AADA,EAAU,QAAQF,GAClB,EAAU,SAASC;EACnB,IAAME,IAAMD,EAAU,WAAW,IAAI;EACrC,IAAI,CAACC,GAAK;GACR,IAAMM,IAAM,OAAQV,EAA0B,aAAc,aACvDA,EAA0B,UAAU,WAAW,IAChD;GACJ,OAAOU,IAAM;IAAE,SAASA;IAAK,OAAOT;IAAG,QAAQC;GAAE,IAAI;EACvD;EAMA,OALA,EAAI,YAAYP,GAAS,oBAAoB,KAAA,IAEzC,YADA,IAAIA,EAAQ,gBAAgB,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,KAE5DS,EAAI,SAAS,GAAG,GAAGH,GAAGC,CAAC,GACvBE,EAAI,UAAUJ,GAA0B,GAAG,CAAC,GACrC;GAAE,SAASG,EAAU,UAAU,WAAW;GAAG,OAAOF;GAAG,QAAQC;EAAE;CAC1E;CAEA,UAAgB;EACd,IAAI,MAAK,eACT,KAAK,aAAa,IACb,KAAK,eAMV;OAAI;IACF,KAAK,IAAI,MAAM,QAAQ;KAAE,UAAU;KAAM,SAAS;IAAK,CAAC;GAC1D,QAAQ,CAER;GACA,IAAI;IACF,KAAK,IAAI,QAAQ,EAAK;GACxB,QAAQ,CAER;EALA;CAMF;CAEA,IAAI,YAAqB;EACvB,OAAO,KAAK;CACd;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionOverlay.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/SelectionOverlay.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\n\n/**\n * Renders marquee selection rectangle and node selection rings.\n */\nexport class SelectionOverlay {\n private marquee: Graphics;\n private rings: Graphics;\n\n constructor(stage: Container) {\n this.marquee = new Graphics();\n this.marquee.label = 'marquee';\n this.marquee.visible = false;\n stage.addChild(this.marquee);\n\n this.rings = new Graphics();\n this.rings.label = 'selection-rings';\n stage.addChild(this.rings);\n }\n\n showMarquee(x: number, y: number, w: number, h: number): void {\n const m = this.marquee;\n m.clear();\n m.rect(x, y, w, h)\n .fill({ color: 0x3b82f6, alpha: 0.08 })\n .stroke({ color: 0x3b82f6, width: 1, alpha: 0.5 });\n m.visible = true;\n }\n\n hideMarquee(): void {\n this.marquee.visible = false;\n this.marquee.clear();\n }\n\n drawRings(rects: Array<{ x: number; y: number; w: number; h: number }>): void {\n const g = this.rings;\n g.clear();\n for (const r of rects) {\n g.rect(r.x - 2, r.y - 2, r.w + 4, r.h + 4)\n .stroke({ color: 0x3b82f6, width: 1.5 });\n }\n }\n\n clearRings(): void {\n this.rings.clear();\n }\n\n destroy(): void {\n this.marquee.destroy();\n this.rings.destroy();\n }\n}\n"],"mappings":";;AAKA,IAAa,IAAb,MAA8B;CAC5B;CACA;CAEA,YAAY,GAAkB;EAQ5B,AAPA,KAAK,UAAU,IAAI,EAAS,GAC5B,KAAK,QAAQ,QAAQ,WACrB,KAAK,QAAQ,UAAU,IACvB,EAAM,SAAS,KAAK,OAAO,GAE3B,KAAK,QAAQ,IAAI,EAAS,GAC1B,KAAK,MAAM,QAAQ,mBACnB,EAAM,SAAS,KAAK,KAAK;CAC3B;CAEA,YAAY,GAAW,GAAW,GAAW,GAAiB;EAC5D,IAAM,IAAI,KAAK;EAKf,AAJA,EAAE,MAAM,GACR,EAAE,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,CACf,KAAK;GAAE,OAAO;GAAU,OAAO;EAAK,CAAC,CAAC,CACtC,OAAO;GAAE,OAAO;GAAU,OAAO;GAAG,OAAO;EAAI,CAAC,GACnD,EAAE,UAAU;CACd;CAEA,cAAoB;EAElB,AADA,KAAK,QAAQ,UAAU,IACvB,KAAK,QAAQ,MAAM;CACrB;CAEA,UAAU,GAAoE;EAC5E,IAAM,IAAI,KAAK;EACf,EAAE,MAAM;EACR,KAAK,IAAM,KAAK,GACd,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,IAAI,GAAG,EAAE,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CACvC,OAAO;GAAE,OAAO;GAAU,OAAO;EAAI,CAAC;CAE7C;CAEA,aAAmB;EACjB,KAAK,MAAM,MAAM;CACnB;CAEA,UAAgB;EAEd,AADA,KAAK,QAAQ,QAAQ,GACrB,KAAK,MAAM,QAAQ;CACrB;AACF"}
1
+ {"version":3,"file":"SelectionOverlay.js","names":["SelectionOverlay","Graphics","stage","m","x","y","w","h","g","r","rects"],"sources":["../../../../../src/components/pro/Flow/canvas/SelectionOverlay.ts"],"sourcesContent":["import { Graphics, Container } from 'pixi.js';\n\n/**\n * Renders marquee selection rectangle and node selection rings.\n */\nexport class SelectionOverlay {\n private marquee: Graphics;\n private rings: Graphics;\n\n constructor(stage: Container) {\n this.marquee = new Graphics();\n this.marquee.label = 'marquee';\n this.marquee.visible = false;\n stage.addChild(this.marquee);\n\n this.rings = new Graphics();\n this.rings.label = 'selection-rings';\n stage.addChild(this.rings);\n }\n\n showMarquee(x: number, y: number, w: number, h: number): void {\n const m = this.marquee;\n m.clear();\n m.rect(x, y, w, h)\n .fill({ color: 0x3b82f6, alpha: 0.08 })\n .stroke({ color: 0x3b82f6, width: 1, alpha: 0.5 });\n m.visible = true;\n }\n\n hideMarquee(): void {\n this.marquee.visible = false;\n this.marquee.clear();\n }\n\n drawRings(rects: Array<{ x: number; y: number; w: number; h: number }>): void {\n const g = this.rings;\n g.clear();\n for (const r of rects) {\n g.rect(r.x - 2, r.y - 2, r.w + 4, r.h + 4)\n .stroke({ color: 0x3b82f6, width: 1.5 });\n }\n }\n\n clearRings(): void {\n this.rings.clear();\n }\n\n destroy(): void {\n this.marquee.destroy();\n this.rings.destroy();\n }\n}\n"],"mappings":";;AAKA,IAAaA,IAAb,MAA8B;CAC5B;CACA;CAEA,YAAY,GAAkB;EAQ5B,AAPA,KAAK,UAAU,IAAIC,EAAS,GAC5B,KAAK,QAAQ,QAAQ,WACrB,KAAK,QAAQ,UAAU,IACvBC,EAAM,SAAS,KAAK,OAAO,GAE3B,KAAK,QAAQ,IAAID,EAAS,GAC1B,KAAK,MAAM,QAAQ,mBACnBC,EAAM,SAAS,KAAK,KAAK;CAC3B;CAEA,YAAY,GAAW,GAAW,GAAW,GAAiB;EAC5D,IAAMC,IAAI,KAAK;EAKf,AAJAA,EAAE,MAAM,GACRA,EAAE,KAAKC,GAAGC,GAAGC,GAAGC,CAAC,CAAC,CACf,KAAK;GAAE,OAAO;GAAU,OAAO;EAAK,CAAC,CAAC,CACtC,OAAO;GAAE,OAAO;GAAU,OAAO;GAAG,OAAO;EAAI,CAAC,GACnD,EAAE,UAAU;CACd;CAEA,cAAoB;EAElB,AADA,KAAK,QAAQ,UAAU,IACvB,KAAK,QAAQ,MAAM;CACrB;CAEA,UAAU,GAAoE;EAC5E,IAAMC,IAAI,KAAK;EACf,EAAE,MAAM;EACR,KAAK,IAAMC,KAAKC,GACd,EAAE,KAAKD,EAAE,IAAI,GAAGA,EAAE,IAAI,GAAGA,EAAE,IAAI,GAAGA,EAAE,IAAI,CAAC,CAAC,CACvC,OAAO;GAAE,OAAO;GAAU,OAAO;EAAI,CAAC;CAE7C;CAEA,aAAmB;EACjB,KAAK,MAAM,MAAM;CACnB;CAEA,UAAgB;EAEd,AADA,KAAK,QAAQ,QAAQ,GACrB,KAAK,MAAM,QAAQ;CACrB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportContainer.js","names":[],"sources":["../../../../../src/components/pro/Flow/canvas/ViewportContainer.ts"],"sourcesContent":["import { Container, FederatedPointerEvent } from 'pixi.js';\nimport { MIN_ZOOM, MAX_ZOOM } from '../constants';\nimport type { ViewportState } from '../types';\n\nexport type ViewportChangeCallback = (state: ViewportState) => void;\n\n/**\n * Manages pan/zoom on the world container.\n * Listens for wheel (zoom) and middle-click / space+drag (pan).\n */\nexport class ViewportManager {\n private world: Container;\n private stage: Container;\n private _state: ViewportState = { x: 0, y: 0, zoom: 1 };\n private onChange?: ViewportChangeCallback;\n\n private _panning = false;\n private _panStart = { x: 0, y: 0 };\n private _worldStart = { x: 0, y: 0 };\n private _spaceHeld = false;\n /** True while a pan was triggered by the right mouse button. */\n private _rightPanning = false;\n /** Whether the current right-button pan actually moved (used to suppress the context menu). */\n private _rightPanMoved = false;\n /** True while a multi-touch gesture (pinch zoom / two-finger pan) is active.\n * Set by FlowCanvas's native touch handlers; while set, pointer-driven\n * interactions (marquee, node drag, tap-to-place) must be suppressed. */\n multiTouchActive = false;\n\n constructor(world: Container, stage: Container, onChange?: ViewportChangeCallback) {\n this.world = world;\n this.stage = stage;\n this.onChange = onChange;\n this._bindStageEvents();\n this._bindKeyEvents();\n }\n\n get state(): ViewportState {\n return { ...this._state };\n }\n\n setState(s: Partial<ViewportState>): void {\n const nx = s.x !== undefined ? s.x : this._state.x;\n const ny = s.y !== undefined ? s.y : this._state.y;\n const nz = s.zoom !== undefined\n ? Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, s.zoom))\n : this._state.zoom;\n // Skip if nothing actually changed — avoids a needless onChange emit that\n // could feed back into React state and cause viewport jitter.\n if (nx === this._state.x && ny === this._state.y && nz === this._state.zoom) return;\n this._state.x = nx;\n this._state.y = ny;\n this._state.zoom = nz;\n this._applyTransform();\n }\n\n /** Start a pan from an external trigger (e.g. pan tool mode) */\n startPan(sx: number, sy: number): void {\n this._panning = true;\n this._panStart = { x: sx, y: sy };\n this._worldStart = { x: this._state.x, y: this._state.y };\n }\n\n /** Abort any in-progress pan (used when a multi-touch gesture takes over). */\n cancelPan(): void {\n this._panning = false;\n this._rightPanning = false;\n }\n\n /** Smoothly animate to a target state */\n animateTo(target: ViewportState, duration = 300): void {\n const start = { ...this._state };\n const startTime = performance.now();\n const tick = () => {\n const elapsed = performance.now() - startTime;\n const t = Math.min(1, elapsed / duration);\n const ease = t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;\n this._state.x = start.x + (target.x - start.x) * ease;\n this._state.y = start.y + (target.y - start.y) * ease;\n this._state.zoom = start.zoom + (target.zoom - start.zoom) * ease;\n this._applyTransform();\n if (t < 1) requestAnimationFrame(tick);\n };\n requestAnimationFrame(tick);\n }\n\n /** Convert screen coords to world coords */\n screenToWorld(sx: number, sy: number): { x: number; y: number } {\n return {\n x: (sx - this._state.x) / this._state.zoom,\n y: (sy - this._state.y) / this._state.zoom,\n };\n }\n\n /** Convert world coords to screen coords */\n worldToScreen(wx: number, wy: number): { x: number; y: number } {\n return {\n x: wx * this._state.zoom + this._state.x,\n y: wy * this._state.zoom + this._state.y,\n };\n }\n\n private _applyTransform(): void {\n this.world.position.set(this._state.x, this._state.y);\n this.world.scale.set(this._state.zoom);\n this.onChange?.(this.state);\n }\n\n private _bindStageEvents(): void {\n // NOTE: wheel/zoom is handled by a native, non-passive DOM listener in\n // FlowCanvas (see `zoomAt`) so it can call preventDefault() and stop the\n // browser's Ctrl/Cmd+wheel page zoom. Pixi's federated wheel event cannot\n // reliably prevent that native gesture.\n this.stage.on('pointerdown', this._onPointerDown, this);\n this.stage.on('pointermove', this._onPointerMove, this);\n this.stage.on('pointerup', this._onPointerUp, this);\n this.stage.on('pointerupoutside', this._onPointerUp, this);\n }\n\n private _bindKeyEvents(): void {\n this._handleKeyDown = this._handleKeyDown.bind(this);\n this._handleKeyUp = this._handleKeyUp.bind(this);\n window.addEventListener('keydown', this._handleKeyDown);\n window.addEventListener('keyup', this._handleKeyUp);\n }\n\n private _handleKeyDown(e: KeyboardEvent): void {\n if (e.code === 'Space') this._spaceHeld = true;\n }\n\n private _handleKeyUp(e: KeyboardEvent): void {\n if (e.code === 'Space') {\n this._spaceHeld = false;\n this._panning = false;\n }\n }\n\n /**\n * Zoom by a multiplicative factor around a screen-space anchor point.\n * Driven by a native wheel listener so the browser page zoom can be blocked.\n */\n zoomAt(sx: number, sy: number, factor: number): void {\n const oldZoom = this._state.zoom;\n const newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, oldZoom * factor));\n if (newZoom === oldZoom) return;\n this._state.x = sx - (sx - this._state.x) * (newZoom / oldZoom);\n this._state.y = sy - (sy - this._state.y) * (newZoom / oldZoom);\n this._state.zoom = newZoom;\n this._applyTransform();\n }\n\n private _onPointerDown = (e: FederatedPointerEvent): void => {\n if (this.multiTouchActive) return;\n const isMiddle = e.button === 1;\n const isRight = e.button === 2;\n if (isMiddle || isRight || this._spaceHeld) {\n this._panning = true;\n this._rightPanning = isRight;\n this._rightPanMoved = false;\n this._panStart = { x: e.global.x, y: e.global.y };\n this._worldStart = { x: this._state.x, y: this._state.y };\n }\n };\n\n private _onPointerMove = (e: FederatedPointerEvent): void => {\n if (!this._panning || this.multiTouchActive) return;\n const dx = e.global.x - this._panStart.x;\n const dy = e.global.y - this._panStart.y;\n // Mark a right-button pan as \"moved\" once it passes a small threshold so\n // that a plain right-click (no drag) still opens the context menu.\n if (this._rightPanning && (Math.abs(dx) > 3 || Math.abs(dy) > 3)) {\n this._rightPanMoved = true;\n }\n this._state.x = this._worldStart.x + dx;\n this._state.y = this._worldStart.y + dy;\n this._applyTransform();\n };\n\n private _onPointerUp = (): void => {\n this._panning = false;\n this._rightPanning = false;\n };\n\n get isPanning(): boolean {\n return this._panning;\n }\n\n get isSpaceHeld(): boolean {\n return this._spaceHeld;\n }\n\n /**\n * Whether the most recent right-button interaction was a pan drag (moved past\n * the threshold). Consumers use this to suppress the context menu after a\n * right-drag pan. The flag resets on the next pointer down.\n */\n get didRightPan(): boolean {\n return this._rightPanMoved;\n }\n\n destroy(): void {\n window.removeEventListener('keydown', this._handleKeyDown);\n window.removeEventListener('keyup', this._handleKeyUp);\n this.stage.off('pointerdown', this._onPointerDown, this);\n this.stage.off('pointermove', this._onPointerMove, this);\n this.stage.off('pointerup', this._onPointerUp, this);\n this.stage.off('pointerupoutside', this._onPointerUp, this);\n }\n}\n"],"mappings":";;AAUA,IAAa,IAAb,MAA6B;CAC3B;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KAAK,gBAAgB;CACvB;CAEA,qBAAmC;EAEjC,AADA,KAAK,WAAW,IAChB,KAAK,gBAAgB;CACvB;CAEA,IAAI,YAAqB;EACvB,OAAO,KAAK;CACd;CAEA,IAAI,cAAuB;EACzB,OAAO,KAAK;CACd;CAOA,IAAI,cAAuB;EACzB,OAAO,KAAK;CACd;CAEA,UAAgB;EAMd,AALA,OAAO,oBAAoB,WAAW,KAAK,cAAc,GACzD,OAAO,oBAAoB,SAAS,KAAK,YAAY,GACrD,KAAK,MAAM,IAAI,eAAe,KAAK,gBAAgB,IAAI,GACvD,KAAK,MAAM,IAAI,eAAe,KAAK,gBAAgB,IAAI,GACvD,KAAK,MAAM,IAAI,aAAa,KAAK,cAAc,IAAI,GACnD,KAAK,MAAM,IAAI,oBAAoB,KAAK,cAAc,IAAI;CAC5D;AACF"}
1
+ {"version":3,"file":"ViewportContainer.js","names":["ViewportManager","world","stage","onChange","nx","s","ny","nz","MIN_ZOOM","sx","sy","start","startTime","tick","elapsed","t","duration","ease","target","wx","wy","oldZoom","newZoom","factor","isMiddle","isRight","dx","dy"],"sources":["../../../../../src/components/pro/Flow/canvas/ViewportContainer.ts"],"sourcesContent":["import { Container, FederatedPointerEvent } from 'pixi.js';\nimport { MIN_ZOOM, MAX_ZOOM } from '../constants';\nimport type { ViewportState } from '../types';\n\nexport type ViewportChangeCallback = (state: ViewportState) => void;\n\n/**\n * Manages pan/zoom on the world container.\n * Listens for wheel (zoom) and middle-click / space+drag (pan).\n */\nexport class ViewportManager {\n private world: Container;\n private stage: Container;\n private _state: ViewportState = { x: 0, y: 0, zoom: 1 };\n private onChange?: ViewportChangeCallback;\n\n private _panning = false;\n private _panStart = { x: 0, y: 0 };\n private _worldStart = { x: 0, y: 0 };\n private _spaceHeld = false;\n /** True while a pan was triggered by the right mouse button. */\n private _rightPanning = false;\n /** Whether the current right-button pan actually moved (used to suppress the context menu). */\n private _rightPanMoved = false;\n /** True while a multi-touch gesture (pinch zoom / two-finger pan) is active.\n * Set by FlowCanvas's native touch handlers; while set, pointer-driven\n * interactions (marquee, node drag, tap-to-place) must be suppressed. */\n multiTouchActive = false;\n\n constructor(world: Container, stage: Container, onChange?: ViewportChangeCallback) {\n this.world = world;\n this.stage = stage;\n this.onChange = onChange;\n this._bindStageEvents();\n this._bindKeyEvents();\n }\n\n get state(): ViewportState {\n return { ...this._state };\n }\n\n setState(s: Partial<ViewportState>): void {\n const nx = s.x !== undefined ? s.x : this._state.x;\n const ny = s.y !== undefined ? s.y : this._state.y;\n const nz = s.zoom !== undefined\n ? Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, s.zoom))\n : this._state.zoom;\n // Skip if nothing actually changed — avoids a needless onChange emit that\n // could feed back into React state and cause viewport jitter.\n if (nx === this._state.x && ny === this._state.y && nz === this._state.zoom) return;\n this._state.x = nx;\n this._state.y = ny;\n this._state.zoom = nz;\n this._applyTransform();\n }\n\n /** Start a pan from an external trigger (e.g. pan tool mode) */\n startPan(sx: number, sy: number): void {\n this._panning = true;\n this._panStart = { x: sx, y: sy };\n this._worldStart = { x: this._state.x, y: this._state.y };\n }\n\n /** Abort any in-progress pan (used when a multi-touch gesture takes over). */\n cancelPan(): void {\n this._panning = false;\n this._rightPanning = false;\n }\n\n /** Smoothly animate to a target state */\n animateTo(target: ViewportState, duration = 300): void {\n const start = { ...this._state };\n const startTime = performance.now();\n const tick = () => {\n const elapsed = performance.now() - startTime;\n const t = Math.min(1, elapsed / duration);\n const ease = t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;\n this._state.x = start.x + (target.x - start.x) * ease;\n this._state.y = start.y + (target.y - start.y) * ease;\n this._state.zoom = start.zoom + (target.zoom - start.zoom) * ease;\n this._applyTransform();\n if (t < 1) requestAnimationFrame(tick);\n };\n requestAnimationFrame(tick);\n }\n\n /** Convert screen coords to world coords */\n screenToWorld(sx: number, sy: number): { x: number; y: number } {\n return {\n x: (sx - this._state.x) / this._state.zoom,\n y: (sy - this._state.y) / this._state.zoom,\n };\n }\n\n /** Convert world coords to screen coords */\n worldToScreen(wx: number, wy: number): { x: number; y: number } {\n return {\n x: wx * this._state.zoom + this._state.x,\n y: wy * this._state.zoom + this._state.y,\n };\n }\n\n private _applyTransform(): void {\n this.world.position.set(this._state.x, this._state.y);\n this.world.scale.set(this._state.zoom);\n this.onChange?.(this.state);\n }\n\n private _bindStageEvents(): void {\n // NOTE: wheel/zoom is handled by a native, non-passive DOM listener in\n // FlowCanvas (see `zoomAt`) so it can call preventDefault() and stop the\n // browser's Ctrl/Cmd+wheel page zoom. Pixi's federated wheel event cannot\n // reliably prevent that native gesture.\n this.stage.on('pointerdown', this._onPointerDown, this);\n this.stage.on('pointermove', this._onPointerMove, this);\n this.stage.on('pointerup', this._onPointerUp, this);\n this.stage.on('pointerupoutside', this._onPointerUp, this);\n }\n\n private _bindKeyEvents(): void {\n this._handleKeyDown = this._handleKeyDown.bind(this);\n this._handleKeyUp = this._handleKeyUp.bind(this);\n window.addEventListener('keydown', this._handleKeyDown);\n window.addEventListener('keyup', this._handleKeyUp);\n }\n\n private _handleKeyDown(e: KeyboardEvent): void {\n if (e.code === 'Space') this._spaceHeld = true;\n }\n\n private _handleKeyUp(e: KeyboardEvent): void {\n if (e.code === 'Space') {\n this._spaceHeld = false;\n this._panning = false;\n }\n }\n\n /**\n * Zoom by a multiplicative factor around a screen-space anchor point.\n * Driven by a native wheel listener so the browser page zoom can be blocked.\n */\n zoomAt(sx: number, sy: number, factor: number): void {\n const oldZoom = this._state.zoom;\n const newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, oldZoom * factor));\n if (newZoom === oldZoom) return;\n this._state.x = sx - (sx - this._state.x) * (newZoom / oldZoom);\n this._state.y = sy - (sy - this._state.y) * (newZoom / oldZoom);\n this._state.zoom = newZoom;\n this._applyTransform();\n }\n\n private _onPointerDown = (e: FederatedPointerEvent): void => {\n if (this.multiTouchActive) return;\n const isMiddle = e.button === 1;\n const isRight = e.button === 2;\n if (isMiddle || isRight || this._spaceHeld) {\n this._panning = true;\n this._rightPanning = isRight;\n this._rightPanMoved = false;\n this._panStart = { x: e.global.x, y: e.global.y };\n this._worldStart = { x: this._state.x, y: this._state.y };\n }\n };\n\n private _onPointerMove = (e: FederatedPointerEvent): void => {\n if (!this._panning || this.multiTouchActive) return;\n const dx = e.global.x - this._panStart.x;\n const dy = e.global.y - this._panStart.y;\n // Mark a right-button pan as \"moved\" once it passes a small threshold so\n // that a plain right-click (no drag) still opens the context menu.\n if (this._rightPanning && (Math.abs(dx) > 3 || Math.abs(dy) > 3)) {\n this._rightPanMoved = true;\n }\n this._state.x = this._worldStart.x + dx;\n this._state.y = this._worldStart.y + dy;\n this._applyTransform();\n };\n\n private _onPointerUp = (): void => {\n this._panning = false;\n this._rightPanning = false;\n };\n\n get isPanning(): boolean {\n return this._panning;\n }\n\n get isSpaceHeld(): boolean {\n return this._spaceHeld;\n }\n\n /**\n * Whether the most recent right-button interaction was a pan drag (moved past\n * the threshold). Consumers use this to suppress the context menu after a\n * right-drag pan. The flag resets on the next pointer down.\n */\n get didRightPan(): boolean {\n return this._rightPanMoved;\n }\n\n destroy(): void {\n window.removeEventListener('keydown', this._handleKeyDown);\n window.removeEventListener('keyup', this._handleKeyUp);\n this.stage.off('pointerdown', this._onPointerDown, this);\n this.stage.off('pointermove', this._onPointerMove, this);\n this.stage.off('pointerup', this._onPointerUp, this);\n this.stage.off('pointerupoutside', this._onPointerUp, this);\n }\n}\n"],"mappings":";;AAUA,IAAaA,IAAb,MAA6B;CAC3B;CACA;CACA,SAAgC;EAAE,GAAG;EAAG,GAAG;EAAG,MAAM;CAAE;CACtD;CAEA,WAAmB;CACnB,YAAoB;EAAE,GAAG;EAAG,GAAG;CAAE;CACjC,cAAsB;EAAE,GAAG;EAAG,GAAG;CAAE;CACnC,aAAqB;CAErB,gBAAwB;CAExB,iBAAyB;CAIzB,mBAAmB;CAEnB,YAAY,GAAkB,GAAkB,GAAmC;EAKjF,AAJA,KAAK,QAAQC,G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EACzB,OAAO,KAAK;CACd;CAEA,UAAgB;EAMd,AALA,OAAO,oBAAoB,WAAW,KAAK,cAAc,GACzD,OAAO,oBAAoB,SAAS,KAAK,YAAY,GACrD,KAAK,MAAM,IAAI,eAAe,KAAK,gBAAgB,IAAI,GACvD,KAAK,MAAM,IAAI,eAAe,KAAK,gBAAgB,IAAI,GACvD,KAAK,MAAM,IAAI,aAAa,KAAK,cAAc,IAAI,GACnD,KAAK,MAAM,IAAI,oBAAoB,KAAK,cAAc,IAAI;CAC5D;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../../../src/components/pro/Flow/constants.ts"],"sourcesContent":["import type {\n FlowNodeData,\n FlowShapeType,\n FlowEdgeTypeName,\n FlowEdgeMarkerKind,\n FlowEdgeLineStyle,\n FlowEdgeDashDensity,\n FlowBorderStyle,\n GradientDirection,\n FlowDocument,\n FlowEdgeData,\n} from './types';\n\nexport const ROOT_CANVAS_ID = 'root';\n\nexport const DEFAULT_NODE_DATA: FlowNodeData = {\n label: 'Text',\n fill: 'theme:base-100',\n stroke: 'theme:base-300',\n strokeWidth: 1,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const TEXT_NODE_DATA: FlowNodeData = {\n label: 'Label',\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const DEFAULT_EDGE_DATA: FlowEdgeData = {\n strokeColor: 'theme:base-300',\n strokeWidth: 2,\n lineStyle: 'solid',\n markerEnd: 'arrowclosed',\n};\n\nexport const PALETTE_ITEMS: Array<{\n type: FlowShapeType;\n width: number;\n height: number;\n data: FlowNodeData;\n}> = [\n { type: 'shapeRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rectangle' } },\n { type: 'shapeRoundRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rounded' } },\n { type: 'shapeEllipse', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Ellipse' } },\n { type: 'shapeDiamond', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Diamond' } },\n { type: 'shapeDocument', width: 120, height: 80, data: { ...DEFAULT_NODE_DATA, label: 'Document' } },\n { type: 'shapeParallelogram', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Parallelogram' } },\n { type: 'shapeTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Triangle' } },\n { type: 'shapeTrapezoid', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Trapezoid' } },\n { type: 'shapePentagon', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Pentagon' } },\n { type: 'shapeHexagon', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagon' } },\n { type: 'shapeStar', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Star' } },\n { type: 'shapeHexagram', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagram' } },\n { type: 'shapeRightTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Right Triangle' } },\n { type: 'shapeCorner', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Corner' } },\n { type: 'textLabel', width: 120, height: 40, data: { ...TEXT_NODE_DATA, label: 'Label' } },\n { type: 'animAnchor', width: 320, height: 240, data: { ...DEFAULT_NODE_DATA, label: 'Anchor', fill: 'transparent', stroke: '#8b5cf6', strokeWidth: 1.5, borderStyle: 'dashed' } },\n { type: 'flowGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Group', fill: '#f0f9ff', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dotted', isGroup: true } },\n { type: 'geometryGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Geo Group', fill: '#fefce8', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dashed', isGroup: true } },\n];\n\nexport const EDGE_TYPE_OPTIONS: FlowEdgeTypeName[] = [\n 'smoothstep',\n 'step',\n 'straight',\n 'simplebezier',\n];\n\nexport const EDGE_MARKER_OPTIONS: FlowEdgeMarkerKind[] = [\n 'none',\n 'arrow',\n 'arrowclosed',\n];\n\nexport const EDGE_LINE_STYLE_OPTIONS: FlowEdgeLineStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const BORDER_STYLE_OPTIONS: FlowBorderStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const DASH_DENSITY_OPTIONS: FlowEdgeDashDensity[] = [\n 'sparse',\n 'medium',\n 'dense',\n];\n\nexport const GRADIENT_DIRECTION_OPTIONS: Array<{\n value: GradientDirection;\n label: string;\n}> = [\n { value: 'to-r', label: 'Left → Right' },\n { value: 'to-l', label: 'Right → Left' },\n { value: 'to-b', label: 'Top → Bottom' },\n { value: 'to-t', label: 'Bottom → Top' },\n { value: 'to-br', label: 'Top-Left → Bottom-Right' },\n { value: 'to-tl', label: 'Bottom-Right → Top-Left' },\n { value: 'to-tr', label: 'Bottom-Left → Top-Right' },\n { value: 'to-bl', label: 'Top-Right → Bottom-Left' },\n];\n\nexport const MIN_ZOOM = 0.1;\nexport const MAX_ZOOM = 4;\nexport const DEFAULT_GRID_SIZE = 20;\nexport const ZOOM_SENSITIVITY = 0.001;\nexport const SNAP_THRESHOLD = 5;\nexport const HANDLE_SIZE = 8;\n\nexport function createEmptyDocument(): FlowDocument {\n return {\n canvases: { [ROOT_CANVAS_ID]: { nodes: [], edges: [], lines: [] } },\n stack: [ROOT_CANVAS_ID],\n };\n}\n"],"mappings":";AAaA,IAAa,IAAiB,QAEjB,IAAkC;CAC7C,OAAO;CACP,MAAM;CACN,QAAQ;CACR,aAAa;CACb,OAAO;CACP,UAAU;CACV,YAAY,CAAC;AACf,GAEa,IAA+B;CAC1C,OAAO;CACP,MAAM;CACN,QAAQ;CACR,aAAa;CACb,OAAO;CACP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AACrD,GAEa,IAAW;AAOxB,SAAgB,IAAoC;CAClD,OAAO;EACL,UAAU,GAAG,IAAiB;GAAE,OAAO,CAAC;GAAG,OAAO,CAAC;GAAG,OAAO,CAAC;EAAE,EAAE;EAClE,OAAO,CAAC,CAAc;CACxB;AACF"}
1
+ {"version":3,"file":"constants.js","names":["ROOT_CANVAS_ID","DEFAULT_NODE_DATA","TEXT_NODE_DATA","DEFAULT_EDGE_DATA","PALETTE_ITEMS","EDGE_TYPE_OPTIONS","EDGE_MARKER_OPTIONS","EDGE_LINE_STYLE_OPTIONS","BORDER_STYLE_OPTIONS","DASH_DENSITY_OPTIONS","GRADIENT_DIRECTION_OPTIONS","MIN_ZOOM","createEmptyDocument"],"sources":["../../../../src/components/pro/Flow/constants.ts"],"sourcesContent":["import type {\n FlowNodeData,\n FlowShapeType,\n FlowEdgeTypeName,\n FlowEdgeMarkerKind,\n FlowEdgeLineStyle,\n FlowEdgeDashDensity,\n FlowBorderStyle,\n GradientDirection,\n FlowDocument,\n FlowEdgeData,\n} from './types';\n\nexport const ROOT_CANVAS_ID = 'root';\n\nexport const DEFAULT_NODE_DATA: FlowNodeData = {\n label: 'Text',\n fill: 'theme:base-100',\n stroke: 'theme:base-300',\n strokeWidth: 1,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const TEXT_NODE_DATA: FlowNodeData = {\n label: 'Label',\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const DEFAULT_EDGE_DATA: FlowEdgeData = {\n strokeColor: 'theme:base-300',\n strokeWidth: 2,\n lineStyle: 'solid',\n markerEnd: 'arrowclosed',\n};\n\nexport const PALETTE_ITEMS: Array<{\n type: FlowShapeType;\n width: number;\n height: number;\n data: FlowNodeData;\n}> = [\n { type: 'shapeRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rectangle' } },\n { type: 'shapeRoundRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rounded' } },\n { type: 'shapeEllipse', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Ellipse' } },\n { type: 'shapeDiamond', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Diamond' } },\n { type: 'shapeDocument', width: 120, height: 80, data: { ...DEFAULT_NODE_DATA, label: 'Document' } },\n { type: 'shapeParallelogram', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Parallelogram' } },\n { type: 'shapeTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Triangle' } },\n { type: 'shapeTrapezoid', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Trapezoid' } },\n { type: 'shapePentagon', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Pentagon' } },\n { type: 'shapeHexagon', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagon' } },\n { type: 'shapeStar', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Star' } },\n { type: 'shapeHexagram', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagram' } },\n { type: 'shapeRightTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Right Triangle' } },\n { type: 'shapeCorner', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Corner' } },\n { type: 'textLabel', width: 120, height: 40, data: { ...TEXT_NODE_DATA, label: 'Label' } },\n { type: 'animAnchor', width: 320, height: 240, data: { ...DEFAULT_NODE_DATA, label: 'Anchor', fill: 'transparent', stroke: '#8b5cf6', strokeWidth: 1.5, borderStyle: 'dashed' } },\n { type: 'flowGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Group', fill: '#f0f9ff', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dotted', isGroup: true } },\n { type: 'geometryGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Geo Group', fill: '#fefce8', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dashed', isGroup: true } },\n];\n\nexport const EDGE_TYPE_OPTIONS: FlowEdgeTypeName[] = [\n 'smoothstep',\n 'step',\n 'straight',\n 'simplebezier',\n];\n\nexport const EDGE_MARKER_OPTIONS: FlowEdgeMarkerKind[] = [\n 'none',\n 'arrow',\n 'arrowclosed',\n];\n\nexport const EDGE_LINE_STYLE_OPTIONS: FlowEdgeLineStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const BORDER_STYLE_OPTIONS: FlowBorderStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const DASH_DENSITY_OPTIONS: FlowEdgeDashDensity[] = [\n 'sparse',\n 'medium',\n 'dense',\n];\n\nexport const GRADIENT_DIRECTION_OPTIONS: Array<{\n value: GradientDirection;\n label: string;\n}> = [\n { value: 'to-r', label: 'Left → Right' },\n { value: 'to-l', label: 'Right → Left' },\n { value: 'to-b', label: 'Top → Bottom' },\n { value: 'to-t', label: 'Bottom → Top' },\n { value: 'to-br', label: 'Top-Left → Bottom-Right' },\n { value: 'to-tl', label: 'Bottom-Right → Top-Left' },\n { value: 'to-tr', label: 'Bottom-Left → Top-Right' },\n { value: 'to-bl', label: 'Top-Right → Bottom-Left' },\n];\n\nexport const MIN_ZOOM = 0.1;\nexport const MAX_ZOOM = 4;\nexport const DEFAULT_GRID_SIZE = 20;\nexport const ZOOM_SENSITIVITY = 0.001;\nexport const SNAP_THRESHOLD = 5;\nexport const HANDLE_SIZE = 8;\n\nexport function createEmptyDocument(): FlowDocument {\n return {\n canvases: { [ROOT_CANVAS_ID]: { nodes: [], edges: [], lines: [] } },\n stack: [ROOT_CANVAS_ID],\n };\n}\n"],"mappings":";AAaA,IAAaA,IAAiB,QAEjBC,IAAkC;CAC7C,OAAO;CACP,MAAM;CACN,QAAQ;CACR,aAAa;CACb,OAAO;CACP,UAAU;CACV,YAAY,CAAC;AACf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