@tmagic/editor 1.0.2 → 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 +76 -32
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +76 -32
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/dist/types/src/Editor.vue.d.ts +2 -1
- package/dist/types/src/components/Icon.vue.d.ts +2 -1
- package/dist/types/src/components/ScrollViewer.vue.d.ts +2 -1
- package/dist/types/src/fields/Code.vue.d.ts +2 -1
- package/dist/types/src/fields/CodeLink.vue.d.ts +3 -1
- package/dist/types/src/layouts/AddPageBox.vue.d.ts +1 -1
- package/dist/types/src/layouts/CodeEditor.vue.d.ts +2 -1
- package/dist/types/src/layouts/Framework.vue.d.ts +2 -1
- package/dist/types/src/layouts/NavMenu.vue.d.ts +3 -1
- package/dist/types/src/layouts/PropsPanel.vue.d.ts +2 -1
- package/dist/types/src/layouts/Resizer.vue.d.ts +2 -1
- package/dist/types/src/layouts/sidebar/ComponentListPanel.vue.d.ts +2 -1
- package/dist/types/src/layouts/sidebar/Sidebar.vue.d.ts +3 -1
- package/dist/types/src/layouts/sidebar/TabPane.vue.d.ts +3 -1
- package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +2 -1
- package/dist/types/src/services/history.d.ts +1 -1
- package/package.json +13 -14
- package/src/Editor.vue +16 -4
- package/src/layouts/AddPageBox.vue +1 -1
- package/src/layouts/Framework.vue +1 -1
- package/src/layouts/PropsPanel.vue +12 -9
- package/src/layouts/sidebar/ComponentListPanel.vue +2 -0
- package/src/layouts/sidebar/LayerPanel.vue +2 -0
- package/src/layouts/sidebar/Sidebar.vue +9 -1
- package/src/layouts/sidebar/TabPane.vue +10 -0
- package/src/services/history.ts +1 -1
|
@@ -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,
|
|
@@ -1762,7 +1762,7 @@
|
|
|
1762
1762
|
}, [
|
|
1763
1763
|
vue.createVNode(_component_el_scrollbar, null, {
|
|
1764
1764
|
default: vue.withCtx(() => [
|
|
1765
|
-
vue.renderSlot(_ctx.$slots, "
|
|
1765
|
+
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
1766
1766
|
]),
|
|
1767
1767
|
_: 3
|
|
1768
1768
|
})
|
|
@@ -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,6 +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(() => [
|
|
2251
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
2247
2252
|
vue.createVNode(_component_el_collapse, {
|
|
2248
2253
|
class: "ui-component-panel",
|
|
2249
2254
|
"model-value": _ctx.collapseValue
|
|
@@ -2301,7 +2306,7 @@
|
|
|
2301
2306
|
_: 1
|
|
2302
2307
|
}, 8, ["model-value"])
|
|
2303
2308
|
]),
|
|
2304
|
-
_:
|
|
2309
|
+
_: 3
|
|
2305
2310
|
});
|
|
2306
2311
|
}
|
|
2307
2312
|
var ComponentListPanel = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b]]);
|
|
@@ -2666,6 +2671,7 @@
|
|
|
2666
2671
|
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
2667
2672
|
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, { class: "magic-editor-layer-panel" }, {
|
|
2668
2673
|
default: vue.withCtx(() => [
|
|
2674
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
2669
2675
|
vue.createVNode(_component_el_input, {
|
|
2670
2676
|
class: "filterInput",
|
|
2671
2677
|
size: "small",
|
|
@@ -2783,6 +2789,18 @@
|
|
|
2783
2789
|
]),
|
|
2784
2790
|
default: vue.withCtx(() => [
|
|
2785
2791
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.config.component), vue.mergeProps(_ctx.config.props || {}, vue.toHandlers(_ctx.config?.listeners || {})), vue.createSlots({ _: 2 }, [
|
|
2792
|
+
_ctx.data === "component-list" || _ctx.config.slots?.componentListPanelHeader ? {
|
|
2793
|
+
name: "component-list-panel-header",
|
|
2794
|
+
fn: vue.withCtx(() => [
|
|
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)
|
|
2796
|
+
])
|
|
2797
|
+
} : void 0,
|
|
2798
|
+
_ctx.data === "layer" || _ctx.config.slots?.layerPanelHeader ? {
|
|
2799
|
+
name: "layer-panel-header",
|
|
2800
|
+
fn: vue.withCtx(() => [
|
|
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)
|
|
2802
|
+
])
|
|
2803
|
+
} : void 0,
|
|
2786
2804
|
_ctx.config.slots?.layerNodeContent ? {
|
|
2787
2805
|
name: "layer-node-content",
|
|
2788
2806
|
fn: vue.withCtx(({ data, node }) => [
|
|
@@ -2794,7 +2812,7 @@
|
|
|
2794
2812
|
} : void 0
|
|
2795
2813
|
]), 1040))
|
|
2796
2814
|
]),
|
|
2797
|
-
_:
|
|
2815
|
+
_: 3
|
|
2798
2816
|
}, 8, ["name"])) : vue.createCommentVNode("", true);
|
|
2799
2817
|
}
|
|
2800
2818
|
var TabPane = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
|
|
@@ -2834,10 +2852,23 @@
|
|
|
2834
2852
|
return vue.openBlock(), vue.createBlock(_component_tab_pane, {
|
|
2835
2853
|
key: index,
|
|
2836
2854
|
data: item
|
|
2837
|
-
},
|
|
2855
|
+
}, vue.createSlots({ _: 2 }, [
|
|
2856
|
+
item === "layer" ? {
|
|
2857
|
+
name: "layer-panel-header",
|
|
2858
|
+
fn: vue.withCtx(() => [
|
|
2859
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
2860
|
+
])
|
|
2861
|
+
} : void 0,
|
|
2862
|
+
item === "component-list" ? {
|
|
2863
|
+
name: "component-list-panel-header",
|
|
2864
|
+
fn: vue.withCtx(() => [
|
|
2865
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header")
|
|
2866
|
+
])
|
|
2867
|
+
} : void 0
|
|
2868
|
+
]), 1032, ["data"]);
|
|
2838
2869
|
}), 128))
|
|
2839
2870
|
]),
|
|
2840
|
-
_:
|
|
2871
|
+
_: 3
|
|
2841
2872
|
}, 8, ["modelValue"])) : vue.createCommentVNode("", true);
|
|
2842
2873
|
}
|
|
2843
2874
|
var Sidebar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
|
|
@@ -4012,7 +4043,15 @@
|
|
|
4012
4043
|
]),
|
|
4013
4044
|
sidebar: vue.withCtx(() => [
|
|
4014
4045
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: _ctx.editorService }, () => [
|
|
4015
|
-
vue.createVNode(_component_sidebar, { data: _ctx.sidebar },
|
|
4046
|
+
vue.createVNode(_component_sidebar, { data: _ctx.sidebar }, {
|
|
4047
|
+
"layer-panel-header": vue.withCtx(() => [
|
|
4048
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
4049
|
+
]),
|
|
4050
|
+
"component-list-panel-header": vue.withCtx(() => [
|
|
4051
|
+
vue.renderSlot(_ctx.$slots, "component-list-panel-header")
|
|
4052
|
+
]),
|
|
4053
|
+
_: 3
|
|
4054
|
+
}, 8, ["data"])
|
|
4016
4055
|
])
|
|
4017
4056
|
]),
|
|
4018
4057
|
workspace: vue.withCtx(() => [
|
|
@@ -4031,12 +4070,17 @@
|
|
|
4031
4070
|
})
|
|
4032
4071
|
])
|
|
4033
4072
|
]),
|
|
4034
|
-
|
|
4035
|
-
vue.renderSlot(_ctx.$slots, "
|
|
4073
|
+
"props-panel": vue.withCtx(() => [
|
|
4074
|
+
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
4036
4075
|
vue.createVNode(_component_props_panel, {
|
|
4037
4076
|
ref: "propsPanel",
|
|
4038
4077
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
4039
|
-
},
|
|
4078
|
+
}, {
|
|
4079
|
+
"props-panel-header": vue.withCtx(() => [
|
|
4080
|
+
vue.renderSlot(_ctx.$slots, "props-panel-header")
|
|
4081
|
+
]),
|
|
4082
|
+
_: 3
|
|
4083
|
+
}, 512)
|
|
4040
4084
|
])
|
|
4041
4085
|
]),
|
|
4042
4086
|
empty: vue.withCtx(() => [
|