@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.
- package/dist/App.d.ts +1 -0
- package/dist/api/client.d.ts +143 -0
- package/dist/api/transport-vscode.d.ts +8 -0
- package/dist/api/transport.d.ts +1 -0
- package/dist/components/CodePreviewPanel-vscode.d.ts +7 -0
- package/dist/components/CodePreviewPanel.d.ts +9 -0
- package/dist/components/ConfirmDialog.d.ts +12 -0
- package/dist/components/ConnectorPanel.d.ts +21 -0
- package/dist/components/ContextBoundaryElement.d.ts +11 -0
- package/dist/components/ContextNeighborElement.d.ts +29 -0
- package/dist/components/ContextStraightConnector.d.ts +4 -0
- package/dist/components/CrossBranchControls.d.ts +9 -0
- package/dist/components/DependenciesOnboarding.d.ts +5 -0
- package/dist/components/DrawingCanvas.d.ts +39 -0
- package/dist/components/ElementLibrary-vscode.d.ts +7 -0
- package/dist/components/ElementLibrary.d.ts +22 -0
- package/dist/components/ElementNode.d.ts +36 -0
- package/dist/components/ElementPanel.d.ts +25 -0
- package/dist/components/ExploreOnboarding.d.ts +5 -0
- package/dist/components/ExplorePageOnboarding.d.ts +5 -0
- package/dist/components/ExportModal.d.ts +16 -0
- package/dist/components/FloatingEdge.d.ts +9 -0
- package/dist/components/GitSourceLinker.d.ts +8 -0
- package/dist/components/HeaderContext.d.ts +16 -0
- package/dist/components/Icons.d.ts +95 -0
- package/dist/components/ImportModal.d.ts +10 -0
- package/dist/components/InlineElementAdder.d.ts +17 -0
- package/dist/components/LayoutSection.d.ts +7 -0
- package/dist/components/LocalSourceLinker.d.ts +8 -0
- package/dist/components/MiniZoomOnboarding.d.ts +5 -0
- package/dist/components/NavBreadcrumb.d.ts +6 -0
- package/dist/components/NodeBody.d.ts +12 -0
- package/dist/components/NodeContainer.d.ts +8 -0
- package/dist/components/NodeHoverCard.d.ts +10 -0
- package/dist/components/PanelHeader.d.ts +8 -0
- package/dist/components/PanelUI.d.ts +3 -0
- package/dist/components/ProxyConnectorEdge.d.ts +4 -0
- package/dist/components/ProxyConnectorPanel.d.ts +9 -0
- package/dist/components/SafeBackground.d.ts +13 -0
- package/dist/components/ScrollIndicatorWrapper.d.ts +8 -0
- package/dist/components/SetChildModal.d.ts +10 -0
- package/dist/components/SetParentModal.d.ts +10 -0
- package/dist/components/SlidingPanel.d.ts +16 -0
- package/dist/components/TagUpsert.d.ts +8 -0
- package/dist/components/TopMenuBar.d.ts +8 -0
- package/dist/components/ViewBezierConnector.d.ts +4 -0
- package/dist/components/ViewDrawMenu.d.ts +22 -0
- package/dist/components/ViewEditorEdgeLabelLayout.d.ts +16 -0
- package/dist/components/ViewEditorOnboarding.d.ts +5 -0
- package/dist/components/ViewExplorer/TagManager/ColorPicker.d.ts +7 -0
- package/dist/components/ViewExplorer/TagManager/GroupNamingPopover.d.ts +10 -0
- package/dist/components/ViewExplorer/TagManager/LayerItem.d.ts +27 -0
- package/dist/components/ViewExplorer/TagManager/TagItem.d.ts +25 -0
- package/dist/components/ViewExplorer/TagManager/index.d.ts +21 -0
- package/dist/components/ViewExplorer/ViewNavigator.d.ts +11 -0
- package/dist/components/ViewExplorer/ViewSearch.d.ts +8 -0
- package/dist/components/ViewExplorer/ViewTree.d.ts +18 -0
- package/dist/components/ViewExplorer/index.d.ts +31 -0
- package/dist/components/ViewExplorer/types.d.ts +11 -0
- package/dist/components/ViewExplorer/utils.d.ts +6 -0
- package/dist/components/ViewExplorer-vscode.d.ts +6 -0
- package/dist/components/ViewFloatingMenu-vscode.d.ts +27 -0
- package/dist/components/ViewFloatingMenu.d.ts +39 -0
- package/dist/components/ViewGridNode.d.ts +29 -0
- package/dist/components/ViewHeaderButton.d.ts +11 -0
- package/dist/components/ViewPanel.d.ts +18 -0
- package/dist/components/ViewsGridOnboarding.d.ts +5 -0
- package/dist/components/ZUI/ZUICanvas.d.ts +18 -0
- package/dist/components/ZUI/index.d.ts +2 -0
- package/dist/components/ZUI/layout.d.ts +18 -0
- package/dist/components/ZUI/proxy.d.ts +25 -0
- package/dist/components/ZUI/renderer.d.ts +30 -0
- package/dist/components/ZUI/types.d.ts +140 -0
- package/dist/components/ZUI/useZUIInteraction.d.ts +21 -0
- package/dist/config/runtime-vscode.d.ts +22 -0
- package/dist/config/runtime.d.ts +5 -0
- package/dist/constants/colors.d.ts +27 -0
- package/dist/constants/diagramColors.d.ts +1 -0
- package/dist/context/ThemeContext.d.ts +27 -0
- package/dist/crossBranch/graph.d.ts +13 -0
- package/dist/crossBranch/resolve.d.ts +22 -0
- package/dist/crossBranch/settings.d.ts +6 -0
- package/dist/crossBranch/store.d.ts +11 -0
- package/dist/crossBranch/types.d.ts +96 -0
- package/dist/demo/DemoPage.d.ts +9 -0
- package/dist/demo/seed.d.ts +9 -0
- package/dist/demo/store.d.ts +137 -0
- package/dist/demo/viewEditor.d.ts +26 -0
- package/dist/favicon.svg +35 -0
- package/dist/hooks/useSafeFitView.d.ts +16 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +19966 -0
- package/dist/lib/vscodeBridge-vscode.d.ts +13 -0
- package/dist/lib/vscodeBridge.d.ts +5 -0
- package/dist/logo-120.png +0 -0
- package/dist/logo-bw.png +0 -0
- package/dist/logo-bw.svg +15 -0
- package/dist/logo-text.svg +51 -0
- package/dist/logo.svg +35 -0
- package/dist/pages/AppearanceSettings.d.ts +3 -0
- package/dist/pages/Dependencies.d.ts +1 -0
- package/dist/pages/InfiniteZoom.d.ts +7 -0
- package/dist/pages/Settings.d.ts +7 -0
- package/dist/pages/ViewEditor/components/EditorMenus.d.ts +24 -0
- package/dist/pages/ViewEditor/components/EditorOverlays.d.ts +30 -0
- package/dist/pages/ViewEditor/components/EmptyCanvasState.d.ts +7 -0
- package/dist/pages/ViewEditor/context.d.ts +13 -0
- package/dist/pages/ViewEditor/hooks/useCanvasInteractions.d.ts +201 -0
- package/dist/pages/ViewEditor/hooks/useDrawingEngine.d.ts +40 -0
- package/dist/pages/ViewEditor/hooks/useViewContextNeighbours.d.ts +20 -0
- package/dist/pages/ViewEditor/hooks/useViewData.d.ts +74 -0
- package/dist/pages/ViewEditor/index.d.ts +8 -0
- package/dist/pages/ViewEditor/utils.d.ts +14 -0
- package/dist/pages/Views.d.ts +6 -0
- package/dist/pages/ViewsGrid.d.ts +6 -0
- package/dist/pkg/importer/mermaid.d.ts +7 -0
- package/dist/pkg/importer/mermaid.test.d.ts +1 -0
- package/dist/platform/PlatformContext.d.ts +6 -0
- package/dist/platform/context.d.ts +3 -0
- package/dist/platform/local.d.ts +2 -0
- package/dist/platform/types.d.ts +17 -0
- package/dist/slots.d.ts +67 -0
- package/dist/theme.d.ts +2 -0
- package/dist/types/index.d.ts +193 -0
- package/dist/types/vscode-messages.d.ts +60 -0
- package/dist/utils/edgeDistribution.d.ts +34 -0
- package/dist/utils/githubApi.d.ts +4 -0
- package/dist/utils/githubCache.d.ts +17 -0
- package/dist/utils/ids.d.ts +2 -0
- package/dist/utils/technologyCatalog.d.ts +15 -0
- package/dist/utils/toast.d.ts +15 -0
- package/dist/utils/treesitter.d.ts +13 -0
- package/dist/utils/url.d.ts +12 -0
- package/package.json +159 -0
- package/src/App.tsx +141 -0
- package/src/api/client.ts +618 -0
- package/src/api/transport-vscode.ts +28 -0
- package/src/api/transport.ts +7 -0
- package/src/assets/logo-mark.svg +31 -0
- package/src/assets/logo-wordmark.svg +22 -0
- package/src/assets/logo.svg +35 -0
- package/src/components/CodePreviewPanel-vscode.tsx +85 -0
- package/src/components/CodePreviewPanel.tsx +384 -0
- package/src/components/ConfirmDialog.tsx +66 -0
- package/src/components/ConnectorPanel.tsx +403 -0
- package/src/components/ContextBoundaryElement.tsx +35 -0
- package/src/components/ContextNeighborElement.tsx +282 -0
- package/src/components/ContextStraightConnector.tsx +144 -0
- package/src/components/CrossBranchControls.tsx +105 -0
- package/src/components/DependenciesOnboarding.tsx +427 -0
- package/src/components/DrawingCanvas.tsx +391 -0
- package/src/components/ElementLibrary-vscode.tsx +9 -0
- package/src/components/ElementLibrary.tsx +512 -0
- package/src/components/ElementNode.tsx +1033 -0
- package/src/components/ElementPanel.tsx +928 -0
- package/src/components/ExploreOnboarding.tsx +347 -0
- package/src/components/ExplorePageOnboarding.tsx +383 -0
- package/src/components/ExportModal.tsx +132 -0
- package/src/components/FloatingEdge.tsx +115 -0
- package/src/components/GitSourceLinker.tsx +1053 -0
- package/src/components/HeaderContext.tsx +30 -0
- package/src/components/Icons.tsx +245 -0
- package/src/components/ImportModal.tsx +219 -0
- package/src/components/InlineElementAdder.tsx +216 -0
- package/src/components/LayoutSection.tsx +624 -0
- package/src/components/LocalSourceLinker.tsx +330 -0
- package/src/components/MiniZoomOnboarding.tsx +78 -0
- package/src/components/NavBreadcrumb.tsx +24 -0
- package/src/components/NodeBody.tsx +89 -0
- package/src/components/NodeContainer.tsx +58 -0
- package/src/components/NodeHoverCard.tsx +135 -0
- package/src/components/PanelHeader.tsx +36 -0
- package/src/components/PanelUI.tsx +24 -0
- package/src/components/ProxyConnectorEdge.tsx +169 -0
- package/src/components/ProxyConnectorPanel.tsx +130 -0
- package/src/components/SafeBackground.tsx +19 -0
- package/src/components/ScrollIndicatorWrapper.tsx +117 -0
- package/src/components/SetChildModal.tsx +191 -0
- package/src/components/SetParentModal.tsx +187 -0
- package/src/components/SlidingPanel.tsx +114 -0
- package/src/components/TagUpsert.tsx +142 -0
- package/src/components/TopMenuBar.tsx +380 -0
- package/src/components/ViewBezierConnector.tsx +143 -0
- package/src/components/ViewDrawMenu.tsx +270 -0
- package/src/components/ViewEditorEdgeLabelLayout.ts +189 -0
- package/src/components/ViewEditorOnboarding.tsx +445 -0
- package/src/components/ViewExplorer/TagManager/ColorPicker.tsx +49 -0
- package/src/components/ViewExplorer/TagManager/GroupNamingPopover.tsx +96 -0
- package/src/components/ViewExplorer/TagManager/LayerItem.tsx +228 -0
- package/src/components/ViewExplorer/TagManager/TagItem.tsx +242 -0
- package/src/components/ViewExplorer/TagManager/index.tsx +418 -0
- package/src/components/ViewExplorer/ViewNavigator.tsx +121 -0
- package/src/components/ViewExplorer/ViewSearch.tsx +33 -0
- package/src/components/ViewExplorer/ViewTree.tsx +98 -0
- package/src/components/ViewExplorer/index.tsx +384 -0
- package/src/components/ViewExplorer/types.ts +13 -0
- package/src/components/ViewExplorer/utils.ts +56 -0
- package/src/components/ViewExplorer-vscode.tsx +8 -0
- package/src/components/ViewFloatingMenu-vscode.tsx +248 -0
- package/src/components/ViewFloatingMenu.tsx +379 -0
- package/src/components/ViewGridNode.tsx +451 -0
- package/src/components/ViewHeaderButton.tsx +60 -0
- package/src/components/ViewPanel.tsx +162 -0
- package/src/components/ViewsGridOnboarding.tsx +400 -0
- package/src/components/ZUI/ZUICanvas.tsx +853 -0
- package/src/components/ZUI/index.ts +3 -0
- package/src/components/ZUI/layout.ts +323 -0
- package/src/components/ZUI/proxy.ts +278 -0
- package/src/components/ZUI/renderer.ts +1189 -0
- package/src/components/ZUI/types.ts +150 -0
- package/src/components/ZUI/useZUIInteraction.ts +720 -0
- package/src/config/runtime-vscode.ts +46 -0
- package/src/config/runtime.ts +30 -0
- package/src/constants/colors.ts +80 -0
- package/src/constants/diagramColors.ts +9 -0
- package/src/context/ThemeContext.tsx +158 -0
- package/src/crossBranch/graph.ts +207 -0
- package/src/crossBranch/resolve.ts +643 -0
- package/src/crossBranch/settings.ts +59 -0
- package/src/crossBranch/store.ts +71 -0
- package/src/crossBranch/types.ts +102 -0
- package/src/demo/DemoPage.tsx +184 -0
- package/src/demo/seed.ts +67 -0
- package/src/demo/store.ts +536 -0
- package/src/demo/viewEditor.ts +110 -0
- package/src/hooks/useSafeFitView.ts +60 -0
- package/src/index.css +309 -0
- package/src/index.ts +184 -0
- package/src/kafka-ss.png +0 -0
- package/src/lib/vscodeBridge-vscode.ts +27 -0
- package/src/lib/vscodeBridge.ts +7 -0
- package/src/main.tsx +46 -0
- package/src/pages/AppearanceSettings.tsx +135 -0
- package/src/pages/Dependencies.tsx +926 -0
- package/src/pages/InfiniteZoom.tsx +404 -0
- package/src/pages/Settings.tsx +91 -0
- package/src/pages/ViewEditor/EDGE_DISTRIBUTION.md +64 -0
- package/src/pages/ViewEditor/components/EditorMenus.tsx +112 -0
- package/src/pages/ViewEditor/components/EditorOverlays.tsx +172 -0
- package/src/pages/ViewEditor/components/EmptyCanvasState.tsx +42 -0
- package/src/pages/ViewEditor/context.tsx +21 -0
- package/src/pages/ViewEditor/hooks/useCanvasInteractions.ts +1349 -0
- package/src/pages/ViewEditor/hooks/useDrawingEngine.ts +127 -0
- package/src/pages/ViewEditor/hooks/useViewContextNeighbours.ts +501 -0
- package/src/pages/ViewEditor/hooks/useViewData.ts +491 -0
- package/src/pages/ViewEditor/index.tsx +1366 -0
- package/src/pages/ViewEditor/utils.ts +88 -0
- package/src/pages/Views.tsx +171 -0
- package/src/pages/ViewsGrid.tsx +1310 -0
- package/src/pkg/importer/mermaid.test.ts +141 -0
- package/src/pkg/importer/mermaid.ts +76 -0
- package/src/platform/PlatformContext.tsx +17 -0
- package/src/platform/context.ts +9 -0
- package/src/platform/local.tsx +15 -0
- package/src/platform/types.ts +19 -0
- package/src/slots.ts +92 -0
- package/src/styles/editor-panels.css +66 -0
- package/src/styles/theme.css +56 -0
- package/src/theme.ts +336 -0
- package/src/types/index.ts +234 -0
- package/src/types/offline-ambient.d.ts +14 -0
- package/src/types/vscode-messages.ts +32 -0
- package/src/utils/edgeDistribution.ts +103 -0
- package/src/utils/githubApi.ts +121 -0
- package/src/utils/githubCache.ts +108 -0
- package/src/utils/ids.ts +9 -0
- package/src/utils/technologyCatalog.ts +143 -0
- package/src/utils/toast.ts +100 -0
- package/src/utils/treesitter.ts +147 -0
- package/src/utils/url.ts +72 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { Box, Button, HStack, Text, VStack } from '@chakra-ui/react'
|
|
3
|
+
|
|
4
|
+
const STORAGE_KEY = `explore_tutorial_v1_core`
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
|
|
8
|
+
hasLinkedNodes: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ── SVG helpers ────────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
function GridDots({ prefix }: { prefix: string }) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{Array.from({ length: 7 }, (_, r) =>
|
|
17
|
+
Array.from({ length: 14 }, (_, c) => (
|
|
18
|
+
<circle
|
|
19
|
+
key={`${prefix}-${r}-${c}`}
|
|
20
|
+
cx={c * 20 + 10}
|
|
21
|
+
cy={r * 20 + 10}
|
|
22
|
+
r={0.8}
|
|
23
|
+
fill="#1E2D40"
|
|
24
|
+
/>
|
|
25
|
+
)),
|
|
26
|
+
).flat()}
|
|
27
|
+
</>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Step 1 - animated zoom-in / zoom-out illustration
|
|
32
|
+
function ZoomAnimation() {
|
|
33
|
+
return (
|
|
34
|
+
<svg
|
|
35
|
+
viewBox="0 0 280 150"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block', overflow: 'hidden' }}
|
|
38
|
+
>
|
|
39
|
+
<defs>
|
|
40
|
+
<style>{`
|
|
41
|
+
.eo-outer {
|
|
42
|
+
transform-box: view-box;
|
|
43
|
+
transform-origin: 79% 52%;
|
|
44
|
+
animation: eoOuterZoom 5s ease-in-out infinite;
|
|
45
|
+
}
|
|
46
|
+
@keyframes eoOuterZoom {
|
|
47
|
+
0%, 18% { transform: scale(1); opacity: 1; }
|
|
48
|
+
40%, 62% { transform: scale(2.4); opacity: 0; }
|
|
49
|
+
82%, 100% { transform: scale(1); opacity: 1; }
|
|
50
|
+
}
|
|
51
|
+
.eo-inner {
|
|
52
|
+
animation: eoInnerFade 5s ease-in-out infinite;
|
|
53
|
+
}
|
|
54
|
+
@keyframes eoInnerFade {
|
|
55
|
+
0%, 32% { opacity: 0; }
|
|
56
|
+
50%, 60% { opacity: 1; }
|
|
57
|
+
77%, 100% { opacity: 0; }
|
|
58
|
+
}
|
|
59
|
+
`}</style>
|
|
60
|
+
<marker id="eo-arr" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
|
|
61
|
+
<path d="M0,0 L0,6 L8,3 z" fill="#4A5568" />
|
|
62
|
+
</marker>
|
|
63
|
+
<marker id="eo-arr-dash" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
|
|
64
|
+
<path d="M0,0 L0,6 L8,3 z" fill="#374151" />
|
|
65
|
+
</marker>
|
|
66
|
+
</defs>
|
|
67
|
+
|
|
68
|
+
{/* Background */}
|
|
69
|
+
<rect width="280" height="150" fill="#0D1117" rx="8" />
|
|
70
|
+
<GridDots prefix="z-o" />
|
|
71
|
+
|
|
72
|
+
{/* ── Outer scene: two nodes connected ── */}
|
|
73
|
+
<g className="eo-outer">
|
|
74
|
+
{/* Node A */}
|
|
75
|
+
<rect x="22" y="47" width="90" height="56" rx="7" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
76
|
+
<text x="67" y="70" textAnchor="middle" fill="#94A3B8" fontSize="11" fontFamily="system-ui,sans-serif" fontWeight="600">Auth</text>
|
|
77
|
+
<text x="67" y="83" textAnchor="middle" fill="#475569" fontSize="8" fontFamily="system-ui,sans-serif">service</text>
|
|
78
|
+
|
|
79
|
+
{/* Arrow */}
|
|
80
|
+
<line x1="112" y1="75" x2="163" y2="75" stroke="#2D3748" strokeWidth="1.5" markerEnd="url(#eo-arr)" />
|
|
81
|
+
|
|
82
|
+
{/* Node B - has child link (blue dot) */}
|
|
83
|
+
<rect x="167" y="47" width="90" height="56" rx="7" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
84
|
+
<text x="212" y="70" textAnchor="middle" fill="#94A3B8" fontSize="11" fontFamily="system-ui,sans-serif" fontWeight="600">API</text>
|
|
85
|
+
<text x="212" y="83" textAnchor="middle" fill="#475569" fontSize="8" fontFamily="system-ui,sans-serif">gateway</text>
|
|
86
|
+
|
|
87
|
+
{/* Blue dot with ripple */}
|
|
88
|
+
<circle cx="249" cy="54" r="4" fill="#3B82F6" />
|
|
89
|
+
<circle cx="249" cy="54" r="4" fill="none" stroke="#3B82F6" strokeWidth="1.5">
|
|
90
|
+
<animate attributeName="r" values="4;16" dur="2s" repeatCount="indefinite" />
|
|
91
|
+
<animate attributeName="opacity" values="0.7;0" dur="2s" repeatCount="indefinite" />
|
|
92
|
+
</circle>
|
|
93
|
+
|
|
94
|
+
{/* Hint label */}
|
|
95
|
+
<text x="212" y="35" textAnchor="middle" fill="#3B82F6" fontSize="7.5" fontFamily="system-ui,sans-serif">zoom in ↑</text>
|
|
96
|
+
</g>
|
|
97
|
+
|
|
98
|
+
{/* ── Inner scene: child diagram ── */}
|
|
99
|
+
<g className="eo-inner" opacity="0">
|
|
100
|
+
<rect width="280" height="150" fill="#0D1117" />
|
|
101
|
+
<GridDots prefix="z-i" />
|
|
102
|
+
<text x="140" y="18" textAnchor="middle" fill="#3B82F6" fontSize="8.5" fontFamily="system-ui,sans-serif" fontWeight="700" letterSpacing="0.05em">API GATEWAY - INTERNALS</text>
|
|
103
|
+
|
|
104
|
+
<rect x="15" y="35" width="72" height="46" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
105
|
+
<text x="51" y="55" textAnchor="middle" fill="#94A3B8" fontSize="10" fontFamily="system-ui,sans-serif" fontWeight="600">Router</text>
|
|
106
|
+
<text x="51" y="68" textAnchor="middle" fill="#475569" fontSize="7.5" fontFamily="system-ui,sans-serif">container</text>
|
|
107
|
+
|
|
108
|
+
<rect x="104" y="57" width="72" height="46" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
109
|
+
<text x="140" y="77" textAnchor="middle" fill="#94A3B8" fontSize="10" fontFamily="system-ui,sans-serif" fontWeight="600">Auth MW</text>
|
|
110
|
+
<text x="140" y="90" textAnchor="middle" fill="#475569" fontSize="7.5" fontFamily="system-ui,sans-serif">component</text>
|
|
111
|
+
|
|
112
|
+
<rect x="193" y="35" width="72" height="46" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
113
|
+
<text x="229" y="55" textAnchor="middle" fill="#94A3B8" fontSize="10" fontFamily="system-ui,sans-serif" fontWeight="600">Cache</text>
|
|
114
|
+
<text x="229" y="68" textAnchor="middle" fill="#475569" fontSize="7.5" fontFamily="system-ui,sans-serif">database</text>
|
|
115
|
+
|
|
116
|
+
<line x1="87" y1="62" x2="107" y2="75" stroke="#374151" strokeWidth="1.5" strokeDasharray="4,2" markerEnd="url(#eo-arr-dash)" />
|
|
117
|
+
<line x1="176" y1="75" x2="196" y2="62" stroke="#374151" strokeWidth="1.5" strokeDasharray="4,2" markerEnd="url(#eo-arr-dash)" />
|
|
118
|
+
</g>
|
|
119
|
+
</svg>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Step 0 - pan/navigate illustration
|
|
124
|
+
function PanIllustration() {
|
|
125
|
+
return (
|
|
126
|
+
<svg
|
|
127
|
+
viewBox="0 0 280 140"
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
+
style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block' }}
|
|
130
|
+
>
|
|
131
|
+
<rect width="280" height="140" fill="#0D1117" rx="8" />
|
|
132
|
+
<GridDots prefix="p" />
|
|
133
|
+
|
|
134
|
+
<rect x="20" y="30" width="70" height="44" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
135
|
+
<text x="55" y="57" textAnchor="middle" fill="#94A3B8" fontSize="9" fontFamily="system-ui,sans-serif">System A</text>
|
|
136
|
+
|
|
137
|
+
<rect x="105" y="48" width="70" height="44" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
138
|
+
<text x="140" y="75" textAnchor="middle" fill="#94A3B8" fontSize="9" fontFamily="system-ui,sans-serif">System B</text>
|
|
139
|
+
|
|
140
|
+
<rect x="190" y="30" width="70" height="44" rx="6" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
141
|
+
<text x="225" y="57" textAnchor="middle" fill="#94A3B8" fontSize="9" fontFamily="system-ui,sans-serif">System C</text>
|
|
142
|
+
|
|
143
|
+
{/* Directional arrows */}
|
|
144
|
+
<text x="140" y="19" textAnchor="middle" fill="#4A5568" fontSize="15" fontFamily="system-ui,sans-serif">↑</text>
|
|
145
|
+
<text x="140" y="134" textAnchor="middle" fill="#4A5568" fontSize="15" fontFamily="system-ui,sans-serif">↓</text>
|
|
146
|
+
<text x="8" y="77" textAnchor="middle" fill="#4A5568" fontSize="15" fontFamily="system-ui,sans-serif">←</text>
|
|
147
|
+
<text x="273" y="77" textAnchor="middle" fill="#4A5568" fontSize="15" fontFamily="system-ui,sans-serif">→</text>
|
|
148
|
+
|
|
149
|
+
<text x="140" y="118" textAnchor="middle" fill="#2D3748" fontSize="8.5" fontFamily="system-ui,sans-serif">scroll to zoom · drag to pan</text>
|
|
150
|
+
</svg>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Step 2 - zoom-out / breadcrumb illustration
|
|
155
|
+
function ZoomOutIllustration() {
|
|
156
|
+
return (
|
|
157
|
+
<svg
|
|
158
|
+
viewBox="0 0 280 140"
|
|
159
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
+
style={{ width: '100%', height: 'auto', borderRadius: 10, display: 'block' }}
|
|
161
|
+
>
|
|
162
|
+
<rect width="280" height="140" fill="#0D1117" rx="8" />
|
|
163
|
+
<GridDots prefix="b" />
|
|
164
|
+
|
|
165
|
+
{/* Outer parent box (dashed) */}
|
|
166
|
+
<rect x="10" y="10" width="260" height="120" rx="10" fill="none" stroke="#2D3748" strokeWidth="1.5" strokeDasharray="6,3" />
|
|
167
|
+
<text x="26" y="25" fill="#374151" fontSize="8.5" fontFamily="system-ui,sans-serif">Parent Diagram</text>
|
|
168
|
+
|
|
169
|
+
{/* Inner focused box */}
|
|
170
|
+
<rect x="50" y="30" width="180" height="88" rx="8" fill="#111827" stroke="#3B82F6" strokeWidth="1.5" />
|
|
171
|
+
<text x="140" y="46" textAnchor="middle" fill="#3B82F6" fontSize="8" fontFamily="system-ui,sans-serif" fontWeight="600">Current View</text>
|
|
172
|
+
|
|
173
|
+
{/* Inner nodes */}
|
|
174
|
+
<rect x="62" y="52" width="55" height="50" rx="5" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
175
|
+
<text x="89" y="81" textAnchor="middle" fill="#94A3B8" fontSize="8" fontFamily="system-ui,sans-serif">Service A</text>
|
|
176
|
+
|
|
177
|
+
<rect x="163" y="52" width="55" height="50" rx="5" fill="#1C2535" stroke="#2D3748" strokeWidth="1" />
|
|
178
|
+
<text x="190" y="81" textAnchor="middle" fill="#94A3B8" fontSize="8" fontFamily="system-ui,sans-serif">Service B</text>
|
|
179
|
+
|
|
180
|
+
{/* Breadcrumb trail */}
|
|
181
|
+
<text x="10" y="136" fill="#374151" fontSize="7.5" fontFamily="system-ui,sans-serif">All Diagrams / Parent / Current View</text>
|
|
182
|
+
|
|
183
|
+
{/* Zoom-out indicator */}
|
|
184
|
+
<circle cx="256" cy="24" r="10" fill="none" stroke="#3B82F6" strokeWidth="1.5" />
|
|
185
|
+
<line x1="252" y1="24" x2="260" y2="24" stroke="#3B82F6" strokeWidth="1.5" />
|
|
186
|
+
<line x1="262" y1="30" x2="267" y2="35" stroke="#3B82F6" strokeWidth="1.5" />
|
|
187
|
+
</svg>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// ── Steps data ─────────────────────────────────────────────────────────────────
|
|
192
|
+
|
|
193
|
+
const STEPS = [
|
|
194
|
+
{
|
|
195
|
+
title: 'Navigate the Canvas',
|
|
196
|
+
body: 'Scroll to zoom in and out. Drag to pan. Your entire architecture is laid out on one infinite canvas.',
|
|
197
|
+
visual: 'pan' as const,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
title: 'Zoom In to Dive Deeper',
|
|
201
|
+
body: 'Nodes with a blue dot \u2022 have a linked sub-diagram. Zoom in on one - the view automatically transitions inside.',
|
|
202
|
+
visual: 'zoom' as const,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: 'Zoom Out to Go Back',
|
|
206
|
+
body: 'Zoom out past the diagram boundary to return to the parent. Follow the breadcrumb at the top to jump anywhere.',
|
|
207
|
+
visual: 'zoomout' as const,
|
|
208
|
+
},
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
// ── Main component ─────────────────────────────────────────────────────────────
|
|
212
|
+
|
|
213
|
+
export default function ExploreOnboarding({ hasLinkedNodes }: Props) {
|
|
214
|
+
const [visible, setVisible] = useState(false)
|
|
215
|
+
const [step, setStep] = useState(0)
|
|
216
|
+
|
|
217
|
+
useEffect(() => {
|
|
218
|
+
if (!hasLinkedNodes) return
|
|
219
|
+
if (!localStorage.getItem(STORAGE_KEY)) {
|
|
220
|
+
setVisible(true)
|
|
221
|
+
}
|
|
222
|
+
}, [ hasLinkedNodes])
|
|
223
|
+
|
|
224
|
+
const dismiss = () => {
|
|
225
|
+
localStorage.setItem(STORAGE_KEY, '1')
|
|
226
|
+
setVisible(false)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!visible) return null
|
|
230
|
+
|
|
231
|
+
const current = STEPS[step]
|
|
232
|
+
const isLast = step === STEPS.length - 1
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<Box
|
|
236
|
+
position="fixed"
|
|
237
|
+
inset={0}
|
|
238
|
+
zIndex={2000}
|
|
239
|
+
display="flex"
|
|
240
|
+
alignItems="center"
|
|
241
|
+
justifyContent="center"
|
|
242
|
+
pointerEvents="none"
|
|
243
|
+
>
|
|
244
|
+
{/* Backdrop */}
|
|
245
|
+
<Box
|
|
246
|
+
position="absolute"
|
|
247
|
+
inset={0}
|
|
248
|
+
bg="blackAlpha.700"
|
|
249
|
+
pointerEvents="auto"
|
|
250
|
+
onClick={dismiss}
|
|
251
|
+
/>
|
|
252
|
+
|
|
253
|
+
{/* Tutorial card */}
|
|
254
|
+
<Box
|
|
255
|
+
position="relative"
|
|
256
|
+
w="380px"
|
|
257
|
+
bg="var(--bg-panel)"
|
|
258
|
+
border="1px solid"
|
|
259
|
+
borderColor="var(--border-main)"
|
|
260
|
+
borderRadius="16px"
|
|
261
|
+
p={6}
|
|
262
|
+
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)"
|
|
263
|
+
pointerEvents="auto"
|
|
264
|
+
>
|
|
265
|
+
{/* Skip Tutorial - always visible, top-right */}
|
|
266
|
+
<Button
|
|
267
|
+
position="absolute"
|
|
268
|
+
top={3}
|
|
269
|
+
right={3}
|
|
270
|
+
size="xs"
|
|
271
|
+
variant="ghost"
|
|
272
|
+
color="gray.500"
|
|
273
|
+
_hover={{ color: 'gray.200', bg: 'whiteAlpha.100' }}
|
|
274
|
+
onClick={dismiss}
|
|
275
|
+
fontWeight="normal"
|
|
276
|
+
>
|
|
277
|
+
Skip Tutorial
|
|
278
|
+
</Button>
|
|
279
|
+
|
|
280
|
+
{/* Step indicator dots */}
|
|
281
|
+
<HStack justify="center" spacing={2} mb={5}>
|
|
282
|
+
{STEPS.map((_, i) => (
|
|
283
|
+
<Box
|
|
284
|
+
key={i}
|
|
285
|
+
w={i === step ? '18px' : '6px'}
|
|
286
|
+
h="6px"
|
|
287
|
+
rounded="full"
|
|
288
|
+
bg={i === step ? 'blue.400' : 'gray.600'}
|
|
289
|
+
transition="all 0.25s ease"
|
|
290
|
+
cursor="pointer"
|
|
291
|
+
onClick={() => setStep(i)}
|
|
292
|
+
_hover={{ bg: i === step ? 'blue.400' : 'gray.500' }}
|
|
293
|
+
/>
|
|
294
|
+
))}
|
|
295
|
+
</HStack>
|
|
296
|
+
|
|
297
|
+
{/* Visual + text content */}
|
|
298
|
+
<VStack spacing={4} textAlign="center">
|
|
299
|
+
{current.visual === 'pan' && <PanIllustration />}
|
|
300
|
+
{current.visual === 'zoom' && <ZoomAnimation />}
|
|
301
|
+
{current.visual === 'zoomout' && <ZoomOutIllustration />}
|
|
302
|
+
|
|
303
|
+
<VStack spacing={2}>
|
|
304
|
+
<Text
|
|
305
|
+
fontWeight="bold"
|
|
306
|
+
fontSize="lg"
|
|
307
|
+
color="gray.100"
|
|
308
|
+
lineHeight="short"
|
|
309
|
+
>
|
|
310
|
+
{current.title}
|
|
311
|
+
</Text>
|
|
312
|
+
<Text
|
|
313
|
+
fontSize="sm"
|
|
314
|
+
color="gray.400"
|
|
315
|
+
lineHeight="tall"
|
|
316
|
+
maxW="300px"
|
|
317
|
+
>
|
|
318
|
+
{current.body}
|
|
319
|
+
</Text>
|
|
320
|
+
</VStack>
|
|
321
|
+
</VStack>
|
|
322
|
+
|
|
323
|
+
{/* Navigation: Back / Next (or Get Started) */}
|
|
324
|
+
<HStack mt={6} justify="space-between" align="center">
|
|
325
|
+
<Button
|
|
326
|
+
size="sm"
|
|
327
|
+
variant="ghost"
|
|
328
|
+
color="gray.500"
|
|
329
|
+
_hover={{ color: 'gray.300' }}
|
|
330
|
+
onClick={() => setStep(step - 1)}
|
|
331
|
+
visibility={step > 0 ? 'visible' : 'hidden'}
|
|
332
|
+
>
|
|
333
|
+
← Back
|
|
334
|
+
</Button>
|
|
335
|
+
<Button
|
|
336
|
+
size="sm"
|
|
337
|
+
colorScheme="blue"
|
|
338
|
+
px={5}
|
|
339
|
+
onClick={isLast ? dismiss : () => setStep(step + 1)}
|
|
340
|
+
>
|
|
341
|
+
{isLast ? 'Get Started' : 'Next →'}
|
|
342
|
+
</Button>
|
|
343
|
+
</HStack>
|
|
344
|
+
</Box>
|
|
345
|
+
</Box>
|
|
346
|
+
)
|
|
347
|
+
}
|