@tmagic/editor 1.2.0-beta.18 → 1.2.0-beta.19
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.mjs +21 -12
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +20 -11
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +22 -13
- package/src/layouts/workspace/Stage.vue +10 -1
- package/src/layouts/workspace/Workspace.vue +1 -1
- package/src/services/editor.ts +4 -6
- package/src/services/history.ts +4 -14
- package/src/services/props.ts +1 -1
- package/src/type.ts +39 -12
- package/src/utils/stage.ts +2 -2
- package/types/Editor.vue.d.ts +40 -27
- package/types/layouts/workspace/Stage.vue.d.ts +2 -1
- package/types/services/editor.d.ts +3 -6
- package/types/services/history.d.ts +4 -14
- package/types/services/props.d.ts +1 -1
- package/types/type.d.ts +31 -13
|
@@ -1177,6 +1177,7 @@
|
|
|
1177
1177
|
this.state.pageSteps[this.state.pageId] = undoRedo;
|
|
1178
1178
|
}
|
|
1179
1179
|
this.setCanUndoRedo();
|
|
1180
|
+
this.emit("page-change", this.state.pageSteps[this.state.pageId]);
|
|
1180
1181
|
}
|
|
1181
1182
|
empty() {
|
|
1182
1183
|
this.state.pageId = void 0;
|
|
@@ -1507,7 +1508,7 @@
|
|
|
1507
1508
|
this.setPropsValue(utils.toLine(type), values[type]);
|
|
1508
1509
|
});
|
|
1509
1510
|
}
|
|
1510
|
-
setPropsValue(type, value) {
|
|
1511
|
+
async setPropsValue(type, value) {
|
|
1511
1512
|
this.state.propsValueMap[type] = value;
|
|
1512
1513
|
}
|
|
1513
1514
|
async getPropsValue(type, { inputEvent, ...defaultValue } = {}) {
|
|
@@ -2592,7 +2593,7 @@
|
|
|
2592
2593
|
stage.on("highlight", (el) => {
|
|
2593
2594
|
editorService.highlight(el.id);
|
|
2594
2595
|
});
|
|
2595
|
-
stage.on("
|
|
2596
|
+
stage.on("multi-select", (els) => {
|
|
2596
2597
|
editorService.multiSelect(els.map((el) => el.id));
|
|
2597
2598
|
});
|
|
2598
2599
|
stage.on("update", (ev) => {
|
|
@@ -2612,7 +2613,7 @@
|
|
|
2612
2613
|
editorService.select(parent);
|
|
2613
2614
|
editorService.get("stage").select(parent.id);
|
|
2614
2615
|
});
|
|
2615
|
-
stage.on("
|
|
2616
|
+
stage.on("change-guides", (e) => {
|
|
2616
2617
|
uiService.set("showGuides", true);
|
|
2617
2618
|
if (!root.value || !page.value)
|
|
2618
2619
|
return;
|
|
@@ -5489,6 +5490,14 @@
|
|
|
5489
5490
|
runtime.updateRootConfig?.(lodashEs.cloneDeep(vue.toRaw(root2)));
|
|
5490
5491
|
}
|
|
5491
5492
|
});
|
|
5493
|
+
vue.watch(page, (page2) => {
|
|
5494
|
+
if (runtime && page2) {
|
|
5495
|
+
runtime.updatePageId?.(page2.id);
|
|
5496
|
+
vue.nextTick(() => {
|
|
5497
|
+
stage?.select(page2.id);
|
|
5498
|
+
});
|
|
5499
|
+
}
|
|
5500
|
+
});
|
|
5492
5501
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
5493
5502
|
for (const { contentRect } of entries) {
|
|
5494
5503
|
services?.uiService.set("stageContainerRect", {
|
|
@@ -5710,10 +5719,10 @@
|
|
|
5710
5719
|
}, [
|
|
5711
5720
|
vue.createVNode(_sfc_main$8),
|
|
5712
5721
|
vue.renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
5713
|
-
(vue.openBlock(), vue.createBlock(_sfc_main$2, {
|
|
5714
|
-
key:
|
|
5722
|
+
vue.unref(page) ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
|
|
5723
|
+
key: 0,
|
|
5715
5724
|
"stage-content-menu": __props.stageContentMenu
|
|
5716
|
-
}, null, 8, ["stage-content-menu"]))
|
|
5725
|
+
}, null, 8, ["stage-content-menu"])) : vue.createCommentVNode("", true)
|
|
5717
5726
|
]),
|
|
5718
5727
|
vue.renderSlot(_ctx.$slots, "workspace-content"),
|
|
5719
5728
|
vue.createVNode(_sfc_main$6, null, {
|
|
@@ -5772,6 +5781,10 @@
|
|
|
5772
5781
|
sidebar: {
|
|
5773
5782
|
type: Object
|
|
5774
5783
|
},
|
|
5784
|
+
menu: {
|
|
5785
|
+
type: Object,
|
|
5786
|
+
default: () => ({ left: [], right: [] })
|
|
5787
|
+
},
|
|
5775
5788
|
layerContentMenu: {
|
|
5776
5789
|
type: Array,
|
|
5777
5790
|
default: () => []
|
|
@@ -5780,10 +5793,6 @@
|
|
|
5780
5793
|
type: Array,
|
|
5781
5794
|
default: () => []
|
|
5782
5795
|
},
|
|
5783
|
-
menu: {
|
|
5784
|
-
type: Object,
|
|
5785
|
-
default: () => ({ left: [], right: [] })
|
|
5786
|
-
},
|
|
5787
5796
|
render: {
|
|
5788
5797
|
type: Function
|
|
5789
5798
|
},
|
|
@@ -5817,7 +5826,7 @@
|
|
|
5817
5826
|
},
|
|
5818
5827
|
containerHighlightClassName: {
|
|
5819
5828
|
type: String,
|
|
5820
|
-
default: StageCore.
|
|
5829
|
+
default: StageCore.CONTAINER_HIGHLIGHT_CLASS_NAME
|
|
5821
5830
|
},
|
|
5822
5831
|
containerHighlightDuration: {
|
|
5823
5832
|
type: Number,
|