project-graph-mcp 2.3.2 → 2.4.1
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/package.json +3 -2
- package/src/analysis/analysis-cache.ctx +9 -0
- package/src/analysis/analysis-cache.js +1 -1
- package/src/analysis/complexity.ctx +6 -0
- package/src/analysis/complexity.js +1 -1
- package/src/analysis/custom-rules.ctx +14 -0
- package/src/analysis/custom-rules.js +1 -1
- package/src/analysis/db-analysis.ctx +7 -0
- package/src/analysis/db-analysis.js +1 -1
- package/src/analysis/dead-code.ctx +6 -0
- package/src/analysis/dead-code.js +1 -1
- package/src/analysis/full-analysis.ctx +9 -0
- package/src/analysis/full-analysis.js +1 -1
- package/src/analysis/jsdoc-checker.ctx +10 -0
- package/src/analysis/jsdoc-checker.js +1 -1
- package/src/analysis/jsdoc-generator.ctx +9 -0
- package/src/analysis/jsdoc-generator.js +1 -1
- package/src/analysis/large-files.ctx +6 -0
- package/src/analysis/large-files.js +1 -1
- package/src/analysis/outdated-patterns.ctx +7 -0
- package/src/analysis/outdated-patterns.js +1 -1
- package/src/analysis/similar-functions.ctx +6 -0
- package/src/analysis/similar-functions.js +1 -1
- package/src/analysis/test-annotations.ctx +11 -0
- package/src/analysis/test-annotations.js +1 -1
- package/src/analysis/type-checker.ctx +6 -0
- package/src/analysis/type-checker.js +1 -1
- package/src/analysis/undocumented.ctx +8 -0
- package/src/analysis/undocumented.js +1 -1
- package/src/cli/cli-handlers.ctx +7 -0
- package/src/cli/cli-handlers.js +1 -1
- package/src/cli/cli.ctx +6 -0
- package/src/cli/cli.js +1 -1
- package/src/compact/ai-context.ctx +6 -0
- package/src/compact/ai-context.js +1 -1
- package/src/compact/compact-migrate.ctx +8 -0
- package/src/compact/compact-migrate.js +1 -1
- package/src/compact/compact.ctx +11 -0
- package/src/compact/compact.js +1 -1
- package/src/compact/compress.ctx +7 -0
- package/src/compact/compress.js +1 -1
- package/src/compact/ctx-resolver.ctx +2 -0
- package/src/compact/ctx-resolver.js +1 -1
- package/src/compact/ctx-to-jsdoc.ctx +11 -0
- package/src/compact/ctx-to-jsdoc.js +1 -1
- package/src/compact/doc-dialect.ctx +11 -0
- package/src/compact/doc-dialect.js +2 -2
- package/src/compact/expand.ctx +14 -0
- package/src/compact/expand.js +1 -1
- package/src/compact/framework-references.ctx +7 -0
- package/src/compact/framework-references.js +1 -1
- package/src/compact/instructions.ctx +6 -0
- package/src/compact/instructions.js +1 -1
- package/src/compact/jsdoc-builder.ctx +4 -0
- package/src/compact/jsdoc-builder.js +1 -1
- package/src/compact/mode-config.ctx +8 -0
- package/src/compact/mode-config.js +1 -1
- package/src/compact/split-declarations.ctx +6 -0
- package/src/compact/split-declarations.js +1 -1
- package/src/compact/validate-pipeline.ctx +12 -0
- package/src/compact/validate-pipeline.js +1 -1
- package/src/core/event-bus.ctx +9 -0
- package/src/core/event-bus.js +1 -1
- package/src/core/file-walker.ctx +1 -0
- package/src/core/file-walker.js +1 -1
- package/src/core/filters.ctx +12 -0
- package/src/core/filters.js +1 -1
- package/src/core/graph-builder.ctx +7 -0
- package/src/core/graph-builder.js +1 -1
- package/src/core/parser.ctx +12 -0
- package/src/core/parser.js +1 -1
- package/src/core/utils.ctx +1 -0
- package/src/core/utils.js +1 -1
- package/src/core/workspace.ctx +7 -0
- package/src/core/workspace.js +1 -1
- package/src/lang/lang-go.ctx +8 -0
- package/src/lang/lang-go.js +1 -1
- package/src/lang/lang-python.ctx +5 -0
- package/src/lang/lang-python.js +1 -1
- package/src/lang/lang-sql.ctx +10 -0
- package/src/lang/lang-sql.js +1 -1
- package/src/lang/lang-typescript.ctx +6 -0
- package/src/lang/lang-typescript.js +1 -1
- package/src/lang/lang-utils.ctx +5 -0
- package/src/lang/lang-utils.js +1 -1
- package/src/mcp/mcp-server.ctx +6 -0
- package/src/mcp/mcp-server.js +1 -1
- package/src/mcp/tool-defs.ctx +2 -0
- package/src/mcp/tool-defs.js +1 -1
- package/src/mcp/tools.ctx +13 -0
- package/src/mcp/tools.js +1 -1
- package/src/network/backend-lifecycle.ctx +10 -0
- package/src/network/backend-lifecycle.js +1 -1
- package/src/network/backend.ctx +5 -0
- package/src/network/backend.js +1 -1
- package/src/network/local-gateway.ctx +9 -0
- package/src/network/local-gateway.js +1 -1
- package/src/network/mdns.ctx +6 -0
- package/src/network/mdns.js +1 -1
- package/src/network/server.ctx +2 -0
- package/src/network/server.js +2 -2
- package/src/network/web-server.ctx +17 -0
- package/src/network/web-server.js +2 -2
- package/web/follow-controller.js +94 -25
- package/web/panels/dep-graph.js +207 -21
- package/project-graph-mcp-2.3.0.tgz +0 -0
- package/vendor/symbiote-node/CHANGELOG.md +0 -31
- package/vendor/symbiote-node/LICENSE +0 -21
- package/vendor/symbiote-node/README.md +0 -206
- package/vendor/symbiote-node/canvas/AutoLayout.js +0 -725
- package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.css.js +0 -73
- package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.js +0 -93
- package/vendor/symbiote-node/canvas/Breadcrumb/Breadcrumb.tpl.js +0 -9
- package/vendor/symbiote-node/canvas/CanvasConnectionRenderer.js +0 -962
- package/vendor/symbiote-node/canvas/ConnectionRenderer.js +0 -1468
- package/vendor/symbiote-node/canvas/FlowSimulator.js +0 -323
- package/vendor/symbiote-node/canvas/ForceLayout.js +0 -189
- package/vendor/symbiote-node/canvas/ForceWorker.js +0 -1325
- package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.css.js +0 -97
- package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.js +0 -176
- package/vendor/symbiote-node/canvas/GraphTabs/GraphTabs.tpl.js +0 -12
- package/vendor/symbiote-node/canvas/LODManager.js +0 -88
- package/vendor/symbiote-node/canvas/Minimap/Minimap.css.js +0 -71
- package/vendor/symbiote-node/canvas/Minimap/Minimap.js +0 -207
- package/vendor/symbiote-node/canvas/Minimap/Minimap.tpl.js +0 -9
- package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.css.js +0 -261
- package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.js +0 -1840
- package/vendor/symbiote-node/canvas/NodeCanvas/NodeCanvas.tpl.js +0 -22
- package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.css.js +0 -97
- package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.js +0 -132
- package/vendor/symbiote-node/canvas/NodeSearch/NodeSearch.tpl.js +0 -21
- package/vendor/symbiote-node/canvas/NodeViewManager.js +0 -584
- package/vendor/symbiote-node/canvas/PinExpansion.js +0 -131
- package/vendor/symbiote-node/canvas/PseudoConnection.js +0 -80
- package/vendor/symbiote-node/canvas/SubgraphManager.js +0 -201
- package/vendor/symbiote-node/canvas/SubgraphRouter.js +0 -443
- package/vendor/symbiote-node/canvas/ViewportActions.js +0 -446
- package/vendor/symbiote-node/core/Connection.js +0 -45
- package/vendor/symbiote-node/core/Editor.js +0 -451
- package/vendor/symbiote-node/core/Frame.js +0 -31
- package/vendor/symbiote-node/core/GraphMermaid.js +0 -348
- package/vendor/symbiote-node/core/GraphText.js +0 -210
- package/vendor/symbiote-node/core/Node.js +0 -143
- package/vendor/symbiote-node/core/Portal.js +0 -104
- package/vendor/symbiote-node/core/Socket.js +0 -185
- package/vendor/symbiote-node/core/SubgraphNode.js +0 -125
- package/vendor/symbiote-node/engine/AgentUICommands.js +0 -100
- package/vendor/symbiote-node/engine/Executor.js +0 -371
- package/vendor/symbiote-node/engine/Graph.js +0 -314
- package/vendor/symbiote-node/engine/GraphServer.js +0 -353
- package/vendor/symbiote-node/engine/HandlerLoader.js +0 -145
- package/vendor/symbiote-node/engine/History.js +0 -83
- package/vendor/symbiote-node/engine/Lifecycle.js +0 -118
- package/vendor/symbiote-node/engine/Persistence.js +0 -84
- package/vendor/symbiote-node/engine/Registry.js +0 -264
- package/vendor/symbiote-node/engine/SocketTypes.js +0 -79
- package/vendor/symbiote-node/engine/cli.js +0 -404
- package/vendor/symbiote-node/engine/index.js +0 -56
- package/vendor/symbiote-node/engine/nanoid.js +0 -28
- package/vendor/symbiote-node/engine/package.json +0 -26
- package/vendor/symbiote-node/engine/packs/ai/beat-detect.handler.js +0 -215
- package/vendor/symbiote-node/engine/packs/ai/content-adapt.handler.js +0 -238
- package/vendor/symbiote-node/engine/packs/ai/face-detect.handler.js +0 -287
- package/vendor/symbiote-node/engine/packs/ai/grok-generate.handler.js +0 -565
- package/vendor/symbiote-node/engine/packs/ai/kling-lipsync.handler.js +0 -414
- package/vendor/symbiote-node/engine/packs/ai/lesson-generate.handler.js +0 -343
- package/vendor/symbiote-node/engine/packs/ai/opencode.handler.js +0 -164
- package/vendor/symbiote-node/engine/packs/ai/replicate-lipsync.handler.js +0 -341
- package/vendor/symbiote-node/engine/packs/ai/tts.handler.js +0 -241
- package/vendor/symbiote-node/engine/packs/ai/whisper.handler.js +0 -191
- package/vendor/symbiote-node/engine/packs/data/db-query.handler.js +0 -67
- package/vendor/symbiote-node/engine/packs/data/news-accumulate.handler.js +0 -281
- package/vendor/symbiote-node/engine/packs/data/personas.handler.js +0 -160
- package/vendor/symbiote-node/engine/packs/data/prompt-loader.handler.js +0 -193
- package/vendor/symbiote-node/engine/packs/data/roles.handler.js +0 -216
- package/vendor/symbiote-node/engine/packs/data/rss-feed.handler.js +0 -244
- package/vendor/symbiote-node/engine/packs/debug/inject.handler.js +0 -52
- package/vendor/symbiote-node/engine/packs/flow/agent.handler.js +0 -73
- package/vendor/symbiote-node/engine/packs/flow/if.handler.js +0 -107
- package/vendor/symbiote-node/engine/packs/flow/loop.handler.js +0 -58
- package/vendor/symbiote-node/engine/packs/flow/merge.handler.js +0 -60
- package/vendor/symbiote-node/engine/packs/flow/retry.handler.js +0 -65
- package/vendor/symbiote-node/engine/packs/flow/switch.handler.js +0 -64
- package/vendor/symbiote-node/engine/packs/flow/wait-all.handler.js +0 -39
- package/vendor/symbiote-node/engine/packs/io/http-request.handler.js +0 -82
- package/vendor/symbiote-node/engine/packs/io/read-file.handler.js +0 -60
- package/vendor/symbiote-node/engine/packs/io/write-file.handler.js +0 -63
- package/vendor/symbiote-node/engine/packs/transform/anchor-match.handler.js +0 -494
- package/vendor/symbiote-node/engine/packs/transform/effects-skeleton.handler.js +0 -417
- package/vendor/symbiote-node/engine/packs/transform/json-parse.handler.js +0 -43
- package/vendor/symbiote-node/engine/packs/transform/lipsync-select.handler.js +0 -339
- package/vendor/symbiote-node/engine/packs/transform/riopla-adapt.handler.js +0 -432
- package/vendor/symbiote-node/engine/packs/transform/set.handler.js +0 -57
- package/vendor/symbiote-node/engine/packs/transform/template-builder.handler.js +0 -134
- package/vendor/symbiote-node/engine/packs/transform/template.handler.js +0 -79
- package/vendor/symbiote-node/engine/packs/transform/timeline-build.handler.js +0 -399
- package/vendor/symbiote-node/engine/packs/util/delay.handler.js +0 -39
- package/vendor/symbiote-node/engine/packs/util/log.handler.js +0 -44
- package/vendor/symbiote-node/engine/packs/video-pack.js +0 -323
- package/vendor/symbiote-node/index.js +0 -103
- package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.css.js +0 -361
- package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.js +0 -332
- package/vendor/symbiote-node/inspector/InspectorPanel/InspectorPanel.tpl.js +0 -96
- package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.css.js +0 -104
- package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.js +0 -133
- package/vendor/symbiote-node/inspector/TemplatePreview/TemplatePreview.tpl.js +0 -33
- package/vendor/symbiote-node/interactions/ConnectFlow.js +0 -307
- package/vendor/symbiote-node/interactions/Drag.js +0 -102
- package/vendor/symbiote-node/interactions/Selector.js +0 -132
- package/vendor/symbiote-node/interactions/SnapGrid.js +0 -65
- package/vendor/symbiote-node/interactions/Zoom.js +0 -140
- package/vendor/symbiote-node/layout/ActionZone/ActionZone.css.js +0 -88
- package/vendor/symbiote-node/layout/ActionZone/ActionZone.js +0 -254
- package/vendor/symbiote-node/layout/ActionZone/ActionZone.tpl.js +0 -11
- package/vendor/symbiote-node/layout/Layout/Layout.css.js +0 -88
- package/vendor/symbiote-node/layout/Layout/Layout.js +0 -622
- package/vendor/symbiote-node/layout/Layout/Layout.tpl.js +0 -25
- package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.css.js +0 -293
- package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.js +0 -467
- package/vendor/symbiote-node/layout/LayoutNode/LayoutNode.tpl.js +0 -33
- package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.css.js +0 -46
- package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.js +0 -102
- package/vendor/symbiote-node/layout/LayoutPreview/LayoutPreview.tpl.js +0 -6
- package/vendor/symbiote-node/layout/LayoutRouter/LayoutRouter.js +0 -156
- package/vendor/symbiote-node/layout/LayoutRouter/routerSync.js +0 -250
- package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.css.js +0 -379
- package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.js +0 -263
- package/vendor/symbiote-node/layout/LayoutSidebar/LayoutSidebar.tpl.js +0 -20
- package/vendor/symbiote-node/layout/LayoutSidebar/SidebarSection.js +0 -183
- package/vendor/symbiote-node/layout/LayoutTree.js +0 -246
- package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.css.js +0 -43
- package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.js +0 -89
- package/vendor/symbiote-node/layout/PanelMenu/PanelMenu.tpl.js +0 -14
- package/vendor/symbiote-node/layout/index.js +0 -16
- package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.css.js +0 -61
- package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.js +0 -79
- package/vendor/symbiote-node/menu/ContextMenu/ContextMenu.tpl.js +0 -19
- package/vendor/symbiote-node/node/CtrlItem/CtrlItem.css.js +0 -41
- package/vendor/symbiote-node/node/CtrlItem/CtrlItem.js +0 -24
- package/vendor/symbiote-node/node/CtrlItem/CtrlItem.tpl.js +0 -16
- package/vendor/symbiote-node/node/GraphFrame/GraphFrame.css.js +0 -65
- package/vendor/symbiote-node/node/GraphFrame/GraphFrame.js +0 -29
- package/vendor/symbiote-node/node/GraphFrame/GraphFrame.tpl.js +0 -13
- package/vendor/symbiote-node/node/GraphNode/GraphNode.css.js +0 -683
- package/vendor/symbiote-node/node/GraphNode/GraphNode.js +0 -92
- package/vendor/symbiote-node/node/GraphNode/GraphNode.tpl.js +0 -17
- package/vendor/symbiote-node/node/NodeSocket/NodeSocket.js +0 -25
- package/vendor/symbiote-node/node/NodeSocket/NodeSocket.tpl.js +0 -7
- package/vendor/symbiote-node/node/PortItem/PortItem.css.js +0 -90
- package/vendor/symbiote-node/node/PortItem/PortItem.js +0 -87
- package/vendor/symbiote-node/node/PortItem/PortItem.tpl.js +0 -10
- package/vendor/symbiote-node/package.json +0 -59
- package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.css.js +0 -143
- package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.js +0 -131
- package/vendor/symbiote-node/palette/PaletteBrowser/PaletteBrowser.tpl.js +0 -16
- package/vendor/symbiote-node/plugins/History.js +0 -384
- package/vendor/symbiote-node/plugins/Readonly.js +0 -59
- package/vendor/symbiote-node/shapes/CircleShape.js +0 -80
- package/vendor/symbiote-node/shapes/CommentShape.js +0 -35
- package/vendor/symbiote-node/shapes/DiamondShape.js +0 -115
- package/vendor/symbiote-node/shapes/NodeShape.js +0 -80
- package/vendor/symbiote-node/shapes/PillShape.js +0 -91
- package/vendor/symbiote-node/shapes/RectShape.js +0 -72
- package/vendor/symbiote-node/shapes/SVGShape.js +0 -494
- package/vendor/symbiote-node/shapes/index.js +0 -53
- package/vendor/symbiote-node/themes/Palette.js +0 -32
- package/vendor/symbiote-node/themes/Skin.js +0 -113
- package/vendor/symbiote-node/themes/Theme.js +0 -84
- package/vendor/symbiote-node/themes/carbon.js +0 -137
- package/vendor/symbiote-node/themes/dark.js +0 -137
- package/vendor/symbiote-node/themes/ebook.js +0 -138
- package/vendor/symbiote-node/themes/grey.js +0 -137
- package/vendor/symbiote-node/themes/light.js +0 -137
- package/vendor/symbiote-node/themes/neon.js +0 -138
- package/vendor/symbiote-node/themes/pcb.js +0 -273
- package/vendor/symbiote-node/themes/synthwave.js +0 -137
- package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.css.js +0 -86
- package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.js +0 -128
- package/vendor/symbiote-node/toolbar/QuickToolbar/QuickToolbar.tpl.js +0 -29
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PseudoConnection — temporary connection line during drag
|
|
3
|
-
*
|
|
4
|
-
* Renders dashed Bézier path + plus indicator at endpoint.
|
|
5
|
-
* Extracted from NodeCanvas to reduce complexity.
|
|
6
|
-
*
|
|
7
|
-
* @module symbiote-node/canvas/PseudoConnection
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export class PseudoConnection {
|
|
11
|
-
|
|
12
|
-
/** @type {SVGPathElement|null} */
|
|
13
|
-
#path = null;
|
|
14
|
-
|
|
15
|
-
/** @type {SVGGElement|null} */
|
|
16
|
-
#plusIndicator = null;
|
|
17
|
-
|
|
18
|
-
/** @type {SVGElement} */
|
|
19
|
-
#svg;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @param {SVGElement} svgLayer - pseudo SVG overlay
|
|
23
|
-
*/
|
|
24
|
-
constructor(svgLayer) {
|
|
25
|
-
this.#svg = svgLayer;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Show pseudo-connection between two world-space points.
|
|
30
|
-
* pseudo-svg is inside .content which applies CSS transform (zoom+pan),
|
|
31
|
-
* so coordinates must be in world-space (same as ConnectionRenderer dots).
|
|
32
|
-
* @param {number} sx - Start X (world space)
|
|
33
|
-
* @param {number} sy - Start Y (world space)
|
|
34
|
-
* @param {number} ex - End X (world space)
|
|
35
|
-
* @param {number} ey - End Y (world space)
|
|
36
|
-
*/
|
|
37
|
-
show(sx, sy, ex, ey) {
|
|
38
|
-
if (!this.#path) {
|
|
39
|
-
this.#path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
40
|
-
this.#path.setAttribute('class', 'pseudo-path');
|
|
41
|
-
this.#svg.appendChild(this.#path);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const dx = Math.abs(ex - sx) * 0.5;
|
|
45
|
-
const d = `M ${sx} ${sy} C ${sx + dx} ${sy}, ${ex - dx} ${ey}, ${ex} ${ey}`;
|
|
46
|
-
this.#path.setAttribute('d', d);
|
|
47
|
-
|
|
48
|
-
// Plus indicator at endpoint
|
|
49
|
-
if (!this.#plusIndicator) {
|
|
50
|
-
const g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
|
|
51
|
-
g.setAttribute('class', 'plus-indicator');
|
|
52
|
-
const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
|
|
53
|
-
circle.setAttribute('r', '8');
|
|
54
|
-
const h = document.createElementNS('http://www.w3.org/2000/svg', 'line');
|
|
55
|
-
h.setAttribute('x1', '-4'); h.setAttribute('y1', '0');
|
|
56
|
-
h.setAttribute('x2', '4'); h.setAttribute('y2', '0');
|
|
57
|
-
const v = document.createElementNS('http://www.w3.org/2000/svg', 'line');
|
|
58
|
-
v.setAttribute('x1', '0'); v.setAttribute('y1', '-4');
|
|
59
|
-
v.setAttribute('x2', '0'); v.setAttribute('y2', '4');
|
|
60
|
-
g.appendChild(circle);
|
|
61
|
-
g.appendChild(h);
|
|
62
|
-
g.appendChild(v);
|
|
63
|
-
this.#svg.appendChild(g);
|
|
64
|
-
this.#plusIndicator = g;
|
|
65
|
-
}
|
|
66
|
-
this.#plusIndicator.setAttribute('transform', `translate(${ex}, ${ey})`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Hide and clean up pseudo-connection */
|
|
70
|
-
hide() {
|
|
71
|
-
if (this.#path) {
|
|
72
|
-
this.#path.remove();
|
|
73
|
-
this.#path = null;
|
|
74
|
-
}
|
|
75
|
-
if (this.#plusIndicator) {
|
|
76
|
-
this.#plusIndicator.remove();
|
|
77
|
-
this.#plusIndicator = null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SubgraphManager — Navigation stack for subgraph drill-down
|
|
3
|
-
*
|
|
4
|
-
* Manages a stack of editor contexts. When drilling into a subgraph,
|
|
5
|
-
* the current state is saved and the inner editor is loaded.
|
|
6
|
-
* Breadcrumb navigation allows jumping back to any level.
|
|
7
|
-
*
|
|
8
|
-
* @module symbiote-node/canvas/SubgraphManager
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {Object} NavEntry
|
|
13
|
-
* @property {import('../core/Editor.js').NodeEditor} editor
|
|
14
|
-
* @property {Object<string, { x: number, y: number }>} positions
|
|
15
|
-
* @property {{ panX: number, panY: number, zoom: number }} transform
|
|
16
|
-
* @property {string} label - Display label for breadcrumb
|
|
17
|
-
* @property {string|null} subgraphNodeId - SubgraphNode ID in parent (null for root)
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export class SubgraphManager {
|
|
21
|
-
/** @type {NavEntry[]} */
|
|
22
|
-
#stack = [];
|
|
23
|
-
|
|
24
|
-
/** @type {import('./NodeCanvas.js').NodeCanvas|null} */
|
|
25
|
-
#canvas = null;
|
|
26
|
-
|
|
27
|
-
/** @type {function|null} */
|
|
28
|
-
#onNavigate = null;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Initialize with canvas and root editor
|
|
32
|
-
* @param {*} canvas - NodeCanvas element
|
|
33
|
-
* @param {import('../core/Editor.js').NodeEditor} rootEditor
|
|
34
|
-
*/
|
|
35
|
-
initialize(canvas, rootEditor) {
|
|
36
|
-
this.#canvas = canvas;
|
|
37
|
-
this.#stack = [{
|
|
38
|
-
editor: rootEditor,
|
|
39
|
-
positions: {},
|
|
40
|
-
transform: { panX: 0, panY: 0, zoom: 1 },
|
|
41
|
-
label: 'Root',
|
|
42
|
-
subgraphNodeId: null,
|
|
43
|
-
}];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Set navigation callback (for breadcrumb updates)
|
|
48
|
-
* @param {function} callback - (path: string[]) => void
|
|
49
|
-
*/
|
|
50
|
-
onNavigate(callback) {
|
|
51
|
-
this.#onNavigate = callback;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Drill down into a SubgraphNode
|
|
56
|
-
* @param {import('../core/SubgraphNode.js').SubgraphNode} subgraphNode
|
|
57
|
-
*/
|
|
58
|
-
drillDown(subgraphNode) {
|
|
59
|
-
if (!subgraphNode?._isSubgraph || !this.#canvas) return;
|
|
60
|
-
|
|
61
|
-
// Save current state
|
|
62
|
-
const current = this.#stack[this.#stack.length - 1];
|
|
63
|
-
current.positions = this.#capturePositions(current.editor, current.positions);
|
|
64
|
-
current.transform = this.#captureTransform();
|
|
65
|
-
|
|
66
|
-
// Push inner editor
|
|
67
|
-
this.#stack.push({
|
|
68
|
-
editor: subgraphNode.getInnerEditor(),
|
|
69
|
-
positions: subgraphNode.innerPositions,
|
|
70
|
-
transform: subgraphNode.innerTransform,
|
|
71
|
-
label: subgraphNode.label,
|
|
72
|
-
subgraphNodeId: subgraphNode.id,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// Switch canvas to inner editor
|
|
76
|
-
this.#applyLevel(this.#stack.length - 1);
|
|
77
|
-
this.#notifyNavigate();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Navigate up to a specific level
|
|
82
|
-
* @param {number} level - 0 = root
|
|
83
|
-
*/
|
|
84
|
-
drillUp(level) {
|
|
85
|
-
if (level === undefined) level = this.#stack.length - 2;
|
|
86
|
-
if (level < 0 || level >= this.#stack.length || !this.#canvas) return;
|
|
87
|
-
|
|
88
|
-
// Save state of levels being popped (persist inner positions)
|
|
89
|
-
for (let i = this.#stack.length - 1; i > level; i--) {
|
|
90
|
-
const entry = this.#stack[i];
|
|
91
|
-
const parentEntry = this.#stack[i - 1];
|
|
92
|
-
if (entry.subgraphNodeId) {
|
|
93
|
-
const subNode = parentEntry.editor.getNode(entry.subgraphNodeId);
|
|
94
|
-
if (subNode?._isSubgraph) {
|
|
95
|
-
subNode.setInnerPositions(this.#capturePositions(entry.editor, entry.positions));
|
|
96
|
-
subNode.setInnerTransform(entry.transform);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Save current deep level positions before truncating
|
|
102
|
-
const currentEntry = this.#stack[this.#stack.length - 1];
|
|
103
|
-
currentEntry.positions = this.#capturePositions(currentEntry.editor, currentEntry.positions);
|
|
104
|
-
currentEntry.transform = this.#captureTransform();
|
|
105
|
-
|
|
106
|
-
// Truncate stack
|
|
107
|
-
this.#stack.length = level + 1;
|
|
108
|
-
|
|
109
|
-
// Switch canvas
|
|
110
|
-
this.#applyLevel(level);
|
|
111
|
-
this.#notifyNavigate();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Get current breadcrumb path
|
|
116
|
-
* @returns {Array<{ label: string, level: number }>}
|
|
117
|
-
*/
|
|
118
|
-
getPath() {
|
|
119
|
-
return this.#stack.map((entry, i) => ({
|
|
120
|
-
label: entry.label,
|
|
121
|
-
level: i,
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Get current depth (0 = root)
|
|
127
|
-
* @returns {number}
|
|
128
|
-
*/
|
|
129
|
-
get depth() {
|
|
130
|
-
return this.#stack.length - 1;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Get current editor
|
|
135
|
-
* @returns {import('../core/Editor.js').NodeEditor}
|
|
136
|
-
*/
|
|
137
|
-
get currentEditor() {
|
|
138
|
-
return this.#stack[this.#stack.length - 1].editor;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Apply a stack level to the canvas
|
|
143
|
-
* @param {number} level
|
|
144
|
-
*/
|
|
145
|
-
#applyLevel(level) {
|
|
146
|
-
const entry = this.#stack[level];
|
|
147
|
-
if (!entry || !this.#canvas) return;
|
|
148
|
-
|
|
149
|
-
// Rebind editor
|
|
150
|
-
this.#canvas.setEditor(entry.editor);
|
|
151
|
-
|
|
152
|
-
// Restore positions
|
|
153
|
-
for (const [nodeId, pos] of Object.entries(entry.positions)) {
|
|
154
|
-
this.#canvas.setNodePosition(nodeId, pos.x, pos.y);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Restore transform
|
|
158
|
-
this.#canvas.$.panX = entry.transform.panX;
|
|
159
|
-
this.#canvas.$.panY = entry.transform.panY;
|
|
160
|
-
this.#canvas.$.zoom = entry.transform.zoom;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Capture current node positions from editor.
|
|
165
|
-
* Falls back to existing entry positions when DOM elements
|
|
166
|
-
* have already been cleared (e.g. during setEditor transitions).
|
|
167
|
-
* @param {import('../core/Editor.js').NodeEditor} editor
|
|
168
|
-
* @param {Object<string, { x: number, y: number }>} [fallback={}]
|
|
169
|
-
* @returns {Object<string, { x: number, y: number }>}
|
|
170
|
-
*/
|
|
171
|
-
#capturePositions(editor, fallback = {}) {
|
|
172
|
-
const positions = { ...fallback };
|
|
173
|
-
if (!this.#canvas) return positions;
|
|
174
|
-
for (const node of editor.getNodes()) {
|
|
175
|
-
const el = this.#canvas.getNodeView?.(node.id);
|
|
176
|
-
if (el?._position) {
|
|
177
|
-
positions[node.id] = { ...el._position };
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return positions;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Capture current viewport transform
|
|
185
|
-
* @returns {{ panX: number, panY: number, zoom: number }}
|
|
186
|
-
*/
|
|
187
|
-
#captureTransform() {
|
|
188
|
-
if (!this.#canvas) return { panX: 0, panY: 0, zoom: 1 };
|
|
189
|
-
return {
|
|
190
|
-
panX: this.#canvas.$.panX ?? 0,
|
|
191
|
-
panY: this.#canvas.$.panY ?? 0,
|
|
192
|
-
zoom: this.#canvas.$.zoom ?? 1,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
#notifyNavigate() {
|
|
197
|
-
if (this.#onNavigate) {
|
|
198
|
-
this.#onNavigate(this.getPath());
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|