@tmagic/editor 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tmagic-editor.js +601 -565
- package/dist/tmagic-editor.umd.cjs +600 -564
- package/package.json +7 -7
- package/src/components/CodeBlockEditor.vue +3 -3
- package/src/components/CodeParams.vue +2 -2
- package/src/components/ContentMenu.vue +13 -13
- package/src/components/FloatingBox.vue +9 -9
- package/src/components/Resizer.vue +2 -2
- package/src/components/ScrollBar.vue +6 -7
- package/src/components/ScrollViewer.vue +6 -6
- package/src/components/SplitView.vue +2 -2
- package/src/fields/DataSourceInput.vue +3 -3
- package/src/fields/DataSourceMethods.vue +4 -4
- package/src/hooks/use-code-block-edit.ts +5 -5
- package/src/initService.ts +289 -220
- package/src/layouts/CodeEditor.vue +6 -6
- package/src/layouts/Framework.vue +5 -5
- package/src/layouts/NavMenu.vue +6 -3
- package/src/layouts/page-bar/PageBar.vue +13 -13
- package/src/layouts/page-bar/PageBarScrollContainer.vue +12 -11
- package/src/layouts/props-panel/FormPanel.vue +6 -6
- package/src/layouts/props-panel/PropsPanel.vue +4 -2
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +3 -3
- package/src/layouts/sidebar/layer/LayerMenu.vue +2 -2
- package/src/layouts/sidebar/layer/LayerPanel.vue +5 -4
- package/src/layouts/sidebar/layer/use-click.ts +4 -6
- package/src/layouts/workspace/viewer/NodeListMenu.vue +5 -5
- package/src/layouts/workspace/viewer/Stage.vue +13 -13
- package/src/layouts/workspace/viewer/StageOverlay.vue +2 -2
- package/src/layouts/workspace/viewer/ViewerMenu.vue +3 -3
- package/src/services/componentList.ts +2 -2
- package/src/services/dep.ts +10 -4
- package/src/services/stageOverlay.ts +2 -2
- package/src/services/ui.ts +2 -2
- package/src/utils/idle-task.ts +26 -10
- package/types/index.d.ts +7 -60
package/dist/tmagic-editor.js
CHANGED
|
@@ -7,7 +7,7 @@ export { default as formPlugin } from '@tmagic/form';
|
|
|
7
7
|
import tablePlugin__default, { MagicTable } from '@tmagic/table';
|
|
8
8
|
export * from '@tmagic/table';
|
|
9
9
|
export { default as tablePlugin } from '@tmagic/table';
|
|
10
|
-
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, createElementBlock, normalizeClass, resolveDynamicComponent, toRaw, ref, useTemplateRef, watch, onMounted, onBeforeUnmount, Teleport, normalizeStyle, computed, reactive, resolveComponent, inject, createCommentVNode, Fragment, renderList, mergeProps, mergeModels, useModel, nextTick, provide, renderSlot, toDisplayString, createTextVNode, isRef, createStaticVNode, watchEffect, markRaw, withDirectives, vModelText, vShow, shallowRef, withModifiers, toHandlers, createSlots, getCurrentInstance, Transition, resolveDirective, mergeDefaults } from 'vue';
|
|
10
|
+
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, createElementBlock, normalizeClass, resolveDynamicComponent, toRaw, ref, useTemplateRef, watch, onMounted, onBeforeUnmount, Teleport, normalizeStyle, computed, reactive, resolveComponent, inject, createCommentVNode, Fragment, renderList, mergeProps, mergeModels, useModel, nextTick, provide, renderSlot, toDisplayString, shallowReactive, createTextVNode, isRef, createStaticVNode, watchEffect, markRaw, withDirectives, vModelText, vShow, shallowRef, withModifiers, toHandlers, createSlots, getCurrentInstance, Transition, resolveDirective, mergeDefaults } from 'vue';
|
|
11
11
|
import { Edit, FullScreen, View, Close, Coin, Delete, Plus, Grid, ArrowDown, ArrowLeftBold, ArrowRightBold, Files, Search, CaretBottom, DocumentCopy, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Document, Sugar, ArrowRight, CopyDocument, Hide, Goods, List, EditPen, CloseBold, Top, Bottom } from '@element-plus/icons-vue';
|
|
12
12
|
import { throttle, isEmpty, isObject, cloneDeep, mergeWith, uniq, get, map, has, pick, keys } from 'lodash-es';
|
|
13
13
|
import serialize from 'serialize-javascript';
|
|
@@ -27,7 +27,7 @@ import { detailedDiff } from 'deep-object-diff';
|
|
|
27
27
|
import Sortable from 'sortablejs';
|
|
28
28
|
import KeyController from 'keycon';
|
|
29
29
|
|
|
30
|
-
const _hoisted_1$
|
|
30
|
+
const _hoisted_1$10 = ["src"];
|
|
31
31
|
const _sfc_main$1s = /* @__PURE__ */ defineComponent({
|
|
32
32
|
...{
|
|
33
33
|
name: "MEditorIcon"
|
|
@@ -52,7 +52,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
class: "magic-editor-icon"
|
|
53
53
|
}, {
|
|
54
54
|
default: withCtx(() => [
|
|
55
|
-
createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
55
|
+
createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$10)
|
|
56
56
|
]),
|
|
57
57
|
_: 1
|
|
58
58
|
})) : typeof _ctx.icon === "string" ? (openBlock(), createElementBlock("i", {
|
|
@@ -80,9 +80,13 @@ const getEditorConfig = (key) => $TMAGIC_EDITOR[key];
|
|
|
80
80
|
emmetHTML(monaco);
|
|
81
81
|
emmetCSS(monaco, ["css", "scss"]);
|
|
82
82
|
|
|
83
|
-
const _hoisted_1
|
|
83
|
+
const _hoisted_1$$ = {
|
|
84
84
|
class: /* @__PURE__ */ normalizeClass(`magic-code-editor`)
|
|
85
85
|
};
|
|
86
|
+
const _hoisted_2$o = {
|
|
87
|
+
ref: "codeEditor",
|
|
88
|
+
class: "magic-code-editor-content"
|
|
89
|
+
};
|
|
86
90
|
const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
87
91
|
...{
|
|
88
92
|
name: "MEditorCodeEditor"
|
|
@@ -136,7 +140,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
136
140
|
let vsDiffEditor = null;
|
|
137
141
|
const values = ref("");
|
|
138
142
|
const loading = ref(false);
|
|
139
|
-
const
|
|
143
|
+
const codeEditorEl = useTemplateRef("codeEditor");
|
|
140
144
|
const resizeObserver = new globalThis.ResizeObserver(
|
|
141
145
|
throttle(() => {
|
|
142
146
|
vsEditor?.layout();
|
|
@@ -157,7 +161,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
157
161
|
};
|
|
158
162
|
const getEditorValue = () => (props.type === "diff" ? vsDiffEditor?.getModifiedEditor().getValue() : vsEditor?.getValue()) || "";
|
|
159
163
|
const init = async () => {
|
|
160
|
-
if (!
|
|
164
|
+
if (!codeEditorEl.value) return;
|
|
161
165
|
const options = {
|
|
162
166
|
value: values.value,
|
|
163
167
|
language: props.language,
|
|
@@ -165,14 +169,14 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
165
169
|
...props.options
|
|
166
170
|
};
|
|
167
171
|
if (props.type === "diff") {
|
|
168
|
-
vsDiffEditor = monaco.editor.createDiffEditor(
|
|
172
|
+
vsDiffEditor = monaco.editor.createDiffEditor(codeEditorEl.value, options);
|
|
169
173
|
} else {
|
|
170
|
-
vsEditor = monaco.editor.create(
|
|
174
|
+
vsEditor = monaco.editor.create(codeEditorEl.value, options);
|
|
171
175
|
}
|
|
172
176
|
setEditorValue(props.initValues, props.modifiedValues);
|
|
173
177
|
loading.value = false;
|
|
174
178
|
emit("initd", vsEditor);
|
|
175
|
-
|
|
179
|
+
codeEditorEl.value.addEventListener("keydown", (e) => {
|
|
176
180
|
if (e.keyCode === 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
|
|
177
181
|
e.preventDefault();
|
|
178
182
|
e.stopPropagation();
|
|
@@ -190,7 +194,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
190
194
|
}
|
|
191
195
|
});
|
|
192
196
|
}
|
|
193
|
-
resizeObserver.observe(
|
|
197
|
+
resizeObserver.observe(codeEditorEl.value);
|
|
194
198
|
};
|
|
195
199
|
watch(
|
|
196
200
|
() => props.initValues,
|
|
@@ -240,7 +244,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
240
244
|
}
|
|
241
245
|
});
|
|
242
246
|
return (_ctx, _cache) => {
|
|
243
|
-
return openBlock(), createElementBlock("div", _hoisted_1
|
|
247
|
+
return openBlock(), createElementBlock("div", _hoisted_1$$, [
|
|
244
248
|
(openBlock(), createBlock(Teleport, {
|
|
245
249
|
to: "body",
|
|
246
250
|
disabled: !fullScreen.value
|
|
@@ -260,11 +264,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
|
|
|
260
264
|
]),
|
|
261
265
|
_: 1
|
|
262
266
|
}),
|
|
263
|
-
createElementVNode("div",
|
|
264
|
-
ref_key: "codeEditor",
|
|
265
|
-
ref: codeEditor,
|
|
266
|
-
class: "magic-code-editor-content"
|
|
267
|
-
}, null, 512)
|
|
267
|
+
createElementVNode("div", _hoisted_2$o, null, 512)
|
|
268
268
|
], 6)
|
|
269
269
|
], 8, ["disabled"]))
|
|
270
270
|
]);
|
|
@@ -2834,13 +2834,14 @@ globalThis.requestIdleCallback = globalThis.requestIdleCallback || function(cb)
|
|
|
2834
2834
|
};
|
|
2835
2835
|
class IdleTask extends EventEmitter {
|
|
2836
2836
|
taskList = [];
|
|
2837
|
+
hightLevelTaskList = [];
|
|
2837
2838
|
taskHandle = null;
|
|
2838
2839
|
constructor() {
|
|
2839
2840
|
super();
|
|
2840
2841
|
this.setMaxListeners(1e3);
|
|
2841
2842
|
}
|
|
2842
|
-
enqueueTask(taskHandler, taskData) {
|
|
2843
|
-
this.taskList.push({
|
|
2843
|
+
enqueueTask(taskHandler, taskData, isHightLevel = false) {
|
|
2844
|
+
(isHightLevel ? this.hightLevelTaskList : this.taskList).push({
|
|
2844
2845
|
handler: taskHandler,
|
|
2845
2846
|
data: taskData
|
|
2846
2847
|
});
|
|
@@ -2849,6 +2850,10 @@ class IdleTask extends EventEmitter {
|
|
|
2849
2850
|
}
|
|
2850
2851
|
}
|
|
2851
2852
|
clearTasks() {
|
|
2853
|
+
if (this.taskHandle) {
|
|
2854
|
+
globalThis.cancelIdleCallback(this.taskHandle);
|
|
2855
|
+
}
|
|
2856
|
+
this.hightLevelTaskList = [];
|
|
2852
2857
|
this.taskList = [];
|
|
2853
2858
|
}
|
|
2854
2859
|
on(eventName, listener) {
|
|
@@ -2861,7 +2866,8 @@ class IdleTask extends EventEmitter {
|
|
|
2861
2866
|
return super.emit(eventName, ...args);
|
|
2862
2867
|
}
|
|
2863
2868
|
runTaskQueue(deadline) {
|
|
2864
|
-
|
|
2869
|
+
const { hightLevelTaskList, taskList } = this;
|
|
2870
|
+
while (deadline.timeRemaining() > 0 && (taskList.length || hightLevelTaskList.length)) {
|
|
2865
2871
|
const timeRemaining = deadline.timeRemaining();
|
|
2866
2872
|
let times = 0;
|
|
2867
2873
|
if (timeRemaining <= 5) {
|
|
@@ -2874,16 +2880,19 @@ class IdleTask extends EventEmitter {
|
|
|
2874
2880
|
times = 600;
|
|
2875
2881
|
}
|
|
2876
2882
|
for (let i = 0; i < times; i++) {
|
|
2877
|
-
const task =
|
|
2883
|
+
const task = hightLevelTaskList.length > 0 ? hightLevelTaskList.shift() : taskList.shift();
|
|
2878
2884
|
if (task) {
|
|
2879
2885
|
task.handler(task.data);
|
|
2880
2886
|
}
|
|
2881
|
-
if (
|
|
2887
|
+
if (hightLevelTaskList.length === 0 && taskList.length === 0) {
|
|
2882
2888
|
break;
|
|
2883
2889
|
}
|
|
2884
2890
|
}
|
|
2885
2891
|
}
|
|
2886
|
-
if (
|
|
2892
|
+
if (!hightLevelTaskList.length) {
|
|
2893
|
+
this.emit("hight-level-finish");
|
|
2894
|
+
}
|
|
2895
|
+
if (hightLevelTaskList.length || taskList.length) {
|
|
2887
2896
|
this.taskHandle = globalThis.requestIdleCallback(this.runTaskQueue.bind(this), { timeout: 300 });
|
|
2888
2897
|
} else {
|
|
2889
2898
|
this.taskHandle = 0;
|
|
@@ -3045,7 +3054,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
3045
3054
|
setup(__props, { emit: __emit }) {
|
|
3046
3055
|
const props = __props;
|
|
3047
3056
|
const emit = __emit;
|
|
3048
|
-
const
|
|
3057
|
+
const formRef = useTemplateRef("form");
|
|
3049
3058
|
const getFormConfig = (items = []) => [
|
|
3050
3059
|
{
|
|
3051
3060
|
type: "fieldset",
|
|
@@ -3068,7 +3077,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
3068
3077
|
);
|
|
3069
3078
|
const onParamsChangeHandler = async (v, eventData) => {
|
|
3070
3079
|
try {
|
|
3071
|
-
const value = await
|
|
3080
|
+
const value = await formRef.value?.submitForm(true);
|
|
3072
3081
|
emit("change", value, eventData);
|
|
3073
3082
|
} catch (e) {
|
|
3074
3083
|
error(e);
|
|
@@ -3076,8 +3085,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
3076
3085
|
};
|
|
3077
3086
|
return (_ctx, _cache) => {
|
|
3078
3087
|
return openBlock(), createBlock(unref(MForm), {
|
|
3079
|
-
|
|
3080
|
-
ref: form,
|
|
3088
|
+
ref: "form",
|
|
3081
3089
|
config: codeParamsConfig.value,
|
|
3082
3090
|
"init-values": _ctx.model,
|
|
3083
3091
|
disabled: _ctx.disabled,
|
|
@@ -3089,8 +3097,8 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
3089
3097
|
}
|
|
3090
3098
|
});
|
|
3091
3099
|
|
|
3092
|
-
const _hoisted_1$
|
|
3093
|
-
const _hoisted_2$
|
|
3100
|
+
const _hoisted_1$_ = { class: "m-fields-code-select-col" };
|
|
3101
|
+
const _hoisted_2$n = { class: "code-select-container" };
|
|
3094
3102
|
const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
3095
3103
|
...{
|
|
3096
3104
|
name: "MFieldsCodeSelectCol"
|
|
@@ -3187,8 +3195,8 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3187
3195
|
eventBus?.emit("edit-code", id);
|
|
3188
3196
|
};
|
|
3189
3197
|
return (_ctx, _cache) => {
|
|
3190
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3191
|
-
createElementVNode("div", _hoisted_2$
|
|
3198
|
+
return openBlock(), createElementBlock("div", _hoisted_1$_, [
|
|
3199
|
+
createElementVNode("div", _hoisted_2$n, [
|
|
3192
3200
|
createVNode(unref(MContainer), {
|
|
3193
3201
|
class: "select",
|
|
3194
3202
|
config: selectConfig,
|
|
@@ -3309,6 +3317,10 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
3309
3317
|
}
|
|
3310
3318
|
});
|
|
3311
3319
|
|
|
3320
|
+
const _hoisted_1$Z = {
|
|
3321
|
+
ref: "title",
|
|
3322
|
+
class: "m-editor-float-box-title"
|
|
3323
|
+
};
|
|
3312
3324
|
const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
3313
3325
|
__name: "FloatingBox",
|
|
3314
3326
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -3329,8 +3341,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3329
3341
|
const height = useModel(__props, "height");
|
|
3330
3342
|
const visible = useModel(__props, "visible");
|
|
3331
3343
|
const props = __props;
|
|
3332
|
-
const
|
|
3333
|
-
const titleEl = useTemplateRef("
|
|
3344
|
+
const targetEl = useTemplateRef("target");
|
|
3345
|
+
const titleEl = useTemplateRef("title");
|
|
3334
3346
|
const zIndex = useZIndex();
|
|
3335
3347
|
const curZIndex = ref(0);
|
|
3336
3348
|
const titleHeight = ref(0);
|
|
@@ -3338,8 +3350,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3338
3350
|
if (height.value) {
|
|
3339
3351
|
return height.value - titleHeight.value;
|
|
3340
3352
|
}
|
|
3341
|
-
if (
|
|
3342
|
-
return
|
|
3353
|
+
if (targetEl.value) {
|
|
3354
|
+
return targetEl.value.clientHeight - titleHeight.value;
|
|
3343
3355
|
}
|
|
3344
3356
|
return "auto";
|
|
3345
3357
|
});
|
|
@@ -3361,7 +3373,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3361
3373
|
const initMoveable = () => {
|
|
3362
3374
|
moveable = new VanillaMoveable(globalThis.document.body, {
|
|
3363
3375
|
className: "m-editor-floating-box-moveable",
|
|
3364
|
-
target:
|
|
3376
|
+
target: targetEl.value,
|
|
3365
3377
|
draggable: true,
|
|
3366
3378
|
resizable: true,
|
|
3367
3379
|
edge: true,
|
|
@@ -3395,7 +3407,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3395
3407
|
if (visible2) {
|
|
3396
3408
|
await nextTick();
|
|
3397
3409
|
curZIndex.value = zIndex.nextZIndex();
|
|
3398
|
-
const targetRect =
|
|
3410
|
+
const targetRect = targetEl.value?.getBoundingClientRect();
|
|
3399
3411
|
if (targetRect) {
|
|
3400
3412
|
width.value = targetRect.width;
|
|
3401
3413
|
height.value = targetRect.height;
|
|
@@ -3431,10 +3443,10 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3431
3443
|
const nextZIndex = () => {
|
|
3432
3444
|
curZIndex.value = zIndex.nextZIndex();
|
|
3433
3445
|
};
|
|
3434
|
-
provide("parentFloating",
|
|
3446
|
+
provide("parentFloating", targetEl);
|
|
3435
3447
|
__expose({
|
|
3436
3448
|
bodyHeight,
|
|
3437
|
-
target,
|
|
3449
|
+
target: targetEl,
|
|
3438
3450
|
titleEl
|
|
3439
3451
|
});
|
|
3440
3452
|
return (_ctx, _cache) => {
|
|
@@ -3443,17 +3455,12 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3443
3455
|
to: "body"
|
|
3444
3456
|
}, [
|
|
3445
3457
|
createElementVNode("div", {
|
|
3446
|
-
|
|
3447
|
-
ref: target,
|
|
3458
|
+
ref: "target",
|
|
3448
3459
|
class: "m-editor-float-box",
|
|
3449
3460
|
style: normalizeStyle({ ...style.value, zIndex: curZIndex.value }),
|
|
3450
3461
|
onMousedown: nextZIndex
|
|
3451
3462
|
}, [
|
|
3452
|
-
createElementVNode("div",
|
|
3453
|
-
ref_key: "titleEl",
|
|
3454
|
-
ref: titleEl,
|
|
3455
|
-
class: "m-editor-float-box-title"
|
|
3456
|
-
}, [
|
|
3463
|
+
createElementVNode("div", _hoisted_1$Z, [
|
|
3457
3464
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
3458
3465
|
createElementVNode("span", null, toDisplayString(_ctx.title), 1)
|
|
3459
3466
|
]),
|
|
@@ -3485,7 +3492,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3485
3492
|
const useCodeBlockEdit = (codeBlockService) => {
|
|
3486
3493
|
const codeConfig = ref();
|
|
3487
3494
|
const codeId = ref();
|
|
3488
|
-
const
|
|
3495
|
+
const codeBlockEditorRef = useTemplateRef("codeBlockEditor");
|
|
3489
3496
|
const createCodeBlock = async () => {
|
|
3490
3497
|
if (!codeBlockService) {
|
|
3491
3498
|
tMagicMessage.error("新增代码块失败");
|
|
@@ -3500,7 +3507,7 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
3500
3507
|
};
|
|
3501
3508
|
codeId.value = await codeBlockService.getUniqueId();
|
|
3502
3509
|
await nextTick();
|
|
3503
|
-
|
|
3510
|
+
codeBlockEditorRef.value?.show();
|
|
3504
3511
|
};
|
|
3505
3512
|
const editCode = async (id) => {
|
|
3506
3513
|
const codeBlock = await codeBlockService?.getCodeContentById(id);
|
|
@@ -3518,7 +3525,7 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
3518
3525
|
};
|
|
3519
3526
|
codeId.value = id;
|
|
3520
3527
|
await nextTick();
|
|
3521
|
-
|
|
3528
|
+
codeBlockEditorRef.value?.show();
|
|
3522
3529
|
};
|
|
3523
3530
|
const deleteCode = async (key) => {
|
|
3524
3531
|
codeBlockService?.deleteCodeDslByIds([key]);
|
|
@@ -3526,12 +3533,12 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
3526
3533
|
const submitCodeBlockHandler = async (values) => {
|
|
3527
3534
|
if (!codeId.value) return;
|
|
3528
3535
|
await codeBlockService?.setCodeDslById(codeId.value, values);
|
|
3529
|
-
|
|
3536
|
+
codeBlockEditorRef.value?.hide();
|
|
3530
3537
|
};
|
|
3531
3538
|
return {
|
|
3532
3539
|
codeId,
|
|
3533
3540
|
codeConfig,
|
|
3534
|
-
codeBlockEditor,
|
|
3541
|
+
codeBlockEditor: codeBlockEditorRef,
|
|
3535
3542
|
createCodeBlock,
|
|
3536
3543
|
editCode,
|
|
3537
3544
|
deleteCode,
|
|
@@ -3539,7 +3546,7 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
3539
3546
|
};
|
|
3540
3547
|
};
|
|
3541
3548
|
|
|
3542
|
-
const state =
|
|
3549
|
+
const state = shallowReactive({
|
|
3543
3550
|
uiSelectMode: false,
|
|
3544
3551
|
showSrc: false,
|
|
3545
3552
|
showStylePanel: true,
|
|
@@ -3987,8 +3994,8 @@ const useNodeStatus$1 = (nodeData) => {
|
|
|
3987
3994
|
};
|
|
3988
3995
|
};
|
|
3989
3996
|
|
|
3990
|
-
const _hoisted_1$
|
|
3991
|
-
const _hoisted_2$
|
|
3997
|
+
const _hoisted_1$Y = { class: "m-editor-data-source-fields" };
|
|
3998
|
+
const _hoisted_2$m = { class: "m-editor-data-source-fields-footer" };
|
|
3992
3999
|
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
3993
4000
|
...{
|
|
3994
4001
|
name: "MFieldsDataSourceFields"
|
|
@@ -4253,12 +4260,12 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
4253
4260
|
const parentFloating = inject("parentFloating", ref(null));
|
|
4254
4261
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
4255
4262
|
return (_ctx, _cache) => {
|
|
4256
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4263
|
+
return openBlock(), createElementBlock("div", _hoisted_1$Y, [
|
|
4257
4264
|
createVNode(unref(MagicTable), {
|
|
4258
4265
|
data: _ctx.model[_ctx.name],
|
|
4259
4266
|
columns: fieldColumns
|
|
4260
4267
|
}, null, 8, ["data"]),
|
|
4261
|
-
createElementVNode("div", _hoisted_2$
|
|
4268
|
+
createElementVNode("div", _hoisted_2$m, [
|
|
4262
4269
|
createVNode(unref(TMagicButton), {
|
|
4263
4270
|
size: "small",
|
|
4264
4271
|
disabled: _ctx.disabled,
|
|
@@ -4331,7 +4338,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
4331
4338
|
}
|
|
4332
4339
|
});
|
|
4333
4340
|
|
|
4334
|
-
const _hoisted_1$
|
|
4341
|
+
const _hoisted_1$X = { class: "m-editor-data-source-field-select" };
|
|
4335
4342
|
const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
4336
4343
|
__name: "FieldSelect",
|
|
4337
4344
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -4413,7 +4420,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
4413
4420
|
eventBus?.emit("edit-data-source", removeDataSourceFieldPrefix(id));
|
|
4414
4421
|
};
|
|
4415
4422
|
return (_ctx, _cache) => {
|
|
4416
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4423
|
+
return openBlock(), createElementBlock("div", _hoisted_1$X, [
|
|
4417
4424
|
_ctx.checkStrictly ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4418
4425
|
createVNode(unref(TMagicSelect), {
|
|
4419
4426
|
"model-value": selectDataSourceId.value,
|
|
@@ -4495,7 +4502,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
4495
4502
|
}
|
|
4496
4503
|
});
|
|
4497
4504
|
|
|
4498
|
-
const _hoisted_1$
|
|
4505
|
+
const _hoisted_1$W = { class: "m-fields-data-source-field-select" };
|
|
4499
4506
|
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
4500
4507
|
...{
|
|
4501
4508
|
name: "MFieldsDataSourceFieldSelect"
|
|
@@ -4597,7 +4604,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
4597
4604
|
}
|
|
4598
4605
|
};
|
|
4599
4606
|
return (_ctx, _cache) => {
|
|
4600
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
4607
|
+
return openBlock(), createElementBlock("div", _hoisted_1$W, [
|
|
4601
4608
|
showDataSourceFieldSelect.value || !_ctx.config.fieldConfig ? (openBlock(), createBlock(_sfc_main$1i, {
|
|
4602
4609
|
key: 0,
|
|
4603
4610
|
"model-value": _ctx.model[_ctx.name],
|
|
@@ -4645,8 +4652,8 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
4645
4652
|
}
|
|
4646
4653
|
});
|
|
4647
4654
|
|
|
4648
|
-
const _hoisted_1$
|
|
4649
|
-
const _hoisted_2$
|
|
4655
|
+
const _hoisted_1$V = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4656
|
+
const _hoisted_2$l = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4650
4657
|
const _hoisted_3$8 = { class: "el-input__inner t-input__inner" };
|
|
4651
4658
|
const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
4652
4659
|
...{
|
|
@@ -4669,11 +4676,11 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4669
4676
|
const props = __props;
|
|
4670
4677
|
const emit = __emit;
|
|
4671
4678
|
const { dataSourceService } = inject("services") || {};
|
|
4672
|
-
const
|
|
4679
|
+
const autocompleteRef = useTemplateRef("autocomplete");
|
|
4673
4680
|
const isFocused = ref(false);
|
|
4674
4681
|
const state = ref("");
|
|
4675
4682
|
const displayState = ref([]);
|
|
4676
|
-
const input = computed(() =>
|
|
4683
|
+
const input = computed(() => autocompleteRef.value?.inputRef?.input);
|
|
4677
4684
|
const dataSources = computed(() => dataSourceService?.get("dataSources") || []);
|
|
4678
4685
|
const setDisplayState = () => {
|
|
4679
4686
|
displayState.value = getDisplayField(dataSources.value, state.value);
|
|
@@ -4692,7 +4699,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4692
4699
|
const focusOffset = selection?.focusOffset || 0;
|
|
4693
4700
|
isFocused.value = true;
|
|
4694
4701
|
await nextTick();
|
|
4695
|
-
|
|
4702
|
+
autocompleteRef.value?.focus();
|
|
4696
4703
|
if (focusOffset && input.value) {
|
|
4697
4704
|
input.value.setSelectionRange(anchorOffset, focusOffset);
|
|
4698
4705
|
}
|
|
@@ -4828,8 +4835,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4828
4835
|
{
|
|
4829
4836
|
key: 0,
|
|
4830
4837
|
class: "tmagic-design-auto-complete",
|
|
4831
|
-
|
|
4832
|
-
ref: autocomplete,
|
|
4838
|
+
ref: "autocomplete",
|
|
4833
4839
|
modelValue: state.value,
|
|
4834
4840
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
|
|
4835
4841
|
},
|
|
@@ -4851,9 +4857,9 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4851
4857
|
createVNode(_sfc_main$1s, { icon: unref(Coin) }, null, 8, ["icon"])
|
|
4852
4858
|
]),
|
|
4853
4859
|
default: withCtx(({ item }) => [
|
|
4854
|
-
createElementVNode("div", _hoisted_1$
|
|
4860
|
+
createElementVNode("div", _hoisted_1$V, [
|
|
4855
4861
|
createElementVNode("div", null, toDisplayString(item.text), 1),
|
|
4856
|
-
createElementVNode("span", _hoisted_2$
|
|
4862
|
+
createElementVNode("span", _hoisted_2$l, toDisplayString(item.value), 1)
|
|
4857
4863
|
])
|
|
4858
4864
|
]),
|
|
4859
4865
|
_: 1
|
|
@@ -4894,8 +4900,8 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
|
4894
4900
|
}
|
|
4895
4901
|
});
|
|
4896
4902
|
|
|
4897
|
-
const _hoisted_1$
|
|
4898
|
-
const _hoisted_2$
|
|
4903
|
+
const _hoisted_1$U = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
4904
|
+
const _hoisted_2$k = { style: { "flex": "1" } };
|
|
4899
4905
|
const _hoisted_3$7 = { style: { "flex": "1" } };
|
|
4900
4906
|
const _hoisted_4$5 = { class: "dialog-footer" };
|
|
4901
4907
|
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
@@ -4924,12 +4930,12 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
4924
4930
|
const { height: codeBlockEditorHeight } = useEditorContentHeight();
|
|
4925
4931
|
const difVisible = ref(false);
|
|
4926
4932
|
const { rect: windowRect } = useWindowRect();
|
|
4927
|
-
const
|
|
4933
|
+
const magicVsEditorRef = useTemplateRef("magicVsEditor");
|
|
4928
4934
|
const diffChange = () => {
|
|
4929
|
-
if (!
|
|
4935
|
+
if (!magicVsEditorRef.value || !formBox.value?.form) {
|
|
4930
4936
|
return;
|
|
4931
4937
|
}
|
|
4932
|
-
formBox.value.form.values.content =
|
|
4938
|
+
formBox.value.form.values.content = magicVsEditorRef.value.getEditorValue();
|
|
4933
4939
|
difVisible.value = false;
|
|
4934
4940
|
};
|
|
4935
4941
|
const defaultParamColConfig = {
|
|
@@ -5148,8 +5154,8 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
5148
5154
|
])
|
|
5149
5155
|
]),
|
|
5150
5156
|
default: withCtx(() => [
|
|
5151
|
-
createElementVNode("div", _hoisted_1$
|
|
5152
|
-
createElementVNode("div", _hoisted_2$
|
|
5157
|
+
createElementVNode("div", _hoisted_1$U, [
|
|
5158
|
+
createElementVNode("div", _hoisted_2$k, [
|
|
5153
5159
|
createVNode(unref(TMagicTag), {
|
|
5154
5160
|
size: "small",
|
|
5155
5161
|
type: "info"
|
|
@@ -5174,8 +5180,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
5174
5180
|
]),
|
|
5175
5181
|
difVisible.value ? (openBlock(), createBlock(_sfc_main$1r, {
|
|
5176
5182
|
key: 0,
|
|
5177
|
-
|
|
5178
|
-
ref: magicVsEditor,
|
|
5183
|
+
ref: "magicVsEditor",
|
|
5179
5184
|
type: "diff",
|
|
5180
5185
|
language: "json",
|
|
5181
5186
|
initValues: _ctx.content.content,
|
|
@@ -5191,8 +5196,8 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
5191
5196
|
}
|
|
5192
5197
|
});
|
|
5193
5198
|
|
|
5194
|
-
const _hoisted_1$
|
|
5195
|
-
const _hoisted_2$
|
|
5199
|
+
const _hoisted_1$T = { class: "m-editor-data-source-methods" };
|
|
5200
|
+
const _hoisted_2$j = { class: "m-editor-data-source-methods-footer" };
|
|
5196
5201
|
const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
5197
5202
|
...{
|
|
5198
5203
|
name: "MFieldsDataSourceMethods"
|
|
@@ -5214,7 +5219,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5214
5219
|
const props = __props;
|
|
5215
5220
|
const emit = __emit;
|
|
5216
5221
|
const codeConfig = ref();
|
|
5217
|
-
const
|
|
5222
|
+
const codeBlockEditorRef = useTemplateRef("codeBlockEditor");
|
|
5218
5223
|
let editIndex = -1;
|
|
5219
5224
|
const methodColumns = [
|
|
5220
5225
|
{
|
|
@@ -5253,7 +5258,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5253
5258
|
};
|
|
5254
5259
|
editIndex = index;
|
|
5255
5260
|
nextTick(() => {
|
|
5256
|
-
|
|
5261
|
+
codeBlockEditorRef.value?.show();
|
|
5257
5262
|
});
|
|
5258
5263
|
}
|
|
5259
5264
|
},
|
|
@@ -5279,7 +5284,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5279
5284
|
};
|
|
5280
5285
|
editIndex = -1;
|
|
5281
5286
|
nextTick(() => {
|
|
5282
|
-
|
|
5287
|
+
codeBlockEditorRef.value?.show();
|
|
5283
5288
|
});
|
|
5284
5289
|
};
|
|
5285
5290
|
const submitCodeHandler = (value, data) => {
|
|
@@ -5311,15 +5316,15 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5311
5316
|
}
|
|
5312
5317
|
editIndex = -1;
|
|
5313
5318
|
codeConfig.value = void 0;
|
|
5314
|
-
|
|
5319
|
+
codeBlockEditorRef.value?.hide();
|
|
5315
5320
|
};
|
|
5316
5321
|
return (_ctx, _cache) => {
|
|
5317
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5322
|
+
return openBlock(), createElementBlock("div", _hoisted_1$T, [
|
|
5318
5323
|
createVNode(unref(MagicTable), {
|
|
5319
5324
|
data: _ctx.model[_ctx.name],
|
|
5320
5325
|
columns: methodColumns
|
|
5321
5326
|
}, null, 8, ["data"]),
|
|
5322
|
-
createElementVNode("div", _hoisted_2$
|
|
5327
|
+
createElementVNode("div", _hoisted_2$j, [
|
|
5323
5328
|
createVNode(unref(TMagicButton), {
|
|
5324
5329
|
size: "small",
|
|
5325
5330
|
type: "primary",
|
|
@@ -5335,8 +5340,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5335
5340
|
]),
|
|
5336
5341
|
codeConfig.value ? (openBlock(), createBlock(_sfc_main$1f, {
|
|
5337
5342
|
key: 0,
|
|
5338
|
-
|
|
5339
|
-
ref: codeBlockEditor,
|
|
5343
|
+
ref: "codeBlockEditor",
|
|
5340
5344
|
disabled: _ctx.disabled,
|
|
5341
5345
|
content: codeConfig.value,
|
|
5342
5346
|
"is-data-source": true,
|
|
@@ -5348,8 +5352,8 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
|
5348
5352
|
}
|
|
5349
5353
|
});
|
|
5350
5354
|
|
|
5351
|
-
const _hoisted_1$
|
|
5352
|
-
const _hoisted_2$
|
|
5355
|
+
const _hoisted_1$S = { class: "m-fields-data-source-method-select" };
|
|
5356
|
+
const _hoisted_2$i = { class: "data-source-method-select-container" };
|
|
5353
5357
|
const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
5354
5358
|
...{
|
|
5355
5359
|
name: "MFieldsDataSourceMethodSelect"
|
|
@@ -5436,8 +5440,8 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
5436
5440
|
eventBus?.emit("edit-data-source", id);
|
|
5437
5441
|
};
|
|
5438
5442
|
return (_ctx, _cache) => {
|
|
5439
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5440
|
-
createElementVNode("div", _hoisted_2$
|
|
5443
|
+
return openBlock(), createElementBlock("div", _hoisted_1$S, [
|
|
5444
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
5441
5445
|
createVNode(unref(MContainer), {
|
|
5442
5446
|
class: "select",
|
|
5443
5447
|
config: cascaderConfig.value,
|
|
@@ -5480,8 +5484,8 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
5480
5484
|
}
|
|
5481
5485
|
});
|
|
5482
5486
|
|
|
5483
|
-
const _hoisted_1$
|
|
5484
|
-
const _hoisted_2$
|
|
5487
|
+
const _hoisted_1$R = { class: "m-editor-data-source-fields" };
|
|
5488
|
+
const _hoisted_2$h = { class: "m-editor-data-source-fields-footer" };
|
|
5485
5489
|
const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
5486
5490
|
...{
|
|
5487
5491
|
name: "MFieldsDataSourceMocks"
|
|
@@ -5686,12 +5690,12 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5686
5690
|
const parentFloating = inject("parentFloating", ref(null));
|
|
5687
5691
|
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
5688
5692
|
return (_ctx, _cache) => {
|
|
5689
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5693
|
+
return openBlock(), createElementBlock("div", _hoisted_1$R, [
|
|
5690
5694
|
createVNode(unref(MagicTable), {
|
|
5691
5695
|
data: _ctx.model[_ctx.name],
|
|
5692
5696
|
columns
|
|
5693
5697
|
}, null, 8, ["data"]),
|
|
5694
|
-
createElementVNode("div", _hoisted_2$
|
|
5698
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
5695
5699
|
createVNode(unref(TMagicButton), {
|
|
5696
5700
|
size: "small",
|
|
5697
5701
|
type: "primary",
|
|
@@ -5732,7 +5736,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
5732
5736
|
}
|
|
5733
5737
|
});
|
|
5734
5738
|
|
|
5735
|
-
const _hoisted_1$
|
|
5739
|
+
const _hoisted_1$Q = { class: "m-fields-data-source-select" };
|
|
5736
5740
|
const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
5737
5741
|
...{
|
|
5738
5742
|
name: "MFieldsDataSourceSelect"
|
|
@@ -5790,7 +5794,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
5790
5794
|
eventBus?.emit("edit-data-source", id);
|
|
5791
5795
|
};
|
|
5792
5796
|
return (_ctx, _cache) => {
|
|
5793
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5797
|
+
return openBlock(), createElementBlock("div", _hoisted_1$Q, [
|
|
5794
5798
|
createVNode(unref(MSelect), {
|
|
5795
5799
|
model: _ctx.model,
|
|
5796
5800
|
name: _ctx.name,
|
|
@@ -5958,8 +5962,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
5958
5962
|
}
|
|
5959
5963
|
});
|
|
5960
5964
|
|
|
5961
|
-
const _hoisted_1$
|
|
5962
|
-
const _hoisted_2$
|
|
5965
|
+
const _hoisted_1$P = { class: "m-fields-event-select" };
|
|
5966
|
+
const _hoisted_2$g = {
|
|
5963
5967
|
key: 1,
|
|
5964
5968
|
class: "fullWidth"
|
|
5965
5969
|
};
|
|
@@ -6239,7 +6243,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
6239
6243
|
const onChangeHandler = (v, eventData) => emit("change", props.model[props.name], eventData);
|
|
6240
6244
|
return (_ctx, _cache) => {
|
|
6241
6245
|
const _component_m_form_table = resolveComponent("m-form-table");
|
|
6242
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6246
|
+
return openBlock(), createElementBlock("div", _hoisted_1$P, [
|
|
6243
6247
|
isOldVersion.value ? (openBlock(), createBlock(_component_m_form_table, {
|
|
6244
6248
|
key: 0,
|
|
6245
6249
|
name: "events",
|
|
@@ -6248,7 +6252,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
6248
6252
|
model: _ctx.model,
|
|
6249
6253
|
config: tableConfig.value,
|
|
6250
6254
|
onChange: onChangeHandler
|
|
6251
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
6255
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$g, [
|
|
6252
6256
|
createVNode(unref(TMagicButton), {
|
|
6253
6257
|
class: "create-button",
|
|
6254
6258
|
type: "primary",
|
|
@@ -6300,7 +6304,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
6300
6304
|
}
|
|
6301
6305
|
});
|
|
6302
6306
|
|
|
6303
|
-
const _hoisted_1$
|
|
6307
|
+
const _hoisted_1$O = {
|
|
6304
6308
|
viewBox: "0 0 32 32",
|
|
6305
6309
|
version: "1.1",
|
|
6306
6310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6313,15 +6317,15 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
6313
6317
|
__name: "CodeIcon",
|
|
6314
6318
|
setup(__props) {
|
|
6315
6319
|
return (_ctx, _cache) => {
|
|
6316
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6320
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$O, _cache[0] || (_cache[0] = [
|
|
6317
6321
|
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)
|
|
6318
6322
|
]));
|
|
6319
6323
|
};
|
|
6320
6324
|
}
|
|
6321
6325
|
});
|
|
6322
6326
|
|
|
6323
|
-
const _hoisted_1$
|
|
6324
|
-
const _hoisted_2$
|
|
6327
|
+
const _hoisted_1$N = { class: "m-fields-key-value" };
|
|
6328
|
+
const _hoisted_2$f = { key: 0 };
|
|
6325
6329
|
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
6326
6330
|
...{
|
|
6327
6331
|
name: "MFieldsKeyValue"
|
|
@@ -6384,8 +6388,8 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
6384
6388
|
emit("change", v);
|
|
6385
6389
|
};
|
|
6386
6390
|
return (_ctx, _cache) => {
|
|
6387
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6388
|
-
!showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
6391
|
+
return openBlock(), createElementBlock("div", _hoisted_1$N, [
|
|
6392
|
+
!showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
|
|
6389
6393
|
(openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
|
|
6390
6394
|
return openBlock(), createElementBlock("div", {
|
|
6391
6395
|
class: "m-fields-key-value-item",
|
|
@@ -6458,8 +6462,8 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
6458
6462
|
}
|
|
6459
6463
|
});
|
|
6460
6464
|
|
|
6461
|
-
const _hoisted_1$
|
|
6462
|
-
const _hoisted_2$
|
|
6465
|
+
const _hoisted_1$M = { class: "m-fields-page-fragment-select" };
|
|
6466
|
+
const _hoisted_2$e = { class: "page-fragment-select-container" };
|
|
6463
6467
|
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
6464
6468
|
...{
|
|
6465
6469
|
name: "MFieldsPageFragmentSelect"
|
|
@@ -6506,8 +6510,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
6506
6510
|
};
|
|
6507
6511
|
return (_ctx, _cache) => {
|
|
6508
6512
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
6509
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6510
|
-
createElementVNode("div", _hoisted_2$
|
|
6513
|
+
return openBlock(), createElementBlock("div", _hoisted_1$M, [
|
|
6514
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
6511
6515
|
createVNode(_component_m_form_container, {
|
|
6512
6516
|
class: "select",
|
|
6513
6517
|
config: selectConfig,
|
|
@@ -6527,8 +6531,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
6527
6531
|
}
|
|
6528
6532
|
});
|
|
6529
6533
|
|
|
6530
|
-
const _hoisted_1$
|
|
6531
|
-
const _hoisted_2$
|
|
6534
|
+
const _hoisted_1$L = { class: "background-position-container" };
|
|
6535
|
+
const _hoisted_2$d = { class: "presets-value-list" };
|
|
6532
6536
|
const _hoisted_3$6 = { class: "custom-value" };
|
|
6533
6537
|
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
6534
6538
|
__name: "BackgroundPosition",
|
|
@@ -6585,8 +6589,8 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
6585
6589
|
emit("change", v);
|
|
6586
6590
|
};
|
|
6587
6591
|
return (_ctx, _cache) => {
|
|
6588
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6589
|
-
createElementVNode("div", _hoisted_2$
|
|
6592
|
+
return openBlock(), createElementBlock("div", _hoisted_1$L, [
|
|
6593
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
6590
6594
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item, index) => {
|
|
6591
6595
|
return openBlock(), createBlock(unref(TMagicButton), {
|
|
6592
6596
|
key: index,
|
|
@@ -6628,13 +6632,13 @@ const _export_sfc = (sfc, props) => {
|
|
|
6628
6632
|
|
|
6629
6633
|
const _sfc_main$14 = {};
|
|
6630
6634
|
|
|
6631
|
-
const _hoisted_1$
|
|
6635
|
+
const _hoisted_1$K = {
|
|
6632
6636
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6633
6637
|
viewBox: "0 0 1024 1024"
|
|
6634
6638
|
};
|
|
6635
6639
|
|
|
6636
6640
|
function _sfc_render$k(_ctx, _cache) {
|
|
6637
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6641
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$K, _cache[0] || (_cache[0] = [
|
|
6638
6642
|
createStaticVNode("<path d=\"M884.736 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C696.32 311.296 712.704 327.68 733.184 327.68l147.456 0c20.48 0 36.864-16.384 36.864-36.864L917.504 139.264C921.6 118.784 905.216 102.4 884.736 102.4zM884.736 290.816l-147.456 0L737.28 139.264l147.456 0L884.736 290.816z\"></path><path d=\"M884.736 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 712.704 905.216 696.32 884.736 696.32zM884.736 884.736l-147.456 0 0-147.456 147.456 0L884.736 884.736z\"></path><path d=\"M884.736 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 417.792 905.216 401.408 884.736 401.408zM884.736 585.728l-147.456 0 0-147.456 147.456 0L884.736 585.728z\"></path><path d=\"M585.728 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 417.792 606.208 401.408 585.728 401.408zM585.728 585.728l-147.456 0 0-147.456 147.456 0L585.728 585.728z\"></path><path d=\"M585.728 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864L622.592 139.264C622.592 118.784 606.208 102.4 585.728 102.4zM585.728 290.816l-147.456 0L438.272 139.264l147.456 0L585.728 290.816z\"></path><path d=\"M585.728 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 712.704 606.208 696.32 585.728 696.32zM585.728 884.736l-147.456 0 0-147.456 147.456 0L585.728 884.736z\"></path><path d=\"M290.816 696.32 139.264 696.32c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 712.704 311.296 696.32 290.816 696.32zM290.816 884.736 139.264 884.736l0-147.456 147.456 0L286.72 884.736z\"></path><path d=\"M290.816 401.408 139.264 401.408c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 417.792 311.296 401.408 290.816 401.408zM290.816 585.728 139.264 585.728l0-147.456 147.456 0L286.72 585.728z\"></path><path d=\"M290.816 102.4 139.264 102.4c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C102.4 311.296 118.784 327.68 139.264 327.68l147.456 0C311.296 327.68 327.68 311.296 327.68 290.816L327.68 139.264C327.68 118.784 311.296 102.4 290.816 102.4zM290.816 290.816 139.264 290.816 139.264 139.264l147.456 0L286.72 290.816z\"></path>", 9)
|
|
6639
6643
|
])))
|
|
6640
6644
|
}
|
|
@@ -6642,13 +6646,13 @@ const BackgroundRepeat = /*#__PURE__*/_export_sfc(_sfc_main$14, [['render',_sfc_
|
|
|
6642
6646
|
|
|
6643
6647
|
const _sfc_main$13 = {};
|
|
6644
6648
|
|
|
6645
|
-
const _hoisted_1$
|
|
6649
|
+
const _hoisted_1$J = {
|
|
6646
6650
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6647
6651
|
viewBox: "0 0 1024 1024"
|
|
6648
6652
|
};
|
|
6649
6653
|
|
|
6650
6654
|
function _sfc_render$j(_ctx, _cache) {
|
|
6651
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6655
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$J, _cache[0] || (_cache[0] = [
|
|
6652
6656
|
createElementVNode("path", {
|
|
6653
6657
|
d: "M796.444444 170.666667h-227.555555v682.666666h227.555555V170.666667z m-56.888888 625.777777h-113.777778V227.555556h113.777778v568.888888zM455.111111 170.666667H227.555556v682.666666h227.555555V170.666667zM398.222222 796.444444H284.444444V227.555556h113.777778v568.888888zM910.222222 56.888889h56.888889v910.222222h-56.888889zM56.888889 56.888889h56.888889v910.222222H56.888889z",
|
|
6654
6658
|
fill: "#333333"
|
|
@@ -6659,13 +6663,13 @@ const BackgroundRepeatX = /*#__PURE__*/_export_sfc(_sfc_main$13, [['render',_sfc
|
|
|
6659
6663
|
|
|
6660
6664
|
const _sfc_main$12 = {};
|
|
6661
6665
|
|
|
6662
|
-
const _hoisted_1$
|
|
6666
|
+
const _hoisted_1$I = {
|
|
6663
6667
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6664
6668
|
viewBox: "0 0 1024 1024"
|
|
6665
6669
|
};
|
|
6666
6670
|
|
|
6667
6671
|
function _sfc_render$i(_ctx, _cache) {
|
|
6668
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6672
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$I, _cache[0] || (_cache[0] = [
|
|
6669
6673
|
createElementVNode("path", {
|
|
6670
6674
|
d: "M170.666667 227.555556v227.555555h682.666666V227.555556H170.666667z m625.777777 56.888888v113.777778H227.555556V284.444444h568.888888zM170.666667 568.888889v227.555555h682.666666v-227.555555H170.666667z m625.777777 56.888889v113.777778H227.555556v-113.777778h568.888888zM56.888889 56.888889h910.222222v56.888889H56.888889zM56.888889 910.222222h910.222222v56.888889H56.888889z",
|
|
6671
6675
|
fill: "#333333"
|
|
@@ -6676,13 +6680,13 @@ const BackgroundRepeatY = /*#__PURE__*/_export_sfc(_sfc_main$12, [['render',_sfc
|
|
|
6676
6680
|
|
|
6677
6681
|
const _sfc_main$11 = {};
|
|
6678
6682
|
|
|
6679
|
-
const _hoisted_1$
|
|
6683
|
+
const _hoisted_1$H = {
|
|
6680
6684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6681
6685
|
viewBox: "0 0 1024 1024"
|
|
6682
6686
|
};
|
|
6683
6687
|
|
|
6684
6688
|
function _sfc_render$h(_ctx, _cache) {
|
|
6685
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6689
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$H, _cache[0] || (_cache[0] = [
|
|
6686
6690
|
createElementVNode("path", {
|
|
6687
6691
|
d: "M912.526651 867.741144 555.540144 510.712681l356.986507-357.000833c11.171434-11.18576 11.171434-29.257348 0-40.443108-11.20111-11.18576-29.272697-11.18576-40.444131 0L515.096013 470.267527 158.096203 113.267716c-11.187807-11.159154-29.258371-11.159154-40.444131 0-11.186783 11.186783-11.186783 29.286 0 40.47176L474.623229 510.712681 117.623419 867.741144c-11.159154 11.172457-11.159154 29.216415 0 40.443108 11.18576 11.17348 29.284977 11.17348 40.47176 0l357.000833-357.027439 356.985484 357.027439c11.171434 11.17348 29.243021 11.17348 40.444131 0C923.698085 896.957559 923.725714 878.913601 912.526651 867.741144z",
|
|
6688
6692
|
fill: "#5D5D5D"
|
|
@@ -6768,13 +6772,13 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
6768
6772
|
|
|
6769
6773
|
const _sfc_main$$ = {};
|
|
6770
6774
|
|
|
6771
|
-
const _hoisted_1$
|
|
6775
|
+
const _hoisted_1$G = {
|
|
6772
6776
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6773
6777
|
viewBox: "0 0 1024 1024"
|
|
6774
6778
|
};
|
|
6775
6779
|
|
|
6776
6780
|
function _sfc_render$g(_ctx, _cache) {
|
|
6777
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6781
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$G, _cache[0] || (_cache[0] = [
|
|
6778
6782
|
createElementVNode("path", { d: "M128 810.666667h768v85.333333H128z m0-170.666667h512v85.333333H128z m0-170.666667h768v85.333334H128z m0-341.333333h768v85.333333H128z m0 170.666667h512v85.333333H128z" }, null, -1)
|
|
6779
6783
|
])))
|
|
6780
6784
|
}
|
|
@@ -6782,13 +6786,13 @@ const AlignLeft = /*#__PURE__*/_export_sfc(_sfc_main$$, [['render',_sfc_render$g
|
|
|
6782
6786
|
|
|
6783
6787
|
const _sfc_main$_ = {};
|
|
6784
6788
|
|
|
6785
|
-
const _hoisted_1$
|
|
6789
|
+
const _hoisted_1$F = {
|
|
6786
6790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6787
6791
|
viewBox: "0 0 1024 1024"
|
|
6788
6792
|
};
|
|
6789
6793
|
|
|
6790
6794
|
function _sfc_render$f(_ctx, _cache) {
|
|
6791
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6795
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$F, _cache[0] || (_cache[0] = [
|
|
6792
6796
|
createElementVNode("path", { d: "M128 810.666667h768v85.333333H128z m128-170.666667h512v85.333333H256z m-128-170.666667h768v85.333334H128z m0-341.333333h768v85.333333H128z m128 170.666667h512v85.333333H256z" }, null, -1)
|
|
6793
6797
|
])))
|
|
6794
6798
|
}
|
|
@@ -6796,13 +6800,13 @@ const AlignCenter = /*#__PURE__*/_export_sfc(_sfc_main$_, [['render',_sfc_render
|
|
|
6796
6800
|
|
|
6797
6801
|
const _sfc_main$Z = {};
|
|
6798
6802
|
|
|
6799
|
-
const _hoisted_1$
|
|
6803
|
+
const _hoisted_1$E = {
|
|
6800
6804
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6801
6805
|
viewBox: "0 0 1024 1024"
|
|
6802
6806
|
};
|
|
6803
6807
|
|
|
6804
6808
|
function _sfc_render$e(_ctx, _cache) {
|
|
6805
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6809
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$E, _cache[0] || (_cache[0] = [
|
|
6806
6810
|
createElementVNode("path", { d: "M128 128h768v85.333333H128z m0 682.666667h768v85.333333H128z m213.333333-170.666667h554.666667v85.333333H341.333333z m-213.333333-170.666667h768v85.333334H128z m213.333333-170.666666h554.666667v85.333333H341.333333z" }, null, -1)
|
|
6807
6811
|
])))
|
|
6808
6812
|
}
|
|
@@ -6892,8 +6896,8 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
6892
6896
|
}
|
|
6893
6897
|
});
|
|
6894
6898
|
|
|
6895
|
-
const _hoisted_1$
|
|
6896
|
-
const _hoisted_2$
|
|
6899
|
+
const _hoisted_1$D = { class: "layout-box-container" };
|
|
6900
|
+
const _hoisted_2$c = {
|
|
6897
6901
|
key: 0,
|
|
6898
6902
|
class: "help-txt"
|
|
6899
6903
|
};
|
|
@@ -6949,13 +6953,13 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
6949
6953
|
});
|
|
6950
6954
|
};
|
|
6951
6955
|
return (_ctx, _cache) => {
|
|
6952
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6956
|
+
return openBlock(), createElementBlock("div", _hoisted_1$D, [
|
|
6953
6957
|
(openBlock(), createElementBlock(Fragment, null, renderList(list, (item, index) => {
|
|
6954
6958
|
return createElementVNode("div", {
|
|
6955
6959
|
key: index,
|
|
6956
6960
|
class: normalizeClass(item.class)
|
|
6957
6961
|
}, [
|
|
6958
|
-
item.text ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
6962
|
+
item.text ? (openBlock(), createElementBlock("span", _hoisted_2$c, toDisplayString(item.text), 1)) : createCommentVNode("", true),
|
|
6959
6963
|
createElementVNode("span", _hoisted_3$5, [
|
|
6960
6964
|
withDirectives(createElementVNode("input", {
|
|
6961
6965
|
"onUpdate:modelValue": ($event) => _ctx.model[item.name] = $event,
|
|
@@ -6975,13 +6979,13 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
6975
6979
|
|
|
6976
6980
|
const _sfc_main$W = {};
|
|
6977
6981
|
|
|
6978
|
-
const _hoisted_1$
|
|
6982
|
+
const _hoisted_1$C = {
|
|
6979
6983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6980
6984
|
viewBox: "0 0 1024 1024"
|
|
6981
6985
|
};
|
|
6982
6986
|
|
|
6983
6987
|
function _sfc_render$d(_ctx, _cache) {
|
|
6984
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
6988
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$C, _cache[0] || (_cache[0] = [
|
|
6985
6989
|
createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192z m-96 64a32 32 0 0 1 32 32v448a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32h704z" }, null, -1)
|
|
6986
6990
|
])))
|
|
6987
6991
|
}
|
|
@@ -6989,13 +6993,13 @@ const DisplayBlock = /*#__PURE__*/_export_sfc(_sfc_main$W, [['render',_sfc_rende
|
|
|
6989
6993
|
|
|
6990
6994
|
const _sfc_main$V = {};
|
|
6991
6995
|
|
|
6992
|
-
const _hoisted_1$
|
|
6996
|
+
const _hoisted_1$B = {
|
|
6993
6997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6994
6998
|
viewBox: "0 0 1024 1024"
|
|
6995
6999
|
};
|
|
6996
7000
|
|
|
6997
7001
|
function _sfc_render$c(_ctx, _cache) {
|
|
6998
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7002
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$B, _cache[0] || (_cache[0] = [
|
|
6999
7003
|
createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192zM352 256v512H160V256h192z m256 0v512h-192V256h192z m256 0v512h-192V256h192z" }, null, -1)
|
|
7000
7004
|
])))
|
|
7001
7005
|
}
|
|
@@ -7003,13 +7007,13 @@ const DisplayFlex = /*#__PURE__*/_export_sfc(_sfc_main$V, [['render',_sfc_render
|
|
|
7003
7007
|
|
|
7004
7008
|
const _sfc_main$U = {};
|
|
7005
7009
|
|
|
7006
|
-
const _hoisted_1$
|
|
7010
|
+
const _hoisted_1$A = {
|
|
7007
7011
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7008
7012
|
viewBox: "0 0 1024 1024"
|
|
7009
7013
|
};
|
|
7010
7014
|
|
|
7011
7015
|
function _sfc_render$b(_ctx, _cache) {
|
|
7012
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7016
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$A, _cache[0] || (_cache[0] = [
|
|
7013
7017
|
createElementVNode("path", { d: "M787.616 651.36a142.72 142.72 0 0 0 52.864 31.904 205.504 205.504 0 0 0 67.264 10.848 245.76 245.76 0 0 0 38.784-2.4c9.504-1.6 19.36-4 30.208-7.04 8.16-2.24 15.968-5.12 23.36-8.32l23.392-10.816V587.52h-8.736c-3.968 3.424-8.96 7.648-15.104 12.544a190.272 190.272 0 0 1-19.936 13.504 120.32 120.32 0 0 1-27.616 12.544 102.528 102.528 0 0 1-62.72-0.576 80 80 0 0 1-29.824-17.088 89.28 89.28 0 0 1-21.664-32.512c-5.696-13.664-8.64-30.784-8.64-51.296 0-19.744 2.72-36.384 7.968-50.08 5.248-13.664 12.384-24.896 20.992-33.056 9.12-8.832 18.816-14.816 29.632-18.816a101.824 101.824 0 0 1 63.68-0.736c9.408 3.136 18.08 7.04 26.112 11.68 13.024 7.808 25.28 16.768 36.672 26.784H1024v-78.72c-6.08-2.88-13.12-6.08-21.12-9.6a205.984 205.984 0 0 0-57.152-15.36 270.016 270.016 0 0 0-37.056-2.304c-24.864 0-47.744 4-68.704 11.84-20.992 7.776-38.432 18.784-52.64 33.6a144.256 144.256 0 0 0-33.632 54.176 207.68 207.68 0 0 0-12.48 70.176c0 27.84 3.968 52.352 12.16 73.568a146.08 146.08 0 0 0 34.176 53.184l0.064 0.416z m-186.112 34.656a122.912 122.912 0 0 0 42.784-21.504c11.2-8.32 20.224-19.296 26.24-31.936 6.56-13.664 9.888-28.704 9.664-43.904 0-22.784-6.272-41.024-18.912-54.72-12.544-13.92-29.664-23.04-51.104-27.36v-2.304c14.4-6.24 26.688-16.448 35.52-29.408 8.384-12.544 12.544-27.008 12.544-43.52 0-14.24-2.944-26.784-9.12-37.6a65.696 65.696 0 0 0-27.936-26.24 117.44 117.44 0 0 0-36.48-12.096A437.312 437.312 0 0 0 526.656 352h-127.552v340.384h143.392c23.84 0 43.52-2.112 59.008-6.4z m-118.112-271.584h7.968c16.544 0 29.472 0.128 38.656 0.352 9.248 0.576 16.864 1.728 23.04 4a26.24 26.24 0 0 1 14.4 13.12c2.656 5.28 4.064 11.072 4.128 16.96 0.16 6.656-1.056 13.248-3.52 19.392a28.064 28.064 0 0 1-15.04 13.696c-7.04 2.912-14.56 4.48-22.208 4.576-9.472 0.32-20.864 0.544-34.24 0.544h-13.184v-72.64z m6.144 215.52h-6.144v-84.8h18.464c12.64 0 24.736 0 36.384 0.256 9.216-0.16 18.432 0.896 27.36 3.2 9.696 2.848 16.544 7.232 20.512 13.12 4 5.92 6.08 14.24 6.08 25.088 0 8.192-1.728 15.488-4.992 21.824-3.232 6.336-9.696 11.392-18.24 15.392-8.544 4-18.24 5.696-28.48 6.272-10.304 0.224-27.392 0.224-51.328 0.224l0.384-0.576z m-378.56-6.016h124.672l23.36 68.416H348.8L224.32 353.728H124.416L0 692.384h87.52l23.488-68.416-0.064-0.032z m62.336-183.552l41.472 121.44h-82.88l41.408-121.44z" }, null, -1)
|
|
7014
7018
|
])))
|
|
7015
7019
|
}
|
|
@@ -7017,13 +7021,13 @@ const DisplayInline = /*#__PURE__*/_export_sfc(_sfc_main$U, [['render',_sfc_rend
|
|
|
7017
7021
|
|
|
7018
7022
|
const _sfc_main$T = {};
|
|
7019
7023
|
|
|
7020
|
-
const _hoisted_1$
|
|
7024
|
+
const _hoisted_1$z = {
|
|
7021
7025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7022
7026
|
viewBox: "0 0 1024 1024"
|
|
7023
7027
|
};
|
|
7024
7028
|
|
|
7025
7029
|
function _sfc_render$a(_ctx, _cache) {
|
|
7026
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7030
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$z, _cache[0] || (_cache[0] = [
|
|
7027
7031
|
createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192z m-131.936 158.496c65.984 1.824 109.024 32.512 129.184 92.064l-65.952 15.136-1.856-5.664c-9.984-27.52-30.432-42.112-61.376-43.84-46.72 2.784-71.456 35.296-74.208 97.6 1.856 63.2 26.56 96.64 74.24 100.32 37.536-0.928 59.52-23.36 65.92-67.328L960 559.36l-1.792 7.232c-16.96 63.872-60.352 95.84-130.144 95.84-93.44-4.608-142.464-56.8-147.04-156.672 4.576-98.048 53.6-149.792 147.04-155.296z m-568.928 4.128l114.08 302.336H297.6l-22.016-65.984H160.192L138.24 656.96H64l112.672-302.336h82.464z m278.976 0l7.68 0.32c62.816 3.36 96 27.104 99.52 71.136 0 35.744-19.712 59.552-59.104 71.456 42.144 9.184 65.952 32.544 71.456 70.08 0 59.552-37.568 89.344-112.672 89.344h-148.416v-302.336h141.536z m-4.128 173.152H465.28v81.088h67.328c33.92 0 51.296-13.76 52.224-41.248-2.752-25.632-19.68-38.912-50.848-39.84zM217.92 408.224h-1.376l-0.96 7.36c-1.184 7.232-3.168 13.92-5.92 20.128l-34.336 103.04h87.936l-38.464-104.416-2.624-9.024c-1.6-5.888-3.04-11.584-4.256-17.088z m309.184-2.752H465.28v71.456h61.824c29.344-0.928 44.448-13.76 45.376-38.464-0.96-22.016-16.032-32.992-45.376-32.992z" }, null, -1)
|
|
7028
7032
|
])))
|
|
7029
7033
|
}
|
|
@@ -7031,13 +7035,13 @@ const DisplayInlineBlock = /*#__PURE__*/_export_sfc(_sfc_main$T, [['render',_sfc
|
|
|
7031
7035
|
|
|
7032
7036
|
const _sfc_main$S = {};
|
|
7033
7037
|
|
|
7034
|
-
const _hoisted_1$
|
|
7038
|
+
const _hoisted_1$y = {
|
|
7035
7039
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7036
7040
|
viewBox: "0 0 1024 1024"
|
|
7037
7041
|
};
|
|
7038
7042
|
|
|
7039
7043
|
function _sfc_render$9(_ctx, _cache) {
|
|
7040
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7044
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$y, _cache[0] || (_cache[0] = [
|
|
7041
7045
|
createElementVNode("path", { d: "M931.37 477.14c-43.94-69.49-93.39-125.03-147.99-166.35L663.31 441.46c8.79 21.36 13.63 44.91 13.63 69.62 0 96.27-73.84 174.32-164.95 174.32-21.63 0-42.28-4.39-61.32-12.47l-94.09 102.52a455.097 455.097 0 0 0 155.41 26.2c172.62 0 312.43-85.54 419.59-256.63 12.83-20.43 12.72-47.45-0.21-67.88zM795.52 127.99L682.24 252.82C627.73 231 570.1 220.04 512.11 220.5c-171.15 0-310.99 85.66-419.48 256.75-12.93 20.43-13.04 47.33-0.2 67.78 46.95 75.15 100.3 133.68 160.01 175.82L131.9 853.65l38.9 42.36 663.6-725.76-38.88-42.26zM519.68 438.37c-3.72-0.59-7.46-0.81-11.27-0.81-45.63 0-82.43 39.03-82.43 87.16 0 4.97 0.42 9.81 1.14 14.54l-57.15 60.14-5.92 8.33c-13.15-24.94-20.5-53.68-20.5-84.28 0-96.3 73.84-174.45 164.95-174.45 27.2 0 52.76 6.93 75.4 19.29l-64.22 70.08z m52.05 135.53c21.74-23.26 27.17-55.48 16.31-81.39l-96.42 103.16c26.59 9.08 58.38 1.48 80.11-21.77z" }, null, -1)
|
|
7042
7046
|
])))
|
|
7043
7047
|
}
|
|
@@ -7045,13 +7049,13 @@ const DisplayNone = /*#__PURE__*/_export_sfc(_sfc_main$S, [['render',_sfc_render
|
|
|
7045
7049
|
|
|
7046
7050
|
const _sfc_main$R = {};
|
|
7047
7051
|
|
|
7048
|
-
const _hoisted_1$
|
|
7052
|
+
const _hoisted_1$x = {
|
|
7049
7053
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7050
7054
|
viewBox: "0 0 1024 1024"
|
|
7051
7055
|
};
|
|
7052
7056
|
|
|
7053
7057
|
function _sfc_render$8(_ctx, _cache) {
|
|
7054
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7058
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$x, _cache[0] || (_cache[0] = [
|
|
7055
7059
|
createElementVNode("path", { d: "M896 320H128V0h768v320z m0 320H128v-256h768v256z m-128 192l-256 192-256-192 192-0.032V704h128v128h192z" }, null, -1)
|
|
7056
7060
|
])))
|
|
7057
7061
|
}
|
|
@@ -7059,13 +7063,13 @@ const FlexDirectionColumn = /*#__PURE__*/_export_sfc(_sfc_main$R, [['render',_sf
|
|
|
7059
7063
|
|
|
7060
7064
|
const _sfc_main$Q = {};
|
|
7061
7065
|
|
|
7062
|
-
const _hoisted_1$
|
|
7066
|
+
const _hoisted_1$w = {
|
|
7063
7067
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7064
7068
|
viewBox: "0 0 1024 1024"
|
|
7065
7069
|
};
|
|
7066
7070
|
|
|
7067
7071
|
function _sfc_render$7(_ctx, _cache) {
|
|
7068
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7072
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$w, _cache[0] || (_cache[0] = [
|
|
7069
7073
|
createElementVNode("path", { d: "M896 704H128v320h768V704z m0-320H128v256h768v-256z m-128-192l-256-192-256 192 192 0.032V320h128V192h192z" }, null, -1)
|
|
7070
7074
|
])))
|
|
7071
7075
|
}
|
|
@@ -7073,13 +7077,13 @@ const FlexDirectionColumnReverse = /*#__PURE__*/_export_sfc(_sfc_main$Q, [['rend
|
|
|
7073
7077
|
|
|
7074
7078
|
const _sfc_main$P = {};
|
|
7075
7079
|
|
|
7076
|
-
const _hoisted_1$
|
|
7080
|
+
const _hoisted_1$v = {
|
|
7077
7081
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7078
7082
|
viewBox: "0 0 1024 1024"
|
|
7079
7083
|
};
|
|
7080
7084
|
|
|
7081
7085
|
function _sfc_render$6(_ctx, _cache) {
|
|
7082
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7086
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$v, _cache[0] || (_cache[0] = [
|
|
7083
7087
|
createElementVNode("path", { d: "M320 128v768H0V128h320z m320 0v768h-256V128h256z m192 128l192 256-192 256-0.032-192H704v-128h128V256z" }, null, -1)
|
|
7084
7088
|
])))
|
|
7085
7089
|
}
|
|
@@ -7087,13 +7091,13 @@ const FlexDirectionRow = /*#__PURE__*/_export_sfc(_sfc_main$P, [['render',_sfc_r
|
|
|
7087
7091
|
|
|
7088
7092
|
const _sfc_main$O = {};
|
|
7089
7093
|
|
|
7090
|
-
const _hoisted_1$
|
|
7094
|
+
const _hoisted_1$u = {
|
|
7091
7095
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7092
7096
|
viewBox: "0 0 1024 1024"
|
|
7093
7097
|
};
|
|
7094
7098
|
|
|
7095
7099
|
function _sfc_render$5(_ctx, _cache) {
|
|
7096
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7100
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$u, _cache[0] || (_cache[0] = [
|
|
7097
7101
|
createElementVNode("path", { d: "M704 128v768h320V128H704zM384 128v768h256V128h-256zM192 256l-192 256 192 256 0.032-192H320v-128H192V256z" }, null, -1)
|
|
7098
7102
|
])))
|
|
7099
7103
|
}
|
|
@@ -7101,13 +7105,13 @@ const FlexDirectionRowReverse = /*#__PURE__*/_export_sfc(_sfc_main$O, [['render'
|
|
|
7101
7105
|
|
|
7102
7106
|
const _sfc_main$N = {};
|
|
7103
7107
|
|
|
7104
|
-
const _hoisted_1$
|
|
7108
|
+
const _hoisted_1$t = {
|
|
7105
7109
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7106
7110
|
viewBox: "0 0 1024 1024"
|
|
7107
7111
|
};
|
|
7108
7112
|
|
|
7109
7113
|
function _sfc_render$4(_ctx, _cache) {
|
|
7110
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7114
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$t, _cache[0] || (_cache[0] = [
|
|
7111
7115
|
createElementVNode("path", { d: "M480 1024V0h64v1024h-64z m128-64V64h320v896H608zM96 960V64h320v896H96z" }, null, -1)
|
|
7112
7116
|
])))
|
|
7113
7117
|
}
|
|
@@ -7115,13 +7119,13 @@ const JustifyContentCenter = /*#__PURE__*/_export_sfc(_sfc_main$N, [['render',_s
|
|
|
7115
7119
|
|
|
7116
7120
|
const _sfc_main$M = {};
|
|
7117
7121
|
|
|
7118
|
-
const _hoisted_1$
|
|
7122
|
+
const _hoisted_1$s = {
|
|
7119
7123
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7120
7124
|
viewBox: "0 0 1024 1024"
|
|
7121
7125
|
};
|
|
7122
7126
|
|
|
7123
7127
|
function _sfc_render$3(_ctx, _cache) {
|
|
7124
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7128
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$s, _cache[0] || (_cache[0] = [
|
|
7125
7129
|
createElementVNode("path", { d: "M416 160H96v704h320V160z m384 0H480v704h320V160z m128-160h-64v1024h64V0z" }, null, -1)
|
|
7126
7130
|
])))
|
|
7127
7131
|
}
|
|
@@ -7129,13 +7133,13 @@ const JustifyContentFlexEnd = /*#__PURE__*/_export_sfc(_sfc_main$M, [['render',_
|
|
|
7129
7133
|
|
|
7130
7134
|
const _sfc_main$L = {};
|
|
7131
7135
|
|
|
7132
|
-
const _hoisted_1$
|
|
7136
|
+
const _hoisted_1$r = {
|
|
7133
7137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7134
7138
|
viewBox: "0 0 1024 1024"
|
|
7135
7139
|
};
|
|
7136
7140
|
|
|
7137
7141
|
function _sfc_render$2(_ctx, _cache) {
|
|
7138
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7142
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$r, _cache[0] || (_cache[0] = [
|
|
7139
7143
|
createElementVNode("path", { d: "M608 160h320v704H608V160zM224 160h320v704H224V160zM96 0h64v1024H96V0z" }, null, -1)
|
|
7140
7144
|
])))
|
|
7141
7145
|
}
|
|
@@ -7143,13 +7147,13 @@ const JustifyContentFlexStart = /*#__PURE__*/_export_sfc(_sfc_main$L, [['render'
|
|
|
7143
7147
|
|
|
7144
7148
|
const _sfc_main$K = {};
|
|
7145
7149
|
|
|
7146
|
-
const _hoisted_1$
|
|
7150
|
+
const _hoisted_1$q = {
|
|
7147
7151
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7148
7152
|
viewBox: "0 0 1024 1024"
|
|
7149
7153
|
};
|
|
7150
7154
|
|
|
7151
7155
|
function _sfc_render$1(_ctx, _cache) {
|
|
7152
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7156
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$q, _cache[0] || (_cache[0] = [
|
|
7153
7157
|
createElementVNode("path", { d: "M320 864H192v160H128v-160H0V160h128V0h64v160h128v704z m704 0h-128v160h-64v-160h-128V160h128V0h64v160h128v704z" }, null, -1)
|
|
7154
7158
|
])))
|
|
7155
7159
|
}
|
|
@@ -7157,13 +7161,13 @@ const JustifyContentSpaceAround = /*#__PURE__*/_export_sfc(_sfc_main$K, [['rende
|
|
|
7157
7161
|
|
|
7158
7162
|
const _sfc_main$J = {};
|
|
7159
7163
|
|
|
7160
|
-
const _hoisted_1$
|
|
7164
|
+
const _hoisted_1$p = {
|
|
7161
7165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7162
7166
|
viewBox: "0 0 1024 1024"
|
|
7163
7167
|
};
|
|
7164
7168
|
|
|
7165
7169
|
function _sfc_render(_ctx, _cache) {
|
|
7166
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
7170
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1$p, _cache[0] || (_cache[0] = [
|
|
7167
7171
|
createElementVNode("path", { d: "M64 1024H0V0h64v1024z m384-160H128V160h320v704z m448 0H576V160h320v704z m128 160h-64V0h64v1024z" }, null, -1)
|
|
7168
7172
|
])))
|
|
7169
7173
|
}
|
|
@@ -7319,8 +7323,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
7319
7323
|
}
|
|
7320
7324
|
});
|
|
7321
7325
|
|
|
7322
|
-
const _hoisted_1$
|
|
7323
|
-
const _hoisted_2$
|
|
7326
|
+
const _hoisted_1$o = { class: "layout-box-container" };
|
|
7327
|
+
const _hoisted_2$b = { class: "next-input" };
|
|
7324
7328
|
const _hoisted_3$4 = ["onUpdate:modelValue", "title", "onChange"];
|
|
7325
7329
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
7326
7330
|
__name: "Position",
|
|
@@ -7354,13 +7358,13 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
7354
7358
|
});
|
|
7355
7359
|
};
|
|
7356
7360
|
return (_ctx, _cache) => {
|
|
7357
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7361
|
+
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
7358
7362
|
(openBlock(), createElementBlock(Fragment, null, renderList(list, (item, index) => {
|
|
7359
7363
|
return createElementVNode("div", {
|
|
7360
7364
|
key: index,
|
|
7361
7365
|
class: normalizeClass(item.class)
|
|
7362
7366
|
}, [
|
|
7363
|
-
createElementVNode("span", _hoisted_2$
|
|
7367
|
+
createElementVNode("span", _hoisted_2$b, [
|
|
7364
7368
|
withDirectives(createElementVNode("input", {
|
|
7365
7369
|
"onUpdate:modelValue": ($event) => _ctx.model[item.name] = $event,
|
|
7366
7370
|
title: _ctx.model[item.name],
|
|
@@ -7432,8 +7436,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
7432
7436
|
}
|
|
7433
7437
|
});
|
|
7434
7438
|
|
|
7435
|
-
const _hoisted_1$
|
|
7436
|
-
const _hoisted_2$
|
|
7439
|
+
const _hoisted_1$n = { class: "border-box-container" };
|
|
7440
|
+
const _hoisted_2$a = { class: "border-icon-container" };
|
|
7437
7441
|
const _hoisted_3$3 = { class: "border-icon-container-row" };
|
|
7438
7442
|
const _hoisted_4$3 = { class: "border-icon-container-row" };
|
|
7439
7443
|
const _hoisted_5$1 = { class: "border-icon-container-row" };
|
|
@@ -7491,8 +7495,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
7491
7495
|
});
|
|
7492
7496
|
};
|
|
7493
7497
|
return (_ctx, _cache) => {
|
|
7494
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7495
|
-
createElementVNode("div", _hoisted_2$
|
|
7498
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
7499
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
7496
7500
|
createElementVNode("div", _hoisted_3$3, [
|
|
7497
7501
|
createElementVNode("div", {
|
|
7498
7502
|
class: normalizeClass(["border-icon border-icon-top", { active: direction.value === "Top" }]),
|
|
@@ -7572,7 +7576,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
7572
7576
|
}
|
|
7573
7577
|
});
|
|
7574
7578
|
|
|
7575
|
-
const _hoisted_1$
|
|
7579
|
+
const _hoisted_1$m = { class: "m-fields-style-setter" };
|
|
7576
7580
|
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
7577
7581
|
...{
|
|
7578
7582
|
name: "MFieldsStyleSetter"
|
|
@@ -7622,7 +7626,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
7622
7626
|
emit("change", v, eventData);
|
|
7623
7627
|
};
|
|
7624
7628
|
return (_ctx, _cache) => {
|
|
7625
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7629
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
7626
7630
|
createVNode(unref(TMagicCollapse), { "model-value": collapseValue.value }, {
|
|
7627
7631
|
default: withCtx(() => [
|
|
7628
7632
|
(openBlock(), createElementBlock(Fragment, null, renderList(list, (item, index) => {
|
|
@@ -7652,7 +7656,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
7652
7656
|
}
|
|
7653
7657
|
});
|
|
7654
7658
|
|
|
7655
|
-
const _hoisted_1$
|
|
7659
|
+
const _hoisted_1$l = {
|
|
7656
7660
|
key: 1,
|
|
7657
7661
|
class: "m-fields-ui-select",
|
|
7658
7662
|
style: { "display": "flex" }
|
|
@@ -7755,7 +7759,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
7755
7759
|
])),
|
|
7756
7760
|
_: 1
|
|
7757
7761
|
}, 8, ["icon", "disabled", "size"])
|
|
7758
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
7762
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
7759
7763
|
val.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
7760
7764
|
createVNode(unref(TMagicTooltip), {
|
|
7761
7765
|
content: "清除",
|
|
@@ -7830,12 +7834,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
7830
7834
|
emits: ["change"],
|
|
7831
7835
|
setup(__props, { emit: __emit }) {
|
|
7832
7836
|
const emit = __emit;
|
|
7833
|
-
const
|
|
7834
|
-
const { isDragging } = useGetSo(
|
|
7837
|
+
const targetEl = useTemplateRef("target");
|
|
7838
|
+
const { isDragging } = useGetSo(targetEl, emit);
|
|
7835
7839
|
return (_ctx, _cache) => {
|
|
7836
7840
|
return openBlock(), createElementBlock("span", {
|
|
7837
|
-
|
|
7838
|
-
ref: target,
|
|
7841
|
+
ref: "target",
|
|
7839
7842
|
class: normalizeClass(["m-editor-resizer", { "m-editor-resizer-dragging": unref(isDragging) }])
|
|
7840
7843
|
}, [
|
|
7841
7844
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -7864,7 +7867,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
7864
7867
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7865
7868
|
const emit = __emit;
|
|
7866
7869
|
const props = __props;
|
|
7867
|
-
const el = useTemplateRef("
|
|
7870
|
+
const el = useTemplateRef("target");
|
|
7868
7871
|
const hasLeft = computed(() => typeof props.left !== "undefined");
|
|
7869
7872
|
const hasRight = computed(() => typeof props.right !== "undefined");
|
|
7870
7873
|
const center = ref(0);
|
|
@@ -7970,8 +7973,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
7970
7973
|
});
|
|
7971
7974
|
return (_ctx, _cache) => {
|
|
7972
7975
|
return openBlock(), createElementBlock("div", {
|
|
7973
|
-
|
|
7974
|
-
ref: el,
|
|
7976
|
+
ref: "target",
|
|
7975
7977
|
class: "m-editor-layout",
|
|
7976
7978
|
style: normalizeStyle(`min-width: ${props.minCenter + props.minLeft + props.minRight}px`)
|
|
7977
7979
|
}, [
|
|
@@ -8004,11 +8006,11 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
8004
8006
|
}
|
|
8005
8007
|
});
|
|
8006
8008
|
|
|
8007
|
-
const _hoisted_1$
|
|
8009
|
+
const _hoisted_1$k = {
|
|
8008
8010
|
key: 1,
|
|
8009
8011
|
class: "menu-item-text"
|
|
8010
8012
|
};
|
|
8011
|
-
const _hoisted_2$
|
|
8013
|
+
const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
|
|
8012
8014
|
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
8013
8015
|
...{
|
|
8014
8016
|
name: "MEditorToolButton"
|
|
@@ -8080,7 +8082,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
8080
8082
|
_ctx.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
|
|
8081
8083
|
key: 0,
|
|
8082
8084
|
direction: _ctx.data.direction || "vertical"
|
|
8083
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8085
|
+
}, 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 }, [
|
|
8084
8086
|
_ctx.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
8085
8087
|
key: 0,
|
|
8086
8088
|
effect: "dark",
|
|
@@ -8145,7 +8147,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
8145
8147
|
})) : createCommentVNode("", true)
|
|
8146
8148
|
]),
|
|
8147
8149
|
default: withCtx(() => [
|
|
8148
|
-
createElementVNode("span", _hoisted_2$
|
|
8150
|
+
createElementVNode("span", _hoisted_2$9, [
|
|
8149
8151
|
createTextVNode(toDisplayString(_ctx.data.text), 1),
|
|
8150
8152
|
createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
|
|
8151
8153
|
default: withCtx(() => [
|
|
@@ -8162,12 +8164,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
8162
8164
|
}
|
|
8163
8165
|
});
|
|
8164
8166
|
|
|
8165
|
-
const _hoisted_1$
|
|
8167
|
+
const _hoisted_1$j = {
|
|
8166
8168
|
key: 0,
|
|
8167
8169
|
id: "m-editor-page-bar-add-icon",
|
|
8168
8170
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon"
|
|
8169
8171
|
};
|
|
8170
|
-
const _hoisted_2$
|
|
8172
|
+
const _hoisted_2$8 = {
|
|
8171
8173
|
key: 1,
|
|
8172
8174
|
style: { "width": "21px" }
|
|
8173
8175
|
};
|
|
@@ -8193,7 +8195,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
8193
8195
|
editorService.add(pageConfig);
|
|
8194
8196
|
};
|
|
8195
8197
|
return (_ctx, _cache) => {
|
|
8196
|
-
return showAddPageButton.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8198
|
+
return showAddPageButton.value ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
8197
8199
|
createVNode(unref(TMagicPopover), { "popper-class": "data-source-list-panel-add-menu" }, {
|
|
8198
8200
|
reference: withCtx(() => [
|
|
8199
8201
|
createVNode(_sfc_main$1s, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
@@ -8220,11 +8222,20 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
8220
8222
|
]),
|
|
8221
8223
|
_: 1
|
|
8222
8224
|
})
|
|
8223
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
8225
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_2$8));
|
|
8224
8226
|
};
|
|
8225
8227
|
}
|
|
8226
8228
|
});
|
|
8227
8229
|
|
|
8230
|
+
const _hoisted_1$i = {
|
|
8231
|
+
class: "m-editor-page-bar",
|
|
8232
|
+
ref: "pageBar"
|
|
8233
|
+
};
|
|
8234
|
+
const _hoisted_2$7 = {
|
|
8235
|
+
key: 0,
|
|
8236
|
+
class: "m-editor-page-bar-items",
|
|
8237
|
+
ref: "itemsContainer"
|
|
8238
|
+
};
|
|
8228
8239
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
8229
8240
|
...{
|
|
8230
8241
|
name: "MEditorPageBarScrollContainer"
|
|
@@ -8239,33 +8250,33 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8239
8250
|
const services = inject("services");
|
|
8240
8251
|
const editorService = services?.editorService;
|
|
8241
8252
|
const uiService = services?.uiService;
|
|
8242
|
-
const
|
|
8253
|
+
const itemsContainerEl = useTemplateRef("itemsContainer");
|
|
8243
8254
|
const canScroll = ref(false);
|
|
8244
8255
|
const showAddPageButton = computed(() => uiService?.get("showAddPageButton"));
|
|
8245
8256
|
const showPageListButton = computed(() => uiService?.get("showPageListButton"));
|
|
8246
8257
|
const itemsContainerWidth = ref(0);
|
|
8258
|
+
const pageBarEl = useTemplateRef("pageBar");
|
|
8247
8259
|
const setCanScroll = () => {
|
|
8248
|
-
itemsContainerWidth.value = (
|
|
8260
|
+
itemsContainerWidth.value = (pageBarEl.value?.clientWidth || 0) - 37 * 2 - 37 - (showAddPageButton.value ? 37 : 21) - (showPageListButton.value ? 37 : 0);
|
|
8249
8261
|
nextTick(() => {
|
|
8250
|
-
if (
|
|
8251
|
-
canScroll.value =
|
|
8262
|
+
if (itemsContainerEl.value) {
|
|
8263
|
+
canScroll.value = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
8252
8264
|
}
|
|
8253
8265
|
});
|
|
8254
8266
|
};
|
|
8255
8267
|
const resizeObserver = new ResizeObserver(() => {
|
|
8256
8268
|
setCanScroll();
|
|
8257
8269
|
});
|
|
8258
|
-
const pageBar = useTemplateRef("pageBar");
|
|
8259
8270
|
onMounted(() => {
|
|
8260
|
-
|
|
8271
|
+
pageBarEl.value && resizeObserver.observe(pageBarEl.value);
|
|
8261
8272
|
});
|
|
8262
8273
|
onBeforeUnmount(() => {
|
|
8263
8274
|
resizeObserver.disconnect();
|
|
8264
8275
|
});
|
|
8265
8276
|
let translateLeft = 0;
|
|
8266
8277
|
const scroll = (type) => {
|
|
8267
|
-
if (!
|
|
8268
|
-
const maxScrollLeft =
|
|
8278
|
+
if (!itemsContainerEl.value || !canScroll.value) return;
|
|
8279
|
+
const maxScrollLeft = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value;
|
|
8269
8280
|
if (type === "left") {
|
|
8270
8281
|
scrollTo(translateLeft + 200);
|
|
8271
8282
|
} else if (type === "right") {
|
|
@@ -8277,8 +8288,8 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8277
8288
|
}
|
|
8278
8289
|
};
|
|
8279
8290
|
const scrollTo = (value) => {
|
|
8280
|
-
if (!
|
|
8281
|
-
const maxScrollLeft =
|
|
8291
|
+
if (!itemsContainerEl.value || !canScroll.value) return;
|
|
8292
|
+
const maxScrollLeft = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value;
|
|
8282
8293
|
if (value >= 0) {
|
|
8283
8294
|
value = 0;
|
|
8284
8295
|
}
|
|
@@ -8286,7 +8297,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8286
8297
|
value = -maxScrollLeft;
|
|
8287
8298
|
}
|
|
8288
8299
|
translateLeft = value;
|
|
8289
|
-
|
|
8300
|
+
itemsContainerEl.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
8290
8301
|
};
|
|
8291
8302
|
watch(
|
|
8292
8303
|
() => props.length,
|
|
@@ -8345,18 +8356,9 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8345
8356
|
}
|
|
8346
8357
|
});
|
|
8347
8358
|
return (_ctx, _cache) => {
|
|
8348
|
-
return openBlock(), createElementBlock("div",
|
|
8349
|
-
class: "m-editor-page-bar",
|
|
8350
|
-
ref_key: "pageBar",
|
|
8351
|
-
ref: pageBar
|
|
8352
|
-
}, [
|
|
8359
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
8353
8360
|
renderSlot(_ctx.$slots, "prepend"),
|
|
8354
|
-
_ctx.length ? (openBlock(), createElementBlock("div",
|
|
8355
|
-
key: 0,
|
|
8356
|
-
class: "m-editor-page-bar-items",
|
|
8357
|
-
ref_key: "itemsContainer",
|
|
8358
|
-
ref: itemsContainer
|
|
8359
|
-
}, [
|
|
8361
|
+
_ctx.length ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
8360
8362
|
renderSlot(_ctx.$slots, "default")
|
|
8361
8363
|
], 512)) : createCommentVNode("", true),
|
|
8362
8364
|
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -8378,7 +8380,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
8378
8380
|
}
|
|
8379
8381
|
});
|
|
8380
8382
|
|
|
8381
|
-
const _hoisted_1$
|
|
8383
|
+
const _hoisted_1$h = {
|
|
8382
8384
|
key: 0,
|
|
8383
8385
|
id: "m-editor-page-bar-list-icon",
|
|
8384
8386
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon"
|
|
@@ -8401,7 +8403,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8401
8403
|
await editorService?.select(id);
|
|
8402
8404
|
};
|
|
8403
8405
|
return (_ctx, _cache) => {
|
|
8404
|
-
return showPageListButton.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
8406
|
+
return showPageListButton.value ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
8405
8407
|
createVNode(unref(TMagicPopover), {
|
|
8406
8408
|
"popper-class": "page-bar-popover",
|
|
8407
8409
|
placement: "top",
|
|
@@ -8441,7 +8443,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
8441
8443
|
}
|
|
8442
8444
|
});
|
|
8443
8445
|
|
|
8444
|
-
const _hoisted_1$
|
|
8446
|
+
const _hoisted_1$g = { class: "m-editor-page-bar-item m-editor-page-bar-item-icon m-editor-page-bar-search" };
|
|
8445
8447
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
8446
8448
|
__name: "Search",
|
|
8447
8449
|
props: {
|
|
@@ -8480,7 +8482,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
8480
8482
|
emit("search", values);
|
|
8481
8483
|
};
|
|
8482
8484
|
return (_ctx, _cache) => {
|
|
8483
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8485
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
8484
8486
|
createVNode(_sfc_main$1s, {
|
|
8485
8487
|
icon: unref(Search),
|
|
8486
8488
|
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = !visible.value),
|
|
@@ -8505,7 +8507,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
8505
8507
|
}
|
|
8506
8508
|
});
|
|
8507
8509
|
|
|
8508
|
-
const _hoisted_1$
|
|
8510
|
+
const _hoisted_1$f = { class: "m-editor-page-bar-tabs" };
|
|
8509
8511
|
const _hoisted_2$6 = ["data-page-id", "onClick"];
|
|
8510
8512
|
const _hoisted_3$2 = { class: "m-editor-page-bar-title" };
|
|
8511
8513
|
const _hoisted_4$2 = ["title"];
|
|
@@ -8557,38 +8559,37 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
8557
8559
|
const remove = (node) => {
|
|
8558
8560
|
editorService?.remove(node);
|
|
8559
8561
|
};
|
|
8560
|
-
const
|
|
8561
|
-
const
|
|
8562
|
+
const pageBarScrollContainerRef = useTemplateRef("pageBarScrollContainer");
|
|
8563
|
+
const pageBarItemEls = useTemplateRef("pageBarItems");
|
|
8562
8564
|
watch(page, (page2) => {
|
|
8563
|
-
if (!page2 || !
|
|
8565
|
+
if (!page2 || !pageBarScrollContainerRef.value?.itemsContainerWidth || !pageBarItemEls.value || pageBarItemEls.value.length < 2) {
|
|
8564
8566
|
return;
|
|
8565
8567
|
}
|
|
8566
|
-
const firstItem =
|
|
8567
|
-
const lastItem =
|
|
8568
|
+
const firstItem = pageBarItemEls.value[0];
|
|
8569
|
+
const lastItem = pageBarItemEls.value[pageBarItemEls.value.length - 1];
|
|
8568
8570
|
if (page2.id === firstItem.dataset.pageId) {
|
|
8569
|
-
|
|
8571
|
+
pageBarScrollContainerRef.value.scroll("start");
|
|
8570
8572
|
} else if (page2.id === lastItem.dataset.pageId) {
|
|
8571
|
-
|
|
8573
|
+
pageBarScrollContainerRef.value.scroll("end");
|
|
8572
8574
|
} else {
|
|
8573
|
-
const pageItem =
|
|
8575
|
+
const pageItem = pageBarItemEls.value.find((item) => item.dataset.pageId === page2.id);
|
|
8574
8576
|
if (!pageItem) {
|
|
8575
8577
|
return;
|
|
8576
8578
|
}
|
|
8577
8579
|
const pageItemRect = pageItem.getBoundingClientRect();
|
|
8578
8580
|
const offsetLeft = pageItemRect.left - firstItem.getBoundingClientRect().left;
|
|
8579
|
-
const { itemsContainerWidth } =
|
|
8581
|
+
const { itemsContainerWidth } = pageBarScrollContainerRef.value;
|
|
8580
8582
|
const left = itemsContainerWidth - offsetLeft - pageItemRect.width;
|
|
8581
|
-
const translateLeft =
|
|
8583
|
+
const translateLeft = pageBarScrollContainerRef.value.getTranslateLeft();
|
|
8582
8584
|
if (offsetLeft + translateLeft < 0 || offsetLeft + pageItemRect.width > itemsContainerWidth - translateLeft) {
|
|
8583
|
-
|
|
8585
|
+
pageBarScrollContainerRef.value.scrollTo(left);
|
|
8584
8586
|
}
|
|
8585
8587
|
}
|
|
8586
8588
|
});
|
|
8587
8589
|
return (_ctx, _cache) => {
|
|
8588
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8590
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
8589
8591
|
createVNode(_sfc_main$x, {
|
|
8590
|
-
|
|
8591
|
-
ref: pageBarScrollContainer,
|
|
8592
|
+
ref: "pageBarScrollContainer",
|
|
8592
8593
|
"page-bar-sort-options": _ctx.pageBarSortOptions,
|
|
8593
8594
|
length: list.value.length
|
|
8594
8595
|
}, {
|
|
@@ -8612,8 +8613,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
8612
8613
|
return openBlock(), createElementBlock("div", {
|
|
8613
8614
|
class: normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
8614
8615
|
ref_for: true,
|
|
8615
|
-
|
|
8616
|
-
ref: pageBarItems,
|
|
8616
|
+
ref: "pageBarItems",
|
|
8617
8617
|
key: item.id,
|
|
8618
8618
|
"data-page-id": item.id,
|
|
8619
8619
|
onClick: ($event) => switchPage(item.id)
|
|
@@ -8674,7 +8674,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
8674
8674
|
}
|
|
8675
8675
|
});
|
|
8676
8676
|
|
|
8677
|
-
const _hoisted_1$
|
|
8677
|
+
const _hoisted_1$e = { class: "m-editor-empty-panel" };
|
|
8678
8678
|
const _hoisted_2$5 = { class: "m-editor-empty-content" };
|
|
8679
8679
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
8680
8680
|
...{
|
|
@@ -8698,7 +8698,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
8698
8698
|
});
|
|
8699
8699
|
};
|
|
8700
8700
|
return (_ctx, _cache) => {
|
|
8701
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
8701
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
8702
8702
|
createElementVNode("div", _hoisted_2$5, [
|
|
8703
8703
|
createElementVNode("div", {
|
|
8704
8704
|
class: "m-editor-empty-button",
|
|
@@ -8725,6 +8725,11 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
8725
8725
|
}
|
|
8726
8726
|
});
|
|
8727
8727
|
|
|
8728
|
+
const _hoisted_1$d = {
|
|
8729
|
+
class: "m-editor",
|
|
8730
|
+
ref: "content",
|
|
8731
|
+
style: { "min-width": "180px" }
|
|
8732
|
+
};
|
|
8728
8733
|
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
8729
8734
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
8730
8735
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
@@ -8742,8 +8747,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8742
8747
|
setup(__props) {
|
|
8743
8748
|
const codeOptions = inject("codeOptions", {});
|
|
8744
8749
|
const { editorService, uiService } = inject("services") || {};
|
|
8745
|
-
const
|
|
8746
|
-
const
|
|
8750
|
+
const contentEl = useTemplateRef("content");
|
|
8751
|
+
const splitViewRef = useTemplateRef("splitView");
|
|
8747
8752
|
const root = computed(() => editorService?.get("root"));
|
|
8748
8753
|
const page = computed(() => editorService?.get("page"));
|
|
8749
8754
|
const pageLength = computed(() => editorService?.get("pageLength") || 0);
|
|
@@ -8756,7 +8761,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8756
8761
|
right: getRightColumnWidthCacheData()
|
|
8757
8762
|
});
|
|
8758
8763
|
watch(pageLength, () => {
|
|
8759
|
-
|
|
8764
|
+
splitViewRef.value?.updateWidth();
|
|
8760
8765
|
});
|
|
8761
8766
|
watch(
|
|
8762
8767
|
() => uiService?.get("hideSlideBar"),
|
|
@@ -8781,8 +8786,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8781
8786
|
});
|
|
8782
8787
|
});
|
|
8783
8788
|
onMounted(() => {
|
|
8784
|
-
if (
|
|
8785
|
-
resizerObserver.observe(
|
|
8789
|
+
if (contentEl.value) {
|
|
8790
|
+
resizerObserver.observe(contentEl.value);
|
|
8786
8791
|
}
|
|
8787
8792
|
});
|
|
8788
8793
|
onBeforeUnmount(() => {
|
|
@@ -8797,12 +8802,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8797
8802
|
}
|
|
8798
8803
|
};
|
|
8799
8804
|
return (_ctx, _cache) => {
|
|
8800
|
-
return openBlock(), createElementBlock("div",
|
|
8801
|
-
class: "m-editor",
|
|
8802
|
-
ref_key: "content",
|
|
8803
|
-
ref: content,
|
|
8804
|
-
style: { "min-width": "180px" }
|
|
8805
|
-
}, [
|
|
8805
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
8806
8806
|
renderSlot(_ctx.$slots, "header"),
|
|
8807
8807
|
renderSlot(_ctx.$slots, "nav"),
|
|
8808
8808
|
renderSlot(_ctx.$slots, "content-before"),
|
|
@@ -8815,8 +8815,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8815
8815
|
}, null, 8, ["init-values", "options"])
|
|
8816
8816
|
]) : (openBlock(), createBlock(_sfc_main$A, {
|
|
8817
8817
|
key: 1,
|
|
8818
|
-
|
|
8819
|
-
ref: splitView,
|
|
8818
|
+
ref: "splitView",
|
|
8820
8819
|
class: "m-editor-content",
|
|
8821
8820
|
"left-class": "m-editor-framework-left",
|
|
8822
8821
|
"center-class": "m-editor-framework-center",
|
|
@@ -9027,8 +9026,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
9027
9026
|
});
|
|
9028
9027
|
return data;
|
|
9029
9028
|
});
|
|
9029
|
+
const navMenuEl = useTemplateRef("navMenu");
|
|
9030
9030
|
const resizeObserver = new ResizeObserver(() => {
|
|
9031
|
-
const rect =
|
|
9031
|
+
const rect = navMenuEl.value?.getBoundingClientRect();
|
|
9032
9032
|
if (rect) {
|
|
9033
9033
|
uiService?.set("navMenuRect", {
|
|
9034
9034
|
left: rect.left,
|
|
@@ -9038,9 +9038,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
9038
9038
|
});
|
|
9039
9039
|
}
|
|
9040
9040
|
});
|
|
9041
|
-
const navMenu = useTemplateRef("navMenu");
|
|
9042
9041
|
onMounted(() => {
|
|
9043
|
-
|
|
9042
|
+
navMenuEl.value && resizeObserver.observe(navMenuEl.value);
|
|
9044
9043
|
});
|
|
9045
9044
|
onBeforeUnmount(() => {
|
|
9046
9045
|
resizeObserver.disconnect();
|
|
@@ -9049,8 +9048,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
9049
9048
|
return openBlock(), createElementBlock("div", {
|
|
9050
9049
|
class: "m-editor-nav-menu",
|
|
9051
9050
|
style: normalizeStyle({ height: `${_ctx.height}px` }),
|
|
9052
|
-
|
|
9053
|
-
ref: navMenu
|
|
9051
|
+
ref: "navMenu"
|
|
9054
9052
|
}, [
|
|
9055
9053
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys), (key) => {
|
|
9056
9054
|
return openBlock(), createElementBlock("div", {
|
|
@@ -9071,7 +9069,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
9071
9069
|
}
|
|
9072
9070
|
});
|
|
9073
9071
|
|
|
9074
|
-
const _hoisted_1$
|
|
9072
|
+
const _hoisted_1$c = { class: "m-editor-props-form-panel" };
|
|
9075
9073
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
9076
9074
|
...{
|
|
9077
9075
|
name: "MEditorFormPanel"
|
|
@@ -9096,11 +9094,11 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
9096
9094
|
const propsPanelSize = computed(() => services?.uiService.get("propsPanelSize") || "small");
|
|
9097
9095
|
const { height: editorContentHeight } = useEditorContentHeight();
|
|
9098
9096
|
const stage = computed(() => services?.editorService.get("stage"));
|
|
9099
|
-
const
|
|
9097
|
+
const configFormRef = useTemplateRef("configForm");
|
|
9100
9098
|
watchEffect(() => {
|
|
9101
|
-
if (
|
|
9102
|
-
|
|
9103
|
-
|
|
9099
|
+
if (configFormRef.value) {
|
|
9100
|
+
configFormRef.value.formState.stage = stage.value;
|
|
9101
|
+
configFormRef.value.formState.services = services;
|
|
9104
9102
|
}
|
|
9105
9103
|
});
|
|
9106
9104
|
const internalInstance = getCurrentInstance();
|
|
@@ -9109,7 +9107,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
9109
9107
|
});
|
|
9110
9108
|
const submit = async (v, eventData) => {
|
|
9111
9109
|
try {
|
|
9112
|
-
const values = await
|
|
9110
|
+
const values = await configFormRef.value?.submitForm();
|
|
9113
9111
|
emit("submit", values, eventData);
|
|
9114
9112
|
} catch (e) {
|
|
9115
9113
|
emit("submit-error", e);
|
|
@@ -9121,15 +9119,14 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
9121
9119
|
const saveCode = (values) => {
|
|
9122
9120
|
emit("submit", props.codeValueKey ? { [props.codeValueKey]: values } : values);
|
|
9123
9121
|
};
|
|
9124
|
-
__expose({ configForm, submit });
|
|
9122
|
+
__expose({ configForm: configFormRef, submit });
|
|
9125
9123
|
return (_ctx, _cache) => {
|
|
9126
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
9124
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
9127
9125
|
renderSlot(_ctx.$slots, "props-form-panel-header"),
|
|
9128
9126
|
createVNode(unref(TMagicScrollbar), null, {
|
|
9129
9127
|
default: withCtx(() => [
|
|
9130
9128
|
createVNode(unref(MForm), {
|
|
9131
|
-
|
|
9132
|
-
ref: configForm,
|
|
9129
|
+
ref: "configForm",
|
|
9133
9130
|
class: normalizeClass(propsPanelSize.value),
|
|
9134
9131
|
"popper-class": `m-editor-props-panel-popper ${propsPanelSize.value}`,
|
|
9135
9132
|
"label-width": _ctx.labelWidth,
|
|
@@ -9195,7 +9192,7 @@ const useStylePanel = (services) => {
|
|
|
9195
9192
|
};
|
|
9196
9193
|
};
|
|
9197
9194
|
|
|
9198
|
-
const _hoisted_1$
|
|
9195
|
+
const _hoisted_1$b = {
|
|
9199
9196
|
ref: "propsPanel",
|
|
9200
9197
|
class: "m-editor-props-panel"
|
|
9201
9198
|
};
|
|
@@ -9261,8 +9258,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
9261
9258
|
const errorHandler = (e) => {
|
|
9262
9259
|
emit("form-error", e);
|
|
9263
9260
|
};
|
|
9264
|
-
const mountedHandler = (
|
|
9265
|
-
|
|
9261
|
+
const mountedHandler = () => {
|
|
9262
|
+
if (propertyFormPanelRef.value) {
|
|
9263
|
+
emit("mounted", propertyFormPanelRef.value);
|
|
9264
|
+
}
|
|
9266
9265
|
};
|
|
9267
9266
|
const propsPanelEl = useTemplateRef("propsPanel");
|
|
9268
9267
|
const widthChange = ({ deltaX }) => {
|
|
@@ -9283,7 +9282,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
9283
9282
|
submit
|
|
9284
9283
|
});
|
|
9285
9284
|
return (_ctx, _cache) => {
|
|
9286
|
-
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
9285
|
+
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
9287
9286
|
renderSlot(_ctx.$slots, "props-panel-header"),
|
|
9288
9287
|
createVNode(_sfc_main$q, {
|
|
9289
9288
|
ref: "propertyFormPanel",
|
|
@@ -9367,9 +9366,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9367
9366
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9368
9367
|
const props = __props;
|
|
9369
9368
|
const emit = __emit;
|
|
9370
|
-
const
|
|
9371
|
-
const
|
|
9372
|
-
const
|
|
9369
|
+
const menuEl = useTemplateRef("menu");
|
|
9370
|
+
const buttonRefs = useTemplateRef("buttons");
|
|
9371
|
+
const subMenuRef = useTemplateRef("subMenu");
|
|
9373
9372
|
const visible = ref(false);
|
|
9374
9373
|
const subMenuData = ref([]);
|
|
9375
9374
|
const zIndex = useZIndex();
|
|
@@ -9383,11 +9382,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9383
9382
|
left: `${menuPosition.value.left + 2}px`,
|
|
9384
9383
|
zIndex: curZIndex.value
|
|
9385
9384
|
}));
|
|
9386
|
-
const contains = (el) =>
|
|
9385
|
+
const contains = (el) => menuEl.value?.contains(el) || subMenuRef.value?.contains(el);
|
|
9387
9386
|
const hide = () => {
|
|
9388
9387
|
if (!visible.value) return;
|
|
9389
9388
|
visible.value = false;
|
|
9390
|
-
|
|
9389
|
+
subMenuRef.value?.hide();
|
|
9391
9390
|
emit("hide");
|
|
9392
9391
|
};
|
|
9393
9392
|
const clickHandler = (event) => {
|
|
@@ -9408,7 +9407,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9408
9407
|
hide();
|
|
9409
9408
|
};
|
|
9410
9409
|
const setPosition = (e) => {
|
|
9411
|
-
const menuHeight =
|
|
9410
|
+
const menuHeight = menuEl.value?.clientHeight || 0;
|
|
9412
9411
|
let top = e.clientY;
|
|
9413
9412
|
if (menuHeight + e.clientY > document.body.clientHeight) {
|
|
9414
9413
|
top = document.body.clientHeight - menuHeight;
|
|
@@ -9436,14 +9435,14 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9436
9435
|
if (!visible.value) {
|
|
9437
9436
|
return;
|
|
9438
9437
|
}
|
|
9439
|
-
if (
|
|
9440
|
-
let y =
|
|
9441
|
-
if (
|
|
9442
|
-
const rect =
|
|
9438
|
+
if (menuEl.value) {
|
|
9439
|
+
let y = menuEl.value.offsetTop;
|
|
9440
|
+
if (buttonRefs.value?.[index].$el) {
|
|
9441
|
+
const rect = buttonRefs.value?.[index].$el.getBoundingClientRect();
|
|
9443
9442
|
y = rect.top;
|
|
9444
9443
|
}
|
|
9445
|
-
|
|
9446
|
-
clientX:
|
|
9444
|
+
subMenuRef.value?.show({
|
|
9445
|
+
clientX: menuEl.value.offsetLeft + menuEl.value.clientWidth - 2,
|
|
9447
9446
|
clientY: y
|
|
9448
9447
|
});
|
|
9449
9448
|
}
|
|
@@ -9461,7 +9460,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9461
9460
|
globalThis.removeEventListener("mousedown", outsideClickHideHandler, true);
|
|
9462
9461
|
});
|
|
9463
9462
|
__expose({
|
|
9464
|
-
menu,
|
|
9463
|
+
menu: menuEl,
|
|
9465
9464
|
menuPosition,
|
|
9466
9465
|
hide,
|
|
9467
9466
|
show,
|
|
@@ -9474,8 +9473,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9474
9473
|
default: withCtx(() => [
|
|
9475
9474
|
withDirectives(createElementVNode("div", {
|
|
9476
9475
|
class: "magic-editor-content-menu",
|
|
9477
|
-
|
|
9478
|
-
ref: menu,
|
|
9476
|
+
ref: "menu",
|
|
9479
9477
|
style: normalizeStyle(menuStyle.value),
|
|
9480
9478
|
onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseenterHandler()),
|
|
9481
9479
|
onContextmenu: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
@@ -9487,8 +9485,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9487
9485
|
return openBlock(), createBlock(_sfc_main$z, {
|
|
9488
9486
|
"event-type": "mouseup",
|
|
9489
9487
|
ref_for: true,
|
|
9490
|
-
|
|
9491
|
-
ref: buttons,
|
|
9488
|
+
ref: "buttons",
|
|
9492
9489
|
class: normalizeClass({ active: _ctx.active && item.id === _ctx.active }),
|
|
9493
9490
|
data: item,
|
|
9494
9491
|
key: index,
|
|
@@ -9501,8 +9498,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
9501
9498
|
subMenuData.value.length ? (openBlock(), createBlock(_component_content_menu, {
|
|
9502
9499
|
key: 0,
|
|
9503
9500
|
class: "sub-menu",
|
|
9504
|
-
|
|
9505
|
-
ref: subMenu,
|
|
9501
|
+
ref: "subMenu",
|
|
9506
9502
|
active: _ctx.active,
|
|
9507
9503
|
"menu-data": subMenuData.value,
|
|
9508
9504
|
"is-sub-menu": true,
|
|
@@ -9560,7 +9556,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
9560
9556
|
}
|
|
9561
9557
|
});
|
|
9562
9558
|
|
|
9563
|
-
const _hoisted_1$
|
|
9559
|
+
const _hoisted_1$a = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
|
|
9564
9560
|
const _hoisted_2$3 = { class: "tree-node-label" };
|
|
9565
9561
|
const _hoisted_3$1 = { class: "tree-node-tool" };
|
|
9566
9562
|
const _hoisted_4$1 = {
|
|
@@ -9686,14 +9682,14 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
9686
9682
|
}, 1032, ["data", "parent", "parentsId", "node-status-map", "indent"]);
|
|
9687
9683
|
}), 128))
|
|
9688
9684
|
])) : createCommentVNode("", true)
|
|
9689
|
-
], 40, _hoisted_1$
|
|
9685
|
+
], 40, _hoisted_1$a)), [
|
|
9690
9686
|
[vShow, visible.value]
|
|
9691
9687
|
]);
|
|
9692
9688
|
};
|
|
9693
9689
|
}
|
|
9694
9690
|
});
|
|
9695
9691
|
|
|
9696
|
-
const _hoisted_1$
|
|
9692
|
+
const _hoisted_1$9 = {
|
|
9697
9693
|
key: 1,
|
|
9698
9694
|
class: "m-editor-tree-empty"
|
|
9699
9695
|
};
|
|
@@ -9740,7 +9736,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
9740
9736
|
]),
|
|
9741
9737
|
_: 2
|
|
9742
9738
|
}, 1032, ["data", "indent", "next-level-indent-increment", "node-status-map"]);
|
|
9743
|
-
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
9739
|
+
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
9744
9740
|
createElementVNode("p", null, toDisplayString(_ctx.emptyText), 1)
|
|
9745
9741
|
]))
|
|
9746
9742
|
], 32);
|
|
@@ -9991,7 +9987,7 @@ const useContentMenu$1 = (deleteCode) => {
|
|
|
9991
9987
|
};
|
|
9992
9988
|
};
|
|
9993
9989
|
|
|
9994
|
-
const _hoisted_1$
|
|
9990
|
+
const _hoisted_1$8 = { class: "search-wrapper" };
|
|
9995
9991
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
9996
9992
|
...{
|
|
9997
9993
|
name: "MEditorCodeBlockListPanel"
|
|
@@ -10009,9 +10005,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10009
10005
|
const { codeBlockService } = inject("services") || {};
|
|
10010
10006
|
const editable = computed(() => codeBlockService?.getEditStatus());
|
|
10011
10007
|
const { codeBlockEditor, codeConfig, editCode, deleteCode, createCodeBlock, submitCodeBlockHandler } = useCodeBlockEdit(codeBlockService);
|
|
10012
|
-
const
|
|
10008
|
+
const codeBlockListRef = useTemplateRef("codeBlockList");
|
|
10013
10009
|
const filterTextChangeHandler = (val) => {
|
|
10014
|
-
|
|
10010
|
+
codeBlockListRef.value?.filter(val);
|
|
10015
10011
|
};
|
|
10016
10012
|
eventBus?.on("edit-code", (id) => {
|
|
10017
10013
|
editCode(id);
|
|
@@ -10021,7 +10017,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10021
10017
|
menuData: contentMenuData,
|
|
10022
10018
|
contentMenuHideHandler
|
|
10023
10019
|
} = useContentMenu$1((id) => {
|
|
10024
|
-
|
|
10020
|
+
codeBlockListRef.value?.deleteCode(id);
|
|
10025
10021
|
});
|
|
10026
10022
|
const menuData = computed(() => props.customContentMenu(contentMenuData, "code-block"));
|
|
10027
10023
|
return (_ctx, _cache) => {
|
|
@@ -10029,7 +10025,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10029
10025
|
createVNode(unref(TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
10030
10026
|
default: withCtx(() => [
|
|
10031
10027
|
renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
10032
|
-
createElementVNode("div", _hoisted_1$
|
|
10028
|
+
createElementVNode("div", _hoisted_1$8, [
|
|
10033
10029
|
createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
10034
10030
|
editable.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
10035
10031
|
key: 0,
|
|
@@ -10047,8 +10043,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
10047
10043
|
])
|
|
10048
10044
|
]),
|
|
10049
10045
|
createVNode(_sfc_main$k, {
|
|
10050
|
-
|
|
10051
|
-
ref: codeBlockList,
|
|
10046
|
+
ref: "codeBlockList",
|
|
10052
10047
|
"custom-error": _ctx.customError,
|
|
10053
10048
|
indent: _ctx.indent,
|
|
10054
10049
|
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
@@ -10427,7 +10422,7 @@ const useContentMenu = () => {
|
|
|
10427
10422
|
};
|
|
10428
10423
|
};
|
|
10429
10424
|
|
|
10430
|
-
const _hoisted_1$
|
|
10425
|
+
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
10431
10426
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
10432
10427
|
...{
|
|
10433
10428
|
name: "MEditorDataSourceListPanel"
|
|
@@ -10490,7 +10485,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
10490
10485
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
10491
10486
|
createVNode(unref(TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
10492
10487
|
default: withCtx(() => [
|
|
10493
|
-
createElementVNode("div", _hoisted_1$
|
|
10488
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
10494
10489
|
createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
10495
10490
|
unref(editable) ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
10496
10491
|
key: 0,
|
|
@@ -10562,7 +10557,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
10562
10557
|
}
|
|
10563
10558
|
});
|
|
10564
10559
|
|
|
10565
|
-
const _hoisted_1$
|
|
10560
|
+
const _hoisted_1$6 = {
|
|
10566
10561
|
width: "1em",
|
|
10567
10562
|
height: "1em",
|
|
10568
10563
|
viewBox: "0 0 16 16",
|
|
@@ -10577,7 +10572,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
10577
10572
|
__name: "FolderMinusIcon",
|
|
10578
10573
|
setup(__props) {
|
|
10579
10574
|
return (_ctx, _cache) => {
|
|
10580
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
10575
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [
|
|
10581
10576
|
createElementVNode("path", {
|
|
10582
10577
|
"fill-rule": "evenodd",
|
|
10583
10578
|
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"
|
|
@@ -10675,7 +10670,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
10675
10670
|
const props = __props;
|
|
10676
10671
|
const emit = __emit;
|
|
10677
10672
|
const services = inject("services");
|
|
10678
|
-
const
|
|
10673
|
+
const menuRef = useTemplateRef("menu");
|
|
10679
10674
|
const node = computed(() => services?.editorService.get("node"));
|
|
10680
10675
|
const nodes = computed(() => services?.editorService.get("nodes"));
|
|
10681
10676
|
const componentList = computed(() => services?.componentListService.getList() || []);
|
|
@@ -10751,7 +10746,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
10751
10746
|
)
|
|
10752
10747
|
);
|
|
10753
10748
|
const show = (e) => {
|
|
10754
|
-
|
|
10749
|
+
menuRef.value?.show(e);
|
|
10755
10750
|
};
|
|
10756
10751
|
__expose({
|
|
10757
10752
|
show
|
|
@@ -10759,8 +10754,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
10759
10754
|
return (_ctx, _cache) => {
|
|
10760
10755
|
return openBlock(), createBlock(_sfc_main$o, {
|
|
10761
10756
|
"menu-data": menuData.value,
|
|
10762
|
-
|
|
10763
|
-
ref: menu,
|
|
10757
|
+
ref: "menu",
|
|
10764
10758
|
style: { "overflow": "initial" }
|
|
10765
10759
|
}, null, 8, ["menu-data"]);
|
|
10766
10760
|
};
|
|
@@ -10802,7 +10796,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
10802
10796
|
}
|
|
10803
10797
|
});
|
|
10804
10798
|
|
|
10805
|
-
const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
10799
|
+
const useClick = (services, isCtrlKeyDown, nodeStatusMap, menuRef) => {
|
|
10806
10800
|
const isMultiSelect = computed(() => isCtrlKeyDown.value && !services?.editorService.get("disabledMultiSelect"));
|
|
10807
10801
|
const select = async (data) => {
|
|
10808
10802
|
if (!data.id) {
|
|
@@ -10867,9 +10861,8 @@ const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
|
10867
10861
|
select(data);
|
|
10868
10862
|
});
|
|
10869
10863
|
};
|
|
10870
|
-
const menu = useTemplateRef("menu");
|
|
10871
10864
|
return {
|
|
10872
|
-
|
|
10865
|
+
menuRef,
|
|
10873
10866
|
nodeClickHandler,
|
|
10874
10867
|
nodeContentMenuHandler(event, data) {
|
|
10875
10868
|
event.preventDefault();
|
|
@@ -10877,7 +10870,7 @@ const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
|
10877
10870
|
if (nodes.length < 2 || !nodes.includes(data)) {
|
|
10878
10871
|
nodeClickHandler(event, data);
|
|
10879
10872
|
}
|
|
10880
|
-
|
|
10873
|
+
menuRef.value?.show(event);
|
|
10881
10874
|
},
|
|
10882
10875
|
highlightHandler
|
|
10883
10876
|
};
|
|
@@ -11278,11 +11271,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
11278
11271
|
setup(__props) {
|
|
11279
11272
|
const services = inject("services");
|
|
11280
11273
|
const editorService = services?.editorService;
|
|
11281
|
-
const
|
|
11274
|
+
const treeRef = useTemplateRef("tree");
|
|
11282
11275
|
const page = computed(() => editorService?.get("page"));
|
|
11283
11276
|
const nodeData = computed(() => !page.value ? [] : [page.value]);
|
|
11284
11277
|
const { nodeStatusMap } = useNodeStatus(services);
|
|
11285
|
-
const { isCtrlKeyDown } = useKeybinding(services,
|
|
11278
|
+
const { isCtrlKeyDown } = useKeybinding(services, treeRef);
|
|
11286
11279
|
const filterNodeMethod = (v, data) => {
|
|
11287
11280
|
let name = "";
|
|
11288
11281
|
if (data.name) {
|
|
@@ -11304,12 +11297,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
11304
11297
|
}
|
|
11305
11298
|
};
|
|
11306
11299
|
const { handleDragStart, handleDragEnd, handleDragLeave, handleDragOver } = useDrag(services);
|
|
11300
|
+
const menuRef = useTemplateRef("menu");
|
|
11307
11301
|
const {
|
|
11308
|
-
menu,
|
|
11309
11302
|
nodeClickHandler,
|
|
11310
11303
|
nodeContentMenuHandler,
|
|
11311
11304
|
highlightHandler: mouseenterHandler
|
|
11312
|
-
} = useClick(services, isCtrlKeyDown, nodeStatusMap);
|
|
11305
|
+
} = useClick(services, isCtrlKeyDown, nodeStatusMap, menuRef);
|
|
11313
11306
|
return (_ctx, _cache) => {
|
|
11314
11307
|
return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
11315
11308
|
default: withCtx(() => [
|
|
@@ -11318,8 +11311,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
11318
11311
|
page.value && unref(nodeStatusMap) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
11319
11312
|
key: 0,
|
|
11320
11313
|
tabindex: "-1",
|
|
11321
|
-
|
|
11322
|
-
ref: tree,
|
|
11314
|
+
ref: "tree",
|
|
11323
11315
|
data: nodeData.value,
|
|
11324
11316
|
"node-status-map": unref(nodeStatusMap),
|
|
11325
11317
|
indent: _ctx.indent,
|
|
@@ -11347,8 +11339,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
11347
11339
|
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : createCommentVNode("", true),
|
|
11348
11340
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
11349
11341
|
createVNode(_sfc_main$e, {
|
|
11350
|
-
|
|
11351
|
-
ref: menu,
|
|
11342
|
+
ref: "menu",
|
|
11352
11343
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
11353
11344
|
"custom-content-menu": _ctx.customContentMenu,
|
|
11354
11345
|
onCollapseAll: collapseAllHandler
|
|
@@ -11361,7 +11352,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
11361
11352
|
}
|
|
11362
11353
|
});
|
|
11363
11354
|
|
|
11364
|
-
const _hoisted_1$
|
|
11355
|
+
const _hoisted_1$5 = ["onClick", "onDragstart"];
|
|
11365
11356
|
const _hoisted_2$2 = ["title"];
|
|
11366
11357
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
11367
11358
|
...{
|
|
@@ -11482,7 +11473,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11482
11473
|
title: item.text
|
|
11483
11474
|
}, toDisplayString(item.text), 9, _hoisted_2$2)
|
|
11484
11475
|
])
|
|
11485
|
-
], 40, _hoisted_1$
|
|
11476
|
+
], 40, _hoisted_1$5);
|
|
11486
11477
|
}), 128))
|
|
11487
11478
|
]),
|
|
11488
11479
|
_: 2
|
|
@@ -11500,7 +11491,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11500
11491
|
}
|
|
11501
11492
|
});
|
|
11502
11493
|
|
|
11503
|
-
const _hoisted_1$
|
|
11494
|
+
const _hoisted_1$4 = {
|
|
11504
11495
|
key: 0,
|
|
11505
11496
|
class: "m-editor-sidebar"
|
|
11506
11497
|
};
|
|
@@ -11650,7 +11641,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
11650
11641
|
});
|
|
11651
11642
|
return (_ctx, _cache) => {
|
|
11652
11643
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
11653
|
-
_ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
11644
|
+
_ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
11654
11645
|
createElementVNode("div", _hoisted_2$1, [
|
|
11655
11646
|
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
11656
11647
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
@@ -11855,8 +11846,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11855
11846
|
setup(__props, { emit: __emit }) {
|
|
11856
11847
|
const props = __props;
|
|
11857
11848
|
const emit = __emit;
|
|
11858
|
-
const
|
|
11859
|
-
const
|
|
11849
|
+
const barEl = useTemplateRef("bar");
|
|
11850
|
+
const thumbEl = useTemplateRef("thumb");
|
|
11860
11851
|
const thumbSize = computed(() => props.size * (props.size / props.scrollSize));
|
|
11861
11852
|
const thumbPos = computed(() => props.pos / props.scrollSize * props.size);
|
|
11862
11853
|
const thumbStyle = computed(() => ({
|
|
@@ -11865,9 +11856,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11865
11856
|
}));
|
|
11866
11857
|
let gesto;
|
|
11867
11858
|
onMounted(() => {
|
|
11868
|
-
if (!
|
|
11869
|
-
|
|
11870
|
-
gesto = new Gesto(thumbEl, {
|
|
11859
|
+
if (!thumbEl.value) return;
|
|
11860
|
+
gesto = new Gesto(thumbEl.value, {
|
|
11871
11861
|
container: window
|
|
11872
11862
|
});
|
|
11873
11863
|
gesto.on("dragStart", (e) => {
|
|
@@ -11876,11 +11866,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11876
11866
|
}).on("drag", (e) => {
|
|
11877
11867
|
scrollBy(getDelta(e));
|
|
11878
11868
|
});
|
|
11879
|
-
|
|
11869
|
+
barEl.value?.addEventListener("wheel", wheelHandler, false);
|
|
11880
11870
|
});
|
|
11881
11871
|
onBeforeUnmount(() => {
|
|
11882
11872
|
if (gesto) gesto.off();
|
|
11883
|
-
|
|
11873
|
+
barEl.value?.removeEventListener("wheel", wheelHandler, false);
|
|
11884
11874
|
});
|
|
11885
11875
|
const wheelHandler = (e) => {
|
|
11886
11876
|
const delta = props.isHorizontal ? e.deltaX : e.deltaY;
|
|
@@ -11911,13 +11901,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11911
11901
|
};
|
|
11912
11902
|
return (_ctx, _cache) => {
|
|
11913
11903
|
return openBlock(), createElementBlock("div", {
|
|
11914
|
-
|
|
11915
|
-
ref: bar,
|
|
11904
|
+
ref: "bar",
|
|
11916
11905
|
class: normalizeClass(["m-editor-scroll-bar", _ctx.isHorizontal ? "horizontal" : "vertical"])
|
|
11917
11906
|
}, [
|
|
11918
11907
|
createElementVNode("div", {
|
|
11919
|
-
|
|
11920
|
-
ref: thumb,
|
|
11908
|
+
ref: "thumb",
|
|
11921
11909
|
class: "m-editor-scroll-bar-thumb",
|
|
11922
11910
|
style: normalizeStyle(thumbStyle.value)
|
|
11923
11911
|
}, null, 4)
|
|
@@ -11926,6 +11914,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
11926
11914
|
}
|
|
11927
11915
|
});
|
|
11928
11916
|
|
|
11917
|
+
const _hoisted_1$3 = {
|
|
11918
|
+
class: "m-editor-scroll-viewer-container",
|
|
11919
|
+
ref: "container"
|
|
11920
|
+
};
|
|
11929
11921
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
11930
11922
|
...{
|
|
11931
11923
|
name: "MEditorScrollViewer"
|
|
@@ -11944,8 +11936,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
11944
11936
|
},
|
|
11945
11937
|
setup(__props, { expose: __expose }) {
|
|
11946
11938
|
const props = __props;
|
|
11947
|
-
const
|
|
11948
|
-
const el = useTemplateRef("
|
|
11939
|
+
const containerEl = useTemplateRef("container");
|
|
11940
|
+
const el = useTemplateRef("target");
|
|
11949
11941
|
const style = computed(
|
|
11950
11942
|
() => `
|
|
11951
11943
|
width: ${isNumber(`${props.width}`) ? `${props.width}px` : props.width};
|
|
@@ -11958,9 +11950,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
11958
11950
|
const scrollHeight = ref(0);
|
|
11959
11951
|
let scrollViewer;
|
|
11960
11952
|
onMounted(() => {
|
|
11961
|
-
if (!
|
|
11953
|
+
if (!containerEl.value || !el.value) return;
|
|
11962
11954
|
scrollViewer = new ScrollViewer({
|
|
11963
|
-
container:
|
|
11955
|
+
container: containerEl.value,
|
|
11964
11956
|
target: el.value,
|
|
11965
11957
|
zoom: props.zoom,
|
|
11966
11958
|
correctionScrollSize: props.correctionScrollSize
|
|
@@ -11996,17 +11988,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
11996
11988
|
});
|
|
11997
11989
|
};
|
|
11998
11990
|
__expose({
|
|
11999
|
-
container
|
|
11991
|
+
container: containerEl
|
|
12000
11992
|
});
|
|
12001
11993
|
return (_ctx, _cache) => {
|
|
12002
|
-
return openBlock(), createElementBlock("div",
|
|
12003
|
-
class: "m-editor-scroll-viewer-container",
|
|
12004
|
-
ref_key: "container",
|
|
12005
|
-
ref: container
|
|
12006
|
-
}, [
|
|
11994
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
12007
11995
|
createElementVNode("div", {
|
|
12008
|
-
|
|
12009
|
-
ref: el,
|
|
11996
|
+
ref: "target",
|
|
12010
11997
|
style: normalizeStyle(style.value)
|
|
12011
11998
|
}, [
|
|
12012
11999
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -12039,8 +12026,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
12039
12026
|
const editorService = services?.editorService;
|
|
12040
12027
|
const visible = ref(false);
|
|
12041
12028
|
const buttonVisible = ref(false);
|
|
12042
|
-
const
|
|
12043
|
-
const
|
|
12029
|
+
const buttonEl = useTemplateRef("button");
|
|
12030
|
+
const boxRef = useTemplateRef("box");
|
|
12044
12031
|
const stage = computed(() => editorService?.get("stage"));
|
|
12045
12032
|
const page = computed(() => editorService?.get("page"));
|
|
12046
12033
|
const nodes = computed(() => editorService?.get("nodes") || []);
|
|
@@ -12085,12 +12072,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
12085
12072
|
top: 0
|
|
12086
12073
|
});
|
|
12087
12074
|
watch(visible, async (visible2) => {
|
|
12088
|
-
if (!
|
|
12075
|
+
if (!buttonEl.value || !visible2) {
|
|
12089
12076
|
return;
|
|
12090
12077
|
}
|
|
12091
12078
|
await nextTick();
|
|
12092
|
-
const rect =
|
|
12093
|
-
const height =
|
|
12079
|
+
const rect = buttonEl.value.getBoundingClientRect();
|
|
12080
|
+
const height = boxRef.value?.target?.clientHeight || 0;
|
|
12094
12081
|
menuPosition.value = {
|
|
12095
12082
|
left: rect.left + rect.width + 5,
|
|
12096
12083
|
top: rect.top - height / 2 + rect.height / 2
|
|
@@ -12104,8 +12091,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
12104
12091
|
}, {
|
|
12105
12092
|
default: withCtx(() => [
|
|
12106
12093
|
createElementVNode("div", {
|
|
12107
|
-
|
|
12108
|
-
ref: button,
|
|
12094
|
+
ref: "button",
|
|
12109
12095
|
class: "m-editor-stage-float-button",
|
|
12110
12096
|
onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true)
|
|
12111
12097
|
}, "可选组件", 512)
|
|
@@ -12114,8 +12100,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
12114
12100
|
})) : createCommentVNode("", true),
|
|
12115
12101
|
page.value && unref(nodeStatusMap) && buttonVisible.value ? (openBlock(), createBlock(_sfc_main$1k, {
|
|
12116
12102
|
key: 1,
|
|
12117
|
-
|
|
12118
|
-
ref: box,
|
|
12103
|
+
ref: "box",
|
|
12119
12104
|
visible: visible.value,
|
|
12120
12105
|
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
|
|
12121
12106
|
title: "当前位置下的组件",
|
|
@@ -12141,7 +12126,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
12141
12126
|
setup(__props) {
|
|
12142
12127
|
const services = inject("services");
|
|
12143
12128
|
const stageOptions = inject("stageOptions");
|
|
12144
|
-
const
|
|
12129
|
+
const stageOverlayEl = useTemplateRef("stageOverlay");
|
|
12145
12130
|
const stageOverlayVisible = computed(() => services?.stageOverlayService.get("stageOverlayVisible"));
|
|
12146
12131
|
const wrapWidth = computed(() => services?.stageOverlayService.get("wrapWidth") || 0);
|
|
12147
12132
|
const wrapHeight = computed(() => services?.stageOverlayService.get("wrapHeight") || 0);
|
|
@@ -12160,12 +12145,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
12160
12145
|
services?.stageOverlayService.closeOverlay();
|
|
12161
12146
|
}
|
|
12162
12147
|
});
|
|
12163
|
-
watch(
|
|
12148
|
+
watch(stageOverlayEl, (stageOverlay) => {
|
|
12164
12149
|
if (!services) return;
|
|
12165
12150
|
const subStage = services.stageOverlayService.createStage(stageOptions);
|
|
12166
12151
|
services?.stageOverlayService.set("stage", subStage);
|
|
12167
|
-
if (
|
|
12168
|
-
subStage.mount(
|
|
12152
|
+
if (stageOverlay && subStage) {
|
|
12153
|
+
subStage.mount(stageOverlay);
|
|
12169
12154
|
const { mask, renderer } = subStage;
|
|
12170
12155
|
const { contentWindow } = renderer;
|
|
12171
12156
|
mask?.showRule(false);
|
|
@@ -12197,8 +12182,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
12197
12182
|
_: 1
|
|
12198
12183
|
}),
|
|
12199
12184
|
createElementVNode("div", {
|
|
12200
|
-
|
|
12201
|
-
ref: stageOverlay,
|
|
12185
|
+
ref: "stageOverlay",
|
|
12202
12186
|
class: "m-editor-stage-overlay-container",
|
|
12203
12187
|
style: normalizeStyle(style.value),
|
|
12204
12188
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
@@ -12262,7 +12246,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
12262
12246
|
const props = __props;
|
|
12263
12247
|
const services = inject("services");
|
|
12264
12248
|
const editorService = services?.editorService;
|
|
12265
|
-
const
|
|
12249
|
+
const menuRef = useTemplateRef("menu");
|
|
12266
12250
|
const canCenter = ref(false);
|
|
12267
12251
|
const node = computed(() => editorService?.get("node"));
|
|
12268
12252
|
const nodes = computed(() => editorService?.get("nodes"));
|
|
@@ -12281,7 +12265,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
12281
12265
|
}
|
|
12282
12266
|
},
|
|
12283
12267
|
useCopyMenu(),
|
|
12284
|
-
usePasteMenu(
|
|
12268
|
+
usePasteMenu(menuRef),
|
|
12285
12269
|
{
|
|
12286
12270
|
type: "divider",
|
|
12287
12271
|
direction: "horizontal",
|
|
@@ -12363,14 +12347,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
12363
12347
|
{ immediate: true }
|
|
12364
12348
|
);
|
|
12365
12349
|
const show = (e) => {
|
|
12366
|
-
|
|
12350
|
+
menuRef.value?.show(e);
|
|
12367
12351
|
};
|
|
12368
12352
|
__expose({ show });
|
|
12369
12353
|
return (_ctx, _cache) => {
|
|
12370
12354
|
return openBlock(), createBlock(_sfc_main$o, {
|
|
12371
12355
|
"menu-data": menuData.value,
|
|
12372
|
-
|
|
12373
|
-
ref: menu
|
|
12356
|
+
ref: "menu"
|
|
12374
12357
|
}, null, 8, ["menu-data"]);
|
|
12375
12358
|
};
|
|
12376
12359
|
}
|
|
@@ -12393,9 +12376,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12393
12376
|
let runtime = null;
|
|
12394
12377
|
const services = inject("services");
|
|
12395
12378
|
const stageLoading = computed(() => services?.editorService.get("stageLoading") || false);
|
|
12396
|
-
const
|
|
12397
|
-
const
|
|
12398
|
-
const
|
|
12379
|
+
const stageWrapRef = useTemplateRef("stageWrap");
|
|
12380
|
+
const stageContainerEl = useTemplateRef("stageContainer");
|
|
12381
|
+
const menuRef = useTemplateRef("menu");
|
|
12399
12382
|
const nodes = computed(() => services?.editorService.get("nodes") || []);
|
|
12400
12383
|
const isMultiSelect = computed(() => nodes.value.length > 1);
|
|
12401
12384
|
const stageRect = computed(() => services?.uiService.get("stageRect"));
|
|
@@ -12406,14 +12389,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12406
12389
|
const node = computed(() => services?.editorService.get("node"));
|
|
12407
12390
|
watchEffect(() => {
|
|
12408
12391
|
if (stage || !page.value) return;
|
|
12409
|
-
if (!
|
|
12392
|
+
if (!stageContainerEl.value) return;
|
|
12410
12393
|
if (!(props.stageOptions?.runtimeUrl || props.stageOptions?.render) || !root.value) return;
|
|
12411
12394
|
stage = useStage(props.stageOptions);
|
|
12412
12395
|
stage.on("select", () => {
|
|
12413
|
-
|
|
12396
|
+
stageWrapRef.value?.container?.focus();
|
|
12414
12397
|
});
|
|
12415
12398
|
services?.editorService.set("stage", markRaw(stage));
|
|
12416
|
-
stage.mount(
|
|
12399
|
+
stage.mount(stageContainerEl.value);
|
|
12417
12400
|
if (!node.value?.id) {
|
|
12418
12401
|
return;
|
|
12419
12402
|
}
|
|
@@ -12466,9 +12449,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12466
12449
|
}
|
|
12467
12450
|
});
|
|
12468
12451
|
onMounted(() => {
|
|
12469
|
-
if (
|
|
12470
|
-
resizeObserver.observe(
|
|
12471
|
-
services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE,
|
|
12452
|
+
if (stageWrapRef.value?.container) {
|
|
12453
|
+
resizeObserver.observe(stageWrapRef.value.container);
|
|
12454
|
+
services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrapRef.value.container);
|
|
12472
12455
|
}
|
|
12473
12456
|
});
|
|
12474
12457
|
onBeforeUnmount(() => {
|
|
@@ -12481,7 +12464,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12481
12464
|
const parseDSL = getEditorConfig("parseDSL");
|
|
12482
12465
|
const contextmenuHandler = (e) => {
|
|
12483
12466
|
e.preventDefault();
|
|
12484
|
-
|
|
12467
|
+
menuRef.value?.show(e);
|
|
12485
12468
|
};
|
|
12486
12469
|
const dragoverHandler = (e) => {
|
|
12487
12470
|
if (!e.dataTransfer) return;
|
|
@@ -12504,9 +12487,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12504
12487
|
if (parentId) {
|
|
12505
12488
|
parent = services?.editorService.getNodeById(parentId, false);
|
|
12506
12489
|
}
|
|
12507
|
-
if (parent &&
|
|
12490
|
+
if (parent && stageContainerEl.value && stage) {
|
|
12508
12491
|
const layout = await services?.editorService.getLayout(parent);
|
|
12509
|
-
const containerRect =
|
|
12492
|
+
const containerRect = stageContainerEl.value.getBoundingClientRect();
|
|
12510
12493
|
const { scrollTop, scrollLeft } = stage.mask;
|
|
12511
12494
|
const { style = {} } = config.data;
|
|
12512
12495
|
let top = 0;
|
|
@@ -12540,8 +12523,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12540
12523
|
const _directive_loading = resolveDirective("loading");
|
|
12541
12524
|
return withDirectives((openBlock(), createBlock(_sfc_main$8, {
|
|
12542
12525
|
class: "m-editor-stage",
|
|
12543
|
-
|
|
12544
|
-
ref: stageWrap,
|
|
12526
|
+
ref: "stageWrap",
|
|
12545
12527
|
tabindex: "-1",
|
|
12546
12528
|
"element-loading-text": "Runtime 加载中...",
|
|
12547
12529
|
width: stageRect.value?.width,
|
|
@@ -12553,14 +12535,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12553
12535
|
width: 60,
|
|
12554
12536
|
height: 50
|
|
12555
12537
|
},
|
|
12556
|
-
onClick: _cache[0] || (_cache[0] = ($event) => unref(
|
|
12538
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(stageWrapRef)?.container?.focus())
|
|
12557
12539
|
}, {
|
|
12558
12540
|
content: withCtx(() => [
|
|
12559
12541
|
!_ctx.disabledStageOverlay ? (openBlock(), createBlock(_sfc_main$6, { key: 0 })) : createCommentVNode("", true),
|
|
12560
12542
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
12561
12543
|
createVNode(_sfc_main$4, {
|
|
12562
|
-
|
|
12563
|
-
ref: menu,
|
|
12544
|
+
ref: "menu",
|
|
12564
12545
|
"is-multi-select": isMultiSelect.value,
|
|
12565
12546
|
"stage-content-menu": _ctx.stageContentMenu,
|
|
12566
12547
|
"custom-content-menu": _ctx.customContentMenu
|
|
@@ -12570,8 +12551,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
12570
12551
|
default: withCtx(() => [
|
|
12571
12552
|
createElementVNode("div", {
|
|
12572
12553
|
class: "m-editor-stage-container",
|
|
12573
|
-
|
|
12574
|
-
ref: stageContainer,
|
|
12554
|
+
ref: "stageContainer",
|
|
12575
12555
|
style: normalizeStyle(`transform: scale(${zoom.value});`),
|
|
12576
12556
|
onContextmenu: contextmenuHandler,
|
|
12577
12557
|
onDrop: dropHandler,
|
|
@@ -12912,7 +12892,7 @@ class CodeBlock extends BaseService {
|
|
|
12912
12892
|
const codeBlockService = new CodeBlock();
|
|
12913
12893
|
|
|
12914
12894
|
class ComponentList extends BaseService {
|
|
12915
|
-
state =
|
|
12895
|
+
state = shallowReactive({
|
|
12916
12896
|
list: []
|
|
12917
12897
|
});
|
|
12918
12898
|
constructor() {
|
|
@@ -13093,7 +13073,7 @@ const dataSourceService = new DataSource();
|
|
|
13093
13073
|
|
|
13094
13074
|
const idleTask = new IdleTask();
|
|
13095
13075
|
class Dep extends BaseService {
|
|
13096
|
-
state =
|
|
13076
|
+
state = shallowReactive({
|
|
13097
13077
|
collecting: false
|
|
13098
13078
|
});
|
|
13099
13079
|
watcher = new Watcher({ initialTargets: reactive({}) });
|
|
@@ -13135,6 +13115,7 @@ class Dep extends BaseService {
|
|
|
13135
13115
|
});
|
|
13136
13116
|
this.set("collecting", false);
|
|
13137
13117
|
this.emit("collected", nodes, deep);
|
|
13118
|
+
this.emit("ds-collected", nodes, deep);
|
|
13138
13119
|
}
|
|
13139
13120
|
collectIdle(nodes, depExtendedData = {}, deep = false, type) {
|
|
13140
13121
|
this.set("collecting", true);
|
|
@@ -13153,17 +13134,20 @@ class Dep extends BaseService {
|
|
|
13153
13134
|
idleTask.once("finish", () => {
|
|
13154
13135
|
this.emit("collected", nodes, deep);
|
|
13155
13136
|
this.set("collecting", false);
|
|
13137
|
+
});
|
|
13138
|
+
idleTask.once("hight-level-finish", () => {
|
|
13139
|
+
this.emit("ds-collected", nodes, deep);
|
|
13156
13140
|
resolve();
|
|
13157
13141
|
});
|
|
13158
13142
|
});
|
|
13159
13143
|
}
|
|
13160
13144
|
collectNode(node, target, depExtendedData = {}, deep = false) {
|
|
13161
13145
|
if (isPage(node)) {
|
|
13162
|
-
Object.entries(target.deps)
|
|
13146
|
+
for (const [depKey, dep] of Object.entries(target.deps)) {
|
|
13163
13147
|
if (dep.data?.pageId && dep.data.pageId === depExtendedData.pageId) {
|
|
13164
13148
|
delete target.deps[depKey];
|
|
13165
13149
|
}
|
|
13166
|
-
}
|
|
13150
|
+
}
|
|
13167
13151
|
} else {
|
|
13168
13152
|
this.watcher.removeTargetDep(target, node);
|
|
13169
13153
|
}
|
|
@@ -13202,7 +13186,8 @@ class Dep extends BaseService {
|
|
|
13202
13186
|
node,
|
|
13203
13187
|
deep: false,
|
|
13204
13188
|
target
|
|
13205
|
-
}
|
|
13189
|
+
},
|
|
13190
|
+
target.type === DepTargetType.DATA_SOURCE
|
|
13206
13191
|
);
|
|
13207
13192
|
if (deep && Array.isArray(node.items) && node.items.length) {
|
|
13208
13193
|
node.items.forEach((item) => {
|
|
@@ -13449,7 +13434,7 @@ const canUsePluginMethods = {
|
|
|
13449
13434
|
sync: ["openOverlay", "closeOverlay", "updateOverlay", "createStage"]
|
|
13450
13435
|
};
|
|
13451
13436
|
class StageOverlay extends BaseService {
|
|
13452
|
-
state =
|
|
13437
|
+
state = shallowReactive({
|
|
13453
13438
|
wrapDiv: document.createElement("div"),
|
|
13454
13439
|
sourceEl: null,
|
|
13455
13440
|
contentEl: null,
|
|
@@ -13692,10 +13677,12 @@ const initServiceState = (props, {
|
|
|
13692
13677
|
(eventMethodList) => {
|
|
13693
13678
|
const eventsList = {};
|
|
13694
13679
|
const methodsList = {};
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13680
|
+
if (eventMethodList) {
|
|
13681
|
+
for (const type of Object.keys(eventMethodList)) {
|
|
13682
|
+
eventsList[type] = eventMethodList[type].events;
|
|
13683
|
+
methodsList[type] = eventMethodList[type].methods;
|
|
13684
|
+
}
|
|
13685
|
+
}
|
|
13699
13686
|
eventsService.setEvents(eventsList);
|
|
13700
13687
|
eventsService.setMethods(methodsList);
|
|
13701
13688
|
},
|
|
@@ -13706,9 +13693,12 @@ const initServiceState = (props, {
|
|
|
13706
13693
|
watch(
|
|
13707
13694
|
() => props.datasourceConfigs,
|
|
13708
13695
|
(configs) => {
|
|
13709
|
-
|
|
13696
|
+
if (!configs) {
|
|
13697
|
+
return;
|
|
13698
|
+
}
|
|
13699
|
+
for (const [key, value] of Object.entries(configs)) {
|
|
13710
13700
|
dataSourceService.setFormConfig(key, value);
|
|
13711
|
-
}
|
|
13701
|
+
}
|
|
13712
13702
|
},
|
|
13713
13703
|
{
|
|
13714
13704
|
immediate: true
|
|
@@ -13717,9 +13707,12 @@ const initServiceState = (props, {
|
|
|
13717
13707
|
watch(
|
|
13718
13708
|
() => props.datasourceValues,
|
|
13719
13709
|
(values) => {
|
|
13720
|
-
|
|
13710
|
+
if (!values) {
|
|
13711
|
+
return;
|
|
13712
|
+
}
|
|
13713
|
+
for (const [key, value] of Object.entries(values)) {
|
|
13721
13714
|
dataSourceService.setFormValue(key, value);
|
|
13722
|
-
}
|
|
13715
|
+
}
|
|
13723
13716
|
},
|
|
13724
13717
|
{
|
|
13725
13718
|
immediate: true
|
|
@@ -13730,16 +13723,18 @@ const initServiceState = (props, {
|
|
|
13730
13723
|
(eventMethodList) => {
|
|
13731
13724
|
const eventsList = {};
|
|
13732
13725
|
const methodsList = {};
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13726
|
+
if (eventMethodList) {
|
|
13727
|
+
for (const type of Object.keys(eventMethodList)) {
|
|
13728
|
+
eventsList[type] = eventMethodList[type].events;
|
|
13729
|
+
methodsList[type] = eventMethodList[type].methods;
|
|
13730
|
+
}
|
|
13731
|
+
}
|
|
13732
|
+
for (const [key, value] of Object.entries(eventsList)) {
|
|
13738
13733
|
dataSourceService.setFormEvent(key, value);
|
|
13739
|
-
}
|
|
13740
|
-
|
|
13734
|
+
}
|
|
13735
|
+
for (const [key, value] of Object.entries(methodsList)) {
|
|
13741
13736
|
dataSourceService.setFormMethod(key, value);
|
|
13742
|
-
}
|
|
13737
|
+
}
|
|
13743
13738
|
},
|
|
13744
13739
|
{
|
|
13745
13740
|
immediate: true
|
|
@@ -13770,6 +13765,91 @@ const initServiceState = (props, {
|
|
|
13770
13765
|
});
|
|
13771
13766
|
};
|
|
13772
13767
|
const initServiceEvents = (props, emit, { editorService, codeBlockService, dataSourceService, depService }) => {
|
|
13768
|
+
const getTMagicApp = () => {
|
|
13769
|
+
const renderer = editorService.get("stage")?.renderer;
|
|
13770
|
+
if (!renderer) {
|
|
13771
|
+
return void 0;
|
|
13772
|
+
}
|
|
13773
|
+
if (renderer.runtime) {
|
|
13774
|
+
return renderer.runtime.getApp?.();
|
|
13775
|
+
}
|
|
13776
|
+
return new Promise((resolve) => {
|
|
13777
|
+
const timeout = globalThis.setTimeout(() => {
|
|
13778
|
+
resolve(void 0);
|
|
13779
|
+
}, 1e4);
|
|
13780
|
+
renderer.on("runtime-ready", () => {
|
|
13781
|
+
if (timeout) {
|
|
13782
|
+
globalThis.clearTimeout(timeout);
|
|
13783
|
+
}
|
|
13784
|
+
resolve(renderer.runtime?.getApp?.());
|
|
13785
|
+
});
|
|
13786
|
+
});
|
|
13787
|
+
};
|
|
13788
|
+
const updateStageNodes = (nodes) => {
|
|
13789
|
+
for (const node of nodes) {
|
|
13790
|
+
updateStageNode(node);
|
|
13791
|
+
}
|
|
13792
|
+
};
|
|
13793
|
+
const updateStageNode = (node) => {
|
|
13794
|
+
const root = editorService.get("root");
|
|
13795
|
+
if (!root) return;
|
|
13796
|
+
return editorService.get("stage")?.update({
|
|
13797
|
+
config: cloneDeep(node),
|
|
13798
|
+
parentId: editorService.getParentById(node.id)?.id,
|
|
13799
|
+
root: cloneDeep(root)
|
|
13800
|
+
});
|
|
13801
|
+
};
|
|
13802
|
+
const updateDataSourceSchema = async () => {
|
|
13803
|
+
const root = editorService.get("root");
|
|
13804
|
+
const app = await getTMagicApp();
|
|
13805
|
+
if (!app || !root) {
|
|
13806
|
+
return;
|
|
13807
|
+
}
|
|
13808
|
+
if (app.dsl) {
|
|
13809
|
+
app.dsl.dataSources = root.dataSources;
|
|
13810
|
+
}
|
|
13811
|
+
if (root.dataSources) {
|
|
13812
|
+
app.dataSourceManager?.updateSchema(root.dataSources);
|
|
13813
|
+
}
|
|
13814
|
+
};
|
|
13815
|
+
const dsDepCollectedHandler = async () => {
|
|
13816
|
+
const root = editorService.get("root");
|
|
13817
|
+
const app = await getTMagicApp();
|
|
13818
|
+
if (root && app?.dsl) {
|
|
13819
|
+
app.dsl.dataSourceDeps = root.dataSourceDeps;
|
|
13820
|
+
}
|
|
13821
|
+
};
|
|
13822
|
+
const collectIdle = (nodes, deep, type) => Promise.all(
|
|
13823
|
+
nodes.map((node) => {
|
|
13824
|
+
let pageId;
|
|
13825
|
+
if (isPage(node)) {
|
|
13826
|
+
pageId = node.id;
|
|
13827
|
+
} else {
|
|
13828
|
+
const info = editorService.getNodeInfo(node.id);
|
|
13829
|
+
pageId = info.page?.id;
|
|
13830
|
+
}
|
|
13831
|
+
return depService.collectIdle([node], { pageId }, deep, type);
|
|
13832
|
+
})
|
|
13833
|
+
);
|
|
13834
|
+
watch(
|
|
13835
|
+
() => editorService.get("stage"),
|
|
13836
|
+
(stage) => {
|
|
13837
|
+
if (!stage) {
|
|
13838
|
+
return;
|
|
13839
|
+
}
|
|
13840
|
+
stage.on("rerender", async () => {
|
|
13841
|
+
const node = editorService.get("node");
|
|
13842
|
+
if (!node) return;
|
|
13843
|
+
await collectIdle([node], true, DepTargetType.DATA_SOURCE);
|
|
13844
|
+
updateStageNode(node);
|
|
13845
|
+
});
|
|
13846
|
+
}
|
|
13847
|
+
);
|
|
13848
|
+
const initDataSourceDepTarget = (ds) => {
|
|
13849
|
+
depService.addTarget(createDataSourceTarget(ds, reactive({})));
|
|
13850
|
+
depService.addTarget(createDataSourceMethodTarget(ds, reactive({})));
|
|
13851
|
+
depService.addTarget(createDataSourceCondTarget(ds, reactive({})));
|
|
13852
|
+
};
|
|
13773
13853
|
const rootChangeHandler = async (value, preValue) => {
|
|
13774
13854
|
if (!value) return;
|
|
13775
13855
|
value.codeBlocks = value.codeBlocks || {};
|
|
@@ -13777,15 +13857,17 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
13777
13857
|
codeBlockService.setCodeDsl(value.codeBlocks);
|
|
13778
13858
|
dataSourceService.set("dataSources", value.dataSources);
|
|
13779
13859
|
depService.removeTargets(DepTargetType.CODE_BLOCK);
|
|
13780
|
-
Object.entries(value.codeBlocks)
|
|
13860
|
+
for (const [id, code] of Object.entries(value.codeBlocks)) {
|
|
13781
13861
|
depService.addTarget(createCodeBlockTarget(id, code));
|
|
13782
|
-
}
|
|
13783
|
-
dataSourceService.get("dataSources")
|
|
13862
|
+
}
|
|
13863
|
+
for (const ds of dataSourceService.get("dataSources")) {
|
|
13784
13864
|
initDataSourceDepTarget(ds);
|
|
13785
|
-
}
|
|
13865
|
+
}
|
|
13786
13866
|
if (Array.isArray(value.items)) {
|
|
13787
13867
|
depService.clearIdleTasks();
|
|
13788
|
-
collectIdle(value.items, true)
|
|
13868
|
+
collectIdle(value.items, true).then(() => {
|
|
13869
|
+
updateStageNodes(value.items);
|
|
13870
|
+
});
|
|
13789
13871
|
} else {
|
|
13790
13872
|
depService.clear();
|
|
13791
13873
|
delete value.dataSourceDeps;
|
|
@@ -13809,188 +13891,83 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
13809
13891
|
emit("update:modelValue", value);
|
|
13810
13892
|
}
|
|
13811
13893
|
};
|
|
13812
|
-
const
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
return;
|
|
13816
|
-
}
|
|
13817
|
-
stage2.on("rerender", () => {
|
|
13818
|
-
const node = editorService.get("node");
|
|
13819
|
-
if (!node) return;
|
|
13820
|
-
collectIdle([node], true).then(() => {
|
|
13821
|
-
afterUpdateNodes([node]);
|
|
13822
|
-
});
|
|
13823
|
-
});
|
|
13824
|
-
});
|
|
13825
|
-
const getApp = () => stage.value?.renderer?.runtime?.getApp?.();
|
|
13826
|
-
const updateDataSourceSchema = (nodes, deep) => {
|
|
13827
|
-
const root = editorService.get("root");
|
|
13828
|
-
const app = getApp();
|
|
13829
|
-
if (root && app?.dsl) {
|
|
13830
|
-
app.dsl.dataSourceDeps = root.dataSourceDeps;
|
|
13831
|
-
app.dsl.dataSourceCondDeps = root.dataSourceCondDeps;
|
|
13832
|
-
app.dsl.dataSources = root.dataSources;
|
|
13833
|
-
}
|
|
13834
|
-
if (root?.dataSources) {
|
|
13835
|
-
getApp()?.dataSourceManager?.updateSchema(root.dataSources);
|
|
13836
|
-
}
|
|
13837
|
-
if (!root || !stage.value) return;
|
|
13838
|
-
const allNodes = [];
|
|
13839
|
-
if (deep) {
|
|
13840
|
-
nodes.forEach((node) => {
|
|
13841
|
-
traverseNode(node, (node2) => {
|
|
13842
|
-
if (!allNodes.includes(node2)) {
|
|
13843
|
-
allNodes.push(node2);
|
|
13844
|
-
}
|
|
13845
|
-
});
|
|
13846
|
-
});
|
|
13847
|
-
} else {
|
|
13848
|
-
allNodes.push(...nodes);
|
|
13849
|
-
}
|
|
13850
|
-
const deps = Object.values(root.dataSourceDeps || {});
|
|
13851
|
-
deps.forEach((dep) => {
|
|
13852
|
-
Object.keys(dep).forEach((id) => {
|
|
13853
|
-
const node = allNodes.find((node2) => node2.id === id);
|
|
13854
|
-
node && stage.value?.update({
|
|
13855
|
-
config: cloneDeep(node),
|
|
13856
|
-
parentId: editorService.getParentById(node.id)?.id,
|
|
13857
|
-
root: cloneDeep(root)
|
|
13858
|
-
});
|
|
13859
|
-
});
|
|
13860
|
-
});
|
|
13861
|
-
};
|
|
13862
|
-
const afterUpdateNodes = (nodes) => {
|
|
13863
|
-
const root = editorService.get("root");
|
|
13864
|
-
if (!root) return;
|
|
13865
|
-
for (const node of nodes) {
|
|
13866
|
-
stage.value?.update({
|
|
13867
|
-
config: cloneDeep(node),
|
|
13868
|
-
parentId: editorService.getParentById(node.id)?.id,
|
|
13869
|
-
root: cloneDeep(root)
|
|
13870
|
-
});
|
|
13871
|
-
}
|
|
13872
|
-
};
|
|
13873
|
-
const targetAddHandler = (target) => {
|
|
13874
|
-
const root = editorService.get("root");
|
|
13875
|
-
if (!root) return;
|
|
13876
|
-
if (target.type === DepTargetType.DATA_SOURCE) {
|
|
13877
|
-
if (!root.dataSourceDeps) {
|
|
13878
|
-
root.dataSourceDeps = {};
|
|
13879
|
-
}
|
|
13880
|
-
root.dataSourceDeps[target.id] = target.deps;
|
|
13881
|
-
}
|
|
13882
|
-
if (target.type === DepTargetType.DATA_SOURCE_COND) {
|
|
13883
|
-
if (!root.dataSourceCondDeps) {
|
|
13884
|
-
root.dataSourceCondDeps = {};
|
|
13885
|
-
}
|
|
13886
|
-
root.dataSourceCondDeps[target.id] = target.deps;
|
|
13887
|
-
}
|
|
13888
|
-
};
|
|
13889
|
-
const targetRemoveHandler = (id) => {
|
|
13890
|
-
const root = editorService.get("root");
|
|
13891
|
-
if (!root) return;
|
|
13892
|
-
if (root.dataSourceDeps) {
|
|
13893
|
-
delete root.dataSourceDeps[id];
|
|
13894
|
-
}
|
|
13895
|
-
if (root.dataSourceCondDeps) {
|
|
13896
|
-
delete root.dataSourceCondDeps[id];
|
|
13897
|
-
}
|
|
13898
|
-
};
|
|
13899
|
-
const depCollectedHandler = () => {
|
|
13900
|
-
const root = editorService.get("root");
|
|
13901
|
-
if (!root) return;
|
|
13902
|
-
const app = getApp();
|
|
13903
|
-
if (app?.dsl) {
|
|
13904
|
-
app.dsl.dataSourceDeps = root.dataSourceDeps;
|
|
13905
|
-
}
|
|
13906
|
-
};
|
|
13907
|
-
depService.on("add-target", targetAddHandler);
|
|
13908
|
-
depService.on("remove-target", targetRemoveHandler);
|
|
13909
|
-
depService.on("collected", depCollectedHandler);
|
|
13910
|
-
const initDataSourceDepTarget = (ds) => {
|
|
13911
|
-
depService.addTarget(createDataSourceTarget(ds, reactive({})));
|
|
13912
|
-
depService.addTarget(createDataSourceMethodTarget(ds, reactive({})));
|
|
13913
|
-
depService.addTarget(createDataSourceCondTarget(ds, reactive({})));
|
|
13914
|
-
};
|
|
13915
|
-
const collectIdle = (nodes, deep) => Promise.all(
|
|
13916
|
-
nodes.map((node) => {
|
|
13917
|
-
let pageId;
|
|
13918
|
-
if (isPage(node)) {
|
|
13919
|
-
pageId = node.id;
|
|
13920
|
-
} else {
|
|
13921
|
-
const info = editorService.getNodeInfo(node.id);
|
|
13922
|
-
pageId = info.page?.id;
|
|
13923
|
-
}
|
|
13924
|
-
return depService.collectIdle([node], { pageId }, deep);
|
|
13925
|
-
})
|
|
13926
|
-
);
|
|
13927
|
-
const nodeAddHandler = (nodes) => {
|
|
13928
|
-
collectIdle(nodes, true).then(() => {
|
|
13929
|
-
afterUpdateNodes(nodes);
|
|
13930
|
-
});
|
|
13894
|
+
const nodeAddHandler = async (nodes) => {
|
|
13895
|
+
await collectIdle(nodes, true);
|
|
13896
|
+
updateStageNodes(nodes);
|
|
13931
13897
|
};
|
|
13932
|
-
const nodeUpdateHandler = (data) => {
|
|
13898
|
+
const nodeUpdateHandler = async (data) => {
|
|
13933
13899
|
const needRecollectNodes = [];
|
|
13934
13900
|
const normalNodes = [];
|
|
13935
|
-
|
|
13901
|
+
for (const { newNode, oldNode, changeRecords } of data) {
|
|
13936
13902
|
if (changeRecords?.length) {
|
|
13937
|
-
for (const record of changeRecords) {
|
|
13938
|
-
if (!record.propPath
|
|
13903
|
+
forChangeRecords: for (const record of changeRecords) {
|
|
13904
|
+
if (!record.propPath) {
|
|
13939
13905
|
needRecollectNodes.push(newNode);
|
|
13940
|
-
|
|
13941
|
-
|
|
13906
|
+
break forChangeRecords;
|
|
13907
|
+
}
|
|
13908
|
+
if (new RegExp(`${NODE_CONDS_KEY}.(\\d)+.cond`).test(record.propPath) || new RegExp(`${NODE_CONDS_KEY}.(\\d)+.cond.(\\d)+.value`).test(record.propPath) || record.propPath === NODE_CONDS_KEY || isValueIncludeDataSource(record.value)) {
|
|
13909
|
+
needRecollectNodes.push(newNode);
|
|
13910
|
+
break forChangeRecords;
|
|
13911
|
+
}
|
|
13912
|
+
for (const target of Object.values(depService.getTargets(DepTargetType.DATA_SOURCE))) {
|
|
13913
|
+
if (!target.deps[newNode.id]) {
|
|
13914
|
+
continue;
|
|
13915
|
+
}
|
|
13916
|
+
if (target.deps[newNode.id].keys.includes(record.propPath)) {
|
|
13917
|
+
needRecollectNodes.push(newNode);
|
|
13918
|
+
break forChangeRecords;
|
|
13919
|
+
}
|
|
13942
13920
|
}
|
|
13921
|
+
normalNodes.push(newNode);
|
|
13943
13922
|
}
|
|
13944
13923
|
} else if (isIncludeDataSource(newNode, oldNode)) {
|
|
13945
13924
|
needRecollectNodes.push(newNode);
|
|
13946
13925
|
} else {
|
|
13947
13926
|
normalNodes.push(newNode);
|
|
13948
13927
|
}
|
|
13949
|
-
}
|
|
13928
|
+
}
|
|
13950
13929
|
if (needRecollectNodes.length) {
|
|
13951
|
-
collectIdle(needRecollectNodes, true
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
} else
|
|
13955
|
-
|
|
13930
|
+
await collectIdle(needRecollectNodes, true, DepTargetType.DATA_SOURCE);
|
|
13931
|
+
await collectIdle(needRecollectNodes, true, DepTargetType.DATA_SOURCE_COND);
|
|
13932
|
+
updateStageNodes(needRecollectNodes);
|
|
13933
|
+
} else {
|
|
13934
|
+
updateStageNodes(normalNodes);
|
|
13935
|
+
Promise.all([
|
|
13936
|
+
collectIdle(normalNodes, true, DepTargetType.CODE_BLOCK),
|
|
13937
|
+
collectIdle(normalNodes, true, DepTargetType.DATA_SOURCE_METHOD)
|
|
13938
|
+
]);
|
|
13956
13939
|
}
|
|
13957
13940
|
};
|
|
13958
13941
|
const nodeRemoveHandler = (nodes) => {
|
|
13959
13942
|
depService.clear(nodes);
|
|
13960
13943
|
};
|
|
13961
|
-
const historyChangeHandler = (page) => {
|
|
13962
|
-
collectIdle([page], true)
|
|
13963
|
-
|
|
13964
|
-
});
|
|
13944
|
+
const historyChangeHandler = async (page) => {
|
|
13945
|
+
await collectIdle([page], true);
|
|
13946
|
+
updateStageNode(page);
|
|
13965
13947
|
};
|
|
13966
13948
|
editorService.on("history-change", historyChangeHandler);
|
|
13967
13949
|
editorService.on("root-change", rootChangeHandler);
|
|
13968
13950
|
editorService.on("add", nodeAddHandler);
|
|
13969
13951
|
editorService.on("remove", nodeRemoveHandler);
|
|
13970
13952
|
editorService.on("update", nodeUpdateHandler);
|
|
13971
|
-
const
|
|
13972
|
-
if (depService.hasTarget(id, DepTargetType.CODE_BLOCK)) {
|
|
13973
|
-
depService.getTarget(id, DepTargetType.CODE_BLOCK).name = codeBlock.name;
|
|
13974
|
-
return;
|
|
13975
|
-
}
|
|
13976
|
-
depService.addTarget(createCodeBlockTarget(id, codeBlock));
|
|
13977
|
-
};
|
|
13978
|
-
const codeBlockRemoveHandler = (id) => {
|
|
13979
|
-
depService.removeTarget(id, DepTargetType.CODE_BLOCK);
|
|
13980
|
-
};
|
|
13981
|
-
codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
|
|
13982
|
-
codeBlockService.on("remove", codeBlockRemoveHandler);
|
|
13983
|
-
const dataSourceAddHandler = (config) => {
|
|
13953
|
+
const dataSourceAddHandler = async (config) => {
|
|
13984
13954
|
initDataSourceDepTarget(config);
|
|
13985
|
-
|
|
13955
|
+
const app = await getTMagicApp();
|
|
13956
|
+
app?.dataSourceManager?.addDataSource(config);
|
|
13986
13957
|
};
|
|
13987
|
-
const dataSourceUpdateHandler = (config, { changeRecords }) => {
|
|
13958
|
+
const dataSourceUpdateHandler = async (config, { changeRecords }) => {
|
|
13988
13959
|
let needRecollectDep = false;
|
|
13960
|
+
let isModifyField = false;
|
|
13961
|
+
let isModifyMock = false;
|
|
13962
|
+
let isModifyMethod = false;
|
|
13989
13963
|
for (const changeRecord of changeRecords) {
|
|
13990
13964
|
if (!changeRecord.propPath) {
|
|
13991
13965
|
continue;
|
|
13992
13966
|
}
|
|
13993
|
-
|
|
13967
|
+
isModifyField = changeRecord.propPath === "fields" || /fields.(\d)+.name/.test(changeRecord.propPath) || /fields.(\d)+$/.test(changeRecord.propPath);
|
|
13968
|
+
isModifyMock = changeRecord.propPath === "mocks";
|
|
13969
|
+
isModifyMethod = changeRecord.propPath === "methods" || /methods.(\d)+.name/.test(changeRecord.propPath) || /methods.(\d)+$/.test(changeRecord.propPath);
|
|
13970
|
+
needRecollectDep = isModifyField || isModifyMock || isModifyMethod;
|
|
13994
13971
|
if (needRecollectDep) {
|
|
13995
13972
|
break;
|
|
13996
13973
|
}
|
|
@@ -14001,12 +13978,25 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14001
13978
|
depService.clearIdleTasks();
|
|
14002
13979
|
removeDataSourceTarget(config.id);
|
|
14003
13980
|
initDataSourceDepTarget(config);
|
|
14004
|
-
|
|
14005
|
-
|
|
13981
|
+
let collectIdlePromises = [];
|
|
13982
|
+
if (isModifyField) {
|
|
13983
|
+
collectIdlePromises = [
|
|
13984
|
+
collectIdle(root.items, true, DepTargetType.DATA_SOURCE),
|
|
13985
|
+
collectIdle(root.items, true, DepTargetType.DATA_SOURCE_COND)
|
|
13986
|
+
];
|
|
13987
|
+
} else if (isModifyMock) {
|
|
13988
|
+
collectIdlePromises = [collectIdle(root.items, true, DepTargetType.DATA_SOURCE)];
|
|
13989
|
+
} else if (isModifyMethod) {
|
|
13990
|
+
collectIdlePromises = [collectIdle(root.items, true, DepTargetType.DATA_SOURCE_METHOD)];
|
|
13991
|
+
}
|
|
13992
|
+
Promise.all(collectIdlePromises).then(() => {
|
|
13993
|
+
updateDataSourceSchema();
|
|
13994
|
+
updateStageNodes(root.items);
|
|
14006
13995
|
});
|
|
14007
13996
|
}
|
|
14008
13997
|
} else if (root?.dataSources) {
|
|
14009
|
-
|
|
13998
|
+
const app = await getTMagicApp();
|
|
13999
|
+
app?.dataSourceManager?.updateSchema(root.dataSources);
|
|
14010
14000
|
}
|
|
14011
14001
|
};
|
|
14012
14002
|
const removeDataSourceTarget = (id) => {
|
|
@@ -14018,18 +14008,64 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
14018
14008
|
const root = editorService.get("root");
|
|
14019
14009
|
const nodeIds = Object.keys(root?.dataSourceDeps?.[id] || {});
|
|
14020
14010
|
const nodes = getNodes(nodeIds, root?.items);
|
|
14021
|
-
|
|
14022
|
-
|
|
14011
|
+
Promise.all([
|
|
14012
|
+
collectIdle(nodes, false, DepTargetType.DATA_SOURCE),
|
|
14013
|
+
collectIdle(nodes, false, DepTargetType.DATA_SOURCE_COND),
|
|
14014
|
+
collectIdle(nodes, false, DepTargetType.DATA_SOURCE_METHOD)
|
|
14015
|
+
]).then(() => {
|
|
14016
|
+
updateDataSourceSchema();
|
|
14017
|
+
updateStageNodes(nodes);
|
|
14023
14018
|
});
|
|
14024
14019
|
removeDataSourceTarget(id);
|
|
14025
14020
|
};
|
|
14026
14021
|
dataSourceService.on("add", dataSourceAddHandler);
|
|
14027
14022
|
dataSourceService.on("update", dataSourceUpdateHandler);
|
|
14028
14023
|
dataSourceService.on("remove", dataSourceRemoveHandler);
|
|
14024
|
+
const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
|
|
14025
|
+
if (depService.hasTarget(id, DepTargetType.CODE_BLOCK)) {
|
|
14026
|
+
depService.getTarget(id, DepTargetType.CODE_BLOCK).name = codeBlock.name;
|
|
14027
|
+
return;
|
|
14028
|
+
}
|
|
14029
|
+
depService.addTarget(createCodeBlockTarget(id, codeBlock));
|
|
14030
|
+
};
|
|
14031
|
+
const codeBlockRemoveHandler = (id) => {
|
|
14032
|
+
depService.removeTarget(id, DepTargetType.CODE_BLOCK);
|
|
14033
|
+
};
|
|
14034
|
+
codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
|
|
14035
|
+
codeBlockService.on("remove", codeBlockRemoveHandler);
|
|
14036
|
+
const targetAddHandler = (target) => {
|
|
14037
|
+
const root = editorService.get("root");
|
|
14038
|
+
if (!root) return;
|
|
14039
|
+
if (target.type === DepTargetType.DATA_SOURCE) {
|
|
14040
|
+
if (!root.dataSourceDeps) {
|
|
14041
|
+
root.dataSourceDeps = {};
|
|
14042
|
+
}
|
|
14043
|
+
root.dataSourceDeps[target.id] = target.deps;
|
|
14044
|
+
}
|
|
14045
|
+
if (target.type === DepTargetType.DATA_SOURCE_COND) {
|
|
14046
|
+
if (!root.dataSourceCondDeps) {
|
|
14047
|
+
root.dataSourceCondDeps = {};
|
|
14048
|
+
}
|
|
14049
|
+
root.dataSourceCondDeps[target.id] = target.deps;
|
|
14050
|
+
}
|
|
14051
|
+
};
|
|
14052
|
+
const targetRemoveHandler = (id) => {
|
|
14053
|
+
const root = editorService.get("root");
|
|
14054
|
+
if (!root) return;
|
|
14055
|
+
if (root.dataSourceDeps) {
|
|
14056
|
+
delete root.dataSourceDeps[id];
|
|
14057
|
+
}
|
|
14058
|
+
if (root.dataSourceCondDeps) {
|
|
14059
|
+
delete root.dataSourceCondDeps[id];
|
|
14060
|
+
}
|
|
14061
|
+
};
|
|
14062
|
+
depService.on("add-target", targetAddHandler);
|
|
14063
|
+
depService.on("remove-target", targetRemoveHandler);
|
|
14064
|
+
depService.on("ds-collected", dsDepCollectedHandler);
|
|
14029
14065
|
onBeforeUnmount(() => {
|
|
14030
14066
|
depService.off("add-target", targetAddHandler);
|
|
14031
14067
|
depService.off("remove-target", targetRemoveHandler);
|
|
14032
|
-
depService.off("collected",
|
|
14068
|
+
depService.off("ds-collected", dsDepCollectedHandler);
|
|
14033
14069
|
editorService.off("history-change", historyChangeHandler);
|
|
14034
14070
|
editorService.off("root-change", rootChangeHandler);
|
|
14035
14071
|
editorService.off("add", nodeAddHandler);
|