@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.
@@ -2008,6 +2008,7 @@ class Editor$1 extends BaseService {
2008
2008
  await this.select(value.nodeId);
2009
2009
  this.get("stage")?.select(value.nodeId);
2010
2010
  }, 0);
2011
+ this.emit("history-change", value.data);
2011
2012
  }
2012
2013
  async toggleFixedPosition(dist, src, root) {
2013
2014
  const newConfig = cloneDeep(dist);
@@ -3543,10 +3544,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3543
3544
  });
3544
3545
  });
3545
3546
  };
3546
- onMounted(() => {
3547
- services?.codeBlockService.refreshAllRelations();
3548
- refreshCodeList();
3549
- });
3547
+ watch(
3548
+ () => services?.editorService.get("root"),
3549
+ () => {
3550
+ services?.codeBlockService.refreshAllRelations();
3551
+ refreshCodeList();
3552
+ }
3553
+ );
3550
3554
  watch(
3551
3555
  [() => services?.codeBlockService.getCodeDslSync(), () => services?.codeBlockService.getCombineInfo()],
3552
3556
  () => {
@@ -5712,6 +5716,11 @@ class CodeBlock extends BaseService {
5712
5716
  this.state.relations = this.deleteNodeRelation(node, this.state.relations);
5713
5717
  });
5714
5718
  });
5719
+ editorService.on("history-change", (page) => {
5720
+ const relations = {};
5721
+ this.getNodeRelation(page, relations, true);
5722
+ this.state.relations = relations;
5723
+ });
5715
5724
  }
5716
5725
  refreshAllRelations() {
5717
5726
  const root = editorService.get("root");