@tmagic/editor 1.3.6 → 1.3.8
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 +34 -11
- package/dist/tmagic-editor.js +1360 -957
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1382 -977
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -17
- package/src/Editor.vue +15 -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/Tree.vue +1 -1
- package/src/components/TreeNode.vue +3 -3
- package/src/editorProps.ts +14 -4
- package/src/fields/PageFragmentSelect.vue +63 -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 +19 -3
- package/src/layouts/PropsPanel.vue +9 -7
- 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/dataSource.ts +17 -0
- package/src/services/dep.ts +4 -0
- package/src/services/editor.ts +66 -35
- 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/theme/page-fragment-select.scss +14 -0
- package/src/theme/theme.scss +1 -0
- package/src/theme/tree.scss +6 -0
- package/src/type.ts +23 -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 +19 -10
- 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 +2 -0
- package/types/services/dep.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 +26 -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,
|
|
@@ -1139,6 +1139,22 @@
|
|
|
1139
1139
|
events: {},
|
|
1140
1140
|
methods: {}
|
|
1141
1141
|
});
|
|
1142
|
+
constructor() {
|
|
1143
|
+
super([
|
|
1144
|
+
{ name: "getFormConfig", isAsync: false },
|
|
1145
|
+
{ name: "setFormConfig", isAsync: false },
|
|
1146
|
+
{ name: "getFormValue", isAsync: false },
|
|
1147
|
+
{ name: "setFormValue", isAsync: false },
|
|
1148
|
+
{ name: "getFormEvent", isAsync: false },
|
|
1149
|
+
{ name: "setFormEvent", isAsync: false },
|
|
1150
|
+
{ name: "getFormMethod", isAsync: false },
|
|
1151
|
+
{ name: "setFormMethod", isAsync: false },
|
|
1152
|
+
{ name: "add", isAsync: false },
|
|
1153
|
+
{ name: "update", isAsync: false },
|
|
1154
|
+
{ name: "remove", isAsync: false },
|
|
1155
|
+
{ name: "createId", isAsync: false }
|
|
1156
|
+
]);
|
|
1157
|
+
}
|
|
1142
1158
|
set(name, value) {
|
|
1143
1159
|
this.state[name] = value;
|
|
1144
1160
|
}
|
|
@@ -1614,25 +1630,33 @@
|
|
|
1614
1630
|
const UI_SELECT_MODE_EVENT_NAME = "ui-select";
|
|
1615
1631
|
|
|
1616
1632
|
const COPY_STORAGE_KEY = "$MagicEditorCopyData";
|
|
1617
|
-
const getPageList = (
|
|
1618
|
-
if (
|
|
1619
|
-
return
|
|
1620
|
-
|
|
1621
|
-
|
|
1633
|
+
const getPageList = (root) => {
|
|
1634
|
+
if (!root)
|
|
1635
|
+
return [];
|
|
1636
|
+
if (!Array.isArray(root.items))
|
|
1637
|
+
return [];
|
|
1638
|
+
return root.items.filter((item) => utils.isPage(item));
|
|
1639
|
+
};
|
|
1640
|
+
const getPageFragmentList = (root) => {
|
|
1641
|
+
if (!root)
|
|
1642
|
+
return [];
|
|
1643
|
+
if (!Array.isArray(root.items))
|
|
1644
|
+
return [];
|
|
1645
|
+
return root.items.filter((item) => utils.isPageFragment(item));
|
|
1622
1646
|
};
|
|
1623
1647
|
const getPageNameList = (pages) => pages.map((page) => page.name || "index");
|
|
1624
|
-
const generatePageName = (pageNameList) => {
|
|
1648
|
+
const generatePageName = (pageNameList, type) => {
|
|
1625
1649
|
let pageLength = pageNameList.length;
|
|
1626
1650
|
if (!pageLength)
|
|
1627
|
-
return
|
|
1628
|
-
let pageName =
|
|
1651
|
+
return `${type}_index`;
|
|
1652
|
+
let pageName = `${type}_${pageLength}`;
|
|
1629
1653
|
while (pageNameList.includes(pageName)) {
|
|
1630
1654
|
pageLength += 1;
|
|
1631
|
-
pageName =
|
|
1655
|
+
pageName = `${type}_${pageLength}`;
|
|
1632
1656
|
}
|
|
1633
1657
|
return pageName;
|
|
1634
1658
|
};
|
|
1635
|
-
const generatePageNameByApp = (app) => generatePageName(getPageNameList(getPageList(app)));
|
|
1659
|
+
const generatePageNameByApp = (app, type) => generatePageName(getPageNameList(type === "page" ? getPageList(app) : getPageFragmentList(app)), type);
|
|
1636
1660
|
const isFixed = (node) => node.style?.position === "fixed";
|
|
1637
1661
|
const getNodeIndex = (id, parent) => {
|
|
1638
1662
|
const items = parent?.items || [];
|
|
@@ -1674,7 +1698,7 @@
|
|
|
1674
1698
|
}
|
|
1675
1699
|
return style;
|
|
1676
1700
|
};
|
|
1677
|
-
const
|
|
1701
|
+
const setChildrenLayout = (node, layout) => {
|
|
1678
1702
|
node.items?.forEach((child) => {
|
|
1679
1703
|
setLayout(child, layout);
|
|
1680
1704
|
});
|
|
@@ -1816,6 +1840,9 @@
|
|
|
1816
1840
|
clear(nodes) {
|
|
1817
1841
|
return this.watcher.clear(nodes);
|
|
1818
1842
|
}
|
|
1843
|
+
clearByType(type, nodes) {
|
|
1844
|
+
return this.watcher.clearByType(type, nodes);
|
|
1845
|
+
}
|
|
1819
1846
|
hasTarget(id, type = dep.DepTargetType.DEFAULT) {
|
|
1820
1847
|
return this.watcher.hasTarget(id, type);
|
|
1821
1848
|
}
|
|
@@ -1886,6 +1913,9 @@
|
|
|
1886
1913
|
}
|
|
1887
1914
|
reset() {
|
|
1888
1915
|
this.state.pageSteps = {};
|
|
1916
|
+
this.resetPage();
|
|
1917
|
+
}
|
|
1918
|
+
resetPage() {
|
|
1889
1919
|
this.state.pageId = void 0;
|
|
1890
1920
|
this.state.canRedo = false;
|
|
1891
1921
|
this.state.canUndo = false;
|
|
@@ -2275,9 +2305,12 @@
|
|
|
2275
2305
|
node: null,
|
|
2276
2306
|
nodes: [],
|
|
2277
2307
|
stage: null,
|
|
2308
|
+
stageLoading: true,
|
|
2278
2309
|
highlightNode: null,
|
|
2279
2310
|
modifiedNodeIds: /* @__PURE__ */ new Map(),
|
|
2280
|
-
pageLength: 0
|
|
2311
|
+
pageLength: 0,
|
|
2312
|
+
pageFragmentLength: 0,
|
|
2313
|
+
disabledMultiSelect: false
|
|
2281
2314
|
});
|
|
2282
2315
|
isHistoryStateChange = false;
|
|
2283
2316
|
constructor() {
|
|
@@ -2311,7 +2344,7 @@
|
|
|
2311
2344
|
}
|
|
2312
2345
|
/**
|
|
2313
2346
|
* 设置当前指点节点配置
|
|
2314
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
2347
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength' | 'pageFragmentLength
|
|
2315
2348
|
* @param value MNode
|
|
2316
2349
|
*/
|
|
2317
2350
|
set(name, value) {
|
|
@@ -2324,17 +2357,22 @@
|
|
|
2324
2357
|
if (Array.isArray(value)) {
|
|
2325
2358
|
throw new Error("root 不能为数组");
|
|
2326
2359
|
}
|
|
2327
|
-
if (value && lodashEs.isObject(value)
|
|
2328
|
-
|
|
2360
|
+
if (value && lodashEs.isObject(value)) {
|
|
2361
|
+
const app = value;
|
|
2362
|
+
this.state.pageLength = getPageList(app).length || 0;
|
|
2363
|
+
this.state.pageFragmentLength = getPageFragmentList(app).length || 0;
|
|
2364
|
+
this.state.stageLoading = this.state.pageLength !== 0;
|
|
2329
2365
|
} else {
|
|
2330
2366
|
this.state.pageLength = 0;
|
|
2367
|
+
this.state.pageFragmentLength = 0;
|
|
2368
|
+
this.state.stageLoading = false;
|
|
2331
2369
|
}
|
|
2332
2370
|
this.emit("root-change", value, preValue);
|
|
2333
2371
|
}
|
|
2334
2372
|
}
|
|
2335
2373
|
/**
|
|
2336
2374
|
* 获取当前指点节点配置
|
|
2337
|
-
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength'
|
|
2375
|
+
* @param name 'root' | 'page' | 'parent' | 'node' | 'highlightNode' | 'nodes' | 'stage' | 'modifiedNodeIds' | 'pageLength' | 'pageFragmentLength'
|
|
2338
2376
|
* @returns MNode
|
|
2339
2377
|
*/
|
|
2340
2378
|
get(name) {
|
|
@@ -2369,7 +2407,7 @@
|
|
|
2369
2407
|
info.node = path[path.length - 1];
|
|
2370
2408
|
info.parent = path[path.length - 2];
|
|
2371
2409
|
path.forEach((item) => {
|
|
2372
|
-
if (item
|
|
2410
|
+
if (utils.isPage(item) || utils.isPageFragment(item)) {
|
|
2373
2411
|
info.page = item;
|
|
2374
2412
|
return;
|
|
2375
2413
|
}
|
|
@@ -2493,6 +2531,16 @@
|
|
|
2493
2531
|
});
|
|
2494
2532
|
this.set("nodes", nodes);
|
|
2495
2533
|
}
|
|
2534
|
+
selectRoot() {
|
|
2535
|
+
const root = this.get("root");
|
|
2536
|
+
if (!root)
|
|
2537
|
+
return;
|
|
2538
|
+
this.set("nodes", [root]);
|
|
2539
|
+
this.set("parent", null);
|
|
2540
|
+
this.set("page", null);
|
|
2541
|
+
this.set("stage", null);
|
|
2542
|
+
this.set("highlightNode", null);
|
|
2543
|
+
}
|
|
2496
2544
|
async doAdd(node, parent) {
|
|
2497
2545
|
const root = this.get("root");
|
|
2498
2546
|
if (!root)
|
|
@@ -2501,10 +2549,10 @@
|
|
|
2501
2549
|
const stage = this.get("stage");
|
|
2502
2550
|
if (!curNode)
|
|
2503
2551
|
throw new Error("当前选中节点为空");
|
|
2504
|
-
if ((parent.type === schema.NodeType.ROOT || curNode?.type === schema.NodeType.ROOT) && node
|
|
2552
|
+
if ((parent.type === schema.NodeType.ROOT || curNode?.type === schema.NodeType.ROOT) && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2505
2553
|
throw new Error("app下不能添加组件");
|
|
2506
2554
|
}
|
|
2507
|
-
if (parent.id !== curNode.id && node
|
|
2555
|
+
if (parent.id !== curNode.id && !(utils.isPage(node) || utils.isPageFragment(node))) {
|
|
2508
2556
|
const index = parent.items.indexOf(curNode);
|
|
2509
2557
|
parent.items?.splice(index + 1, 0, node);
|
|
2510
2558
|
} else {
|
|
@@ -2546,7 +2594,7 @@
|
|
|
2546
2594
|
const newNodes = await Promise.all(
|
|
2547
2595
|
addNodes.map((node) => {
|
|
2548
2596
|
const root = this.get("root");
|
|
2549
|
-
if (utils.isPage(node) && root) {
|
|
2597
|
+
if ((utils.isPage(node) || utils.isPageFragment(node)) && root) {
|
|
2550
2598
|
return this.doAdd(node, root);
|
|
2551
2599
|
}
|
|
2552
2600
|
const parentNode = parent && typeof parent !== "function" ? parent : getAddParent(node);
|
|
@@ -2563,11 +2611,13 @@
|
|
|
2563
2611
|
await this.select(newNodes[0]);
|
|
2564
2612
|
if (utils.isPage(newNodes[0])) {
|
|
2565
2613
|
this.state.pageLength += 1;
|
|
2614
|
+
} else if (utils.isPageFragment(newNodes[0])) {
|
|
2615
|
+
this.state.pageFragmentLength += 1;
|
|
2566
2616
|
} else {
|
|
2567
2617
|
stage?.select(newNodes[0].id);
|
|
2568
2618
|
}
|
|
2569
2619
|
}
|
|
2570
|
-
if (!utils.isPage(newNodes[0])) {
|
|
2620
|
+
if (!(utils.isPage(newNodes[0]) || utils.isPageFragment(newNodes[0]))) {
|
|
2571
2621
|
this.pushHistoryState();
|
|
2572
2622
|
}
|
|
2573
2623
|
this.emit("add", newNodes);
|
|
@@ -2577,7 +2627,7 @@
|
|
|
2577
2627
|
const root = this.get("root");
|
|
2578
2628
|
if (!root)
|
|
2579
2629
|
throw new Error("root不能为空");
|
|
2580
|
-
const { parent, node: curNode } = this.getNodeInfo(node.id);
|
|
2630
|
+
const { parent, node: curNode } = this.getNodeInfo(node.id, false);
|
|
2581
2631
|
if (!parent || !curNode)
|
|
2582
2632
|
throw new Error("找不要删除的节点");
|
|
2583
2633
|
const index = getNodeIndex(curNode.id, parent);
|
|
@@ -2586,26 +2636,31 @@
|
|
|
2586
2636
|
parent.items?.splice(index, 1);
|
|
2587
2637
|
const stage = this.get("stage");
|
|
2588
2638
|
stage?.remove({ id: node.id, parentId: parent.id, root: lodashEs.cloneDeep(root) });
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
stage?.select(root.items[0].id);
|
|
2639
|
+
const selectDefault = async (pages) => {
|
|
2640
|
+
if (pages[0]) {
|
|
2641
|
+
await this.select(pages[0]);
|
|
2642
|
+
stage?.select(pages[0].id);
|
|
2594
2643
|
} 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;
|
|
2644
|
+
this.selectRoot();
|
|
2645
|
+
historyService.resetPage();
|
|
2603
2646
|
}
|
|
2647
|
+
};
|
|
2648
|
+
const rootItems = root.items || [];
|
|
2649
|
+
if (utils.isPage(node)) {
|
|
2650
|
+
this.state.pageLength -= 1;
|
|
2651
|
+
await selectDefault(getPageList(root));
|
|
2652
|
+
} else if (utils.isPageFragment(node)) {
|
|
2653
|
+
this.state.pageFragmentLength -= 1;
|
|
2654
|
+
await selectDefault(getPageFragmentList(root));
|
|
2604
2655
|
} else {
|
|
2605
2656
|
await this.select(parent);
|
|
2606
2657
|
stage?.select(parent.id);
|
|
2658
|
+
this.addModifiedNodeId(parent.id);
|
|
2659
|
+
}
|
|
2660
|
+
if (!rootItems.length) {
|
|
2661
|
+
this.resetModifiedNodeId();
|
|
2662
|
+
historyService.reset();
|
|
2607
2663
|
}
|
|
2608
|
-
this.addModifiedNodeId(parent.id);
|
|
2609
2664
|
}
|
|
2610
2665
|
/**
|
|
2611
2666
|
* 删除组件
|
|
@@ -2614,7 +2669,7 @@
|
|
|
2614
2669
|
async remove(nodeOrNodeList) {
|
|
2615
2670
|
const nodes = Array.isArray(nodeOrNodeList) ? nodeOrNodeList : [nodeOrNodeList];
|
|
2616
2671
|
await Promise.all(nodes.map((node) => this.doRemove(node)));
|
|
2617
|
-
if (!utils.isPage(nodes[0])) {
|
|
2672
|
+
if (!(utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))) {
|
|
2618
2673
|
this.pushHistoryState();
|
|
2619
2674
|
}
|
|
2620
2675
|
this.emit("remove", nodes);
|
|
@@ -2654,7 +2709,7 @@
|
|
|
2654
2709
|
const newLayout = await this.getLayout(newConfig);
|
|
2655
2710
|
const layout = await this.getLayout(node);
|
|
2656
2711
|
if (Array.isArray(newConfig.items) && newLayout !== layout) {
|
|
2657
|
-
newConfig =
|
|
2712
|
+
newConfig = setChildrenLayout(newConfig, newLayout);
|
|
2658
2713
|
}
|
|
2659
2714
|
parentNodeItems[index] = newConfig;
|
|
2660
2715
|
const nodes = this.get("nodes");
|
|
@@ -2666,7 +2721,7 @@
|
|
|
2666
2721
|
parentId: parent.id,
|
|
2667
2722
|
root: lodashEs.cloneDeep(root)
|
|
2668
2723
|
});
|
|
2669
|
-
if (newConfig
|
|
2724
|
+
if (utils.isPage(newConfig) || utils.isPageFragment(newConfig)) {
|
|
2670
2725
|
this.set("page", newConfig);
|
|
2671
2726
|
}
|
|
2672
2727
|
this.addModifiedNodeId(newConfig.id);
|
|
@@ -2734,7 +2789,7 @@
|
|
|
2734
2789
|
*/
|
|
2735
2790
|
copyWithRelated(config) {
|
|
2736
2791
|
const copyNodes = Array.isArray(config) ? config : [config];
|
|
2737
|
-
depService.
|
|
2792
|
+
depService.clearByType(dep.DepTargetType.RELATED_COMP_WHEN_COPY);
|
|
2738
2793
|
depService.collect(copyNodes, true, dep.DepTargetType.RELATED_COMP_WHEN_COPY);
|
|
2739
2794
|
const customTarget = depService.getTarget(
|
|
2740
2795
|
dep.DepTargetType.RELATED_COMP_WHEN_COPY,
|
|
@@ -3115,8 +3170,8 @@
|
|
|
3115
3170
|
};
|
|
3116
3171
|
}
|
|
3117
3172
|
const root = editorService.get("root");
|
|
3118
|
-
if (utils.isPage(pasteConfig) && root) {
|
|
3119
|
-
pasteConfig.name = generatePageNameByApp(root);
|
|
3173
|
+
if ((utils.isPage(pasteConfig) || utils.isPageFragment(pasteConfig)) && root) {
|
|
3174
|
+
pasteConfig.name = generatePageNameByApp(root, utils.isPage(pasteConfig) ? schema.NodeType.PAGE : schema.NodeType.PAGE_FRAGMENT);
|
|
3120
3175
|
}
|
|
3121
3176
|
return pasteConfig;
|
|
3122
3177
|
})
|
|
@@ -3154,7 +3209,7 @@
|
|
|
3154
3209
|
return newNode;
|
|
3155
3210
|
};
|
|
3156
3211
|
|
|
3157
|
-
const _sfc_main$
|
|
3212
|
+
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
3158
3213
|
...{
|
|
3159
3214
|
name: "MEditorCodeParams"
|
|
3160
3215
|
},
|
|
@@ -3204,8 +3259,8 @@
|
|
|
3204
3259
|
}
|
|
3205
3260
|
});
|
|
3206
3261
|
|
|
3207
|
-
const _hoisted_1$
|
|
3208
|
-
const _sfc_main$
|
|
3262
|
+
const _hoisted_1$r = ["src"];
|
|
3263
|
+
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
3209
3264
|
...{
|
|
3210
3265
|
name: "MEditorIcon"
|
|
3211
3266
|
},
|
|
@@ -3229,7 +3284,7 @@
|
|
|
3229
3284
|
class: "magic-editor-icon"
|
|
3230
3285
|
}, {
|
|
3231
3286
|
default: vue.withCtx(() => [
|
|
3232
|
-
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$
|
|
3287
|
+
vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$r)
|
|
3233
3288
|
]),
|
|
3234
3289
|
_: 1
|
|
3235
3290
|
})) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -3307,9 +3362,9 @@
|
|
|
3307
3362
|
};
|
|
3308
3363
|
};
|
|
3309
3364
|
|
|
3310
|
-
const _hoisted_1$
|
|
3311
|
-
const _hoisted_2$
|
|
3312
|
-
const _sfc_main$
|
|
3365
|
+
const _hoisted_1$q = { class: "m-fields-code-select-col" };
|
|
3366
|
+
const _hoisted_2$j = { class: "code-select-container" };
|
|
3367
|
+
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
3313
3368
|
...{
|
|
3314
3369
|
name: "MEditorCodeSelectCol"
|
|
3315
3370
|
},
|
|
@@ -3382,8 +3437,8 @@
|
|
|
3382
3437
|
const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
|
|
3383
3438
|
return (_ctx, _cache) => {
|
|
3384
3439
|
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$
|
|
3440
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$q, [
|
|
3441
|
+
vue.createElementVNode("div", _hoisted_2$j, [
|
|
3387
3442
|
vue.createVNode(_component_m_form_container, {
|
|
3388
3443
|
class: "select",
|
|
3389
3444
|
config: selectConfig,
|
|
@@ -3391,14 +3446,14 @@
|
|
|
3391
3446
|
size: _ctx.size,
|
|
3392
3447
|
onChange: onParamsChangeHandler
|
|
3393
3448
|
}, null, 8, ["model", "size"]),
|
|
3394
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3449
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
3395
3450
|
key: 0,
|
|
3396
3451
|
class: "icon",
|
|
3397
3452
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3398
3453
|
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editCode)(_ctx.model[_ctx.name]))
|
|
3399
3454
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
3400
3455
|
]),
|
|
3401
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3456
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
3402
3457
|
key: 0,
|
|
3403
3458
|
name: "params",
|
|
3404
3459
|
model: _ctx.model,
|
|
@@ -3406,7 +3461,7 @@
|
|
|
3406
3461
|
"params-config": paramsConfig.value,
|
|
3407
3462
|
onChange: onParamsChangeHandler
|
|
3408
3463
|
}, null, 8, ["model", "size", "params-config"])) : vue.createCommentVNode("", true),
|
|
3409
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3464
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
3410
3465
|
key: 1,
|
|
3411
3466
|
ref_key: "codeBlockEditor",
|
|
3412
3467
|
ref: codeBlockEditor,
|
|
@@ -3419,9 +3474,9 @@
|
|
|
3419
3474
|
}
|
|
3420
3475
|
});
|
|
3421
3476
|
|
|
3422
|
-
const _hoisted_1$
|
|
3423
|
-
const _hoisted_2$
|
|
3424
|
-
const _sfc_main$
|
|
3477
|
+
const _hoisted_1$p = { class: "m-editor-data-source-fields" };
|
|
3478
|
+
const _hoisted_2$i = { class: "m-editor-data-source-fields-footer" };
|
|
3479
|
+
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
3425
3480
|
...{
|
|
3426
3481
|
name: "MEditorDataSourceFields"
|
|
3427
3482
|
},
|
|
@@ -3656,12 +3711,12 @@
|
|
|
3656
3711
|
}
|
|
3657
3712
|
};
|
|
3658
3713
|
return (_ctx, _cache) => {
|
|
3659
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
3714
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$p, [
|
|
3660
3715
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
3661
3716
|
data: _ctx.model[_ctx.name],
|
|
3662
3717
|
columns: fieldColumns
|
|
3663
3718
|
}, null, 8, ["data"]),
|
|
3664
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3719
|
+
vue.createElementVNode("div", _hoisted_2$i, [
|
|
3665
3720
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3666
3721
|
size: "small",
|
|
3667
3722
|
disabled: _ctx.disabled,
|
|
@@ -3713,7 +3768,7 @@
|
|
|
3713
3768
|
}
|
|
3714
3769
|
});
|
|
3715
3770
|
|
|
3716
|
-
const _sfc_main$
|
|
3771
|
+
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
3717
3772
|
__name: "DataSourceFieldSelect",
|
|
3718
3773
|
props: {
|
|
3719
3774
|
config: {},
|
|
@@ -3768,10 +3823,10 @@
|
|
|
3768
3823
|
}
|
|
3769
3824
|
});
|
|
3770
3825
|
|
|
3771
|
-
const _hoisted_1$
|
|
3772
|
-
const _hoisted_2$
|
|
3773
|
-
const _hoisted_3$
|
|
3774
|
-
const _sfc_main$
|
|
3826
|
+
const _hoisted_1$o = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
3827
|
+
const _hoisted_2$h = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
3828
|
+
const _hoisted_3$7 = { class: "el-input__inner" };
|
|
3829
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
3775
3830
|
...{
|
|
3776
3831
|
name: "MEditorDataSourceInput"
|
|
3777
3832
|
},
|
|
@@ -3961,12 +4016,12 @@
|
|
|
3961
4016
|
}
|
|
3962
4017
|
), {
|
|
3963
4018
|
suffix: vue.withCtx(() => [
|
|
3964
|
-
vue.createVNode(_sfc_main$
|
|
4019
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
3965
4020
|
]),
|
|
3966
4021
|
default: vue.withCtx(({ item }) => [
|
|
3967
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
4022
|
+
vue.createElementVNode("div", _hoisted_1$o, [
|
|
3968
4023
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
3969
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
4024
|
+
vue.createElementVNode("span", _hoisted_2$h, vue.toDisplayString(item.value), 1)
|
|
3970
4025
|
])
|
|
3971
4026
|
]),
|
|
3972
4027
|
_: 1
|
|
@@ -3978,7 +4033,7 @@
|
|
|
3978
4033
|
vue.createElementVNode("div", {
|
|
3979
4034
|
class: vue.normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
3980
4035
|
}, [
|
|
3981
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
4036
|
+
vue.createElementVNode("div", _hoisted_3$7, [
|
|
3982
4037
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
|
|
3983
4038
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3984
4039
|
item.type === "text" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
@@ -3996,7 +4051,7 @@
|
|
|
3996
4051
|
}, 1032, ["size"])) : vue.createCommentVNode("", true)
|
|
3997
4052
|
], 64);
|
|
3998
4053
|
}), 256)),
|
|
3999
|
-
vue.createVNode(_sfc_main$
|
|
4054
|
+
vue.createVNode(_sfc_main$N, {
|
|
4000
4055
|
class: "tmagic-data-source-input-icon",
|
|
4001
4056
|
icon: vue.unref(iconsVue.Coin)
|
|
4002
4057
|
}, null, 8, ["icon"])
|
|
@@ -4079,9 +4134,9 @@
|
|
|
4079
4134
|
};
|
|
4080
4135
|
};
|
|
4081
4136
|
|
|
4082
|
-
const _hoisted_1$
|
|
4083
|
-
const _hoisted_2$
|
|
4084
|
-
const _sfc_main$
|
|
4137
|
+
const _hoisted_1$n = { class: "m-editor-data-source-methods" };
|
|
4138
|
+
const _hoisted_2$g = { class: "m-editor-data-source-methods-footer" };
|
|
4139
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
4085
4140
|
...{
|
|
4086
4141
|
name: "MEditorDataSourceMethods"
|
|
4087
4142
|
},
|
|
@@ -4151,12 +4206,12 @@
|
|
|
4151
4206
|
emit("change", props.model[props.name]);
|
|
4152
4207
|
};
|
|
4153
4208
|
return (_ctx, _cache) => {
|
|
4154
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4209
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
4155
4210
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4156
4211
|
data: _ctx.model[_ctx.name],
|
|
4157
4212
|
columns: methodColumns
|
|
4158
4213
|
}, null, 8, ["data"]),
|
|
4159
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4214
|
+
vue.createElementVNode("div", _hoisted_2$g, [
|
|
4160
4215
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4161
4216
|
size: "small",
|
|
4162
4217
|
type: "primary",
|
|
@@ -4170,7 +4225,7 @@
|
|
|
4170
4225
|
_: 1
|
|
4171
4226
|
}, 8, ["disabled"])
|
|
4172
4227
|
]),
|
|
4173
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4228
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4174
4229
|
key: 0,
|
|
4175
4230
|
ref_key: "codeBlockEditor",
|
|
4176
4231
|
ref: codeBlockEditor,
|
|
@@ -4185,9 +4240,9 @@
|
|
|
4185
4240
|
}
|
|
4186
4241
|
});
|
|
4187
4242
|
|
|
4188
|
-
const _hoisted_1$
|
|
4189
|
-
const _hoisted_2$
|
|
4190
|
-
const _sfc_main$
|
|
4243
|
+
const _hoisted_1$m = { class: "m-fields-data-source-method-select" };
|
|
4244
|
+
const _hoisted_2$f = { class: "data-source-method-select-container" };
|
|
4245
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
4191
4246
|
...{
|
|
4192
4247
|
name: "MEditorDataSourceMethodSelect"
|
|
4193
4248
|
},
|
|
@@ -4270,22 +4325,22 @@
|
|
|
4270
4325
|
};
|
|
4271
4326
|
return (_ctx, _cache) => {
|
|
4272
4327
|
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$
|
|
4328
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
|
|
4329
|
+
vue.createElementVNode("div", _hoisted_2$f, [
|
|
4275
4330
|
vue.createVNode(_component_m_form_container, {
|
|
4276
4331
|
class: "select",
|
|
4277
4332
|
config: cascaderConfig.value,
|
|
4278
4333
|
model: _ctx.model,
|
|
4279
4334
|
onChange: onChangeHandler
|
|
4280
4335
|
}, null, 8, ["config", "model"]),
|
|
4281
|
-
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4336
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
4282
4337
|
key: 0,
|
|
4283
4338
|
class: "icon",
|
|
4284
4339
|
icon: !_ctx.disabled ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
4285
4340
|
onClick: editCodeHandler
|
|
4286
4341
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
4287
4342
|
]),
|
|
4288
|
-
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4343
|
+
paramsConfig.value.length ? (vue.openBlock(), vue.createBlock(_sfc_main$O, {
|
|
4289
4344
|
key: 0,
|
|
4290
4345
|
name: "params",
|
|
4291
4346
|
model: _ctx.model,
|
|
@@ -4294,7 +4349,7 @@
|
|
|
4294
4349
|
"params-config": paramsConfig.value,
|
|
4295
4350
|
onChange: onChangeHandler
|
|
4296
4351
|
}, null, 8, ["model", "size", "disabled", "params-config"])) : vue.createCommentVNode("", true),
|
|
4297
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4352
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4298
4353
|
key: 1,
|
|
4299
4354
|
ref_key: "codeBlockEditor",
|
|
4300
4355
|
ref: codeBlockEditor,
|
|
@@ -4307,9 +4362,9 @@
|
|
|
4307
4362
|
}
|
|
4308
4363
|
});
|
|
4309
4364
|
|
|
4310
|
-
const _hoisted_1$
|
|
4311
|
-
const _hoisted_2$
|
|
4312
|
-
const _sfc_main$
|
|
4365
|
+
const _hoisted_1$l = { class: "m-editor-data-source-fields" };
|
|
4366
|
+
const _hoisted_2$e = { class: "m-editor-data-source-fields-footer" };
|
|
4367
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
4313
4368
|
...{
|
|
4314
4369
|
name: "MEditorDataSourceMocks"
|
|
4315
4370
|
},
|
|
@@ -4396,7 +4451,7 @@
|
|
|
4396
4451
|
const columns = [
|
|
4397
4452
|
{
|
|
4398
4453
|
type: "expand",
|
|
4399
|
-
component: _sfc_main$
|
|
4454
|
+
component: _sfc_main$T,
|
|
4400
4455
|
props: (row) => ({
|
|
4401
4456
|
initValues: row.data,
|
|
4402
4457
|
language: "json",
|
|
@@ -4505,12 +4560,12 @@
|
|
|
4505
4560
|
});
|
|
4506
4561
|
};
|
|
4507
4562
|
return (_ctx, _cache) => {
|
|
4508
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4563
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
|
|
4509
4564
|
vue.createVNode(vue.unref(table.MagicTable), {
|
|
4510
4565
|
data: _ctx.model[_ctx.name],
|
|
4511
4566
|
columns
|
|
4512
4567
|
}, null, 8, ["data"]),
|
|
4513
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4568
|
+
vue.createElementVNode("div", _hoisted_2$e, [
|
|
4514
4569
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4515
4570
|
size: "small",
|
|
4516
4571
|
type: "primary",
|
|
@@ -4541,7 +4596,7 @@
|
|
|
4541
4596
|
}
|
|
4542
4597
|
});
|
|
4543
4598
|
|
|
4544
|
-
const _sfc_main$
|
|
4599
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
4545
4600
|
...{
|
|
4546
4601
|
name: "MEditorDataSourceSelect"
|
|
4547
4602
|
},
|
|
@@ -4598,12 +4653,12 @@
|
|
|
4598
4653
|
}
|
|
4599
4654
|
});
|
|
4600
4655
|
|
|
4601
|
-
const _hoisted_1$
|
|
4602
|
-
const _hoisted_2$
|
|
4656
|
+
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
4657
|
+
const _hoisted_2$d = {
|
|
4603
4658
|
key: 1,
|
|
4604
4659
|
class: "fullWidth"
|
|
4605
4660
|
};
|
|
4606
|
-
const _sfc_main$
|
|
4661
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
4607
4662
|
...{
|
|
4608
4663
|
name: "MEditorEventSelect"
|
|
4609
4664
|
},
|
|
@@ -4806,7 +4861,7 @@
|
|
|
4806
4861
|
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
4807
4862
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
4808
4863
|
const _component_m_form_panel = vue.resolveComponent("m-form-panel");
|
|
4809
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4864
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
|
|
4810
4865
|
isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
|
|
4811
4866
|
key: 0,
|
|
4812
4867
|
ref: "eventForm",
|
|
@@ -4816,7 +4871,7 @@
|
|
|
4816
4871
|
model: _ctx.model,
|
|
4817
4872
|
config: tableConfig.value,
|
|
4818
4873
|
onChange: onChangeHandler
|
|
4819
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
4874
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$d, [
|
|
4820
4875
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4821
4876
|
class: "create-button",
|
|
4822
4877
|
type: "primary",
|
|
@@ -4866,32 +4921,32 @@
|
|
|
4866
4921
|
}
|
|
4867
4922
|
});
|
|
4868
4923
|
|
|
4869
|
-
const _hoisted_1$
|
|
4924
|
+
const _hoisted_1$j = {
|
|
4870
4925
|
viewBox: "0 0 32 32",
|
|
4871
4926
|
version: "1.1",
|
|
4872
4927
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4873
4928
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
4874
4929
|
};
|
|
4875
|
-
const _hoisted_2$
|
|
4876
|
-
const _hoisted_4$
|
|
4877
|
-
_hoisted_2$
|
|
4930
|
+
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);
|
|
4931
|
+
const _hoisted_4$6 = [
|
|
4932
|
+
_hoisted_2$c
|
|
4878
4933
|
];
|
|
4879
|
-
const _sfc_main$
|
|
4934
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
4880
4935
|
...{
|
|
4881
4936
|
name: "MEditorCodeIcon"
|
|
4882
4937
|
},
|
|
4883
4938
|
__name: "CodeIcon",
|
|
4884
4939
|
setup(__props) {
|
|
4885
4940
|
return (_ctx, _cache) => {
|
|
4886
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
4941
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$j, _hoisted_4$6);
|
|
4887
4942
|
};
|
|
4888
4943
|
}
|
|
4889
4944
|
});
|
|
4890
4945
|
|
|
4891
|
-
const _hoisted_1$
|
|
4892
|
-
const _hoisted_2$
|
|
4893
|
-
const _hoisted_3$
|
|
4894
|
-
const _sfc_main$
|
|
4946
|
+
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
4947
|
+
const _hoisted_2$b = { key: 0 };
|
|
4948
|
+
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
4949
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
4895
4950
|
...{
|
|
4896
4951
|
name: "MEditorKeyValue"
|
|
4897
4952
|
},
|
|
@@ -4949,8 +5004,8 @@
|
|
|
4949
5004
|
emit("change", v);
|
|
4950
5005
|
};
|
|
4951
5006
|
return (_ctx, _cache) => {
|
|
4952
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
4953
|
-
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
5007
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
5008
|
+
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, [
|
|
4954
5009
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
4955
5010
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4956
5011
|
class: "m-fields-key-value-item",
|
|
@@ -4964,7 +5019,7 @@
|
|
|
4964
5019
|
size: _ctx.size,
|
|
4965
5020
|
onChange: keyChangeHandler
|
|
4966
5021
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
4967
|
-
_hoisted_3$
|
|
5022
|
+
_hoisted_3$6,
|
|
4968
5023
|
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4969
5024
|
placeholder: "value",
|
|
4970
5025
|
modelValue: records.value[index][1],
|
|
@@ -4999,7 +5054,7 @@
|
|
|
4999
5054
|
_: 1
|
|
5000
5055
|
}, 8, ["size", "disabled", "icon"])
|
|
5001
5056
|
])) : vue.createCommentVNode("", true),
|
|
5002
|
-
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
5057
|
+
_ctx.config.advanced && showCode.value ? (vue.openBlock(), vue.createBlock(_sfc_main$T, {
|
|
5003
5058
|
key: 1,
|
|
5004
5059
|
height: "200px",
|
|
5005
5060
|
"init-values": _ctx.model[_ctx.name],
|
|
@@ -5015,7 +5070,7 @@
|
|
|
5015
5070
|
size: "default",
|
|
5016
5071
|
disabled: _ctx.disabled,
|
|
5017
5072
|
text: "",
|
|
5018
|
-
icon: _sfc_main$
|
|
5073
|
+
icon: _sfc_main$D,
|
|
5019
5074
|
onClick: _cache[0] || (_cache[0] = ($event) => showCode.value = !showCode.value)
|
|
5020
5075
|
}, null, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
5021
5076
|
]);
|
|
@@ -5023,12 +5078,81 @@
|
|
|
5023
5078
|
}
|
|
5024
5079
|
});
|
|
5025
5080
|
|
|
5081
|
+
const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
|
|
5082
|
+
const _hoisted_2$a = { class: "page-fragment-select-container" };
|
|
5083
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
5084
|
+
...{
|
|
5085
|
+
name: "MEditorPageFragmentSelect"
|
|
5086
|
+
},
|
|
5087
|
+
__name: "PageFragmentSelect",
|
|
5088
|
+
props: {
|
|
5089
|
+
config: {},
|
|
5090
|
+
model: {},
|
|
5091
|
+
initValues: {},
|
|
5092
|
+
values: {},
|
|
5093
|
+
name: {},
|
|
5094
|
+
prop: {},
|
|
5095
|
+
disabled: { type: Boolean, default: false },
|
|
5096
|
+
size: {},
|
|
5097
|
+
lastValues: {}
|
|
5098
|
+
},
|
|
5099
|
+
emits: ["change"],
|
|
5100
|
+
setup(__props, { emit: __emit }) {
|
|
5101
|
+
const services = vue.inject("services");
|
|
5102
|
+
const emit = __emit;
|
|
5103
|
+
const props = __props;
|
|
5104
|
+
const pageList = vue.computed(
|
|
5105
|
+
() => services?.editorService.get("root")?.items.filter((item) => item.type === schema.NodeType.PAGE_FRAGMENT)
|
|
5106
|
+
);
|
|
5107
|
+
const selectConfig = {
|
|
5108
|
+
type: "select",
|
|
5109
|
+
name: props.name,
|
|
5110
|
+
options: () => {
|
|
5111
|
+
if (pageList.value) {
|
|
5112
|
+
return pageList.value.map((item) => ({
|
|
5113
|
+
text: `${item.devconfig?.tabName || item.title || item.name}(${item.id})`,
|
|
5114
|
+
label: `${item.devconfig?.tabName || item.title || item.name}(${item.id})`,
|
|
5115
|
+
value: item.id
|
|
5116
|
+
}));
|
|
5117
|
+
}
|
|
5118
|
+
return [];
|
|
5119
|
+
}
|
|
5120
|
+
};
|
|
5121
|
+
const changeHandler = async () => {
|
|
5122
|
+
emit("change", props.model[props.name]);
|
|
5123
|
+
};
|
|
5124
|
+
const editPageFragment = (id) => {
|
|
5125
|
+
services?.editorService.select(id);
|
|
5126
|
+
};
|
|
5127
|
+
return (_ctx, _cache) => {
|
|
5128
|
+
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
5129
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
5130
|
+
vue.createElementVNode("div", _hoisted_2$a, [
|
|
5131
|
+
vue.createVNode(_component_m_form_container, {
|
|
5132
|
+
class: "select",
|
|
5133
|
+
config: selectConfig,
|
|
5134
|
+
model: _ctx.model,
|
|
5135
|
+
size: _ctx.size,
|
|
5136
|
+
onChange: changeHandler
|
|
5137
|
+
}, null, 8, ["model", "size"]),
|
|
5138
|
+
_ctx.model[_ctx.name] ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5139
|
+
key: 0,
|
|
5140
|
+
class: "icon",
|
|
5141
|
+
icon: vue.unref(iconsVue.Edit),
|
|
5142
|
+
onClick: _cache[0] || (_cache[0] = ($event) => editPageFragment(_ctx.model[_ctx.name]))
|
|
5143
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true)
|
|
5144
|
+
])
|
|
5145
|
+
]);
|
|
5146
|
+
};
|
|
5147
|
+
}
|
|
5148
|
+
});
|
|
5149
|
+
|
|
5026
5150
|
const _hoisted_1$g = {
|
|
5027
5151
|
key: 1,
|
|
5028
5152
|
class: "m-fields-ui-select",
|
|
5029
5153
|
style: { "display": "flex" }
|
|
5030
5154
|
};
|
|
5031
|
-
const _sfc_main$
|
|
5155
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
5032
5156
|
...{
|
|
5033
5157
|
name: "MEditorUISelect"
|
|
5034
5158
|
},
|
|
@@ -5204,7 +5328,7 @@
|
|
|
5204
5328
|
isDraging.value = false;
|
|
5205
5329
|
});
|
|
5206
5330
|
});
|
|
5207
|
-
vue.
|
|
5331
|
+
vue.onBeforeUnmount(() => {
|
|
5208
5332
|
getso?.unset();
|
|
5209
5333
|
isDraging.value = false;
|
|
5210
5334
|
});
|
|
@@ -5213,7 +5337,7 @@
|
|
|
5213
5337
|
};
|
|
5214
5338
|
};
|
|
5215
5339
|
|
|
5216
|
-
const _sfc_main$
|
|
5340
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
5217
5341
|
...{
|
|
5218
5342
|
name: "MEditorResizer"
|
|
5219
5343
|
},
|
|
@@ -5235,7 +5359,7 @@
|
|
|
5235
5359
|
}
|
|
5236
5360
|
});
|
|
5237
5361
|
|
|
5238
|
-
const _sfc_main$
|
|
5362
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
5239
5363
|
...{
|
|
5240
5364
|
name: "MEditorLayout"
|
|
5241
5365
|
},
|
|
@@ -5302,7 +5426,7 @@
|
|
|
5302
5426
|
resizerObserver.observe(el.value);
|
|
5303
5427
|
}
|
|
5304
5428
|
});
|
|
5305
|
-
vue.
|
|
5429
|
+
vue.onBeforeUnmount(() => {
|
|
5306
5430
|
resizerObserver.disconnect();
|
|
5307
5431
|
});
|
|
5308
5432
|
const center = vue.ref(0);
|
|
@@ -5362,7 +5486,7 @@
|
|
|
5362
5486
|
}, [
|
|
5363
5487
|
vue.renderSlot(_ctx.$slots, "left")
|
|
5364
5488
|
], 6),
|
|
5365
|
-
vue.createVNode(_sfc_main$
|
|
5489
|
+
vue.createVNode(_sfc_main$z, { onChange: changeLeft })
|
|
5366
5490
|
], 64)) : vue.createCommentVNode("", true),
|
|
5367
5491
|
vue.createElementVNode("div", {
|
|
5368
5492
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -5371,7 +5495,7 @@
|
|
|
5371
5495
|
vue.renderSlot(_ctx.$slots, "center")
|
|
5372
5496
|
], 6),
|
|
5373
5497
|
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5374
|
-
vue.createVNode(_sfc_main$
|
|
5498
|
+
vue.createVNode(_sfc_main$z, { onChange: changeRight }),
|
|
5375
5499
|
vue.createElementVNode("div", {
|
|
5376
5500
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
5377
5501
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -5384,345 +5508,751 @@
|
|
|
5384
5508
|
}
|
|
5385
5509
|
});
|
|
5386
5510
|
|
|
5387
|
-
const _hoisted_1$f = {
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5511
|
+
const _hoisted_1$f = {
|
|
5512
|
+
key: 1,
|
|
5513
|
+
class: "menu-item-text"
|
|
5514
|
+
};
|
|
5515
|
+
const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
|
|
5516
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
5391
5517
|
...{
|
|
5392
|
-
name: "
|
|
5518
|
+
name: "MEditorToolButton"
|
|
5519
|
+
},
|
|
5520
|
+
__name: "ToolButton",
|
|
5521
|
+
props: {
|
|
5522
|
+
data: { default: () => ({
|
|
5523
|
+
type: "text",
|
|
5524
|
+
display: false
|
|
5525
|
+
}) },
|
|
5526
|
+
eventType: { default: "click" }
|
|
5393
5527
|
},
|
|
5394
|
-
__name: "AddPageBox",
|
|
5395
5528
|
setup(__props) {
|
|
5529
|
+
const props = __props;
|
|
5396
5530
|
const services = vue.inject("services");
|
|
5397
|
-
const
|
|
5398
|
-
|
|
5399
|
-
|
|
5531
|
+
const disabled = vue.computed(() => {
|
|
5532
|
+
if (typeof props.data === "string")
|
|
5533
|
+
return false;
|
|
5534
|
+
if (props.data.type === "component")
|
|
5535
|
+
return false;
|
|
5536
|
+
if (typeof props.data.disabled === "function") {
|
|
5537
|
+
return props.data.disabled(services);
|
|
5538
|
+
}
|
|
5539
|
+
return props.data.disabled;
|
|
5540
|
+
});
|
|
5541
|
+
const display = vue.computed(() => {
|
|
5542
|
+
if (!props.data)
|
|
5543
|
+
return false;
|
|
5544
|
+
if (typeof props.data === "string")
|
|
5545
|
+
return true;
|
|
5546
|
+
if (typeof props.data.display === "function") {
|
|
5547
|
+
return props.data.display(services);
|
|
5548
|
+
}
|
|
5549
|
+
return props.data.display ?? true;
|
|
5550
|
+
});
|
|
5551
|
+
const buttonHandler = (item, event) => {
|
|
5552
|
+
if (disabled.value)
|
|
5400
5553
|
return;
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
editorService.add({
|
|
5405
|
-
type: schema.NodeType.PAGE,
|
|
5406
|
-
name: generatePageNameByApp(root)
|
|
5407
|
-
});
|
|
5554
|
+
if (typeof item.handler === "function" && services) {
|
|
5555
|
+
item.handler?.(services, event);
|
|
5556
|
+
}
|
|
5408
5557
|
};
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
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
|
-
]);
|
|
5558
|
+
const dropdownHandler = (command) => {
|
|
5559
|
+
if (command.item.handler) {
|
|
5560
|
+
command.item.handler(services);
|
|
5561
|
+
}
|
|
5423
5562
|
};
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
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"
|
|
5434
|
-
},
|
|
5435
|
-
__name: "Framework",
|
|
5436
|
-
setup(__props) {
|
|
5437
|
-
const codeOptions = vue.inject("codeOptions", {});
|
|
5438
|
-
const { editorService, uiService } = vue.inject("services") || {};
|
|
5439
|
-
const content = vue.ref();
|
|
5440
|
-
const splitView = vue.ref();
|
|
5441
|
-
const root = vue.computed(() => editorService?.get("root"));
|
|
5442
|
-
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
5443
|
-
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
5444
|
-
const getLeftColumnWidthCacheData = () => Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
5445
|
-
const leftColumnWidthCacheData = getLeftColumnWidthCacheData();
|
|
5446
|
-
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
5447
|
-
const columnWidth = vue.ref({
|
|
5448
|
-
left: leftColumnWidthCacheData,
|
|
5449
|
-
center: 0,
|
|
5450
|
-
right: RightColumnWidthCacheData
|
|
5451
|
-
});
|
|
5452
|
-
vue.watch(
|
|
5453
|
-
[pageLength, splitView],
|
|
5454
|
-
() => {
|
|
5455
|
-
splitView.value?.updateWidth();
|
|
5456
|
-
},
|
|
5457
|
-
{
|
|
5458
|
-
immediate: true
|
|
5563
|
+
const clickHandler = (item, event) => {
|
|
5564
|
+
if (props.eventType !== "click")
|
|
5565
|
+
return;
|
|
5566
|
+
if (item.type === "button") {
|
|
5567
|
+
buttonHandler(item, event);
|
|
5459
5568
|
}
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
(
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
globalThis.localStorage.setItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, `${right}`);
|
|
5569
|
+
};
|
|
5570
|
+
const mousedownHandler = (item, event) => {
|
|
5571
|
+
if (props.eventType !== "mousedown")
|
|
5572
|
+
return;
|
|
5573
|
+
if (item.type === "button") {
|
|
5574
|
+
buttonHandler(item, event);
|
|
5467
5575
|
}
|
|
5468
|
-
);
|
|
5469
|
-
vue.watch(
|
|
5470
|
-
() => columnWidth.value.left,
|
|
5471
|
-
(left) => {
|
|
5472
|
-
globalThis.localStorage.setItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, `${left}`);
|
|
5473
|
-
}
|
|
5474
|
-
);
|
|
5475
|
-
vue.watch(
|
|
5476
|
-
() => uiService?.get("hideSlideBar"),
|
|
5477
|
-
(hideSlideBar) => {
|
|
5478
|
-
columnWidth.value.left = hideSlideBar ? 0 : getLeftColumnWidthCacheData();
|
|
5479
|
-
}
|
|
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
5576
|
};
|
|
5487
|
-
const
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
console.error(e);
|
|
5577
|
+
const mouseupHandler = (item, event) => {
|
|
5578
|
+
if (props.eventType !== "mouseup")
|
|
5579
|
+
return;
|
|
5580
|
+
if (item.type === "button") {
|
|
5581
|
+
buttonHandler(item, event);
|
|
5493
5582
|
}
|
|
5494
5583
|
};
|
|
5495
5584
|
return (_ctx, _cache) => {
|
|
5496
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5585
|
+
return display.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5586
|
+
key: 0,
|
|
5587
|
+
class: vue.normalizeClass(["menu-item", `${_ctx.data.type} ${_ctx.data.className || ""}`]),
|
|
5588
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(_ctx.data, $event)),
|
|
5589
|
+
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
|
|
5590
|
+
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
|
|
5501
5591
|
}, [
|
|
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
|
-
|
|
5592
|
+
_ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
5593
|
+
key: 0,
|
|
5594
|
+
direction: _ctx.data.direction || "vertical"
|
|
5595
|
+
}, 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 }, [
|
|
5596
|
+
_ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
5597
|
+
key: 0,
|
|
5598
|
+
effect: "dark",
|
|
5599
|
+
placement: "bottom-start",
|
|
5600
|
+
content: _ctx.data.tooltip
|
|
5601
|
+
}, {
|
|
5602
|
+
default: vue.withCtx(() => [
|
|
5603
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5604
|
+
size: "small",
|
|
5605
|
+
text: "",
|
|
5606
|
+
disabled: disabled.value
|
|
5607
|
+
}, {
|
|
5608
|
+
default: vue.withCtx(() => [
|
|
5609
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5610
|
+
key: 0,
|
|
5611
|
+
icon: _ctx.data.icon
|
|
5612
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5613
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
|
|
5614
|
+
]),
|
|
5615
|
+
_: 1
|
|
5616
|
+
}, 8, ["disabled"])
|
|
5617
|
+
]),
|
|
5618
|
+
_: 1
|
|
5619
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
5620
|
+
key: 1,
|
|
5621
|
+
size: "small",
|
|
5622
|
+
text: "",
|
|
5623
|
+
disabled: disabled.value,
|
|
5624
|
+
title: _ctx.data.text
|
|
5625
|
+
}, {
|
|
5626
|
+
default: vue.withCtx(() => [
|
|
5627
|
+
_ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
5628
|
+
key: 0,
|
|
5629
|
+
icon: _ctx.data.icon
|
|
5630
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
5631
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
|
|
5632
|
+
]),
|
|
5633
|
+
_: 1
|
|
5634
|
+
}, 8, ["disabled", "title"]))
|
|
5635
|
+
], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
|
|
5636
|
+
key: 3,
|
|
5637
|
+
trigger: "click",
|
|
5638
|
+
disabled: disabled.value,
|
|
5639
|
+
onCommand: dropdownHandler
|
|
5640
|
+
}, {
|
|
5641
|
+
dropdown: vue.withCtx(() => [
|
|
5642
|
+
_ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
|
|
5643
|
+
default: vue.withCtx(() => [
|
|
5644
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
|
|
5645
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
|
|
5646
|
+
key: index,
|
|
5647
|
+
command: { data: _ctx.data, subItem }
|
|
5648
|
+
}, {
|
|
5649
|
+
default: vue.withCtx(() => [
|
|
5650
|
+
vue.createTextVNode(vue.toDisplayString(subItem.text), 1)
|
|
5651
|
+
]),
|
|
5652
|
+
_: 2
|
|
5653
|
+
}, 1032, ["command"]);
|
|
5654
|
+
}), 128))
|
|
5655
|
+
]),
|
|
5656
|
+
_: 1
|
|
5657
|
+
})) : vue.createCommentVNode("", true)
|
|
5536
5658
|
]),
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
fn: vue.withCtx(() => [
|
|
5542
|
-
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
5659
|
+
default: vue.withCtx(() => [
|
|
5660
|
+
vue.createElementVNode("span", _hoisted_2$9, [
|
|
5661
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
5662
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
5543
5663
|
default: vue.withCtx(() => [
|
|
5544
|
-
vue.
|
|
5664
|
+
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
5545
5665
|
]),
|
|
5546
|
-
_:
|
|
5666
|
+
_: 1
|
|
5547
5667
|
})
|
|
5548
|
-
])
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
vue.renderSlot(_ctx.$slots, "footer")
|
|
5554
|
-
], 512);
|
|
5668
|
+
])
|
|
5669
|
+
]),
|
|
5670
|
+
_: 1
|
|
5671
|
+
}, 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)
|
|
5672
|
+
], 34)) : vue.createCommentVNode("", true);
|
|
5555
5673
|
};
|
|
5556
5674
|
}
|
|
5557
5675
|
});
|
|
5558
5676
|
|
|
5559
5677
|
const _hoisted_1$e = {
|
|
5560
5678
|
key: 1,
|
|
5561
|
-
|
|
5679
|
+
style: { "width": "21px" }
|
|
5562
5680
|
};
|
|
5563
|
-
const
|
|
5564
|
-
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5681
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
5565
5682
|
...{
|
|
5566
|
-
name: "
|
|
5683
|
+
name: "MEditorPageBarAddButton"
|
|
5567
5684
|
},
|
|
5568
|
-
__name: "
|
|
5685
|
+
__name: "AddButton",
|
|
5569
5686
|
props: {
|
|
5570
|
-
|
|
5571
|
-
type: "text",
|
|
5572
|
-
display: false
|
|
5573
|
-
}) },
|
|
5574
|
-
eventType: { default: "click" }
|
|
5687
|
+
type: {}
|
|
5575
5688
|
},
|
|
5576
5689
|
setup(__props) {
|
|
5577
5690
|
const props = __props;
|
|
5578
5691
|
const services = vue.inject("services");
|
|
5579
|
-
const
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5692
|
+
const uiService = services?.uiService;
|
|
5693
|
+
const editorService = services?.editorService;
|
|
5694
|
+
const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
|
|
5695
|
+
const addPage = () => {
|
|
5696
|
+
if (!editorService)
|
|
5697
|
+
return;
|
|
5698
|
+
const root = vue.toRaw(editorService.get("root"));
|
|
5699
|
+
if (!root)
|
|
5700
|
+
throw new Error("root 不能为空");
|
|
5701
|
+
const pageConfig = {
|
|
5702
|
+
type: props.type,
|
|
5703
|
+
name: generatePageNameByApp(root, props.type),
|
|
5704
|
+
items: []
|
|
5705
|
+
};
|
|
5706
|
+
editorService.add(pageConfig);
|
|
5707
|
+
};
|
|
5708
|
+
return (_ctx, _cache) => {
|
|
5709
|
+
return showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5710
|
+
key: 0,
|
|
5711
|
+
id: "m-editor-page-bar-add-icon",
|
|
5712
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5713
|
+
onClick: addPage
|
|
5714
|
+
}, [
|
|
5715
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
5716
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e));
|
|
5717
|
+
};
|
|
5718
|
+
}
|
|
5719
|
+
});
|
|
5720
|
+
|
|
5721
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
5722
|
+
...{
|
|
5723
|
+
name: "MEditorPageBarScrollContainer"
|
|
5724
|
+
},
|
|
5725
|
+
__name: "PageBarScrollContainer",
|
|
5726
|
+
props: {
|
|
5727
|
+
type: {}
|
|
5728
|
+
},
|
|
5729
|
+
setup(__props) {
|
|
5730
|
+
const props = __props;
|
|
5731
|
+
const services = vue.inject("services");
|
|
5732
|
+
const editorService = services?.editorService;
|
|
5733
|
+
const uiService = services?.uiService;
|
|
5734
|
+
const itemsContainer = vue.ref();
|
|
5735
|
+
const canScroll = vue.ref(false);
|
|
5736
|
+
const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
|
|
5737
|
+
const itemsContainerWidth = vue.ref(0);
|
|
5738
|
+
const setCanScroll = () => {
|
|
5739
|
+
itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - (showAddPageButton.value ? 37 : 21);
|
|
5740
|
+
vue.nextTick(() => {
|
|
5741
|
+
if (itemsContainer.value) {
|
|
5742
|
+
canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
|
|
5743
|
+
}
|
|
5744
|
+
});
|
|
5745
|
+
};
|
|
5746
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
5747
|
+
setCanScroll();
|
|
5588
5748
|
});
|
|
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;
|
|
5749
|
+
const pageBar = vue.ref();
|
|
5750
|
+
vue.onMounted(() => {
|
|
5751
|
+
pageBar.value && resizeObserver.observe(pageBar.value);
|
|
5598
5752
|
});
|
|
5599
|
-
|
|
5600
|
-
|
|
5753
|
+
vue.onBeforeUnmount(() => {
|
|
5754
|
+
resizeObserver.disconnect();
|
|
5755
|
+
});
|
|
5756
|
+
let translateLeft = 0;
|
|
5757
|
+
const scroll = (type) => {
|
|
5758
|
+
if (!itemsContainer.value)
|
|
5601
5759
|
return;
|
|
5602
|
-
|
|
5603
|
-
|
|
5760
|
+
const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
|
|
5761
|
+
if (type === "left") {
|
|
5762
|
+
translateLeft += 100;
|
|
5763
|
+
if (translateLeft > 0) {
|
|
5764
|
+
translateLeft = 0;
|
|
5765
|
+
}
|
|
5766
|
+
} else if (type === "right") {
|
|
5767
|
+
translateLeft -= 100;
|
|
5768
|
+
if (-translateLeft > maxScrollLeft) {
|
|
5769
|
+
translateLeft = -maxScrollLeft;
|
|
5770
|
+
}
|
|
5771
|
+
} else if (type === "start") {
|
|
5772
|
+
translateLeft = 0;
|
|
5773
|
+
} else if (type === "end") {
|
|
5774
|
+
translateLeft = -maxScrollLeft;
|
|
5604
5775
|
}
|
|
5776
|
+
itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
|
|
5605
5777
|
};
|
|
5606
|
-
const
|
|
5607
|
-
|
|
5608
|
-
|
|
5778
|
+
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
5779
|
+
const pageFragmentLength = vue.computed(() => editorService?.get("pageFragmentLength") || 0);
|
|
5780
|
+
const crateWatchLength = (length) => vue.watch(
|
|
5781
|
+
length,
|
|
5782
|
+
(length2 = 0, preLength = 0) => {
|
|
5783
|
+
setTimeout(() => {
|
|
5784
|
+
setCanScroll();
|
|
5785
|
+
if (length2 < preLength) {
|
|
5786
|
+
scroll("start");
|
|
5787
|
+
} else {
|
|
5788
|
+
scroll("end");
|
|
5789
|
+
}
|
|
5790
|
+
});
|
|
5791
|
+
},
|
|
5792
|
+
{
|
|
5793
|
+
immediate: true
|
|
5794
|
+
}
|
|
5795
|
+
);
|
|
5796
|
+
let unWatchPageLength;
|
|
5797
|
+
let unWatchPageFragmentLength;
|
|
5798
|
+
vue.watch(
|
|
5799
|
+
() => props.type,
|
|
5800
|
+
(type) => {
|
|
5801
|
+
if (type === schema.NodeType.PAGE) {
|
|
5802
|
+
unWatchPageFragmentLength?.();
|
|
5803
|
+
unWatchPageFragmentLength = null;
|
|
5804
|
+
unWatchPageLength = crateWatchLength(pageLength);
|
|
5805
|
+
} else {
|
|
5806
|
+
unWatchPageLength?.();
|
|
5807
|
+
unWatchPageLength = null;
|
|
5808
|
+
unWatchPageFragmentLength = crateWatchLength(pageFragmentLength);
|
|
5809
|
+
}
|
|
5810
|
+
},
|
|
5811
|
+
{
|
|
5812
|
+
immediate: true
|
|
5609
5813
|
}
|
|
5814
|
+
);
|
|
5815
|
+
return (_ctx, _cache) => {
|
|
5816
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5817
|
+
class: "m-editor-page-bar",
|
|
5818
|
+
ref_key: "pageBar",
|
|
5819
|
+
ref: pageBar
|
|
5820
|
+
}, [
|
|
5821
|
+
vue.renderSlot(_ctx.$slots, "prepend"),
|
|
5822
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5823
|
+
key: 0,
|
|
5824
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5825
|
+
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
5826
|
+
}, [
|
|
5827
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
5828
|
+
])) : vue.createCommentVNode("", true),
|
|
5829
|
+
_ctx.type === vue.unref(schema.NodeType).PAGE && pageLength.value || _ctx.type === vue.unref(schema.NodeType).PAGE_FRAGMENT && pageFragmentLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5830
|
+
key: 1,
|
|
5831
|
+
class: "m-editor-page-bar-items",
|
|
5832
|
+
ref_key: "itemsContainer",
|
|
5833
|
+
ref: itemsContainer,
|
|
5834
|
+
style: vue.normalizeStyle(`width: ${itemsContainerWidth.value}px`)
|
|
5835
|
+
}, [
|
|
5836
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
5837
|
+
], 4)) : vue.createCommentVNode("", true),
|
|
5838
|
+
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
5839
|
+
key: 2,
|
|
5840
|
+
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5841
|
+
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
5842
|
+
}, [
|
|
5843
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
5844
|
+
])) : vue.createCommentVNode("", true)
|
|
5845
|
+
], 512);
|
|
5610
5846
|
};
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5847
|
+
}
|
|
5848
|
+
});
|
|
5849
|
+
|
|
5850
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
5851
|
+
...{
|
|
5852
|
+
name: "MEditorPageBarSwitchTypeButton"
|
|
5853
|
+
},
|
|
5854
|
+
__name: "SwitchTypeButton",
|
|
5855
|
+
props: {
|
|
5856
|
+
modelValue: {}
|
|
5857
|
+
},
|
|
5858
|
+
emits: ["update:modelValue"],
|
|
5859
|
+
setup(__props, { emit: __emit }) {
|
|
5860
|
+
const data = [
|
|
5861
|
+
{
|
|
5862
|
+
type: schema.NodeType.PAGE,
|
|
5863
|
+
text: "页面"
|
|
5864
|
+
},
|
|
5865
|
+
{
|
|
5866
|
+
type: schema.NodeType.PAGE_FRAGMENT,
|
|
5867
|
+
text: "页面片"
|
|
5616
5868
|
}
|
|
5869
|
+
];
|
|
5870
|
+
const emit = __emit;
|
|
5871
|
+
const clickHandler = (value) => {
|
|
5872
|
+
emit("update:modelValue", value);
|
|
5617
5873
|
};
|
|
5618
|
-
|
|
5619
|
-
|
|
5874
|
+
return (_ctx, _cache) => {
|
|
5875
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(data, (item) => {
|
|
5876
|
+
return vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5877
|
+
class: vue.normalizeClass(["m-editor-page-bar-switch-type-button", { active: _ctx.modelValue === item.type }]),
|
|
5878
|
+
size: "small",
|
|
5879
|
+
key: item.type,
|
|
5880
|
+
text: "",
|
|
5881
|
+
type: _ctx.modelValue === item.type ? "primary" : "",
|
|
5882
|
+
onClick: ($event) => clickHandler(item.type)
|
|
5883
|
+
}, {
|
|
5884
|
+
default: vue.withCtx(() => [
|
|
5885
|
+
vue.createTextVNode(vue.toDisplayString(item.text), 1)
|
|
5886
|
+
]),
|
|
5887
|
+
_: 2
|
|
5888
|
+
}, 1032, ["class", "type", "onClick"]);
|
|
5889
|
+
}), 64);
|
|
5890
|
+
};
|
|
5891
|
+
}
|
|
5892
|
+
});
|
|
5893
|
+
|
|
5894
|
+
const _hoisted_1$d = { class: "m-editor-page-bar-tabs" };
|
|
5895
|
+
const _hoisted_2$8 = ["onClick"];
|
|
5896
|
+
const _hoisted_3$5 = { class: "m-editor-page-bar-title" };
|
|
5897
|
+
const _hoisted_4$5 = ["title"];
|
|
5898
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
5899
|
+
...{
|
|
5900
|
+
name: "MEditorPageBar"
|
|
5901
|
+
},
|
|
5902
|
+
__name: "PageBar",
|
|
5903
|
+
props: {
|
|
5904
|
+
disabledPageFragment: { type: Boolean }
|
|
5905
|
+
},
|
|
5906
|
+
setup(__props) {
|
|
5907
|
+
const active = vue.ref(schema.NodeType.PAGE);
|
|
5908
|
+
const services = vue.inject("services");
|
|
5909
|
+
const editorService = services?.editorService;
|
|
5910
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
5911
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
5912
|
+
const pageList = vue.computed(() => getPageList(root.value));
|
|
5913
|
+
const pageFragmentList = vue.computed(() => getPageFragmentList(root.value));
|
|
5914
|
+
const list = vue.computed(() => active.value === schema.NodeType.PAGE ? pageList.value : pageFragmentList.value);
|
|
5915
|
+
const activePage = vue.ref("");
|
|
5916
|
+
const activePageFragment = vue.ref("");
|
|
5917
|
+
vue.watch(
|
|
5918
|
+
page,
|
|
5919
|
+
(page2) => {
|
|
5920
|
+
if (!page2) {
|
|
5921
|
+
if (active.value === schema.NodeType.PAGE) {
|
|
5922
|
+
activePage.value = "";
|
|
5923
|
+
}
|
|
5924
|
+
if (active.value === schema.NodeType.PAGE_FRAGMENT) {
|
|
5925
|
+
activePageFragment.value = "";
|
|
5926
|
+
}
|
|
5927
|
+
return;
|
|
5928
|
+
}
|
|
5929
|
+
if (utils.isPage(page2)) {
|
|
5930
|
+
activePage.value = page2?.id;
|
|
5931
|
+
if (active.value !== schema.NodeType.PAGE) {
|
|
5932
|
+
active.value = schema.NodeType.PAGE;
|
|
5933
|
+
}
|
|
5934
|
+
} else if (utils.isPageFragment(page2)) {
|
|
5935
|
+
activePageFragment.value = page2?.id;
|
|
5936
|
+
if (active.value !== schema.NodeType.PAGE_FRAGMENT) {
|
|
5937
|
+
active.value = schema.NodeType.PAGE_FRAGMENT;
|
|
5938
|
+
}
|
|
5939
|
+
}
|
|
5940
|
+
},
|
|
5941
|
+
{
|
|
5942
|
+
immediate: true
|
|
5943
|
+
}
|
|
5944
|
+
);
|
|
5945
|
+
vue.watch(active, (active2) => {
|
|
5946
|
+
if (active2 === schema.NodeType.PAGE) {
|
|
5947
|
+
if (!activePage.value) {
|
|
5948
|
+
editorService?.selectRoot();
|
|
5949
|
+
return;
|
|
5950
|
+
}
|
|
5951
|
+
switchPage(activePage.value);
|
|
5620
5952
|
return;
|
|
5621
|
-
if (item.type === "button") {
|
|
5622
|
-
buttonHandler(item, event);
|
|
5623
5953
|
}
|
|
5954
|
+
if (active2 === schema.NodeType.PAGE_FRAGMENT) {
|
|
5955
|
+
if (!activePageFragment.value) {
|
|
5956
|
+
editorService?.selectRoot();
|
|
5957
|
+
return;
|
|
5958
|
+
}
|
|
5959
|
+
switchPage(activePageFragment.value);
|
|
5960
|
+
}
|
|
5961
|
+
});
|
|
5962
|
+
const switchPage = (id) => {
|
|
5963
|
+
editorService?.select(id);
|
|
5624
5964
|
};
|
|
5625
|
-
const
|
|
5626
|
-
|
|
5965
|
+
const copy = (node) => {
|
|
5966
|
+
node && editorService?.copy(node);
|
|
5967
|
+
editorService?.paste({
|
|
5968
|
+
left: 0,
|
|
5969
|
+
top: 0
|
|
5970
|
+
});
|
|
5971
|
+
};
|
|
5972
|
+
const remove = (node) => {
|
|
5973
|
+
editorService?.remove(node);
|
|
5974
|
+
};
|
|
5975
|
+
return (_ctx, _cache) => {
|
|
5976
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
5977
|
+
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createBlock(_sfc_main$u, {
|
|
5978
|
+
key: 0,
|
|
5979
|
+
modelValue: active.value,
|
|
5980
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => active.value = $event)
|
|
5981
|
+
}, null, 8, ["modelValue"])) : vue.createCommentVNode("", true),
|
|
5982
|
+
vue.createVNode(_sfc_main$v, { type: active.value }, {
|
|
5983
|
+
prepend: vue.withCtx(() => [
|
|
5984
|
+
vue.createVNode(_sfc_main$w, { type: active.value }, null, 8, ["type"])
|
|
5985
|
+
]),
|
|
5986
|
+
default: vue.withCtx(() => [
|
|
5987
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (item) => {
|
|
5988
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5989
|
+
class: vue.normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
5990
|
+
key: item.id,
|
|
5991
|
+
onClick: ($event) => switchPage(item.id)
|
|
5992
|
+
}, [
|
|
5993
|
+
vue.createElementVNode("div", _hoisted_3$5, [
|
|
5994
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
5995
|
+
vue.createElementVNode("span", {
|
|
5996
|
+
title: item.name
|
|
5997
|
+
}, vue.toDisplayString(item.name || item.id), 9, _hoisted_4$5)
|
|
5998
|
+
])
|
|
5999
|
+
]),
|
|
6000
|
+
vue.createVNode(vue.unref(design.TMagicPopover), {
|
|
6001
|
+
"popper-class": "page-bar-popover",
|
|
6002
|
+
placement: "top",
|
|
6003
|
+
width: 160,
|
|
6004
|
+
trigger: "hover"
|
|
6005
|
+
}, {
|
|
6006
|
+
reference: vue.withCtx(() => [
|
|
6007
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
6008
|
+
default: vue.withCtx(() => [
|
|
6009
|
+
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
6010
|
+
]),
|
|
6011
|
+
_: 1
|
|
6012
|
+
})
|
|
6013
|
+
]),
|
|
6014
|
+
default: vue.withCtx(() => [
|
|
6015
|
+
vue.createElementVNode("div", null, [
|
|
6016
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
6017
|
+
vue.createVNode(_sfc_main$x, {
|
|
6018
|
+
data: {
|
|
6019
|
+
type: "button",
|
|
6020
|
+
text: "复制",
|
|
6021
|
+
icon: vue.unref(iconsVue.DocumentCopy),
|
|
6022
|
+
handler: () => copy(item)
|
|
6023
|
+
}
|
|
6024
|
+
}, null, 8, ["data"]),
|
|
6025
|
+
vue.createVNode(_sfc_main$x, {
|
|
6026
|
+
data: {
|
|
6027
|
+
type: "button",
|
|
6028
|
+
text: "删除",
|
|
6029
|
+
icon: vue.unref(iconsVue.Delete),
|
|
6030
|
+
handler: () => remove(item)
|
|
6031
|
+
}
|
|
6032
|
+
}, null, 8, ["data"])
|
|
6033
|
+
])
|
|
6034
|
+
])
|
|
6035
|
+
]),
|
|
6036
|
+
_: 2
|
|
6037
|
+
}, 1024)
|
|
6038
|
+
], 10, _hoisted_2$8);
|
|
6039
|
+
}), 128))
|
|
6040
|
+
]),
|
|
6041
|
+
_: 3
|
|
6042
|
+
}, 8, ["type"])
|
|
6043
|
+
]);
|
|
6044
|
+
};
|
|
6045
|
+
}
|
|
6046
|
+
});
|
|
6047
|
+
|
|
6048
|
+
const _hoisted_1$c = { class: "m-editor-empty-panel" };
|
|
6049
|
+
const _hoisted_2$7 = { class: "m-editor-empty-content" };
|
|
6050
|
+
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
6051
|
+
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面片", -1);
|
|
6052
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
6053
|
+
...{
|
|
6054
|
+
name: "MEditorAddPageBox"
|
|
6055
|
+
},
|
|
6056
|
+
__name: "AddPageBox",
|
|
6057
|
+
props: {
|
|
6058
|
+
disabledPageFragment: { type: Boolean }
|
|
6059
|
+
},
|
|
6060
|
+
setup(__props) {
|
|
6061
|
+
const services = vue.inject("services");
|
|
6062
|
+
const clickHandler = (type) => {
|
|
6063
|
+
const { editorService } = services || {};
|
|
6064
|
+
if (!editorService)
|
|
5627
6065
|
return;
|
|
5628
|
-
|
|
5629
|
-
|
|
6066
|
+
const root = vue.toRaw(editorService.get("root"));
|
|
6067
|
+
if (!root)
|
|
6068
|
+
throw new Error("root 不能为空");
|
|
6069
|
+
editorService.add({
|
|
6070
|
+
type,
|
|
6071
|
+
name: generatePageNameByApp(root, type),
|
|
6072
|
+
items: []
|
|
6073
|
+
});
|
|
6074
|
+
};
|
|
6075
|
+
return (_ctx, _cache) => {
|
|
6076
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
6077
|
+
vue.createElementVNode("div", _hoisted_2$7, [
|
|
6078
|
+
vue.createElementVNode("div", {
|
|
6079
|
+
class: "m-editor-empty-button",
|
|
6080
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(schema.NodeType).PAGE))
|
|
6081
|
+
}, [
|
|
6082
|
+
vue.createElementVNode("div", null, [
|
|
6083
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
6084
|
+
]),
|
|
6085
|
+
_hoisted_3$4
|
|
6086
|
+
]),
|
|
6087
|
+
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
6088
|
+
key: 0,
|
|
6089
|
+
class: "m-editor-empty-button",
|
|
6090
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickHandler(vue.unref(schema.NodeType).PAGE_FRAGMENT))
|
|
6091
|
+
}, [
|
|
6092
|
+
vue.createElementVNode("div", null, [
|
|
6093
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
6094
|
+
]),
|
|
6095
|
+
_hoisted_4$4
|
|
6096
|
+
])) : vue.createCommentVNode("", true)
|
|
6097
|
+
])
|
|
6098
|
+
]);
|
|
6099
|
+
};
|
|
6100
|
+
}
|
|
6101
|
+
});
|
|
6102
|
+
|
|
6103
|
+
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
6104
|
+
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
6105
|
+
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
6106
|
+
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
6107
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
6108
|
+
...{
|
|
6109
|
+
name: "MEditorFramework"
|
|
6110
|
+
},
|
|
6111
|
+
__name: "Framework",
|
|
6112
|
+
props: {
|
|
6113
|
+
disabledPageFragment: { type: Boolean }
|
|
6114
|
+
},
|
|
6115
|
+
setup(__props) {
|
|
6116
|
+
const codeOptions = vue.inject("codeOptions", {});
|
|
6117
|
+
const { editorService, uiService } = vue.inject("services") || {};
|
|
6118
|
+
const content = vue.ref();
|
|
6119
|
+
const splitView = vue.ref();
|
|
6120
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
6121
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
6122
|
+
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
6123
|
+
const stageLoading = vue.computed(() => editorService?.get("stageLoading") || false);
|
|
6124
|
+
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
6125
|
+
const getLeftColumnWidthCacheData = () => Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
6126
|
+
const leftColumnWidthCacheData = getLeftColumnWidthCacheData();
|
|
6127
|
+
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
6128
|
+
const columnWidth = vue.ref({
|
|
6129
|
+
left: leftColumnWidthCacheData,
|
|
6130
|
+
center: 0,
|
|
6131
|
+
right: RightColumnWidthCacheData
|
|
6132
|
+
});
|
|
6133
|
+
vue.watch(
|
|
6134
|
+
[pageLength, splitView],
|
|
6135
|
+
() => {
|
|
6136
|
+
splitView.value?.updateWidth();
|
|
6137
|
+
},
|
|
6138
|
+
{
|
|
6139
|
+
immediate: true
|
|
6140
|
+
}
|
|
6141
|
+
);
|
|
6142
|
+
vue.watch(
|
|
6143
|
+
() => columnWidth.value.right,
|
|
6144
|
+
(right) => {
|
|
6145
|
+
if (typeof right === "undefined")
|
|
6146
|
+
return;
|
|
6147
|
+
globalThis.localStorage.setItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, `${right}`);
|
|
6148
|
+
}
|
|
6149
|
+
);
|
|
6150
|
+
vue.watch(
|
|
6151
|
+
() => columnWidth.value.left,
|
|
6152
|
+
(left) => {
|
|
6153
|
+
globalThis.localStorage.setItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, `${left}`);
|
|
6154
|
+
}
|
|
6155
|
+
);
|
|
6156
|
+
vue.watch(
|
|
6157
|
+
() => uiService?.get("hideSlideBar"),
|
|
6158
|
+
(hideSlideBar) => {
|
|
6159
|
+
columnWidth.value.left = hideSlideBar ? 0 : getLeftColumnWidthCacheData();
|
|
6160
|
+
}
|
|
6161
|
+
);
|
|
6162
|
+
const columnWidthChange = (columnW) => {
|
|
6163
|
+
columnWidth.value.left = columnW.left;
|
|
6164
|
+
columnWidth.value.center = columnW.center;
|
|
6165
|
+
columnWidth.value.right = columnW.right;
|
|
6166
|
+
uiService?.set("columnWidth", columnW);
|
|
6167
|
+
};
|
|
6168
|
+
const saveCode = (value) => {
|
|
6169
|
+
try {
|
|
6170
|
+
const parseDSL = getConfig("parseDSL");
|
|
6171
|
+
editorService?.set("root", parseDSL(value));
|
|
6172
|
+
} catch (e) {
|
|
6173
|
+
console.error(e);
|
|
5630
6174
|
}
|
|
5631
6175
|
};
|
|
5632
6176
|
return (_ctx, _cache) => {
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
class:
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
6177
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
6178
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6179
|
+
class: "m-editor",
|
|
6180
|
+
ref_key: "content",
|
|
6181
|
+
ref: content,
|
|
6182
|
+
style: { "min-width": "180px" }
|
|
5639
6183
|
}, [
|
|
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)
|
|
6184
|
+
vue.renderSlot(_ctx.$slots, "header"),
|
|
6185
|
+
vue.renderSlot(_ctx.$slots, "nav"),
|
|
6186
|
+
vue.renderSlot(_ctx.$slots, "content-before"),
|
|
6187
|
+
showSrc.value ? vue.renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
|
|
6188
|
+
vue.createVNode(_sfc_main$T, {
|
|
6189
|
+
class: "m-editor-content",
|
|
6190
|
+
"init-values": root.value,
|
|
6191
|
+
options: vue.unref(codeOptions),
|
|
6192
|
+
onSave: saveCode
|
|
6193
|
+
}, null, 8, ["init-values", "options"])
|
|
6194
|
+
]) : vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$y, {
|
|
6195
|
+
key: 1,
|
|
6196
|
+
"element-loading-text": "Runtime 加载中...",
|
|
6197
|
+
ref_key: "splitView",
|
|
6198
|
+
ref: splitView,
|
|
6199
|
+
class: "m-editor-content",
|
|
6200
|
+
"left-class": "m-editor-framework-left",
|
|
6201
|
+
"center-class": "m-editor-framework-center",
|
|
6202
|
+
"right-class": "m-editor-framework-right",
|
|
6203
|
+
left: columnWidth.value.left,
|
|
6204
|
+
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => columnWidth.value.left = $event),
|
|
6205
|
+
right: columnWidth.value.right,
|
|
6206
|
+
"onUpdate:right": _cache[1] || (_cache[1] = ($event) => columnWidth.value.right = $event),
|
|
6207
|
+
"min-left": 65,
|
|
6208
|
+
"min-right": 20,
|
|
6209
|
+
"min-center": 100,
|
|
6210
|
+
onChange: columnWidthChange
|
|
6211
|
+
}, vue.createSlots({
|
|
6212
|
+
left: vue.withCtx(() => [
|
|
6213
|
+
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
6214
|
+
]),
|
|
6215
|
+
center: vue.withCtx(() => [
|
|
6216
|
+
page.value ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
6217
|
+
vue.createVNode(_sfc_main$s, { "disabled-page-fragment": _ctx.disabledPageFragment }, null, 8, ["disabled-page-fragment"])
|
|
5680
6218
|
]),
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
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))
|
|
5703
|
-
]),
|
|
5704
|
-
_: 1
|
|
5705
|
-
})) : vue.createCommentVNode("", true)
|
|
6219
|
+
vue.renderSlot(_ctx.$slots, "page-bar", {}, () => [
|
|
6220
|
+
vue.createVNode(_sfc_main$t, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
6221
|
+
"page-bar-title": vue.withCtx(({ page: page2 }) => [
|
|
6222
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: page2 })
|
|
6223
|
+
]),
|
|
6224
|
+
"page-bar-popover": vue.withCtx(({ page: page2 }) => [
|
|
6225
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: page2 })
|
|
6226
|
+
]),
|
|
6227
|
+
_: 3
|
|
6228
|
+
}, 8, ["disabled-page-fragment"])
|
|
6229
|
+
])
|
|
5706
6230
|
]),
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
6231
|
+
_: 2
|
|
6232
|
+
}, [
|
|
6233
|
+
page.value ? {
|
|
6234
|
+
name: "right",
|
|
6235
|
+
fn: vue.withCtx(() => [
|
|
6236
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
5711
6237
|
default: vue.withCtx(() => [
|
|
5712
|
-
vue.
|
|
6238
|
+
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
5713
6239
|
]),
|
|
5714
|
-
_:
|
|
6240
|
+
_: 3
|
|
5715
6241
|
})
|
|
5716
|
-
])
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
6242
|
+
]),
|
|
6243
|
+
key: "0"
|
|
6244
|
+
} : void 0
|
|
6245
|
+
]), 1032, ["left", "right"])), [
|
|
6246
|
+
[_directive_loading, stageLoading.value]
|
|
6247
|
+
]),
|
|
6248
|
+
vue.renderSlot(_ctx.$slots, "content-after"),
|
|
6249
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
6250
|
+
], 512);
|
|
5721
6251
|
};
|
|
5722
6252
|
}
|
|
5723
6253
|
});
|
|
5724
6254
|
|
|
5725
|
-
const _sfc_main$
|
|
6255
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
5726
6256
|
...{
|
|
5727
6257
|
name: "MEditorNavMenu"
|
|
5728
6258
|
},
|
|
@@ -5884,7 +6414,7 @@
|
|
|
5884
6414
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
5885
6415
|
}, [
|
|
5886
6416
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
5887
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6417
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
5888
6418
|
data: item,
|
|
5889
6419
|
key: index
|
|
5890
6420
|
}, null, 8, ["data"]);
|
|
@@ -5896,8 +6426,8 @@
|
|
|
5896
6426
|
}
|
|
5897
6427
|
});
|
|
5898
6428
|
|
|
5899
|
-
const _hoisted_1$
|
|
5900
|
-
const _sfc_main$
|
|
6429
|
+
const _hoisted_1$b = { class: "m-editor-props-panel" };
|
|
6430
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
5901
6431
|
...{
|
|
5902
6432
|
name: "MEditorPropsPanel"
|
|
5903
6433
|
},
|
|
@@ -5905,7 +6435,7 @@
|
|
|
5905
6435
|
props: {
|
|
5906
6436
|
extendState: { type: Function }
|
|
5907
6437
|
},
|
|
5908
|
-
emits: ["mounted"],
|
|
6438
|
+
emits: ["mounted", "submit-error", "form-error"],
|
|
5909
6439
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5910
6440
|
const emit = __emit;
|
|
5911
6441
|
const internalInstance = vue.getCurrentInstance();
|
|
@@ -5931,7 +6461,7 @@
|
|
|
5931
6461
|
vue.onMounted(() => {
|
|
5932
6462
|
emit("mounted", internalInstance);
|
|
5933
6463
|
});
|
|
5934
|
-
vue.
|
|
6464
|
+
vue.onBeforeUnmount(() => {
|
|
5935
6465
|
services?.propsService.off("props-configs-change", init);
|
|
5936
6466
|
});
|
|
5937
6467
|
vue.watchEffect(() => {
|
|
@@ -5944,14 +6474,15 @@
|
|
|
5944
6474
|
const values2 = await configForm.value?.submitForm();
|
|
5945
6475
|
services?.editorService.update(values2);
|
|
5946
6476
|
} catch (e) {
|
|
5947
|
-
|
|
5948
|
-
design.tMagicMessage.closeAll();
|
|
5949
|
-
design.tMagicMessage.error(e.message);
|
|
6477
|
+
emit("submit-error", e);
|
|
5950
6478
|
}
|
|
5951
6479
|
};
|
|
6480
|
+
const errorHandler = (e) => {
|
|
6481
|
+
emit("form-error", e);
|
|
6482
|
+
};
|
|
5952
6483
|
__expose({ configForm, submit });
|
|
5953
6484
|
return (_ctx, _cache) => {
|
|
5954
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6485
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
5955
6486
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
5956
6487
|
vue.createVNode(vue.unref(form.MForm), {
|
|
5957
6488
|
ref_key: "configForm",
|
|
@@ -5962,7 +6493,8 @@
|
|
|
5962
6493
|
"init-values": values.value,
|
|
5963
6494
|
config: curFormConfig.value,
|
|
5964
6495
|
"extend-state": _ctx.extendState,
|
|
5965
|
-
onChange: submit
|
|
6496
|
+
onChange: submit,
|
|
6497
|
+
onError: errorHandler
|
|
5966
6498
|
}, null, 8, ["class", "popper-class", "size", "init-values", "config", "extend-state"])
|
|
5967
6499
|
], 512)), [
|
|
5968
6500
|
[vue.vShow, nodes.value.length === 1]
|
|
@@ -6102,7 +6634,7 @@
|
|
|
6102
6634
|
};
|
|
6103
6635
|
};
|
|
6104
6636
|
|
|
6105
|
-
const _sfc_main$
|
|
6637
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
6106
6638
|
...{
|
|
6107
6639
|
name: "MEditorSearchInput"
|
|
6108
6640
|
},
|
|
@@ -6153,14 +6685,14 @@
|
|
|
6153
6685
|
});
|
|
6154
6686
|
};
|
|
6155
6687
|
|
|
6156
|
-
const _hoisted_1$
|
|
6157
|
-
const _hoisted_2$
|
|
6688
|
+
const _hoisted_1$a = ["draggable", "data-node-id", "data-is-container"];
|
|
6689
|
+
const _hoisted_2$6 = { class: "tree-node-label" };
|
|
6158
6690
|
const _hoisted_3$3 = { class: "tree-node-tool" };
|
|
6159
6691
|
const _hoisted_4$3 = {
|
|
6160
6692
|
key: 0,
|
|
6161
6693
|
class: "m-editor-tree-node-children"
|
|
6162
6694
|
};
|
|
6163
|
-
const _sfc_main$
|
|
6695
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
6164
6696
|
...{
|
|
6165
6697
|
name: "MEditorTreeNode"
|
|
6166
6698
|
},
|
|
@@ -6186,7 +6718,7 @@
|
|
|
6186
6718
|
const selected = vue.computed(() => nodeStatus.value.selected);
|
|
6187
6719
|
const visible = vue.computed(() => nodeStatus.value.visible);
|
|
6188
6720
|
const draggable = vue.computed(() => nodeStatus.value.draggable);
|
|
6189
|
-
const
|
|
6721
|
+
const hasChildren = vue.computed(() => props.data.items?.some((item) => props.nodeStatusMap.get(item.id)?.visible));
|
|
6190
6722
|
const handleDragStart = (event) => {
|
|
6191
6723
|
treeEmit?.("node-dragstart", event, props.data);
|
|
6192
6724
|
};
|
|
@@ -6227,9 +6759,9 @@
|
|
|
6227
6759
|
onContextmenu: nodeContentmenuHandler,
|
|
6228
6760
|
onMouseenter: mouseenterHandler
|
|
6229
6761
|
}, [
|
|
6230
|
-
vue.createVNode(_sfc_main$
|
|
6762
|
+
vue.createVNode(_sfc_main$N, {
|
|
6231
6763
|
class: "expand-icon",
|
|
6232
|
-
style: vue.normalizeStyle(
|
|
6764
|
+
style: vue.normalizeStyle(hasChildren.value ? "" : "color: transparent; cursor: default"),
|
|
6233
6765
|
icon: expanded.value ? vue.unref(iconsVue.ArrowDown) : vue.unref(iconsVue.ArrowRight),
|
|
6234
6766
|
onClick: expandHandler
|
|
6235
6767
|
}, null, 8, ["style", "icon"]),
|
|
@@ -6238,7 +6770,7 @@
|
|
|
6238
6770
|
onClick: nodeClickHandler
|
|
6239
6771
|
}, [
|
|
6240
6772
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
6241
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6773
|
+
vue.createElementVNode("div", _hoisted_2$6, [
|
|
6242
6774
|
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
6243
6775
|
vue.createTextVNode(vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
6244
6776
|
])
|
|
@@ -6249,7 +6781,7 @@
|
|
|
6249
6781
|
])
|
|
6250
6782
|
])
|
|
6251
6783
|
], 38),
|
|
6252
|
-
|
|
6784
|
+
hasChildren.value && expanded.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
|
|
6253
6785
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (item) => {
|
|
6254
6786
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
6255
6787
|
key: item.id,
|
|
@@ -6270,15 +6802,18 @@
|
|
|
6270
6802
|
}, 1032, ["data", "node-status-map", "indent"]);
|
|
6271
6803
|
}), 128))
|
|
6272
6804
|
])) : vue.createCommentVNode("", true)
|
|
6273
|
-
], 40, _hoisted_1$
|
|
6805
|
+
], 40, _hoisted_1$a)), [
|
|
6274
6806
|
[vue.vShow, visible.value]
|
|
6275
6807
|
]);
|
|
6276
6808
|
};
|
|
6277
6809
|
}
|
|
6278
6810
|
});
|
|
6279
6811
|
|
|
6280
|
-
const _hoisted_1$
|
|
6281
|
-
|
|
6812
|
+
const _hoisted_1$9 = {
|
|
6813
|
+
key: 1,
|
|
6814
|
+
class: "m-editor-tree-empty"
|
|
6815
|
+
};
|
|
6816
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
6282
6817
|
...{
|
|
6283
6818
|
name: "MEditorTree"
|
|
6284
6819
|
},
|
|
@@ -6302,7 +6837,7 @@
|
|
|
6302
6837
|
onDragover: handleDragOver
|
|
6303
6838
|
}, [
|
|
6304
6839
|
_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$
|
|
6840
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
6306
6841
|
key: item.id,
|
|
6307
6842
|
data: item,
|
|
6308
6843
|
indent: _ctx.indent,
|
|
@@ -6319,7 +6854,7 @@
|
|
|
6319
6854
|
]),
|
|
6320
6855
|
_: 2
|
|
6321
6856
|
}, 1032, ["data", "indent", "node-status-map"]);
|
|
6322
|
-
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6857
|
+
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
6323
6858
|
vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
6324
6859
|
]))
|
|
6325
6860
|
], 32);
|
|
@@ -6399,7 +6934,7 @@
|
|
|
6399
6934
|
};
|
|
6400
6935
|
};
|
|
6401
6936
|
|
|
6402
|
-
const _sfc_main$
|
|
6937
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
6403
6938
|
...{
|
|
6404
6939
|
name: "MEditorCodeBlockList"
|
|
6405
6940
|
},
|
|
@@ -6481,7 +7016,7 @@
|
|
|
6481
7016
|
filter: filterTextChangeHandler
|
|
6482
7017
|
});
|
|
6483
7018
|
return (_ctx, _cache) => {
|
|
6484
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7019
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6485
7020
|
data: codeList.value,
|
|
6486
7021
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
6487
7022
|
onNodeClick: clickHandler
|
|
@@ -6503,7 +7038,7 @@
|
|
|
6503
7038
|
placement: "bottom"
|
|
6504
7039
|
}, {
|
|
6505
7040
|
default: vue.withCtx(() => [
|
|
6506
|
-
vue.createVNode(_sfc_main$
|
|
7041
|
+
vue.createVNode(_sfc_main$N, {
|
|
6507
7042
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6508
7043
|
class: "edit-icon",
|
|
6509
7044
|
onClick: vue.withModifiers(($event) => editCode(`${data.key}`), ["stop"])
|
|
@@ -6518,7 +7053,7 @@
|
|
|
6518
7053
|
placement: "bottom"
|
|
6519
7054
|
}, {
|
|
6520
7055
|
default: vue.withCtx(() => [
|
|
6521
|
-
vue.createVNode(_sfc_main$
|
|
7056
|
+
vue.createVNode(_sfc_main$N, {
|
|
6522
7057
|
icon: vue.unref(iconsVue.Close),
|
|
6523
7058
|
class: "edit-icon",
|
|
6524
7059
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.key}`), ["stop"])
|
|
@@ -6537,8 +7072,8 @@
|
|
|
6537
7072
|
}
|
|
6538
7073
|
});
|
|
6539
7074
|
|
|
6540
|
-
const _hoisted_1$
|
|
6541
|
-
const _sfc_main$
|
|
7075
|
+
const _hoisted_1$8 = { class: "search-wrapper" };
|
|
7076
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
6542
7077
|
...{
|
|
6543
7078
|
name: "MEditorCodeBlockListPanel"
|
|
6544
7079
|
},
|
|
@@ -6560,8 +7095,8 @@
|
|
|
6560
7095
|
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
|
|
6561
7096
|
default: vue.withCtx(() => [
|
|
6562
7097
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
6563
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6564
|
-
vue.createVNode(_sfc_main$
|
|
7098
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
7099
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
6565
7100
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
6566
7101
|
key: 0,
|
|
6567
7102
|
class: "create-code-button",
|
|
@@ -6577,7 +7112,7 @@
|
|
|
6577
7112
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
6578
7113
|
])
|
|
6579
7114
|
]),
|
|
6580
|
-
vue.createVNode(_sfc_main$
|
|
7115
|
+
vue.createVNode(_sfc_main$l, {
|
|
6581
7116
|
ref_key: "codeBlockList",
|
|
6582
7117
|
ref: codeBlockList,
|
|
6583
7118
|
"custom-error": _ctx.customError,
|
|
@@ -6595,7 +7130,7 @@
|
|
|
6595
7130
|
]),
|
|
6596
7131
|
_: 3
|
|
6597
7132
|
}),
|
|
6598
|
-
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7133
|
+
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
6599
7134
|
key: 0,
|
|
6600
7135
|
ref_key: "codeBlockEditor",
|
|
6601
7136
|
ref: codeBlockEditor,
|
|
@@ -6609,7 +7144,7 @@
|
|
|
6609
7144
|
}
|
|
6610
7145
|
});
|
|
6611
7146
|
|
|
6612
|
-
const _sfc_main$
|
|
7147
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
6613
7148
|
...{
|
|
6614
7149
|
name: "MEditorDataSourceConfigPanel"
|
|
6615
7150
|
},
|
|
@@ -6665,7 +7200,7 @@
|
|
|
6665
7200
|
}
|
|
6666
7201
|
});
|
|
6667
7202
|
|
|
6668
|
-
const _sfc_main$
|
|
7203
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
6669
7204
|
...{
|
|
6670
7205
|
name: "MEditorDataSourceList"
|
|
6671
7206
|
},
|
|
@@ -6754,7 +7289,7 @@
|
|
|
6754
7289
|
filter: filterTextChangeHandler
|
|
6755
7290
|
});
|
|
6756
7291
|
return (_ctx, _cache) => {
|
|
6757
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7292
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
6758
7293
|
data: list.value,
|
|
6759
7294
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
6760
7295
|
onNodeClick: clickHandler
|
|
@@ -6776,7 +7311,7 @@
|
|
|
6776
7311
|
placement: "bottom"
|
|
6777
7312
|
}, {
|
|
6778
7313
|
default: vue.withCtx(() => [
|
|
6779
|
-
vue.createVNode(_sfc_main$
|
|
7314
|
+
vue.createVNode(_sfc_main$N, {
|
|
6780
7315
|
icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
6781
7316
|
class: "edit-icon",
|
|
6782
7317
|
onClick: vue.withModifiers(($event) => editHandler(`${data.key}`), ["stop"])
|
|
@@ -6791,7 +7326,7 @@
|
|
|
6791
7326
|
placement: "bottom"
|
|
6792
7327
|
}, {
|
|
6793
7328
|
default: vue.withCtx(() => [
|
|
6794
|
-
vue.createVNode(_sfc_main$
|
|
7329
|
+
vue.createVNode(_sfc_main$N, {
|
|
6795
7330
|
icon: vue.unref(iconsVue.Close),
|
|
6796
7331
|
class: "edit-icon",
|
|
6797
7332
|
onClick: vue.withModifiers(($event) => removeHandler(`${data.key}`), ["stop"])
|
|
@@ -6807,9 +7342,9 @@
|
|
|
6807
7342
|
}
|
|
6808
7343
|
});
|
|
6809
7344
|
|
|
6810
|
-
const _hoisted_1$
|
|
6811
|
-
const _hoisted_2$
|
|
6812
|
-
const _sfc_main$
|
|
7345
|
+
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
7346
|
+
const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
|
|
7347
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
6813
7348
|
...{
|
|
6814
7349
|
name: "MEditorDataSourceListPanel"
|
|
6815
7350
|
},
|
|
@@ -6873,8 +7408,8 @@
|
|
|
6873
7408
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
6874
7409
|
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
6875
7410
|
default: vue.withCtx(() => [
|
|
6876
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
6877
|
-
vue.createVNode(_sfc_main$
|
|
7411
|
+
vue.createElementVNode("div", _hoisted_1$7, [
|
|
7412
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
6878
7413
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
6879
7414
|
key: 0,
|
|
6880
7415
|
placement: "right"
|
|
@@ -6891,9 +7426,9 @@
|
|
|
6891
7426
|
})
|
|
6892
7427
|
]),
|
|
6893
7428
|
default: vue.withCtx(() => [
|
|
6894
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
7429
|
+
vue.createElementVNode("div", _hoisted_2$5, [
|
|
6895
7430
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
6896
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7431
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
6897
7432
|
data: {
|
|
6898
7433
|
type: "button",
|
|
6899
7434
|
text: item.text,
|
|
@@ -6909,14 +7444,14 @@
|
|
|
6909
7444
|
_: 1
|
|
6910
7445
|
})) : vue.createCommentVNode("", true)
|
|
6911
7446
|
]),
|
|
6912
|
-
vue.createVNode(_sfc_main$
|
|
7447
|
+
vue.createVNode(_sfc_main$i, {
|
|
6913
7448
|
onEdit: editHandler,
|
|
6914
7449
|
onRemove: removeHandler
|
|
6915
7450
|
})
|
|
6916
7451
|
]),
|
|
6917
7452
|
_: 1
|
|
6918
7453
|
}),
|
|
6919
|
-
vue.createVNode(_sfc_main$
|
|
7454
|
+
vue.createVNode(_sfc_main$j, {
|
|
6920
7455
|
ref_key: "editDialog",
|
|
6921
7456
|
ref: editDialog,
|
|
6922
7457
|
disabled: !editable.value,
|
|
@@ -6930,7 +7465,7 @@
|
|
|
6930
7465
|
}
|
|
6931
7466
|
});
|
|
6932
7467
|
|
|
6933
|
-
const _sfc_main$
|
|
7468
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
6934
7469
|
...{
|
|
6935
7470
|
name: "MEditorContentMenu"
|
|
6936
7471
|
},
|
|
@@ -6971,7 +7506,7 @@
|
|
|
6971
7506
|
return;
|
|
6972
7507
|
hide();
|
|
6973
7508
|
};
|
|
6974
|
-
const
|
|
7509
|
+
const outsideClickHideHandler = (e) => {
|
|
6975
7510
|
if (!props.autoHide)
|
|
6976
7511
|
return;
|
|
6977
7512
|
const target = e.target;
|
|
@@ -7032,12 +7567,12 @@
|
|
|
7032
7567
|
vue.onMounted(() => {
|
|
7033
7568
|
if (props.isSubMenu)
|
|
7034
7569
|
return;
|
|
7035
|
-
globalThis.addEventListener("mousedown",
|
|
7570
|
+
globalThis.addEventListener("mousedown", outsideClickHideHandler, true);
|
|
7036
7571
|
});
|
|
7037
|
-
vue.
|
|
7572
|
+
vue.onBeforeUnmount(() => {
|
|
7038
7573
|
if (props.isSubMenu)
|
|
7039
7574
|
return;
|
|
7040
|
-
globalThis.removeEventListener("mousedown",
|
|
7575
|
+
globalThis.removeEventListener("mousedown", outsideClickHideHandler, true);
|
|
7041
7576
|
});
|
|
7042
7577
|
__expose({
|
|
7043
7578
|
menu,
|
|
@@ -7061,7 +7596,7 @@
|
|
|
7061
7596
|
vue.renderSlot(_ctx.$slots, "title"),
|
|
7062
7597
|
vue.createElementVNode("div", null, [
|
|
7063
7598
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
7064
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7599
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
7065
7600
|
"event-type": "mouseup",
|
|
7066
7601
|
ref_for: true,
|
|
7067
7602
|
ref_key: "buttons",
|
|
@@ -7096,7 +7631,7 @@
|
|
|
7096
7631
|
}
|
|
7097
7632
|
});
|
|
7098
7633
|
|
|
7099
|
-
const _hoisted_1$
|
|
7634
|
+
const _hoisted_1$6 = {
|
|
7100
7635
|
width: "1em",
|
|
7101
7636
|
height: "1em",
|
|
7102
7637
|
viewBox: "0 0 16 16",
|
|
@@ -7104,7 +7639,7 @@
|
|
|
7104
7639
|
fill: "currentColor",
|
|
7105
7640
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7106
7641
|
};
|
|
7107
|
-
const _hoisted_2$
|
|
7642
|
+
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
7108
7643
|
"fill-rule": "evenodd",
|
|
7109
7644
|
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
7645
|
}, null, -1);
|
|
@@ -7113,17 +7648,17 @@
|
|
|
7113
7648
|
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
7649
|
}, null, -1);
|
|
7115
7650
|
const _hoisted_4$2 = [
|
|
7116
|
-
_hoisted_2$
|
|
7651
|
+
_hoisted_2$4,
|
|
7117
7652
|
_hoisted_3$2
|
|
7118
7653
|
];
|
|
7119
|
-
const _sfc_main$
|
|
7654
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
7120
7655
|
...{
|
|
7121
7656
|
name: "MEditorFolderMinusIcon"
|
|
7122
7657
|
},
|
|
7123
7658
|
__name: "FolderMinusIcon",
|
|
7124
7659
|
setup(__props) {
|
|
7125
7660
|
return (_ctx, _cache) => {
|
|
7126
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
7661
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _hoisted_4$2);
|
|
7127
7662
|
};
|
|
7128
7663
|
}
|
|
7129
7664
|
});
|
|
@@ -7134,7 +7669,7 @@
|
|
|
7134
7669
|
icon: iconsVue.Delete,
|
|
7135
7670
|
display: (services) => {
|
|
7136
7671
|
const node = services?.editorService?.get("node");
|
|
7137
|
-
return node?.type !== schema.NodeType.ROOT && !utils.isPage(node);
|
|
7672
|
+
return node?.type !== schema.NodeType.ROOT && !utils.isPage(node) && !utils.isPageFragment(node);
|
|
7138
7673
|
},
|
|
7139
7674
|
handler: (services) => {
|
|
7140
7675
|
const nodes = services?.editorService?.get("nodes");
|
|
@@ -7201,13 +7736,14 @@
|
|
|
7201
7736
|
};
|
|
7202
7737
|
};
|
|
7203
7738
|
|
|
7204
|
-
const _sfc_main$
|
|
7739
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
7205
7740
|
...{
|
|
7206
7741
|
name: "MEditorLayerMenu"
|
|
7207
7742
|
},
|
|
7208
7743
|
__name: "LayerMenu",
|
|
7209
7744
|
props: {
|
|
7210
|
-
layerContentMenu: {}
|
|
7745
|
+
layerContentMenu: { default: () => [] },
|
|
7746
|
+
customContentMenu: { type: Function, default: (menus) => menus }
|
|
7211
7747
|
},
|
|
7212
7748
|
emits: ["collapse-all"],
|
|
7213
7749
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -7261,29 +7797,34 @@
|
|
|
7261
7797
|
}
|
|
7262
7798
|
return [];
|
|
7263
7799
|
});
|
|
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
|
-
|
|
7800
|
+
const menuData = vue.computed(
|
|
7801
|
+
() => props.customContentMenu(
|
|
7802
|
+
[
|
|
7803
|
+
{
|
|
7804
|
+
type: "button",
|
|
7805
|
+
text: "全部折叠",
|
|
7806
|
+
icon: _sfc_main$f,
|
|
7807
|
+
display: () => utils.isPage(node.value) || utils.isPageFragment(node.value),
|
|
7808
|
+
handler: () => {
|
|
7809
|
+
emit("collapse-all");
|
|
7810
|
+
}
|
|
7811
|
+
},
|
|
7812
|
+
{
|
|
7813
|
+
type: "button",
|
|
7814
|
+
text: "新增",
|
|
7815
|
+
icon: vue.markRaw(iconsVue.Plus),
|
|
7816
|
+
display: () => node.value?.items && nodes.value?.length === 1,
|
|
7817
|
+
items: getSubMenuData.value
|
|
7818
|
+
},
|
|
7819
|
+
useCopyMenu(),
|
|
7820
|
+
usePasteMenu(),
|
|
7821
|
+
useDeleteMenu(),
|
|
7822
|
+
useMoveToMenu(services),
|
|
7823
|
+
...props.layerContentMenu
|
|
7824
|
+
],
|
|
7825
|
+
"layer"
|
|
7826
|
+
)
|
|
7827
|
+
);
|
|
7287
7828
|
const show = (e) => {
|
|
7288
7829
|
menu.value?.show(e);
|
|
7289
7830
|
};
|
|
@@ -7291,7 +7832,7 @@
|
|
|
7291
7832
|
show
|
|
7292
7833
|
});
|
|
7293
7834
|
return (_ctx, _cache) => {
|
|
7294
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7835
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
7295
7836
|
"menu-data": menuData.value,
|
|
7296
7837
|
ref_key: "menu",
|
|
7297
7838
|
ref: menu,
|
|
@@ -7301,7 +7842,7 @@
|
|
|
7301
7842
|
}
|
|
7302
7843
|
});
|
|
7303
7844
|
|
|
7304
|
-
const _sfc_main$
|
|
7845
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
7305
7846
|
__name: "LayerNodeTool",
|
|
7306
7847
|
props: {
|
|
7307
7848
|
data: {}
|
|
@@ -7320,12 +7861,12 @@
|
|
|
7320
7861
|
};
|
|
7321
7862
|
return (_ctx, _cache) => {
|
|
7322
7863
|
return _ctx.data.type !== "page" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
7323
|
-
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7864
|
+
_ctx.data.visible === false ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
7324
7865
|
key: 0,
|
|
7325
7866
|
icon: vue.unref(iconsVue.Hide),
|
|
7326
7867
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => setNodeVisible(true), ["stop"])),
|
|
7327
7868
|
title: "点击显示"
|
|
7328
|
-
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7869
|
+
}, null, 8, ["icon"])) : (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
7329
7870
|
key: 1,
|
|
7330
7871
|
icon: vue.unref(iconsVue.View),
|
|
7331
7872
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => setNodeVisible(false), ["stop"])),
|
|
@@ -7338,11 +7879,12 @@
|
|
|
7338
7879
|
});
|
|
7339
7880
|
|
|
7340
7881
|
const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
|
|
7882
|
+
const isMultiSelect = vue.computed(() => isCtrlKeyDown.value && !services?.editorService.get("disabledMultiSelect"));
|
|
7341
7883
|
const select = async (data) => {
|
|
7342
7884
|
if (!data.id) {
|
|
7343
7885
|
throw new Error("没有id");
|
|
7344
7886
|
}
|
|
7345
|
-
if (
|
|
7887
|
+
if (isMultiSelect.value) {
|
|
7346
7888
|
multiSelect(data);
|
|
7347
7889
|
} else {
|
|
7348
7890
|
await services?.editorService.select(data);
|
|
@@ -7381,7 +7923,7 @@
|
|
|
7381
7923
|
document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: data }));
|
|
7382
7924
|
return;
|
|
7383
7925
|
}
|
|
7384
|
-
if (data.items && data.items.length > 0 && !
|
|
7926
|
+
if (data.items && data.items.length > 0 && !isMultiSelect.value) {
|
|
7385
7927
|
updateStatus(nodeStatusMap.value, data.id, {
|
|
7386
7928
|
expand: true
|
|
7387
7929
|
});
|
|
@@ -7651,21 +8193,21 @@
|
|
|
7651
8193
|
}
|
|
7652
8194
|
];
|
|
7653
8195
|
|
|
7654
|
-
const useKeybinding = (services,
|
|
8196
|
+
const useKeybinding = (services, container) => {
|
|
7655
8197
|
const keybindingService = services?.keybindingService;
|
|
7656
8198
|
const isCtrlKeyDown = vue.ref(false);
|
|
7657
8199
|
const windowBlurHandler = () => {
|
|
7658
8200
|
isCtrlKeyDown.value = false;
|
|
7659
8201
|
};
|
|
7660
|
-
keybindingService?.
|
|
8202
|
+
keybindingService?.registerCommand("layer-panel-global-keyup", () => {
|
|
7661
8203
|
isCtrlKeyDown.value = false;
|
|
7662
8204
|
});
|
|
7663
|
-
keybindingService?.
|
|
8205
|
+
keybindingService?.registerCommand("layer-panel-global-keydown", () => {
|
|
7664
8206
|
isCtrlKeyDown.value = true;
|
|
7665
8207
|
});
|
|
7666
|
-
keybindingService?.
|
|
8208
|
+
keybindingService?.register([
|
|
7667
8209
|
{
|
|
7668
|
-
command: "layer-panel-global-
|
|
8210
|
+
command: "layer-panel-global-keydown",
|
|
7669
8211
|
keybinding: "ctrl",
|
|
7670
8212
|
when: [["global", "keydown"]]
|
|
7671
8213
|
},
|
|
@@ -7676,12 +8218,12 @@
|
|
|
7676
8218
|
}
|
|
7677
8219
|
]);
|
|
7678
8220
|
vue.watchEffect(() => {
|
|
7679
|
-
if (
|
|
8221
|
+
if (container.value) {
|
|
7680
8222
|
globalThis.addEventListener("blur", windowBlurHandler);
|
|
7681
|
-
keybindingService?.
|
|
8223
|
+
keybindingService?.registerEl(KeyBindingContainerKey.LAYER_PANEL, container.value.$el);
|
|
7682
8224
|
} else {
|
|
7683
8225
|
globalThis.removeEventListener("blur", windowBlurHandler);
|
|
7684
|
-
keybindingService?.
|
|
8226
|
+
keybindingService?.unregisterEl(KeyBindingContainerKey.LAYER_PANEL);
|
|
7685
8227
|
}
|
|
7686
8228
|
});
|
|
7687
8229
|
return {
|
|
@@ -7689,7 +8231,7 @@
|
|
|
7689
8231
|
};
|
|
7690
8232
|
};
|
|
7691
8233
|
|
|
7692
|
-
const createPageNodeStatus = (page,
|
|
8234
|
+
const createPageNodeStatus = (page, initialLayerNodeStatus) => {
|
|
7693
8235
|
const map = /* @__PURE__ */ new Map();
|
|
7694
8236
|
map.set(page.id, {
|
|
7695
8237
|
visible: true,
|
|
@@ -7701,7 +8243,7 @@
|
|
|
7701
8243
|
(node) => traverseNode(node, (node2) => {
|
|
7702
8244
|
map.set(
|
|
7703
8245
|
node2.id,
|
|
7704
|
-
|
|
8246
|
+
initialLayerNodeStatus?.get(node2.id) || {
|
|
7705
8247
|
visible: true,
|
|
7706
8248
|
expand: false,
|
|
7707
8249
|
selected: false,
|
|
@@ -7776,13 +8318,14 @@
|
|
|
7776
8318
|
};
|
|
7777
8319
|
};
|
|
7778
8320
|
|
|
7779
|
-
const _sfc_main$
|
|
8321
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
7780
8322
|
...{
|
|
7781
8323
|
name: "MEditorLayerPanel"
|
|
7782
8324
|
},
|
|
7783
8325
|
__name: "LayerPanel",
|
|
7784
8326
|
props: {
|
|
7785
|
-
layerContentMenu: {}
|
|
8327
|
+
layerContentMenu: {},
|
|
8328
|
+
customContentMenu: { type: Function }
|
|
7786
8329
|
},
|
|
7787
8330
|
setup(__props) {
|
|
7788
8331
|
const services = vue.inject("services");
|
|
@@ -7824,8 +8367,8 @@
|
|
|
7824
8367
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
7825
8368
|
default: vue.withCtx(() => [
|
|
7826
8369
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
7827
|
-
vue.createVNode(_sfc_main$
|
|
7828
|
-
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8370
|
+
vue.createVNode(_sfc_main$o, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
8371
|
+
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
7829
8372
|
key: 0,
|
|
7830
8373
|
tabindex: "-1",
|
|
7831
8374
|
ref_key: "tree",
|
|
@@ -7845,7 +8388,7 @@
|
|
|
7845
8388
|
]),
|
|
7846
8389
|
"tree-node-tool": vue.withCtx(({ data: nodeData2 }) => [
|
|
7847
8390
|
vue.renderSlot(_ctx.$slots, "layer-node-tool", { data: nodeData2 }, () => [
|
|
7848
|
-
vue.createVNode(_sfc_main$
|
|
8391
|
+
vue.createVNode(_sfc_main$d, { data: nodeData2 }, null, 8, ["data"])
|
|
7849
8392
|
])
|
|
7850
8393
|
]),
|
|
7851
8394
|
"tree-node-label": vue.withCtx(({ data: nodeData2 }) => [
|
|
@@ -7854,12 +8397,13 @@
|
|
|
7854
8397
|
_: 3
|
|
7855
8398
|
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
|
|
7856
8399
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
7857
|
-
vue.createVNode(_sfc_main$
|
|
8400
|
+
vue.createVNode(_sfc_main$e, {
|
|
7858
8401
|
ref_key: "menu",
|
|
7859
8402
|
ref: menu,
|
|
7860
8403
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
8404
|
+
"custom-content-menu": _ctx.customContentMenu,
|
|
7861
8405
|
onCollapseAll: collapseAllHandler
|
|
7862
|
-
}, null, 8, ["layer-content-menu"])
|
|
8406
|
+
}, null, 8, ["layer-content-menu", "custom-content-menu"])
|
|
7863
8407
|
]))
|
|
7864
8408
|
]),
|
|
7865
8409
|
_: 3
|
|
@@ -7868,9 +8412,9 @@
|
|
|
7868
8412
|
}
|
|
7869
8413
|
});
|
|
7870
8414
|
|
|
7871
|
-
const _hoisted_1$
|
|
7872
|
-
const _hoisted_2$
|
|
7873
|
-
const _sfc_main$
|
|
8415
|
+
const _hoisted_1$5 = ["onClick", "onDragstart"];
|
|
8416
|
+
const _hoisted_2$3 = ["title"];
|
|
8417
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
7874
8418
|
...{
|
|
7875
8419
|
name: "MEditorComponentListPanel"
|
|
7876
8420
|
},
|
|
@@ -7950,7 +8494,7 @@
|
|
|
7950
8494
|
"model-value": collapseValue.value
|
|
7951
8495
|
}, {
|
|
7952
8496
|
default: vue.withCtx(() => [
|
|
7953
|
-
vue.createVNode(_sfc_main$
|
|
8497
|
+
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
7954
8498
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
7955
8499
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
7956
8500
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -7958,7 +8502,7 @@
|
|
|
7958
8502
|
name: `${index}`
|
|
7959
8503
|
}, {
|
|
7960
8504
|
title: vue.withCtx(() => [
|
|
7961
|
-
vue.createVNode(_sfc_main$
|
|
8505
|
+
vue.createVNode(_sfc_main$N, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
7962
8506
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
7963
8507
|
]),
|
|
7964
8508
|
default: vue.withCtx(() => [
|
|
@@ -7979,7 +8523,7 @@
|
|
|
7979
8523
|
content: item.desc
|
|
7980
8524
|
}, {
|
|
7981
8525
|
default: vue.withCtx(() => [
|
|
7982
|
-
vue.createVNode(_sfc_main$
|
|
8526
|
+
vue.createVNode(_sfc_main$N, {
|
|
7983
8527
|
icon: item.icon
|
|
7984
8528
|
}, null, 8, ["icon"])
|
|
7985
8529
|
]),
|
|
@@ -7987,9 +8531,9 @@
|
|
|
7987
8531
|
}, 1032, ["disabled", "content"]),
|
|
7988
8532
|
vue.createElementVNode("span", {
|
|
7989
8533
|
title: item.text
|
|
7990
|
-
}, vue.toDisplayString(item.text), 9, _hoisted_2$
|
|
8534
|
+
}, vue.toDisplayString(item.text), 9, _hoisted_2$3)
|
|
7991
8535
|
])
|
|
7992
|
-
], 40, _hoisted_1$
|
|
8536
|
+
], 40, _hoisted_1$5);
|
|
7993
8537
|
}), 128))
|
|
7994
8538
|
]),
|
|
7995
8539
|
_: 2
|
|
@@ -8006,11 +8550,11 @@
|
|
|
8006
8550
|
}
|
|
8007
8551
|
});
|
|
8008
8552
|
|
|
8009
|
-
const _hoisted_1$
|
|
8553
|
+
const _hoisted_1$4 = {
|
|
8010
8554
|
key: 0,
|
|
8011
8555
|
class: "m-editor-sidebar"
|
|
8012
8556
|
};
|
|
8013
|
-
const _hoisted_2$
|
|
8557
|
+
const _hoisted_2$2 = { class: "m-editor-sidebar-header" };
|
|
8014
8558
|
const _hoisted_3$1 = ["onClick", "onDragend"];
|
|
8015
8559
|
const _hoisted_4$1 = {
|
|
8016
8560
|
key: 1,
|
|
@@ -8019,14 +8563,15 @@
|
|
|
8019
8563
|
const _hoisted_5$1 = { class: "m-editor-float-box-list" };
|
|
8020
8564
|
const _hoisted_6 = ["onClick"];
|
|
8021
8565
|
const _hoisted_7 = { class: "m-editor-float-box-body" };
|
|
8022
|
-
const _sfc_main$
|
|
8566
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
8023
8567
|
...{
|
|
8024
8568
|
name: "MEditorSidebar"
|
|
8025
8569
|
},
|
|
8026
8570
|
__name: "Sidebar",
|
|
8027
8571
|
props: {
|
|
8028
8572
|
data: { default: () => ({ type: "tabs", status: "组件", items: ["component-list", "layer", "code-block", "data-source"] }) },
|
|
8029
|
-
layerContentMenu: {}
|
|
8573
|
+
layerContentMenu: {},
|
|
8574
|
+
customContentMenu: {}
|
|
8030
8575
|
},
|
|
8031
8576
|
setup(__props, { expose: __expose }) {
|
|
8032
8577
|
const props = __props;
|
|
@@ -8039,7 +8584,7 @@
|
|
|
8039
8584
|
type: "component",
|
|
8040
8585
|
icon: iconsVue.Goods,
|
|
8041
8586
|
text: "组件",
|
|
8042
|
-
component: _sfc_main$
|
|
8587
|
+
component: _sfc_main$b,
|
|
8043
8588
|
slots: {}
|
|
8044
8589
|
},
|
|
8045
8590
|
layer: {
|
|
@@ -8048,9 +8593,10 @@
|
|
|
8048
8593
|
icon: iconsVue.List,
|
|
8049
8594
|
text: "已选组件",
|
|
8050
8595
|
props: {
|
|
8051
|
-
layerContentMenu: props.layerContentMenu
|
|
8596
|
+
layerContentMenu: props.layerContentMenu,
|
|
8597
|
+
customContentMenu: props.customContentMenu
|
|
8052
8598
|
},
|
|
8053
|
-
component: _sfc_main$
|
|
8599
|
+
component: _sfc_main$c,
|
|
8054
8600
|
slots: {}
|
|
8055
8601
|
},
|
|
8056
8602
|
"code-block": {
|
|
@@ -8058,7 +8604,7 @@
|
|
|
8058
8604
|
type: "component",
|
|
8059
8605
|
icon: iconsVue.EditPen,
|
|
8060
8606
|
text: "代码编辑",
|
|
8061
|
-
component: _sfc_main$
|
|
8607
|
+
component: _sfc_main$k,
|
|
8062
8608
|
slots: {},
|
|
8063
8609
|
boxComponentConfig: {
|
|
8064
8610
|
props: {
|
|
@@ -8071,7 +8617,7 @@
|
|
|
8071
8617
|
type: "component",
|
|
8072
8618
|
icon: iconsVue.Coin,
|
|
8073
8619
|
text: "数据源",
|
|
8074
|
-
component: _sfc_main$
|
|
8620
|
+
component: _sfc_main$h,
|
|
8075
8621
|
slots: {},
|
|
8076
8622
|
boxComponentConfig: {
|
|
8077
8623
|
props: {
|
|
@@ -8114,8 +8660,8 @@
|
|
|
8114
8660
|
});
|
|
8115
8661
|
return (_ctx, _cache) => {
|
|
8116
8662
|
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$
|
|
8663
|
+
_ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
8664
|
+
vue.createElementVNode("div", _hoisted_2$2, [
|
|
8119
8665
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
|
|
8120
8666
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
8121
8667
|
class: vue.normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
@@ -8126,7 +8672,7 @@
|
|
|
8126
8672
|
(...args) => vue.unref(dragstartHandler) && vue.unref(dragstartHandler)(...args)),
|
|
8127
8673
|
onDragend: ($event) => vue.unref(dragendHandler)(config.$key, $event)
|
|
8128
8674
|
}, [
|
|
8129
|
-
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8675
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$N, {
|
|
8130
8676
|
key: 0,
|
|
8131
8677
|
icon: config.icon
|
|
8132
8678
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -8262,7 +8808,7 @@
|
|
|
8262
8808
|
onClick: ($event) => vue.unref(showFloatBox)(config.$key)
|
|
8263
8809
|
}, [
|
|
8264
8810
|
vue.createElementVNode("div", null, vue.toDisplayString(config.text), 1),
|
|
8265
|
-
vue.createVNode(_sfc_main$
|
|
8811
|
+
vue.createVNode(_sfc_main$N, {
|
|
8266
8812
|
class: "m-editor-float-box-close",
|
|
8267
8813
|
icon: vue.unref(iconsVue.Close),
|
|
8268
8814
|
onClick: vue.withModifiers(($event) => vue.unref(closeFloatBox)(config.$key), ["stop"])
|
|
@@ -8410,7 +8956,7 @@
|
|
|
8410
8956
|
};
|
|
8411
8957
|
}
|
|
8412
8958
|
|
|
8413
|
-
const _sfc_main$
|
|
8959
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
8414
8960
|
...{
|
|
8415
8961
|
name: "MEditorScrollBar"
|
|
8416
8962
|
},
|
|
@@ -8449,7 +8995,7 @@
|
|
|
8449
8995
|
});
|
|
8450
8996
|
bar.value?.addEventListener("wheel", wheelHandler, false);
|
|
8451
8997
|
});
|
|
8452
|
-
vue.
|
|
8998
|
+
vue.onBeforeUnmount(() => {
|
|
8453
8999
|
if (gesto)
|
|
8454
9000
|
gesto.off();
|
|
8455
9001
|
bar.value?.removeEventListener("wheel", wheelHandler, false);
|
|
@@ -8498,7 +9044,7 @@
|
|
|
8498
9044
|
}
|
|
8499
9045
|
});
|
|
8500
9046
|
|
|
8501
|
-
const _sfc_main$
|
|
9047
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
8502
9048
|
...{
|
|
8503
9049
|
name: "MEditorScrollViewer"
|
|
8504
9050
|
},
|
|
@@ -8545,7 +9091,7 @@
|
|
|
8545
9091
|
scrollHeight.value = data.scrollHeight;
|
|
8546
9092
|
});
|
|
8547
9093
|
});
|
|
8548
|
-
vue.
|
|
9094
|
+
vue.onBeforeUnmount(() => {
|
|
8549
9095
|
scrollViewer.destroy();
|
|
8550
9096
|
});
|
|
8551
9097
|
vue.watch(
|
|
@@ -8584,14 +9130,14 @@
|
|
|
8584
9130
|
}, [
|
|
8585
9131
|
vue.renderSlot(_ctx.$slots, "default")
|
|
8586
9132
|
], 4),
|
|
8587
|
-
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9133
|
+
scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
|
|
8588
9134
|
key: 0,
|
|
8589
9135
|
"scroll-size": scrollHeight.value,
|
|
8590
9136
|
size: _ctx.wrapHeight,
|
|
8591
9137
|
pos: vOffset.value,
|
|
8592
9138
|
onScroll: vScrollHandler
|
|
8593
9139
|
}, null, 8, ["scroll-size", "size", "pos"])) : vue.createCommentVNode("", true),
|
|
8594
|
-
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9140
|
+
scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
|
|
8595
9141
|
key: 1,
|
|
8596
9142
|
"is-horizontal": true,
|
|
8597
9143
|
"scroll-size": scrollWidth.value,
|
|
@@ -8734,12 +9280,27 @@
|
|
|
8734
9280
|
return elCanSelect;
|
|
8735
9281
|
},
|
|
8736
9282
|
moveableOptions: stageOptions.moveableOptions,
|
|
8737
|
-
updateDragEl: stageOptions.updateDragEl
|
|
9283
|
+
updateDragEl: stageOptions.updateDragEl,
|
|
9284
|
+
guidesOptions: stageOptions.guidesOptions,
|
|
9285
|
+
disabledMultiSelect: stageOptions.disabledMultiSelect
|
|
8738
9286
|
});
|
|
9287
|
+
vue.watch(
|
|
9288
|
+
() => editorService.get("disabledMultiSelect"),
|
|
9289
|
+
(disabledMultiSelect) => {
|
|
9290
|
+
if (disabledMultiSelect) {
|
|
9291
|
+
stage.disableMultiSelect();
|
|
9292
|
+
} else {
|
|
9293
|
+
stage.enableMultiSelect();
|
|
9294
|
+
}
|
|
9295
|
+
}
|
|
9296
|
+
);
|
|
8739
9297
|
stage.mask.setGuides([
|
|
8740
9298
|
getGuideLineFromCache(getGuideLineKey(H_GUIDE_LINE_STORAGE_KEY)),
|
|
8741
9299
|
getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY))
|
|
8742
9300
|
]);
|
|
9301
|
+
stage.on("page-el-update", () => {
|
|
9302
|
+
editorService.set("stageLoading", false);
|
|
9303
|
+
});
|
|
8743
9304
|
stage.on("select", (el) => {
|
|
8744
9305
|
if (`${editorService.get("node")?.id}` === el.id && editorService.get("nodes").length === 1)
|
|
8745
9306
|
return;
|
|
@@ -8790,8 +9351,8 @@
|
|
|
8790
9351
|
return stage;
|
|
8791
9352
|
};
|
|
8792
9353
|
|
|
8793
|
-
const _hoisted_1$
|
|
8794
|
-
const _sfc_main$
|
|
9354
|
+
const _hoisted_1$3 = { class: "m-editor-float-box-body" };
|
|
9355
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
8795
9356
|
__name: "FloatingBox",
|
|
8796
9357
|
props: {
|
|
8797
9358
|
visible: { type: Boolean, default: false },
|
|
@@ -8891,7 +9452,7 @@
|
|
|
8891
9452
|
}, null, 8, ["icon"])
|
|
8892
9453
|
])
|
|
8893
9454
|
], 512),
|
|
8894
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
9455
|
+
vue.createElementVNode("div", _hoisted_1$3, [
|
|
8895
9456
|
vue.renderSlot(_ctx.$slots, "body")
|
|
8896
9457
|
])
|
|
8897
9458
|
], 4)
|
|
@@ -8900,7 +9461,7 @@
|
|
|
8900
9461
|
}
|
|
8901
9462
|
});
|
|
8902
9463
|
|
|
8903
|
-
const _sfc_main$
|
|
9464
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
8904
9465
|
__name: "NodeListMenu",
|
|
8905
9466
|
setup(__props) {
|
|
8906
9467
|
const services = vue.inject("services");
|
|
@@ -8921,13 +9482,13 @@
|
|
|
8921
9482
|
(stage2) => {
|
|
8922
9483
|
if (!stage2)
|
|
8923
9484
|
return;
|
|
9485
|
+
vue.nextTick(() => unWatch());
|
|
8924
9486
|
stage2.on("select", (el, event) => {
|
|
8925
9487
|
const els = stage2.renderer.getElementsFromPoint(event) || [];
|
|
8926
9488
|
const ids = els.map((el2) => el2.id).filter((id) => Boolean(id));
|
|
8927
9489
|
buttonVisible.value = ids.length > 3;
|
|
8928
9490
|
filterTextChangeHandler(ids);
|
|
8929
9491
|
});
|
|
8930
|
-
unWatch();
|
|
8931
9492
|
},
|
|
8932
9493
|
{
|
|
8933
9494
|
immediate: true
|
|
@@ -8982,7 +9543,7 @@
|
|
|
8982
9543
|
]),
|
|
8983
9544
|
_: 1
|
|
8984
9545
|
})) : vue.createCommentVNode("", true),
|
|
8985
|
-
page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9546
|
+
page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$7, {
|
|
8986
9547
|
key: 1,
|
|
8987
9548
|
ref_key: "box",
|
|
8988
9549
|
ref: box,
|
|
@@ -8992,7 +9553,7 @@
|
|
|
8992
9553
|
position: menuPosition.value
|
|
8993
9554
|
}, {
|
|
8994
9555
|
body: vue.withCtx(() => [
|
|
8995
|
-
vue.createVNode(_sfc_main$
|
|
9556
|
+
vue.createVNode(_sfc_main$m, {
|
|
8996
9557
|
class: "m-editor-node-list-menu magic-editor-layer-tree",
|
|
8997
9558
|
data: nodeData.value,
|
|
8998
9559
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
@@ -9006,12 +9567,12 @@
|
|
|
9006
9567
|
}
|
|
9007
9568
|
});
|
|
9008
9569
|
|
|
9009
|
-
const _hoisted_1$
|
|
9570
|
+
const _hoisted_1$2 = {
|
|
9010
9571
|
viewBox: "0 0 24 24",
|
|
9011
9572
|
fill: "none",
|
|
9012
9573
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9013
9574
|
};
|
|
9014
|
-
const _hoisted_2$
|
|
9575
|
+
const _hoisted_2$1 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
9015
9576
|
"fill-rule": "evenodd",
|
|
9016
9577
|
"clip-rule": "evenodd",
|
|
9017
9578
|
d: "M2 4H21V6H2V4Z",
|
|
@@ -9033,119 +9594,125 @@
|
|
|
9033
9594
|
"fill-opacity": "0.9"
|
|
9034
9595
|
}, null, -1);
|
|
9035
9596
|
const _hoisted_5 = [
|
|
9036
|
-
_hoisted_2$
|
|
9597
|
+
_hoisted_2$1,
|
|
9037
9598
|
_hoisted_3,
|
|
9038
9599
|
_hoisted_4
|
|
9039
9600
|
];
|
|
9040
|
-
const _sfc_main$
|
|
9601
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
9041
9602
|
...{
|
|
9042
9603
|
name: "MEditorCenterIcon"
|
|
9043
9604
|
},
|
|
9044
9605
|
__name: "CenterIcon",
|
|
9045
9606
|
setup(__props) {
|
|
9046
9607
|
return (_ctx, _cache) => {
|
|
9047
|
-
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$
|
|
9608
|
+
return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_5);
|
|
9048
9609
|
};
|
|
9049
9610
|
}
|
|
9050
9611
|
});
|
|
9051
9612
|
|
|
9052
|
-
const _sfc_main$
|
|
9613
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
9053
9614
|
...{
|
|
9054
9615
|
name: "MEditorViewerMenu"
|
|
9055
9616
|
},
|
|
9056
9617
|
__name: "ViewerMenu",
|
|
9057
9618
|
props: {
|
|
9058
9619
|
isMultiSelect: { type: Boolean, default: false },
|
|
9059
|
-
stageContentMenu: {}
|
|
9620
|
+
stageContentMenu: { default: () => [] },
|
|
9621
|
+
customContentMenu: { type: Function, default: (menus) => menus }
|
|
9060
9622
|
},
|
|
9061
9623
|
setup(__props, { expose: __expose }) {
|
|
9062
9624
|
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
|
-
|
|
9625
|
+
const services = vue.inject("services");
|
|
9626
|
+
const editorService = services?.editorService;
|
|
9627
|
+
const menu = vue.ref();
|
|
9628
|
+
const canCenter = vue.ref(false);
|
|
9629
|
+
const node = vue.computed(() => editorService?.get("node"));
|
|
9630
|
+
const nodes = vue.computed(() => editorService?.get("nodes"));
|
|
9631
|
+
const parent = vue.computed(() => editorService?.get("parent"));
|
|
9632
|
+
const menuData = vue.computed(
|
|
9633
|
+
() => props.customContentMenu(
|
|
9634
|
+
[
|
|
9635
|
+
{
|
|
9636
|
+
type: "button",
|
|
9637
|
+
text: "水平居中",
|
|
9638
|
+
icon: vue.markRaw(_sfc_main$5),
|
|
9639
|
+
display: () => canCenter.value,
|
|
9640
|
+
handler: () => {
|
|
9641
|
+
if (!nodes.value)
|
|
9642
|
+
return;
|
|
9643
|
+
editorService?.alignCenter(nodes.value);
|
|
9644
|
+
}
|
|
9645
|
+
},
|
|
9646
|
+
useCopyMenu(),
|
|
9647
|
+
usePasteMenu(menu),
|
|
9648
|
+
{
|
|
9649
|
+
type: "divider",
|
|
9650
|
+
direction: "horizontal",
|
|
9651
|
+
display: () => {
|
|
9652
|
+
if (!node.value)
|
|
9653
|
+
return false;
|
|
9654
|
+
return !utils.isPage(node.value) && !utils.isPageFragment(node.value);
|
|
9655
|
+
}
|
|
9656
|
+
},
|
|
9657
|
+
{
|
|
9658
|
+
type: "button",
|
|
9659
|
+
text: "上移一层",
|
|
9660
|
+
icon: vue.markRaw(iconsVue.Top),
|
|
9661
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9662
|
+
handler: () => {
|
|
9663
|
+
editorService?.moveLayer(1);
|
|
9664
|
+
}
|
|
9665
|
+
},
|
|
9666
|
+
{
|
|
9667
|
+
type: "button",
|
|
9668
|
+
text: "下移一层",
|
|
9669
|
+
icon: vue.markRaw(iconsVue.Bottom),
|
|
9670
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9671
|
+
handler: () => {
|
|
9672
|
+
editorService?.moveLayer(-1);
|
|
9673
|
+
}
|
|
9674
|
+
},
|
|
9675
|
+
{
|
|
9676
|
+
type: "button",
|
|
9677
|
+
text: "置顶",
|
|
9678
|
+
icon: vue.markRaw(iconsVue.Top),
|
|
9679
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9680
|
+
handler: () => {
|
|
9681
|
+
editorService?.moveLayer(LayerOffset.TOP);
|
|
9682
|
+
}
|
|
9683
|
+
},
|
|
9684
|
+
{
|
|
9685
|
+
type: "button",
|
|
9686
|
+
text: "置底",
|
|
9687
|
+
icon: vue.markRaw(iconsVue.Bottom),
|
|
9688
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect,
|
|
9689
|
+
handler: () => {
|
|
9690
|
+
editorService?.moveLayer(LayerOffset.BOTTOM);
|
|
9691
|
+
}
|
|
9692
|
+
},
|
|
9693
|
+
useMoveToMenu(services),
|
|
9694
|
+
{
|
|
9695
|
+
type: "divider",
|
|
9696
|
+
direction: "horizontal",
|
|
9697
|
+
display: () => !utils.isPage(node.value) && !utils.isPageFragment(node.value) && !props.isMultiSelect
|
|
9698
|
+
},
|
|
9699
|
+
useDeleteMenu(),
|
|
9700
|
+
{
|
|
9701
|
+
type: "divider",
|
|
9702
|
+
direction: "horizontal"
|
|
9703
|
+
},
|
|
9704
|
+
{
|
|
9705
|
+
type: "button",
|
|
9706
|
+
text: "清空参考线",
|
|
9707
|
+
handler: () => {
|
|
9708
|
+
editorService?.get("stage")?.clearGuides();
|
|
9709
|
+
}
|
|
9710
|
+
},
|
|
9711
|
+
...props.stageContentMenu
|
|
9712
|
+
],
|
|
9713
|
+
"viewer"
|
|
9714
|
+
)
|
|
9715
|
+
);
|
|
9149
9716
|
vue.watch(
|
|
9150
9717
|
parent,
|
|
9151
9718
|
async () => {
|
|
@@ -9165,7 +9732,7 @@
|
|
|
9165
9732
|
};
|
|
9166
9733
|
__expose({ show });
|
|
9167
9734
|
return (_ctx, _cache) => {
|
|
9168
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9735
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
9169
9736
|
"menu-data": menuData.value,
|
|
9170
9737
|
ref_key: "menu",
|
|
9171
9738
|
ref: menu
|
|
@@ -9174,13 +9741,14 @@
|
|
|
9174
9741
|
}
|
|
9175
9742
|
});
|
|
9176
9743
|
|
|
9177
|
-
const _sfc_main$
|
|
9744
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
9178
9745
|
...{
|
|
9179
9746
|
name: "MEditorStage"
|
|
9180
9747
|
},
|
|
9181
9748
|
__name: "Stage",
|
|
9182
9749
|
props: {
|
|
9183
|
-
stageContentMenu: {}
|
|
9750
|
+
stageContentMenu: {},
|
|
9751
|
+
customContentMenu: { type: Function }
|
|
9184
9752
|
},
|
|
9185
9753
|
setup(__props) {
|
|
9186
9754
|
let stage = null;
|
|
@@ -9229,6 +9797,7 @@
|
|
|
9229
9797
|
});
|
|
9230
9798
|
vue.watch(page, (page2) => {
|
|
9231
9799
|
if (runtime && page2) {
|
|
9800
|
+
services?.editorService.set("stageLoading", true);
|
|
9232
9801
|
runtime.updatePageId?.(page2.id);
|
|
9233
9802
|
vue.nextTick(() => {
|
|
9234
9803
|
stage?.select(page2.id);
|
|
@@ -9252,14 +9821,14 @@
|
|
|
9252
9821
|
vue.onMounted(() => {
|
|
9253
9822
|
if (stageWrap.value?.container) {
|
|
9254
9823
|
resizeObserver.observe(stageWrap.value.container);
|
|
9255
|
-
services?.keybindingService.
|
|
9824
|
+
services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrap.value.container);
|
|
9256
9825
|
}
|
|
9257
9826
|
});
|
|
9258
|
-
vue.
|
|
9827
|
+
vue.onBeforeUnmount(() => {
|
|
9259
9828
|
stage?.destroy();
|
|
9260
9829
|
resizeObserver.disconnect();
|
|
9261
9830
|
services?.editorService.set("stage", null);
|
|
9262
|
-
services?.keybindingService.
|
|
9831
|
+
services?.keybindingService.unregisterEl("stage");
|
|
9263
9832
|
services?.editorService.off("root-change", rootChangeHandler);
|
|
9264
9833
|
});
|
|
9265
9834
|
const parseDSL = getConfig("parseDSL");
|
|
@@ -9322,7 +9891,7 @@
|
|
|
9322
9891
|
}
|
|
9323
9892
|
};
|
|
9324
9893
|
return (_ctx, _cache) => {
|
|
9325
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9894
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$8, {
|
|
9326
9895
|
class: "m-editor-stage",
|
|
9327
9896
|
ref_key: "stageWrap",
|
|
9328
9897
|
ref: stageWrap,
|
|
@@ -9348,14 +9917,15 @@
|
|
|
9348
9917
|
onDrop: dropHandler,
|
|
9349
9918
|
onDragover: dragoverHandler
|
|
9350
9919
|
}, null, 36),
|
|
9351
|
-
vue.createVNode(_sfc_main$
|
|
9920
|
+
vue.createVNode(_sfc_main$6),
|
|
9352
9921
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
9353
|
-
vue.createVNode(_sfc_main$
|
|
9922
|
+
vue.createVNode(_sfc_main$4, {
|
|
9354
9923
|
ref_key: "menu",
|
|
9355
9924
|
ref: menu,
|
|
9356
9925
|
"is-multi-select": isMultiSelect.value,
|
|
9357
|
-
"stage-content-menu": _ctx.stageContentMenu
|
|
9358
|
-
|
|
9926
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
9927
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
9928
|
+
}, null, 8, ["is-multi-select", "stage-content-menu", "custom-content-menu"])
|
|
9359
9929
|
]))
|
|
9360
9930
|
]),
|
|
9361
9931
|
_: 1
|
|
@@ -9364,12 +9934,12 @@
|
|
|
9364
9934
|
}
|
|
9365
9935
|
});
|
|
9366
9936
|
|
|
9367
|
-
const _hoisted_1$
|
|
9937
|
+
const _hoisted_1$1 = {
|
|
9368
9938
|
key: 0,
|
|
9369
9939
|
class: "m-editor-breadcrumb"
|
|
9370
9940
|
};
|
|
9371
|
-
const _hoisted_2
|
|
9372
|
-
const _sfc_main$
|
|
9941
|
+
const _hoisted_2 = { key: 0 };
|
|
9942
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
9373
9943
|
...{
|
|
9374
9944
|
name: "MEditorBreadcrumb"
|
|
9375
9945
|
},
|
|
@@ -9386,7 +9956,7 @@
|
|
|
9386
9956
|
editorService?.get("stage")?.select(node2.id);
|
|
9387
9957
|
};
|
|
9388
9958
|
return (_ctx, _cache) => {
|
|
9389
|
-
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
9959
|
+
return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
9390
9960
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(path.value, (item, index) => {
|
|
9391
9961
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
9392
9962
|
key: item.id
|
|
@@ -9401,7 +9971,7 @@
|
|
|
9401
9971
|
]),
|
|
9402
9972
|
_: 2
|
|
9403
9973
|
}, 1032, ["disabled", "onClick"]),
|
|
9404
|
-
index < path.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2
|
|
9974
|
+
index < path.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, "/")) : vue.createCommentVNode("", true)
|
|
9405
9975
|
], 64);
|
|
9406
9976
|
}), 128))
|
|
9407
9977
|
])) : vue.createCommentVNode("", true);
|
|
@@ -9409,223 +9979,6 @@
|
|
|
9409
9979
|
}
|
|
9410
9980
|
});
|
|
9411
9981
|
|
|
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
9982
|
const _hoisted_1 = { class: "m-editor-workspace" };
|
|
9630
9983
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
9631
9984
|
...{
|
|
@@ -9633,30 +9986,23 @@
|
|
|
9633
9986
|
},
|
|
9634
9987
|
__name: "Workspace",
|
|
9635
9988
|
props: {
|
|
9636
|
-
stageContentMenu: {}
|
|
9989
|
+
stageContentMenu: {},
|
|
9990
|
+
customContentMenu: { type: Function }
|
|
9637
9991
|
},
|
|
9638
9992
|
setup(__props) {
|
|
9639
9993
|
const services = vue.inject("services");
|
|
9640
9994
|
const page = vue.computed(() => services?.editorService.get("page"));
|
|
9641
9995
|
return (_ctx, _cache) => {
|
|
9642
9996
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
9643
|
-
vue.createVNode(_sfc_main$
|
|
9997
|
+
vue.createVNode(_sfc_main$2),
|
|
9644
9998
|
vue.renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
9645
|
-
page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9999
|
+
page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$3, {
|
|
9646
10000
|
key: 0,
|
|
9647
|
-
"stage-content-menu": _ctx.stageContentMenu
|
|
9648
|
-
|
|
10001
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
10002
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
10003
|
+
}, null, 8, ["stage-content-menu", "custom-content-menu"])) : vue.createCommentVNode("", true)
|
|
9649
10004
|
]),
|
|
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
|
-
})
|
|
10005
|
+
vue.renderSlot(_ctx.$slots, "workspace-content")
|
|
9660
10006
|
]);
|
|
9661
10007
|
};
|
|
9662
10008
|
}
|
|
@@ -9940,7 +10286,7 @@
|
|
|
9940
10286
|
commands = {
|
|
9941
10287
|
[KeyBindingCommand.DELETE_NODE]: () => {
|
|
9942
10288
|
const nodes = editorService.get("nodes");
|
|
9943
|
-
if (!nodes || utils.isPage(nodes[0]))
|
|
10289
|
+
if (!nodes || utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))
|
|
9944
10290
|
return;
|
|
9945
10291
|
editorService.remove(nodes);
|
|
9946
10292
|
},
|
|
@@ -9950,7 +10296,7 @@
|
|
|
9950
10296
|
},
|
|
9951
10297
|
[KeyBindingCommand.CUT_NODE]: () => {
|
|
9952
10298
|
const nodes = editorService.get("nodes");
|
|
9953
|
-
if (!nodes || utils.isPage(nodes[0]))
|
|
10299
|
+
if (!nodes || utils.isPage(nodes[0]) || utils.isPageFragment(nodes[0]))
|
|
9954
10300
|
return;
|
|
9955
10301
|
editorService.copy(nodes);
|
|
9956
10302
|
editorService.remove(nodes);
|
|
@@ -10005,13 +10351,25 @@
|
|
|
10005
10351
|
editorService.selectNextNode();
|
|
10006
10352
|
}
|
|
10007
10353
|
};
|
|
10008
|
-
|
|
10354
|
+
registerCommand(command, handler) {
|
|
10009
10355
|
this.commands[command] = handler;
|
|
10010
10356
|
}
|
|
10011
|
-
|
|
10357
|
+
/**
|
|
10358
|
+
* @deprecated
|
|
10359
|
+
*/
|
|
10360
|
+
registeCommand(command, handler) {
|
|
10361
|
+
this.registerCommand(command, handler);
|
|
10362
|
+
}
|
|
10363
|
+
unregisterCommand(command) {
|
|
10012
10364
|
delete this.commands[command];
|
|
10013
10365
|
}
|
|
10014
|
-
|
|
10366
|
+
/**
|
|
10367
|
+
* @deprecated
|
|
10368
|
+
*/
|
|
10369
|
+
unregisteCommand(command) {
|
|
10370
|
+
this.unregisterCommand(command);
|
|
10371
|
+
}
|
|
10372
|
+
registerEl(name, el) {
|
|
10015
10373
|
if (name !== "global" && !el) {
|
|
10016
10374
|
throw new Error("只有name为global可以不传el");
|
|
10017
10375
|
}
|
|
@@ -10019,23 +10377,41 @@
|
|
|
10019
10377
|
this.controllers.set(name, keycon);
|
|
10020
10378
|
this.bind(name);
|
|
10021
10379
|
}
|
|
10022
|
-
|
|
10380
|
+
/**
|
|
10381
|
+
* @deprecated
|
|
10382
|
+
*/
|
|
10383
|
+
registeEl(name, el) {
|
|
10384
|
+
this.registerEl(name, el);
|
|
10385
|
+
}
|
|
10386
|
+
unregisterEl(name) {
|
|
10023
10387
|
this.controllers.get(name)?.destroy();
|
|
10024
10388
|
this.controllers.delete(name);
|
|
10025
10389
|
this.bindingList.forEach((item) => {
|
|
10026
|
-
item.
|
|
10390
|
+
item.bound = false;
|
|
10027
10391
|
});
|
|
10028
10392
|
}
|
|
10029
|
-
|
|
10393
|
+
/**
|
|
10394
|
+
* @deprecated
|
|
10395
|
+
*/
|
|
10396
|
+
unregisteEl(name) {
|
|
10397
|
+
this.unregisterEl(name);
|
|
10398
|
+
}
|
|
10399
|
+
register(maps) {
|
|
10030
10400
|
for (const keybindingItem of maps) {
|
|
10031
10401
|
const { command, keybinding, when } = keybindingItem;
|
|
10032
10402
|
for (const [type = "", eventType = "keydown"] of when) {
|
|
10033
|
-
const cacheItem = { type, command, keybinding, eventType,
|
|
10403
|
+
const cacheItem = { type, command, keybinding, eventType, bound: false };
|
|
10034
10404
|
this.bindingList.push(cacheItem);
|
|
10035
10405
|
}
|
|
10036
10406
|
}
|
|
10037
10407
|
this.bind();
|
|
10038
10408
|
}
|
|
10409
|
+
/**
|
|
10410
|
+
* @deprecated
|
|
10411
|
+
*/
|
|
10412
|
+
registe(map) {
|
|
10413
|
+
this.register(map);
|
|
10414
|
+
}
|
|
10039
10415
|
reset() {
|
|
10040
10416
|
this.controllers.forEach((keycon) => {
|
|
10041
10417
|
keycon.destroy();
|
|
@@ -10048,11 +10424,11 @@
|
|
|
10048
10424
|
}
|
|
10049
10425
|
bind(name) {
|
|
10050
10426
|
for (const item of this.bindingList) {
|
|
10051
|
-
const { type, eventType, command, keybinding,
|
|
10427
|
+
const { type, eventType, command, keybinding, bound } = item;
|
|
10052
10428
|
if (name && name !== type) {
|
|
10053
10429
|
continue;
|
|
10054
10430
|
}
|
|
10055
|
-
if (
|
|
10431
|
+
if (bound) {
|
|
10056
10432
|
continue;
|
|
10057
10433
|
}
|
|
10058
10434
|
const keycon = this.controllers.get(type);
|
|
@@ -10070,7 +10446,7 @@
|
|
|
10070
10446
|
keycon[eventType](handler);
|
|
10071
10447
|
}
|
|
10072
10448
|
});
|
|
10073
|
-
item.
|
|
10449
|
+
item.bound = true;
|
|
10074
10450
|
}
|
|
10075
10451
|
}
|
|
10076
10452
|
getKeyconKeys(keybinding = "") {
|
|
@@ -10100,7 +10476,9 @@
|
|
|
10100
10476
|
containerHighlightDuration: 800,
|
|
10101
10477
|
containerHighlightType: StageCore.ContainerHighlightType.DEFAULT,
|
|
10102
10478
|
codeOptions: () => ({}),
|
|
10103
|
-
renderType: StageCore.RenderType.IFRAME
|
|
10479
|
+
renderType: StageCore.RenderType.IFRAME,
|
|
10480
|
+
disabledMultiSelect: false,
|
|
10481
|
+
disabledPageFragment: false
|
|
10104
10482
|
};
|
|
10105
10483
|
|
|
10106
10484
|
const initServiceState = (props, {
|
|
@@ -10123,6 +10501,15 @@
|
|
|
10123
10501
|
immediate: true
|
|
10124
10502
|
}
|
|
10125
10503
|
);
|
|
10504
|
+
vue.watch(
|
|
10505
|
+
() => props.disabledMultiSelect,
|
|
10506
|
+
(disabledMultiSelect) => {
|
|
10507
|
+
editorService.set("disabledMultiSelect", disabledMultiSelect || false);
|
|
10508
|
+
},
|
|
10509
|
+
{
|
|
10510
|
+
immediate: true
|
|
10511
|
+
}
|
|
10512
|
+
);
|
|
10126
10513
|
vue.watch(
|
|
10127
10514
|
() => props.componentGroupList,
|
|
10128
10515
|
(componentGroupList) => componentGroupList && componentListService.setList(componentGroupList),
|
|
@@ -10223,7 +10610,7 @@
|
|
|
10223
10610
|
immediate: true
|
|
10224
10611
|
}
|
|
10225
10612
|
);
|
|
10226
|
-
vue.
|
|
10613
|
+
vue.onBeforeUnmount(() => {
|
|
10227
10614
|
editorService.resetState();
|
|
10228
10615
|
historyService.resetState();
|
|
10229
10616
|
propsService.resetState();
|
|
@@ -10407,7 +10794,7 @@
|
|
|
10407
10794
|
if (props.collectorOptions && !depService.hasTarget(dep.DepTargetType.RELATED_COMP_WHEN_COPY)) {
|
|
10408
10795
|
depService.addTarget(dep.createRelatedCompTarget(props.collectorOptions));
|
|
10409
10796
|
}
|
|
10410
|
-
vue.
|
|
10797
|
+
vue.onBeforeUnmount(() => {
|
|
10411
10798
|
depService.off("add-target", targetAddHandler);
|
|
10412
10799
|
depService.off("remove-target", targetRemoveHandler);
|
|
10413
10800
|
depService.off("dep-update", depUpdateHandler);
|
|
@@ -10460,9 +10847,13 @@
|
|
|
10460
10847
|
updateDragEl: { type: Function },
|
|
10461
10848
|
disabledDragStart: { type: Boolean },
|
|
10462
10849
|
extendFormState: { type: Function },
|
|
10463
|
-
collectorOptions: {}
|
|
10850
|
+
collectorOptions: {},
|
|
10851
|
+
guidesOptions: {},
|
|
10852
|
+
disabledMultiSelect: { type: Boolean },
|
|
10853
|
+
disabledPageFragment: { type: Boolean },
|
|
10854
|
+
customContentMenu: { type: Function }
|
|
10464
10855
|
}, defaultEditorProps),
|
|
10465
|
-
emits: ["props-panel-mounted", "update:modelValue"],
|
|
10856
|
+
emits: ["props-panel-mounted", "update:modelValue", "props-form-error", "props-submit-error"],
|
|
10466
10857
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
10467
10858
|
const emit = __emit;
|
|
10468
10859
|
const props = __props;
|
|
@@ -10481,8 +10872,8 @@
|
|
|
10481
10872
|
};
|
|
10482
10873
|
initServiceEvents(props, emit, services);
|
|
10483
10874
|
initServiceState(props, services);
|
|
10484
|
-
keybindingService.
|
|
10485
|
-
keybindingService.
|
|
10875
|
+
keybindingService.register(keybindingConfig);
|
|
10876
|
+
keybindingService.registerEl("global");
|
|
10486
10877
|
vue.provide("services", services);
|
|
10487
10878
|
vue.provide("codeOptions", props.codeOptions);
|
|
10488
10879
|
vue.provide(
|
|
@@ -10499,18 +10890,20 @@
|
|
|
10499
10890
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
10500
10891
|
containerHighlightType: props.containerHighlightType,
|
|
10501
10892
|
disabledDragStart: props.disabledDragStart,
|
|
10502
|
-
renderType: props.renderType
|
|
10893
|
+
renderType: props.renderType,
|
|
10894
|
+
guidesOptions: props.guidesOptions,
|
|
10895
|
+
disabledMultiSelect: props.disabledMultiSelect
|
|
10503
10896
|
})
|
|
10504
10897
|
);
|
|
10505
10898
|
__expose(services);
|
|
10506
10899
|
return (_ctx, _cache) => {
|
|
10507
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
10900
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$r, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
10508
10901
|
header: vue.withCtx(() => [
|
|
10509
10902
|
vue.renderSlot(_ctx.$slots, "header")
|
|
10510
10903
|
]),
|
|
10511
10904
|
nav: vue.withCtx(() => [
|
|
10512
10905
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: vue.unref(editorService) }, () => [
|
|
10513
|
-
vue.createVNode(_sfc_main$
|
|
10906
|
+
vue.createVNode(_sfc_main$q, { data: _ctx.menu }, null, 8, ["data"])
|
|
10514
10907
|
])
|
|
10515
10908
|
]),
|
|
10516
10909
|
"content-before": vue.withCtx(() => [
|
|
@@ -10521,9 +10914,10 @@
|
|
|
10521
10914
|
]),
|
|
10522
10915
|
sidebar: vue.withCtx(() => [
|
|
10523
10916
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: vue.unref(editorService) }, () => [
|
|
10524
|
-
vue.createVNode(_sfc_main$
|
|
10917
|
+
vue.createVNode(_sfc_main$a, {
|
|
10525
10918
|
data: _ctx.sidebar,
|
|
10526
|
-
"layer-content-menu": _ctx.layerContentMenu
|
|
10919
|
+
"layer-content-menu": _ctx.layerContentMenu,
|
|
10920
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
10527
10921
|
}, {
|
|
10528
10922
|
"layer-panel-header": vue.withCtx(() => [
|
|
10529
10923
|
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
@@ -10556,33 +10950,32 @@
|
|
|
10556
10950
|
vue.renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
10557
10951
|
]),
|
|
10558
10952
|
_: 3
|
|
10559
|
-
}, 8, ["data", "layer-content-menu"])
|
|
10953
|
+
}, 8, ["data", "layer-content-menu", "custom-content-menu"])
|
|
10560
10954
|
])
|
|
10561
10955
|
]),
|
|
10562
10956
|
workspace: vue.withCtx(() => [
|
|
10563
10957
|
vue.renderSlot(_ctx.$slots, "workspace", { editorService: vue.unref(editorService) }, () => [
|
|
10564
|
-
vue.createVNode(_sfc_main$1, {
|
|
10958
|
+
vue.createVNode(_sfc_main$1, {
|
|
10959
|
+
"stage-content-menu": _ctx.stageContentMenu,
|
|
10960
|
+
"custom-content-menu": _ctx.customContentMenu
|
|
10961
|
+
}, {
|
|
10565
10962
|
stage: vue.withCtx(() => [
|
|
10566
10963
|
vue.renderSlot(_ctx.$slots, "stage")
|
|
10567
10964
|
]),
|
|
10568
10965
|
"workspace-content": vue.withCtx(() => [
|
|
10569
10966
|
vue.renderSlot(_ctx.$slots, "workspace-content", { editorService: vue.unref(editorService) })
|
|
10570
10967
|
]),
|
|
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
10968
|
_: 3
|
|
10578
|
-
}, 8, ["stage-content-menu"])
|
|
10969
|
+
}, 8, ["stage-content-menu", "custom-content-menu"])
|
|
10579
10970
|
])
|
|
10580
10971
|
]),
|
|
10581
10972
|
"props-panel": vue.withCtx(() => [
|
|
10582
10973
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
10583
|
-
vue.createVNode(_sfc_main$
|
|
10974
|
+
vue.createVNode(_sfc_main$p, {
|
|
10584
10975
|
"extend-state": _ctx.extendFormState,
|
|
10585
|
-
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
10976
|
+
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance)),
|
|
10977
|
+
onFormError: _cache[1] || (_cache[1] = (e) => _ctx.$emit("props-form-error", e)),
|
|
10978
|
+
onSubmitError: _cache[2] || (_cache[2] = (e) => _ctx.$emit("props-submit-error", e))
|
|
10586
10979
|
}, {
|
|
10587
10980
|
"props-panel-header": vue.withCtx(() => [
|
|
10588
10981
|
vue.renderSlot(_ctx.$slots, "props-panel-header")
|
|
@@ -10600,8 +10993,17 @@
|
|
|
10600
10993
|
footer: vue.withCtx(() => [
|
|
10601
10994
|
vue.renderSlot(_ctx.$slots, "footer")
|
|
10602
10995
|
]),
|
|
10996
|
+
"page-bar": vue.withCtx(() => [
|
|
10997
|
+
vue.renderSlot(_ctx.$slots, "page-bar")
|
|
10998
|
+
]),
|
|
10999
|
+
"page-bar-title": vue.withCtx(({ page }) => [
|
|
11000
|
+
vue.renderSlot(_ctx.$slots, "page-bar-title", { page })
|
|
11001
|
+
]),
|
|
11002
|
+
"page-bar-popover": vue.withCtx(({ page }) => [
|
|
11003
|
+
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page })
|
|
11004
|
+
]),
|
|
10603
11005
|
_: 3
|
|
10604
|
-
});
|
|
11006
|
+
}, 8, ["disabled-page-fragment"]);
|
|
10605
11007
|
};
|
|
10606
11008
|
}
|
|
10607
11009
|
});
|
|
@@ -10616,21 +11018,22 @@
|
|
|
10616
11018
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
10617
11019
|
setConfig(option);
|
|
10618
11020
|
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$
|
|
11021
|
+
app.component("m-fields-ui-select", _sfc_main$A);
|
|
11022
|
+
app.component("m-fields-code-link", _sfc_main$R);
|
|
11023
|
+
app.component("m-fields-vs-code", _sfc_main$S);
|
|
11024
|
+
app.component("magic-code-editor", _sfc_main$T);
|
|
11025
|
+
app.component("m-fields-code-select", _sfc_main$Q);
|
|
11026
|
+
app.component("m-fields-code-select-col", _sfc_main$M);
|
|
11027
|
+
app.component("m-fields-event-select", _sfc_main$E);
|
|
11028
|
+
app.component("m-fields-data-source-fields", _sfc_main$L);
|
|
11029
|
+
app.component("m-fields-data-source-mocks", _sfc_main$G);
|
|
11030
|
+
app.component("m-fields-key-value", _sfc_main$C);
|
|
11031
|
+
app.component("m-fields-data-source-input", _sfc_main$J);
|
|
11032
|
+
app.component("m-fields-data-source-select", _sfc_main$F);
|
|
11033
|
+
app.component("m-fields-data-source-methods", _sfc_main$I);
|
|
11034
|
+
app.component("m-fields-data-source-method-select", _sfc_main$H);
|
|
11035
|
+
app.component("m-fields-data-source-field-select", _sfc_main$K);
|
|
11036
|
+
app.component("m-fields-page-fragment-select", _sfc_main$B);
|
|
10634
11037
|
}
|
|
10635
11038
|
};
|
|
10636
11039
|
|
|
@@ -10640,40 +11043,41 @@
|
|
|
10640
11043
|
});
|
|
10641
11044
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
10642
11045
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
10643
|
-
exports.CodeBlockEditor = _sfc_main$
|
|
10644
|
-
exports.CodeBlockList = _sfc_main$
|
|
10645
|
-
exports.CodeBlockListPanel = _sfc_main$
|
|
11046
|
+
exports.CodeBlockEditor = _sfc_main$P;
|
|
11047
|
+
exports.CodeBlockList = _sfc_main$l;
|
|
11048
|
+
exports.CodeBlockListPanel = _sfc_main$k;
|
|
10646
11049
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
10647
|
-
exports.CodeSelect = _sfc_main$
|
|
10648
|
-
exports.CodeSelectCol = _sfc_main$
|
|
11050
|
+
exports.CodeSelect = _sfc_main$Q;
|
|
11051
|
+
exports.CodeSelectCol = _sfc_main$M;
|
|
10649
11052
|
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$
|
|
11053
|
+
exports.ComponentListPanel = _sfc_main$b;
|
|
11054
|
+
exports.ContentMenu = _sfc_main$g;
|
|
11055
|
+
exports.DataSourceFieldSelect = _sfc_main$K;
|
|
11056
|
+
exports.DataSourceFields = _sfc_main$L;
|
|
11057
|
+
exports.DataSourceInput = _sfc_main$J;
|
|
11058
|
+
exports.DataSourceMethodSelect = _sfc_main$H;
|
|
11059
|
+
exports.DataSourceMethods = _sfc_main$I;
|
|
11060
|
+
exports.DataSourceMocks = _sfc_main$G;
|
|
11061
|
+
exports.DataSourceSelect = _sfc_main$F;
|
|
10659
11062
|
exports.DragType = DragType;
|
|
10660
|
-
exports.EventSelect = _sfc_main$
|
|
11063
|
+
exports.EventSelect = _sfc_main$E;
|
|
10661
11064
|
exports.Fixed2Other = Fixed2Other;
|
|
10662
11065
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
10663
|
-
exports.Icon = _sfc_main$
|
|
11066
|
+
exports.Icon = _sfc_main$N;
|
|
10664
11067
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
10665
|
-
exports.KeyValue = _sfc_main$
|
|
11068
|
+
exports.KeyValue = _sfc_main$C;
|
|
10666
11069
|
exports.Keys = Keys;
|
|
10667
11070
|
exports.LayerOffset = LayerOffset;
|
|
10668
|
-
exports.LayerPanel = _sfc_main$
|
|
11071
|
+
exports.LayerPanel = _sfc_main$c;
|
|
10669
11072
|
exports.Layout = Layout;
|
|
10670
|
-
exports.LayoutContainer = _sfc_main$
|
|
10671
|
-
exports.
|
|
10672
|
-
exports.
|
|
10673
|
-
exports.
|
|
10674
|
-
exports.
|
|
11073
|
+
exports.LayoutContainer = _sfc_main$y;
|
|
11074
|
+
exports.PageFragmentSelect = _sfc_main$B;
|
|
11075
|
+
exports.PropsPanel = _sfc_main$p;
|
|
11076
|
+
exports.Resizer = _sfc_main$z;
|
|
11077
|
+
exports.SplitView = _sfc_main$y;
|
|
11078
|
+
exports.TMagicCodeEditor = _sfc_main$T;
|
|
10675
11079
|
exports.TMagicEditor = _sfc_main;
|
|
10676
|
-
exports.ToolButton = _sfc_main$
|
|
11080
|
+
exports.ToolButton = _sfc_main$x;
|
|
10677
11081
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
10678
11082
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
10679
11083
|
exports.advancedTabConfig = advancedTabConfig;
|
|
@@ -10703,6 +11107,7 @@
|
|
|
10703
11107
|
exports.getGuideLineFromCache = getGuideLineFromCache;
|
|
10704
11108
|
exports.getInitPositionStyle = getInitPositionStyle;
|
|
10705
11109
|
exports.getNodeIndex = getNodeIndex;
|
|
11110
|
+
exports.getPageFragmentList = getPageFragmentList;
|
|
10706
11111
|
exports.getPageList = getPageList;
|
|
10707
11112
|
exports.getPageNameList = getPageNameList;
|
|
10708
11113
|
exports.getPositionInContainer = getPositionInContainer;
|
|
@@ -10713,7 +11118,7 @@
|
|
|
10713
11118
|
exports.log = log;
|
|
10714
11119
|
exports.propsService = propsService;
|
|
10715
11120
|
exports.serializeConfig = serializeConfig;
|
|
10716
|
-
exports.
|
|
11121
|
+
exports.setChildrenLayout = setChildrenLayout;
|
|
10717
11122
|
exports.setConfig = setConfig;
|
|
10718
11123
|
exports.setLayout = setLayout;
|
|
10719
11124
|
exports.storageService = storageService;
|