@industry-theme/principal-view-panels 0.4.21 → 0.4.22
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/panels/CanvasDetailPanel.d.ts +11 -0
- package/dist/panels/CanvasDetailPanel.d.ts.map +1 -1
- package/dist/panels/CanvasDetailPanel.stories.d.ts +2 -0
- package/dist/panels/CanvasDetailPanel.stories.d.ts.map +1 -1
- package/dist/panels/CanvasEditorPanel.d.ts +6 -0
- package/dist/panels/CanvasEditorPanel.d.ts.map +1 -1
- package/dist/panels/CanvasEditorPanel.stories.d.ts +1 -0
- package/dist/panels/CanvasEditorPanel.stories.d.ts.map +1 -1
- package/dist/panels/CanvasListPanel.d.ts.map +1 -1
- package/dist/panels/SkillInstallation.stories.d.ts +2 -0
- package/dist/panels/SkillInstallation.stories.d.ts.map +1 -1
- package/dist/panels/canvas-list/hooks/useCanvasData.d.ts.map +1 -1
- package/dist/panels/canvas-list/hooks/useCanvasNarrativeData.d.ts.map +1 -1
- package/dist/panels.bundle.js +126 -86
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelComponentProps } from '@principal-ade/panel-framework-core';
|
|
3
3
|
import type { NarrativeTemplate } from '@principal-ai/principal-view-core/browser';
|
|
4
|
+
import type { FileInfo } from '@principal-ai/repository-abstraction';
|
|
4
5
|
export type ViewMode = 'raw' | 'narrative' | 'summary';
|
|
5
6
|
/**
|
|
6
7
|
* Props for CanvasDetailPanel
|
|
@@ -21,6 +22,11 @@ export interface CanvasDetailPanelProps extends PanelComponentProps {
|
|
|
21
22
|
* Optional canvas name for display.
|
|
22
23
|
*/
|
|
23
24
|
canvasName?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Optional canvas file info with metadata (size, lastModified, etc.).
|
|
27
|
+
* Used for detecting file changes and auto-reloading.
|
|
28
|
+
*/
|
|
29
|
+
canvasFileInfo?: FileInfo | null;
|
|
24
30
|
/**
|
|
25
31
|
* Optional narrative ID to display.
|
|
26
32
|
* If provided, the panel will display this narrative without showing the selector UI.
|
|
@@ -36,6 +42,11 @@ export interface CanvasDetailPanelProps extends PanelComponentProps {
|
|
|
36
42
|
* If provided along with selectedNarrativeId, the panel will use this template directly.
|
|
37
43
|
*/
|
|
38
44
|
narrativeTemplate?: NarrativeTemplate | null;
|
|
45
|
+
/**
|
|
46
|
+
* Optional narrative file info with metadata (size, lastModified, etc.).
|
|
47
|
+
* Used for detecting narrative file changes and auto-reloading.
|
|
48
|
+
*/
|
|
49
|
+
narrativeFileInfo?: FileInfo | null;
|
|
39
50
|
}
|
|
40
51
|
/**
|
|
41
52
|
* Canvas Detail Panel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnG,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAiB/E,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;AA8LvD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAE7C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACrC;AA8BD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwuC9D,CAAC"}
|
|
@@ -35,9 +35,11 @@ declare const meta: {
|
|
|
35
35
|
selectedCanvasId?: string | null | undefined;
|
|
36
36
|
canvasPath?: string | null | undefined;
|
|
37
37
|
canvasName?: string | null | undefined;
|
|
38
|
+
canvasFileInfo?: (import("@principal-ai/repository-abstraction").FileInfo | null) | undefined;
|
|
38
39
|
selectedNarrativeId?: string | null | undefined;
|
|
39
40
|
narrativePath?: string | null | undefined;
|
|
40
41
|
narrativeTemplate?: (NarrativeTemplate | null) | undefined;
|
|
42
|
+
narrativeFileInfo?: (import("@principal-ai/repository-abstraction").FileInfo | null) | undefined;
|
|
41
43
|
context: import("@principal-ade/panel-framework-core").PanelContextValue;
|
|
42
44
|
actions: import("@principal-ade/panel-framework-core").PanelActions;
|
|
43
45
|
events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasDetailPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasDetailPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"CanvasDetailPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasDetailPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;CAsBgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA0wBnC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAiC9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAyCxC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,KA+CtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,KA+CtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,KA+C5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,KA+C9B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelComponentProps } from '@principal-ade/panel-framework-core';
|
|
3
|
+
import type { FileInfo } from '@principal-ai/repository-abstraction';
|
|
3
4
|
/**
|
|
4
5
|
* Props for CanvasEditorPanel
|
|
5
6
|
*/
|
|
@@ -16,6 +17,11 @@ export interface CanvasEditorPanelProps extends PanelComponentProps {
|
|
|
16
17
|
* Canvas display name.
|
|
17
18
|
*/
|
|
18
19
|
canvasName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional canvas file info with metadata (size, lastModified, etc.).
|
|
22
|
+
* Used for detecting file changes and auto-reloading.
|
|
23
|
+
*/
|
|
24
|
+
canvasFileInfo?: FileInfo | null;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* Principal View Graph Panel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAS/E,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAmB/E;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuwB9D,CAAC"}
|
|
@@ -20,6 +20,7 @@ declare const meta: {
|
|
|
20
20
|
selectedConfigId?: string | undefined;
|
|
21
21
|
canvasPath?: string | undefined;
|
|
22
22
|
canvasName?: string | undefined;
|
|
23
|
+
canvasFileInfo?: (import("@principal-ai/repository-abstraction").FileInfo | null) | undefined;
|
|
23
24
|
context: import("@principal-ade/panel-framework-core").PanelContextValue;
|
|
24
25
|
actions: import("@principal-ade/panel-framework-core").PanelActions;
|
|
25
26
|
events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasEditorPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD;;;GAGG;AACH,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"CanvasEditorPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD;;;GAGG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;CAsBgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA0HnC,eAAO,MAAM,mBAAmB,EAAE,KAGjC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAgErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAW/E;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgmBzD,CAAC"}
|
|
@@ -22,9 +22,11 @@ declare const meta: {
|
|
|
22
22
|
selectedCanvasId?: string | null | undefined;
|
|
23
23
|
canvasPath?: string | null | undefined;
|
|
24
24
|
canvasName?: string | null | undefined;
|
|
25
|
+
canvasFileInfo?: (import("@principal-ai/repository-abstraction").FileInfo | null) | undefined;
|
|
25
26
|
selectedNarrativeId?: string | null | undefined;
|
|
26
27
|
narrativePath?: string | null | undefined;
|
|
27
28
|
narrativeTemplate?: (import("@principal-ai/principal-view-core").NarrativeTemplate | null) | undefined;
|
|
29
|
+
narrativeFileInfo?: (import("@principal-ai/repository-abstraction").FileInfo | null) | undefined;
|
|
28
30
|
context: import("@principal-ade/panel-framework-core").PanelContextValue;
|
|
29
31
|
actions: import("@principal-ade/panel-framework-core").PanelActions;
|
|
30
32
|
events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkillInstallation.stories.d.ts","sourceRoot":"","sources":["../../src/panels/SkillInstallation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;GAKG;AACH,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"SkillInstallation.stories.d.ts","sourceRoot":"","sources":["../../src/panels/SkillInstallation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;GAKG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;CAsBgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA0UnC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAkDpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasData.d.ts","sourceRoot":"","sources":["../../../../src/panels/canvas-list/hooks/useCanvasData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAGnG,UAAU,mBAAmB;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAKD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,cAE3B,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"useCanvasData.d.ts","sourceRoot":"","sources":["../../../../src/panels/canvas-list/hooks/useCanvasData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAGnG,UAAU,mBAAmB;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAKD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,cAE3B,mBAAmB,KAAG,mBAiFxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanvasNarrativeData.d.ts","sourceRoot":"","sources":["../../../../src/panels/canvas-list/hooks/useCanvasNarrativeData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"useCanvasNarrativeData.d.ts","sourceRoot":"","sources":["../../../../src/panels/canvas-list/hooks/useCanvasNarrativeData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAG7F,UAAU,4BAA4B;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,UAAU,4BAA4B;IACpC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,UAAU,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,QAAQ,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAC;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAKD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,uBAGpC,4BAA4B,KAAG,4BAoHjC,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -47490,7 +47490,8 @@ const CanvasEditorPanel = ({
|
|
|
47490
47490
|
events,
|
|
47491
47491
|
selectedConfigId,
|
|
47492
47492
|
canvasPath,
|
|
47493
|
-
canvasName
|
|
47493
|
+
canvasName,
|
|
47494
|
+
canvasFileInfo
|
|
47494
47495
|
}) => {
|
|
47495
47496
|
var _a, _b;
|
|
47496
47497
|
const { theme } = useTheme$1();
|
|
@@ -47516,6 +47517,7 @@ const CanvasEditorPanel = ({
|
|
|
47516
47517
|
actionsRef.current = actions2;
|
|
47517
47518
|
eventsRef.current = events;
|
|
47518
47519
|
const skipNextFileChangeRef = useRef(false);
|
|
47520
|
+
const canvasFileTimestampRef = useRef(null);
|
|
47519
47521
|
const [pathCopied, setPathCopied] = useState(false);
|
|
47520
47522
|
const containerRef = useCallback((container) => {
|
|
47521
47523
|
if (resizeObserverRef.current) {
|
|
@@ -47568,10 +47570,10 @@ const CanvasEditorPanel = ({
|
|
|
47568
47570
|
const canvas = ConfigLoader.parseCanvas(configContent);
|
|
47569
47571
|
let library = null;
|
|
47570
47572
|
if (ctx.hasSlice("fileTree") && !ctx.isSliceLoading("fileTree")) {
|
|
47571
|
-
const
|
|
47572
|
-
const
|
|
47573
|
-
if (
|
|
47574
|
-
const libraryPath = ConfigLoader.findLibraryPath(
|
|
47573
|
+
const fileTreeSlice = ctx.getSlice("fileTree");
|
|
47574
|
+
const fileTreeData = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
47575
|
+
if (fileTreeData == null ? void 0 : fileTreeData.allFiles) {
|
|
47576
|
+
const libraryPath = ConfigLoader.findLibraryPath(fileTreeData.allFiles);
|
|
47575
47577
|
if (libraryPath) {
|
|
47576
47578
|
try {
|
|
47577
47579
|
const libraryFullPath = `${repositoryPath}/${libraryPath}`;
|
|
@@ -47701,39 +47703,44 @@ const CanvasEditorPanel = ({
|
|
|
47701
47703
|
useEffect(() => {
|
|
47702
47704
|
loadConfiguration();
|
|
47703
47705
|
}, [canvasPath, loadConfiguration]);
|
|
47704
|
-
const fileTreeSlice = context.hasSlice("fileTree") ? context.getSlice("fileTree") : null;
|
|
47705
|
-
const fileTreeData = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
47706
|
-
const fileTreeDataRef = useRef(fileTreeData);
|
|
47707
47706
|
useEffect(() => {
|
|
47708
|
-
|
|
47709
|
-
|
|
47710
|
-
if (prevData === null) {
|
|
47711
|
-
return;
|
|
47712
|
-
}
|
|
47713
|
-
if (skipNextFileChangeRef.current) {
|
|
47714
|
-
skipNextFileChangeRef.current = false;
|
|
47715
|
-
return;
|
|
47707
|
+
if (canvasFileInfo == null ? void 0 : canvasFileInfo.lastModified) {
|
|
47708
|
+
canvasFileTimestampRef.current = canvasFileInfo.lastModified.getTime();
|
|
47716
47709
|
}
|
|
47717
|
-
|
|
47718
|
-
|
|
47719
|
-
|
|
47720
|
-
|
|
47721
|
-
|
|
47722
|
-
|
|
47723
|
-
|
|
47724
|
-
const newLibraryFile = libraryPath ? newFiles.find((f) => (f.path || f.relativePath) === libraryPath) : null;
|
|
47725
|
-
const configChanged = prevConfigFile !== newConfigFile;
|
|
47726
|
-
const libraryChanged = prevLibraryFile !== newLibraryFile;
|
|
47727
|
-
if (configChanged || libraryChanged) {
|
|
47728
|
-
console.log("[PrincipalViewGraph] Current canvas or library changed, reloading...", {
|
|
47729
|
-
configChanged,
|
|
47730
|
-
libraryChanged,
|
|
47731
|
-
canvasPath
|
|
47732
|
-
});
|
|
47733
|
-
loadConfiguration();
|
|
47710
|
+
}, [canvasFileInfo]);
|
|
47711
|
+
useEffect(() => {
|
|
47712
|
+
if (!events || !canvasPath) return;
|
|
47713
|
+
const handleWorkspaceChange = () => {
|
|
47714
|
+
if (skipNextFileChangeRef.current) {
|
|
47715
|
+
skipNextFileChangeRef.current = false;
|
|
47716
|
+
return;
|
|
47734
47717
|
}
|
|
47735
|
-
|
|
47736
|
-
|
|
47718
|
+
const ctx = contextRef.current;
|
|
47719
|
+
if (!ctx.hasSlice("fileTree")) return;
|
|
47720
|
+
const fileTreeSlice = ctx.getSlice("fileTree");
|
|
47721
|
+
const fileTreeData = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
47722
|
+
if (!(fileTreeData == null ? void 0 : fileTreeData.allFiles)) return;
|
|
47723
|
+
const canvasFile = fileTreeData.allFiles.find(
|
|
47724
|
+
(f) => f.path === canvasPath || f.relativePath === canvasPath
|
|
47725
|
+
);
|
|
47726
|
+
if (canvasFile == null ? void 0 : canvasFile.lastModified) {
|
|
47727
|
+
const currentTimestamp = canvasFile.lastModified.getTime();
|
|
47728
|
+
if (canvasFileTimestampRef.current && currentTimestamp !== canvasFileTimestampRef.current) {
|
|
47729
|
+
console.log("[CanvasEditorPanel] Canvas file modified, reloading...", {
|
|
47730
|
+
path: canvasPath,
|
|
47731
|
+
lastLoaded: new Date(canvasFileTimestampRef.current),
|
|
47732
|
+
current: new Date(currentTimestamp)
|
|
47733
|
+
});
|
|
47734
|
+
loadConfiguration();
|
|
47735
|
+
canvasFileTimestampRef.current = currentTimestamp;
|
|
47736
|
+
}
|
|
47737
|
+
}
|
|
47738
|
+
};
|
|
47739
|
+
events.on("workspace:changed", handleWorkspaceChange);
|
|
47740
|
+
return () => {
|
|
47741
|
+
events.off("workspace:changed", handleWorkspaceChange);
|
|
47742
|
+
};
|
|
47743
|
+
}, [events, canvasPath, loadConfiguration]);
|
|
47737
47744
|
useEffect(() => {
|
|
47738
47745
|
const unsubscribe = eventsRef.current.on("data:refresh", () => {
|
|
47739
47746
|
loadConfiguration();
|
|
@@ -50890,9 +50897,11 @@ const CanvasDetailPanel = ({
|
|
|
50890
50897
|
selectedCanvasId: selectedCanvasIdProp,
|
|
50891
50898
|
canvasPath: canvasPathProp,
|
|
50892
50899
|
canvasName: canvasNameProp,
|
|
50900
|
+
canvasFileInfo: canvasFileInfoProp,
|
|
50893
50901
|
selectedNarrativeId: selectedNarrativeIdProp,
|
|
50894
50902
|
narrativePath: narrativePathProp,
|
|
50895
|
-
narrativeTemplate: narrativeTemplateProp
|
|
50903
|
+
narrativeTemplate: narrativeTemplateProp,
|
|
50904
|
+
narrativeFileInfo: narrativeFileInfoProp
|
|
50896
50905
|
}) => {
|
|
50897
50906
|
var _a;
|
|
50898
50907
|
const { theme } = useTheme$1();
|
|
@@ -50931,6 +50940,8 @@ const CanvasDetailPanel = ({
|
|
|
50931
50940
|
eventsRef.current = events;
|
|
50932
50941
|
const playbackTimerRef = useRef(null);
|
|
50933
50942
|
const eventNodeMapRef = useRef(/* @__PURE__ */ new Map());
|
|
50943
|
+
const canvasFileTimestampRef = useRef(null);
|
|
50944
|
+
const narrativeFileTimestampRef = useRef(null);
|
|
50934
50945
|
const loadCanvas = useCallback(async (canvasId, canvasPath) => {
|
|
50935
50946
|
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
50936
50947
|
try {
|
|
@@ -51066,6 +51077,65 @@ const CanvasDetailPanel = ({
|
|
|
51066
51077
|
events.off("custom", handleEvent);
|
|
51067
51078
|
};
|
|
51068
51079
|
}, [events, loadCanvas, selectedCanvasIdProp, canvasPathProp]);
|
|
51080
|
+
useEffect(() => {
|
|
51081
|
+
if (canvasFileInfoProp == null ? void 0 : canvasFileInfoProp.lastModified) {
|
|
51082
|
+
canvasFileTimestampRef.current = canvasFileInfoProp.lastModified.getTime();
|
|
51083
|
+
}
|
|
51084
|
+
}, [canvasFileInfoProp]);
|
|
51085
|
+
useEffect(() => {
|
|
51086
|
+
if (narrativeFileInfoProp == null ? void 0 : narrativeFileInfoProp.lastModified) {
|
|
51087
|
+
narrativeFileTimestampRef.current = narrativeFileInfoProp.lastModified.getTime();
|
|
51088
|
+
}
|
|
51089
|
+
}, [narrativeFileInfoProp]);
|
|
51090
|
+
useEffect(() => {
|
|
51091
|
+
if (!events || !canvasPathProp) return;
|
|
51092
|
+
const handleWorkspaceChange = (event) => {
|
|
51093
|
+
const ctx = contextRef.current;
|
|
51094
|
+
if (!ctx.hasSlice("fileTree")) return;
|
|
51095
|
+
const fileTreeSlice = ctx.getSlice("fileTree");
|
|
51096
|
+
const fileTreeData = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
51097
|
+
if (!(fileTreeData == null ? void 0 : fileTreeData.allFiles)) return;
|
|
51098
|
+
if (canvasPathProp) {
|
|
51099
|
+
const canvasFile = fileTreeData.allFiles.find(
|
|
51100
|
+
(f) => f.path === canvasPathProp || f.relativePath === canvasPathProp
|
|
51101
|
+
);
|
|
51102
|
+
if (canvasFile == null ? void 0 : canvasFile.lastModified) {
|
|
51103
|
+
const currentTimestamp = canvasFile.lastModified.getTime();
|
|
51104
|
+
if (canvasFileTimestampRef.current && currentTimestamp !== canvasFileTimestampRef.current) {
|
|
51105
|
+
console.log("[CanvasDetailPanel] Canvas file modified, reloading...", {
|
|
51106
|
+
path: canvasPathProp,
|
|
51107
|
+
lastLoaded: new Date(canvasFileTimestampRef.current),
|
|
51108
|
+
current: new Date(currentTimestamp)
|
|
51109
|
+
});
|
|
51110
|
+
if (selectedCanvasIdProp) {
|
|
51111
|
+
loadCanvas(selectedCanvasIdProp, canvasPathProp);
|
|
51112
|
+
}
|
|
51113
|
+
canvasFileTimestampRef.current = currentTimestamp;
|
|
51114
|
+
}
|
|
51115
|
+
}
|
|
51116
|
+
}
|
|
51117
|
+
if (narrativePathProp) {
|
|
51118
|
+
const narrativeFile = fileTreeData.allFiles.find(
|
|
51119
|
+
(f) => f.path === narrativePathProp || f.relativePath === narrativePathProp
|
|
51120
|
+
);
|
|
51121
|
+
if (narrativeFile == null ? void 0 : narrativeFile.lastModified) {
|
|
51122
|
+
const currentTimestamp = narrativeFile.lastModified.getTime();
|
|
51123
|
+
if (narrativeFileTimestampRef.current && currentTimestamp !== narrativeFileTimestampRef.current) {
|
|
51124
|
+
console.log("[CanvasDetailPanel] Narrative file modified, reloading...", {
|
|
51125
|
+
path: narrativePathProp,
|
|
51126
|
+
lastLoaded: new Date(narrativeFileTimestampRef.current),
|
|
51127
|
+
current: new Date(currentTimestamp)
|
|
51128
|
+
});
|
|
51129
|
+
narrativeFileTimestampRef.current = currentTimestamp;
|
|
51130
|
+
}
|
|
51131
|
+
}
|
|
51132
|
+
}
|
|
51133
|
+
};
|
|
51134
|
+
events.on("workspace:changed", handleWorkspaceChange);
|
|
51135
|
+
return () => {
|
|
51136
|
+
events.off("workspace:changed", handleWorkspaceChange);
|
|
51137
|
+
};
|
|
51138
|
+
}, [events, canvasPathProp, narrativePathProp, selectedCanvasIdProp, loadCanvas]);
|
|
51069
51139
|
const handleToggleGrid = useCallback(() => {
|
|
51070
51140
|
setState((prev) => ({ ...prev, showGrid: !prev.showGrid }));
|
|
51071
51141
|
}, []);
|
|
@@ -51248,7 +51318,7 @@ const CanvasDetailPanel = ({
|
|
|
51248
51318
|
}));
|
|
51249
51319
|
}, []);
|
|
51250
51320
|
const activeNodeIds = useMemo(() => {
|
|
51251
|
-
var _a2
|
|
51321
|
+
var _a2;
|
|
51252
51322
|
if (!state.canvas) return null;
|
|
51253
51323
|
if (state.hoveredExecution) {
|
|
51254
51324
|
const spans = ExecutionLoader.getSpans(state.hoveredExecution);
|
|
@@ -51277,7 +51347,7 @@ const CanvasDetailPanel = ({
|
|
|
51277
51347
|
const activeIds = /* @__PURE__ */ new Set();
|
|
51278
51348
|
for (const node of state.canvas.nodes || []) {
|
|
51279
51349
|
const nodePv = node.pv || ((_a2 = node.data) == null ? void 0 : _a2.pv);
|
|
51280
|
-
const nodeEventName =
|
|
51350
|
+
const nodeEventName = nodePv == null ? void 0 : nodePv.event;
|
|
51281
51351
|
if (nodeEventName && state.hoveredScenarioEventNames.includes(nodeEventName)) {
|
|
51282
51352
|
activeIds.add(node.id);
|
|
51283
51353
|
}
|
|
@@ -53966,18 +54036,12 @@ const useCanvasData = ({
|
|
|
53966
54036
|
setIsLoading(true);
|
|
53967
54037
|
setError(null);
|
|
53968
54038
|
try {
|
|
53969
|
-
|
|
53970
|
-
if (fileTreeData == null ? void 0 : fileTreeData.fileTree) {
|
|
53971
|
-
fileTree = fileTreeData.fileTree;
|
|
53972
|
-
} else if (fileTreeData == null ? void 0 : fileTreeData.allFiles) {
|
|
53973
|
-
fileTree = convertToFileTree(fileTreeData.allFiles, fileTreeSha || "unknown");
|
|
53974
|
-
}
|
|
53975
|
-
if (!fileTree) {
|
|
54039
|
+
if (!fileTreeData) {
|
|
53976
54040
|
setCanvases(EMPTY_CANVAS_ARRAY);
|
|
53977
54041
|
lastLoadedSha.current = fileTreeSha;
|
|
53978
54042
|
return;
|
|
53979
54043
|
}
|
|
53980
|
-
const result = await discovery.current.discover(
|
|
54044
|
+
const result = await discovery.current.discover(fileTreeData, {
|
|
53981
54045
|
// Don't include content - just metadata for listing
|
|
53982
54046
|
includeContent: false
|
|
53983
54047
|
});
|
|
@@ -54013,43 +54077,6 @@ const useCanvasData = ({
|
|
|
54013
54077
|
refreshCanvases
|
|
54014
54078
|
};
|
|
54015
54079
|
};
|
|
54016
|
-
function convertToFileTree(allFiles, sha) {
|
|
54017
|
-
const fileInfos = allFiles.map((file) => ({
|
|
54018
|
-
path: file.path || file.relativePath || "",
|
|
54019
|
-
relativePath: file.relativePath || file.path || "",
|
|
54020
|
-
name: file.name || (file.relativePath || file.path || "").split("/").pop() || "",
|
|
54021
|
-
extension: (file.name || "").split(".").pop() || "",
|
|
54022
|
-
size: 0,
|
|
54023
|
-
lastModified: /* @__PURE__ */ new Date(),
|
|
54024
|
-
isDirectory: false
|
|
54025
|
-
}));
|
|
54026
|
-
return {
|
|
54027
|
-
sha,
|
|
54028
|
-
root: {
|
|
54029
|
-
path: "/",
|
|
54030
|
-
name: "",
|
|
54031
|
-
relativePath: "",
|
|
54032
|
-
children: [],
|
|
54033
|
-
fileCount: fileInfos.length,
|
|
54034
|
-
totalSize: 0,
|
|
54035
|
-
depth: 0
|
|
54036
|
-
},
|
|
54037
|
-
allFiles: fileInfos,
|
|
54038
|
-
allDirectories: [],
|
|
54039
|
-
stats: {
|
|
54040
|
-
totalFiles: fileInfos.length,
|
|
54041
|
-
totalDirectories: 0,
|
|
54042
|
-
totalSize: 0,
|
|
54043
|
-
maxDepth: 0
|
|
54044
|
-
},
|
|
54045
|
-
metadata: {
|
|
54046
|
-
id: "panel-context",
|
|
54047
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
54048
|
-
sourceType: "panel",
|
|
54049
|
-
sourceInfo: {}
|
|
54050
|
-
}
|
|
54051
|
-
};
|
|
54052
|
-
}
|
|
54053
54080
|
const EMPTY_NARRATIVES_ARRAY = [];
|
|
54054
54081
|
const useCanvasNarrativeData = ({
|
|
54055
54082
|
context,
|
|
@@ -61535,6 +61562,13 @@ const CanvasListPanel = ({
|
|
|
61535
61562
|
const [showHelp, setShowHelp] = useState(false);
|
|
61536
61563
|
const [cliCommandCopied, setCliCommandCopied] = useState(false);
|
|
61537
61564
|
const { canvases, narratives, isLoading, error, refreshData } = useCanvasNarrativeData({ context, actions: actions2 });
|
|
61565
|
+
const fileTreeSlice = context.getSlice("fileTree");
|
|
61566
|
+
const fileTreeData = fileTreeSlice == null ? void 0 : fileTreeSlice.data;
|
|
61567
|
+
const getCanvasFileInfo = useCallback((canvasPath) => {
|
|
61568
|
+
return fileTreeData == null ? void 0 : fileTreeData.allFiles.find(
|
|
61569
|
+
(f) => f.path === canvasPath || f.relativePath === canvasPath
|
|
61570
|
+
);
|
|
61571
|
+
}, [fileTreeData]);
|
|
61538
61572
|
const availablePackages = useMemo(() => {
|
|
61539
61573
|
const packages = /* @__PURE__ */ new Set();
|
|
61540
61574
|
canvases.forEach((canvas) => {
|
|
@@ -61576,6 +61610,7 @@ const CanvasListPanel = ({
|
|
|
61576
61610
|
if (node.type === "canvas" && node.canvas) {
|
|
61577
61611
|
setSelectedCanvasId(node.canvas.id);
|
|
61578
61612
|
if (events) {
|
|
61613
|
+
const canvasFileInfo = getCanvasFileInfo(node.canvas.path);
|
|
61579
61614
|
events.emit({
|
|
61580
61615
|
type: "custom",
|
|
61581
61616
|
source: "canvas-list-panel",
|
|
@@ -61583,13 +61618,16 @@ const CanvasListPanel = ({
|
|
|
61583
61618
|
payload: {
|
|
61584
61619
|
action: "selectCanvas",
|
|
61585
61620
|
canvasId: node.canvas.id,
|
|
61586
|
-
canvas: node.canvas
|
|
61621
|
+
canvas: node.canvas,
|
|
61622
|
+
canvasFileInfo
|
|
61587
61623
|
}
|
|
61588
61624
|
});
|
|
61589
61625
|
}
|
|
61590
61626
|
} else if (node.type === "narrative" && node.narrative && node.canvas) {
|
|
61591
61627
|
setSelectedCanvasId(node.canvas.id);
|
|
61592
61628
|
if (events) {
|
|
61629
|
+
const canvasFileInfo = getCanvasFileInfo(node.canvas.path);
|
|
61630
|
+
const narrativeFileInfo = getCanvasFileInfo(node.narrative.path);
|
|
61593
61631
|
events.emit({
|
|
61594
61632
|
type: "custom",
|
|
61595
61633
|
source: "canvas-list-panel",
|
|
@@ -61598,14 +61636,16 @@ const CanvasListPanel = ({
|
|
|
61598
61636
|
action: "selectCanvas",
|
|
61599
61637
|
canvasId: node.canvas.id,
|
|
61600
61638
|
canvas: node.canvas,
|
|
61639
|
+
canvasFileInfo,
|
|
61601
61640
|
narrativeId: node.narrative.id,
|
|
61602
61641
|
narrative: node.narrative,
|
|
61603
|
-
narrativeTemplate: node.narrativeTemplate
|
|
61642
|
+
narrativeTemplate: node.narrativeTemplate,
|
|
61643
|
+
narrativeFileInfo
|
|
61604
61644
|
}
|
|
61605
61645
|
});
|
|
61606
61646
|
}
|
|
61607
61647
|
}
|
|
61608
|
-
}, [events]);
|
|
61648
|
+
}, [events, getCanvasFileInfo]);
|
|
61609
61649
|
const handleRefresh = async () => {
|
|
61610
61650
|
setIsRefreshing(true);
|
|
61611
61651
|
if (events) {
|