@tmagic/editor 1.3.0-alpha.22 → 1.3.0-alpha.23
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 +21 -103
- package/dist/tmagic-editor.js +169 -145
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +169 -145
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/layouts/sidebar/Sidebar.vue +20 -26
- package/src/services/editor.ts +43 -15
- package/src/theme/sidebar.scss +18 -60
package/dist/tmagic-editor.js
CHANGED
|
@@ -2301,12 +2301,14 @@ let Editor$1 = class Editor extends BaseService {
|
|
|
2301
2301
|
const doc = stage?.renderer.contentWindow?.document;
|
|
2302
2302
|
if (doc) {
|
|
2303
2303
|
const el = doc.getElementById(`${node.id}`);
|
|
2304
|
-
const parentEl = el?.offsetParent;
|
|
2304
|
+
const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
|
|
2305
2305
|
if (parentEl && el) {
|
|
2306
2306
|
node.style.left = (parentEl.clientWidth - el.clientWidth) / 2;
|
|
2307
|
+
node.style.right = "";
|
|
2307
2308
|
}
|
|
2308
2309
|
} else if (parent.style && isNumber(parent.style?.width) && isNumber(node.style?.width)) {
|
|
2309
2310
|
node.style.left = (parent.style.width - node.style.width) / 2;
|
|
2311
|
+
node.style.right = "";
|
|
2310
2312
|
}
|
|
2311
2313
|
return node;
|
|
2312
2314
|
}
|
|
@@ -2418,21 +2420,43 @@ let Editor$1 = class Editor extends BaseService {
|
|
|
2418
2420
|
if (!node || isPage(node))
|
|
2419
2421
|
return;
|
|
2420
2422
|
const { style, id, type } = node;
|
|
2421
|
-
if (!style || style.position
|
|
2423
|
+
if (!style || !["absolute", "fixed"].includes(style.position))
|
|
2422
2424
|
return;
|
|
2423
|
-
|
|
2424
|
-
return;
|
|
2425
|
-
if (left && !isNumber(style.left))
|
|
2426
|
-
return;
|
|
2427
|
-
this.update({
|
|
2425
|
+
const update = (style2) => this.update({
|
|
2428
2426
|
id,
|
|
2429
2427
|
type,
|
|
2430
|
-
style:
|
|
2431
|
-
...style,
|
|
2432
|
-
left: Number(style.left) + left,
|
|
2433
|
-
top: Number(style.top) + top
|
|
2434
|
-
}
|
|
2428
|
+
style: style2
|
|
2435
2429
|
});
|
|
2430
|
+
if (top) {
|
|
2431
|
+
if (isNumber(style.top)) {
|
|
2432
|
+
update({
|
|
2433
|
+
...style,
|
|
2434
|
+
top: Number(style.top) + Number(top),
|
|
2435
|
+
bottom: ""
|
|
2436
|
+
});
|
|
2437
|
+
} else if (isNumber(style.bottom)) {
|
|
2438
|
+
update({
|
|
2439
|
+
...style,
|
|
2440
|
+
bottom: Number(style.bottom) - Number(top),
|
|
2441
|
+
top: ""
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
if (left) {
|
|
2446
|
+
if (isNumber(style.left)) {
|
|
2447
|
+
update({
|
|
2448
|
+
...style,
|
|
2449
|
+
left: Number(style.left) + Number(left),
|
|
2450
|
+
right: ""
|
|
2451
|
+
});
|
|
2452
|
+
} else if (isNumber(style.right)) {
|
|
2453
|
+
update({
|
|
2454
|
+
...style,
|
|
2455
|
+
right: Number(style.right) - Number(left),
|
|
2456
|
+
left: ""
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2436
2460
|
}
|
|
2437
2461
|
resetState() {
|
|
2438
2462
|
this.set("root", null);
|
|
@@ -2743,7 +2767,7 @@ const useCodeBlockEdit = (codeBlockService) => {
|
|
|
2743
2767
|
};
|
|
2744
2768
|
|
|
2745
2769
|
const _hoisted_1$p = { class: "m-fields-code-select-col" };
|
|
2746
|
-
const _hoisted_2$
|
|
2770
|
+
const _hoisted_2$i = { class: "code-select-container" };
|
|
2747
2771
|
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
2748
2772
|
...{
|
|
2749
2773
|
name: "MEditorCodeSelectCol"
|
|
@@ -2811,7 +2835,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
2811
2835
|
return (_ctx, _cache) => {
|
|
2812
2836
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
2813
2837
|
return openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
2814
|
-
createElementVNode("div", _hoisted_2$
|
|
2838
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
2815
2839
|
createVNode(_component_m_form_container, {
|
|
2816
2840
|
class: "select",
|
|
2817
2841
|
config: selectConfig,
|
|
@@ -2847,7 +2871,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
2847
2871
|
});
|
|
2848
2872
|
|
|
2849
2873
|
const _hoisted_1$o = { class: "m-editor-data-source-fields" };
|
|
2850
|
-
const _hoisted_2$
|
|
2874
|
+
const _hoisted_2$h = { class: "m-editor-data-source-fields-footer" };
|
|
2851
2875
|
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
2852
2876
|
...{
|
|
2853
2877
|
name: "MEditorDataSourceFields"
|
|
@@ -3004,7 +3028,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
3004
3028
|
data: _ctx.model[_ctx.name],
|
|
3005
3029
|
columns: fieldColumns
|
|
3006
3030
|
}, null, 8, ["data"]),
|
|
3007
|
-
createElementVNode("div", _hoisted_2$
|
|
3031
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
3008
3032
|
createVNode(unref(TMagicButton), {
|
|
3009
3033
|
size: "small",
|
|
3010
3034
|
type: "primary",
|
|
@@ -3083,8 +3107,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
3083
3107
|
});
|
|
3084
3108
|
|
|
3085
3109
|
const _hoisted_1$n = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3086
|
-
const _hoisted_2$
|
|
3087
|
-
const _hoisted_3$
|
|
3110
|
+
const _hoisted_2$g = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3111
|
+
const _hoisted_3$6 = { class: "el-input__inner" };
|
|
3088
3112
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
3089
3113
|
...{
|
|
3090
3114
|
name: "MEditorDataSourceInput"
|
|
@@ -3279,7 +3303,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3279
3303
|
default: withCtx(({ item }) => [
|
|
3280
3304
|
createElementVNode("div", _hoisted_1$n, [
|
|
3281
3305
|
createElementVNode("div", null, toDisplayString(item.text), 1),
|
|
3282
|
-
createElementVNode("span", _hoisted_2$
|
|
3306
|
+
createElementVNode("span", _hoisted_2$g, toDisplayString(item.value), 1)
|
|
3283
3307
|
])
|
|
3284
3308
|
]),
|
|
3285
3309
|
_: 1
|
|
@@ -3291,7 +3315,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
3291
3315
|
createElementVNode("div", {
|
|
3292
3316
|
class: normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
3293
3317
|
}, [
|
|
3294
|
-
createElementVNode("div", _hoisted_3$
|
|
3318
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
3295
3319
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
|
|
3296
3320
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3297
3321
|
item.type === "text" ? (openBlock(), createElementBlock("span", {
|
|
@@ -3393,7 +3417,7 @@ const useDataSourceMethod = () => {
|
|
|
3393
3417
|
};
|
|
3394
3418
|
|
|
3395
3419
|
const _hoisted_1$m = { class: "m-editor-data-source-methods" };
|
|
3396
|
-
const _hoisted_2$
|
|
3420
|
+
const _hoisted_2$f = { class: "m-editor-data-source-methods-footer" };
|
|
3397
3421
|
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
3398
3422
|
...{
|
|
3399
3423
|
name: "MEditorDataSourceMethods"
|
|
@@ -3468,7 +3492,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3468
3492
|
data: _ctx.model[_ctx.name],
|
|
3469
3493
|
columns: methodColumns
|
|
3470
3494
|
}, null, 8, ["data"]),
|
|
3471
|
-
createElementVNode("div", _hoisted_2$
|
|
3495
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
3472
3496
|
createVNode(unref(TMagicButton), {
|
|
3473
3497
|
size: "small",
|
|
3474
3498
|
type: "primary",
|
|
@@ -3497,7 +3521,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
3497
3521
|
});
|
|
3498
3522
|
|
|
3499
3523
|
const _hoisted_1$l = { class: "m-fields-data-source-method-select" };
|
|
3500
|
-
const _hoisted_2$
|
|
3524
|
+
const _hoisted_2$e = { class: "data-source-method-select-container" };
|
|
3501
3525
|
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
3502
3526
|
...{
|
|
3503
3527
|
name: "MEditorDataSourceMethodSelect"
|
|
@@ -3577,7 +3601,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
3577
3601
|
return (_ctx, _cache) => {
|
|
3578
3602
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
3579
3603
|
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
3580
|
-
createElementVNode("div", _hoisted_2$
|
|
3604
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
3581
3605
|
createVNode(_component_m_form_container, {
|
|
3582
3606
|
class: "select",
|
|
3583
3607
|
config: cascaderConfig,
|
|
@@ -3669,7 +3693,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
3669
3693
|
});
|
|
3670
3694
|
|
|
3671
3695
|
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
3672
|
-
const _hoisted_2$
|
|
3696
|
+
const _hoisted_2$d = {
|
|
3673
3697
|
key: 1,
|
|
3674
3698
|
class: "fullWidth"
|
|
3675
3699
|
};
|
|
@@ -3873,7 +3897,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
3873
3897
|
model: _ctx.model,
|
|
3874
3898
|
config: tableConfig.value,
|
|
3875
3899
|
onChange: onChangeHandler
|
|
3876
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
3900
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$d, [
|
|
3877
3901
|
createVNode(unref(TMagicButton), {
|
|
3878
3902
|
class: "create-button",
|
|
3879
3903
|
type: "primary",
|
|
@@ -3923,7 +3947,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
3923
3947
|
});
|
|
3924
3948
|
|
|
3925
3949
|
const _hoisted_1$j = { class: "m-fields-key-value" };
|
|
3926
|
-
const _hoisted_2$
|
|
3950
|
+
const _hoisted_2$c = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
3927
3951
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
3928
3952
|
...{
|
|
3929
3953
|
name: "MEditorKeyValue"
|
|
@@ -3983,7 +4007,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
3983
4007
|
size: _ctx.size,
|
|
3984
4008
|
onChange: keyChangeHandler
|
|
3985
4009
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
3986
|
-
_hoisted_2$
|
|
4010
|
+
_hoisted_2$c,
|
|
3987
4011
|
createVNode(unref(TMagicInput), {
|
|
3988
4012
|
placeholder: "value",
|
|
3989
4013
|
modelValue: records.value[index][1],
|
|
@@ -4362,8 +4386,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
4362
4386
|
});
|
|
4363
4387
|
|
|
4364
4388
|
const _hoisted_1$h = { class: "m-editor-empty-panel" };
|
|
4365
|
-
const _hoisted_2$
|
|
4366
|
-
const _hoisted_3$
|
|
4389
|
+
const _hoisted_2$b = { class: "m-editor-empty-content" };
|
|
4390
|
+
const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
|
|
4367
4391
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
4368
4392
|
...{
|
|
4369
4393
|
name: "MEditorAddPageBox"
|
|
@@ -4385,7 +4409,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4385
4409
|
};
|
|
4386
4410
|
return (_ctx, _cache) => {
|
|
4387
4411
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
4388
|
-
createElementVNode("div", _hoisted_2$
|
|
4412
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
4389
4413
|
createElementVNode("div", {
|
|
4390
4414
|
class: "m-editor-empty-button",
|
|
4391
4415
|
onClick: clickHandler
|
|
@@ -4393,7 +4417,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4393
4417
|
createElementVNode("div", null, [
|
|
4394
4418
|
createVNode(_sfc_main$F, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
4395
4419
|
]),
|
|
4396
|
-
_hoisted_3$
|
|
4420
|
+
_hoisted_3$5
|
|
4397
4421
|
])
|
|
4398
4422
|
])
|
|
4399
4423
|
]);
|
|
@@ -4536,7 +4560,7 @@ const _hoisted_1$g = {
|
|
|
4536
4560
|
key: 1,
|
|
4537
4561
|
class: "menu-item-text"
|
|
4538
4562
|
};
|
|
4539
|
-
const _hoisted_2$
|
|
4563
|
+
const _hoisted_2$a = { class: "el-dropdown-link menubar-menu-button" };
|
|
4540
4564
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
4541
4565
|
...{
|
|
4542
4566
|
name: "MEditorToolButton"
|
|
@@ -4680,7 +4704,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
4680
4704
|
})) : createCommentVNode("", true)
|
|
4681
4705
|
]),
|
|
4682
4706
|
default: withCtx(() => [
|
|
4683
|
-
createElementVNode("span", _hoisted_2$
|
|
4707
|
+
createElementVNode("span", _hoisted_2$a, [
|
|
4684
4708
|
createTextVNode(toDisplayString(_ctx.data.text), 1),
|
|
4685
4709
|
createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
|
|
4686
4710
|
default: withCtx(() => [
|
|
@@ -4981,7 +5005,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4981
5005
|
});
|
|
4982
5006
|
|
|
4983
5007
|
const _hoisted_1$e = { xmlns: "http://www.w3.org/2000/svg" };
|
|
4984
|
-
const _hoisted_2$
|
|
5008
|
+
const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("g", {
|
|
4985
5009
|
fill: "#7C878E",
|
|
4986
5010
|
"fill-rule": "evenodd"
|
|
4987
5011
|
}, [
|
|
@@ -4991,8 +5015,8 @@ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
4991
5015
|
}),
|
|
4992
5016
|
/* @__PURE__ */ createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
|
|
4993
5017
|
], -1);
|
|
4994
|
-
const _hoisted_3$
|
|
4995
|
-
_hoisted_2$
|
|
5018
|
+
const _hoisted_3$4 = [
|
|
5019
|
+
_hoisted_2$9
|
|
4996
5020
|
];
|
|
4997
5021
|
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
4998
5022
|
...{
|
|
@@ -5001,7 +5025,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5001
5025
|
__name: "AppManageIcon",
|
|
5002
5026
|
setup(__props) {
|
|
5003
5027
|
return (_ctx, _cache) => {
|
|
5004
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$e, _hoisted_3$
|
|
5028
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$e, _hoisted_3$4);
|
|
5005
5029
|
};
|
|
5006
5030
|
}
|
|
5007
5031
|
});
|
|
@@ -5012,9 +5036,9 @@ const _hoisted_1$d = {
|
|
|
5012
5036
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5013
5037
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
5014
5038
|
};
|
|
5015
|
-
const _hoisted_2$
|
|
5016
|
-
const _hoisted_4$
|
|
5017
|
-
_hoisted_2$
|
|
5039
|
+
const _hoisted_2$8 = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
5040
|
+
const _hoisted_4$2 = [
|
|
5041
|
+
_hoisted_2$8
|
|
5018
5042
|
];
|
|
5019
5043
|
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
5020
5044
|
...{
|
|
@@ -5023,14 +5047,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5023
5047
|
__name: "CodeIcon",
|
|
5024
5048
|
setup(__props) {
|
|
5025
5049
|
return (_ctx, _cache) => {
|
|
5026
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_4$
|
|
5050
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_4$2);
|
|
5027
5051
|
};
|
|
5028
5052
|
}
|
|
5029
5053
|
});
|
|
5030
5054
|
|
|
5031
5055
|
const _hoisted_1$c = ["id"];
|
|
5032
|
-
const _hoisted_2$
|
|
5033
|
-
const _hoisted_3$
|
|
5056
|
+
const _hoisted_2$7 = { class: "list-item" };
|
|
5057
|
+
const _hoisted_3$3 = {
|
|
5034
5058
|
key: 2,
|
|
5035
5059
|
class: "right-tool"
|
|
5036
5060
|
};
|
|
@@ -5135,7 +5159,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5135
5159
|
id: data.id,
|
|
5136
5160
|
class: "list-container"
|
|
5137
5161
|
}, [
|
|
5138
|
-
createElementVNode("div", _hoisted_2$
|
|
5162
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
5139
5163
|
data.type === "code" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
5140
5164
|
key: 0,
|
|
5141
5165
|
class: "codeIcon"
|
|
@@ -5147,7 +5171,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5147
5171
|
createElementVNode("span", {
|
|
5148
5172
|
class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
|
|
5149
5173
|
}, toDisplayString(data.name) + " (" + toDisplayString(data.id) + ")", 3),
|
|
5150
|
-
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
5174
|
+
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
5151
5175
|
createVNode(unref(TMagicTooltip), {
|
|
5152
5176
|
effect: "dark",
|
|
5153
5177
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -5331,8 +5355,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5331
5355
|
});
|
|
5332
5356
|
|
|
5333
5357
|
const _hoisted_1$a = ["id"];
|
|
5334
|
-
const _hoisted_2$
|
|
5335
|
-
const _hoisted_3$
|
|
5358
|
+
const _hoisted_2$6 = { class: "list-item" };
|
|
5359
|
+
const _hoisted_3$2 = {
|
|
5336
5360
|
key: 2,
|
|
5337
5361
|
class: "right-tool"
|
|
5338
5362
|
};
|
|
@@ -5431,7 +5455,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5431
5455
|
id: data.id,
|
|
5432
5456
|
class: "list-container"
|
|
5433
5457
|
}, [
|
|
5434
|
-
createElementVNode("div", _hoisted_2$
|
|
5458
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
5435
5459
|
data.type === "code" ? (openBlock(), createBlock(_sfc_main$F, {
|
|
5436
5460
|
key: 0,
|
|
5437
5461
|
class: "codeIcon",
|
|
@@ -5445,7 +5469,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5445
5469
|
createElementVNode("span", {
|
|
5446
5470
|
class: normalizeClass(["name", { code: data.type === "ds", hook: data.type === "key" }])
|
|
5447
5471
|
}, toDisplayString(data.type === "key" ? data.name : `${data.name}(${data.id})`), 3),
|
|
5448
|
-
data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
5472
|
+
data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
5449
5473
|
createVNode(unref(TMagicTooltip), {
|
|
5450
5474
|
effect: "dark",
|
|
5451
5475
|
content: editable.value ? "编辑" : "查看",
|
|
@@ -5490,7 +5514,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5490
5514
|
});
|
|
5491
5515
|
|
|
5492
5516
|
const _hoisted_1$9 = { class: "search-wrapper" };
|
|
5493
|
-
const _hoisted_2$
|
|
5517
|
+
const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
|
|
5494
5518
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
5495
5519
|
...{
|
|
5496
5520
|
name: "MEditorDataSourceListPanel"
|
|
@@ -5563,7 +5587,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5563
5587
|
})
|
|
5564
5588
|
]),
|
|
5565
5589
|
default: withCtx(() => [
|
|
5566
|
-
createElementVNode("div", _hoisted_2$
|
|
5590
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
5567
5591
|
(openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
|
|
5568
5592
|
return openBlock(), createBlock(_sfc_main$q, {
|
|
5569
5593
|
data: {
|
|
@@ -5601,7 +5625,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
5601
5625
|
});
|
|
5602
5626
|
|
|
5603
5627
|
const _hoisted_1$8 = ["onClick", "onDragstart"];
|
|
5604
|
-
const _hoisted_2$
|
|
5628
|
+
const _hoisted_2$4 = ["title"];
|
|
5605
5629
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
5606
5630
|
...{
|
|
5607
5631
|
name: "MEditorComponentListPanel"
|
|
@@ -5710,7 +5734,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
5710
5734
|
}, null, 8, ["title", "icon"]),
|
|
5711
5735
|
createElementVNode("span", {
|
|
5712
5736
|
title: item.text
|
|
5713
|
-
}, toDisplayString(item.text), 9, _hoisted_2$
|
|
5737
|
+
}, toDisplayString(item.text), 9, _hoisted_2$4)
|
|
5714
5738
|
])
|
|
5715
5739
|
], 40, _hoisted_1$8);
|
|
5716
5740
|
}), 128))
|
|
@@ -6378,6 +6402,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6378
6402
|
});
|
|
6379
6403
|
|
|
6380
6404
|
const _hoisted_1$5 = {
|
|
6405
|
+
key: 0,
|
|
6406
|
+
class: "m-editor-sidebar"
|
|
6407
|
+
};
|
|
6408
|
+
const _hoisted_2$3 = { class: "m-editor-sidebar-header" };
|
|
6409
|
+
const _hoisted_3$1 = ["onClick"];
|
|
6410
|
+
const _hoisted_4$1 = {
|
|
6381
6411
|
key: 1,
|
|
6382
6412
|
class: "magic-editor-tab-panel-title"
|
|
6383
6413
|
};
|
|
@@ -6392,8 +6422,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6392
6422
|
},
|
|
6393
6423
|
setup(__props, { expose: __expose }) {
|
|
6394
6424
|
const props = __props;
|
|
6395
|
-
const tabPaneComponent = getConfig$1("components")?.tabPane;
|
|
6396
|
-
const tabsComponent = getConfig$1("components")?.tabs;
|
|
6397
6425
|
const activeTabName = ref(props.data?.status);
|
|
6398
6426
|
const getItemConfig = (data) => {
|
|
6399
6427
|
const map = {
|
|
@@ -6446,98 +6474,94 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6446
6474
|
activeTabName
|
|
6447
6475
|
});
|
|
6448
6476
|
return (_ctx, _cache) => {
|
|
6449
|
-
return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(),
|
|
6450
|
-
|
|
6451
|
-
modelValue: activeTabName.value,
|
|
6452
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
|
|
6453
|
-
class: "m-editor-sidebar tmagic-design-tabs"
|
|
6454
|
-
}, unref(tabsComponent)?.props({ type: "card", tabPosition: "left" }) || {}), {
|
|
6455
|
-
default: withCtx(() => [
|
|
6477
|
+
return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
6478
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
6456
6479
|
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
6457
|
-
return openBlock(),
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
config.text ? (openBlock(), createElementBlock("div", _hoisted_1$5, toDisplayString(config.text), 1)) : createCommentVNode("", true)
|
|
6469
|
-
]))
|
|
6470
|
-
]),
|
|
6471
|
-
default: withCtx(() => [
|
|
6472
|
-
config ? (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({ key: 0 }, config.props || {}, toHandlers(config?.listeners || {})), createSlots({ _: 2 }, [
|
|
6473
|
-
config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
|
|
6474
|
-
name: "component-list-panel-header",
|
|
6475
|
-
fn: withCtx(() => [
|
|
6476
|
-
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6477
|
-
]),
|
|
6478
|
-
key: "0"
|
|
6479
|
-
} : void 0,
|
|
6480
|
-
config.$key === "component-list" || config.slots?.componentListItem ? {
|
|
6481
|
-
name: "component-list-item",
|
|
6482
|
-
fn: withCtx(({ component }) => [
|
|
6483
|
-
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-item", {
|
|
6484
|
-
key: 0,
|
|
6485
|
-
component
|
|
6486
|
-
}) : config.slots?.componentListItem ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListItem), {
|
|
6487
|
-
key: 1,
|
|
6488
|
-
component
|
|
6489
|
-
}, null, 8, ["component"])) : createCommentVNode("", true)
|
|
6490
|
-
]),
|
|
6491
|
-
key: "1"
|
|
6492
|
-
} : void 0,
|
|
6493
|
-
config.$key === "layer" || config.slots?.layerPanelHeader ? {
|
|
6494
|
-
name: "layer-panel-header",
|
|
6495
|
-
fn: withCtx(() => [
|
|
6496
|
-
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6497
|
-
]),
|
|
6498
|
-
key: "2"
|
|
6499
|
-
} : void 0,
|
|
6500
|
-
config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
|
|
6501
|
-
name: "code-block-panel-header",
|
|
6502
|
-
fn: withCtx(() => [
|
|
6503
|
-
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6504
|
-
]),
|
|
6505
|
-
key: "3"
|
|
6506
|
-
} : void 0,
|
|
6507
|
-
config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
|
|
6508
|
-
name: "code-block-panel-tool",
|
|
6509
|
-
fn: withCtx(({ id, data }) => [
|
|
6510
|
-
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
6511
|
-
key: 0,
|
|
6512
|
-
id,
|
|
6513
|
-
data
|
|
6514
|
-
}) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
|
|
6515
|
-
]),
|
|
6516
|
-
key: "4"
|
|
6517
|
-
} : void 0,
|
|
6518
|
-
config.$key === "layer" || config.slots?.layerNodeContent ? {
|
|
6519
|
-
name: "layer-node-content",
|
|
6520
|
-
fn: withCtx(({ data: nodeData, node }) => [
|
|
6521
|
-
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-node-content", {
|
|
6522
|
-
key: 0,
|
|
6523
|
-
data: nodeData,
|
|
6524
|
-
node
|
|
6525
|
-
}) : config.slots?.layerNodeContent ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerNodeContent), {
|
|
6526
|
-
key: 1,
|
|
6527
|
-
data: nodeData,
|
|
6528
|
-
node
|
|
6529
|
-
}, null, 8, ["data", "node"])) : createCommentVNode("", true)
|
|
6530
|
-
]),
|
|
6531
|
-
key: "5"
|
|
6532
|
-
} : void 0
|
|
6533
|
-
]), 1040)) : createCommentVNode("", true)
|
|
6534
|
-
]),
|
|
6535
|
-
_: 2
|
|
6536
|
-
}, 1040);
|
|
6480
|
+
return openBlock(), createElementBlock("div", {
|
|
6481
|
+
class: normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
6482
|
+
key: config.$key ?? index,
|
|
6483
|
+
onClick: ($event) => activeTabName.value = config.text || `${index}`
|
|
6484
|
+
}, [
|
|
6485
|
+
config.icon ? (openBlock(), createBlock(_sfc_main$F, {
|
|
6486
|
+
key: 0,
|
|
6487
|
+
icon: config.icon
|
|
6488
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
6489
|
+
config.text ? (openBlock(), createElementBlock("div", _hoisted_4$1, toDisplayString(config.text), 1)) : createCommentVNode("", true)
|
|
6490
|
+
], 10, _hoisted_3$1);
|
|
6537
6491
|
}), 128))
|
|
6538
6492
|
]),
|
|
6539
|
-
|
|
6540
|
-
|
|
6493
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
6494
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
6495
|
+
class: "m-editor-sidebar-content",
|
|
6496
|
+
key: config.$key ?? index
|
|
6497
|
+
}, [
|
|
6498
|
+
config ? (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({ key: 0 }, config.props || {}, toHandlers(config?.listeners || {})), createSlots({ _: 2 }, [
|
|
6499
|
+
config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
|
|
6500
|
+
name: "component-list-panel-header",
|
|
6501
|
+
fn: withCtx(() => [
|
|
6502
|
+
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6503
|
+
]),
|
|
6504
|
+
key: "0"
|
|
6505
|
+
} : void 0,
|
|
6506
|
+
config.$key === "component-list" || config.slots?.componentListItem ? {
|
|
6507
|
+
name: "component-list-item",
|
|
6508
|
+
fn: withCtx(({ component }) => [
|
|
6509
|
+
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-item", {
|
|
6510
|
+
key: 0,
|
|
6511
|
+
component
|
|
6512
|
+
}) : config.slots?.componentListItem ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListItem), {
|
|
6513
|
+
key: 1,
|
|
6514
|
+
component
|
|
6515
|
+
}, null, 8, ["component"])) : createCommentVNode("", true)
|
|
6516
|
+
]),
|
|
6517
|
+
key: "1"
|
|
6518
|
+
} : void 0,
|
|
6519
|
+
config.$key === "layer" || config.slots?.layerPanelHeader ? {
|
|
6520
|
+
name: "layer-panel-header",
|
|
6521
|
+
fn: withCtx(() => [
|
|
6522
|
+
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6523
|
+
]),
|
|
6524
|
+
key: "2"
|
|
6525
|
+
} : void 0,
|
|
6526
|
+
config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
|
|
6527
|
+
name: "code-block-panel-header",
|
|
6528
|
+
fn: withCtx(() => [
|
|
6529
|
+
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
6530
|
+
]),
|
|
6531
|
+
key: "3"
|
|
6532
|
+
} : void 0,
|
|
6533
|
+
config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
|
|
6534
|
+
name: "code-block-panel-tool",
|
|
6535
|
+
fn: withCtx(({ id, data }) => [
|
|
6536
|
+
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
6537
|
+
key: 0,
|
|
6538
|
+
id,
|
|
6539
|
+
data
|
|
6540
|
+
}) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
|
|
6541
|
+
]),
|
|
6542
|
+
key: "4"
|
|
6543
|
+
} : void 0,
|
|
6544
|
+
config.$key === "layer" || config.slots?.layerNodeContent ? {
|
|
6545
|
+
name: "layer-node-content",
|
|
6546
|
+
fn: withCtx(({ data: nodeData, node }) => [
|
|
6547
|
+
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-node-content", {
|
|
6548
|
+
key: 0,
|
|
6549
|
+
data: nodeData,
|
|
6550
|
+
node
|
|
6551
|
+
}) : config.slots?.layerNodeContent ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerNodeContent), {
|
|
6552
|
+
key: 1,
|
|
6553
|
+
data: nodeData,
|
|
6554
|
+
node
|
|
6555
|
+
}, null, 8, ["data", "node"])) : createCommentVNode("", true)
|
|
6556
|
+
]),
|
|
6557
|
+
key: "5"
|
|
6558
|
+
} : void 0
|
|
6559
|
+
]), 1040)) : createCommentVNode("", true)
|
|
6560
|
+
])), [
|
|
6561
|
+
[vShow, activeTabName.value === config.text]
|
|
6562
|
+
]);
|
|
6563
|
+
}), 128))
|
|
6564
|
+
])) : createCommentVNode("", true);
|
|
6541
6565
|
};
|
|
6542
6566
|
}
|
|
6543
6567
|
});
|