@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.
- package/dist/tmagic-editor.js +13 -4
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +13 -4
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +9 -9
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +8 -5
- package/src/services/codeBlock.ts +7 -1
- package/src/services/editor.ts +1 -0
package/dist/tmagic-editor.js
CHANGED
|
@@ -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
|
-
|
|
3547
|
-
services?.
|
|
3548
|
-
|
|
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");
|