@principal-ai/subsystems-react 0.17.0 → 0.19.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.
Files changed (108) hide show
  1. package/README.md +11 -85
  2. package/dist/index.d.ts +7 -44
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +6 -32
  5. package/dist/index.js.map +1 -1
  6. package/dist/subsystem/SubsystemCarousel.d.ts +36 -0
  7. package/dist/subsystem/SubsystemCarousel.d.ts.map +1 -0
  8. package/dist/subsystem/SubsystemCarousel.js +163 -0
  9. package/dist/subsystem/SubsystemCarousel.js.map +1 -0
  10. package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -0
  11. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  12. package/dist/subsystem/SubsystemComponentGraph.js +329 -68
  13. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  14. package/package.json +4 -4
  15. package/src/index.ts +9 -199
  16. package/src/subsystem/SubsystemComponentGraph.tsx +396 -50
  17. package/src/components/ConfigurationSelector.tsx +0 -133
  18. package/src/components/GraphRenderer.tsx +0 -3195
  19. package/src/components/MultiCanvasRenderer.tsx +0 -295
  20. package/src/components/NodeTooltip.tsx +0 -279
  21. package/src/components/PendingChanges.test.tsx +0 -375
  22. package/src/components/SelectionSidebar.tsx +0 -352
  23. package/src/components/SequenceDiagramRenderer.tsx +0 -1156
  24. package/src/components/WorkflowSequenceDiagram.tsx +0 -270
  25. package/src/components/dashboard/DashboardRenderer.tsx +0 -317
  26. package/src/components/dashboard/MetricPanel.tsx +0 -254
  27. package/src/components/dashboard/MockDataProvider.ts +0 -330
  28. package/src/components/dashboard/components/BarChart.tsx +0 -299
  29. package/src/components/dashboard/components/LineChart.tsx +0 -279
  30. package/src/components/dashboard/components/MetricCard.tsx +0 -270
  31. package/src/components/dashboard/components/SourceLink.tsx +0 -63
  32. package/src/components/dashboard/components/TimeRangeSelector.tsx +0 -280
  33. package/src/components/dashboard/components/index.ts +0 -5
  34. package/src/components/dashboard/index.ts +0 -47
  35. package/src/components/dashboard/types.ts +0 -126
  36. package/src/components/state-view/PipelineView.tsx +0 -347
  37. package/src/components/state-view/index.ts +0 -14
  38. package/src/components/state-view/types.ts +0 -261
  39. package/src/components/state-view/useStateView.ts +0 -205
  40. package/src/contexts/GraphEditContext.tsx +0 -27
  41. package/src/contexts/TooltipPortalContext.ts +0 -8
  42. package/src/edges/CustomEdge.tsx +0 -402
  43. package/src/edges/GenericEdge.tsx +0 -36
  44. package/src/hooks/usePathBasedEvents.ts +0 -192
  45. package/src/hooks/useSequenceLayout.ts +0 -543
  46. package/src/hooks/useUndoRedo.ts +0 -144
  47. package/src/nodes/CustomNode.tsx +0 -1231
  48. package/src/nodes/GenericNode.tsx +0 -55
  49. package/src/nodes/otel/OtelBoundaryNode.tsx +0 -224
  50. package/src/nodes/otel/OtelEventNode.tsx +0 -225
  51. package/src/nodes/otel/OtelResourceNode.tsx +0 -251
  52. package/src/nodes/otel/OtelScopeNode.tsx +0 -221
  53. package/src/nodes/otel/OtelSpanConventionNode.tsx +0 -295
  54. package/src/nodes/otel/index.ts +0 -23
  55. package/src/nodes/otel/shared/NodeBadges.tsx +0 -295
  56. package/src/nodes/otel/shared/NodeContent.tsx +0 -204
  57. package/src/nodes/otel/shared/index.ts +0 -8
  58. package/src/nodes/otel/shared/types.ts +0 -138
  59. package/src/nodes/otel/shared/useNodeBehavior.ts +0 -114
  60. package/src/stories/Audit/BoundaryNodes.stories.tsx +0 -385
  61. package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +0 -1448
  62. package/src/stories/Audit/CanvasNodeTypes.stories.tsx +0 -1049
  63. package/src/stories/Audit/ColorPriority.stories.tsx +0 -895
  64. package/src/stories/Audit/DiamondBadges.stories.tsx +0 -629
  65. package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +0 -724
  66. package/src/stories/Audit/NodeFieldsAudit.stories.tsx +0 -996
  67. package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +0 -715
  68. package/src/stories/Audit/NodeShapes.stories.tsx +0 -1208
  69. package/src/stories/Audit/WideNodesTesting.stories.tsx +0 -1045
  70. package/src/stories/Components/DashboardRenderer.stories.tsx +0 -263
  71. package/src/stories/Components/GraphRenderer.stories.tsx +0 -3236
  72. package/src/stories/Components/MultiCanvasRenderer.stories.tsx +0 -370
  73. package/src/stories/Components/SequenceDiagram.stories.tsx +0 -255
  74. package/src/stories/Components/StateView.stories.tsx +0 -417
  75. package/src/stories/Components/TraceViewer.stories.tsx +0 -442
  76. package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +0 -802
  77. package/src/stories/Features/AnimationWorkshop.stories.tsx +0 -727
  78. package/src/stories/Features/ChangeTypeVisual.stories.tsx +0 -67
  79. package/src/stories/Features/EventDrivenAnimations.stories.tsx +0 -513
  80. package/src/stories/Features/MultiConfig.stories.tsx +0 -539
  81. package/src/stories/Layout/ElkEdgeRouting.stories.tsx +0 -539
  82. package/src/stories/Layout/GraphOrientation.stories.tsx +0 -500
  83. package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +0 -352
  84. package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +0 -560
  85. package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +0 -491
  86. package/src/stories/Nodes/NumericColors.stories.tsx +0 -440
  87. package/src/stories/OTEL/EventNameDisplay.stories.tsx +0 -694
  88. package/src/stories/OTEL/EventNameFallback.stories.tsx +0 -578
  89. package/src/stories/OTEL/OtelComponents.stories.tsx +0 -422
  90. package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +0 -806
  91. package/src/stories/OTEL/RawEventCards.stories.tsx +0 -57
  92. package/src/stories/OTEL/SpanBadges.stories.tsx +0 -840
  93. package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +0 -209
  94. package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +0 -721
  95. package/src/stories/RealWorld/FileCitySequence.stories.tsx +0 -516
  96. package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +0 -336
  97. package/src/stories/__traces__/test-run.canvas.json +0 -241
  98. package/src/stories/data/activity-feed-analytics.dashboard.json +0 -300
  99. package/src/stories/data/file-city-images-transformed.otel.canvas.json +0 -295
  100. package/src/stories/data/file-city-workflows.json +0 -269
  101. package/src/stories/data/graph-converter-test-execution.json +0 -443
  102. package/src/stories/data/graph-converter-test.workflow.json +0 -105
  103. package/src/stories/data/graph-converter-validated-execution.json +0 -58
  104. package/src/utils/animationMapping.ts +0 -166
  105. package/src/utils/canvasBounds.ts +0 -146
  106. package/src/utils/graphConverter.ts +0 -148
  107. package/src/utils/iconResolver.tsx +0 -53
  108. package/src/utils/orientationUtils.ts +0 -73
@@ -1,385 +0,0 @@
1
- import React from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { GraphRenderer } from '../../components/GraphRenderer';
4
- import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
5
- import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
6
-
7
- const meta = {
8
- title: 'Audit/BoundaryNodes',
9
- component: GraphRenderer,
10
- parameters: {
11
- layout: 'centered',
12
- },
13
- tags: ['autodocs'],
14
- decorators: [
15
- (Story) => (
16
- <ThemeProvider theme={defaultEditorTheme}>
17
- <Story />
18
- </ThemeProvider>
19
- ),
20
- ],
21
- } satisfies Meta<typeof GraphRenderer>;
22
-
23
- export default meta;
24
- type Story = StoryObj<typeof meta>;
25
-
26
- /**
27
- * Canvas showing boundary node visual treatment
28
- */
29
- const boundaryNodesCanvas: ExtendedCanvas = {
30
- nodes: [
31
- // Regular node for comparison
32
- {
33
- id: 'regular-node',
34
- type: 'text',
35
- x: 100,
36
- y: 100,
37
- width: 160,
38
- height: 80,
39
- text: '# Regular Node\nSharp corners',
40
- color: 6, // purple
41
- pv: {
42
- nodeType: 'event',
43
- name: 'Regular Node',
44
- description: 'A standard event node with sharp corners',
45
- sources: ['src/events/regular.ts'],
46
- event: {
47
- name: 'app.regular-event',
48
- description: 'Regular event',
49
- attributes: {},
50
- },
51
- },
52
- },
53
- // Outbound boundary node
54
- {
55
- id: 'outbound-boundary',
56
- type: 'text',
57
- x: 350,
58
- y: 100,
59
- width: 180,
60
- height: 80,
61
- text: '# Host Callback\nPersists layout',
62
- color: 5, // cyan
63
- pv: {
64
- nodeType: 'boundary',
65
- name: 'onBatchLayoutInitialized',
66
- description: 'Calls host to persist batch layout data',
67
- boundary: {
68
- direction: 'outbound',
69
- node: {
70
- 'pv.event.name': 'host.batch-layout-initialized',
71
- 'pv.event.namespace': 'collection-host',
72
- },
73
- },
74
- },
75
- },
76
- // Inbound boundary node
77
- {
78
- id: 'inbound-boundary',
79
- type: 'text',
80
- x: 620,
81
- y: 100,
82
- width: 180,
83
- height: 80,
84
- text: '# Webhook\nRepository created',
85
- color: 5, // cyan
86
- pv: {
87
- nodeType: 'boundary',
88
- name: 'onRepositoryCreated',
89
- description: 'Called by GitHub when a repository is created',
90
- boundary: {
91
- direction: 'inbound',
92
- node: {
93
- 'pv.event.name': 'webhook.repository-created',
94
- 'pv.event.namespace': 'github',
95
- },
96
- },
97
- },
98
- },
99
- ],
100
- edges: [],
101
- pv: {
102
- version: '1.0.0',
103
- name: 'Boundary Nodes Demo',
104
- description: 'Demonstrates boundary node visual treatment',
105
- edgeTypes: {},
106
- },
107
- };
108
-
109
- export const BoundaryVsRegular: Story = {
110
- args: {
111
- canvas: boundaryNodesCanvas,
112
- width: 900,
113
- height: 300,
114
- },
115
- parameters: {
116
- docs: {
117
- description: {
118
- story: `
119
- **Boundary Node Visual Treatment**
120
-
121
- Boundary nodes represent interaction points where control crosses system edges.
122
- They have distinct visual treatment:
123
-
124
- - **Rounded corners** (8px border-radius) to visually distinguish from regular nodes
125
- - **Direction badge** in top-right corner:
126
- - ↗ (arrow up-right) for **outbound** boundaries - this system calls external
127
- - ↙ (arrow down-left) for **inbound** boundaries - external calls this system
128
- - **Cyan badge color** (#06b6d4) to match boundary theme
129
- - **No sources badge** since boundary nodes don't have local source files
130
-
131
- Compare with the regular node on the left which has:
132
- - Sharp corners (0 border-radius)
133
- - Green "S" sources badge (when sources are defined)
134
- `,
135
- },
136
- },
137
- },
138
- };
139
-
140
- /**
141
- * Canvas showing boundary nodes in a workflow context
142
- */
143
- const workflowWithBoundariesCanvas: ExtendedCanvas = {
144
- nodes: [
145
- // Internal event
146
- {
147
- id: 'batch-save',
148
- type: 'text',
149
- x: 100,
150
- y: 150,
151
- width: 160,
152
- height: 70,
153
- text: '# Batch Save\nSaves regions',
154
- color: 4, // green
155
- pv: {
156
- nodeType: 'event',
157
- name: 'batch-save',
158
- event: {
159
- name: 'collection-map.batch-save',
160
- description: 'Saved regions to local state',
161
- attributes: {},
162
- },
163
- },
164
- },
165
- // Outbound to host
166
- {
167
- id: 'host-persist',
168
- type: 'text',
169
- x: 350,
170
- y: 150,
171
- width: 180,
172
- height: 70,
173
- text: '# Host: Persist\nSaves to backend',
174
- color: 5, // cyan
175
- pv: {
176
- nodeType: 'boundary',
177
- name: 'onBatchLayoutInitialized',
178
- boundary: {
179
- direction: 'outbound',
180
- node: {
181
- 'pv.event.name': 'host.batch-layout-initialized',
182
- },
183
- },
184
- },
185
- },
186
- // Another internal event
187
- {
188
- id: 'layout-complete',
189
- type: 'text',
190
- x: 620,
191
- y: 150,
192
- width: 160,
193
- height: 70,
194
- text: '# Layout Complete\nUI updated',
195
- color: 4, // green
196
- pv: {
197
- nodeType: 'event',
198
- name: 'layout-complete',
199
- event: {
200
- name: 'collection-map.layout-complete',
201
- description: 'Layout computation finished',
202
- attributes: {},
203
- },
204
- },
205
- },
206
- ],
207
- edges: [
208
- {
209
- id: 'e1',
210
- fromNode: 'batch-save',
211
- toNode: 'host-persist',
212
- fromSide: 'right',
213
- toSide: 'left',
214
- },
215
- {
216
- id: 'e2',
217
- fromNode: 'host-persist',
218
- toNode: 'layout-complete',
219
- fromSide: 'right',
220
- toSide: 'left',
221
- },
222
- ],
223
- pv: {
224
- version: '1.0.0',
225
- name: 'Workflow with Boundaries',
226
- description: 'Shows boundary nodes in workflow context',
227
- edgeTypes: {
228
- default: {
229
- style: 'solid',
230
- color: '#888',
231
- directed: true,
232
- },
233
- },
234
- },
235
- };
236
-
237
- export const WorkflowContext: Story = {
238
- args: {
239
- canvas: workflowWithBoundariesCanvas,
240
- width: 900,
241
- height: 350,
242
- },
243
- parameters: {
244
- docs: {
245
- description: {
246
- story: `
247
- **Boundary Nodes in Workflow Context**
248
-
249
- This shows how boundary nodes appear in a typical workflow:
250
-
251
- 1. **Internal Event** (green, sharp corners) - Code we own and instrument
252
- 2. **Boundary Node** (cyan, rounded corners) - Calls external system
253
- 3. **Internal Event** (green, sharp corners) - Continues after external call
254
-
255
- The boundary node visually breaks the flow to indicate control leaving the system.
256
- The ↗ badge indicates this is an outbound call (we call them, they don't call us).
257
- `,
258
- },
259
- },
260
- },
261
- };
262
-
263
- /**
264
- * Canvas showing different boundary directions
265
- */
266
- const boundaryDirectionsCanvas: ExtendedCanvas = {
267
- nodes: [
268
- // Outbound examples
269
- {
270
- id: 'outbound-1',
271
- type: 'text',
272
- x: 100,
273
- y: 100,
274
- width: 180,
275
- height: 70,
276
- text: '# Host Callback\nonBatchLayout',
277
- color: 5,
278
- pv: {
279
- nodeType: 'boundary',
280
- name: 'onBatchLayout',
281
- boundary: {
282
- direction: 'outbound',
283
- node: { 'pv.event.name': 'host.batch-layout' },
284
- },
285
- },
286
- },
287
- {
288
- id: 'outbound-2',
289
- type: 'text',
290
- x: 350,
291
- y: 100,
292
- width: 180,
293
- height: 70,
294
- text: '# API Call\nPOST /payments',
295
- color: 5,
296
- pv: {
297
- nodeType: 'boundary',
298
- name: 'createPayment',
299
- boundary: {
300
- direction: 'outbound',
301
- node: { 'pv.event.name': 'stripe.payment-created' },
302
- },
303
- },
304
- },
305
- // Inbound examples
306
- {
307
- id: 'inbound-1',
308
- type: 'text',
309
- x: 100,
310
- y: 250,
311
- width: 180,
312
- height: 70,
313
- text: '# Webhook\nrepo.created',
314
- color: 5,
315
- pv: {
316
- nodeType: 'boundary',
317
- name: 'onRepoCreated',
318
- boundary: {
319
- direction: 'inbound',
320
- node: { 'pv.event.name': 'github.repo-created' },
321
- },
322
- },
323
- },
324
- {
325
- id: 'inbound-2',
326
- type: 'text',
327
- x: 350,
328
- y: 250,
329
- width: 180,
330
- height: 70,
331
- text: '# Message\norder.placed',
332
- color: 5,
333
- pv: {
334
- nodeType: 'boundary',
335
- name: 'onOrderPlaced',
336
- boundary: {
337
- direction: 'inbound',
338
- node: { 'pv.event.name': 'queue.order-placed' },
339
- },
340
- },
341
- },
342
- ],
343
- edges: [],
344
- pv: {
345
- version: '1.0.0',
346
- name: 'Boundary Directions',
347
- description: 'Outbound vs Inbound boundary nodes',
348
- edgeTypes: {},
349
- nodeTypes: {
350
- boundary: {
351
- description: 'External system boundary',
352
- color: '#06b6d4',
353
- },
354
- },
355
- },
356
- };
357
-
358
- export const DirectionComparison: Story = {
359
- args: {
360
- canvas: boundaryDirectionsCanvas,
361
- width: 650,
362
- height: 400,
363
- },
364
- parameters: {
365
- docs: {
366
- description: {
367
- story: `
368
- **Outbound vs Inbound Boundaries**
369
-
370
- **Top row - Outbound (↗)**
371
- - Host callbacks we invoke
372
- - API calls we make
373
- - Messages we publish
374
-
375
- **Bottom row - Inbound (↙)**
376
- - Webhooks that call us
377
- - Queue messages we consume
378
- - Events we subscribe to
379
-
380
- The direction badge makes it immediately clear which way control flows across the boundary.
381
- `,
382
- },
383
- },
384
- },
385
- };