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,361 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* InspectorPanel styles
|
|
3
|
-
* @module symbiote-node/inspector/InspectorPanel.css
|
|
4
|
-
*/
|
|
5
|
-
import { css } from '@symbiotejs/symbiote';
|
|
6
|
-
|
|
7
|
-
export const styles = css`
|
|
8
|
-
inspector-panel {
|
|
9
|
-
position: absolute;
|
|
10
|
-
top: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
width: 280px;
|
|
14
|
-
background: var(--sn-node-bg, #2a2a3e);
|
|
15
|
-
border-left: 1px solid var(--sn-node-border, rgba(255,255,255,0.08));
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
z-index: 100;
|
|
19
|
-
font-family: var(--sn-font, 'Inter', sans-serif);
|
|
20
|
-
color: var(--sn-text, #d4d4d4);
|
|
21
|
-
overflow-y: auto;
|
|
22
|
-
transition: transform 0.2s ease;
|
|
23
|
-
|
|
24
|
-
&[hidden] {
|
|
25
|
-
display: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
& .insp-resize-handle {
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 0;
|
|
31
|
-
left: -2px;
|
|
32
|
-
width: 5px;
|
|
33
|
-
height: 100%;
|
|
34
|
-
cursor: col-resize;
|
|
35
|
-
z-index: 110;
|
|
36
|
-
transition: background 0.15s;
|
|
37
|
-
|
|
38
|
-
&:hover, &.dragging {
|
|
39
|
-
background: var(--sn-node-selected, #4a9eff);
|
|
40
|
-
opacity: 0.5;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
& .insp-header {
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
gap: 8px;
|
|
48
|
-
padding: 12px 16px;
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
border-bottom: 1px solid var(--sn-node-border, rgba(255,255,255,0.08));
|
|
52
|
-
background: var(--sn-node-bg, #2a2a3e);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
& .insp-header .material-symbols-outlined {
|
|
56
|
-
font-size: 18px;
|
|
57
|
-
opacity: 0.7;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
& .insp-body {
|
|
61
|
-
flex: 1;
|
|
62
|
-
padding: 44px 16px 12px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
& .insp-empty {
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
align-items: center;
|
|
69
|
-
gap: 8px;
|
|
70
|
-
padding: 40px 0;
|
|
71
|
-
color: var(--sn-text-dim, #888);
|
|
72
|
-
font-size: 13px;
|
|
73
|
-
|
|
74
|
-
&[hidden] {
|
|
75
|
-
display: none;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
& .insp-empty .material-symbols-outlined {
|
|
80
|
-
font-size: 32px;
|
|
81
|
-
opacity: 0.4;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
& .insp-field {
|
|
85
|
-
margin-bottom: 12px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
& .insp-field label {
|
|
89
|
-
display: block;
|
|
90
|
-
font-size: 11px;
|
|
91
|
-
font-weight: 600;
|
|
92
|
-
text-transform: uppercase;
|
|
93
|
-
color: var(--sn-text-dim, #888);
|
|
94
|
-
margin-bottom: 4px;
|
|
95
|
-
letter-spacing: 0.5px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
& .insp-value {
|
|
99
|
-
font-size: 13px;
|
|
100
|
-
padding: 6px 8px;
|
|
101
|
-
background: color-mix(in srgb, currentColor 4%, transparent);
|
|
102
|
-
border-radius: 4px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
& .insp-tag {
|
|
106
|
-
display: inline-block;
|
|
107
|
-
padding: 2px 8px;
|
|
108
|
-
font-size: 11px;
|
|
109
|
-
border-radius: 4px;
|
|
110
|
-
background: color-mix(in srgb, var(--sn-cat-server, #5cb8ff) 15%, transparent);
|
|
111
|
-
color: var(--sn-cat-server, #5cb8ff);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
& .insp-mono {
|
|
115
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
116
|
-
font-size: 11px;
|
|
117
|
-
opacity: 0.6;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
& .insp-section {
|
|
121
|
-
margin-top: 16px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
& .insp-section-title {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
gap: 6px;
|
|
128
|
-
font-size: 12px;
|
|
129
|
-
font-weight: 600;
|
|
130
|
-
color: var(--sn-text-dim, #888);
|
|
131
|
-
margin-bottom: 8px;
|
|
132
|
-
text-transform: uppercase;
|
|
133
|
-
letter-spacing: 0.5px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
& .insp-section-title .material-symbols-outlined {
|
|
137
|
-
font-size: 16px;
|
|
138
|
-
opacity: 0.6;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.insp-port {
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
gap: 8px;
|
|
146
|
-
padding: 4px 8px;
|
|
147
|
-
font-size: 12px;
|
|
148
|
-
border-radius: 4px;
|
|
149
|
-
margin-bottom: 2px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.insp-port:hover {
|
|
153
|
-
background: color-mix(in srgb, currentColor 4%, transparent);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.insp-port-dot {
|
|
157
|
-
width: 8px;
|
|
158
|
-
height: 8px;
|
|
159
|
-
border-radius: 50%;
|
|
160
|
-
background: var(--sn-cat-server, #5cb8ff);
|
|
161
|
-
flex-shrink: 0;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.insp-port-label {
|
|
165
|
-
flex: 1;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.insp-port-type {
|
|
169
|
-
font-size: 10px;
|
|
170
|
-
color: var(--sn-text-dim, #888);
|
|
171
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.insp-ctrl {
|
|
175
|
-
margin-bottom: 12px;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.insp-ctrl-label {
|
|
179
|
-
display: block;
|
|
180
|
-
font-size: 11px;
|
|
181
|
-
font-weight: 600;
|
|
182
|
-
text-transform: uppercase;
|
|
183
|
-
color: var(--sn-text-dim, #888);
|
|
184
|
-
margin-bottom: 4px;
|
|
185
|
-
letter-spacing: 0.5px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.insp-ctrl-input-el,
|
|
189
|
-
.insp-ctrl-select {
|
|
190
|
-
width: 100%;
|
|
191
|
-
padding: 6px 8px;
|
|
192
|
-
font-size: 12px;
|
|
193
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
194
|
-
color: var(--sn-text, #d4d4d4);
|
|
195
|
-
background: color-mix(in srgb, currentColor 6%, transparent);
|
|
196
|
-
border: 1px solid rgba(255,255,255,0.06);
|
|
197
|
-
border-radius: 4px;
|
|
198
|
-
outline: none;
|
|
199
|
-
box-sizing: border-box;
|
|
200
|
-
transition: border-color 0.15s;
|
|
201
|
-
|
|
202
|
-
&:focus {
|
|
203
|
-
border-color: var(--sn-node-selected, #4a9eff);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.insp-ctrl-textarea {
|
|
208
|
-
width: 100%;
|
|
209
|
-
padding: 6px 8px;
|
|
210
|
-
font-size: 11px;
|
|
211
|
-
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
212
|
-
color: var(--sn-text, #d4d4d4);
|
|
213
|
-
background: color-mix(in srgb, currentColor 6%, transparent);
|
|
214
|
-
border: 1px solid rgba(255,255,255,0.06);
|
|
215
|
-
border-radius: 4px;
|
|
216
|
-
outline: none;
|
|
217
|
-
resize: vertical;
|
|
218
|
-
min-height: 80px;
|
|
219
|
-
box-sizing: border-box;
|
|
220
|
-
line-height: 1.4;
|
|
221
|
-
transition: border-color 0.15s;
|
|
222
|
-
|
|
223
|
-
&:focus {
|
|
224
|
-
border-color: var(--sn-node-selected, #4a9eff);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.insp-ctrl-select {
|
|
229
|
-
appearance: none;
|
|
230
|
-
cursor: pointer;
|
|
231
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
232
|
-
background-repeat: no-repeat;
|
|
233
|
-
background-position: right 6px center;
|
|
234
|
-
padding-right: 24px;
|
|
235
|
-
|
|
236
|
-
& option {
|
|
237
|
-
background: #2a2a3e;
|
|
238
|
-
color: #d4d4d4;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.insp-ctrl-toggle {
|
|
243
|
-
position: relative;
|
|
244
|
-
display: inline-block;
|
|
245
|
-
width: 36px;
|
|
246
|
-
height: 20px;
|
|
247
|
-
cursor: pointer;
|
|
248
|
-
|
|
249
|
-
& input {
|
|
250
|
-
opacity: 0;
|
|
251
|
-
width: 0;
|
|
252
|
-
height: 0;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
& .insp-ctrl-slider {
|
|
256
|
-
position: absolute;
|
|
257
|
-
inset: 0;
|
|
258
|
-
background: rgba(255,255,255,0.1);
|
|
259
|
-
border-radius: 10px;
|
|
260
|
-
transition: background 0.2s;
|
|
261
|
-
|
|
262
|
-
&::before {
|
|
263
|
-
content: '';
|
|
264
|
-
position: absolute;
|
|
265
|
-
width: 14px;
|
|
266
|
-
height: 14px;
|
|
267
|
-
left: 3px;
|
|
268
|
-
bottom: 3px;
|
|
269
|
-
background: #aaa;
|
|
270
|
-
border-radius: 50%;
|
|
271
|
-
transition: transform 0.2s, background 0.2s;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
& input:checked + .insp-ctrl-slider {
|
|
276
|
-
background: var(--sn-node-selected, #4a9eff);
|
|
277
|
-
|
|
278
|
-
&::before {
|
|
279
|
-
transform: translateX(16px);
|
|
280
|
-
background: white;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.insp-enter-btn {
|
|
286
|
-
display: flex;
|
|
287
|
-
align-items: center;
|
|
288
|
-
justify-content: center;
|
|
289
|
-
gap: 8px;
|
|
290
|
-
width: 100%;
|
|
291
|
-
padding: 10px 16px;
|
|
292
|
-
margin-top: 12px;
|
|
293
|
-
border: 1px solid rgba(167, 139, 250, 0.3);
|
|
294
|
-
border-radius: 8px;
|
|
295
|
-
background: linear-gradient(135deg, rgba(167, 139, 250, 0.12) 0%, rgba(109, 40, 217, 0.08) 100%);
|
|
296
|
-
color: var(--sn-subgraph-accent, #a78bfa);
|
|
297
|
-
font-family: var(--sn-font, 'Inter', sans-serif);
|
|
298
|
-
font-size: 13px;
|
|
299
|
-
font-weight: 500;
|
|
300
|
-
cursor: pointer;
|
|
301
|
-
transition: background 0.15s, border-color 0.15s, transform 0.1s;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.insp-enter-btn:hover {
|
|
305
|
-
background: linear-gradient(135deg, rgba(167, 139, 250, 0.22) 0%, rgba(109, 40, 217, 0.15) 100%);
|
|
306
|
-
border-color: rgba(167, 139, 250, 0.5);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.insp-enter-btn:active {
|
|
310
|
-
transform: scale(0.97);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.insp-enter-btn .material-symbols-outlined {
|
|
314
|
-
font-size: 18px;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.insp-fire {
|
|
318
|
-
padding: 12px 16px;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.insp-fire-btn {
|
|
322
|
-
display: flex;
|
|
323
|
-
align-items: center;
|
|
324
|
-
justify-content: center;
|
|
325
|
-
gap: 6px;
|
|
326
|
-
width: 100%;
|
|
327
|
-
padding: 10px 16px;
|
|
328
|
-
border: 1px solid rgba(76, 175, 80, 0.4);
|
|
329
|
-
border-radius: 8px;
|
|
330
|
-
background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(46, 125, 50, 0.10) 100%);
|
|
331
|
-
color: #66bb6a;
|
|
332
|
-
font-family: var(--sn-font, 'Inter', sans-serif);
|
|
333
|
-
font-size: 13px;
|
|
334
|
-
font-weight: 600;
|
|
335
|
-
cursor: pointer;
|
|
336
|
-
transition: background 0.15s, border-color 0.15s, transform 0.1s;
|
|
337
|
-
|
|
338
|
-
&:hover {
|
|
339
|
-
background: linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(46, 125, 50, 0.18) 100%);
|
|
340
|
-
border-color: rgba(76, 175, 80, 0.6);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
&:active {
|
|
344
|
-
transform: scale(0.97);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.material-symbols-outlined {
|
|
348
|
-
font-size: 20px;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.insp-template-preview {
|
|
353
|
-
padding: 0 16px 12px;
|
|
354
|
-
border-top: 1px solid rgba(255,255,255,0.06);
|
|
355
|
-
margin-top: 8px;
|
|
356
|
-
|
|
357
|
-
&[hidden] {
|
|
358
|
-
display: none;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
`;
|
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* InspectorPanel — side panel showing selected node properties
|
|
3
|
-
*
|
|
4
|
-
* Displays node label, type, category, inputs/outputs/controls.
|
|
5
|
-
* Updates when selection changes. Shows "No selection" when nothing selected.
|
|
6
|
-
*
|
|
7
|
-
* @module symbiote-node/inspector/InspectorPanel
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import Symbiote from '@symbiotejs/symbiote';
|
|
11
|
-
import { template, inspPortItemTemplate, inspCtrlItemTemplate } from './InspectorPanel.tpl.js';
|
|
12
|
-
import { styles } from './InspectorPanel.css.js';
|
|
13
|
-
import '../TemplatePreview/TemplatePreview.js';
|
|
14
|
-
|
|
15
|
-
export class InspectorPanel extends Symbiote {
|
|
16
|
-
init$ = {
|
|
17
|
-
visible: false,
|
|
18
|
-
nodeLabel: '',
|
|
19
|
-
nodeType: '',
|
|
20
|
-
nodeCategory: '',
|
|
21
|
-
nodeId: '',
|
|
22
|
-
inputsList: [],
|
|
23
|
-
outputsList: [],
|
|
24
|
-
controlsList: [],
|
|
25
|
-
hasSelection: false,
|
|
26
|
-
isFireable: false,
|
|
27
|
-
isSubgraph: false,
|
|
28
|
-
isTemplateBuilder: false,
|
|
29
|
-
innerNodeCount: 0,
|
|
30
|
-
onFire: () => {
|
|
31
|
-
if (this._currentNodeId) {
|
|
32
|
-
this.dispatchEvent(new CustomEvent('node-fire', {
|
|
33
|
-
detail: { nodeId: this._currentNodeId },
|
|
34
|
-
bubbles: true,
|
|
35
|
-
composed: true,
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
onEnterSubgraph: () => {
|
|
40
|
-
if (this._canvas && this._currentNodeId) {
|
|
41
|
-
this._canvas.drillDown(this._currentNodeId);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** @type {*} */
|
|
47
|
-
_canvas = null;
|
|
48
|
-
|
|
49
|
-
/** @type {string|null} */
|
|
50
|
-
_currentNodeId = null;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Show inspector for a node
|
|
54
|
-
* @param {*} node - Node instance or node-like object
|
|
55
|
-
*/
|
|
56
|
-
inspect(node) {
|
|
57
|
-
if (!node) {
|
|
58
|
-
this.clear();
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const inputs = Object.entries(node.inputs).map(([key, port]) => ({
|
|
63
|
-
key,
|
|
64
|
-
label: port.label || key,
|
|
65
|
-
socketType: port.socket?.name || 'any',
|
|
66
|
-
}));
|
|
67
|
-
|
|
68
|
-
const outputs = Object.entries(node.outputs).map(([key, port]) => ({
|
|
69
|
-
key,
|
|
70
|
-
label: port.label || key,
|
|
71
|
-
socketType: port.socket?.name || 'any',
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
const controls = Object.entries(node.controls).map(([key, ctrl]) => ({
|
|
75
|
-
key,
|
|
76
|
-
label: ctrl.label || key,
|
|
77
|
-
value: ctrl.value ?? '',
|
|
78
|
-
type: ctrl.type || 'text',
|
|
79
|
-
options: (ctrl.options || []).join(','),
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
const isSubgraph = !!node._isSubgraph;
|
|
83
|
-
let innerNodeCount = 0;
|
|
84
|
-
if (isSubgraph && node.innerEditor) {
|
|
85
|
-
innerNodeCount = node.innerEditor.getNodes().length;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
this._currentNodeId = node.id;
|
|
89
|
-
|
|
90
|
-
// Check if node is fireable (inject or trigger with testData)
|
|
91
|
-
const driver = node.driver || node._driver;
|
|
92
|
-
const isFireable = !!(driver?.fireable) ||
|
|
93
|
-
node.type === 'debug/inject' ||
|
|
94
|
-
(node.category === 'trigger' || node.category === 'queue');
|
|
95
|
-
|
|
96
|
-
this.set$({
|
|
97
|
-
nodeLabel: node.label,
|
|
98
|
-
nodeType: node.type || 'default',
|
|
99
|
-
nodeCategory: node.category || 'default',
|
|
100
|
-
nodeId: node.id,
|
|
101
|
-
inputsList: inputs,
|
|
102
|
-
outputsList: outputs,
|
|
103
|
-
controlsList: controls,
|
|
104
|
-
hasSelection: true,
|
|
105
|
-
visible: true,
|
|
106
|
-
isFireable,
|
|
107
|
-
isSubgraph,
|
|
108
|
-
isTemplateBuilder: node.type === 'transform/template-builder' || node.type === 'transform/template',
|
|
109
|
-
innerNodeCount,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// Populate template-preview with current template value
|
|
113
|
-
if (node.type === 'transform/template-builder' || node.type === 'transform/template') {
|
|
114
|
-
requestAnimationFrame(() => {
|
|
115
|
-
/** @type {*} */
|
|
116
|
-
const preview = this.querySelector('template-preview');
|
|
117
|
-
if (preview && node.params?.template) {
|
|
118
|
-
preview.$.template = node.params.template;
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/** Clear inspector */
|
|
125
|
-
clear() {
|
|
126
|
-
this._currentNodeId = null;
|
|
127
|
-
this.set$({
|
|
128
|
-
hasSelection: false,
|
|
129
|
-
nodeLabel: '',
|
|
130
|
-
nodeType: '',
|
|
131
|
-
nodeCategory: '',
|
|
132
|
-
nodeId: '',
|
|
133
|
-
inputsList: [],
|
|
134
|
-
outputsList: [],
|
|
135
|
-
controlsList: [],
|
|
136
|
-
isFireable: false,
|
|
137
|
-
isSubgraph: false,
|
|
138
|
-
isTemplateBuilder: false,
|
|
139
|
-
innerNodeCount: 0,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
renderCallback() {
|
|
144
|
-
this.sub('visible', (val) => {
|
|
145
|
-
this.toggleAttribute('hidden', !val);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
// Listen for control value changes from InspCtrlItem
|
|
149
|
-
this.addEventListener('ctrl-change', (/** @type {CustomEvent} */ e) => {
|
|
150
|
-
const { key, value } = e.detail;
|
|
151
|
-
if (this._currentNodeId && this._canvas) {
|
|
152
|
-
const editor = this._canvas._editor;
|
|
153
|
-
if (editor) {
|
|
154
|
-
const node = editor.getNode(this._currentNodeId);
|
|
155
|
-
if (node && node.controls[key]) {
|
|
156
|
-
node.controls[key].setValue(value);
|
|
157
|
-
}
|
|
158
|
-
// Also update params for serialization
|
|
159
|
-
if (node && node.params) {
|
|
160
|
-
node.params[key] = value;
|
|
161
|
-
}
|
|
162
|
-
// Update template-preview when template field changes
|
|
163
|
-
if (key === 'template') {
|
|
164
|
-
const preview = this.querySelector('template-preview');
|
|
165
|
-
if (preview) preview.$.template = value;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
this.sub('hasSelection', (val) => {
|
|
172
|
-
/** @type {HTMLElement} */
|
|
173
|
-
const empty = this.querySelector('.insp-empty');
|
|
174
|
-
/** @type {HTMLElement} */
|
|
175
|
-
const content = this.querySelector('.insp-content');
|
|
176
|
-
if (empty) empty.hidden = val;
|
|
177
|
-
if (content) content.hidden = !val;
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
this.sub('isSubgraph', (val) => {
|
|
181
|
-
/** @type {HTMLElement} */
|
|
182
|
-
const sgSection = this.querySelector('.insp-subgraph');
|
|
183
|
-
if (sgSection) sgSection.hidden = !val;
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
// Resize drag handle
|
|
187
|
-
const STORAGE_KEY = 'sn-inspector-width';
|
|
188
|
-
const handle = this.querySelector('.insp-resize-handle');
|
|
189
|
-
|
|
190
|
-
// Restore saved width
|
|
191
|
-
const saved = localStorage.getItem(STORAGE_KEY);
|
|
192
|
-
if (saved) this.style.width = saved + 'px';
|
|
193
|
-
|
|
194
|
-
if (handle) {
|
|
195
|
-
let startX = 0;
|
|
196
|
-
let startW = 0;
|
|
197
|
-
|
|
198
|
-
/** @param {PointerEvent} e */
|
|
199
|
-
const onMove = (e) => {
|
|
200
|
-
const delta = startX - e.clientX;
|
|
201
|
-
const newWidth = Math.max(200, Math.min(600, startW + delta));
|
|
202
|
-
this.style.width = newWidth + 'px';
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const onUp = () => {
|
|
206
|
-
handle.classList.remove('dragging');
|
|
207
|
-
localStorage.setItem(STORAGE_KEY, String(this.offsetWidth));
|
|
208
|
-
document.removeEventListener('pointermove', onMove);
|
|
209
|
-
document.removeEventListener('pointerup', onUp);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
handle.addEventListener('pointerdown', (/** @type {PointerEvent} */ e) => {
|
|
213
|
-
e.preventDefault();
|
|
214
|
-
e.stopPropagation();
|
|
215
|
-
startX = e.clientX;
|
|
216
|
-
startW = this.offsetWidth;
|
|
217
|
-
handle.classList.add('dragging');
|
|
218
|
-
document.addEventListener('pointermove', onMove);
|
|
219
|
-
document.addEventListener('pointerup', onUp);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Port item for itemize
|
|
226
|
-
class InspPortItem extends Symbiote {
|
|
227
|
-
init$ = {
|
|
228
|
-
key: '',
|
|
229
|
-
label: '',
|
|
230
|
-
socketType: '',
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
InspPortItem.template = inspPortItemTemplate;
|
|
235
|
-
InspPortItem.reg('insp-port-item');
|
|
236
|
-
|
|
237
|
-
// Control item for itemize — renders editable form controls
|
|
238
|
-
class InspCtrlItem extends Symbiote {
|
|
239
|
-
init$ = {
|
|
240
|
-
key: '',
|
|
241
|
-
label: '',
|
|
242
|
-
value: '',
|
|
243
|
-
type: 'text',
|
|
244
|
-
options: '',
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
renderCallback() {
|
|
248
|
-
/** @type {HTMLElement} */
|
|
249
|
-
const container = this.querySelector('.insp-ctrl-input');
|
|
250
|
-
if (!container) return;
|
|
251
|
-
|
|
252
|
-
this.sub('type', (type) => {
|
|
253
|
-
this._renderControl(container, type);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Render the appropriate control element
|
|
259
|
-
* @param {HTMLElement} container
|
|
260
|
-
* @param {string} type
|
|
261
|
-
*/
|
|
262
|
-
_renderControl(container, type) {
|
|
263
|
-
container.innerHTML = '';
|
|
264
|
-
|
|
265
|
-
if (type === 'textarea') {
|
|
266
|
-
const el = document.createElement('textarea');
|
|
267
|
-
el.className = 'insp-ctrl-textarea';
|
|
268
|
-
el.value = this.$.value || '';
|
|
269
|
-
el.rows = 6;
|
|
270
|
-
el.spellcheck = false;
|
|
271
|
-
el.addEventListener('input', () => this._emitChange(el.value));
|
|
272
|
-
container.appendChild(el);
|
|
273
|
-
} else if (type === 'boolean') {
|
|
274
|
-
const label = document.createElement('label');
|
|
275
|
-
label.className = 'insp-ctrl-toggle';
|
|
276
|
-
const el = document.createElement('input');
|
|
277
|
-
el.type = 'checkbox';
|
|
278
|
-
el.checked = this.$.value === true || this.$.value === 'true';
|
|
279
|
-
el.addEventListener('change', () => this._emitChange(el.checked));
|
|
280
|
-
const slider = document.createElement('span');
|
|
281
|
-
slider.className = 'insp-ctrl-slider';
|
|
282
|
-
label.appendChild(el);
|
|
283
|
-
label.appendChild(slider);
|
|
284
|
-
container.appendChild(label);
|
|
285
|
-
} else if (type === 'select') {
|
|
286
|
-
const el = document.createElement('select');
|
|
287
|
-
el.className = 'insp-ctrl-select';
|
|
288
|
-
const opts = typeof this.$.options === 'string'
|
|
289
|
-
? this.$.options.split(',').map((s) => s.trim()).filter(Boolean)
|
|
290
|
-
: [];
|
|
291
|
-
for (const opt of opts) {
|
|
292
|
-
const option = document.createElement('option');
|
|
293
|
-
option.value = opt;
|
|
294
|
-
option.textContent = opt;
|
|
295
|
-
if (opt === String(this.$.value)) option.selected = true;
|
|
296
|
-
el.appendChild(option);
|
|
297
|
-
}
|
|
298
|
-
el.addEventListener('change', () => this._emitChange(el.value));
|
|
299
|
-
container.appendChild(el);
|
|
300
|
-
} else {
|
|
301
|
-
// text / number
|
|
302
|
-
const el = document.createElement('input');
|
|
303
|
-
el.className = 'insp-ctrl-input-el';
|
|
304
|
-
el.type = type === 'number' ? 'number' : 'text';
|
|
305
|
-
el.value = this.$.value ?? '';
|
|
306
|
-
el.spellcheck = false;
|
|
307
|
-
el.addEventListener('input', () => {
|
|
308
|
-
this._emitChange(type === 'number' ? Number(el.value) : el.value);
|
|
309
|
-
});
|
|
310
|
-
container.appendChild(el);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Emit change event to parent InspectorPanel
|
|
316
|
-
* @param {*} value
|
|
317
|
-
*/
|
|
318
|
-
_emitChange(value) {
|
|
319
|
-
this.$.value = value;
|
|
320
|
-
this.dispatchEvent(new CustomEvent('ctrl-change', {
|
|
321
|
-
bubbles: true,
|
|
322
|
-
detail: { key: this.$.key, value },
|
|
323
|
-
}));
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
InspCtrlItem.template = inspCtrlItemTemplate;
|
|
328
|
-
InspCtrlItem.reg('insp-ctrl-item');
|
|
329
|
-
|
|
330
|
-
InspectorPanel.template = template;
|
|
331
|
-
InspectorPanel.rootStyles = styles;
|
|
332
|
-
InspectorPanel.reg('inspector-panel');
|