@tmagic/editor 1.3.0-beta.0 → 1.3.0-beta.2
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/style.css +30 -2
- package/dist/tmagic-editor.js +1053 -647
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1071 -665
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/components/CodeBlockEditor.vue +15 -6
- package/src/components/ContentMenu.vue +88 -42
- package/src/components/Resizer.vue +8 -30
- package/src/components/SplitView.vue +3 -2
- package/src/components/ToolButton.vue +1 -1
- package/src/fields/DataSourceFields.vue +10 -0
- package/src/fields/DataSourceMethods.vue +1 -0
- package/src/fields/EventSelect.vue +15 -3
- package/src/hooks/use-getso.ts +35 -0
- package/src/icons/PinIcon.vue +25 -0
- package/src/icons/PinnedIcon.vue +25 -0
- package/src/index.ts +2 -0
- package/src/layouts/workspace/Workspace.vue +1 -1
- package/src/layouts/workspace/viewer/NodeListMenu.vue +166 -0
- package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +68 -0
- package/src/layouts/workspace/{Stage.vue → viewer/Stage.vue} +2 -0
- package/src/layouts/workspace/{ViewerMenu.vue → viewer/ViewerMenu.vue} +1 -1
- package/src/services/dataSource.ts +11 -0
- package/src/theme/content-menu.scss +29 -3
- package/src/theme/index.scss +8 -0
- package/src/type.ts +3 -0
- package/src/utils/data-source/formConfigs/http.ts +9 -0
- package/src/utils/data-source/index.ts +12 -0
- package/src/utils/props.ts +21 -10
- package/types/components/CodeBlockEditor.vue.d.ts +2 -0
- package/types/components/ContentMenu.vue.d.ts +27 -8
- package/types/components/Resizer.vue.d.ts +1 -3
- package/types/hooks/use-code-block-edit.d.ts +7 -0
- package/types/hooks/use-data-source-method.d.ts +7 -0
- package/types/hooks/use-getso.d.ts +5 -0
- package/types/icons/PinIcon.vue.d.ts +2 -0
- package/types/icons/PinnedIcon.vue.d.ts +2 -0
- package/types/index.d.ts +1 -0
- package/types/layouts/PropsPanel.vue.d.ts +1 -1
- package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +15 -0
- package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +15 -0
- package/types/layouts/workspace/{Stage.vue.d.ts → viewer/Stage.vue.d.ts} +1 -1
- package/types/layouts/workspace/{ViewerMenu.vue.d.ts → viewer/ViewerMenu.vue.d.ts} +1 -1
- package/types/services/dataSource.d.ts +4 -0
- package/types/type.d.ts +3 -0
package/dist/tmagic-editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, Teleport, createElementVNode, normalizeClass, normalizeStyle, createVNode, unref, computed, reactive, resolveComponent, inject, withCtx, Fragment, createTextVNode, createCommentVNode, toRaw, resolveDynamicComponent, nextTick, mergeProps, toDisplayString, renderList, watchEffect, withModifiers, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, withDirectives, vShow, createStaticVNode, onBeforeUnmount, toHandlers, provide } from 'vue';
|
|
2
|
-
import { FullScreen, Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, CopyDocument, DocumentCopy, Files, Hide, Goods, List, EditPen,
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, Teleport, createElementVNode, normalizeClass, normalizeStyle, createVNode, unref, computed, reactive, resolveComponent, inject, withCtx, Fragment, createTextVNode, createCommentVNode, toRaw, resolveDynamicComponent, nextTick, mergeProps, toDisplayString, renderList, watchEffect, withModifiers, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, withDirectives, vShow, createStaticVNode, Transition, onBeforeUnmount, toHandlers, provide } from 'vue';
|
|
2
|
+
import { FullScreen, Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, CopyDocument, DocumentCopy, Files, Hide, Goods, List, EditPen, Top, Bottom, ArrowLeftBold, ArrowRightBold, CaretBottom } from '@element-plus/icons-vue';
|
|
3
3
|
import { throttle, isEmpty, cloneDeep, mergeWith, isObject, uniq, map, has, difference, union, pick, keys } from 'lodash-es';
|
|
4
4
|
import * as monaco from 'monaco-editor';
|
|
5
5
|
import serialize from 'serialize-javascript';
|
|
@@ -8,16 +8,16 @@ import { HookType, NodeType, ActionType } from '@tmagic/schema';
|
|
|
8
8
|
import { MFormDrawer, MForm, createValues, MSelect } from '@tmagic/form';
|
|
9
9
|
import { MagicTable } from '@tmagic/table';
|
|
10
10
|
import Gesto from 'gesto';
|
|
11
|
-
import { guid, isPop, getNodePath, isNumber, isPage, toLine, removeClassNameByClassName, isObject as isObject$1
|
|
12
|
-
import StageCore, { GuidesType, getOffset, calcValueByFontsize, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType } from '@tmagic/stage';
|
|
11
|
+
import { guid, isPop, getNodePath, isNumber, isPage, toLine, removeClassNameByClassName, getNodes, isObject as isObject$1 } from '@tmagic/utils';
|
|
12
|
+
import StageCore, { GuidesType, StageDragStatus, getOffset, calcValueByFontsize, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType } from '@tmagic/stage';
|
|
13
13
|
import { EventEmitter } from 'events';
|
|
14
14
|
import { DEFAULT_EVENTS, DEFAULT_METHODS } from '@tmagic/core';
|
|
15
15
|
import KeyController from 'keycon';
|
|
16
16
|
|
|
17
|
-
const _hoisted_1$
|
|
17
|
+
const _hoisted_1$w = {
|
|
18
18
|
class: /* @__PURE__ */ normalizeClass(`magic-code-editor`)
|
|
19
19
|
};
|
|
20
|
-
const _sfc_main$
|
|
20
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
21
21
|
...{
|
|
22
22
|
name: "MEditorCodeEditor"
|
|
23
23
|
},
|
|
@@ -164,7 +164,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
return (_ctx, _cache) => {
|
|
167
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
167
|
+
return openBlock(), createElementBlock("div", _hoisted_1$w, [
|
|
168
168
|
(openBlock(), createBlock(Teleport, {
|
|
169
169
|
to: "body",
|
|
170
170
|
disabled: !fullScreen.value
|
|
@@ -192,7 +192,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
const _sfc_main$
|
|
195
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
196
196
|
...{
|
|
197
197
|
name: "MEditorCode"
|
|
198
198
|
},
|
|
@@ -216,7 +216,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
216
216
|
emit("change", v);
|
|
217
217
|
};
|
|
218
218
|
return (_ctx, _cache) => {
|
|
219
|
-
return openBlock(), createBlock(_sfc_main$
|
|
219
|
+
return openBlock(), createBlock(_sfc_main$Q, {
|
|
220
220
|
height: _ctx.config.height,
|
|
221
221
|
"init-values": _ctx.model[_ctx.name],
|
|
222
222
|
language: _ctx.config.language,
|
|
@@ -236,7 +236,7 @@ const setConfig = (option) => {
|
|
|
236
236
|
};
|
|
237
237
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
238
238
|
|
|
239
|
-
const _sfc_main$
|
|
239
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
240
240
|
...{
|
|
241
241
|
name: "MEditorCodeLink"
|
|
242
242
|
},
|
|
@@ -315,7 +315,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
|
|
318
|
-
const _sfc_main$
|
|
318
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
319
319
|
...{
|
|
320
320
|
name: "MEditorCodeSelect"
|
|
321
321
|
},
|
|
@@ -387,11 +387,11 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
387
387
|
}
|
|
388
388
|
});
|
|
389
389
|
|
|
390
|
-
const _hoisted_1$
|
|
391
|
-
const _hoisted_2$
|
|
392
|
-
const _hoisted_3$
|
|
393
|
-
const _hoisted_4$
|
|
394
|
-
const _sfc_main$
|
|
390
|
+
const _hoisted_1$v = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
391
|
+
const _hoisted_2$n = { style: { "flex": "1" } };
|
|
392
|
+
const _hoisted_3$a = { style: { "flex": "1" } };
|
|
393
|
+
const _hoisted_4$6 = { class: "dialog-footer" };
|
|
394
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
395
395
|
...{
|
|
396
396
|
name: "MEditorCodeBlockEditor"
|
|
397
397
|
},
|
|
@@ -399,7 +399,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
399
399
|
props: {
|
|
400
400
|
content: {},
|
|
401
401
|
disabled: { type: Boolean },
|
|
402
|
-
isDataSource: { type: Boolean }
|
|
402
|
+
isDataSource: { type: Boolean },
|
|
403
|
+
dataSourceType: {}
|
|
403
404
|
},
|
|
404
405
|
emits: ["submit"],
|
|
405
406
|
setup(__props, { expose: __expose, emit }) {
|
|
@@ -459,7 +460,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
459
460
|
const functionConfig = computed(() => [
|
|
460
461
|
{
|
|
461
462
|
text: "名称",
|
|
462
|
-
name: "name"
|
|
463
|
+
name: "name",
|
|
464
|
+
rules: [{ required: true, message: "请输入名称", trigger: "blur" }]
|
|
463
465
|
},
|
|
464
466
|
{
|
|
465
467
|
text: "描述",
|
|
@@ -469,10 +471,17 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
469
471
|
text: "执行时机",
|
|
470
472
|
name: "timing",
|
|
471
473
|
type: "select",
|
|
472
|
-
options:
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
options: () => {
|
|
475
|
+
const options = [
|
|
476
|
+
{ text: "初始化前", value: "beforeInit" },
|
|
477
|
+
{ text: "初始化后", value: "afterInit" }
|
|
478
|
+
];
|
|
479
|
+
if (props.dataSourceType !== "base") {
|
|
480
|
+
options.push({ text: "请求前", value: "beforeRequest" });
|
|
481
|
+
options.push({ text: "请求后", value: "afterRequest" });
|
|
482
|
+
}
|
|
483
|
+
return options;
|
|
484
|
+
},
|
|
476
485
|
display: () => props.isDataSource
|
|
477
486
|
},
|
|
478
487
|
{
|
|
@@ -601,7 +610,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
601
610
|
fullscreen: ""
|
|
602
611
|
}, {
|
|
603
612
|
footer: withCtx(() => [
|
|
604
|
-
createElementVNode("span", _hoisted_4$
|
|
613
|
+
createElementVNode("span", _hoisted_4$6, [
|
|
605
614
|
createVNode(unref(TMagicButton), {
|
|
606
615
|
size: "small",
|
|
607
616
|
onClick: _cache[1] || (_cache[1] = ($event) => difVisible.value = false)
|
|
@@ -624,8 +633,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
624
633
|
])
|
|
625
634
|
]),
|
|
626
635
|
default: withCtx(() => [
|
|
627
|
-
createElementVNode("div", _hoisted_1$
|
|
628
|
-
createElementVNode("div", _hoisted_2$
|
|
636
|
+
createElementVNode("div", _hoisted_1$v, [
|
|
637
|
+
createElementVNode("div", _hoisted_2$n, [
|
|
629
638
|
createVNode(unref(TMagicTag), {
|
|
630
639
|
size: "small",
|
|
631
640
|
type: "info"
|
|
@@ -636,7 +645,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
636
645
|
_: 1
|
|
637
646
|
})
|
|
638
647
|
]),
|
|
639
|
-
createElementVNode("div", _hoisted_3$
|
|
648
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
640
649
|
createVNode(unref(TMagicTag), {
|
|
641
650
|
size: "small",
|
|
642
651
|
type: "success"
|
|
@@ -648,7 +657,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
648
657
|
})
|
|
649
658
|
])
|
|
650
659
|
]),
|
|
651
|
-
difVisible.value ? (openBlock(), createBlock(_sfc_main$
|
|
660
|
+
difVisible.value ? (openBlock(), createBlock(_sfc_main$Q, {
|
|
652
661
|
key: 0,
|
|
653
662
|
ref_key: "magicVsEditor",
|
|
654
663
|
ref: magicVsEditor,
|
|
@@ -702,6 +711,15 @@ const HttpFormConfig = [
|
|
|
702
711
|
type: "switch",
|
|
703
712
|
defaultValue: true
|
|
704
713
|
},
|
|
714
|
+
{
|
|
715
|
+
name: "responseOptions",
|
|
716
|
+
items: [
|
|
717
|
+
{
|
|
718
|
+
name: "dataPath",
|
|
719
|
+
text: "数据路径"
|
|
720
|
+
}
|
|
721
|
+
]
|
|
722
|
+
},
|
|
705
723
|
{
|
|
706
724
|
type: "fieldset",
|
|
707
725
|
name: "options",
|
|
@@ -768,6 +786,18 @@ const fillConfig$1 = (config) => [
|
|
|
768
786
|
defaultValue: () => []
|
|
769
787
|
}
|
|
770
788
|
]
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
type: "panel",
|
|
792
|
+
title: "事件配置",
|
|
793
|
+
display: false,
|
|
794
|
+
items: [
|
|
795
|
+
{
|
|
796
|
+
name: "events",
|
|
797
|
+
src: "datasource",
|
|
798
|
+
type: "event-select"
|
|
799
|
+
}
|
|
800
|
+
]
|
|
771
801
|
}
|
|
772
802
|
];
|
|
773
803
|
const getFormConfig = (type, configs) => {
|
|
@@ -948,7 +978,8 @@ class DataSource extends BaseService {
|
|
|
948
978
|
dataSources: [],
|
|
949
979
|
editable: true,
|
|
950
980
|
configs: {},
|
|
951
|
-
values: {}
|
|
981
|
+
values: {},
|
|
982
|
+
events: {}
|
|
952
983
|
});
|
|
953
984
|
set(name, value) {
|
|
954
985
|
this.state[name] = value;
|
|
@@ -968,6 +999,12 @@ class DataSource extends BaseService {
|
|
|
968
999
|
setFormValue(type, value) {
|
|
969
1000
|
this.get("values")[type] = value;
|
|
970
1001
|
}
|
|
1002
|
+
getFormEvent(type = "base") {
|
|
1003
|
+
return this.get("events")[type] || [];
|
|
1004
|
+
}
|
|
1005
|
+
setFormEvent(type, value = []) {
|
|
1006
|
+
this.get("events")[type] = value;
|
|
1007
|
+
}
|
|
971
1008
|
add(config) {
|
|
972
1009
|
const newConfig = {
|
|
973
1010
|
...config,
|
|
@@ -1184,6 +1221,7 @@ const eventTabConfig = {
|
|
|
1184
1221
|
items: [
|
|
1185
1222
|
{
|
|
1186
1223
|
name: "events",
|
|
1224
|
+
src: "component",
|
|
1187
1225
|
type: "event-select"
|
|
1188
1226
|
}
|
|
1189
1227
|
]
|
|
@@ -1254,21 +1292,28 @@ const displayTabConfig = {
|
|
|
1254
1292
|
items: [
|
|
1255
1293
|
{
|
|
1256
1294
|
name: "value",
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1295
|
+
type: (mForm, { model }) => {
|
|
1296
|
+
const [id, field] = model.field;
|
|
1297
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
1298
|
+
const type = ds?.fields.find((f) => f.name === field)?.type;
|
|
1299
|
+
if (type === "number") {
|
|
1300
|
+
return "number";
|
|
1301
|
+
}
|
|
1302
|
+
if (type === "boolean") {
|
|
1303
|
+
return "select";
|
|
1304
|
+
}
|
|
1305
|
+
return "text";
|
|
1306
|
+
},
|
|
1262
1307
|
options: [
|
|
1263
1308
|
{ text: "true", value: true },
|
|
1264
1309
|
{ text: "false", value: false }
|
|
1265
1310
|
],
|
|
1266
|
-
display: (vm, { model }) => ["
|
|
1311
|
+
display: (vm, { model }) => !["between", "not_between"].includes(model.op)
|
|
1267
1312
|
},
|
|
1268
1313
|
{
|
|
1269
1314
|
name: "range",
|
|
1270
1315
|
type: "number-range",
|
|
1271
|
-
display: (vm, { model }) => ["between", "not_between"].includes(model.op)
|
|
1316
|
+
display: (vm, { model }) => ["between", "not_between"].includes(model.op)
|
|
1272
1317
|
}
|
|
1273
1318
|
]
|
|
1274
1319
|
}
|
|
@@ -2748,7 +2793,7 @@ const getDefaultConfig = async (addNode, parentNode) => {
|
|
|
2748
2793
|
return newNode;
|
|
2749
2794
|
};
|
|
2750
2795
|
|
|
2751
|
-
const _sfc_main$
|
|
2796
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
2752
2797
|
...{
|
|
2753
2798
|
name: "MEditorCodeParams"
|
|
2754
2799
|
},
|
|
@@ -2797,8 +2842,8 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
2797
2842
|
}
|
|
2798
2843
|
});
|
|
2799
2844
|
|
|
2800
|
-
const _hoisted_1$
|
|
2801
|
-
const _sfc_main$
|
|
2845
|
+
const _hoisted_1$u = ["src"];
|
|
2846
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
2802
2847
|
...{
|
|
2803
2848
|
name: "MEditorIcon"
|
|
2804
2849
|
},
|
|
@@ -2821,7 +2866,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2821
2866
|
class: "magic-editor-icon"
|
|
2822
2867
|
}, {
|
|
2823
2868
|
default: withCtx(() => [
|
|
2824
|
-
createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
2869
|
+
createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$u)
|
|
2825
2870
|
]),
|
|
2826
2871
|
_: 1
|
|
2827
2872
|
})) : typeof _ctx.icon === "string" ? (openBlock(), createElementBlock("i", {
|
|
@@ -2898,9 +2943,9 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
2898
2943
|
};
|
|
2899
2944
|
};
|
|
2900
2945
|
|
|
2901
|
-
const _hoisted_1$
|
|
2902
|
-
const _hoisted_2$
|
|
2903
|
-
const _sfc_main$
|
|
2946
|
+
const _hoisted_1$t = { class: "m-fields-code-select-col" };
|
|
2947
|
+
const _hoisted_2$m = { class: "code-select-container" };
|
|
2948
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
2904
2949
|
...{
|
|
2905
2950
|
name: "MEditorCodeSelectCol"
|
|
2906
2951
|
},
|
|
@@ -2974,22 +3019,22 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
2974
3019
|
const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
|
|
2975
3020
|
return (_ctx, _cache) => {
|
|
2976
3021
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
2977
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2978
|
-
createElementVNode("div", _hoisted_2$
|
|
3022
|
+
return openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
3023
|
+
createElementVNode("div", _hoisted_2$m, [
|
|
2979
3024
|
createVNode(_component_m_form_container, {
|
|
2980
3025
|
class: "select",
|
|
2981
3026
|
config: selectConfig,
|
|
2982
3027
|
model: _ctx.model,
|
|
2983
3028
|
onChange: onParamsChangeHandler
|
|
2984
3029
|
}, null, 8, ["model"]),
|
|
2985
|
-
_ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$
|
|
3030
|
+
_ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$K, {
|
|
2986
3031
|
key: 0,
|
|
2987
3032
|
class: "icon",
|
|
2988
3033
|
icon: !_ctx.disabled ? unref(Edit) : unref(View),
|
|
2989
3034
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(editCode)(_ctx.model[_ctx.name]))
|
|
2990
3035
|
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
2991
3036
|
]),
|
|
2992
|
-
paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
3037
|
+
paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$L, {
|
|
2993
3038
|
key: 0,
|
|
2994
3039
|
name: "params",
|
|
2995
3040
|
model: _ctx.model,
|
|
@@ -2997,7 +3042,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
2997
3042
|
"params-config": paramsConfig.value,
|
|
2998
3043
|
onChange: onParamsChangeHandler
|
|
2999
3044
|
}, null, 8, ["model", "size", "params-config"])) : createCommentVNode("", true),
|
|
3000
|
-
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$
|
|
3045
|
+
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$M, {
|
|
3001
3046
|
key: 1,
|
|
3002
3047
|
ref_key: "codeBlockEditor",
|
|
3003
3048
|
ref: codeBlockEditor,
|
|
@@ -3010,9 +3055,9 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
3010
3055
|
}
|
|
3011
3056
|
});
|
|
3012
3057
|
|
|
3013
|
-
const _hoisted_1$
|
|
3014
|
-
const _hoisted_2$
|
|
3015
|
-
const _sfc_main$
|
|
3058
|
+
const _hoisted_1$s = { class: "m-editor-data-source-fields" };
|
|
3059
|
+
const _hoisted_2$l = { class: "m-editor-data-source-fields-footer" };
|
|
3060
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
3016
3061
|
...{
|
|
3017
3062
|
name: "MEditorDataSourceFields"
|
|
3018
3063
|
},
|
|
@@ -3147,7 +3192,18 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
3147
3192
|
},
|
|
3148
3193
|
{
|
|
3149
3194
|
name: "defaultValue",
|
|
3150
|
-
text: "默认值"
|
|
3195
|
+
text: "默认值",
|
|
3196
|
+
type: (mForm, { model }) => {
|
|
3197
|
+
if (model.type === "number")
|
|
3198
|
+
return "number";
|
|
3199
|
+
if (model.type === "boolean")
|
|
3200
|
+
return "select";
|
|
3201
|
+
return "text";
|
|
3202
|
+
},
|
|
3203
|
+
options: [
|
|
3204
|
+
{ text: "true", value: true },
|
|
3205
|
+
{ text: "false", value: false }
|
|
3206
|
+
]
|
|
3151
3207
|
},
|
|
3152
3208
|
{
|
|
3153
3209
|
name: "enable",
|
|
@@ -3163,12 +3219,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
3163
3219
|
}
|
|
3164
3220
|
];
|
|
3165
3221
|
return (_ctx, _cache) => {
|
|
3166
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3222
|
+
return openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
3167
3223
|
createVNode(unref(MagicTable), {
|
|
3168
3224
|
data: _ctx.model[_ctx.name],
|
|
3169
3225
|
columns: fieldColumns
|
|
3170
3226
|
}, null, 8, ["data"]),
|
|
3171
|
-
createElementVNode("div", _hoisted_2$
|
|
3227
|
+
createElementVNode("div", _hoisted_2$l, [
|
|
3172
3228
|
createVNode(unref(TMagicButton), {
|
|
3173
3229
|
size: "small",
|
|
3174
3230
|
type: "primary",
|
|
@@ -3199,7 +3255,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
3199
3255
|
}
|
|
3200
3256
|
});
|
|
3201
3257
|
|
|
3202
|
-
const _sfc_main$
|
|
3258
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
3203
3259
|
__name: "DataSourceFieldSelect",
|
|
3204
3260
|
props: {
|
|
3205
3261
|
config: {},
|
|
@@ -3246,10 +3302,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
3246
3302
|
}
|
|
3247
3303
|
});
|
|
3248
3304
|
|
|
3249
|
-
const _hoisted_1$
|
|
3250
|
-
const _hoisted_2$
|
|
3251
|
-
const _hoisted_3$
|
|
3252
|
-
const _sfc_main$
|
|
3305
|
+
const _hoisted_1$r = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3306
|
+
const _hoisted_2$k = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3307
|
+
const _hoisted_3$9 = { class: "el-input__inner" };
|
|
3308
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
3253
3309
|
...{
|
|
3254
3310
|
name: "MEditorDataSourceInput"
|
|
3255
3311
|
},
|
|
@@ -3438,12 +3494,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3438
3494
|
}
|
|
3439
3495
|
), {
|
|
3440
3496
|
suffix: withCtx(() => [
|
|
3441
|
-
createVNode(_sfc_main$
|
|
3497
|
+
createVNode(_sfc_main$K, { icon: unref(Coin) }, null, 8, ["icon"])
|
|
3442
3498
|
]),
|
|
3443
3499
|
default: withCtx(({ item }) => [
|
|
3444
|
-
createElementVNode("div", _hoisted_1$
|
|
3500
|
+
createElementVNode("div", _hoisted_1$r, [
|
|
3445
3501
|
createElementVNode("div", null, toDisplayString(item.text), 1),
|
|
3446
|
-
createElementVNode("span", _hoisted_2$
|
|
3502
|
+
createElementVNode("span", _hoisted_2$k, toDisplayString(item.value), 1)
|
|
3447
3503
|
])
|
|
3448
3504
|
]),
|
|
3449
3505
|
_: 1
|
|
@@ -3455,7 +3511,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3455
3511
|
createElementVNode("div", {
|
|
3456
3512
|
class: normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
3457
3513
|
}, [
|
|
3458
|
-
createElementVNode("div", _hoisted_3$
|
|
3514
|
+
createElementVNode("div", _hoisted_3$9, [
|
|
3459
3515
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
|
|
3460
3516
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3461
3517
|
item.type === "text" ? (openBlock(), createElementBlock("span", {
|
|
@@ -3473,7 +3529,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3473
3529
|
}, 1032, ["size"])) : createCommentVNode("", true)
|
|
3474
3530
|
], 64);
|
|
3475
3531
|
}), 256)),
|
|
3476
|
-
createVNode(_sfc_main$
|
|
3532
|
+
createVNode(_sfc_main$K, {
|
|
3477
3533
|
class: "tmagic-data-source-input-icon",
|
|
3478
3534
|
icon: unref(Coin)
|
|
3479
3535
|
}, null, 8, ["icon"])
|
|
@@ -3556,9 +3612,9 @@ const useDataSourceMethod = () => {
|
|
|
3556
3612
|
};
|
|
3557
3613
|
};
|
|
3558
3614
|
|
|
3559
|
-
const _hoisted_1$
|
|
3560
|
-
const _hoisted_2$
|
|
3561
|
-
const _sfc_main$
|
|
3615
|
+
const _hoisted_1$q = { class: "m-editor-data-source-methods" };
|
|
3616
|
+
const _hoisted_2$j = { class: "m-editor-data-source-methods-footer" };
|
|
3617
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
3562
3618
|
...{
|
|
3563
3619
|
name: "MEditorDataSourceMethods"
|
|
3564
3620
|
},
|
|
@@ -3627,12 +3683,12 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3627
3683
|
emit("change", props.model[props.name]);
|
|
3628
3684
|
};
|
|
3629
3685
|
return (_ctx, _cache) => {
|
|
3630
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3686
|
+
return openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
3631
3687
|
createVNode(unref(MagicTable), {
|
|
3632
3688
|
data: _ctx.model[_ctx.name],
|
|
3633
3689
|
columns: methodColumns
|
|
3634
3690
|
}, null, 8, ["data"]),
|
|
3635
|
-
createElementVNode("div", _hoisted_2$
|
|
3691
|
+
createElementVNode("div", _hoisted_2$j, [
|
|
3636
3692
|
createVNode(unref(TMagicButton), {
|
|
3637
3693
|
size: "small",
|
|
3638
3694
|
type: "primary",
|
|
@@ -3646,23 +3702,24 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3646
3702
|
_: 1
|
|
3647
3703
|
}, 8, ["disabled"])
|
|
3648
3704
|
]),
|
|
3649
|
-
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$
|
|
3705
|
+
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$M, {
|
|
3650
3706
|
key: 0,
|
|
3651
3707
|
ref_key: "codeBlockEditor",
|
|
3652
3708
|
ref: codeBlockEditor,
|
|
3653
3709
|
disabled: _ctx.disabled,
|
|
3654
3710
|
content: unref(codeConfig),
|
|
3655
3711
|
"is-data-source": true,
|
|
3712
|
+
"data-source-type": _ctx.model.type,
|
|
3656
3713
|
onSubmit: submitCodeHandler
|
|
3657
|
-
}, null, 8, ["disabled", "content"])) : createCommentVNode("", true)
|
|
3714
|
+
}, null, 8, ["disabled", "content", "data-source-type"])) : createCommentVNode("", true)
|
|
3658
3715
|
]);
|
|
3659
3716
|
};
|
|
3660
3717
|
}
|
|
3661
3718
|
});
|
|
3662
3719
|
|
|
3663
|
-
const _hoisted_1$
|
|
3664
|
-
const _hoisted_2$
|
|
3665
|
-
const _sfc_main$
|
|
3720
|
+
const _hoisted_1$p = { class: "m-fields-data-source-method-select" };
|
|
3721
|
+
const _hoisted_2$i = { class: "data-source-method-select-container" };
|
|
3722
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
3666
3723
|
...{
|
|
3667
3724
|
name: "MEditorDataSourceMethodSelect"
|
|
3668
3725
|
},
|
|
@@ -3740,22 +3797,22 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3740
3797
|
};
|
|
3741
3798
|
return (_ctx, _cache) => {
|
|
3742
3799
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
3743
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3744
|
-
createElementVNode("div", _hoisted_2$
|
|
3800
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
3801
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
3745
3802
|
createVNode(_component_m_form_container, {
|
|
3746
3803
|
class: "select",
|
|
3747
3804
|
config: cascaderConfig,
|
|
3748
3805
|
model: _ctx.model,
|
|
3749
3806
|
onChange: onChangeHandler
|
|
3750
3807
|
}, null, 8, ["model"]),
|
|
3751
|
-
_ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$
|
|
3808
|
+
_ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$K, {
|
|
3752
3809
|
key: 0,
|
|
3753
3810
|
class: "icon",
|
|
3754
3811
|
icon: !_ctx.disabled ? unref(Edit) : unref(View),
|
|
3755
3812
|
onClick: editCodeHandler
|
|
3756
3813
|
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
3757
3814
|
]),
|
|
3758
|
-
paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
3815
|
+
paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$L, {
|
|
3759
3816
|
key: 0,
|
|
3760
3817
|
name: "params",
|
|
3761
3818
|
model: _ctx.model,
|
|
@@ -3764,7 +3821,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3764
3821
|
"params-config": paramsConfig.value,
|
|
3765
3822
|
onChange: onChangeHandler
|
|
3766
3823
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : createCommentVNode("", true),
|
|
3767
|
-
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$
|
|
3824
|
+
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$M, {
|
|
3768
3825
|
key: 1,
|
|
3769
3826
|
ref_key: "codeBlockEditor",
|
|
3770
3827
|
ref: codeBlockEditor,
|
|
@@ -3777,7 +3834,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3777
3834
|
}
|
|
3778
3835
|
});
|
|
3779
3836
|
|
|
3780
|
-
const _sfc_main$
|
|
3837
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
3781
3838
|
...{
|
|
3782
3839
|
name: "MEditorDataSourceSelect"
|
|
3783
3840
|
},
|
|
@@ -3832,12 +3889,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3832
3889
|
}
|
|
3833
3890
|
});
|
|
3834
3891
|
|
|
3835
|
-
const _hoisted_1$
|
|
3836
|
-
const _hoisted_2$
|
|
3892
|
+
const _hoisted_1$o = { class: "m-fields-event-select" };
|
|
3893
|
+
const _hoisted_2$h = {
|
|
3837
3894
|
key: 1,
|
|
3838
3895
|
class: "fullWidth"
|
|
3839
3896
|
};
|
|
3840
|
-
const _sfc_main$
|
|
3897
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
3841
3898
|
...{
|
|
3842
3899
|
name: "MEditorEventSelect"
|
|
3843
3900
|
},
|
|
@@ -3863,10 +3920,20 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
3863
3920
|
text: "事件",
|
|
3864
3921
|
type: "select",
|
|
3865
3922
|
labelWidth: "40px",
|
|
3866
|
-
options: (mForm, { formValue }) =>
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3923
|
+
options: (mForm, { formValue }) => {
|
|
3924
|
+
let events = [];
|
|
3925
|
+
if (!services)
|
|
3926
|
+
return events;
|
|
3927
|
+
if (props.config.src === "component") {
|
|
3928
|
+
events = services.eventsService.getEvent(formValue.type);
|
|
3929
|
+
} else if (props.config.src === "datasource") {
|
|
3930
|
+
events = services.dataSourceService.getFormEvent(formValue.type);
|
|
3931
|
+
}
|
|
3932
|
+
return events.map((option) => ({
|
|
3933
|
+
text: option.label,
|
|
3934
|
+
value: option.value
|
|
3935
|
+
}));
|
|
3936
|
+
}
|
|
3870
3937
|
};
|
|
3871
3938
|
return { ...defaultEventNameConfig, ...props.config.eventNameConfig };
|
|
3872
3939
|
});
|
|
@@ -4027,7 +4094,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4027
4094
|
const _component_m_form_table = resolveComponent("m-form-table");
|
|
4028
4095
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
4029
4096
|
const _component_m_form_panel = resolveComponent("m-form-panel");
|
|
4030
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4097
|
+
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
4031
4098
|
isOldVersion.value ? (openBlock(), createBlock(_component_m_form_table, {
|
|
4032
4099
|
key: 0,
|
|
4033
4100
|
ref: "eventForm",
|
|
@@ -4037,7 +4104,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4037
4104
|
model: _ctx.model,
|
|
4038
4105
|
config: tableConfig.value,
|
|
4039
4106
|
onChange: onChangeHandler
|
|
4040
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
4107
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
4041
4108
|
createVNode(unref(TMagicButton), {
|
|
4042
4109
|
class: "create-button",
|
|
4043
4110
|
type: "primary",
|
|
@@ -4086,9 +4153,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
4086
4153
|
}
|
|
4087
4154
|
});
|
|
4088
4155
|
|
|
4089
|
-
const _hoisted_1$
|
|
4090
|
-
const _hoisted_2$
|
|
4091
|
-
const _sfc_main$
|
|
4156
|
+
const _hoisted_1$n = { class: "m-fields-key-value" };
|
|
4157
|
+
const _hoisted_2$g = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
4158
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
4092
4159
|
...{
|
|
4093
4160
|
name: "MEditorKeyValue"
|
|
4094
4161
|
},
|
|
@@ -4133,7 +4200,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4133
4200
|
records.value.splice(index, 1);
|
|
4134
4201
|
};
|
|
4135
4202
|
return (_ctx, _cache) => {
|
|
4136
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4203
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
4137
4204
|
(openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
|
|
4138
4205
|
return openBlock(), createElementBlock("div", {
|
|
4139
4206
|
class: "m-fields-key-value-item",
|
|
@@ -4147,7 +4214,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4147
4214
|
size: _ctx.size,
|
|
4148
4215
|
onChange: keyChangeHandler
|
|
4149
4216
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
4150
|
-
_hoisted_2$
|
|
4217
|
+
_hoisted_2$g,
|
|
4151
4218
|
createVNode(unref(TMagicInput), {
|
|
4152
4219
|
placeholder: "value",
|
|
4153
4220
|
modelValue: records.value[index][1],
|
|
@@ -4186,12 +4253,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
4186
4253
|
}
|
|
4187
4254
|
});
|
|
4188
4255
|
|
|
4189
|
-
const _hoisted_1$
|
|
4256
|
+
const _hoisted_1$m = {
|
|
4190
4257
|
key: 1,
|
|
4191
4258
|
class: "m-fields-ui-select",
|
|
4192
4259
|
style: { "display": "flex" }
|
|
4193
4260
|
};
|
|
4194
|
-
const _sfc_main$
|
|
4261
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
4195
4262
|
...{
|
|
4196
4263
|
name: "MEditorUISelect"
|
|
4197
4264
|
},
|
|
@@ -4280,7 +4347,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
4280
4347
|
]),
|
|
4281
4348
|
_: 1
|
|
4282
4349
|
}, 8, ["icon", "disabled", "size"])
|
|
4283
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
4350
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
4284
4351
|
val.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4285
4352
|
createVNode(unref(TMagicTooltip), {
|
|
4286
4353
|
content: "清除",
|
|
@@ -4349,7 +4416,35 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
4349
4416
|
|
|
4350
4417
|
const UISelect_vue_vue_type_style_index_0_lang = '';
|
|
4351
4418
|
|
|
4352
|
-
const
|
|
4419
|
+
const useGetSo = (target, emit) => {
|
|
4420
|
+
let getso;
|
|
4421
|
+
const isDraging = ref(false);
|
|
4422
|
+
onMounted(() => {
|
|
4423
|
+
if (!target.value)
|
|
4424
|
+
return;
|
|
4425
|
+
getso = new Gesto(target.value, {
|
|
4426
|
+
container: window,
|
|
4427
|
+
pinchOutside: true
|
|
4428
|
+
}).on("drag", (e) => {
|
|
4429
|
+
if (!target.value)
|
|
4430
|
+
return;
|
|
4431
|
+
emit("change", e);
|
|
4432
|
+
}).on("dragStart", () => {
|
|
4433
|
+
isDraging.value = true;
|
|
4434
|
+
}).on("dragEnd", () => {
|
|
4435
|
+
isDraging.value = false;
|
|
4436
|
+
});
|
|
4437
|
+
});
|
|
4438
|
+
onUnmounted(() => {
|
|
4439
|
+
getso?.unset();
|
|
4440
|
+
isDraging.value = false;
|
|
4441
|
+
});
|
|
4442
|
+
return {
|
|
4443
|
+
isDraging
|
|
4444
|
+
};
|
|
4445
|
+
};
|
|
4446
|
+
|
|
4447
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
4353
4448
|
...{
|
|
4354
4449
|
name: "MEditorResizer"
|
|
4355
4450
|
},
|
|
@@ -4357,33 +4452,12 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
4357
4452
|
emits: ["change"],
|
|
4358
4453
|
setup(__props, { emit }) {
|
|
4359
4454
|
const target = ref();
|
|
4360
|
-
const isDraging =
|
|
4361
|
-
let getso;
|
|
4362
|
-
onMounted(() => {
|
|
4363
|
-
if (!target.value)
|
|
4364
|
-
return;
|
|
4365
|
-
getso = new Gesto(target.value, {
|
|
4366
|
-
container: window,
|
|
4367
|
-
pinchOutside: true
|
|
4368
|
-
}).on("drag", (e) => {
|
|
4369
|
-
if (!target.value)
|
|
4370
|
-
return;
|
|
4371
|
-
emit("change", e.deltaX);
|
|
4372
|
-
}).on("dragStart", () => {
|
|
4373
|
-
isDraging.value = true;
|
|
4374
|
-
}).on("dragEnd", () => {
|
|
4375
|
-
isDraging.value = false;
|
|
4376
|
-
});
|
|
4377
|
-
});
|
|
4378
|
-
onUnmounted(() => {
|
|
4379
|
-
getso?.unset();
|
|
4380
|
-
isDraging.value = false;
|
|
4381
|
-
});
|
|
4455
|
+
const { isDraging } = useGetSo(target, emit);
|
|
4382
4456
|
return (_ctx, _cache) => {
|
|
4383
4457
|
return openBlock(), createElementBlock("span", {
|
|
4384
4458
|
ref_key: "target",
|
|
4385
4459
|
ref: target,
|
|
4386
|
-
class: normalizeClass(["m-editor-resizer", { "m-editor-resizer-draging": isDraging
|
|
4460
|
+
class: normalizeClass(["m-editor-resizer", { "m-editor-resizer-draging": unref(isDraging) }])
|
|
4387
4461
|
}, [
|
|
4388
4462
|
renderSlot(_ctx.$slots, "default")
|
|
4389
4463
|
], 2);
|
|
@@ -4391,7 +4465,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
4391
4465
|
}
|
|
4392
4466
|
});
|
|
4393
4467
|
|
|
4394
|
-
const _sfc_main$
|
|
4468
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
4395
4469
|
...{
|
|
4396
4470
|
name: "MEditorLayout"
|
|
4397
4471
|
},
|
|
@@ -4458,7 +4532,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4458
4532
|
resizerObserver.disconnect();
|
|
4459
4533
|
});
|
|
4460
4534
|
const center = ref(0);
|
|
4461
|
-
const changeLeft = (deltaX) => {
|
|
4535
|
+
const changeLeft = ({ deltaX }) => {
|
|
4462
4536
|
if (typeof props.left === "undefined")
|
|
4463
4537
|
return;
|
|
4464
4538
|
let left = Math.max(props.left + deltaX, props.minLeft) || 0;
|
|
@@ -4474,7 +4548,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4474
4548
|
right: columnWidth.right
|
|
4475
4549
|
});
|
|
4476
4550
|
};
|
|
4477
|
-
const changeRight = (deltaX) => {
|
|
4551
|
+
const changeRight = ({ deltaX }) => {
|
|
4478
4552
|
if (typeof props.right === "undefined")
|
|
4479
4553
|
return;
|
|
4480
4554
|
let right = Math.max(props.right - deltaX, props.minRight) || 0;
|
|
@@ -4503,7 +4577,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4503
4577
|
}, [
|
|
4504
4578
|
renderSlot(_ctx.$slots, "left")
|
|
4505
4579
|
], 6),
|
|
4506
|
-
createVNode(_sfc_main$
|
|
4580
|
+
createVNode(_sfc_main$z, { onChange: changeLeft })
|
|
4507
4581
|
], 64)) : createCommentVNode("", true),
|
|
4508
4582
|
createElementVNode("div", {
|
|
4509
4583
|
class: normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -4512,7 +4586,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4512
4586
|
renderSlot(_ctx.$slots, "center")
|
|
4513
4587
|
], 6),
|
|
4514
4588
|
hasRight.value && _ctx.$slots.right ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4515
|
-
createVNode(_sfc_main$
|
|
4589
|
+
createVNode(_sfc_main$z, { onChange: changeRight }),
|
|
4516
4590
|
createElementVNode("div", {
|
|
4517
4591
|
class: normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
4518
4592
|
style: normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -4525,10 +4599,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4525
4599
|
}
|
|
4526
4600
|
});
|
|
4527
4601
|
|
|
4528
|
-
const _hoisted_1$
|
|
4529
|
-
const _hoisted_2$
|
|
4530
|
-
const _hoisted_3$
|
|
4531
|
-
const _sfc_main$
|
|
4602
|
+
const _hoisted_1$l = { class: "m-editor-empty-panel" };
|
|
4603
|
+
const _hoisted_2$f = { class: "m-editor-empty-content" };
|
|
4604
|
+
const _hoisted_3$8 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
|
|
4605
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
4532
4606
|
...{
|
|
4533
4607
|
name: "MEditorAddPageBox"
|
|
4534
4608
|
},
|
|
@@ -4548,16 +4622,16 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
4548
4622
|
});
|
|
4549
4623
|
};
|
|
4550
4624
|
return (_ctx, _cache) => {
|
|
4551
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4552
|
-
createElementVNode("div", _hoisted_2$
|
|
4625
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
4626
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
4553
4627
|
createElementVNode("div", {
|
|
4554
4628
|
class: "m-editor-empty-button",
|
|
4555
4629
|
onClick: clickHandler
|
|
4556
4630
|
}, [
|
|
4557
4631
|
createElementVNode("div", null, [
|
|
4558
|
-
createVNode(_sfc_main$
|
|
4632
|
+
createVNode(_sfc_main$K, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
4559
4633
|
]),
|
|
4560
|
-
_hoisted_3$
|
|
4634
|
+
_hoisted_3$8
|
|
4561
4635
|
])
|
|
4562
4636
|
])
|
|
4563
4637
|
]);
|
|
@@ -4569,7 +4643,7 @@ const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
|
4569
4643
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
4570
4644
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
4571
4645
|
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
4572
|
-
const _sfc_main$
|
|
4646
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
4573
4647
|
...{
|
|
4574
4648
|
name: "MEditorFramework"
|
|
4575
4649
|
},
|
|
@@ -4646,13 +4720,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4646
4720
|
renderSlot(_ctx.$slots, "nav"),
|
|
4647
4721
|
renderSlot(_ctx.$slots, "content-before"),
|
|
4648
4722
|
showSrc.value ? renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
4649
|
-
createVNode(_sfc_main$
|
|
4723
|
+
createVNode(_sfc_main$Q, {
|
|
4650
4724
|
class: "m-editor-content",
|
|
4651
4725
|
"init-values": root.value,
|
|
4652
4726
|
options: unref(codeOptions),
|
|
4653
4727
|
onSave: saveCode
|
|
4654
4728
|
}, null, 8, ["init-values", "options"])
|
|
4655
|
-
]) : (openBlock(), createBlock(_sfc_main$
|
|
4729
|
+
]) : (openBlock(), createBlock(_sfc_main$y, {
|
|
4656
4730
|
key: 1,
|
|
4657
4731
|
class: "m-editor-content",
|
|
4658
4732
|
"left-class": "m-editor-framework-left",
|
|
@@ -4671,7 +4745,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4671
4745
|
]),
|
|
4672
4746
|
center: withCtx(() => [
|
|
4673
4747
|
pageLength.value > 0 ? renderSlot(_ctx.$slots, "workspace", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
4674
|
-
createVNode(_sfc_main$
|
|
4748
|
+
createVNode(_sfc_main$x)
|
|
4675
4749
|
])
|
|
4676
4750
|
]),
|
|
4677
4751
|
_: 2
|
|
@@ -4696,12 +4770,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4696
4770
|
}
|
|
4697
4771
|
});
|
|
4698
4772
|
|
|
4699
|
-
const _hoisted_1$
|
|
4773
|
+
const _hoisted_1$k = {
|
|
4700
4774
|
key: 1,
|
|
4701
4775
|
class: "menu-item-text"
|
|
4702
4776
|
};
|
|
4703
|
-
const _hoisted_2$
|
|
4704
|
-
const _sfc_main$
|
|
4777
|
+
const _hoisted_2$e = { class: "el-dropdown-link menubar-menu-button" };
|
|
4778
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
4705
4779
|
...{
|
|
4706
4780
|
name: "MEditorToolButton"
|
|
4707
4781
|
},
|
|
@@ -4780,7 +4854,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
4780
4854
|
_ctx.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
|
|
4781
4855
|
key: 0,
|
|
4782
4856
|
direction: _ctx.data.direction || "vertical"
|
|
4783
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
4857
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$k, toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4784
4858
|
_ctx.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
4785
4859
|
key: 0,
|
|
4786
4860
|
effect: "dark",
|
|
@@ -4794,7 +4868,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
4794
4868
|
disabled: disabled.value
|
|
4795
4869
|
}, {
|
|
4796
4870
|
default: withCtx(() => [
|
|
4797
|
-
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$
|
|
4871
|
+
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$K, {
|
|
4798
4872
|
key: 0,
|
|
4799
4873
|
icon: _ctx.data.icon
|
|
4800
4874
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
@@ -4808,17 +4882,18 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
4808
4882
|
key: 1,
|
|
4809
4883
|
size: "small",
|
|
4810
4884
|
text: "",
|
|
4811
|
-
disabled: disabled.value
|
|
4885
|
+
disabled: disabled.value,
|
|
4886
|
+
title: _ctx.data.text
|
|
4812
4887
|
}, {
|
|
4813
4888
|
default: withCtx(() => [
|
|
4814
|
-
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$
|
|
4889
|
+
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$K, {
|
|
4815
4890
|
key: 0,
|
|
4816
4891
|
icon: _ctx.data.icon
|
|
4817
4892
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
4818
4893
|
createElementVNode("span", null, toDisplayString(_ctx.data.text), 1)
|
|
4819
4894
|
]),
|
|
4820
4895
|
_: 1
|
|
4821
|
-
}, 8, ["disabled"]))
|
|
4896
|
+
}, 8, ["disabled", "title"]))
|
|
4822
4897
|
], 64)) : _ctx.data.type === "dropdown" ? (openBlock(), createBlock(unref(TMagicDropdown), {
|
|
4823
4898
|
key: 3,
|
|
4824
4899
|
trigger: "click",
|
|
@@ -4844,7 +4919,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
4844
4919
|
})) : createCommentVNode("", true)
|
|
4845
4920
|
]),
|
|
4846
4921
|
default: withCtx(() => [
|
|
4847
|
-
createElementVNode("span", _hoisted_2$
|
|
4922
|
+
createElementVNode("span", _hoisted_2$e, [
|
|
4848
4923
|
createTextVNode(toDisplayString(_ctx.data.text), 1),
|
|
4849
4924
|
createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
|
|
4850
4925
|
default: withCtx(() => [
|
|
@@ -4861,7 +4936,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
4861
4936
|
}
|
|
4862
4937
|
});
|
|
4863
4938
|
|
|
4864
|
-
const _sfc_main$
|
|
4939
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
4865
4940
|
...{
|
|
4866
4941
|
name: "MEditorNavMenu"
|
|
4867
4942
|
},
|
|
@@ -5023,7 +5098,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
5023
5098
|
style: normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
5024
5099
|
}, [
|
|
5025
5100
|
(openBlock(true), createElementBlock(Fragment, null, renderList(buttons.value[key], (item, index) => {
|
|
5026
|
-
return openBlock(), createBlock(_sfc_main$
|
|
5101
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
5027
5102
|
data: item,
|
|
5028
5103
|
key: index
|
|
5029
5104
|
}, null, 8, ["data"]);
|
|
@@ -5035,8 +5110,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
5035
5110
|
}
|
|
5036
5111
|
});
|
|
5037
5112
|
|
|
5038
|
-
const _hoisted_1$
|
|
5039
|
-
const _sfc_main$
|
|
5113
|
+
const _hoisted_1$j = { class: "m-editor-props-panel" };
|
|
5114
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
5040
5115
|
...{
|
|
5041
5116
|
name: "MEditorPropsPanel"
|
|
5042
5117
|
},
|
|
@@ -5089,7 +5164,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
5089
5164
|
};
|
|
5090
5165
|
__expose({ configForm, submit });
|
|
5091
5166
|
return (_ctx, _cache) => {
|
|
5092
|
-
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
5167
|
+
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
5093
5168
|
renderSlot(_ctx.$slots, "props-panel-header"),
|
|
5094
5169
|
createVNode(unref(MForm), {
|
|
5095
5170
|
ref_key: "configForm",
|
|
@@ -5109,7 +5184,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
5109
5184
|
}
|
|
5110
5185
|
});
|
|
5111
5186
|
|
|
5112
|
-
const _sfc_main$
|
|
5187
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
5113
5188
|
...{
|
|
5114
5189
|
name: "MEditorSearchInput"
|
|
5115
5190
|
},
|
|
@@ -5144,8 +5219,8 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
5144
5219
|
}
|
|
5145
5220
|
});
|
|
5146
5221
|
|
|
5147
|
-
const _hoisted_1$
|
|
5148
|
-
const _hoisted_2$
|
|
5222
|
+
const _hoisted_1$i = { xmlns: "http://www.w3.org/2000/svg" };
|
|
5223
|
+
const _hoisted_2$d = /* @__PURE__ */ createElementVNode("g", {
|
|
5149
5224
|
fill: "#7C878E",
|
|
5150
5225
|
"fill-rule": "evenodd"
|
|
5151
5226
|
}, [
|
|
@@ -5155,50 +5230,50 @@ const _hoisted_2$a = /* @__PURE__ */ createElementVNode("g", {
|
|
|
5155
5230
|
}),
|
|
5156
5231
|
/* @__PURE__ */ createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
|
|
5157
5232
|
], -1);
|
|
5158
|
-
const _hoisted_3$
|
|
5159
|
-
_hoisted_2$
|
|
5233
|
+
const _hoisted_3$7 = [
|
|
5234
|
+
_hoisted_2$d
|
|
5160
5235
|
];
|
|
5161
|
-
const _sfc_main$
|
|
5236
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
5162
5237
|
...{
|
|
5163
5238
|
name: "MEditorAppManageIcon"
|
|
5164
5239
|
},
|
|
5165
5240
|
__name: "AppManageIcon",
|
|
5166
5241
|
setup(__props) {
|
|
5167
5242
|
return (_ctx, _cache) => {
|
|
5168
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
5243
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$i, _hoisted_3$7);
|
|
5169
5244
|
};
|
|
5170
5245
|
}
|
|
5171
5246
|
});
|
|
5172
5247
|
|
|
5173
|
-
const _hoisted_1$
|
|
5248
|
+
const _hoisted_1$h = {
|
|
5174
5249
|
viewBox: "0 0 32 32",
|
|
5175
5250
|
version: "1.1",
|
|
5176
5251
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5177
5252
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
5178
5253
|
};
|
|
5179
|
-
const _hoisted_2$
|
|
5180
|
-
const _hoisted_4$
|
|
5181
|
-
_hoisted_2$
|
|
5254
|
+
const _hoisted_2$c = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
5255
|
+
const _hoisted_4$5 = [
|
|
5256
|
+
_hoisted_2$c
|
|
5182
5257
|
];
|
|
5183
|
-
const _sfc_main$
|
|
5258
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
5184
5259
|
...{
|
|
5185
5260
|
name: "MEditorCodeIcon"
|
|
5186
5261
|
},
|
|
5187
5262
|
__name: "CodeIcon",
|
|
5188
5263
|
setup(__props) {
|
|
5189
5264
|
return (_ctx, _cache) => {
|
|
5190
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
5265
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_4$5);
|
|
5191
5266
|
};
|
|
5192
5267
|
}
|
|
5193
5268
|
});
|
|
5194
5269
|
|
|
5195
|
-
const _hoisted_1$
|
|
5196
|
-
const _hoisted_2$
|
|
5197
|
-
const _hoisted_3$
|
|
5270
|
+
const _hoisted_1$g = ["id"];
|
|
5271
|
+
const _hoisted_2$b = { class: "list-item" };
|
|
5272
|
+
const _hoisted_3$6 = {
|
|
5198
5273
|
key: 2,
|
|
5199
5274
|
class: "right-tool"
|
|
5200
5275
|
};
|
|
5201
|
-
const _sfc_main$
|
|
5276
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
5202
5277
|
...{
|
|
5203
5278
|
name: "MEditorCodeBlockList"
|
|
5204
5279
|
},
|
|
@@ -5299,26 +5374,26 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5299
5374
|
id: data.id,
|
|
5300
5375
|
class: "list-container"
|
|
5301
5376
|
}, [
|
|
5302
|
-
createElementVNode("div", _hoisted_2$
|
|
5303
|
-
data.type === "code" ? (openBlock(), createBlock(_sfc_main$
|
|
5377
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
5378
|
+
data.type === "code" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
5304
5379
|
key: 0,
|
|
5305
5380
|
class: "codeIcon"
|
|
5306
5381
|
})) : createCommentVNode("", true),
|
|
5307
|
-
data.type === "node" ? (openBlock(), createBlock(_sfc_main$
|
|
5382
|
+
data.type === "node" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
5308
5383
|
key: 1,
|
|
5309
5384
|
class: "compIcon"
|
|
5310
5385
|
})) : createCommentVNode("", true),
|
|
5311
5386
|
createElementVNode("span", {
|
|
5312
5387
|
class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
|
|
5313
5388
|
}, toDisplayString(data.name) + " (" + toDisplayString(data.id) + ")", 3),
|
|
5314
|
-
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
5389
|
+
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
|
|
5315
5390
|
createVNode(unref(TMagicTooltip), {
|
|
5316
5391
|
effect: "dark",
|
|
5317
5392
|
content: editable.value ? "编辑" : "查看",
|
|
5318
5393
|
placement: "bottom"
|
|
5319
5394
|
}, {
|
|
5320
5395
|
default: withCtx(() => [
|
|
5321
|
-
createVNode(_sfc_main$
|
|
5396
|
+
createVNode(_sfc_main$K, {
|
|
5322
5397
|
icon: editable.value ? unref(Edit) : unref(View),
|
|
5323
5398
|
class: "edit-icon",
|
|
5324
5399
|
onClick: withModifiers(($event) => editCode(data.id), ["stop"])
|
|
@@ -5333,7 +5408,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5333
5408
|
placement: "bottom"
|
|
5334
5409
|
}, {
|
|
5335
5410
|
default: withCtx(() => [
|
|
5336
|
-
createVNode(_sfc_main$
|
|
5411
|
+
createVNode(_sfc_main$K, {
|
|
5337
5412
|
icon: unref(Close),
|
|
5338
5413
|
class: "edit-icon",
|
|
5339
5414
|
onClick: withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -5347,7 +5422,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5347
5422
|
})
|
|
5348
5423
|
])) : createCommentVNode("", true)
|
|
5349
5424
|
])
|
|
5350
|
-
], 8, _hoisted_1$
|
|
5425
|
+
], 8, _hoisted_1$g)
|
|
5351
5426
|
]),
|
|
5352
5427
|
_: 3
|
|
5353
5428
|
}, 8, ["default-expanded-keys", "data"]);
|
|
@@ -5355,8 +5430,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5355
5430
|
}
|
|
5356
5431
|
});
|
|
5357
5432
|
|
|
5358
|
-
const _hoisted_1$
|
|
5359
|
-
const _sfc_main$
|
|
5433
|
+
const _hoisted_1$f = { class: "search-wrapper" };
|
|
5434
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
5360
5435
|
...{
|
|
5361
5436
|
name: "MEditorCodeBlockListPanel"
|
|
5362
5437
|
},
|
|
@@ -5376,8 +5451,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5376
5451
|
return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
|
|
5377
5452
|
default: withCtx(() => [
|
|
5378
5453
|
renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
5379
|
-
createElementVNode("div", _hoisted_1$
|
|
5380
|
-
createVNode(_sfc_main$
|
|
5454
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
5455
|
+
createVNode(_sfc_main$s, { onSearch: filterTextChangeHandler }),
|
|
5381
5456
|
editable.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
5382
5457
|
key: 0,
|
|
5383
5458
|
class: "create-code-button",
|
|
@@ -5393,7 +5468,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5393
5468
|
renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
5394
5469
|
])
|
|
5395
5470
|
]),
|
|
5396
|
-
createVNode(_sfc_main$
|
|
5471
|
+
createVNode(_sfc_main$p, {
|
|
5397
5472
|
ref_key: "codeBlockList",
|
|
5398
5473
|
ref: codeBlockList,
|
|
5399
5474
|
"custom-error": _ctx.customError,
|
|
@@ -5408,7 +5483,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5408
5483
|
]),
|
|
5409
5484
|
_: 3
|
|
5410
5485
|
}, 8, ["custom-error", "onEdit", "onRemove"]),
|
|
5411
|
-
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$
|
|
5486
|
+
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$M, {
|
|
5412
5487
|
key: 0,
|
|
5413
5488
|
ref_key: "codeBlockEditor",
|
|
5414
5489
|
ref: codeBlockEditor,
|
|
@@ -5423,7 +5498,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5423
5498
|
}
|
|
5424
5499
|
});
|
|
5425
5500
|
|
|
5426
|
-
const _sfc_main$
|
|
5501
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
5427
5502
|
...{
|
|
5428
5503
|
name: "MEditorDataSourceConfigPanel"
|
|
5429
5504
|
},
|
|
@@ -5477,13 +5552,13 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5477
5552
|
}
|
|
5478
5553
|
});
|
|
5479
5554
|
|
|
5480
|
-
const _hoisted_1$
|
|
5481
|
-
const _hoisted_2$
|
|
5482
|
-
const _hoisted_3$
|
|
5555
|
+
const _hoisted_1$e = ["id"];
|
|
5556
|
+
const _hoisted_2$a = { class: "list-item" };
|
|
5557
|
+
const _hoisted_3$5 = {
|
|
5483
5558
|
key: 2,
|
|
5484
5559
|
class: "right-tool"
|
|
5485
5560
|
};
|
|
5486
|
-
const _sfc_main$
|
|
5561
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
5487
5562
|
...{
|
|
5488
5563
|
name: "MEditorDataSourceList"
|
|
5489
5564
|
},
|
|
@@ -5578,13 +5653,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5578
5653
|
id: data.id,
|
|
5579
5654
|
class: "list-container"
|
|
5580
5655
|
}, [
|
|
5581
|
-
createElementVNode("div", _hoisted_2$
|
|
5582
|
-
data.type === "code" ? (openBlock(), createBlock(_sfc_main$
|
|
5656
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
5657
|
+
data.type === "code" ? (openBlock(), createBlock(_sfc_main$K, {
|
|
5583
5658
|
key: 0,
|
|
5584
5659
|
class: "codeIcon",
|
|
5585
5660
|
icon: unref(Coin)
|
|
5586
5661
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
5587
|
-
data.type === "node" ? (openBlock(), createBlock(_sfc_main$
|
|
5662
|
+
data.type === "node" ? (openBlock(), createBlock(_sfc_main$K, {
|
|
5588
5663
|
key: 1,
|
|
5589
5664
|
class: "compIcon",
|
|
5590
5665
|
icon: unref(Aim)
|
|
@@ -5592,14 +5667,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5592
5667
|
createElementVNode("span", {
|
|
5593
5668
|
class: normalizeClass(["name", { code: data.type === "ds", hook: data.type === "key" }])
|
|
5594
5669
|
}, toDisplayString(data.type === "key" ? data.name : `${data.name}(${data.id})`), 3),
|
|
5595
|
-
data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
5670
|
+
data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
|
|
5596
5671
|
createVNode(unref(TMagicTooltip), {
|
|
5597
5672
|
effect: "dark",
|
|
5598
5673
|
content: editable.value ? "编辑" : "查看",
|
|
5599
5674
|
placement: "bottom"
|
|
5600
5675
|
}, {
|
|
5601
5676
|
default: withCtx(() => [
|
|
5602
|
-
createVNode(_sfc_main$
|
|
5677
|
+
createVNode(_sfc_main$K, {
|
|
5603
5678
|
icon: editable.value ? unref(Edit) : unref(View),
|
|
5604
5679
|
class: "edit-icon",
|
|
5605
5680
|
onClick: withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
|
|
@@ -5614,7 +5689,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5614
5689
|
placement: "bottom"
|
|
5615
5690
|
}, {
|
|
5616
5691
|
default: withCtx(() => [
|
|
5617
|
-
createVNode(_sfc_main$
|
|
5692
|
+
createVNode(_sfc_main$K, {
|
|
5618
5693
|
icon: unref(Close),
|
|
5619
5694
|
class: "edit-icon",
|
|
5620
5695
|
onClick: withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
|
|
@@ -5628,7 +5703,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5628
5703
|
})
|
|
5629
5704
|
])) : createCommentVNode("", true)
|
|
5630
5705
|
])
|
|
5631
|
-
], 8, _hoisted_1$
|
|
5706
|
+
], 8, _hoisted_1$e)
|
|
5632
5707
|
]),
|
|
5633
5708
|
_: 3
|
|
5634
5709
|
}, 8, ["data"]);
|
|
@@ -5636,9 +5711,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5636
5711
|
}
|
|
5637
5712
|
});
|
|
5638
5713
|
|
|
5639
|
-
const _hoisted_1$
|
|
5640
|
-
const _hoisted_2$
|
|
5641
|
-
const _sfc_main$
|
|
5714
|
+
const _hoisted_1$d = { class: "search-wrapper" };
|
|
5715
|
+
const _hoisted_2$9 = { class: "data-source-list-panel-add-menu" };
|
|
5716
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
5642
5717
|
...{
|
|
5643
5718
|
name: "MEditorDataSourceListPanel"
|
|
5644
5719
|
},
|
|
@@ -5698,8 +5773,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5698
5773
|
return (_ctx, _cache) => {
|
|
5699
5774
|
return openBlock(), createBlock(unref(TMagicScrollbar), { class: "data-source-list-panel m-editor-dep-list-panel" }, {
|
|
5700
5775
|
default: withCtx(() => [
|
|
5701
|
-
createElementVNode("div", _hoisted_1$
|
|
5702
|
-
createVNode(_sfc_main$
|
|
5776
|
+
createElementVNode("div", _hoisted_1$d, [
|
|
5777
|
+
createVNode(_sfc_main$s, { onSearch: filterTextChangeHandler }),
|
|
5703
5778
|
editable.value ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
5704
5779
|
key: 0,
|
|
5705
5780
|
placement: "right"
|
|
@@ -5716,9 +5791,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5716
5791
|
})
|
|
5717
5792
|
]),
|
|
5718
5793
|
default: withCtx(() => [
|
|
5719
|
-
createElementVNode("div", _hoisted_2$
|
|
5794
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
5720
5795
|
(openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
|
|
5721
|
-
return openBlock(), createBlock(_sfc_main$
|
|
5796
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
5722
5797
|
data: {
|
|
5723
5798
|
type: "button",
|
|
5724
5799
|
text: item.text,
|
|
@@ -5734,11 +5809,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5734
5809
|
_: 1
|
|
5735
5810
|
})) : createCommentVNode("", true)
|
|
5736
5811
|
]),
|
|
5737
|
-
createVNode(_sfc_main$
|
|
5812
|
+
createVNode(_sfc_main$m, {
|
|
5738
5813
|
onEdit: editHandler,
|
|
5739
5814
|
onRemove: removeHandler
|
|
5740
5815
|
}),
|
|
5741
|
-
createVNode(_sfc_main$
|
|
5816
|
+
createVNode(_sfc_main$n, {
|
|
5742
5817
|
ref_key: "editDialog",
|
|
5743
5818
|
ref: editDialog,
|
|
5744
5819
|
disabled: !editable.value,
|
|
@@ -5753,9 +5828,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5753
5828
|
}
|
|
5754
5829
|
});
|
|
5755
5830
|
|
|
5756
|
-
const _hoisted_1$
|
|
5757
|
-
const _hoisted_2$
|
|
5758
|
-
const _sfc_main$
|
|
5831
|
+
const _hoisted_1$c = ["onClick", "onDragstart"];
|
|
5832
|
+
const _hoisted_2$8 = ["title"];
|
|
5833
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
5759
5834
|
...{
|
|
5760
5835
|
name: "MEditorComponentListPanel"
|
|
5761
5836
|
},
|
|
@@ -5834,7 +5909,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5834
5909
|
"model-value": collapseValue.value
|
|
5835
5910
|
}, {
|
|
5836
5911
|
default: withCtx(() => [
|
|
5837
|
-
createVNode(_sfc_main$
|
|
5912
|
+
createVNode(_sfc_main$s, { onSearch: filterTextChangeHandler }),
|
|
5838
5913
|
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (group, index) => {
|
|
5839
5914
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
5840
5915
|
group.items && group.items.length ? (openBlock(), createBlock(unref(TMagicCollapseItem), {
|
|
@@ -5842,7 +5917,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5842
5917
|
name: `${index}`
|
|
5843
5918
|
}, {
|
|
5844
5919
|
title: withCtx(() => [
|
|
5845
|
-
createVNode(_sfc_main$
|
|
5920
|
+
createVNode(_sfc_main$K, { icon: unref(Grid) }, null, 8, ["icon"]),
|
|
5846
5921
|
createTextVNode(toDisplayString(group.title), 1)
|
|
5847
5922
|
]),
|
|
5848
5923
|
default: withCtx(() => [
|
|
@@ -5857,15 +5932,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5857
5932
|
onDrag: dragHandler
|
|
5858
5933
|
}, [
|
|
5859
5934
|
renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
5860
|
-
createVNode(_sfc_main$
|
|
5935
|
+
createVNode(_sfc_main$K, {
|
|
5861
5936
|
title: item.text,
|
|
5862
5937
|
icon: item.icon
|
|
5863
5938
|
}, null, 8, ["title", "icon"]),
|
|
5864
5939
|
createElementVNode("span", {
|
|
5865
5940
|
title: item.text
|
|
5866
|
-
}, toDisplayString(item.text), 9, _hoisted_2$
|
|
5941
|
+
}, toDisplayString(item.text), 9, _hoisted_2$8)
|
|
5867
5942
|
])
|
|
5868
|
-
], 40, _hoisted_1$
|
|
5943
|
+
], 40, _hoisted_1$c);
|
|
5869
5944
|
}), 128))
|
|
5870
5945
|
]),
|
|
5871
5946
|
_: 2
|
|
@@ -5882,16 +5957,18 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5882
5957
|
}
|
|
5883
5958
|
});
|
|
5884
5959
|
|
|
5885
|
-
const _sfc_main$
|
|
5960
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
5886
5961
|
...{
|
|
5887
5962
|
name: "MEditorContentMenu"
|
|
5888
5963
|
},
|
|
5889
5964
|
__name: "ContentMenu",
|
|
5890
5965
|
props: {
|
|
5891
5966
|
menuData: { default: () => [] },
|
|
5892
|
-
isSubMenu: { type: Boolean, default: false }
|
|
5967
|
+
isSubMenu: { type: Boolean, default: false },
|
|
5968
|
+
active: {},
|
|
5969
|
+
autoHide: { type: Boolean, default: true }
|
|
5893
5970
|
},
|
|
5894
|
-
emits: ["hide", "show"],
|
|
5971
|
+
emits: ["hide", "show", "mouseenter"],
|
|
5895
5972
|
setup(__props, { expose: __expose, emit }) {
|
|
5896
5973
|
const props = __props;
|
|
5897
5974
|
const menu = ref();
|
|
@@ -5899,10 +5976,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
5899
5976
|
const subMenu = ref();
|
|
5900
5977
|
const visible = ref(false);
|
|
5901
5978
|
const subMenuData = ref([]);
|
|
5902
|
-
const
|
|
5903
|
-
left:
|
|
5904
|
-
top:
|
|
5979
|
+
const menuPosition = ref({
|
|
5980
|
+
left: 0,
|
|
5981
|
+
top: 0
|
|
5905
5982
|
});
|
|
5983
|
+
const menuStyle = computed(() => ({
|
|
5984
|
+
top: `${menuPosition.value.top}px`,
|
|
5985
|
+
left: `${menuPosition.value.left}px`
|
|
5986
|
+
}));
|
|
5906
5987
|
const contains = (el) => menu.value?.contains(el) || subMenu.value?.contains(el);
|
|
5907
5988
|
const hide = () => {
|
|
5908
5989
|
if (!visible.value)
|
|
@@ -5911,7 +5992,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
5911
5992
|
subMenu.value?.hide();
|
|
5912
5993
|
emit("hide");
|
|
5913
5994
|
};
|
|
5914
|
-
const
|
|
5995
|
+
const clickHandler = () => {
|
|
5996
|
+
if (!props.autoHide)
|
|
5997
|
+
return;
|
|
5998
|
+
hide();
|
|
5999
|
+
};
|
|
6000
|
+
const outsideClickhideHandler = (e) => {
|
|
6001
|
+
if (!props.autoHide)
|
|
6002
|
+
return;
|
|
5915
6003
|
const target = e.target;
|
|
5916
6004
|
if (!visible.value || !target) {
|
|
5917
6005
|
return;
|
|
@@ -5921,19 +6009,25 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
5921
6009
|
}
|
|
5922
6010
|
hide();
|
|
5923
6011
|
};
|
|
6012
|
+
const setPosition = (e) => {
|
|
6013
|
+
const menuHeight = menu.value?.clientHeight || 0;
|
|
6014
|
+
let top = e.clientY;
|
|
6015
|
+
if (menuHeight + e.clientY > document.body.clientHeight) {
|
|
6016
|
+
top = document.body.clientHeight - menuHeight;
|
|
6017
|
+
}
|
|
6018
|
+
menuPosition.value = {
|
|
6019
|
+
top,
|
|
6020
|
+
left: e.clientX
|
|
6021
|
+
};
|
|
6022
|
+
};
|
|
5924
6023
|
const show = (e) => {
|
|
5925
6024
|
setTimeout(() => {
|
|
5926
6025
|
visible.value = true;
|
|
6026
|
+
if (!e) {
|
|
6027
|
+
return;
|
|
6028
|
+
}
|
|
5927
6029
|
nextTick(() => {
|
|
5928
|
-
|
|
5929
|
-
let top = e.clientY;
|
|
5930
|
-
if (menuHeight + e.clientY > document.body.clientHeight) {
|
|
5931
|
-
top = document.body.clientHeight - menuHeight;
|
|
5932
|
-
}
|
|
5933
|
-
menuStyle.value = {
|
|
5934
|
-
top: `${top}px`,
|
|
5935
|
-
left: `${e.clientX}px`
|
|
5936
|
-
};
|
|
6030
|
+
setPosition(e);
|
|
5937
6031
|
emit("show");
|
|
5938
6032
|
});
|
|
5939
6033
|
}, 300);
|
|
@@ -5958,64 +6052,77 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
5958
6052
|
}
|
|
5959
6053
|
}, 0);
|
|
5960
6054
|
};
|
|
6055
|
+
const mouseenterHandler = () => {
|
|
6056
|
+
emit("mouseenter");
|
|
6057
|
+
};
|
|
5961
6058
|
onMounted(() => {
|
|
5962
6059
|
if (props.isSubMenu)
|
|
5963
6060
|
return;
|
|
5964
|
-
globalThis.addEventListener("mousedown",
|
|
6061
|
+
globalThis.addEventListener("mousedown", outsideClickhideHandler, true);
|
|
5965
6062
|
});
|
|
5966
6063
|
onUnmounted(() => {
|
|
5967
6064
|
if (props.isSubMenu)
|
|
5968
6065
|
return;
|
|
5969
|
-
globalThis.removeEventListener("mousedown",
|
|
6066
|
+
globalThis.removeEventListener("mousedown", outsideClickhideHandler, true);
|
|
5970
6067
|
});
|
|
5971
6068
|
__expose({
|
|
5972
6069
|
menu,
|
|
6070
|
+
menuPosition,
|
|
5973
6071
|
hide,
|
|
5974
6072
|
show,
|
|
5975
|
-
contains
|
|
6073
|
+
contains,
|
|
6074
|
+
setPosition
|
|
5976
6075
|
});
|
|
5977
6076
|
return (_ctx, _cache) => {
|
|
5978
6077
|
const _component_content_menu = resolveComponent("content-menu", true);
|
|
5979
|
-
return
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
6078
|
+
return openBlock(), createBlock(Transition, { name: "fade" }, {
|
|
6079
|
+
default: withCtx(() => [
|
|
6080
|
+
withDirectives(createElementVNode("div", {
|
|
6081
|
+
class: "magic-editor-content-menu",
|
|
6082
|
+
ref_key: "menu",
|
|
6083
|
+
ref: menu,
|
|
6084
|
+
style: normalizeStyle(menuStyle.value),
|
|
6085
|
+
onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseenterHandler())
|
|
6086
|
+
}, [
|
|
6087
|
+
renderSlot(_ctx.$slots, "title"),
|
|
6088
|
+
createElementVNode("div", null, [
|
|
6089
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuData, (item, index) => {
|
|
6090
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
6091
|
+
"event-type": "mouseup",
|
|
6092
|
+
ref_for: true,
|
|
6093
|
+
ref_key: "buttons",
|
|
6094
|
+
ref: buttons,
|
|
6095
|
+
class: normalizeClass({ active: _ctx.active && item.id === _ctx.active }),
|
|
6096
|
+
data: item,
|
|
6097
|
+
key: index,
|
|
6098
|
+
onMouseup: clickHandler,
|
|
6099
|
+
onMouseenter: ($event) => showSubMenu(item, index)
|
|
6100
|
+
}, null, 8, ["class", "data", "onMouseenter"]);
|
|
6101
|
+
}), 128))
|
|
6102
|
+
]),
|
|
6103
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
6104
|
+
subMenuData.value.length ? (openBlock(), createBlock(_component_content_menu, {
|
|
6105
|
+
key: 0,
|
|
6106
|
+
class: "sub-menu",
|
|
6107
|
+
ref_key: "subMenu",
|
|
6108
|
+
ref: subMenu,
|
|
6109
|
+
active: _ctx.active,
|
|
6110
|
+
"menu-data": subMenuData.value,
|
|
6111
|
+
"is-sub-menu": true,
|
|
6112
|
+
onHide: hide
|
|
6113
|
+
}, null, 8, ["active", "menu-data"])) : createCommentVNode("", true)
|
|
6114
|
+
]))
|
|
6115
|
+
], 36), [
|
|
6116
|
+
[vShow, visible.value]
|
|
6117
|
+
])
|
|
5999
6118
|
]),
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
key: 0,
|
|
6003
|
-
class: "sub-menu",
|
|
6004
|
-
ref_key: "subMenu",
|
|
6005
|
-
ref: subMenu,
|
|
6006
|
-
"menu-data": subMenuData.value,
|
|
6007
|
-
"is-sub-menu": true,
|
|
6008
|
-
onHide: hide
|
|
6009
|
-
}, null, 8, ["menu-data"])) : createCommentVNode("", true)
|
|
6010
|
-
]))
|
|
6011
|
-
], 4)), [
|
|
6012
|
-
[vShow, visible.value]
|
|
6013
|
-
]) : createCommentVNode("", true);
|
|
6119
|
+
_: 3
|
|
6120
|
+
});
|
|
6014
6121
|
};
|
|
6015
6122
|
}
|
|
6016
6123
|
});
|
|
6017
6124
|
|
|
6018
|
-
const _hoisted_1$
|
|
6125
|
+
const _hoisted_1$b = {
|
|
6019
6126
|
width: "1em",
|
|
6020
6127
|
height: "1em",
|
|
6021
6128
|
viewBox: "0 0 16 16",
|
|
@@ -6023,26 +6130,26 @@ const _hoisted_1$8 = {
|
|
|
6023
6130
|
fill: "currentColor",
|
|
6024
6131
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6025
6132
|
};
|
|
6026
|
-
const _hoisted_2$
|
|
6133
|
+
const _hoisted_2$7 = /* @__PURE__ */ createElementVNode("path", {
|
|
6027
6134
|
"fill-rule": "evenodd",
|
|
6028
6135
|
d: "M9.828 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H9.828zm-2.95-1.707L7.587 3H2.19c-.24 0-.47.042-.684.12L1.5 2.98a1 1 0 0 1 1-.98h3.672a1 1 0 0 1 .707.293z"
|
|
6029
6136
|
}, null, -1);
|
|
6030
|
-
const _hoisted_3$
|
|
6137
|
+
const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("path", {
|
|
6031
6138
|
"fill-rule": "evenodd",
|
|
6032
6139
|
d: "M11 11.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z"
|
|
6033
6140
|
}, null, -1);
|
|
6034
|
-
const _hoisted_4$
|
|
6035
|
-
_hoisted_2$
|
|
6036
|
-
_hoisted_3$
|
|
6141
|
+
const _hoisted_4$4 = [
|
|
6142
|
+
_hoisted_2$7,
|
|
6143
|
+
_hoisted_3$4
|
|
6037
6144
|
];
|
|
6038
|
-
const _sfc_main$
|
|
6145
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
6039
6146
|
...{
|
|
6040
6147
|
name: "MEditorFolderMinusIcon"
|
|
6041
6148
|
},
|
|
6042
6149
|
__name: "FolderMinusIcon",
|
|
6043
6150
|
setup(__props) {
|
|
6044
6151
|
return (_ctx, _cache) => {
|
|
6045
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6152
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$b, _hoisted_4$4);
|
|
6046
6153
|
};
|
|
6047
6154
|
}
|
|
6048
6155
|
});
|
|
@@ -6122,7 +6229,7 @@ const useMoveToMenu = (services) => {
|
|
|
6122
6229
|
};
|
|
6123
6230
|
};
|
|
6124
6231
|
|
|
6125
|
-
const _sfc_main$
|
|
6232
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
6126
6233
|
...{
|
|
6127
6234
|
name: "MEditorLayerMenu"
|
|
6128
6235
|
},
|
|
@@ -6185,7 +6292,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6185
6292
|
{
|
|
6186
6293
|
type: "button",
|
|
6187
6294
|
text: "全部折叠",
|
|
6188
|
-
icon: _sfc_main$
|
|
6295
|
+
icon: _sfc_main$i,
|
|
6189
6296
|
display: () => isPage(node.value),
|
|
6190
6297
|
handler: () => {
|
|
6191
6298
|
emit("collapse-all");
|
|
@@ -6211,7 +6318,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6211
6318
|
show
|
|
6212
6319
|
});
|
|
6213
6320
|
return (_ctx, _cache) => {
|
|
6214
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6321
|
+
return openBlock(), createBlock(_sfc_main$j, {
|
|
6215
6322
|
"menu-data": menuData.value,
|
|
6216
6323
|
ref_key: "menu",
|
|
6217
6324
|
ref: menu,
|
|
@@ -6221,8 +6328,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6221
6328
|
}
|
|
6222
6329
|
});
|
|
6223
6330
|
|
|
6224
|
-
const _hoisted_1$
|
|
6225
|
-
const _sfc_main$
|
|
6331
|
+
const _hoisted_1$a = { class: "layer-node-tool" };
|
|
6332
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
6226
6333
|
__name: "LayerNode",
|
|
6227
6334
|
props: {
|
|
6228
6335
|
data: {}
|
|
@@ -6243,7 +6350,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6243
6350
|
const _component_el_icon = resolveComponent("el-icon");
|
|
6244
6351
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
6245
6352
|
createElementVNode("div", null, toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
|
|
6246
|
-
createElementVNode("div", _hoisted_1$
|
|
6353
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
6247
6354
|
_ctx.data.type !== "page" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
6248
6355
|
_ctx.data.visible === false ? (openBlock(), createBlock(_component_el_icon, {
|
|
6249
6356
|
key: 0,
|
|
@@ -6272,9 +6379,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6272
6379
|
}
|
|
6273
6380
|
});
|
|
6274
6381
|
|
|
6275
|
-
const _hoisted_1$
|
|
6382
|
+
const _hoisted_1$9 = ["id", "onMouseenter"];
|
|
6276
6383
|
const throttleTime = 150;
|
|
6277
|
-
const _sfc_main$
|
|
6384
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
6278
6385
|
...{
|
|
6279
6386
|
name: "MEditorLayerPanel"
|
|
6280
6387
|
},
|
|
@@ -6522,7 +6629,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6522
6629
|
return openBlock(), createBlock(unref(TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
|
|
6523
6630
|
default: withCtx(() => [
|
|
6524
6631
|
renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
6525
|
-
createVNode(_sfc_main$
|
|
6632
|
+
createVNode(_sfc_main$s, { onSearch: filterTextChangeHandler }),
|
|
6526
6633
|
values.value.length ? (openBlock(), createBlock(unref(TMagicTree), {
|
|
6527
6634
|
key: 0,
|
|
6528
6635
|
class: "magic-editor-layer-tree",
|
|
@@ -6562,14 +6669,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6562
6669
|
node,
|
|
6563
6670
|
data
|
|
6564
6671
|
}, () => [
|
|
6565
|
-
createVNode(_sfc_main$
|
|
6672
|
+
createVNode(_sfc_main$g, { data }, null, 8, ["data"])
|
|
6566
6673
|
])
|
|
6567
|
-
], 40, _hoisted_1$
|
|
6674
|
+
], 40, _hoisted_1$9)
|
|
6568
6675
|
]),
|
|
6569
6676
|
_: 3
|
|
6570
6677
|
}, 8, ["default-expanded-keys", "default-checked-keys", "current-node-key", "data", "highlight-current", "show-checkbox"])) : createCommentVNode("", true),
|
|
6571
6678
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
6572
|
-
createVNode(_sfc_main$
|
|
6679
|
+
createVNode(_sfc_main$h, {
|
|
6573
6680
|
ref_key: "menu",
|
|
6574
6681
|
ref: menu,
|
|
6575
6682
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
@@ -6583,17 +6690,17 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6583
6690
|
}
|
|
6584
6691
|
});
|
|
6585
6692
|
|
|
6586
|
-
const _hoisted_1$
|
|
6693
|
+
const _hoisted_1$8 = {
|
|
6587
6694
|
key: 0,
|
|
6588
6695
|
class: "m-editor-sidebar"
|
|
6589
6696
|
};
|
|
6590
|
-
const _hoisted_2$
|
|
6591
|
-
const _hoisted_3$
|
|
6592
|
-
const _hoisted_4$
|
|
6697
|
+
const _hoisted_2$6 = { class: "m-editor-sidebar-header" };
|
|
6698
|
+
const _hoisted_3$3 = ["onClick"];
|
|
6699
|
+
const _hoisted_4$3 = {
|
|
6593
6700
|
key: 1,
|
|
6594
6701
|
class: "magic-editor-tab-panel-title"
|
|
6595
6702
|
};
|
|
6596
|
-
const _sfc_main$
|
|
6703
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
6597
6704
|
...{
|
|
6598
6705
|
name: "MEditorSidebar"
|
|
6599
6706
|
},
|
|
@@ -6612,7 +6719,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6612
6719
|
type: "component",
|
|
6613
6720
|
icon: Goods,
|
|
6614
6721
|
text: "组件",
|
|
6615
|
-
component: _sfc_main$
|
|
6722
|
+
component: _sfc_main$k,
|
|
6616
6723
|
slots: {}
|
|
6617
6724
|
},
|
|
6618
6725
|
layer: {
|
|
@@ -6623,7 +6730,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6623
6730
|
props: {
|
|
6624
6731
|
layerContentMenu: props.layerContentMenu
|
|
6625
6732
|
},
|
|
6626
|
-
component: _sfc_main$
|
|
6733
|
+
component: _sfc_main$f,
|
|
6627
6734
|
slots: {}
|
|
6628
6735
|
},
|
|
6629
6736
|
"code-block": {
|
|
@@ -6631,7 +6738,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6631
6738
|
type: "component",
|
|
6632
6739
|
icon: EditPen,
|
|
6633
6740
|
text: "代码编辑",
|
|
6634
|
-
component: _sfc_main$
|
|
6741
|
+
component: _sfc_main$o,
|
|
6635
6742
|
slots: {}
|
|
6636
6743
|
},
|
|
6637
6744
|
"data-source": {
|
|
@@ -6639,7 +6746,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6639
6746
|
type: "component",
|
|
6640
6747
|
icon: Coin,
|
|
6641
6748
|
text: "数据源",
|
|
6642
|
-
component: _sfc_main$
|
|
6749
|
+
component: _sfc_main$l,
|
|
6643
6750
|
slots: {}
|
|
6644
6751
|
}
|
|
6645
6752
|
};
|
|
@@ -6656,20 +6763,20 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6656
6763
|
activeTabName
|
|
6657
6764
|
});
|
|
6658
6765
|
return (_ctx, _cache) => {
|
|
6659
|
-
return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6660
|
-
createElementVNode("div", _hoisted_2$
|
|
6766
|
+
return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
6767
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
6661
6768
|
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
6662
6769
|
return openBlock(), createElementBlock("div", {
|
|
6663
6770
|
class: normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
6664
6771
|
key: config.$key ?? index,
|
|
6665
6772
|
onClick: ($event) => activeTabName.value = config.text || `${index}`
|
|
6666
6773
|
}, [
|
|
6667
|
-
config.icon ? (openBlock(), createBlock(_sfc_main$
|
|
6774
|
+
config.icon ? (openBlock(), createBlock(_sfc_main$K, {
|
|
6668
6775
|
key: 0,
|
|
6669
6776
|
icon: config.icon
|
|
6670
6777
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
6671
|
-
config.text ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
6672
|
-
], 10, _hoisted_3$
|
|
6778
|
+
config.text ? (openBlock(), createElementBlock("div", _hoisted_4$3, toDisplayString(config.text), 1)) : createCommentVNode("", true)
|
|
6779
|
+
], 10, _hoisted_3$3);
|
|
6673
6780
|
}), 128))
|
|
6674
6781
|
]),
|
|
6675
6782
|
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
@@ -6748,268 +6855,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6748
6855
|
}
|
|
6749
6856
|
});
|
|
6750
6857
|
|
|
6751
|
-
const _hoisted_1$4 = {
|
|
6752
|
-
key: 0,
|
|
6753
|
-
class: "m-editor-breadcrumb"
|
|
6754
|
-
};
|
|
6755
|
-
const _hoisted_2$2 = { key: 0 };
|
|
6756
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
6757
|
-
...{
|
|
6758
|
-
name: "MEditorBreadcrumb"
|
|
6759
|
-
},
|
|
6760
|
-
__name: "Breadcrumb",
|
|
6761
|
-
setup(__props) {
|
|
6762
|
-
const services = inject("services");
|
|
6763
|
-
const editorService = services?.editorService;
|
|
6764
|
-
const node = computed(() => editorService?.get("node"));
|
|
6765
|
-
const nodes = computed(() => editorService?.get("nodes") || []);
|
|
6766
|
-
const root = computed(() => editorService?.get("root"));
|
|
6767
|
-
const path = computed(() => getNodePath(node.value?.id || "", root.value?.items || []));
|
|
6768
|
-
const select = async (node2) => {
|
|
6769
|
-
await editorService?.select(node2);
|
|
6770
|
-
editorService?.get("stage")?.select(node2.id);
|
|
6771
|
-
};
|
|
6772
|
-
return (_ctx, _cache) => {
|
|
6773
|
-
return nodes.value.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
6774
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(path.value, (item, index) => {
|
|
6775
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
6776
|
-
key: item.id
|
|
6777
|
-
}, [
|
|
6778
|
-
createVNode(unref(TMagicButton), {
|
|
6779
|
-
text: "",
|
|
6780
|
-
disabled: item.id === node.value?.id,
|
|
6781
|
-
onClick: ($event) => select(item)
|
|
6782
|
-
}, {
|
|
6783
|
-
default: withCtx(() => [
|
|
6784
|
-
createTextVNode(toDisplayString(item.name), 1)
|
|
6785
|
-
]),
|
|
6786
|
-
_: 2
|
|
6787
|
-
}, 1032, ["disabled", "onClick"]),
|
|
6788
|
-
index < path.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_2$2, "/")) : createCommentVNode("", true)
|
|
6789
|
-
], 64);
|
|
6790
|
-
}), 128))
|
|
6791
|
-
])) : createCommentVNode("", true);
|
|
6792
|
-
};
|
|
6793
|
-
}
|
|
6794
|
-
});
|
|
6795
|
-
|
|
6796
|
-
const _hoisted_1$3 = {
|
|
6797
|
-
key: 1,
|
|
6798
|
-
style: { "width": "21px" }
|
|
6799
|
-
};
|
|
6800
|
-
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
6801
|
-
...{
|
|
6802
|
-
name: "MEditorPageBarScrollContainer"
|
|
6803
|
-
},
|
|
6804
|
-
__name: "PageBarScrollContainer",
|
|
6805
|
-
setup(__props) {
|
|
6806
|
-
const services = inject("services");
|
|
6807
|
-
const editorService = services?.editorService;
|
|
6808
|
-
const uiService = services?.uiService;
|
|
6809
|
-
const itemsContainer = ref();
|
|
6810
|
-
const canScroll = ref(false);
|
|
6811
|
-
const showAddPageButton = computed(() => uiService?.get("showAddPageButton"));
|
|
6812
|
-
const itemsContainerWidth = ref(0);
|
|
6813
|
-
const setCanScroll = () => {
|
|
6814
|
-
itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - (showAddPageButton.value ? 37 : 21);
|
|
6815
|
-
nextTick(() => {
|
|
6816
|
-
if (itemsContainer.value) {
|
|
6817
|
-
canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
6818
|
-
}
|
|
6819
|
-
});
|
|
6820
|
-
};
|
|
6821
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
6822
|
-
setCanScroll();
|
|
6823
|
-
});
|
|
6824
|
-
const pageBar = ref();
|
|
6825
|
-
onMounted(() => {
|
|
6826
|
-
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
6827
|
-
});
|
|
6828
|
-
onUnmounted(() => {
|
|
6829
|
-
resizeObserver.disconnect();
|
|
6830
|
-
});
|
|
6831
|
-
let translateLeft = 0;
|
|
6832
|
-
const scroll = (type) => {
|
|
6833
|
-
if (!itemsContainer.value)
|
|
6834
|
-
return;
|
|
6835
|
-
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
6836
|
-
if (type === "left") {
|
|
6837
|
-
translateLeft += 100;
|
|
6838
|
-
if (translateLeft > 0) {
|
|
6839
|
-
translateLeft = 0;
|
|
6840
|
-
}
|
|
6841
|
-
} else if (type === "right") {
|
|
6842
|
-
translateLeft -= 100;
|
|
6843
|
-
if (-translateLeft > maxScrollLeft) {
|
|
6844
|
-
translateLeft = -maxScrollLeft;
|
|
6845
|
-
}
|
|
6846
|
-
} else if (type === "start") {
|
|
6847
|
-
translateLeft = 0;
|
|
6848
|
-
} else if (type === "end") {
|
|
6849
|
-
translateLeft = -maxScrollLeft;
|
|
6850
|
-
}
|
|
6851
|
-
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
6852
|
-
};
|
|
6853
|
-
const pageLength = computed(() => editorService?.get("pageLength"));
|
|
6854
|
-
watch(pageLength, (length = 0, preLength = 0) => {
|
|
6855
|
-
setTimeout(() => {
|
|
6856
|
-
setCanScroll();
|
|
6857
|
-
if (length < preLength) {
|
|
6858
|
-
scroll("start");
|
|
6859
|
-
} else {
|
|
6860
|
-
scroll("end");
|
|
6861
|
-
}
|
|
6862
|
-
});
|
|
6863
|
-
});
|
|
6864
|
-
const addPage = () => {
|
|
6865
|
-
if (!editorService)
|
|
6866
|
-
return;
|
|
6867
|
-
const root = toRaw(editorService.get("root"));
|
|
6868
|
-
if (!root)
|
|
6869
|
-
throw new Error("root 不能为空");
|
|
6870
|
-
const pageConfig = {
|
|
6871
|
-
type: NodeType.PAGE,
|
|
6872
|
-
name: generatePageNameByApp(root)
|
|
6873
|
-
};
|
|
6874
|
-
editorService.add(pageConfig);
|
|
6875
|
-
};
|
|
6876
|
-
return (_ctx, _cache) => {
|
|
6877
|
-
return openBlock(), createElementBlock("div", {
|
|
6878
|
-
class: "m-editor-page-bar",
|
|
6879
|
-
ref_key: "pageBar",
|
|
6880
|
-
ref: pageBar
|
|
6881
|
-
}, [
|
|
6882
|
-
showAddPageButton.value ? (openBlock(), createElementBlock("div", {
|
|
6883
|
-
key: 0,
|
|
6884
|
-
id: "m-editor-page-bar-add-icon",
|
|
6885
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
6886
|
-
onClick: addPage
|
|
6887
|
-
}, [
|
|
6888
|
-
createVNode(_sfc_main$G, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
6889
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_1$3)),
|
|
6890
|
-
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
6891
|
-
key: 2,
|
|
6892
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
6893
|
-
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
6894
|
-
}, [
|
|
6895
|
-
createVNode(_sfc_main$G, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
|
|
6896
|
-
])) : createCommentVNode("", true),
|
|
6897
|
-
pageLength.value ? (openBlock(), createElementBlock("div", {
|
|
6898
|
-
key: 3,
|
|
6899
|
-
class: "m-editor-page-bar-items",
|
|
6900
|
-
ref_key: "itemsContainer",
|
|
6901
|
-
ref: itemsContainer,
|
|
6902
|
-
style: normalizeStyle(`width: ${itemsContainerWidth.value}px`)
|
|
6903
|
-
}, [
|
|
6904
|
-
renderSlot(_ctx.$slots, "default")
|
|
6905
|
-
], 4)) : createCommentVNode("", true),
|
|
6906
|
-
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
6907
|
-
key: 4,
|
|
6908
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
6909
|
-
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
6910
|
-
}, [
|
|
6911
|
-
createVNode(_sfc_main$G, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
|
|
6912
|
-
])) : createCommentVNode("", true)
|
|
6913
|
-
], 512);
|
|
6914
|
-
};
|
|
6915
|
-
}
|
|
6916
|
-
});
|
|
6917
|
-
|
|
6918
|
-
const _hoisted_1$2 = ["onClick"];
|
|
6919
|
-
const _hoisted_2$1 = { class: "m-editor-page-bar-title" };
|
|
6920
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
6921
|
-
...{
|
|
6922
|
-
name: "MEditorPageBar"
|
|
6923
|
-
},
|
|
6924
|
-
__name: "PageBar",
|
|
6925
|
-
setup(__props) {
|
|
6926
|
-
const services = inject("services");
|
|
6927
|
-
const editorService = services?.editorService;
|
|
6928
|
-
const root = computed(() => editorService?.get("root"));
|
|
6929
|
-
const page = computed(() => editorService?.get("page"));
|
|
6930
|
-
const switchPage = (page2) => {
|
|
6931
|
-
editorService?.select(page2);
|
|
6932
|
-
};
|
|
6933
|
-
const copy = (node) => {
|
|
6934
|
-
node && editorService?.copy(node);
|
|
6935
|
-
editorService?.paste({
|
|
6936
|
-
left: 0,
|
|
6937
|
-
top: 0
|
|
6938
|
-
});
|
|
6939
|
-
};
|
|
6940
|
-
const remove = (node) => {
|
|
6941
|
-
editorService?.remove(node);
|
|
6942
|
-
};
|
|
6943
|
-
return (_ctx, _cache) => {
|
|
6944
|
-
return openBlock(), createBlock(_sfc_main$8, null, {
|
|
6945
|
-
default: withCtx(() => [
|
|
6946
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(root.value && root.value.items || [], (item) => {
|
|
6947
|
-
return openBlock(), createElementBlock("div", {
|
|
6948
|
-
class: normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
6949
|
-
key: item.key,
|
|
6950
|
-
onClick: ($event) => switchPage(item)
|
|
6951
|
-
}, [
|
|
6952
|
-
createElementVNode("div", _hoisted_2$1, [
|
|
6953
|
-
renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
6954
|
-
createVNode(unref(TMagicTooltip), {
|
|
6955
|
-
effect: "dark",
|
|
6956
|
-
placement: "top-start",
|
|
6957
|
-
content: item.name
|
|
6958
|
-
}, {
|
|
6959
|
-
default: withCtx(() => [
|
|
6960
|
-
createElementVNode("span", null, toDisplayString(item.name || item.id), 1)
|
|
6961
|
-
]),
|
|
6962
|
-
_: 2
|
|
6963
|
-
}, 1032, ["content"])
|
|
6964
|
-
])
|
|
6965
|
-
]),
|
|
6966
|
-
createVNode(unref(TMagicPopover), {
|
|
6967
|
-
"popper-class": "page-bar-popover",
|
|
6968
|
-
placement: "top",
|
|
6969
|
-
width: 160,
|
|
6970
|
-
trigger: "hover"
|
|
6971
|
-
}, {
|
|
6972
|
-
reference: withCtx(() => [
|
|
6973
|
-
createVNode(unref(TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
6974
|
-
default: withCtx(() => [
|
|
6975
|
-
createVNode(unref(CaretBottom))
|
|
6976
|
-
]),
|
|
6977
|
-
_: 1
|
|
6978
|
-
})
|
|
6979
|
-
]),
|
|
6980
|
-
default: withCtx(() => [
|
|
6981
|
-
createElementVNode("div", null, [
|
|
6982
|
-
renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
6983
|
-
createVNode(_sfc_main$r, {
|
|
6984
|
-
data: {
|
|
6985
|
-
type: "button",
|
|
6986
|
-
text: "复制",
|
|
6987
|
-
icon: unref(DocumentCopy),
|
|
6988
|
-
handler: () => copy(item)
|
|
6989
|
-
}
|
|
6990
|
-
}, null, 8, ["data"]),
|
|
6991
|
-
createVNode(_sfc_main$r, {
|
|
6992
|
-
data: {
|
|
6993
|
-
type: "button",
|
|
6994
|
-
text: "删除",
|
|
6995
|
-
icon: unref(Delete),
|
|
6996
|
-
handler: () => remove(item)
|
|
6997
|
-
}
|
|
6998
|
-
}, null, 8, ["data"])
|
|
6999
|
-
])
|
|
7000
|
-
])
|
|
7001
|
-
]),
|
|
7002
|
-
_: 2
|
|
7003
|
-
}, 1024)
|
|
7004
|
-
], 10, _hoisted_1$2);
|
|
7005
|
-
}), 128))
|
|
7006
|
-
]),
|
|
7007
|
-
_: 3
|
|
7008
|
-
});
|
|
7009
|
-
};
|
|
7010
|
-
}
|
|
7011
|
-
});
|
|
7012
|
-
|
|
7013
6858
|
class ScrollViewer extends EventEmitter {
|
|
7014
6859
|
container;
|
|
7015
6860
|
target;
|
|
@@ -7138,7 +6983,7 @@ class ScrollViewer extends EventEmitter {
|
|
|
7138
6983
|
};
|
|
7139
6984
|
}
|
|
7140
6985
|
|
|
7141
|
-
const _sfc_main$
|
|
6986
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
7142
6987
|
...{
|
|
7143
6988
|
name: "MEditorScrollBar"
|
|
7144
6989
|
},
|
|
@@ -7227,7 +7072,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
7227
7072
|
|
|
7228
7073
|
const ScrollBar_vue_vue_type_style_index_0_lang = '';
|
|
7229
7074
|
|
|
7230
|
-
const _sfc_main$
|
|
7075
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
7231
7076
|
...{
|
|
7232
7077
|
name: "MEditorScrollViewer"
|
|
7233
7078
|
},
|
|
@@ -7313,14 +7158,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
7313
7158
|
}, [
|
|
7314
7159
|
renderSlot(_ctx.$slots, "default")
|
|
7315
7160
|
], 4),
|
|
7316
|
-
scrollHeight.value > _ctx.wrapHeight ? (openBlock(), createBlock(_sfc_main$
|
|
7161
|
+
scrollHeight.value > _ctx.wrapHeight ? (openBlock(), createBlock(_sfc_main$d, {
|
|
7317
7162
|
key: 0,
|
|
7318
7163
|
"scroll-size": scrollHeight.value,
|
|
7319
7164
|
size: _ctx.wrapHeight,
|
|
7320
7165
|
pos: vOffset.value,
|
|
7321
7166
|
onScroll: vScrollHandler
|
|
7322
7167
|
}, null, 8, ["scroll-size", "size", "pos"])) : createCommentVNode("", true),
|
|
7323
|
-
scrollWidth.value > _ctx.wrapWidth ? (openBlock(), createBlock(_sfc_main$
|
|
7168
|
+
scrollWidth.value > _ctx.wrapWidth ? (openBlock(), createBlock(_sfc_main$d, {
|
|
7324
7169
|
key: 1,
|
|
7325
7170
|
"is-horizontal": true,
|
|
7326
7171
|
"scroll-size": scrollWidth.value,
|
|
@@ -7498,83 +7343,378 @@ const useStage = (stageOptions) => {
|
|
|
7498
7343
|
return stage;
|
|
7499
7344
|
};
|
|
7500
7345
|
|
|
7501
|
-
const _hoisted_1$
|
|
7346
|
+
const _hoisted_1$7 = {
|
|
7347
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7348
|
+
class: "icon icon-tabler icon-tabler-pin",
|
|
7349
|
+
width: "24",
|
|
7350
|
+
height: "24",
|
|
7502
7351
|
viewBox: "0 0 24 24",
|
|
7352
|
+
"stroke-width": "2",
|
|
7353
|
+
stroke: "currentColor",
|
|
7503
7354
|
fill: "none",
|
|
7504
|
-
|
|
7355
|
+
"stroke-linecap": "round",
|
|
7356
|
+
"stroke-linejoin": "round"
|
|
7505
7357
|
};
|
|
7506
|
-
const _hoisted_2 = /* @__PURE__ */ createElementVNode("path", {
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
fill: "black",
|
|
7511
|
-
"fill-opacity": "0.9"
|
|
7358
|
+
const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("path", {
|
|
7359
|
+
stroke: "none",
|
|
7360
|
+
d: "M0 0h24v24H0z",
|
|
7361
|
+
fill: "none"
|
|
7512
7362
|
}, null, -1);
|
|
7513
|
-
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", {
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7363
|
+
const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("path", { d: "M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4" }, null, -1);
|
|
7364
|
+
const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("line", {
|
|
7365
|
+
x1: "9",
|
|
7366
|
+
y1: "15",
|
|
7367
|
+
x2: "4.5",
|
|
7368
|
+
y2: "19.5"
|
|
7519
7369
|
}, null, -1);
|
|
7520
|
-
const
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
"fill-opacity": "0.9"
|
|
7370
|
+
const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("line", {
|
|
7371
|
+
x1: "14.5",
|
|
7372
|
+
y1: "4",
|
|
7373
|
+
x2: "20",
|
|
7374
|
+
y2: "9.5"
|
|
7526
7375
|
}, null, -1);
|
|
7527
|
-
const
|
|
7528
|
-
_hoisted_2,
|
|
7529
|
-
_hoisted_3,
|
|
7530
|
-
_hoisted_4
|
|
7376
|
+
const _hoisted_6$1 = [
|
|
7377
|
+
_hoisted_2$5,
|
|
7378
|
+
_hoisted_3$2,
|
|
7379
|
+
_hoisted_4$2,
|
|
7380
|
+
_hoisted_5$2
|
|
7531
7381
|
];
|
|
7532
|
-
const _sfc_main$
|
|
7382
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
7533
7383
|
...{
|
|
7534
|
-
name: "
|
|
7384
|
+
name: "MEditorPinIcon"
|
|
7535
7385
|
},
|
|
7536
|
-
__name: "
|
|
7386
|
+
__name: "PinIcon",
|
|
7537
7387
|
setup(__props) {
|
|
7538
7388
|
return (_ctx, _cache) => {
|
|
7539
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7389
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_6$1);
|
|
7540
7390
|
};
|
|
7541
7391
|
}
|
|
7542
7392
|
});
|
|
7543
7393
|
|
|
7544
|
-
const
|
|
7394
|
+
const _hoisted_1$6 = {
|
|
7395
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7396
|
+
class: "icon icon-tabler icon-tabler-pinned",
|
|
7397
|
+
width: "24",
|
|
7398
|
+
height: "24",
|
|
7399
|
+
viewBox: "0 0 24 24",
|
|
7400
|
+
"stroke-width": "2",
|
|
7401
|
+
stroke: "currentColor",
|
|
7402
|
+
fill: "none",
|
|
7403
|
+
"stroke-linecap": "round",
|
|
7404
|
+
"stroke-linejoin": "round"
|
|
7405
|
+
};
|
|
7406
|
+
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("path", {
|
|
7407
|
+
stroke: "none",
|
|
7408
|
+
d: "M0 0h24v24H0z",
|
|
7409
|
+
fill: "none"
|
|
7410
|
+
}, null, -1);
|
|
7411
|
+
const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("path", { d: "M9 4v6l-2 4v2h10v-2l-2 -4v-6" }, null, -1);
|
|
7412
|
+
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("line", {
|
|
7413
|
+
x1: "12",
|
|
7414
|
+
y1: "16",
|
|
7415
|
+
x2: "12",
|
|
7416
|
+
y2: "21"
|
|
7417
|
+
}, null, -1);
|
|
7418
|
+
const _hoisted_5$1 = /* @__PURE__ */ createElementVNode("line", {
|
|
7419
|
+
x1: "8",
|
|
7420
|
+
y1: "4",
|
|
7421
|
+
x2: "16",
|
|
7422
|
+
y2: "4"
|
|
7423
|
+
}, null, -1);
|
|
7424
|
+
const _hoisted_6 = [
|
|
7425
|
+
_hoisted_2$4,
|
|
7426
|
+
_hoisted_3$1,
|
|
7427
|
+
_hoisted_4$1,
|
|
7428
|
+
_hoisted_5$1
|
|
7429
|
+
];
|
|
7430
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
7545
7431
|
...{
|
|
7546
|
-
name: "
|
|
7432
|
+
name: "MEditorPinnedIcon"
|
|
7547
7433
|
},
|
|
7548
|
-
__name: "
|
|
7434
|
+
__name: "PinnedIcon",
|
|
7435
|
+
setup(__props) {
|
|
7436
|
+
return (_ctx, _cache) => {
|
|
7437
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_6);
|
|
7438
|
+
};
|
|
7439
|
+
}
|
|
7440
|
+
});
|
|
7441
|
+
|
|
7442
|
+
const _hoisted_1$5 = /* @__PURE__ */ createElementVNode("span", null, "可选组件", -1);
|
|
7443
|
+
const _hoisted_2$3 = { style: { "margin-right": "10px" } };
|
|
7444
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
7445
|
+
...{
|
|
7446
|
+
name: "MEditorNodeListMenuTitle"
|
|
7447
|
+
},
|
|
7448
|
+
__name: "NodeListMenuTitle",
|
|
7549
7449
|
props: {
|
|
7550
|
-
|
|
7551
|
-
stageContentMenu: {}
|
|
7450
|
+
pinned: { type: Boolean }
|
|
7552
7451
|
},
|
|
7553
|
-
|
|
7452
|
+
emits: ["close", "update:pinned", "change"],
|
|
7453
|
+
setup(__props, { emit }) {
|
|
7554
7454
|
const props = __props;
|
|
7555
|
-
const
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
const
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
const
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
{
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7455
|
+
const pinHandler = () => {
|
|
7456
|
+
emit("update:pinned", !props.pinned);
|
|
7457
|
+
};
|
|
7458
|
+
const closeHandler = () => {
|
|
7459
|
+
emit("close");
|
|
7460
|
+
};
|
|
7461
|
+
const target = ref();
|
|
7462
|
+
useGetSo(target, emit);
|
|
7463
|
+
return (_ctx, _cache) => {
|
|
7464
|
+
return openBlock(), createElementBlock("div", {
|
|
7465
|
+
style: { "text-align": "center", "padding": "5px 0", "font-size": "14px", "cursor": "move", "display": "flex", "justify-content": "space-between", "align-items": "center" },
|
|
7466
|
+
ref_key: "target",
|
|
7467
|
+
ref: target
|
|
7468
|
+
}, [
|
|
7469
|
+
createVNode(unref(TMagicTooltip), {
|
|
7470
|
+
placement: "top",
|
|
7471
|
+
content: _ctx.pinned ? "取消置于顶层自动隐藏" : "置于顶层不消失"
|
|
7472
|
+
}, {
|
|
7473
|
+
default: withCtx(() => [
|
|
7474
|
+
createVNode(_sfc_main$K, {
|
|
7475
|
+
style: { "margin-left": "10px", "cursor": "pointer" },
|
|
7476
|
+
icon: _ctx.pinned ? _sfc_main$a : _sfc_main$b,
|
|
7477
|
+
onClick: pinHandler
|
|
7478
|
+
}, null, 8, ["icon"])
|
|
7479
|
+
]),
|
|
7480
|
+
_: 1
|
|
7481
|
+
}, 8, ["content"]),
|
|
7482
|
+
_hoisted_1$5,
|
|
7483
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
7484
|
+
createVNode(unref(TMagicButton), {
|
|
7485
|
+
text: "",
|
|
7486
|
+
size: "small",
|
|
7487
|
+
onClick: closeHandler
|
|
7488
|
+
}, {
|
|
7489
|
+
default: withCtx(() => [
|
|
7490
|
+
createVNode(_sfc_main$K, { icon: unref(Close) }, null, 8, ["icon"])
|
|
7491
|
+
]),
|
|
7492
|
+
_: 1
|
|
7493
|
+
})
|
|
7494
|
+
])
|
|
7495
|
+
], 512);
|
|
7496
|
+
};
|
|
7497
|
+
}
|
|
7498
|
+
});
|
|
7499
|
+
|
|
7500
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
7501
|
+
__name: "NodeListMenu",
|
|
7502
|
+
props: {
|
|
7503
|
+
isMultiSelect: { type: Boolean }
|
|
7504
|
+
},
|
|
7505
|
+
setup(__props) {
|
|
7506
|
+
const props = __props;
|
|
7507
|
+
const menu = ref();
|
|
7508
|
+
const nodeList = ref([]);
|
|
7509
|
+
const pinned = ref(false);
|
|
7510
|
+
const services = inject("services");
|
|
7511
|
+
const editorService = services?.editorService;
|
|
7512
|
+
const componentListService = services?.componentListService;
|
|
7513
|
+
const stage = computed(() => editorService?.get("stage"));
|
|
7514
|
+
const page = computed(() => editorService?.get("page"));
|
|
7515
|
+
const node = computed(() => editorService?.get("node"));
|
|
7516
|
+
let timeout = null;
|
|
7517
|
+
const cancel = () => {
|
|
7518
|
+
if (timeout) {
|
|
7519
|
+
globalThis.clearTimeout(timeout);
|
|
7520
|
+
}
|
|
7521
|
+
if (pinned.value) {
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
nodeList.value = [];
|
|
7525
|
+
menu.value?.hide();
|
|
7526
|
+
};
|
|
7527
|
+
const clearTimeoutLazy = () => {
|
|
7528
|
+
globalThis.setTimeout(() => {
|
|
7529
|
+
if (timeout) {
|
|
7530
|
+
globalThis.clearTimeout(timeout);
|
|
7531
|
+
}
|
|
7532
|
+
}, 300);
|
|
7533
|
+
};
|
|
7534
|
+
const unWatch = watch(
|
|
7535
|
+
stage,
|
|
7536
|
+
(stage2) => {
|
|
7537
|
+
if (!stage2)
|
|
7538
|
+
return;
|
|
7539
|
+
stage2.on("drag-start", () => {
|
|
7540
|
+
cancel();
|
|
7541
|
+
});
|
|
7542
|
+
stage2.on("mousemove", (event) => {
|
|
7543
|
+
cancel();
|
|
7544
|
+
if (props.isMultiSelect || stage2.getDragStatus() !== StageDragStatus.END) {
|
|
7545
|
+
return;
|
|
7546
|
+
}
|
|
7547
|
+
timeout = globalThis.setTimeout(() => {
|
|
7548
|
+
const els = stage2?.renderer.getElementsFromPoint(event);
|
|
7549
|
+
const nodes = getNodes(
|
|
7550
|
+
els.map((el) => el.id),
|
|
7551
|
+
page.value?.items
|
|
7552
|
+
);
|
|
7553
|
+
if (pinned.value && nodes.length === 0) {
|
|
7554
|
+
return;
|
|
7555
|
+
}
|
|
7556
|
+
nodeList.value = nodes;
|
|
7557
|
+
if (nodeList.value.length > 1) {
|
|
7558
|
+
menu.value?.show(pinned.value ? void 0 : event);
|
|
7559
|
+
}
|
|
7560
|
+
}, 1500);
|
|
7561
|
+
});
|
|
7562
|
+
stage2.on("mouseleave", () => {
|
|
7563
|
+
clearTimeoutLazy();
|
|
7564
|
+
});
|
|
7565
|
+
unWatch();
|
|
7566
|
+
},
|
|
7567
|
+
{
|
|
7568
|
+
immediate: true
|
|
7569
|
+
}
|
|
7570
|
+
);
|
|
7571
|
+
const componentMap = computed(() => {
|
|
7572
|
+
const map = {};
|
|
7573
|
+
componentListService?.getList().forEach((group) => {
|
|
7574
|
+
group.items.forEach((item) => {
|
|
7575
|
+
map[item.type] = item;
|
|
7576
|
+
});
|
|
7577
|
+
});
|
|
7578
|
+
return map;
|
|
7579
|
+
});
|
|
7580
|
+
const menuData = computed(
|
|
7581
|
+
() => nodeList.value.map((node2) => {
|
|
7582
|
+
let text = node2.name;
|
|
7583
|
+
let icon;
|
|
7584
|
+
if (node2.type) {
|
|
7585
|
+
const item = componentMap.value[node2.type];
|
|
7586
|
+
text += ` (${item?.text})`;
|
|
7587
|
+
icon = item?.icon;
|
|
7588
|
+
}
|
|
7589
|
+
return {
|
|
7590
|
+
type: "button",
|
|
7591
|
+
text,
|
|
7592
|
+
id: node2.id,
|
|
7593
|
+
icon,
|
|
7594
|
+
handler: async () => {
|
|
7595
|
+
await editorService?.select(node2);
|
|
7596
|
+
stage.value?.select(node2.id);
|
|
7597
|
+
}
|
|
7598
|
+
};
|
|
7599
|
+
})
|
|
7600
|
+
);
|
|
7601
|
+
const mouseenterHandler = () => {
|
|
7602
|
+
clearTimeoutLazy();
|
|
7603
|
+
};
|
|
7604
|
+
const dragMenuHandler = ({ deltaY, deltaX }) => {
|
|
7605
|
+
if (!menu.value)
|
|
7606
|
+
return;
|
|
7607
|
+
const { menuPosition } = menu.value;
|
|
7608
|
+
menu.value?.setPosition({
|
|
7609
|
+
clientY: menuPosition.top + deltaY,
|
|
7610
|
+
clientX: menuPosition.left + deltaX
|
|
7611
|
+
});
|
|
7612
|
+
};
|
|
7613
|
+
const closeHandler = () => {
|
|
7614
|
+
menu.value?.hide();
|
|
7615
|
+
};
|
|
7616
|
+
return (_ctx, _cache) => {
|
|
7617
|
+
return openBlock(), createBlock(_sfc_main$j, {
|
|
7618
|
+
ref_key: "menu",
|
|
7619
|
+
ref: menu,
|
|
7620
|
+
class: "magic-editor-node-list-menu",
|
|
7621
|
+
style: { "max-width": "280px" },
|
|
7622
|
+
"menu-data": menuData.value,
|
|
7623
|
+
active: node.value?.id,
|
|
7624
|
+
"auto-hide": !pinned.value,
|
|
7625
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => mouseenterHandler())
|
|
7626
|
+
}, {
|
|
7627
|
+
title: withCtx(() => [
|
|
7628
|
+
createVNode(_sfc_main$9, {
|
|
7629
|
+
pinned: pinned.value,
|
|
7630
|
+
"onUpdate:pinned": _cache[0] || (_cache[0] = ($event) => pinned.value = $event),
|
|
7631
|
+
onChange: dragMenuHandler,
|
|
7632
|
+
onClose: closeHandler
|
|
7633
|
+
}, null, 8, ["pinned"])
|
|
7634
|
+
]),
|
|
7635
|
+
_: 1
|
|
7636
|
+
}, 8, ["menu-data", "active", "auto-hide"]);
|
|
7637
|
+
};
|
|
7638
|
+
}
|
|
7639
|
+
});
|
|
7640
|
+
|
|
7641
|
+
const _hoisted_1$4 = {
|
|
7642
|
+
viewBox: "0 0 24 24",
|
|
7643
|
+
fill: "none",
|
|
7644
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
7645
|
+
};
|
|
7646
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
7647
|
+
"fill-rule": "evenodd",
|
|
7648
|
+
"clip-rule": "evenodd",
|
|
7649
|
+
d: "M2 4H21V6H2V4Z",
|
|
7650
|
+
fill: "black",
|
|
7651
|
+
"fill-opacity": "0.9"
|
|
7652
|
+
}, null, -1);
|
|
7653
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", {
|
|
7654
|
+
"fill-rule": "evenodd",
|
|
7655
|
+
"clip-rule": "evenodd",
|
|
7656
|
+
d: "M5 11H18V13H5V11Z",
|
|
7657
|
+
fill: "black",
|
|
7658
|
+
"fill-opacity": "0.9"
|
|
7659
|
+
}, null, -1);
|
|
7660
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("path", {
|
|
7661
|
+
"fill-rule": "evenodd",
|
|
7662
|
+
"clip-rule": "evenodd",
|
|
7663
|
+
d: "M2 18H21V20H2V18Z",
|
|
7664
|
+
fill: "black",
|
|
7665
|
+
"fill-opacity": "0.9"
|
|
7666
|
+
}, null, -1);
|
|
7667
|
+
const _hoisted_5 = [
|
|
7668
|
+
_hoisted_2$2,
|
|
7669
|
+
_hoisted_3,
|
|
7670
|
+
_hoisted_4
|
|
7671
|
+
];
|
|
7672
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
7673
|
+
...{
|
|
7674
|
+
name: "MEditorCenterIcon"
|
|
7675
|
+
},
|
|
7676
|
+
__name: "CenterIcon",
|
|
7677
|
+
setup(__props) {
|
|
7678
|
+
return (_ctx, _cache) => {
|
|
7679
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_5);
|
|
7680
|
+
};
|
|
7681
|
+
}
|
|
7682
|
+
});
|
|
7683
|
+
|
|
7684
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
7685
|
+
...{
|
|
7686
|
+
name: "MEditorViewerMenu"
|
|
7687
|
+
},
|
|
7688
|
+
__name: "ViewerMenu",
|
|
7689
|
+
props: {
|
|
7690
|
+
isMultiSelect: { type: Boolean, default: false },
|
|
7691
|
+
stageContentMenu: {}
|
|
7692
|
+
},
|
|
7693
|
+
setup(__props, { expose: __expose }) {
|
|
7694
|
+
const props = __props;
|
|
7695
|
+
const services = inject("services");
|
|
7696
|
+
const editorService = services?.editorService;
|
|
7697
|
+
const menu = ref();
|
|
7698
|
+
const canPaste = ref(false);
|
|
7699
|
+
const canCenter = ref(false);
|
|
7700
|
+
const node = computed(() => editorService?.get("node"));
|
|
7701
|
+
const nodes = computed(() => editorService?.get("nodes"));
|
|
7702
|
+
const parent = computed(() => editorService?.get("parent"));
|
|
7703
|
+
const menuData = computed(() => [
|
|
7704
|
+
{
|
|
7705
|
+
type: "button",
|
|
7706
|
+
text: "水平居中",
|
|
7707
|
+
icon: markRaw(_sfc_main$7),
|
|
7708
|
+
display: () => canCenter.value,
|
|
7709
|
+
handler: () => {
|
|
7710
|
+
if (!nodes.value)
|
|
7711
|
+
return;
|
|
7712
|
+
editorService?.alignCenter(nodes.value);
|
|
7713
|
+
}
|
|
7714
|
+
},
|
|
7715
|
+
useCopyMenu(),
|
|
7716
|
+
usePasteMenu(menu),
|
|
7717
|
+
{
|
|
7578
7718
|
type: "divider",
|
|
7579
7719
|
direction: "horizontal",
|
|
7580
7720
|
display: () => {
|
|
@@ -7660,7 +7800,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7660
7800
|
};
|
|
7661
7801
|
__expose({ show });
|
|
7662
7802
|
return (_ctx, _cache) => {
|
|
7663
|
-
return openBlock(), createBlock(_sfc_main$
|
|
7803
|
+
return openBlock(), createBlock(_sfc_main$j, {
|
|
7664
7804
|
"menu-data": menuData.value,
|
|
7665
7805
|
ref_key: "menu",
|
|
7666
7806
|
ref: menu
|
|
@@ -7669,7 +7809,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7669
7809
|
}
|
|
7670
7810
|
});
|
|
7671
7811
|
|
|
7672
|
-
const _sfc_main$
|
|
7812
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
7673
7813
|
...{
|
|
7674
7814
|
name: "MEditorStage"
|
|
7675
7815
|
},
|
|
@@ -7809,7 +7949,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
7809
7949
|
}
|
|
7810
7950
|
};
|
|
7811
7951
|
return (_ctx, _cache) => {
|
|
7812
|
-
return openBlock(), createBlock(_sfc_main$
|
|
7952
|
+
return openBlock(), createBlock(_sfc_main$c, {
|
|
7813
7953
|
class: "m-editor-stage",
|
|
7814
7954
|
ref_key: "stageWrap",
|
|
7815
7955
|
ref: stageWrap,
|
|
@@ -7836,12 +7976,16 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
7836
7976
|
onDragover: dragoverHandler
|
|
7837
7977
|
}, null, 36),
|
|
7838
7978
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
7839
|
-
createVNode(_sfc_main$
|
|
7979
|
+
createVNode(_sfc_main$6, {
|
|
7840
7980
|
ref_key: "menu",
|
|
7841
7981
|
ref: menu,
|
|
7842
7982
|
"is-multi-select": isMultiSelect.value,
|
|
7843
7983
|
"stage-content-menu": _ctx.stageContentMenu
|
|
7844
|
-
}, null, 8, ["is-multi-select", "stage-content-menu"])
|
|
7984
|
+
}, null, 8, ["is-multi-select", "stage-content-menu"]),
|
|
7985
|
+
createVNode(_sfc_main$8, {
|
|
7986
|
+
ref: "nodeList",
|
|
7987
|
+
"is-multi-select": isMultiSelect.value
|
|
7988
|
+
}, null, 8, ["is-multi-select"])
|
|
7845
7989
|
]))
|
|
7846
7990
|
]),
|
|
7847
7991
|
_: 1
|
|
@@ -7850,6 +7994,268 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
7850
7994
|
}
|
|
7851
7995
|
});
|
|
7852
7996
|
|
|
7997
|
+
const _hoisted_1$3 = {
|
|
7998
|
+
key: 0,
|
|
7999
|
+
class: "m-editor-breadcrumb"
|
|
8000
|
+
};
|
|
8001
|
+
const _hoisted_2$1 = { key: 0 };
|
|
8002
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
8003
|
+
...{
|
|
8004
|
+
name: "MEditorBreadcrumb"
|
|
8005
|
+
},
|
|
8006
|
+
__name: "Breadcrumb",
|
|
8007
|
+
setup(__props) {
|
|
8008
|
+
const services = inject("services");
|
|
8009
|
+
const editorService = services?.editorService;
|
|
8010
|
+
const node = computed(() => editorService?.get("node"));
|
|
8011
|
+
const nodes = computed(() => editorService?.get("nodes") || []);
|
|
8012
|
+
const root = computed(() => editorService?.get("root"));
|
|
8013
|
+
const path = computed(() => getNodePath(node.value?.id || "", root.value?.items || []));
|
|
8014
|
+
const select = async (node2) => {
|
|
8015
|
+
await editorService?.select(node2);
|
|
8016
|
+
editorService?.get("stage")?.select(node2.id);
|
|
8017
|
+
};
|
|
8018
|
+
return (_ctx, _cache) => {
|
|
8019
|
+
return nodes.value.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
8020
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(path.value, (item, index) => {
|
|
8021
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
8022
|
+
key: item.id
|
|
8023
|
+
}, [
|
|
8024
|
+
createVNode(unref(TMagicButton), {
|
|
8025
|
+
text: "",
|
|
8026
|
+
disabled: item.id === node.value?.id,
|
|
8027
|
+
onClick: ($event) => select(item)
|
|
8028
|
+
}, {
|
|
8029
|
+
default: withCtx(() => [
|
|
8030
|
+
createTextVNode(toDisplayString(item.name), 1)
|
|
8031
|
+
]),
|
|
8032
|
+
_: 2
|
|
8033
|
+
}, 1032, ["disabled", "onClick"]),
|
|
8034
|
+
index < path.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_2$1, "/")) : createCommentVNode("", true)
|
|
8035
|
+
], 64);
|
|
8036
|
+
}), 128))
|
|
8037
|
+
])) : createCommentVNode("", true);
|
|
8038
|
+
};
|
|
8039
|
+
}
|
|
8040
|
+
});
|
|
8041
|
+
|
|
8042
|
+
const _hoisted_1$2 = {
|
|
8043
|
+
key: 1,
|
|
8044
|
+
style: { "width": "21px" }
|
|
8045
|
+
};
|
|
8046
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
8047
|
+
...{
|
|
8048
|
+
name: "MEditorPageBarScrollContainer"
|
|
8049
|
+
},
|
|
8050
|
+
__name: "PageBarScrollContainer",
|
|
8051
|
+
setup(__props) {
|
|
8052
|
+
const services = inject("services");
|
|
8053
|
+
const editorService = services?.editorService;
|
|
8054
|
+
const uiService = services?.uiService;
|
|
8055
|
+
const itemsContainer = ref();
|
|
8056
|
+
const canScroll = ref(false);
|
|
8057
|
+
const showAddPageButton = computed(() => uiService?.get("showAddPageButton"));
|
|
8058
|
+
const itemsContainerWidth = ref(0);
|
|
8059
|
+
const setCanScroll = () => {
|
|
8060
|
+
itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - (showAddPageButton.value ? 37 : 21);
|
|
8061
|
+
nextTick(() => {
|
|
8062
|
+
if (itemsContainer.value) {
|
|
8063
|
+
canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
8064
|
+
}
|
|
8065
|
+
});
|
|
8066
|
+
};
|
|
8067
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
8068
|
+
setCanScroll();
|
|
8069
|
+
});
|
|
8070
|
+
const pageBar = ref();
|
|
8071
|
+
onMounted(() => {
|
|
8072
|
+
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
8073
|
+
});
|
|
8074
|
+
onUnmounted(() => {
|
|
8075
|
+
resizeObserver.disconnect();
|
|
8076
|
+
});
|
|
8077
|
+
let translateLeft = 0;
|
|
8078
|
+
const scroll = (type) => {
|
|
8079
|
+
if (!itemsContainer.value)
|
|
8080
|
+
return;
|
|
8081
|
+
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
8082
|
+
if (type === "left") {
|
|
8083
|
+
translateLeft += 100;
|
|
8084
|
+
if (translateLeft > 0) {
|
|
8085
|
+
translateLeft = 0;
|
|
8086
|
+
}
|
|
8087
|
+
} else if (type === "right") {
|
|
8088
|
+
translateLeft -= 100;
|
|
8089
|
+
if (-translateLeft > maxScrollLeft) {
|
|
8090
|
+
translateLeft = -maxScrollLeft;
|
|
8091
|
+
}
|
|
8092
|
+
} else if (type === "start") {
|
|
8093
|
+
translateLeft = 0;
|
|
8094
|
+
} else if (type === "end") {
|
|
8095
|
+
translateLeft = -maxScrollLeft;
|
|
8096
|
+
}
|
|
8097
|
+
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
8098
|
+
};
|
|
8099
|
+
const pageLength = computed(() => editorService?.get("pageLength"));
|
|
8100
|
+
watch(pageLength, (length = 0, preLength = 0) => {
|
|
8101
|
+
setTimeout(() => {
|
|
8102
|
+
setCanScroll();
|
|
8103
|
+
if (length < preLength) {
|
|
8104
|
+
scroll("start");
|
|
8105
|
+
} else {
|
|
8106
|
+
scroll("end");
|
|
8107
|
+
}
|
|
8108
|
+
});
|
|
8109
|
+
});
|
|
8110
|
+
const addPage = () => {
|
|
8111
|
+
if (!editorService)
|
|
8112
|
+
return;
|
|
8113
|
+
const root = toRaw(editorService.get("root"));
|
|
8114
|
+
if (!root)
|
|
8115
|
+
throw new Error("root 不能为空");
|
|
8116
|
+
const pageConfig = {
|
|
8117
|
+
type: NodeType.PAGE,
|
|
8118
|
+
name: generatePageNameByApp(root)
|
|
8119
|
+
};
|
|
8120
|
+
editorService.add(pageConfig);
|
|
8121
|
+
};
|
|
8122
|
+
return (_ctx, _cache) => {
|
|
8123
|
+
return openBlock(), createElementBlock("div", {
|
|
8124
|
+
class: "m-editor-page-bar",
|
|
8125
|
+
ref_key: "pageBar",
|
|
8126
|
+
ref: pageBar
|
|
8127
|
+
}, [
|
|
8128
|
+
showAddPageButton.value ? (openBlock(), createElementBlock("div", {
|
|
8129
|
+
key: 0,
|
|
8130
|
+
id: "m-editor-page-bar-add-icon",
|
|
8131
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
8132
|
+
onClick: addPage
|
|
8133
|
+
}, [
|
|
8134
|
+
createVNode(_sfc_main$K, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
8135
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_1$2)),
|
|
8136
|
+
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
8137
|
+
key: 2,
|
|
8138
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
8139
|
+
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
8140
|
+
}, [
|
|
8141
|
+
createVNode(_sfc_main$K, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
|
|
8142
|
+
])) : createCommentVNode("", true),
|
|
8143
|
+
pageLength.value ? (openBlock(), createElementBlock("div", {
|
|
8144
|
+
key: 3,
|
|
8145
|
+
class: "m-editor-page-bar-items",
|
|
8146
|
+
ref_key: "itemsContainer",
|
|
8147
|
+
ref: itemsContainer,
|
|
8148
|
+
style: normalizeStyle(`width: ${itemsContainerWidth.value}px`)
|
|
8149
|
+
}, [
|
|
8150
|
+
renderSlot(_ctx.$slots, "default")
|
|
8151
|
+
], 4)) : createCommentVNode("", true),
|
|
8152
|
+
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
8153
|
+
key: 4,
|
|
8154
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
8155
|
+
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
8156
|
+
}, [
|
|
8157
|
+
createVNode(_sfc_main$K, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
|
|
8158
|
+
])) : createCommentVNode("", true)
|
|
8159
|
+
], 512);
|
|
8160
|
+
};
|
|
8161
|
+
}
|
|
8162
|
+
});
|
|
8163
|
+
|
|
8164
|
+
const _hoisted_1$1 = ["onClick"];
|
|
8165
|
+
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
8166
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
8167
|
+
...{
|
|
8168
|
+
name: "MEditorPageBar"
|
|
8169
|
+
},
|
|
8170
|
+
__name: "PageBar",
|
|
8171
|
+
setup(__props) {
|
|
8172
|
+
const services = inject("services");
|
|
8173
|
+
const editorService = services?.editorService;
|
|
8174
|
+
const root = computed(() => editorService?.get("root"));
|
|
8175
|
+
const page = computed(() => editorService?.get("page"));
|
|
8176
|
+
const switchPage = (page2) => {
|
|
8177
|
+
editorService?.select(page2);
|
|
8178
|
+
};
|
|
8179
|
+
const copy = (node) => {
|
|
8180
|
+
node && editorService?.copy(node);
|
|
8181
|
+
editorService?.paste({
|
|
8182
|
+
left: 0,
|
|
8183
|
+
top: 0
|
|
8184
|
+
});
|
|
8185
|
+
};
|
|
8186
|
+
const remove = (node) => {
|
|
8187
|
+
editorService?.remove(node);
|
|
8188
|
+
};
|
|
8189
|
+
return (_ctx, _cache) => {
|
|
8190
|
+
return openBlock(), createBlock(_sfc_main$3, null, {
|
|
8191
|
+
default: withCtx(() => [
|
|
8192
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(root.value && root.value.items || [], (item) => {
|
|
8193
|
+
return openBlock(), createElementBlock("div", {
|
|
8194
|
+
class: normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
8195
|
+
key: item.key,
|
|
8196
|
+
onClick: ($event) => switchPage(item)
|
|
8197
|
+
}, [
|
|
8198
|
+
createElementVNode("div", _hoisted_2, [
|
|
8199
|
+
renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
8200
|
+
createVNode(unref(TMagicTooltip), {
|
|
8201
|
+
effect: "dark",
|
|
8202
|
+
placement: "top-start",
|
|
8203
|
+
content: item.name
|
|
8204
|
+
}, {
|
|
8205
|
+
default: withCtx(() => [
|
|
8206
|
+
createElementVNode("span", null, toDisplayString(item.name || item.id), 1)
|
|
8207
|
+
]),
|
|
8208
|
+
_: 2
|
|
8209
|
+
}, 1032, ["content"])
|
|
8210
|
+
])
|
|
8211
|
+
]),
|
|
8212
|
+
createVNode(unref(TMagicPopover), {
|
|
8213
|
+
"popper-class": "page-bar-popover",
|
|
8214
|
+
placement: "top",
|
|
8215
|
+
width: 160,
|
|
8216
|
+
trigger: "hover"
|
|
8217
|
+
}, {
|
|
8218
|
+
reference: withCtx(() => [
|
|
8219
|
+
createVNode(unref(TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
8220
|
+
default: withCtx(() => [
|
|
8221
|
+
createVNode(unref(CaretBottom))
|
|
8222
|
+
]),
|
|
8223
|
+
_: 1
|
|
8224
|
+
})
|
|
8225
|
+
]),
|
|
8226
|
+
default: withCtx(() => [
|
|
8227
|
+
createElementVNode("div", null, [
|
|
8228
|
+
renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
8229
|
+
createVNode(_sfc_main$v, {
|
|
8230
|
+
data: {
|
|
8231
|
+
type: "button",
|
|
8232
|
+
text: "复制",
|
|
8233
|
+
icon: unref(DocumentCopy),
|
|
8234
|
+
handler: () => copy(item)
|
|
8235
|
+
}
|
|
8236
|
+
}, null, 8, ["data"]),
|
|
8237
|
+
createVNode(_sfc_main$v, {
|
|
8238
|
+
data: {
|
|
8239
|
+
type: "button",
|
|
8240
|
+
text: "删除",
|
|
8241
|
+
icon: unref(Delete),
|
|
8242
|
+
handler: () => remove(item)
|
|
8243
|
+
}
|
|
8244
|
+
}, null, 8, ["data"])
|
|
8245
|
+
])
|
|
8246
|
+
])
|
|
8247
|
+
]),
|
|
8248
|
+
_: 2
|
|
8249
|
+
}, 1024)
|
|
8250
|
+
], 10, _hoisted_1$1);
|
|
8251
|
+
}), 128))
|
|
8252
|
+
]),
|
|
8253
|
+
_: 3
|
|
8254
|
+
});
|
|
8255
|
+
};
|
|
8256
|
+
}
|
|
8257
|
+
});
|
|
8258
|
+
|
|
7853
8259
|
const _hoisted_1 = { class: "m-editor-workspace" };
|
|
7854
8260
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7855
8261
|
...{
|
|
@@ -7864,15 +8270,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7864
8270
|
const page = computed(() => services?.editorService.get("page"));
|
|
7865
8271
|
return (_ctx, _cache) => {
|
|
7866
8272
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
7867
|
-
createVNode(_sfc_main$
|
|
8273
|
+
createVNode(_sfc_main$4),
|
|
7868
8274
|
renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
7869
|
-
page.value ? (openBlock(), createBlock(_sfc_main$
|
|
8275
|
+
page.value ? (openBlock(), createBlock(_sfc_main$5, {
|
|
7870
8276
|
key: 0,
|
|
7871
8277
|
"stage-content-menu": _ctx.stageContentMenu
|
|
7872
8278
|
}, null, 8, ["stage-content-menu"])) : createCommentVNode("", true)
|
|
7873
8279
|
]),
|
|
7874
8280
|
renderSlot(_ctx.$slots, "workspace-content"),
|
|
7875
|
-
createVNode(_sfc_main$
|
|
8281
|
+
createVNode(_sfc_main$2, null, {
|
|
7876
8282
|
"page-bar-title": withCtx(({ page: page2 }) => [
|
|
7877
8283
|
renderSlot(_ctx.$slots, "page-bar-title", { page: page2 })
|
|
7878
8284
|
]),
|
|
@@ -9120,11 +9526,11 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
9120
9526
|
const _sfc_main = defineComponent({
|
|
9121
9527
|
name: "MEditor",
|
|
9122
9528
|
components: {
|
|
9123
|
-
TMagicNavMenu: _sfc_main$
|
|
9124
|
-
Sidebar: _sfc_main$
|
|
9529
|
+
TMagicNavMenu: _sfc_main$u,
|
|
9530
|
+
Sidebar: _sfc_main$e,
|
|
9125
9531
|
Workspace: _sfc_main$1,
|
|
9126
|
-
PropsPanel: _sfc_main$
|
|
9127
|
-
Framework: _sfc_main$
|
|
9532
|
+
PropsPanel: _sfc_main$t,
|
|
9533
|
+
Framework: _sfc_main$w
|
|
9128
9534
|
},
|
|
9129
9535
|
props: editorProps,
|
|
9130
9536
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
@@ -9289,22 +9695,22 @@ const index = {
|
|
|
9289
9695
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
9290
9696
|
setConfig(option);
|
|
9291
9697
|
app.component(Editor.name, Editor);
|
|
9292
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
9293
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
9294
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
9295
|
-
app.component("magic-code-editor", _sfc_main$
|
|
9296
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
9297
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
9298
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
9299
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
9300
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
9301
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
9302
|
-
app.component("m-fields-data-source-select", _sfc_main$
|
|
9303
|
-
app.component("m-fields-data-source-methods", _sfc_main$
|
|
9304
|
-
app.component("m-fields-data-source-method-select", _sfc_main$
|
|
9305
|
-
app.component("m-fields-data-source-field-select", _sfc_main$
|
|
9698
|
+
app.component("m-fields-ui-select", _sfc_main$A);
|
|
9699
|
+
app.component("m-fields-code-link", _sfc_main$O);
|
|
9700
|
+
app.component("m-fields-vs-code", _sfc_main$P);
|
|
9701
|
+
app.component("magic-code-editor", _sfc_main$Q);
|
|
9702
|
+
app.component("m-fields-code-select", _sfc_main$N);
|
|
9703
|
+
app.component("m-fields-code-select-col", _sfc_main$J);
|
|
9704
|
+
app.component("m-fields-event-select", _sfc_main$C);
|
|
9705
|
+
app.component("m-fields-data-source-fields", _sfc_main$I);
|
|
9706
|
+
app.component("m-fields-key-value", _sfc_main$B);
|
|
9707
|
+
app.component("m-fields-data-source-input", _sfc_main$G);
|
|
9708
|
+
app.component("m-fields-data-source-select", _sfc_main$D);
|
|
9709
|
+
app.component("m-fields-data-source-methods", _sfc_main$F);
|
|
9710
|
+
app.component("m-fields-data-source-method-select", _sfc_main$E);
|
|
9711
|
+
app.component("m-fields-data-source-field-select", _sfc_main$H);
|
|
9306
9712
|
}
|
|
9307
9713
|
};
|
|
9308
9714
|
|
|
9309
|
-
export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$
|
|
9715
|
+
export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$M as CodeBlockEditor, _sfc_main$p as CodeBlockList, _sfc_main$o as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$N as CodeSelect, _sfc_main$J as CodeSelectCol, ColumnLayout, _sfc_main$k as ComponentListPanel, _sfc_main$j as ContentMenu, _sfc_main$H as DataSourceFieldSelect, _sfc_main$I as DataSourceFields, _sfc_main$G as DataSourceInput, _sfc_main$E as DataSourceMethodSelect, _sfc_main$F as DataSourceMethods, _sfc_main$D as DataSourceSelect, DepTargetType, _sfc_main$C as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$K as Icon, KeyBindingCommand, _sfc_main$B as KeyValue, Keys, LayerOffset, _sfc_main$f as LayerPanel, Layout, _sfc_main$y as LayoutContainer, _sfc_main$t as PropsPanel, _sfc_main$z as Resizer, _sfc_main$y as SplitView, _sfc_main$Q as TMagicCodeEditor, Editor as TMagicEditor, _sfc_main$v as ToolButton, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, error, eventTabConfig, eventsService, fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getDisplayField, getFormConfig, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, styleTabConfig, uiService, useCodeBlockEdit, useDataSourceMethod, useStage, warn };
|
|
9310
9716
|
//# sourceMappingURL=tmagic-editor.js.map
|