@bian-womp/spark-workbench 0.2.59 → 0.2.60

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 CHANGED
@@ -688,13 +688,14 @@ class LocalGraphRunner extends AbstractGraphRunner {
688
688
  const environment = this.getEnvironment() || {};
689
689
  return { def, environment, inputs, outputs };
690
690
  }
691
- async applySnapshotFull(payload) {
692
- if (payload.def)
691
+ async applySnapshotFull(payload, options) {
692
+ if (payload.def && options?.skipBuild !== true) {
693
693
  this.build(payload.def);
694
+ }
694
695
  this.setEnvironment?.(payload.environment || {}, { merge: false });
695
- this.hydrateSnapshotFull(payload);
696
+ this.hydrate(payload);
696
697
  }
697
- hydrateSnapshotFull(snapshot) {
698
+ hydrate(snapshot) {
698
699
  // Hydrate via runtime for exact restore (this emits events on runtime emitter)
699
700
  this.runtime?.hydrate({
700
701
  inputs: snapshot.inputs || {},
@@ -1161,19 +1162,19 @@ class RemoteGraphRunner extends AbstractGraphRunner {
1161
1162
  return { def: undefined, environment: {}, inputs: {}, outputs: {} };
1162
1163
  }
1163
1164
  }
1164
- async applySnapshotFull(payload) {
1165
+ async applySnapshotFull(payload, options) {
1165
1166
  // Hydrate local cache first so UI can display values immediately
1166
- this.hydrateSnapshotFull(payload);
1167
+ this.hydrateValueCache(payload);
1167
1168
  // Then sync with backend
1168
1169
  const client = await this.ensureClient();
1169
- await client.applySnapshotFull(payload);
1170
+ await client.applySnapshotFull(payload, options);
1170
1171
  }
1171
1172
  /**
1172
1173
  * Hydrates the local valueCache from a snapshot and emits value events.
1173
1174
  * This ensures the UI can display inputs/outputs immediately without waiting
1174
1175
  * for value events from the remote backend.
1175
1176
  */
1176
- hydrateSnapshotFull(snapshot) {
1177
+ hydrateValueCache(snapshot) {
1177
1178
  // Hydrate inputs
1178
1179
  for (const [nodeId, map] of Object.entries(snapshot.inputs || {})) {
1179
1180
  for (const [handle, value] of Object.entries(map || {})) {
@@ -2077,7 +2078,7 @@ function getHandleClassName(args) {
2077
2078
  else {
2078
2079
  borderColor = "!border-gray-500 dark:!border-gray-400";
2079
2080
  }
2080
- return cx("!w-3 !h-3 !bg-white/50 !dark:bg-stone-900", borderColor, kind === "output" && "!rounded-none");
2081
+ return cx("!w-3 !h-3 !bg-white/50 !dark:bg-stone-900 wb-nodrag wb-nowheel", borderColor, kind === "output" && "!rounded-none");
2081
2082
  }
2082
2083
 
2083
2084
  function generateTimestamp() {
@@ -3186,7 +3187,7 @@ function NodeHandles({ data, isConnectable, getClassName, renderLabel, labelClas
3186
3187
  const key = `missing-input:${h.id}`;
3187
3188
  const position = h.position ?? react.Position.Left;
3188
3189
  const y = h.y;
3189
- const cls = "!w-3 !h-3 !bg-amber-400 !border-amber-500";
3190
+ const cls = "!w-3 !h-3 !bg-amber-400 !border-amber-500 wb-nodrag wb-nowheel";
3190
3191
  return (jsxRuntime.jsx(NodeHandleItem, { kind: "input", id: h.id, type: "target", position: position, y: y, isConnectable: false, className: `${cls} wb-nodrag wb-nowheel`, labelClassName: labelClassName, renderLabel: renderLabel }, key));
3191
3192
  }), (data.outputHandles ?? []).map((h) => {
3192
3193
  const placed = byId.get(`source:${h.id}`) ?? byId.get(h.id);
@@ -3199,7 +3200,7 @@ function NodeHandles({ data, isConnectable, getClassName, renderLabel, labelClas
3199
3200
  const position = h.position ?? react.Position.Right;
3200
3201
  const y = h.y;
3201
3202
  const cls = "!w-3 !h-3 !bg-amber-400 !border-amber-500 !rounded-none wb-nodrag wb-nowheel";
3202
- return (jsxRuntime.jsx(NodeHandleItem, { kind: "output", id: h.id, type: "source", position: position, y: y, isConnectable: false, className: `${cls} wb-nodrag wb-nowheel`, labelClassName: labelClassName, renderLabel: renderLabel }, key));
3203
+ return (jsxRuntime.jsx(NodeHandleItem, { kind: "output", id: h.id, type: "source", position: position, y: y, isConnectable: false, className: cls, labelClassName: labelClassName, renderLabel: renderLabel }, key));
3203
3204
  })] }));
3204
3205
  }
3205
3206