footprint-explainable-ui 0.14.7 → 0.14.9
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/flowchart.cjs +48 -46
- package/dist/flowchart.cjs.map +1 -1
- package/dist/flowchart.d.cts +0 -11
- package/dist/flowchart.d.ts +0 -11
- package/dist/flowchart.js +5 -3
- package/dist/flowchart.js.map +1 -1
- package/dist/index.cjs +56 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -11
- package/dist/index.d.ts +0 -11
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/flowchart.cjs
CHANGED
|
@@ -561,8 +561,8 @@ var StageNode = (0, import_react3.memo)(function StageNode2({
|
|
|
561
561
|
{
|
|
562
562
|
id: "loop-source",
|
|
563
563
|
type: "source",
|
|
564
|
-
position: import_react4.Position.
|
|
565
|
-
style: { background: "transparent", border: "none", width: 6, height: 6 }
|
|
564
|
+
position: import_react4.Position.Bottom,
|
|
565
|
+
style: { background: "transparent", border: "none", width: 6, height: 6, left: "75%" }
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
568
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -691,10 +691,11 @@ function FlowchartView({
|
|
|
691
691
|
}
|
|
692
692
|
|
|
693
693
|
// src/components/FlowchartView/TracedFlowchartView.tsx
|
|
694
|
-
var
|
|
695
|
-
var
|
|
694
|
+
var import_react8 = require("react");
|
|
695
|
+
var import_react9 = require("@xyflow/react");
|
|
696
696
|
|
|
697
697
|
// src/components/FlowchartView/specToReactFlow.ts
|
|
698
|
+
var import_react7 = require("@xyflow/react");
|
|
698
699
|
var DEFAULT_COLORS = {
|
|
699
700
|
edgeDefault: rawDefaults.colors.textMuted,
|
|
700
701
|
edgeExecuted: rawDefaults.colors.success,
|
|
@@ -852,7 +853,8 @@ function applyOverlay(layout, overlay, colors) {
|
|
|
852
853
|
targetHandle: "loop-target",
|
|
853
854
|
label: le.label ?? "loop",
|
|
854
855
|
type: "smoothstep",
|
|
855
|
-
pathOptions: { offset:
|
|
856
|
+
pathOptions: { offset: 60, borderRadius: 20 },
|
|
857
|
+
markerEnd: { type: import_react7.MarkerType.ArrowClosed, color: c.edgeLoop, width: 16, height: 16 },
|
|
856
858
|
style: {
|
|
857
859
|
stroke: c.edgeLoop,
|
|
858
860
|
strokeWidth: loopExecuted ? 3 : 2,
|
|
@@ -912,8 +914,8 @@ function specToReactFlow(spec, overlay, colors) {
|
|
|
912
914
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
913
915
|
var defaultNodeTypes = { stage: StageNode };
|
|
914
916
|
function FitViewOnResize() {
|
|
915
|
-
const { fitView } = (0,
|
|
916
|
-
(0,
|
|
917
|
+
const { fitView } = (0, import_react9.useReactFlow)();
|
|
918
|
+
(0, import_react8.useEffect)(() => {
|
|
917
919
|
const handler = () => {
|
|
918
920
|
requestAnimationFrame(() => fitView({ padding: 0.3 }));
|
|
919
921
|
};
|
|
@@ -937,7 +939,7 @@ function TracedFlowchartView({
|
|
|
937
939
|
style
|
|
938
940
|
}) {
|
|
939
941
|
const nodeTypes2 = customNodeTypes ?? defaultNodeTypes;
|
|
940
|
-
const overlay = (0,
|
|
942
|
+
const overlay = (0, import_react8.useMemo)(() => {
|
|
941
943
|
if (!snapshots || snapshots.length === 0) return void 0;
|
|
942
944
|
const executionOrder = snapshots.slice(0, snapshotIndex + 1).map((s) => s.stageLabel);
|
|
943
945
|
const doneStages = new Set(
|
|
@@ -948,21 +950,21 @@ function TracedFlowchartView({
|
|
|
948
950
|
if (activeStage) executedStages.add(activeStage);
|
|
949
951
|
return { doneStages, activeStage, executedStages, executionOrder };
|
|
950
952
|
}, [snapshots, snapshotIndex]);
|
|
951
|
-
const layout = (0,
|
|
953
|
+
const layout = (0, import_react8.useMemo)(() => {
|
|
952
954
|
if (!spec) return null;
|
|
953
955
|
return specToLayout(spec);
|
|
954
956
|
}, [spec]);
|
|
955
|
-
const flowData = (0,
|
|
957
|
+
const flowData = (0, import_react8.useMemo)(() => {
|
|
956
958
|
if (!layout) return { nodes: [], edges: [] };
|
|
957
959
|
return applyOverlay(layout, overlay);
|
|
958
960
|
}, [layout, overlay]);
|
|
959
|
-
const [nodes, setNodes, onNodesChange] = (0,
|
|
960
|
-
const [edges, setEdges, onEdgesChange] = (0,
|
|
961
|
-
(0,
|
|
961
|
+
const [nodes, setNodes, onNodesChange] = (0, import_react9.useNodesState)(flowData.nodes);
|
|
962
|
+
const [edges, setEdges, onEdgesChange] = (0, import_react9.useEdgesState)(flowData.edges);
|
|
963
|
+
(0, import_react8.useEffect)(() => {
|
|
962
964
|
setNodes(flowData.nodes);
|
|
963
965
|
setEdges(flowData.edges);
|
|
964
966
|
}, [flowData, setNodes, setEdges]);
|
|
965
|
-
const handleNodeClick = (0,
|
|
967
|
+
const handleNodeClick = (0, import_react8.useCallback)(
|
|
966
968
|
(_, node) => {
|
|
967
969
|
if (!onNodeClick) return;
|
|
968
970
|
onNodeClick(node.id);
|
|
@@ -976,7 +978,7 @@ function TracedFlowchartView({
|
|
|
976
978
|
style: { width: "100%", height: "100%", ...style },
|
|
977
979
|
"data-fp": "traced-flowchart",
|
|
978
980
|
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
979
|
-
|
|
981
|
+
import_react9.ReactFlow,
|
|
980
982
|
{
|
|
981
983
|
nodes,
|
|
982
984
|
edges,
|
|
@@ -997,7 +999,7 @@ function TracedFlowchartView({
|
|
|
997
999
|
elementsSelectable: !!onNodeClick,
|
|
998
1000
|
children: [
|
|
999
1001
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FitViewOnResize, {}),
|
|
1000
|
-
!unstyled && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1002
|
+
!unstyled && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react9.Background, { variant: import_react9.BackgroundVariant.Dots, gap: 16, size: 1 })
|
|
1001
1003
|
]
|
|
1002
1004
|
}
|
|
1003
1005
|
)
|
|
@@ -1006,9 +1008,9 @@ function TracedFlowchartView({
|
|
|
1006
1008
|
}
|
|
1007
1009
|
|
|
1008
1010
|
// src/components/FlowchartView/SubflowBreadcrumb.tsx
|
|
1009
|
-
var
|
|
1011
|
+
var import_react10 = require("react");
|
|
1010
1012
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1011
|
-
var SubflowBreadcrumb = (0,
|
|
1013
|
+
var SubflowBreadcrumb = (0, import_react10.memo)(function SubflowBreadcrumb2({
|
|
1012
1014
|
breadcrumbs,
|
|
1013
1015
|
onNavigate
|
|
1014
1016
|
}) {
|
|
@@ -1089,15 +1091,15 @@ var SubflowBreadcrumb = (0, import_react9.memo)(function SubflowBreadcrumb2({
|
|
|
1089
1091
|
});
|
|
1090
1092
|
|
|
1091
1093
|
// src/components/FlowchartView/useSubflowNavigation.ts
|
|
1092
|
-
var
|
|
1094
|
+
var import_react11 = require("react");
|
|
1093
1095
|
function useSubflowNavigation(rootSpec, overlay, colors) {
|
|
1094
|
-
const [stack, setStack] = (0,
|
|
1096
|
+
const [stack, setStack] = (0, import_react11.useState)([]);
|
|
1095
1097
|
const currentSpec = stack.length > 0 ? stack[stack.length - 1].spec : rootSpec;
|
|
1096
|
-
const { nodes, edges } = (0,
|
|
1098
|
+
const { nodes, edges } = (0, import_react11.useMemo)(() => {
|
|
1097
1099
|
if (!currentSpec) return { nodes: [], edges: [] };
|
|
1098
1100
|
return specToReactFlow(currentSpec, overlay, colors);
|
|
1099
1101
|
}, [currentSpec, overlay, colors]);
|
|
1100
|
-
const subflowMap = (0,
|
|
1102
|
+
const subflowMap = (0, import_react11.useMemo)(() => {
|
|
1101
1103
|
const map = /* @__PURE__ */ new Map();
|
|
1102
1104
|
if (!currentSpec) return map;
|
|
1103
1105
|
function collectSubflows(node) {
|
|
@@ -1111,7 +1113,7 @@ function useSubflowNavigation(rootSpec, overlay, colors) {
|
|
|
1111
1113
|
collectSubflows(currentSpec);
|
|
1112
1114
|
return map;
|
|
1113
1115
|
}, [currentSpec]);
|
|
1114
|
-
const breadcrumbs = (0,
|
|
1116
|
+
const breadcrumbs = (0, import_react11.useMemo)(() => {
|
|
1115
1117
|
const root = {
|
|
1116
1118
|
label: rootSpec?.name || "Flowchart",
|
|
1117
1119
|
spec: rootSpec,
|
|
@@ -1119,7 +1121,7 @@ function useSubflowNavigation(rootSpec, overlay, colors) {
|
|
|
1119
1121
|
};
|
|
1120
1122
|
return [root, ...stack];
|
|
1121
1123
|
}, [rootSpec, stack]);
|
|
1122
|
-
const handleNodeClick = (0,
|
|
1124
|
+
const handleNodeClick = (0, import_react11.useCallback)(
|
|
1123
1125
|
(nodeId) => {
|
|
1124
1126
|
const subflowNode = subflowMap.get(nodeId);
|
|
1125
1127
|
if (!subflowNode?.subflowStructure) return false;
|
|
@@ -1135,7 +1137,7 @@ function useSubflowNavigation(rootSpec, overlay, colors) {
|
|
|
1135
1137
|
},
|
|
1136
1138
|
[subflowMap]
|
|
1137
1139
|
);
|
|
1138
|
-
const navigateTo = (0,
|
|
1140
|
+
const navigateTo = (0, import_react11.useCallback)(
|
|
1139
1141
|
(level) => {
|
|
1140
1142
|
if (level === 0) {
|
|
1141
1143
|
setStack([]);
|
|
@@ -1157,7 +1159,7 @@ function useSubflowNavigation(rootSpec, overlay, colors) {
|
|
|
1157
1159
|
}
|
|
1158
1160
|
|
|
1159
1161
|
// src/components/FlowchartView/SubflowTree.tsx
|
|
1160
|
-
var
|
|
1162
|
+
var import_react12 = require("react");
|
|
1161
1163
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1162
1164
|
function specToTree(node) {
|
|
1163
1165
|
if (!node) return [];
|
|
@@ -1190,18 +1192,18 @@ function specToTree(node) {
|
|
|
1190
1192
|
walk(node);
|
|
1191
1193
|
return entries;
|
|
1192
1194
|
}
|
|
1193
|
-
var TreeNode = (0,
|
|
1195
|
+
var TreeNode = (0, import_react12.memo)(function TreeNode2({
|
|
1194
1196
|
entry,
|
|
1195
1197
|
depth,
|
|
1196
1198
|
activeStage,
|
|
1197
1199
|
doneStages,
|
|
1198
1200
|
onNodeSelect
|
|
1199
1201
|
}) {
|
|
1200
|
-
const [expanded, setExpanded] = (0,
|
|
1202
|
+
const [expanded, setExpanded] = (0, import_react12.useState)(true);
|
|
1201
1203
|
const hasChildren = entry.children && entry.children.length > 0;
|
|
1202
1204
|
const isActive = activeStage === entry.name;
|
|
1203
1205
|
const isDone = doneStages?.has(entry.name);
|
|
1204
|
-
const handleClick = (0,
|
|
1206
|
+
const handleClick = (0, import_react12.useCallback)(() => {
|
|
1205
1207
|
if (hasChildren) {
|
|
1206
1208
|
setExpanded((prev) => !prev);
|
|
1207
1209
|
}
|
|
@@ -1314,7 +1316,7 @@ var TreeNode = (0, import_react11.memo)(function TreeNode2({
|
|
|
1314
1316
|
)) })
|
|
1315
1317
|
] });
|
|
1316
1318
|
});
|
|
1317
|
-
var SectionLabel = (0,
|
|
1319
|
+
var SectionLabel = (0, import_react12.memo)(function SectionLabel2({ children }) {
|
|
1318
1320
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1319
1321
|
"div",
|
|
1320
1322
|
{
|
|
@@ -1330,7 +1332,7 @@ var SectionLabel = (0, import_react11.memo)(function SectionLabel2({ children })
|
|
|
1330
1332
|
}
|
|
1331
1333
|
);
|
|
1332
1334
|
});
|
|
1333
|
-
var SubflowTree = (0,
|
|
1335
|
+
var SubflowTree = (0, import_react12.memo)(function SubflowTree2({
|
|
1334
1336
|
spec,
|
|
1335
1337
|
activeStage,
|
|
1336
1338
|
doneStages,
|
|
@@ -1339,8 +1341,8 @@ var SubflowTree = (0, import_react11.memo)(function SubflowTree2({
|
|
|
1339
1341
|
className,
|
|
1340
1342
|
style
|
|
1341
1343
|
}) {
|
|
1342
|
-
const tree = (0,
|
|
1343
|
-
const subflowStages = (0,
|
|
1344
|
+
const tree = (0, import_react12.useMemo)(() => specToTree(spec), [spec]);
|
|
1345
|
+
const subflowStages = (0, import_react12.useMemo)(() => tree.filter((e) => e.isSubflow), [tree]);
|
|
1344
1346
|
if (subflowStages.length === 0) return null;
|
|
1345
1347
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1346
1348
|
"div",
|
|
@@ -1378,10 +1380,10 @@ var SubflowTree = (0, import_react11.memo)(function SubflowTree2({
|
|
|
1378
1380
|
});
|
|
1379
1381
|
|
|
1380
1382
|
// src/components/TimeTravelDebugger/TimeTravelDebugger.tsx
|
|
1381
|
-
var
|
|
1383
|
+
var import_react16 = require("react");
|
|
1382
1384
|
|
|
1383
1385
|
// src/components/MemoryInspector/MemoryInspector.tsx
|
|
1384
|
-
var
|
|
1386
|
+
var import_react13 = require("react");
|
|
1385
1387
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1386
1388
|
function MemoryInspector({
|
|
1387
1389
|
data,
|
|
@@ -1394,8 +1396,8 @@ function MemoryInspector({
|
|
|
1394
1396
|
className,
|
|
1395
1397
|
style
|
|
1396
1398
|
}) {
|
|
1397
|
-
const cacheRef = (0,
|
|
1398
|
-
const { memory, newKeys } = (0,
|
|
1399
|
+
const cacheRef = (0, import_react13.useRef)(null);
|
|
1400
|
+
const { memory, newKeys } = (0, import_react13.useMemo)(() => {
|
|
1399
1401
|
if (data) {
|
|
1400
1402
|
return { memory: data, newKeys: /* @__PURE__ */ new Set() };
|
|
1401
1403
|
}
|
|
@@ -1557,7 +1559,7 @@ function formatValue(value) {
|
|
|
1557
1559
|
}
|
|
1558
1560
|
|
|
1559
1561
|
// src/components/NarrativeLog/NarrativeLog.tsx
|
|
1560
|
-
var
|
|
1562
|
+
var import_react14 = require("react");
|
|
1561
1563
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1562
1564
|
function NarrativeLog({
|
|
1563
1565
|
snapshots,
|
|
@@ -1568,7 +1570,7 @@ function NarrativeLog({
|
|
|
1568
1570
|
className,
|
|
1569
1571
|
style
|
|
1570
1572
|
}) {
|
|
1571
|
-
const entries = (0,
|
|
1573
|
+
const entries = (0, import_react14.useMemo)(() => {
|
|
1572
1574
|
if (narrative) {
|
|
1573
1575
|
return [{ label: "Output", text: narrative, isCurrent: true }];
|
|
1574
1576
|
}
|
|
@@ -1690,7 +1692,7 @@ function NarrativeLog({
|
|
|
1690
1692
|
}
|
|
1691
1693
|
|
|
1692
1694
|
// src/components/GanttTimeline/GanttTimeline.tsx
|
|
1693
|
-
var
|
|
1695
|
+
var import_react15 = require("react");
|
|
1694
1696
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1695
1697
|
function GanttTimeline({
|
|
1696
1698
|
snapshots,
|
|
@@ -1702,10 +1704,10 @@ function GanttTimeline({
|
|
|
1702
1704
|
style,
|
|
1703
1705
|
maxVisibleRows = 5
|
|
1704
1706
|
}) {
|
|
1705
|
-
const [expanded, setExpanded] = (0,
|
|
1706
|
-
const activeRowRef = (0,
|
|
1707
|
-
const scrollContainerRef = (0,
|
|
1708
|
-
const totalWallTime = (0,
|
|
1707
|
+
const [expanded, setExpanded] = (0, import_react15.useState)(false);
|
|
1708
|
+
const activeRowRef = (0, import_react15.useRef)(null);
|
|
1709
|
+
const scrollContainerRef = (0, import_react15.useRef)(null);
|
|
1710
|
+
const totalWallTime = (0, import_react15.useMemo)(
|
|
1709
1711
|
() => Math.max(...snapshots.map((s) => s.startMs + s.durationMs), 1),
|
|
1710
1712
|
[snapshots]
|
|
1711
1713
|
);
|
|
@@ -1716,7 +1718,7 @@ function GanttTimeline({
|
|
|
1716
1718
|
const rowHeight = size === "compact" ? 18 : 22;
|
|
1717
1719
|
const collapsible = maxVisibleRows > 0 && snapshots.length > maxVisibleRows;
|
|
1718
1720
|
const showAll = expanded || !collapsible;
|
|
1719
|
-
(0,
|
|
1721
|
+
(0, import_react15.useEffect)(() => {
|
|
1720
1722
|
if (!showAll && activeRowRef.current && scrollContainerRef.current) {
|
|
1721
1723
|
activeRowRef.current.scrollIntoView({
|
|
1722
1724
|
block: "nearest",
|
|
@@ -1949,7 +1951,7 @@ function TimeTravelDebugger({
|
|
|
1949
1951
|
className,
|
|
1950
1952
|
style
|
|
1951
1953
|
}) {
|
|
1952
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
1954
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react16.useState)(0);
|
|
1953
1955
|
const fs = fontSize[size];
|
|
1954
1956
|
const pad = padding[size];
|
|
1955
1957
|
if (snapshots.length === 0) {
|