@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,209 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import '@xyflow/react/dist/style.css';
4
- import { GraphRenderer } from '../../components/GraphRenderer';
5
- import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
6
- import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
7
-
8
- // Import the CLI events canvas
9
- import validationEventsCanvasUrl from '../../../../../.principal-views/principal-view-cli.events.canvas?url';
10
-
11
- // Helper to load canvas from URL
12
- async function loadCanvas(url: string): Promise<ExtendedCanvas> {
13
- const response = await fetch(url);
14
- return await response.json();
15
- }
16
-
17
- // Wrapper component that loads canvas data
18
- function CanvasLoader({ url, children }: { url: string; children: (canvas: ExtendedCanvas) => React.ReactNode }) {
19
- const [canvas, setCanvas] = useState<ExtendedCanvas | null>(null);
20
- const [error, setError] = useState<string | null>(null);
21
-
22
- useEffect(() => {
23
- loadCanvas(url)
24
- .then(setCanvas)
25
- .catch((err) => setError(err.message));
26
- }, [url]);
27
-
28
- if (error) {
29
- return <div style={{ padding: 20, color: 'red' }}>Error loading canvas: {error}</div>;
30
- }
31
-
32
- if (!canvas) {
33
- return <div style={{ padding: 20 }}>Loading canvas...</div>;
34
- }
35
-
36
- return (
37
- <div style={{ width: '100%', height: '100vh' }}>
38
- {children(canvas)}
39
- </div>
40
- );
41
- }
42
-
43
- const meta = {
44
- title: 'OTEL/ValidationEventsCanvas',
45
- component: GraphRenderer,
46
- parameters: {
47
- layout: 'fullscreen',
48
- },
49
- tags: ['autodocs'],
50
- decorators: [
51
- (Story) => (
52
- <ThemeProvider theme={defaultEditorTheme}>
53
- <div style={{ width: '100vw', height: '100vh' }}>
54
- <Story />
55
- </div>
56
- </ThemeProvider>
57
- ),
58
- ],
59
- } satisfies Meta<typeof GraphRenderer>;
60
-
61
- export default meta;
62
- type Story = StoryObj<typeof meta>;
63
-
64
- /**
65
- * Validation Event Namespace Canvas
66
- *
67
- * File: .principal-views/validation/validation.events.canvas
68
- * Type: event-namespace nodes
69
- * Purpose: Shows the vocabulary of events emitted during validation workflows
70
- */
71
- export const EventNamespaceVocabulary: Story = {
72
- render: () => (
73
- <CanvasLoader url={validationEventsCanvasUrl}>
74
- {(canvas) => <GraphRenderer canvas={canvas} showBackground={false} editable={true} />}
75
- </CanvasLoader>
76
- ),
77
- parameters: {
78
- docs: {
79
- description: {
80
- story: `
81
- Renders the **validation.events.canvas** file - an event namespace vocabulary canvas.
82
-
83
- ## Event Namespace Canvas Concept
84
-
85
- Unlike span canvases (which show user workflows) or OTEL event canvases (which show individual events),
86
- this canvas shows the **vocabulary of event namespaces** and their adjacency relationships.
87
-
88
- ### Structure
89
-
90
- **Nodes = Event Namespaces**
91
- - \`analysis\` - Analysis pipeline lifecycle events
92
- - \`validation\` - Validation lifecycle events (started, complete, error)
93
- - \`file\` - File parsing events
94
- - \`type\` - Type detection events
95
- - etc.
96
-
97
- Each namespace node documents all events within that namespace with their attributes.
98
-
99
- **Edges = Adjacency**
100
- - Edges represent when events from one namespace appear adjacent to events from another namespace in workflow scenarios
101
- - Example: \`analysis → filetree\` because \`analysis.started → filetree.built\` in scenarios
102
- - Example: \`file → validation\` because \`file.parsed → validation.error\` in scenarios
103
-
104
- ### Purpose
105
-
106
- This canvas serves as:
107
- 1. **Event vocabulary documentation** - What events can be emitted
108
- 2. **Flow visualization** - How events from different namespaces connect
109
- 3. **Implementation guide** - What attributes each event requires
110
- 4. **Validation source** - Canvas edges must match actual workflow scenario adjacencies
111
-
112
- ### Conventions
113
-
114
- As defined in \`.principal-views/architecture.events.md\`:
115
- - Events follow \`{namespace}.{action}.{detail}\` naming
116
- - Edges represent direct adjacency only (not transitive)
117
- - Canvas is validated against workflow scenario files
118
- - Namespaces group code-level implementation events (vs user-level workflow spans)
119
-
120
- **Use this to:**
121
- - Preview event namespace canvas rendering
122
- - Understand event flow architecture
123
- - Document which events your code emits
124
- - Validate event relationships match actual code
125
- `,
126
- },
127
- },
128
- },
129
- };
130
-
131
- /**
132
- * Event Namespace Canvas with Annotations
133
- *
134
- * Shows the canvas with additional context about what each namespace contains
135
- */
136
- export const WithNamespaceDetails: Story = {
137
- render: () => (
138
- <CanvasLoader url={validationEventsCanvasUrl}>
139
- {(canvas) => (
140
- <div style={{ display: 'flex', height: '100vh' }}>
141
- <div style={{ flex: 1 }}>
142
- <GraphRenderer canvas={canvas} showBackground={false} editable={true} />
143
- </div>
144
- <div style={{
145
- width: '350px',
146
- padding: '20px',
147
- backgroundColor: '#f5f5f5',
148
- overflowY: 'auto',
149
- fontFamily: 'system-ui, -apple-system, sans-serif'
150
- }}>
151
- <h2 style={{ marginTop: 0, fontSize: '18px' }}>Event Namespaces</h2>
152
- <p style={{ fontSize: '14px', color: '#666' }}>
153
- Each node represents a namespace grouping related events.
154
- </p>
155
-
156
- <div style={{ marginTop: '20px' }}>
157
- <h3 style={{ fontSize: '14px', marginBottom: '8px' }}>Discovery Phase</h3>
158
- <ul style={{ fontSize: '13px', lineHeight: '1.6', paddingLeft: '20px' }}>
159
- <li><strong>analysis</strong> - Pipeline start</li>
160
- <li><strong>filetree</strong> - Repository scanning</li>
161
- <li><strong>packages</strong> - Package discovery</li>
162
- <li><strong>canvases</strong> - Canvas file discovery</li>
163
- <li><strong>executions</strong> - Execution file discovery</li>
164
- <li><strong>library</strong> - Component library loading</li>
165
- <li><strong>discovery</strong> - Phase completion</li>
166
- </ul>
167
- </div>
168
-
169
- <div style={{ marginTop: '20px' }}>
170
- <h3 style={{ fontSize: '14px', marginBottom: '8px' }}>Validation Phase</h3>
171
- <ul style={{ fontSize: '13px', lineHeight: '1.6', paddingLeft: '20px' }}>
172
- <li><strong>validation</strong> - Lifecycle (started, complete, error)</li>
173
- <li><strong>file</strong> - Parsing operations</li>
174
- <li><strong>type</strong> - Type detection</li>
175
- <li><strong>canvas</strong> - Canvas validation</li>
176
- <li><strong>workflow</strong> - Workflow validation</li>
177
- <li><strong>execution</strong> - Execution validation</li>
178
- <li><strong>rules</strong> - Lint rule execution</li>
179
- <li><strong>results</strong> - Result aggregation</li>
180
- </ul>
181
- </div>
182
-
183
- <div style={{ marginTop: '20px', padding: '12px', backgroundColor: '#fff3cd', borderRadius: '4px' }}>
184
- <h4 style={{ fontSize: '13px', marginTop: 0 }}>Adjacency Edges</h4>
185
- <p style={{ fontSize: '12px', margin: 0, color: '#856404' }}>
186
- Edges show when events from one namespace appear next to events from another namespace
187
- in workflow scenarios. These are validated against actual execution traces.
188
- </p>
189
- </div>
190
- </div>
191
- </div>
192
- )}
193
- </CanvasLoader>
194
- ),
195
- parameters: {
196
- docs: {
197
- description: {
198
- story: `
199
- Same canvas with a side panel showing namespace details and explanations.
200
-
201
- This view helps:
202
- - Understand what each namespace contains
203
- - See the phase groupings (discovery vs validation)
204
- - Learn the event namespace canvas concept
205
- `,
206
- },
207
- },
208
- },
209
- };