@tmagic/editor 1.2.0-beta.2 → 1.2.0-beta.4
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.mjs +415 -400
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +417 -402
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +9 -9
- package/src/components/ContentMenu.vue +2 -2
- package/src/components/Icon.vue +6 -4
- package/src/components/ToolButton.vue +29 -14
- package/src/fields/CodeSelect.vue +6 -6
- package/src/fields/UISelect.vue +8 -7
- package/src/layouts/AddPageBox.vue +2 -1
- package/src/layouts/Framework.vue +3 -2
- package/src/layouts/PropsPanel.vue +3 -8
- package/src/layouts/sidebar/ComponentListPanel.vue +13 -11
- package/src/layouts/sidebar/LayerPanel.vue +252 -162
- package/src/layouts/sidebar/Sidebar.vue +4 -2
- package/src/layouts/sidebar/TabPane.vue +4 -2
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +21 -16
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +19 -19
- package/src/layouts/workspace/PageBar.vue +11 -10
- package/types/Editor.vue.d.ts +2 -2
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +16 -883
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.
|
|
5
|
-
})(this, (function (exports, vue, serialize,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('lodash-es'), require('@tmagic/design'), require('@element-plus/icons-vue'), require('monaco-editor'), require('@tmagic/stage'), require('@tmagic/schema'), require('@tmagic/utils'), require('events'), require('@tmagic/core'), require('gesto'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', 'lodash-es', '@tmagic/design', '@element-plus/icons-vue', 'monaco-editor', '@tmagic/stage', '@tmagic/schema', '@tmagic/utils', 'events', '@tmagic/core', 'gesto', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.lodashEs, global.design, global.iconsVue, global.monaco, global.StageCore, global.schema, global.utils, global.events, global.core, global.Gesto, global.KeyController));
|
|
5
|
+
})(this, (function (exports, vue, serialize, lodashEs, design, iconsVue, monaco, StageCore, schema, utils, events, core, Gesto, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
8
8
|
|
|
@@ -172,12 +172,12 @@
|
|
|
172
172
|
})(CodeSelectOp || {});
|
|
173
173
|
|
|
174
174
|
const _hoisted_1$d = { class: "tool-bar" };
|
|
175
|
-
const _hoisted_2$
|
|
175
|
+
const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
176
176
|
fill: "currentColor",
|
|
177
177
|
d: "m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414L23 12zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414L3.828 12z"
|
|
178
178
|
}, null, -1);
|
|
179
179
|
const _hoisted_3$3 = [
|
|
180
|
-
_hoisted_2$
|
|
180
|
+
_hoisted_2$5
|
|
181
181
|
];
|
|
182
182
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
183
183
|
__name: "CodeSelect",
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
};
|
|
254
254
|
const viewHandler = async () => {
|
|
255
255
|
if (props.model[props.name].length === 0) {
|
|
256
|
-
|
|
256
|
+
design.tMagicMessage.error("\u8BF7\u5148\u7ED1\u5B9A\u4EE3\u7801\u5757");
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
await setCombineIds(props.model[props.name]);
|
|
@@ -262,13 +262,11 @@
|
|
|
262
262
|
};
|
|
263
263
|
return (_ctx, _cache) => {
|
|
264
264
|
const _component_m_fields_select = vue.resolveComponent("m-fields-select");
|
|
265
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
266
|
-
const _component_el_card = vue.resolveComponent("el-card");
|
|
267
265
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
268
266
|
class: "m-fields-code-select",
|
|
269
267
|
key: fieldKey.value
|
|
270
268
|
}, [
|
|
271
|
-
vue.createVNode(
|
|
269
|
+
vue.createVNode(vue.unref(design.TMagicCard), { shadow: "never" }, {
|
|
272
270
|
header: vue.withCtx(() => [
|
|
273
271
|
vue.createVNode(_component_m_fields_select, {
|
|
274
272
|
config: vue.unref(selectConfig),
|
|
@@ -281,7 +279,7 @@
|
|
|
281
279
|
]),
|
|
282
280
|
default: vue.withCtx(() => [
|
|
283
281
|
vue.createElementVNode("div", _hoisted_1$d, [
|
|
284
|
-
vue.createVNode(
|
|
282
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
285
283
|
class: "tool-item",
|
|
286
284
|
effect: "dark",
|
|
287
285
|
content: "\u67E5\u770B\u4EE3\u7801\u5757",
|
|
@@ -360,14 +358,12 @@
|
|
|
360
358
|
}
|
|
361
359
|
};
|
|
362
360
|
return (_ctx, _cache) => {
|
|
363
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
364
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
365
361
|
return uiSelectMode.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
366
362
|
key: 0,
|
|
367
363
|
class: "m-fields-ui-select",
|
|
368
364
|
onClick: cancelHandler
|
|
369
365
|
}, [
|
|
370
|
-
vue.createVNode(
|
|
366
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
371
367
|
type: "danger",
|
|
372
368
|
icon: vue.unref(iconsVue.Delete),
|
|
373
369
|
text: "",
|
|
@@ -384,12 +380,12 @@
|
|
|
384
380
|
onClick: startSelect,
|
|
385
381
|
style: { "display": "flex" }
|
|
386
382
|
}, [
|
|
387
|
-
vue.unref(val) ? (vue.openBlock(), vue.createBlock(
|
|
383
|
+
vue.unref(val) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
388
384
|
key: 0,
|
|
389
385
|
content: "\u6E05\u9664"
|
|
390
386
|
}, {
|
|
391
387
|
default: vue.withCtx(() => [
|
|
392
|
-
vue.createVNode(
|
|
388
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
393
389
|
style: { "padding": "0" },
|
|
394
390
|
type: "danger",
|
|
395
391
|
icon: vue.unref(iconsVue.Close),
|
|
@@ -399,11 +395,11 @@
|
|
|
399
395
|
]),
|
|
400
396
|
_: 1
|
|
401
397
|
})) : vue.createCommentVNode("", true),
|
|
402
|
-
vue.createVNode(
|
|
398
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
403
399
|
content: vue.unref(val) ? vue.unref(toName) + "_" + vue.unref(val) : "\u70B9\u51FB\u6B64\u5904\u9009\u62E9"
|
|
404
400
|
}, {
|
|
405
401
|
default: vue.withCtx(() => [
|
|
406
|
-
vue.createVNode(
|
|
402
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
407
403
|
text: "",
|
|
408
404
|
style: { "padding": "0", "margin": "0" }
|
|
409
405
|
}, {
|
|
@@ -552,6 +548,46 @@
|
|
|
552
548
|
};
|
|
553
549
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
554
550
|
|
|
551
|
+
const _hoisted_1$b = ["src"];
|
|
552
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
553
|
+
__name: "Icon",
|
|
554
|
+
props: {
|
|
555
|
+
icon: null
|
|
556
|
+
},
|
|
557
|
+
setup(__props) {
|
|
558
|
+
return (_ctx, _cache) => {
|
|
559
|
+
return !__props.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
560
|
+
key: 0,
|
|
561
|
+
class: "magic-editor-icon"
|
|
562
|
+
}, {
|
|
563
|
+
default: vue.withCtx(() => [
|
|
564
|
+
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
565
|
+
]),
|
|
566
|
+
_: 1
|
|
567
|
+
})) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
568
|
+
key: 1,
|
|
569
|
+
class: "magic-editor-icon"
|
|
570
|
+
}, {
|
|
571
|
+
default: vue.withCtx(() => [
|
|
572
|
+
vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$b)
|
|
573
|
+
]),
|
|
574
|
+
_: 1
|
|
575
|
+
})) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
576
|
+
key: 2,
|
|
577
|
+
class: vue.normalizeClass(["magic-editor-icon", __props.icon])
|
|
578
|
+
}, null, 2)) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
579
|
+
key: 3,
|
|
580
|
+
class: "magic-editor-icon"
|
|
581
|
+
}, {
|
|
582
|
+
default: vue.withCtx(() => [
|
|
583
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(__props.icon))))
|
|
584
|
+
]),
|
|
585
|
+
_: 1
|
|
586
|
+
}));
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
555
591
|
const log = (...args) => {
|
|
556
592
|
if (process.env.NODE_ENV === "development") {
|
|
557
593
|
console.log("magic editor: ", ...args);
|
|
@@ -2408,10 +2444,10 @@
|
|
|
2408
2444
|
return stage;
|
|
2409
2445
|
};
|
|
2410
2446
|
|
|
2411
|
-
const _hoisted_1$
|
|
2412
|
-
const _hoisted_2$
|
|
2447
|
+
const _hoisted_1$a = { class: "m-editor-empty-panel" };
|
|
2448
|
+
const _hoisted_2$4 = { class: "m-editor-empty-content" };
|
|
2413
2449
|
const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u65B0\u589E\u9875\u9762", -1);
|
|
2414
|
-
const _sfc_main$
|
|
2450
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
2415
2451
|
__name: "AddPageBox",
|
|
2416
2452
|
setup(__props) {
|
|
2417
2453
|
const services = vue.inject("services");
|
|
@@ -2425,20 +2461,14 @@
|
|
|
2425
2461
|
});
|
|
2426
2462
|
};
|
|
2427
2463
|
return (_ctx, _cache) => {
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
vue.createElementVNode("div", _hoisted_2$5, [
|
|
2464
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
2465
|
+
vue.createElementVNode("div", _hoisted_2$4, [
|
|
2431
2466
|
vue.createElementVNode("div", {
|
|
2432
2467
|
class: "m-editor-empty-button",
|
|
2433
2468
|
onClick: clickHandler
|
|
2434
2469
|
}, [
|
|
2435
2470
|
vue.createElementVNode("div", null, [
|
|
2436
|
-
vue.createVNode(
|
|
2437
|
-
default: vue.withCtx(() => [
|
|
2438
|
-
vue.createVNode(vue.unref(iconsVue.Plus))
|
|
2439
|
-
]),
|
|
2440
|
-
_: 1
|
|
2441
|
-
})
|
|
2471
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
2442
2472
|
]),
|
|
2443
2473
|
_hoisted_3$2
|
|
2444
2474
|
])
|
|
@@ -2448,7 +2478,7 @@
|
|
|
2448
2478
|
}
|
|
2449
2479
|
});
|
|
2450
2480
|
|
|
2451
|
-
const _sfc_main$
|
|
2481
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
2452
2482
|
__name: "Resizer",
|
|
2453
2483
|
emits: ["change"],
|
|
2454
2484
|
setup(__props, { emit }) {
|
|
@@ -2481,7 +2511,7 @@
|
|
|
2481
2511
|
}
|
|
2482
2512
|
});
|
|
2483
2513
|
|
|
2484
|
-
const _sfc_main$
|
|
2514
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2485
2515
|
__name: "Layout",
|
|
2486
2516
|
props: {
|
|
2487
2517
|
left: null,
|
|
@@ -2554,7 +2584,7 @@
|
|
|
2554
2584
|
}, [
|
|
2555
2585
|
vue.renderSlot(_ctx.$slots, "left")
|
|
2556
2586
|
], 6),
|
|
2557
|
-
vue.createVNode(_sfc_main$
|
|
2587
|
+
vue.createVNode(_sfc_main$l, { onChange: changeLeft })
|
|
2558
2588
|
], 64)) : vue.createCommentVNode("", true),
|
|
2559
2589
|
vue.createElementVNode("div", {
|
|
2560
2590
|
class: vue.normalizeClass(["m-editor-layout-center", __props.centerClass]),
|
|
@@ -2563,7 +2593,7 @@
|
|
|
2563
2593
|
vue.renderSlot(_ctx.$slots, "center")
|
|
2564
2594
|
], 6),
|
|
2565
2595
|
typeof props.right !== "undefined" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
2566
|
-
vue.createVNode(_sfc_main$
|
|
2596
|
+
vue.createVNode(_sfc_main$l, { onChange: changeRight }),
|
|
2567
2597
|
vue.createElementVNode("div", {
|
|
2568
2598
|
class: vue.normalizeClass(["m-editor-layout-right", __props.rightClass]),
|
|
2569
2599
|
style: vue.normalizeStyle(`width: ${__props.right}px`)
|
|
@@ -2576,8 +2606,8 @@
|
|
|
2576
2606
|
}
|
|
2577
2607
|
});
|
|
2578
2608
|
|
|
2579
|
-
const _hoisted_1$
|
|
2580
|
-
const _sfc_main$
|
|
2609
|
+
const _hoisted_1$9 = { class: "m-editor" };
|
|
2610
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2581
2611
|
__name: "Framework",
|
|
2582
2612
|
props: {
|
|
2583
2613
|
codeOptions: { default: () => ({}) }
|
|
@@ -2627,8 +2657,7 @@
|
|
|
2627
2657
|
};
|
|
2628
2658
|
return (_ctx, _cache) => {
|
|
2629
2659
|
const _component_magic_code_editor = vue.resolveComponent("magic-code-editor");
|
|
2630
|
-
|
|
2631
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
2660
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
2632
2661
|
vue.renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
|
|
2633
2662
|
vue.unref(showSrc) ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
|
|
2634
2663
|
key: 0,
|
|
@@ -2636,7 +2665,7 @@
|
|
|
2636
2665
|
"init-values": vue.unref(root),
|
|
2637
2666
|
options: __props.codeOptions,
|
|
2638
2667
|
onSave: saveCode
|
|
2639
|
-
}, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2668
|
+
}, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
2640
2669
|
key: 1,
|
|
2641
2670
|
class: "m-editor-content",
|
|
2642
2671
|
"left-class": "m-editor-framework-left",
|
|
@@ -2655,7 +2684,7 @@
|
|
|
2655
2684
|
]),
|
|
2656
2685
|
center: vue.withCtx(() => [
|
|
2657
2686
|
vue.unref(pageLength) > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
2658
|
-
vue.createVNode(_sfc_main$
|
|
2687
|
+
vue.createVNode(_sfc_main$m)
|
|
2659
2688
|
])
|
|
2660
2689
|
]),
|
|
2661
2690
|
_: 2
|
|
@@ -2663,7 +2692,7 @@
|
|
|
2663
2692
|
vue.unref(pageLength) > 0 ? {
|
|
2664
2693
|
name: "right",
|
|
2665
2694
|
fn: vue.withCtx(() => [
|
|
2666
|
-
vue.createVNode(
|
|
2695
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
2667
2696
|
default: vue.withCtx(() => [
|
|
2668
2697
|
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
2669
2698
|
]),
|
|
@@ -2677,52 +2706,11 @@
|
|
|
2677
2706
|
}
|
|
2678
2707
|
});
|
|
2679
2708
|
|
|
2680
|
-
const _hoisted_1$9 = ["src"];
|
|
2681
|
-
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2682
|
-
__name: "Icon",
|
|
2683
|
-
props: {
|
|
2684
|
-
icon: null
|
|
2685
|
-
},
|
|
2686
|
-
setup(__props) {
|
|
2687
|
-
return (_ctx, _cache) => {
|
|
2688
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
2689
|
-
return !__props.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2690
|
-
key: 0,
|
|
2691
|
-
class: "magic-editor-icon"
|
|
2692
|
-
}, {
|
|
2693
|
-
default: vue.withCtx(() => [
|
|
2694
|
-
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
2695
|
-
]),
|
|
2696
|
-
_: 1
|
|
2697
|
-
})) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2698
|
-
key: 1,
|
|
2699
|
-
class: "magic-editor-icon"
|
|
2700
|
-
}, {
|
|
2701
|
-
default: vue.withCtx(() => [
|
|
2702
|
-
vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$9)
|
|
2703
|
-
]),
|
|
2704
|
-
_: 1
|
|
2705
|
-
})) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
2706
|
-
key: 2,
|
|
2707
|
-
class: vue.normalizeClass(["magic-editor-icon", __props.icon])
|
|
2708
|
-
}, null, 2)) : (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2709
|
-
key: 3,
|
|
2710
|
-
class: "magic-editor-icon"
|
|
2711
|
-
}, {
|
|
2712
|
-
default: vue.withCtx(() => [
|
|
2713
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(__props.icon))))
|
|
2714
|
-
]),
|
|
2715
|
-
_: 1
|
|
2716
|
-
}));
|
|
2717
|
-
};
|
|
2718
|
-
}
|
|
2719
|
-
});
|
|
2720
|
-
|
|
2721
2709
|
const _hoisted_1$8 = {
|
|
2722
2710
|
key: 1,
|
|
2723
2711
|
class: "menu-item-text"
|
|
2724
2712
|
};
|
|
2725
|
-
const _hoisted_2$
|
|
2713
|
+
const _hoisted_2$3 = { class: "el-dropdown-link menubar-menu-button" };
|
|
2726
2714
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2727
2715
|
__name: "ToolButton",
|
|
2728
2716
|
props: {
|
|
@@ -2789,13 +2777,6 @@
|
|
|
2789
2777
|
}
|
|
2790
2778
|
};
|
|
2791
2779
|
return (_ctx, _cache) => {
|
|
2792
|
-
const _component_el_divider = vue.resolveComponent("el-divider");
|
|
2793
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
2794
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
2795
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
2796
|
-
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
2797
|
-
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
2798
|
-
const _component_el_dropdown = vue.resolveComponent("el-dropdown");
|
|
2799
2780
|
return vue.unref(display) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2800
2781
|
key: 0,
|
|
2801
2782
|
class: vue.normalizeClass(["menu-item", `${__props.data.type} ${__props.data.className || ""}`]),
|
|
@@ -2803,24 +2784,24 @@
|
|
|
2803
2784
|
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(__props.data, $event)),
|
|
2804
2785
|
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(__props.data, $event))
|
|
2805
2786
|
}, [
|
|
2806
|
-
__props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(
|
|
2787
|
+
__props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
2807
2788
|
key: 0,
|
|
2808
2789
|
direction: __props.data.direction || "vertical"
|
|
2809
2790
|
}, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, vue.toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
2810
|
-
__props.data.tooltip ? (vue.openBlock(), vue.createBlock(
|
|
2791
|
+
__props.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
2811
2792
|
key: 0,
|
|
2812
2793
|
effect: "dark",
|
|
2813
2794
|
placement: "bottom-start",
|
|
2814
2795
|
content: __props.data.tooltip
|
|
2815
2796
|
}, {
|
|
2816
2797
|
default: vue.withCtx(() => [
|
|
2817
|
-
vue.createVNode(
|
|
2798
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
2818
2799
|
size: "small",
|
|
2819
2800
|
text: "",
|
|
2820
2801
|
disabled: vue.unref(disabled)
|
|
2821
2802
|
}, {
|
|
2822
2803
|
default: vue.withCtx(() => [
|
|
2823
|
-
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2804
|
+
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
2824
2805
|
key: 0,
|
|
2825
2806
|
icon: __props.data.icon
|
|
2826
2807
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -2830,14 +2811,14 @@
|
|
|
2830
2811
|
}, 8, ["disabled"])
|
|
2831
2812
|
]),
|
|
2832
2813
|
_: 1
|
|
2833
|
-
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(
|
|
2814
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
2834
2815
|
key: 1,
|
|
2835
2816
|
size: "small",
|
|
2836
2817
|
text: "",
|
|
2837
2818
|
disabled: vue.unref(disabled)
|
|
2838
2819
|
}, {
|
|
2839
2820
|
default: vue.withCtx(() => [
|
|
2840
|
-
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2821
|
+
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
2841
2822
|
key: 0,
|
|
2842
2823
|
icon: __props.data.icon
|
|
2843
2824
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -2845,17 +2826,17 @@
|
|
|
2845
2826
|
]),
|
|
2846
2827
|
_: 1
|
|
2847
2828
|
}, 8, ["disabled"]))
|
|
2848
|
-
], 64)) : __props.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(
|
|
2829
|
+
], 64)) : __props.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
|
|
2849
2830
|
key: 3,
|
|
2850
2831
|
trigger: "click",
|
|
2851
2832
|
disabled: vue.unref(disabled),
|
|
2852
2833
|
onCommand: dropdownHandler
|
|
2853
2834
|
}, {
|
|
2854
2835
|
dropdown: vue.withCtx(() => [
|
|
2855
|
-
__props.data.items && __props.data.items.length ? (vue.openBlock(), vue.createBlock(
|
|
2836
|
+
__props.data.items && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
|
|
2856
2837
|
default: vue.withCtx(() => [
|
|
2857
2838
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.data.items, (subItem, index) => {
|
|
2858
|
-
return vue.openBlock(), vue.createBlock(
|
|
2839
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
|
|
2859
2840
|
key: index,
|
|
2860
2841
|
command: { data: __props.data, subItem }
|
|
2861
2842
|
}, {
|
|
@@ -2870,9 +2851,9 @@
|
|
|
2870
2851
|
})) : vue.createCommentVNode("", true)
|
|
2871
2852
|
]),
|
|
2872
2853
|
default: vue.withCtx(() => [
|
|
2873
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
2854
|
+
vue.createElementVNode("span", _hoisted_2$3, [
|
|
2874
2855
|
vue.createTextVNode(vue.toDisplayString(__props.data.text), 1),
|
|
2875
|
-
vue.createVNode(
|
|
2856
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
2876
2857
|
default: vue.withCtx(() => [
|
|
2877
2858
|
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
2878
2859
|
]),
|
|
@@ -3093,13 +3074,8 @@
|
|
|
3093
3074
|
services?.editorService.update(values2);
|
|
3094
3075
|
} catch (e) {
|
|
3095
3076
|
console.error(e);
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
duration: 1e4,
|
|
3099
|
-
showClose: true,
|
|
3100
|
-
message: e.message,
|
|
3101
|
-
dangerouslyUseHTMLString: true
|
|
3102
|
-
});
|
|
3077
|
+
design.tMagicMessage.closeAll();
|
|
3078
|
+
design.tMagicMessage.error(e.message);
|
|
3103
3079
|
}
|
|
3104
3080
|
};
|
|
3105
3081
|
expose({ submit });
|
|
@@ -3123,7 +3099,7 @@
|
|
|
3123
3099
|
});
|
|
3124
3100
|
|
|
3125
3101
|
const _hoisted_1$6 = ["id"];
|
|
3126
|
-
const _hoisted_2$
|
|
3102
|
+
const _hoisted_2$2 = { class: "list-item" };
|
|
3127
3103
|
const _hoisted_3$1 = { class: "code-name" };
|
|
3128
3104
|
const _hoisted_4$1 = { class: "code-name-wrapper" };
|
|
3129
3105
|
const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "\u4EE3\u7801\u5757\u540D\u79F0", -1);
|
|
@@ -3180,14 +3156,14 @@
|
|
|
3180
3156
|
const codeContent = codeEditor.value.getEditor()?.getValue();
|
|
3181
3157
|
codeConfig.value.content = eval(codeContent);
|
|
3182
3158
|
} catch (e) {
|
|
3183
|
-
|
|
3159
|
+
design.tMagicMessage.error(e.stack);
|
|
3184
3160
|
return false;
|
|
3185
3161
|
}
|
|
3186
3162
|
await services?.codeBlockService.setCodeDslById(id.value, {
|
|
3187
3163
|
name: codeConfig.value.name,
|
|
3188
3164
|
content: codeConfig.value.content
|
|
3189
3165
|
});
|
|
3190
|
-
|
|
3166
|
+
design.tMagicMessage.success("\u4EE3\u7801\u4FDD\u5B58\u6210\u529F");
|
|
3191
3167
|
return true;
|
|
3192
3168
|
};
|
|
3193
3169
|
const saveAndClose = async () => {
|
|
@@ -3201,12 +3177,7 @@
|
|
|
3201
3177
|
currentTitle.value = data.name;
|
|
3202
3178
|
};
|
|
3203
3179
|
return (_ctx, _cache) => {
|
|
3204
|
-
|
|
3205
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
3206
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
3207
|
-
const _component_el_card = vue.resolveComponent("el-card");
|
|
3208
|
-
const _component_el_dialog = vue.resolveComponent("el-dialog");
|
|
3209
|
-
return vue.openBlock(), vue.createBlock(_component_el_dialog, {
|
|
3180
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDialog), {
|
|
3210
3181
|
modelValue: vue.unref(isShowCodeBlockEditor),
|
|
3211
3182
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(isShowCodeBlockEditor) ? isShowCodeBlockEditor.value = $event : null),
|
|
3212
3183
|
class: "code-editor-dialog",
|
|
@@ -3216,7 +3187,7 @@
|
|
|
3216
3187
|
"append-to-body": true
|
|
3217
3188
|
}, {
|
|
3218
3189
|
default: vue.withCtx(() => [
|
|
3219
|
-
vue.createVNode(_sfc_main$
|
|
3190
|
+
vue.createVNode(_sfc_main$k, {
|
|
3220
3191
|
left: left.value,
|
|
3221
3192
|
"onUpdate:left": _cache[1] || (_cache[1] = ($event) => left.value = $event),
|
|
3222
3193
|
"min-left": 45,
|
|
@@ -3230,11 +3201,11 @@
|
|
|
3230
3201
|
])
|
|
3231
3202
|
}, [
|
|
3232
3203
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: vue.unref(id) }),
|
|
3233
|
-
vue.createVNode(
|
|
3204
|
+
vue.createVNode(vue.unref(design.TMagicCard), { shadow: "never" }, {
|
|
3234
3205
|
header: vue.withCtx(() => [
|
|
3235
3206
|
vue.createElementVNode("div", _hoisted_4$1, [
|
|
3236
3207
|
_hoisted_5$1,
|
|
3237
|
-
codeConfig.value ? (vue.openBlock(), vue.createBlock(
|
|
3208
|
+
codeConfig.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
|
|
3238
3209
|
key: 0,
|
|
3239
3210
|
class: "code-name-input",
|
|
3240
3211
|
modelValue: codeConfig.value.name,
|
|
@@ -3260,7 +3231,7 @@
|
|
|
3260
3231
|
}
|
|
3261
3232
|
}, null, 8, ["init-values", "options"])) : vue.createCommentVNode("", true),
|
|
3262
3233
|
vue.unref(editable) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, [
|
|
3263
|
-
vue.createVNode(
|
|
3234
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3264
3235
|
type: "primary",
|
|
3265
3236
|
class: "button",
|
|
3266
3237
|
onClick: saveCode
|
|
@@ -3270,7 +3241,7 @@
|
|
|
3270
3241
|
]),
|
|
3271
3242
|
_: 1
|
|
3272
3243
|
}),
|
|
3273
|
-
vue.createVNode(
|
|
3244
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3274
3245
|
type: "primary",
|
|
3275
3246
|
class: "button",
|
|
3276
3247
|
onClick: saveAndClose
|
|
@@ -3281,7 +3252,7 @@
|
|
|
3281
3252
|
_: 1
|
|
3282
3253
|
})
|
|
3283
3254
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
3284
|
-
vue.createVNode(
|
|
3255
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3285
3256
|
type: "primary",
|
|
3286
3257
|
class: "button",
|
|
3287
3258
|
onClick: saveAndClose
|
|
@@ -3303,23 +3274,22 @@
|
|
|
3303
3274
|
vue.unref(mode) === vue.unref(CodeEditorMode).LIST ? {
|
|
3304
3275
|
name: "left",
|
|
3305
3276
|
fn: vue.withCtx(() => [
|
|
3306
|
-
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(
|
|
3277
|
+
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
3307
3278
|
key: 0,
|
|
3308
|
-
|
|
3279
|
+
class: "side-tree",
|
|
3309
3280
|
"node-key": "id",
|
|
3310
3281
|
"empty-text": "\u6682\u65E0\u4EE3\u7801\u5757",
|
|
3311
3282
|
data: state.codeList,
|
|
3312
3283
|
"highlight-current": true,
|
|
3313
|
-
onNodeClick: selectHandler,
|
|
3314
3284
|
"current-node-key": state.codeList[0].id,
|
|
3315
|
-
|
|
3285
|
+
onNodeClick: selectHandler
|
|
3316
3286
|
}, {
|
|
3317
3287
|
default: vue.withCtx(({ data }) => [
|
|
3318
3288
|
vue.createElementVNode("div", {
|
|
3319
3289
|
id: data.id,
|
|
3320
3290
|
class: "list-container"
|
|
3321
3291
|
}, [
|
|
3322
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3292
|
+
vue.createElementVNode("div", _hoisted_2$2, [
|
|
3323
3293
|
vue.createElementVNode("div", _hoisted_3$1, vue.toDisplayString(data.name) + "\uFF08" + vue.toDisplayString(data.id) + "\uFF09", 1)
|
|
3324
3294
|
])
|
|
3325
3295
|
], 8, _hoisted_1$6)
|
|
@@ -3337,7 +3307,7 @@
|
|
|
3337
3307
|
});
|
|
3338
3308
|
|
|
3339
3309
|
const _hoisted_1$5 = { class: "m-editor-code-block-list" };
|
|
3340
|
-
const _hoisted_2$
|
|
3310
|
+
const _hoisted_2$1 = { class: "code-header-wrapper" };
|
|
3341
3311
|
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u65B0\u589E");
|
|
3342
3312
|
const _hoisted_4 = ["id"];
|
|
3343
3313
|
const _hoisted_5 = { class: "list-item" };
|
|
@@ -3427,7 +3397,7 @@
|
|
|
3427
3397
|
const createCodeBlock = async () => {
|
|
3428
3398
|
const { codeBlockService } = services || {};
|
|
3429
3399
|
if (!codeBlockService) {
|
|
3430
|
-
|
|
3400
|
+
design.tMagicMessage.error("\u65B0\u589E\u4EE3\u7801\u5757\u5931\u8D25");
|
|
3431
3401
|
return;
|
|
3432
3402
|
}
|
|
3433
3403
|
const codeConfig = {
|
|
@@ -3454,7 +3424,7 @@
|
|
|
3454
3424
|
if (typeof props.customError === "function") {
|
|
3455
3425
|
props.customError(key, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
3456
3426
|
} else {
|
|
3457
|
-
|
|
3427
|
+
design.tMagicMessage.error("\u4EE3\u7801\u5757\u5220\u9664\u5931\u8D25");
|
|
3458
3428
|
}
|
|
3459
3429
|
}
|
|
3460
3430
|
};
|
|
@@ -3486,14 +3456,10 @@
|
|
|
3486
3456
|
stage?.select(compId);
|
|
3487
3457
|
};
|
|
3488
3458
|
return (_ctx, _cache) => {
|
|
3489
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
3490
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
3491
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
3492
|
-
const _component_el_tree = vue.resolveComponent("el-tree");
|
|
3493
3459
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
3494
3460
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
3495
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3496
|
-
vue.createVNode(
|
|
3461
|
+
vue.createElementVNode("div", _hoisted_2$1, [
|
|
3462
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3497
3463
|
class: vue.normalizeClass([vue.unref(editable) ? "code-filter-input" : "code-filter-input-no-btn"]),
|
|
3498
3464
|
size: "small",
|
|
3499
3465
|
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
@@ -3502,7 +3468,7 @@
|
|
|
3502
3468
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
3503
3469
|
onInput: filterTextChangeHandler
|
|
3504
3470
|
}, null, 8, ["class", "modelValue"]),
|
|
3505
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(
|
|
3471
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3506
3472
|
key: 0,
|
|
3507
3473
|
class: "create-code-button",
|
|
3508
3474
|
type: "primary",
|
|
@@ -3516,7 +3482,7 @@
|
|
|
3516
3482
|
})) : vue.createCommentVNode("", true)
|
|
3517
3483
|
])
|
|
3518
3484
|
]),
|
|
3519
|
-
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(
|
|
3485
|
+
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
3520
3486
|
key: 0,
|
|
3521
3487
|
ref_key: "tree",
|
|
3522
3488
|
ref: tree,
|
|
@@ -3535,13 +3501,13 @@
|
|
|
3535
3501
|
vue.createElementVNode("div", _hoisted_5, [
|
|
3536
3502
|
vue.createElementVNode("div", _hoisted_6, vue.toDisplayString(data.name) + "\uFF08" + vue.toDisplayString(data.id) + "\uFF09", 1),
|
|
3537
3503
|
vue.createElementVNode("div", _hoisted_7, [
|
|
3538
|
-
vue.createVNode(
|
|
3504
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
3539
3505
|
effect: "dark",
|
|
3540
3506
|
content: vue.unref(editable) ? "\u7F16\u8F91" : "\u67E5\u770B",
|
|
3541
3507
|
placement: "bottom"
|
|
3542
3508
|
}, {
|
|
3543
3509
|
default: vue.withCtx(() => [
|
|
3544
|
-
vue.createVNode(_sfc_main$
|
|
3510
|
+
vue.createVNode(_sfc_main$n, {
|
|
3545
3511
|
icon: vue.unref(editable) ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3546
3512
|
class: "edit-icon",
|
|
3547
3513
|
onClick: vue.withModifiers(($event) => editCode(`${data.id}`), ["stop"])
|
|
@@ -3549,14 +3515,14 @@
|
|
|
3549
3515
|
]),
|
|
3550
3516
|
_: 2
|
|
3551
3517
|
}, 1032, ["content"]),
|
|
3552
|
-
state.bindComps[data.id] && state.bindComps[data.id].length > 0 ? (vue.openBlock(), vue.createBlock(
|
|
3518
|
+
state.bindComps[data.id] && state.bindComps[data.id].length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3553
3519
|
key: 0,
|
|
3554
3520
|
effect: "dark",
|
|
3555
3521
|
content: "\u67E5\u770B\u7ED1\u5B9A\u5173\u7CFB",
|
|
3556
3522
|
placement: "bottom"
|
|
3557
3523
|
}, {
|
|
3558
3524
|
default: vue.withCtx(() => [
|
|
3559
|
-
vue.createVNode(_sfc_main$
|
|
3525
|
+
vue.createVNode(_sfc_main$n, {
|
|
3560
3526
|
icon: vue.unref(iconsVue.Link),
|
|
3561
3527
|
class: "edit-icon",
|
|
3562
3528
|
onClick: vue.withModifiers(($event) => toggleCombineRelation(data), ["stop"])
|
|
@@ -3564,14 +3530,14 @@
|
|
|
3564
3530
|
]),
|
|
3565
3531
|
_: 2
|
|
3566
3532
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
3567
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(
|
|
3533
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3568
3534
|
key: 1,
|
|
3569
3535
|
effect: "dark",
|
|
3570
3536
|
content: "\u5220\u9664",
|
|
3571
3537
|
placement: "bottom"
|
|
3572
3538
|
}, {
|
|
3573
3539
|
default: vue.withCtx(() => [
|
|
3574
|
-
vue.createVNode(_sfc_main$
|
|
3540
|
+
vue.createVNode(_sfc_main$n, {
|
|
3575
3541
|
icon: vue.unref(iconsVue.Close),
|
|
3576
3542
|
class: "edit-icon",
|
|
3577
3543
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -3588,7 +3554,7 @@
|
|
|
3588
3554
|
data.showRelation && state.bindComps[data.id] && state.bindComps[data.id].length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
3589
3555
|
_hoisted_9,
|
|
3590
3556
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(state.bindComps[data.id], (comp, index) => {
|
|
3591
|
-
return vue.openBlock(), vue.createBlock(
|
|
3557
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3592
3558
|
key: index,
|
|
3593
3559
|
class: "code-comp",
|
|
3594
3560
|
size: "small",
|
|
@@ -3617,8 +3583,7 @@
|
|
|
3617
3583
|
}
|
|
3618
3584
|
});
|
|
3619
3585
|
|
|
3620
|
-
const _hoisted_1$4 =
|
|
3621
|
-
const _hoisted_2$1 = ["onClick", "onDragstart"];
|
|
3586
|
+
const _hoisted_1$4 = ["onClick", "onDragstart"];
|
|
3622
3587
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
3623
3588
|
__name: "ComponentListPanel",
|
|
3624
3589
|
setup(__props) {
|
|
@@ -3633,7 +3598,7 @@
|
|
|
3633
3598
|
}))
|
|
3634
3599
|
);
|
|
3635
3600
|
const collapseValue = vue.computed(
|
|
3636
|
-
() => Array(list.value?.length).fill(1).map((x, i) => i)
|
|
3601
|
+
() => Array(list.value?.length).fill(1).map((x, i) => `${i}`)
|
|
3637
3602
|
);
|
|
3638
3603
|
let timeout;
|
|
3639
3604
|
let clientX;
|
|
@@ -3685,20 +3650,15 @@
|
|
|
3685
3650
|
timeout = stage.value.getAddContainerHighlightClassNameTimeout(e);
|
|
3686
3651
|
};
|
|
3687
3652
|
return (_ctx, _cache) => {
|
|
3688
|
-
|
|
3689
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
3690
|
-
const _component_el_collapse_item = vue.resolveComponent("el-collapse-item");
|
|
3691
|
-
const _component_el_collapse = vue.resolveComponent("el-collapse");
|
|
3692
|
-
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
3693
|
-
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, null, {
|
|
3653
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), null, {
|
|
3694
3654
|
default: vue.withCtx(() => [
|
|
3695
3655
|
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
3696
|
-
vue.createVNode(
|
|
3656
|
+
vue.createVNode(vue.unref(design.TMagicCollapse), {
|
|
3697
3657
|
class: "ui-component-panel",
|
|
3698
3658
|
"model-value": vue.unref(collapseValue)
|
|
3699
3659
|
}, {
|
|
3700
3660
|
default: vue.withCtx(() => [
|
|
3701
|
-
vue.createVNode(
|
|
3661
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3702
3662
|
"prefix-icon": "el-icon-search",
|
|
3703
3663
|
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
3704
3664
|
class: "search-input",
|
|
@@ -3709,12 +3669,12 @@
|
|
|
3709
3669
|
}, null, 8, ["modelValue"]),
|
|
3710
3670
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(list), (group, index) => {
|
|
3711
3671
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3712
|
-
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(
|
|
3672
|
+
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
3713
3673
|
key: index,
|
|
3714
|
-
name: index
|
|
3674
|
+
name: `${index}`
|
|
3715
3675
|
}, {
|
|
3716
3676
|
title: vue.withCtx(() => [
|
|
3717
|
-
|
|
3677
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
3718
3678
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
3719
3679
|
]),
|
|
3720
3680
|
default: vue.withCtx(() => [
|
|
@@ -3729,10 +3689,10 @@
|
|
|
3729
3689
|
onDrag: dragHandler
|
|
3730
3690
|
}, [
|
|
3731
3691
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
3732
|
-
vue.createVNode(_sfc_main$
|
|
3692
|
+
vue.createVNode(_sfc_main$n, {
|
|
3733
3693
|
icon: item.icon
|
|
3734
3694
|
}, null, 8, ["icon"]),
|
|
3735
|
-
vue.createVNode(
|
|
3695
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
3736
3696
|
effect: "dark",
|
|
3737
3697
|
placement: "bottom",
|
|
3738
3698
|
content: item.text
|
|
@@ -3743,7 +3703,7 @@
|
|
|
3743
3703
|
_: 2
|
|
3744
3704
|
}, 1032, ["content"])
|
|
3745
3705
|
])
|
|
3746
|
-
], 40,
|
|
3706
|
+
], 40, _hoisted_1$4);
|
|
3747
3707
|
}), 128))
|
|
3748
3708
|
]),
|
|
3749
3709
|
_: 2
|
|
@@ -3971,255 +3931,307 @@
|
|
|
3971
3931
|
}
|
|
3972
3932
|
});
|
|
3973
3933
|
|
|
3974
|
-
const
|
|
3975
|
-
const
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3934
|
+
const _hoisted_1$3 = ["id", "onMouseenter"];
|
|
3935
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
3936
|
+
__name: "LayerPanel",
|
|
3937
|
+
setup(__props) {
|
|
3938
|
+
const throttleTime = 150;
|
|
3939
|
+
const services = vue.inject("services");
|
|
3940
|
+
const tree = vue.ref();
|
|
3941
|
+
const menu = vue.ref();
|
|
3942
|
+
const editorService = services?.editorService;
|
|
3943
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
3944
|
+
const values = vue.computed(() => page.value ? [page.value] : []);
|
|
3945
|
+
const selectedNodes = vue.ref([]);
|
|
3946
|
+
const selectedIds = vue.computed(() => selectedNodes.value.map((node) => node.id));
|
|
3947
|
+
const isMultiSelectStatus = vue.ref(false);
|
|
3948
|
+
const spliceNodeKey = vue.ref();
|
|
3949
|
+
const filterText = vue.ref("");
|
|
3950
|
+
const defaultExpandedKeys = vue.computed(() => selectedIds.value.length > 0 ? selectedIds.value : []);
|
|
3951
|
+
editorService?.on("remove", () => {
|
|
3952
|
+
setTimeout(() => {
|
|
3953
|
+
tree.value?.getNode(editorService.get("node").id)?.updateChildren();
|
|
3954
|
+
}, 0);
|
|
3955
|
+
});
|
|
3956
|
+
const select = async (data) => {
|
|
3957
|
+
if (!data.id) {
|
|
3958
|
+
throw new Error("\u6CA1\u6709id");
|
|
3959
|
+
}
|
|
3960
|
+
await editorService?.select(data);
|
|
3961
|
+
editorService?.get("stage")?.select(data.id);
|
|
3962
|
+
};
|
|
3963
|
+
const multiSelect = async (data) => {
|
|
3964
|
+
await editorService?.multiSelect(data);
|
|
3965
|
+
editorService?.get("stage")?.multiSelect(data);
|
|
3966
|
+
};
|
|
3967
|
+
const highlight = (data) => {
|
|
3968
|
+
if (!data?.id) {
|
|
3969
|
+
throw new Error("\u6CA1\u6709id");
|
|
3970
|
+
}
|
|
3971
|
+
editorService?.highlight(data);
|
|
3972
|
+
editorService?.get("stage")?.highlight(data.id);
|
|
3973
|
+
};
|
|
3974
|
+
const expandedKeys = /* @__PURE__ */ new Map();
|
|
3975
|
+
const allowDrop = (draggingNode, dropNode, type) => {
|
|
3976
|
+
const { data } = dropNode || {};
|
|
3977
|
+
const { data: ingData } = draggingNode;
|
|
3978
|
+
const { type: ingType } = ingData;
|
|
3979
|
+
if (ingType !== schema.NodeType.PAGE && data.type === schema.NodeType.PAGE)
|
|
3980
|
+
return false;
|
|
3981
|
+
if (ingType === schema.NodeType.PAGE && data.type !== schema.NodeType.PAGE)
|
|
3982
|
+
return false;
|
|
3983
|
+
if (!data || !data.type)
|
|
3984
|
+
return false;
|
|
3985
|
+
if (["prev", "next"].includes(type))
|
|
3986
|
+
return true;
|
|
3987
|
+
if (data.items || data.type === "container")
|
|
3988
|
+
return true;
|
|
3999
3989
|
return false;
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
if (data.items || data.type === "container")
|
|
4003
|
-
return true;
|
|
4004
|
-
return false;
|
|
4005
|
-
},
|
|
4006
|
-
async handleDragEnd(e) {
|
|
4007
|
-
if (!tree.value)
|
|
4008
|
-
return;
|
|
4009
|
-
const { data: node } = e;
|
|
4010
|
-
const parent = editorService?.getParentById(node.id, false);
|
|
4011
|
-
const layout = await editorService?.getLayout(parent);
|
|
4012
|
-
node.style.position = layout;
|
|
4013
|
-
if (layout === Layout.RELATIVE) {
|
|
4014
|
-
node.style.top = 0;
|
|
4015
|
-
node.style.left = 0;
|
|
4016
|
-
}
|
|
4017
|
-
const { data } = tree.value;
|
|
4018
|
-
const [page] = data;
|
|
4019
|
-
editorService?.update(page);
|
|
4020
|
-
}
|
|
4021
|
-
});
|
|
4022
|
-
const useStatus = (tree, editorService) => {
|
|
4023
|
-
const node = vue.ref();
|
|
4024
|
-
const page = vue.computed(() => editorService?.get("page"));
|
|
4025
|
-
const expandedKeys = /* @__PURE__ */ new Map();
|
|
4026
|
-
const expandNodes = () => {
|
|
4027
|
-
expandedKeys.forEach((key) => {
|
|
3990
|
+
};
|
|
3991
|
+
const handleDragEnd = async (e) => {
|
|
4028
3992
|
if (!tree.value)
|
|
4029
3993
|
return;
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
return;
|
|
4038
|
-
node.value = editorService.get("node");
|
|
4039
|
-
if (!node.value)
|
|
4040
|
-
return;
|
|
4041
|
-
tree.value.setCurrentKey(node.value.id, true);
|
|
4042
|
-
const parent = editorService.get("parent");
|
|
4043
|
-
if (!parent?.id)
|
|
4044
|
-
return;
|
|
4045
|
-
const treeNode = tree.value.getNode(parent.id);
|
|
4046
|
-
treeNode?.updateChildren();
|
|
4047
|
-
setTimeout(() => {
|
|
4048
|
-
tree.value && Object.entries(tree.value.store.nodesMap).forEach(([id, node2]) => {
|
|
4049
|
-
if (node2.expanded && node2.data.items) {
|
|
4050
|
-
expandedKeys.set(id, id);
|
|
4051
|
-
}
|
|
4052
|
-
});
|
|
4053
|
-
expandNodes();
|
|
4054
|
-
});
|
|
4055
|
-
});
|
|
4056
|
-
return {
|
|
4057
|
-
values: vue.computed(() => page.value ? [page.value] : []),
|
|
4058
|
-
loadItems: (node2, resolve) => {
|
|
4059
|
-
if (Array.isArray(node2.data)) {
|
|
4060
|
-
return resolve(node2.data);
|
|
3994
|
+
const { data: node } = e;
|
|
3995
|
+
const parent = editorService?.getParentById(node.id, false);
|
|
3996
|
+
const layout = await editorService?.getLayout(parent);
|
|
3997
|
+
node.style.position = layout;
|
|
3998
|
+
if (layout === Layout.RELATIVE) {
|
|
3999
|
+
node.style.top = 0;
|
|
4000
|
+
node.style.left = 0;
|
|
4061
4001
|
}
|
|
4062
|
-
|
|
4063
|
-
|
|
4002
|
+
const data = tree.value.getData();
|
|
4003
|
+
const [page2] = data;
|
|
4004
|
+
editorService?.update(page2);
|
|
4005
|
+
};
|
|
4006
|
+
const loadItems = (node, resolve) => {
|
|
4007
|
+
if (Array.isArray(node.data)) {
|
|
4008
|
+
return resolve(node.data);
|
|
4009
|
+
}
|
|
4010
|
+
if (Array.isArray(node.data?.items)) {
|
|
4011
|
+
return resolve(node.data?.items);
|
|
4064
4012
|
}
|
|
4065
4013
|
resolve([]);
|
|
4066
|
-
}
|
|
4067
|
-
|
|
4068
|
-
clickNode: node,
|
|
4069
|
-
expandedKeys: vue.computed(() => node.value ? [node.value.id] : []),
|
|
4070
|
-
handleCollapse: (data) => {
|
|
4014
|
+
};
|
|
4015
|
+
const handleCollapse = (data) => {
|
|
4071
4016
|
expandedKeys.delete(data.id);
|
|
4072
|
-
}
|
|
4073
|
-
handleExpand
|
|
4017
|
+
};
|
|
4018
|
+
const handleExpand = (data) => {
|
|
4074
4019
|
const parent = editorService?.getParentById(data.id);
|
|
4075
4020
|
if (!parent?.id)
|
|
4076
4021
|
return;
|
|
4077
4022
|
expandedKeys.set(parent.id, parent.id);
|
|
4078
|
-
}
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
}
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4023
|
+
};
|
|
4024
|
+
const filterNode = (value, data) => {
|
|
4025
|
+
if (!value) {
|
|
4026
|
+
return true;
|
|
4027
|
+
}
|
|
4028
|
+
let name = "";
|
|
4029
|
+
if (data.name) {
|
|
4030
|
+
name = data.name;
|
|
4031
|
+
} else if (data.items) {
|
|
4032
|
+
name = "container";
|
|
4033
|
+
}
|
|
4034
|
+
return `${data.id}${name}${data.type}`.indexOf(value) !== -1;
|
|
4035
|
+
};
|
|
4036
|
+
const filterTextChangeHandler = (val) => {
|
|
4037
|
+
tree.value?.filter(val);
|
|
4038
|
+
};
|
|
4039
|
+
const expandNodes = () => {
|
|
4040
|
+
expandedKeys.forEach((key) => {
|
|
4041
|
+
if (!tree.value)
|
|
4042
|
+
return;
|
|
4043
|
+
tree.value.getNode(key)?.expand();
|
|
4044
|
+
});
|
|
4045
|
+
};
|
|
4046
|
+
vue.watch(
|
|
4047
|
+
() => editorService?.get("nodes"),
|
|
4048
|
+
(nodes) => {
|
|
4049
|
+
if (!tree.value)
|
|
4050
|
+
return;
|
|
4051
|
+
if (!editorService)
|
|
4052
|
+
return;
|
|
4053
|
+
if (!nodes)
|
|
4054
|
+
return;
|
|
4055
|
+
selectedNodes.value = nodes;
|
|
4056
|
+
const parent = editorService.get("parent");
|
|
4057
|
+
if (!parent?.id)
|
|
4058
|
+
return;
|
|
4059
|
+
const treeNode = tree.value.getNode(parent.id);
|
|
4060
|
+
treeNode?.updateChildren();
|
|
4061
|
+
setTimeout(() => {
|
|
4062
|
+
tree.value && Object.entries(tree.value.getStore().nodesMap).forEach(([id, node]) => {
|
|
4063
|
+
if (node.expanded && node.data.items) {
|
|
4064
|
+
expandedKeys.set(id, id);
|
|
4065
|
+
}
|
|
4066
|
+
});
|
|
4067
|
+
expandNodes();
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4070
|
+
);
|
|
4071
|
+
const setTreeKeyStatus = () => {
|
|
4072
|
+
if (!tree.value)
|
|
4073
|
+
return;
|
|
4074
|
+
if (selectedIds.value.length === 0) {
|
|
4075
|
+
tree.value.setCheckedKeys([]);
|
|
4076
|
+
tree.value.setCurrentKey();
|
|
4077
|
+
} else if (selectedIds.value.length === 1 && !isMultiSelectStatus.value) {
|
|
4078
|
+
tree.value.setCurrentKey(selectedIds.value[0], true);
|
|
4079
|
+
tree.value.setCheckedKeys([]);
|
|
4080
|
+
} else {
|
|
4081
|
+
tree.value.setCheckedKeys(selectedIds.value);
|
|
4082
|
+
tree.value.setCurrentKey();
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4085
|
+
vue.watch(selectedIds, () => {
|
|
4086
|
+
setTreeKeyStatus();
|
|
4087
|
+
});
|
|
4088
|
+
const keycon = vue.ref();
|
|
4089
|
+
const addSelectModeListener = () => {
|
|
4090
|
+
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
4091
|
+
const ctrl = isMac ? "meta" : "ctrl";
|
|
4092
|
+
keycon.value = new KeyController__default.default();
|
|
4093
|
+
keycon.value.keydown(ctrl, (e) => {
|
|
4094
|
+
e.inputEvent.preventDefault();
|
|
4095
|
+
isMultiSelectStatus.value = true;
|
|
4096
|
+
});
|
|
4097
|
+
keycon.value.on("blur", () => {
|
|
4098
|
+
isMultiSelectStatus.value = false;
|
|
4099
|
+
});
|
|
4100
|
+
keycon.value.keyup(ctrl, (e) => {
|
|
4101
|
+
e.inputEvent.preventDefault();
|
|
4102
|
+
isMultiSelectStatus.value = false;
|
|
4103
|
+
});
|
|
4104
|
+
};
|
|
4105
|
+
const removeSelectModeListener = () => {
|
|
4106
|
+
keycon.value?.destroy();
|
|
4107
|
+
if (selectedIds.value.length === 1)
|
|
4108
|
+
isMultiSelectStatus.value = false;
|
|
4109
|
+
};
|
|
4106
4110
|
const clicked = vue.ref(false);
|
|
4107
|
-
const
|
|
4111
|
+
const highlightNode = vue.computed(() => editorService?.get("highlightNode"));
|
|
4108
4112
|
const highlightHandler = lodashEs.throttle((data) => {
|
|
4109
|
-
highlight(data
|
|
4113
|
+
highlight(data);
|
|
4110
4114
|
}, throttleTime);
|
|
4111
4115
|
const toggleClickFlag = () => {
|
|
4112
4116
|
clicked.value = !clicked.value;
|
|
4113
4117
|
};
|
|
4114
|
-
const
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4118
|
+
const canHighlight = (data) => {
|
|
4119
|
+
if (clicked.value)
|
|
4120
|
+
return false;
|
|
4121
|
+
return data.id === highlightNode?.value?.id && !selectedIds.value.includes(data.id) && spliceNodeKey.value !== data.id;
|
|
4122
|
+
};
|
|
4123
|
+
vue.watch(isMultiSelectStatus, () => {
|
|
4124
|
+
if (isMultiSelectStatus.value && selectedNodes.value.length === 1 && selectedNodes.value[0].type === schema.NodeType.PAGE) {
|
|
4125
|
+
selectedNodes.value = [];
|
|
4126
|
+
}
|
|
4122
4127
|
});
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4128
|
+
const multiClickHandler = (data) => {
|
|
4129
|
+
if (!data?.id) {
|
|
4130
|
+
throw new Error("\u6CA1\u6709id");
|
|
4131
|
+
}
|
|
4132
|
+
if (data.type === schema.NodeType.PAGE) {
|
|
4133
|
+
tree.value?.setCheckedKeys([]);
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
const index = selectedNodes.value.findIndex((node) => node.id === data.id);
|
|
4137
|
+
if (index !== -1) {
|
|
4138
|
+
selectedNodes.value.splice(index, 1);
|
|
4139
|
+
spliceNodeKey.value = data.id;
|
|
4140
|
+
} else {
|
|
4141
|
+
selectedNodes.value = [...selectedNodes.value, data];
|
|
4142
|
+
}
|
|
4143
|
+
tree.value?.setCheckedKeys(selectedIds.value);
|
|
4144
|
+
multiSelect(selectedIds.value);
|
|
4145
|
+
};
|
|
4146
|
+
const clickHandler = (data) => {
|
|
4147
|
+
if (!isMultiSelectStatus.value) {
|
|
4133
4148
|
if (services?.uiService.get("uiSelectMode")) {
|
|
4134
4149
|
document.dispatchEvent(new CustomEvent("ui-select", { detail: data }));
|
|
4135
4150
|
return;
|
|
4136
4151
|
}
|
|
4137
4152
|
tree.value?.setCurrentKey(data.id);
|
|
4138
|
-
select(data
|
|
4139
|
-
}
|
|
4140
|
-
|
|
4141
|
-
event.preventDefault();
|
|
4142
|
-
await select(data, editorService);
|
|
4143
|
-
menu.value?.show(event);
|
|
4153
|
+
select(data);
|
|
4154
|
+
} else {
|
|
4155
|
+
multiClickHandler(data);
|
|
4144
4156
|
}
|
|
4145
4157
|
};
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
const _hoisted_1$3 = ["id", "onMouseenter"];
|
|
4158
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4159
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
4160
|
-
const _component_el_tree = vue.resolveComponent("el-tree");
|
|
4161
|
-
const _component_layer_menu = vue.resolveComponent("layer-menu");
|
|
4162
|
-
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
4163
|
-
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, { class: "magic-editor-layer-panel" }, {
|
|
4164
|
-
default: vue.withCtx(() => [
|
|
4165
|
-
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4166
|
-
vue.createVNode(_component_el_input, {
|
|
4167
|
-
class: "filterInput",
|
|
4168
|
-
size: "small",
|
|
4169
|
-
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4170
|
-
clearable: "",
|
|
4171
|
-
modelValue: _ctx.filterText,
|
|
4172
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filterText = $event),
|
|
4173
|
-
onChange: _ctx.filterTextChangeHandler
|
|
4174
|
-
}, null, 8, ["modelValue", "onChange"]),
|
|
4175
|
-
_ctx.values.length ? (vue.openBlock(), vue.createBlock(_component_el_tree, {
|
|
4176
|
-
key: 0,
|
|
4177
|
-
ref: "tree",
|
|
4178
|
-
"node-key": "id",
|
|
4179
|
-
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4180
|
-
draggable: "",
|
|
4181
|
-
"default-expanded-keys": _ctx.expandedKeys,
|
|
4182
|
-
load: _ctx.loadItems,
|
|
4183
|
-
data: _ctx.values,
|
|
4184
|
-
"expand-on-click-node": false,
|
|
4185
|
-
"highlight-current": true,
|
|
4186
|
-
props: {
|
|
4187
|
-
children: "items"
|
|
4188
|
-
},
|
|
4189
|
-
"filter-node-method": _ctx.filterNode,
|
|
4190
|
-
"allow-drop": _ctx.allowDrop,
|
|
4191
|
-
onNodeClick: _ctx.clickHandler,
|
|
4192
|
-
onNodeContextmenu: _ctx.contextmenu,
|
|
4193
|
-
onNodeDragEnd: _ctx.handleDragEnd,
|
|
4194
|
-
onNodeCollapse: _ctx.handleCollapse,
|
|
4195
|
-
onNodeExpand: _ctx.handleExpand
|
|
4158
|
+
const contextmenu = async (event, data) => {
|
|
4159
|
+
event.preventDefault();
|
|
4160
|
+
await select(data);
|
|
4161
|
+
menu.value?.show(event);
|
|
4162
|
+
};
|
|
4163
|
+
return (_ctx, _cache) => {
|
|
4164
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), {
|
|
4165
|
+
class: "magic-editor-layer-panel",
|
|
4166
|
+
onMouseenter: addSelectModeListener,
|
|
4167
|
+
onMouseleave: removeSelectModeListener
|
|
4196
4168
|
}, {
|
|
4197
|
-
default: vue.withCtx((
|
|
4198
|
-
vue.
|
|
4199
|
-
|
|
4200
|
-
class:
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4169
|
+
default: vue.withCtx(() => [
|
|
4170
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4171
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4172
|
+
class: "filterInput",
|
|
4173
|
+
size: "small",
|
|
4174
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4175
|
+
clearable: "",
|
|
4176
|
+
modelValue: filterText.value,
|
|
4177
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
4178
|
+
onChange: filterTextChangeHandler
|
|
4179
|
+
}, null, 8, ["modelValue"]),
|
|
4180
|
+
vue.unref(values).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
4181
|
+
key: 0,
|
|
4182
|
+
ref_key: "tree",
|
|
4183
|
+
ref: tree,
|
|
4184
|
+
"node-key": "id",
|
|
4185
|
+
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4186
|
+
draggable: "",
|
|
4187
|
+
"default-expanded-keys": vue.unref(defaultExpandedKeys),
|
|
4188
|
+
load: loadItems,
|
|
4189
|
+
data: vue.unref(values),
|
|
4190
|
+
"expand-on-click-node": false,
|
|
4191
|
+
"highlight-current": true,
|
|
4192
|
+
props: {
|
|
4193
|
+
children: "items"
|
|
4194
|
+
},
|
|
4195
|
+
"filter-node-method": filterNode,
|
|
4196
|
+
"allow-drop": allowDrop,
|
|
4197
|
+
"show-checkbox": isMultiSelectStatus.value || vue.unref(selectedIds).length > 1,
|
|
4198
|
+
onNodeClick: clickHandler,
|
|
4199
|
+
onNodeContextmenu: contextmenu,
|
|
4200
|
+
onNodeDragEnd: handleDragEnd,
|
|
4201
|
+
onNodeCollapse: handleCollapse,
|
|
4202
|
+
onNodeExpand: handleExpand,
|
|
4203
|
+
onCheck: multiClickHandler,
|
|
4204
|
+
onMousedown: toggleClickFlag,
|
|
4205
|
+
onMouseup: toggleClickFlag
|
|
4206
|
+
}, {
|
|
4207
|
+
default: vue.withCtx(({ node, data }) => [
|
|
4208
|
+
vue.createElementVNode("div", {
|
|
4209
|
+
id: data.id,
|
|
4210
|
+
class: vue.normalizeClass(["cus-tree-node", { "cus-tree-node-hover": canHighlight(data) }]),
|
|
4211
|
+
onMouseenter: ($event) => vue.unref(highlightHandler)(data)
|
|
4212
|
+
}, [
|
|
4213
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4214
|
+
node,
|
|
4215
|
+
data
|
|
4216
|
+
}, () => [
|
|
4217
|
+
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
4218
|
+
])
|
|
4219
|
+
], 42, _hoisted_1$3)
|
|
4220
|
+
]),
|
|
4221
|
+
_: 3
|
|
4222
|
+
}, 8, ["default-expanded-keys", "data", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
4223
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
4224
|
+
vue.createVNode(_sfc_main$b, {
|
|
4225
|
+
ref_key: "menu",
|
|
4226
|
+
ref: menu
|
|
4227
|
+
}, null, 512)
|
|
4228
|
+
]))
|
|
4212
4229
|
]),
|
|
4213
4230
|
_: 3
|
|
4214
|
-
}
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
]),
|
|
4219
|
-
_: 3
|
|
4220
|
-
});
|
|
4221
|
-
}
|
|
4222
|
-
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$1]]);
|
|
4231
|
+
});
|
|
4232
|
+
};
|
|
4233
|
+
}
|
|
4234
|
+
});
|
|
4223
4235
|
|
|
4224
4236
|
const _hoisted_1$2 = {
|
|
4225
4237
|
key: 1,
|
|
@@ -4250,7 +4262,7 @@
|
|
|
4250
4262
|
type: "component",
|
|
4251
4263
|
icon: iconsVue.Files,
|
|
4252
4264
|
text: "\u5DF2\u9009\u7EC4\u4EF6",
|
|
4253
|
-
component:
|
|
4265
|
+
component: _sfc_main$a,
|
|
4254
4266
|
slots: {}
|
|
4255
4267
|
};
|
|
4256
4268
|
case "code-block":
|
|
@@ -4266,8 +4278,7 @@
|
|
|
4266
4278
|
}
|
|
4267
4279
|
});
|
|
4268
4280
|
return (_ctx, _cache) => {
|
|
4269
|
-
|
|
4270
|
-
return vue.unref(config) ? (vue.openBlock(), vue.createBlock(_component_el_tab_pane, {
|
|
4281
|
+
return vue.unref(config) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTabPane), {
|
|
4271
4282
|
key: 0,
|
|
4272
4283
|
name: vue.unref(config).text
|
|
4273
4284
|
}, {
|
|
@@ -4275,7 +4286,7 @@
|
|
|
4275
4286
|
(vue.openBlock(), vue.createElementBlock("div", {
|
|
4276
4287
|
key: vue.unref(config).text
|
|
4277
4288
|
}, [
|
|
4278
|
-
vue.unref(config).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4289
|
+
vue.unref(config).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
4279
4290
|
key: 0,
|
|
4280
4291
|
icon: vue.unref(config).icon
|
|
4281
4292
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -4373,8 +4384,7 @@
|
|
|
4373
4384
|
activeTabName
|
|
4374
4385
|
});
|
|
4375
4386
|
return (_ctx, _cache) => {
|
|
4376
|
-
|
|
4377
|
-
return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(_component_el_tabs, {
|
|
4387
|
+
return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTabs), {
|
|
4378
4388
|
key: 0,
|
|
4379
4389
|
class: "m-editor-sidebar",
|
|
4380
4390
|
modelValue: activeTabName.value,
|
|
@@ -4531,14 +4541,14 @@
|
|
|
4531
4541
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4532
4542
|
onClick: addPage
|
|
4533
4543
|
}, [
|
|
4534
|
-
vue.createVNode(_sfc_main$
|
|
4544
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
4535
4545
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1)),
|
|
4536
4546
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4537
4547
|
key: 2,
|
|
4538
4548
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4539
4549
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
4540
4550
|
}, [
|
|
4541
|
-
vue.createVNode(_sfc_main$
|
|
4551
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
4542
4552
|
])) : vue.createCommentVNode("", true),
|
|
4543
4553
|
vue.unref(pageLength) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4544
4554
|
key: 3,
|
|
@@ -4554,7 +4564,7 @@
|
|
|
4554
4564
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4555
4565
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
4556
4566
|
}, [
|
|
4557
|
-
vue.createVNode(_sfc_main$
|
|
4567
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
4558
4568
|
])) : vue.createCommentVNode("", true)
|
|
4559
4569
|
], 512);
|
|
4560
4570
|
};
|
|
@@ -4584,9 +4594,6 @@
|
|
|
4584
4594
|
editorService?.remove(node);
|
|
4585
4595
|
};
|
|
4586
4596
|
return (_ctx, _cache) => {
|
|
4587
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
4588
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
4589
|
-
const _component_el_popover = vue.resolveComponent("el-popover");
|
|
4590
4597
|
return vue.openBlock(), vue.createBlock(_sfc_main$7, null, {
|
|
4591
4598
|
default: vue.withCtx(() => [
|
|
4592
4599
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(root) && vue.unref(root).items || [], (item) => {
|
|
@@ -4597,7 +4604,7 @@
|
|
|
4597
4604
|
}, [
|
|
4598
4605
|
vue.createElementVNode("div", _hoisted_2, [
|
|
4599
4606
|
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
4600
|
-
vue.createVNode(
|
|
4607
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
4601
4608
|
effect: "dark",
|
|
4602
4609
|
placement: "top-start",
|
|
4603
4610
|
content: item.name
|
|
@@ -4609,14 +4616,14 @@
|
|
|
4609
4616
|
}, 1032, ["content"])
|
|
4610
4617
|
])
|
|
4611
4618
|
]),
|
|
4612
|
-
vue.createVNode(
|
|
4619
|
+
vue.createVNode(vue.unref(design.TMagicPopover), {
|
|
4613
4620
|
"popper-class": "page-bar-popover",
|
|
4614
4621
|
placement: "top",
|
|
4615
4622
|
width: 160,
|
|
4616
4623
|
trigger: "hover"
|
|
4617
4624
|
}, {
|
|
4618
4625
|
reference: vue.withCtx(() => [
|
|
4619
|
-
vue.createVNode(
|
|
4626
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
4620
4627
|
default: vue.withCtx(() => [
|
|
4621
4628
|
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
4622
4629
|
]),
|
|
@@ -5412,7 +5419,7 @@
|
|
|
5412
5419
|
Sidebar: _sfc_main$8,
|
|
5413
5420
|
Workspace: _sfc_main$1,
|
|
5414
5421
|
PropsPanel: _sfc_main$g,
|
|
5415
|
-
Framework: _sfc_main$
|
|
5422
|
+
Framework: _sfc_main$j
|
|
5416
5423
|
},
|
|
5417
5424
|
props: {
|
|
5418
5425
|
modelValue: {
|
|
@@ -5606,6 +5613,14 @@
|
|
|
5606
5613
|
}
|
|
5607
5614
|
});
|
|
5608
5615
|
|
|
5616
|
+
const _export_sfc = (sfc, props) => {
|
|
5617
|
+
const target = sfc.__vccOpts || sfc;
|
|
5618
|
+
for (const [key, val] of props) {
|
|
5619
|
+
target[key] = val;
|
|
5620
|
+
}
|
|
5621
|
+
return target;
|
|
5622
|
+
};
|
|
5623
|
+
|
|
5609
5624
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5610
5625
|
const _component_nav_menu = vue.resolveComponent("nav-menu");
|
|
5611
5626
|
const _component_sidebar = vue.resolveComponent("sidebar");
|
|
@@ -5719,10 +5734,10 @@
|
|
|
5719
5734
|
exports.ContentMenu = _sfc_main$c;
|
|
5720
5735
|
exports.Fixed2Other = Fixed2Other;
|
|
5721
5736
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
5722
|
-
exports.Icon = _sfc_main$
|
|
5737
|
+
exports.Icon = _sfc_main$n;
|
|
5723
5738
|
exports.Keys = Keys;
|
|
5724
5739
|
exports.LayerOffset = LayerOffset;
|
|
5725
|
-
exports.LayerPanel =
|
|
5740
|
+
exports.LayerPanel = _sfc_main$a;
|
|
5726
5741
|
exports.Layout = Layout;
|
|
5727
5742
|
exports.PropsPanel = _sfc_main$g;
|
|
5728
5743
|
exports.TMagicCodeEditor = _sfc_main$o;
|