@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.
Files changed (109) hide show
  1. package/dist/graphify/consolidated.d.ts +16 -1
  2. package/dist/graphify/consolidated.d.ts.map +1 -1
  3. package/dist/graphify/index.d.ts +1 -1
  4. package/dist/graphify/index.d.ts.map +1 -1
  5. package/dist/graphify/index.js.map +1 -1
  6. package/dist/graphify/kind.d.ts +1 -1
  7. package/dist/graphify/kind.d.ts.map +1 -1
  8. package/dist/graphify/kind.js +7 -1
  9. package/dist/graphify/kind.js.map +1 -1
  10. package/dist/index.d.ts +3 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/pierre/constructColors.d.ts +24 -0
  15. package/dist/pierre/constructColors.d.ts.map +1 -0
  16. package/dist/pierre/constructColors.js +91 -0
  17. package/dist/pierre/constructColors.js.map +1 -0
  18. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
  19. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
  20. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
  21. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
  22. package/dist/subsystem/ComponentDeclaration.d.ts +2 -2
  23. package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
  24. package/dist/subsystem/ComponentDeclaration.js +12 -11
  25. package/dist/subsystem/ComponentDeclaration.js.map +1 -1
  26. package/dist/subsystem/SubsystemComponentGraph.d.ts +10 -1
  27. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  28. package/dist/subsystem/SubsystemComponentGraph.js +401 -40
  29. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  30. package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
  31. package/dist/subsystem/formatDeclaration.js +49 -10
  32. package/dist/subsystem/formatDeclaration.js.map +1 -1
  33. package/dist/subsystem/model.d.ts +89 -12
  34. package/dist/subsystem/model.d.ts.map +1 -1
  35. package/dist/subsystem/model.js +55 -25
  36. package/dist/subsystem/model.js.map +1 -1
  37. package/dist/subsystem/nodes.d.ts +32 -1
  38. package/dist/subsystem/nodes.d.ts.map +1 -1
  39. package/dist/subsystem/nodes.js +122 -24
  40. package/dist/subsystem/nodes.js.map +1 -1
  41. package/dist/subsystem/tokenizeComponent.js +1 -1
  42. package/dist/subsystem/tokenizeComponent.js.map +1 -1
  43. package/dist/utils/elkLayout.d.ts.map +1 -1
  44. package/dist/utils/elkLayout.js +4 -3
  45. package/dist/utils/elkLayout.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/graphify/consolidated.ts +18 -1
  48. package/src/graphify/index.ts +1 -0
  49. package/src/graphify/kind.ts +7 -1
  50. package/src/index.ts +3 -2
  51. package/src/pierre/constructColors.test.ts +52 -0
  52. package/src/pierre/constructColors.ts +112 -0
  53. package/src/stories/{BoundaryNodes.stories.tsx → Audit/BoundaryNodes.stories.tsx} +1 -1
  54. package/src/stories/{CanvasEdgeTypes.stories.tsx → Audit/CanvasEdgeTypes.stories.tsx} +1 -1
  55. package/src/stories/{CanvasNodeTypes.stories.tsx → Audit/CanvasNodeTypes.stories.tsx} +1 -1
  56. package/src/stories/{ColorPriority.stories.tsx → Audit/ColorPriority.stories.tsx} +1 -1
  57. package/src/stories/{DiamondBadges.stories.tsx → Audit/DiamondBadges.stories.tsx} +1 -1
  58. package/src/stories/{NodeDimensionsTesting.stories.tsx → Audit/NodeDimensionsTesting.stories.tsx} +2 -2
  59. package/src/stories/{NodeFieldsAudit.stories.tsx → Audit/NodeFieldsAudit.stories.tsx} +1 -1
  60. package/src/stories/{NodeFontSizeTesting.stories.tsx → Audit/NodeFontSizeTesting.stories.tsx} +2 -2
  61. package/src/stories/{NodeShapes.stories.tsx → Audit/NodeShapes.stories.tsx} +1 -1
  62. package/src/stories/{WideNodesTesting.stories.tsx → Audit/WideNodesTesting.stories.tsx} +2 -2
  63. package/src/stories/{dashboard → Components}/DashboardRenderer.stories.tsx +2 -2
  64. package/src/stories/{GraphRenderer.stories.tsx → Components/GraphRenderer.stories.tsx} +2 -2
  65. package/src/stories/{MultiCanvasRenderer.stories.tsx → Components/MultiCanvasRenderer.stories.tsx} +2 -2
  66. package/src/stories/{SequenceDiagram.stories.tsx → Components/SequenceDiagram.stories.tsx} +2 -2
  67. package/src/stories/{StateView.stories.tsx → Components/StateView.stories.tsx} +2 -2
  68. package/src/stories/{TraceViewer.stories.tsx → Components/TraceViewer.stories.tsx} +3 -3
  69. package/src/stories/{WorkflowSequenceDiagram.stories.tsx → Components/WorkflowSequenceDiagram.stories.tsx} +1 -1
  70. package/src/stories/{AnimationWorkshop.stories.tsx → Features/AnimationWorkshop.stories.tsx} +5 -5
  71. package/src/stories/{ChangeTypeVisual.stories.tsx → Features/ChangeTypeVisual.stories.tsx} +2 -2
  72. package/src/stories/{EventDrivenAnimations.stories.tsx → Features/EventDrivenAnimations.stories.tsx} +2 -2
  73. package/src/stories/{MultiConfig.stories.tsx → Features/MultiConfig.stories.tsx} +2 -2
  74. package/src/stories/{ElkEdgeRouting.stories.tsx → Layout/ElkEdgeRouting.stories.tsx} +2 -2
  75. package/src/stories/{GraphOrientation.stories.tsx → Layout/GraphOrientation.stories.tsx} +3 -3
  76. package/src/stories/{MultiDirectionalConnections.stories.tsx → Layout/MultiDirectionalConnections.stories.tsx} +2 -2
  77. package/src/stories/{NodeDefinitionComparison.stories.tsx → Nodes/NodeDefinitionComparison.stories.tsx} +2 -2
  78. package/src/stories/{NodeNameFallbacks.stories.tsx → Nodes/NodeNameFallbacks.stories.tsx} +2 -2
  79. package/src/stories/{NumericColors.stories.tsx → Nodes/NumericColors.stories.tsx} +2 -2
  80. package/src/stories/{EventNameDisplay.stories.tsx → OTEL/EventNameDisplay.stories.tsx} +2 -2
  81. package/src/stories/{EventNameFallback.stories.tsx → OTEL/EventNameFallback.stories.tsx} +2 -2
  82. package/src/stories/{OtelComponents.stories.tsx → OTEL/OtelComponents.stories.tsx} +3 -3
  83. package/src/stories/{OtelNodeTypesPrototype.stories.tsx → OTEL/OtelNodeTypesPrototype.stories.tsx} +2 -2
  84. package/src/stories/{RawEventCards.stories.tsx → OTEL/RawEventCards.stories.tsx} +3 -3
  85. package/src/stories/{SpanBadges.stories.tsx → OTEL/SpanBadges.stories.tsx} +1 -1
  86. package/src/stories/{ValidationEventsCanvas.stories.tsx → OTEL/ValidationEventsCanvas.stories.tsx} +3 -3
  87. package/src/stories/{BacklogMdCanvases.stories.tsx → RealWorld/BacklogMdCanvases.stories.tsx} +2 -2
  88. package/src/stories/{FileCitySequence.stories.tsx → RealWorld/FileCitySequence.stories.tsx} +4 -4
  89. package/src/stories/{RealCanvasFiles.stories.tsx → RealWorld/RealCanvasFiles.stories.tsx} +7 -7
  90. package/src/stories/{ComponentDeclarationAudit.stories.tsx → Subsystem/ComponentDeclarationAudit.stories.tsx} +19 -20
  91. package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
  92. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
  93. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
  94. package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
  95. package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +181 -0
  96. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
  97. package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +646 -0
  98. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
  99. package/src/subsystem/ComponentDeclaration.tsx +13 -13
  100. package/src/subsystem/SubsystemComponentGraph.tsx +558 -44
  101. package/src/subsystem/formatDeclaration.ts +57 -11
  102. package/src/subsystem/model.test.ts +38 -6
  103. package/src/subsystem/model.ts +145 -32
  104. package/src/subsystem/nodes.test.ts +56 -0
  105. package/src/subsystem/nodes.tsx +161 -31
  106. package/src/subsystem/tokenizeComponent.ts +1 -1
  107. package/src/utils/elkLayout.ts +4 -3
  108. package/src/stories/SubsystemComponentGraph.stories.tsx +0 -1225
  109. /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
+ };