@bian-womp/spark-workbench 0.2.33 → 0.2.34
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 +12 -5
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/index.js +12 -5
- package/lib/esm/index.js.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":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;AAa3E,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,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,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;AAa3E,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,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,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAmqBA"}
|
package/lib/esm/index.js
CHANGED
|
@@ -565,7 +565,10 @@ class LocalGraphRunner extends AbstractGraphRunner {
|
|
|
565
565
|
this.build(payload.def);
|
|
566
566
|
this.setEnvironment?.(payload.environment || {}, { merge: false });
|
|
567
567
|
// Hydrate via runtime for exact restore and re-emit
|
|
568
|
-
this.runtime?.hydrate({
|
|
568
|
+
this.runtime?.hydrate({
|
|
569
|
+
inputs: payload.inputs || {},
|
|
570
|
+
outputs: payload.outputs || {},
|
|
571
|
+
});
|
|
569
572
|
}
|
|
570
573
|
dispose() {
|
|
571
574
|
super.dispose();
|
|
@@ -1627,7 +1630,7 @@ function toReactFlow(def, positions, registry, opts) {
|
|
|
1627
1630
|
});
|
|
1628
1631
|
const edges = def.edges.map((e) => {
|
|
1629
1632
|
const st = opts.edgeStatus?.[e.id];
|
|
1630
|
-
const isRunning =
|
|
1633
|
+
const isRunning = (st?.activeRuns || 0) > 0;
|
|
1631
1634
|
const hasError = !!st?.lastError;
|
|
1632
1635
|
const isInvalidEdge = !!opts.edgeValidation?.[e.id];
|
|
1633
1636
|
const sourceMissing = !validHandleMap[e.source.nodeId]?.outputs.has(e.source.handle);
|
|
@@ -1664,7 +1667,7 @@ function getNodeBorderClassNames(args) {
|
|
|
1664
1667
|
const hasError = !!status.lastError;
|
|
1665
1668
|
const hasValidationError = issues.some((i) => i.level === "error");
|
|
1666
1669
|
const hasValidationWarning = !hasValidationError && issues.length > 0;
|
|
1667
|
-
const isRunning =
|
|
1670
|
+
const isRunning = (status.activeRuns || 0) > 0;
|
|
1668
1671
|
const isInvalid = !!status.invalidated && !isRunning && !hasError;
|
|
1669
1672
|
// Keep border width constant to avoid layout reflow on selection toggles
|
|
1670
1673
|
const borderWidth = "border";
|
|
@@ -2049,8 +2052,12 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, uiVer
|
|
|
2049
2052
|
const isValidRunId = runId && typeof runId === "string" && runId.length > 0;
|
|
2050
2053
|
setNodeStatus((prev) => {
|
|
2051
2054
|
const current = prev[id]?.activeRuns ?? 0;
|
|
2052
|
-
const nextActive = current - 1;
|
|
2053
2055
|
const currentRunIds = prev[id]?.activeRunIds ?? [];
|
|
2056
|
+
if (isValidRunId && !currentRunIds.includes(runId)) {
|
|
2057
|
+
console.warn(`[WorkbenchContext] node-done event for unknown runId: node=${id} runId=${runId}`, { event: s, currentRunIds });
|
|
2058
|
+
return prev; // Ignore stale event
|
|
2059
|
+
}
|
|
2060
|
+
const nextActive = Math.max(0, current - 1); // Prevent negative values
|
|
2054
2061
|
const nextRunIds = isValidRunId
|
|
2055
2062
|
? currentRunIds.filter((rid) => rid !== runId)
|
|
2056
2063
|
: currentRunIds;
|
|
@@ -2095,7 +2102,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, uiVer
|
|
|
2095
2102
|
const current = prev[id]?.activeRuns ?? 0;
|
|
2096
2103
|
return {
|
|
2097
2104
|
...prev,
|
|
2098
|
-
[id]: { ...prev[id], activeRuns: current - 1 },
|
|
2105
|
+
[id]: { ...prev[id], activeRuns: Math.max(0, current - 1) }, // Prevent negative values
|
|
2099
2106
|
};
|
|
2100
2107
|
});
|
|
2101
2108
|
}
|