@bian-womp/spark-workbench 0.2.6 → 0.2.7
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/lib/cjs/index.cjs +14 -22
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/WorkbenchCanvas.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/index.js +14 -22
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/WorkbenchCanvas.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchCanvas.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAiB9E,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,eAAe;iBAGX,OAAO;cACV,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM;eAC3C,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO;yBACvC,CACnB,MAAM,EAAE,MAAM,KACX;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;+
|
|
1
|
+
{"version":3,"file":"WorkbenchCanvas.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAiB9E,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,eAAe;iBAGX,OAAO;cACV,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM;eAC3C,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO;yBACvC,CACnB,MAAM,EAAE,MAAM,KACX;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;+CAyUpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;AAiB3E,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAshBA"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1286,7 +1286,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1286
1286
|
const FALLBACK_TOTAL_MS = 2 * 60 * 1000;
|
|
1287
1287
|
const [fallbackStarts, setFallbackStarts] = useState({});
|
|
1288
1288
|
// Track runs that emitted an error so we can keep progress on completion
|
|
1289
|
-
const
|
|
1289
|
+
const errorRunsRef = useRef({});
|
|
1290
1290
|
// Periodically advance fallback progress for running nodes without explicit progress
|
|
1291
1291
|
useEffect(() => {
|
|
1292
1292
|
const interval = setInterval(() => {
|
|
@@ -1449,6 +1449,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
else if (nodeError.nodeId) {
|
|
1451
1451
|
const nodeId = nodeError.nodeId;
|
|
1452
|
+
const runId = nodeError.runId;
|
|
1452
1453
|
setNodeStatus((s) => ({
|
|
1453
1454
|
...s,
|
|
1454
1455
|
[nodeId]: {
|
|
@@ -1457,11 +1458,11 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1457
1458
|
},
|
|
1458
1459
|
}));
|
|
1459
1460
|
// Mark this runId as errored
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1462
|
-
...
|
|
1463
|
-
[
|
|
1464
|
-
}
|
|
1461
|
+
if (runId) {
|
|
1462
|
+
errorRunsRef.current[nodeId] = {
|
|
1463
|
+
...errorRunsRef.current[nodeId],
|
|
1464
|
+
[runId]: true,
|
|
1465
|
+
};
|
|
1465
1466
|
}
|
|
1466
1467
|
}
|
|
1467
1468
|
return add("runner", "error")(e);
|
|
@@ -1514,38 +1515,29 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, children, }) {
|
|
|
1514
1515
|
setNodeStatus((prev) => {
|
|
1515
1516
|
const current = prev[id]?.activeRuns ?? 0;
|
|
1516
1517
|
const nextActive = current - 1;
|
|
1517
|
-
const hadError = !!(runId &&
|
|
1518
|
+
const hadError = !!(runId && errorRunsRef.current[id]?.[runId]);
|
|
1518
1519
|
const keepProgress = hadError || nextActive > 0;
|
|
1520
|
+
// Clear error flag for this runId
|
|
1521
|
+
if (runId && errorRunsRef.current[id]?.[runId]) {
|
|
1522
|
+
delete errorRunsRef.current[id]?.[runId];
|
|
1523
|
+
}
|
|
1519
1524
|
return {
|
|
1520
1525
|
...prev,
|
|
1521
1526
|
[id]: {
|
|
1522
1527
|
...prev[id],
|
|
1523
1528
|
activeRuns: nextActive,
|
|
1524
1529
|
progress: keepProgress ? prev[id]?.progress : 0,
|
|
1530
|
+
lastError: hadError ? prev[id]?.lastError : undefined,
|
|
1525
1531
|
},
|
|
1526
1532
|
};
|
|
1527
1533
|
});
|
|
1528
1534
|
// Clear fallback start timestamp if no more active runs
|
|
1529
1535
|
setFallbackStarts((prev) => {
|
|
1530
|
-
prev[id];
|
|
1531
1536
|
const nextPrev = { ...prev };
|
|
1532
1537
|
// If we don't know nextActive here, conservatively clear to stop animation
|
|
1533
1538
|
delete nextPrev[id];
|
|
1534
1539
|
return nextPrev;
|
|
1535
1540
|
});
|
|
1536
|
-
// Clear error flag for this runId
|
|
1537
|
-
if (runId) {
|
|
1538
|
-
setErrorRuns((prev) => {
|
|
1539
|
-
const nodeMap = { ...(prev[id] || {}) };
|
|
1540
|
-
delete nodeMap[runId];
|
|
1541
|
-
const next = { ...prev };
|
|
1542
|
-
if (Object.keys(nodeMap).length === 0)
|
|
1543
|
-
delete next[id];
|
|
1544
|
-
else
|
|
1545
|
-
next[id] = nodeMap;
|
|
1546
|
-
return next;
|
|
1547
|
-
});
|
|
1548
|
-
}
|
|
1549
1541
|
}
|
|
1550
1542
|
else if (s.kind === "edge-start") {
|
|
1551
1543
|
const id = s.edgeId;
|
|
@@ -2465,7 +2457,7 @@ const WorkbenchCanvas = React.forwardRef(({ showValues, toString, toElement, get
|
|
|
2465
2457
|
const addNodeAt = (typeId, pos) => {
|
|
2466
2458
|
wb.addNode({ typeId, position: pos });
|
|
2467
2459
|
};
|
|
2468
|
-
return (jsx("div", { className: "w-full h-full", onContextMenu: onContextMenu, children: jsx(ReactFlowProvider, { children: jsxs(ReactFlow, { nodes: throttled.nodes, edges: throttled.edges, nodeTypes: nodeTypes,
|
|
2460
|
+
return (jsx("div", { className: "w-full h-full", onContextMenu: onContextMenu, children: jsx(ReactFlowProvider, { children: jsxs(ReactFlow, { nodes: throttled.nodes, edges: throttled.edges, nodeTypes: nodeTypes, selectionOnDrag: true, onInit: (inst) => (rfInstanceRef.current = inst), onConnect: onConnect, onEdgesChange: onEdgesChange, onEdgesDelete: onEdgesDelete, onNodesDelete: onNodesDelete, onNodesChange: onNodesChange, deleteKeyCode: ["Backspace", "Delete"], proOptions: { hideAttribution: true }, noDragClassName: "wb-nodrag", noWheelClassName: "wb-nowheel", noPanClassName: "wb-nopan", fitView: true, children: [jsx(Background, { id: "workbench-canvas-background", variant: BackgroundVariant.Dots, gap: 12, size: 1 }), jsx(MiniMap, {}), jsx(Controls, {}), jsx(DefaultContextMenu, { open: menuOpen, clientPos: menuPos, onAdd: addNodeAt, onClose: () => setMenuOpen(false) }), jsx(NodeContextMenu, { open: nodeMenuOpen, clientPos: nodeMenuPos, nodeId: nodeAtMenu, onClose: () => setNodeMenuOpen(false) })] }) }) }));
|
|
2469
2461
|
});
|
|
2470
2462
|
|
|
2471
2463
|
function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, example, onExampleChange, engine, onEngineChange, backendKind, onBackendKindChange, httpBaseUrl, onHttpBaseUrlChange, wsUrl, onWsUrlChange, debug, onDebugChange, showValues, onShowValuesChange, hideWorkbench, onHideWorkbenchChange, overrides, onInit, onChange, }) {
|