@tmagic/editor 1.2.4 → 1.2.5

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.
@@ -2025,6 +2025,7 @@
2025
2025
  await this.select(value.nodeId);
2026
2026
  this.get("stage")?.select(value.nodeId);
2027
2027
  }, 0);
2028
+ this.emit("history-change", value.data);
2028
2029
  }
2029
2030
  async toggleFixedPosition(dist, src, root) {
2030
2031
  const newConfig = lodashEs.cloneDeep(dist);
@@ -3560,10 +3561,13 @@
3560
3561
  });
3561
3562
  });
3562
3563
  };
3563
- vue.onMounted(() => {
3564
- services?.codeBlockService.refreshAllRelations();
3565
- refreshCodeList();
3566
- });
3564
+ vue.watch(
3565
+ () => services?.editorService.get("root"),
3566
+ () => {
3567
+ services?.codeBlockService.refreshAllRelations();
3568
+ refreshCodeList();
3569
+ }
3570
+ );
3567
3571
  vue.watch(
3568
3572
  [() => services?.codeBlockService.getCodeDslSync(), () => services?.codeBlockService.getCombineInfo()],
3569
3573
  () => {
@@ -5729,6 +5733,11 @@
5729
5733
  this.state.relations = this.deleteNodeRelation(node, this.state.relations);
5730
5734
  });
5731
5735
  });
5736
+ editorService.on("history-change", (page) => {
5737
+ const relations = {};
5738
+ this.getNodeRelation(page, relations, true);
5739
+ this.state.relations = relations;
5740
+ });
5732
5741
  }
5733
5742
  refreshAllRelations() {
5734
5743
  const root = editorService.get("root");