@tmagic/editor 1.3.0-alpha.12 → 1.3.0-alpha.13
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 +80 -39
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +80 -39
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/fields/UISelect.vue +37 -6
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +15 -2
- package/src/services/codeBlock.ts +1 -1
- package/types/components/FunctionEditor.vue.d.ts +9 -9
- package/types/services/codeBlock.d.ts +1 -1
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
const _hoisted_1$
|
|
204
|
+
const _hoisted_1$q = ["src"];
|
|
205
205
|
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
206
206
|
...{
|
|
207
207
|
name: "MEditorIcon"
|
|
@@ -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$q)
|
|
229
229
|
]),
|
|
230
230
|
_: 1
|
|
231
231
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
const _hoisted_1$
|
|
247
|
+
const _hoisted_1$p = { class: "m-fields-code-select-col" };
|
|
248
248
|
const _hoisted_2$f = { class: "code-select-container" };
|
|
249
249
|
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
250
250
|
...{
|
|
@@ -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$p, [
|
|
342
342
|
vue.createElementVNode("div", _hoisted_2$f, [
|
|
343
343
|
vue.createVNode(_component_m_form_container, {
|
|
344
344
|
class: "select",
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
}
|
|
363
363
|
});
|
|
364
364
|
|
|
365
|
-
const _hoisted_1$
|
|
365
|
+
const _hoisted_1$o = { class: "m-editor-data-source-fields" };
|
|
366
366
|
const _hoisted_2$e = { class: "m-editor-data-source-fields-footer" };
|
|
367
367
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
368
368
|
...{
|
|
@@ -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$o, [
|
|
514
514
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
515
515
|
data: _ctx.model[_ctx.name],
|
|
516
516
|
columns: filedColumns
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
}
|
|
544
544
|
});
|
|
545
545
|
|
|
546
|
-
const _hoisted_1$
|
|
546
|
+
const _hoisted_1$n = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
547
547
|
const _hoisted_2$d = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
548
548
|
const _hoisted_3$6 = { class: "el-input__inner" };
|
|
549
549
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
vue.createVNode(_sfc_main$E, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
769
769
|
]),
|
|
770
770
|
default: vue.withCtx(({ item }) => [
|
|
771
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
771
|
+
vue.createElementVNode("div", _hoisted_1$n, [
|
|
772
772
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
773
773
|
vue.createElementVNode("span", _hoisted_2$d, vue.toDisplayString(item.value), 1)
|
|
774
774
|
])
|
|
@@ -864,7 +864,7 @@
|
|
|
864
864
|
}
|
|
865
865
|
});
|
|
866
866
|
|
|
867
|
-
const _hoisted_1$
|
|
867
|
+
const _hoisted_1$m = { class: "m-fields-event-select" };
|
|
868
868
|
const _hoisted_2$c = {
|
|
869
869
|
key: 1,
|
|
870
870
|
class: "fullWidth"
|
|
@@ -1031,7 +1031,7 @@
|
|
|
1031
1031
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
1032
1032
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
1033
1033
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
1034
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1034
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
1035
1035
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
1036
1036
|
key: 0,
|
|
1037
1037
|
ref: "eventForm",
|
|
@@ -1082,7 +1082,7 @@
|
|
|
1082
1082
|
}
|
|
1083
1083
|
});
|
|
1084
1084
|
|
|
1085
|
-
const _hoisted_1$
|
|
1085
|
+
const _hoisted_1$l = { class: "m-fields-key-value" };
|
|
1086
1086
|
const _hoisted_2$b = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
1087
1087
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
1088
1088
|
...{
|
|
@@ -1127,7 +1127,7 @@
|
|
|
1127
1127
|
records.value.splice(index, 1);
|
|
1128
1128
|
};
|
|
1129
1129
|
return (_ctx, _cache) => {
|
|
1130
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1130
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
1131
1131
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
1132
1132
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1133
1133
|
class: "m-fields-key-value-item",
|
|
@@ -1178,6 +1178,11 @@
|
|
|
1178
1178
|
}
|
|
1179
1179
|
});
|
|
1180
1180
|
|
|
1181
|
+
const _hoisted_1$k = {
|
|
1182
|
+
key: 1,
|
|
1183
|
+
class: "m-fields-ui-select",
|
|
1184
|
+
style: { "display": "flex" }
|
|
1185
|
+
};
|
|
1181
1186
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
1182
1187
|
...{
|
|
1183
1188
|
name: "MEditorUISelect"
|
|
@@ -1231,6 +1236,18 @@
|
|
|
1231
1236
|
mForm?.$emit("field-change", props.prop, "");
|
|
1232
1237
|
}
|
|
1233
1238
|
};
|
|
1239
|
+
const selectNode = async (id) => {
|
|
1240
|
+
await services?.editorService.select(id);
|
|
1241
|
+
services?.editorService.get("stage")?.select(id);
|
|
1242
|
+
};
|
|
1243
|
+
const highlight = lodashEs.throttle((id) => {
|
|
1244
|
+
services?.editorService.highlight(id);
|
|
1245
|
+
services?.editorService.get("stage")?.highlight(id);
|
|
1246
|
+
}, 150);
|
|
1247
|
+
const unhightlight = () => {
|
|
1248
|
+
services?.editorService.set("highlightNode", null);
|
|
1249
|
+
services?.editorService.get("stage")?.clearHighlight();
|
|
1250
|
+
};
|
|
1234
1251
|
return (_ctx, _cache) => {
|
|
1235
1252
|
return uiSelectMode.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1236
1253
|
key: 0,
|
|
@@ -1248,43 +1265,62 @@
|
|
|
1248
1265
|
]),
|
|
1249
1266
|
_: 1
|
|
1250
1267
|
}, 8, ["icon"])
|
|
1251
|
-
])) : (vue.openBlock(), vue.createElementBlock("div",
|
|
1252
|
-
key:
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1268
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
|
|
1269
|
+
val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
1270
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1271
|
+
content: "清除",
|
|
1272
|
+
placement: "top"
|
|
1273
|
+
}, {
|
|
1274
|
+
default: vue.withCtx(() => [
|
|
1275
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1276
|
+
style: { "padding": "0" },
|
|
1277
|
+
type: "danger",
|
|
1278
|
+
icon: vue.unref(iconsVue.Close),
|
|
1279
|
+
text: "",
|
|
1280
|
+
onClick: vue.withModifiers(deleteHandler, ["stop"])
|
|
1281
|
+
}, null, 8, ["icon", "onClick"])
|
|
1282
|
+
]),
|
|
1283
|
+
_: 1
|
|
1284
|
+
}),
|
|
1285
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1286
|
+
content: "点击选中组件",
|
|
1287
|
+
placement: "top"
|
|
1288
|
+
}, {
|
|
1289
|
+
default: vue.withCtx(() => [
|
|
1290
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1291
|
+
text: "",
|
|
1292
|
+
style: { "padding": "0", "margin": "0" },
|
|
1293
|
+
onClick: _cache[0] || (_cache[0] = ($event) => selectNode(val.value)),
|
|
1294
|
+
onMouseenter: _cache[1] || (_cache[1] = ($event) => vue.unref(highlight)(val.value)),
|
|
1295
|
+
onMouseleave: unhightlight
|
|
1296
|
+
}, {
|
|
1297
|
+
default: vue.withCtx(() => [
|
|
1298
|
+
vue.createTextVNode(vue.toDisplayString(`${toName.value}_${val.value}`), 1)
|
|
1299
|
+
]),
|
|
1300
|
+
_: 1
|
|
1301
|
+
})
|
|
1302
|
+
]),
|
|
1303
|
+
_: 1
|
|
1304
|
+
})
|
|
1305
|
+
], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1306
|
+
key: 1,
|
|
1307
|
+
content: "点击此处选择",
|
|
1308
|
+
placement: "top"
|
|
1274
1309
|
}, {
|
|
1275
1310
|
default: vue.withCtx(() => [
|
|
1276
1311
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1277
1312
|
text: "",
|
|
1278
|
-
style: { "padding": "0", "margin": "0" }
|
|
1313
|
+
style: { "padding": "0", "margin": "0" },
|
|
1314
|
+
onClick: startSelect
|
|
1279
1315
|
}, {
|
|
1280
1316
|
default: vue.withCtx(() => [
|
|
1281
|
-
vue.createTextVNode(
|
|
1317
|
+
vue.createTextVNode("点击此处选择")
|
|
1282
1318
|
]),
|
|
1283
1319
|
_: 1
|
|
1284
1320
|
})
|
|
1285
1321
|
]),
|
|
1286
1322
|
_: 1
|
|
1287
|
-
}
|
|
1323
|
+
}))
|
|
1288
1324
|
]));
|
|
1289
1325
|
};
|
|
1290
1326
|
}
|
|
@@ -4669,11 +4705,16 @@
|
|
|
4669
4705
|
const editCode = async (key) => {
|
|
4670
4706
|
codeBlockService?.setCodeEditorContent(true, key);
|
|
4671
4707
|
};
|
|
4672
|
-
const deleteCode = (key) => {
|
|
4708
|
+
const deleteCode = async (key) => {
|
|
4673
4709
|
const currentCode = codeList.value.find((codeItem) => codeItem.id === key);
|
|
4674
4710
|
const existBinds = Boolean(currentCode?.children.length);
|
|
4675
4711
|
const undeleteableList = codeBlockService?.getUndeletableList() || [];
|
|
4676
4712
|
if (!existBinds && !undeleteableList.includes(key)) {
|
|
4713
|
+
await design.tMagicMessageBox.confirm("确定删除该代码块吗?", "提示", {
|
|
4714
|
+
confirmButtonText: "确定",
|
|
4715
|
+
cancelButtonText: "取消",
|
|
4716
|
+
type: "warning"
|
|
4717
|
+
});
|
|
4677
4718
|
codeBlockService?.deleteCodeDslByIds([key]);
|
|
4678
4719
|
} else {
|
|
4679
4720
|
if (typeof props.customError === "function") {
|