@tmagic/editor 1.3.6 → 1.3.7
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/LICENSE +5432 -0
- package/dist/style.css +15 -11
- package/dist/tmagic-editor.js +1312 -949
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1334 -969
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -17
- package/src/Editor.vue +10 -7
- package/src/components/CodeBlockEditor.vue +2 -2
- package/src/components/ContentMenu.vue +5 -5
- package/src/components/ScrollBar.vue +2 -2
- package/src/components/ScrollViewer.vue +2 -2
- package/src/components/SplitView.vue +2 -2
- package/src/components/TreeNode.vue +3 -3
- package/src/editorProps.ts +14 -4
- package/src/fields/PageFragmentSelect.vue +55 -0
- package/src/hooks/use-getso.ts +2 -2
- package/src/hooks/use-stage.ts +18 -1
- package/src/index.ts +3 -0
- package/src/initService.ts +15 -5
- package/src/layouts/AddPageBox.vue +16 -4
- package/src/layouts/CodeEditor.vue +2 -2
- package/src/layouts/Framework.vue +17 -3
- package/src/layouts/PropsPanel.vue +2 -2
- package/src/layouts/page-bar/AddButton.vue +48 -0
- package/src/layouts/page-bar/PageBar.vue +158 -0
- package/src/layouts/{workspace → page-bar}/PageBarScrollContainer.vue +61 -35
- package/src/layouts/page-bar/SwitchTypeButton.vue +45 -0
- package/src/layouts/sidebar/Sidebar.vue +2 -0
- package/src/layouts/sidebar/layer/LayerMenu.vue +39 -27
- package/src/layouts/sidebar/layer/LayerPanel.vue +7 -1
- package/src/layouts/sidebar/layer/use-click.ts +5 -3
- package/src/layouts/sidebar/layer/use-keybinding.ts +8 -8
- package/src/layouts/sidebar/layer/use-node-status.ts +3 -3
- package/src/layouts/workspace/Workspace.vue +6 -7
- package/src/layouts/workspace/viewer/NodeListMenu.vue +2 -2
- package/src/layouts/workspace/viewer/Stage.vue +12 -5
- package/src/layouts/workspace/viewer/ViewerMenu.vue +93 -80
- package/src/services/editor.ts +65 -34
- package/src/services/history.ts +6 -2
- package/src/services/keybinding.ts +48 -13
- package/src/theme/code-block.scss +0 -16
- package/src/theme/page-bar.scss +18 -1
- package/src/type.ts +22 -7
- package/src/utils/content-menu.ts +2 -2
- package/src/utils/editor.ts +22 -15
- package/src/utils/operator.ts +4 -4
- package/types/components/ToolButton.vue.d.ts +2 -2
- package/types/editorProps.d.ts +11 -2
- package/types/fields/PageFragmentSelect.vue.d.ts +31 -0
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +14 -1
- package/types/layouts/Framework.vue.d.ts +14 -1
- package/types/layouts/PropsPanel.vue.d.ts +9 -9
- package/types/layouts/page-bar/AddButton.vue.d.ts +16 -0
- package/types/layouts/page-bar/PageBar.vue.d.ts +28 -0
- package/types/layouts/page-bar/PageBarScrollContainer.vue.d.ts +24 -0
- package/types/layouts/page-bar/SwitchTypeButton.vue.d.ts +20 -0
- package/types/layouts/sidebar/Sidebar.vue.d.ts +2 -0
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +22 -3
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +2 -0
- package/types/layouts/sidebar/layer/use-click.d.ts +25 -3
- package/types/layouts/sidebar/layer/use-keybinding.d.ts +1 -1
- package/types/layouts/workspace/Workspace.vue.d.ts +2 -0
- package/types/layouts/workspace/viewer/Stage.vue.d.ts +2 -0
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +8 -0
- package/types/services/dataSource.d.ts +1 -0
- package/types/services/editor.d.ts +3 -2
- package/types/services/history.d.ts +3 -2
- package/types/services/keybinding.d.ts +21 -1
- package/types/type.d.ts +25 -12
- package/types/utils/editor.d.ts +9 -7
- package/src/layouts/workspace/PageBar.vue +0 -87
- package/types/layouts/workspace/PageBar.vue.d.ts +0 -15
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +0 -9
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
};
|
|
30
30
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
31
31
|
|
|
32
|
-
const _hoisted_1$
|
|
32
|
+
const _hoisted_1$t = {
|
|
33
33
|
class: /* @__PURE__ */ vue.normalizeClass(`magic-code-editor`)
|
|
34
34
|
};
|
|
35
|
-
const _sfc_main$
|
|
35
|
+
const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
|
|
36
36
|
...{
|
|
37
37
|
name: "MEditorCodeEditor"
|
|
38
38
|
},
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
loading.value = true;
|
|
159
159
|
init();
|
|
160
160
|
});
|
|
161
|
-
vue.
|
|
161
|
+
vue.onBeforeUnmount(() => {
|
|
162
162
|
resizeObserver.disconnect();
|
|
163
163
|
});
|
|
164
164
|
const fullScreen = vue.ref(false);
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
return (_ctx, _cache) => {
|
|
193
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
193
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
|
|
194
194
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
195
195
|
to: "body",
|
|
196
196
|
disabled: !fullScreen.value
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
-
const _sfc_main$
|
|
221
|
+
const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
222
222
|
...{
|
|
223
223
|
name: "MEditorCode"
|
|
224
224
|
},
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
emit("change", v);
|
|
244
244
|
};
|
|
245
245
|
return (_ctx, _cache) => {
|
|
246
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
246
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
247
247
|
height: _ctx.config.height,
|
|
248
248
|
"init-values": _ctx.model[_ctx.name],
|
|
249
249
|
language: _ctx.config.language,
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
const _sfc_main$
|
|
261
|
+
const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
262
262
|
...{
|
|
263
263
|
name: "MEditorCodeLink"
|
|
264
264
|
},
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
-
const _sfc_main$
|
|
341
|
+
const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
|
|
342
342
|
...{
|
|
343
343
|
name: "MEditorCodeSelect"
|
|
344
344
|
},
|
|
@@ -411,11 +411,11 @@
|
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
|
|
414
|
-
const _hoisted_1$
|
|
415
|
-
const _hoisted_2$
|
|
416
|
-
const _hoisted_3$
|
|
417
|
-
const _hoisted_4$
|
|
418
|
-
const _sfc_main$
|
|
414
|
+
const _hoisted_1$s = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
415
|
+
const _hoisted_2$k = { style: { "flex": "1" } };
|
|
416
|
+
const _hoisted_3$8 = { style: { "flex": "1" } };
|
|
417
|
+
const _hoisted_4$7 = { class: "dialog-footer" };
|
|
418
|
+
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
419
419
|
...{
|
|
420
420
|
name: "MEditorCodeBlockEditor"
|
|
421
421
|
},
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
height.value = globalThis.innerHeight;
|
|
439
439
|
};
|
|
440
440
|
globalThis.addEventListener("resize", windowReizehandler);
|
|
441
|
-
vue.
|
|
441
|
+
vue.onBeforeUnmount(() => {
|
|
442
442
|
globalThis.removeEventListener("resize", windowReizehandler);
|
|
443
443
|
});
|
|
444
444
|
const magicVsEditor = vue.ref();
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
fullscreen: ""
|
|
637
637
|
}, {
|
|
638
638
|
footer: vue.withCtx(() => [
|
|
639
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
639
|
+
vue.createElementVNode("span", _hoisted_4$7, [
|
|
640
640
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
641
641
|
size: "small",
|
|
642
642
|
onClick: _cache[1] || (_cache[1] = ($event) => difVisible.value = false)
|
|
@@ -659,8 +659,8 @@
|
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
default: vue.withCtx(() => [
|
|
662
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
663
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
662
|
+
vue.createElementVNode("div", _hoisted_1$s, [
|
|
663
|
+
vue.createElementVNode("div", _hoisted_2$k, [
|
|
664
664
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
665
665
|
size: "small",
|
|
666
666
|
type: "info"
|
|
@@ -671,7 +671,7 @@
|
|
|
671
671
|
_: 1
|
|
672
672
|
})
|
|
673
673
|
]),
|
|
674
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
674
|
+
vue.createElementVNode("div", _hoisted_3$8, [
|
|
675
675
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
676
676
|
size: "small",
|
|
677
677
|
type: "success"
|
|
@@ -683,7 +683,7 @@
|
|
|
683
683
|
})
|
|
684
684
|
])
|
|
685
685
|
]),
|
|
686
|
-
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
686
|
+
difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
687
687
|
key: 0,
|
|
688
688
|
ref_key: "magicVsEditor",
|
|
689
689
|
ref: magicVsEditor,
|
|
@@ -1614,25 +1614,33 @@
|
|
|
1614
1614
|
const UI_SELECT_MODE_EVENT_NAME = "ui-select";
|
|
1615
1615
|
|
|
1616
1616
|
const COPY_STORAGE_KEY = "$MagicEditorCopyData";
|
|
1617
|
-
const getPageList = (
|
|
1618
|
-
if (
|
|
1619
|
-
return
|
|
1620
|
-
|
|
1621
|
-
|
|
1617
|
+
const getPageList = (root) => {
|
|
1618
|
+
if (!root)
|
|
1619
|
+
return [];
|
|
1620
|
+
if (!Array.isArray(root.items))
|
|
1621
|
+
return [];
|
|
1622
|
+
return root.items.filter((item) => utils.isPage(item));
|
|
1623
|
+
};
|
|
1624
|
+
const getPageFragmentList = (root) => {
|
|
1625
|
+
if (!root)
|
|
1626
|
+
return [];
|
|
1627
|
+
if (!Array.isArray(root.items))
|
|
1628
|
+
return [];
|
|
1629
|
+
return root.items.filter((item) => utils.isPageFragment(item));
|
|
1622
1630
|
};
|
|
1623
1631
|
const getPageNameList = (pages) => pages.map((page) => page.name || "index");
|
|
1624
|
-
const generatePageName = (pageNameList) => {
|
|
1632
|
+
const generatePageName = (pageNameList, type) => {
|
|
1625
1633
|
let pageLength = pageNameList.length;
|
|
1626
1634
|
if (!pageLength)
|
|
1627
|
-
return
|
|
1628
|
-
let pageName =
|
|
1635
|
+
return `${type}_index`;
|
|
1636
|
+
let pageName = `${type}_${pageLength}`;
|
|
1629
1637
|
while (pageNameList.includes(pageName)) {
|
|
1630
1638
|
pageLength += 1;
|
|
1631
|
-
pageName =
|
|
1639
|
+
pageName = `${type}_${pageLength}`;
|
|
1632
1640
|
}
|
|
1633
1641
|
return pageName;
|
|
1634
1642
|
};
|
|
1635
|
-
const generatePageNameByApp = (app) => generatePageName(getPageNameList(getPageList(app)));
|
|
1643
|
+
const generatePageNameByApp = (app, type) => generatePageName(getPageNameList(type === "page" ? getPageList(app) : getPageFragmentList(app)), type);
|
|
1636
1644
|
const isFixed = (node) => node.style?.position === "fixed";
|
|
1637
1645
|
const getNodeIndex = (id, parent) => {
|
|
1638
1646
|
const items = parent?.items || [];
|
|
@@ -1674,7 +1682,7 @@
|
|
|
1674
1682
|
}
|
|
1675
1683
|
return style;
|
|
1676
1684
|
};
|
|
1677
|
-
const
|
|
1685
|
+
const setChildrenLayout = (node, layout) => {
|
|
1678
1686
|
node.items?.forEach((child) => {
|
|
1679
1687
|
setLayout(child, layout);
|
|
1680
1688
|
});
|
|
@@ -1886,6 +1894,9 @@
|
|
|
1886
1894
|
}
|
|
1887
1895
|
reset() {
|
|
1888
1896
|
this.state.pageSteps = {};
|
|
1897
|
+
this.resetPage();
|
|
1898
|
+
}
|
|
1899
|
+
resetPage() {
|
|
1889
1900
|
this.state.pageId = void 0;
|
|
1890
1901
|
this.state.canRedo = false;
|
|
1891
1902
|
this.state.canUndo = false;
|
|
@@ -2275,9 +2286,12 @@
|
|
|
2275
2286
|
node: null,
|
|
2276
2287
|
nodes: [],
|
|
2277
2288
|
stage: null,
|
|
2289
|
+
stageLoading: true,
|
|
2278
2290
|
highlightNode: null,
|
|
2279
2291
|
modifiedNodeIds: /* @__PURE__ */ new Map(),
|
|
2280
|
-
pageLength: 0
|
|
2292
|
+
pageLength: 0,
|
|
2293
|
+
pageFragmentLength: 0,
|
|
2294
|
+
disabledMultiSelect: false
|
|
2281
2295
|
});
|
|
2282
2296
|
isHistoryStateChange = false;
|
|
2283
2297
|
constructor() {
|
|
@@ -2311,7 +2325,7 @@
|
|
|
2311
2325
|
}
|
|
2312
2326
|
/**
|
|
2313
2327
|
* 设置当前指点节点配置
|
|
2314
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
2328
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength' | 'pageFragmentLength
|
|
2315
2329
|
* @param value MNode
|
|
2316
2330
|
*/
|
|
2317
2331
|
set(name, value) {
|
|
@@ -2324,17 +2338,22 @@
|
|
|
2324
2338
|
if (Array.isArray(value)) {
|
|
2325
2339
|
throw new Error("root 不能为数组");
|
|
2326
2340
|
}
|
|
2327
|
-
if (value && lodashEs.isObject(value)
|
|
2328
|
-
|
|
2341
|
+
if (value && lodashEs.isObject(value)) {
|
|
2342
|
+
const app = value;
|
|
2343
|
+
this.state.pageLength = getPageList(app).length || 0;
|
|
2344
|
+
this.state.pageFragmentLength = getPageFragmentList(app).length || 0;
|
|
2345
|
+
this.state.stageLoading = this.state.pageLength !== 0;
|
|
2329
2346
|
} else {
|
|
2330
2347
|
this.state.pageLength = 0;
|
|
2348
|
+
this.state.pageFragmentLength = 0;
|
|
2349
|
+
this.state.stageLoading = false;
|
|
2331
2350
|
}
|
|
2332
2351
|
this.emit("root-change", value, preValue);
|
|
2333
2352
|
}
|
|
2334
2353
|
}
|
|
2335
2354
|
/**
|
|
2336
2355
|
* 获取当前指点节点配置
|
|
2337
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
2356
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength' | 'pageFragmentLength'
|
|
2338
2357
|
* @returns MNode
|
|
2339
2358
|
*/
|
|
2340
2359
|
get(name) {
|
|
@@ -2369,7 +2388,7 @@
|
|
|
2369
2388
|
info.node = path[path.length - 1];
|
|
2370
2389
|
info.parent = path[path.length - 2];
|
|
2371
2390
|
path.forEach((item) => {
|
|
2372
|
-
if (item
|
|
2391
|
+
if (utils.isPage(item) || utils.isPageFragment(item)) {
|
|
2373
2392
|
info.page = item;
|
|
2374
2393
|
return;
|
|
2375
2394
|
}
|
|
@@ -2493,6 +2512,16 @@
|
|
|
2493
2512
|
});
|
|
2494
2513
|
this.set("nodes", nodes);
|
|
2495
2514
|
}
|
|
2515
|
+
selectRoot() {
|
|
2516
|
+
const root = this.get("root");
|
|
2517
|
+
if (!root)
|
|
2518
|
+
return;
|
|
2519
|
+
this.set("nodes", [root]);
|
|
2520
|
+
this.set("parent", null);
|
|
2521
|
+
this.set("page", null);
|
|
2522
|
+
this.set("stage", null);
|
|
2523
|
+
this.set("highlightNode", null);
|
|
2524
|
+
}
|
|
2496
2525
|
async doAdd(node, parent) {
|
|
2497
2526
|
const root = this.get("root");
|
|
2498
2527
|
if (!root)
|
|
@@ -2501,10 +2530,10 @@
|
|
|
2501
2530
|
const stage = this.get("stage");
|
|
2502
2531
|
if (!curNode)
|
|
2503
2532
|
throw new Error("当前选中节点为空");
|
|
2504
|
-
if ((parent.type === schema.NodeType.ROOT || curNode?.type === schema.NodeType.ROOT) && node
|
|
2533
|
+
if ((parent.type === schema.NodeType.ROOT || curNode?.type === schema.NodeType.ROOT) && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2505
2534
|
throw new Error("app下不能添加组件");
|
|
2506
2535
|
}
|
|
2507
|
-
if (parent.id !== curNode.id && node
|
|
2536
|
+
if (parent.id !== curNode.id && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2508
2537
|
const index = parent.items.indexOf(curNode);
|
|
2509
2538
|
parent.items?.splice(index + 1, 0, node);
|
|
2510
2539
|
} else {
|
|
@@ -2546,7 +2575,7 @@
|
|
|
2546
2575
|
const newNodes = await Promise.all(
|
|
2547
2576
|
addNodes.map((node) => {
|
|
2548
2577
|
const root = this.get("root");
|
|
2549
|
-
if (utils.isPage(node) && root) {
|
|
2578
|
+
if ((utils.isPage(node) || utils.isPageFragment(node)) && root) {
|
|
2550
2579
|
return this.doAdd(node, root);
|
|
2551
2580
|
}
|
|
2552
2581
|
const parentNode = parent && typeof parent !== "function" ? parent : getAddParent(node);
|
|
@@ -2563,11 +2592,13 @@
|
|
|
2563
2592
|
await this.select(newNodes[0]);
|
|
2564
2593
|
if (utils.isPage(newNodes[0])) {
|
|
2565
2594
|
this.state.pageLength += 1;
|
|
2595
|
+
} else if (utils.isPageFragment(newNodes[0])) {
|
|
2596
|
+
this.state.pageFragmentLength += 1;
|
|
2566
2597
|
} else {
|
|
2567
2598
|
stage?.select(newNodes[0].id);
|
|
2568
2599
|
}
|
|
2569
2600
|
}
|
|
2570
|
-
if (!utils.isPage(newNodes[0])) {
|
|
2601
|
+
if (!(utils.isPage(newNodes[0]) || utils.isPageFragment(newNodes[0]))) {
|
|
2571
2602
|
this.pushHistoryState();
|
|
2572
2603
|
}
|
|
2573
2604
|
this.emit("add", newNodes);
|
|
@@ -2577,7 +2608,7 @@
|
|
|
2577
2608
|
const root = this.get("root");
|
|
2578
2609
|
if (!root)
|
|
2579
2610
|
throw new Error("root不能为空");
|
|
2580
|
-
const { parent, node: curNode } = this.getNodeInfo(node.id);
|
|
2611
|
+
const { parent, node: curNode } = this.getNodeInfo(node.id, false);
|
|
2581
2612
|
if (!parent || !curNode)
|
|
2582
2613
|
throw new Error("找不要删除的节点");
|
|
2583
2614
|
const index = getNodeIndex(curNode.id, parent);
|
|
@@ -2586,26 +2617,31 @@
|
|
|
2586
2617
|
parent.items?.splice(index, 1);
|
|
2587
2618
|
const stage = this.get("stage");
|
|
2588
2619
|
stage?.remove({ id: node.id, parentId: parent.id, root: lodashEs.cloneDeep(root) });
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
stage?.select(root.items[0].id);
|
|
2620
|
+
const selectDefault = async (pages) => {
|
|
2621
|
+
if (pages[0]) {
|
|
2622
|
+
await this.select(pages[0]);
|
|
2623
|
+
stage?.select(pages[0].id);
|
|
2594
2624
|
} else {
|
|
2595
|
-
this.
|
|
2596
|
-
|
|
2597
|
-
this.set("page", null);
|
|
2598
|
-
this.set("stage", null);
|
|
2599
|
-
this.set("highlightNode", null);
|
|
2600
|
-
this.resetModifiedNodeId();
|
|
2601
|
-
historyService.reset();
|
|
2602
|
-
return;
|
|
2625
|
+
this.selectRoot();
|
|
2626
|
+
historyService.resetPage();
|
|
2603
2627
|
}
|
|
2628
|
+
};
|
|
2629
|
+
const rootItems = root.items || [];
|
|
2630
|
+
if (utils.isPage(node)) {
|
|
2631
|
+
this.state.pageLength -= 1;
|
|
2632
|
+
await selectDefault(getPageList(root));
|
|
2633
|
+
} else if (utils.isPageFragment(node)) {
|
|
2634
|
+
this.state.pageFragmentLength -= 1;
|
|
2635
|
+
await selectDefault(getPageFragmentList(root));
|
|
2604
2636
|
} else {
|
|
2605
2637
|
await this.select(parent);
|
|
2606
2638
|
stage?.select(parent.id);
|
|
2639
|
+
this.addModifiedNodeId(parent.id);
|
|
2640
|
+
}
|
|
2641
|
+
if (!rootItems.length) {
|
|
2642
|
+
this.resetModifiedNodeId();
|
|
2643
|
+
historyService.reset();
|
|
2607
2644
|
}
|
|
2608
|
-
this.addModifiedNodeId(parent.id);
|
|
2609
2645
|
}
|
|
2610
2646
|
/**
|
|
2611
2647
|
* 删除组件
|
|
@@ -2614,7 +2650,7 @@
|
|
|
2614
2650
|
async remove(nodeOrNodeList) {
|
|
2615
2651
|
const nodes = Array.isArray(nodeOrNodeList) ? nodeOrNodeList : [nodeOrNodeList];
|
|
2616
2652
|
await Promise.all(nodes.map((node) => this.doRemove(node)));
|
|
2617
|
-
if (!utils.isPage(nodes[0])) {
|
|
2653
|
+
if (!(utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))) {
|
|
2618
2654
|
this.pushHistoryState();
|
|
2619
2655
|
}
|
|
2620
2656
|
this.emit("remove", nodes);
|
|
@@ -2654,7 +2690,7 @@
|
|
|
2654
2690
|
const newLayout = await this.getLayout(newConfig);
|
|
2655
2691
|
const layout = await this.getLayout(node);
|
|
2656
2692
|
if (Array.isArray(newConfig.items) && newLayout !== layout) {
|
|
2657
|
-
newConfig =
|
|
2693
|
+
newConfig = setChildrenLayout(newConfig, newLayout);
|
|
2658
2694
|
}
|
|
2659
2695
|
parentNodeItems[index] = newConfig;
|
|
2660
2696
|
const nodes = this.get("nodes");
|
|
@@ -2666,7 +2702,7 @@
|
|
|
2666
2702
|
parentId: parent.id,
|
|
2667
2703
|
root: lodashEs.cloneDeep(root)
|
|
2668
2704
|
});
|
|
2669
|
-
if (newConfig
|
|
2705
|
+
if (utils.isPage(newConfig) || utils.isPageFragment(newConfig)) {
|
|
2670
2706
|
this.set("page", newConfig);
|
|
2671
2707
|
}
|
|
2672
2708
|
this.addModifiedNodeId(newConfig.id);
|
|
@@ -3115,8 +3151,8 @@
|
|
|
3115
3151
|
};
|
|
3116
3152
|
}
|
|
3117
3153
|
const root = editorService.get("root");
|
|
3118
|
-
if (utils.isPage(pasteConfig) && root) {
|
|
3119
|
-
pasteConfig.name = generatePageNameByApp(root);
|
|
3154
|
+
if ((utils.isPage(pasteConfig) || utils.isPageFragment(pasteConfig)) && root) {
|
|
3155
|
+
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ? schema.NodeType.PAGE : schema.NodeType.PAGE_FRAGMENT);
|
|
3120
3156
|
}
|
|
3121
3157
|
return pasteConfig;
|
|
3122
3158
|
})
|
|
@@ -3154,7 +3190,7 @@
|
|
|
3154
3190
|
return newNode;
|
|
3155
3191
|
};
|
|
3156
3192
|
|
|
3157
|
-
const _sfc_main$
|
|
3193
|
+
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
3158
3194
|
...{
|
|
3159
3195
|
name: "MEditorCodeParams"
|
|
3160
3196
|
},
|
|
@@ -3204,8 +3240,8 @@
|
|
|
3204
3240
|
}
|
|
3205
3241
|
});
|
|
3206
3242
|
|
|
3207
|
-
const _hoisted_1$
|
|
3208
|
-
const _sfc_main$
|
|
3243
|
+
const _hoisted_1$r = ["src"];
|
|
3244
|
+
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
3209
3245
|
...{
|
|
3210
3246
|
name: "MEditorIcon"
|
|
3211
3247
|
},
|
|
@@ -3229,7 +3265,7 @@
|
|
|
3229
3265
|
class: "magic-editor-icon"
|
|
3230
3266
|
}, {
|
|
3231
3267
|
default: vue.withCtx(() => [
|
|
3232
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
3268
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$r)
|
|
3233
3269
|
]),
|
|
3234
3270
|
_: 1
|
|
3235
3271
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -3307,9 +3343,9 @@
|
|
|
3307
3343
|
};
|
|
3308
3344
|
};
|
|
3309
3345
|
|
|
3310
|
-
const _hoisted_1$
|
|
3311
|
-
const _hoisted_2$
|
|
3312
|
-
const _sfc_main$
|
|
3346
|
+
const _hoisted_1$q = { class: "m-fields-code-select-col" };
|
|
3347
|
+
const _hoisted_2$j = { class: "code-select-container" };
|
|
3348
|
+
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
3313
3349
|
...{
|
|
3314
3350
|
name: "MEditorCodeSelectCol"
|
|
3315
3351
|
},
|
|
@@ -3382,8 +3418,8 @@
|
|
|
3382
3418
|
const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
|
|
3383
3419
|
return (_ctx, _cache) => {
|
|
3384
3420
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
3385
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3386
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3421
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
|
|
3422
|
+
vue.createElementVNode("div", _hoisted_2$j, [
|
|
3387
3423
|
vue.createVNode(_component_m_form_container, {
|
|
3388
3424
|
class: "select",
|
|
3389
3425
|
config: selectConfig,
|
|
@@ -3391,14 +3427,14 @@
|
|
|
3391
3427
|
size: _ctx.size,
|
|
3392
3428
|
onChange: onParamsChangeHandler
|
|
3393
3429
|
}, null, 8, ["model", "size"]),
|
|
3394
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3430
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
3395
3431
|
key: 0,
|
|
3396
3432
|
class: "icon",
|
|
3397
3433
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3398
3434
|
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editCode)(_ctx.model[_ctx.name]))
|
|
3399
3435
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
3400
3436
|
]),
|
|
3401
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3437
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
3402
3438
|
key: 0,
|
|
3403
3439
|
name: "params",
|
|
3404
3440
|
model: _ctx.model,
|
|
@@ -3406,7 +3442,7 @@
|
|
|
3406
3442
|
"params-config": paramsConfig.value,
|
|
3407
3443
|
onChange: onParamsChangeHandler
|
|
3408
3444
|
}, null, 8, ["model", "size", "params-config"])) : vue.createCommentVNode("", true),
|
|
3409
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3445
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
3410
3446
|
key: 1,
|
|
3411
3447
|
ref_key: "codeBlockEditor",
|
|
3412
3448
|
ref: codeBlockEditor,
|
|
@@ -3419,9 +3455,9 @@
|
|
|
3419
3455
|
}
|
|
3420
3456
|
});
|
|
3421
3457
|
|
|
3422
|
-
const _hoisted_1$
|
|
3423
|
-
const _hoisted_2$
|
|
3424
|
-
const _sfc_main$
|
|
3458
|
+
const _hoisted_1$p = { class: "m-editor-data-source-fields" };
|
|
3459
|
+
const _hoisted_2$i = { class: "m-editor-data-source-fields-footer" };
|
|
3460
|
+
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
3425
3461
|
...{
|
|
3426
3462
|
name: "MEditorDataSourceFields"
|
|
3427
3463
|
},
|
|
@@ -3656,12 +3692,12 @@
|
|
|
3656
3692
|
}
|
|
3657
3693
|
};
|
|
3658
3694
|
return (_ctx, _cache) => {
|
|
3659
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3695
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
3660
3696
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3661
3697
|
data: _ctx.model[_ctx.name],
|
|
3662
3698
|
columns: fieldColumns
|
|
3663
3699
|
}, null, 8, ["data"]),
|
|
3664
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3700
|
+
vue.createElementVNode("div", _hoisted_2$i, [
|
|
3665
3701
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3666
3702
|
size: "small",
|
|
3667
3703
|
disabled: _ctx.disabled,
|
|
@@ -3713,7 +3749,7 @@
|
|
|
3713
3749
|
}
|
|
3714
3750
|
});
|
|
3715
3751
|
|
|
3716
|
-
const _sfc_main$
|
|
3752
|
+
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
3717
3753
|
__name: "DataSourceFieldSelect",
|
|
3718
3754
|
props: {
|
|
3719
3755
|
config: {},
|
|
@@ -3768,10 +3804,10 @@
|
|
|
3768
3804
|
}
|
|
3769
3805
|
});
|
|
3770
3806
|
|
|
3771
|
-
const _hoisted_1$
|
|
3772
|
-
const _hoisted_2$
|
|
3773
|
-
const _hoisted_3$
|
|
3774
|
-
const _sfc_main$
|
|
3807
|
+
const _hoisted_1$o = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3808
|
+
const _hoisted_2$h = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3809
|
+
const _hoisted_3$7 = { class: "el-input__inner" };
|
|
3810
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
3775
3811
|
...{
|
|
3776
3812
|
name: "MEditorDataSourceInput"
|
|
3777
3813
|
},
|
|
@@ -3961,12 +3997,12 @@
|
|
|
3961
3997
|
}
|
|
3962
3998
|
), {
|
|
3963
3999
|
suffix: vue.withCtx(() => [
|
|
3964
|
-
vue.createVNode(_sfc_main$
|
|
4000
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
3965
4001
|
]),
|
|
3966
4002
|
default: vue.withCtx(({ item }) => [
|
|
3967
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4003
|
+
vue.createElementVNode("div", _hoisted_1$o, [
|
|
3968
4004
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
3969
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
4005
|
+
vue.createElementVNode("span", _hoisted_2$h, vue.toDisplayString(item.value), 1)
|
|
3970
4006
|
])
|
|
3971
4007
|
]),
|
|
3972
4008
|
_: 1
|
|
@@ -3978,7 +4014,7 @@
|
|
|
3978
4014
|
vue.createElementVNode("div", {
|
|
3979
4015
|
class: vue.normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
3980
4016
|
}, [
|
|
3981
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
4017
|
+
vue.createElementVNode("div", _hoisted_3$7, [
|
|
3982
4018
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
|
|
3983
4019
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3984
4020
|
item.type === "text" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
@@ -3996,7 +4032,7 @@
|
|
|
3996
4032
|
}, 1032, ["size"])) : vue.createCommentVNode("", true)
|
|
3997
4033
|
], 64);
|
|
3998
4034
|
}), 256)),
|
|
3999
|
-
vue.createVNode(_sfc_main$
|
|
4035
|
+
vue.createVNode(_sfc_main$N, {
|
|
4000
4036
|
class: "tmagic-data-source-input-icon",
|
|
4001
4037
|
icon: vue.unref(iconsVue.Coin)
|
|
4002
4038
|
}, null, 8, ["icon"])
|
|
@@ -4079,9 +4115,9 @@
|
|
|
4079
4115
|
};
|
|
4080
4116
|
};
|
|
4081
4117
|
|
|
4082
|
-
const _hoisted_1$
|
|
4083
|
-
const _hoisted_2$
|
|
4084
|
-
const _sfc_main$
|
|
4118
|
+
const _hoisted_1$n = { class: "m-editor-data-source-methods" };
|
|
4119
|
+
const _hoisted_2$g = { class: "m-editor-data-source-methods-footer" };
|
|
4120
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
4085
4121
|
...{
|
|
4086
4122
|
name: "MEditorDataSourceMethods"
|
|
4087
4123
|
},
|
|
@@ -4151,12 +4187,12 @@
|
|
|
4151
4187
|
emit("change", props.model[props.name]);
|
|
4152
4188
|
};
|
|
4153
4189
|
return (_ctx, _cache) => {
|
|
4154
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4190
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
4155
4191
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4156
4192
|
data: _ctx.model[_ctx.name],
|
|
4157
4193
|
columns: methodColumns
|
|
4158
4194
|
}, null, 8, ["data"]),
|
|
4159
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4195
|
+
vue.createElementVNode("div", _hoisted_2$g, [
|
|
4160
4196
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4161
4197
|
size: "small",
|
|
4162
4198
|
type: "primary",
|
|
@@ -4170,7 +4206,7 @@
|
|
|
4170
4206
|
_: 1
|
|
4171
4207
|
}, 8, ["disabled"])
|
|
4172
4208
|
]),
|
|
4173
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4209
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4174
4210
|
key: 0,
|
|
4175
4211
|
ref_key: "codeBlockEditor",
|
|
4176
4212
|
ref: codeBlockEditor,
|
|
@@ -4185,9 +4221,9 @@
|
|
|
4185
4221
|
}
|
|
4186
4222
|
});
|
|
4187
4223
|
|
|
4188
|
-
const _hoisted_1$
|
|
4189
|
-
const _hoisted_2$
|
|
4190
|
-
const _sfc_main$
|
|
4224
|
+
const _hoisted_1$m = { class: "m-fields-data-source-method-select" };
|
|
4225
|
+
const _hoisted_2$f = { class: "data-source-method-select-container" };
|
|
4226
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
4191
4227
|
...{
|
|
4192
4228
|
name: "MEditorDataSourceMethodSelect"
|
|
4193
4229
|
},
|
|
@@ -4270,22 +4306,22 @@
|
|
|
4270
4306
|
};
|
|
4271
4307
|
return (_ctx, _cache) => {
|
|
4272
4308
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4273
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4274
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4309
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
4310
|
+
vue.createElementVNode("div", _hoisted_2$f, [
|
|
4275
4311
|
vue.createVNode(_component_m_form_container, {
|
|
4276
4312
|
class: "select",
|
|
4277
4313
|
config: cascaderConfig.value,
|
|
4278
4314
|
model: _ctx.model,
|
|
4279
4315
|
onChange: onChangeHandler
|
|
4280
4316
|
}, null, 8, ["config", "model"]),
|
|
4281
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4317
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
4282
4318
|
key: 0,
|
|
4283
4319
|
class: "icon",
|
|
4284
4320
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
4285
4321
|
onClick: editCodeHandler
|
|
4286
4322
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
4287
4323
|
]),
|
|
4288
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4324
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
4289
4325
|
key: 0,
|
|
4290
4326
|
name: "params",
|
|
4291
4327
|
model: _ctx.model,
|
|
@@ -4294,7 +4330,7 @@
|
|
|
4294
4330
|
"params-config": paramsConfig.value,
|
|
4295
4331
|
onChange: onChangeHandler
|
|
4296
4332
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : vue.createCommentVNode("", true),
|
|
4297
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4333
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4298
4334
|
key: 1,
|
|
4299
4335
|
ref_key: "codeBlockEditor",
|
|
4300
4336
|
ref: codeBlockEditor,
|
|
@@ -4307,9 +4343,9 @@
|
|
|
4307
4343
|
}
|
|
4308
4344
|
});
|
|
4309
4345
|
|
|
4310
|
-
const _hoisted_1$
|
|
4311
|
-
const _hoisted_2$
|
|
4312
|
-
const _sfc_main$
|
|
4346
|
+
const _hoisted_1$l = { class: "m-editor-data-source-fields" };
|
|
4347
|
+
const _hoisted_2$e = { class: "m-editor-data-source-fields-footer" };
|
|
4348
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
4313
4349
|
...{
|
|
4314
4350
|
name: "MEditorDataSourceMocks"
|
|
4315
4351
|
},
|
|
@@ -4396,7 +4432,7 @@
|
|
|
4396
4432
|
const columns = [
|
|
4397
4433
|
{
|
|
4398
4434
|
type: "expand",
|
|
4399
|
-
component: _sfc_main$
|
|
4435
|
+
component: _sfc_main$T,
|
|
4400
4436
|
props: (row) => ({
|
|
4401
4437
|
initValues: row.data,
|
|
4402
4438
|
language: "json",
|
|
@@ -4505,12 +4541,12 @@
|
|
|
4505
4541
|
});
|
|
4506
4542
|
};
|
|
4507
4543
|
return (_ctx, _cache) => {
|
|
4508
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4544
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
4509
4545
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4510
4546
|
data: _ctx.model[_ctx.name],
|
|
4511
4547
|
columns
|
|
4512
4548
|
}, null, 8, ["data"]),
|
|
4513
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4549
|
+
vue.createElementVNode("div", _hoisted_2$e, [
|
|
4514
4550
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4515
4551
|
size: "small",
|
|
4516
4552
|
type: "primary",
|
|
@@ -4541,7 +4577,7 @@
|
|
|
4541
4577
|
}
|
|
4542
4578
|
});
|
|
4543
4579
|
|
|
4544
|
-
const _sfc_main$
|
|
4580
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
4545
4581
|
...{
|
|
4546
4582
|
name: "MEditorDataSourceSelect"
|
|
4547
4583
|
},
|
|
@@ -4598,12 +4634,12 @@
|
|
|
4598
4634
|
}
|
|
4599
4635
|
});
|
|
4600
4636
|
|
|
4601
|
-
const _hoisted_1$
|
|
4602
|
-
const _hoisted_2$
|
|
4637
|
+
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
4638
|
+
const _hoisted_2$d = {
|
|
4603
4639
|
key: 1,
|
|
4604
4640
|
class: "fullWidth"
|
|
4605
4641
|
};
|
|
4606
|
-
const _sfc_main$
|
|
4642
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
4607
4643
|
...{
|
|
4608
4644
|
name: "MEditorEventSelect"
|
|
4609
4645
|
},
|
|
@@ -4806,7 +4842,7 @@
|
|
|
4806
4842
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4807
4843
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4808
4844
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
4809
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4845
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
|
|
4810
4846
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
4811
4847
|
key: 0,
|
|
4812
4848
|
ref: "eventForm",
|
|
@@ -4816,7 +4852,7 @@
|
|
|
4816
4852
|
model: _ctx.model,
|
|
4817
4853
|
config: tableConfig.value,
|
|
4818
4854
|
onChange: onChangeHandler
|
|
4819
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4855
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$d, [
|
|
4820
4856
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4821
4857
|
class: "create-button",
|
|
4822
4858
|
type: "primary",
|
|
@@ -4866,32 +4902,32 @@
|
|
|
4866
4902
|
}
|
|
4867
4903
|
});
|
|
4868
4904
|
|
|
4869
|
-
const _hoisted_1$
|
|
4905
|
+
const _hoisted_1$j = {
|
|
4870
4906
|
viewBox: "0 0 32 32",
|
|
4871
4907
|
version: "1.1",
|
|
4872
4908
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4873
4909
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
4874
4910
|
};
|
|
4875
|
-
const _hoisted_2$
|
|
4876
|
-
const _hoisted_4$
|
|
4877
|
-
_hoisted_2$
|
|
4911
|
+
const _hoisted_2$c = /* @__PURE__ */ vue.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);
|
|
4912
|
+
const _hoisted_4$6 = [
|
|
4913
|
+
_hoisted_2$c
|
|
4878
4914
|
];
|
|
4879
|
-
const _sfc_main$
|
|
4915
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
4880
4916
|
...{
|
|
4881
4917
|
name: "MEditorCodeIcon"
|
|
4882
4918
|
},
|
|
4883
4919
|
__name: "CodeIcon",
|
|
4884
4920
|
setup(__props) {
|
|
4885
4921
|
return (_ctx, _cache) => {
|
|
4886
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4922
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$j, _hoisted_4$6);
|
|
4887
4923
|
};
|
|
4888
4924
|
}
|
|
4889
4925
|
});
|
|
4890
4926
|
|
|
4891
|
-
const _hoisted_1$
|
|
4892
|
-
const _hoisted_2$
|
|
4893
|
-
const _hoisted_3$
|
|
4894
|
-
const _sfc_main$
|
|
4927
|
+
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
4928
|
+
const _hoisted_2$b = { key: 0 };
|
|
4929
|
+
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
4930
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
4895
4931
|
...{
|
|
4896
4932
|
name: "MEditorKeyValue"
|
|
4897
4933
|
},
|
|
@@ -4949,8 +4985,8 @@
|
|
|
4949
4985
|
emit("change", v);
|
|
4950
4986
|
};
|
|
4951
4987
|
return (_ctx, _cache) => {
|
|
4952
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4953
|
-
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4988
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
4989
|
+
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, [
|
|
4954
4990
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
4955
4991
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4956
4992
|
class: "m-fields-key-value-item",
|
|
@@ -4964,7 +5000,7 @@
|
|
|
4964
5000
|
size: _ctx.size,
|
|
4965
5001
|
onChange: keyChangeHandler
|
|
4966
5002
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
4967
|
-
_hoisted_3$
|
|
5003
|
+
_hoisted_3$6,
|
|
4968
5004
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4969
5005
|
placeholder: "value",
|
|
4970
5006
|
modelValue: records.value[index][1],
|
|
@@ -4999,7 +5035,7 @@
|
|
|
4999
5035
|
_: 1
|
|
5000
5036
|
}, 8, ["size", "disabled", "icon"])
|
|
5001
5037
|
])) : vue.createCommentVNode("", true),
|
|
5002
|
-
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5038
|
+
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
5003
5039
|
key: 1,
|
|
5004
5040
|
height: "200px",
|
|
5005
5041
|
"init-values": _ctx.model[_ctx.name],
|
|
@@ -5015,7 +5051,7 @@
|
|
|
5015
5051
|
size: "default",
|
|
5016
5052
|
disabled: _ctx.disabled,
|
|
5017
5053
|
text: "",
|
|
5018
|
-
icon: _sfc_main$
|
|
5054
|
+
icon: _sfc_main$D,
|
|
5019
5055
|
onClick: _cache[0] || (_cache[0] = ($event) => showCode.value = !showCode.value)
|
|
5020
5056
|
}, null, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
5021
5057
|
]);
|
|
@@ -5023,12 +5059,72 @@
|
|
|
5023
5059
|
}
|
|
5024
5060
|
});
|
|
5025
5061
|
|
|
5062
|
+
const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
|
|
5063
|
+
const _hoisted_2$a = { class: "page-fragment-select-container" };
|
|
5064
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
5065
|
+
...{
|
|
5066
|
+
name: "MEditorPageFragmentSelect"
|
|
5067
|
+
},
|
|
5068
|
+
__name: "PageFragmentSelect",
|
|
5069
|
+
props: {
|
|
5070
|
+
config: {},
|
|
5071
|
+
model: {},
|
|
5072
|
+
initValues: {},
|
|
5073
|
+
values: {},
|
|
5074
|
+
name: {},
|
|
5075
|
+
prop: {},
|
|
5076
|
+
disabled: { type: Boolean, default: false },
|
|
5077
|
+
size: {},
|
|
5078
|
+
lastValues: {}
|
|
5079
|
+
},
|
|
5080
|
+
emits: ["change"],
|
|
5081
|
+
setup(__props, { emit: __emit }) {
|
|
5082
|
+
const services = vue.inject("services");
|
|
5083
|
+
const emit = __emit;
|
|
5084
|
+
const props = __props;
|
|
5085
|
+
const pageList = vue.computed(
|
|
5086
|
+
() => services?.editorService.get("root")?.items.filter((item) => item.type === schema.NodeType.PAGE_FRAGMENT)
|
|
5087
|
+
);
|
|
5088
|
+
const selectConfig = {
|
|
5089
|
+
type: "select",
|
|
5090
|
+
name: props.name,
|
|
5091
|
+
options: () => {
|
|
5092
|
+
if (pageList.value) {
|
|
5093
|
+
return pageList.value.map((item) => ({
|
|
5094
|
+
text: `${item.name}(${item.id})`,
|
|
5095
|
+
label: `${item.name}(${item.id})`,
|
|
5096
|
+
value: item.id
|
|
5097
|
+
}));
|
|
5098
|
+
}
|
|
5099
|
+
return [];
|
|
5100
|
+
}
|
|
5101
|
+
};
|
|
5102
|
+
const changeHandler = async () => {
|
|
5103
|
+
emit("change", props.model[props.name]);
|
|
5104
|
+
};
|
|
5105
|
+
return (_ctx, _cache) => {
|
|
5106
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
5107
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
5108
|
+
vue.createElementVNode("div", _hoisted_2$a, [
|
|
5109
|
+
vue.createVNode(_component_m_form_container, {
|
|
5110
|
+
class: "select",
|
|
5111
|
+
config: selectConfig,
|
|
5112
|
+
model: _ctx.model,
|
|
5113
|
+
size: _ctx.size,
|
|
5114
|
+
onChange: changeHandler
|
|
5115
|
+
}, null, 8, ["model", "size"])
|
|
5116
|
+
])
|
|
5117
|
+
]);
|
|
5118
|
+
};
|
|
5119
|
+
}
|
|
5120
|
+
});
|
|
5121
|
+
|
|
5026
5122
|
const _hoisted_1$g = {
|
|
5027
5123
|
key: 1,
|
|
5028
5124
|
class: "m-fields-ui-select",
|
|
5029
5125
|
style: { "display": "flex" }
|
|
5030
5126
|
};
|
|
5031
|
-
const _sfc_main$
|
|
5127
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
5032
5128
|
...{
|
|
5033
5129
|
name: "MEditorUISelect"
|
|
5034
5130
|
},
|
|
@@ -5204,7 +5300,7 @@
|
|
|
5204
5300
|
isDraging.value = false;
|
|
5205
5301
|
});
|
|
5206
5302
|
});
|
|
5207
|
-
vue.
|
|
5303
|
+
vue.onBeforeUnmount(() => {
|
|
5208
5304
|
getso?.unset();
|
|
5209
5305
|
isDraging.value = false;
|
|
5210
5306
|
});
|
|
@@ -5213,7 +5309,7 @@
|
|
|
5213
5309
|
};
|
|
5214
5310
|
};
|
|
5215
5311
|
|
|
5216
|
-
const _sfc_main$
|
|
5312
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
5217
5313
|
...{
|
|
5218
5314
|
name: "MEditorResizer"
|
|
5219
5315
|
},
|
|
@@ -5235,7 +5331,7 @@
|
|
|
5235
5331
|
}
|
|
5236
5332
|
});
|
|
5237
5333
|
|
|
5238
|
-
const _sfc_main$
|
|
5334
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
5239
5335
|
...{
|
|
5240
5336
|
name: "MEditorLayout"
|
|
5241
5337
|
},
|
|
@@ -5302,7 +5398,7 @@
|
|
|
5302
5398
|
resizerObserver.observe(el.value);
|
|
5303
5399
|
}
|
|
5304
5400
|
});
|
|
5305
|
-
vue.
|
|
5401
|
+
vue.onBeforeUnmount(() => {
|
|
5306
5402
|
resizerObserver.disconnect();
|
|
5307
5403
|
});
|
|
5308
5404
|
const center = vue.ref(0);
|
|
@@ -5362,7 +5458,7 @@
|
|
|
5362
5458
|
}, [
|
|
5363
5459
|
vue.renderSlot(_ctx.$slots, "left")
|
|
5364
5460
|
], 6),
|
|
5365
|
-
vue.createVNode(_sfc_main$
|
|
5461
|
+
vue.createVNode(_sfc_main$z, { onChange: changeLeft })
|
|
5366
5462
|
], 64)) : vue.createCommentVNode("", true),
|
|
5367
5463
|
vue.createElementVNode("div", {
|
|
5368
5464
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -5371,7 +5467,7 @@
|
|
|
5371
5467
|
vue.renderSlot(_ctx.$slots, "center")
|
|
5372
5468
|
], 6),
|
|
5373
5469
|
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5374
|
-
vue.createVNode(_sfc_main$
|
|
5470
|
+
vue.createVNode(_sfc_main$z, { onChange: changeRight }),
|
|
5375
5471
|
vue.createElementVNode("div", {
|
|
5376
5472
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
5377
5473
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -5384,345 +5480,749 @@
|
|
|
5384
5480
|
}
|
|
5385
5481
|
});
|
|
5386
5482
|
|
|
5387
|
-
const _hoisted_1$f = {
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5483
|
+
const _hoisted_1$f = {
|
|
5484
|
+
key: 1,
|
|
5485
|
+
class: "menu-item-text"
|
|
5486
|
+
};
|
|
5487
|
+
const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
|
|
5488
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
5391
5489
|
...{
|
|
5392
|
-
name: "
|
|
5490
|
+
name: "MEditorToolButton"
|
|
5393
5491
|
},
|
|
5394
|
-
__name: "
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
const root = vue.toRaw(editorService.get("root"));
|
|
5402
|
-
if (!root)
|
|
5403
|
-
throw new Error("root 不能为空");
|
|
5404
|
-
editorService.add({
|
|
5405
|
-
type: schema.NodeType.PAGE,
|
|
5406
|
-
name: generatePageNameByApp(root)
|
|
5407
|
-
});
|
|
5408
|
-
};
|
|
5409
|
-
return (_ctx, _cache) => {
|
|
5410
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
|
|
5411
|
-
vue.createElementVNode("div", _hoisted_2$9, [
|
|
5412
|
-
vue.createElementVNode("div", {
|
|
5413
|
-
class: "m-editor-empty-button",
|
|
5414
|
-
onClick: clickHandler
|
|
5415
|
-
}, [
|
|
5416
|
-
vue.createElementVNode("div", null, [
|
|
5417
|
-
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5418
|
-
]),
|
|
5419
|
-
_hoisted_3$4
|
|
5420
|
-
])
|
|
5421
|
-
])
|
|
5422
|
-
]);
|
|
5423
|
-
};
|
|
5424
|
-
}
|
|
5425
|
-
});
|
|
5426
|
-
|
|
5427
|
-
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
5428
|
-
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
5429
|
-
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
5430
|
-
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
5431
|
-
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
5432
|
-
...{
|
|
5433
|
-
name: "MEditorFramework"
|
|
5492
|
+
__name: "ToolButton",
|
|
5493
|
+
props: {
|
|
5494
|
+
data: { default: () => ({
|
|
5495
|
+
type: "text",
|
|
5496
|
+
display: false
|
|
5497
|
+
}) },
|
|
5498
|
+
eventType: { default: "click" }
|
|
5434
5499
|
},
|
|
5435
|
-
__name: "Framework",
|
|
5436
5500
|
setup(__props) {
|
|
5437
|
-
const
|
|
5438
|
-
const
|
|
5439
|
-
const
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
left: leftColumnWidthCacheData,
|
|
5449
|
-
center: 0,
|
|
5450
|
-
right: RightColumnWidthCacheData
|
|
5501
|
+
const props = __props;
|
|
5502
|
+
const services = vue.inject("services");
|
|
5503
|
+
const disabled = vue.computed(() => {
|
|
5504
|
+
if (typeof props.data === "string")
|
|
5505
|
+
return false;
|
|
5506
|
+
if (props.data.type === "component")
|
|
5507
|
+
return false;
|
|
5508
|
+
if (typeof props.data.disabled === "function") {
|
|
5509
|
+
return props.data.disabled(services);
|
|
5510
|
+
}
|
|
5511
|
+
return props.data.disabled;
|
|
5451
5512
|
});
|
|
5452
|
-
vue.
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
{
|
|
5458
|
-
|
|
5513
|
+
const display = vue.computed(() => {
|
|
5514
|
+
if (!props.data)
|
|
5515
|
+
return false;
|
|
5516
|
+
if (typeof props.data === "string")
|
|
5517
|
+
return true;
|
|
5518
|
+
if (typeof props.data.display === "function") {
|
|
5519
|
+
return props.data.display(services);
|
|
5459
5520
|
}
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
(
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5521
|
+
return props.data.display ?? true;
|
|
5522
|
+
});
|
|
5523
|
+
const buttonHandler = (item, event) => {
|
|
5524
|
+
if (disabled.value)
|
|
5525
|
+
return;
|
|
5526
|
+
if (typeof item.handler === "function" && services) {
|
|
5527
|
+
item.handler?.(services, event);
|
|
5467
5528
|
}
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
()
|
|
5471
|
-
|
|
5472
|
-
globalThis.localStorage.setItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, `${left}`);
|
|
5529
|
+
};
|
|
5530
|
+
const dropdownHandler = (command) => {
|
|
5531
|
+
if (command.item.handler) {
|
|
5532
|
+
command.item.handler(services);
|
|
5473
5533
|
}
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
(
|
|
5477
|
-
|
|
5478
|
-
|
|
5534
|
+
};
|
|
5535
|
+
const clickHandler = (item, event) => {
|
|
5536
|
+
if (props.eventType !== "click")
|
|
5537
|
+
return;
|
|
5538
|
+
if (item.type === "button") {
|
|
5539
|
+
buttonHandler(item, event);
|
|
5479
5540
|
}
|
|
5480
|
-
);
|
|
5481
|
-
const columnWidthChange = (columnW) => {
|
|
5482
|
-
columnWidth.value.left = columnW.left;
|
|
5483
|
-
columnWidth.value.center = columnW.center;
|
|
5484
|
-
columnWidth.value.right = columnW.right;
|
|
5485
|
-
uiService?.set("columnWidth", columnW);
|
|
5486
5541
|
};
|
|
5487
|
-
const
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5542
|
+
const mousedownHandler = (item, event) => {
|
|
5543
|
+
if (props.eventType !== "mousedown")
|
|
5544
|
+
return;
|
|
5545
|
+
if (item.type === "button") {
|
|
5546
|
+
buttonHandler(item, event);
|
|
5547
|
+
}
|
|
5548
|
+
};
|
|
5549
|
+
const mouseupHandler = (item, event) => {
|
|
5550
|
+
if (props.eventType !== "mouseup")
|
|
5551
|
+
return;
|
|
5552
|
+
if (item.type === "button") {
|
|
5553
|
+
buttonHandler(item, event);
|
|
5493
5554
|
}
|
|
5494
5555
|
};
|
|
5495
5556
|
return (_ctx, _cache) => {
|
|
5496
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5557
|
+
return display.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5558
|
+
key: 0,
|
|
5559
|
+
class: vue.normalizeClass(["menu-item", `${_ctx.data.type} ${_ctx.data.className || ""}`]),
|
|
5560
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(_ctx.data, $event)),
|
|
5561
|
+
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
|
|
5562
|
+
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
|
|
5501
5563
|
}, [
|
|
5502
|
-
vue.
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
vue.
|
|
5507
|
-
|
|
5508
|
-
"
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
},
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5564
|
+
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
5565
|
+
key: 0,
|
|
5566
|
+
direction: _ctx.data.direction || "vertical"
|
|
5567
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
5568
|
+
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
5569
|
+
key: 0,
|
|
5570
|
+
effect: "dark",
|
|
5571
|
+
placement: "bottom-start",
|
|
5572
|
+
content: _ctx.data.tooltip
|
|
5573
|
+
}, {
|
|
5574
|
+
default: vue.withCtx(() => [
|
|
5575
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5576
|
+
size: "small",
|
|
5577
|
+
text: "",
|
|
5578
|
+
disabled: disabled.value
|
|
5579
|
+
}, {
|
|
5580
|
+
default: vue.withCtx(() => [
|
|
5581
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5582
|
+
key: 0,
|
|
5583
|
+
icon: _ctx.data.icon
|
|
5584
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5585
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
|
|
5586
|
+
]),
|
|
5587
|
+
_: 1
|
|
5588
|
+
}, 8, ["disabled"])
|
|
5589
|
+
]),
|
|
5590
|
+
_: 1
|
|
5591
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5592
|
+
key: 1,
|
|
5593
|
+
size: "small",
|
|
5594
|
+
text: "",
|
|
5595
|
+
disabled: disabled.value,
|
|
5596
|
+
title: _ctx.data.text
|
|
5597
|
+
}, {
|
|
5598
|
+
default: vue.withCtx(() => [
|
|
5599
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5600
|
+
key: 0,
|
|
5601
|
+
icon: _ctx.data.icon
|
|
5602
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5603
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
|
|
5604
|
+
]),
|
|
5605
|
+
_: 1
|
|
5606
|
+
}, 8, ["disabled", "title"]))
|
|
5607
|
+
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
|
|
5608
|
+
key: 3,
|
|
5609
|
+
trigger: "click",
|
|
5610
|
+
disabled: disabled.value,
|
|
5611
|
+
onCommand: dropdownHandler
|
|
5612
|
+
}, {
|
|
5613
|
+
dropdown: vue.withCtx(() => [
|
|
5614
|
+
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
|
|
5615
|
+
default: vue.withCtx(() => [
|
|
5616
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
|
|
5617
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
|
|
5618
|
+
key: index,
|
|
5619
|
+
command: { data: _ctx.data, subItem }
|
|
5620
|
+
}, {
|
|
5621
|
+
default: vue.withCtx(() => [
|
|
5622
|
+
vue.createTextVNode(vue.toDisplayString(subItem.text), 1)
|
|
5623
|
+
]),
|
|
5624
|
+
_: 2
|
|
5625
|
+
}, 1032, ["command"]);
|
|
5626
|
+
}), 128))
|
|
5627
|
+
]),
|
|
5628
|
+
_: 1
|
|
5629
|
+
})) : vue.createCommentVNode("", true)
|
|
5536
5630
|
]),
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
fn: vue.withCtx(() => [
|
|
5542
|
-
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
5631
|
+
default: vue.withCtx(() => [
|
|
5632
|
+
vue.createElementVNode("span", _hoisted_2$9, [
|
|
5633
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
5634
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
5543
5635
|
default: vue.withCtx(() => [
|
|
5544
|
-
vue.
|
|
5636
|
+
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
5545
5637
|
]),
|
|
5546
|
-
_:
|
|
5638
|
+
_: 1
|
|
5547
5639
|
})
|
|
5548
|
-
])
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
vue.renderSlot(_ctx.$slots, "footer")
|
|
5554
|
-
], 512);
|
|
5640
|
+
])
|
|
5641
|
+
]),
|
|
5642
|
+
_: 1
|
|
5643
|
+
}, 8, ["disabled"])) : _ctx.data.type === "component" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.data.component), vue.normalizeProps(vue.mergeProps({ key: 4 }, _ctx.data.props || {})), null, 16)) : vue.createCommentVNode("", true)
|
|
5644
|
+
], 34)) : vue.createCommentVNode("", true);
|
|
5555
5645
|
};
|
|
5556
5646
|
}
|
|
5557
5647
|
});
|
|
5558
5648
|
|
|
5559
5649
|
const _hoisted_1$e = {
|
|
5560
5650
|
key: 1,
|
|
5561
|
-
|
|
5651
|
+
style: { "width": "21px" }
|
|
5562
5652
|
};
|
|
5563
|
-
const
|
|
5564
|
-
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5653
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
5565
5654
|
...{
|
|
5566
|
-
name: "
|
|
5655
|
+
name: "MEditorPageBarAddButton"
|
|
5567
5656
|
},
|
|
5568
|
-
__name: "
|
|
5657
|
+
__name: "AddButton",
|
|
5569
5658
|
props: {
|
|
5570
|
-
|
|
5571
|
-
type: "text",
|
|
5572
|
-
display: false
|
|
5573
|
-
}) },
|
|
5574
|
-
eventType: { default: "click" }
|
|
5659
|
+
type: {}
|
|
5575
5660
|
},
|
|
5576
5661
|
setup(__props) {
|
|
5577
5662
|
const props = __props;
|
|
5578
5663
|
const services = vue.inject("services");
|
|
5579
|
-
const
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5664
|
+
const uiService = services?.uiService;
|
|
5665
|
+
const editorService = services?.editorService;
|
|
5666
|
+
const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
|
|
5667
|
+
const addPage = () => {
|
|
5668
|
+
if (!editorService)
|
|
5669
|
+
return;
|
|
5670
|
+
const root = vue.toRaw(editorService.get("root"));
|
|
5671
|
+
if (!root)
|
|
5672
|
+
throw new Error("root 不能为空");
|
|
5673
|
+
const pageConfig = {
|
|
5674
|
+
type: props.type,
|
|
5675
|
+
name: generatePageNameByApp(root, props.type),
|
|
5676
|
+
items: []
|
|
5677
|
+
};
|
|
5678
|
+
editorService.add(pageConfig);
|
|
5679
|
+
};
|
|
5680
|
+
return (_ctx, _cache) => {
|
|
5681
|
+
return showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5682
|
+
key: 0,
|
|
5683
|
+
id: "m-editor-page-bar-add-icon",
|
|
5684
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5685
|
+
onClick: addPage
|
|
5686
|
+
}, [
|
|
5687
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5688
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e));
|
|
5689
|
+
};
|
|
5690
|
+
}
|
|
5691
|
+
});
|
|
5692
|
+
|
|
5693
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
5694
|
+
...{
|
|
5695
|
+
name: "MEditorPageBarScrollContainer"
|
|
5696
|
+
},
|
|
5697
|
+
__name: "PageBarScrollContainer",
|
|
5698
|
+
props: {
|
|
5699
|
+
type: {}
|
|
5700
|
+
},
|
|
5701
|
+
setup(__props) {
|
|
5702
|
+
const props = __props;
|
|
5703
|
+
const services = vue.inject("services");
|
|
5704
|
+
const editorService = services?.editorService;
|
|
5705
|
+
const uiService = services?.uiService;
|
|
5706
|
+
const itemsContainer = vue.ref();
|
|
5707
|
+
const canScroll = vue.ref(false);
|
|
5708
|
+
const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
|
|
5709
|
+
const itemsContainerWidth = vue.ref(0);
|
|
5710
|
+
const setCanScroll = () => {
|
|
5711
|
+
itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - (showAddPageButton.value ? 37 : 21);
|
|
5712
|
+
vue.nextTick(() => {
|
|
5713
|
+
if (itemsContainer.value) {
|
|
5714
|
+
canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
5715
|
+
}
|
|
5716
|
+
});
|
|
5717
|
+
};
|
|
5718
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
5719
|
+
setCanScroll();
|
|
5588
5720
|
});
|
|
5589
|
-
const
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
if (typeof props.data === "string")
|
|
5593
|
-
return true;
|
|
5594
|
-
if (typeof props.data.display === "function") {
|
|
5595
|
-
return props.data.display(services);
|
|
5596
|
-
}
|
|
5597
|
-
return props.data.display ?? true;
|
|
5721
|
+
const pageBar = vue.ref();
|
|
5722
|
+
vue.onMounted(() => {
|
|
5723
|
+
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
5598
5724
|
});
|
|
5599
|
-
|
|
5600
|
-
|
|
5725
|
+
vue.onBeforeUnmount(() => {
|
|
5726
|
+
resizeObserver.disconnect();
|
|
5727
|
+
});
|
|
5728
|
+
let translateLeft = 0;
|
|
5729
|
+
const scroll = (type) => {
|
|
5730
|
+
if (!itemsContainer.value)
|
|
5601
5731
|
return;
|
|
5602
|
-
|
|
5603
|
-
|
|
5732
|
+
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
5733
|
+
if (type === "left") {
|
|
5734
|
+
translateLeft += 100;
|
|
5735
|
+
if (translateLeft > 0) {
|
|
5736
|
+
translateLeft = 0;
|
|
5737
|
+
}
|
|
5738
|
+
} else if (type === "right") {
|
|
5739
|
+
translateLeft -= 100;
|
|
5740
|
+
if (-translateLeft > maxScrollLeft) {
|
|
5741
|
+
translateLeft = -maxScrollLeft;
|
|
5742
|
+
}
|
|
5743
|
+
} else if (type === "start") {
|
|
5744
|
+
translateLeft = 0;
|
|
5745
|
+
} else if (type === "end") {
|
|
5746
|
+
translateLeft = -maxScrollLeft;
|
|
5604
5747
|
}
|
|
5748
|
+
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
5605
5749
|
};
|
|
5606
|
-
const
|
|
5607
|
-
|
|
5608
|
-
|
|
5750
|
+
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
5751
|
+
const pageFragmentLength = vue.computed(() => editorService?.get("pageFragmentLength") || 0);
|
|
5752
|
+
const crateWatchLength = (length) => vue.watch(
|
|
5753
|
+
length,
|
|
5754
|
+
(length2 = 0, preLength = 0) => {
|
|
5755
|
+
setTimeout(() => {
|
|
5756
|
+
setCanScroll();
|
|
5757
|
+
if (length2 < preLength) {
|
|
5758
|
+
scroll("start");
|
|
5759
|
+
} else {
|
|
5760
|
+
scroll("end");
|
|
5761
|
+
}
|
|
5762
|
+
});
|
|
5763
|
+
},
|
|
5764
|
+
{
|
|
5765
|
+
immediate: true
|
|
5609
5766
|
}
|
|
5767
|
+
);
|
|
5768
|
+
let unWatchPageLength;
|
|
5769
|
+
let unWatchPageFragmentLength;
|
|
5770
|
+
vue.watch(
|
|
5771
|
+
() => props.type,
|
|
5772
|
+
(type) => {
|
|
5773
|
+
if (type === schema.NodeType.PAGE) {
|
|
5774
|
+
unWatchPageFragmentLength?.();
|
|
5775
|
+
unWatchPageFragmentLength = null;
|
|
5776
|
+
unWatchPageLength = crateWatchLength(pageLength);
|
|
5777
|
+
} else {
|
|
5778
|
+
unWatchPageLength?.();
|
|
5779
|
+
unWatchPageLength = null;
|
|
5780
|
+
unWatchPageFragmentLength = crateWatchLength(pageFragmentLength);
|
|
5781
|
+
}
|
|
5782
|
+
},
|
|
5783
|
+
{
|
|
5784
|
+
immediate: true
|
|
5785
|
+
}
|
|
5786
|
+
);
|
|
5787
|
+
return (_ctx, _cache) => {
|
|
5788
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5789
|
+
class: "m-editor-page-bar",
|
|
5790
|
+
ref_key: "pageBar",
|
|
5791
|
+
ref: pageBar
|
|
5792
|
+
}, [
|
|
5793
|
+
vue.renderSlot(_ctx.$slots, "prepend"),
|
|
5794
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5795
|
+
key: 0,
|
|
5796
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5797
|
+
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
5798
|
+
}, [
|
|
5799
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
5800
|
+
])) : vue.createCommentVNode("", true),
|
|
5801
|
+
_ctx.type === vue.unref(schema.NodeType).PAGE && pageLength.value || _ctx.type === vue.unref(schema.NodeType).PAGE_FRAGMENT && pageFragmentLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5802
|
+
key: 1,
|
|
5803
|
+
class: "m-editor-page-bar-items",
|
|
5804
|
+
ref_key: "itemsContainer",
|
|
5805
|
+
ref: itemsContainer,
|
|
5806
|
+
style: vue.normalizeStyle(`width: ${itemsContainerWidth.value}px`)
|
|
5807
|
+
}, [
|
|
5808
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
5809
|
+
], 4)) : vue.createCommentVNode("", true),
|
|
5810
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5811
|
+
key: 2,
|
|
5812
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5813
|
+
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
5814
|
+
}, [
|
|
5815
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
5816
|
+
])) : vue.createCommentVNode("", true)
|
|
5817
|
+
], 512);
|
|
5610
5818
|
};
|
|
5611
|
-
|
|
5612
|
-
|
|
5819
|
+
}
|
|
5820
|
+
});
|
|
5821
|
+
|
|
5822
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
5823
|
+
...{
|
|
5824
|
+
name: "MEditorPageBarSwitchTypeButton"
|
|
5825
|
+
},
|
|
5826
|
+
__name: "SwitchTypeButton",
|
|
5827
|
+
props: {
|
|
5828
|
+
modelValue: {}
|
|
5829
|
+
},
|
|
5830
|
+
emits: ["update:modelValue"],
|
|
5831
|
+
setup(__props, { emit: __emit }) {
|
|
5832
|
+
const data = [
|
|
5833
|
+
{
|
|
5834
|
+
type: schema.NodeType.PAGE,
|
|
5835
|
+
text: "页面"
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
type: schema.NodeType.PAGE_FRAGMENT,
|
|
5839
|
+
text: "页面片"
|
|
5840
|
+
}
|
|
5841
|
+
];
|
|
5842
|
+
const emit = __emit;
|
|
5843
|
+
const clickHandler = (value) => {
|
|
5844
|
+
emit("update:modelValue", value);
|
|
5845
|
+
};
|
|
5846
|
+
return (_ctx, _cache) => {
|
|
5847
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(data, (item) => {
|
|
5848
|
+
return vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5849
|
+
class: vue.normalizeClass(["m-editor-page-bar-switch-type-button", { active: _ctx.modelValue === item.type }]),
|
|
5850
|
+
size: "small",
|
|
5851
|
+
key: item.type,
|
|
5852
|
+
text: "",
|
|
5853
|
+
type: _ctx.modelValue === item.type ? "primary" : "",
|
|
5854
|
+
onClick: ($event) => clickHandler(item.type)
|
|
5855
|
+
}, {
|
|
5856
|
+
default: vue.withCtx(() => [
|
|
5857
|
+
vue.createTextVNode(vue.toDisplayString(item.text), 1)
|
|
5858
|
+
]),
|
|
5859
|
+
_: 2
|
|
5860
|
+
}, 1032, ["class", "type", "onClick"]);
|
|
5861
|
+
}), 64);
|
|
5862
|
+
};
|
|
5863
|
+
}
|
|
5864
|
+
});
|
|
5865
|
+
|
|
5866
|
+
const _hoisted_1$d = { class: "m-editor-page-bar-tabs" };
|
|
5867
|
+
const _hoisted_2$8 = ["onClick"];
|
|
5868
|
+
const _hoisted_3$5 = { class: "m-editor-page-bar-title" };
|
|
5869
|
+
const _hoisted_4$5 = ["title"];
|
|
5870
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5871
|
+
...{
|
|
5872
|
+
name: "MEditorPageBar"
|
|
5873
|
+
},
|
|
5874
|
+
__name: "PageBar",
|
|
5875
|
+
props: {
|
|
5876
|
+
disabledPageFragment: { type: Boolean }
|
|
5877
|
+
},
|
|
5878
|
+
setup(__props) {
|
|
5879
|
+
const active = vue.ref(schema.NodeType.PAGE);
|
|
5880
|
+
const services = vue.inject("services");
|
|
5881
|
+
const editorService = services?.editorService;
|
|
5882
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
5883
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
5884
|
+
const pageList = vue.computed(() => getPageList(root.value));
|
|
5885
|
+
const pageFragmentList = vue.computed(() => getPageFragmentList(root.value));
|
|
5886
|
+
const list = vue.computed(() => active.value === schema.NodeType.PAGE ? pageList.value : pageFragmentList.value);
|
|
5887
|
+
const activePage = vue.ref("");
|
|
5888
|
+
const activePageFragment = vue.ref("");
|
|
5889
|
+
vue.watch(
|
|
5890
|
+
page,
|
|
5891
|
+
(page2) => {
|
|
5892
|
+
if (!page2) {
|
|
5893
|
+
if (active.value === schema.NodeType.PAGE) {
|
|
5894
|
+
activePage.value = "";
|
|
5895
|
+
}
|
|
5896
|
+
if (active.value === schema.NodeType.PAGE_FRAGMENT) {
|
|
5897
|
+
activePageFragment.value = "";
|
|
5898
|
+
}
|
|
5899
|
+
return;
|
|
5900
|
+
}
|
|
5901
|
+
if (utils.isPage(page2)) {
|
|
5902
|
+
activePage.value = page2?.id;
|
|
5903
|
+
if (active.value !== schema.NodeType.PAGE) {
|
|
5904
|
+
active.value = schema.NodeType.PAGE;
|
|
5905
|
+
}
|
|
5906
|
+
} else if (utils.isPageFragment(page2)) {
|
|
5907
|
+
activePageFragment.value = page2?.id;
|
|
5908
|
+
if (active.value !== schema.NodeType.PAGE_FRAGMENT) {
|
|
5909
|
+
active.value = schema.NodeType.PAGE_FRAGMENT;
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
},
|
|
5913
|
+
{
|
|
5914
|
+
immediate: true
|
|
5915
|
+
}
|
|
5916
|
+
);
|
|
5917
|
+
vue.watch(active, (active2) => {
|
|
5918
|
+
if (active2 === schema.NodeType.PAGE) {
|
|
5919
|
+
if (!activePage.value) {
|
|
5920
|
+
editorService?.selectRoot();
|
|
5921
|
+
return;
|
|
5922
|
+
}
|
|
5923
|
+
switchPage(activePage.value);
|
|
5613
5924
|
return;
|
|
5614
|
-
if (item.type === "button") {
|
|
5615
|
-
buttonHandler(item, event);
|
|
5616
5925
|
}
|
|
5926
|
+
if (active2 === schema.NodeType.PAGE_FRAGMENT) {
|
|
5927
|
+
if (!activePageFragment.value) {
|
|
5928
|
+
editorService?.selectRoot();
|
|
5929
|
+
return;
|
|
5930
|
+
}
|
|
5931
|
+
switchPage(activePageFragment.value);
|
|
5932
|
+
}
|
|
5933
|
+
});
|
|
5934
|
+
const switchPage = (id) => {
|
|
5935
|
+
editorService?.select(id);
|
|
5617
5936
|
};
|
|
5618
|
-
const
|
|
5619
|
-
|
|
5937
|
+
const copy = (node) => {
|
|
5938
|
+
node && editorService?.copy(node);
|
|
5939
|
+
editorService?.paste({
|
|
5940
|
+
left: 0,
|
|
5941
|
+
top: 0
|
|
5942
|
+
});
|
|
5943
|
+
};
|
|
5944
|
+
const remove = (node) => {
|
|
5945
|
+
editorService?.remove(node);
|
|
5946
|
+
};
|
|
5947
|
+
return (_ctx, _cache) => {
|
|
5948
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
5949
|
+
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createBlock(_sfc_main$u, {
|
|
5950
|
+
key: 0,
|
|
5951
|
+
modelValue: active.value,
|
|
5952
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => active.value = $event)
|
|
5953
|
+
}, null, 8, ["modelValue"])) : vue.createCommentVNode("", true),
|
|
5954
|
+
vue.createVNode(_sfc_main$v, { type: active.value }, {
|
|
5955
|
+
prepend: vue.withCtx(() => [
|
|
5956
|
+
vue.createVNode(_sfc_main$w, { type: active.value }, null, 8, ["type"])
|
|
5957
|
+
]),
|
|
5958
|
+
default: vue.withCtx(() => [
|
|
5959
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (item) => {
|
|
5960
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5961
|
+
class: vue.normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
5962
|
+
key: item.id,
|
|
5963
|
+
onClick: ($event) => switchPage(item.id)
|
|
5964
|
+
}, [
|
|
5965
|
+
vue.createElementVNode("div", _hoisted_3$5, [
|
|
5966
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
5967
|
+
vue.createElementVNode("span", {
|
|
5968
|
+
title: item.name
|
|
5969
|
+
}, vue.toDisplayString(item.name || item.id), 9, _hoisted_4$5)
|
|
5970
|
+
])
|
|
5971
|
+
]),
|
|
5972
|
+
vue.createVNode(vue.unref(design.TMagicPopover), {
|
|
5973
|
+
"popper-class": "page-bar-popover",
|
|
5974
|
+
placement: "top",
|
|
5975
|
+
width: 160,
|
|
5976
|
+
trigger: "hover"
|
|
5977
|
+
}, {
|
|
5978
|
+
reference: vue.withCtx(() => [
|
|
5979
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
5980
|
+
default: vue.withCtx(() => [
|
|
5981
|
+
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
5982
|
+
]),
|
|
5983
|
+
_: 1
|
|
5984
|
+
})
|
|
5985
|
+
]),
|
|
5986
|
+
default: vue.withCtx(() => [
|
|
5987
|
+
vue.createElementVNode("div", null, [
|
|
5988
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
5989
|
+
vue.createVNode(_sfc_main$x, {
|
|
5990
|
+
data: {
|
|
5991
|
+
type: "button",
|
|
5992
|
+
text: "复制",
|
|
5993
|
+
icon: vue.unref(iconsVue.DocumentCopy),
|
|
5994
|
+
handler: () => copy(item)
|
|
5995
|
+
}
|
|
5996
|
+
}, null, 8, ["data"]),
|
|
5997
|
+
vue.createVNode(_sfc_main$x, {
|
|
5998
|
+
data: {
|
|
5999
|
+
type: "button",
|
|
6000
|
+
text: "删除",
|
|
6001
|
+
icon: vue.unref(iconsVue.Delete),
|
|
6002
|
+
handler: () => remove(item)
|
|
6003
|
+
}
|
|
6004
|
+
}, null, 8, ["data"])
|
|
6005
|
+
])
|
|
6006
|
+
])
|
|
6007
|
+
]),
|
|
6008
|
+
_: 2
|
|
6009
|
+
}, 1024)
|
|
6010
|
+
], 10, _hoisted_2$8);
|
|
6011
|
+
}), 128))
|
|
6012
|
+
]),
|
|
6013
|
+
_: 3
|
|
6014
|
+
}, 8, ["type"])
|
|
6015
|
+
]);
|
|
6016
|
+
};
|
|
6017
|
+
}
|
|
6018
|
+
});
|
|
6019
|
+
|
|
6020
|
+
const _hoisted_1$c = { class: "m-editor-empty-panel" };
|
|
6021
|
+
const _hoisted_2$7 = { class: "m-editor-empty-content" };
|
|
6022
|
+
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
6023
|
+
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面片", -1);
|
|
6024
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
6025
|
+
...{
|
|
6026
|
+
name: "MEditorAddPageBox"
|
|
6027
|
+
},
|
|
6028
|
+
__name: "AddPageBox",
|
|
6029
|
+
props: {
|
|
6030
|
+
disabledPageFragment: { type: Boolean }
|
|
6031
|
+
},
|
|
6032
|
+
setup(__props) {
|
|
6033
|
+
const services = vue.inject("services");
|
|
6034
|
+
const clickHandler = (type) => {
|
|
6035
|
+
const { editorService } = services || {};
|
|
6036
|
+
if (!editorService)
|
|
5620
6037
|
return;
|
|
5621
|
-
|
|
5622
|
-
|
|
6038
|
+
const root = vue.toRaw(editorService.get("root"));
|
|
6039
|
+
if (!root)
|
|
6040
|
+
throw new Error("root 不能为空");
|
|
6041
|
+
editorService.add({
|
|
6042
|
+
type,
|
|
6043
|
+
name: generatePageNameByApp(root, type),
|
|
6044
|
+
items: []
|
|
6045
|
+
});
|
|
6046
|
+
};
|
|
6047
|
+
return (_ctx, _cache) => {
|
|
6048
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
6049
|
+
vue.createElementVNode("div", _hoisted_2$7, [
|
|
6050
|
+
vue.createElementVNode("div", {
|
|
6051
|
+
class: "m-editor-empty-button",
|
|
6052
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(schema.NodeType).PAGE))
|
|
6053
|
+
}, [
|
|
6054
|
+
vue.createElementVNode("div", null, [
|
|
6055
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
6056
|
+
]),
|
|
6057
|
+
_hoisted_3$4
|
|
6058
|
+
]),
|
|
6059
|
+
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
6060
|
+
key: 0,
|
|
6061
|
+
class: "m-editor-empty-button",
|
|
6062
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(schema.NodeType).PAGE_FRAGMENT))
|
|
6063
|
+
}, [
|
|
6064
|
+
vue.createElementVNode("div", null, [
|
|
6065
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
6066
|
+
]),
|
|
6067
|
+
_hoisted_4$4
|
|
6068
|
+
])) : vue.createCommentVNode("", true)
|
|
6069
|
+
])
|
|
6070
|
+
]);
|
|
6071
|
+
};
|
|
6072
|
+
}
|
|
6073
|
+
});
|
|
6074
|
+
|
|
6075
|
+
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
6076
|
+
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
6077
|
+
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
6078
|
+
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
6079
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
6080
|
+
...{
|
|
6081
|
+
name: "MEditorFramework"
|
|
6082
|
+
},
|
|
6083
|
+
__name: "Framework",
|
|
6084
|
+
props: {
|
|
6085
|
+
disabledPageFragment: { type: Boolean }
|
|
6086
|
+
},
|
|
6087
|
+
setup(__props) {
|
|
6088
|
+
const codeOptions = vue.inject("codeOptions", {});
|
|
6089
|
+
const { editorService, uiService } = vue.inject("services") || {};
|
|
6090
|
+
const content = vue.ref();
|
|
6091
|
+
const splitView = vue.ref();
|
|
6092
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
6093
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
6094
|
+
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
6095
|
+
const stageLoading = vue.computed(() => editorService?.get("stageLoading") || false);
|
|
6096
|
+
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
6097
|
+
const getLeftColumnWidthCacheData = () => Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
6098
|
+
const leftColumnWidthCacheData = getLeftColumnWidthCacheData();
|
|
6099
|
+
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
6100
|
+
const columnWidth = vue.ref({
|
|
6101
|
+
left: leftColumnWidthCacheData,
|
|
6102
|
+
center: 0,
|
|
6103
|
+
right: RightColumnWidthCacheData
|
|
6104
|
+
});
|
|
6105
|
+
vue.watch(
|
|
6106
|
+
[pageLength, splitView],
|
|
6107
|
+
() => {
|
|
6108
|
+
splitView.value?.updateWidth();
|
|
6109
|
+
},
|
|
6110
|
+
{
|
|
6111
|
+
immediate: true
|
|
6112
|
+
}
|
|
6113
|
+
);
|
|
6114
|
+
vue.watch(
|
|
6115
|
+
() => columnWidth.value.right,
|
|
6116
|
+
(right) => {
|
|
6117
|
+
if (typeof right === "undefined")
|
|
6118
|
+
return;
|
|
6119
|
+
globalThis.localStorage.setItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, `${right}`);
|
|
6120
|
+
}
|
|
6121
|
+
);
|
|
6122
|
+
vue.watch(
|
|
6123
|
+
() => columnWidth.value.left,
|
|
6124
|
+
(left) => {
|
|
6125
|
+
globalThis.localStorage.setItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, `${left}`);
|
|
5623
6126
|
}
|
|
6127
|
+
);
|
|
6128
|
+
vue.watch(
|
|
6129
|
+
() => uiService?.get("hideSlideBar"),
|
|
6130
|
+
(hideSlideBar) => {
|
|
6131
|
+
columnWidth.value.left = hideSlideBar ? 0 : getLeftColumnWidthCacheData();
|
|
6132
|
+
}
|
|
6133
|
+
);
|
|
6134
|
+
const columnWidthChange = (columnW) => {
|
|
6135
|
+
columnWidth.value.left = columnW.left;
|
|
6136
|
+
columnWidth.value.center = columnW.center;
|
|
6137
|
+
columnWidth.value.right = columnW.right;
|
|
6138
|
+
uiService?.set("columnWidth", columnW);
|
|
5624
6139
|
};
|
|
5625
|
-
const
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
6140
|
+
const saveCode = (value) => {
|
|
6141
|
+
try {
|
|
6142
|
+
const parseDSL = getConfig("parseDSL");
|
|
6143
|
+
editorService?.set("root", parseDSL(value));
|
|
6144
|
+
} catch (e) {
|
|
6145
|
+
console.error(e);
|
|
5630
6146
|
}
|
|
5631
6147
|
};
|
|
5632
6148
|
return (_ctx, _cache) => {
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
class:
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
6149
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
6150
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6151
|
+
class: "m-editor",
|
|
6152
|
+
ref_key: "content",
|
|
6153
|
+
ref: content,
|
|
6154
|
+
style: { "min-width": "180px" }
|
|
5639
6155
|
}, [
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
},
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
default: vue.withCtx(() => [
|
|
5675
|
-
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$K, {
|
|
5676
|
-
key: 0,
|
|
5677
|
-
icon: _ctx.data.icon
|
|
5678
|
-
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5679
|
-
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
|
|
6156
|
+
vue.renderSlot(_ctx.$slots, "header"),
|
|
6157
|
+
vue.renderSlot(_ctx.$slots, "nav"),
|
|
6158
|
+
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
6159
|
+
showSrc.value ? vue.renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
6160
|
+
vue.createVNode(_sfc_main$T, {
|
|
6161
|
+
class: "m-editor-content",
|
|
6162
|
+
"init-values": root.value,
|
|
6163
|
+
options: vue.unref(codeOptions),
|
|
6164
|
+
onSave: saveCode
|
|
6165
|
+
}, null, 8, ["init-values", "options"])
|
|
6166
|
+
]) : vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$y, {
|
|
6167
|
+
key: 1,
|
|
6168
|
+
"element-loading-text": "Runtime 加载中...",
|
|
6169
|
+
ref_key: "splitView",
|
|
6170
|
+
ref: splitView,
|
|
6171
|
+
class: "m-editor-content",
|
|
6172
|
+
"left-class": "m-editor-framework-left",
|
|
6173
|
+
"center-class": "m-editor-framework-center",
|
|
6174
|
+
"right-class": "m-editor-framework-right",
|
|
6175
|
+
left: columnWidth.value.left,
|
|
6176
|
+
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => columnWidth.value.left = $event),
|
|
6177
|
+
right: columnWidth.value.right,
|
|
6178
|
+
"onUpdate:right": _cache[1] || (_cache[1] = ($event) => columnWidth.value.right = $event),
|
|
6179
|
+
"min-left": 65,
|
|
6180
|
+
"min-right": 20,
|
|
6181
|
+
"min-center": 100,
|
|
6182
|
+
onChange: columnWidthChange
|
|
6183
|
+
}, vue.createSlots({
|
|
6184
|
+
left: vue.withCtx(() => [
|
|
6185
|
+
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
6186
|
+
]),
|
|
6187
|
+
center: vue.withCtx(() => [
|
|
6188
|
+
page.value ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
6189
|
+
vue.createVNode(_sfc_main$s, { "disabled-page-fragment": _ctx.disabledPageFragment }, null, 8, ["disabled-page-fragment"])
|
|
5680
6190
|
]),
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
key: 3,
|
|
5685
|
-
trigger: "click",
|
|
5686
|
-
disabled: disabled.value,
|
|
5687
|
-
onCommand: dropdownHandler
|
|
5688
|
-
}, {
|
|
5689
|
-
dropdown: vue.withCtx(() => [
|
|
5690
|
-
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
|
|
5691
|
-
default: vue.withCtx(() => [
|
|
5692
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
|
|
5693
|
-
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
|
|
5694
|
-
key: index,
|
|
5695
|
-
command: { data: _ctx.data, subItem }
|
|
5696
|
-
}, {
|
|
5697
|
-
default: vue.withCtx(() => [
|
|
5698
|
-
vue.createTextVNode(vue.toDisplayString(subItem.text), 1)
|
|
5699
|
-
]),
|
|
5700
|
-
_: 2
|
|
5701
|
-
}, 1032, ["command"]);
|
|
5702
|
-
}), 128))
|
|
6191
|
+
vue.createVNode(_sfc_main$t, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
6192
|
+
"page-bar-title": vue.withCtx(({ page: page2 }) => [
|
|
6193
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: page2 })
|
|
5703
6194
|
]),
|
|
5704
|
-
|
|
5705
|
-
|
|
6195
|
+
"page-bar-popover": vue.withCtx(({ page: page2 }) => [
|
|
6196
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: page2 })
|
|
6197
|
+
]),
|
|
6198
|
+
_: 3
|
|
6199
|
+
}, 8, ["disabled-page-fragment"])
|
|
5706
6200
|
]),
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
6201
|
+
_: 2
|
|
6202
|
+
}, [
|
|
6203
|
+
page.value ? {
|
|
6204
|
+
name: "right",
|
|
6205
|
+
fn: vue.withCtx(() => [
|
|
6206
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
5711
6207
|
default: vue.withCtx(() => [
|
|
5712
|
-
vue.
|
|
6208
|
+
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
5713
6209
|
]),
|
|
5714
|
-
_:
|
|
6210
|
+
_: 3
|
|
5715
6211
|
})
|
|
5716
|
-
])
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
6212
|
+
]),
|
|
6213
|
+
key: "0"
|
|
6214
|
+
} : void 0
|
|
6215
|
+
]), 1032, ["left", "right"])), [
|
|
6216
|
+
[_directive_loading, stageLoading.value]
|
|
6217
|
+
]),
|
|
6218
|
+
vue.renderSlot(_ctx.$slots, "content-after"),
|
|
6219
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
6220
|
+
], 512);
|
|
5721
6221
|
};
|
|
5722
6222
|
}
|
|
5723
6223
|
});
|
|
5724
6224
|
|
|
5725
|
-
const _sfc_main$
|
|
6225
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
5726
6226
|
...{
|
|
5727
6227
|
name: "MEditorNavMenu"
|
|
5728
6228
|
},
|
|
@@ -5884,7 +6384,7 @@
|
|
|
5884
6384
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
5885
6385
|
}, [
|
|
5886
6386
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
5887
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6387
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
5888
6388
|
data: item,
|
|
5889
6389
|
key: index
|
|
5890
6390
|
}, null, 8, ["data"]);
|
|
@@ -5896,8 +6396,8 @@
|
|
|
5896
6396
|
}
|
|
5897
6397
|
});
|
|
5898
6398
|
|
|
5899
|
-
const _hoisted_1$
|
|
5900
|
-
const _sfc_main$
|
|
6399
|
+
const _hoisted_1$b = { class: "m-editor-props-panel" };
|
|
6400
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
5901
6401
|
...{
|
|
5902
6402
|
name: "MEditorPropsPanel"
|
|
5903
6403
|
},
|
|
@@ -5931,7 +6431,7 @@
|
|
|
5931
6431
|
vue.onMounted(() => {
|
|
5932
6432
|
emit("mounted", internalInstance);
|
|
5933
6433
|
});
|
|
5934
|
-
vue.
|
|
6434
|
+
vue.onBeforeUnmount(() => {
|
|
5935
6435
|
services?.propsService.off("props-configs-change", init);
|
|
5936
6436
|
});
|
|
5937
6437
|
vue.watchEffect(() => {
|
|
@@ -5951,7 +6451,7 @@
|
|
|
5951
6451
|
};
|
|
5952
6452
|
__expose({ configForm, submit });
|
|
5953
6453
|
return (_ctx, _cache) => {
|
|
5954
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6454
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
5955
6455
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
5956
6456
|
vue.createVNode(vue.unref(form.MForm), {
|
|
5957
6457
|
ref_key: "configForm",
|
|
@@ -6102,7 +6602,7 @@
|
|
|
6102
6602
|
};
|
|
6103
6603
|
};
|
|
6104
6604
|
|
|
6105
|
-
const _sfc_main$
|
|
6605
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
6106
6606
|
...{
|
|
6107
6607
|
name: "MEditorSearchInput"
|
|
6108
6608
|
},
|
|
@@ -6153,14 +6653,14 @@
|
|
|
6153
6653
|
});
|
|
6154
6654
|
};
|
|
6155
6655
|
|
|
6156
|
-
const _hoisted_1$
|
|
6157
|
-
const _hoisted_2$
|
|
6656
|
+
const _hoisted_1$a = ["draggable", "data-node-id", "data-is-container"];
|
|
6657
|
+
const _hoisted_2$6 = { class: "tree-node-label" };
|
|
6158
6658
|
const _hoisted_3$3 = { class: "tree-node-tool" };
|
|
6159
6659
|
const _hoisted_4$3 = {
|
|
6160
6660
|
key: 0,
|
|
6161
6661
|
class: "m-editor-tree-node-children"
|
|
6162
6662
|
};
|
|
6163
|
-
const _sfc_main$
|
|
6663
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
6164
6664
|
...{
|
|
6165
6665
|
name: "MEditorTreeNode"
|
|
6166
6666
|
},
|
|
@@ -6186,7 +6686,7 @@
|
|
|
6186
6686
|
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6187
6687
|
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6188
6688
|
const draggable = vue.computed(() => nodeStatus.value.draggable);
|
|
6189
|
-
const
|
|
6689
|
+
const hasChildren = vue.computed(() => props.data.items?.some((item) => props.nodeStatusMap.get(item.id)?.visible));
|
|
6190
6690
|
const handleDragStart = (event) => {
|
|
6191
6691
|
treeEmit?.("node-dragstart", event, props.data);
|
|
6192
6692
|
};
|
|
@@ -6227,9 +6727,9 @@
|
|
|
6227
6727
|
onContextmenu: nodeContentmenuHandler,
|
|
6228
6728
|
onMouseenter: mouseenterHandler
|
|
6229
6729
|
}, [
|
|
6230
|
-
vue.createVNode(_sfc_main$
|
|
6730
|
+
vue.createVNode(_sfc_main$N, {
|
|
6231
6731
|
class: "expand-icon",
|
|
6232
|
-
style: vue.normalizeStyle(
|
|
6732
|
+
style: vue.normalizeStyle(hasChildren.value ? "" : "color: transparent; cursor: default"),
|
|
6233
6733
|
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
6234
6734
|
onClick: expandHandler
|
|
6235
6735
|
}, null, 8, ["style", "icon"]),
|
|
@@ -6238,7 +6738,7 @@
|
|
|
6238
6738
|
onClick: nodeClickHandler
|
|
6239
6739
|
}, [
|
|
6240
6740
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
6241
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6741
|
+
vue.createElementVNode("div", _hoisted_2$6, [
|
|
6242
6742
|
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
6243
6743
|
vue.createTextVNode(vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
6244
6744
|
])
|
|
@@ -6249,7 +6749,7 @@
|
|
|
6249
6749
|
])
|
|
6250
6750
|
])
|
|
6251
6751
|
], 38),
|
|
6252
|
-
|
|
6752
|
+
hasChildren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
6253
6753
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
6254
6754
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
6255
6755
|
key: item.id,
|
|
@@ -6270,15 +6770,15 @@
|
|
|
6270
6770
|
}, 1032, ["data", "node-status-map", "indent"]);
|
|
6271
6771
|
}), 128))
|
|
6272
6772
|
])) : vue.createCommentVNode("", true)
|
|
6273
|
-
], 40, _hoisted_1$
|
|
6773
|
+
], 40, _hoisted_1$a)), [
|
|
6274
6774
|
[vue.vShow, visible.value]
|
|
6275
6775
|
]);
|
|
6276
6776
|
};
|
|
6277
6777
|
}
|
|
6278
6778
|
});
|
|
6279
6779
|
|
|
6280
|
-
const _hoisted_1$
|
|
6281
|
-
const _sfc_main$
|
|
6780
|
+
const _hoisted_1$9 = { key: 1 };
|
|
6781
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
6282
6782
|
...{
|
|
6283
6783
|
name: "MEditorTree"
|
|
6284
6784
|
},
|
|
@@ -6302,7 +6802,7 @@
|
|
|
6302
6802
|
onDragover: handleDragOver
|
|
6303
6803
|
}, [
|
|
6304
6804
|
_ctx.data?.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.data, (item) => {
|
|
6305
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6805
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
6306
6806
|
key: item.id,
|
|
6307
6807
|
data: item,
|
|
6308
6808
|
indent: _ctx.indent,
|
|
@@ -6319,7 +6819,7 @@
|
|
|
6319
6819
|
]),
|
|
6320
6820
|
_: 2
|
|
6321
6821
|
}, 1032, ["data", "indent", "node-status-map"]);
|
|
6322
|
-
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6822
|
+
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
6323
6823
|
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
6324
6824
|
]))
|
|
6325
6825
|
], 32);
|
|
@@ -6399,7 +6899,7 @@
|
|
|
6399
6899
|
};
|
|
6400
6900
|
};
|
|
6401
6901
|
|
|
6402
|
-
const _sfc_main$
|
|
6902
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
6403
6903
|
...{
|
|
6404
6904
|
name: "MEditorCodeBlockList"
|
|
6405
6905
|
},
|
|
@@ -6481,7 +6981,7 @@
|
|
|
6481
6981
|
filter: filterTextChangeHandler
|
|
6482
6982
|
});
|
|
6483
6983
|
return (_ctx, _cache) => {
|
|
6484
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6984
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6485
6985
|
data: codeList.value,
|
|
6486
6986
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
6487
6987
|
onNodeClick: clickHandler
|
|
@@ -6503,7 +7003,7 @@
|
|
|
6503
7003
|
placement: "bottom"
|
|
6504
7004
|
}, {
|
|
6505
7005
|
default: vue.withCtx(() => [
|
|
6506
|
-
vue.createVNode(_sfc_main$
|
|
7006
|
+
vue.createVNode(_sfc_main$N, {
|
|
6507
7007
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6508
7008
|
class: "edit-icon",
|
|
6509
7009
|
onClick: vue.withModifiers(($event) => editCode(`${data.key}`), ["stop"])
|
|
@@ -6518,7 +7018,7 @@
|
|
|
6518
7018
|
placement: "bottom"
|
|
6519
7019
|
}, {
|
|
6520
7020
|
default: vue.withCtx(() => [
|
|
6521
|
-
vue.createVNode(_sfc_main$
|
|
7021
|
+
vue.createVNode(_sfc_main$N, {
|
|
6522
7022
|
icon: vue.unref(iconsVue.Close),
|
|
6523
7023
|
class: "edit-icon",
|
|
6524
7024
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.key}`), ["stop"])
|
|
@@ -6537,8 +7037,8 @@
|
|
|
6537
7037
|
}
|
|
6538
7038
|
});
|
|
6539
7039
|
|
|
6540
|
-
const _hoisted_1$
|
|
6541
|
-
const _sfc_main$
|
|
7040
|
+
const _hoisted_1$8 = { class: "search-wrapper" };
|
|
7041
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6542
7042
|
...{
|
|
6543
7043
|
name: "MEditorCodeBlockListPanel"
|
|
6544
7044
|
},
|
|
@@ -6560,8 +7060,8 @@
|
|
|
6560
7060
|
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
6561
7061
|
default: vue.withCtx(() => [
|
|
6562
7062
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
6563
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6564
|
-
vue.createVNode(_sfc_main$
|
|
7063
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
7064
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
6565
7065
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
6566
7066
|
key: 0,
|
|
6567
7067
|
class: "create-code-button",
|
|
@@ -6577,7 +7077,7 @@
|
|
|
6577
7077
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
6578
7078
|
])
|
|
6579
7079
|
]),
|
|
6580
|
-
vue.createVNode(_sfc_main$
|
|
7080
|
+
vue.createVNode(_sfc_main$l, {
|
|
6581
7081
|
ref_key: "codeBlockList",
|
|
6582
7082
|
ref: codeBlockList,
|
|
6583
7083
|
"custom-error": _ctx.customError,
|
|
@@ -6595,7 +7095,7 @@
|
|
|
6595
7095
|
]),
|
|
6596
7096
|
_: 3
|
|
6597
7097
|
}),
|
|
6598
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7098
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
6599
7099
|
key: 0,
|
|
6600
7100
|
ref_key: "codeBlockEditor",
|
|
6601
7101
|
ref: codeBlockEditor,
|
|
@@ -6609,7 +7109,7 @@
|
|
|
6609
7109
|
}
|
|
6610
7110
|
});
|
|
6611
7111
|
|
|
6612
|
-
const _sfc_main$
|
|
7112
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
6613
7113
|
...{
|
|
6614
7114
|
name: "MEditorDataSourceConfigPanel"
|
|
6615
7115
|
},
|
|
@@ -6665,7 +7165,7 @@
|
|
|
6665
7165
|
}
|
|
6666
7166
|
});
|
|
6667
7167
|
|
|
6668
|
-
const _sfc_main$
|
|
7168
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
6669
7169
|
...{
|
|
6670
7170
|
name: "MEditorDataSourceList"
|
|
6671
7171
|
},
|
|
@@ -6754,7 +7254,7 @@
|
|
|
6754
7254
|
filter: filterTextChangeHandler
|
|
6755
7255
|
});
|
|
6756
7256
|
return (_ctx, _cache) => {
|
|
6757
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7257
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6758
7258
|
data: list.value,
|
|
6759
7259
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
6760
7260
|
onNodeClick: clickHandler
|
|
@@ -6776,7 +7276,7 @@
|
|
|
6776
7276
|
placement: "bottom"
|
|
6777
7277
|
}, {
|
|
6778
7278
|
default: vue.withCtx(() => [
|
|
6779
|
-
vue.createVNode(_sfc_main$
|
|
7279
|
+
vue.createVNode(_sfc_main$N, {
|
|
6780
7280
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6781
7281
|
class: "edit-icon",
|
|
6782
7282
|
onClick: vue.withModifiers(($event) => editHandler(`${data.key}`), ["stop"])
|
|
@@ -6791,7 +7291,7 @@
|
|
|
6791
7291
|
placement: "bottom"
|
|
6792
7292
|
}, {
|
|
6793
7293
|
default: vue.withCtx(() => [
|
|
6794
|
-
vue.createVNode(_sfc_main$
|
|
7294
|
+
vue.createVNode(_sfc_main$N, {
|
|
6795
7295
|
icon: vue.unref(iconsVue.Close),
|
|
6796
7296
|
class: "edit-icon",
|
|
6797
7297
|
onClick: vue.withModifiers(($event) => removeHandler(`${data.key}`), ["stop"])
|
|
@@ -6807,9 +7307,9 @@
|
|
|
6807
7307
|
}
|
|
6808
7308
|
});
|
|
6809
7309
|
|
|
6810
|
-
const _hoisted_1$
|
|
6811
|
-
const _hoisted_2$
|
|
6812
|
-
const _sfc_main$
|
|
7310
|
+
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
7311
|
+
const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
|
|
7312
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6813
7313
|
...{
|
|
6814
7314
|
name: "MEditorDataSourceListPanel"
|
|
6815
7315
|
},
|
|
@@ -6873,8 +7373,8 @@
|
|
|
6873
7373
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
6874
7374
|
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
6875
7375
|
default: vue.withCtx(() => [
|
|
6876
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6877
|
-
vue.createVNode(_sfc_main$
|
|
7376
|
+
vue.createElementVNode("div", _hoisted_1$7, [
|
|
7377
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
6878
7378
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
6879
7379
|
key: 0,
|
|
6880
7380
|
placement: "right"
|
|
@@ -6891,9 +7391,9 @@
|
|
|
6891
7391
|
})
|
|
6892
7392
|
]),
|
|
6893
7393
|
default: vue.withCtx(() => [
|
|
6894
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
7394
|
+
vue.createElementVNode("div", _hoisted_2$5, [
|
|
6895
7395
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
6896
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7396
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
6897
7397
|
data: {
|
|
6898
7398
|
type: "button",
|
|
6899
7399
|
text: item.text,
|
|
@@ -6909,14 +7409,14 @@
|
|
|
6909
7409
|
_: 1
|
|
6910
7410
|
})) : vue.createCommentVNode("", true)
|
|
6911
7411
|
]),
|
|
6912
|
-
vue.createVNode(_sfc_main$
|
|
7412
|
+
vue.createVNode(_sfc_main$i, {
|
|
6913
7413
|
onEdit: editHandler,
|
|
6914
7414
|
onRemove: removeHandler
|
|
6915
7415
|
})
|
|
6916
7416
|
]),
|
|
6917
7417
|
_: 1
|
|
6918
7418
|
}),
|
|
6919
|
-
vue.createVNode(_sfc_main$
|
|
7419
|
+
vue.createVNode(_sfc_main$j, {
|
|
6920
7420
|
ref_key: "editDialog",
|
|
6921
7421
|
ref: editDialog,
|
|
6922
7422
|
disabled: !editable.value,
|
|
@@ -6930,7 +7430,7 @@
|
|
|
6930
7430
|
}
|
|
6931
7431
|
});
|
|
6932
7432
|
|
|
6933
|
-
const _sfc_main$
|
|
7433
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
6934
7434
|
...{
|
|
6935
7435
|
name: "MEditorContentMenu"
|
|
6936
7436
|
},
|
|
@@ -6971,7 +7471,7 @@
|
|
|
6971
7471
|
return;
|
|
6972
7472
|
hide();
|
|
6973
7473
|
};
|
|
6974
|
-
const
|
|
7474
|
+
const outsideClickHideHandler = (e) => {
|
|
6975
7475
|
if (!props.autoHide)
|
|
6976
7476
|
return;
|
|
6977
7477
|
const target = e.target;
|
|
@@ -7032,12 +7532,12 @@
|
|
|
7032
7532
|
vue.onMounted(() => {
|
|
7033
7533
|
if (props.isSubMenu)
|
|
7034
7534
|
return;
|
|
7035
|
-
globalThis.addEventListener("mousedown",
|
|
7535
|
+
globalThis.addEventListener("mousedown", outsideClickHideHandler, true);
|
|
7036
7536
|
});
|
|
7037
|
-
vue.
|
|
7537
|
+
vue.onBeforeUnmount(() => {
|
|
7038
7538
|
if (props.isSubMenu)
|
|
7039
7539
|
return;
|
|
7040
|
-
globalThis.removeEventListener("mousedown",
|
|
7540
|
+
globalThis.removeEventListener("mousedown", outsideClickHideHandler, true);
|
|
7041
7541
|
});
|
|
7042
7542
|
__expose({
|
|
7043
7543
|
menu,
|
|
@@ -7061,7 +7561,7 @@
|
|
|
7061
7561
|
vue.renderSlot(_ctx.$slots, "title"),
|
|
7062
7562
|
vue.createElementVNode("div", null, [
|
|
7063
7563
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
7064
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7564
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
7065
7565
|
"event-type": "mouseup",
|
|
7066
7566
|
ref_for: true,
|
|
7067
7567
|
ref_key: "buttons",
|
|
@@ -7096,7 +7596,7 @@
|
|
|
7096
7596
|
}
|
|
7097
7597
|
});
|
|
7098
7598
|
|
|
7099
|
-
const _hoisted_1$
|
|
7599
|
+
const _hoisted_1$6 = {
|
|
7100
7600
|
width: "1em",
|
|
7101
7601
|
height: "1em",
|
|
7102
7602
|
viewBox: "0 0 16 16",
|
|
@@ -7104,7 +7604,7 @@
|
|
|
7104
7604
|
fill: "currentColor",
|
|
7105
7605
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7106
7606
|
};
|
|
7107
|
-
const _hoisted_2$
|
|
7607
|
+
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
7108
7608
|
"fill-rule": "evenodd",
|
|
7109
7609
|
d: "M9.828 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H9.828zm-2.95-1.707L7.587 3H2.19c-.24 0-.47.042-.684.12L1.5 2.98a1 1 0 0 1 1-.98h3.672a1 1 0 0 1 .707.293z"
|
|
7110
7610
|
}, null, -1);
|
|
@@ -7113,17 +7613,17 @@
|
|
|
7113
7613
|
d: "M11 11.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z"
|
|
7114
7614
|
}, null, -1);
|
|
7115
7615
|
const _hoisted_4$2 = [
|
|
7116
|
-
_hoisted_2$
|
|
7616
|
+
_hoisted_2$4,
|
|
7117
7617
|
_hoisted_3$2
|
|
7118
7618
|
];
|
|
7119
|
-
const _sfc_main$
|
|
7619
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
7120
7620
|
...{
|
|
7121
7621
|
name: "MEditorFolderMinusIcon"
|
|
7122
7622
|
},
|
|
7123
7623
|
__name: "FolderMinusIcon",
|
|
7124
7624
|
setup(__props) {
|
|
7125
7625
|
return (_ctx, _cache) => {
|
|
7126
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
7626
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _hoisted_4$2);
|
|
7127
7627
|
};
|
|
7128
7628
|
}
|
|
7129
7629
|
});
|
|
@@ -7134,7 +7634,7 @@
|
|
|
7134
7634
|
icon: iconsVue.Delete,
|
|
7135
7635
|
display: (services) => {
|
|
7136
7636
|
const node = services?.editorService?.get("node");
|
|
7137
|
-
return node?.type !== schema.NodeType.ROOT && !utils.isPage(node);
|
|
7637
|
+
return node?.type !== schema.NodeType.ROOT && !utils.isPage(node) && !utils.isPageFragment(node);
|
|
7138
7638
|
},
|
|
7139
7639
|
handler: (services) => {
|
|
7140
7640
|
const nodes = services?.editorService?.get("nodes");
|
|
@@ -7201,13 +7701,14 @@
|
|
|
7201
7701
|
};
|
|
7202
7702
|
};
|
|
7203
7703
|
|
|
7204
|
-
const _sfc_main$
|
|
7704
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
7205
7705
|
...{
|
|
7206
7706
|
name: "MEditorLayerMenu"
|
|
7207
7707
|
},
|
|
7208
7708
|
__name: "LayerMenu",
|
|
7209
7709
|
props: {
|
|
7210
|
-
layerContentMenu: {}
|
|
7710
|
+
layerContentMenu: { default: () => [] },
|
|
7711
|
+
customContentMenu: { type: Function, default: (menus) => menus }
|
|
7211
7712
|
},
|
|
7212
7713
|
emits: ["collapse-all"],
|
|
7213
7714
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -7261,29 +7762,34 @@
|
|
|
7261
7762
|
}
|
|
7262
7763
|
return [];
|
|
7263
7764
|
});
|
|
7264
|
-
const menuData = vue.computed(
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7765
|
+
const menuData = vue.computed(
|
|
7766
|
+
() => props.customContentMenu(
|
|
7767
|
+
[
|
|
7768
|
+
{
|
|
7769
|
+
type: "button",
|
|
7770
|
+
text: "全部折叠",
|
|
7771
|
+
icon: _sfc_main$f,
|
|
7772
|
+
display: () => utils.isPage(node.value) || utils.isPageFragment(node.value),
|
|
7773
|
+
handler: () => {
|
|
7774
|
+
emit("collapse-all");
|
|
7775
|
+
}
|
|
7776
|
+
},
|
|
7777
|
+
{
|
|
7778
|
+
type: "button",
|
|
7779
|
+
text: "新增",
|
|
7780
|
+
icon: vue.markRaw(iconsVue.Plus),
|
|
7781
|
+
display: () => node.value?.items && nodes.value?.length === 1,
|
|
7782
|
+
items: getSubMenuData.value
|
|
7783
|
+
},
|
|
7784
|
+
useCopyMenu(),
|
|
7785
|
+
usePasteMenu(),
|
|
7786
|
+
useDeleteMenu(),
|
|
7787
|
+
useMoveToMenu(services),
|
|
7788
|
+
...props.layerContentMenu
|
|
7789
|
+
],
|
|
7790
|
+
"layer"
|
|
7791
|
+
)
|
|
7792
|
+
);
|
|
7287
7793
|
const show = (e) => {
|
|
7288
7794
|
menu.value?.show(e);
|
|
7289
7795
|
};
|
|
@@ -7291,7 +7797,7 @@
|
|
|
7291
7797
|
show
|
|
7292
7798
|
});
|
|
7293
7799
|
return (_ctx, _cache) => {
|
|
7294
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7800
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
7295
7801
|
"menu-data": menuData.value,
|
|
7296
7802
|
ref_key: "menu",
|
|
7297
7803
|
ref: menu,
|
|
@@ -7301,7 +7807,7 @@
|
|
|
7301
7807
|
}
|
|
7302
7808
|
});
|
|
7303
7809
|
|
|
7304
|
-
const _sfc_main$
|
|
7810
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
7305
7811
|
__name: "LayerNodeTool",
|
|
7306
7812
|
props: {
|
|
7307
7813
|
data: {}
|
|
@@ -7320,12 +7826,12 @@
|
|
|
7320
7826
|
};
|
|
7321
7827
|
return (_ctx, _cache) => {
|
|
7322
7828
|
return _ctx.data.type !== "page" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
7323
|
-
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7829
|
+
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
7324
7830
|
key: 0,
|
|
7325
7831
|
icon: vue.unref(iconsVue.Hide),
|
|
7326
7832
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => setNodeVisible(true), ["stop"])),
|
|
7327
7833
|
title: "点击显示"
|
|
7328
|
-
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7834
|
+
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
7329
7835
|
key: 1,
|
|
7330
7836
|
icon: vue.unref(iconsVue.View),
|
|
7331
7837
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => setNodeVisible(false), ["stop"])),
|
|
@@ -7338,11 +7844,12 @@
|
|
|
7338
7844
|
});
|
|
7339
7845
|
|
|
7340
7846
|
const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
7847
|
+
const isMultiSelect = vue.computed(() => isCtrlKeyDown.value && !services?.editorService.get("disabledMultiSelect"));
|
|
7341
7848
|
const select = async (data) => {
|
|
7342
7849
|
if (!data.id) {
|
|
7343
7850
|
throw new Error("没有id");
|
|
7344
7851
|
}
|
|
7345
|
-
if (
|
|
7852
|
+
if (isMultiSelect.value) {
|
|
7346
7853
|
multiSelect(data);
|
|
7347
7854
|
} else {
|
|
7348
7855
|
await services?.editorService.select(data);
|
|
@@ -7381,7 +7888,7 @@
|
|
|
7381
7888
|
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: data }));
|
|
7382
7889
|
return;
|
|
7383
7890
|
}
|
|
7384
|
-
if (data.items && data.items.length > 0 && !
|
|
7891
|
+
if (data.items && data.items.length > 0 && !isMultiSelect.value) {
|
|
7385
7892
|
updateStatus(nodeStatusMap.value, data.id, {
|
|
7386
7893
|
expand: true
|
|
7387
7894
|
});
|
|
@@ -7651,21 +8158,21 @@
|
|
|
7651
8158
|
}
|
|
7652
8159
|
];
|
|
7653
8160
|
|
|
7654
|
-
const useKeybinding = (services,
|
|
8161
|
+
const useKeybinding = (services, container) => {
|
|
7655
8162
|
const keybindingService = services?.keybindingService;
|
|
7656
8163
|
const isCtrlKeyDown = vue.ref(false);
|
|
7657
8164
|
const windowBlurHandler = () => {
|
|
7658
8165
|
isCtrlKeyDown.value = false;
|
|
7659
8166
|
};
|
|
7660
|
-
keybindingService?.
|
|
8167
|
+
keybindingService?.registerCommand("layer-panel-global-keyup", () => {
|
|
7661
8168
|
isCtrlKeyDown.value = false;
|
|
7662
8169
|
});
|
|
7663
|
-
keybindingService?.
|
|
8170
|
+
keybindingService?.registerCommand("layer-panel-global-keydown", () => {
|
|
7664
8171
|
isCtrlKeyDown.value = true;
|
|
7665
8172
|
});
|
|
7666
|
-
keybindingService?.
|
|
8173
|
+
keybindingService?.register([
|
|
7667
8174
|
{
|
|
7668
|
-
command: "layer-panel-global-
|
|
8175
|
+
command: "layer-panel-global-keydown",
|
|
7669
8176
|
keybinding: "ctrl",
|
|
7670
8177
|
when: [["global", "keydown"]]
|
|
7671
8178
|
},
|
|
@@ -7676,12 +8183,12 @@
|
|
|
7676
8183
|
}
|
|
7677
8184
|
]);
|
|
7678
8185
|
vue.watchEffect(() => {
|
|
7679
|
-
if (
|
|
8186
|
+
if (container.value) {
|
|
7680
8187
|
globalThis.addEventListener("blur", windowBlurHandler);
|
|
7681
|
-
keybindingService?.
|
|
8188
|
+
keybindingService?.registerEl(KeyBindingContainerKey.LAYER_PANEL, container.value.$el);
|
|
7682
8189
|
} else {
|
|
7683
8190
|
globalThis.removeEventListener("blur", windowBlurHandler);
|
|
7684
|
-
keybindingService?.
|
|
8191
|
+
keybindingService?.unregisterEl(KeyBindingContainerKey.LAYER_PANEL);
|
|
7685
8192
|
}
|
|
7686
8193
|
});
|
|
7687
8194
|
return {
|
|
@@ -7689,7 +8196,7 @@
|
|
|
7689
8196
|
};
|
|
7690
8197
|
};
|
|
7691
8198
|
|
|
7692
|
-
const createPageNodeStatus = (page,
|
|
8199
|
+
const createPageNodeStatus = (page, initialLayerNodeStatus) => {
|
|
7693
8200
|
const map = /* @__PURE__ */ new Map();
|
|
7694
8201
|
map.set(page.id, {
|
|
7695
8202
|
visible: true,
|
|
@@ -7701,7 +8208,7 @@
|
|
|
7701
8208
|
(node) => traverseNode(node, (node2) => {
|
|
7702
8209
|
map.set(
|
|
7703
8210
|
node2.id,
|
|
7704
|
-
|
|
8211
|
+
initialLayerNodeStatus?.get(node2.id) || {
|
|
7705
8212
|
visible: true,
|
|
7706
8213
|
expand: false,
|
|
7707
8214
|
selected: false,
|
|
@@ -7776,13 +8283,14 @@
|
|
|
7776
8283
|
};
|
|
7777
8284
|
};
|
|
7778
8285
|
|
|
7779
|
-
const _sfc_main$
|
|
8286
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
7780
8287
|
...{
|
|
7781
8288
|
name: "MEditorLayerPanel"
|
|
7782
8289
|
},
|
|
7783
8290
|
__name: "LayerPanel",
|
|
7784
8291
|
props: {
|
|
7785
|
-
layerContentMenu: {}
|
|
8292
|
+
layerContentMenu: {},
|
|
8293
|
+
customContentMenu: { type: Function }
|
|
7786
8294
|
},
|
|
7787
8295
|
setup(__props) {
|
|
7788
8296
|
const services = vue.inject("services");
|
|
@@ -7824,8 +8332,8 @@
|
|
|
7824
8332
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
7825
8333
|
default: vue.withCtx(() => [
|
|
7826
8334
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
7827
|
-
vue.createVNode(_sfc_main$
|
|
7828
|
-
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8335
|
+
vue.createVNode(_sfc_main$o, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
8336
|
+
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
7829
8337
|
key: 0,
|
|
7830
8338
|
tabindex: "-1",
|
|
7831
8339
|
ref_key: "tree",
|
|
@@ -7845,7 +8353,7 @@
|
|
|
7845
8353
|
]),
|
|
7846
8354
|
"tree-node-tool": vue.withCtx(({ data: nodeData2 }) => [
|
|
7847
8355
|
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data: nodeData2 }, () => [
|
|
7848
|
-
vue.createVNode(_sfc_main$
|
|
8356
|
+
vue.createVNode(_sfc_main$d, { data: nodeData2 }, null, 8, ["data"])
|
|
7849
8357
|
])
|
|
7850
8358
|
]),
|
|
7851
8359
|
"tree-node-label": vue.withCtx(({ data: nodeData2 }) => [
|
|
@@ -7854,12 +8362,13 @@
|
|
|
7854
8362
|
_: 3
|
|
7855
8363
|
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
7856
8364
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7857
|
-
vue.createVNode(_sfc_main$
|
|
8365
|
+
vue.createVNode(_sfc_main$e, {
|
|
7858
8366
|
ref_key: "menu",
|
|
7859
8367
|
ref: menu,
|
|
7860
8368
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
8369
|
+
"custom-content-menu": _ctx.customContentMenu,
|
|
7861
8370
|
onCollapseAll: collapseAllHandler
|
|
7862
|
-
}, null, 8, ["layer-content-menu"])
|
|
8371
|
+
}, null, 8, ["layer-content-menu", "custom-content-menu"])
|
|
7863
8372
|
]))
|
|
7864
8373
|
]),
|
|
7865
8374
|
_: 3
|
|
@@ -7868,9 +8377,9 @@
|
|
|
7868
8377
|
}
|
|
7869
8378
|
});
|
|
7870
8379
|
|
|
7871
|
-
const _hoisted_1$
|
|
7872
|
-
const _hoisted_2$
|
|
7873
|
-
const _sfc_main$
|
|
8380
|
+
const _hoisted_1$5 = ["onClick", "onDragstart"];
|
|
8381
|
+
const _hoisted_2$3 = ["title"];
|
|
8382
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
7874
8383
|
...{
|
|
7875
8384
|
name: "MEditorComponentListPanel"
|
|
7876
8385
|
},
|
|
@@ -7950,7 +8459,7 @@
|
|
|
7950
8459
|
"model-value": collapseValue.value
|
|
7951
8460
|
}, {
|
|
7952
8461
|
default: vue.withCtx(() => [
|
|
7953
|
-
vue.createVNode(_sfc_main$
|
|
8462
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
7954
8463
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
7955
8464
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
7956
8465
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -7958,7 +8467,7 @@
|
|
|
7958
8467
|
name: `${index}`
|
|
7959
8468
|
}, {
|
|
7960
8469
|
title: vue.withCtx(() => [
|
|
7961
|
-
vue.createVNode(_sfc_main$
|
|
8470
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
7962
8471
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
7963
8472
|
]),
|
|
7964
8473
|
default: vue.withCtx(() => [
|
|
@@ -7979,7 +8488,7 @@
|
|
|
7979
8488
|
content: item.desc
|
|
7980
8489
|
}, {
|
|
7981
8490
|
default: vue.withCtx(() => [
|
|
7982
|
-
vue.createVNode(_sfc_main$
|
|
8491
|
+
vue.createVNode(_sfc_main$N, {
|
|
7983
8492
|
icon: item.icon
|
|
7984
8493
|
}, null, 8, ["icon"])
|
|
7985
8494
|
]),
|
|
@@ -7987,9 +8496,9 @@
|
|
|
7987
8496
|
}, 1032, ["disabled", "content"]),
|
|
7988
8497
|
vue.createElementVNode("span", {
|
|
7989
8498
|
title: item.text
|
|
7990
|
-
}, vue.toDisplayString(item.text), 9, _hoisted_2$
|
|
8499
|
+
}, vue.toDisplayString(item.text), 9, _hoisted_2$3)
|
|
7991
8500
|
])
|
|
7992
|
-
], 40, _hoisted_1$
|
|
8501
|
+
], 40, _hoisted_1$5);
|
|
7993
8502
|
}), 128))
|
|
7994
8503
|
]),
|
|
7995
8504
|
_: 2
|
|
@@ -8006,11 +8515,11 @@
|
|
|
8006
8515
|
}
|
|
8007
8516
|
});
|
|
8008
8517
|
|
|
8009
|
-
const _hoisted_1$
|
|
8518
|
+
const _hoisted_1$4 = {
|
|
8010
8519
|
key: 0,
|
|
8011
8520
|
class: "m-editor-sidebar"
|
|
8012
8521
|
};
|
|
8013
|
-
const _hoisted_2$
|
|
8522
|
+
const _hoisted_2$2 = { class: "m-editor-sidebar-header" };
|
|
8014
8523
|
const _hoisted_3$1 = ["onClick", "onDragend"];
|
|
8015
8524
|
const _hoisted_4$1 = {
|
|
8016
8525
|
key: 1,
|
|
@@ -8019,14 +8528,15 @@
|
|
|
8019
8528
|
const _hoisted_5$1 = { class: "m-editor-float-box-list" };
|
|
8020
8529
|
const _hoisted_6 = ["onClick"];
|
|
8021
8530
|
const _hoisted_7 = { class: "m-editor-float-box-body" };
|
|
8022
|
-
const _sfc_main$
|
|
8531
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
8023
8532
|
...{
|
|
8024
8533
|
name: "MEditorSidebar"
|
|
8025
8534
|
},
|
|
8026
8535
|
__name: "Sidebar",
|
|
8027
8536
|
props: {
|
|
8028
8537
|
data: { default: () => ({ type: "tabs", status: "组件", items: ["component-list", "layer", "code-block", "data-source"] }) },
|
|
8029
|
-
layerContentMenu: {}
|
|
8538
|
+
layerContentMenu: {},
|
|
8539
|
+
customContentMenu: {}
|
|
8030
8540
|
},
|
|
8031
8541
|
setup(__props, { expose: __expose }) {
|
|
8032
8542
|
const props = __props;
|
|
@@ -8039,7 +8549,7 @@
|
|
|
8039
8549
|
type: "component",
|
|
8040
8550
|
icon: iconsVue.Goods,
|
|
8041
8551
|
text: "组件",
|
|
8042
|
-
component: _sfc_main$
|
|
8552
|
+
component: _sfc_main$b,
|
|
8043
8553
|
slots: {}
|
|
8044
8554
|
},
|
|
8045
8555
|
layer: {
|
|
@@ -8048,9 +8558,10 @@
|
|
|
8048
8558
|
icon: iconsVue.List,
|
|
8049
8559
|
text: "已选组件",
|
|
8050
8560
|
props: {
|
|
8051
|
-
layerContentMenu: props.layerContentMenu
|
|
8561
|
+
layerContentMenu: props.layerContentMenu,
|
|
8562
|
+
customContentMenu: props.customContentMenu
|
|
8052
8563
|
},
|
|
8053
|
-
component: _sfc_main$
|
|
8564
|
+
component: _sfc_main$c,
|
|
8054
8565
|
slots: {}
|
|
8055
8566
|
},
|
|
8056
8567
|
"code-block": {
|
|
@@ -8058,7 +8569,7 @@
|
|
|
8058
8569
|
type: "component",
|
|
8059
8570
|
icon: iconsVue.EditPen,
|
|
8060
8571
|
text: "代码编辑",
|
|
8061
|
-
component: _sfc_main$
|
|
8572
|
+
component: _sfc_main$k,
|
|
8062
8573
|
slots: {},
|
|
8063
8574
|
boxComponentConfig: {
|
|
8064
8575
|
props: {
|
|
@@ -8071,7 +8582,7 @@
|
|
|
8071
8582
|
type: "component",
|
|
8072
8583
|
icon: iconsVue.Coin,
|
|
8073
8584
|
text: "数据源",
|
|
8074
|
-
component: _sfc_main$
|
|
8585
|
+
component: _sfc_main$h,
|
|
8075
8586
|
slots: {},
|
|
8076
8587
|
boxComponentConfig: {
|
|
8077
8588
|
props: {
|
|
@@ -8114,8 +8625,8 @@
|
|
|
8114
8625
|
});
|
|
8115
8626
|
return (_ctx, _cache) => {
|
|
8116
8627
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
8117
|
-
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
8118
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
8628
|
+
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
8629
|
+
vue.createElementVNode("div", _hoisted_2$2, [
|
|
8119
8630
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
|
|
8120
8631
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
8121
8632
|
class: vue.normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
@@ -8126,7 +8637,7 @@
|
|
|
8126
8637
|
(...args) => vue.unref(dragstartHandler) && vue.unref(dragstartHandler)(...args)),
|
|
8127
8638
|
onDragend: ($event) => vue.unref(dragendHandler)(config.$key, $event)
|
|
8128
8639
|
}, [
|
|
8129
|
-
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8640
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
8130
8641
|
key: 0,
|
|
8131
8642
|
icon: config.icon
|
|
8132
8643
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -8262,7 +8773,7 @@
|
|
|
8262
8773
|
onClick: ($event) => vue.unref(showFloatBox)(config.$key)
|
|
8263
8774
|
}, [
|
|
8264
8775
|
vue.createElementVNode("div", null, vue.toDisplayString(config.text), 1),
|
|
8265
|
-
vue.createVNode(_sfc_main$
|
|
8776
|
+
vue.createVNode(_sfc_main$N, {
|
|
8266
8777
|
class: "m-editor-float-box-close",
|
|
8267
8778
|
icon: vue.unref(iconsVue.Close),
|
|
8268
8779
|
onClick: vue.withModifiers(($event) => vue.unref(closeFloatBox)(config.$key), ["stop"])
|
|
@@ -8410,7 +8921,7 @@
|
|
|
8410
8921
|
};
|
|
8411
8922
|
}
|
|
8412
8923
|
|
|
8413
|
-
const _sfc_main$
|
|
8924
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
8414
8925
|
...{
|
|
8415
8926
|
name: "MEditorScrollBar"
|
|
8416
8927
|
},
|
|
@@ -8449,7 +8960,7 @@
|
|
|
8449
8960
|
});
|
|
8450
8961
|
bar.value?.addEventListener("wheel", wheelHandler, false);
|
|
8451
8962
|
});
|
|
8452
|
-
vue.
|
|
8963
|
+
vue.onBeforeUnmount(() => {
|
|
8453
8964
|
if (gesto)
|
|
8454
8965
|
gesto.off();
|
|
8455
8966
|
bar.value?.removeEventListener("wheel", wheelHandler, false);
|
|
@@ -8498,7 +9009,7 @@
|
|
|
8498
9009
|
}
|
|
8499
9010
|
});
|
|
8500
9011
|
|
|
8501
|
-
const _sfc_main$
|
|
9012
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
8502
9013
|
...{
|
|
8503
9014
|
name: "MEditorScrollViewer"
|
|
8504
9015
|
},
|
|
@@ -8545,7 +9056,7 @@
|
|
|
8545
9056
|
scrollHeight.value = data.scrollHeight;
|
|
8546
9057
|
});
|
|
8547
9058
|
});
|
|
8548
|
-
vue.
|
|
9059
|
+
vue.onBeforeUnmount(() => {
|
|
8549
9060
|
scrollViewer.destroy();
|
|
8550
9061
|
});
|
|
8551
9062
|
vue.watch(
|
|
@@ -8584,14 +9095,14 @@
|
|
|
8584
9095
|
}, [
|
|
8585
9096
|
vue.renderSlot(_ctx.$slots, "default")
|
|
8586
9097
|
], 4),
|
|
8587
|
-
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9098
|
+
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
|
|
8588
9099
|
key: 0,
|
|
8589
9100
|
"scroll-size": scrollHeight.value,
|
|
8590
9101
|
size: _ctx.wrapHeight,
|
|
8591
9102
|
pos: vOffset.value,
|
|
8592
9103
|
onScroll: vScrollHandler
|
|
8593
9104
|
}, null, 8, ["scroll-size", "size", "pos"])) : vue.createCommentVNode("", true),
|
|
8594
|
-
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9105
|
+
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
|
|
8595
9106
|
key: 1,
|
|
8596
9107
|
"is-horizontal": true,
|
|
8597
9108
|
"scroll-size": scrollWidth.value,
|
|
@@ -8734,12 +9245,27 @@
|
|
|
8734
9245
|
return elCanSelect;
|
|
8735
9246
|
},
|
|
8736
9247
|
moveableOptions: stageOptions.moveableOptions,
|
|
8737
|
-
updateDragEl: stageOptions.updateDragEl
|
|
9248
|
+
updateDragEl: stageOptions.updateDragEl,
|
|
9249
|
+
guidesOptions: stageOptions.guidesOptions,
|
|
9250
|
+
disabledMultiSelect: stageOptions.disabledMultiSelect
|
|
8738
9251
|
});
|
|
9252
|
+
vue.watch(
|
|
9253
|
+
() => editorService.get("disabledMultiSelect"),
|
|
9254
|
+
(disabledMultiSelect) => {
|
|
9255
|
+
if (disabledMultiSelect) {
|
|
9256
|
+
stage.disableMultiSelect();
|
|
9257
|
+
} else {
|
|
9258
|
+
stage.enableMultiSelect();
|
|
9259
|
+
}
|
|
9260
|
+
}
|
|
9261
|
+
);
|
|
8739
9262
|
stage.mask.setGuides([
|
|
8740
9263
|
getGuideLineFromCache(getGuideLineKey(H_GUIDE_LINE_STORAGE_KEY)),
|
|
8741
9264
|
getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY))
|
|
8742
9265
|
]);
|
|
9266
|
+
stage.on("page-el-update", () => {
|
|
9267
|
+
editorService.set("stageLoading", false);
|
|
9268
|
+
});
|
|
8743
9269
|
stage.on("select", (el) => {
|
|
8744
9270
|
if (`${editorService.get("node")?.id}` === el.id && editorService.get("nodes").length === 1)
|
|
8745
9271
|
return;
|
|
@@ -8790,8 +9316,8 @@
|
|
|
8790
9316
|
return stage;
|
|
8791
9317
|
};
|
|
8792
9318
|
|
|
8793
|
-
const _hoisted_1$
|
|
8794
|
-
const _sfc_main$
|
|
9319
|
+
const _hoisted_1$3 = { class: "m-editor-float-box-body" };
|
|
9320
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
8795
9321
|
__name: "FloatingBox",
|
|
8796
9322
|
props: {
|
|
8797
9323
|
visible: { type: Boolean, default: false },
|
|
@@ -8891,7 +9417,7 @@
|
|
|
8891
9417
|
}, null, 8, ["icon"])
|
|
8892
9418
|
])
|
|
8893
9419
|
], 512),
|
|
8894
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
9420
|
+
vue.createElementVNode("div", _hoisted_1$3, [
|
|
8895
9421
|
vue.renderSlot(_ctx.$slots, "body")
|
|
8896
9422
|
])
|
|
8897
9423
|
], 4)
|
|
@@ -8900,7 +9426,7 @@
|
|
|
8900
9426
|
}
|
|
8901
9427
|
});
|
|
8902
9428
|
|
|
8903
|
-
const _sfc_main$
|
|
9429
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
8904
9430
|
__name: "NodeListMenu",
|
|
8905
9431
|
setup(__props) {
|
|
8906
9432
|
const services = vue.inject("services");
|
|
@@ -8921,13 +9447,13 @@
|
|
|
8921
9447
|
(stage2) => {
|
|
8922
9448
|
if (!stage2)
|
|
8923
9449
|
return;
|
|
9450
|
+
vue.nextTick(() => unWatch());
|
|
8924
9451
|
stage2.on("select", (el, event) => {
|
|
8925
9452
|
const els = stage2.renderer.getElementsFromPoint(event) || [];
|
|
8926
9453
|
const ids = els.map((el2) => el2.id).filter((id) => Boolean(id));
|
|
8927
9454
|
buttonVisible.value = ids.length > 3;
|
|
8928
9455
|
filterTextChangeHandler(ids);
|
|
8929
9456
|
});
|
|
8930
|
-
unWatch();
|
|
8931
9457
|
},
|
|
8932
9458
|
{
|
|
8933
9459
|
immediate: true
|
|
@@ -8982,7 +9508,7 @@
|
|
|
8982
9508
|
]),
|
|
8983
9509
|
_: 1
|
|
8984
9510
|
})) : vue.createCommentVNode("", true),
|
|
8985
|
-
page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9511
|
+
page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$7, {
|
|
8986
9512
|
key: 1,
|
|
8987
9513
|
ref_key: "box",
|
|
8988
9514
|
ref: box,
|
|
@@ -8992,7 +9518,7 @@
|
|
|
8992
9518
|
position: menuPosition.value
|
|
8993
9519
|
}, {
|
|
8994
9520
|
body: vue.withCtx(() => [
|
|
8995
|
-
vue.createVNode(_sfc_main$
|
|
9521
|
+
vue.createVNode(_sfc_main$m, {
|
|
8996
9522
|
class: "m-editor-node-list-menu magic-editor-layer-tree",
|
|
8997
9523
|
data: nodeData.value,
|
|
8998
9524
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
@@ -9006,12 +9532,12 @@
|
|
|
9006
9532
|
}
|
|
9007
9533
|
});
|
|
9008
9534
|
|
|
9009
|
-
const _hoisted_1$
|
|
9535
|
+
const _hoisted_1$2 = {
|
|
9010
9536
|
viewBox: "0 0 24 24",
|
|
9011
9537
|
fill: "none",
|
|
9012
9538
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9013
9539
|
};
|
|
9014
|
-
const _hoisted_2$
|
|
9540
|
+
const _hoisted_2$1 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
9015
9541
|
"fill-rule": "evenodd",
|
|
9016
9542
|
"clip-rule": "evenodd",
|
|
9017
9543
|
d: "M2 4H21V6H2V4Z",
|
|
@@ -9033,119 +9559,125 @@
|
|
|
9033
9559
|
"fill-opacity": "0.9"
|
|
9034
9560
|
}, null, -1);
|
|
9035
9561
|
const _hoisted_5 = [
|
|
9036
|
-
_hoisted_2$
|
|
9562
|
+
_hoisted_2$1,
|
|
9037
9563
|
_hoisted_3,
|
|
9038
9564
|
_hoisted_4
|
|
9039
9565
|
];
|
|
9040
|
-
const _sfc_main$
|
|
9566
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
9041
9567
|
...{
|
|
9042
9568
|
name: "MEditorCenterIcon"
|
|
9043
9569
|
},
|
|
9044
9570
|
__name: "CenterIcon",
|
|
9045
9571
|
setup(__props) {
|
|
9046
9572
|
return (_ctx, _cache) => {
|
|
9047
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
9573
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_5);
|
|
9048
9574
|
};
|
|
9049
9575
|
}
|
|
9050
9576
|
});
|
|
9051
9577
|
|
|
9052
|
-
const _sfc_main$
|
|
9578
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
9053
9579
|
...{
|
|
9054
9580
|
name: "MEditorViewerMenu"
|
|
9055
9581
|
},
|
|
9056
9582
|
__name: "ViewerMenu",
|
|
9057
9583
|
props: {
|
|
9058
9584
|
isMultiSelect: { type: Boolean, default: false },
|
|
9059
|
-
stageContentMenu: {}
|
|
9585
|
+
stageContentMenu: { default: () => [] },
|
|
9586
|
+
customContentMenu: { type: Function, default: (menus) => menus }
|
|
9060
9587
|
},
|
|
9061
9588
|
setup(__props, { expose: __expose }) {
|
|
9062
|
-
const props = __props;
|
|
9063
|
-
const services = vue.inject("services");
|
|
9064
|
-
const editorService = services?.editorService;
|
|
9065
|
-
const menu = vue.ref();
|
|
9066
|
-
const canCenter = vue.ref(false);
|
|
9067
|
-
const node = vue.computed(() => editorService?.get("node"));
|
|
9068
|
-
const nodes = vue.computed(() => editorService?.get("nodes"));
|
|
9069
|
-
const parent = vue.computed(() => editorService?.get("parent"));
|
|
9070
|
-
const menuData = vue.computed(
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9589
|
+
const props = __props;
|
|
9590
|
+
const services = vue.inject("services");
|
|
9591
|
+
const editorService = services?.editorService;
|
|
9592
|
+
const menu = vue.ref();
|
|
9593
|
+
const canCenter = vue.ref(false);
|
|
9594
|
+
const node = vue.computed(() => editorService?.get("node"));
|
|
9595
|
+
const nodes = vue.computed(() => editorService?.get("nodes"));
|
|
9596
|
+
const parent = vue.computed(() => editorService?.get("parent"));
|
|
9597
|
+
const menuData = vue.computed(
|
|
9598
|
+
() => props.customContentMenu(
|
|
9599
|
+
[
|
|
9600
|
+
{
|
|
9601
|
+
type: "button",
|
|
9602
|
+
text: "水平居中",
|
|
9603
|
+
icon: vue.markRaw(_sfc_main$5),
|
|
9604
|
+
display: () => canCenter.value,
|
|
9605
|
+
handler: () => {
|
|
9606
|
+
if (!nodes.value)
|
|
9607
|
+
return;
|
|
9608
|
+
editorService?.alignCenter(nodes.value);
|
|
9609
|
+
}
|
|
9610
|
+
},
|
|
9611
|
+
useCopyMenu(),
|
|
9612
|
+
usePasteMenu(menu),
|
|
9613
|
+
{
|
|
9614
|
+
type: "divider",
|
|
9615
|
+
direction: "horizontal",
|
|
9616
|
+
display: () => {
|
|
9617
|
+
if (!node.value)
|
|
9618
|
+
return false;
|
|
9619
|
+
return !utils.isPage(node.value) && !utils.isPageFragment(node.value);
|
|
9620
|
+
}
|
|
9621
|
+
},
|
|
9622
|
+
{
|
|
9623
|
+
type: "button",
|
|
9624
|
+
text: "上移一层",
|
|
9625
|
+
icon: vue.markRaw(iconsVue.Top),
|
|
9626
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9627
|
+
handler: () => {
|
|
9628
|
+
editorService?.moveLayer(1);
|
|
9629
|
+
}
|
|
9630
|
+
},
|
|
9631
|
+
{
|
|
9632
|
+
type: "button",
|
|
9633
|
+
text: "下移一层",
|
|
9634
|
+
icon: vue.markRaw(iconsVue.Bottom),
|
|
9635
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9636
|
+
handler: () => {
|
|
9637
|
+
editorService?.moveLayer(-1);
|
|
9638
|
+
}
|
|
9639
|
+
},
|
|
9640
|
+
{
|
|
9641
|
+
type: "button",
|
|
9642
|
+
text: "置顶",
|
|
9643
|
+
icon: vue.markRaw(iconsVue.Top),
|
|
9644
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9645
|
+
handler: () => {
|
|
9646
|
+
editorService?.moveLayer(LayerOffset.TOP);
|
|
9647
|
+
}
|
|
9648
|
+
},
|
|
9649
|
+
{
|
|
9650
|
+
type: "button",
|
|
9651
|
+
text: "置底",
|
|
9652
|
+
icon: vue.markRaw(iconsVue.Bottom),
|
|
9653
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9654
|
+
handler: () => {
|
|
9655
|
+
editorService?.moveLayer(LayerOffset.BOTTOM);
|
|
9656
|
+
}
|
|
9657
|
+
},
|
|
9658
|
+
useMoveToMenu(services),
|
|
9659
|
+
{
|
|
9660
|
+
type: "divider",
|
|
9661
|
+
direction: "horizontal",
|
|
9662
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect
|
|
9663
|
+
},
|
|
9664
|
+
useDeleteMenu(),
|
|
9665
|
+
{
|
|
9666
|
+
type: "divider",
|
|
9667
|
+
direction: "horizontal"
|
|
9668
|
+
},
|
|
9669
|
+
{
|
|
9670
|
+
type: "button",
|
|
9671
|
+
text: "清空参考线",
|
|
9672
|
+
handler: () => {
|
|
9673
|
+
editorService?.get("stage")?.clearGuides();
|
|
9674
|
+
}
|
|
9675
|
+
},
|
|
9676
|
+
...props.stageContentMenu
|
|
9677
|
+
],
|
|
9678
|
+
"viewer"
|
|
9679
|
+
)
|
|
9680
|
+
);
|
|
9149
9681
|
vue.watch(
|
|
9150
9682
|
parent,
|
|
9151
9683
|
async () => {
|
|
@@ -9165,7 +9697,7 @@
|
|
|
9165
9697
|
};
|
|
9166
9698
|
__expose({ show });
|
|
9167
9699
|
return (_ctx, _cache) => {
|
|
9168
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9700
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
9169
9701
|
"menu-data": menuData.value,
|
|
9170
9702
|
ref_key: "menu",
|
|
9171
9703
|
ref: menu
|
|
@@ -9174,13 +9706,14 @@
|
|
|
9174
9706
|
}
|
|
9175
9707
|
});
|
|
9176
9708
|
|
|
9177
|
-
const _sfc_main$
|
|
9709
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
9178
9710
|
...{
|
|
9179
9711
|
name: "MEditorStage"
|
|
9180
9712
|
},
|
|
9181
9713
|
__name: "Stage",
|
|
9182
9714
|
props: {
|
|
9183
|
-
stageContentMenu: {}
|
|
9715
|
+
stageContentMenu: {},
|
|
9716
|
+
customContentMenu: { type: Function }
|
|
9184
9717
|
},
|
|
9185
9718
|
setup(__props) {
|
|
9186
9719
|
let stage = null;
|
|
@@ -9229,6 +9762,7 @@
|
|
|
9229
9762
|
});
|
|
9230
9763
|
vue.watch(page, (page2) => {
|
|
9231
9764
|
if (runtime && page2) {
|
|
9765
|
+
services?.editorService.set("stageLoading", true);
|
|
9232
9766
|
runtime.updatePageId?.(page2.id);
|
|
9233
9767
|
vue.nextTick(() => {
|
|
9234
9768
|
stage?.select(page2.id);
|
|
@@ -9252,14 +9786,14 @@
|
|
|
9252
9786
|
vue.onMounted(() => {
|
|
9253
9787
|
if (stageWrap.value?.container) {
|
|
9254
9788
|
resizeObserver.observe(stageWrap.value.container);
|
|
9255
|
-
services?.keybindingService.
|
|
9789
|
+
services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrap.value.container);
|
|
9256
9790
|
}
|
|
9257
9791
|
});
|
|
9258
|
-
vue.
|
|
9792
|
+
vue.onBeforeUnmount(() => {
|
|
9259
9793
|
stage?.destroy();
|
|
9260
9794
|
resizeObserver.disconnect();
|
|
9261
9795
|
services?.editorService.set("stage", null);
|
|
9262
|
-
services?.keybindingService.
|
|
9796
|
+
services?.keybindingService.unregisterEl("stage");
|
|
9263
9797
|
services?.editorService.off("root-change", rootChangeHandler);
|
|
9264
9798
|
});
|
|
9265
9799
|
const parseDSL = getConfig("parseDSL");
|
|
@@ -9322,7 +9856,7 @@
|
|
|
9322
9856
|
}
|
|
9323
9857
|
};
|
|
9324
9858
|
return (_ctx, _cache) => {
|
|
9325
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9859
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$8, {
|
|
9326
9860
|
class: "m-editor-stage",
|
|
9327
9861
|
ref_key: "stageWrap",
|
|
9328
9862
|
ref: stageWrap,
|
|
@@ -9348,14 +9882,15 @@
|
|
|
9348
9882
|
onDrop: dropHandler,
|
|
9349
9883
|
onDragover: dragoverHandler
|
|
9350
9884
|
}, null, 36),
|
|
9351
|
-
vue.createVNode(_sfc_main$
|
|
9885
|
+
vue.createVNode(_sfc_main$6),
|
|
9352
9886
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
9353
|
-
vue.createVNode(_sfc_main$
|
|
9887
|
+
vue.createVNode(_sfc_main$4, {
|
|
9354
9888
|
ref_key: "menu",
|
|
9355
9889
|
ref: menu,
|
|
9356
9890
|
"is-multi-select": isMultiSelect.value,
|
|
9357
|
-
"stage-content-menu": _ctx.stageContentMenu
|
|
9358
|
-
|
|
9891
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
9892
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
9893
|
+
}, null, 8, ["is-multi-select", "stage-content-menu", "custom-content-menu"])
|
|
9359
9894
|
]))
|
|
9360
9895
|
]),
|
|
9361
9896
|
_: 1
|
|
@@ -9364,12 +9899,12 @@
|
|
|
9364
9899
|
}
|
|
9365
9900
|
});
|
|
9366
9901
|
|
|
9367
|
-
const _hoisted_1$
|
|
9902
|
+
const _hoisted_1$1 = {
|
|
9368
9903
|
key: 0,
|
|
9369
9904
|
class: "m-editor-breadcrumb"
|
|
9370
9905
|
};
|
|
9371
|
-
const _hoisted_2
|
|
9372
|
-
const _sfc_main$
|
|
9906
|
+
const _hoisted_2 = { key: 0 };
|
|
9907
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
9373
9908
|
...{
|
|
9374
9909
|
name: "MEditorBreadcrumb"
|
|
9375
9910
|
},
|
|
@@ -9386,7 +9921,7 @@
|
|
|
9386
9921
|
editorService?.get("stage")?.select(node2.id);
|
|
9387
9922
|
};
|
|
9388
9923
|
return (_ctx, _cache) => {
|
|
9389
|
-
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
9924
|
+
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
9390
9925
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(path.value, (item, index) => {
|
|
9391
9926
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
9392
9927
|
key: item.id
|
|
@@ -9401,7 +9936,7 @@
|
|
|
9401
9936
|
]),
|
|
9402
9937
|
_: 2
|
|
9403
9938
|
}, 1032, ["disabled", "onClick"]),
|
|
9404
|
-
index < path.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2
|
|
9939
|
+
index < path.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, "/")) : vue.createCommentVNode("", true)
|
|
9405
9940
|
], 64);
|
|
9406
9941
|
}), 128))
|
|
9407
9942
|
])) : vue.createCommentVNode("", true);
|
|
@@ -9409,223 +9944,6 @@
|
|
|
9409
9944
|
}
|
|
9410
9945
|
});
|
|
9411
9946
|
|
|
9412
|
-
const _hoisted_1$2 = {
|
|
9413
|
-
key: 1,
|
|
9414
|
-
style: { "width": "21px" }
|
|
9415
|
-
};
|
|
9416
|
-
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
9417
|
-
...{
|
|
9418
|
-
name: "MEditorPageBarScrollContainer"
|
|
9419
|
-
},
|
|
9420
|
-
__name: "PageBarScrollContainer",
|
|
9421
|
-
setup(__props) {
|
|
9422
|
-
const services = vue.inject("services");
|
|
9423
|
-
const editorService = services?.editorService;
|
|
9424
|
-
const uiService = services?.uiService;
|
|
9425
|
-
const itemsContainer = vue.ref();
|
|
9426
|
-
const canScroll = vue.ref(false);
|
|
9427
|
-
const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
|
|
9428
|
-
const itemsContainerWidth = vue.ref(0);
|
|
9429
|
-
const setCanScroll = () => {
|
|
9430
|
-
itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - (showAddPageButton.value ? 37 : 21);
|
|
9431
|
-
vue.nextTick(() => {
|
|
9432
|
-
if (itemsContainer.value) {
|
|
9433
|
-
canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
9434
|
-
}
|
|
9435
|
-
});
|
|
9436
|
-
};
|
|
9437
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
9438
|
-
setCanScroll();
|
|
9439
|
-
});
|
|
9440
|
-
const pageBar = vue.ref();
|
|
9441
|
-
vue.onMounted(() => {
|
|
9442
|
-
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
9443
|
-
});
|
|
9444
|
-
vue.onUnmounted(() => {
|
|
9445
|
-
resizeObserver.disconnect();
|
|
9446
|
-
});
|
|
9447
|
-
let translateLeft = 0;
|
|
9448
|
-
const scroll = (type) => {
|
|
9449
|
-
if (!itemsContainer.value)
|
|
9450
|
-
return;
|
|
9451
|
-
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
9452
|
-
if (type === "left") {
|
|
9453
|
-
translateLeft += 100;
|
|
9454
|
-
if (translateLeft > 0) {
|
|
9455
|
-
translateLeft = 0;
|
|
9456
|
-
}
|
|
9457
|
-
} else if (type === "right") {
|
|
9458
|
-
translateLeft -= 100;
|
|
9459
|
-
if (-translateLeft > maxScrollLeft) {
|
|
9460
|
-
translateLeft = -maxScrollLeft;
|
|
9461
|
-
}
|
|
9462
|
-
} else if (type === "start") {
|
|
9463
|
-
translateLeft = 0;
|
|
9464
|
-
} else if (type === "end") {
|
|
9465
|
-
translateLeft = -maxScrollLeft;
|
|
9466
|
-
}
|
|
9467
|
-
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
9468
|
-
};
|
|
9469
|
-
const pageLength = vue.computed(() => editorService?.get("pageLength"));
|
|
9470
|
-
vue.watch(pageLength, (length = 0, preLength = 0) => {
|
|
9471
|
-
setTimeout(() => {
|
|
9472
|
-
setCanScroll();
|
|
9473
|
-
if (length < preLength) {
|
|
9474
|
-
scroll("start");
|
|
9475
|
-
} else {
|
|
9476
|
-
scroll("end");
|
|
9477
|
-
}
|
|
9478
|
-
});
|
|
9479
|
-
});
|
|
9480
|
-
const addPage = () => {
|
|
9481
|
-
if (!editorService)
|
|
9482
|
-
return;
|
|
9483
|
-
const root = vue.toRaw(editorService.get("root"));
|
|
9484
|
-
if (!root)
|
|
9485
|
-
throw new Error("root 不能为空");
|
|
9486
|
-
const pageConfig = {
|
|
9487
|
-
type: schema.NodeType.PAGE,
|
|
9488
|
-
name: generatePageNameByApp(root)
|
|
9489
|
-
};
|
|
9490
|
-
editorService.add(pageConfig);
|
|
9491
|
-
};
|
|
9492
|
-
return (_ctx, _cache) => {
|
|
9493
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
9494
|
-
class: "m-editor-page-bar",
|
|
9495
|
-
ref_key: "pageBar",
|
|
9496
|
-
ref: pageBar
|
|
9497
|
-
}, [
|
|
9498
|
-
showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9499
|
-
key: 0,
|
|
9500
|
-
id: "m-editor-page-bar-add-icon",
|
|
9501
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9502
|
-
onClick: addPage
|
|
9503
|
-
}, [
|
|
9504
|
-
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
9505
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2)),
|
|
9506
|
-
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9507
|
-
key: 2,
|
|
9508
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9509
|
-
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
9510
|
-
}, [
|
|
9511
|
-
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
9512
|
-
])) : vue.createCommentVNode("", true),
|
|
9513
|
-
pageLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9514
|
-
key: 3,
|
|
9515
|
-
class: "m-editor-page-bar-items",
|
|
9516
|
-
ref_key: "itemsContainer",
|
|
9517
|
-
ref: itemsContainer,
|
|
9518
|
-
style: vue.normalizeStyle(`width: ${itemsContainerWidth.value}px`)
|
|
9519
|
-
}, [
|
|
9520
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
9521
|
-
], 4)) : vue.createCommentVNode("", true),
|
|
9522
|
-
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9523
|
-
key: 4,
|
|
9524
|
-
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
9525
|
-
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
9526
|
-
}, [
|
|
9527
|
-
vue.createVNode(_sfc_main$K, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
9528
|
-
])) : vue.createCommentVNode("", true)
|
|
9529
|
-
], 512);
|
|
9530
|
-
};
|
|
9531
|
-
}
|
|
9532
|
-
});
|
|
9533
|
-
|
|
9534
|
-
const _hoisted_1$1 = ["onClick"];
|
|
9535
|
-
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
9536
|
-
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
9537
|
-
...{
|
|
9538
|
-
name: "MEditorPageBar"
|
|
9539
|
-
},
|
|
9540
|
-
__name: "PageBar",
|
|
9541
|
-
setup(__props) {
|
|
9542
|
-
const services = vue.inject("services");
|
|
9543
|
-
const editorService = services?.editorService;
|
|
9544
|
-
const root = vue.computed(() => editorService?.get("root"));
|
|
9545
|
-
const page = vue.computed(() => editorService?.get("page"));
|
|
9546
|
-
const switchPage = (page2) => {
|
|
9547
|
-
editorService?.select(page2);
|
|
9548
|
-
};
|
|
9549
|
-
const copy = (node) => {
|
|
9550
|
-
node && editorService?.copy(node);
|
|
9551
|
-
editorService?.paste({
|
|
9552
|
-
left: 0,
|
|
9553
|
-
top: 0
|
|
9554
|
-
});
|
|
9555
|
-
};
|
|
9556
|
-
const remove = (node) => {
|
|
9557
|
-
editorService?.remove(node);
|
|
9558
|
-
};
|
|
9559
|
-
return (_ctx, _cache) => {
|
|
9560
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$3, null, {
|
|
9561
|
-
default: vue.withCtx(() => [
|
|
9562
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(root.value && root.value.items || [], (item) => {
|
|
9563
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
9564
|
-
class: vue.normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
9565
|
-
key: item.key,
|
|
9566
|
-
onClick: ($event) => switchPage(item)
|
|
9567
|
-
}, [
|
|
9568
|
-
vue.createElementVNode("div", _hoisted_2, [
|
|
9569
|
-
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
9570
|
-
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
9571
|
-
effect: "dark",
|
|
9572
|
-
placement: "top-start",
|
|
9573
|
-
content: item.name
|
|
9574
|
-
}, {
|
|
9575
|
-
default: vue.withCtx(() => [
|
|
9576
|
-
vue.createElementVNode("span", null, vue.toDisplayString(item.name || item.id), 1)
|
|
9577
|
-
]),
|
|
9578
|
-
_: 2
|
|
9579
|
-
}, 1032, ["content"])
|
|
9580
|
-
])
|
|
9581
|
-
]),
|
|
9582
|
-
vue.createVNode(vue.unref(design.TMagicPopover), {
|
|
9583
|
-
"popper-class": "page-bar-popover",
|
|
9584
|
-
placement: "top",
|
|
9585
|
-
width: 160,
|
|
9586
|
-
trigger: "hover"
|
|
9587
|
-
}, {
|
|
9588
|
-
reference: vue.withCtx(() => [
|
|
9589
|
-
vue.createVNode(vue.unref(design.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
9590
|
-
default: vue.withCtx(() => [
|
|
9591
|
-
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
9592
|
-
]),
|
|
9593
|
-
_: 1
|
|
9594
|
-
})
|
|
9595
|
-
]),
|
|
9596
|
-
default: vue.withCtx(() => [
|
|
9597
|
-
vue.createElementVNode("div", null, [
|
|
9598
|
-
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
9599
|
-
vue.createVNode(_sfc_main$t, {
|
|
9600
|
-
data: {
|
|
9601
|
-
type: "button",
|
|
9602
|
-
text: "复制",
|
|
9603
|
-
icon: vue.unref(iconsVue.DocumentCopy),
|
|
9604
|
-
handler: () => copy(item)
|
|
9605
|
-
}
|
|
9606
|
-
}, null, 8, ["data"]),
|
|
9607
|
-
vue.createVNode(_sfc_main$t, {
|
|
9608
|
-
data: {
|
|
9609
|
-
type: "button",
|
|
9610
|
-
text: "删除",
|
|
9611
|
-
icon: vue.unref(iconsVue.Delete),
|
|
9612
|
-
handler: () => remove(item)
|
|
9613
|
-
}
|
|
9614
|
-
}, null, 8, ["data"])
|
|
9615
|
-
])
|
|
9616
|
-
])
|
|
9617
|
-
]),
|
|
9618
|
-
_: 2
|
|
9619
|
-
}, 1024)
|
|
9620
|
-
], 10, _hoisted_1$1);
|
|
9621
|
-
}), 128))
|
|
9622
|
-
]),
|
|
9623
|
-
_: 3
|
|
9624
|
-
});
|
|
9625
|
-
};
|
|
9626
|
-
}
|
|
9627
|
-
});
|
|
9628
|
-
|
|
9629
9947
|
const _hoisted_1 = { class: "m-editor-workspace" };
|
|
9630
9948
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
9631
9949
|
...{
|
|
@@ -9633,30 +9951,23 @@
|
|
|
9633
9951
|
},
|
|
9634
9952
|
__name: "Workspace",
|
|
9635
9953
|
props: {
|
|
9636
|
-
stageContentMenu: {}
|
|
9954
|
+
stageContentMenu: {},
|
|
9955
|
+
customContentMenu: { type: Function }
|
|
9637
9956
|
},
|
|
9638
9957
|
setup(__props) {
|
|
9639
9958
|
const services = vue.inject("services");
|
|
9640
9959
|
const page = vue.computed(() => services?.editorService.get("page"));
|
|
9641
9960
|
return (_ctx, _cache) => {
|
|
9642
9961
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
9643
|
-
vue.createVNode(_sfc_main$
|
|
9962
|
+
vue.createVNode(_sfc_main$2),
|
|
9644
9963
|
vue.renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
9645
|
-
page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9964
|
+
page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$3, {
|
|
9646
9965
|
key: 0,
|
|
9647
|
-
"stage-content-menu": _ctx.stageContentMenu
|
|
9648
|
-
|
|
9966
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
9967
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
9968
|
+
}, null, 8, ["stage-content-menu", "custom-content-menu"])) : vue.createCommentVNode("", true)
|
|
9649
9969
|
]),
|
|
9650
|
-
vue.renderSlot(_ctx.$slots, "workspace-content")
|
|
9651
|
-
vue.createVNode(_sfc_main$2, null, {
|
|
9652
|
-
"page-bar-title": vue.withCtx(({ page: page2 }) => [
|
|
9653
|
-
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: page2 })
|
|
9654
|
-
]),
|
|
9655
|
-
"page-bar-popover": vue.withCtx(({ page: page2 }) => [
|
|
9656
|
-
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: page2 })
|
|
9657
|
-
]),
|
|
9658
|
-
_: 3
|
|
9659
|
-
})
|
|
9970
|
+
vue.renderSlot(_ctx.$slots, "workspace-content")
|
|
9660
9971
|
]);
|
|
9661
9972
|
};
|
|
9662
9973
|
}
|
|
@@ -9940,7 +10251,7 @@
|
|
|
9940
10251
|
commands = {
|
|
9941
10252
|
[KeyBindingCommand.DELETE_NODE]: () => {
|
|
9942
10253
|
const nodes = editorService.get("nodes");
|
|
9943
|
-
if (!nodes || utils.isPage(nodes[0]))
|
|
10254
|
+
if (!nodes || utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))
|
|
9944
10255
|
return;
|
|
9945
10256
|
editorService.remove(nodes);
|
|
9946
10257
|
},
|
|
@@ -9950,7 +10261,7 @@
|
|
|
9950
10261
|
},
|
|
9951
10262
|
[KeyBindingCommand.CUT_NODE]: () => {
|
|
9952
10263
|
const nodes = editorService.get("nodes");
|
|
9953
|
-
if (!nodes || utils.isPage(nodes[0]))
|
|
10264
|
+
if (!nodes || utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))
|
|
9954
10265
|
return;
|
|
9955
10266
|
editorService.copy(nodes);
|
|
9956
10267
|
editorService.remove(nodes);
|
|
@@ -10005,13 +10316,25 @@
|
|
|
10005
10316
|
editorService.selectNextNode();
|
|
10006
10317
|
}
|
|
10007
10318
|
};
|
|
10008
|
-
|
|
10319
|
+
registerCommand(command, handler) {
|
|
10009
10320
|
this.commands[command] = handler;
|
|
10010
10321
|
}
|
|
10011
|
-
|
|
10322
|
+
/**
|
|
10323
|
+
* @deprecated
|
|
10324
|
+
*/
|
|
10325
|
+
registeCommand(command, handler) {
|
|
10326
|
+
this.registerCommand(command, handler);
|
|
10327
|
+
}
|
|
10328
|
+
unregisterCommand(command) {
|
|
10012
10329
|
delete this.commands[command];
|
|
10013
10330
|
}
|
|
10014
|
-
|
|
10331
|
+
/**
|
|
10332
|
+
* @deprecated
|
|
10333
|
+
*/
|
|
10334
|
+
unregisteCommand(command) {
|
|
10335
|
+
this.unregisterCommand(command);
|
|
10336
|
+
}
|
|
10337
|
+
registerEl(name, el) {
|
|
10015
10338
|
if (name !== "global" && !el) {
|
|
10016
10339
|
throw new Error("只有name为global可以不传el");
|
|
10017
10340
|
}
|
|
@@ -10019,23 +10342,41 @@
|
|
|
10019
10342
|
this.controllers.set(name, keycon);
|
|
10020
10343
|
this.bind(name);
|
|
10021
10344
|
}
|
|
10022
|
-
|
|
10345
|
+
/**
|
|
10346
|
+
* @deprecated
|
|
10347
|
+
*/
|
|
10348
|
+
registeEl(name, el) {
|
|
10349
|
+
this.registerEl(name, el);
|
|
10350
|
+
}
|
|
10351
|
+
unregisterEl(name) {
|
|
10023
10352
|
this.controllers.get(name)?.destroy();
|
|
10024
10353
|
this.controllers.delete(name);
|
|
10025
10354
|
this.bindingList.forEach((item) => {
|
|
10026
|
-
item.
|
|
10355
|
+
item.bound = false;
|
|
10027
10356
|
});
|
|
10028
10357
|
}
|
|
10029
|
-
|
|
10358
|
+
/**
|
|
10359
|
+
* @deprecated
|
|
10360
|
+
*/
|
|
10361
|
+
unregisteEl(name) {
|
|
10362
|
+
this.unregisterEl(name);
|
|
10363
|
+
}
|
|
10364
|
+
register(maps) {
|
|
10030
10365
|
for (const keybindingItem of maps) {
|
|
10031
10366
|
const { command, keybinding, when } = keybindingItem;
|
|
10032
10367
|
for (const [type = "", eventType = "keydown"] of when) {
|
|
10033
|
-
const cacheItem = { type, command, keybinding, eventType,
|
|
10368
|
+
const cacheItem = { type, command, keybinding, eventType, bound: false };
|
|
10034
10369
|
this.bindingList.push(cacheItem);
|
|
10035
10370
|
}
|
|
10036
10371
|
}
|
|
10037
10372
|
this.bind();
|
|
10038
10373
|
}
|
|
10374
|
+
/**
|
|
10375
|
+
* @deprecated
|
|
10376
|
+
*/
|
|
10377
|
+
registe(map) {
|
|
10378
|
+
this.register(map);
|
|
10379
|
+
}
|
|
10039
10380
|
reset() {
|
|
10040
10381
|
this.controllers.forEach((keycon) => {
|
|
10041
10382
|
keycon.destroy();
|
|
@@ -10048,11 +10389,11 @@
|
|
|
10048
10389
|
}
|
|
10049
10390
|
bind(name) {
|
|
10050
10391
|
for (const item of this.bindingList) {
|
|
10051
|
-
const { type, eventType, command, keybinding,
|
|
10392
|
+
const { type, eventType, command, keybinding, bound } = item;
|
|
10052
10393
|
if (name && name !== type) {
|
|
10053
10394
|
continue;
|
|
10054
10395
|
}
|
|
10055
|
-
if (
|
|
10396
|
+
if (bound) {
|
|
10056
10397
|
continue;
|
|
10057
10398
|
}
|
|
10058
10399
|
const keycon = this.controllers.get(type);
|
|
@@ -10070,7 +10411,7 @@
|
|
|
10070
10411
|
keycon[eventType](handler);
|
|
10071
10412
|
}
|
|
10072
10413
|
});
|
|
10073
|
-
item.
|
|
10414
|
+
item.bound = true;
|
|
10074
10415
|
}
|
|
10075
10416
|
}
|
|
10076
10417
|
getKeyconKeys(keybinding = "") {
|
|
@@ -10100,7 +10441,9 @@
|
|
|
10100
10441
|
containerHighlightDuration: 800,
|
|
10101
10442
|
containerHighlightType: StageCore.ContainerHighlightType.DEFAULT,
|
|
10102
10443
|
codeOptions: () => ({}),
|
|
10103
|
-
renderType: StageCore.RenderType.IFRAME
|
|
10444
|
+
renderType: StageCore.RenderType.IFRAME,
|
|
10445
|
+
disabledMultiSelect: false,
|
|
10446
|
+
disabledPageFragment: false
|
|
10104
10447
|
};
|
|
10105
10448
|
|
|
10106
10449
|
const initServiceState = (props, {
|
|
@@ -10123,6 +10466,15 @@
|
|
|
10123
10466
|
immediate: true
|
|
10124
10467
|
}
|
|
10125
10468
|
);
|
|
10469
|
+
vue.watch(
|
|
10470
|
+
() => props.disabledMultiSelect,
|
|
10471
|
+
(disabledMultiSelect) => {
|
|
10472
|
+
editorService.set("disabledMultiSelect", disabledMultiSelect || false);
|
|
10473
|
+
},
|
|
10474
|
+
{
|
|
10475
|
+
immediate: true
|
|
10476
|
+
}
|
|
10477
|
+
);
|
|
10126
10478
|
vue.watch(
|
|
10127
10479
|
() => props.componentGroupList,
|
|
10128
10480
|
(componentGroupList) => componentGroupList && componentListService.setList(componentGroupList),
|
|
@@ -10223,7 +10575,7 @@
|
|
|
10223
10575
|
immediate: true
|
|
10224
10576
|
}
|
|
10225
10577
|
);
|
|
10226
|
-
vue.
|
|
10578
|
+
vue.onBeforeUnmount(() => {
|
|
10227
10579
|
editorService.resetState();
|
|
10228
10580
|
historyService.resetState();
|
|
10229
10581
|
propsService.resetState();
|
|
@@ -10407,7 +10759,7 @@
|
|
|
10407
10759
|
if (props.collectorOptions && !depService.hasTarget(dep.DepTargetType.RELATED_COMP_WHEN_COPY)) {
|
|
10408
10760
|
depService.addTarget(dep.createRelatedCompTarget(props.collectorOptions));
|
|
10409
10761
|
}
|
|
10410
|
-
vue.
|
|
10762
|
+
vue.onBeforeUnmount(() => {
|
|
10411
10763
|
depService.off("add-target", targetAddHandler);
|
|
10412
10764
|
depService.off("remove-target", targetRemoveHandler);
|
|
10413
10765
|
depService.off("dep-update", depUpdateHandler);
|
|
@@ -10460,7 +10812,11 @@
|
|
|
10460
10812
|
updateDragEl: { type: Function },
|
|
10461
10813
|
disabledDragStart: { type: Boolean },
|
|
10462
10814
|
extendFormState: { type: Function },
|
|
10463
|
-
collectorOptions: {}
|
|
10815
|
+
collectorOptions: {},
|
|
10816
|
+
guidesOptions: {},
|
|
10817
|
+
disabledMultiSelect: { type: Boolean },
|
|
10818
|
+
disabledPageFragment: { type: Boolean },
|
|
10819
|
+
customContentMenu: { type: Function }
|
|
10464
10820
|
}, defaultEditorProps),
|
|
10465
10821
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
10466
10822
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -10481,8 +10837,8 @@
|
|
|
10481
10837
|
};
|
|
10482
10838
|
initServiceEvents(props, emit, services);
|
|
10483
10839
|
initServiceState(props, services);
|
|
10484
|
-
keybindingService.
|
|
10485
|
-
keybindingService.
|
|
10840
|
+
keybindingService.register(keybindingConfig);
|
|
10841
|
+
keybindingService.registerEl("global");
|
|
10486
10842
|
vue.provide("services", services);
|
|
10487
10843
|
vue.provide("codeOptions", props.codeOptions);
|
|
10488
10844
|
vue.provide(
|
|
@@ -10499,18 +10855,20 @@
|
|
|
10499
10855
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
10500
10856
|
containerHighlightType: props.containerHighlightType,
|
|
10501
10857
|
disabledDragStart: props.disabledDragStart,
|
|
10502
|
-
renderType: props.renderType
|
|
10858
|
+
renderType: props.renderType,
|
|
10859
|
+
guidesOptions: props.guidesOptions,
|
|
10860
|
+
disabledMultiSelect: props.disabledMultiSelect
|
|
10503
10861
|
})
|
|
10504
10862
|
);
|
|
10505
10863
|
__expose(services);
|
|
10506
10864
|
return (_ctx, _cache) => {
|
|
10507
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
10865
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$r, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
10508
10866
|
header: vue.withCtx(() => [
|
|
10509
10867
|
vue.renderSlot(_ctx.$slots, "header")
|
|
10510
10868
|
]),
|
|
10511
10869
|
nav: vue.withCtx(() => [
|
|
10512
10870
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: vue.unref(editorService) }, () => [
|
|
10513
|
-
vue.createVNode(_sfc_main$
|
|
10871
|
+
vue.createVNode(_sfc_main$q, { data: _ctx.menu }, null, 8, ["data"])
|
|
10514
10872
|
])
|
|
10515
10873
|
]),
|
|
10516
10874
|
"content-before": vue.withCtx(() => [
|
|
@@ -10521,9 +10879,10 @@
|
|
|
10521
10879
|
]),
|
|
10522
10880
|
sidebar: vue.withCtx(() => [
|
|
10523
10881
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: vue.unref(editorService) }, () => [
|
|
10524
|
-
vue.createVNode(_sfc_main$
|
|
10882
|
+
vue.createVNode(_sfc_main$a, {
|
|
10525
10883
|
data: _ctx.sidebar,
|
|
10526
|
-
"layer-content-menu": _ctx.layerContentMenu
|
|
10884
|
+
"layer-content-menu": _ctx.layerContentMenu,
|
|
10885
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
10527
10886
|
}, {
|
|
10528
10887
|
"layer-panel-header": vue.withCtx(() => [
|
|
10529
10888
|
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
@@ -10556,31 +10915,28 @@
|
|
|
10556
10915
|
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
10557
10916
|
]),
|
|
10558
10917
|
_: 3
|
|
10559
|
-
}, 8, ["data", "layer-content-menu"])
|
|
10918
|
+
}, 8, ["data", "layer-content-menu", "custom-content-menu"])
|
|
10560
10919
|
])
|
|
10561
10920
|
]),
|
|
10562
10921
|
workspace: vue.withCtx(() => [
|
|
10563
10922
|
vue.renderSlot(_ctx.$slots, "workspace", { editorService: vue.unref(editorService) }, () => [
|
|
10564
|
-
vue.createVNode(_sfc_main$1, {
|
|
10923
|
+
vue.createVNode(_sfc_main$1, {
|
|
10924
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
10925
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
10926
|
+
}, {
|
|
10565
10927
|
stage: vue.withCtx(() => [
|
|
10566
10928
|
vue.renderSlot(_ctx.$slots, "stage")
|
|
10567
10929
|
]),
|
|
10568
10930
|
"workspace-content": vue.withCtx(() => [
|
|
10569
10931
|
vue.renderSlot(_ctx.$slots, "workspace-content", { editorService: vue.unref(editorService) })
|
|
10570
10932
|
]),
|
|
10571
|
-
"page-bar-title": vue.withCtx(({ page }) => [
|
|
10572
|
-
vue.renderSlot(_ctx.$slots, "page-bar-title", { page })
|
|
10573
|
-
]),
|
|
10574
|
-
"page-bar-popover": vue.withCtx(({ page }) => [
|
|
10575
|
-
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page })
|
|
10576
|
-
]),
|
|
10577
10933
|
_: 3
|
|
10578
|
-
}, 8, ["stage-content-menu"])
|
|
10934
|
+
}, 8, ["stage-content-menu", "custom-content-menu"])
|
|
10579
10935
|
])
|
|
10580
10936
|
]),
|
|
10581
10937
|
"props-panel": vue.withCtx(() => [
|
|
10582
10938
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
10583
|
-
vue.createVNode(_sfc_main$
|
|
10939
|
+
vue.createVNode(_sfc_main$p, {
|
|
10584
10940
|
"extend-state": _ctx.extendFormState,
|
|
10585
10941
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
10586
10942
|
}, {
|
|
@@ -10600,8 +10956,14 @@
|
|
|
10600
10956
|
footer: vue.withCtx(() => [
|
|
10601
10957
|
vue.renderSlot(_ctx.$slots, "footer")
|
|
10602
10958
|
]),
|
|
10959
|
+
"page-bar-title": vue.withCtx(({ page }) => [
|
|
10960
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page })
|
|
10961
|
+
]),
|
|
10962
|
+
"page-bar-popover": vue.withCtx(({ page }) => [
|
|
10963
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page })
|
|
10964
|
+
]),
|
|
10603
10965
|
_: 3
|
|
10604
|
-
});
|
|
10966
|
+
}, 8, ["disabled-page-fragment"]);
|
|
10605
10967
|
};
|
|
10606
10968
|
}
|
|
10607
10969
|
});
|
|
@@ -10616,21 +10978,22 @@
|
|
|
10616
10978
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
10617
10979
|
setConfig(option);
|
|
10618
10980
|
app.component(_sfc_main.name, _sfc_main);
|
|
10619
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
10620
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
10621
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
10622
|
-
app.component("magic-code-editor", _sfc_main$
|
|
10623
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
10624
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
10625
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
10626
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
10627
|
-
app.component("m-fields-data-source-mocks", _sfc_main$
|
|
10628
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
10629
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
10630
|
-
app.component("m-fields-data-source-select", _sfc_main$
|
|
10631
|
-
app.component("m-fields-data-source-methods", _sfc_main$
|
|
10632
|
-
app.component("m-fields-data-source-method-select", _sfc_main$
|
|
10633
|
-
app.component("m-fields-data-source-field-select", _sfc_main$
|
|
10981
|
+
app.component("m-fields-ui-select", _sfc_main$A);
|
|
10982
|
+
app.component("m-fields-code-link", _sfc_main$R);
|
|
10983
|
+
app.component("m-fields-vs-code", _sfc_main$S);
|
|
10984
|
+
app.component("magic-code-editor", _sfc_main$T);
|
|
10985
|
+
app.component("m-fields-code-select", _sfc_main$Q);
|
|
10986
|
+
app.component("m-fields-code-select-col", _sfc_main$M);
|
|
10987
|
+
app.component("m-fields-event-select", _sfc_main$E);
|
|
10988
|
+
app.component("m-fields-data-source-fields", _sfc_main$L);
|
|
10989
|
+
app.component("m-fields-data-source-mocks", _sfc_main$G);
|
|
10990
|
+
app.component("m-fields-key-value", _sfc_main$C);
|
|
10991
|
+
app.component("m-fields-data-source-input", _sfc_main$J);
|
|
10992
|
+
app.component("m-fields-data-source-select", _sfc_main$F);
|
|
10993
|
+
app.component("m-fields-data-source-methods", _sfc_main$I);
|
|
10994
|
+
app.component("m-fields-data-source-method-select", _sfc_main$H);
|
|
10995
|
+
app.component("m-fields-data-source-field-select", _sfc_main$K);
|
|
10996
|
+
app.component("m-fields-page-fragment-select", _sfc_main$B);
|
|
10634
10997
|
}
|
|
10635
10998
|
};
|
|
10636
10999
|
|
|
@@ -10640,40 +11003,41 @@
|
|
|
10640
11003
|
});
|
|
10641
11004
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
10642
11005
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
10643
|
-
exports.CodeBlockEditor = _sfc_main$
|
|
10644
|
-
exports.CodeBlockList = _sfc_main$
|
|
10645
|
-
exports.CodeBlockListPanel = _sfc_main$
|
|
11006
|
+
exports.CodeBlockEditor = _sfc_main$P;
|
|
11007
|
+
exports.CodeBlockList = _sfc_main$l;
|
|
11008
|
+
exports.CodeBlockListPanel = _sfc_main$k;
|
|
10646
11009
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
10647
|
-
exports.CodeSelect = _sfc_main$
|
|
10648
|
-
exports.CodeSelectCol = _sfc_main$
|
|
11010
|
+
exports.CodeSelect = _sfc_main$Q;
|
|
11011
|
+
exports.CodeSelectCol = _sfc_main$M;
|
|
10649
11012
|
exports.ColumnLayout = ColumnLayout;
|
|
10650
|
-
exports.ComponentListPanel = _sfc_main$
|
|
10651
|
-
exports.ContentMenu = _sfc_main$
|
|
10652
|
-
exports.DataSourceFieldSelect = _sfc_main$
|
|
10653
|
-
exports.DataSourceFields = _sfc_main$
|
|
10654
|
-
exports.DataSourceInput = _sfc_main$
|
|
10655
|
-
exports.DataSourceMethodSelect = _sfc_main$
|
|
10656
|
-
exports.DataSourceMethods = _sfc_main$
|
|
10657
|
-
exports.DataSourceMocks = _sfc_main$
|
|
10658
|
-
exports.DataSourceSelect = _sfc_main$
|
|
11013
|
+
exports.ComponentListPanel = _sfc_main$b;
|
|
11014
|
+
exports.ContentMenu = _sfc_main$g;
|
|
11015
|
+
exports.DataSourceFieldSelect = _sfc_main$K;
|
|
11016
|
+
exports.DataSourceFields = _sfc_main$L;
|
|
11017
|
+
exports.DataSourceInput = _sfc_main$J;
|
|
11018
|
+
exports.DataSourceMethodSelect = _sfc_main$H;
|
|
11019
|
+
exports.DataSourceMethods = _sfc_main$I;
|
|
11020
|
+
exports.DataSourceMocks = _sfc_main$G;
|
|
11021
|
+
exports.DataSourceSelect = _sfc_main$F;
|
|
10659
11022
|
exports.DragType = DragType;
|
|
10660
|
-
exports.EventSelect = _sfc_main$
|
|
11023
|
+
exports.EventSelect = _sfc_main$E;
|
|
10661
11024
|
exports.Fixed2Other = Fixed2Other;
|
|
10662
11025
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
10663
|
-
exports.Icon = _sfc_main$
|
|
11026
|
+
exports.Icon = _sfc_main$N;
|
|
10664
11027
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
10665
|
-
exports.KeyValue = _sfc_main$
|
|
11028
|
+
exports.KeyValue = _sfc_main$C;
|
|
10666
11029
|
exports.Keys = Keys;
|
|
10667
11030
|
exports.LayerOffset = LayerOffset;
|
|
10668
|
-
exports.LayerPanel = _sfc_main$
|
|
11031
|
+
exports.LayerPanel = _sfc_main$c;
|
|
10669
11032
|
exports.Layout = Layout;
|
|
10670
|
-
exports.LayoutContainer = _sfc_main$
|
|
10671
|
-
exports.
|
|
10672
|
-
exports.
|
|
10673
|
-
exports.
|
|
10674
|
-
exports.
|
|
11033
|
+
exports.LayoutContainer = _sfc_main$y;
|
|
11034
|
+
exports.PageFragmentSelect = _sfc_main$B;
|
|
11035
|
+
exports.PropsPanel = _sfc_main$p;
|
|
11036
|
+
exports.Resizer = _sfc_main$z;
|
|
11037
|
+
exports.SplitView = _sfc_main$y;
|
|
11038
|
+
exports.TMagicCodeEditor = _sfc_main$T;
|
|
10675
11039
|
exports.TMagicEditor = _sfc_main;
|
|
10676
|
-
exports.ToolButton = _sfc_main$
|
|
11040
|
+
exports.ToolButton = _sfc_main$x;
|
|
10677
11041
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
10678
11042
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
10679
11043
|
exports.advancedTabConfig = advancedTabConfig;
|
|
@@ -10703,6 +11067,7 @@
|
|
|
10703
11067
|
exports.getGuideLineFromCache = getGuideLineFromCache;
|
|
10704
11068
|
exports.getInitPositionStyle = getInitPositionStyle;
|
|
10705
11069
|
exports.getNodeIndex = getNodeIndex;
|
|
11070
|
+
exports.getPageFragmentList = getPageFragmentList;
|
|
10706
11071
|
exports.getPageList = getPageList;
|
|
10707
11072
|
exports.getPageNameList = getPageNameList;
|
|
10708
11073
|
exports.getPositionInContainer = getPositionInContainer;
|
|
@@ -10713,7 +11078,7 @@
|
|
|
10713
11078
|
exports.log = log;
|
|
10714
11079
|
exports.propsService = propsService;
|
|
10715
11080
|
exports.serializeConfig = serializeConfig;
|
|
10716
|
-
exports.
|
|
11081
|
+
exports.setChildrenLayout = setChildrenLayout;
|
|
10717
11082
|
exports.setConfig = setConfig;
|
|
10718
11083
|
exports.setLayout = setLayout;
|
|
10719
11084
|
exports.storageService = storageService;
|