symbiote-ui 0.3.0-alpha.4
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/CHANGELOG.md +46 -0
- package/LICENSE +21 -0
- package/README.md +76 -0
- package/canvas/AutoLayout.js +731 -0
- package/canvas/Breadcrumb/Breadcrumb.css.js +75 -0
- package/canvas/Breadcrumb/Breadcrumb.js +96 -0
- package/canvas/Breadcrumb/Breadcrumb.tpl.js +7 -0
- package/canvas/CanvasConnectionRenderer.js +971 -0
- package/canvas/CanvasGraph/CanvasGraph.css.js +29 -0
- package/canvas/CanvasGraph/CanvasGraph.js +1697 -0
- package/canvas/CanvasGraph/CanvasGraphDrawState.js +280 -0
- package/canvas/CanvasGraph/CanvasGraphGeometry.js +194 -0
- package/canvas/CanvasViewport.js +550 -0
- package/canvas/ConnectionRenderer.js +1283 -0
- package/canvas/FlowSimulator.js +326 -0
- package/canvas/ForceLayout.js +226 -0
- package/canvas/ForceWorker.js +1303 -0
- package/canvas/FrameManager.js +223 -0
- package/canvas/GraphExplorerShell/GraphExplorerShell.css.js +136 -0
- package/canvas/GraphExplorerShell/GraphExplorerShell.js +129 -0
- package/canvas/GraphExplorerShell/GraphExplorerShell.tpl.js +12 -0
- package/canvas/GraphTabs/GraphTabs.css.js +101 -0
- package/canvas/GraphTabs/GraphTabs.js +189 -0
- package/canvas/GraphTabs/GraphTabs.tpl.js +12 -0
- package/canvas/LODManager.js +88 -0
- package/canvas/Minimap/Minimap.css.js +73 -0
- package/canvas/Minimap/Minimap.js +210 -0
- package/canvas/Minimap/Minimap.tpl.js +7 -0
- package/canvas/NodeCanvas/NodeCanvas.css.js +398 -0
- package/canvas/NodeCanvas/NodeCanvas.js +1499 -0
- package/canvas/NodeCanvas/NodeCanvas.tpl.js +22 -0
- package/canvas/NodeSearch/NodeSearch.css.js +97 -0
- package/canvas/NodeSearch/NodeSearch.js +140 -0
- package/canvas/NodeSearch/NodeSearch.tpl.js +25 -0
- package/canvas/NodeViewManager.js +748 -0
- package/canvas/PcbRouteDiagnostics.js +463 -0
- package/canvas/PcbRouter.js +1127 -0
- package/canvas/PinExpansion.js +134 -0
- package/canvas/PseudoConnection.js +84 -0
- package/canvas/SelectionSync.js +163 -0
- package/canvas/SubgraphManager.js +203 -0
- package/canvas/SubgraphRouter.js +452 -0
- package/canvas/ViewportActions.js +473 -0
- package/canvas/graph-explorer.js +339 -0
- package/canvas/graph-layout.js +148 -0
- package/canvas/graph-model.js +68 -0
- package/canvas/html-in-canvas.js +202 -0
- package/canvas/project-graph-builder.js +440 -0
- package/canvas/project-graph-model.js +183 -0
- package/chat/ChatComposer/ChatComposer.css.js +652 -0
- package/chat/ChatComposer/ChatComposer.js +304 -0
- package/chat/ChatList/ChatList.css.js +102 -0
- package/chat/ChatList/ChatList.js +99 -0
- package/chat/ChatList/ChatList.tpl.js +20 -0
- package/chat/ChatListItem/ChatListItem.css.js +117 -0
- package/chat/ChatListItem/ChatListItem.js +32 -0
- package/chat/ChatListItem/ChatListItem.tpl.js +17 -0
- package/chat/ChatMessageItem/ChatMessageItem.css.js +628 -0
- package/chat/ChatMessageItem/ChatMessageItem.js +156 -0
- package/chat/ChatSidebar/ChatSidebar.css.js +150 -0
- package/chat/ChatSidebar/ChatSidebar.js +230 -0
- package/chat/ChatSidebar/ChatSidebar.tpl.js +18 -0
- package/chat/ChatSidebar/constants.js +11 -0
- package/chat/ChatSidebarItem/ChatSidebarItem.css.js +445 -0
- package/chat/ChatSidebarItem/ChatSidebarItem.js +304 -0
- package/chat/ChatTranscript/ChatTranscript.css.js +90 -0
- package/chat/ChatTranscript/ChatTranscript.js +244 -0
- package/chat/chat-context.js +123 -0
- package/chat/message-model.js +156 -0
- package/cli.js +20 -0
- package/control/Button/Button.css.js +93 -0
- package/control/Button/Button.js +78 -0
- package/control/Button/Button.tpl.js +3 -0
- package/control/Field/Field.css.js +91 -0
- package/control/Field/Field.js +17 -0
- package/control/Field/Field.tpl.js +3 -0
- package/core/Connection.js +47 -0
- package/core/Editor.js +449 -0
- package/core/Frame.js +33 -0
- package/core/GraphMermaid.js +348 -0
- package/core/GraphText.js +228 -0
- package/core/Node.js +145 -0
- package/core/Portal.js +106 -0
- package/core/Socket.js +187 -0
- package/core/SubgraphNode.js +121 -0
- package/core/base-path.js +55 -0
- package/core/dom-utils.js +14 -0
- package/core/index.js +18 -0
- package/core/local-cache.js +26 -0
- package/core/state-sync.js +227 -0
- package/custom-elements.json +6380 -0
- package/discover.js +240 -0
- package/display/Badge/Badge.css.js +44 -0
- package/display/Badge/Badge.js +17 -0
- package/display/Badge/Badge.tpl.js +3 -0
- package/display/Banner/Banner.css.js +61 -0
- package/display/Banner/Banner.js +17 -0
- package/display/Banner/Banner.tpl.js +3 -0
- package/display/CodeBlock/CodeBlock.css.js +194 -0
- package/display/CodeBlock/CodeBlock.js +220 -0
- package/display/CodeBlock/CodeBlock.tpl.js +11 -0
- package/display/DataTable/DataTable.css.js +101 -0
- package/display/DataTable/DataTable.js +136 -0
- package/display/DataTable/DataTable.tpl.js +13 -0
- package/display/EmptyState/EmptyState.css.js +33 -0
- package/display/EmptyState/EmptyState.js +17 -0
- package/display/EmptyState/EmptyState.tpl.js +3 -0
- package/display/EventFeed/EventFeed.css.js +145 -0
- package/display/EventFeed/EventFeed.js +64 -0
- package/display/EventFeed/EventFeed.tpl.js +14 -0
- package/display/EventFeed/EventFeedItem.js +116 -0
- package/display/EventFeed/EventFeedItem.tpl.js +22 -0
- package/display/LoadingOverlay/LoadingOverlay.css.js +91 -0
- package/display/LoadingOverlay/LoadingOverlay.js +48 -0
- package/display/LoadingOverlay/LoadingOverlay.tpl.js +12 -0
- package/display/Metric/Metric.css.js +60 -0
- package/display/Metric/Metric.js +17 -0
- package/display/Metric/Metric.tpl.js +6 -0
- package/display/OutputGraphPreview/OutputGraphPreview.css.js +122 -0
- package/display/OutputGraphPreview/OutputGraphPreview.js +89 -0
- package/display/OutputGraphPreview/OutputGraphPreview.tpl.js +13 -0
- package/display/OutputListPreview/OutputListPreview.css.js +109 -0
- package/display/OutputListPreview/OutputListPreview.js +77 -0
- package/display/OutputListPreview/OutputListPreview.tpl.js +13 -0
- package/display/SourceEditor/SourceEditor.css.js +39 -0
- package/display/SourceEditor/SourceEditor.js +129 -0
- package/display/SourceEditor/SourceEditor.tpl.js +10 -0
- package/display/SourceViewer/SourceViewer.css.js +80 -0
- package/display/SourceViewer/SourceViewer.js +418 -0
- package/display/SourceViewer/SourceViewer.tpl.js +17 -0
- package/display/StatusRibbon/StatusRibbon.css.js +73 -0
- package/display/StatusRibbon/StatusRibbon.js +87 -0
- package/display/StatusRibbon/StatusRibbon.tpl.js +7 -0
- package/display/event-feed-adapter.js +72 -0
- package/display/format-utils.js +29 -0
- package/display/highlight.js +659 -0
- package/display/icons.js +37 -0
- package/display/markdown-formatter.js +60 -0
- package/display/network-approval-page.js +487 -0
- package/display/output-preview.js +261 -0
- package/effects/CellBg/CellBg.css.js +33 -0
- package/effects/CellBg/CellBg.js +410 -0
- package/effects/CellBg/CellBg.tpl.js +5 -0
- package/graph/canvas-adapter.js +223 -0
- package/graph/graph-algorithms.js +31 -0
- package/graph/index.js +46 -0
- package/graph/model.js +176 -0
- package/graph/project-graph-build.js +66 -0
- package/graph/project-graph-metadata.js +253 -0
- package/graph/project-package.js +128 -0
- package/graph/project-runtime.js +116 -0
- package/graph/project-transaction.js +284 -0
- package/graph/skeleton-utils.js +84 -0
- package/graph/theme-contract.js +36 -0
- package/graph/transaction-parser.js +56 -0
- package/icons/MaterialSymbols.js +69 -0
- package/icons/material-symbols-outlined-400.ttf +0 -0
- package/icons/material-symbols.css +24 -0
- package/index.js +95 -0
- package/inspector/InspectorPanel/InspectorPanel.css.js +375 -0
- package/inspector/InspectorPanel/InspectorPanel.js +368 -0
- package/inspector/InspectorPanel/InspectorPanel.tpl.js +96 -0
- package/inspector/TemplatePreview/TemplatePreview.css.js +104 -0
- package/inspector/TemplatePreview/TemplatePreview.js +145 -0
- package/inspector/TemplatePreview/TemplatePreview.tpl.js +33 -0
- package/interactions/ConnectFlow.js +304 -0
- package/interactions/Drag.js +104 -0
- package/interactions/Selector.js +133 -0
- package/interactions/SnapGrid.js +66 -0
- package/interactions/Zoom.js +139 -0
- package/layout/ActionZone/ActionZone.css.js +88 -0
- package/layout/ActionZone/ActionZone.js +261 -0
- package/layout/ActionZone/ActionZone.tpl.js +11 -0
- package/layout/CrossLayoutPortalBridge/CrossLayoutPortalBridge.js +255 -0
- package/layout/Layout/Layout.css.js +91 -0
- package/layout/Layout/Layout.js +637 -0
- package/layout/Layout/Layout.tpl.js +27 -0
- package/layout/LayoutNode/LayoutNode.css.js +302 -0
- package/layout/LayoutNode/LayoutNode.js +509 -0
- package/layout/LayoutNode/LayoutNode.tpl.js +39 -0
- package/layout/LayoutPreview/LayoutPreview.css.js +46 -0
- package/layout/LayoutPreview/LayoutPreview.js +102 -0
- package/layout/LayoutPreview/LayoutPreview.tpl.js +6 -0
- package/layout/LayoutRouter/LayoutRouter.js +274 -0
- package/layout/LayoutRouter/SectionRegistry.js +135 -0
- package/layout/LayoutRouter/routerSync.js +250 -0
- package/layout/LayoutSidebar/LayoutSidebar.css.js +411 -0
- package/layout/LayoutSidebar/LayoutSidebar.js +368 -0
- package/layout/LayoutSidebar/LayoutSidebar.tpl.js +26 -0
- package/layout/LayoutSidebar/SidebarSection.css.js +20 -0
- package/layout/LayoutSidebar/SidebarSection.js +184 -0
- package/layout/LayoutSidebar/SidebarSection.tpl.js +22 -0
- package/layout/LayoutTree.js +373 -0
- package/layout/PanelMenu/PanelMenu.css.js +43 -0
- package/layout/PanelMenu/PanelMenu.js +95 -0
- package/layout/PanelMenu/PanelMenu.tpl.js +17 -0
- package/layout/ProjectTabs/ProjectTabs.css.js +188 -0
- package/layout/ProjectTabs/ProjectTabs.js +77 -0
- package/layout/ProjectTabs/ProjectTabs.tpl.js +15 -0
- package/layout/index.js +40 -0
- package/list/ListDetailShell/ListDetailShell.css.js +128 -0
- package/list/ListDetailShell/ListDetailShell.js +72 -0
- package/list/ListDetailShell/ListDetailShell.tpl.js +36 -0
- package/list/ListItem/ListItem.css.js +111 -0
- package/list/ListItem/ListItem.js +66 -0
- package/list/ListItem/ListItem.tpl.js +18 -0
- package/locale/index.js +503 -0
- package/manifest/component-registry.js +2446 -0
- package/manifest/graph-schema.js +285 -0
- package/manifest/index.js +6 -0
- package/manifest/project-schema-catalog.js +246 -0
- package/manifest/rule-catalog.js +201 -0
- package/manifest/theme-catalog.js +2149 -0
- package/manifest/ui-schema-catalog.js +334 -0
- package/menu/ContextMenu/ContextMenu.css.js +61 -0
- package/menu/ContextMenu/ContextMenu.js +82 -0
- package/menu/ContextMenu/ContextMenu.tpl.js +19 -0
- package/navigation/QuickOpen/QuickOpen.css.js +92 -0
- package/navigation/QuickOpen/QuickOpen.js +185 -0
- package/navigation/QuickOpen/QuickOpen.tpl.js +15 -0
- package/navigation/quick-open-utils.js +101 -0
- package/node/CtrlItem/CtrlItem.css.js +41 -0
- package/node/CtrlItem/CtrlItem.js +24 -0
- package/node/CtrlItem/CtrlItem.tpl.js +17 -0
- package/node/GraphFrame/GraphFrame.css.js +66 -0
- package/node/GraphFrame/GraphFrame.js +32 -0
- package/node/GraphFrame/GraphFrame.tpl.js +13 -0
- package/node/GraphNode/GraphNode.css.js +815 -0
- package/node/GraphNode/GraphNode.js +173 -0
- package/node/GraphNode/GraphNode.tpl.js +33 -0
- package/node/NodeCallout/NodeCallout.css.js +91 -0
- package/node/NodeCallout/NodeCallout.js +281 -0
- package/node/NodeCallout/NodeCallout.tpl.js +8 -0
- package/node/NodeSocket/NodeSocket.css.js +68 -0
- package/node/NodeSocket/NodeSocket.js +26 -0
- package/node/NodeSocket/NodeSocket.tpl.js +7 -0
- package/node/PortItem/PortItem.css.js +93 -0
- package/node/PortItem/PortItem.js +87 -0
- package/node/PortItem/PortItem.tpl.js +10 -0
- package/package.json +165 -0
- package/palette/PaletteBrowser/PaletteBrowser.css.js +143 -0
- package/palette/PaletteBrowser/PaletteBrowser.js +152 -0
- package/palette/PaletteBrowser/PaletteBrowser.tpl.js +23 -0
- package/plugins/History.js +408 -0
- package/plugins/Readonly.js +60 -0
- package/rules/symbiote-3x.json +170 -0
- package/schemas/component-descriptor-v1.json +91 -0
- package/schemas/component-descriptor-v2.json +145 -0
- package/schemas/graph-model-v1.json +179 -0
- package/schemas/graph-v1.json +91 -0
- package/schemas/project-package-v1.json +102 -0
- package/schemas/project-transaction-v1.json +114 -0
- package/schemas/runtime-ui-v1.json +80 -0
- package/schemas/theme-rule-block-v1.json +73 -0
- package/shapes/CircleShape.js +79 -0
- package/shapes/CommentShape.js +35 -0
- package/shapes/DiamondShape.js +130 -0
- package/shapes/NodeShape.js +79 -0
- package/shapes/PillShape.js +91 -0
- package/shapes/RectShape.js +84 -0
- package/shapes/SVGShape.js +525 -0
- package/shapes/index.js +63 -0
- package/surface/Card/Card.css.js +57 -0
- package/surface/Card/Card.js +17 -0
- package/surface/Card/Card.tpl.js +3 -0
- package/themes/Palette.js +30 -0
- package/themes/Skin.js +113 -0
- package/themes/Theme.js +82 -0
- package/themes/carbon.js +135 -0
- package/themes/dark.js +140 -0
- package/themes/default-dark.js +714 -0
- package/themes/default-provider.css +635 -0
- package/themes/default-provider.js +718 -0
- package/themes/ebook.js +136 -0
- package/themes/grey.js +137 -0
- package/themes/light.js +139 -0
- package/themes/neon.js +138 -0
- package/themes/pcb.js +273 -0
- package/themes/synthwave.js +138 -0
- package/tokens/base.json +29 -0
- package/tokens/themes/carbon.json +11 -0
- package/tokens/themes/dark.json +12 -0
- package/tokens/themes/default-dark.json +1543 -0
- package/tokens/themes/default-provider.json +1543 -0
- package/tokens/themes/ebook.json +11 -0
- package/tokens/themes/grey.json +11 -0
- package/tokens/themes/light.json +12 -0
- package/tokens/themes/neon.json +11 -0
- package/tokens/themes/pcb.json +11 -0
- package/tokens/themes/synthwave.json +11 -0
- package/toolbar/QuickToolbar/QuickToolbar.css.js +152 -0
- package/toolbar/QuickToolbar/QuickToolbar.js +529 -0
- package/toolbar/QuickToolbar/QuickToolbar.tpl.js +34 -0
- package/tree/TreePanel/TreePanel.css.js +112 -0
- package/tree/TreePanel/TreePanel.js +147 -0
- package/tree/TreePanel/TreePanel.tpl.js +18 -0
- package/tree/TreeView/TreeView.css.js +122 -0
- package/tree/TreeView/TreeView.js +365 -0
- package/tree/TreeView/TreeView.tpl.js +10 -0
- package/ui/dialogs.js +221 -0
- package/ui/host-adapters.js +114 -0
- package/ui/index.js +660 -0
- package/ui/locale.js +50 -0
- package/ui/overlay-stack.js +89 -0
- package/ui/shared-styles.js +26 -0
- package/webmcp.js +37 -0
- package/xr/deep-graph.js +646 -0
- package/xr/emulation.js +198 -0
- package/xr/gesture.js +228 -0
- package/xr/html-canvas-renderer.js +472 -0
- package/xr/index.js +15 -0
- package/xr/layout-projection.js +1046 -0
- package/xr/panel-frame.js +128 -0
- package/xr/panel-host.js +267 -0
- package/xr/pointer.js +258 -0
- package/xr/scene-controller.js +242 -0
- package/xr/spatial-scene.js +212 -0
- package/xr/theme-bridge.js +105 -0
- package/xr/three-webxr-adapter.js +3439 -0
- package/xr/webgl-layer-renderer.js +419 -0
- package/xr/webxr.js +679 -0
- package/xr/workbench.js +516 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { normalizeGraphEdge, normalizeGraphModel, normalizeGraphNode } from './model.js';
|
|
2
|
+
import { normalizeProjectPackage } from './project-package.js';
|
|
3
|
+
|
|
4
|
+
const LOCAL_PATH_PATTERN = /(^|[\s"'=:])(?:\/Users\/|\/home\/|[A-Za-z]:\\)/;
|
|
5
|
+
const SUPPORTED_OPERATIONS = new Set([
|
|
6
|
+
'graph.addNode',
|
|
7
|
+
'graph.addEdge',
|
|
8
|
+
'layout.addPanel',
|
|
9
|
+
'layout.setRoot',
|
|
10
|
+
'layout.updateNode',
|
|
11
|
+
'theme.setModifier',
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
function asObject(value) {
|
|
15
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const FORBIDDEN_PATCH_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
19
|
+
const ALLOWED_LAYOUT_PATCH_KEYS = new Set(['rect', 'weight']);
|
|
20
|
+
const ALLOWED_NODE_PATCH_KEYS = new Set(['layout', 'props', 'attrs']);
|
|
21
|
+
|
|
22
|
+
function normalizeId(value, fieldName) {
|
|
23
|
+
const id = String(value ?? '').trim();
|
|
24
|
+
if (!id) throw new Error(`${fieldName} is required`);
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function assertNoLocalPaths(value) {
|
|
29
|
+
if (LOCAL_PATH_PATTERN.test(JSON.stringify(value))) {
|
|
30
|
+
throw new Error('project transaction contains an absolute local path');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function normalizeOperation(rawOperation) {
|
|
35
|
+
const data = asObject(rawOperation);
|
|
36
|
+
const type = normalizeId(data.type, 'operation.type');
|
|
37
|
+
if (!SUPPORTED_OPERATIONS.has(type)) {
|
|
38
|
+
throw new Error(`unsupported project transaction operation "${type}"`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (type === 'graph.addNode') {
|
|
42
|
+
return {
|
|
43
|
+
type,
|
|
44
|
+
graph: normalizeId(data.graph, 'operation.graph'),
|
|
45
|
+
node: normalizeGraphNode(data.node),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (type === 'graph.addEdge') {
|
|
50
|
+
return {
|
|
51
|
+
type,
|
|
52
|
+
graph: normalizeId(data.graph, 'operation.graph'),
|
|
53
|
+
edge: normalizeGraphEdge(data.edge),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (type === 'layout.setRoot') {
|
|
58
|
+
return {
|
|
59
|
+
type,
|
|
60
|
+
layout: normalizeId(data.layout, 'operation.layout'),
|
|
61
|
+
root: asObject(data.root),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (type === 'layout.addPanel') {
|
|
66
|
+
return {
|
|
67
|
+
type,
|
|
68
|
+
layout: normalizeId(data.layout, 'operation.layout'),
|
|
69
|
+
parentId: data.parentId == null ? null : normalizeId(data.parentId, 'operation.parentId'),
|
|
70
|
+
panel: asObject(data.panel),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (type === 'layout.updateNode') {
|
|
75
|
+
return {
|
|
76
|
+
type,
|
|
77
|
+
layout: normalizeId(data.layout, 'operation.layout'),
|
|
78
|
+
nodeId: normalizeId(data.nodeId, 'operation.nodeId'),
|
|
79
|
+
patch: asObject(data.patch),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
type,
|
|
85
|
+
theme: normalizeId(data.theme, 'operation.theme'),
|
|
86
|
+
name: normalizeId(data.name, 'operation.name'),
|
|
87
|
+
value: data.value,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function normalizeProjectTransaction(rawTransaction = {}) {
|
|
92
|
+
assertNoLocalPaths(rawTransaction);
|
|
93
|
+
const data = asObject(rawTransaction);
|
|
94
|
+
const version = String(data.version ?? 'project-transaction-v1');
|
|
95
|
+
if (version !== 'project-transaction-v1') {
|
|
96
|
+
throw new Error(`unsupported project transaction version "${version}"`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
version,
|
|
101
|
+
id: normalizeId(data.id, 'transaction.id'),
|
|
102
|
+
targetProject: data.targetProject == null ? null : String(data.targetProject),
|
|
103
|
+
operations: (data.operations || []).map(normalizeOperation),
|
|
104
|
+
metadata: asObject(data.metadata),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function cloneProjectForMutation(project) {
|
|
109
|
+
return JSON.parse(JSON.stringify({
|
|
110
|
+
...project,
|
|
111
|
+
graphsById: undefined,
|
|
112
|
+
layoutsById: undefined,
|
|
113
|
+
themesById: undefined,
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function applyOperation(project, operation) {
|
|
118
|
+
if (operation.type === 'graph.addNode') {
|
|
119
|
+
const graph = project.graphs[operation.graph];
|
|
120
|
+
if (!graph) throw new Error(`graph "${operation.graph}" is not defined`);
|
|
121
|
+
graph.nodes.push(operation.node);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (operation.type === 'graph.addEdge') {
|
|
126
|
+
const graph = project.graphs[operation.graph];
|
|
127
|
+
if (!graph) throw new Error(`graph "${operation.graph}" is not defined`);
|
|
128
|
+
graph.edges.push(operation.edge);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (operation.type === 'layout.setRoot') {
|
|
133
|
+
const layout = project.layouts[operation.layout];
|
|
134
|
+
if (!layout) throw new Error(`layout "${operation.layout}" is not defined`);
|
|
135
|
+
layout.root = operation.root;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (operation.type === 'layout.addPanel') {
|
|
140
|
+
const layout = project.layouts[operation.layout];
|
|
141
|
+
if (!layout) throw new Error(`layout "${operation.layout}" is not defined`);
|
|
142
|
+
addPanelToLayout(layout, operation);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (operation.type === 'layout.updateNode') {
|
|
147
|
+
const layout = project.layouts[operation.layout];
|
|
148
|
+
if (!layout) throw new Error(`layout "${operation.layout}" is not defined`);
|
|
149
|
+
updateLayoutNode(layout, operation.nodeId, operation.patch);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const theme = project.themes[operation.theme];
|
|
154
|
+
if (!theme) throw new Error(`theme "${operation.theme}" is not defined`);
|
|
155
|
+
theme.modifiers = {
|
|
156
|
+
...asObject(theme.modifiers),
|
|
157
|
+
[operation.name]: operation.value,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function addPanelToLayout(layout, operation) {
|
|
162
|
+
const panel = operation.panel;
|
|
163
|
+
if (!panel.component) throw new Error('operation.panel.component is required');
|
|
164
|
+
|
|
165
|
+
if (!operation.parentId) {
|
|
166
|
+
layout.root = {
|
|
167
|
+
...asObject(layout.root),
|
|
168
|
+
children: [...(Array.isArray(layout.root?.children) ? layout.root.children : []), panel],
|
|
169
|
+
};
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const inserted = appendChildById(layout.root, operation.parentId, panel);
|
|
174
|
+
if (!inserted) throw new Error(`layout parent "${operation.parentId}" is not defined`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function appendChildById(node, parentId, child) {
|
|
178
|
+
if (!node || typeof node !== 'object') return false;
|
|
179
|
+
if (node.id === parentId) {
|
|
180
|
+
node.children = [...(Array.isArray(node.children) ? node.children : []), child];
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
for (const nested of node.children || []) {
|
|
184
|
+
if (appendChildById(nested, parentId, child)) return true;
|
|
185
|
+
}
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function assertPlainPatchObject(value, path) {
|
|
190
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
191
|
+
throw new Error(`${path} must be an object`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function cloneSafePatchObject(value, path) {
|
|
196
|
+
assertPlainPatchObject(value, path);
|
|
197
|
+
let next = {};
|
|
198
|
+
for (const [key, child] of Object.entries(value)) {
|
|
199
|
+
if (FORBIDDEN_PATCH_KEYS.has(key)) {
|
|
200
|
+
throw new Error(`layout.updateNode patch key "${key}" is not allowed`);
|
|
201
|
+
}
|
|
202
|
+
next[key] = child && typeof child === 'object' && !Array.isArray(child)
|
|
203
|
+
? cloneSafePatchObject(child, `${path}.${key}`)
|
|
204
|
+
: child;
|
|
205
|
+
}
|
|
206
|
+
return next;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function normalizeLayoutPatch(layoutPatch) {
|
|
210
|
+
assertPlainPatchObject(layoutPatch, 'layout.updateNode.patch.layout');
|
|
211
|
+
let next = {};
|
|
212
|
+
for (const [key, value] of Object.entries(layoutPatch)) {
|
|
213
|
+
if (!ALLOWED_LAYOUT_PATCH_KEYS.has(key)) {
|
|
214
|
+
throw new Error(`layout.updateNode patch.layout.${key} is not allowed`);
|
|
215
|
+
}
|
|
216
|
+
next[key] = value && typeof value === 'object' && !Array.isArray(value)
|
|
217
|
+
? cloneSafePatchObject(value, `layout.updateNode.patch.layout.${key}`)
|
|
218
|
+
: value;
|
|
219
|
+
}
|
|
220
|
+
return next;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function normalizeLayoutNodePatch(patch) {
|
|
224
|
+
assertPlainPatchObject(patch, 'layout.updateNode.patch');
|
|
225
|
+
let next = {};
|
|
226
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
227
|
+
if (!ALLOWED_NODE_PATCH_KEYS.has(key)) {
|
|
228
|
+
throw new Error(`layout.updateNode patch.${key} is not allowed`);
|
|
229
|
+
}
|
|
230
|
+
next[key] = key === 'layout'
|
|
231
|
+
? normalizeLayoutPatch(value)
|
|
232
|
+
: cloneSafePatchObject(value, `layout.updateNode.patch.${key}`);
|
|
233
|
+
}
|
|
234
|
+
return next;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function mergePatch(target, patch) {
|
|
238
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
239
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && target[key] && typeof target[key] === 'object' && !Array.isArray(target[key])) {
|
|
240
|
+
target[key] = mergePatch({ ...target[key] }, value);
|
|
241
|
+
} else {
|
|
242
|
+
target[key] = value;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return target;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function patchNodeById(node, nodeId, patch) {
|
|
249
|
+
if (!node || typeof node !== 'object') return false;
|
|
250
|
+
if (node.id === nodeId) {
|
|
251
|
+
mergePatch(node, patch);
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
if (patchNodeById(node.first, nodeId, patch) || patchNodeById(node.second, nodeId, patch)) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
for (const nested of node.children || []) {
|
|
258
|
+
if (patchNodeById(nested, nodeId, patch)) return true;
|
|
259
|
+
}
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export function updateLayoutNode(layout, nodeId, patch, options = {}) {
|
|
264
|
+
const root = options.root || layout?.root;
|
|
265
|
+
if (!root) throw new Error('layout.root is required');
|
|
266
|
+
const updated = patchNodeById(root, nodeId, normalizeLayoutNodePatch(patch));
|
|
267
|
+
if (!updated) throw new Error(`layout node "${nodeId}" is not defined`);
|
|
268
|
+
return layout;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function applyProjectTransaction(project, rawTransaction) {
|
|
272
|
+
const transaction = normalizeProjectTransaction(rawTransaction);
|
|
273
|
+
const nextProject = cloneProjectForMutation(project);
|
|
274
|
+
|
|
275
|
+
for (const operation of transaction.operations) {
|
|
276
|
+
applyOperation(nextProject, operation);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
for (const [id, graph] of Object.entries(nextProject.graphs)) {
|
|
280
|
+
nextProject.graphs[id] = normalizeGraphModel(graph);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return normalizeProjectPackage(nextProject);
|
|
284
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const basenameIndexes = new WeakMap()
|
|
2
|
+
|
|
3
|
+
export function dirOf(filePath) {
|
|
4
|
+
if (!filePath) return './'
|
|
5
|
+
const idx = filePath.lastIndexOf('/')
|
|
6
|
+
return idx >= 0 ? filePath.slice(0, idx + 1) : './'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function baseName(filePath) {
|
|
10
|
+
if (!filePath) return '?'
|
|
11
|
+
const idx = filePath.lastIndexOf('/')
|
|
12
|
+
return idx >= 0 ? filePath.slice(idx + 1) : filePath
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function buildBasenameIndex(knownFiles) {
|
|
16
|
+
const cached = basenameIndexes.get(knownFiles)
|
|
17
|
+
if (cached) return cached
|
|
18
|
+
|
|
19
|
+
const index = new Map()
|
|
20
|
+
for (const file of knownFiles) {
|
|
21
|
+
const base = baseName(file)
|
|
22
|
+
if (!index.has(base)) index.set(base, file)
|
|
23
|
+
if (!base.endsWith('.js') && !index.has(base + '.js')) {
|
|
24
|
+
index.set(base + '.js', file)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
basenameIndexes.set(knownFiles, index)
|
|
28
|
+
return index
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function resolveImport(importPath, fromFile, knownFiles) {
|
|
32
|
+
if (knownFiles.has(importPath)) return importPath
|
|
33
|
+
if (knownFiles.has(importPath + '.js')) return importPath + '.js'
|
|
34
|
+
|
|
35
|
+
if (importPath.startsWith('.')) {
|
|
36
|
+
const dir = dirOf(fromFile)
|
|
37
|
+
let resolved = dir + importPath.replace(/^\.\//, '')
|
|
38
|
+
const parts = resolved.split('/')
|
|
39
|
+
const normalized = []
|
|
40
|
+
for (const part of parts) {
|
|
41
|
+
if (part === '..') normalized.pop()
|
|
42
|
+
else if (part !== '.') normalized.push(part)
|
|
43
|
+
}
|
|
44
|
+
resolved = normalized.join('/')
|
|
45
|
+
|
|
46
|
+
if (knownFiles.has(resolved)) return resolved
|
|
47
|
+
if (knownFiles.has(resolved + '.js')) return resolved + '.js'
|
|
48
|
+
if (knownFiles.has(resolved + '/index.js')) return resolved + '/index.js'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const base = importPath.split('/').pop()
|
|
52
|
+
const index = buildBasenameIndex(knownFiles)
|
|
53
|
+
return index.get(base) || index.get(base.replace(/\.js$/, '')) || null
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function collectSkeletonFiles(skeleton = {}) {
|
|
57
|
+
const files = new Set()
|
|
58
|
+
const assetFiles = new Set()
|
|
59
|
+
const classFiles = new Set()
|
|
60
|
+
|
|
61
|
+
for (const data of Object.values(skeleton.n || {})) {
|
|
62
|
+
if (data.f) {
|
|
63
|
+
files.add(data.f)
|
|
64
|
+
classFiles.add(data.f)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const file of Object.keys(skeleton.X || {})) {
|
|
68
|
+
files.add(file)
|
|
69
|
+
}
|
|
70
|
+
for (const [dir, names] of Object.entries(skeleton.f || {})) {
|
|
71
|
+
for (const name of names) {
|
|
72
|
+
files.add(dir === './' ? name : dir + name)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const [dir, names] of Object.entries(skeleton.a || {})) {
|
|
76
|
+
for (const name of names) {
|
|
77
|
+
const fullPath = dir === './' ? name : dir + name
|
|
78
|
+
files.add(fullPath)
|
|
79
|
+
assetFiles.add(fullPath)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return { files, assetFiles, classFiles }
|
|
84
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const GRAPH_TYPE_COLOR_TOKENS = Object.freeze({
|
|
2
|
+
action: '--sn-graph-type-action',
|
|
3
|
+
output: '--sn-graph-type-output',
|
|
4
|
+
data: '--sn-graph-type-data',
|
|
5
|
+
config: '--sn-graph-type-config',
|
|
6
|
+
external: '--sn-graph-type-external',
|
|
7
|
+
style: '--sn-graph-type-style',
|
|
8
|
+
docs: '--sn-graph-type-docs',
|
|
9
|
+
asset: '--sn-graph-type-asset',
|
|
10
|
+
group: '--sn-graph-type-group',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const GRAPH_CLUSTER_COLOR_TOKENS = Object.freeze([
|
|
14
|
+
'--sn-graph-cluster-0',
|
|
15
|
+
'--sn-graph-cluster-1',
|
|
16
|
+
'--sn-graph-cluster-2',
|
|
17
|
+
'--sn-graph-cluster-3',
|
|
18
|
+
'--sn-graph-cluster-4',
|
|
19
|
+
'--sn-graph-cluster-5',
|
|
20
|
+
'--sn-graph-cluster-6',
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
export function getGraphClusterColorToken(index = 0) {
|
|
24
|
+
let token = GRAPH_CLUSTER_COLOR_TOKENS[Math.abs(Number(index) || 0) % GRAPH_CLUSTER_COLOR_TOKENS.length];
|
|
25
|
+
return `var(${token})`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isGraphColorReference(value) {
|
|
29
|
+
let color = String(value || '').trim();
|
|
30
|
+
return /^#?[0-9a-f]{3}([0-9a-f]{3})?$/i.test(color) || /^var\(--sn-[A-Za-z0-9_-]+\)$/.test(color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function normalizeGraphColorReference(value, fallbackIndex = 0) {
|
|
34
|
+
let color = String(value || '').trim();
|
|
35
|
+
return isGraphColorReference(color) ? color : getGraphClusterColorToken(fallbackIndex);
|
|
36
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction Parser — extract project-transaction-v1 blocks from chat messages.
|
|
3
|
+
*
|
|
4
|
+
* Parses fenced code blocks in agent messages to find structured
|
|
5
|
+
* project transaction payloads.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const TRANSACTION_FENCE_RE = /```([^\n`]*)\n([\s\S]*?)```/g
|
|
9
|
+
const AGENT_ROLES = new Set(['agent', 'assistant'])
|
|
10
|
+
|
|
11
|
+
function parseJsonBlock(source) {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(source)
|
|
14
|
+
} catch {
|
|
15
|
+
return null
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function transactionItems(value) {
|
|
20
|
+
if (Array.isArray(value)) return value
|
|
21
|
+
return value && typeof value === 'object' ? [value] : []
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isTransactionFence(info, payload) {
|
|
25
|
+
const normalizedInfo = String(info || '').toLowerCase()
|
|
26
|
+
if (normalizedInfo.includes('project-transaction-v1')) return true
|
|
27
|
+
return payload?.version === 'project-transaction-v1'
|
|
28
|
+
|| (Array.isArray(payload) && payload.some((item) => item?.version === 'project-transaction-v1'))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Extract project-transaction-v1 items from an array of chat messages.
|
|
33
|
+
*
|
|
34
|
+
* Scans agent/assistant messages for fenced code blocks containing
|
|
35
|
+
* valid project-transaction-v1 JSON payloads.
|
|
36
|
+
*
|
|
37
|
+
* @param {Array<{role: string, text?: string, content?: string}>} [messages=[]]
|
|
38
|
+
* @returns {Array<object>} Extracted transaction objects
|
|
39
|
+
*/
|
|
40
|
+
export function extractProjectTransactionsFromMessages(messages = []) {
|
|
41
|
+
const transactions = []
|
|
42
|
+
for (const message of messages || []) {
|
|
43
|
+
if (!AGENT_ROLES.has(message?.role)) continue
|
|
44
|
+
const text = String(message.text || message.content || '')
|
|
45
|
+
for (const match of text.matchAll(TRANSACTION_FENCE_RE)) {
|
|
46
|
+
const payload = parseJsonBlock(match[2].trim())
|
|
47
|
+
if (!isTransactionFence(match[1], payload)) continue
|
|
48
|
+
for (const item of transactionItems(payload)) {
|
|
49
|
+
if (item?.version === 'project-transaction-v1' && item.id && Array.isArray(item.operations)) {
|
|
50
|
+
transactions.push(item)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return transactions
|
|
56
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const MATERIAL_SYMBOLS_LOCAL_URL = new URL('./material-symbols.css', import.meta.url).href;
|
|
2
|
+
|
|
3
|
+
const ICON_NAME_RE = /^[a-z0-9_]+$/;
|
|
4
|
+
|
|
5
|
+
/** @type {Set<string>} */
|
|
6
|
+
const loadedIcons = new Set();
|
|
7
|
+
|
|
8
|
+
const LINK_SELECTOR = 'link[data-sn-material-symbols="managed"]';
|
|
9
|
+
|
|
10
|
+
/** @type {{ autoload: boolean, hrefBuilder: ((iconNames: string[]) => string)|null }} */
|
|
11
|
+
const config = {
|
|
12
|
+
autoload: true,
|
|
13
|
+
hrefBuilder: null,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Configure Material Symbols loading for host apps with strict CSP, privacy,
|
|
18
|
+
* or alternative font delivery requirements.
|
|
19
|
+
* @param {{ autoload?: boolean, hrefBuilder?: ((iconNames: string[]) => string)|null }} options
|
|
20
|
+
*/
|
|
21
|
+
export function configureMaterialSymbols(options = {}) {
|
|
22
|
+
if (typeof options.autoload === 'boolean') config.autoload = options.autoload;
|
|
23
|
+
if ('hrefBuilder' in options) config.hrefBuilder = options.hrefBuilder || null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Ensure Material Symbols ligatures used by built-in UI are available.
|
|
28
|
+
* Components declare the icons they own so hosts can still use a custom
|
|
29
|
+
* `hrefBuilder` for subset font loading. The default provider path is a
|
|
30
|
+
* self-hosted font to keep public demos and embedded browsers deterministic.
|
|
31
|
+
* @param {string[]} iconNames
|
|
32
|
+
*/
|
|
33
|
+
export function ensureMaterialSymbols(iconNames) {
|
|
34
|
+
if (!config.autoload || !isBrowserDocument()) return;
|
|
35
|
+
|
|
36
|
+
const names = [...new Set(iconNames.filter((name) => typeof name === 'string' && ICON_NAME_RE.test(name)))].sort();
|
|
37
|
+
if (names.length === 0) return;
|
|
38
|
+
|
|
39
|
+
let changed = false;
|
|
40
|
+
for (const name of names) {
|
|
41
|
+
if (loadedIcons.has(name)) continue;
|
|
42
|
+
loadedIcons.add(name);
|
|
43
|
+
changed = true;
|
|
44
|
+
}
|
|
45
|
+
if (!changed) return;
|
|
46
|
+
|
|
47
|
+
const iconList = [...loadedIcons].sort();
|
|
48
|
+
const href = config.hrefBuilder
|
|
49
|
+
? config.hrefBuilder(iconList)
|
|
50
|
+
: MATERIAL_SYMBOLS_LOCAL_URL;
|
|
51
|
+
if (!href) return;
|
|
52
|
+
|
|
53
|
+
let link = document.querySelector(LINK_SELECTOR);
|
|
54
|
+
if (!link) {
|
|
55
|
+
link = document.createElement('link');
|
|
56
|
+
link.rel = 'stylesheet';
|
|
57
|
+
link.dataset.snMaterialSymbols = 'managed';
|
|
58
|
+
document.head.append(link);
|
|
59
|
+
}
|
|
60
|
+
link.href = href;
|
|
61
|
+
link.dataset.snMaterialSymbolsIcons = iconList.join(',');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function isBrowserDocument() {
|
|
65
|
+
return typeof document !== 'undefined'
|
|
66
|
+
&& typeof window !== 'undefined'
|
|
67
|
+
&& document.nodeType === 9
|
|
68
|
+
&& !!document.head;
|
|
69
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Material Symbols Outlined';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: normal;
|
|
5
|
+
font-display: block;
|
|
6
|
+
src: url('./material-symbols-outlined-400.ttf') format('truetype');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.material-symbols-outlined {
|
|
10
|
+
font-family: 'Material Symbols Outlined';
|
|
11
|
+
font-weight: normal;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
letter-spacing: normal;
|
|
16
|
+
text-transform: none;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
word-wrap: normal;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
-webkit-font-feature-settings: 'liga';
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
font-feature-settings: 'liga';
|
|
24
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* symbiote-ui — Node-safe provider UI API.
|
|
3
|
+
*
|
|
4
|
+
* Browser components live in the explicit `symbiote-ui/ui` entrypoint.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from './core/index.js';
|
|
8
|
+
export * from './graph/index.js';
|
|
9
|
+
export * from './locale/index.js';
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
NodeShape,
|
|
13
|
+
RectShape,
|
|
14
|
+
PillShape,
|
|
15
|
+
CircleShape,
|
|
16
|
+
DiamondShape,
|
|
17
|
+
CommentShape,
|
|
18
|
+
getShape,
|
|
19
|
+
registerShape,
|
|
20
|
+
SVGShape,
|
|
21
|
+
createSVGShape,
|
|
22
|
+
SVG_PRESETS,
|
|
23
|
+
} from './shapes/index.js';
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
DEFAULT_PROVIDER_THEME,
|
|
27
|
+
DEFAULT_THEME,
|
|
28
|
+
} from './themes/Theme.js';
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
DEFAULT_PROVIDER_PALETTE,
|
|
32
|
+
DEFAULT_PALETTE,
|
|
33
|
+
} from './themes/Palette.js';
|
|
34
|
+
|
|
35
|
+
export { MODERN_SKIN, COMPACT_SKIN, ROUNDED_SKIN } from './themes/Skin.js';
|
|
36
|
+
export { CARBON, CARBON_PALETTE } from './themes/carbon.js';
|
|
37
|
+
export { PCB_DARK } from './themes/pcb.js';
|
|
38
|
+
export { EBOOK, EBOOK_PALETTE } from './themes/ebook.js';
|
|
39
|
+
export { NEON_PALETTE } from './themes/neon.js';
|
|
40
|
+
export { GraphHistory } from 'symbiote-engine';
|
|
41
|
+
export { Readonly } from './plugins/Readonly.js';
|
|
42
|
+
export { History } from './plugins/History.js';
|
|
43
|
+
export { computeAutoLayout, computeTreeLayout } from './canvas/AutoLayout.js';
|
|
44
|
+
export {
|
|
45
|
+
createCanvasGraphStore,
|
|
46
|
+
normalizeCanvasGraphModel,
|
|
47
|
+
} from './canvas/graph-model.js';
|
|
48
|
+
export {
|
|
49
|
+
computeInitialGraphPositions,
|
|
50
|
+
createForceLayoutPayload,
|
|
51
|
+
findForceNodeGroup,
|
|
52
|
+
getDrillableFiles,
|
|
53
|
+
getForceLayoutOptions,
|
|
54
|
+
getGraphCacheKey,
|
|
55
|
+
getOrBuildGraph,
|
|
56
|
+
} from './canvas/graph-layout.js';
|
|
57
|
+
export {
|
|
58
|
+
GRAPH_DIRECTORY_FRAME_COLORS,
|
|
59
|
+
GRAPH_PATH_STYLES,
|
|
60
|
+
addGraphDirectoryFrames,
|
|
61
|
+
buildFlatPathHash,
|
|
62
|
+
getFileSelectionNodeId,
|
|
63
|
+
getFlatFocusRestoreKey,
|
|
64
|
+
getGraphHashNavigationState,
|
|
65
|
+
getGraphPathStyleDisplay,
|
|
66
|
+
getNextGraphPathStyle,
|
|
67
|
+
resolveFlatHashChange,
|
|
68
|
+
resolveInitialGraphViewMode,
|
|
69
|
+
shouldClearFocusOnSelection,
|
|
70
|
+
shouldFitForceLayoutInitialTick,
|
|
71
|
+
shouldRestoreFlatFocus,
|
|
72
|
+
} from './canvas/graph-explorer.js';
|
|
73
|
+
export { resolveSymbolFile, findConnectionPath } from './graph/graph-algorithms.js';
|
|
74
|
+
export {
|
|
75
|
+
HTML_IN_CANVAS_APIS,
|
|
76
|
+
HTML_IN_CANVAS_RENDERER,
|
|
77
|
+
HTML_IN_CANVAS_RENDERER_NAME,
|
|
78
|
+
captureHtmlElementImage,
|
|
79
|
+
closeHtmlElementImage,
|
|
80
|
+
copyHtmlElementToWebGPUTexture,
|
|
81
|
+
createHtmlInCanvasAdapter,
|
|
82
|
+
drawHtmlElement2d,
|
|
83
|
+
getHtmlInCanvasChangedElements,
|
|
84
|
+
getHtmlElementCanvasTransform,
|
|
85
|
+
getHtmlInCanvasSupport,
|
|
86
|
+
requestHtmlInCanvasPaint,
|
|
87
|
+
setupHtmlInCanvas,
|
|
88
|
+
uploadHtmlElementToWebGLTexture,
|
|
89
|
+
} from './canvas/html-in-canvas.js';
|
|
90
|
+
export * from './xr/index.js';
|
|
91
|
+
export { buildFileGraph, buildStructuredGraph } from './canvas/project-graph-builder.js';
|
|
92
|
+
export { buildGraphModelFromSkeleton, buildCanvasGraphModelFromSkeleton } from './canvas/project-graph-model.js';
|
|
93
|
+
export { collectQuickOpenFilesFromSkeleton, fuzzyScore, searchQuickOpenItems } from './navigation/quick-open-utils.js';
|
|
94
|
+
export { normalizeOutputList, normalizePreviewGraph } from './display/output-preview.js';
|
|
95
|
+
export { createNetworkApprovalPageStyles, renderNetworkApprovalPage } from './display/network-approval-page.js';
|