@bian-womp/spark-workbench 0.2.42 → 0.2.44
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 +21 -40
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/cjs/src/runtime/RemoteGraphRunner.d.ts +0 -1
- package/lib/cjs/src/runtime/RemoteGraphRunner.d.ts.map +1 -1
- package/lib/esm/index.js +21 -40
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/src/runtime/RemoteGraphRunner.d.ts +0 -1
- package/lib/esm/src/runtime/RemoteGraphRunner.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;AASf,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;AASf,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,2CAouBA"}
|
|
@@ -7,7 +7,6 @@ export declare class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
7
7
|
protected lastDef?: GraphDefinition;
|
|
8
8
|
protected client?: RuntimeApiClient;
|
|
9
9
|
private clientPromise?;
|
|
10
|
-
private customEventUnsubscribe?;
|
|
11
10
|
private transportStatusUnsubscribe?;
|
|
12
11
|
private disposed;
|
|
13
12
|
private valueCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteGraphRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/RemoteGraphRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBA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,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBzE,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA6BxE,gBAAgB,CACd,GAAG,EAAE,eAAe,GACnB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAW1C,OAAO,IAAI,IAAI;CAkChB"}
|
package/lib/esm/index.js
CHANGED
|
@@ -734,11 +734,7 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
734
734
|
/**
|
|
735
735
|
* Setup event subscriptions for the client.
|
|
736
736
|
*/
|
|
737
|
-
setupClientSubscriptions(client
|
|
738
|
-
// Subscribe to custom events (for additional listeners if needed)
|
|
739
|
-
if (backend.onCustomEvent) {
|
|
740
|
-
this.customEventUnsubscribe = client.subscribeCustomEvents(backend.onCustomEvent);
|
|
741
|
-
}
|
|
737
|
+
setupClientSubscriptions(client) {
|
|
742
738
|
// Subscribe to transport status changes
|
|
743
739
|
// Convert RuntimeApiClient.TransportStatus to IGraphRunner.TransportStatus
|
|
744
740
|
this.transportStatusUnsubscribe = client.onTransportStatus((status) => {
|
|
@@ -770,7 +766,7 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
770
766
|
onCustomEvent: backend.onCustomEvent,
|
|
771
767
|
});
|
|
772
768
|
// Setup event subscriptions
|
|
773
|
-
this.setupClientSubscriptions(client
|
|
769
|
+
this.setupClientSubscriptions(client);
|
|
774
770
|
// Connect the client (this will create and connect transport)
|
|
775
771
|
await client.connect();
|
|
776
772
|
this.client = client;
|
|
@@ -1124,11 +1120,8 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
1124
1120
|
super.dispose();
|
|
1125
1121
|
// Clear client promise if any
|
|
1126
1122
|
this.clientPromise = undefined;
|
|
1127
|
-
// Unsubscribe from
|
|
1128
|
-
|
|
1129
|
-
this.customEventUnsubscribe();
|
|
1130
|
-
this.customEventUnsubscribe = undefined;
|
|
1131
|
-
}
|
|
1123
|
+
// Unsubscribe from transport status
|
|
1124
|
+
// Note: Custom events are cleaned up automatically when client is disposed
|
|
1132
1125
|
if (this.transportStatusUnsubscribe) {
|
|
1133
1126
|
this.transportStatusUnsubscribe();
|
|
1134
1127
|
this.transportStatusUnsubscribe = undefined;
|
|
@@ -2055,35 +2048,23 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, uiVer
|
|
|
2055
2048
|
];
|
|
2056
2049
|
return next.length > 200 ? next.slice(0, 200) : next;
|
|
2057
2050
|
});
|
|
2058
|
-
// Helper to
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
const
|
|
2066
|
-
const
|
|
2067
|
-
|
|
2068
|
-
n
|
|
2069
|
-
|
|
2070
|
-
let changed = false;
|
|
2071
|
-
for (const n of cur.nodes) {
|
|
2072
|
-
const rn = byId.get(n.nodeId);
|
|
2073
|
-
if (rn && rn.resolvedHandles) {
|
|
2074
|
-
const before = JSON.stringify(n.resolvedHandles || {});
|
|
2075
|
-
const after = JSON.stringify(rn.resolvedHandles || {});
|
|
2076
|
-
if (before !== after) {
|
|
2077
|
-
n.resolvedHandles = rn.resolvedHandles;
|
|
2078
|
-
changed = true;
|
|
2079
|
-
}
|
|
2080
|
-
}
|
|
2051
|
+
// Helper to apply resolved handles from event payload to workbench
|
|
2052
|
+
const applyResolvedHandles = (resolvedHandles) => {
|
|
2053
|
+
const cur = wb.export();
|
|
2054
|
+
let changed = false;
|
|
2055
|
+
for (const n of cur.nodes) {
|
|
2056
|
+
const updated = resolvedHandles[n.nodeId];
|
|
2057
|
+
if (updated) {
|
|
2058
|
+
const before = JSON.stringify(n.resolvedHandles || {});
|
|
2059
|
+
const after = JSON.stringify(updated);
|
|
2060
|
+
if (before !== after) {
|
|
2061
|
+
n.resolvedHandles = updated;
|
|
2062
|
+
changed = true;
|
|
2081
2063
|
}
|
|
2082
|
-
if (changed)
|
|
2083
|
-
wb.refreshValidation();
|
|
2084
2064
|
}
|
|
2085
2065
|
}
|
|
2086
|
-
|
|
2066
|
+
if (changed)
|
|
2067
|
+
wb.refreshValidation();
|
|
2087
2068
|
};
|
|
2088
2069
|
const offRunnerValue = runner.on("value", (e) => {
|
|
2089
2070
|
if (e?.io === "input") {
|
|
@@ -2165,9 +2146,9 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, uiVer
|
|
|
2165
2146
|
return add("runner", "error")(e);
|
|
2166
2147
|
});
|
|
2167
2148
|
const offRunnerInvalidate = runner.on("invalidate", (e) => {
|
|
2168
|
-
//
|
|
2169
|
-
if (e?.
|
|
2170
|
-
|
|
2149
|
+
// If resolvedHandles are included in the event, use them directly (more efficient)
|
|
2150
|
+
if (e?.resolvedHandles && Object.keys(e.resolvedHandles).length > 0) {
|
|
2151
|
+
applyResolvedHandles(e.resolvedHandles);
|
|
2171
2152
|
}
|
|
2172
2153
|
return add("runner", "invalidate")(e);
|
|
2173
2154
|
});
|