@tmagic/editor 1.0.0-beta.5 → 1.0.0-beta.8
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/LICENSE +5432 -0
- package/dist/style.css +10 -0
- package/dist/tmagic-editor.es.js +9 -3
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +9 -3
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +9 -8
- package/src/layouts/PropsPanel.vue +1 -0
- package/src/services/editor.ts +7 -1
- package/src/theme/props-panel.scss +14 -0
- package/src/utils/scroll-viewer.ts +5 -3
package/dist/style.css
CHANGED
|
@@ -441,6 +441,16 @@
|
|
|
441
441
|
.m-editor-props-panel .el-tabs__item {
|
|
442
442
|
font-size: 12px;
|
|
443
443
|
}
|
|
444
|
+
.m-editor-props-panel span,
|
|
445
|
+
.m-editor-props-panel a,
|
|
446
|
+
.m-editor-props-panel p {
|
|
447
|
+
font-size: 12px;
|
|
448
|
+
}
|
|
449
|
+
.m-editor-props-panel-popper span,
|
|
450
|
+
.m-editor-props-panel-popper a,
|
|
451
|
+
.m-editor-props-panel-popper p {
|
|
452
|
+
font-size: 12px;
|
|
453
|
+
}
|
|
444
454
|
.magic-editor-content-menu {
|
|
445
455
|
position: fixed;
|
|
446
456
|
font-size: 12px;
|
package/dist/tmagic-editor.es.js
CHANGED
|
@@ -843,6 +843,9 @@ class Editor$1 extends BaseService {
|
|
|
843
843
|
const { node, parent, page } = this.getNodeInfo(id);
|
|
844
844
|
if (!node)
|
|
845
845
|
throw new Error("\u83B7\u53D6\u4E0D\u5230\u7EC4\u4EF6\u4FE1\u606F");
|
|
846
|
+
if (node.id === this.state.root?.id) {
|
|
847
|
+
throw new Error("\u4E0D\u80FD\u9009\u6839\u8282\u70B9");
|
|
848
|
+
}
|
|
846
849
|
this.set("node", node);
|
|
847
850
|
this.set("page", page || null);
|
|
848
851
|
this.set("parent", parent || null);
|
|
@@ -910,7 +913,7 @@ class Editor$1 extends BaseService {
|
|
|
910
913
|
throw new Error(`\u83B7\u53D6\u4E0D\u5230id\u4E3A${config2.id}\u7684\u8282\u70B9`);
|
|
911
914
|
const node = cloneDeep(toRaw(info.node));
|
|
912
915
|
let newConfig = await this.toggleFixedPosition(toRaw(config2), node, this.get("root"));
|
|
913
|
-
newConfig = mergeWith(node, newConfig, (objValue, srcValue) => {
|
|
916
|
+
newConfig = mergeWith(cloneDeep(node), newConfig, (objValue, srcValue) => {
|
|
914
917
|
if (Array.isArray(srcValue)) {
|
|
915
918
|
return srcValue;
|
|
916
919
|
}
|
|
@@ -955,6 +958,7 @@ class Editor$1 extends BaseService {
|
|
|
955
958
|
parent.items.splice(index2, 0, ...parent.items.splice(index1, 1));
|
|
956
959
|
await this.update(parent);
|
|
957
960
|
await this.select(node);
|
|
961
|
+
this.get("stage")?.update({ config: cloneDeep(node), root: this.get("root") });
|
|
958
962
|
this.addModifiedNodeId(parent.id);
|
|
959
963
|
this.pushHistoryState();
|
|
960
964
|
}
|
|
@@ -2998,6 +3002,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2998
3002
|
const _component_m_form = resolveComponent("m-form");
|
|
2999
3003
|
return openBlock(), createBlock(_component_m_form, {
|
|
3000
3004
|
class: "m-editor-props-panel",
|
|
3005
|
+
"popper-class": "m-editor-props-panel-popper",
|
|
3001
3006
|
ref: "configForm",
|
|
3002
3007
|
size: "small",
|
|
3003
3008
|
"init-values": _ctx.values,
|
|
@@ -3712,10 +3717,11 @@ class ScrollViewer$1 {
|
|
|
3712
3717
|
event.preventDefault();
|
|
3713
3718
|
event.stopImmediatePropagation();
|
|
3714
3719
|
event.stopPropagation();
|
|
3715
|
-
}
|
|
3720
|
+
}
|
|
3721
|
+
if (event.code !== Keys.ESCAPE || !this.enter || this.keydown) {
|
|
3716
3722
|
return;
|
|
3723
|
+
}
|
|
3717
3724
|
this.keydown = true;
|
|
3718
|
-
event.preventDefault();
|
|
3719
3725
|
this.target.style.cursor = "grab";
|
|
3720
3726
|
this.container.addEventListener("mousedown", this.mousedownHandler);
|
|
3721
3727
|
};
|