@tmagic/editor 1.3.0-alpha.7 → 1.3.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +19 -0
- package/dist/tmagic-editor.js +353 -165
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +367 -177
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +12 -12
- package/src/components/FunctionEditor.vue +1 -1
- package/src/components/SplitView.vue +2 -2
- package/src/fields/DataSourceInput.vue +11 -10
- package/src/fields/DataSourceSelect.vue +75 -0
- package/src/index.ts +4 -0
- package/src/initService.ts +4 -0
- package/src/layouts/CodeEditor.vue +27 -7
- package/src/layouts/Framework.vue +1 -2
- package/src/layouts/PropsPanel.vue +2 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +3 -4
- package/src/layouts/sidebar/LayerMenu.vue +4 -3
- package/src/layouts/sidebar/LayerNode.vue +40 -0
- package/src/layouts/sidebar/LayerPanel.vue +7 -4
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +18 -2
- package/src/layouts/workspace/Stage.vue +11 -4
- package/src/services/dep.ts +1 -0
- package/src/theme/data-source-input.scss +18 -0
- package/src/theme/layer-panel.scss +6 -0
- package/src/theme/theme.scss +1 -0
- package/src/utils/dep.ts +7 -1
- package/src/utils/props.ts +34 -0
- package/types/components/FunctionEditor.vue.d.ts +2 -0
- package/types/fields/DataSourceSelect.vue.d.ts +56 -0
- package/types/index.d.ts +2 -0
- package/types/layouts/CodeEditor.vue.d.ts +3 -0
- package/types/layouts/sidebar/LayerNode.vue.d.ts +16 -0
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
const monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
|
|
25
25
|
|
|
26
|
-
const _sfc_main$
|
|
26
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
27
27
|
...{
|
|
28
28
|
name: "MEditorCode"
|
|
29
29
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
};
|
|
63
63
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
64
64
|
|
|
65
|
-
const _sfc_main$
|
|
65
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
66
66
|
...{
|
|
67
67
|
name: "MEditorCodeLink"
|
|
68
68
|
},
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
const _sfc_main$
|
|
139
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
140
140
|
...{
|
|
141
141
|
name: "MEditorCodeSelect"
|
|
142
142
|
},
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
const _hoisted_1$
|
|
205
|
-
const _sfc_main$
|
|
204
|
+
const _hoisted_1$o = ["src"];
|
|
205
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
206
206
|
...{
|
|
207
207
|
name: "MEditorIcon"
|
|
208
208
|
},
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
class: "magic-editor-icon"
|
|
226
226
|
}, {
|
|
227
227
|
default: vue.withCtx(() => [
|
|
228
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
228
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$o)
|
|
229
229
|
]),
|
|
230
230
|
_: 1
|
|
231
231
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -244,9 +244,9 @@
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
const _hoisted_1$
|
|
247
|
+
const _hoisted_1$n = { class: "m-fields-code-select-col" };
|
|
248
248
|
const _hoisted_2$e = { class: "code-select-container" };
|
|
249
|
-
const _sfc_main$
|
|
249
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
250
250
|
...{
|
|
251
251
|
name: "MEditorCodeSelectCol"
|
|
252
252
|
},
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
};
|
|
339
339
|
return (_ctx, _cache) => {
|
|
340
340
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
341
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
341
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
342
342
|
vue.createElementVNode("div", _hoisted_2$e, [
|
|
343
343
|
vue.createVNode(_component_m_form_container, {
|
|
344
344
|
class: "select",
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
model: _ctx.model,
|
|
347
347
|
onChange: onParamsChangeHandler
|
|
348
348
|
}, null, 8, ["model"]),
|
|
349
|
-
vue.createVNode(_sfc_main$
|
|
349
|
+
vue.createVNode(_sfc_main$D, {
|
|
350
350
|
class: "icon",
|
|
351
351
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
352
352
|
onClick: editCode
|
|
@@ -362,9 +362,9 @@
|
|
|
362
362
|
}
|
|
363
363
|
});
|
|
364
364
|
|
|
365
|
-
const _hoisted_1$
|
|
365
|
+
const _hoisted_1$m = { class: "m-editor-data-source-fields" };
|
|
366
366
|
const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
|
|
367
|
-
const _sfc_main$
|
|
367
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
368
368
|
...{
|
|
369
369
|
name: "MEditorDataSourceFields"
|
|
370
370
|
},
|
|
@@ -510,7 +510,7 @@
|
|
|
510
510
|
}
|
|
511
511
|
];
|
|
512
512
|
return (_ctx, _cache) => {
|
|
513
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
513
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
514
514
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
515
515
|
data: _ctx.model[_ctx.name],
|
|
516
516
|
columns: filedColumns
|
|
@@ -543,10 +543,10 @@
|
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
545
|
|
|
546
|
-
const _hoisted_1$
|
|
546
|
+
const _hoisted_1$l = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
547
547
|
const _hoisted_2$c = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
548
548
|
const _hoisted_3$5 = { class: "el-input__inner" };
|
|
549
|
-
const _sfc_main$
|
|
549
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
550
550
|
...{
|
|
551
551
|
name: "MEditorDataSourceInput"
|
|
552
552
|
},
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
573
573
|
const setDisplayState = () => {
|
|
574
574
|
displayState.value = [];
|
|
575
|
-
const matches = state.value.matchAll(
|
|
575
|
+
const matches = state.value.matchAll(/\$\{([\s\S]+?)\}/g);
|
|
576
576
|
let index = 0;
|
|
577
577
|
for (const match of matches) {
|
|
578
578
|
if (typeof match.index === "undefined")
|
|
@@ -645,13 +645,13 @@
|
|
|
645
645
|
}
|
|
646
646
|
return selectionStart;
|
|
647
647
|
};
|
|
648
|
-
const curCharIsLeftCurlyBracket = (leftCurlyBracketIndex) => leftCurlyBracketIndex >
|
|
648
|
+
const curCharIsLeftCurlyBracket = (leftCurlyBracketIndex) => leftCurlyBracketIndex > 0 && leftCurlyBracketIndex === getSelectionStart() - 1;
|
|
649
649
|
const curCharIsDot = (dotIndex) => dotIndex > -1 && dotIndex === getSelectionStart() - 1;
|
|
650
650
|
const dsQuerySearch = (queryString, leftCurlyBracketIndex, cb) => {
|
|
651
651
|
let result = [];
|
|
652
652
|
if (curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
|
|
653
653
|
result = dataSources.value;
|
|
654
|
-
} else if (leftCurlyBracketIndex >
|
|
654
|
+
} else if (leftCurlyBracketIndex > 0) {
|
|
655
655
|
const queryName = queryString.substring(leftCurlyBracketIndex + 1).toLowerCase();
|
|
656
656
|
result = dataSources.value.filter((ds) => ds.title?.toLowerCase().includes(queryName) || ds.id.includes(queryName));
|
|
657
657
|
}
|
|
@@ -703,7 +703,7 @@
|
|
|
703
703
|
const selectionStart = getSelectionStart();
|
|
704
704
|
const curQueryString = queryString.substring(0, selectionStart);
|
|
705
705
|
const fieldKeyStringLastIndex = curQueryString.lastIndexOf(".");
|
|
706
|
-
const dsKeyStringLastIndex = curQueryString.lastIndexOf("{");
|
|
706
|
+
const dsKeyStringLastIndex = curQueryString.lastIndexOf("${") + 1;
|
|
707
707
|
const isFieldTip = fieldKeyStringLastIndex > dsKeyStringLastIndex;
|
|
708
708
|
if (isFieldTip) {
|
|
709
709
|
fieldQuerySearch(curQueryString, dsKeyStringLastIndex, fieldKeyStringLastIndex, cb);
|
|
@@ -716,7 +716,7 @@
|
|
|
716
716
|
const selectionStart = input.value?.selectionStart || 0;
|
|
717
717
|
let startText = inputText.substring(0, selectionStart);
|
|
718
718
|
const dotIndex = startText.lastIndexOf(".");
|
|
719
|
-
const leftCurlyBracketIndex = startText.lastIndexOf("{");
|
|
719
|
+
const leftCurlyBracketIndex = startText.lastIndexOf("${") + 1;
|
|
720
720
|
const endText = inputText.substring(selectionStart);
|
|
721
721
|
let suggestText = value;
|
|
722
722
|
if (isDataSource) {
|
|
@@ -726,7 +726,6 @@
|
|
|
726
726
|
if (!isRightCurlyBracket(selectionStart + 1)) {
|
|
727
727
|
suggestText = `${suggestText}}`;
|
|
728
728
|
}
|
|
729
|
-
suggestText = `{${suggestText}}`;
|
|
730
729
|
} else if (!curCharIsDot(dotIndex)) {
|
|
731
730
|
startText = startText.substring(0, dotIndex + 1);
|
|
732
731
|
}
|
|
@@ -734,7 +733,7 @@
|
|
|
734
733
|
await vue.nextTick();
|
|
735
734
|
let newSelectionStart = 0;
|
|
736
735
|
if (isDataSource) {
|
|
737
|
-
newSelectionStart = leftCurlyBracketIndex + suggestText.length
|
|
736
|
+
newSelectionStart = leftCurlyBracketIndex + suggestText.length;
|
|
738
737
|
} else {
|
|
739
738
|
newSelectionStart = dotIndex + suggestText.length + 1;
|
|
740
739
|
}
|
|
@@ -766,10 +765,10 @@
|
|
|
766
765
|
}
|
|
767
766
|
), {
|
|
768
767
|
suffix: vue.withCtx(() => [
|
|
769
|
-
vue.createVNode(_sfc_main$
|
|
768
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
770
769
|
]),
|
|
771
770
|
default: vue.withCtx(({ item }) => [
|
|
772
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
771
|
+
vue.createElementVNode("div", _hoisted_1$l, [
|
|
773
772
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
774
773
|
vue.createElementVNode("span", _hoisted_2$c, vue.toDisplayString(item.value), 1)
|
|
775
774
|
])
|
|
@@ -777,11 +776,11 @@
|
|
|
777
776
|
_: 1
|
|
778
777
|
}, 16, ["modelValue"])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
779
778
|
key: 1,
|
|
780
|
-
class: vue.normalizeClass(`el-input el-input--${_ctx.size}`),
|
|
779
|
+
class: vue.normalizeClass(`tmagic-data-source-input-text el-input el-input--${_ctx.size}`),
|
|
781
780
|
onMouseup: mouseupHandler
|
|
782
781
|
}, [
|
|
783
782
|
vue.createElementVNode("div", {
|
|
784
|
-
class: vue.normalizeClass(`el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
783
|
+
class: vue.normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
785
784
|
}, [
|
|
786
785
|
vue.createElementVNode("div", _hoisted_3$5, [
|
|
787
786
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
|
|
@@ -800,7 +799,11 @@
|
|
|
800
799
|
_: 2
|
|
801
800
|
}, 1032, ["size"])) : vue.createCommentVNode("", true)
|
|
802
801
|
], 64);
|
|
803
|
-
}), 256))
|
|
802
|
+
}), 256)),
|
|
803
|
+
vue.createVNode(_sfc_main$D, {
|
|
804
|
+
class: "tmagic-data-source-input-icon",
|
|
805
|
+
icon: vue.unref(iconsVue.Coin)
|
|
806
|
+
}, null, 8, ["icon"])
|
|
804
807
|
])
|
|
805
808
|
], 2)
|
|
806
809
|
], 34));
|
|
@@ -808,12 +811,65 @@
|
|
|
808
811
|
}
|
|
809
812
|
});
|
|
810
813
|
|
|
811
|
-
const
|
|
814
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
815
|
+
...{
|
|
816
|
+
name: "MEditorDataSourceSelect"
|
|
817
|
+
},
|
|
818
|
+
__name: "DataSourceSelect",
|
|
819
|
+
props: {
|
|
820
|
+
config: {},
|
|
821
|
+
model: {},
|
|
822
|
+
name: {},
|
|
823
|
+
prop: {},
|
|
824
|
+
disabled: { type: Boolean, default: false },
|
|
825
|
+
lastValues: {},
|
|
826
|
+
size: {}
|
|
827
|
+
},
|
|
828
|
+
emits: ["change"],
|
|
829
|
+
setup(__props, { emit }) {
|
|
830
|
+
const props = __props;
|
|
831
|
+
const { dataSourceService } = vue.inject("services") || {};
|
|
832
|
+
const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
|
|
833
|
+
const selectConfig = vue.computed(() => {
|
|
834
|
+
const { type, dataSourceType, ...config } = props.config;
|
|
835
|
+
return {
|
|
836
|
+
...config,
|
|
837
|
+
type: "select",
|
|
838
|
+
valueKey: "dataSourceId",
|
|
839
|
+
options: dataSources.value.filter((ds) => !dataSourceType || ds.type === dataSourceType).map((ds) => ({
|
|
840
|
+
value: {
|
|
841
|
+
isBindDataSource: true,
|
|
842
|
+
dataSourceType: ds.type,
|
|
843
|
+
dataSourceId: ds.id
|
|
844
|
+
},
|
|
845
|
+
text: ds.title || ds.id
|
|
846
|
+
}))
|
|
847
|
+
};
|
|
848
|
+
});
|
|
849
|
+
const changeHandler = (value) => {
|
|
850
|
+
emit("change", value);
|
|
851
|
+
};
|
|
852
|
+
return (_ctx, _cache) => {
|
|
853
|
+
return vue.openBlock(), vue.createBlock(vue.unref(form.MSelect), {
|
|
854
|
+
model: _ctx.model,
|
|
855
|
+
name: _ctx.name,
|
|
856
|
+
size: _ctx.size,
|
|
857
|
+
prop: _ctx.prop,
|
|
858
|
+
disabled: _ctx.disabled,
|
|
859
|
+
config: selectConfig.value,
|
|
860
|
+
"last-values": _ctx.lastValues,
|
|
861
|
+
onChange: changeHandler
|
|
862
|
+
}, null, 8, ["model", "name", "size", "prop", "disabled", "config", "last-values"]);
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
812
868
|
const _hoisted_2$b = {
|
|
813
869
|
key: 1,
|
|
814
870
|
class: "fullWidth"
|
|
815
871
|
};
|
|
816
|
-
const _sfc_main$
|
|
872
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
817
873
|
...{
|
|
818
874
|
name: "MEditorEventSelect"
|
|
819
875
|
},
|
|
@@ -975,7 +1031,7 @@
|
|
|
975
1031
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
976
1032
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
977
1033
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
978
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1034
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
|
|
979
1035
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
980
1036
|
key: 0,
|
|
981
1037
|
ref: "eventForm",
|
|
@@ -1026,9 +1082,9 @@
|
|
|
1026
1082
|
}
|
|
1027
1083
|
});
|
|
1028
1084
|
|
|
1029
|
-
const _hoisted_1$
|
|
1085
|
+
const _hoisted_1$j = { class: "m-fields-key-value" };
|
|
1030
1086
|
const _hoisted_2$a = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
1031
|
-
const _sfc_main$
|
|
1087
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
1032
1088
|
...{
|
|
1033
1089
|
name: "MEditorKeyValue"
|
|
1034
1090
|
},
|
|
@@ -1071,7 +1127,7 @@
|
|
|
1071
1127
|
records.value.splice(index, 1);
|
|
1072
1128
|
};
|
|
1073
1129
|
return (_ctx, _cache) => {
|
|
1074
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1130
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
|
|
1075
1131
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
1076
1132
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1077
1133
|
class: "m-fields-key-value-item",
|
|
@@ -1122,7 +1178,7 @@
|
|
|
1122
1178
|
}
|
|
1123
1179
|
});
|
|
1124
1180
|
|
|
1125
|
-
const _sfc_main$
|
|
1181
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
1126
1182
|
...{
|
|
1127
1183
|
name: "MEditorUISelect"
|
|
1128
1184
|
},
|
|
@@ -1236,7 +1292,7 @@
|
|
|
1236
1292
|
|
|
1237
1293
|
const UISelect_vue_vue_type_style_index_0_lang = '';
|
|
1238
1294
|
|
|
1239
|
-
const _sfc_main$
|
|
1295
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
1240
1296
|
...{
|
|
1241
1297
|
name: "MEditorCodeEditor"
|
|
1242
1298
|
},
|
|
@@ -1257,10 +1313,14 @@
|
|
|
1257
1313
|
const toString = (v, language) => {
|
|
1258
1314
|
let value = "";
|
|
1259
1315
|
if (typeof v !== "string") {
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1316
|
+
if (props.language.toLocaleLowerCase() === "json") {
|
|
1317
|
+
value = JSON.stringify(v, null, 2);
|
|
1318
|
+
} else {
|
|
1319
|
+
value = serialize(v, {
|
|
1320
|
+
space: 2,
|
|
1321
|
+
unsafe: true
|
|
1322
|
+
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
1323
|
+
}
|
|
1264
1324
|
} else {
|
|
1265
1325
|
value = v;
|
|
1266
1326
|
}
|
|
@@ -1292,7 +1352,7 @@
|
|
|
1292
1352
|
}
|
|
1293
1353
|
return vsEditor?.setValue(values.value);
|
|
1294
1354
|
};
|
|
1295
|
-
const getEditorValue = () => props.type === "diff" ? vsDiffEditor?.getModifiedEditor().getValue() : vsEditor?.getValue();
|
|
1355
|
+
const getEditorValue = () => (props.type === "diff" ? vsDiffEditor?.getModifiedEditor().getValue() : vsEditor?.getValue()) || "";
|
|
1296
1356
|
const init = async () => {
|
|
1297
1357
|
if (!codeEditor.value)
|
|
1298
1358
|
return;
|
|
@@ -1314,12 +1374,18 @@
|
|
|
1314
1374
|
if (e.keyCode === 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
|
|
1315
1375
|
e.preventDefault();
|
|
1316
1376
|
e.stopPropagation();
|
|
1317
|
-
|
|
1377
|
+
const newValue = getEditorValue();
|
|
1378
|
+
values.value = newValue;
|
|
1379
|
+
emit("save", newValue);
|
|
1318
1380
|
}
|
|
1319
1381
|
});
|
|
1320
1382
|
if (props.type !== "diff" && props.autoSave) {
|
|
1321
1383
|
vsEditor?.onDidBlurEditorWidget(() => {
|
|
1322
|
-
|
|
1384
|
+
const newValue = getEditorValue();
|
|
1385
|
+
if (values.value !== newValue) {
|
|
1386
|
+
values.value = newValue;
|
|
1387
|
+
emit("save", newValue);
|
|
1388
|
+
}
|
|
1323
1389
|
});
|
|
1324
1390
|
}
|
|
1325
1391
|
resizeObserver.observe(codeEditor.value);
|
|
@@ -1344,9 +1410,16 @@
|
|
|
1344
1410
|
resizeObserver.disconnect();
|
|
1345
1411
|
});
|
|
1346
1412
|
__expose({
|
|
1413
|
+
values,
|
|
1347
1414
|
getEditor() {
|
|
1348
1415
|
return vsEditor || vsDiffEditor;
|
|
1349
1416
|
},
|
|
1417
|
+
getVsEditor() {
|
|
1418
|
+
return vsEditor;
|
|
1419
|
+
},
|
|
1420
|
+
getVsDiffEditor() {
|
|
1421
|
+
return vsDiffEditor;
|
|
1422
|
+
},
|
|
1350
1423
|
setEditorValue,
|
|
1351
1424
|
focus() {
|
|
1352
1425
|
vsEditor?.focus();
|
|
@@ -1363,7 +1436,7 @@
|
|
|
1363
1436
|
}
|
|
1364
1437
|
});
|
|
1365
1438
|
|
|
1366
|
-
const _sfc_main$
|
|
1439
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
1367
1440
|
...{
|
|
1368
1441
|
name: "MEditorResizer"
|
|
1369
1442
|
},
|
|
@@ -1405,7 +1478,7 @@
|
|
|
1405
1478
|
}
|
|
1406
1479
|
});
|
|
1407
1480
|
|
|
1408
|
-
const _sfc_main$
|
|
1481
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
1409
1482
|
...{
|
|
1410
1483
|
name: "MEditorLayout"
|
|
1411
1484
|
},
|
|
@@ -1510,14 +1583,14 @@
|
|
|
1510
1583
|
ref: el,
|
|
1511
1584
|
class: "m-editor-layout"
|
|
1512
1585
|
}, [
|
|
1513
|
-
hasLeft.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
1586
|
+
hasLeft.value && _ctx.$slots.left ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
1514
1587
|
vue.createElementVNode("div", {
|
|
1515
1588
|
class: vue.normalizeClass(["m-editor-layout-left", _ctx.leftClass]),
|
|
1516
1589
|
style: vue.normalizeStyle(`width: ${_ctx.left}px`)
|
|
1517
1590
|
}, [
|
|
1518
1591
|
vue.renderSlot(_ctx.$slots, "left")
|
|
1519
1592
|
], 6),
|
|
1520
|
-
vue.createVNode(_sfc_main$
|
|
1593
|
+
vue.createVNode(_sfc_main$u, { onChange: changeLeft })
|
|
1521
1594
|
], 64)) : vue.createCommentVNode("", true),
|
|
1522
1595
|
vue.createElementVNode("div", {
|
|
1523
1596
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -1525,8 +1598,8 @@
|
|
|
1525
1598
|
}, [
|
|
1526
1599
|
vue.renderSlot(_ctx.$slots, "center")
|
|
1527
1600
|
], 6),
|
|
1528
|
-
hasRight.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
1529
|
-
vue.createVNode(_sfc_main$
|
|
1601
|
+
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
1602
|
+
vue.createVNode(_sfc_main$u, { onChange: changeRight }),
|
|
1530
1603
|
vue.createElementVNode("div", {
|
|
1531
1604
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
1532
1605
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -1619,6 +1692,40 @@
|
|
|
1619
1692
|
}
|
|
1620
1693
|
]
|
|
1621
1694
|
},
|
|
1695
|
+
{
|
|
1696
|
+
type: "fieldset",
|
|
1697
|
+
legend: "边框",
|
|
1698
|
+
items: [
|
|
1699
|
+
{
|
|
1700
|
+
name: "borderWidth",
|
|
1701
|
+
text: "宽度",
|
|
1702
|
+
defaultValue: "0"
|
|
1703
|
+
},
|
|
1704
|
+
{
|
|
1705
|
+
name: "borderColor",
|
|
1706
|
+
text: "颜色",
|
|
1707
|
+
type: "colorPicker"
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
name: "borderStyle",
|
|
1711
|
+
text: "样式",
|
|
1712
|
+
type: "select",
|
|
1713
|
+
defaultValue: "none",
|
|
1714
|
+
options: [
|
|
1715
|
+
{ text: "none", value: "none" },
|
|
1716
|
+
{ text: "hidden", value: "hidden" },
|
|
1717
|
+
{ text: "dotted", value: "dotted" },
|
|
1718
|
+
{ text: "dashed", value: "dashed" },
|
|
1719
|
+
{ text: "solid", value: "solid" },
|
|
1720
|
+
{ text: "double", value: "double" },
|
|
1721
|
+
{ text: "groove", value: "groove" },
|
|
1722
|
+
{ text: "ridge", value: "ridge" },
|
|
1723
|
+
{ text: "inset", value: "inset" },
|
|
1724
|
+
{ text: "outset", value: "outset" }
|
|
1725
|
+
]
|
|
1726
|
+
}
|
|
1727
|
+
]
|
|
1728
|
+
},
|
|
1622
1729
|
{
|
|
1623
1730
|
type: "fieldset",
|
|
1624
1731
|
legend: "背景",
|
|
@@ -3415,10 +3522,10 @@
|
|
|
3415
3522
|
return stage;
|
|
3416
3523
|
};
|
|
3417
3524
|
|
|
3418
|
-
const _hoisted_1$
|
|
3525
|
+
const _hoisted_1$i = { class: "m-editor-empty-panel" };
|
|
3419
3526
|
const _hoisted_2$9 = { class: "m-editor-empty-content" };
|
|
3420
3527
|
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
3421
|
-
const _sfc_main$
|
|
3528
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
3422
3529
|
...{
|
|
3423
3530
|
name: "MEditorAddPageBox"
|
|
3424
3531
|
},
|
|
@@ -3438,14 +3545,14 @@
|
|
|
3438
3545
|
});
|
|
3439
3546
|
};
|
|
3440
3547
|
return (_ctx, _cache) => {
|
|
3441
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3548
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
3442
3549
|
vue.createElementVNode("div", _hoisted_2$9, [
|
|
3443
3550
|
vue.createElementVNode("div", {
|
|
3444
3551
|
class: "m-editor-empty-button",
|
|
3445
3552
|
onClick: clickHandler
|
|
3446
3553
|
}, [
|
|
3447
3554
|
vue.createElementVNode("div", null, [
|
|
3448
|
-
vue.createVNode(_sfc_main$
|
|
3555
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
3449
3556
|
]),
|
|
3450
3557
|
_hoisted_3$4
|
|
3451
3558
|
])
|
|
@@ -3455,12 +3562,12 @@
|
|
|
3455
3562
|
}
|
|
3456
3563
|
});
|
|
3457
3564
|
|
|
3458
|
-
const _hoisted_1$
|
|
3565
|
+
const _hoisted_1$h = { class: "m-editor" };
|
|
3459
3566
|
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
3460
3567
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
3461
3568
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
3462
3569
|
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
3463
|
-
const _sfc_main$
|
|
3570
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
3464
3571
|
...{
|
|
3465
3572
|
name: "MEditorFramework"
|
|
3466
3573
|
},
|
|
@@ -3469,7 +3576,6 @@
|
|
|
3469
3576
|
const codeOptions = vue.inject("codeOptions", {});
|
|
3470
3577
|
const { editorService, uiService } = vue.inject("services") || {};
|
|
3471
3578
|
const root = vue.computed(() => editorService?.get("root"));
|
|
3472
|
-
const nodes = vue.computed(() => editorService?.get("nodes") || []);
|
|
3473
3579
|
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
3474
3580
|
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
3475
3581
|
const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
|
|
@@ -3527,18 +3633,18 @@
|
|
|
3527
3633
|
}
|
|
3528
3634
|
};
|
|
3529
3635
|
return (_ctx, _cache) => {
|
|
3530
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3636
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
3531
3637
|
vue.renderSlot(_ctx.$slots, "header"),
|
|
3532
3638
|
vue.renderSlot(_ctx.$slots, "nav"),
|
|
3533
3639
|
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
3534
3640
|
showSrc.value ? vue.renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
3535
|
-
vue.createVNode(_sfc_main$
|
|
3641
|
+
vue.createVNode(_sfc_main$v, {
|
|
3536
3642
|
class: "m-editor-content",
|
|
3537
3643
|
"init-values": root.value,
|
|
3538
3644
|
options: vue.unref(codeOptions),
|
|
3539
3645
|
onSave: saveCode
|
|
3540
3646
|
}, null, 8, ["init-values", "options"])
|
|
3541
|
-
]) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3647
|
+
]) : (vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
3542
3648
|
key: 1,
|
|
3543
3649
|
class: "m-editor-content",
|
|
3544
3650
|
"left-class": "m-editor-framework-left",
|
|
@@ -3557,12 +3663,12 @@
|
|
|
3557
3663
|
]),
|
|
3558
3664
|
center: vue.withCtx(() => [
|
|
3559
3665
|
pageLength.value > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
3560
|
-
vue.createVNode(_sfc_main$
|
|
3666
|
+
vue.createVNode(_sfc_main$s)
|
|
3561
3667
|
])
|
|
3562
3668
|
]),
|
|
3563
3669
|
_: 2
|
|
3564
3670
|
}, [
|
|
3565
|
-
pageLength.value > 0
|
|
3671
|
+
pageLength.value > 0 ? {
|
|
3566
3672
|
name: "right",
|
|
3567
3673
|
fn: vue.withCtx(() => [
|
|
3568
3674
|
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
@@ -3582,12 +3688,12 @@
|
|
|
3582
3688
|
}
|
|
3583
3689
|
});
|
|
3584
3690
|
|
|
3585
|
-
const _hoisted_1$
|
|
3691
|
+
const _hoisted_1$g = {
|
|
3586
3692
|
key: 1,
|
|
3587
3693
|
class: "menu-item-text"
|
|
3588
3694
|
};
|
|
3589
3695
|
const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
|
|
3590
|
-
const _sfc_main$
|
|
3696
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
3591
3697
|
...{
|
|
3592
3698
|
name: "MEditorToolButton"
|
|
3593
3699
|
},
|
|
@@ -3666,7 +3772,7 @@
|
|
|
3666
3772
|
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
3667
3773
|
key: 0,
|
|
3668
3774
|
direction: _ctx.data.direction || "vertical"
|
|
3669
|
-
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3775
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
3670
3776
|
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3671
3777
|
key: 0,
|
|
3672
3778
|
effect: "dark",
|
|
@@ -3680,7 +3786,7 @@
|
|
|
3680
3786
|
disabled: disabled.value
|
|
3681
3787
|
}, {
|
|
3682
3788
|
default: vue.withCtx(() => [
|
|
3683
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3789
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
|
|
3684
3790
|
key: 0,
|
|
3685
3791
|
icon: _ctx.data.icon
|
|
3686
3792
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -3697,7 +3803,7 @@
|
|
|
3697
3803
|
disabled: disabled.value
|
|
3698
3804
|
}, {
|
|
3699
3805
|
default: vue.withCtx(() => [
|
|
3700
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3806
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
|
|
3701
3807
|
key: 0,
|
|
3702
3808
|
icon: _ctx.data.icon
|
|
3703
3809
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -3747,7 +3853,7 @@
|
|
|
3747
3853
|
}
|
|
3748
3854
|
});
|
|
3749
3855
|
|
|
3750
|
-
const _sfc_main$
|
|
3856
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
3751
3857
|
...{
|
|
3752
3858
|
name: "MEditorNavMenu"
|
|
3753
3859
|
},
|
|
@@ -3909,7 +4015,7 @@
|
|
|
3909
4015
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
3910
4016
|
}, [
|
|
3911
4017
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
3912
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4018
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$q, {
|
|
3913
4019
|
data: item,
|
|
3914
4020
|
key: index
|
|
3915
4021
|
}, null, 8, ["data"]);
|
|
@@ -3921,8 +4027,11 @@
|
|
|
3921
4027
|
}
|
|
3922
4028
|
});
|
|
3923
4029
|
|
|
3924
|
-
const _hoisted_1$
|
|
3925
|
-
|
|
4030
|
+
const _hoisted_1$f = {
|
|
4031
|
+
key: 0,
|
|
4032
|
+
class: "m-editor-props-panel"
|
|
4033
|
+
};
|
|
4034
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
3926
4035
|
...{
|
|
3927
4036
|
name: "MEditorPropsPanel"
|
|
3928
4037
|
},
|
|
@@ -3935,6 +4044,7 @@
|
|
|
3935
4044
|
const curFormConfig = vue.ref([]);
|
|
3936
4045
|
const services = vue.inject("services");
|
|
3937
4046
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
4047
|
+
const nodes = vue.computed(() => services?.editorService.get("nodes") || []);
|
|
3938
4048
|
const propsPanelSize = vue.computed(() => services?.uiService.get("propsPanelSize") || "small");
|
|
3939
4049
|
const stage = vue.computed(() => services?.editorService.get("stage"));
|
|
3940
4050
|
const init = async () => {
|
|
@@ -3971,7 +4081,7 @@
|
|
|
3971
4081
|
};
|
|
3972
4082
|
__expose({ submit });
|
|
3973
4083
|
return (_ctx, _cache) => {
|
|
3974
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4084
|
+
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
|
|
3975
4085
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
3976
4086
|
vue.createVNode(vue.unref(form.MForm), {
|
|
3977
4087
|
ref_key: "configForm",
|
|
@@ -3983,12 +4093,12 @@
|
|
|
3983
4093
|
config: curFormConfig.value,
|
|
3984
4094
|
onChange: submit
|
|
3985
4095
|
}, null, 8, ["class", "popper-class", "size", "init-values", "config"])
|
|
3986
|
-
]);
|
|
4096
|
+
])) : vue.createCommentVNode("", true);
|
|
3987
4097
|
};
|
|
3988
4098
|
}
|
|
3989
4099
|
});
|
|
3990
4100
|
|
|
3991
|
-
const _sfc_main$
|
|
4101
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
3992
4102
|
...{
|
|
3993
4103
|
name: "MEditorSearchInput"
|
|
3994
4104
|
},
|
|
@@ -4023,7 +4133,7 @@
|
|
|
4023
4133
|
}
|
|
4024
4134
|
});
|
|
4025
4135
|
|
|
4026
|
-
const _hoisted_1$
|
|
4136
|
+
const _hoisted_1$e = { xmlns: "http://www.w3.org/2000/svg" };
|
|
4027
4137
|
const _hoisted_2$7 = /* @__PURE__ */ vue.createElementVNode("g", {
|
|
4028
4138
|
fill: "#7C878E",
|
|
4029
4139
|
"fill-rule": "evenodd"
|
|
@@ -4037,19 +4147,19 @@
|
|
|
4037
4147
|
const _hoisted_3$3 = [
|
|
4038
4148
|
_hoisted_2$7
|
|
4039
4149
|
];
|
|
4040
|
-
const _sfc_main$
|
|
4150
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
4041
4151
|
...{
|
|
4042
4152
|
name: "MEditorAppManageIcon"
|
|
4043
4153
|
},
|
|
4044
4154
|
__name: "AppManageIcon",
|
|
4045
4155
|
setup(__props) {
|
|
4046
4156
|
return (_ctx, _cache) => {
|
|
4047
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4157
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$e, _hoisted_3$3);
|
|
4048
4158
|
};
|
|
4049
4159
|
}
|
|
4050
4160
|
});
|
|
4051
4161
|
|
|
4052
|
-
const _hoisted_1$
|
|
4162
|
+
const _hoisted_1$d = {
|
|
4053
4163
|
viewBox: "0 0 32 32",
|
|
4054
4164
|
version: "1.1",
|
|
4055
4165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4059,19 +4169,19 @@
|
|
|
4059
4169
|
const _hoisted_4$3 = [
|
|
4060
4170
|
_hoisted_2$6
|
|
4061
4171
|
];
|
|
4062
|
-
const _sfc_main$
|
|
4172
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
4063
4173
|
...{
|
|
4064
4174
|
name: "MEditorCodeIcon"
|
|
4065
4175
|
},
|
|
4066
4176
|
__name: "CodeIcon",
|
|
4067
4177
|
setup(__props) {
|
|
4068
4178
|
return (_ctx, _cache) => {
|
|
4069
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4179
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, _hoisted_4$3);
|
|
4070
4180
|
};
|
|
4071
4181
|
}
|
|
4072
4182
|
});
|
|
4073
4183
|
|
|
4074
|
-
const _hoisted_1$
|
|
4184
|
+
const _hoisted_1$c = {
|
|
4075
4185
|
key: 0,
|
|
4076
4186
|
class: "m-editor-content-bottom"
|
|
4077
4187
|
};
|
|
@@ -4079,7 +4189,7 @@
|
|
|
4079
4189
|
key: 1,
|
|
4080
4190
|
class: "m-editor-content-bottom"
|
|
4081
4191
|
};
|
|
4082
|
-
const _sfc_main$
|
|
4192
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
4083
4193
|
...{
|
|
4084
4194
|
name: "MEditorCodeDraftEditor"
|
|
4085
4195
|
},
|
|
@@ -4166,7 +4276,7 @@
|
|
|
4166
4276
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4167
4277
|
class: vue.normalizeClass(["m-editor-wrapper", isFullScreen.value ? "fullScreen" : "normal"])
|
|
4168
4278
|
}, [
|
|
4169
|
-
vue.createVNode(_sfc_main$
|
|
4279
|
+
vue.createVNode(_sfc_main$v, {
|
|
4170
4280
|
ref_key: "codeEditor",
|
|
4171
4281
|
ref: codeEditor,
|
|
4172
4282
|
class: "m-editor-container",
|
|
@@ -4175,7 +4285,7 @@
|
|
|
4175
4285
|
language: _ctx.language,
|
|
4176
4286
|
options: codeOptions.value
|
|
4177
4287
|
}, null, 8, ["init-values", "language", "options"]),
|
|
4178
|
-
_ctx.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4288
|
+
_ctx.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
4179
4289
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4180
4290
|
type: "primary",
|
|
4181
4291
|
class: "button",
|
|
@@ -4231,11 +4341,11 @@
|
|
|
4231
4341
|
}
|
|
4232
4342
|
});
|
|
4233
4343
|
|
|
4234
|
-
const _hoisted_1$
|
|
4344
|
+
const _hoisted_1$b = { class: "code-name-wrapper" };
|
|
4235
4345
|
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
|
|
4236
4346
|
const _hoisted_3$2 = { class: "code-name-wrapper" };
|
|
4237
4347
|
const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "参数", -1);
|
|
4238
|
-
const _sfc_main$
|
|
4348
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
4239
4349
|
...{
|
|
4240
4350
|
name: "MEditorFunctionEditor"
|
|
4241
4351
|
},
|
|
@@ -4251,7 +4361,7 @@
|
|
|
4251
4361
|
},
|
|
4252
4362
|
setup(__props, { expose: __expose }) {
|
|
4253
4363
|
const props = __props;
|
|
4254
|
-
vue.provide("mForm",
|
|
4364
|
+
vue.provide("mForm", null);
|
|
4255
4365
|
const defaultParamColConfig = {
|
|
4256
4366
|
type: "row",
|
|
4257
4367
|
label: "参数类型",
|
|
@@ -4358,7 +4468,7 @@
|
|
|
4358
4468
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4359
4469
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), { shadow: "never" }, {
|
|
4360
4470
|
header: vue.withCtx(() => [
|
|
4361
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4471
|
+
vue.createElementVNode("div", _hoisted_1$b, [
|
|
4362
4472
|
_hoisted_2$4,
|
|
4363
4473
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4364
4474
|
class: "code-name-input",
|
|
@@ -4381,7 +4491,7 @@
|
|
|
4381
4491
|
])
|
|
4382
4492
|
]),
|
|
4383
4493
|
default: vue.withCtx(() => [
|
|
4384
|
-
vue.createVNode(_sfc_main$
|
|
4494
|
+
vue.createVNode(_sfc_main$k, {
|
|
4385
4495
|
ref_key: "codeDraftEditor",
|
|
4386
4496
|
ref: codeDraftEditor,
|
|
4387
4497
|
id: _ctx.id,
|
|
@@ -4400,11 +4510,11 @@
|
|
|
4400
4510
|
}
|
|
4401
4511
|
});
|
|
4402
4512
|
|
|
4403
|
-
const _hoisted_1$
|
|
4513
|
+
const _hoisted_1$a = {
|
|
4404
4514
|
key: 0,
|
|
4405
4515
|
class: "m-editor-code-block-editor-panel"
|
|
4406
4516
|
};
|
|
4407
|
-
const _sfc_main$
|
|
4517
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
4408
4518
|
...{
|
|
4409
4519
|
name: "MEditorCodeBlockEditor"
|
|
4410
4520
|
},
|
|
@@ -4461,16 +4571,16 @@
|
|
|
4461
4571
|
"before-close": handleClose
|
|
4462
4572
|
}, {
|
|
4463
4573
|
default: vue.withCtx(() => [
|
|
4464
|
-
vue.createVNode(_sfc_main$
|
|
4574
|
+
vue.createVNode(_sfc_main$t, {
|
|
4465
4575
|
left: left.value,
|
|
4466
4576
|
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => left.value = $event),
|
|
4467
4577
|
"min-left": 45,
|
|
4468
4578
|
class: "code-editor-layout"
|
|
4469
4579
|
}, {
|
|
4470
4580
|
center: vue.withCtx(() => [
|
|
4471
|
-
!vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4581
|
+
!vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
4472
4582
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: id.value }),
|
|
4473
|
-
codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4583
|
+
codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$j, {
|
|
4474
4584
|
key: 0,
|
|
4475
4585
|
ref_key: "functionEditor",
|
|
4476
4586
|
ref: functionEditor,
|
|
@@ -4493,14 +4603,14 @@
|
|
|
4493
4603
|
}
|
|
4494
4604
|
});
|
|
4495
4605
|
|
|
4496
|
-
const _hoisted_1$
|
|
4606
|
+
const _hoisted_1$9 = { class: "search-wrapper" };
|
|
4497
4607
|
const _hoisted_2$3 = ["id"];
|
|
4498
4608
|
const _hoisted_3$1 = { class: "list-item" };
|
|
4499
4609
|
const _hoisted_4$1 = {
|
|
4500
4610
|
key: 2,
|
|
4501
4611
|
class: "right-tool"
|
|
4502
4612
|
};
|
|
4503
|
-
const _sfc_main$
|
|
4613
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
4504
4614
|
...{
|
|
4505
4615
|
name: "MEditorCodeBlockList"
|
|
4506
4616
|
},
|
|
@@ -4596,8 +4706,8 @@
|
|
|
4596
4706
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
|
|
4597
4707
|
default: vue.withCtx(() => [
|
|
4598
4708
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
4599
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4600
|
-
vue.createVNode(_sfc_main$
|
|
4709
|
+
vue.createElementVNode("div", _hoisted_1$9, [
|
|
4710
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
4601
4711
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4602
4712
|
key: 0,
|
|
4603
4713
|
class: "create-code-button",
|
|
@@ -4632,11 +4742,11 @@
|
|
|
4632
4742
|
class: "list-container"
|
|
4633
4743
|
}, [
|
|
4634
4744
|
vue.createElementVNode("div", _hoisted_3$1, [
|
|
4635
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4745
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
4636
4746
|
key: 0,
|
|
4637
4747
|
class: "codeIcon"
|
|
4638
4748
|
})) : vue.createCommentVNode("", true),
|
|
4639
|
-
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4749
|
+
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
4640
4750
|
key: 1,
|
|
4641
4751
|
class: "compIcon"
|
|
4642
4752
|
})) : vue.createCommentVNode("", true),
|
|
@@ -4650,7 +4760,7 @@
|
|
|
4650
4760
|
placement: "bottom"
|
|
4651
4761
|
}, {
|
|
4652
4762
|
default: vue.withCtx(() => [
|
|
4653
|
-
vue.createVNode(_sfc_main$
|
|
4763
|
+
vue.createVNode(_sfc_main$D, {
|
|
4654
4764
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
4655
4765
|
class: "edit-icon",
|
|
4656
4766
|
onClick: vue.withModifiers(($event) => editCode(`${data.id}`), ["stop"])
|
|
@@ -4665,7 +4775,7 @@
|
|
|
4665
4775
|
placement: "bottom"
|
|
4666
4776
|
}, {
|
|
4667
4777
|
default: vue.withCtx(() => [
|
|
4668
|
-
vue.createVNode(_sfc_main$
|
|
4778
|
+
vue.createVNode(_sfc_main$D, {
|
|
4669
4779
|
icon: vue.unref(iconsVue.Close),
|
|
4670
4780
|
class: "edit-icon",
|
|
4671
4781
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -4683,7 +4793,7 @@
|
|
|
4683
4793
|
]),
|
|
4684
4794
|
_: 3
|
|
4685
4795
|
}, 8, ["default-expanded-keys", "data"]),
|
|
4686
|
-
isShowCodeBlockEditor.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4796
|
+
isShowCodeBlockEditor.value ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
|
|
4687
4797
|
key: 0,
|
|
4688
4798
|
paramsColConfig: _ctx.paramsColConfig
|
|
4689
4799
|
}, {
|
|
@@ -4699,7 +4809,7 @@
|
|
|
4699
4809
|
}
|
|
4700
4810
|
});
|
|
4701
4811
|
|
|
4702
|
-
const _sfc_main$
|
|
4812
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
4703
4813
|
...{
|
|
4704
4814
|
name: "MEditorDataSourceConfigPanel"
|
|
4705
4815
|
},
|
|
@@ -4791,21 +4901,21 @@
|
|
|
4791
4901
|
}
|
|
4792
4902
|
});
|
|
4793
4903
|
|
|
4794
|
-
const _hoisted_1$
|
|
4904
|
+
const _hoisted_1$8 = { class: "search-wrapper" };
|
|
4795
4905
|
const _hoisted_2$2 = ["id"];
|
|
4796
4906
|
const _hoisted_3 = { class: "list-item" };
|
|
4797
4907
|
const _hoisted_4 = {
|
|
4798
4908
|
key: 2,
|
|
4799
4909
|
class: "right-tool"
|
|
4800
4910
|
};
|
|
4801
|
-
const _sfc_main$
|
|
4911
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
4802
4912
|
...{
|
|
4803
4913
|
name: "MEditorDataSourceListPanel"
|
|
4804
4914
|
},
|
|
4805
4915
|
__name: "DataSourceListPanel",
|
|
4806
4916
|
setup(__props) {
|
|
4807
4917
|
const services = vue.inject("services", {});
|
|
4808
|
-
const { dataSourceService, depService } = vue.inject("services") || {};
|
|
4918
|
+
const { dataSourceService, depService, editorService } = vue.inject("services") || {};
|
|
4809
4919
|
const list = vue.computed(
|
|
4810
4920
|
() => Object.values(depService?.targets["data-source"] || {}).map((target) => ({
|
|
4811
4921
|
id: target.id,
|
|
@@ -4857,11 +4967,23 @@
|
|
|
4857
4967
|
const filterTextChangeHandler = (val) => {
|
|
4858
4968
|
tree.value?.filter(val);
|
|
4859
4969
|
};
|
|
4970
|
+
const selectComp = (compId) => {
|
|
4971
|
+
const stage = editorService?.get("stage");
|
|
4972
|
+
editorService?.select(compId);
|
|
4973
|
+
stage?.select(compId);
|
|
4974
|
+
};
|
|
4975
|
+
const clickHandler = (data, node) => {
|
|
4976
|
+
if (data.type === "node") {
|
|
4977
|
+
selectComp(data.id);
|
|
4978
|
+
} else if (data.type === "key") {
|
|
4979
|
+
selectComp(node.parent.data.id);
|
|
4980
|
+
}
|
|
4981
|
+
};
|
|
4860
4982
|
return (_ctx, _cache) => {
|
|
4861
4983
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-dep-list-panel" }, {
|
|
4862
4984
|
default: vue.withCtx(() => [
|
|
4863
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4864
|
-
vue.createVNode(_sfc_main$
|
|
4985
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
4986
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
4865
4987
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4866
4988
|
type: "primary",
|
|
4867
4989
|
size: "small",
|
|
@@ -4882,7 +5004,8 @@
|
|
|
4882
5004
|
"default-expand-all": "",
|
|
4883
5005
|
"expand-on-click-node": false,
|
|
4884
5006
|
data: list.value,
|
|
4885
|
-
"highlight-current": true
|
|
5007
|
+
"highlight-current": true,
|
|
5008
|
+
onNodeClick: clickHandler
|
|
4886
5009
|
}, {
|
|
4887
5010
|
default: vue.withCtx(({ data }) => [
|
|
4888
5011
|
vue.createElementVNode("div", {
|
|
@@ -4890,12 +5013,12 @@
|
|
|
4890
5013
|
class: "list-container"
|
|
4891
5014
|
}, [
|
|
4892
5015
|
vue.createElementVNode("div", _hoisted_3, [
|
|
4893
|
-
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5016
|
+
data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
|
|
4894
5017
|
key: 0,
|
|
4895
5018
|
class: "codeIcon",
|
|
4896
5019
|
icon: vue.unref(iconsVue.Coin)
|
|
4897
5020
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
4898
|
-
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5021
|
+
data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
|
|
4899
5022
|
key: 1,
|
|
4900
5023
|
class: "compIcon",
|
|
4901
5024
|
icon: vue.unref(iconsVue.Aim)
|
|
@@ -4910,7 +5033,7 @@
|
|
|
4910
5033
|
placement: "bottom"
|
|
4911
5034
|
}, {
|
|
4912
5035
|
default: vue.withCtx(() => [
|
|
4913
|
-
vue.createVNode(_sfc_main$
|
|
5036
|
+
vue.createVNode(_sfc_main$D, {
|
|
4914
5037
|
class: "edit-icon",
|
|
4915
5038
|
icon: vue.unref(iconsVue.Edit),
|
|
4916
5039
|
onClick: vue.withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
|
|
@@ -4924,7 +5047,7 @@
|
|
|
4924
5047
|
placement: "bottom"
|
|
4925
5048
|
}, {
|
|
4926
5049
|
default: vue.withCtx(() => [
|
|
4927
|
-
vue.createVNode(_sfc_main$
|
|
5050
|
+
vue.createVNode(_sfc_main$D, {
|
|
4928
5051
|
icon: vue.unref(iconsVue.Close),
|
|
4929
5052
|
class: "edit-icon",
|
|
4930
5053
|
onClick: vue.withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
|
|
@@ -4942,7 +5065,7 @@
|
|
|
4942
5065
|
]),
|
|
4943
5066
|
_: 3
|
|
4944
5067
|
}, 8, ["data"]),
|
|
4945
|
-
vue.createVNode(_sfc_main$
|
|
5068
|
+
vue.createVNode(_sfc_main$g, {
|
|
4946
5069
|
ref_key: "editDialog",
|
|
4947
5070
|
ref: editDialog,
|
|
4948
5071
|
values: dataSourceValues.value,
|
|
@@ -4956,8 +5079,8 @@
|
|
|
4956
5079
|
}
|
|
4957
5080
|
});
|
|
4958
5081
|
|
|
4959
|
-
const _hoisted_1$
|
|
4960
|
-
const _sfc_main$
|
|
5082
|
+
const _hoisted_1$7 = ["onClick", "onDragstart"];
|
|
5083
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
4961
5084
|
...{
|
|
4962
5085
|
name: "MEditorComponentListPanel"
|
|
4963
5086
|
},
|
|
@@ -4991,14 +5114,13 @@
|
|
|
4991
5114
|
};
|
|
4992
5115
|
const dragstartHandler = ({ text, type, data = {} }, e) => {
|
|
4993
5116
|
if (e.dataTransfer) {
|
|
4994
|
-
e.dataTransfer.effectAllowed = "move";
|
|
4995
5117
|
e.dataTransfer.setData(
|
|
4996
|
-
"
|
|
5118
|
+
"text/html",
|
|
4997
5119
|
serialize({
|
|
4998
5120
|
name: text,
|
|
4999
5121
|
type,
|
|
5000
5122
|
...data
|
|
5001
|
-
})
|
|
5123
|
+
})
|
|
5002
5124
|
);
|
|
5003
5125
|
}
|
|
5004
5126
|
};
|
|
@@ -5026,7 +5148,7 @@
|
|
|
5026
5148
|
}
|
|
5027
5149
|
if (timeout || !stage.value)
|
|
5028
5150
|
return;
|
|
5029
|
-
timeout = stage.value.
|
|
5151
|
+
timeout = stage.value.delayedMarkContainer(e);
|
|
5030
5152
|
};
|
|
5031
5153
|
return (_ctx, _cache) => {
|
|
5032
5154
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), null, {
|
|
@@ -5037,7 +5159,7 @@
|
|
|
5037
5159
|
"model-value": collapseValue.value
|
|
5038
5160
|
}, {
|
|
5039
5161
|
default: vue.withCtx(() => [
|
|
5040
|
-
vue.createVNode(_sfc_main$
|
|
5162
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
5041
5163
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
5042
5164
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
5043
5165
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -5045,7 +5167,7 @@
|
|
|
5045
5167
|
name: `${index}`
|
|
5046
5168
|
}, {
|
|
5047
5169
|
title: vue.withCtx(() => [
|
|
5048
|
-
vue.createVNode(_sfc_main$
|
|
5170
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
5049
5171
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
5050
5172
|
]),
|
|
5051
5173
|
default: vue.withCtx(() => [
|
|
@@ -5060,7 +5182,7 @@
|
|
|
5060
5182
|
onDrag: dragHandler
|
|
5061
5183
|
}, [
|
|
5062
5184
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
5063
|
-
vue.createVNode(_sfc_main$
|
|
5185
|
+
vue.createVNode(_sfc_main$D, {
|
|
5064
5186
|
icon: item.icon
|
|
5065
5187
|
}, null, 8, ["icon"]),
|
|
5066
5188
|
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
@@ -5074,7 +5196,7 @@
|
|
|
5074
5196
|
_: 2
|
|
5075
5197
|
}, 1032, ["content"])
|
|
5076
5198
|
])
|
|
5077
|
-
], 40, _hoisted_1$
|
|
5199
|
+
], 40, _hoisted_1$7);
|
|
5078
5200
|
}), 128))
|
|
5079
5201
|
]),
|
|
5080
5202
|
_: 2
|
|
@@ -5091,7 +5213,7 @@
|
|
|
5091
5213
|
}
|
|
5092
5214
|
});
|
|
5093
5215
|
|
|
5094
|
-
const _sfc_main$
|
|
5216
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
5095
5217
|
...{
|
|
5096
5218
|
name: "MEditorContentMenu"
|
|
5097
5219
|
},
|
|
@@ -5188,7 +5310,7 @@
|
|
|
5188
5310
|
}, [
|
|
5189
5311
|
vue.createElementVNode("div", null, [
|
|
5190
5312
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
5191
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5313
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$q, {
|
|
5192
5314
|
"event-type": "mouseup",
|
|
5193
5315
|
data: item,
|
|
5194
5316
|
key: index,
|
|
@@ -5215,7 +5337,7 @@
|
|
|
5215
5337
|
}
|
|
5216
5338
|
});
|
|
5217
5339
|
|
|
5218
|
-
const _sfc_main$
|
|
5340
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
5219
5341
|
...{
|
|
5220
5342
|
name: "MEditorLayerMenu"
|
|
5221
5343
|
},
|
|
@@ -5228,6 +5350,7 @@
|
|
|
5228
5350
|
const services = vue.inject("services");
|
|
5229
5351
|
const menu = vue.ref();
|
|
5230
5352
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
5353
|
+
const nodes = vue.computed(() => services?.editorService.get("nodes"));
|
|
5231
5354
|
const isRoot = vue.computed(() => node.value?.type === schema.NodeType.ROOT);
|
|
5232
5355
|
const isPage = vue.computed(() => node.value?.type === schema.NodeType.PAGE);
|
|
5233
5356
|
const componentList = vue.computed(() => services?.componentListService.getList() || []);
|
|
@@ -5279,7 +5402,7 @@
|
|
|
5279
5402
|
type: "button",
|
|
5280
5403
|
text: "新增",
|
|
5281
5404
|
icon: vue.markRaw(iconsVue.Plus),
|
|
5282
|
-
display: () => node.value?.items,
|
|
5405
|
+
display: () => node.value?.items && nodes.value?.length === 1,
|
|
5283
5406
|
items: getSubMenuData.value
|
|
5284
5407
|
},
|
|
5285
5408
|
{
|
|
@@ -5288,7 +5411,7 @@
|
|
|
5288
5411
|
icon: vue.markRaw(iconsVue.CopyDocument),
|
|
5289
5412
|
display: () => !isRoot.value,
|
|
5290
5413
|
handler: () => {
|
|
5291
|
-
node.value && services?.editorService.copy(
|
|
5414
|
+
node.value && services?.editorService.copy(nodes.value || []);
|
|
5292
5415
|
}
|
|
5293
5416
|
},
|
|
5294
5417
|
{
|
|
@@ -5297,7 +5420,7 @@
|
|
|
5297
5420
|
icon: vue.markRaw(iconsVue.Delete),
|
|
5298
5421
|
display: () => !isRoot.value && !isPage.value,
|
|
5299
5422
|
handler: () => {
|
|
5300
|
-
node.value && services?.editorService.remove(
|
|
5423
|
+
node.value && services?.editorService.remove(nodes.value || []);
|
|
5301
5424
|
}
|
|
5302
5425
|
},
|
|
5303
5426
|
...props.layerContentMenu
|
|
@@ -5309,7 +5432,7 @@
|
|
|
5309
5432
|
show
|
|
5310
5433
|
});
|
|
5311
5434
|
return (_ctx, _cache) => {
|
|
5312
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5435
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$d, {
|
|
5313
5436
|
"menu-data": menuData.value,
|
|
5314
5437
|
ref_key: "menu",
|
|
5315
5438
|
ref: menu,
|
|
@@ -5319,6 +5442,57 @@
|
|
|
5319
5442
|
}
|
|
5320
5443
|
});
|
|
5321
5444
|
|
|
5445
|
+
const _hoisted_1$6 = { class: "layer-node-tool" };
|
|
5446
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
5447
|
+
__name: "LayerNode",
|
|
5448
|
+
props: {
|
|
5449
|
+
data: {}
|
|
5450
|
+
},
|
|
5451
|
+
setup(__props) {
|
|
5452
|
+
const props = __props;
|
|
5453
|
+
const services = vue.inject("services");
|
|
5454
|
+
const editorService = services?.editorService;
|
|
5455
|
+
const setNodeVisible = (visible) => {
|
|
5456
|
+
if (!editorService)
|
|
5457
|
+
return;
|
|
5458
|
+
editorService.update({
|
|
5459
|
+
id: props.data.id,
|
|
5460
|
+
visible
|
|
5461
|
+
});
|
|
5462
|
+
};
|
|
5463
|
+
return (_ctx, _cache) => {
|
|
5464
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
5465
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
5466
|
+
vue.createElementVNode("div", null, vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
|
|
5467
|
+
vue.createElementVNode("div", _hoisted_1$6, [
|
|
5468
|
+
_ctx.data.type !== "page" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
5469
|
+
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
5470
|
+
key: 0,
|
|
5471
|
+
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => setNodeVisible(true), ["stop"])),
|
|
5472
|
+
title: "点击显示"
|
|
5473
|
+
}, {
|
|
5474
|
+
default: vue.withCtx(() => [
|
|
5475
|
+
vue.createVNode(vue.unref(iconsVue.Hide))
|
|
5476
|
+
]),
|
|
5477
|
+
_: 1
|
|
5478
|
+
})) : (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
5479
|
+
key: 1,
|
|
5480
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => setNodeVisible(false), ["stop"])),
|
|
5481
|
+
class: "node-lock",
|
|
5482
|
+
title: "点击隐藏"
|
|
5483
|
+
}, {
|
|
5484
|
+
default: vue.withCtx(() => [
|
|
5485
|
+
vue.createVNode(vue.unref(iconsVue.View))
|
|
5486
|
+
]),
|
|
5487
|
+
_: 1
|
|
5488
|
+
}))
|
|
5489
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
5490
|
+
])
|
|
5491
|
+
], 64);
|
|
5492
|
+
};
|
|
5493
|
+
}
|
|
5494
|
+
});
|
|
5495
|
+
|
|
5322
5496
|
const _hoisted_1$5 = ["id", "onMouseenter"];
|
|
5323
5497
|
const throttleTime = 150;
|
|
5324
5498
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -5550,14 +5724,16 @@
|
|
|
5550
5724
|
};
|
|
5551
5725
|
const contextmenu = async (event, data) => {
|
|
5552
5726
|
event.preventDefault();
|
|
5553
|
-
|
|
5727
|
+
if (nodes.value.length < 2) {
|
|
5728
|
+
await select(data);
|
|
5729
|
+
}
|
|
5554
5730
|
menu.value?.show(event);
|
|
5555
5731
|
};
|
|
5556
5732
|
return (_ctx, _cache) => {
|
|
5557
5733
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
|
|
5558
5734
|
default: vue.withCtx(() => [
|
|
5559
5735
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
5560
|
-
vue.createVNode(_sfc_main$
|
|
5736
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
5561
5737
|
values.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
5562
5738
|
key: 0,
|
|
5563
5739
|
class: "magic-editor-layer-tree",
|
|
@@ -5597,14 +5773,14 @@
|
|
|
5597
5773
|
node,
|
|
5598
5774
|
data
|
|
5599
5775
|
}, () => [
|
|
5600
|
-
vue.
|
|
5776
|
+
vue.createVNode(_sfc_main$b, { data }, null, 8, ["data"])
|
|
5601
5777
|
])
|
|
5602
5778
|
], 40, _hoisted_1$5)
|
|
5603
5779
|
]),
|
|
5604
5780
|
_: 3
|
|
5605
5781
|
}, 8, ["default-expanded-keys", "default-checked-keys", "current-node-key", "data", "highlight-current", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
5606
5782
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
5607
|
-
vue.createVNode(_sfc_main$
|
|
5783
|
+
vue.createVNode(_sfc_main$c, {
|
|
5608
5784
|
ref_key: "menu",
|
|
5609
5785
|
ref: menu,
|
|
5610
5786
|
"layer-content-menu": _ctx.layerContentMenu
|
|
@@ -5642,7 +5818,7 @@
|
|
|
5642
5818
|
type: "component",
|
|
5643
5819
|
icon: iconsVue.Goods,
|
|
5644
5820
|
text: "组件",
|
|
5645
|
-
component: _sfc_main$
|
|
5821
|
+
component: _sfc_main$e,
|
|
5646
5822
|
slots: {}
|
|
5647
5823
|
},
|
|
5648
5824
|
layer: {
|
|
@@ -5661,7 +5837,7 @@
|
|
|
5661
5837
|
type: "component",
|
|
5662
5838
|
icon: iconsVue.EditPen,
|
|
5663
5839
|
text: "代码编辑",
|
|
5664
|
-
component: _sfc_main$
|
|
5840
|
+
component: _sfc_main$h,
|
|
5665
5841
|
slots: {}
|
|
5666
5842
|
},
|
|
5667
5843
|
"data-source": {
|
|
@@ -5669,7 +5845,7 @@
|
|
|
5669
5845
|
type: "component",
|
|
5670
5846
|
icon: iconsVue.Coin,
|
|
5671
5847
|
text: "数据源",
|
|
5672
|
-
component: _sfc_main$
|
|
5848
|
+
component: _sfc_main$f,
|
|
5673
5849
|
slots: {}
|
|
5674
5850
|
}
|
|
5675
5851
|
};
|
|
@@ -5701,7 +5877,7 @@
|
|
|
5701
5877
|
(vue.openBlock(), vue.createElementBlock("div", {
|
|
5702
5878
|
key: config.text
|
|
5703
5879
|
}, [
|
|
5704
|
-
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5880
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$D, {
|
|
5705
5881
|
key: 0,
|
|
5706
5882
|
icon: config.icon
|
|
5707
5883
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -5929,14 +6105,14 @@
|
|
|
5929
6105
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5930
6106
|
onClick: addPage
|
|
5931
6107
|
}, [
|
|
5932
|
-
vue.createVNode(_sfc_main$
|
|
6108
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5933
6109
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2)),
|
|
5934
6110
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5935
6111
|
key: 2,
|
|
5936
6112
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5937
6113
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
5938
6114
|
}, [
|
|
5939
|
-
vue.createVNode(_sfc_main$
|
|
6115
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
5940
6116
|
])) : vue.createCommentVNode("", true),
|
|
5941
6117
|
pageLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5942
6118
|
key: 3,
|
|
@@ -5952,7 +6128,7 @@
|
|
|
5952
6128
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5953
6129
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
5954
6130
|
}, [
|
|
5955
|
-
vue.createVNode(_sfc_main$
|
|
6131
|
+
vue.createVNode(_sfc_main$D, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
5956
6132
|
])) : vue.createCommentVNode("", true)
|
|
5957
6133
|
], 512);
|
|
5958
6134
|
};
|
|
@@ -6024,7 +6200,7 @@
|
|
|
6024
6200
|
default: vue.withCtx(() => [
|
|
6025
6201
|
vue.createElementVNode("div", null, [
|
|
6026
6202
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
6027
|
-
vue.createVNode(_sfc_main$
|
|
6203
|
+
vue.createVNode(_sfc_main$q, {
|
|
6028
6204
|
data: {
|
|
6029
6205
|
type: "button",
|
|
6030
6206
|
text: "复制",
|
|
@@ -6032,7 +6208,7 @@
|
|
|
6032
6208
|
handler: () => copy(item)
|
|
6033
6209
|
}
|
|
6034
6210
|
}, null, 8, ["data"]),
|
|
6035
|
-
vue.createVNode(_sfc_main$
|
|
6211
|
+
vue.createVNode(_sfc_main$q, {
|
|
6036
6212
|
data: {
|
|
6037
6213
|
type: "button",
|
|
6038
6214
|
text: "删除",
|
|
@@ -6523,7 +6699,7 @@
|
|
|
6523
6699
|
};
|
|
6524
6700
|
__expose({ show });
|
|
6525
6701
|
return (_ctx, _cache) => {
|
|
6526
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6702
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$d, {
|
|
6527
6703
|
"menu-data": menuData.value,
|
|
6528
6704
|
ref_key: "menu",
|
|
6529
6705
|
ref: menu
|
|
@@ -6624,9 +6800,9 @@
|
|
|
6624
6800
|
};
|
|
6625
6801
|
const dragoverHandler = (e) => {
|
|
6626
6802
|
e.preventDefault();
|
|
6627
|
-
if (e.dataTransfer)
|
|
6628
|
-
|
|
6629
|
-
|
|
6803
|
+
if (!e.dataTransfer)
|
|
6804
|
+
return;
|
|
6805
|
+
e.dataTransfer.dropEffect = "move";
|
|
6630
6806
|
};
|
|
6631
6807
|
const dropHandler = async (e) => {
|
|
6632
6808
|
e.preventDefault();
|
|
@@ -6638,7 +6814,12 @@
|
|
|
6638
6814
|
}
|
|
6639
6815
|
if (e.dataTransfer && parent && stageContainer.value && stage) {
|
|
6640
6816
|
const parseDSL = getConfig("parseDSL");
|
|
6641
|
-
const
|
|
6817
|
+
const data = e.dataTransfer.getData("text/html");
|
|
6818
|
+
if (!data)
|
|
6819
|
+
return;
|
|
6820
|
+
const config = parseDSL(`(${data})`);
|
|
6821
|
+
if (!config)
|
|
6822
|
+
return;
|
|
6642
6823
|
const layout = await services?.editorService.getLayout(parent);
|
|
6643
6824
|
const containerRect = stageContainer.value.getBoundingClientRect();
|
|
6644
6825
|
const { scrollTop, scrollLeft } = stage.mask;
|
|
@@ -7838,6 +8019,9 @@
|
|
|
7838
8019
|
id,
|
|
7839
8020
|
name: codeBlock.name,
|
|
7840
8021
|
isTarget: (key, value) => {
|
|
8022
|
+
if (id === value) {
|
|
8023
|
+
return true;
|
|
8024
|
+
}
|
|
7841
8025
|
if (value?.hookType === schema.HookType.CODE && !lodashEs.isEmpty(value.hookData)) {
|
|
7842
8026
|
const index = value.hookData.findIndex((item) => item.codeId === id);
|
|
7843
8027
|
return Boolean(index > -1);
|
|
@@ -7849,7 +8033,10 @@
|
|
|
7849
8033
|
type: "data-source",
|
|
7850
8034
|
id,
|
|
7851
8035
|
name: ds.title || `${id}`,
|
|
7852
|
-
isTarget: (key, value) =>
|
|
8036
|
+
isTarget: (key, value) => (
|
|
8037
|
+
// 关联数据源对象或者在模板在使用数据源
|
|
8038
|
+
value.isBindDataSource && value.dataSourceId || typeof value === "string" && value.includes(`${id}`)
|
|
8039
|
+
)
|
|
7853
8040
|
});
|
|
7854
8041
|
|
|
7855
8042
|
const initServiceState = (props, {
|
|
@@ -8102,11 +8289,11 @@
|
|
|
8102
8289
|
const _sfc_main = vue.defineComponent({
|
|
8103
8290
|
name: "MEditor",
|
|
8104
8291
|
components: {
|
|
8105
|
-
TMagicNavMenu: _sfc_main$
|
|
8292
|
+
TMagicNavMenu: _sfc_main$p,
|
|
8106
8293
|
Sidebar: _sfc_main$9,
|
|
8107
8294
|
Workspace: _sfc_main$1,
|
|
8108
|
-
PropsPanel: _sfc_main$
|
|
8109
|
-
Framework: _sfc_main$
|
|
8295
|
+
PropsPanel: _sfc_main$o,
|
|
8296
|
+
Framework: _sfc_main$r
|
|
8110
8297
|
},
|
|
8111
8298
|
props: editorProps,
|
|
8112
8299
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
@@ -8273,46 +8460,49 @@
|
|
|
8273
8460
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
8274
8461
|
setConfig(option);
|
|
8275
8462
|
app.component(Editor.name, Editor);
|
|
8276
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
8277
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
8278
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
8279
|
-
app.component("magic-code-editor", _sfc_main$
|
|
8280
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
8281
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
8282
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
8283
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
8284
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
8285
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
8463
|
+
app.component("m-fields-ui-select", _sfc_main$w);
|
|
8464
|
+
app.component("m-fields-code-link", _sfc_main$F);
|
|
8465
|
+
app.component("m-fields-vs-code", _sfc_main$G);
|
|
8466
|
+
app.component("magic-code-editor", _sfc_main$v);
|
|
8467
|
+
app.component("m-fields-code-select", _sfc_main$E);
|
|
8468
|
+
app.component("m-fields-code-select-col", _sfc_main$C);
|
|
8469
|
+
app.component("m-fields-event-select", _sfc_main$y);
|
|
8470
|
+
app.component("m-fields-data-source-fields", _sfc_main$B);
|
|
8471
|
+
app.component("m-fields-key-value", _sfc_main$x);
|
|
8472
|
+
app.component("m-fields-data-source-input", _sfc_main$A);
|
|
8473
|
+
app.component("m-fields-data-source-select", _sfc_main$z);
|
|
8286
8474
|
}
|
|
8287
8475
|
};
|
|
8288
8476
|
|
|
8289
8477
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
8290
8478
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
8291
|
-
exports.CodeBlockList = _sfc_main$
|
|
8479
|
+
exports.CodeBlockList = _sfc_main$h;
|
|
8292
8480
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
8293
|
-
exports.CodeSelect = _sfc_main$
|
|
8294
|
-
exports.CodeSelectCol = _sfc_main$
|
|
8481
|
+
exports.CodeSelect = _sfc_main$E;
|
|
8482
|
+
exports.CodeSelectCol = _sfc_main$C;
|
|
8295
8483
|
exports.ColumnLayout = ColumnLayout;
|
|
8296
|
-
exports.ComponentListPanel = _sfc_main$
|
|
8297
|
-
exports.ContentMenu = _sfc_main$
|
|
8298
|
-
exports.DataSourceFields = _sfc_main$
|
|
8299
|
-
exports.DataSourceInput = _sfc_main$
|
|
8300
|
-
exports.
|
|
8484
|
+
exports.ComponentListPanel = _sfc_main$e;
|
|
8485
|
+
exports.ContentMenu = _sfc_main$d;
|
|
8486
|
+
exports.DataSourceFields = _sfc_main$B;
|
|
8487
|
+
exports.DataSourceInput = _sfc_main$A;
|
|
8488
|
+
exports.DataSourceSelect = _sfc_main$z;
|
|
8489
|
+
exports.EventSelect = _sfc_main$y;
|
|
8301
8490
|
exports.Fixed2Other = Fixed2Other;
|
|
8302
8491
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
8303
|
-
exports.Icon = _sfc_main$
|
|
8492
|
+
exports.Icon = _sfc_main$D;
|
|
8304
8493
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
8305
|
-
exports.KeyValue = _sfc_main$
|
|
8494
|
+
exports.KeyValue = _sfc_main$x;
|
|
8306
8495
|
exports.Keys = Keys;
|
|
8307
8496
|
exports.LayerOffset = LayerOffset;
|
|
8308
8497
|
exports.LayerPanel = _sfc_main$a;
|
|
8309
8498
|
exports.Layout = Layout;
|
|
8310
|
-
exports.LayoutContainer = _sfc_main$
|
|
8311
|
-
exports.PropsPanel = _sfc_main$
|
|
8312
|
-
exports.
|
|
8313
|
-
exports.
|
|
8499
|
+
exports.LayoutContainer = _sfc_main$t;
|
|
8500
|
+
exports.PropsPanel = _sfc_main$o;
|
|
8501
|
+
exports.Resizer = _sfc_main$u;
|
|
8502
|
+
exports.SplitView = _sfc_main$t;
|
|
8503
|
+
exports.TMagicCodeEditor = _sfc_main$v;
|
|
8314
8504
|
exports.TMagicEditor = Editor;
|
|
8315
|
-
exports.ToolButton = _sfc_main$
|
|
8505
|
+
exports.ToolButton = _sfc_main$q;
|
|
8316
8506
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
8317
8507
|
exports.beforePaste = beforePaste;
|
|
8318
8508
|
exports.change2Fixed = change2Fixed;
|