@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,140 @@
|
|
|
1
|
+
import type { ProxyConnectorDetails } from '../../crossBranch/types';
|
|
2
|
+
/** Pan + zoom state for the canvas viewport. */
|
|
3
|
+
export interface ZUIViewState {
|
|
4
|
+
/** World-space X of the canvas origin (panX). */
|
|
5
|
+
x: number;
|
|
6
|
+
/** World-space Y of the canvas origin (panY). */
|
|
7
|
+
y: number;
|
|
8
|
+
/** Current zoom multiplier (1 = 1 world-pixel per screen-pixel). */
|
|
9
|
+
zoom: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A node in the global world-space layout.
|
|
13
|
+
*
|
|
14
|
+
* Root-level nodes are placed directly from diagram coordinates.
|
|
15
|
+
* Each node that has a linked child diagram stores that diagram's
|
|
16
|
+
* elements in `children`, expressed in child-local (diagram-editor)
|
|
17
|
+
* coordinates. The `childScale` and `childOffset*` values map those
|
|
18
|
+
* local coords into the node's own NODE_W × NODE_H world footprint.
|
|
19
|
+
*/
|
|
20
|
+
export interface LayoutNode {
|
|
21
|
+
/** Unique stable id: "d{diagramId}-o{elementId}" */
|
|
22
|
+
id: string;
|
|
23
|
+
elementId: number;
|
|
24
|
+
diagramId: number;
|
|
25
|
+
worldX: number;
|
|
26
|
+
worldY: number;
|
|
27
|
+
/** Fixed: always NODE_W. */
|
|
28
|
+
worldW: number;
|
|
29
|
+
/** Fixed: always NODE_H. */
|
|
30
|
+
worldH: number;
|
|
31
|
+
label: string;
|
|
32
|
+
/** One of: person | system | container | component | database | queue | api | service | external */
|
|
33
|
+
type: string;
|
|
34
|
+
logoUrl: string | null;
|
|
35
|
+
description: string | null;
|
|
36
|
+
technology: string | null;
|
|
37
|
+
tags: string[];
|
|
38
|
+
isCircular?: boolean;
|
|
39
|
+
ancestorElementIds: number[];
|
|
40
|
+
pathElementIds: number[];
|
|
41
|
+
linkedDiagramId?: number;
|
|
42
|
+
linkedDiagramLabel?: string;
|
|
43
|
+
/** True when this node's children come from a portal (diagram-to-diagram) link, not an element-child link. */
|
|
44
|
+
isPortal?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Child nodes in CHILD-LOCAL coordinates (same coord space as the
|
|
47
|
+
* diagram editor). To draw them, apply:
|
|
48
|
+
* ctx.translate(worldX, worldY)
|
|
49
|
+
* ctx.scale(childScale, childScale)
|
|
50
|
+
* ctx.translate(-childOffsetX, -childOffsetY)
|
|
51
|
+
* …draw each child at child.worldX/worldY…
|
|
52
|
+
*/
|
|
53
|
+
children: LayoutNode[];
|
|
54
|
+
/** Scale factor: child-local → node world-space. */
|
|
55
|
+
childScale: number;
|
|
56
|
+
/** BBox minX used to align children to top-left of node. */
|
|
57
|
+
childOffsetX: number;
|
|
58
|
+
/** BBox minY used to align children to top-left of node. */
|
|
59
|
+
childOffsetY: number;
|
|
60
|
+
edgesOut: Array<{
|
|
61
|
+
/** LayoutNode id of the target. */
|
|
62
|
+
targetId: string;
|
|
63
|
+
label: string;
|
|
64
|
+
direction: 'forward' | 'backward' | 'both' | 'bidirectional' | string;
|
|
65
|
+
sourceHandle: string | null;
|
|
66
|
+
targetHandle: string | null;
|
|
67
|
+
type: string;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
/** Top-level group wrapping one root diagram. */
|
|
71
|
+
export interface DiagramGroupLayout {
|
|
72
|
+
/** True when this group is a portal-linked target diagram (not a hierarchy root). */
|
|
73
|
+
isPortal?: boolean;
|
|
74
|
+
diagramId: number;
|
|
75
|
+
label: string;
|
|
76
|
+
description: string | null;
|
|
77
|
+
level: number;
|
|
78
|
+
levelLabel: string | null;
|
|
79
|
+
/** Top-left of this diagram in world space. */
|
|
80
|
+
worldX: number;
|
|
81
|
+
worldY: number;
|
|
82
|
+
worldW: number;
|
|
83
|
+
worldH: number;
|
|
84
|
+
/** Dimensions of the main diagram box (excluding portals below). */
|
|
85
|
+
diagramW: number;
|
|
86
|
+
diagramH: number;
|
|
87
|
+
diagramX: number;
|
|
88
|
+
diagramY: number;
|
|
89
|
+
nodes: LayoutNode[];
|
|
90
|
+
/** Edges whose both endpoints are in this diagram. */
|
|
91
|
+
edges: Array<{
|
|
92
|
+
sourceId: string;
|
|
93
|
+
targetId: string;
|
|
94
|
+
label: string;
|
|
95
|
+
direction: string;
|
|
96
|
+
sourceHandle: string | null;
|
|
97
|
+
targetHandle: string | null;
|
|
98
|
+
type: string;
|
|
99
|
+
}>;
|
|
100
|
+
}
|
|
101
|
+
/** Bounding box in world space. */
|
|
102
|
+
export interface BBox {
|
|
103
|
+
minX: number;
|
|
104
|
+
minY: number;
|
|
105
|
+
maxX: number;
|
|
106
|
+
maxY: number;
|
|
107
|
+
}
|
|
108
|
+
/** Top-level result of the layout pass. */
|
|
109
|
+
export interface ZUILayout {
|
|
110
|
+
groups: DiagramGroupLayout[];
|
|
111
|
+
/** Bounding box of the whole layout in world space. */
|
|
112
|
+
bbox: BBox;
|
|
113
|
+
}
|
|
114
|
+
export type HoveredItem = {
|
|
115
|
+
type: 'node';
|
|
116
|
+
data: LayoutNode;
|
|
117
|
+
absX: number;
|
|
118
|
+
absY: number;
|
|
119
|
+
absW: number;
|
|
120
|
+
absH: number;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'edge';
|
|
123
|
+
data: {
|
|
124
|
+
sourceId: string;
|
|
125
|
+
targetId: string;
|
|
126
|
+
label: string;
|
|
127
|
+
diagramId: number;
|
|
128
|
+
sourceObjId?: number;
|
|
129
|
+
targetObjId?: number;
|
|
130
|
+
targetDiagId?: number;
|
|
131
|
+
isPortalConn?: boolean;
|
|
132
|
+
isProxy?: boolean;
|
|
133
|
+
details?: ProxyConnectorDetails;
|
|
134
|
+
};
|
|
135
|
+
absX: number;
|
|
136
|
+
absY: number;
|
|
137
|
+
} | {
|
|
138
|
+
type: 'group';
|
|
139
|
+
data: DiagramGroupLayout;
|
|
140
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BBox, DiagramGroupLayout, ZUIViewState, HoveredItem } from './types';
|
|
2
|
+
export declare function calculateMaxZoom(groups: DiagramGroupLayout[], canvasW: number): number;
|
|
3
|
+
export interface ZUIInteraction {
|
|
4
|
+
viewState: ZUIViewState;
|
|
5
|
+
/** Ref that is updated synchronously on every input event use this in RAF loops to avoid waiting for React renders. */
|
|
6
|
+
viewStateRef: React.MutableRefObject<ZUIViewState>;
|
|
7
|
+
setViewState: React.Dispatch<React.SetStateAction<ZUIViewState>>;
|
|
8
|
+
/** Call with the canvas DOMRect + layout bbox to fit all content. */
|
|
9
|
+
fitView: (canvasW: number, canvasH: number, bbox: {
|
|
10
|
+
minX: number;
|
|
11
|
+
minY: number;
|
|
12
|
+
maxX: number;
|
|
13
|
+
maxY: number;
|
|
14
|
+
}, padding?: number) => void;
|
|
15
|
+
maxZoom: number;
|
|
16
|
+
hoveredItem: HoveredItem | null;
|
|
17
|
+
setHoveredItem: (item: HoveredItem | null, force?: boolean) => void;
|
|
18
|
+
/** Set to true to prevent clearing hoveredItem (e.g. when mouse is over a popover). */
|
|
19
|
+
setHoverLocked: (locked: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useZUIInteraction(canvasRef: React.RefObject<HTMLCanvasElement | null>, initialView?: ZUIViewState, groups?: DiagramGroupLayout[], bbox?: BBox, onZoom?: () => void, onPan?: () => void, isMobile?: boolean, resolveHoveredProxyItem?: (worldX: number, worldY: number, view: ZUIViewState, canvasW: number) => HoveredItem | null): ZUIInteraction;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VS Code webview runtime configuration.
|
|
3
|
+
*
|
|
4
|
+
* Replaces runtime.ts for the vscode webview build:
|
|
5
|
+
* - Reads server URL from window.__TLD_SERVER_URL__ instead of import.meta.env
|
|
6
|
+
* - No Capacitor dependency (isNativeApp = false)
|
|
7
|
+
*/
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
__TLD_SERVER_URL__?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const appBase = "/app/";
|
|
14
|
+
export declare const routerBasename: undefined;
|
|
15
|
+
export declare const isNativeApp = false;
|
|
16
|
+
export declare const apiBase: string;
|
|
17
|
+
export declare function apiUrl(path: string): string;
|
|
18
|
+
export declare function oauthGoogleStartUrl(): string;
|
|
19
|
+
export declare function oauthGithubStartUrl(): string;
|
|
20
|
+
export declare function oauthAppleStartUrl(): string;
|
|
21
|
+
export declare const googleClientId = "945690634753-lcrtd97c5hnqdo5shkoaetstmtrqbk5t.apps.googleusercontent.com";
|
|
22
|
+
export declare const turnstileSiteKey = "0x4AAAAAACyQUcIpN2Yuy8-a";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const ACCENT_DEFAULT = "#63b3ed";
|
|
2
|
+
export declare const ACCENT_OPTIONS: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare const BACKGROUND_DEFAULT = "#0d121e";
|
|
7
|
+
export declare const BACKGROUND_OPTIONS: {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const ELEMENT_DEFAULT = "#2d3748";
|
|
12
|
+
export declare const ELEMENT_OPTIONS: {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const PARENT_VIEW_COLOR = "#63b3ed";
|
|
17
|
+
export declare const CHILD_VIEW_COLOR = "#4fd1c5";
|
|
18
|
+
export declare const PARENT_VIEW_BG = "rgba(99,179,237,0.12)";
|
|
19
|
+
export declare const PARENT_VIEW_BORDER = "rgba(99,179,237,0.25)";
|
|
20
|
+
export declare const CHILD_VIEW_BG = "rgba(79,209,197,0.12)";
|
|
21
|
+
export declare const CHILD_VIEW_BORDER = "rgba(79,209,197,0.25)";
|
|
22
|
+
export declare const DRAWING_COLORS: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Convert a 6-char hex color to `rgba(r, g, b, alpha)`.
|
|
25
|
+
* Used to compute dynamic shadows from the accent value.
|
|
26
|
+
*/
|
|
27
|
+
export declare function hexToRgba(hex: string, alpha: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PARENT_VIEW_COLOR as PARENT_DIAGRAM_COLOR, CHILD_VIEW_COLOR as CHILD_DIAGRAM_COLOR, PARENT_VIEW_BG as PARENT_DIAGRAM_BG, PARENT_VIEW_BORDER as PARENT_DIAGRAM_BORDER, CHILD_VIEW_BG as CHILD_DIAGRAM_BG, CHILD_VIEW_BORDER as CHILD_DIAGRAM_BORDER, } from './colors';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface ThemeContextValue {
|
|
3
|
+
accent: string;
|
|
4
|
+
setAccent: (value: string) => void;
|
|
5
|
+
background: string;
|
|
6
|
+
setBackground: (value: string) => void;
|
|
7
|
+
elementColor: string;
|
|
8
|
+
setElementColor: (value: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function ThemeProvider({ children, isAuthenticated, defaultAccent, defaultBackground, defaultElementColor, storagePrefix, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
isAuthenticated?: boolean;
|
|
13
|
+
defaultAccent?: string;
|
|
14
|
+
defaultBackground?: string;
|
|
15
|
+
defaultElementColor?: string;
|
|
16
|
+
storagePrefix?: string;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function useTheme(): ThemeContextValue;
|
|
19
|
+
/**
|
|
20
|
+
* Backward compatibility alias
|
|
21
|
+
* @deprecated Use useTheme() instead
|
|
22
|
+
*/
|
|
23
|
+
export declare function useAccentColor(): {
|
|
24
|
+
accent: string;
|
|
25
|
+
setAccent: (value: string) => void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Connector, ExploreData, PlacedElement } from '../types';
|
|
2
|
+
import type { WorkspaceGraphSnapshot } from './types';
|
|
3
|
+
export declare function buildWorkspaceGraphSnapshot(data: ExploreData): WorkspaceGraphSnapshot;
|
|
4
|
+
export declare function isDescendantView(snapshot: WorkspaceGraphSnapshot, maybeDescendantId: number | null | undefined, ancestorId: number | null | undefined): boolean;
|
|
5
|
+
export declare function findLowestCommonAncestorViewId(snapshot: WorkspaceGraphSnapshot, leftViewId: number | null | undefined, rightViewId: number | null | undefined): number | null;
|
|
6
|
+
export declare function relativeOwnerElementPath(snapshot: WorkspaceGraphSnapshot, ancestorViewId: number, descendantViewId: number): number[];
|
|
7
|
+
export declare function viewName(snapshot: WorkspaceGraphSnapshot, viewId: number | null | undefined): string | null;
|
|
8
|
+
export declare function allConnectors(snapshot: WorkspaceGraphSnapshot): Connector[];
|
|
9
|
+
export declare function upsertConnectorInSnapshot(snapshot: WorkspaceGraphSnapshot | null, connector: Connector): WorkspaceGraphSnapshot | null;
|
|
10
|
+
export declare function removeConnectorFromSnapshot(snapshot: WorkspaceGraphSnapshot | null, viewId: number, connectorId: number): WorkspaceGraphSnapshot | null;
|
|
11
|
+
export declare function upsertPlacementInSnapshot(snapshot: WorkspaceGraphSnapshot | null, viewId: number, placement: PlacedElement): WorkspaceGraphSnapshot | null;
|
|
12
|
+
export declare function removePlacementFromSnapshot(snapshot: WorkspaceGraphSnapshot | null, viewId: number, elementId: number): WorkspaceGraphSnapshot | null;
|
|
13
|
+
export declare function overrideViewContentInSnapshot(snapshot: WorkspaceGraphSnapshot | null, viewId: number, placements: PlacedElement[], connectors: Connector[]): WorkspaceGraphSnapshot | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PlacedElement } from '../types';
|
|
2
|
+
import type { AggregatedProxyConnector, CrossBranchContextSettings, ProxyConnectorDetails, ProxyContextNode, WorkspaceGraphSnapshot } from './types';
|
|
3
|
+
export interface ViewProxyGraphResult {
|
|
4
|
+
proxyNodes: ProxyContextNode[];
|
|
5
|
+
proxyConnectors: AggregatedProxyConnector[];
|
|
6
|
+
proxyConnectorDetailsByKey: Record<string, ProxyConnectorDetails>;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveViewProxyGraph(snapshot: WorkspaceGraphSnapshot | null, currentViewId: number | null, currentViewElements: PlacedElement[], settings: CrossBranchContextSettings): ViewProxyGraphResult;
|
|
9
|
+
export interface ZUIResolvedConnector {
|
|
10
|
+
key: string;
|
|
11
|
+
sourceElementId: number;
|
|
12
|
+
targetElementId: number;
|
|
13
|
+
sourceAnchorElementId: number;
|
|
14
|
+
targetAnchorElementId: number;
|
|
15
|
+
sourceNodeId: string;
|
|
16
|
+
targetNodeId: string;
|
|
17
|
+
direction: string;
|
|
18
|
+
style: string;
|
|
19
|
+
label: string;
|
|
20
|
+
details: ProxyConnectorDetails;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveZUIProxyConnectors(snapshot: WorkspaceGraphSnapshot | null, visibleNodeIdsByElementId: Map<number, string>, settings: CrossBranchContextSettings): ZUIResolvedConnector[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CrossBranchContextSettings, CrossBranchSurface } from './types';
|
|
2
|
+
export declare function useCrossBranchContextSettings(surface: CrossBranchSurface): {
|
|
3
|
+
settings: CrossBranchContextSettings;
|
|
4
|
+
setEnabled: (enabled: boolean) => void;
|
|
5
|
+
setDepth: (depth: number) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExploreData } from '../types';
|
|
2
|
+
import { upsertConnectorInSnapshot, upsertPlacementInSnapshot } from './graph';
|
|
3
|
+
import type { WorkspaceGraphSnapshot } from './types';
|
|
4
|
+
export declare function primeWorkspaceGraphSnapshot(data: ExploreData): void;
|
|
5
|
+
export declare function loadWorkspaceGraphSnapshot(force?: boolean): Promise<WorkspaceGraphSnapshot>;
|
|
6
|
+
export declare function subscribeWorkspaceGraphSnapshot(listener: (snapshot: WorkspaceGraphSnapshot | null) => void): () => void;
|
|
7
|
+
export declare function useWorkspaceGraphSnapshot(enabled?: boolean): WorkspaceGraphSnapshot | null;
|
|
8
|
+
export declare function upsertConnectorGraphSnapshot(connector: Parameters<typeof upsertConnectorInSnapshot>[1]): void;
|
|
9
|
+
export declare function removeConnectorGraphSnapshot(viewId: number, connectorId: number): void;
|
|
10
|
+
export declare function upsertPlacementGraphSnapshot(viewId: number, placement: Parameters<typeof upsertPlacementInSnapshot>[2]): void;
|
|
11
|
+
export declare function removePlacementGraphSnapshot(viewId: number, elementId: number): void;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Connector, ExploreData, PlacedElement, ViewTreeNode } from '../types';
|
|
2
|
+
export declare const CROSS_BRANCH_DEPTH_ALL = 5;
|
|
3
|
+
export declare const CROSS_BRANCH_DEPTH_MIN = 1;
|
|
4
|
+
export declare const CROSS_BRANCH_DEPTH_MAX = 5;
|
|
5
|
+
export type CrossBranchSurface = 'editor' | 'zui' | 'zui-shared';
|
|
6
|
+
export interface CrossBranchContextSettings {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
depth: number;
|
|
9
|
+
}
|
|
10
|
+
export interface GraphPlacementRef {
|
|
11
|
+
viewId: number;
|
|
12
|
+
viewName: string;
|
|
13
|
+
element: PlacedElement;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkspaceGraphSnapshot {
|
|
16
|
+
source: ExploreData;
|
|
17
|
+
tree: ViewTreeNode[];
|
|
18
|
+
views: Record<number, {
|
|
19
|
+
view: ViewTreeNode;
|
|
20
|
+
placements: PlacedElement[];
|
|
21
|
+
connectors: Connector[];
|
|
22
|
+
}>;
|
|
23
|
+
viewById: Record<number, ViewTreeNode>;
|
|
24
|
+
placementsByViewId: Record<number, PlacedElement[]>;
|
|
25
|
+
connectorsByViewId: Record<number, Connector[]>;
|
|
26
|
+
placementsByElementId: Record<number, GraphPlacementRef[]>;
|
|
27
|
+
childViewIdByOwnerElementId: Record<number, number>;
|
|
28
|
+
descendantsByViewId: Record<number, number[]>;
|
|
29
|
+
ancestorsByViewId: Record<number, number[]>;
|
|
30
|
+
}
|
|
31
|
+
export interface ProxyEndpoint {
|
|
32
|
+
actualElementId: number;
|
|
33
|
+
actualElementName: string;
|
|
34
|
+
anchorElementId: number;
|
|
35
|
+
anchorElementName: string;
|
|
36
|
+
anchorViewId: number | null;
|
|
37
|
+
anchorViewName: string | null;
|
|
38
|
+
placementViewId: number | null;
|
|
39
|
+
placementViewName: string | null;
|
|
40
|
+
depth: number;
|
|
41
|
+
externalToView: boolean;
|
|
42
|
+
currentBranchElementId: number | null;
|
|
43
|
+
commonAncestorViewId: number | null;
|
|
44
|
+
commonAncestorViewName: string | null;
|
|
45
|
+
mergeAncestorElementId?: number | null;
|
|
46
|
+
contextPathElementIds?: number[];
|
|
47
|
+
}
|
|
48
|
+
export interface ProxyConnectorLeaf {
|
|
49
|
+
connector: Connector;
|
|
50
|
+
ownerViewId: number;
|
|
51
|
+
ownerViewName: string;
|
|
52
|
+
source: ProxyEndpoint;
|
|
53
|
+
target: ProxyEndpoint;
|
|
54
|
+
}
|
|
55
|
+
export interface ProxyConnectorDetails {
|
|
56
|
+
key: string;
|
|
57
|
+
label: string;
|
|
58
|
+
count: number;
|
|
59
|
+
sourceAnchorId: string;
|
|
60
|
+
targetAnchorId: string;
|
|
61
|
+
sourceAnchorName: string;
|
|
62
|
+
targetAnchorName: string;
|
|
63
|
+
ownerViewIds: number[];
|
|
64
|
+
ownerViewNames: string[];
|
|
65
|
+
connectors: ProxyConnectorLeaf[];
|
|
66
|
+
}
|
|
67
|
+
export interface AggregatedProxyConnector {
|
|
68
|
+
key: string;
|
|
69
|
+
sourceAnchorId: string;
|
|
70
|
+
targetAnchorId: string;
|
|
71
|
+
direction: string;
|
|
72
|
+
style: string;
|
|
73
|
+
label: string;
|
|
74
|
+
count: number;
|
|
75
|
+
sourceElementId: number | null;
|
|
76
|
+
targetElementId: number | null;
|
|
77
|
+
details: ProxyConnectorDetails;
|
|
78
|
+
}
|
|
79
|
+
export interface ProxyContextNode {
|
|
80
|
+
id: string;
|
|
81
|
+
anchorElementId: number;
|
|
82
|
+
name: string;
|
|
83
|
+
sortLevel: number;
|
|
84
|
+
placementViewId: number | null;
|
|
85
|
+
kind: string | null;
|
|
86
|
+
description: string | null;
|
|
87
|
+
technology: string | null;
|
|
88
|
+
logoUrl: string | null;
|
|
89
|
+
technologyConnectors: PlacedElement['technology_connectors'];
|
|
90
|
+
ownerViewIds: number[];
|
|
91
|
+
ownerViewNames: string[];
|
|
92
|
+
commonAncestorViewId: number | null;
|
|
93
|
+
commonAncestorViewName: string | null;
|
|
94
|
+
currentBranchElementId: number | null;
|
|
95
|
+
connectorCount: number;
|
|
96
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Demo entry point.
|
|
3
|
+
* Overrides the real `api` singleton with localStorage-backed implementations
|
|
4
|
+
* and patches window.history to redirect /views/:id → /demo/:id, all for the
|
|
5
|
+
* lifetime of this component. Restores everything on unmount.
|
|
6
|
+
* No auth required; served at /demo and /demo/:id routes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DemoNavigator(): null;
|
|
9
|
+
export default function DemoPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LibraryElement, PlacedElement, Connector, ViewTreeNode, ViewLayer } from '../types';
|
|
2
|
+
export declare const DEMO_ELEMENTS: LibraryElement[];
|
|
3
|
+
export declare const DEMO_VIEWS: ViewTreeNode[];
|
|
4
|
+
type ViewPlacements = Record<number, PlacedElement[]>;
|
|
5
|
+
type ViewConnectors = Record<number, Connector[]>;
|
|
6
|
+
export declare const DEMO_PLACEMENTS: ViewPlacements;
|
|
7
|
+
export declare const DEMO_CONNECTORS: ViewConnectors;
|
|
8
|
+
export declare const DEMO_LAYERS: Record<number, ViewLayer[]>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* localStorage-backed store for the demo mode.
|
|
3
|
+
* Implements the subset of the `api` interface used by ViewEditor and its hooks.
|
|
4
|
+
* Data is scoped under the `diag:demo:*` key namespace to avoid colliding
|
|
5
|
+
* with a real logged-in session.
|
|
6
|
+
*/
|
|
7
|
+
import type { LibraryElement, PlacedElement, Connector, ViewTreeNode, ViewLayer, Tag, ElementPlacement, ExploreData } from '../types';
|
|
8
|
+
export declare function initDemoStore(): void;
|
|
9
|
+
export declare function resetDemoStore(): void;
|
|
10
|
+
export declare const demoApi: {
|
|
11
|
+
explore: {
|
|
12
|
+
load: () => Promise<ExploreData>;
|
|
13
|
+
};
|
|
14
|
+
elements: {
|
|
15
|
+
list: (_params?: unknown) => Promise<LibraryElement[]>;
|
|
16
|
+
get: (id: number) => Promise<LibraryElement>;
|
|
17
|
+
create: (data: Partial<LibraryElement>) => Promise<LibraryElement>;
|
|
18
|
+
update: (id: number, data: Partial<LibraryElement>) => Promise<LibraryElement>;
|
|
19
|
+
delete: (_orgId: string, id: number) => Promise<void>;
|
|
20
|
+
placements: (id: number) => Promise<ElementPlacement[]>;
|
|
21
|
+
};
|
|
22
|
+
workspace: {
|
|
23
|
+
orgs: {
|
|
24
|
+
tagColors: {
|
|
25
|
+
list: () => Promise<Record<string, Tag>>;
|
|
26
|
+
set: (tag: string, color: string, description?: string) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
views: {
|
|
30
|
+
list: () => Promise<{
|
|
31
|
+
id: number;
|
|
32
|
+
owner_element_id: number | null;
|
|
33
|
+
name: string;
|
|
34
|
+
label: string | null;
|
|
35
|
+
is_root: boolean;
|
|
36
|
+
created_at: string;
|
|
37
|
+
updated_at: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
get: (id: number) => Promise<ViewTreeNode>;
|
|
40
|
+
content: (id: number) => Promise<{
|
|
41
|
+
placements: PlacedElement[];
|
|
42
|
+
connectors: Connector[];
|
|
43
|
+
}>;
|
|
44
|
+
tree: () => Promise<ViewTreeNode[]>;
|
|
45
|
+
create: (data: {
|
|
46
|
+
name: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
parent_view_id?: number | null;
|
|
49
|
+
}) => Promise<{
|
|
50
|
+
id: number;
|
|
51
|
+
owner_element_id: number | null;
|
|
52
|
+
name: string;
|
|
53
|
+
label: string | null;
|
|
54
|
+
is_root: boolean;
|
|
55
|
+
created_at: string;
|
|
56
|
+
updated_at: string;
|
|
57
|
+
}>;
|
|
58
|
+
update: (id: number, data: {
|
|
59
|
+
name: string;
|
|
60
|
+
label?: string;
|
|
61
|
+
}) => Promise<{
|
|
62
|
+
id: number;
|
|
63
|
+
owner_element_id: number | null;
|
|
64
|
+
name: string;
|
|
65
|
+
label: string | null;
|
|
66
|
+
is_root: boolean;
|
|
67
|
+
created_at: string;
|
|
68
|
+
updated_at: string;
|
|
69
|
+
}>;
|
|
70
|
+
delete: (_orgId: string, id: number) => Promise<void>;
|
|
71
|
+
placements: {
|
|
72
|
+
list: (viewId: number) => Promise<ElementPlacement[]>;
|
|
73
|
+
add: (viewId: number, elementId: number, x?: number, y?: number) => Promise<ElementPlacement>;
|
|
74
|
+
updatePosition: (viewId: number, elementId: number, x: number, y: number) => Promise<void>;
|
|
75
|
+
remove: (viewId: number, elementId: number) => Promise<void>;
|
|
76
|
+
};
|
|
77
|
+
layers: {
|
|
78
|
+
list: (viewId: number) => Promise<ViewLayer[]>;
|
|
79
|
+
create: (viewId: number, data: {
|
|
80
|
+
name: string;
|
|
81
|
+
tags: string[];
|
|
82
|
+
color?: string;
|
|
83
|
+
}) => Promise<ViewLayer>;
|
|
84
|
+
update: (viewId: number, layerId: number, data: Partial<ViewLayer>) => Promise<ViewLayer>;
|
|
85
|
+
delete: (viewId: number, layerId: number) => Promise<void>;
|
|
86
|
+
};
|
|
87
|
+
reactions: {
|
|
88
|
+
list: (_viewId: number) => Promise<never[]>;
|
|
89
|
+
};
|
|
90
|
+
threads: {
|
|
91
|
+
listForElement: () => Promise<never[]>;
|
|
92
|
+
listForConnector: () => Promise<never[]>;
|
|
93
|
+
createForElement: () => Promise<never>;
|
|
94
|
+
createForConnector: () => Promise<never>;
|
|
95
|
+
addComment: () => Promise<never>;
|
|
96
|
+
resolve: () => Promise<void>;
|
|
97
|
+
};
|
|
98
|
+
thumbnail: (_id: number) => Promise<null>;
|
|
99
|
+
rename: (id: number, name: string) => Promise<{
|
|
100
|
+
id: number;
|
|
101
|
+
owner_element_id: number | null;
|
|
102
|
+
name: string;
|
|
103
|
+
label: string | null;
|
|
104
|
+
is_root: boolean;
|
|
105
|
+
created_at: string;
|
|
106
|
+
updated_at: string;
|
|
107
|
+
}>;
|
|
108
|
+
setLevel: () => Promise<void>;
|
|
109
|
+
reparent: () => Promise<never>;
|
|
110
|
+
};
|
|
111
|
+
connectors: {
|
|
112
|
+
list: (viewId: number) => Promise<Connector[]>;
|
|
113
|
+
create: (viewId: number, data: {
|
|
114
|
+
source_element_id: number;
|
|
115
|
+
target_element_id: number;
|
|
116
|
+
label?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
relationship?: string;
|
|
119
|
+
direction?: string;
|
|
120
|
+
style?: string;
|
|
121
|
+
url?: string;
|
|
122
|
+
source_handle?: string | null;
|
|
123
|
+
target_handle?: string | null;
|
|
124
|
+
}) => Promise<Connector>;
|
|
125
|
+
update: (viewId: number, connectorId: number, data: Partial<Connector>) => Promise<Connector>;
|
|
126
|
+
delete: (_orgId: string, connectorId: number) => Promise<void>;
|
|
127
|
+
};
|
|
128
|
+
elements: {
|
|
129
|
+
list: (params?: unknown) => Promise<LibraryElement[]>;
|
|
130
|
+
get: (id: number) => Promise<LibraryElement>;
|
|
131
|
+
create: (data: Partial<LibraryElement>) => Promise<LibraryElement>;
|
|
132
|
+
update: (id: number, data: Partial<LibraryElement>) => Promise<LibraryElement>;
|
|
133
|
+
delete: (orgId: string, id: number) => Promise<void>;
|
|
134
|
+
placements: (id: number) => Promise<ElementPlacement[]>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type MutableRefObject, type RefObject } from 'react';
|
|
2
|
+
import { type Node as RFNode, type ReactFlowInstance } from 'reactflow';
|
|
3
|
+
export interface ViewEditorDemoOptions {
|
|
4
|
+
revealProgress?: number;
|
|
5
|
+
disableImportExport?: boolean;
|
|
6
|
+
hideFlowControls?: boolean;
|
|
7
|
+
disableOnboarding?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEMO_VIEW_EDITOR_OPTIONS: Omit<ViewEditorDemoOptions, 'revealProgress'>;
|
|
10
|
+
interface UseDemoRevealViewportArgs {
|
|
11
|
+
demoOptions?: ViewEditorDemoOptions;
|
|
12
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
rfNodesRef: MutableRefObject<RFNode[]>;
|
|
14
|
+
rfReadyRef: MutableRefObject<boolean>;
|
|
15
|
+
needsFitViewRef: MutableRefObject<boolean>;
|
|
16
|
+
computedMinZoom: number;
|
|
17
|
+
setViewport: ReactFlowInstance['setViewport'];
|
|
18
|
+
resetKey: number | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function useDemoRevealViewport({ demoOptions, containerRef, rfNodesRef, rfReadyRef, needsFitViewRef, computedMinZoom, setViewport, resetKey, }: UseDemoRevealViewportArgs): {
|
|
21
|
+
clampedRevealProgress: number | null;
|
|
22
|
+
applyDemoRevealViewport: () => boolean;
|
|
23
|
+
disableImportExport: boolean;
|
|
24
|
+
hideFlowControls: boolean;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
|
3
|
+
<defs>
|
|
4
|
+
<clipPath id="roundsq">
|
|
5
|
+
<rect width="1024" height="1024" rx="224" ry="224" />
|
|
6
|
+
</clipPath>
|
|
7
|
+
<filter id="dshadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
8
|
+
<feGaussianBlur in="SourceAlpha" stdDeviation="32" result="blur1" />
|
|
9
|
+
<feFlood flood-color="#63b3ed" flood-opacity="0.3" result="c1" />
|
|
10
|
+
<feComposite in="c1" in2="blur1" operator="in" result="glow1" />
|
|
11
|
+
<feGaussianBlur in="SourceAlpha" stdDeviation="10" result="blur2" />
|
|
12
|
+
<feFlood flood-color="#90cdf4" flood-opacity="0.5" result="c2" />
|
|
13
|
+
<feComposite in="c2" in2="blur2" operator="in" result="glow2" />
|
|
14
|
+
<feDropShadow dx="0" dy="20" stdDeviation="20" flood-color="#000" flood-opacity="0.9"
|
|
15
|
+
result="drop" />
|
|
16
|
+
<feMerge>
|
|
17
|
+
<feMergeNode in="glow1" />
|
|
18
|
+
<feMergeNode in="glow2" />
|
|
19
|
+
<feMergeNode in="SourceGraphic" />
|
|
20
|
+
</feMerge>
|
|
21
|
+
</filter>
|
|
22
|
+
<linearGradient id="dgrad" x1="0" y1="0" x2="0.6" y2="1">
|
|
23
|
+
<stop offset="0" stop-color="#90cdf4" />
|
|
24
|
+
<stop offset="0.45" stop-color="#63b3ed" />
|
|
25
|
+
<stop offset="1" stop-color="#2b6cb0" />
|
|
26
|
+
</linearGradient>
|
|
27
|
+
</defs>
|
|
28
|
+
<g clip-path="url(#roundsq)" transform="matrix(1, 0, 0, 1, -1.4210854715202004e-14, 0)">
|
|
29
|
+
<g filter="url(#dshadow)" transform="translate(78, 118) scale(0.8)" fill-rule="evenodd">
|
|
30
|
+
<path
|
|
31
|
+
d="M201 18s169-39 340-2c171 38 342 152 342 457S713 902 544 949c-170 48-344 19-344 19l1-566h302V217H201z M455 715c-67 83-122 141-62 48q23-35 33-62h-4a78 78 0 1 1 78-78q0 24-12 44-11 21-33 48"
|
|
32
|
+
fill="url(#dgrad)" />
|
|
33
|
+
</g>
|
|
34
|
+
</g>
|
|
35
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps React Flow's fitView with protections against the d3-zoom NaN
|
|
4
|
+
* poisoning bug that occurs when the container is narrow at load time.
|
|
5
|
+
*
|
|
6
|
+
* Guards:
|
|
7
|
+
* 1. Container width - skips fitView if container is too narrow for d3-zoom
|
|
8
|
+
* to compute a valid transform.
|
|
9
|
+
* 2. Post-call NaN check - if the viewport is still NaN after the call,
|
|
10
|
+
* resets to a known-safe fallback.
|
|
11
|
+
*
|
|
12
|
+
* Returns `boolean`: true if fitView was attempted, false if skipped.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useSafeFitView(containerRef?: RefObject<HTMLElement | null>): {
|
|
15
|
+
safeFitView: (options?: Parameters<import("reactflow").FitView>[0]) => boolean;
|
|
16
|
+
};
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.panel-search-container{padding:.75rem;flex-shrink:0}.panel-search-input{background-color:#ffffff0a!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:10px!important;font-size:.75rem!important;transition:all .2s ease!important}.panel-search-input:focus{background-color:#ffffff14!important;border-color:var(--accent)!important;box-shadow:none!important}.panel-action-button{width:100%;height:100%;padding:8px 12px;display:flex;align-items:center;cursor:pointer;transition:all .2s ease}.panel-action-button:hover:not(:disabled){background-color:#ffffff0f}.panel-action-button:active:not(:disabled){transform:translateY(1px)}.panel-action-icon-container{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;background-color:#ffffff0f;border:1px solid rgba(255,255,255,.08);margin-right:.75rem;flex-shrink:0;transition:all .2s ease}.panel-action-button:hover .panel-action-icon-container{color:var(--accent)}.panel-section-title{font-size:.7rem;font-weight:700;color:#ffffffe6;letter-spacing:.02em;text-transform:uppercase;padding:1rem 1rem .75rem}
|