@tldiagram/core-ui 1.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/App.d.ts +1 -0
  2. package/dist/api/client.d.ts +143 -0
  3. package/dist/api/transport-vscode.d.ts +8 -0
  4. package/dist/api/transport.d.ts +1 -0
  5. package/dist/components/CodePreviewPanel-vscode.d.ts +7 -0
  6. package/dist/components/CodePreviewPanel.d.ts +9 -0
  7. package/dist/components/ConfirmDialog.d.ts +12 -0
  8. package/dist/components/ConnectorPanel.d.ts +21 -0
  9. package/dist/components/ContextBoundaryElement.d.ts +11 -0
  10. package/dist/components/ContextNeighborElement.d.ts +29 -0
  11. package/dist/components/ContextStraightConnector.d.ts +4 -0
  12. package/dist/components/CrossBranchControls.d.ts +9 -0
  13. package/dist/components/DependenciesOnboarding.d.ts +5 -0
  14. package/dist/components/DrawingCanvas.d.ts +39 -0
  15. package/dist/components/ElementLibrary-vscode.d.ts +7 -0
  16. package/dist/components/ElementLibrary.d.ts +22 -0
  17. package/dist/components/ElementNode.d.ts +36 -0
  18. package/dist/components/ElementPanel.d.ts +25 -0
  19. package/dist/components/ExploreOnboarding.d.ts +5 -0
  20. package/dist/components/ExplorePageOnboarding.d.ts +5 -0
  21. package/dist/components/ExportModal.d.ts +16 -0
  22. package/dist/components/FloatingEdge.d.ts +9 -0
  23. package/dist/components/GitSourceLinker.d.ts +8 -0
  24. package/dist/components/HeaderContext.d.ts +16 -0
  25. package/dist/components/Icons.d.ts +95 -0
  26. package/dist/components/ImportModal.d.ts +10 -0
  27. package/dist/components/InlineElementAdder.d.ts +17 -0
  28. package/dist/components/LayoutSection.d.ts +7 -0
  29. package/dist/components/LocalSourceLinker.d.ts +8 -0
  30. package/dist/components/MiniZoomOnboarding.d.ts +5 -0
  31. package/dist/components/NavBreadcrumb.d.ts +6 -0
  32. package/dist/components/NodeBody.d.ts +12 -0
  33. package/dist/components/NodeContainer.d.ts +8 -0
  34. package/dist/components/NodeHoverCard.d.ts +10 -0
  35. package/dist/components/PanelHeader.d.ts +8 -0
  36. package/dist/components/PanelUI.d.ts +3 -0
  37. package/dist/components/ProxyConnectorEdge.d.ts +4 -0
  38. package/dist/components/ProxyConnectorPanel.d.ts +9 -0
  39. package/dist/components/SafeBackground.d.ts +13 -0
  40. package/dist/components/ScrollIndicatorWrapper.d.ts +8 -0
  41. package/dist/components/SetChildModal.d.ts +10 -0
  42. package/dist/components/SetParentModal.d.ts +10 -0
  43. package/dist/components/SlidingPanel.d.ts +16 -0
  44. package/dist/components/TagUpsert.d.ts +8 -0
  45. package/dist/components/TopMenuBar.d.ts +8 -0
  46. package/dist/components/ViewBezierConnector.d.ts +4 -0
  47. package/dist/components/ViewDrawMenu.d.ts +22 -0
  48. package/dist/components/ViewEditorEdgeLabelLayout.d.ts +16 -0
  49. package/dist/components/ViewEditorOnboarding.d.ts +5 -0
  50. package/dist/components/ViewExplorer/TagManager/ColorPicker.d.ts +7 -0
  51. package/dist/components/ViewExplorer/TagManager/GroupNamingPopover.d.ts +10 -0
  52. package/dist/components/ViewExplorer/TagManager/LayerItem.d.ts +27 -0
  53. package/dist/components/ViewExplorer/TagManager/TagItem.d.ts +25 -0
  54. package/dist/components/ViewExplorer/TagManager/index.d.ts +21 -0
  55. package/dist/components/ViewExplorer/ViewNavigator.d.ts +11 -0
  56. package/dist/components/ViewExplorer/ViewSearch.d.ts +8 -0
  57. package/dist/components/ViewExplorer/ViewTree.d.ts +18 -0
  58. package/dist/components/ViewExplorer/index.d.ts +31 -0
  59. package/dist/components/ViewExplorer/types.d.ts +11 -0
  60. package/dist/components/ViewExplorer/utils.d.ts +6 -0
  61. package/dist/components/ViewExplorer-vscode.d.ts +6 -0
  62. package/dist/components/ViewFloatingMenu-vscode.d.ts +27 -0
  63. package/dist/components/ViewFloatingMenu.d.ts +39 -0
  64. package/dist/components/ViewGridNode.d.ts +29 -0
  65. package/dist/components/ViewHeaderButton.d.ts +11 -0
  66. package/dist/components/ViewPanel.d.ts +18 -0
  67. package/dist/components/ViewsGridOnboarding.d.ts +5 -0
  68. package/dist/components/ZUI/ZUICanvas.d.ts +18 -0
  69. package/dist/components/ZUI/index.d.ts +2 -0
  70. package/dist/components/ZUI/layout.d.ts +18 -0
  71. package/dist/components/ZUI/proxy.d.ts +25 -0
  72. package/dist/components/ZUI/renderer.d.ts +30 -0
  73. package/dist/components/ZUI/types.d.ts +140 -0
  74. package/dist/components/ZUI/useZUIInteraction.d.ts +21 -0
  75. package/dist/config/runtime-vscode.d.ts +22 -0
  76. package/dist/config/runtime.d.ts +5 -0
  77. package/dist/constants/colors.d.ts +27 -0
  78. package/dist/constants/diagramColors.d.ts +1 -0
  79. package/dist/context/ThemeContext.d.ts +27 -0
  80. package/dist/crossBranch/graph.d.ts +13 -0
  81. package/dist/crossBranch/resolve.d.ts +22 -0
  82. package/dist/crossBranch/settings.d.ts +6 -0
  83. package/dist/crossBranch/store.d.ts +11 -0
  84. package/dist/crossBranch/types.d.ts +96 -0
  85. package/dist/demo/DemoPage.d.ts +9 -0
  86. package/dist/demo/seed.d.ts +9 -0
  87. package/dist/demo/store.d.ts +137 -0
  88. package/dist/demo/viewEditor.d.ts +26 -0
  89. package/dist/favicon.svg +35 -0
  90. package/dist/hooks/useSafeFitView.d.ts +16 -0
  91. package/dist/index.css +1 -0
  92. package/dist/index.d.ts +115 -0
  93. package/dist/index.js +19966 -0
  94. package/dist/lib/vscodeBridge-vscode.d.ts +13 -0
  95. package/dist/lib/vscodeBridge.d.ts +5 -0
  96. package/dist/logo-120.png +0 -0
  97. package/dist/logo-bw.png +0 -0
  98. package/dist/logo-bw.svg +15 -0
  99. package/dist/logo-text.svg +51 -0
  100. package/dist/logo.svg +35 -0
  101. package/dist/pages/AppearanceSettings.d.ts +3 -0
  102. package/dist/pages/Dependencies.d.ts +1 -0
  103. package/dist/pages/InfiniteZoom.d.ts +7 -0
  104. package/dist/pages/Settings.d.ts +7 -0
  105. package/dist/pages/ViewEditor/components/EditorMenus.d.ts +24 -0
  106. package/dist/pages/ViewEditor/components/EditorOverlays.d.ts +30 -0
  107. package/dist/pages/ViewEditor/components/EmptyCanvasState.d.ts +7 -0
  108. package/dist/pages/ViewEditor/context.d.ts +13 -0
  109. package/dist/pages/ViewEditor/hooks/useCanvasInteractions.d.ts +201 -0
  110. package/dist/pages/ViewEditor/hooks/useDrawingEngine.d.ts +40 -0
  111. package/dist/pages/ViewEditor/hooks/useViewContextNeighbours.d.ts +20 -0
  112. package/dist/pages/ViewEditor/hooks/useViewData.d.ts +74 -0
  113. package/dist/pages/ViewEditor/index.d.ts +8 -0
  114. package/dist/pages/ViewEditor/utils.d.ts +14 -0
  115. package/dist/pages/Views.d.ts +6 -0
  116. package/dist/pages/ViewsGrid.d.ts +6 -0
  117. package/dist/pkg/importer/mermaid.d.ts +7 -0
  118. package/dist/pkg/importer/mermaid.test.d.ts +1 -0
  119. package/dist/platform/PlatformContext.d.ts +6 -0
  120. package/dist/platform/context.d.ts +3 -0
  121. package/dist/platform/local.d.ts +2 -0
  122. package/dist/platform/types.d.ts +17 -0
  123. package/dist/slots.d.ts +67 -0
  124. package/dist/theme.d.ts +2 -0
  125. package/dist/types/index.d.ts +193 -0
  126. package/dist/types/vscode-messages.d.ts +60 -0
  127. package/dist/utils/edgeDistribution.d.ts +34 -0
  128. package/dist/utils/githubApi.d.ts +4 -0
  129. package/dist/utils/githubCache.d.ts +17 -0
  130. package/dist/utils/ids.d.ts +2 -0
  131. package/dist/utils/technologyCatalog.d.ts +15 -0
  132. package/dist/utils/toast.d.ts +15 -0
  133. package/dist/utils/treesitter.d.ts +13 -0
  134. package/dist/utils/url.d.ts +12 -0
  135. package/package.json +159 -0
  136. package/src/App.tsx +141 -0
  137. package/src/api/client.ts +618 -0
  138. package/src/api/transport-vscode.ts +28 -0
  139. package/src/api/transport.ts +7 -0
  140. package/src/assets/logo-mark.svg +31 -0
  141. package/src/assets/logo-wordmark.svg +22 -0
  142. package/src/assets/logo.svg +35 -0
  143. package/src/components/CodePreviewPanel-vscode.tsx +85 -0
  144. package/src/components/CodePreviewPanel.tsx +384 -0
  145. package/src/components/ConfirmDialog.tsx +66 -0
  146. package/src/components/ConnectorPanel.tsx +403 -0
  147. package/src/components/ContextBoundaryElement.tsx +35 -0
  148. package/src/components/ContextNeighborElement.tsx +282 -0
  149. package/src/components/ContextStraightConnector.tsx +144 -0
  150. package/src/components/CrossBranchControls.tsx +105 -0
  151. package/src/components/DependenciesOnboarding.tsx +427 -0
  152. package/src/components/DrawingCanvas.tsx +391 -0
  153. package/src/components/ElementLibrary-vscode.tsx +9 -0
  154. package/src/components/ElementLibrary.tsx +512 -0
  155. package/src/components/ElementNode.tsx +1033 -0
  156. package/src/components/ElementPanel.tsx +928 -0
  157. package/src/components/ExploreOnboarding.tsx +347 -0
  158. package/src/components/ExplorePageOnboarding.tsx +383 -0
  159. package/src/components/ExportModal.tsx +132 -0
  160. package/src/components/FloatingEdge.tsx +115 -0
  161. package/src/components/GitSourceLinker.tsx +1053 -0
  162. package/src/components/HeaderContext.tsx +30 -0
  163. package/src/components/Icons.tsx +245 -0
  164. package/src/components/ImportModal.tsx +219 -0
  165. package/src/components/InlineElementAdder.tsx +216 -0
  166. package/src/components/LayoutSection.tsx +624 -0
  167. package/src/components/LocalSourceLinker.tsx +330 -0
  168. package/src/components/MiniZoomOnboarding.tsx +78 -0
  169. package/src/components/NavBreadcrumb.tsx +24 -0
  170. package/src/components/NodeBody.tsx +89 -0
  171. package/src/components/NodeContainer.tsx +58 -0
  172. package/src/components/NodeHoverCard.tsx +135 -0
  173. package/src/components/PanelHeader.tsx +36 -0
  174. package/src/components/PanelUI.tsx +24 -0
  175. package/src/components/ProxyConnectorEdge.tsx +169 -0
  176. package/src/components/ProxyConnectorPanel.tsx +130 -0
  177. package/src/components/SafeBackground.tsx +19 -0
  178. package/src/components/ScrollIndicatorWrapper.tsx +117 -0
  179. package/src/components/SetChildModal.tsx +191 -0
  180. package/src/components/SetParentModal.tsx +187 -0
  181. package/src/components/SlidingPanel.tsx +114 -0
  182. package/src/components/TagUpsert.tsx +142 -0
  183. package/src/components/TopMenuBar.tsx +380 -0
  184. package/src/components/ViewBezierConnector.tsx +143 -0
  185. package/src/components/ViewDrawMenu.tsx +270 -0
  186. package/src/components/ViewEditorEdgeLabelLayout.ts +189 -0
  187. package/src/components/ViewEditorOnboarding.tsx +445 -0
  188. package/src/components/ViewExplorer/TagManager/ColorPicker.tsx +49 -0
  189. package/src/components/ViewExplorer/TagManager/GroupNamingPopover.tsx +96 -0
  190. package/src/components/ViewExplorer/TagManager/LayerItem.tsx +228 -0
  191. package/src/components/ViewExplorer/TagManager/TagItem.tsx +242 -0
  192. package/src/components/ViewExplorer/TagManager/index.tsx +418 -0
  193. package/src/components/ViewExplorer/ViewNavigator.tsx +121 -0
  194. package/src/components/ViewExplorer/ViewSearch.tsx +33 -0
  195. package/src/components/ViewExplorer/ViewTree.tsx +98 -0
  196. package/src/components/ViewExplorer/index.tsx +384 -0
  197. package/src/components/ViewExplorer/types.ts +13 -0
  198. package/src/components/ViewExplorer/utils.ts +56 -0
  199. package/src/components/ViewExplorer-vscode.tsx +8 -0
  200. package/src/components/ViewFloatingMenu-vscode.tsx +248 -0
  201. package/src/components/ViewFloatingMenu.tsx +379 -0
  202. package/src/components/ViewGridNode.tsx +451 -0
  203. package/src/components/ViewHeaderButton.tsx +60 -0
  204. package/src/components/ViewPanel.tsx +162 -0
  205. package/src/components/ViewsGridOnboarding.tsx +400 -0
  206. package/src/components/ZUI/ZUICanvas.tsx +853 -0
  207. package/src/components/ZUI/index.ts +3 -0
  208. package/src/components/ZUI/layout.ts +323 -0
  209. package/src/components/ZUI/proxy.ts +278 -0
  210. package/src/components/ZUI/renderer.ts +1189 -0
  211. package/src/components/ZUI/types.ts +150 -0
  212. package/src/components/ZUI/useZUIInteraction.ts +720 -0
  213. package/src/config/runtime-vscode.ts +46 -0
  214. package/src/config/runtime.ts +30 -0
  215. package/src/constants/colors.ts +80 -0
  216. package/src/constants/diagramColors.ts +9 -0
  217. package/src/context/ThemeContext.tsx +158 -0
  218. package/src/crossBranch/graph.ts +207 -0
  219. package/src/crossBranch/resolve.ts +643 -0
  220. package/src/crossBranch/settings.ts +59 -0
  221. package/src/crossBranch/store.ts +71 -0
  222. package/src/crossBranch/types.ts +102 -0
  223. package/src/demo/DemoPage.tsx +184 -0
  224. package/src/demo/seed.ts +67 -0
  225. package/src/demo/store.ts +536 -0
  226. package/src/demo/viewEditor.ts +110 -0
  227. package/src/hooks/useSafeFitView.ts +60 -0
  228. package/src/index.css +309 -0
  229. package/src/index.ts +184 -0
  230. package/src/kafka-ss.png +0 -0
  231. package/src/lib/vscodeBridge-vscode.ts +27 -0
  232. package/src/lib/vscodeBridge.ts +7 -0
  233. package/src/main.tsx +46 -0
  234. package/src/pages/AppearanceSettings.tsx +135 -0
  235. package/src/pages/Dependencies.tsx +926 -0
  236. package/src/pages/InfiniteZoom.tsx +404 -0
  237. package/src/pages/Settings.tsx +91 -0
  238. package/src/pages/ViewEditor/EDGE_DISTRIBUTION.md +64 -0
  239. package/src/pages/ViewEditor/components/EditorMenus.tsx +112 -0
  240. package/src/pages/ViewEditor/components/EditorOverlays.tsx +172 -0
  241. package/src/pages/ViewEditor/components/EmptyCanvasState.tsx +42 -0
  242. package/src/pages/ViewEditor/context.tsx +21 -0
  243. package/src/pages/ViewEditor/hooks/useCanvasInteractions.ts +1349 -0
  244. package/src/pages/ViewEditor/hooks/useDrawingEngine.ts +127 -0
  245. package/src/pages/ViewEditor/hooks/useViewContextNeighbours.ts +501 -0
  246. package/src/pages/ViewEditor/hooks/useViewData.ts +491 -0
  247. package/src/pages/ViewEditor/index.tsx +1366 -0
  248. package/src/pages/ViewEditor/utils.ts +88 -0
  249. package/src/pages/Views.tsx +171 -0
  250. package/src/pages/ViewsGrid.tsx +1310 -0
  251. package/src/pkg/importer/mermaid.test.ts +141 -0
  252. package/src/pkg/importer/mermaid.ts +76 -0
  253. package/src/platform/PlatformContext.tsx +17 -0
  254. package/src/platform/context.ts +9 -0
  255. package/src/platform/local.tsx +15 -0
  256. package/src/platform/types.ts +19 -0
  257. package/src/slots.ts +92 -0
  258. package/src/styles/editor-panels.css +66 -0
  259. package/src/styles/theme.css +56 -0
  260. package/src/theme.ts +336 -0
  261. package/src/types/index.ts +234 -0
  262. package/src/types/offline-ambient.d.ts +14 -0
  263. package/src/types/vscode-messages.ts +32 -0
  264. package/src/utils/edgeDistribution.ts +103 -0
  265. package/src/utils/githubApi.ts +121 -0
  266. package/src/utils/githubCache.ts +108 -0
  267. package/src/utils/ids.ts +9 -0
  268. package/src/utils/technologyCatalog.ts +143 -0
  269. package/src/utils/toast.ts +100 -0
  270. package/src/utils/treesitter.ts +147 -0
  271. package/src/utils/url.ts +72 -0
  272. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,427 @@
1
+ import { useEffect, useState } from 'react'
2
+ import { Box, Button, HStack, Text, VStack } from '@chakra-ui/react'
3
+
4
+ const STORAGE_KEY = `dependencies_tutorial_v1_core`
5
+
6
+ interface Props {
7
+
8
+ hasElements: boolean
9
+ }
10
+
11
+ function GridDots({ prefix }: { prefix: string }) {
12
+ return (
13
+ <>
14
+ {Array.from({ length: 7 }, (_, c) =>
15
+ Array.from({ length: 5 }, (_, r) => (
16
+ <circle
17
+ key={`${prefix}-${r}-${c}`}
18
+ cx={c * 40 + 20}
19
+ cy={r * 30 + 15}
20
+ r={0.8}
21
+ fill="#1E2D40"
22
+ />
23
+ )),
24
+ ).flat()}
25
+ </>
26
+ )
27
+ }
28
+
29
+ // Step 0 - the split layout: list on top, graph below
30
+ function SplitLayoutIllustration() {
31
+ return (
32
+ <svg
33
+ viewBox="0 0 280 150"
34
+ xmlns="http://www.w3.org/2000/svg"
35
+ style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block', overflow: 'hidden' }}
36
+ >
37
+ <defs>
38
+ <style>{`
39
+ .dp-row-0 { animation: dpRowIn 0.4s 0.00s ease both; }
40
+ .dp-row-1 { animation: dpRowIn 0.4s 0.08s ease both; }
41
+ .dp-row-2 { animation: dpRowIn 0.4s 0.16s ease both; }
42
+ .dp-row-3 { animation: dpRowIn 0.4s 0.24s ease both; }
43
+ .dp-row-4 { animation: dpRowIn 0.4s 0.32s ease both; }
44
+ @keyframes dpRowIn {
45
+ from { opacity: 0; transform: translateX(-6px); }
46
+ to { opacity: 1; transform: translateX(0); }
47
+ }
48
+ .dp-divider-hint {
49
+ animation: dpDivPulse 3s ease-in-out infinite;
50
+ }
51
+ @keyframes dpDivPulse {
52
+ 0%, 40% { stroke: #374151; }
53
+ 55%, 70% { stroke: #3B82F6; }
54
+ 85%, 100%{ stroke: #374151; }
55
+ }
56
+ `}</style>
57
+ </defs>
58
+
59
+ <rect width="280" height="150" fill="#0D1117" rx="8" />
60
+
61
+ {/* ── Top half: table ── */}
62
+ {/* Header */}
63
+ <rect x="0" y="0" width="280" height="14" fill="#111827" rx="0" />
64
+ <text x="10" y="10" fill="#4A5568" fontSize="7" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">NAME</text>
65
+ <text x="120" y="10" fill="#4A5568" fontSize="7" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">TYPE</text>
66
+ <text x="185" y="10" fill="#4A5568" fontSize="7" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">TECHNOLOGY</text>
67
+ <text x="258" y="10" textAnchor="end" fill="#4A5568" fontSize="7" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">NBR</text>
68
+
69
+ {/* Rows */}
70
+ {[
71
+ { name: 'API Gateway', type: 'container', tech: 'nginx', nbr: 8, color: '#F6AD55' },
72
+ { name: 'Auth Service', type: 'service', tech: 'Go', nbr: 5, color: '#63B3ED' },
73
+ { name: 'PostgreSQL', type: 'database', tech: 'postgres', nbr: 3, color: '#63B3ED' },
74
+ { name: 'Kafka', type: 'queue', tech: 'kafka', nbr: 2, color: '#63B3ED' },
75
+ { name: 'Frontend', type: 'webapp', tech: 'React', nbr: 1, color: '#9CA3AF' },
76
+ ].map(({ name, type, tech, nbr, color }, i) => (
77
+ <g key={name} className={`dp-row-${i}`}>
78
+ <rect x="0" y={14 + i * 14} width="280" height="14"
79
+ fill={i === 0 ? '#1A2D40' : 'transparent'}
80
+ stroke="none"
81
+ />
82
+ <text x="10" y={23 + i * 14} fill={i === 0 ? '#90CDF4' : '#CBD5E0'} fontSize="8" fontFamily="system-ui,sans-serif" fontWeight={i === 0 ? '600' : '400'}>{name}</text>
83
+ <rect x="116" y={16 + i * 14} width={type.length * 4.5 + 6} height="9" rx="3" fill="rgba(255,255,255,0.06)" />
84
+ <text x="119" y={23 + i * 14} fill="#718096" fontSize="7" fontFamily="system-ui,sans-serif">{type}</text>
85
+ <text x="185" y={23 + i * 14} fill="#4A5568" fontSize="7.5" fontFamily="system-ui,sans-serif">{tech}</text>
86
+ <text x="260" y={23 + i * 14} textAnchor="end" fill={color} fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="700">{nbr}</text>
87
+ </g>
88
+ ))}
89
+
90
+ {/* Divider */}
91
+ <line x1="0" y1="84" x2="280" y2="84" stroke="#374151" strokeWidth="5" className="dp-divider-hint" />
92
+ <rect x="120" y="81.5" width="40" height="5" rx="2.5" fill="#4A5568" />
93
+ <text x="140" y="93" textAnchor="middle" fill="#374151" fontSize="7" fontFamily="system-ui,sans-serif">drag to resize</text>
94
+
95
+ {/* ── Bottom half: empty graph prompt ── */}
96
+ <rect x="0" y="84" width="280" height="66" fill="#171923" />
97
+ <GridDots prefix="dp-btm" />
98
+ <text x="140" y="118" textAnchor="middle" fill="#374151" fontSize="10" fontFamily="system-ui,sans-serif">Select an element above</text>
99
+ <text x="140" y="131" textAnchor="middle" fill="#2D3748" fontSize="8" fontFamily="system-ui,sans-serif">The dependency graph will appear here</text>
100
+ </svg>
101
+ )
102
+ }
103
+
104
+ // Step 1 - click a row → graph shows selected + neighbours
105
+ function DependencyGraphIllustration() {
106
+ return (
107
+ <svg
108
+ viewBox="0 0 280 150"
109
+ xmlns="http://www.w3.org/2000/svg"
110
+ style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block', overflow: 'hidden' }}
111
+ >
112
+ <defs>
113
+ <style>{`
114
+ .dp-src-node { animation: dpSrcIn 0.5s 0.1s ease both; }
115
+ .dp-ctr-node { animation: dpCtrIn 0.4s 0.0s ease both; }
116
+ .dp-tgt-node { animation: dpTgtIn 0.5s 0.2s ease both; }
117
+ .dp-top-node { animation: dpTopIn 0.5s 0.15s ease both; }
118
+ @keyframes dpSrcIn {
119
+ from { opacity: 0; transform: translateX(-12px); }
120
+ to { opacity: 1; transform: translateX(0); }
121
+ }
122
+ @keyframes dpCtrIn {
123
+ from { opacity: 0; transform: scale(0.9); }
124
+ to { opacity: 1; transform: scale(1); }
125
+ }
126
+ @keyframes dpTgtIn {
127
+ from { opacity: 0; transform: translateX(12px); }
128
+ to { opacity: 1; transform: translateX(0); }
129
+ }
130
+ @keyframes dpTopIn {
131
+ from { opacity: 0; transform: translateY(-10px); }
132
+ to { opacity: 1; transform: translateY(0); }
133
+ }
134
+ `}</style>
135
+ </defs>
136
+
137
+ <rect width="280" height="150" fill="#171923" rx="8" />
138
+ <GridDots prefix="dg" />
139
+
140
+ {/* Top: bidirectional */}
141
+ <g className="dp-top-node">
142
+ <rect x="102" y="8" width="76" height="34" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
143
+ <text x="140" y="23" textAnchor="middle" fill="#CBD5E0" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="600">Frontend</text>
144
+ <rect x="110" y="28" width="36" height="10" rx="3" fill="rgba(79,209,197,0.15)" />
145
+ <text x="128" y="36" textAnchor="middle" fill="#4FD1C5" fontSize="7" fontFamily="system-ui,sans-serif">↔ calls</text>
146
+ <text x="140" y="6" textAnchor="middle" fill="#718096" fontSize="6.5" fontFamily="system-ui,sans-serif" style={{ textTransform: 'uppercase', letterSpacing: '0.08em' }}>bidirectional</text>
147
+ </g>
148
+ <line x1="140" y1="42" x2="140" y2="56" stroke="#2D3748" strokeWidth="1.5" />
149
+
150
+ {/* Left: source */}
151
+ <g className="dp-src-node">
152
+ <text x="46" y="52" textAnchor="middle" fill="#718096" fontSize="6.5" fontFamily="system-ui,sans-serif" letterSpacing="0.08em">SOURCES</text>
153
+ <rect x="8" y="58" width="76" height="40" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
154
+ <text x="46" y="76" textAnchor="middle" fill="#CBD5E0" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="600">Load Balancer</text>
155
+ <rect x="14" y="82" width="24" height="10" rx="3" fill="rgba(99,179,237,0.15)" />
156
+ <text x="26" y="90" textAnchor="middle" fill="#63B3ED" fontSize="7" fontFamily="system-ui,sans-serif">→</text>
157
+ </g>
158
+ <line x1="84" y1="78" x2="104" y2="90" stroke="#2D3748" strokeWidth="1.5" />
159
+
160
+ {/* Centre: selected */}
161
+ <g className="dp-ctr-node">
162
+ <rect x="102" y="56" width="76" height="50" rx="7" fill="#1A2D40" stroke="#63B3ED" strokeWidth="1.8" />
163
+ <rect x="118" y="50" width="44" height="10" rx="5" fill="#3B82F6" />
164
+ <text x="140" y="58" textAnchor="middle" fill="white" fontSize="6.5" fontFamily="system-ui,sans-serif" fontWeight="700" letterSpacing="0.08em">SELECTED</text>
165
+ <text x="140" y="80" textAnchor="middle" fill="#90CDF4" fontSize="9" fontFamily="system-ui,sans-serif" fontWeight="700">API Gateway</text>
166
+ <text x="140" y="92" textAnchor="middle" fill="#718096" fontSize="7.5" fontFamily="system-ui,sans-serif">8 neighbours</text>
167
+ </g>
168
+
169
+ {/* Right: targets */}
170
+ <g className="dp-tgt-node">
171
+ <text x="232" y="52" textAnchor="middle" fill="#718096" fontSize="6.5" fontFamily="system-ui,sans-serif" letterSpacing="0.08em">TARGETS</text>
172
+ <rect x="196" y="58" width="76" height="34" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
173
+ <text x="234" y="75" textAnchor="middle" fill="#CBD5E0" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="600">Auth Service</text>
174
+ <rect x="200" y="80" width="24" height="10" rx="3" fill="rgba(99,179,237,0.15)" />
175
+ <text x="212" y="88" textAnchor="middle" fill="#63B3ED" fontSize="7" fontFamily="system-ui,sans-serif">→</text>
176
+ <rect x="196" y="100" width="76" height="34" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
177
+ <text x="234" y="117" textAnchor="middle" fill="#CBD5E0" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="600">PostgreSQL</text>
178
+ <rect x="200" y="122" width="24" height="10" rx="3" fill="rgba(99,179,237,0.15)" />
179
+ <text x="212" y="130" textAnchor="middle" fill="#63B3ED" fontSize="7" fontFamily="system-ui,sans-serif">→</text>
180
+ </g>
181
+ <line x1="178" y1="80" x2="196" y2="74" stroke="#2D3748" strokeWidth="1.5" />
182
+ <line x1="178" y1="90" x2="196" y2="116" stroke="#2D3748" strokeWidth="1.5" />
183
+
184
+ <text x="140" y="146" textAnchor="middle" fill="#2D3748" fontSize="8" fontFamily="system-ui,sans-serif">click any row to see its dependency graph</text>
185
+ </svg>
186
+ )
187
+ }
188
+
189
+ // Step 2 - pivot + search/filter
190
+ function PivotIllustration() {
191
+ return (
192
+ <svg
193
+ viewBox="0 0 280 150"
194
+ xmlns="http://www.w3.org/2000/svg"
195
+ style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block', overflow: 'hidden' }}
196
+ >
197
+ <defs>
198
+ <style>{`
199
+ .dp-pivot-cursor {
200
+ animation: dpPivotCursor 4s ease-in-out infinite;
201
+ }
202
+ @keyframes dpPivotCursor {
203
+ 0%, 20% { transform: translate(232px, 90px); opacity: 0; }
204
+ 30% { opacity: 1; }
205
+ 45% { transform: translate(232px, 90px) scale(0.85); }
206
+ 55%, 90% { transform: translate(232px, 90px) scale(1); opacity: 0.5; }
207
+ 100% { opacity: 0; }
208
+ }
209
+ .dp-pivot-highlight {
210
+ animation: dpPivotHL 4s ease-in-out infinite;
211
+ }
212
+ @keyframes dpPivotHL {
213
+ 0%, 35% { stroke: #2D3748; }
214
+ 50%, 80% { stroke: #63B3ED; filter: drop-shadow(0 0 6px rgba(99,179,237,0.4)); }
215
+ 93%, 100%{ stroke: #2D3748; filter: none; }
216
+ }
217
+ .dp-search-type {
218
+ animation: dpSearchType 4s ease-in-out infinite;
219
+ }
220
+ @keyframes dpSearchType {
221
+ 0%, 10% { width: 0; }
222
+ 40%, 90% { width: 48px; }
223
+ 100% { width: 0; }
224
+ }
225
+ `}</style>
226
+ </defs>
227
+
228
+ <rect width="280" height="150" fill="#0D1117" rx="8" />
229
+
230
+ {/* Search bar */}
231
+ <rect x="8" y="8" width="180" height="20" rx="4" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
232
+ <text x="18" y="22" fill="#4A5568" fontSize="8.5" fontFamily="system-ui,sans-serif">🔍</text>
233
+ <text x="32" y="22" fill="#CBD5E0" fontSize="8.5" fontFamily="system-ui,sans-serif">Auth</text>
234
+ <rect x="32" y="13" width="48" height="10" rx="0" fill="#2A3A50" className="dp-search-type" />
235
+
236
+ {/* Type filter button */}
237
+ <rect x="196" y="8" width="76" height="20" rx="4" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
238
+ <text x="234" y="22" textAnchor="middle" fill="#718096" fontSize="8.5" fontFamily="system-ui,sans-serif">service ▾</text>
239
+
240
+ {/* Filtered rows */}
241
+ <rect x="0" y="32" width="280" height="12" fill="#111827" />
242
+ <text x="10" y="41" fill="#4A5568" fontSize="6.5" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">NAME</text>
243
+ <text x="140" y="41" fill="#4A5568" fontSize="6.5" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">TECHNOLOGY</text>
244
+ <text x="258" y="41" textAnchor="end" fill="#4A5568" fontSize="6.5" fontFamily="system-ui,sans-serif" letterSpacing="0.06em" fontWeight="700">NBR</text>
245
+
246
+ {[
247
+ { name: 'Auth Service', tech: 'Go', nbr: 5 },
248
+ { name: 'Auth Gateway', tech: 'nginx', nbr: 2 },
249
+ ].map(({ name, tech, nbr }, i) => (
250
+ <g key={name}>
251
+ <rect x="0" y={44 + i * 13} width="280" height="13" fill={i === 0 ? '#1A2D40' : 'transparent'} />
252
+ <text x="10" y={53 + i * 13} fill={i === 0 ? '#90CDF4' : '#CBD5E0'} fontSize="8" fontFamily="system-ui,sans-serif" fontWeight={i === 0 ? '600' : '400'}>{name}</text>
253
+ <text x="140" y={53 + i * 13} fill="#4A5568" fontSize="7.5" fontFamily="system-ui,sans-serif">{tech}</text>
254
+ <text x="260" y={53 + i * 13} textAnchor="end" fill="#63B3ED" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="700">{nbr}</text>
255
+ </g>
256
+ ))}
257
+
258
+ {/* Divider */}
259
+ <line x1="0" y1="72" x2="280" y2="72" stroke="#2D3748" strokeWidth="4" />
260
+
261
+ {/* Graph: pivot scenario */}
262
+ <rect x="10" y="80" width="64" height="36" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
263
+ <text x="42" y="97" textAnchor="middle" fill="#CBD5E0" fontSize="7.5" fontFamily="system-ui,sans-serif" fontWeight="600">API GW</text>
264
+ <text x="42" y="108" textAnchor="middle" fill="#718096" fontSize="7" fontFamily="system-ui,sans-serif">source</text>
265
+ <line x1="74" y1="98" x2="94" y2="98" stroke="#2D3748" strokeWidth="1.5" />
266
+
267
+ <rect x="94" y="76" width="76" height="44" rx="7" fill="#1A2D40" stroke="#63B3ED" strokeWidth="1.5" />
268
+ <rect x="112" y="71" width="40" height="9" rx="4" fill="#3B82F6" />
269
+ <text x="132" y="78" textAnchor="middle" fill="white" fontSize="6" fontFamily="system-ui,sans-serif" fontWeight="700">SELECTED</text>
270
+ <text x="132" y="97" textAnchor="middle" fill="#90CDF4" fontSize="8.5" fontFamily="system-ui,sans-serif" fontWeight="700">Auth Service</text>
271
+ <text x="132" y="109" textAnchor="middle" fill="#718096" fontSize="7" fontFamily="system-ui,sans-serif">5 neighbours</text>
272
+ <line x1="170" y1="98" x2="192" y2="90" stroke="#2D3748" strokeWidth="1.5" />
273
+ <line x1="170" y1="98" x2="192" y2="112" stroke="#2D3748" strokeWidth="1.5" />
274
+
275
+ {/* Pivot target - highlighted on hover */}
276
+ <rect x="192" y="80" width="76" height="34" rx="6" fill="#1C2535" strokeWidth="1.5" className="dp-pivot-highlight" stroke="#2D3748" />
277
+ <text x="230" y="97" textAnchor="middle" fill="#CBD5E0" fontSize="7.5" fontFamily="system-ui,sans-serif" fontWeight="600">PostgreSQL</text>
278
+ <text x="230" y="108" textAnchor="middle" fill="#4A5568" fontSize="7" fontFamily="system-ui,sans-serif">click to pivot</text>
279
+ <rect x="192" y="118" width="76" height="24" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
280
+ <text x="230" y="133" textAnchor="middle" fill="#CBD5E0" fontSize="7.5" fontFamily="system-ui,sans-serif">Redis</text>
281
+
282
+ {/* Cursor */}
283
+ <g className="dp-pivot-cursor">
284
+ <path d="M0,0 L0,12 L3.5,9 L6,15 L8,14 L5,8 L9.5,8 Z" fill="white" stroke="#0D1117" strokeWidth="0.5" />
285
+ </g>
286
+
287
+ <text x="140" y="146" textAnchor="middle" fill="#2D3748" fontSize="8" fontFamily="system-ui,sans-serif">click any neighbour to pivot to their dependencies</text>
288
+ </svg>
289
+ )
290
+ }
291
+
292
+ const STEPS = [
293
+ {
294
+ title: 'All Elements, One View',
295
+ body: 'Dependencies lists every element across all your diagrams, sorted by how many connections it has. Search by name, type, or technology. Filter to a specific type to focus.',
296
+ visual: 'layout' as const,
297
+ },
298
+ {
299
+ title: 'Dependency Graph',
300
+ body: 'Click any row to see its full dependency graph. Sources appear on the left, targets on the right, bidirectional connections on top. The neighbour count shows how connected it is.',
301
+ visual: 'graph' as const,
302
+ },
303
+ {
304
+ title: 'Pivot & Navigate',
305
+ body: 'Click any neighbour card in the graph to instantly pivot to their dependencies. Drag the divider bar to give more space to the list or the graph.',
306
+ visual: 'pivot' as const,
307
+ },
308
+ ]
309
+
310
+ export default function DependenciesOnboarding({ hasElements }: Props) {
311
+ const [visible, setVisible] = useState(false)
312
+ const [step, setStep] = useState(0)
313
+
314
+ useEffect(() => {
315
+ if (!hasElements) return
316
+ if (!localStorage.getItem(STORAGE_KEY)) {
317
+ setVisible(true)
318
+ }
319
+ }, [ hasElements])
320
+
321
+ const dismiss = () => {
322
+ localStorage.setItem(STORAGE_KEY, '1')
323
+ setVisible(false)
324
+ }
325
+
326
+ if (!visible) return null
327
+
328
+ const current = STEPS[step]
329
+ const isLast = step === STEPS.length - 1
330
+
331
+ return (
332
+ <Box
333
+ position="fixed"
334
+ inset={0}
335
+ zIndex={2000}
336
+ display="flex"
337
+ alignItems="center"
338
+ justifyContent="center"
339
+ pointerEvents="none"
340
+ >
341
+ <Box
342
+ position="absolute"
343
+ inset={0}
344
+ bg="blackAlpha.700"
345
+ pointerEvents="auto"
346
+ onClick={dismiss}
347
+ />
348
+ <Box
349
+ position="relative"
350
+ w="380px"
351
+ bg="var(--bg-panel)"
352
+ border="1px solid"
353
+ borderColor="var(--border-main)"
354
+ borderRadius="16px"
355
+ p={6}
356
+ boxShadow="0 24px 60px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04)"
357
+ pointerEvents="auto"
358
+ >
359
+ <Button
360
+ position="absolute"
361
+ top={3}
362
+ right={3}
363
+ size="xs"
364
+ variant="ghost"
365
+ color="gray.500"
366
+ _hover={{ color: 'gray.200', bg: 'whiteAlpha.100' }}
367
+ onClick={dismiss}
368
+ fontWeight="normal"
369
+ >
370
+ Skip Tutorial
371
+ </Button>
372
+
373
+ <HStack justify="center" spacing={2} mb={5}>
374
+ {STEPS.map((_, i) => (
375
+ <Box
376
+ key={i}
377
+ w={i === step ? '18px' : '6px'}
378
+ h="6px"
379
+ rounded="full"
380
+ bg={i === step ? 'blue.400' : 'gray.600'}
381
+ transition="all 0.25s ease"
382
+ cursor="pointer"
383
+ onClick={() => setStep(i)}
384
+ _hover={{ bg: i === step ? 'blue.400' : 'gray.500' }}
385
+ />
386
+ ))}
387
+ </HStack>
388
+
389
+ <VStack spacing={4} textAlign="center">
390
+ {current.visual === 'layout' && <SplitLayoutIllustration />}
391
+ {current.visual === 'graph' && <DependencyGraphIllustration />}
392
+ {current.visual === 'pivot' && <PivotIllustration />}
393
+
394
+ <VStack spacing={2}>
395
+ <Text fontWeight="bold" fontSize="lg" color="gray.100" lineHeight="short">
396
+ {current.title}
397
+ </Text>
398
+ <Text fontSize="sm" color="gray.400" lineHeight="tall" maxW="300px">
399
+ {current.body}
400
+ </Text>
401
+ </VStack>
402
+ </VStack>
403
+
404
+ <HStack mt={6} justify="space-between" align="center">
405
+ <Button
406
+ size="sm"
407
+ variant="ghost"
408
+ color="gray.500"
409
+ _hover={{ color: 'gray.300' }}
410
+ onClick={() => setStep(step - 1)}
411
+ visibility={step > 0 ? 'visible' : 'hidden'}
412
+ >
413
+ ← Back
414
+ </Button>
415
+ <Button
416
+ size="sm"
417
+ colorScheme="blue"
418
+ px={5}
419
+ onClick={isLast ? dismiss : () => setStep(step + 1)}
420
+ >
421
+ {isLast ? 'Got it' : 'Next →'}
422
+ </Button>
423
+ </HStack>
424
+ </Box>
425
+ </Box>
426
+ )
427
+ }