@principal-ai/subsystems-react 0.20.6 → 0.21.1
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 +1 -1
- package/dist/graphify/anchor.d.ts +17 -0
- package/dist/graphify/anchor.d.ts.map +1 -1
- package/dist/graphify/anchor.js +41 -0
- package/dist/graphify/anchor.js.map +1 -1
- package/dist/graphify/consolidated.d.ts +40 -1
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/pierre/{PierreThroughlineCodeView.d.ts → PierreWalkthroughCodeView.d.ts} +7 -7
- package/dist/pierre/{PierreThroughlineCodeView.d.ts.map → PierreWalkthroughCodeView.d.ts.map} +1 -1
- package/dist/pierre/{PierreThroughlineCodeView.js → PierreWalkthroughCodeView.js} +28 -36
- package/dist/pierre/PierreWalkthroughCodeView.js.map +1 -0
- package/dist/pierre/index.d.ts +2 -2
- package/dist/pierre/index.js +1 -1
- package/dist/pierre/pierreFileLang.d.ts +1 -1
- package/dist/pierre/pierreFileLang.js +1 -1
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +14 -2
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +86 -20
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
- package/dist/subsystem/FileDrawer.d.ts +2 -2
- package/dist/subsystem/FileDrawer.js +2 -2
- package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -24
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +204 -199
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts +2 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +57 -33
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/model.d.ts +85 -35
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +85 -6
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +30 -13
- package/dist/subsystem/nodes.js.map +1 -1
- package/dist/subsystem/tokenizeComponent.js +2 -2
- package/dist/subsystem/tokenizeComponent.js.map +1 -1
- package/package.json +3 -3
- package/src/graphify/anchor.test.ts +31 -2
- package/src/graphify/anchor.ts +46 -0
- package/src/graphify/consolidated.ts +43 -1
- package/src/index.ts +13 -5
- package/src/pierre/{PierreThroughlineCodeView.tsx → PierreWalkthroughCodeView.tsx} +39 -47
- package/src/pierre/index.ts +2 -2
- package/src/pierre/pierreFileLang.ts +1 -1
- package/src/stories/Pierre/CodeView.stories.tsx +3 -3
- package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +14 -14
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +13 -15
- package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +8 -8
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +14 -14
- package/src/stories/Subsystem/ComponentGraph/CustomEntities.stories.tsx +11 -10
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +13 -14
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +31 -66
- package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +2 -2
- package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +4 -4
- package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +3 -3
- package/src/stories/Subsystem/ComponentGraph/Proposed.stories.tsx +1 -1
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +518 -33
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +13 -13
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +105 -21
- package/src/subsystem/FileDrawer.tsx +2 -2
- package/src/subsystem/SubsystemComponentGraph.tsx +268 -259
- package/src/subsystem/formatDeclaration.test.ts +76 -1
- package/src/subsystem/formatDeclaration.ts +57 -33
- package/src/subsystem/model.test.ts +27 -15
- package/src/subsystem/model.ts +175 -45
- package/src/subsystem/nodes.tsx +47 -13
- package/src/subsystem/tokenizeComponent.ts +2 -2
- package/dist/components/ConfigurationSelector.d.ts +0 -35
- package/dist/components/ConfigurationSelector.d.ts.map +0 -1
- package/dist/components/ConfigurationSelector.js +0 -63
- package/dist/components/ConfigurationSelector.js.map +0 -1
- package/dist/components/GraphRenderer.d.ts +0 -295
- package/dist/components/GraphRenderer.d.ts.map +0 -1
- package/dist/components/GraphRenderer.js +0 -2008
- package/dist/components/GraphRenderer.js.map +0 -1
- package/dist/components/MultiCanvasRenderer.d.ts +0 -75
- package/dist/components/MultiCanvasRenderer.d.ts.map +0 -1
- package/dist/components/MultiCanvasRenderer.js +0 -203
- package/dist/components/MultiCanvasRenderer.js.map +0 -1
- package/dist/components/NodeTooltip.d.ts +0 -24
- package/dist/components/NodeTooltip.d.ts.map +0 -1
- package/dist/components/NodeTooltip.js +0 -160
- package/dist/components/NodeTooltip.js.map +0 -1
- package/dist/components/SelectionSidebar.d.ts +0 -18
- package/dist/components/SelectionSidebar.d.ts.map +0 -1
- package/dist/components/SelectionSidebar.js +0 -190
- package/dist/components/SelectionSidebar.js.map +0 -1
- package/dist/components/SequenceDiagramRenderer.d.ts +0 -77
- package/dist/components/SequenceDiagramRenderer.d.ts.map +0 -1
- package/dist/components/SequenceDiagramRenderer.js +0 -604
- package/dist/components/SequenceDiagramRenderer.js.map +0 -1
- package/dist/components/WorkflowSequenceDiagram.d.ts +0 -63
- package/dist/components/WorkflowSequenceDiagram.d.ts.map +0 -1
- package/dist/components/WorkflowSequenceDiagram.js +0 -147
- package/dist/components/WorkflowSequenceDiagram.js.map +0 -1
- package/dist/components/dashboard/DashboardRenderer.d.ts +0 -10
- package/dist/components/dashboard/DashboardRenderer.d.ts.map +0 -1
- package/dist/components/dashboard/DashboardRenderer.js +0 -179
- package/dist/components/dashboard/DashboardRenderer.js.map +0 -1
- package/dist/components/dashboard/MetricPanel.d.ts +0 -10
- package/dist/components/dashboard/MetricPanel.d.ts.map +0 -1
- package/dist/components/dashboard/MetricPanel.js +0 -103
- package/dist/components/dashboard/MetricPanel.js.map +0 -1
- package/dist/components/dashboard/MockDataProvider.d.ts +0 -30
- package/dist/components/dashboard/MockDataProvider.d.ts.map +0 -1
- package/dist/components/dashboard/MockDataProvider.js +0 -270
- package/dist/components/dashboard/MockDataProvider.js.map +0 -1
- package/dist/components/dashboard/components/BarChart.d.ts +0 -10
- package/dist/components/dashboard/components/BarChart.d.ts.map +0 -1
- package/dist/components/dashboard/components/BarChart.js +0 -167
- package/dist/components/dashboard/components/BarChart.js.map +0 -1
- package/dist/components/dashboard/components/LineChart.d.ts +0 -10
- package/dist/components/dashboard/components/LineChart.d.ts.map +0 -1
- package/dist/components/dashboard/components/LineChart.js +0 -141
- package/dist/components/dashboard/components/LineChart.js.map +0 -1
- package/dist/components/dashboard/components/MetricCard.d.ts +0 -9
- package/dist/components/dashboard/components/MetricCard.d.ts.map +0 -1
- package/dist/components/dashboard/components/MetricCard.js +0 -163
- package/dist/components/dashboard/components/MetricCard.js.map +0 -1
- package/dist/components/dashboard/components/SourceLink.d.ts +0 -9
- package/dist/components/dashboard/components/SourceLink.d.ts.map +0 -1
- package/dist/components/dashboard/components/SourceLink.js +0 -39
- package/dist/components/dashboard/components/SourceLink.js.map +0 -1
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts +0 -9
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +0 -1
- package/dist/components/dashboard/components/TimeRangeSelector.js +0 -167
- package/dist/components/dashboard/components/TimeRangeSelector.js.map +0 -1
- package/dist/components/dashboard/components/index.d.ts +0 -6
- package/dist/components/dashboard/components/index.d.ts.map +0 -1
- package/dist/components/dashboard/components/index.js +0 -6
- package/dist/components/dashboard/components/index.js.map +0 -1
- package/dist/components/dashboard/index.d.ts +0 -6
- package/dist/components/dashboard/index.d.ts.map +0 -1
- package/dist/components/dashboard/index.js +0 -8
- package/dist/components/dashboard/index.js.map +0 -1
- package/dist/components/dashboard/types.d.ts +0 -74
- package/dist/components/dashboard/types.d.ts.map +0 -1
- package/dist/components/dashboard/types.js +0 -8
- package/dist/components/dashboard/types.js.map +0 -1
- package/dist/components/state-view/PipelineView.d.ts +0 -14
- package/dist/components/state-view/PipelineView.d.ts.map +0 -1
- package/dist/components/state-view/PipelineView.js +0 -195
- package/dist/components/state-view/PipelineView.js.map +0 -1
- package/dist/components/state-view/index.d.ts +0 -14
- package/dist/components/state-view/index.d.ts.map +0 -1
- package/dist/components/state-view/index.js +0 -12
- package/dist/components/state-view/index.js.map +0 -1
- package/dist/components/state-view/types.d.ts +0 -188
- package/dist/components/state-view/types.d.ts.map +0 -1
- package/dist/components/state-view/types.js +0 -10
- package/dist/components/state-view/types.js.map +0 -1
- package/dist/components/state-view/useStateView.d.ts +0 -32
- package/dist/components/state-view/useStateView.d.ts.map +0 -1
- package/dist/components/state-view/useStateView.js +0 -129
- package/dist/components/state-view/useStateView.js.map +0 -1
- package/dist/contexts/GraphEditContext.d.ts +0 -20
- package/dist/contexts/GraphEditContext.d.ts.map +0 -1
- package/dist/contexts/GraphEditContext.js +0 -8
- package/dist/contexts/GraphEditContext.js.map +0 -1
- package/dist/contexts/TooltipPortalContext.d.ts +0 -8
- package/dist/contexts/TooltipPortalContext.d.ts.map +0 -1
- package/dist/contexts/TooltipPortalContext.js +0 -8
- package/dist/contexts/TooltipPortalContext.js.map +0 -1
- package/dist/edges/CustomEdge.d.ts +0 -24
- package/dist/edges/CustomEdge.d.ts.map +0 -1
- package/dist/edges/CustomEdge.js +0 -222
- package/dist/edges/CustomEdge.js.map +0 -1
- package/dist/edges/GenericEdge.d.ts +0 -18
- package/dist/edges/GenericEdge.d.ts.map +0 -1
- package/dist/edges/GenericEdge.js +0 -10
- package/dist/edges/GenericEdge.js.map +0 -1
- package/dist/graphify/kind.d.ts +0 -23
- package/dist/graphify/kind.d.ts.map +0 -1
- package/dist/graphify/kind.js +0 -77
- package/dist/graphify/kind.js.map +0 -1
- package/dist/hooks/usePathBasedEvents.d.ts +0 -42
- package/dist/hooks/usePathBasedEvents.d.ts.map +0 -1
- package/dist/hooks/usePathBasedEvents.js +0 -119
- package/dist/hooks/usePathBasedEvents.js.map +0 -1
- package/dist/hooks/useSequenceLayout.d.ts +0 -186
- package/dist/hooks/useSequenceLayout.d.ts.map +0 -1
- package/dist/hooks/useSequenceLayout.js +0 -327
- package/dist/hooks/useSequenceLayout.js.map +0 -1
- package/dist/hooks/useUndoRedo.d.ts +0 -80
- package/dist/hooks/useUndoRedo.d.ts.map +0 -1
- package/dist/hooks/useUndoRedo.js +0 -70
- package/dist/hooks/useUndoRedo.js.map +0 -1
- package/dist/nodes/CustomNode.d.ts +0 -28
- package/dist/nodes/CustomNode.d.ts.map +0 -1
- package/dist/nodes/CustomNode.js +0 -820
- package/dist/nodes/CustomNode.js.map +0 -1
- package/dist/nodes/GenericNode.d.ts +0 -20
- package/dist/nodes/GenericNode.d.ts.map +0 -1
- package/dist/nodes/GenericNode.js +0 -20
- package/dist/nodes/GenericNode.js.map +0 -1
- package/dist/nodes/otel/OtelBoundaryNode.d.ts +0 -55
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +0 -1
- package/dist/nodes/otel/OtelBoundaryNode.js +0 -81
- package/dist/nodes/otel/OtelBoundaryNode.js.map +0 -1
- package/dist/nodes/otel/OtelEventNode.d.ts +0 -59
- package/dist/nodes/otel/OtelEventNode.d.ts.map +0 -1
- package/dist/nodes/otel/OtelEventNode.js +0 -82
- package/dist/nodes/otel/OtelEventNode.js.map +0 -1
- package/dist/nodes/otel/OtelResourceNode.d.ts +0 -53
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +0 -1
- package/dist/nodes/otel/OtelResourceNode.js +0 -105
- package/dist/nodes/otel/OtelResourceNode.js.map +0 -1
- package/dist/nodes/otel/OtelScopeNode.d.ts +0 -53
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +0 -1
- package/dist/nodes/otel/OtelScopeNode.js +0 -81
- package/dist/nodes/otel/OtelScopeNode.js.map +0 -1
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts +0 -61
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +0 -1
- package/dist/nodes/otel/OtelSpanConventionNode.js +0 -131
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +0 -1
- package/dist/nodes/otel/index.d.ts +0 -17
- package/dist/nodes/otel/index.d.ts.map +0 -1
- package/dist/nodes/otel/index.js +0 -13
- package/dist/nodes/otel/index.js.map +0 -1
- package/dist/nodes/otel/shared/NodeBadges.d.ts +0 -10
- package/dist/nodes/otel/shared/NodeBadges.d.ts.map +0 -1
- package/dist/nodes/otel/shared/NodeBadges.js +0 -178
- package/dist/nodes/otel/shared/NodeBadges.js.map +0 -1
- package/dist/nodes/otel/shared/NodeContent.d.ts +0 -10
- package/dist/nodes/otel/shared/NodeContent.d.ts.map +0 -1
- package/dist/nodes/otel/shared/NodeContent.js +0 -96
- package/dist/nodes/otel/shared/NodeContent.js.map +0 -1
- package/dist/nodes/otel/shared/index.d.ts +0 -8
- package/dist/nodes/otel/shared/index.d.ts.map +0 -1
- package/dist/nodes/otel/shared/index.js +0 -8
- package/dist/nodes/otel/shared/index.js.map +0 -1
- package/dist/nodes/otel/shared/types.d.ts +0 -129
- package/dist/nodes/otel/shared/types.d.ts.map +0 -1
- package/dist/nodes/otel/shared/types.js +0 -5
- package/dist/nodes/otel/shared/types.js.map +0 -1
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts +0 -42
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +0 -1
- package/dist/nodes/otel/shared/useNodeBehavior.js +0 -61
- package/dist/nodes/otel/shared/useNodeBehavior.js.map +0 -1
- package/dist/pierre/PierreThroughlineCodeView.js.map +0 -1
- package/dist/subsystem/SubsystemCarousel.d.ts +0 -36
- package/dist/subsystem/SubsystemCarousel.d.ts.map +0 -1
- package/dist/subsystem/SubsystemCarousel.js +0 -163
- package/dist/subsystem/SubsystemCarousel.js.map +0 -1
- package/dist/utils/animationMapping.d.ts +0 -53
- package/dist/utils/animationMapping.d.ts.map +0 -1
- package/dist/utils/animationMapping.js +0 -126
- package/dist/utils/animationMapping.js.map +0 -1
- package/dist/utils/canvasBounds.d.ts +0 -50
- package/dist/utils/canvasBounds.d.ts.map +0 -1
- package/dist/utils/canvasBounds.js +0 -88
- package/dist/utils/canvasBounds.js.map +0 -1
- package/dist/utils/graphConverter.d.ts +0 -18
- package/dist/utils/graphConverter.d.ts.map +0 -1
- package/dist/utils/graphConverter.js +0 -114
- package/dist/utils/graphConverter.js.map +0 -1
- package/dist/utils/iconResolver.d.ts +0 -29
- package/dist/utils/iconResolver.d.ts.map +0 -1
- package/dist/utils/iconResolver.js +0 -30
- package/dist/utils/iconResolver.js.map +0 -1
- package/dist/utils/orientationUtils.d.ts +0 -19
- package/dist/utils/orientationUtils.d.ts.map +0 -1
- package/dist/utils/orientationUtils.js +0 -62
- package/dist/utils/orientationUtils.js.map +0 -1
package/src/subsystem/model.ts
CHANGED
|
@@ -21,6 +21,10 @@ import { computeElkLayout, calculatePathLength } from '../utils/elkLayout';
|
|
|
21
21
|
import type { GraphifyComponentDetail } from '../graphify';
|
|
22
22
|
import type { SubsystemDeclarationRef } from './declarationRef';
|
|
23
23
|
|
|
24
|
+
/** Structured declaration shape — same union as graphify drill-down payloads. */
|
|
25
|
+
export type SubsystemConstructDeclaration = GraphifyComponentDetail;
|
|
26
|
+
export type SubsystemDeclarationProvenance = 'verified' | 'authored';
|
|
27
|
+
|
|
24
28
|
export type SubsystemComponentConstruct =
|
|
25
29
|
| 'class'
|
|
26
30
|
| 'function'
|
|
@@ -82,20 +86,29 @@ export interface SubsystemDeclToken {
|
|
|
82
86
|
color?: string;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Topology relation type — structural / module / type claims.
|
|
91
|
+
* Belongs on `relations[]`, not on walkthrough hops.
|
|
92
|
+
*/
|
|
93
|
+
export type SubsystemRelationType =
|
|
86
94
|
| 'imports'
|
|
87
95
|
| 'imports_from'
|
|
88
96
|
| 're_exports'
|
|
89
97
|
| 'defines'
|
|
90
|
-
| 'calls'
|
|
91
98
|
| 'extends'
|
|
92
99
|
| 'inherits'
|
|
93
100
|
| 'implements'
|
|
94
101
|
| 'mixes_in'
|
|
95
|
-
| 'uses'
|
|
96
102
|
| 'method'
|
|
97
103
|
| 'references'
|
|
98
|
-
| 'contains'
|
|
104
|
+
| 'contains';
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Walkthrough hop mechanism — runtime seams with a `file:line` site.
|
|
108
|
+
*/
|
|
109
|
+
export type SubsystemWalkthroughMechanism =
|
|
110
|
+
| 'calls'
|
|
111
|
+
| 'uses'
|
|
99
112
|
| 'feeds'
|
|
100
113
|
| 'produces'
|
|
101
114
|
| 'writes'
|
|
@@ -103,6 +116,11 @@ export type SubsystemEdgeMechanism =
|
|
|
103
116
|
| 'watches'
|
|
104
117
|
| 'registers-into';
|
|
105
118
|
|
|
119
|
+
/** Union for derived graph-edge styling (relationType or hop mechanism). */
|
|
120
|
+
export type SubsystemEdgeMechanism =
|
|
121
|
+
| SubsystemRelationType
|
|
122
|
+
| SubsystemWalkthroughMechanism;
|
|
123
|
+
|
|
106
124
|
/** A component node — the named unit, construct-tagged; `file` is its location. */
|
|
107
125
|
export interface SubsystemComponent {
|
|
108
126
|
id: string;
|
|
@@ -187,20 +205,20 @@ export interface SubsystemComponent {
|
|
|
187
205
|
*/
|
|
188
206
|
layer?: number;
|
|
189
207
|
/**
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
208
|
+
* Structured declaration shape of the construct (params, members, type
|
|
209
|
+
* buckets, …). Single source of truth for the click panel — authored by
|
|
210
|
+
* agents/CLI or filled by verified graphify capture. Discriminated by kind.
|
|
193
211
|
*/
|
|
194
|
-
|
|
212
|
+
declaration?: SubsystemConstructDeclaration;
|
|
195
213
|
/**
|
|
196
|
-
* Where the
|
|
214
|
+
* Where the structured `declaration` came from. `verified` = extracted from
|
|
197
215
|
* source by tooling (graphify AST, signature extraction) — may be trusted
|
|
198
216
|
* as matching the code. `authored` = written by the authoring agent/human
|
|
199
217
|
* to highlight specific inputs/outputs — informative, not checked against
|
|
200
|
-
* source.
|
|
201
|
-
* may claim `verified`.
|
|
218
|
+
* source. Declaration without provenance is treated as `authored`; only
|
|
219
|
+
* tooling may claim `verified`.
|
|
202
220
|
*/
|
|
203
|
-
|
|
221
|
+
declarationProvenance?: SubsystemDeclarationProvenance;
|
|
204
222
|
/**
|
|
205
223
|
* Pre-tokenized declaration for the detail panel. When present, the
|
|
206
224
|
* renderer skips client-side tokenization. Tokens are language-agnostic;
|
|
@@ -214,7 +232,20 @@ export interface SubsystemComponent {
|
|
|
214
232
|
declarationRef?: SubsystemDeclarationRef;
|
|
215
233
|
}
|
|
216
234
|
|
|
217
|
-
/** A
|
|
235
|
+
/** A topology relation between components (structural / module / type). */
|
|
236
|
+
export interface SubsystemRelation {
|
|
237
|
+
id: string;
|
|
238
|
+
from: string;
|
|
239
|
+
to: string;
|
|
240
|
+
relationType: SubsystemRelationType;
|
|
241
|
+
/** Concrete file/symbol refs backing the relation. */
|
|
242
|
+
refs?: string[];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Derived / display graph edge used by renderers. Built from `relations`
|
|
247
|
+
* and/or walkthrough hops — not authored as its own document field.
|
|
248
|
+
*/
|
|
218
249
|
export interface SubsystemComponentEdge {
|
|
219
250
|
id: string;
|
|
220
251
|
from: string; // component id
|
|
@@ -225,41 +256,97 @@ export interface SubsystemComponentEdge {
|
|
|
225
256
|
}
|
|
226
257
|
|
|
227
258
|
/**
|
|
228
|
-
* A single
|
|
229
|
-
* seam
|
|
230
|
-
* (`from`, `to`, `mechanism`); a throughline step picks the concrete
|
|
231
|
-
* manifestation. One edge can appear in many steps.
|
|
259
|
+
* A single runtime hop — `from`/`to`/`mechanism` plus the exact `file:line`
|
|
260
|
+
* where that seam fires for a walkthrough.
|
|
232
261
|
*/
|
|
233
|
-
export interface
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
262
|
+
export interface SubsystemWalkthroughStep {
|
|
263
|
+
from: string;
|
|
264
|
+
to: string;
|
|
265
|
+
mechanism: SubsystemWalkthroughMechanism;
|
|
266
|
+
/** Repo-root-relative path of the file where the seam fires. */
|
|
237
267
|
file: string;
|
|
238
268
|
/** 1-based line of the site within `file`. */
|
|
239
269
|
line: number;
|
|
240
270
|
/**
|
|
241
271
|
* Frame name for this hop — the function/method/symbol on the stack at
|
|
242
|
-
* this site. Optional
|
|
243
|
-
*
|
|
272
|
+
* this site. Optional; when set the walkthroughs list shows it instead of
|
|
273
|
+
* mechanism + filename.
|
|
244
274
|
*/
|
|
245
275
|
symbol?: string;
|
|
246
276
|
/**
|
|
247
277
|
* Free-text note anchored to this hop's site line. Optional — informative
|
|
248
|
-
* only, never verified against source; the Pierre
|
|
278
|
+
* only, never verified against source; the Pierre walkthrough code view
|
|
249
279
|
* surfaces it in the annotation column next to the highlighted line.
|
|
250
280
|
*/
|
|
251
281
|
annotation?: string;
|
|
252
282
|
}
|
|
253
283
|
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
* existing edge and the exact site where that relationship fires for a flow;
|
|
257
|
-
* ordering is the array. One throughline per flow (save flow, load flow, …).
|
|
258
|
-
*/
|
|
259
|
-
export interface SubsystemThroughline {
|
|
284
|
+
/** An ordered runtime walkthrough — one named behavior story. */
|
|
285
|
+
export interface SubsystemWalkthrough {
|
|
260
286
|
id: string;
|
|
261
287
|
title: string;
|
|
262
|
-
steps:
|
|
288
|
+
steps: SubsystemWalkthroughStep[];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface SubsystemModelDocument {
|
|
292
|
+
components: SubsystemComponent[];
|
|
293
|
+
/** Topology relations (structural / module / type). May be empty. */
|
|
294
|
+
relations: SubsystemRelation[];
|
|
295
|
+
/** Ordered runtime walkthroughs (one per named behavior). */
|
|
296
|
+
walkthroughs?: SubsystemWalkthrough[];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Stable id for a derived graph edge from a relation or walkthrough hop. */
|
|
300
|
+
export function derivedGraphEdgeId(
|
|
301
|
+
from: string,
|
|
302
|
+
to: string,
|
|
303
|
+
mechanism: SubsystemEdgeMechanism,
|
|
304
|
+
): string {
|
|
305
|
+
return `${from}--${mechanism}-->${to}`;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Build display edges for the graph canvas from topology relations and
|
|
310
|
+
* walkthrough hops (deduped by from/to/mechanism).
|
|
311
|
+
*/
|
|
312
|
+
/** React Flow / canvas edge id for a walkthrough hop. */
|
|
313
|
+
export function walkthroughStepGraphEdgeId(
|
|
314
|
+
step: Pick<SubsystemWalkthroughStep, 'from' | 'to' | 'mechanism'>,
|
|
315
|
+
): string {
|
|
316
|
+
return derivedGraphEdgeId(step.from, step.to, step.mechanism);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export function deriveGraphEdges(doc: {
|
|
320
|
+
relations?: SubsystemRelation[];
|
|
321
|
+
walkthroughs?: SubsystemWalkthrough[];
|
|
322
|
+
}): SubsystemComponentEdge[] {
|
|
323
|
+
const byId = new Map<string, SubsystemComponentEdge>();
|
|
324
|
+
for (const r of doc.relations ?? []) {
|
|
325
|
+
const id = r.id || derivedGraphEdgeId(r.from, r.to, r.relationType);
|
|
326
|
+
if (!byId.has(id)) {
|
|
327
|
+
byId.set(id, {
|
|
328
|
+
id,
|
|
329
|
+
from: r.from,
|
|
330
|
+
to: r.to,
|
|
331
|
+
mechanism: r.relationType,
|
|
332
|
+
refs: r.refs,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
for (const w of doc.walkthroughs ?? []) {
|
|
337
|
+
for (const step of w.steps) {
|
|
338
|
+
const id = derivedGraphEdgeId(step.from, step.to, step.mechanism);
|
|
339
|
+
if (!byId.has(id)) {
|
|
340
|
+
byId.set(id, {
|
|
341
|
+
id,
|
|
342
|
+
from: step.from,
|
|
343
|
+
to: step.to,
|
|
344
|
+
mechanism: step.mechanism,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return [...byId.values()];
|
|
263
350
|
}
|
|
264
351
|
|
|
265
352
|
/**
|
|
@@ -337,13 +424,6 @@ export function formatPurl(purl: string): string {
|
|
|
337
424
|
return identity;
|
|
338
425
|
}
|
|
339
426
|
|
|
340
|
-
export interface SubsystemModelDocument {
|
|
341
|
-
components: SubsystemComponent[];
|
|
342
|
-
edges: SubsystemComponentEdge[];
|
|
343
|
-
/** Ordered execution stories over the graph's edges (one per flow). */
|
|
344
|
-
throughlines?: SubsystemThroughline[];
|
|
345
|
-
}
|
|
346
|
-
|
|
347
427
|
// ---------------------------------------------------------------------------
|
|
348
428
|
// React Flow conversion
|
|
349
429
|
// ---------------------------------------------------------------------------
|
|
@@ -552,6 +632,50 @@ export function rightBadgeColor(component: {
|
|
|
552
632
|
return null;
|
|
553
633
|
}
|
|
554
634
|
|
|
635
|
+
/** Display label per store `storage` backing. */
|
|
636
|
+
export const STORAGE_LABEL: Record<string, string> = {
|
|
637
|
+
memory: 'memory',
|
|
638
|
+
disk: 'disk',
|
|
639
|
+
external: 'db',
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
/** Right-badge accent per store `storage` backing — retention reads as its
|
|
643
|
+
* own hue so memory / disk / db are scannable from far on a canvas. */
|
|
644
|
+
export const STORAGE_COLOR: Record<string, string> = {
|
|
645
|
+
memory: '#5aa9e6', // sky — process-lifetime RAM
|
|
646
|
+
disk: '#e3b341', // amber — this process on the filesystem
|
|
647
|
+
external: '#c46fd8', // violet — mediated by another system (db/service)
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
function storeStorage(component: {
|
|
651
|
+
declaration?: GraphifyComponentDetail;
|
|
652
|
+
}): string | undefined {
|
|
653
|
+
return component.declaration?.kind === 'store'
|
|
654
|
+
? component.declaration.storage
|
|
655
|
+
: undefined;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** Top-right storage badge for `construct: 'store'` nodes with an authored
|
|
659
|
+
* `storage` declaration — how the retained state is backed. Sits beside the
|
|
660
|
+
* role/proposed badge (storage is orthogonal to topology). Null otherwise. */
|
|
661
|
+
export function storageBadgeLabel(component: {
|
|
662
|
+
construct: SubsystemComponentConstruct;
|
|
663
|
+
declaration?: GraphifyComponentDetail;
|
|
664
|
+
}): string | null {
|
|
665
|
+
if (component.construct !== 'store') return null;
|
|
666
|
+
const storage = storeStorage(component);
|
|
667
|
+
return storage ? (STORAGE_LABEL[storage] ?? storage) : null;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export function storageBadgeColor(component: {
|
|
671
|
+
construct: SubsystemComponentConstruct;
|
|
672
|
+
declaration?: GraphifyComponentDetail;
|
|
673
|
+
}): string | null {
|
|
674
|
+
if (component.construct !== 'store') return null;
|
|
675
|
+
const storage = storeStorage(component);
|
|
676
|
+
return storage ? (STORAGE_COLOR[storage] ?? null) : null;
|
|
677
|
+
}
|
|
678
|
+
|
|
555
679
|
/**
|
|
556
680
|
* Primary badge text for a node: prefer framework stereotype over the
|
|
557
681
|
* language construct so a React UI unit reads as "component" / "hook"
|
|
@@ -605,13 +729,19 @@ export function nodeMinWidthForBadges(component: {
|
|
|
605
729
|
role?: SubsystemComponentRole;
|
|
606
730
|
proposed?: boolean;
|
|
607
731
|
entityKind?: string;
|
|
732
|
+
declaration?: GraphifyComponentDetail;
|
|
608
733
|
}): number {
|
|
609
734
|
const left = estimateBadgeLabelWidth(constructBadgeLabel(component));
|
|
610
|
-
const
|
|
611
|
-
|
|
735
|
+
const rightBadges = [
|
|
736
|
+
storageBadgeLabel(component),
|
|
737
|
+
rightBadgeLabel(component),
|
|
738
|
+
].filter((l): l is string => l != null);
|
|
739
|
+
if (rightBadges.length === 0) {
|
|
612
740
|
return Math.max(NODE_CSS_MIN_WIDTH, BADGE_EDGE_INSET + left + BADGE_EDGE_INSET);
|
|
613
741
|
}
|
|
614
|
-
const right =
|
|
742
|
+
const right = rightBadges
|
|
743
|
+
.map(estimateBadgeLabelWidth)
|
|
744
|
+
.reduce((acc, w) => acc + BADGE_PAIR_GAP + w);
|
|
615
745
|
return Math.max(
|
|
616
746
|
NODE_CSS_MIN_WIDTH,
|
|
617
747
|
BADGE_EDGE_INSET + left + BADGE_PAIR_GAP + right + BADGE_EDGE_INSET,
|
|
@@ -714,7 +844,7 @@ export function convertSubsystemToEdges(doc: SubsystemModelDocument): SubsystemG
|
|
|
714
844
|
const compIds = new Set(doc.components.map((c) => c.id));
|
|
715
845
|
const edges: SubsystemGraphEdge[] = [];
|
|
716
846
|
|
|
717
|
-
for (const e of doc
|
|
847
|
+
for (const e of deriveGraphEdges(doc)) {
|
|
718
848
|
const color = MECHANISM_COLOR[e.mechanism];
|
|
719
849
|
const style = MECHANISM_STYLE[e.mechanism];
|
|
720
850
|
// If `to` is a real component, connect directly; otherwise point at a stub node.
|
|
@@ -741,14 +871,14 @@ export function convertSubsystemToEdges(doc: SubsystemModelDocument): SubsystemG
|
|
|
741
871
|
|
|
742
872
|
/** Stable key for layout-affecting graph fields (ignores declarationRef, etc.). */
|
|
743
873
|
export function subsystemGraphLayoutKey(
|
|
744
|
-
doc: Pick<SubsystemModelDocument, 'components' | '
|
|
874
|
+
doc: Pick<SubsystemModelDocument, 'components' | 'relations' | 'walkthroughs'>,
|
|
745
875
|
): string {
|
|
746
876
|
const components = doc.components
|
|
747
877
|
.map(({ id, purl, name, symbol, construct, file, purpose, process }) =>
|
|
748
878
|
[id, purl, name, symbol ?? '', construct, file, purpose ?? '', process ?? ''].join('\0'))
|
|
749
879
|
.sort()
|
|
750
880
|
.join('\n');
|
|
751
|
-
const edgeKey = doc
|
|
881
|
+
const edgeKey = deriveGraphEdges(doc)
|
|
752
882
|
.map(({ id, from, to, mechanism }) => [id, from, to, mechanism].join('\0'))
|
|
753
883
|
.sort()
|
|
754
884
|
.join('\n');
|
|
@@ -788,7 +918,7 @@ export async function buildSubsystemGraph(
|
|
|
788
918
|
// cross-package edges have something to land on.
|
|
789
919
|
const realIds = new Set(doc.components.map((c) => c.id));
|
|
790
920
|
const externalIds: string[] = [];
|
|
791
|
-
for (const e of doc
|
|
921
|
+
for (const e of deriveGraphEdges(doc)) {
|
|
792
922
|
if (!realIds.has(e.to)) {
|
|
793
923
|
const extId = `external:${e.to}`;
|
|
794
924
|
if (!externalIds.includes(extId)) externalIds.push(extId);
|
package/src/subsystem/nodes.tsx
CHANGED
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
constructBadgeLabel,
|
|
24
24
|
rightBadgeLabel,
|
|
25
25
|
rightBadgeColor,
|
|
26
|
+
storageBadgeLabel,
|
|
27
|
+
storageBadgeColor,
|
|
26
28
|
deriveNameFromSymbol,
|
|
27
29
|
BADGE_EDGE_INSET,
|
|
28
30
|
nodeMinWidthForBadges,
|
|
@@ -97,6 +99,9 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
97
99
|
const badgeMinWidth = nodeMinWidthForBadges(c);
|
|
98
100
|
const topRightLabel = rightBadgeLabel(c);
|
|
99
101
|
const topRightColor = rightBadgeColor(c);
|
|
102
|
+
// Store retention backing badge — memory/disk/db, beside role (orthogonal).
|
|
103
|
+
const storageLabel = storageBadgeLabel(c);
|
|
104
|
+
const storageColor = storageBadgeColor(c);
|
|
100
105
|
// Set while a file is open in the drawer: true → spotlight, false → dim,
|
|
101
106
|
// absent (no file open) → neutral.
|
|
102
107
|
const fileMatch = data.fileMatch as boolean | undefined;
|
|
@@ -176,28 +181,57 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
176
181
|
{constructBadgeLabel(c)}
|
|
177
182
|
</div>
|
|
178
183
|
|
|
179
|
-
{/* Right badge — proposed wins over role when both are set
|
|
180
|
-
|
|
184
|
+
{/* Right badge cluster — proposed wins over role when both are set;
|
|
185
|
+
store storage (retention backing) sits beside, since it is
|
|
186
|
+
orthogonal to topology. Persistent; pointer-events pass through. */}
|
|
187
|
+
{(topRightLabel != null || storageLabel != null) && (
|
|
181
188
|
<div
|
|
182
189
|
style={{
|
|
183
190
|
position: 'absolute',
|
|
184
191
|
top: -9,
|
|
185
192
|
right: BADGE_EDGE_INSET,
|
|
186
193
|
zIndex: 1,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
letterSpacing: 0.5,
|
|
190
|
-
textTransform: 'uppercase',
|
|
191
|
-
lineHeight: '17px',
|
|
194
|
+
display: 'flex',
|
|
195
|
+
gap: 6,
|
|
192
196
|
whiteSpace: 'nowrap',
|
|
193
|
-
color: topRightColor,
|
|
194
|
-
background: theme.colors.backgroundSecondary ?? theme.colors.background,
|
|
195
|
-
border: `1px solid ${topRightColor}`,
|
|
196
|
-
borderRadius: 4,
|
|
197
|
-
padding: '0 5px',
|
|
198
197
|
}}
|
|
199
198
|
>
|
|
200
|
-
{
|
|
199
|
+
{storageLabel != null && storageColor != null && (
|
|
200
|
+
<span
|
|
201
|
+
style={{
|
|
202
|
+
fontFamily: theme.fonts.monospace,
|
|
203
|
+
fontSize: theme.fontSizes[0] * 1.1,
|
|
204
|
+
letterSpacing: 0.5,
|
|
205
|
+
textTransform: 'uppercase',
|
|
206
|
+
lineHeight: '17px',
|
|
207
|
+
color: storageColor,
|
|
208
|
+
background: theme.colors.backgroundSecondary ?? theme.colors.background,
|
|
209
|
+
border: `1px solid ${storageColor}`,
|
|
210
|
+
borderRadius: 4,
|
|
211
|
+
padding: '0 5px',
|
|
212
|
+
}}
|
|
213
|
+
>
|
|
214
|
+
{storageLabel}
|
|
215
|
+
</span>
|
|
216
|
+
)}
|
|
217
|
+
{topRightLabel != null && topRightColor != null && (
|
|
218
|
+
<span
|
|
219
|
+
style={{
|
|
220
|
+
fontFamily: theme.fonts.monospace,
|
|
221
|
+
fontSize: theme.fontSizes[0] * 1.1,
|
|
222
|
+
letterSpacing: 0.5,
|
|
223
|
+
textTransform: 'uppercase',
|
|
224
|
+
lineHeight: '17px',
|
|
225
|
+
color: topRightColor,
|
|
226
|
+
background: theme.colors.backgroundSecondary ?? theme.colors.background,
|
|
227
|
+
border: `1px solid ${topRightColor}`,
|
|
228
|
+
borderRadius: 4,
|
|
229
|
+
padding: '0 5px',
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
{topRightLabel}
|
|
233
|
+
</span>
|
|
234
|
+
)}
|
|
201
235
|
</div>
|
|
202
236
|
)}
|
|
203
237
|
|
|
@@ -50,9 +50,9 @@ export async function tokenizeComponent(
|
|
|
50
50
|
if (component.tokens) return component.tokens;
|
|
51
51
|
|
|
52
52
|
// External kind — not valid TypeScript, bypass Prettier.
|
|
53
|
-
const kind = component.
|
|
53
|
+
const kind = component.declaration?.kind ?? component.construct;
|
|
54
54
|
if (kind === 'external') {
|
|
55
|
-
const label = component.
|
|
55
|
+
const label = component.declaration?.kind === 'external' ? component.declaration.label : component.name;
|
|
56
56
|
const escaped = label.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
57
57
|
return tokenizeFormatted(`external '${escaped}'`, themeName);
|
|
58
58
|
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ConfigurationFile } from '@principal-ai/subsystems-core';
|
|
3
|
-
export interface ConfigurationSelectorProps {
|
|
4
|
-
/** Available configurations */
|
|
5
|
-
configurations: ConfigurationFile[];
|
|
6
|
-
/** Currently selected configuration name */
|
|
7
|
-
selectedConfig: string;
|
|
8
|
-
/** Callback when configuration changes */
|
|
9
|
-
onConfigChange: (configName: string) => void;
|
|
10
|
-
/** Optional custom className */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** Optional custom styles */
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
/** Whether to show description */
|
|
15
|
-
showDescription?: boolean;
|
|
16
|
-
/** Label text for the selector */
|
|
17
|
-
label?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Configuration selector component for switching between multiple graph configurations
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* const [selectedConfig, setSelectedConfig] = useState('simple-service');
|
|
25
|
-
*
|
|
26
|
-
* <ConfigurationSelector
|
|
27
|
-
* configurations={loadedConfigs}
|
|
28
|
-
* selectedConfig={selectedConfig}
|
|
29
|
-
* onConfigChange={setSelectedConfig}
|
|
30
|
-
* showDescription
|
|
31
|
-
* />
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare const ConfigurationSelector: React.FC<ConfigurationSelectorProps>;
|
|
35
|
-
//# sourceMappingURL=ConfigurationSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationSelector.d.ts","sourceRoot":"","sources":["../../src/components/ConfigurationSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,cAAc,EAAE,iBAAiB,EAAE,CAAC;IAEpC,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IAEvB,0CAA0C;IAC1C,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,kCAAkC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA2FtE,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Configuration selector component for switching between multiple graph configurations
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* const [selectedConfig, setSelectedConfig] = useState('simple-service');
|
|
8
|
-
*
|
|
9
|
-
* <ConfigurationSelector
|
|
10
|
-
* configurations={loadedConfigs}
|
|
11
|
-
* selectedConfig={selectedConfig}
|
|
12
|
-
* onConfigChange={setSelectedConfig}
|
|
13
|
-
* showDescription
|
|
14
|
-
* />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export const ConfigurationSelector = ({ configurations, selectedConfig, onConfigChange, className, style, showDescription = false, label = 'Graph Configuration', }) => {
|
|
18
|
-
const handleChange = (event) => {
|
|
19
|
-
onConfigChange(event.target.value);
|
|
20
|
-
};
|
|
21
|
-
const selectedConfigData = configurations.find((c) => c.name === selectedConfig);
|
|
22
|
-
const defaultStyle = {
|
|
23
|
-
backgroundColor: 'white',
|
|
24
|
-
padding: '12px 16px',
|
|
25
|
-
borderRadius: '8px',
|
|
26
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
27
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
28
|
-
...style,
|
|
29
|
-
};
|
|
30
|
-
const labelStyle = {
|
|
31
|
-
display: 'block',
|
|
32
|
-
fontSize: '14px',
|
|
33
|
-
fontWeight: 600,
|
|
34
|
-
marginBottom: '8px',
|
|
35
|
-
color: '#333',
|
|
36
|
-
};
|
|
37
|
-
const selectStyle = {
|
|
38
|
-
width: '100%',
|
|
39
|
-
padding: '8px 12px',
|
|
40
|
-
fontSize: '14px',
|
|
41
|
-
border: '1px solid #ddd',
|
|
42
|
-
borderRadius: '4px',
|
|
43
|
-
backgroundColor: 'white',
|
|
44
|
-
cursor: 'pointer',
|
|
45
|
-
outline: 'none',
|
|
46
|
-
transition: 'border-color 0.2s',
|
|
47
|
-
};
|
|
48
|
-
const infoStyle = {
|
|
49
|
-
marginTop: '8px',
|
|
50
|
-
fontSize: '12px',
|
|
51
|
-
color: '#666',
|
|
52
|
-
lineHeight: '1.5',
|
|
53
|
-
};
|
|
54
|
-
if (configurations.length === 0) {
|
|
55
|
-
return (_jsx("div", { className: className, style: defaultStyle, children: _jsx("div", { style: { ...labelStyle, color: '#999' }, children: "No configurations available" }) }));
|
|
56
|
-
}
|
|
57
|
-
return (_jsxs("div", { className: className, style: defaultStyle, children: [_jsx("label", { style: labelStyle, htmlFor: "config-selector", children: label }), _jsx("select", { id: "config-selector", value: selectedConfig, onChange: handleChange, style: selectStyle, onMouseEnter: (e) => {
|
|
58
|
-
e.currentTarget.style.borderColor = '#4A90E2';
|
|
59
|
-
}, onMouseLeave: (e) => {
|
|
60
|
-
e.currentTarget.style.borderColor = '#ddd';
|
|
61
|
-
}, children: configurations.map((config) => (_jsx("option", { value: config.name, children: config.config.metadata.name }, config.name))) }), selectedConfigData && showDescription && selectedConfigData.config.metadata.description && (_jsx("div", { style: infoStyle, children: _jsx("div", { children: selectedConfigData.config.metadata.description }) }))] }));
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=ConfigurationSelector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationSelector.js","sourceRoot":"","sources":["../../src/components/ConfigurationSelector.tsx"],"names":[],"mappings":";AA0BA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,KAAK,EACL,eAAe,GAAG,KAAK,EACvB,KAAK,GAAG,qBAAqB,GAC9B,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,CAAC,KAA2C,EAAE,EAAE;QACnE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;IAEjF,MAAM,YAAY,GAAwB;QACxC,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,WAAW;QACpB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,2BAA2B;QACtC,UAAU,EAAE,mEAAmE;QAC/E,GAAG,KAAK;KACT,CAAC;IAEF,MAAM,UAAU,GAAwB;QACtC,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,MAAM;KACd,CAAC;IAEF,MAAM,WAAW,GAAwB;QACvC,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,gBAAgB;QACxB,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,OAAO;QACxB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,mBAAmB;KAChC,CAAC;IAEF,MAAM,SAAS,GAAwB;QACrC,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,KAAK;KAClB,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/B,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,YAC5C,cAAK,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,4CAAmC,GAC3E,CACP,CAAC;KACH;IAED,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,aAC5C,gBAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAC,iBAAiB,YAChD,KAAK,GACA,EAER,iBACE,EAAE,EAAC,iBAAiB,EACpB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;oBAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;gBAChD,CAAC,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;oBAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC;gBAC7C,CAAC,YAEA,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC9B,iBAA0B,KAAK,EAAE,MAAM,CAAC,IAAI,YACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,IADjB,MAAM,CAAC,IAAI,CAEf,CACV,CAAC,GACK,EAER,kBAAkB,IAAI,eAAe,IAAI,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,CAC1F,cAAK,KAAK,EAAE,SAAS,YACnB,wBAAM,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,GAAO,GACvD,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|