@industry-theme/principal-view-panels 0.12.85 → 0.12.87
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/DashboardPanel.d.ts +7 -5
- package/dist/panels/DashboardPanel.d.ts.map +1 -1
- package/dist/panels/StoryboardListPanel.d.ts.map +1 -1
- package/dist/panels/canvas-list/hooks/useCanvasData.d.ts.map +1 -1
- package/dist/panels.bundle.js +10 -46
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelComponentProps } from '@principal-ade/panel-framework-core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { MetricSource, DiscoveredCanvas, DataProvider } from '@principal-ai/principal-view-core';
|
|
4
4
|
export interface DashboardPanelProps extends PanelComponentProps {
|
|
5
5
|
/**
|
|
6
|
-
* The discovered dashboard
|
|
6
|
+
* The discovered dashboard to display.
|
|
7
7
|
* Must be a DiscoveredCanvas with type 'dashboard'.
|
|
8
|
+
* The panel will load the dashboard definition from the file path.
|
|
8
9
|
*/
|
|
9
10
|
selectedDashboard?: DiscoveredCanvas | null;
|
|
10
11
|
/**
|
|
11
|
-
* Optional
|
|
12
|
-
* If provided,
|
|
12
|
+
* Optional data provider for fetching metric values.
|
|
13
|
+
* If not provided, the dashboard will render without data.
|
|
14
|
+
* Use MockDataProvider from @principal-ai/principal-view-react for testing.
|
|
13
15
|
*/
|
|
14
|
-
|
|
16
|
+
dataProvider?: DataProvider;
|
|
15
17
|
/**
|
|
16
18
|
* Callback when a metric source link is clicked.
|
|
17
19
|
* Use this to navigate to the referenced workflow/canvas.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPanel.d.ts","sourceRoot":"","sources":["../../src/panels/DashboardPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DashboardPanel.d.ts","sourceRoot":"","sources":["../../src/panels/DashboardPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E,OAAO,KAAK,EAEV,YAAY,EAGZ,gBAAgB,EAChB,YAAY,EACb,MAAM,mCAAmC,CAAC;AAG3C,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAE/C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyMxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AA2K9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AA2K9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA0wDvE,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,YAAY,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAErE,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACtC;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,oEAAoE;IACpE,SAAS,EAAE,eAAe,CAAC;CAC5B;AAQD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,uBAG3B,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"useCanvasData.d.ts","sourceRoot":"","sources":["../../../../src/panels/canvas-list/hooks/useCanvasData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAErE,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CACtC;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,oEAAoE;IACpE,SAAS,EAAE,eAAe,CAAC;CAC5B;AAQD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,uBAG3B,mBAAmB,KAAG,mBAsGxB,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -195408,7 +195408,6 @@ const useCanvasData = ({
|
|
|
195408
195408
|
const lastLoadedSha = useRef(void 0);
|
|
195409
195409
|
const discovery = useRef(new CanvasDiscovery());
|
|
195410
195410
|
const loadCanvases = useCallback(async () => {
|
|
195411
|
-
var _a2;
|
|
195412
195411
|
if (fileTreeSha === lastLoadedSha.current) {
|
|
195413
195412
|
return;
|
|
195414
195413
|
}
|
|
@@ -195423,11 +195422,6 @@ const useCanvasData = ({
|
|
|
195423
195422
|
lastLoadedSha.current = fileTreeSha;
|
|
195424
195423
|
return;
|
|
195425
195424
|
}
|
|
195426
|
-
console.log("[useCanvasData] Starting discovery with fileTree:", {
|
|
195427
|
-
hasFileTree: !!fileTreeData,
|
|
195428
|
-
fileCount: (_a2 = fileTreeData == null ? void 0 : fileTreeData.allFiles) == null ? void 0 : _a2.length,
|
|
195429
|
-
sha: fileTreeData == null ? void 0 : fileTreeData.sha
|
|
195430
|
-
});
|
|
195431
195425
|
const result = await discovery.current.discover(fileTreeData, {
|
|
195432
195426
|
// Include content to extract markdown paths from pv.markdown field
|
|
195433
195427
|
includeContent: true,
|
|
@@ -195438,13 +195432,6 @@ const useCanvasData = ({
|
|
|
195438
195432
|
return await readFile(path2);
|
|
195439
195433
|
}
|
|
195440
195434
|
});
|
|
195441
|
-
console.log("[useCanvasData] Discovery result:", {
|
|
195442
|
-
canvasCount: result.canvases.length,
|
|
195443
|
-
storyboardCount: result.storyboards.length,
|
|
195444
|
-
dashboardCount: result.dashboards.length,
|
|
195445
|
-
testTraceCount: result.testTraces.length,
|
|
195446
|
-
errorCount: result.errors.length
|
|
195447
|
-
});
|
|
195448
195435
|
if (result.errors.length > 0) {
|
|
195449
195436
|
console.warn("[useCanvasData] Discovery errors:", result.errors);
|
|
195450
195437
|
}
|
|
@@ -195455,7 +195442,6 @@ const useCanvasData = ({
|
|
|
195455
195442
|
setStoryboards(result.storyboards);
|
|
195456
195443
|
setTestTraces(result.testTraces);
|
|
195457
195444
|
setDashboards(result.dashboards);
|
|
195458
|
-
console.log("[useCanvasData] Discovered dashboards:", result.dashboards.length, result.dashboards.map((d) => ({ id: d.id, name: d.name, path: d.path })));
|
|
195459
195445
|
lastLoadedSha.current = fileTreeSha;
|
|
195460
195446
|
} catch (err) {
|
|
195461
195447
|
const errorMessage = err instanceof Error ? err.message : "Failed to load canvases";
|
|
@@ -196314,23 +196300,15 @@ const StoryboardListPanel = ({
|
|
|
196314
196300
|
return filteredStoryboards.map((storyboard) => storyboard.canvas);
|
|
196315
196301
|
}, [filteredStoryboards]);
|
|
196316
196302
|
const handleTreeNodeClick = useCallback((node2, event) => {
|
|
196317
|
-
var _a3, _b3, _c, _d, _e4, _f, _g, _h
|
|
196303
|
+
var _a3, _b3, _c, _d, _e4, _f, _g, _h;
|
|
196318
196304
|
const asCanvasListNode = node2;
|
|
196319
|
-
console.log("[StoryboardListPanel] Tree node clicked:", {
|
|
196320
|
-
nodeType: node2.type,
|
|
196321
|
-
nodeId: node2.id,
|
|
196322
|
-
nodeName: node2.name,
|
|
196323
|
-
hasDashboard: !!asCanvasListNode.dashboard,
|
|
196324
|
-
dashboardId: (_a3 = asCanvasListNode.dashboard) == null ? void 0 : _a3.id,
|
|
196325
|
-
hasCanvas: !!node2.canvas
|
|
196326
|
-
});
|
|
196327
196305
|
if ((event == null ? void 0 : event.metaKey) || (event == null ? void 0 : event.ctrlKey)) {
|
|
196328
196306
|
let filePath;
|
|
196329
|
-
if (node2.type === "canvas" && ((
|
|
196307
|
+
if (node2.type === "canvas" && ((_a3 = asCanvasListNode.dashboard) == null ? void 0 : _a3.path)) {
|
|
196330
196308
|
filePath = asCanvasListNode.dashboard.path;
|
|
196331
|
-
} else if (node2.type === "canvas" && ((
|
|
196309
|
+
} else if (node2.type === "canvas" && ((_b3 = node2.canvas) == null ? void 0 : _b3.path)) {
|
|
196332
196310
|
filePath = node2.canvas.path;
|
|
196333
|
-
} else if (node2.type === "workflow" && "workflow" in node2 && ((
|
|
196311
|
+
} else if (node2.type === "workflow" && "workflow" in node2 && ((_c = node2.workflow) == null ? void 0 : _c.path)) {
|
|
196334
196312
|
filePath = node2.workflow.path;
|
|
196335
196313
|
} else if (node2.markdownPath) {
|
|
196336
196314
|
filePath = node2.markdownPath;
|
|
@@ -196346,7 +196324,7 @@ const StoryboardListPanel = ({
|
|
|
196346
196324
|
}
|
|
196347
196325
|
}
|
|
196348
196326
|
if (node2.type === "overview" && node2.markdownPath) {
|
|
196349
|
-
const canvasId = ((
|
|
196327
|
+
const canvasId = ((_d = node2.canvas) == null ? void 0 : _d.id) || "storyboard" in node2 && ((_f = (_e4 = node2.storyboard) == null ? void 0 : _e4.canvas) == null ? void 0 : _f.id) || "unknown";
|
|
196350
196328
|
setSelectedNodeId(`overview:${canvasId}`);
|
|
196351
196329
|
if (events) {
|
|
196352
196330
|
events.emit({
|
|
@@ -196357,11 +196335,6 @@ const StoryboardListPanel = ({
|
|
|
196357
196335
|
});
|
|
196358
196336
|
}
|
|
196359
196337
|
} else if (node2.type === "canvas" && asCanvasListNode.dashboard) {
|
|
196360
|
-
console.log("[StoryboardListPanel] Dashboard click - emitting openDashboard event:", {
|
|
196361
|
-
dashboardId: asCanvasListNode.dashboard.id,
|
|
196362
|
-
dashboardName: asCanvasListNode.dashboard.name,
|
|
196363
|
-
hasEvents: !!events
|
|
196364
|
-
});
|
|
196365
196338
|
setSelectedNodeId(`dashboard:${asCanvasListNode.dashboard.id}`);
|
|
196366
196339
|
if (events) {
|
|
196367
196340
|
events.emit({
|
|
@@ -196410,7 +196383,7 @@ const StoryboardListPanel = ({
|
|
|
196410
196383
|
return wf.file.path === ((_a4 = node2.workflow) == null ? void 0 : _a4.path);
|
|
196411
196384
|
});
|
|
196412
196385
|
if (!fullWorkflow) {
|
|
196413
|
-
console.warn("[StoryboardListPanel] Workflow template not loaded for:", (
|
|
196386
|
+
console.warn("[StoryboardListPanel] Workflow template not loaded for:", (_g = node2.workflow) == null ? void 0 : _g.path);
|
|
196414
196387
|
return;
|
|
196415
196388
|
}
|
|
196416
196389
|
telemetry.emitWorkflowSelected(
|
|
@@ -196418,7 +196391,7 @@ const StoryboardListPanel = ({
|
|
|
196418
196391
|
node2.workflow.name,
|
|
196419
196392
|
node2.workflow.path,
|
|
196420
196393
|
node2.storyboard.canvas.id,
|
|
196421
|
-
((
|
|
196394
|
+
((_h = fullWorkflow.template.scenarios) == null ? void 0 : _h.length) ?? 0
|
|
196422
196395
|
);
|
|
196423
196396
|
events.emit({
|
|
196424
196397
|
type: "custom",
|
|
@@ -206104,13 +206077,13 @@ const DashboardPanel = ({
|
|
|
206104
206077
|
actions,
|
|
206105
206078
|
events,
|
|
206106
206079
|
selectedDashboard,
|
|
206107
|
-
|
|
206080
|
+
dataProvider,
|
|
206108
206081
|
onSourceClick,
|
|
206109
206082
|
onMetricClick
|
|
206110
206083
|
}) => {
|
|
206111
206084
|
const { theme: theme2 } = useTheme();
|
|
206112
206085
|
const panelRef = useRef(null);
|
|
206113
|
-
const [dashboard, setDashboard] = useState(
|
|
206086
|
+
const [dashboard, setDashboard] = useState(null);
|
|
206114
206087
|
const [loading, setLoading] = useState(false);
|
|
206115
206088
|
const [error, setError] = useState(null);
|
|
206116
206089
|
const [timeRange, setTimeRange] = useState({ preset: "last_1h" });
|
|
@@ -206120,11 +206093,6 @@ const DashboardPanel = ({
|
|
|
206120
206093
|
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
206121
206094
|
});
|
|
206122
206095
|
useEffect(() => {
|
|
206123
|
-
if (propDashboard) {
|
|
206124
|
-
setDashboard(propDashboard);
|
|
206125
|
-
setError(null);
|
|
206126
|
-
return;
|
|
206127
|
-
}
|
|
206128
206096
|
if (!selectedDashboard) {
|
|
206129
206097
|
setDashboard(null);
|
|
206130
206098
|
return;
|
|
@@ -206149,7 +206117,7 @@ const DashboardPanel = ({
|
|
|
206149
206117
|
}
|
|
206150
206118
|
};
|
|
206151
206119
|
loadDashboard();
|
|
206152
|
-
}, [selectedDashboard,
|
|
206120
|
+
}, [selectedDashboard, actions]);
|
|
206153
206121
|
const handleSourceClick = useCallback(
|
|
206154
206122
|
(source2) => {
|
|
206155
206123
|
if (onSourceClick) {
|
|
@@ -206185,10 +206153,6 @@ const DashboardPanel = ({
|
|
|
206185
206153
|
},
|
|
206186
206154
|
[onMetricClick, events]
|
|
206187
206155
|
);
|
|
206188
|
-
const dataProvider = useMemo(() => {
|
|
206189
|
-
if (!dashboard) return void 0;
|
|
206190
|
-
return new MockDataProvider(dashboard);
|
|
206191
|
-
}, [dashboard]);
|
|
206192
206156
|
if (loading) {
|
|
206193
206157
|
return /* @__PURE__ */ jsxs(
|
|
206194
206158
|
"div",
|