@tmagic/editor 1.0.4 → 1.0.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.es.js +49 -40
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +49 -40
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/Editor.vue +9 -5
- package/src/layouts/PropsPanel.vue +12 -9
- package/src/layouts/sidebar/ComponentListPanel.vue +2 -1
- package/src/layouts/sidebar/LayerPanel.vue +1 -1
- package/src/layouts/sidebar/Sidebar.vue +4 -4
- package/src/layouts/sidebar/TabPane.vue +6 -4
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
-
const _hoisted_1$
|
|
209
|
+
const _hoisted_1$d = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
210
210
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
211
211
|
const _component_el_button = vue.resolveComponent("el-button");
|
|
212
212
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
style: { "padding": "0" }
|
|
223
223
|
}, {
|
|
224
224
|
default: vue.withCtx(() => [
|
|
225
|
-
_hoisted_1$
|
|
225
|
+
_hoisted_1$d
|
|
226
226
|
]),
|
|
227
227
|
_: 1
|
|
228
228
|
}, 8, ["icon"])
|
|
@@ -387,12 +387,12 @@
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
|
-
const _hoisted_1$
|
|
390
|
+
const _hoisted_1$c = {
|
|
391
391
|
ref: "codeEditor",
|
|
392
392
|
class: "magic-code-editor"
|
|
393
393
|
};
|
|
394
394
|
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
395
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
395
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, null, 512);
|
|
396
396
|
}
|
|
397
397
|
var CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j]]);
|
|
398
398
|
|
|
@@ -1613,13 +1613,13 @@
|
|
|
1613
1613
|
};
|
|
1614
1614
|
}
|
|
1615
1615
|
});
|
|
1616
|
-
const _hoisted_1$
|
|
1616
|
+
const _hoisted_1$b = { class: "m-editor-empty-panel" };
|
|
1617
1617
|
const _hoisted_2$4 = { class: "m-editor-empty-content" };
|
|
1618
1618
|
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u65B0\u589E\u9875\u9762", -1);
|
|
1619
1619
|
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1620
1620
|
const _component_plus = vue.resolveComponent("plus");
|
|
1621
1621
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
1622
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1622
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
1623
1623
|
vue.createElementVNode("div", _hoisted_2$4, [
|
|
1624
1624
|
vue.createElementVNode("div", {
|
|
1625
1625
|
class: "m-editor-empty-button",
|
|
@@ -1682,12 +1682,12 @@
|
|
|
1682
1682
|
};
|
|
1683
1683
|
}
|
|
1684
1684
|
});
|
|
1685
|
-
const _hoisted_1$
|
|
1685
|
+
const _hoisted_1$a = {
|
|
1686
1686
|
ref: "target",
|
|
1687
1687
|
class: "m-editor-resizer"
|
|
1688
1688
|
};
|
|
1689
1689
|
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1690
|
-
return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$
|
|
1690
|
+
return vue.openBlock(), vue.createElementBlock("span", _hoisted_1$a, [
|
|
1691
1691
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1692
1692
|
], 512);
|
|
1693
1693
|
}
|
|
@@ -1722,7 +1722,7 @@
|
|
|
1722
1722
|
};
|
|
1723
1723
|
}
|
|
1724
1724
|
});
|
|
1725
|
-
const _hoisted_1$
|
|
1725
|
+
const _hoisted_1$9 = { class: "m-editor" };
|
|
1726
1726
|
const _hoisted_2$3 = {
|
|
1727
1727
|
key: 1,
|
|
1728
1728
|
class: "m-editor-content"
|
|
@@ -1732,7 +1732,7 @@
|
|
|
1732
1732
|
const _component_resizer = vue.resolveComponent("resizer");
|
|
1733
1733
|
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
1734
1734
|
const _component_add_page_box = vue.resolveComponent("add-page-box");
|
|
1735
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1735
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
1736
1736
|
vue.renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
|
|
1737
1737
|
_ctx.showSrc ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
|
|
1738
1738
|
key: 0,
|
|
@@ -1789,7 +1789,7 @@
|
|
|
1789
1789
|
};
|
|
1790
1790
|
}
|
|
1791
1791
|
});
|
|
1792
|
-
const _hoisted_1$
|
|
1792
|
+
const _hoisted_1$8 = ["src"];
|
|
1793
1793
|
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1794
1794
|
const _component_edit = vue.resolveComponent("edit");
|
|
1795
1795
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -1801,7 +1801,7 @@
|
|
|
1801
1801
|
})) : typeof _ctx.icon === "string" && _ctx.icon.startsWith("http") ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
1802
1802
|
key: 1,
|
|
1803
1803
|
src: _ctx.icon
|
|
1804
|
-
}, null, 8, _hoisted_1$
|
|
1804
|
+
}, null, 8, _hoisted_1$8)) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
1805
1805
|
key: 2,
|
|
1806
1806
|
class: vue.normalizeClass(_ctx.icon)
|
|
1807
1807
|
}, null, 2)) : (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 3 }, {
|
|
@@ -1973,7 +1973,7 @@
|
|
|
1973
1973
|
};
|
|
1974
1974
|
}
|
|
1975
1975
|
});
|
|
1976
|
-
const _hoisted_1$
|
|
1976
|
+
const _hoisted_1$7 = {
|
|
1977
1977
|
key: 1,
|
|
1978
1978
|
class: "menu-item-text"
|
|
1979
1979
|
};
|
|
@@ -2003,7 +2003,7 @@
|
|
|
2003
2003
|
_ctx.item.type === "divider" ? (vue.openBlock(), vue.createBlock(_component_el_divider, {
|
|
2004
2004
|
key: 0,
|
|
2005
2005
|
direction: _ctx.item.direction || "vertical"
|
|
2006
|
-
}, null, 8, ["direction"])) : _ctx.item.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2006
|
+
}, null, 8, ["direction"])) : _ctx.item.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, vue.toDisplayString(_ctx.item.text), 1)) : _ctx.item.type === "zoom" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
2007
2007
|
vue.createVNode(_component_tool_button, {
|
|
2008
2008
|
data: { type: "button", icon: _ctx.ZoomOut, handler: _ctx.zoomOutHandler, tooltip: "\u7F29\u5C0F" },
|
|
2009
2009
|
"event-type": _ctx.eventType
|
|
@@ -2184,17 +2184,21 @@
|
|
|
2184
2184
|
};
|
|
2185
2185
|
}
|
|
2186
2186
|
});
|
|
2187
|
+
const _hoisted_1$6 = { class: "`m-editor-props-panel" };
|
|
2187
2188
|
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2188
2189
|
const _component_m_form = vue.resolveComponent("m-form");
|
|
2189
|
-
return vue.openBlock(), vue.
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2190
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
2191
|
+
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
2192
|
+
vue.createVNode(_component_m_form, {
|
|
2193
|
+
class: vue.normalizeClass(`m-editor-props-panel ${_ctx.propsPanelSize}`),
|
|
2194
|
+
"popper-class": `m-editor-props-panel-popper ${_ctx.propsPanelSize}`,
|
|
2195
|
+
ref: "configForm",
|
|
2196
|
+
size: _ctx.propsPanelSize,
|
|
2197
|
+
"init-values": _ctx.values,
|
|
2198
|
+
config: _ctx.curFormConfig,
|
|
2199
|
+
onChange: _ctx.submit
|
|
2200
|
+
}, null, 8, ["class", "popper-class", "size", "init-values", "config", "onChange"])
|
|
2201
|
+
]);
|
|
2198
2202
|
}
|
|
2199
2203
|
var PropsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c]]);
|
|
2200
2204
|
|
|
@@ -2244,7 +2248,7 @@
|
|
|
2244
2248
|
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
2245
2249
|
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, null, {
|
|
2246
2250
|
default: vue.withCtx(() => [
|
|
2247
|
-
vue.renderSlot(_ctx.$slots, "component-list-panel"),
|
|
2251
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
2248
2252
|
vue.createVNode(_component_el_collapse, {
|
|
2249
2253
|
class: "ui-component-panel",
|
|
2250
2254
|
"model-value": _ctx.collapseValue
|
|
@@ -2667,7 +2671,7 @@
|
|
|
2667
2671
|
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
2668
2672
|
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, { class: "magic-editor-layer-panel" }, {
|
|
2669
2673
|
default: vue.withCtx(() => [
|
|
2670
|
-
vue.renderSlot(_ctx.$slots, "layer-panel"),
|
|
2674
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
2671
2675
|
vue.createVNode(_component_el_input, {
|
|
2672
2676
|
class: "filterInput",
|
|
2673
2677
|
size: "small",
|
|
@@ -2785,16 +2789,16 @@
|
|
|
2785
2789
|
]),
|
|
2786
2790
|
default: vue.withCtx(() => [
|
|
2787
2791
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.config.component), vue.mergeProps(_ctx.config.props || {}, vue.toHandlers(_ctx.config?.listeners || {})), vue.createSlots({ _: 2 }, [
|
|
2788
|
-
_ctx.data === "
|
|
2789
|
-
name: "
|
|
2792
|
+
_ctx.data === "component-list" || _ctx.config.slots?.componentListPanelHeader ? {
|
|
2793
|
+
name: "component-list-panel-header",
|
|
2790
2794
|
fn: vue.withCtx(() => [
|
|
2791
|
-
vue.renderSlot(_ctx.$slots, "
|
|
2795
|
+
_ctx.data === "component-list" ? vue.renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : _ctx.config.slots?.componentListPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.config.slots.componentListPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
2792
2796
|
])
|
|
2793
2797
|
} : void 0,
|
|
2794
|
-
_ctx.data === "
|
|
2795
|
-
name: "
|
|
2798
|
+
_ctx.data === "layer" || _ctx.config.slots?.layerPanelHeader ? {
|
|
2799
|
+
name: "layer-panel-header",
|
|
2796
2800
|
fn: vue.withCtx(() => [
|
|
2797
|
-
vue.renderSlot(_ctx.$slots, "
|
|
2801
|
+
_ctx.data === "layer" ? vue.renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : _ctx.config.slots?.layerPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.config.slots.layerPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
2798
2802
|
])
|
|
2799
2803
|
} : void 0,
|
|
2800
2804
|
_ctx.config.slots?.layerNodeContent ? {
|
|
@@ -2850,15 +2854,15 @@
|
|
|
2850
2854
|
data: item
|
|
2851
2855
|
}, vue.createSlots({ _: 2 }, [
|
|
2852
2856
|
item === "layer" ? {
|
|
2853
|
-
name: "layer-panel",
|
|
2857
|
+
name: "layer-panel-header",
|
|
2854
2858
|
fn: vue.withCtx(() => [
|
|
2855
|
-
vue.renderSlot(_ctx.$slots, "layer-panel")
|
|
2859
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
2856
2860
|
])
|
|
2857
2861
|
} : void 0,
|
|
2858
2862
|
item === "component-list" ? {
|
|
2859
|
-
name: "component-list-panel",
|
|
2863
|
+
name: "component-list-panel-header",
|
|
2860
2864
|
fn: vue.withCtx(() => [
|
|
2861
|
-
vue.renderSlot(_ctx.$slots, "component-list-panel")
|
|
2865
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header")
|
|
2862
2866
|
])
|
|
2863
2867
|
} : void 0
|
|
2864
2868
|
]), 1032, ["data"]);
|
|
@@ -4040,11 +4044,11 @@
|
|
|
4040
4044
|
sidebar: vue.withCtx(() => [
|
|
4041
4045
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: _ctx.editorService }, () => [
|
|
4042
4046
|
vue.createVNode(_component_sidebar, { data: _ctx.sidebar }, {
|
|
4043
|
-
"layer-panel": vue.withCtx(() => [
|
|
4044
|
-
vue.renderSlot(_ctx.$slots, "layer-panel")
|
|
4047
|
+
"layer-panel-header": vue.withCtx(() => [
|
|
4048
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
4045
4049
|
]),
|
|
4046
|
-
"component-list-panel": vue.withCtx(() => [
|
|
4047
|
-
vue.renderSlot(_ctx.$slots, "component-list-panel")
|
|
4050
|
+
"component-list-panel-header": vue.withCtx(() => [
|
|
4051
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header")
|
|
4048
4052
|
]),
|
|
4049
4053
|
_: 3
|
|
4050
4054
|
}, 8, ["data"])
|
|
@@ -4071,7 +4075,12 @@
|
|
|
4071
4075
|
vue.createVNode(_component_props_panel, {
|
|
4072
4076
|
ref: "propsPanel",
|
|
4073
4077
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
4074
|
-
},
|
|
4078
|
+
}, {
|
|
4079
|
+
"props-panel-header": vue.withCtx(() => [
|
|
4080
|
+
vue.renderSlot(_ctx.$slots, "props-panel-header")
|
|
4081
|
+
]),
|
|
4082
|
+
_: 3
|
|
4083
|
+
}, 512)
|
|
4075
4084
|
])
|
|
4076
4085
|
]),
|
|
4077
4086
|
empty: vue.withCtx(() => [
|