dishui 0.0.65 → 0.0.66
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.
- package/dist/_virtual/_rolldown/runtime.js +10 -11
- package/dist/chart.js +12 -46
- package/dist/code-editor.js +16 -43
- package/dist/components/Badge/index.js +10 -15
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js +62 -89
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.d.ts +76 -0
- package/dist/components/Card/index.js +178 -69
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js +25 -25
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js +57 -65
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.d.ts +44 -0
- package/dist/components/ChoicePicker/index.js +81 -0
- package/dist/components/ChoicePicker/index.js.map +1 -0
- package/dist/components/Column/index.d.ts +28 -0
- package/dist/components/Column/index.js +30 -0
- package/dist/components/Column/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +44 -0
- package/dist/components/DateTimeInput/index.js +48 -0
- package/dist/components/DateTimeInput/index.js.map +1 -0
- package/dist/components/Demo/index.js +107 -107
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Divider/index.d.ts +20 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmptyState/index.js +24 -24
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js +134 -136
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js +159 -163
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js +126 -127
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js +62 -62
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/FloatWindow/index.d.ts +28 -0
- package/dist/components/GridLayout/index.d.ts +42 -0
- package/dist/components/Icon/index.d.ts +24 -0
- package/dist/components/Icon/index.js +26 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Image/index.d.ts +33 -0
- package/dist/components/Image/index.js +44 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Input/index.js +196 -197
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js +62 -74
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js +134 -139
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/List/index.js +45 -58
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +106 -107
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js +24 -33
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js +203 -208
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js +46 -46
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js +41 -42
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/index.js +82 -82
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.d.ts +44 -0
- package/dist/components/MultipleChoice/index.js +52 -0
- package/dist/components/MultipleChoice/index.js.map +1 -0
- package/dist/components/Notification/index.d.ts +17 -0
- package/dist/components/Page/index.js +40 -71
- package/dist/components/Page/index.js.map +1 -1
- package/dist/components/PageHeader/index.js +28 -28
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js +8 -9
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +28 -0
- package/dist/components/Row/index.js +30 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Select/index.js +251 -254
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js +56 -59
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Slider/index.d.ts +39 -0
- package/dist/components/Slider/index.js +52 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +29 -1
- package/dist/components/StatCard/index.js +189 -86
- package/dist/components/StatCard/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +34 -0
- package/dist/components/Switch/index.js +55 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Table/index.js +109 -121
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.js +28 -38
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +43 -0
- package/dist/components/Text/index.js +55 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +23 -0
- package/dist/components/Tooltip/index.js +34 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +205 -205
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js +86 -87
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
- package/dist/components/pro/Calendar/index.d.ts +7 -0
- package/dist/components/pro/Calendar/types.d.ts +151 -0
- package/dist/components/pro/Calendar/utils.d.ts +94 -0
- package/dist/components/pro/Chat/Chat.d.ts +6 -0
- package/dist/components/pro/Chat/index.d.ts +2 -0
- package/dist/components/pro/Chat/types.d.ts +84 -0
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -327
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -224
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js +7 -15
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js +4 -40
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +513 -483
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/CodeEditor/utils.js +171 -175
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js +305 -306
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js +299 -314
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js +203 -204
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js +142 -144
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js +93 -94
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js +5 -5
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js +84 -92
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js +93 -93
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js +45 -62
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js +156 -168
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js +189 -189
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js +100 -100
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js +209 -209
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +920 -948
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1626 -1662
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js +85 -94
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +512 -519
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js +87 -104
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js +34 -37
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js +7 -7
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +266 -278
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js +60 -61
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -180
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -242
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js +556 -589
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -248
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js +137 -140
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +557 -572
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js +26 -26
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js +55 -55
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js +185 -195
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
- package/dist/components/pro/Gantt/index.d.ts +6 -0
- package/dist/components/pro/Gantt/types.d.ts +478 -0
- package/dist/components/pro/Gantt/utils.d.ts +124 -0
- package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
- package/dist/components/pro/Resizable/index.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.js +75 -75
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +216 -221
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/data-table.js +15 -41
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/flow.js +27 -83
- package/dist/hooks/useClickOutside.js +18 -18
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js +9 -9
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js +33 -35
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js +16 -16
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js +14 -14
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js +50 -50
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js +39 -41
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js +67 -68
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +8 -0
- package/dist/index.d.ts +27 -1
- package/dist/index.js +105 -241
- package/dist/layouts/MainLayout.js +56 -56
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js +214 -214
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js +184 -186
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js +25 -25
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js +120 -120
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js +26 -26
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/lite.js +9 -24
- package/dist/markdown.js +4 -9
- package/dist/pages/components/Calendar/index.d.ts +3 -0
- package/dist/pages/components/Calendar/index.en.d.ts +3 -0
- package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
- package/dist/pages/components/Chat/index.d.ts +3 -0
- package/dist/pages/components/Chat/index.en.d.ts +3 -0
- package/dist/pages/components/Chat/index.zh.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
- package/dist/pages/components/Gantt/index.d.ts +3 -0
- package/dist/pages/components/Gantt/index.en.d.ts +3 -0
- package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
- package/dist/pages/components/Notification/index.d.ts +3 -0
- package/dist/pages/components/Notification/index.en.d.ts +3 -0
- package/dist/pages/components/Notification/index.zh.d.ts +3 -0
- package/dist/pages/components/Resizable/index.d.ts +3 -0
- package/dist/pages/components/Resizable/index.en.d.ts +3 -0
- package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
- package/dist/pages/components/Tab/index.d.ts +3 -0
- package/dist/pages/components/Tab/index.en.d.ts +3 -0
- package/dist/pages/components/Tab/index.zh.d.ts +3 -0
- package/dist/styles/themeStyles.js +87 -86
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/cn.js +16 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/i18n.js +690 -602
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +94 -94
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js +14 -14
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js +9 -9
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js +59 -60
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/selection.js +28 -29
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js +275 -255
- package/dist/utils/themes.js.map +1 -1
- package/package.json +19 -6
|
@@ -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\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 const stageX = (i: number) => DF.leftX + i * DF.colGap;\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;AAC3C,SAAO,EAAK,MAAM,cAAc;AAClC;AAMA,IAAM,IAAY;AAAA,EAAE,QAAQ,CAAC,IAAI,EAAE;AAAA,EAAG,MAAM;AAAA,EAAG,MAAM;AAAA,EAAI,MAAM;AAAA,EAAI,OAAO;AAAA,EAAK,OAAO;AAAG;AAEzF,SAAS,EAAoB,GAA6C;AACxE,QAAM,IAAQ,EAAQ,CAAI,GACpB,IAAO;AAAA,IAAE,GAAG;AAAA,IAAW,GAAI,EAAK,UAAU,CAAC;AAAA,EAAG,G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A,IAC7B,KAAK;AACH,aAAO,EAAiB,CAAI;AAAA,IAC9B;AACE,aAAO,EAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAA,EAC1B;AACF"}
|
|
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\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 const stageX = (i: number) => DF.leftX + i * DF.colGap;\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 convertLif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-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
//#region src/components/pro/Flow/archify/palette.ts
|
|
2
|
+
var e = "#020617", t = "#1e293b", n = "#94a3b8", r = "#64748b", i = "#334155", a = "#64748b", o = "#34d399", s = "#fb7185", c = {
|
|
3
|
+
frontend: {
|
|
4
|
+
fill: "#07222c",
|
|
5
|
+
stroke: "#22d3ee",
|
|
6
|
+
text: "#e6feff",
|
|
7
|
+
sub: "#7bc6d4"
|
|
8
|
+
},
|
|
9
|
+
backend: {
|
|
10
|
+
fill: "#052e26",
|
|
11
|
+
stroke: "#34d399",
|
|
12
|
+
text: "#e7fff5",
|
|
13
|
+
sub: "#79c9ad"
|
|
14
|
+
},
|
|
15
|
+
database: {
|
|
16
|
+
fill: "#1e123a",
|
|
17
|
+
stroke: "#a78bfa",
|
|
18
|
+
text: "#f1ecff",
|
|
19
|
+
sub: "#b4a0e6"
|
|
20
|
+
},
|
|
21
|
+
cloud: {
|
|
22
|
+
fill: "#2a1c0a",
|
|
23
|
+
stroke: "#fbbf24",
|
|
24
|
+
text: "#fff6e2",
|
|
25
|
+
sub: "#d9b878"
|
|
26
|
+
},
|
|
27
|
+
security: {
|
|
28
|
+
fill: "#320d21",
|
|
29
|
+
stroke: "#fb7185",
|
|
30
|
+
text: "#ffe9ef",
|
|
31
|
+
sub: "#e59aab"
|
|
32
|
+
},
|
|
33
|
+
messagebus: {
|
|
34
|
+
fill: "#2a1a0c",
|
|
35
|
+
stroke: "#fb923c",
|
|
36
|
+
text: "#fff1e3",
|
|
37
|
+
sub: "#dcab7f"
|
|
38
|
+
},
|
|
39
|
+
external: {
|
|
40
|
+
fill: "#111a2b",
|
|
41
|
+
stroke: "#94a3b8",
|
|
42
|
+
text: "#eef2f8",
|
|
43
|
+
sub: "#9aa8bd"
|
|
44
|
+
}
|
|
44
45
|
}, l = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
start: c.frontend,
|
|
47
|
+
active: c.backend,
|
|
48
|
+
waiting: c.cloud,
|
|
49
|
+
decision: c.security,
|
|
50
|
+
success: c.database,
|
|
51
|
+
failure: c.security,
|
|
52
|
+
neutral: c.external,
|
|
53
|
+
external: c.external
|
|
53
54
|
};
|
|
54
|
-
function
|
|
55
|
-
|
|
55
|
+
function u(e) {
|
|
56
|
+
return c[e] ?? c.external;
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
58
|
+
function d(e) {
|
|
59
|
+
return l[e] ?? l.neutral;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
width: r,
|
|
84
|
-
lineStyle: "solid"
|
|
85
|
-
};
|
|
86
|
-
}
|
|
61
|
+
function f(e, t = 1.75) {
|
|
62
|
+
switch (e) {
|
|
63
|
+
case "emphasis": return {
|
|
64
|
+
color: o,
|
|
65
|
+
width: t + .75,
|
|
66
|
+
lineStyle: "solid"
|
|
67
|
+
};
|
|
68
|
+
case "security": return {
|
|
69
|
+
color: s,
|
|
70
|
+
width: t,
|
|
71
|
+
lineStyle: "dashed"
|
|
72
|
+
};
|
|
73
|
+
case "dashed": return {
|
|
74
|
+
color: a,
|
|
75
|
+
width: t,
|
|
76
|
+
lineStyle: "dashed"
|
|
77
|
+
};
|
|
78
|
+
default: return {
|
|
79
|
+
color: a,
|
|
80
|
+
width: t,
|
|
81
|
+
lineStyle: "solid"
|
|
82
|
+
};
|
|
83
|
+
}
|
|
87
84
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
function p(e) {
|
|
86
|
+
return e === "return" ? {
|
|
87
|
+
color: r,
|
|
88
|
+
width: 1.5,
|
|
89
|
+
lineStyle: "dashed"
|
|
90
|
+
} : f(e);
|
|
94
91
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
s as ARCHIFY_ARROW_EMPHASIS,
|
|
98
|
-
n as ARCHIFY_ARROW_SECURITY,
|
|
99
|
-
d as ARCHIFY_BG,
|
|
100
|
-
i as ARCHIFY_GRID,
|
|
101
|
-
o as ARCHIFY_LANE_STROKE,
|
|
102
|
-
f as ARCHIFY_TEXT_DIM,
|
|
103
|
-
u as ARCHIFY_TEXT_MUTED,
|
|
104
|
-
e as COMPONENT_STYLES,
|
|
105
|
-
l as STATE_STYLES,
|
|
106
|
-
b as componentStyle,
|
|
107
|
-
R as messageEdgeStyle,
|
|
108
|
-
S as stateStyle,
|
|
109
|
-
c as variantEdgeStyle
|
|
110
|
-
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { a as ARCHIFY_ARROW, o as ARCHIFY_ARROW_EMPHASIS, s as ARCHIFY_ARROW_SECURITY, e as ARCHIFY_BG, t as ARCHIFY_GRID, i as ARCHIFY_LANE_STROKE, r as ARCHIFY_TEXT_DIM, n as ARCHIFY_TEXT_MUTED, c as COMPONENT_STYLES, l as STATE_STYLES, u as componentStyle, p as messageEdgeStyle, d as stateStyle, f as variantEdgeStyle };
|
|
111
94
|
|
|
112
95
|
//# sourceMappingURL=palette.js.map
|
|
@@ -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;
|
|
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,IAAy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O;EAAK,WAAW;CAAS,IAE7D,EAAiB,CAAqC;AAC/D"}
|
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
import { COMPONENT_STYLES as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { COMPONENT_STYLES as e } from "./palette.js";
|
|
2
|
+
//#region src/components/pro/Flow/archify/presets.ts
|
|
3
|
+
var t = [
|
|
4
|
+
"frontend",
|
|
5
|
+
"backend",
|
|
6
|
+
"database",
|
|
7
|
+
"cloud",
|
|
8
|
+
"security",
|
|
9
|
+
"messagebus",
|
|
10
|
+
"external"
|
|
10
11
|
], n = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
frontend: "Frontend",
|
|
13
|
+
backend: "Backend",
|
|
14
|
+
database: "Database",
|
|
15
|
+
cloud: "Cloud",
|
|
16
|
+
security: "Security",
|
|
17
|
+
messagebus: "Message bus",
|
|
18
|
+
external: "External"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
function r(t) {
|
|
21
|
+
let n = e[t];
|
|
22
|
+
return {
|
|
23
|
+
fill: n.fill,
|
|
24
|
+
stroke: n.stroke,
|
|
25
|
+
color: n.text,
|
|
26
|
+
labelColor: n.text,
|
|
27
|
+
sublabelColor: n.sub,
|
|
28
|
+
strokeWidth: 1.75,
|
|
29
|
+
borderStyle: "solid"
|
|
30
|
+
};
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
function i(n) {
|
|
33
|
+
let r = (n.stroke ?? "").toLowerCase();
|
|
34
|
+
for (let n of t) if (e[n].stroke.toLowerCase() === r) return n;
|
|
35
|
+
return "external";
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
s as ARCHIFY_COMPONENT_ORDER,
|
|
39
|
-
l as archifyStylePatch,
|
|
40
|
-
c as inferComponentType
|
|
41
|
-
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { n as ARCHIFY_COMPONENT_LABELS, t as ARCHIFY_COMPONENT_ORDER, r as archifyStylePatch, i as inferComponentType };
|
|
42
39
|
|
|
43
40
|
//# sourceMappingURL=presets.js.map
|
|
@@ -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":"
|
|
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,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/components/pro/Flow/archify/spec.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e || typeof e != "object") return !1;
|
|
4
|
+
let t = e, n = t.diagram_type;
|
|
5
|
+
return t.schema_version === 1 && (n === "architecture" || n === "workflow" || n === "sequence" || n === "dataflow" || n === "lifecycle");
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as isArchifySpec };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=spec.js.map
|
|
@@ -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;
|
|
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"}
|