@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.
- package/README.md +11 -85
- package/dist/index.d.ts +7 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -32
- package/dist/index.js.map +1 -1
- package/dist/subsystem/SubsystemCarousel.d.ts +36 -0
- package/dist/subsystem/SubsystemCarousel.d.ts.map +1 -0
- package/dist/subsystem/SubsystemCarousel.js +163 -0
- package/dist/subsystem/SubsystemCarousel.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +329 -68
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +9 -199
- package/src/subsystem/SubsystemComponentGraph.tsx +396 -50
- package/src/components/ConfigurationSelector.tsx +0 -133
- package/src/components/GraphRenderer.tsx +0 -3195
- package/src/components/MultiCanvasRenderer.tsx +0 -295
- package/src/components/NodeTooltip.tsx +0 -279
- package/src/components/PendingChanges.test.tsx +0 -375
- package/src/components/SelectionSidebar.tsx +0 -352
- package/src/components/SequenceDiagramRenderer.tsx +0 -1156
- package/src/components/WorkflowSequenceDiagram.tsx +0 -270
- package/src/components/dashboard/DashboardRenderer.tsx +0 -317
- package/src/components/dashboard/MetricPanel.tsx +0 -254
- package/src/components/dashboard/MockDataProvider.ts +0 -330
- package/src/components/dashboard/components/BarChart.tsx +0 -299
- package/src/components/dashboard/components/LineChart.tsx +0 -279
- package/src/components/dashboard/components/MetricCard.tsx +0 -270
- package/src/components/dashboard/components/SourceLink.tsx +0 -63
- package/src/components/dashboard/components/TimeRangeSelector.tsx +0 -280
- package/src/components/dashboard/components/index.ts +0 -5
- package/src/components/dashboard/index.ts +0 -47
- package/src/components/dashboard/types.ts +0 -126
- package/src/components/state-view/PipelineView.tsx +0 -347
- package/src/components/state-view/index.ts +0 -14
- package/src/components/state-view/types.ts +0 -261
- package/src/components/state-view/useStateView.ts +0 -205
- package/src/contexts/GraphEditContext.tsx +0 -27
- package/src/contexts/TooltipPortalContext.ts +0 -8
- package/src/edges/CustomEdge.tsx +0 -402
- package/src/edges/GenericEdge.tsx +0 -36
- package/src/hooks/usePathBasedEvents.ts +0 -192
- package/src/hooks/useSequenceLayout.ts +0 -543
- package/src/hooks/useUndoRedo.ts +0 -144
- package/src/nodes/CustomNode.tsx +0 -1231
- package/src/nodes/GenericNode.tsx +0 -55
- package/src/nodes/otel/OtelBoundaryNode.tsx +0 -224
- package/src/nodes/otel/OtelEventNode.tsx +0 -225
- package/src/nodes/otel/OtelResourceNode.tsx +0 -251
- package/src/nodes/otel/OtelScopeNode.tsx +0 -221
- package/src/nodes/otel/OtelSpanConventionNode.tsx +0 -295
- package/src/nodes/otel/index.ts +0 -23
- package/src/nodes/otel/shared/NodeBadges.tsx +0 -295
- package/src/nodes/otel/shared/NodeContent.tsx +0 -204
- package/src/nodes/otel/shared/index.ts +0 -8
- package/src/nodes/otel/shared/types.ts +0 -138
- package/src/nodes/otel/shared/useNodeBehavior.ts +0 -114
- package/src/stories/Audit/BoundaryNodes.stories.tsx +0 -385
- package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +0 -1448
- package/src/stories/Audit/CanvasNodeTypes.stories.tsx +0 -1049
- package/src/stories/Audit/ColorPriority.stories.tsx +0 -895
- package/src/stories/Audit/DiamondBadges.stories.tsx +0 -629
- package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +0 -724
- package/src/stories/Audit/NodeFieldsAudit.stories.tsx +0 -996
- package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +0 -715
- package/src/stories/Audit/NodeShapes.stories.tsx +0 -1208
- package/src/stories/Audit/WideNodesTesting.stories.tsx +0 -1045
- package/src/stories/Components/DashboardRenderer.stories.tsx +0 -263
- package/src/stories/Components/GraphRenderer.stories.tsx +0 -3236
- package/src/stories/Components/MultiCanvasRenderer.stories.tsx +0 -370
- package/src/stories/Components/SequenceDiagram.stories.tsx +0 -255
- package/src/stories/Components/StateView.stories.tsx +0 -417
- package/src/stories/Components/TraceViewer.stories.tsx +0 -442
- package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +0 -802
- package/src/stories/Features/AnimationWorkshop.stories.tsx +0 -727
- package/src/stories/Features/ChangeTypeVisual.stories.tsx +0 -67
- package/src/stories/Features/EventDrivenAnimations.stories.tsx +0 -513
- package/src/stories/Features/MultiConfig.stories.tsx +0 -539
- package/src/stories/Layout/ElkEdgeRouting.stories.tsx +0 -539
- package/src/stories/Layout/GraphOrientation.stories.tsx +0 -500
- package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +0 -352
- package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +0 -560
- package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +0 -491
- package/src/stories/Nodes/NumericColors.stories.tsx +0 -440
- package/src/stories/OTEL/EventNameDisplay.stories.tsx +0 -694
- package/src/stories/OTEL/EventNameFallback.stories.tsx +0 -578
- package/src/stories/OTEL/OtelComponents.stories.tsx +0 -422
- package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +0 -806
- package/src/stories/OTEL/RawEventCards.stories.tsx +0 -57
- package/src/stories/OTEL/SpanBadges.stories.tsx +0 -840
- package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +0 -209
- package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +0 -721
- package/src/stories/RealWorld/FileCitySequence.stories.tsx +0 -516
- package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +0 -336
- package/src/stories/__traces__/test-run.canvas.json +0 -241
- package/src/stories/data/activity-feed-analytics.dashboard.json +0 -300
- package/src/stories/data/file-city-images-transformed.otel.canvas.json +0 -295
- package/src/stories/data/file-city-workflows.json +0 -269
- package/src/stories/data/graph-converter-test-execution.json +0 -443
- package/src/stories/data/graph-converter-test.workflow.json +0 -105
- package/src/stories/data/graph-converter-validated-execution.json +0 -58
- package/src/utils/animationMapping.ts +0 -166
- package/src/utils/canvasBounds.ts +0 -146
- package/src/utils/graphConverter.ts +0 -148
- package/src/utils/iconResolver.tsx +0 -53
- package/src/utils/orientationUtils.ts +0 -73
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ConfigurationFile } from '@principal-ai/subsystems-core';
|
|
3
|
-
|
|
4
|
-
export interface ConfigurationSelectorProps {
|
|
5
|
-
/** Available configurations */
|
|
6
|
-
configurations: ConfigurationFile[];
|
|
7
|
-
|
|
8
|
-
/** Currently selected configuration name */
|
|
9
|
-
selectedConfig: string;
|
|
10
|
-
|
|
11
|
-
/** Callback when configuration changes */
|
|
12
|
-
onConfigChange: (configName: string) => void;
|
|
13
|
-
|
|
14
|
-
/** Optional custom className */
|
|
15
|
-
className?: string;
|
|
16
|
-
|
|
17
|
-
/** Optional custom styles */
|
|
18
|
-
style?: React.CSSProperties;
|
|
19
|
-
|
|
20
|
-
/** Whether to show description */
|
|
21
|
-
showDescription?: boolean;
|
|
22
|
-
|
|
23
|
-
/** Label text for the selector */
|
|
24
|
-
label?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Configuration selector component for switching between multiple graph configurations
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* const [selectedConfig, setSelectedConfig] = useState('simple-service');
|
|
33
|
-
*
|
|
34
|
-
* <ConfigurationSelector
|
|
35
|
-
* configurations={loadedConfigs}
|
|
36
|
-
* selectedConfig={selectedConfig}
|
|
37
|
-
* onConfigChange={setSelectedConfig}
|
|
38
|
-
* showDescription
|
|
39
|
-
* />
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export const ConfigurationSelector: React.FC<ConfigurationSelectorProps> = ({
|
|
43
|
-
configurations,
|
|
44
|
-
selectedConfig,
|
|
45
|
-
onConfigChange,
|
|
46
|
-
className,
|
|
47
|
-
style,
|
|
48
|
-
showDescription = false,
|
|
49
|
-
label = 'Graph Configuration',
|
|
50
|
-
}) => {
|
|
51
|
-
const handleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
|
52
|
-
onConfigChange(event.target.value);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const selectedConfigData = configurations.find((c) => c.name === selectedConfig);
|
|
56
|
-
|
|
57
|
-
const defaultStyle: React.CSSProperties = {
|
|
58
|
-
backgroundColor: 'white',
|
|
59
|
-
padding: '12px 16px',
|
|
60
|
-
borderRadius: '8px',
|
|
61
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
62
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
63
|
-
...style,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const labelStyle: React.CSSProperties = {
|
|
67
|
-
display: 'block',
|
|
68
|
-
fontSize: '14px',
|
|
69
|
-
fontWeight: 600,
|
|
70
|
-
marginBottom: '8px',
|
|
71
|
-
color: '#333',
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const selectStyle: React.CSSProperties = {
|
|
75
|
-
width: '100%',
|
|
76
|
-
padding: '8px 12px',
|
|
77
|
-
fontSize: '14px',
|
|
78
|
-
border: '1px solid #ddd',
|
|
79
|
-
borderRadius: '4px',
|
|
80
|
-
backgroundColor: 'white',
|
|
81
|
-
cursor: 'pointer',
|
|
82
|
-
outline: 'none',
|
|
83
|
-
transition: 'border-color 0.2s',
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const infoStyle: React.CSSProperties = {
|
|
87
|
-
marginTop: '8px',
|
|
88
|
-
fontSize: '12px',
|
|
89
|
-
color: '#666',
|
|
90
|
-
lineHeight: '1.5',
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
if (configurations.length === 0) {
|
|
94
|
-
return (
|
|
95
|
-
<div className={className} style={defaultStyle}>
|
|
96
|
-
<div style={{ ...labelStyle, color: '#999' }}>No configurations available</div>
|
|
97
|
-
</div>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<div className={className} style={defaultStyle}>
|
|
103
|
-
<label style={labelStyle} htmlFor="config-selector">
|
|
104
|
-
{label}
|
|
105
|
-
</label>
|
|
106
|
-
|
|
107
|
-
<select
|
|
108
|
-
id="config-selector"
|
|
109
|
-
value={selectedConfig}
|
|
110
|
-
onChange={handleChange}
|
|
111
|
-
style={selectStyle}
|
|
112
|
-
onMouseEnter={(e) => {
|
|
113
|
-
e.currentTarget.style.borderColor = '#4A90E2';
|
|
114
|
-
}}
|
|
115
|
-
onMouseLeave={(e) => {
|
|
116
|
-
e.currentTarget.style.borderColor = '#ddd';
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
{configurations.map((config) => (
|
|
120
|
-
<option key={config.name} value={config.name}>
|
|
121
|
-
{config.config.metadata.name}
|
|
122
|
-
</option>
|
|
123
|
-
))}
|
|
124
|
-
</select>
|
|
125
|
-
|
|
126
|
-
{selectedConfigData && showDescription && selectedConfigData.config.metadata.description && (
|
|
127
|
-
<div style={infoStyle}>
|
|
128
|
-
<div>{selectedConfigData.config.metadata.description}</div>
|
|
129
|
-
</div>
|
|
130
|
-
)}
|
|
131
|
-
</div>
|
|
132
|
-
);
|
|
133
|
-
};
|