@principal-ai/subsystems-react 0.56.26 → 0.56.27
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/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +65 -22
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/model.d.ts +7 -0
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +27 -0
- package/dist/subsystem/model.js.map +1 -1
- package/package.json +1 -1
- package/src/subsystem/SubsystemComponentGraph.tsx +102 -40
- package/src/subsystem/model.collapse.test.ts +35 -1
- package/src/subsystem/model.ts +28 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBtE,OAAO,EAgBL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAI9B,KAAK,sBAAsB,EAE3B,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;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;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,oBAAoB,CAAC;KAC3B,KAAK,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACjE;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;IACjE;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAsnGD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAoN1E"}
|
|
@@ -20,7 +20,7 @@ import { ReactFlow, ReactFlowProvider, useReactFlow, useViewport, applyNodeChang
|
|
|
20
20
|
import { useTheme } from '@principal-ade/industry-theme';
|
|
21
21
|
import { SUBSYSTEM_MODEL_DESCRIPTION_MAX } from '@principal-ai/subsystems-core';
|
|
22
22
|
import { ArrowDown, ArrowRight, Boxes, Files, Route, Unlink, X } from 'lucide-react';
|
|
23
|
-
import { buildSubsystemGraph, deriveGraphEdges, buildBoundaryLayoutGroups, isCardFrame, isConstructsOnlyModel, packageColor, moduleGroupNodeId, processGroupNodeId, isTrailMechanism, edgeColor, MECHANISM_DESCRIPTIONS, subsystemGraphLayoutKey, trailStepGraphEdgeId, unroutedEdgeIds, } from './model';
|
|
23
|
+
import { buildSubsystemGraph, deriveGraphEdges, buildBoundaryLayoutGroups, cardFramesForAliases, isCardFrame, isConstructsOnlyModel, packageColor, moduleGroupNodeId, processGroupNodeId, isTrailMechanism, edgeColor, MECHANISM_DESCRIPTIONS, subsystemGraphLayoutKey, trailStepGraphEdgeId, unroutedEdgeIds, } from './model';
|
|
24
24
|
import { ConstructsCatalog } from './ConstructsCatalog';
|
|
25
25
|
import { ContainersPanel } from './ContainersPanel';
|
|
26
26
|
import { technologyBrand } from './techIcons';
|
|
@@ -227,7 +227,39 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
227
227
|
// every card frame takes, `toggledGroupIds` the frames flipped away from it.
|
|
228
228
|
const [framesCollapsed, setFramesCollapsed] = useState(() => persisted.framesCollapsed ?? defaultFramesCollapsed);
|
|
229
229
|
const [toggledGroupIds, setToggledGroupIds] = useState(() => new Set(persisted.toggledFrames ?? []));
|
|
230
|
-
|
|
230
|
+
// Picking a trail opens the container cards that hold its cast, so the flow
|
|
231
|
+
// reads as its components instead of a row of folded boxes. Derived rather
|
|
232
|
+
// than written into the user's frame state: clearing the trail — or moving to
|
|
233
|
+
// another — restores exactly the frames they had open before.
|
|
234
|
+
const trailFrameIds = useMemo(() => {
|
|
235
|
+
if (!layoutTrailId)
|
|
236
|
+
return new Set();
|
|
237
|
+
const trail = (trails ?? []).find((t) => t.id === layoutTrailId);
|
|
238
|
+
if (!trail)
|
|
239
|
+
return new Set();
|
|
240
|
+
const aliases = new Set();
|
|
241
|
+
for (const step of trail.steps) {
|
|
242
|
+
aliases.add(step.from);
|
|
243
|
+
aliases.add(step.to);
|
|
244
|
+
}
|
|
245
|
+
return cardFramesForAliases({ components }, aliases, { showSingletonFrames, moduleNesting, codeProcessKeys });
|
|
246
|
+
}, [layoutTrailId, trails, components, showSingletonFrames, moduleNesting, codeProcessKeys]);
|
|
247
|
+
// `framesCollapsed` is the default every card takes; a toggled id is the
|
|
248
|
+
// exception. Opening a trail's frames therefore means adding them to the
|
|
249
|
+
// default-collapsed set (or removing them from the default-open one).
|
|
250
|
+
const effectiveToggledGroupIds = useMemo(() => {
|
|
251
|
+
if (trailFrameIds.size === 0)
|
|
252
|
+
return toggledGroupIds;
|
|
253
|
+
const next = new Set(toggledGroupIds);
|
|
254
|
+
for (const id of trailFrameIds) {
|
|
255
|
+
if (framesCollapsed)
|
|
256
|
+
next.add(id);
|
|
257
|
+
else
|
|
258
|
+
next.delete(id);
|
|
259
|
+
}
|
|
260
|
+
return next;
|
|
261
|
+
}, [toggledGroupIds, trailFrameIds, framesCollapsed]);
|
|
262
|
+
const [committedCollapsed, setCommittedCollapsed] = useState({ framesCollapsed, toggled: effectiveToggledGroupIds });
|
|
231
263
|
const toggleCollapsed = useCallback((groupId) => {
|
|
232
264
|
setToggledGroupIds((prev) => {
|
|
233
265
|
const next = new Set(prev);
|
|
@@ -242,7 +274,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
242
274
|
setFramesCollapsed(collapsed);
|
|
243
275
|
setToggledGroupIds(new Set());
|
|
244
276
|
}, []);
|
|
245
|
-
const collapsedKey = `${framesCollapsed ? 'closed' : 'open'}:${Array.from(
|
|
277
|
+
const collapsedKey = `${framesCollapsed ? 'closed' : 'open'}:${Array.from(effectiveToggledGroupIds).sort().join(',')}`;
|
|
246
278
|
const committedCollapsedKey = `${committedCollapsed.framesCollapsed ? 'closed' : 'open'}:${Array.from(committedCollapsed.toggled).sort().join(',')}`;
|
|
247
279
|
const changeLayoutDirection = useCallback((next) => {
|
|
248
280
|
if (next === requestedDirection)
|
|
@@ -284,7 +316,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
284
316
|
if (reduceMotion) {
|
|
285
317
|
setCommittedDirection(requestedDirection);
|
|
286
318
|
setCommittedTrailId(layoutTrailId);
|
|
287
|
-
setCommittedCollapsed({ framesCollapsed, toggled:
|
|
319
|
+
setCommittedCollapsed({ framesCollapsed, toggled: effectiveToggledGroupIds });
|
|
288
320
|
return;
|
|
289
321
|
}
|
|
290
322
|
flipSawPendingLayoutRef.current = false;
|
|
@@ -293,7 +325,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
293
325
|
flipFadeTimerRef.current = null;
|
|
294
326
|
setCommittedDirection(requestedDirection);
|
|
295
327
|
setCommittedTrailId(layoutTrailId);
|
|
296
|
-
setCommittedCollapsed({ framesCollapsed, toggled:
|
|
328
|
+
setCommittedCollapsed({ framesCollapsed, toggled: effectiveToggledGroupIds });
|
|
297
329
|
}, LAYOUT_FLIP_EDGE_MS);
|
|
298
330
|
return () => {
|
|
299
331
|
if (flipFadeTimerRef.current != null) {
|
|
@@ -308,7 +340,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
308
340
|
requestedDirection,
|
|
309
341
|
layoutTrailId,
|
|
310
342
|
framesCollapsed,
|
|
311
|
-
|
|
343
|
+
effectiveToggledGroupIds,
|
|
312
344
|
]);
|
|
313
345
|
// Beat 3: the committed layout has settled → the node slide is over, fade
|
|
314
346
|
// the edges back in. The ref keeps the OLD `layoutReady` (still true until
|
|
@@ -2568,6 +2600,32 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
2568
2600
|
focusedTrail &&
|
|
2569
2601
|
renderTrailViewer ? (_jsx(TrailDrawerContent, { render: renderTrailDrawerContent, trail: focusedTrail, stepIndex: drawerTarget.stepIndex, onOpenFile: onOpenFileFromTrail, resolveSymbol: resolveTrailSymbol, onSymbolClick: openConstructDeclaration, onVisibleStepChange: setVisibleStepIndex })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine, endLine: drawerTarget.endLine })) : null }), committedDirection !== 'vertical' && fileOverlayView, !transparentCanvas && _jsx(GraphLayoutCover, { revealed: layoutReady || layoutFlipping }), canvasOverlay, liveEvents ? _jsx(MaintainLivePanel, { ...liveEvents }) : null] })] }));
|
|
2570
2602
|
}
|
|
2603
|
+
/**
|
|
2604
|
+
* One option in the header's segmented sidebar-view switch. Owns the hover
|
|
2605
|
+
* state so every segment reacts the same way — the Issues segment is a
|
|
2606
|
+
* `SubsystemDiagnosticToggle` and already hovers; keeping the plain options
|
|
2607
|
+
* here means the switch has one hover affordance, not two.
|
|
2608
|
+
*/
|
|
2609
|
+
function SidebarViewOption({ active, ariaLabel, title, onClick, children, }) {
|
|
2610
|
+
const { theme } = useTheme();
|
|
2611
|
+
const [hover, setHover] = useState(false);
|
|
2612
|
+
return (_jsx("button", { type: "button", "aria-label": ariaLabel, title: title, "aria-pressed": active, onClick: onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: {
|
|
2613
|
+
display: 'inline-flex',
|
|
2614
|
+
alignItems: 'center',
|
|
2615
|
+
justifyContent: 'center',
|
|
2616
|
+
gap: 4,
|
|
2617
|
+
height: 28,
|
|
2618
|
+
padding: '4px 16px',
|
|
2619
|
+
fontFamily: theme.fonts.monospace,
|
|
2620
|
+
fontSize: theme.fontSizes[0],
|
|
2621
|
+
border: 'none',
|
|
2622
|
+
borderRadius: 4,
|
|
2623
|
+
background: active || hover ? theme.colors.border : 'transparent',
|
|
2624
|
+
color: active ? theme.colors.text : (theme.colors.textMuted ?? theme.colors.textSecondary),
|
|
2625
|
+
cursor: 'pointer',
|
|
2626
|
+
transition: 'background 120ms ease',
|
|
2627
|
+
}, children: children }));
|
|
2628
|
+
}
|
|
2571
2629
|
export function SubsystemComponentGraph(props) {
|
|
2572
2630
|
const { theme } = useTheme();
|
|
2573
2631
|
const wrapRef = useRef(null);
|
|
@@ -2617,21 +2675,6 @@ export function SubsystemComponentGraph(props) {
|
|
|
2617
2675
|
props.diagnostic?.onToggle?.();
|
|
2618
2676
|
}
|
|
2619
2677
|
};
|
|
2620
|
-
const viewButtonStyle = (active) => ({
|
|
2621
|
-
display: 'inline-flex',
|
|
2622
|
-
alignItems: 'center',
|
|
2623
|
-
justifyContent: 'center',
|
|
2624
|
-
gap: 4,
|
|
2625
|
-
height: 28,
|
|
2626
|
-
padding: '4px 16px',
|
|
2627
|
-
fontFamily: theme.fonts.monospace,
|
|
2628
|
-
fontSize: theme.fontSizes[0],
|
|
2629
|
-
border: 'none',
|
|
2630
|
-
borderRadius: 4,
|
|
2631
|
-
background: active ? theme.colors.border : 'transparent',
|
|
2632
|
-
color: active ? theme.colors.text : (theme.colors.textMuted ?? theme.colors.textSecondary),
|
|
2633
|
-
cursor: 'pointer',
|
|
2634
|
-
});
|
|
2635
2678
|
useEffect(() => {
|
|
2636
2679
|
if (props.initialTrailId)
|
|
2637
2680
|
setFilesOpen(false);
|
|
@@ -2691,6 +2734,6 @@ export function SubsystemComponentGraph(props) {
|
|
|
2691
2734
|
padding: 2,
|
|
2692
2735
|
border: `1px solid ${theme.colors.border}`,
|
|
2693
2736
|
borderRadius: 6,
|
|
2694
|
-
}, children: [containerCount > 0 && (_jsxs(
|
|
2737
|
+
}, children: [containerCount > 0 && (_jsxs(SidebarViewOption, { ariaLabel: `Containers (${containerCount} ${containerCount === 1 ? 'container' : 'containers'})`, title: "Show containers", active: containersActive, onClick: () => selectSidebarView('containers'), children: [_jsx(Boxes, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Containers" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: containerCount })] })), _jsxs(SidebarViewOption, { ariaLabel: sidebarScope.trail ? 'Trail' : `Trails (${trailCount} ${trailCount === 1 ? 'trail' : 'trails'})`, active: !filesActive && !containersActive && !issuesActive, onClick: () => selectSidebarView('trails'), children: [_jsx(Route, { size: 14, "aria-hidden": true }), _jsx("span", { children: trailViewLabel }), !sidebarScope.trail && _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: trailCount })] }), hasFiles && (_jsxs(SidebarViewOption, { ariaLabel: `Files (${fileCount} files)`, title: "Show files", active: filesActive, onClick: () => selectSidebarView('files'), children: [_jsx(Files, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Files" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: fileCount })] })), hasIssues && (_jsx(SubsystemDiagnosticToggle, { ...sidebarDiagnostic, labelText: "Issues", segmented: true, active: issuesActive, onToggle: () => selectSidebarView('issues') }))] }), props.headerActions] })), _jsx("div", { ref: wrapRef, style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: constructsOnly ? (_jsx(ConstructsCatalog, { components: props.components, onSelect: props.onSelect, title: props.title, hideSidebar: props.hideSidebar, description: props.description, notes: props.notes, descriptionOpen: props.descriptionOpen, onDescriptionOpenChange: props.onDescriptionOpenChange, diagnostic: props.diagnostic, sidebarExtra: props.headerActions ? _jsxs(_Fragment, { children: [props.headerActions, props.sidebarExtra] }) : props.sidebarExtra, sidebarAfterDescription: props.sidebarAfterDescription, renderFileViewer: props.renderFileViewer, onFileSelect: props.onFileSelect, componentVerification: props.componentVerification, onInspectSymbol: props.onInspectSymbol })) : (_jsx(ReactFlowProvider, { children: _jsx(Inner, { ...props, showIssues: issuesActive, filesActive: filesActive, containersActive: containersActive, measured: size, sidebarScope: sidebarScope, onSidebarTrailChange: setSidebarTrailId }) })) })] }));
|
|
2695
2738
|
}
|
|
2696
2739
|
//# sourceMappingURL=SubsystemComponentGraph.js.map
|