pmx-canvas 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/Readme.md +865 -0
- package/dist/canvas/global.css +3173 -0
- package/dist/canvas/index.js +183 -0
- package/dist/json-render/index.css +2 -0
- package/dist/json-render/index.js +389 -0
- package/dist/types/cli/agent.d.ts +13 -0
- package/dist/types/cli/index.d.ts +2 -0
- package/dist/types/cli/watch.d.ts +5 -0
- package/dist/types/client/App.d.ts +1 -0
- package/dist/types/client/canvas/AttentionHistory.d.ts +1 -0
- package/dist/types/client/canvas/AttentionToast.d.ts +1 -0
- package/dist/types/client/canvas/CanvasNode.d.ts +8 -0
- package/dist/types/client/canvas/CanvasViewport.d.ts +8 -0
- package/dist/types/client/canvas/CommandPalette.d.ts +4 -0
- package/dist/types/client/canvas/ContextMenu.d.ts +24 -0
- package/dist/types/client/canvas/ContextPinBar.d.ts +1 -0
- package/dist/types/client/canvas/ContextPinHud.d.ts +1 -0
- package/dist/types/client/canvas/DockedNode.d.ts +4 -0
- package/dist/types/client/canvas/EdgeLayer.d.ts +8 -0
- package/dist/types/client/canvas/ExpandedNodeOverlay.d.ts +1 -0
- package/dist/types/client/canvas/FocusFieldLayer.d.ts +1 -0
- package/dist/types/client/canvas/Minimap.d.ts +23 -0
- package/dist/types/client/canvas/SelectionBar.d.ts +1 -0
- package/dist/types/client/canvas/ShortcutOverlay.d.ts +3 -0
- package/dist/types/client/canvas/SnapshotPanel.d.ts +7 -0
- package/dist/types/client/canvas/snap-guides.d.ts +23 -0
- package/dist/types/client/canvas/use-node-drag.d.ts +15 -0
- package/dist/types/client/canvas/use-node-resize.d.ts +15 -0
- package/dist/types/client/canvas/use-pan-zoom.d.ts +16 -0
- package/dist/types/client/ext-app/bridge.d.ts +161 -0
- package/dist/types/client/icons.d.ts +70 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/nodes/ContextNode.d.ts +34 -0
- package/dist/types/client/nodes/ExtAppFrame.d.ts +18 -0
- package/dist/types/client/nodes/FileNode.d.ts +5 -0
- package/dist/types/client/nodes/GroupNode.d.ts +6 -0
- package/dist/types/client/nodes/ImageNode.d.ts +10 -0
- package/dist/types/client/nodes/InlineFormatBar.d.ts +7 -0
- package/dist/types/client/nodes/InlineMarkdownEditor.d.ts +14 -0
- package/dist/types/client/nodes/LedgerNode.d.ts +4 -0
- package/dist/types/client/nodes/MarkdownNode.d.ts +6 -0
- package/dist/types/client/nodes/McpAppNode.d.ts +4 -0
- package/dist/types/client/nodes/MdFormatBar.d.ts +8 -0
- package/dist/types/client/nodes/PromptNode.d.ts +5 -0
- package/dist/types/client/nodes/ResponseNode.d.ts +5 -0
- package/dist/types/client/nodes/StatusNode.d.ts +4 -0
- package/dist/types/client/nodes/StatusSummary.d.ts +4 -0
- package/dist/types/client/nodes/TraceNode.d.ts +4 -0
- package/dist/types/client/nodes/WebpageNode.d.ts +5 -0
- package/dist/types/client/nodes/image-warnings.d.ts +6 -0
- package/dist/types/client/nodes/inline-editor-commands.d.ts +11 -0
- package/dist/types/client/nodes/md-format.d.ts +25 -0
- package/dist/types/client/state/attention-bridge.d.ts +3 -0
- package/dist/types/client/state/attention-store.d.ts +25 -0
- package/dist/types/client/state/canvas-store.d.ts +74 -0
- package/dist/types/client/state/intent-bridge.d.ts +158 -0
- package/dist/types/client/state/sse-bridge.d.ts +5 -0
- package/dist/types/client/theme/tokens.d.ts +27 -0
- package/dist/types/client/types.d.ts +40 -0
- package/dist/types/client/utils/ext-app-tool-result.d.ts +1 -0
- package/dist/types/client/utils/placement.d.ts +1 -0
- package/dist/types/client/utils/platform.d.ts +2 -0
- package/dist/types/json-render/catalog.d.ts +815 -0
- package/dist/types/json-render/charts/components.d.ts +54 -0
- package/dist/types/json-render/charts/definitions.d.ts +103 -0
- package/dist/types/json-render/charts/extra-components.d.ts +58 -0
- package/dist/types/json-render/charts/extra-definitions.d.ts +181 -0
- package/dist/types/json-render/renderer/index.d.ts +16 -0
- package/dist/types/json-render/schema.d.ts +46 -0
- package/dist/types/json-render/server.d.ts +55 -0
- package/dist/types/mcp/server.d.ts +22 -0
- package/dist/types/server/agent-context.d.ts +21 -0
- package/dist/types/server/artifact-paths.d.ts +3 -0
- package/dist/types/server/canvas-operations.d.ts +154 -0
- package/dist/types/server/canvas-provenance.d.ts +13 -0
- package/dist/types/server/canvas-schema.d.ts +49 -0
- package/dist/types/server/canvas-serialization.d.ts +25 -0
- package/dist/types/server/canvas-state.d.ts +174 -0
- package/dist/types/server/canvas-validation.d.ts +33 -0
- package/dist/types/server/chart-template.d.ts +29 -0
- package/dist/types/server/code-graph.d.ts +67 -0
- package/dist/types/server/context-cards.d.ts +24 -0
- package/dist/types/server/diagram-presets.d.ts +28 -0
- package/dist/types/server/ext-app-call-registry.d.ts +16 -0
- package/dist/types/server/ext-app-tool-result.d.ts +1 -0
- package/dist/types/server/file-watcher.d.ts +16 -0
- package/dist/types/server/index.d.ts +243 -0
- package/dist/types/server/mcp-app-candidate.d.ts +25 -0
- package/dist/types/server/mcp-app-host.d.ts +65 -0
- package/dist/types/server/mcp-app-runtime.d.ts +47 -0
- package/dist/types/server/mutation-history.d.ts +105 -0
- package/dist/types/server/placement.d.ts +37 -0
- package/dist/types/server/server.d.ts +103 -0
- package/dist/types/server/spatial-analysis.d.ts +87 -0
- package/dist/types/server/trace-manager.d.ts +48 -0
- package/dist/types/server/web-artifacts.d.ts +50 -0
- package/dist/types/server/webpage-node.d.ts +25 -0
- package/dist/types/shared/auto-arrange.d.ts +29 -0
- package/dist/types/shared/ext-app-tool-result.d.ts +9 -0
- package/dist/types/shared/placement.d.ts +26 -0
- package/dist/types/shared/semantic-attention.d.ts +97 -0
- package/package.json +109 -0
- package/skills/data-analysis/SKILL.md +324 -0
- package/skills/doc-coauthoring/SKILL.md +375 -0
- package/skills/frontend-design/SKILL.md +45 -0
- package/skills/json-render-codegen/SKILL.md +112 -0
- package/skills/json-render-core/SKILL.md +265 -0
- package/skills/json-render-ink/SKILL.md +273 -0
- package/skills/json-render-mcp/SKILL.md +132 -0
- package/skills/json-render-react/SKILL.md +264 -0
- package/skills/json-render-shadcn/SKILL.md +159 -0
- package/skills/playwright-cli/SKILL.md +67 -0
- package/skills/pmx-canvas/SKILL.md +668 -0
- package/skills/pmx-canvas/evals/evals.json +186 -0
- package/skills/pmx-canvas-testing/SKILL.md +78 -0
- package/skills/published-consumer-e2e/SKILL.md +43 -0
- package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +241 -0
- package/skills/web-artifacts-builder/SKILL.md +80 -0
- package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +167 -0
- package/skills/web-artifacts-builder/scripts/init-artifact.sh +425 -0
- package/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/web-design-guidelines/SKILL.md +39 -0
- package/src/cli/agent.ts +2144 -0
- package/src/cli/index.ts +622 -0
- package/src/cli/watch.ts +88 -0
- package/src/client/App.tsx +507 -0
- package/src/client/canvas/AttentionHistory.tsx +81 -0
- package/src/client/canvas/AttentionToast.tsx +19 -0
- package/src/client/canvas/CanvasNode.tsx +363 -0
- package/src/client/canvas/CanvasViewport.tsx +590 -0
- package/src/client/canvas/CommandPalette.tsx +302 -0
- package/src/client/canvas/ContextMenu.tsx +601 -0
- package/src/client/canvas/ContextPinBar.tsx +25 -0
- package/src/client/canvas/ContextPinHud.tsx +22 -0
- package/src/client/canvas/DockedNode.tsx +66 -0
- package/src/client/canvas/EdgeLayer.tsx +280 -0
- package/src/client/canvas/ExpandedNodeOverlay.tsx +260 -0
- package/src/client/canvas/FocusFieldLayer.tsx +107 -0
- package/src/client/canvas/Minimap.tsx +301 -0
- package/src/client/canvas/SelectionBar.tsx +69 -0
- package/src/client/canvas/ShortcutOverlay.tsx +69 -0
- package/src/client/canvas/SnapshotPanel.tsx +236 -0
- package/src/client/canvas/snap-guides.ts +170 -0
- package/src/client/canvas/use-node-drag.ts +51 -0
- package/src/client/canvas/use-node-resize.ts +59 -0
- package/src/client/canvas/use-pan-zoom.ts +191 -0
- package/src/client/ext-app/bridge.ts +542 -0
- package/src/client/icons.tsx +424 -0
- package/src/client/index.tsx +7 -0
- package/src/client/nodes/ContextNode.tsx +412 -0
- package/src/client/nodes/ExtAppFrame.tsx +509 -0
- package/src/client/nodes/FileNode.tsx +256 -0
- package/src/client/nodes/GroupNode.tsx +39 -0
- package/src/client/nodes/ImageNode.tsx +160 -0
- package/src/client/nodes/InlineFormatBar.tsx +169 -0
- package/src/client/nodes/InlineMarkdownEditor.tsx +123 -0
- package/src/client/nodes/LedgerNode.tsx +37 -0
- package/src/client/nodes/MarkdownNode.tsx +359 -0
- package/src/client/nodes/McpAppNode.tsx +85 -0
- package/src/client/nodes/MdFormatBar.tsx +109 -0
- package/src/client/nodes/PromptNode.tsx +597 -0
- package/src/client/nodes/ResponseNode.tsx +153 -0
- package/src/client/nodes/StatusNode.tsx +84 -0
- package/src/client/nodes/StatusSummary.tsx +38 -0
- package/src/client/nodes/TraceNode.tsx +120 -0
- package/src/client/nodes/WebpageNode.tsx +288 -0
- package/src/client/nodes/image-warnings.ts +95 -0
- package/src/client/nodes/inline-editor-commands.ts +37 -0
- package/src/client/nodes/md-format.ts +206 -0
- package/src/client/state/attention-bridge.ts +328 -0
- package/src/client/state/attention-store.ts +73 -0
- package/src/client/state/canvas-store.ts +631 -0
- package/src/client/state/intent-bridge.ts +315 -0
- package/src/client/state/sse-bridge.ts +965 -0
- package/src/client/theme/global.css +3173 -0
- package/src/client/theme/tokens.ts +72 -0
- package/src/client/types-shims.d.ts +5 -0
- package/src/client/types.ts +81 -0
- package/src/client/utils/ext-app-tool-result.ts +4 -0
- package/src/client/utils/placement.ts +4 -0
- package/src/client/utils/platform.ts +2 -0
- package/src/json-render/catalog.ts +256 -0
- package/src/json-render/charts/components.tsx +198 -0
- package/src/json-render/charts/definitions.ts +81 -0
- package/src/json-render/charts/extra-components.tsx +267 -0
- package/src/json-render/charts/extra-definitions.ts +145 -0
- package/src/json-render/renderer/index.css +174 -0
- package/src/json-render/renderer/index.tsx +86 -0
- package/src/json-render/schema.ts +62 -0
- package/src/json-render/server.ts +597 -0
- package/src/mcp/server.ts +1377 -0
- package/src/server/agent-context.ts +242 -0
- package/src/server/artifact-paths.ts +17 -0
- package/src/server/canvas-operations.ts +1279 -0
- package/src/server/canvas-provenance.ts +243 -0
- package/src/server/canvas-schema.ts +432 -0
- package/src/server/canvas-serialization.ts +95 -0
- package/src/server/canvas-state.ts +1134 -0
- package/src/server/canvas-validation.ts +114 -0
- package/src/server/chart-template.ts +449 -0
- package/src/server/code-graph.ts +370 -0
- package/src/server/context-cards.ts +31 -0
- package/src/server/diagram-presets.ts +71 -0
- package/src/server/ext-app-call-registry.ts +77 -0
- package/src/server/ext-app-tool-result.ts +4 -0
- package/src/server/file-watcher.ts +121 -0
- package/src/server/index.ts +647 -0
- package/src/server/mcp-app-candidate.ts +174 -0
- package/src/server/mcp-app-host.ts +814 -0
- package/src/server/mcp-app-runtime.ts +459 -0
- package/src/server/mutation-history.ts +350 -0
- package/src/server/placement.ts +125 -0
- package/src/server/server.ts +3846 -0
- package/src/server/spatial-analysis.ts +356 -0
- package/src/server/trace-manager.ts +333 -0
- package/src/server/web-artifacts/scripts/bundle-artifact.sh +167 -0
- package/src/server/web-artifacts/scripts/init-artifact.sh +426 -0
- package/src/server/web-artifacts/scripts/shadcn-components.tar.gz +0 -0
- package/src/server/web-artifacts.ts +442 -0
- package/src/server/webpage-node.ts +328 -0
- package/src/shared/auto-arrange.ts +439 -0
- package/src/shared/ext-app-tool-result.ts +76 -0
- package/src/shared/placement.ts +81 -0
- package/src/shared/semantic-attention.ts +598 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import type { JSX } from 'preact';
|
|
2
|
+
|
|
3
|
+
interface IconProps {
|
|
4
|
+
size?: number;
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const defaults = { fill: 'none', stroke: 'currentColor', 'stroke-width': '1.5', 'stroke-linecap': 'round', 'stroke-linejoin': 'round' } as const;
|
|
9
|
+
|
|
10
|
+
function Icon({ size = 16, children, ...rest }: IconProps & { children: JSX.Element | JSX.Element[] }): JSX.Element {
|
|
11
|
+
return (
|
|
12
|
+
<svg width={size} height={size} viewBox="0 0 16 16" {...defaults} {...rest}>
|
|
13
|
+
{children}
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Expand-arrows — fit all nodes */
|
|
19
|
+
export function IconFitAll(p: IconProps): JSX.Element {
|
|
20
|
+
return (
|
|
21
|
+
<Icon {...p}>
|
|
22
|
+
<polyline points="1 5 1 1 5 1" />
|
|
23
|
+
<polyline points="11 1 15 1 15 5" />
|
|
24
|
+
<polyline points="15 11 15 15 11 15" />
|
|
25
|
+
<polyline points="5 15 1 15 1 11" />
|
|
26
|
+
<rect x="4" y="4" width="8" height="8" rx="1" />
|
|
27
|
+
</Icon>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Framed crosshair — reset view 1:1 */
|
|
32
|
+
export function IconResetView(p: IconProps): JSX.Element {
|
|
33
|
+
return (
|
|
34
|
+
<Icon {...p}>
|
|
35
|
+
<rect x="2" y="2" width="12" height="12" rx="2" />
|
|
36
|
+
<line x1="8" y1="4.5" x2="8" y2="6.5" />
|
|
37
|
+
<line x1="8" y1="9.5" x2="8" y2="11.5" />
|
|
38
|
+
<line x1="4.5" y1="8" x2="6.5" y2="8" />
|
|
39
|
+
<line x1="9.5" y1="8" x2="11.5" y2="8" />
|
|
40
|
+
<circle cx="8" cy="8" r="1" fill="currentColor" stroke="none" />
|
|
41
|
+
</Icon>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Magnifier with + */
|
|
46
|
+
export function IconZoomIn(p: IconProps): JSX.Element {
|
|
47
|
+
return (
|
|
48
|
+
<Icon {...p}>
|
|
49
|
+
<circle cx="7" cy="7" r="4.5" />
|
|
50
|
+
<line x1="10.5" y1="10.5" x2="14.5" y2="14.5" />
|
|
51
|
+
<line x1="5" y1="7" x2="9" y2="7" />
|
|
52
|
+
<line x1="7" y1="5" x2="7" y2="9" />
|
|
53
|
+
</Icon>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Magnifier with - */
|
|
58
|
+
export function IconZoomOut(p: IconProps): JSX.Element {
|
|
59
|
+
return (
|
|
60
|
+
<Icon {...p}>
|
|
61
|
+
<circle cx="7" cy="7" r="4.5" />
|
|
62
|
+
<line x1="10.5" y1="10.5" x2="14.5" y2="14.5" />
|
|
63
|
+
<line x1="5" y1="7" x2="9" y2="7" />
|
|
64
|
+
</Icon>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** 2x2 grid with links — auto-arrange */
|
|
69
|
+
export function IconArrange(p: IconProps): JSX.Element {
|
|
70
|
+
return (
|
|
71
|
+
<Icon {...p}>
|
|
72
|
+
<rect x="1.5" y="1.5" width="5" height="5" rx="1" />
|
|
73
|
+
<rect x="9.5" y="1.5" width="5" height="5" rx="1" />
|
|
74
|
+
<rect x="1.5" y="9.5" width="5" height="5" rx="1" />
|
|
75
|
+
<rect x="9.5" y="9.5" width="5" height="5" rx="1" />
|
|
76
|
+
<line x1="6.5" y1="4" x2="9.5" y2="4" />
|
|
77
|
+
<line x1="6.5" y1="12" x2="9.5" y2="12" />
|
|
78
|
+
<line x1="4" y1="6.5" x2="4" y2="9.5" />
|
|
79
|
+
<line x1="12" y1="6.5" x2="12" y2="9.5" />
|
|
80
|
+
</Icon>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Frame with focused inner corner — minimap */
|
|
85
|
+
export function IconMinimap(p: IconProps): JSX.Element {
|
|
86
|
+
return (
|
|
87
|
+
<Icon {...p}>
|
|
88
|
+
<rect x="1" y="2" width="14" height="12" rx="1.5" />
|
|
89
|
+
<rect x="8" y="7" width="6" height="6" rx="1" fill="currentColor" fill-opacity="0.2" />
|
|
90
|
+
</Icon>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Sun with rays */
|
|
95
|
+
export function IconSun(p: IconProps): JSX.Element {
|
|
96
|
+
return (
|
|
97
|
+
<Icon {...p}>
|
|
98
|
+
<circle cx="8" cy="8" r="3" />
|
|
99
|
+
<line x1="8" y1="1" x2="8" y2="3" />
|
|
100
|
+
<line x1="8" y1="13" x2="8" y2="15" />
|
|
101
|
+
<line x1="1" y1="8" x2="3" y2="8" />
|
|
102
|
+
<line x1="13" y1="8" x2="15" y2="8" />
|
|
103
|
+
<line x1="3.05" y1="3.05" x2="4.46" y2="4.46" />
|
|
104
|
+
<line x1="11.54" y1="11.54" x2="12.95" y2="12.95" />
|
|
105
|
+
<line x1="3.05" y1="12.95" x2="4.46" y2="11.54" />
|
|
106
|
+
<line x1="11.54" y1="4.46" x2="12.95" y2="3.05" />
|
|
107
|
+
</Icon>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Crescent moon */
|
|
112
|
+
export function IconMoon(p: IconProps): JSX.Element {
|
|
113
|
+
return (
|
|
114
|
+
<Icon {...p}>
|
|
115
|
+
<path d="M13 9.5A5.5 5.5 0 1 1 6.5 3 4.5 4.5 0 0 0 13 9.5Z" />
|
|
116
|
+
</Icon>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Camera — snapshots */
|
|
121
|
+
export function IconSnapshot(p: IconProps): JSX.Element {
|
|
122
|
+
return (
|
|
123
|
+
<Icon {...p}>
|
|
124
|
+
<rect x="1" y="4" width="14" height="10" rx="1.5" />
|
|
125
|
+
<path d="M5.5 4 L6.5 2.5 H9.5 L10.5 4" />
|
|
126
|
+
<circle cx="8" cy="9" r="2.3" />
|
|
127
|
+
</Icon>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Bullseye — trace toggle */
|
|
132
|
+
export function IconTrace(p: IconProps): JSX.Element {
|
|
133
|
+
return (
|
|
134
|
+
<Icon {...p}>
|
|
135
|
+
<circle cx="8" cy="8" r="6" />
|
|
136
|
+
<circle cx="8" cy="8" r="3" />
|
|
137
|
+
<circle cx="8" cy="8" r="0.8" fill="currentColor" stroke="none" />
|
|
138
|
+
</Icon>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** X in circle — clear trace */
|
|
143
|
+
export function IconClearTrace(p: IconProps): JSX.Element {
|
|
144
|
+
return (
|
|
145
|
+
<Icon {...p}>
|
|
146
|
+
<circle cx="8" cy="8" r="6" />
|
|
147
|
+
<line x1="5.5" y1="5.5" x2="10.5" y2="10.5" />
|
|
148
|
+
<line x1="10.5" y1="5.5" x2="5.5" y2="10.5" />
|
|
149
|
+
</Icon>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Magnifying glass — search */
|
|
154
|
+
export function IconSearch(p: IconProps): JSX.Element {
|
|
155
|
+
return (
|
|
156
|
+
<Icon {...p}>
|
|
157
|
+
<circle cx="7" cy="7" r="4.5" />
|
|
158
|
+
<line x1="10.5" y1="10.5" x2="14.5" y2="14.5" />
|
|
159
|
+
</Icon>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Keyboard — shortcuts */
|
|
164
|
+
export function IconShortcuts(p: IconProps): JSX.Element {
|
|
165
|
+
return (
|
|
166
|
+
<Icon {...p}>
|
|
167
|
+
<rect x="1" y="3" width="14" height="10" rx="1.5" />
|
|
168
|
+
<line x1="4" y1="6" x2="5" y2="6" />
|
|
169
|
+
<line x1="7.5" y1="6" x2="8.5" y2="6" />
|
|
170
|
+
<line x1="11" y1="6" x2="12" y2="6" />
|
|
171
|
+
<line x1="4" y1="10" x2="12" y2="10" />
|
|
172
|
+
</Icon>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Half-lit circle — theme toggle (generic). */
|
|
177
|
+
export function IconTheme(p: IconProps): JSX.Element {
|
|
178
|
+
return (
|
|
179
|
+
<Icon {...p}>
|
|
180
|
+
<circle cx="8" cy="8" r="6" />
|
|
181
|
+
<path d="M8 2 A 6 6 0 0 1 8 14 Z" fill="currentColor" stroke="none" />
|
|
182
|
+
</Icon>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Framed pin — context pinning. */
|
|
187
|
+
export function IconPin(p: IconProps): JSX.Element {
|
|
188
|
+
return (
|
|
189
|
+
<Icon {...p}>
|
|
190
|
+
<rect x="2" y="5" width="12" height="9" rx="1.5" />
|
|
191
|
+
<line x1="11" y1="1.5" x2="11" y2="5" />
|
|
192
|
+
<circle cx="11" cy="4.5" r="1.6" fill="currentColor" stroke="none" />
|
|
193
|
+
</Icon>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** Focus Field — PMX Canvas brand mark (concentric rounded squares → lit core). */
|
|
198
|
+
export function IconLogo({ size = 22, class: className }: IconProps): JSX.Element {
|
|
199
|
+
return (
|
|
200
|
+
<svg
|
|
201
|
+
width={size}
|
|
202
|
+
height={size}
|
|
203
|
+
viewBox="0 0 64 64"
|
|
204
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
205
|
+
class={className}
|
|
206
|
+
aria-hidden="true"
|
|
207
|
+
>
|
|
208
|
+
<rect x="8" y="8" width="48" height="48" rx="7" fill="none" stroke="currentColor" stroke-width="2.2" opacity="0.35" />
|
|
209
|
+
<rect x="16" y="16" width="32" height="32" rx="5" fill="none" stroke="currentColor" stroke-width="2.2" opacity="0.6" />
|
|
210
|
+
<rect x="24" y="24" width="16" height="16" rx="3" fill="none" stroke="currentColor" stroke-width="2.2" />
|
|
211
|
+
<rect x="29" y="29" width="6" height="6" rx="1" fill="currentColor" />
|
|
212
|
+
</svg>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* ── Node-type icons · Focus Field family ─────────────────── */
|
|
217
|
+
|
|
218
|
+
/** Framed document with lines — markdown */
|
|
219
|
+
export function IconNodeMarkdown(p: IconProps): JSX.Element {
|
|
220
|
+
return (
|
|
221
|
+
<Icon {...p}>
|
|
222
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
223
|
+
<line x1="4" y1="6" x2="10" y2="6" />
|
|
224
|
+
<line x1="4" y1="8.5" x2="8" y2="8.5" />
|
|
225
|
+
<line x1="4" y1="11" x2="11" y2="11" />
|
|
226
|
+
</Icon>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Framed prompt with chevron and reply tail — prompt */
|
|
231
|
+
export function IconNodePrompt(p: IconProps): JSX.Element {
|
|
232
|
+
return (
|
|
233
|
+
<Icon {...p}>
|
|
234
|
+
<rect x="1.5" y="2.5" width="13" height="9" rx="1.5" />
|
|
235
|
+
<path d="M4 13.5 L5.5 11.5 L8 11.5" />
|
|
236
|
+
<polyline points="5 6 7 8 5 10" />
|
|
237
|
+
<line x1="8" y1="10" x2="11" y2="10" />
|
|
238
|
+
</Icon>
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Framed response with three dots and reply tail — response */
|
|
243
|
+
export function IconNodeResponse(p: IconProps): JSX.Element {
|
|
244
|
+
return (
|
|
245
|
+
<Icon {...p}>
|
|
246
|
+
<rect x="1.5" y="2.5" width="13" height="9" rx="1.5" />
|
|
247
|
+
<path d="M12 13.5 L10.5 11.5 L8 11.5" />
|
|
248
|
+
<circle cx="5" cy="7" r="0.9" fill="currentColor" stroke="none" />
|
|
249
|
+
<circle cx="8" cy="7" r="0.9" fill="currentColor" stroke="none" />
|
|
250
|
+
<circle cx="11" cy="7" r="0.9" fill="currentColor" stroke="none" />
|
|
251
|
+
</Icon>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Dog-eared document — file */
|
|
256
|
+
export function IconNodeFile(p: IconProps): JSX.Element {
|
|
257
|
+
return (
|
|
258
|
+
<Icon {...p}>
|
|
259
|
+
<path d="M3 1.5h6l3.5 3.5v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2.5a1 1 0 0 1 1-1z" />
|
|
260
|
+
<polyline points="9 1.5 9 5 12.5 5" />
|
|
261
|
+
<line x1="4.5" y1="8.5" x2="10.5" y2="8.5" />
|
|
262
|
+
<line x1="4.5" y1="11" x2="9" y2="11" />
|
|
263
|
+
</Icon>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** Framed landscape with sun — image */
|
|
268
|
+
export function IconNodeImage(p: IconProps): JSX.Element {
|
|
269
|
+
return (
|
|
270
|
+
<Icon {...p}>
|
|
271
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
272
|
+
<circle cx="5.5" cy="6.5" r="1.2" />
|
|
273
|
+
<path d="M1.8 12 L6 8.5 L9 11 L11.5 9 L14.2 12" />
|
|
274
|
+
</Icon>
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** Browser-chrome frame — webpage */
|
|
279
|
+
export function IconNodeWebpage(p: IconProps): JSX.Element {
|
|
280
|
+
return (
|
|
281
|
+
<Icon {...p}>
|
|
282
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
283
|
+
<line x1="1.5" y1="5.5" x2="14.5" y2="5.5" />
|
|
284
|
+
<circle cx="3.3" cy="4" r="0.5" fill="currentColor" stroke="none" />
|
|
285
|
+
<circle cx="5" cy="4" r="0.5" fill="currentColor" stroke="none" />
|
|
286
|
+
<circle cx="6.7" cy="4" r="0.5" fill="currentColor" stroke="none" />
|
|
287
|
+
<line x1="4" y1="8" x2="12" y2="8" />
|
|
288
|
+
<line x1="4" y1="10" x2="10" y2="10" />
|
|
289
|
+
</Icon>
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** Card with a pushpin — context */
|
|
294
|
+
export function IconNodeContext(p: IconProps): JSX.Element {
|
|
295
|
+
return (
|
|
296
|
+
<Icon {...p}>
|
|
297
|
+
<rect x="2" y="4" width="12" height="10" rx="1.5" />
|
|
298
|
+
<line x1="2" y1="6.5" x2="14" y2="6.5" />
|
|
299
|
+
<path d="M11 1.5 L11 4" />
|
|
300
|
+
<circle cx="11" cy="4" r="1.6" fill="currentColor" stroke="none" />
|
|
301
|
+
</Icon>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** Dashed frame with three child cards — group */
|
|
306
|
+
export function IconNodeGroup(p: IconProps): JSX.Element {
|
|
307
|
+
return (
|
|
308
|
+
<Icon {...p}>
|
|
309
|
+
<rect x="1.5" y="1.5" width="13" height="13" rx="1.5" stroke-dasharray="2 1.5" />
|
|
310
|
+
<rect x="4" y="4" width="3.5" height="3.5" rx="0.6" />
|
|
311
|
+
<rect x="8.5" y="4" width="3.5" height="3.5" rx="0.6" />
|
|
312
|
+
<rect x="6.25" y="8.5" width="3.5" height="3.5" rx="0.6" />
|
|
313
|
+
</Icon>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** Framed list with leading dot — status */
|
|
318
|
+
export function IconNodeStatus(p: IconProps): JSX.Element {
|
|
319
|
+
return (
|
|
320
|
+
<Icon {...p}>
|
|
321
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
322
|
+
<circle cx="4.5" cy="8" r="1.1" fill="currentColor" stroke="none" />
|
|
323
|
+
<line x1="6.5" y1="6.5" x2="12.5" y2="6.5" />
|
|
324
|
+
<line x1="6.5" y1="8" x2="11" y2="8" />
|
|
325
|
+
<line x1="6.5" y1="9.5" x2="12" y2="9.5" />
|
|
326
|
+
</Icon>
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** Framed spike chart with end dot — trace node */
|
|
331
|
+
export function IconNodeTrace(p: IconProps): JSX.Element {
|
|
332
|
+
return (
|
|
333
|
+
<Icon {...p}>
|
|
334
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
335
|
+
<path d="M3.5 10.5 L6 6.5 L8.5 9.5 L12.5 5" />
|
|
336
|
+
<circle cx="12.5" cy="5" r="0.9" fill="currentColor" stroke="none" />
|
|
337
|
+
</Icon>
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/** Ledger book with spine — ledger */
|
|
342
|
+
export function IconNodeLedger(p: IconProps): JSX.Element {
|
|
343
|
+
return (
|
|
344
|
+
<Icon {...p}>
|
|
345
|
+
<rect x="2" y="2" width="12" height="12" rx="1.5" />
|
|
346
|
+
<line x1="4.5" y1="5.5" x2="11.5" y2="5.5" />
|
|
347
|
+
<line x1="4.5" y1="8" x2="11.5" y2="8" />
|
|
348
|
+
<line x1="4.5" y1="10.5" x2="8" y2="10.5" />
|
|
349
|
+
<line x1="6.5" y1="2" x2="6.5" y2="14" opacity="0.45" />
|
|
350
|
+
</Icon>
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Framed MCP wordmark — mcp-app */
|
|
355
|
+
export function IconNodeMcpApp(p: IconProps): JSX.Element {
|
|
356
|
+
return (
|
|
357
|
+
<Icon {...p}>
|
|
358
|
+
<rect x="1.5" y="1.5" width="13" height="13" rx="2" />
|
|
359
|
+
<path d="M4 11 L4 6 L6 8.5 L8 6 L8 11" />
|
|
360
|
+
<path d="M10 11 L10 6 L12.5 11 L12.5 6" />
|
|
361
|
+
</Icon>
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** Framed arrow-out — ext-app */
|
|
366
|
+
export function IconNodeExtApp(p: IconProps): JSX.Element {
|
|
367
|
+
return (
|
|
368
|
+
<Icon {...p}>
|
|
369
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
370
|
+
<polyline points="10 5 13 5 13 8" />
|
|
371
|
+
<line x1="13" y1="5" x2="8" y2="10" />
|
|
372
|
+
<path d="M6 6 L3.5 6 L3.5 11.5 L10 11.5 L10 9" />
|
|
373
|
+
</Icon>
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** Framed braces — json-render */
|
|
378
|
+
export function IconNodeJsonRender(p: IconProps): JSX.Element {
|
|
379
|
+
return (
|
|
380
|
+
<Icon {...p}>
|
|
381
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
382
|
+
<path d="M7 5.5 C 5.5 5.5 5.5 8 4 8 C 5.5 8 5.5 10.5 7 10.5" />
|
|
383
|
+
<path d="M9 5.5 C 10.5 5.5 10.5 8 12 8 C 10.5 8 10.5 10.5 9 10.5" />
|
|
384
|
+
</Icon>
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** Framed nodes & edges — graph */
|
|
389
|
+
export function IconNodeGraph(p: IconProps): JSX.Element {
|
|
390
|
+
return (
|
|
391
|
+
<Icon {...p}>
|
|
392
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" />
|
|
393
|
+
<line x1="5.2" y1="6" x2="8" y2="8" />
|
|
394
|
+
<line x1="8" y1="8" x2="10.8" y2="6" />
|
|
395
|
+
<line x1="8" y1="8" x2="8" y2="11" />
|
|
396
|
+
<circle cx="5.2" cy="6" r="1" fill="currentColor" stroke="none" />
|
|
397
|
+
<circle cx="10.8" cy="6" r="1" fill="currentColor" stroke="none" />
|
|
398
|
+
<circle cx="8" cy="8" r="1" fill="currentColor" stroke="none" />
|
|
399
|
+
<circle cx="8" cy="11" r="1" fill="currentColor" stroke="none" />
|
|
400
|
+
</Icon>
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** Map a node type → its Focus Field icon component. */
|
|
405
|
+
export function getNodeIcon(type: string): (p: IconProps) => JSX.Element {
|
|
406
|
+
switch (type) {
|
|
407
|
+
case 'markdown': return IconNodeMarkdown;
|
|
408
|
+
case 'prompt': return IconNodePrompt;
|
|
409
|
+
case 'response': return IconNodeResponse;
|
|
410
|
+
case 'file': return IconNodeFile;
|
|
411
|
+
case 'image': return IconNodeImage;
|
|
412
|
+
case 'webpage': return IconNodeWebpage;
|
|
413
|
+
case 'context': return IconNodeContext;
|
|
414
|
+
case 'group': return IconNodeGroup;
|
|
415
|
+
case 'status': return IconNodeStatus;
|
|
416
|
+
case 'trace': return IconNodeTrace;
|
|
417
|
+
case 'ledger': return IconNodeLedger;
|
|
418
|
+
case 'mcp-app': return IconNodeMcpApp;
|
|
419
|
+
case 'ext-app': return IconNodeExtApp;
|
|
420
|
+
case 'json-render': return IconNodeJsonRender;
|
|
421
|
+
case 'graph': return IconNodeGraph;
|
|
422
|
+
default: return IconNodeMarkdown;
|
|
423
|
+
}
|
|
424
|
+
}
|