@principal-ai/subsystems-react 0.21.1 → 0.23.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/dist/graphify/consolidated.d.ts +5 -24
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/graphify/index.d.ts +1 -1
- package/dist/graphify/index.d.ts.map +1 -1
- package/dist/graphify/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pierre/PierreFileView.d.ts +3 -1
- package/dist/pierre/PierreFileView.d.ts.map +1 -1
- package/dist/pierre/PierreFileView.js +13 -3
- package/dist/pierre/PierreFileView.js.map +1 -1
- package/dist/pierre/PierreSnippetView.d.ts.map +1 -1
- package/dist/pierre/PierreSnippetView.js +5 -26
- package/dist/pierre/PierreSnippetView.js.map +1 -1
- package/dist/pierre/PierreWalkthroughCodeView.d.ts +3 -1
- package/dist/pierre/PierreWalkthroughCodeView.d.ts.map +1 -1
- package/dist/pierre/PierreWalkthroughCodeView.js +65 -8
- package/dist/pierre/PierreWalkthroughCodeView.js.map +1 -1
- package/dist/pierre/constructColors.d.ts.map +1 -1
- package/dist/pierre/constructColors.js +0 -5
- package/dist/pierre/constructColors.js.map +1 -1
- package/dist/pierre/index.d.ts +1 -1
- package/dist/pierre/index.d.ts.map +1 -1
- package/dist/pierre/index.js +1 -1
- package/dist/pierre/index.js.map +1 -1
- package/dist/pierre/scrollAnchor.d.ts +2 -0
- package/dist/pierre/scrollAnchor.d.ts.map +1 -1
- package/dist/pierre/scrollAnchor.js +7 -0
- package/dist/pierre/scrollAnchor.js.map +1 -1
- package/dist/pierre/sliceSnippet.d.ts +6 -0
- package/dist/pierre/sliceSnippet.d.ts.map +1 -1
- package/dist/pierre/sliceSnippet.js +25 -0
- package/dist/pierre/sliceSnippet.js.map +1 -1
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -1
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +0 -4
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -1
- package/dist/subsystem/FileDrawer.d.ts +7 -2
- package/dist/subsystem/FileDrawer.d.ts.map +1 -1
- package/dist/subsystem/FileDrawer.js +13 -9
- package/dist/subsystem/FileDrawer.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +2 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +97 -8
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/declarationRef.d.ts +6 -1
- package/dist/subsystem/declarationRef.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +0 -15
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/model.d.ts +61 -22
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +185 -65
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts +3 -4
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +5 -6
- package/dist/subsystem/nodes.js.map +1 -1
- package/dist/utils/elkLayout.d.ts +6 -4
- package/dist/utils/elkLayout.d.ts.map +1 -1
- package/dist/utils/elkLayout.js +144 -54
- package/dist/utils/elkLayout.js.map +1 -1
- package/package.json +3 -3
- package/src/graphify/consolidated.ts +4 -26
- package/src/graphify/index.ts +0 -2
- package/src/index.ts +0 -2
- package/src/pierre/PierreFileView.tsx +25 -2
- package/src/pierre/PierreSnippetView.tsx +5 -31
- package/src/pierre/PierreWalkthroughCodeView.tsx +110 -5
- package/src/pierre/constructColors.test.ts +1 -2
- package/src/pierre/constructColors.ts +0 -5
- package/src/pierre/index.ts +1 -1
- package/src/pierre/scrollAnchor.ts +13 -0
- package/src/pierre/sliceSnippet.test.ts +44 -1
- package/src/pierre/sliceSnippet.ts +28 -0
- package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +0 -31
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +2 -46
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +9 -24
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +2 -2
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +2 -1
- package/src/stories/Subsystem/ComponentGraph/Modules.stories.tsx +287 -0
- package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +1 -1
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +6 -6
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +0 -4
- package/src/subsystem/FileDrawer.tsx +19 -7
- package/src/subsystem/SubsystemComponentGraph.tsx +153 -7
- package/src/subsystem/declarationRef.ts +6 -1
- package/src/subsystem/formatDeclaration.ts +0 -19
- package/src/subsystem/model.test.ts +190 -9
- package/src/subsystem/model.ts +219 -77
- package/src/subsystem/nodes.tsx +6 -6
- package/src/utils/elkLayout.ts +148 -58
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceSnippet.d.ts","sourceRoot":"","sources":["../../src/pierre/sliceSnippet.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,CAcd"}
|
|
1
|
+
{"version":3,"file":"sliceSnippet.d.ts","sourceRoot":"","sources":["../../src/pierre/sliceSnippet.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,YAAY,CAcd;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,WAAW,EAC1B,UAAU,EAAE,MAAM,GACjB,IAAI,CAkBN"}
|
|
@@ -13,4 +13,29 @@ export function sliceSnippetWindow(contents, startLine, endLine, contextLines, f
|
|
|
13
13
|
focusOffset: focusLine == null ? null : Math.max(1, focusLine - sliceStart + 1),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Remap Pierre gutter numbers from slice-local (1-based) to absolute file lines.
|
|
18
|
+
* Pierre numbers whatever `contents` it receives starting at 1; sliced snippets
|
|
19
|
+
* need `sliceStart` applied so the gutter matches the source file.
|
|
20
|
+
*/
|
|
21
|
+
export function remapSnippetLineNumbers(fileContainer, sliceStart) {
|
|
22
|
+
const lineNumberOffset = sliceStart - 1;
|
|
23
|
+
if (lineNumberOffset === 0)
|
|
24
|
+
return;
|
|
25
|
+
const root = fileContainer.shadowRoot ?? fileContainer;
|
|
26
|
+
const items = root.querySelectorAll('[data-column-number][data-line-index]');
|
|
27
|
+
items.forEach((el) => {
|
|
28
|
+
const idxStr = el.dataset.lineIndex;
|
|
29
|
+
if (idxStr == null)
|
|
30
|
+
return;
|
|
31
|
+
const idx = Number.parseInt(idxStr, 10);
|
|
32
|
+
if (Number.isNaN(idx))
|
|
33
|
+
return;
|
|
34
|
+
const display = String(idx + 1 + lineNumberOffset);
|
|
35
|
+
const span = el.querySelector('[data-line-number-content]');
|
|
36
|
+
if (span && span.textContent !== display) {
|
|
37
|
+
span.textContent = display;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
16
41
|
//# sourceMappingURL=sliceSnippet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceSnippet.js","sourceRoot":"","sources":["../../src/pierre/sliceSnippet.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAUhF,MAAM,UAAU,kBAAkB,CAChC,QAAgB,EAChB,SAAiB,EACjB,OAAe,EACf,YAAoB,EACpB,SAAyB;IAEzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC;IACzD,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC7D,UAAU;QACV,QAAQ;QACR,WAAW,EACT,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,CAA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5G,oBAAoB,CAYtB;AAED,6EAA6E;AAC7E,wBAAgB,KAAK,CACnB,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GACvG,sBAAsB,EAAE,CAQ1B;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GACvG;IAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAAC,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE,CA6B3E;AAED,eAAO,MAAM,YAAY,EAAE,uBAY1B,CAAC;AAMF,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,EAuDzD,CAAC;AASF,eAAO,MAAM,wBAAwB,qBAA4B,CAAC;AAClE,eAAO,MAAM,2BAA2B,oCAA+B,CAAC;AAExE,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,EAAE,sBAAsB,EAKvD,CAAC"}
|
|
@@ -16,16 +16,12 @@ export function components(spec) {
|
|
|
16
16
|
}
|
|
17
17
|
const RELATION_TYPES = new Set([
|
|
18
18
|
'imports',
|
|
19
|
-
'imports_from',
|
|
20
|
-
're_exports',
|
|
21
|
-
'defines',
|
|
22
19
|
'extends',
|
|
23
20
|
'inherits',
|
|
24
21
|
'implements',
|
|
25
22
|
'mixes_in',
|
|
26
23
|
'method',
|
|
27
24
|
'references',
|
|
28
|
-
'contains',
|
|
29
25
|
]);
|
|
30
26
|
export function relations(spec) {
|
|
31
27
|
return spec.map(([from, to, relationType, refs], i) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../../src/stories/Subsystem/ComponentGraph/fixtures.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,8EAA8E;AAC9E,wDAAwD;AACxD,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CACxB,IAAyL;IAEzL,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,EAAE;QACF,IAAI;QACJ,SAAS;QACT,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,MAAM;QACN,WAAW;KACZ,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,SAAS;IACT,
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../../src/stories/Subsystem/ComponentGraph/fixtures.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,8EAA8E;AAC9E,wDAAwD;AACxD,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CACxB,IAAyL;IAEzL,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,EAAE;QACF,IAAI;QACJ,SAAS;QACT,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,MAAM;QACN,WAAW;KACZ,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,SAAS;IACT,SAAS;IACT,UAAU;IACV,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,YAAY;CACb,CAAC,CA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,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;aACxC;YACD,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gCAAgC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;YAC3F,YAAY,EAAE,EAAE;SACiB;KACpC;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,kBAAkB,CAAC;IACzC,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3B,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3B,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;IACzB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC,SAAS,CAAC;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC,YAAY,CAAC;AAExE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAA6B,KAAK,CAAC;IAClE,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3B,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3B,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;IACzB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;CAC3B,CAAC,CAAC"}
|
|
@@ -10,11 +10,16 @@ import type { ReactNode } from 'react';
|
|
|
10
10
|
export declare const FILE_DRAWER_HEIGHT_MS = 200;
|
|
11
11
|
/** Bottom panel that slides up from the bottom of the graph area.
|
|
12
12
|
* Sits in normal flow (canvas shrinks while open, nothing covered)
|
|
13
|
-
* and animates via height; stays mounted so open/close animates.
|
|
14
|
-
|
|
13
|
+
* and animates via height; stays mounted so open/close animates.
|
|
14
|
+
* `fillHeight` expands to the full graph column (for whole-file reading). */
|
|
15
|
+
export declare function FileDrawer({ title, onClose, fillHeight, suppressEscape, children, }: {
|
|
15
16
|
/** Drawer chrome title; `null` closes the drawer. */
|
|
16
17
|
title: string | null;
|
|
17
18
|
onClose: () => void;
|
|
19
|
+
/** When true and open, fill the graph column instead of ~45% height. */
|
|
20
|
+
fillHeight?: boolean;
|
|
21
|
+
/** Skip Escape handling (e.g. while a full-file overlay is on top). */
|
|
22
|
+
suppressEscape?: boolean;
|
|
18
23
|
children?: ReactNode;
|
|
19
24
|
}): import("react").JSX.Element;
|
|
20
25
|
//# sourceMappingURL=FileDrawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDrawer.d.ts","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;2EAC2E;AAC3E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"FileDrawer.d.ts","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;2EAC2E;AAC3E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;8EAG8E;AAC9E,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,UAAkB,EAClB,cAAsB,EACtB,QAAQ,GACT,EAAE;IACD,qDAAqD;IACrD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wEAAwE;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BAsFA"}
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* declaration links, and walkthrough step focus; content is injected as
|
|
6
6
|
* children by the graph component.
|
|
7
7
|
*/
|
|
8
|
-
import { useEffect } from 'react';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
9
|
import { useTheme } from '@principal-ade/industry-theme';
|
|
10
10
|
import { X } from 'lucide-react';
|
|
11
11
|
/** Matches `transition: height …` below — callers that fitView after open
|
|
@@ -13,13 +13,15 @@ import { X } from 'lucide-react';
|
|
|
13
13
|
export const FILE_DRAWER_HEIGHT_MS = 200;
|
|
14
14
|
/** Bottom panel that slides up from the bottom of the graph area.
|
|
15
15
|
* Sits in normal flow (canvas shrinks while open, nothing covered)
|
|
16
|
-
* and animates via height; stays mounted so open/close animates.
|
|
17
|
-
|
|
16
|
+
* and animates via height; stays mounted so open/close animates.
|
|
17
|
+
* `fillHeight` expands to the full graph column (for whole-file reading). */
|
|
18
|
+
export function FileDrawer({ title, onClose, fillHeight = false, suppressEscape = false, children, }) {
|
|
18
19
|
const { theme } = useTheme();
|
|
19
20
|
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
20
21
|
const open = title !== null;
|
|
22
|
+
const [closeHover, setCloseHover] = useState(false);
|
|
21
23
|
useEffect(() => {
|
|
22
|
-
if (!open)
|
|
24
|
+
if (!open || suppressEscape)
|
|
23
25
|
return;
|
|
24
26
|
const onKey = (e) => {
|
|
25
27
|
if (e.key === 'Escape')
|
|
@@ -27,14 +29,15 @@ export function FileDrawer({ title, onClose, children, }) {
|
|
|
27
29
|
};
|
|
28
30
|
window.addEventListener('keydown', onKey);
|
|
29
31
|
return () => window.removeEventListener('keydown', onKey);
|
|
30
|
-
}, [open, onClose]);
|
|
32
|
+
}, [open, onClose, suppressEscape]);
|
|
31
33
|
return (_jsxs("div", { style: {
|
|
32
34
|
position: 'relative',
|
|
33
35
|
// Above the absolute edge-label overlay (zIndex 5), which spans the
|
|
34
36
|
// whole graph-area container including this panel's slice.
|
|
35
37
|
zIndex: 6,
|
|
36
38
|
flexShrink: 0,
|
|
37
|
-
|
|
39
|
+
flex: open && fillHeight ? 1 : undefined,
|
|
40
|
+
height: open ? (fillHeight ? undefined : '45%') : 0,
|
|
38
41
|
minHeight: 0,
|
|
39
42
|
overflow: 'hidden',
|
|
40
43
|
display: 'flex',
|
|
@@ -58,7 +61,7 @@ export function FileDrawer({ title, onClose, children, }) {
|
|
|
58
61
|
fontFamily: theme.fonts.monospace,
|
|
59
62
|
fontSize: theme.fontSizes[0],
|
|
60
63
|
color: muted,
|
|
61
|
-
}, children: title }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close file", style: {
|
|
64
|
+
}, children: title }), _jsx("button", { type: "button", onClick: onClose, onMouseEnter: () => setCloseHover(true), onMouseLeave: () => setCloseHover(false), "aria-label": "Close file", style: {
|
|
62
65
|
display: 'inline-flex',
|
|
63
66
|
alignItems: 'center',
|
|
64
67
|
justifyContent: 'center',
|
|
@@ -67,9 +70,10 @@ export function FileDrawer({ title, onClose, children, }) {
|
|
|
67
70
|
padding: 0,
|
|
68
71
|
border: 'none',
|
|
69
72
|
borderRadius: 4,
|
|
70
|
-
background: 'transparent',
|
|
71
|
-
color: theme.colors.text,
|
|
73
|
+
background: closeHover ? theme.colors.border : 'transparent',
|
|
74
|
+
color: closeHover ? theme.colors.text : muted,
|
|
72
75
|
cursor: 'pointer',
|
|
76
|
+
transition: 'background 120ms ease, color 120ms ease',
|
|
73
77
|
}, children: _jsx(X, { size: 14 }) })] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: children })] }));
|
|
74
78
|
}
|
|
75
79
|
//# sourceMappingURL=FileDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDrawer.js","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CA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Y,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EACvC,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,gBAC7B,YAAY,EACvB,KAAK,EAAE;4BACL,OAAO,EAAE,aAAa;4BACtB,UAAU,EAAE,QAAQ;4BACpB,cAAc,EAAE,QAAQ;4BACxB,KAAK,EAAE,EAAE;4BACT,MAAM,EAAE,EAAE;4BACV,OAAO,EAAE,CAAC;4BACV,MAAM,EAAE,MAAM;4BACd,YAAY,EAAE,CAAC;4BACf,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa;4BAC5D,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;4BAC7C,MAAM,EAAE,SAAS;4BACjB,UAAU,EAAE,yCAAyC;yBACtD,YAED,KAAC,CAAC,IAAC,IAAI,EAAE,EAAE,GAAI,GACR,IACL,EACN,cAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAG,QAAQ,GAAO,IACrE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -20,6 +20,8 @@ export interface WalkthroughViewerContext {
|
|
|
20
20
|
walkthrough: SubsystemWalkthrough;
|
|
21
21
|
/** Focused step index; `null` means the whole flow (no specific step). */
|
|
22
22
|
stepIndex: number | null;
|
|
23
|
+
/** Open a step's full source file over the walkthrough drawer (keeps snippets mounted). */
|
|
24
|
+
onOpenFile: (path: string) => void;
|
|
23
25
|
}
|
|
24
26
|
export interface SubsystemComponentGraphProps {
|
|
25
27
|
components: SubsystemComponent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[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AAC;IAC9D;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC3D;AA8oED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAsC1E"}
|
|
@@ -45,8 +45,27 @@ const edgeTypes = {
|
|
|
45
45
|
const FileDrawerContent = memo(function FileDrawerContent({ render, file, startLine, }) {
|
|
46
46
|
return _jsx(_Fragment, { children: render(file, startLine != null ? { startLine } : undefined) });
|
|
47
47
|
});
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
function FileOverlayCloseButton({ onClose }) {
|
|
49
|
+
const { theme } = useTheme();
|
|
50
|
+
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
51
|
+
const [hover, setHover] = useState(false);
|
|
52
|
+
return (_jsx("button", { type: "button", onClick: onClose, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), "aria-label": "Close file", style: {
|
|
53
|
+
display: 'inline-flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
width: 22,
|
|
57
|
+
height: 22,
|
|
58
|
+
padding: 0,
|
|
59
|
+
border: 'none',
|
|
60
|
+
borderRadius: 4,
|
|
61
|
+
background: hover ? theme.colors.border : 'transparent',
|
|
62
|
+
color: hover ? theme.colors.text : muted,
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
transition: 'background 120ms ease, color 120ms ease',
|
|
65
|
+
}, children: _jsx(X, { size: 14 }) }));
|
|
66
|
+
}
|
|
67
|
+
const WalkthroughDrawerContent = memo(function WalkthroughDrawerContent({ render, walkthrough, stepIndex, onOpenFile, }) {
|
|
68
|
+
return _jsx(_Fragment, { children: render({ walkthrough, stepIndex, onOpenFile }) });
|
|
50
69
|
});
|
|
51
70
|
function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, title, hideSidebar, walkthroughStepMode = 'focus', autoPlayWalkthroughs = false, walkthroughAutoPlayIntervalMs = WALKTHROUGH_PLAY_PAUSE_MS, zoomOnWalkthroughFocus = true, graphTitle, showWalkthroughTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, renderFileView, renderFileViewer, renderWalkthroughViewer, onFileSelect, onVerifyComponent, componentVerification }) {
|
|
52
71
|
const { theme } = useTheme();
|
|
@@ -61,6 +80,8 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
61
80
|
const [selected, setSelected] = useState(null);
|
|
62
81
|
/** Bottom drawer: single file or walkthrough multi-snippet mode. */
|
|
63
82
|
const [drawerTarget, setDrawerTarget] = useState(null);
|
|
83
|
+
/** Full-file layer over an open walkthrough drawer — walkthrough stays mounted. */
|
|
84
|
+
const [fileOverlay, setFileOverlay] = useState(null);
|
|
64
85
|
// Mirror so step-focus can decide whether to wait for the drawer open
|
|
65
86
|
// transition before fitView (avoids framing against full-height canvas).
|
|
66
87
|
const drawerOpenRef = useRef(false);
|
|
@@ -133,9 +154,11 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
133
154
|
selectedRef.current = selected;
|
|
134
155
|
// Ref mirror of the open file drawer target for tree-click toggle.
|
|
135
156
|
const openFileRef = useRef(null);
|
|
136
|
-
const openFile =
|
|
137
|
-
|
|
138
|
-
|
|
157
|
+
const openFile = fileOverlay?.file ??
|
|
158
|
+
(drawerTarget?.kind === 'file' ? drawerTarget.file : null);
|
|
159
|
+
openFileRef.current = fileOverlay
|
|
160
|
+
? { file: fileOverlay.file }
|
|
161
|
+
: drawerTarget?.kind === 'file'
|
|
139
162
|
? { file: drawerTarget.file, startLine: drawerTarget.startLine }
|
|
140
163
|
: null;
|
|
141
164
|
const focusedWalkthrough = useMemo(() => {
|
|
@@ -661,6 +684,7 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
661
684
|
}, []);
|
|
662
685
|
const treeFiles = useMemo(() => repoGroups.groups.flatMap((g) => g.entries.map((e) => e.file)), [repoGroups]);
|
|
663
686
|
const onTreeSelectFile = useCallback((file) => {
|
|
687
|
+
setFileOverlay(null);
|
|
664
688
|
if (openFileRef.current?.file === file && openFileRef.current.startLine == null) {
|
|
665
689
|
setDrawerTarget(null);
|
|
666
690
|
return;
|
|
@@ -669,6 +693,7 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
669
693
|
onFileSelect?.(file);
|
|
670
694
|
}, [onFileSelect]);
|
|
671
695
|
const onOpenDeclarationFile = useCallback((file, opts) => {
|
|
696
|
+
setFileOverlay(null);
|
|
672
697
|
const startLine = opts?.startLine;
|
|
673
698
|
if (openFileRef.current?.file === file &&
|
|
674
699
|
openFileRef.current.startLine === startLine) {
|
|
@@ -678,6 +703,38 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
678
703
|
setDrawerTarget({ kind: 'file', file, startLine });
|
|
679
704
|
onFileSelect?.(file);
|
|
680
705
|
}, [onFileSelect]);
|
|
706
|
+
const onOpenFileFromWalkthrough = useCallback((file) => {
|
|
707
|
+
setFileOverlay({ file });
|
|
708
|
+
onFileSelect?.(file);
|
|
709
|
+
}, [onFileSelect]);
|
|
710
|
+
const closeFileOverlay = useCallback(() => {
|
|
711
|
+
setFileOverlay(null);
|
|
712
|
+
}, []);
|
|
713
|
+
const closeDrawer = useCallback(() => {
|
|
714
|
+
setFileOverlay(null);
|
|
715
|
+
setDrawerTarget(null);
|
|
716
|
+
}, []);
|
|
717
|
+
const drawerFillHeight = drawerTarget?.kind === 'file' && drawerTarget.startLine == null;
|
|
718
|
+
const fileOverlayOpen = fileOverlay != null;
|
|
719
|
+
const collapseCanvas = drawerFillHeight || fileOverlayOpen;
|
|
720
|
+
// Drop the full-file overlay when the underlying walkthrough drawer changes
|
|
721
|
+
// or closes — open-file keeps the same drawerTarget so the snippets stay mounted.
|
|
722
|
+
const walkthroughDrawerKey = drawerTarget?.kind === 'walkthrough'
|
|
723
|
+
? `${drawerTarget.walkthroughId}:${drawerTarget.stepIndex}`
|
|
724
|
+
: null;
|
|
725
|
+
useEffect(() => {
|
|
726
|
+
setFileOverlay(null);
|
|
727
|
+
}, [walkthroughDrawerKey]);
|
|
728
|
+
useEffect(() => {
|
|
729
|
+
if (!fileOverlayOpen)
|
|
730
|
+
return;
|
|
731
|
+
const onKey = (e) => {
|
|
732
|
+
if (e.key === 'Escape')
|
|
733
|
+
closeFileOverlay();
|
|
734
|
+
};
|
|
735
|
+
window.addEventListener('keydown', onKey);
|
|
736
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
737
|
+
}, [fileOverlayOpen, closeFileOverlay]);
|
|
681
738
|
// Camera helper shared by the walkthrough interactions: frames the focused
|
|
682
739
|
// edges' endpoint nodes via `fitView({ nodes })`, which uses the store's
|
|
683
740
|
// live positions + measured dims — so the frame always includes BOTH
|
|
@@ -1123,7 +1180,15 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
1123
1180
|
background: theme.colors.border,
|
|
1124
1181
|
transition: 'background 120ms ease',
|
|
1125
1182
|
zIndex: 1,
|
|
1126
|
-
} })), _jsxs("div", { style: { flex: 1, position: 'relative', display: 'flex', flexDirection: 'column', minHeight: 0 }, children: [_jsxs("div", { style: {
|
|
1183
|
+
} })), _jsxs("div", { style: { flex: 1, position: 'relative', display: 'flex', flexDirection: 'column', minHeight: 0 }, children: [_jsxs("div", { style: {
|
|
1184
|
+
position: 'relative',
|
|
1185
|
+
flex: collapseCanvas ? 0 : 1,
|
|
1186
|
+
minHeight: 0,
|
|
1187
|
+
height: collapseCanvas ? 0 : undefined,
|
|
1188
|
+
overflow: 'hidden',
|
|
1189
|
+
display: 'flex',
|
|
1190
|
+
flexDirection: 'column',
|
|
1191
|
+
}, children: [showEdgeLabels !== false && (_jsx("div", { style: {
|
|
1127
1192
|
position: 'absolute',
|
|
1128
1193
|
inset: 0,
|
|
1129
1194
|
overflow: 'hidden',
|
|
@@ -1272,9 +1337,33 @@ function Inner({ components, relations, walkthroughs, onSelect, onEdgeSelect, me
|
|
|
1272
1337
|
border: `1px solid ${theme.colors.border}`,
|
|
1273
1338
|
borderRadius: 8,
|
|
1274
1339
|
boxShadow: '0 8px 24px rgba(0,0,0,0.35)',
|
|
1275
|
-
}, children: _jsx(ComponentDeclaration, { component: selected, onOpenFile: onOpenDeclarationFile, onRelatedSelect: resolveRelatedComponent, onVerify: onVerifyComponent, verification: componentVerification }) }))] }), _jsx(FileDrawer, { title: drawerTitle, onClose:
|
|
1340
|
+
}, children: _jsx(ComponentDeclaration, { component: selected, onOpenFile: onOpenDeclarationFile, onRelatedSelect: resolveRelatedComponent, onVerify: onVerifyComponent, verification: componentVerification }) }))] }), _jsx(FileDrawer, { title: drawerTitle, onClose: closeDrawer, fillHeight: drawerFillHeight, suppressEscape: fileOverlayOpen, children: drawerTarget?.kind === 'walkthrough' &&
|
|
1276
1341
|
focusedWalkthrough &&
|
|
1277
|
-
renderWalkthroughViewer ? (_jsx(WalkthroughDrawerContent, { render: renderWalkthroughDrawerContent, walkthrough: focusedWalkthrough, stepIndex: drawerTarget.stepIndex })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine })) : null }),
|
|
1342
|
+
renderWalkthroughViewer ? (_jsx(WalkthroughDrawerContent, { render: renderWalkthroughDrawerContent, walkthrough: focusedWalkthrough, stepIndex: drawerTarget.stepIndex, onOpenFile: onOpenFileFromWalkthrough })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine })) : null }), fileOverlay && (_jsxs("div", { style: {
|
|
1343
|
+
position: 'absolute',
|
|
1344
|
+
inset: 0,
|
|
1345
|
+
zIndex: 8,
|
|
1346
|
+
display: 'flex',
|
|
1347
|
+
flexDirection: 'column',
|
|
1348
|
+
background: theme.colors.background,
|
|
1349
|
+
borderLeft: `1px solid ${theme.colors.border}`,
|
|
1350
|
+
}, children: [_jsxs("div", { style: {
|
|
1351
|
+
display: 'flex',
|
|
1352
|
+
alignItems: 'center',
|
|
1353
|
+
gap: 8,
|
|
1354
|
+
padding: '6px 10px',
|
|
1355
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
1356
|
+
flexShrink: 0,
|
|
1357
|
+
}, children: [_jsx("span", { title: fileOverlay.file, style: {
|
|
1358
|
+
flex: 1,
|
|
1359
|
+
minWidth: 0,
|
|
1360
|
+
overflow: 'hidden',
|
|
1361
|
+
textOverflow: 'ellipsis',
|
|
1362
|
+
whiteSpace: 'nowrap',
|
|
1363
|
+
fontFamily: theme.fonts.monospace,
|
|
1364
|
+
fontSize: theme.fontSizes[0],
|
|
1365
|
+
color: theme.colors.textMuted ?? theme.colors.textSecondary,
|
|
1366
|
+
}, children: fileOverlay.file }), _jsx(FileOverlayCloseButton, { onClose: closeFileOverlay })] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(FileDrawerContent, { render: renderDrawerContent, file: fileOverlay.file }) })] })), _jsx(GraphLayoutCover, { revealed: layoutReady }), canvasOverlay] })] }));
|
|
1278
1367
|
}
|
|
1279
1368
|
/** Sidebar header for one repo's tree: owner avatar + repo name + file count.
|
|
1280
1369
|
* Clicking toggles the tree's visibility. */
|