@tmagic/editor 1.1.0-beta.6 → 1.1.0-beta.7
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 +163 -155
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +162 -154
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/fields/UISelect.vue +0 -1
- package/src/index.ts +1 -1
- package/src/layouts/workspace/PageBar.vue +43 -161
- package/src/layouts/workspace/PageBarScrollContainer.vue +111 -0
- package/types/fields/UISelect.vue.d.ts +0 -4
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +48 -0
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
window.globalThis = window;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const _sfc_main$
|
|
40
|
+
const _sfc_main$n = vue.defineComponent({
|
|
41
41
|
name: "m-fields-vs-code",
|
|
42
42
|
props: ["model", "name", "config", "prop"],
|
|
43
43
|
emits: ["change"],
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
onSave: _ctx.save
|
|
73
73
|
}, null, 8, ["style", "init-values", "language", "onSave"]);
|
|
74
74
|
}
|
|
75
|
-
const Code = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
75
|
+
const Code = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$g]]);
|
|
76
76
|
|
|
77
|
-
const _sfc_main$
|
|
77
|
+
const _sfc_main$m = vue.defineComponent({
|
|
78
78
|
name: "m-fields-code-link",
|
|
79
79
|
props: {
|
|
80
80
|
config: {
|
|
@@ -139,13 +139,12 @@
|
|
|
139
139
|
onChange: _ctx.changeHandler
|
|
140
140
|
}, null, 8, ["config", "model", "onChange"]);
|
|
141
141
|
}
|
|
142
|
-
const CodeLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
142
|
+
const CodeLink = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$f]]);
|
|
143
143
|
|
|
144
144
|
const _hoisted_1$d = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
145
|
-
const _sfc_main$
|
|
145
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
146
146
|
__name: "UISelect",
|
|
147
147
|
props: {
|
|
148
|
-
labelWidth: null,
|
|
149
148
|
config: null,
|
|
150
149
|
model: null,
|
|
151
150
|
prop: null,
|
|
@@ -269,7 +268,7 @@
|
|
|
269
268
|
}
|
|
270
269
|
return value;
|
|
271
270
|
};
|
|
272
|
-
const _sfc_main$
|
|
271
|
+
const _sfc_main$k = vue.defineComponent({
|
|
273
272
|
name: "magic-code-editor",
|
|
274
273
|
props: {
|
|
275
274
|
initValues: {
|
|
@@ -384,7 +383,7 @@
|
|
|
384
383
|
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
385
384
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, null, 512);
|
|
386
385
|
}
|
|
387
|
-
const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
386
|
+
const CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$e]]);
|
|
388
387
|
|
|
389
388
|
let $TMAGIC_EDITOR = {};
|
|
390
389
|
const setConfig = (option) => {
|
|
@@ -1852,7 +1851,7 @@
|
|
|
1852
1851
|
}
|
|
1853
1852
|
};
|
|
1854
1853
|
|
|
1855
|
-
const _sfc_main$
|
|
1854
|
+
const _sfc_main$j = vue.defineComponent({
|
|
1856
1855
|
components: { Plus: iconsVue.Plus },
|
|
1857
1856
|
setup() {
|
|
1858
1857
|
const services = vue.inject("services");
|
|
@@ -1872,7 +1871,7 @@
|
|
|
1872
1871
|
|
|
1873
1872
|
const _hoisted_1$b = { class: "m-editor-empty-panel" };
|
|
1874
1873
|
const _hoisted_2$4 = { class: "m-editor-empty-content" };
|
|
1875
|
-
const _hoisted_3$
|
|
1874
|
+
const _hoisted_3$1 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u65B0\u589E\u9875\u9762", -1);
|
|
1876
1875
|
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1877
1876
|
const _component_plus = vue.resolveComponent("plus");
|
|
1878
1877
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -1890,14 +1889,14 @@
|
|
|
1890
1889
|
_: 1
|
|
1891
1890
|
})
|
|
1892
1891
|
]),
|
|
1893
|
-
_hoisted_3$
|
|
1892
|
+
_hoisted_3$1
|
|
1894
1893
|
])
|
|
1895
1894
|
])
|
|
1896
1895
|
]);
|
|
1897
1896
|
}
|
|
1898
|
-
const AddPageBox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1897
|
+
const AddPageBox = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$d]]);
|
|
1899
1898
|
|
|
1900
|
-
const _sfc_main$
|
|
1899
|
+
const _sfc_main$i = vue.defineComponent({
|
|
1901
1900
|
name: "m-editor-resize",
|
|
1902
1901
|
props: {
|
|
1903
1902
|
type: {
|
|
@@ -1949,9 +1948,9 @@
|
|
|
1949
1948
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1950
1949
|
], 512);
|
|
1951
1950
|
}
|
|
1952
|
-
const Resizer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1951
|
+
const Resizer = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$c]]);
|
|
1953
1952
|
|
|
1954
|
-
const _sfc_main$
|
|
1953
|
+
const _sfc_main$h = vue.defineComponent({
|
|
1955
1954
|
components: {
|
|
1956
1955
|
AddPageBox,
|
|
1957
1956
|
Resizer
|
|
@@ -2032,9 +2031,9 @@
|
|
|
2032
2031
|
]))
|
|
2033
2032
|
]);
|
|
2034
2033
|
}
|
|
2035
|
-
const Framework = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2034
|
+
const Framework = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$b]]);
|
|
2036
2035
|
|
|
2037
|
-
const _sfc_main$
|
|
2036
|
+
const _sfc_main$g = vue.defineComponent({
|
|
2038
2037
|
name: "m-icon",
|
|
2039
2038
|
components: { Edit: iconsVue.Edit },
|
|
2040
2039
|
props: {
|
|
@@ -2071,7 +2070,7 @@
|
|
|
2071
2070
|
_: 1
|
|
2072
2071
|
}));
|
|
2073
2072
|
}
|
|
2074
|
-
const MIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2073
|
+
const MIcon = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$a]]);
|
|
2075
2074
|
|
|
2076
2075
|
const _hoisted_1$7 = {
|
|
2077
2076
|
key: 1,
|
|
@@ -2081,8 +2080,8 @@
|
|
|
2081
2080
|
class: "menu-item-text",
|
|
2082
2081
|
style: { "margin": "0 5px" }
|
|
2083
2082
|
};
|
|
2084
|
-
const _hoisted_3
|
|
2085
|
-
const _sfc_main$
|
|
2083
|
+
const _hoisted_3 = { class: "el-dropdown-link menubar-menu-button" };
|
|
2084
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
2086
2085
|
__name: "ToolButton",
|
|
2087
2086
|
props: {
|
|
2088
2087
|
data: {
|
|
@@ -2325,7 +2324,7 @@
|
|
|
2325
2324
|
})) : vue.createCommentVNode("", true)
|
|
2326
2325
|
]),
|
|
2327
2326
|
default: vue.withCtx(() => [
|
|
2328
|
-
vue.createElementVNode("span", _hoisted_3
|
|
2327
|
+
vue.createElementVNode("span", _hoisted_3, [
|
|
2329
2328
|
vue.createTextVNode(vue.toDisplayString(vue.unref(item).text), 1),
|
|
2330
2329
|
vue.createVNode(_component_el_icon, { class: "el-icon--right" }, {
|
|
2331
2330
|
default: vue.withCtx(() => [
|
|
@@ -2342,9 +2341,9 @@
|
|
|
2342
2341
|
}
|
|
2343
2342
|
});
|
|
2344
2343
|
|
|
2345
|
-
const _sfc_main$
|
|
2344
|
+
const _sfc_main$e = vue.defineComponent({
|
|
2346
2345
|
name: "nav-menu",
|
|
2347
|
-
components: { ToolButton: _sfc_main$
|
|
2346
|
+
components: { ToolButton: _sfc_main$f },
|
|
2348
2347
|
props: {
|
|
2349
2348
|
data: {
|
|
2350
2349
|
type: Object,
|
|
@@ -2385,9 +2384,9 @@
|
|
|
2385
2384
|
}), 128))
|
|
2386
2385
|
], 4);
|
|
2387
2386
|
}
|
|
2388
|
-
const NavMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2387
|
+
const NavMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$9]]);
|
|
2389
2388
|
|
|
2390
|
-
const _sfc_main$
|
|
2389
|
+
const _sfc_main$d = vue.defineComponent({
|
|
2391
2390
|
name: "m-editor-props-panel",
|
|
2392
2391
|
emits: ["mounted"],
|
|
2393
2392
|
setup(props, { emit }) {
|
|
@@ -2451,9 +2450,9 @@
|
|
|
2451
2450
|
}, null, 8, ["class", "popper-class", "size", "init-values", "config", "onChange"])
|
|
2452
2451
|
]);
|
|
2453
2452
|
}
|
|
2454
|
-
const PropsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2453
|
+
const PropsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$8]]);
|
|
2455
2454
|
|
|
2456
|
-
const _sfc_main$
|
|
2455
|
+
const _sfc_main$c = vue.defineComponent({
|
|
2457
2456
|
name: "ui-component-panel",
|
|
2458
2457
|
components: { MIcon },
|
|
2459
2458
|
setup() {
|
|
@@ -2594,9 +2593,9 @@
|
|
|
2594
2593
|
_: 3
|
|
2595
2594
|
});
|
|
2596
2595
|
}
|
|
2597
|
-
const ComponentListPanel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2596
|
+
const ComponentListPanel = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$7]]);
|
|
2598
2597
|
|
|
2599
|
-
const _sfc_main$
|
|
2598
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
2600
2599
|
__name: "ContentMenu",
|
|
2601
2600
|
props: {
|
|
2602
2601
|
menuData: { default: () => [] },
|
|
@@ -2685,7 +2684,7 @@
|
|
|
2685
2684
|
}, [
|
|
2686
2685
|
vue.createElementVNode("div", null, [
|
|
2687
2686
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.menuData, (item, index) => {
|
|
2688
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2687
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$f, {
|
|
2689
2688
|
"event-type": "mouseup",
|
|
2690
2689
|
data: item,
|
|
2691
2690
|
key: index,
|
|
@@ -2709,8 +2708,8 @@
|
|
|
2709
2708
|
}
|
|
2710
2709
|
});
|
|
2711
2710
|
|
|
2712
|
-
const _sfc_main$
|
|
2713
|
-
components: { ContentMenu: _sfc_main$
|
|
2711
|
+
const _sfc_main$a = vue.defineComponent({
|
|
2712
|
+
components: { ContentMenu: _sfc_main$b },
|
|
2714
2713
|
setup() {
|
|
2715
2714
|
const services = vue.inject("services");
|
|
2716
2715
|
const menu = vue.ref();
|
|
@@ -2801,7 +2800,7 @@
|
|
|
2801
2800
|
style: { "overflow": "initial" }
|
|
2802
2801
|
}, null, 8, ["menu-data"]);
|
|
2803
2802
|
}
|
|
2804
|
-
const LayerMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2803
|
+
const LayerMenu = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$6]]);
|
|
2805
2804
|
|
|
2806
2805
|
const throttleTime = 150;
|
|
2807
2806
|
const select = async (data, editorService) => {
|
|
@@ -2901,7 +2900,7 @@
|
|
|
2901
2900
|
tree.value?.filter(val);
|
|
2902
2901
|
}
|
|
2903
2902
|
});
|
|
2904
|
-
const _sfc_main$
|
|
2903
|
+
const _sfc_main$9 = vue.defineComponent({
|
|
2905
2904
|
name: "magic-editor-layer-panel",
|
|
2906
2905
|
components: { LayerMenu },
|
|
2907
2906
|
setup() {
|
|
@@ -3012,9 +3011,9 @@
|
|
|
3012
3011
|
_: 3
|
|
3013
3012
|
});
|
|
3014
3013
|
}
|
|
3015
|
-
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3014
|
+
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$5]]);
|
|
3016
3015
|
|
|
3017
|
-
const _sfc_main$
|
|
3016
|
+
const _sfc_main$8 = vue.defineComponent({
|
|
3018
3017
|
components: { MIcon },
|
|
3019
3018
|
props: {
|
|
3020
3019
|
data: {
|
|
@@ -3102,9 +3101,9 @@
|
|
|
3102
3101
|
_: 3
|
|
3103
3102
|
}, 8, ["name"])) : vue.createCommentVNode("", true);
|
|
3104
3103
|
}
|
|
3105
|
-
const TabPane = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3104
|
+
const TabPane = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$4]]);
|
|
3106
3105
|
|
|
3107
|
-
const _sfc_main$
|
|
3106
|
+
const _sfc_main$7 = vue.defineComponent({
|
|
3108
3107
|
components: { TabPane },
|
|
3109
3108
|
name: "m-sidebar",
|
|
3110
3109
|
props: {
|
|
@@ -3159,89 +3158,69 @@
|
|
|
3159
3158
|
_: 3
|
|
3160
3159
|
}, 8, ["modelValue"])) : vue.createCommentVNode("", true);
|
|
3161
3160
|
}
|
|
3162
|
-
const Sidebar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3161
|
+
const Sidebar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3]]);
|
|
3163
3162
|
|
|
3164
|
-
const
|
|
3165
|
-
|
|
3166
|
-
ref: "pageBar"
|
|
3167
|
-
};
|
|
3168
|
-
const _hoisted_2 = ["onClick"];
|
|
3169
|
-
const _hoisted_3 = { class: "m-editor-page-bar-title" };
|
|
3170
|
-
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3171
|
-
__name: "PageBar",
|
|
3163
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
3164
|
+
__name: "PageBarScrollContainer",
|
|
3172
3165
|
setup(__props) {
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
}
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
}
|
|
3201
|
-
} else if (type === "right") {
|
|
3202
|
-
translateLeft -= 100;
|
|
3203
|
-
if (-translateLeft > maxScrollLeft) {
|
|
3204
|
-
translateLeft = -maxScrollLeft;
|
|
3205
|
-
}
|
|
3206
|
-
} else if (type === "start") {
|
|
3166
|
+
const services = vue.inject("services");
|
|
3167
|
+
const editorService = services?.editorService;
|
|
3168
|
+
const pageBar = vue.ref();
|
|
3169
|
+
const itemsContainer = vue.ref();
|
|
3170
|
+
const pageBarWidth = vue.ref(0);
|
|
3171
|
+
const canScroll = vue.ref(false);
|
|
3172
|
+
const itemsContainerWidth = vue.computed(() => pageBarWidth.value - 105);
|
|
3173
|
+
let translateLeft = 0;
|
|
3174
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
3175
|
+
for (const { contentRect } of entries) {
|
|
3176
|
+
const { width } = contentRect;
|
|
3177
|
+
pageBarWidth.value = width || 0;
|
|
3178
|
+
setCanScroll();
|
|
3179
|
+
}
|
|
3180
|
+
});
|
|
3181
|
+
const setCanScroll = () => {
|
|
3182
|
+
if (itemsContainer.value) {
|
|
3183
|
+
canScroll.value = itemsContainer.value.scrollWidth > pageBarWidth.value - 105;
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
const scroll = (type) => {
|
|
3187
|
+
if (!itemsContainer.value)
|
|
3188
|
+
return;
|
|
3189
|
+
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
3190
|
+
if (type === "left") {
|
|
3191
|
+
translateLeft += 100;
|
|
3192
|
+
if (translateLeft > 0) {
|
|
3207
3193
|
translateLeft = 0;
|
|
3208
|
-
}
|
|
3194
|
+
}
|
|
3195
|
+
} else if (type === "right") {
|
|
3196
|
+
translateLeft -= 100;
|
|
3197
|
+
if (-translateLeft > maxScrollLeft) {
|
|
3209
3198
|
translateLeft = -maxScrollLeft;
|
|
3210
3199
|
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
|
-
resizeObserver.disconnect();
|
|
3218
|
-
});
|
|
3219
|
-
vue.watch(() => root2.value?.items.length, (length = 0, preLength = 0) => {
|
|
3220
|
-
setTimeout(() => {
|
|
3221
|
-
setCanScroll();
|
|
3222
|
-
if (length < preLength) {
|
|
3223
|
-
scroll("start");
|
|
3224
|
-
} else {
|
|
3225
|
-
scroll("end");
|
|
3226
|
-
}
|
|
3227
|
-
});
|
|
3228
|
-
});
|
|
3229
|
-
return {
|
|
3230
|
-
pageBar,
|
|
3231
|
-
itemsContainer,
|
|
3232
|
-
canScroll,
|
|
3233
|
-
itemsContainerWidth,
|
|
3234
|
-
scroll
|
|
3235
|
-
};
|
|
3200
|
+
} else if (type === "start") {
|
|
3201
|
+
translateLeft = 0;
|
|
3202
|
+
} else if (type === "end") {
|
|
3203
|
+
translateLeft = -maxScrollLeft;
|
|
3204
|
+
}
|
|
3205
|
+
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
3236
3206
|
};
|
|
3237
|
-
|
|
3238
|
-
|
|
3207
|
+
vue.onMounted(() => {
|
|
3208
|
+
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
3209
|
+
});
|
|
3210
|
+
vue.onUnmounted(() => {
|
|
3211
|
+
resizeObserver.disconnect();
|
|
3212
|
+
});
|
|
3239
3213
|
const root = vue.computed(() => editorService?.get("root"));
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3214
|
+
vue.watch(() => root.value?.items.length, (length = 0, preLength = 0) => {
|
|
3215
|
+
setTimeout(() => {
|
|
3216
|
+
setCanScroll();
|
|
3217
|
+
if (length < preLength) {
|
|
3218
|
+
scroll("start");
|
|
3219
|
+
} else {
|
|
3220
|
+
scroll("end");
|
|
3221
|
+
}
|
|
3222
|
+
});
|
|
3223
|
+
});
|
|
3245
3224
|
const addPage = () => {
|
|
3246
3225
|
if (!editorService)
|
|
3247
3226
|
return;
|
|
@@ -3251,21 +3230,13 @@
|
|
|
3251
3230
|
};
|
|
3252
3231
|
editorService.add(pageConfig);
|
|
3253
3232
|
};
|
|
3254
|
-
const copy = (node) => {
|
|
3255
|
-
node && editorService?.copy(node);
|
|
3256
|
-
editorService?.paste({
|
|
3257
|
-
left: 0,
|
|
3258
|
-
top: 0
|
|
3259
|
-
});
|
|
3260
|
-
};
|
|
3261
|
-
const remove = (node) => {
|
|
3262
|
-
editorService?.remove(node);
|
|
3263
|
-
};
|
|
3264
3233
|
return (_ctx, _cache) => {
|
|
3265
3234
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3235
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3236
|
+
class: "m-editor-page-bar",
|
|
3237
|
+
ref_key: "pageBar",
|
|
3238
|
+
ref: pageBar
|
|
3239
|
+
}, [
|
|
3269
3240
|
vue.createElementVNode("div", {
|
|
3270
3241
|
id: "m-editor-page-bar-add-icon",
|
|
3271
3242
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
@@ -3278,10 +3249,10 @@
|
|
|
3278
3249
|
_: 1
|
|
3279
3250
|
})
|
|
3280
3251
|
]),
|
|
3281
|
-
|
|
3252
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3282
3253
|
key: 0,
|
|
3283
3254
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
3284
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
3255
|
+
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
3285
3256
|
}, [
|
|
3286
3257
|
vue.createVNode(_component_el_icon, null, {
|
|
3287
3258
|
default: vue.withCtx(() => [
|
|
@@ -3293,16 +3264,64 @@
|
|
|
3293
3264
|
vue.unref(root) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3294
3265
|
key: 1,
|
|
3295
3266
|
class: "m-editor-page-bar-items",
|
|
3296
|
-
|
|
3297
|
-
|
|
3267
|
+
ref_key: "itemsContainer",
|
|
3268
|
+
ref: itemsContainer,
|
|
3269
|
+
style: vue.normalizeStyle(`width: ${vue.unref(itemsContainerWidth)}px`)
|
|
3298
3270
|
}, [
|
|
3299
|
-
|
|
3271
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
3272
|
+
], 4)) : vue.createCommentVNode("", true),
|
|
3273
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3274
|
+
key: 2,
|
|
3275
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
3276
|
+
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
3277
|
+
}, [
|
|
3278
|
+
vue.createVNode(_component_el_icon, null, {
|
|
3279
|
+
default: vue.withCtx(() => [
|
|
3280
|
+
vue.createVNode(vue.unref(iconsVue.ArrowRightBold))
|
|
3281
|
+
]),
|
|
3282
|
+
_: 1
|
|
3283
|
+
})
|
|
3284
|
+
])) : vue.createCommentVNode("", true)
|
|
3285
|
+
], 512);
|
|
3286
|
+
};
|
|
3287
|
+
}
|
|
3288
|
+
});
|
|
3289
|
+
|
|
3290
|
+
const _hoisted_1$2 = ["onClick"];
|
|
3291
|
+
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
3292
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
3293
|
+
__name: "PageBar",
|
|
3294
|
+
setup(__props) {
|
|
3295
|
+
const services = vue.inject("services");
|
|
3296
|
+
const editorService = services?.editorService;
|
|
3297
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
3298
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
3299
|
+
const switchPage = (page2) => {
|
|
3300
|
+
editorService?.select(page2);
|
|
3301
|
+
};
|
|
3302
|
+
const copy = (node) => {
|
|
3303
|
+
node && editorService?.copy(node);
|
|
3304
|
+
editorService?.paste({
|
|
3305
|
+
left: 0,
|
|
3306
|
+
top: 0
|
|
3307
|
+
});
|
|
3308
|
+
};
|
|
3309
|
+
const remove = (node) => {
|
|
3310
|
+
editorService?.remove(node);
|
|
3311
|
+
};
|
|
3312
|
+
return (_ctx, _cache) => {
|
|
3313
|
+
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
3314
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
3315
|
+
const _component_el_popover = vue.resolveComponent("el-popover");
|
|
3316
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$6, null, {
|
|
3317
|
+
default: vue.withCtx(() => [
|
|
3318
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(root) && vue.unref(root).items || [], (item) => {
|
|
3300
3319
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3301
|
-
key: item.key,
|
|
3302
3320
|
class: vue.normalizeClass(["m-editor-page-bar-item", { active: vue.unref(page)?.id === item.id }]),
|
|
3321
|
+
key: item.key,
|
|
3303
3322
|
onClick: ($event) => switchPage(item)
|
|
3304
3323
|
}, [
|
|
3305
|
-
vue.createElementVNode("div",
|
|
3324
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
3306
3325
|
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
3307
3326
|
vue.createVNode(_component_el_tooltip, {
|
|
3308
3327
|
effect: "dark",
|
|
@@ -3333,7 +3352,7 @@
|
|
|
3333
3352
|
default: vue.withCtx(() => [
|
|
3334
3353
|
vue.createElementVNode("div", null, [
|
|
3335
3354
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
3336
|
-
vue.createVNode(_sfc_main$
|
|
3355
|
+
vue.createVNode(_sfc_main$f, {
|
|
3337
3356
|
data: {
|
|
3338
3357
|
type: "button",
|
|
3339
3358
|
text: "\u590D\u5236",
|
|
@@ -3341,7 +3360,7 @@
|
|
|
3341
3360
|
handler: () => copy(item)
|
|
3342
3361
|
}
|
|
3343
3362
|
}, null, 8, ["data"]),
|
|
3344
|
-
vue.createVNode(_sfc_main$
|
|
3363
|
+
vue.createVNode(_sfc_main$f, {
|
|
3345
3364
|
data: {
|
|
3346
3365
|
type: "button",
|
|
3347
3366
|
text: "\u5220\u9664",
|
|
@@ -3354,22 +3373,11 @@
|
|
|
3354
3373
|
]),
|
|
3355
3374
|
_: 2
|
|
3356
3375
|
}, 1024)
|
|
3357
|
-
], 10,
|
|
3376
|
+
], 10, _hoisted_1$2);
|
|
3358
3377
|
}), 128))
|
|
3359
|
-
]
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
3363
|
-
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(scrollState).scroll("right"))
|
|
3364
|
-
}, [
|
|
3365
|
-
vue.createVNode(_component_el_icon, null, {
|
|
3366
|
-
default: vue.withCtx(() => [
|
|
3367
|
-
vue.createVNode(vue.unref(iconsVue.ArrowRightBold))
|
|
3368
|
-
]),
|
|
3369
|
-
_: 1
|
|
3370
|
-
})
|
|
3371
|
-
])) : vue.createCommentVNode("", true)
|
|
3372
|
-
], 512);
|
|
3378
|
+
]),
|
|
3379
|
+
_: 3
|
|
3380
|
+
});
|
|
3373
3381
|
};
|
|
3374
3382
|
}
|
|
3375
3383
|
});
|
|
@@ -3732,7 +3740,7 @@
|
|
|
3732
3740
|
};
|
|
3733
3741
|
expose({ show });
|
|
3734
3742
|
return (_ctx, _cache) => {
|
|
3735
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3743
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$b, {
|
|
3736
3744
|
"menu-data": menuData,
|
|
3737
3745
|
ref_key: "menu",
|
|
3738
3746
|
ref: menu
|
|
@@ -4427,7 +4435,7 @@
|
|
|
4427
4435
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
4428
4436
|
setConfig(option);
|
|
4429
4437
|
app.component(Editor.name, Editor);
|
|
4430
|
-
app.component(
|
|
4438
|
+
app.component("m-fields-ui-select", _sfc_main$l);
|
|
4431
4439
|
app.component(CodeLink.name, CodeLink);
|
|
4432
4440
|
app.component(Code.name, Code);
|
|
4433
4441
|
app.component(CodeEditor.name, CodeEditor);
|
|
@@ -4446,7 +4454,7 @@
|
|
|
4446
4454
|
exports.PropsPanel = PropsPanel;
|
|
4447
4455
|
exports.TMagicCodeEditor = CodeEditor;
|
|
4448
4456
|
exports.TMagicEditor = Editor;
|
|
4449
|
-
exports.ToolButton = _sfc_main$
|
|
4457
|
+
exports.ToolButton = _sfc_main$f;
|
|
4450
4458
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
4451
4459
|
exports.change2Fixed = change2Fixed;
|
|
4452
4460
|
exports.debug = debug;
|