@principal-ai/principal-view-react 0.16.56 → 0.16.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphify/consolidated.d.ts +16 -1
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/graphify/index.d.ts +1 -1
- package/dist/graphify/index.d.ts.map +1 -1
- package/dist/graphify/index.js.map +1 -1
- package/dist/graphify/kind.d.ts +1 -1
- package/dist/graphify/kind.d.ts.map +1 -1
- package/dist/graphify/kind.js +7 -1
- package/dist/graphify/kind.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pierre/constructColors.d.ts +24 -0
- package/dist/pierre/constructColors.d.ts.map +1 -0
- package/dist/pierre/constructColors.js +91 -0
- package/dist/pierre/constructColors.js.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
- package/dist/subsystem/ComponentDeclaration.d.ts +2 -2
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
- package/dist/subsystem/ComponentDeclaration.js +12 -11
- package/dist/subsystem/ComponentDeclaration.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +10 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +401 -40
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +49 -10
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/model.d.ts +89 -12
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +55 -25
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts +32 -1
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +122 -24
- package/dist/subsystem/nodes.js.map +1 -1
- package/dist/subsystem/tokenizeComponent.js +1 -1
- package/dist/subsystem/tokenizeComponent.js.map +1 -1
- package/dist/utils/elkLayout.d.ts.map +1 -1
- package/dist/utils/elkLayout.js +4 -3
- package/dist/utils/elkLayout.js.map +1 -1
- package/package.json +1 -1
- package/src/graphify/consolidated.ts +18 -1
- package/src/graphify/index.ts +1 -0
- package/src/graphify/kind.ts +7 -1
- package/src/index.ts +3 -2
- package/src/pierre/constructColors.test.ts +52 -0
- package/src/pierre/constructColors.ts +112 -0
- package/src/stories/{BoundaryNodes.stories.tsx → Audit/BoundaryNodes.stories.tsx} +1 -1
- package/src/stories/{CanvasEdgeTypes.stories.tsx → Audit/CanvasEdgeTypes.stories.tsx} +1 -1
- package/src/stories/{CanvasNodeTypes.stories.tsx → Audit/CanvasNodeTypes.stories.tsx} +1 -1
- package/src/stories/{ColorPriority.stories.tsx → Audit/ColorPriority.stories.tsx} +1 -1
- package/src/stories/{DiamondBadges.stories.tsx → Audit/DiamondBadges.stories.tsx} +1 -1
- package/src/stories/{NodeDimensionsTesting.stories.tsx → Audit/NodeDimensionsTesting.stories.tsx} +2 -2
- package/src/stories/{NodeFieldsAudit.stories.tsx → Audit/NodeFieldsAudit.stories.tsx} +1 -1
- package/src/stories/{NodeFontSizeTesting.stories.tsx → Audit/NodeFontSizeTesting.stories.tsx} +2 -2
- package/src/stories/{NodeShapes.stories.tsx → Audit/NodeShapes.stories.tsx} +1 -1
- package/src/stories/{WideNodesTesting.stories.tsx → Audit/WideNodesTesting.stories.tsx} +2 -2
- package/src/stories/{dashboard → Components}/DashboardRenderer.stories.tsx +2 -2
- package/src/stories/{GraphRenderer.stories.tsx → Components/GraphRenderer.stories.tsx} +2 -2
- package/src/stories/{MultiCanvasRenderer.stories.tsx → Components/MultiCanvasRenderer.stories.tsx} +2 -2
- package/src/stories/{SequenceDiagram.stories.tsx → Components/SequenceDiagram.stories.tsx} +2 -2
- package/src/stories/{StateView.stories.tsx → Components/StateView.stories.tsx} +2 -2
- package/src/stories/{TraceViewer.stories.tsx → Components/TraceViewer.stories.tsx} +3 -3
- package/src/stories/{WorkflowSequenceDiagram.stories.tsx → Components/WorkflowSequenceDiagram.stories.tsx} +1 -1
- package/src/stories/{AnimationWorkshop.stories.tsx → Features/AnimationWorkshop.stories.tsx} +5 -5
- package/src/stories/{ChangeTypeVisual.stories.tsx → Features/ChangeTypeVisual.stories.tsx} +2 -2
- package/src/stories/{EventDrivenAnimations.stories.tsx → Features/EventDrivenAnimations.stories.tsx} +2 -2
- package/src/stories/{MultiConfig.stories.tsx → Features/MultiConfig.stories.tsx} +2 -2
- package/src/stories/{ElkEdgeRouting.stories.tsx → Layout/ElkEdgeRouting.stories.tsx} +2 -2
- package/src/stories/{GraphOrientation.stories.tsx → Layout/GraphOrientation.stories.tsx} +3 -3
- package/src/stories/{MultiDirectionalConnections.stories.tsx → Layout/MultiDirectionalConnections.stories.tsx} +2 -2
- package/src/stories/{NodeDefinitionComparison.stories.tsx → Nodes/NodeDefinitionComparison.stories.tsx} +2 -2
- package/src/stories/{NodeNameFallbacks.stories.tsx → Nodes/NodeNameFallbacks.stories.tsx} +2 -2
- package/src/stories/{NumericColors.stories.tsx → Nodes/NumericColors.stories.tsx} +2 -2
- package/src/stories/{EventNameDisplay.stories.tsx → OTEL/EventNameDisplay.stories.tsx} +2 -2
- package/src/stories/{EventNameFallback.stories.tsx → OTEL/EventNameFallback.stories.tsx} +2 -2
- package/src/stories/{OtelComponents.stories.tsx → OTEL/OtelComponents.stories.tsx} +3 -3
- package/src/stories/{OtelNodeTypesPrototype.stories.tsx → OTEL/OtelNodeTypesPrototype.stories.tsx} +2 -2
- package/src/stories/{RawEventCards.stories.tsx → OTEL/RawEventCards.stories.tsx} +3 -3
- package/src/stories/{SpanBadges.stories.tsx → OTEL/SpanBadges.stories.tsx} +1 -1
- package/src/stories/{ValidationEventsCanvas.stories.tsx → OTEL/ValidationEventsCanvas.stories.tsx} +3 -3
- package/src/stories/{BacklogMdCanvases.stories.tsx → RealWorld/BacklogMdCanvases.stories.tsx} +2 -2
- package/src/stories/{FileCitySequence.stories.tsx → RealWorld/FileCitySequence.stories.tsx} +4 -4
- package/src/stories/{RealCanvasFiles.stories.tsx → RealWorld/RealCanvasFiles.stories.tsx} +7 -7
- package/src/stories/{ComponentDeclarationAudit.stories.tsx → Subsystem/ComponentDeclarationAudit.stories.tsx} +19 -20
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
- package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +181 -0
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +646 -0
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
- package/src/subsystem/ComponentDeclaration.tsx +13 -13
- package/src/subsystem/SubsystemComponentGraph.tsx +558 -44
- package/src/subsystem/formatDeclaration.ts +57 -11
- package/src/subsystem/model.test.ts +38 -6
- package/src/subsystem/model.ts +145 -32
- package/src/subsystem/nodes.test.ts +56 -0
- package/src/subsystem/nodes.tsx +161 -31
- package/src/subsystem/tokenizeComponent.ts +1 -1
- package/src/utils/elkLayout.ts +4 -3
- package/src/stories/SubsystemComponentGraph.stories.tsx +0 -1225
- /package/src/stories/{dashboard/sample-dashboards → data}/activity-feed-analytics.dashboard.json +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@xyflow/react/dist/style.css';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
|
+
import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
|
|
6
|
+
import type {
|
|
7
|
+
SubsystemComponent,
|
|
8
|
+
SubsystemComponentEdge,
|
|
9
|
+
SubsystemThroughline,
|
|
10
|
+
} from '../../../subsystem/model';
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'Subsystem/ComponentGraph/Flows',
|
|
14
|
+
component: SubsystemComponentGraph,
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
decorators: [
|
|
20
|
+
(Story) => (
|
|
21
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
22
|
+
<Story />
|
|
23
|
+
</ThemeProvider>
|
|
24
|
+
),
|
|
25
|
+
],
|
|
26
|
+
} satisfies Meta<typeof SubsystemComponentGraph>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Mirror of the retrofitted electron-app drawing graph: the sidebar's Files
|
|
33
|
+
// panel swaps to a Flows panel listing three throughlines (open / save /
|
|
34
|
+
// delete). Clicking a flow row toggles its steps; clicking a step focuses
|
|
35
|
+
// that step's edge and frames it on the canvas. Other opened flows stay
|
|
36
|
+
// dimmed; the rest of the graph is hidden.
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
const drawingComponents: SubsystemComponent[] = [
|
|
40
|
+
{
|
|
41
|
+
id: 'panel',
|
|
42
|
+
name: 'DrawingsLeftPanel',
|
|
43
|
+
construct: 'class',
|
|
44
|
+
file: 'src/panels/DrawingsLeftPanel.tsx',
|
|
45
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
46
|
+
purpose: 'lists drawings; emits open/delete intents',
|
|
47
|
+
symbol: 'DrawingsLeftPanel',
|
|
48
|
+
process: 'draw-list',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'host',
|
|
52
|
+
name: 'useDrawingsHost',
|
|
53
|
+
construct: 'function',
|
|
54
|
+
file: 'src/hooks/useDrawingsHost.ts',
|
|
55
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
56
|
+
purpose: 'hosts drawing CRUD; dispatches to storage and shell',
|
|
57
|
+
symbol: 'useDrawingsHost',
|
|
58
|
+
process: 'draw-list',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'storage',
|
|
62
|
+
name: 'DrawingsStorage',
|
|
63
|
+
construct: 'class',
|
|
64
|
+
file: 'src/storage/drawingsStorage.ts',
|
|
65
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
66
|
+
purpose: 'persists drawings as files',
|
|
67
|
+
symbol: 'DrawingsStorage',
|
|
68
|
+
process: 'draw-host',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'fs',
|
|
72
|
+
name: 'FileSystemService',
|
|
73
|
+
construct: 'external',
|
|
74
|
+
file: 'src/services/fileSystem.ts',
|
|
75
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
76
|
+
purpose: 'sandboxed host fd/fs access',
|
|
77
|
+
symbol: 'FileSystemService',
|
|
78
|
+
role: 'service',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'shell',
|
|
82
|
+
name: 'WorkspaceShell',
|
|
83
|
+
construct: 'class',
|
|
84
|
+
file: 'src/workspace/WorkspaceShell.tsx',
|
|
85
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
86
|
+
purpose: 'mounts tabs for opened drawings',
|
|
87
|
+
symbol: 'WorkspaceShell',
|
|
88
|
+
process: 'draw-host',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'tab',
|
|
92
|
+
name: 'DrawingTabContent',
|
|
93
|
+
construct: 'class',
|
|
94
|
+
file: 'src/components/DrawingTabContent.tsx',
|
|
95
|
+
purl: 'pkg:github/principal-ai/desktop-app',
|
|
96
|
+
purpose: 'loads/saves an open drawing',
|
|
97
|
+
symbol: 'DrawingTabContent',
|
|
98
|
+
process: 'draw-host',
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
const drawingEdges: SubsystemComponentEdge[] = [
|
|
103
|
+
{ id: 'e-scan', from: 'panel', to: 'storage', mechanism: 'calls' },
|
|
104
|
+
{ id: 'e-open-event', from: 'panel', to: 'host', mechanism: 'produces' },
|
|
105
|
+
{ id: 'e-refresh', from: 'host', to: 'panel', mechanism: 'produces' },
|
|
106
|
+
{ id: 'e-open', from: 'host', to: 'storage', mechanism: 'calls' },
|
|
107
|
+
{ id: 'e-read', from: 'storage', to: 'fs', mechanism: 'calls' },
|
|
108
|
+
{ id: 'e-delete', from: 'host', to: 'fs', mechanism: 'calls' },
|
|
109
|
+
{ id: 'e-show', from: 'host', to: 'shell', mechanism: 'produces' },
|
|
110
|
+
{ id: 'e-mount', from: 'shell', to: 'tab', mechanism: 'feeds' },
|
|
111
|
+
{ id: 'e-tab-io', from: 'tab', to: 'fs', mechanism: 'calls' },
|
|
112
|
+
{ id: 'e-saved-event', from: 'tab', to: 'host', mechanism: 'produces' },
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
const drawingThroughlines: SubsystemThroughline[] = [
|
|
116
|
+
{
|
|
117
|
+
id: 'tl-open-drawing',
|
|
118
|
+
title: 'Open drawing',
|
|
119
|
+
steps: [
|
|
120
|
+
{ edgeId: 'e-scan', file: 'src/panels/DrawingsLeftPanel.tsx', line: 56, symbol: 'DrawingsLeftPanel.scan' },
|
|
121
|
+
{ edgeId: 'e-open-event', file: 'src/panels/DrawingsLeftPanel.tsx', line: 85, symbol: 'DrawingsLeftPanel.openDrawing' },
|
|
122
|
+
{ edgeId: 'e-open', file: 'src/hooks/useDrawingsHost.ts', line: 45, symbol: 'useDrawingsHost.openDrawing' },
|
|
123
|
+
{ edgeId: 'e-show', file: 'src/workspace/WorkspaceShell.tsx', line: 369, symbol: 'WorkspaceShell.openTab' },
|
|
124
|
+
{ edgeId: 'e-mount', file: 'src/workspace/WorkspaceShell.tsx', line: 372, symbol: 'WorkspaceShell.mountTab' },
|
|
125
|
+
{ edgeId: 'e-read', file: 'src/storage/drawingsStorage.ts', line: 90, symbol: 'DrawingsStorage.read' },
|
|
126
|
+
{ edgeId: 'e-tab-io', file: 'src/components/DrawingTabContent.tsx', line: 83, symbol: 'DrawingTabContent.load' },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'tl-save-drawing',
|
|
131
|
+
title: 'Save drawing',
|
|
132
|
+
steps: [
|
|
133
|
+
{ edgeId: 'e-tab-io', file: 'src/components/DrawingTabContent.tsx', line: 112, symbol: 'DrawingTabContent.save' },
|
|
134
|
+
{ edgeId: 'e-saved-event', file: 'src/components/DrawingTabContent.tsx', line: 121, symbol: 'DrawingTabContent.emitSaved' },
|
|
135
|
+
{ edgeId: 'e-refresh', file: 'src/hooks/useDrawingsHost.ts', line: 64, symbol: 'useDrawingsHost.onSaved' },
|
|
136
|
+
{ edgeId: 'e-scan', file: 'src/panels/DrawingsLeftPanel.tsx', line: 56, symbol: 'DrawingsLeftPanel.scan' },
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'tl-delete-drawing',
|
|
141
|
+
title: 'Delete drawing',
|
|
142
|
+
steps: [
|
|
143
|
+
{ edgeId: 'e-delete', file: 'src/hooks/useDrawingsHost.ts', line: 64, symbol: 'useDrawingsHost.deleteDrawing' },
|
|
144
|
+
{ edgeId: 'e-refresh', file: 'src/hooks/useDrawingsHost.ts', line: 66, symbol: 'useDrawingsHost.refreshList' },
|
|
145
|
+
{ edgeId: 'e-scan', file: 'src/panels/DrawingsLeftPanel.tsx', line: 56, symbol: 'DrawingsLeftPanel.scan' },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
|
|
150
|
+
function FlowsDemo() {
|
|
151
|
+
return (
|
|
152
|
+
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
153
|
+
<SubsystemComponentGraph
|
|
154
|
+
components={drawingComponents}
|
|
155
|
+
edges={drawingEdges}
|
|
156
|
+
throughlines={drawingThroughlines}
|
|
157
|
+
title="drawing-files flow"
|
|
158
|
+
description="Three throughlines over one graph — opening, saving, and deleting a drawing. The sidebar's **Flows** panel lists each step by **symbol** (the frame at that hop); clicking a step focuses that edge on the canvas."
|
|
159
|
+
renderFileViewer={(file, opts) => (
|
|
160
|
+
<div
|
|
161
|
+
style={{
|
|
162
|
+
padding: 12,
|
|
163
|
+
fontFamily: 'monospace',
|
|
164
|
+
fontSize: 12,
|
|
165
|
+
color: '#bbb',
|
|
166
|
+
whiteSpace: 'pre',
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{`// ${file}`}
|
|
170
|
+
{opts?.startLine != null ? `\n // → focus line ${opts.startLine}` : ''}
|
|
171
|
+
{'\n …'}
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
/>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export const ThreeFlows: Story = {
|
|
180
|
+
render: () => <FlowsDemo />,
|
|
181
|
+
};
|