@principal-ai/subsystems-react 0.20.5 → 0.21.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 +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/graphify/construct.d.ts +23 -0
- package/dist/graphify/construct.d.ts.map +1 -0
- package/dist/graphify/construct.js +77 -0
- package/dist/graphify/construct.js.map +1 -0
- package/dist/graphify/index.d.ts +2 -2
- package/dist/graphify/index.d.ts.map +1 -1
- package/dist/graphify/index.js +1 -1
- package/dist/graphify/index.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/pierre/PierreWalkthroughCodeView.d.ts +22 -0
- package/dist/pierre/PierreWalkthroughCodeView.d.ts.map +1 -0
- package/dist/pierre/PierreWalkthroughCodeView.js +198 -0
- 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/ComponentDeclaration.js +1 -1
- package/dist/subsystem/ComponentDeclaration.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 +220 -194
- 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 +109 -42
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +107 -5
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +43 -18
- 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/graphify/{kind.test.ts → construct.test.ts} +20 -20
- package/src/graphify/{kind.ts → construct.ts} +17 -17
- package/src/graphify/index.ts +5 -2
- package/src/index.ts +20 -9
- 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 +16 -20
- 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 +254 -0
- 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/ComponentDeclaration.tsx +1 -1
- package/src/subsystem/FileDrawer.tsx +2 -2
- package/src/subsystem/SubsystemComponentGraph.tsx +284 -254
- package/src/subsystem/formatDeclaration.test.ts +76 -1
- package/src/subsystem/formatDeclaration.ts +57 -33
- package/src/subsystem/model.test.ts +49 -15
- package/src/subsystem/model.ts +210 -51
- package/src/subsystem/nodes.tsx +63 -22
- package/src/subsystem/tokenizeComponent.ts +2 -2
|
@@ -12,28 +12,29 @@
|
|
|
12
12
|
* injection, onNodeClick) adapted to the subsystem model — read-only.
|
|
13
13
|
*/
|
|
14
14
|
import type { ReactNode } from 'react';
|
|
15
|
-
import { type SubsystemComponentEdge, type SubsystemComponent, type
|
|
15
|
+
import { type SubsystemComponentEdge, type SubsystemComponent, type SubsystemRelation, type SubsystemWalkthrough } from './model';
|
|
16
16
|
import type { SubsystemOpenFileOptions } from './declarationRef';
|
|
17
17
|
import type { ComponentVerificationState } from './ComponentDeclaration';
|
|
18
|
-
/** Context passed to `
|
|
19
|
-
export interface
|
|
20
|
-
|
|
18
|
+
/** Context passed to `renderWalkthroughViewer` when a flow/step is focused. */
|
|
19
|
+
export interface WalkthroughViewerContext {
|
|
20
|
+
walkthrough: SubsystemWalkthrough;
|
|
21
21
|
/** Focused step index; `null` means the whole flow (no specific step). */
|
|
22
22
|
stepIndex: number | null;
|
|
23
23
|
}
|
|
24
24
|
export interface SubsystemComponentGraphProps {
|
|
25
25
|
components: SubsystemComponent[];
|
|
26
|
-
edges
|
|
26
|
+
/** Topology relations (structural / module / type). Display edges are derived with walkthrough hops. */
|
|
27
|
+
relations: SubsystemRelation[];
|
|
27
28
|
/**
|
|
28
|
-
* Ordered
|
|
29
|
-
*
|
|
30
|
-
* the flows panel lists each
|
|
29
|
+
* Ordered runtime walkthroughs — one walkthrough per flow. When present the
|
|
30
|
+
* sidebar's bottom half offers a Files/Walkthroughs toggle:
|
|
31
|
+
* the flows panel lists each walkthrough's steps (`symbol` or `file:line`);
|
|
31
32
|
* clicking a flow row toggles its steps; clicking a step focuses that
|
|
32
|
-
* step's edge and (when `
|
|
33
|
+
* step's edge and (when `renderWalkthroughViewer` is set) opens the bottom
|
|
33
34
|
* drawer on that flow's snippets. Opened flows stay on the canvas
|
|
34
35
|
* (unselected ones dimmed); everything else is hidden.
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
walkthroughs?: SubsystemWalkthrough[];
|
|
37
38
|
onSelect?: (componentId: string) => void;
|
|
38
39
|
/** Called when an edge is clicked (relationship / mechanism + refs seam). */
|
|
39
40
|
onEdgeSelect?: (edge: SubsystemComponentEdge) => void;
|
|
@@ -46,29 +47,29 @@ export interface SubsystemComponentGraphProps {
|
|
|
46
47
|
title?: string;
|
|
47
48
|
/**
|
|
48
49
|
* Suppresses the sidebar entirely (title, description, file tree,
|
|
49
|
-
*
|
|
50
|
+
* walkthroughs) for graph-only embeds. Pair with `graphTitle` to keep the
|
|
50
51
|
* subsystem name visible as an overlay on the canvas.
|
|
51
52
|
*/
|
|
52
53
|
hideSidebar?: boolean;
|
|
53
54
|
/**
|
|
54
|
-
* How
|
|
55
|
+
* How walkthrough step highlighting behaves on the canvas.
|
|
55
56
|
* - `focus` (default): zoom to the step, hide non-participants, open drawer
|
|
56
57
|
* - `dim`: keep the full graph, dim non-participants (same as hovering a step)
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
+
walkthroughStepMode?: 'focus' | 'dim';
|
|
59
60
|
/**
|
|
60
|
-
* When true, cycles
|
|
61
|
-
* (no zoom, no drawer). Loops across all
|
|
61
|
+
* When true, cycles walkthrough steps automatically using `dim` highlighting
|
|
62
|
+
* (no zoom, no drawer). Loops across all walkthroughs that have steps.
|
|
62
63
|
* Useful for graph-only embeds (`hideSidebar`).
|
|
63
64
|
*/
|
|
64
|
-
|
|
65
|
+
autoPlayWalkthroughs?: boolean;
|
|
65
66
|
/** Pause between autoplay steps in ms. @default 2500 */
|
|
66
|
-
|
|
67
|
+
walkthroughAutoPlayIntervalMs?: number;
|
|
67
68
|
/**
|
|
68
|
-
* When false, focusing a
|
|
69
|
+
* When false, focusing a walkthrough/step does not call `fitView`.
|
|
69
70
|
* @default true
|
|
70
71
|
*/
|
|
71
|
-
|
|
72
|
+
zoomOnWalkthroughFocus?: boolean;
|
|
72
73
|
/**
|
|
73
74
|
* Subsystem title rendered as a non-interactive overlay chip on the graph
|
|
74
75
|
* canvas (top-center). Does not trigger the sidebar — for graph-only
|
|
@@ -76,11 +77,11 @@ export interface SubsystemComponentGraphProps {
|
|
|
76
77
|
*/
|
|
77
78
|
graphTitle?: string;
|
|
78
79
|
/**
|
|
79
|
-
* When true, shows the active
|
|
80
|
+
* When true, shows the active walkthrough's title as a non-interactive
|
|
80
81
|
* overlay chip on the canvas (under `graphTitle` when both are set).
|
|
81
|
-
* Uses the focused or hover-highlighted
|
|
82
|
+
* Uses the focused or hover-highlighted walkthrough.
|
|
82
83
|
*/
|
|
83
|
-
|
|
84
|
+
showWalkthroughTitle?: boolean;
|
|
84
85
|
/** Markdown description rendered in the sidebar. */
|
|
85
86
|
description?: string;
|
|
86
87
|
/** Rendered over the graph canvas only (not the title/legend sidebar). */
|
|
@@ -96,11 +97,11 @@ export interface SubsystemComponentGraphProps {
|
|
|
96
97
|
*/
|
|
97
98
|
renderFileViewer?: (file: string, opts?: SubsystemOpenFileOptions) => ReactNode;
|
|
98
99
|
/**
|
|
99
|
-
* Host-injected multi-snippet viewer for a focused
|
|
100
|
+
* Host-injected multi-snippet viewer for a focused walkthrough. When set,
|
|
100
101
|
* clicking a flow step opens the bottom drawer with this content and
|
|
101
102
|
* updates it as the focused step changes.
|
|
102
103
|
*/
|
|
103
|
-
|
|
104
|
+
renderWalkthroughViewer?: (ctx: WalkthroughViewerContext) => ReactNode;
|
|
104
105
|
/**
|
|
105
106
|
* Legacy component-keyed variant, kept for backward compatibility. When
|
|
106
107
|
* `renderFileViewer` is absent, drawer content resolves via the first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAqBtE,OAAO,
|
|
1
|
+
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAqBtE,OAAO,EAOL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAKjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAYzE,+EAA+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,oBAAoB,CAAC;IAClC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAMD,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,wGAAwG;IACxG,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,oBAAoB,EAAE,CA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