@bian-womp/spark-remote 0.3.64 → 0.3.66

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
@@ -488,10 +488,15 @@ async function createServerRuntimeAdapter(id, createRegistry, send, extensions)
488
488
  if (!extData || typeof extData !== "object" || Array.isArray(extData)) {
489
489
  extData = {};
490
490
  }
491
+ let hasCustomUpdate = false;
491
492
  for (const { path, value } of updates) {
492
493
  const pathSegments = sparkGraph.parseJsonPath(path);
493
- sparkGraph.setValueAtPathWithCreation(extData, pathSegments, value);
494
+ const updated = sparkGraph.setValueAtPathWithCreation(extData, pathSegments, value);
495
+ if (updated && pathSegments.length > 0 && pathSegments[0] === "custom") {
496
+ hasCustomUpdate = true;
497
+ }
494
498
  }
499
+ return hasCustomUpdate;
495
500
  },
496
501
  snapshot: async () => {
497
502
  const inputs = {};
@@ -1039,9 +1044,11 @@ class RemoteGraphLifecycleApi {
1039
1044
  }
1040
1045
  async updateExtData(updates) {
1041
1046
  const transport = await this.ensureConnected();
1042
- await transport.request({
1047
+ const res = await transport.request({
1043
1048
  message: { type: "UpdateExtData", payload: updates },
1044
1049
  });
1050
+ const payload = res?.message || {};
1051
+ return payload.hasCustomUpdate ?? false;
1045
1052
  }
1046
1053
  async setViewport(viewport) {
1047
1054
  const transport = await this.ensureConnected();
@@ -1610,8 +1617,8 @@ class ServerCommandHandler {
1610
1617
  break;
1611
1618
  }
1612
1619
  case "UpdateExtData": {
1613
- await this.adapter.updateExtData(msg.payload);
1614
- ack();
1620
+ const hasCustomUpdate = await this.adapter.updateExtData(msg.payload);
1621
+ ack({ hasCustomUpdate });
1615
1622
  break;
1616
1623
  }
1617
1624
  case "Dispose": {