@tmagic/editor 1.5.0-beta.1 → 1.5.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +276 -3
- package/dist/tmagic-editor.js +268 -218
- package/dist/tmagic-editor.umd.cjs +496 -421
- package/package.json +13 -14
- package/src/Editor.vue +18 -4
- package/src/components/CodeBlockEditor.vue +5 -5
- package/src/components/SearchInput.vue +1 -0
- package/src/components/Tree.vue +10 -2
- package/src/components/TreeNode.vue +4 -2
- package/src/editorProps.ts +6 -3
- package/src/fields/CodeLink.vue +2 -2
- package/src/fields/CodeSelect.vue +1 -1
- package/src/fields/CodeSelectCol.vue +1 -1
- package/src/fields/CondOpSelect.vue +1 -1
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +2 -8
- package/src/fields/DataSourceFieldSelect/Index.vue +2 -2
- package/src/fields/DataSourceFields.vue +1 -1
- package/src/fields/DataSourceInput.vue +4 -4
- package/src/fields/DataSourceMethodSelect.vue +1 -1
- package/src/fields/DataSourceMethods.vue +1 -1
- package/src/fields/DataSourceMocks.vue +1 -1
- package/src/fields/DisplayConds.vue +1 -1
- package/src/fields/EventSelect.vue +4 -4
- package/src/fields/PageFragmentSelect.vue +1 -1
- package/src/fields/UISelect.vue +1 -1
- package/src/hooks/use-code-block-edit.ts +1 -1
- package/src/hooks/use-data-source-edit.ts +1 -1
- package/src/hooks/use-data-source-method.ts +3 -3
- package/src/hooks/use-filter.ts +2 -2
- package/src/hooks/use-node-status.ts +3 -3
- package/src/hooks/use-stage.ts +2 -2
- package/src/index.ts +28 -8
- package/src/initService.ts +17 -10
- package/src/layouts/AddPageBox.vue +1 -1
- package/src/layouts/CodeEditor.vue +5 -5
- package/src/layouts/Framework.vue +2 -2
- package/src/layouts/NavMenu.vue +1 -1
- package/src/layouts/PropsPanel.vue +1 -1
- package/src/layouts/page-bar/AddButton.vue +1 -1
- package/src/layouts/page-bar/PageBar.vue +8 -2
- package/src/layouts/page-bar/PageBarScrollContainer.vue +1 -1
- package/src/layouts/page-bar/PageList.vue +8 -2
- package/src/layouts/page-bar/SwitchTypeButton.vue +1 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +1 -1
- package/src/layouts/sidebar/Sidebar.vue +13 -1
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +11 -3
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +11 -2
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +1 -1
- package/src/layouts/sidebar/data-source/DataSourceList.vue +13 -3
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +19 -2
- package/src/layouts/sidebar/layer/LayerNodeTool.vue +1 -1
- package/src/layouts/sidebar/layer/LayerPanel.vue +5 -1
- package/src/layouts/sidebar/layer/use-click.ts +1 -1
- package/src/layouts/sidebar/layer/use-drag.ts +1 -1
- package/src/layouts/sidebar/layer/use-node-status.ts +3 -4
- package/src/layouts/workspace/Breadcrumb.vue +1 -1
- package/src/layouts/workspace/viewer/NodeListMenu.vue +2 -2
- package/src/layouts/workspace/viewer/Stage.vue +9 -5
- package/src/layouts/workspace/viewer/StageOverlay.vue +9 -4
- package/src/layouts/workspace/viewer/ViewerMenu.vue +1 -1
- package/src/services/codeBlock.ts +7 -7
- package/src/services/dataSource.ts +3 -4
- package/src/services/dep.ts +2 -2
- package/src/services/editor.ts +10 -11
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +3 -3
- package/src/services/stageOverlay.ts +15 -7
- package/src/services/storage.ts +2 -2
- package/src/theme/index.scss +3 -0
- package/src/theme/page-bar.scss +2 -1
- package/src/type.ts +14 -11
- package/src/utils/config.ts +5 -5
- package/src/utils/content-menu.ts +3 -3
- package/src/utils/data-source/index.ts +1 -1
- package/src/utils/editor.ts +13 -35
- package/src/utils/operator.ts +2 -1
- package/src/utils/props.ts +1 -1
- package/src/utils/tree.ts +1 -1
- package/types/index.d.ts +1554 -3130
package/dist/tmagic-editor.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
+
import designPlugin__default, { TMagicIcon, TMagicButton, TMagicCard, getDesignConfig, TMagicSelect, useZIndex, tMagicMessage, tMagicMessageBox, TMagicCascader, TMagicTooltip, TMagicTag, TMagicDialog, TMagicSwitch, TMagicInput, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, TMagicPopover, TMagicScrollbar, TMagicCollapse, TMagicCollapseItem } from '@tmagic/design';
|
|
2
|
+
export * from '@tmagic/design';
|
|
3
|
+
export { default as designPlugin } from '@tmagic/design';
|
|
4
|
+
import formPlugin__default, { MContainer, MForm, filterFunction, createValues, MFormBox, MSelect, MGroupList, MPanel } from '@tmagic/form';
|
|
5
|
+
export * from '@tmagic/form';
|
|
6
|
+
export { default as formPlugin } from '@tmagic/form';
|
|
7
|
+
import tablePlugin__default, { MagicTable } from '@tmagic/table';
|
|
8
|
+
export * from '@tmagic/table';
|
|
9
|
+
export { default as tablePlugin } from '@tmagic/table';
|
|
1
10
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, createElementBlock, normalizeClass, resolveDynamicComponent, toRaw, ref, watch, onMounted, onBeforeUnmount, Teleport, normalizeStyle, computed, reactive, resolveComponent, inject, createCommentVNode, Fragment, renderList, mergeProps, mergeModels, useModel, nextTick, provide, renderSlot, toDisplayString, createTextVNode, isRef, createStaticVNode, watchEffect, withModifiers, toHandlers, resolveDirective, withDirectives, createSlots, markRaw, getCurrentInstance, vShow, Transition, mergeDefaults } from 'vue';
|
|
2
11
|
import { Edit, FullScreen, View, Close, Coin, Delete, Plus, ArrowDown, ArrowLeftBold, ArrowRightBold, Files, CaretBottom, DocumentCopy, Grid, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Document, Search, ArrowRight, CopyDocument, Hide, Goods, List, EditPen, CloseBold, Top, Bottom } from '@element-plus/icons-vue';
|
|
3
|
-
import { throttle, isEmpty, cloneDeep, mergeWith, isObject, uniq, get, map, has, pick, keys } from 'lodash-es';
|
|
12
|
+
import { throttle, isEmpty, cloneDeep, mergeWith, isObject, uniq, get, map, has, pick, keys, debounce } from 'lodash-es';
|
|
4
13
|
import serialize from 'serialize-javascript';
|
|
5
|
-
import { TMagicIcon, TMagicButton, TMagicCard, getConfig as getConfig$1, TMagicSelect, useZIndex, tMagicMessage, tMagicMessageBox, TMagicCascader, TMagicTooltip, TMagicTag, TMagicDialog, TMagicSwitch, TMagicInput, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, TMagicPopover, TMagicScrollbar, TMagicCollapse, TMagicCollapseItem } from '@tmagic/design';
|
|
6
14
|
import { emmetHTML, emmetCSS } from 'emmet-monaco-es';
|
|
7
15
|
import * as monaco from 'monaco-editor';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
16
|
+
import { HookCodeType, HookType, NODE_CONDS_KEY, Target, Watcher, NodeType, ActionType, DepTargetType, DEFAULT_EVENTS, DEFAULT_METHODS, createCodeBlockTarget, createDataSourceTarget, createDataSourceMethodTarget, createDataSourceCondTarget } from '@tmagic/core';
|
|
17
|
+
export { DepTargetType } from '@tmagic/core';
|
|
18
|
+
import { isPage, isPageFragment, isPop, getNodePath, isNumber, getElById, calcValueByFontsize, toLine, guid, getValueByKeyPath, setValueByKeyPath, dataSourceTemplateRegExp, getKeysArray, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, getKeys, convertToNumber, getIdFromEl, traverseNode, getDefaultValueFromFields, DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, removeClassName, addClassName, removeClassNameByClassName } from '@tmagic/utils';
|
|
19
|
+
export * from '@tmagic/utils';
|
|
12
20
|
import VanillaMoveable from 'moveable';
|
|
13
|
-
import {
|
|
14
|
-
export
|
|
21
|
+
import StageCore__default, { isFixed, GuidesType, getOffset, RenderType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType } from '@tmagic/stage';
|
|
22
|
+
export * from '@tmagic/stage';
|
|
23
|
+
export { default as StageCore } from '@tmagic/stage';
|
|
15
24
|
import { EventEmitter } from 'events';
|
|
16
25
|
import Gesto from 'gesto';
|
|
17
26
|
import Sortable from 'sortablejs';
|
|
18
|
-
import StageCore, { GuidesType, getOffset, RenderType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType } from '@tmagic/stage';
|
|
19
|
-
import { DEFAULT_EVENTS, DEFAULT_METHODS } from '@tmagic/core';
|
|
20
27
|
import KeyController from 'keycon';
|
|
21
28
|
|
|
22
29
|
const _hoisted_1$w = ["src"];
|
|
@@ -64,10 +71,10 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
64
71
|
});
|
|
65
72
|
|
|
66
73
|
let $TMAGIC_EDITOR = {};
|
|
67
|
-
const
|
|
74
|
+
const setEditorConfig = (option) => {
|
|
68
75
|
$TMAGIC_EDITOR = option;
|
|
69
76
|
};
|
|
70
|
-
const
|
|
77
|
+
const getEditorConfig = (key) => $TMAGIC_EDITOR[key];
|
|
71
78
|
|
|
72
79
|
emmetHTML(monaco);
|
|
73
80
|
emmetCSS(monaco, ["css", "scss"]);
|
|
@@ -115,14 +122,14 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
115
122
|
}
|
|
116
123
|
return value;
|
|
117
124
|
};
|
|
118
|
-
const
|
|
125
|
+
const parseCode = (v, language) => {
|
|
119
126
|
if (typeof v !== "string") {
|
|
120
127
|
return v;
|
|
121
128
|
}
|
|
122
129
|
if (language === "json") {
|
|
123
130
|
return JSON.parse(v);
|
|
124
131
|
}
|
|
125
|
-
return
|
|
132
|
+
return getEditorConfig("parseDSL")(v);
|
|
126
133
|
};
|
|
127
134
|
let vsEditor = null;
|
|
128
135
|
let vsDiffEditor = null;
|
|
@@ -170,7 +177,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
170
177
|
e.stopPropagation();
|
|
171
178
|
const newValue = getEditorValue();
|
|
172
179
|
values.value = newValue;
|
|
173
|
-
emit("save", props.parse ?
|
|
180
|
+
emit("save", props.parse ? parseCode(newValue, props.language) : newValue);
|
|
174
181
|
}
|
|
175
182
|
});
|
|
176
183
|
if (props.type !== "diff" && props.autoSave) {
|
|
@@ -178,7 +185,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
178
185
|
const newValue = getEditorValue();
|
|
179
186
|
if (values.value !== newValue) {
|
|
180
187
|
values.value = newValue;
|
|
181
|
-
emit("save", props.parse ?
|
|
188
|
+
emit("save", props.parse ? parseCode(newValue, props.language) : newValue);
|
|
182
189
|
}
|
|
183
190
|
});
|
|
184
191
|
}
|
|
@@ -364,7 +371,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
364
371
|
const changeHandler = (v) => {
|
|
365
372
|
if (!props.name || !props.model) return;
|
|
366
373
|
try {
|
|
367
|
-
const parseDSL =
|
|
374
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
368
375
|
props.model[props.name] = parseDSL(`(${v[props.name]})`);
|
|
369
376
|
emit("change", props.model[props.name]);
|
|
370
377
|
} catch (e) {
|
|
@@ -994,7 +1001,6 @@ const generatePageName = (pageNameList, type) => {
|
|
|
994
1001
|
return pageName;
|
|
995
1002
|
};
|
|
996
1003
|
const generatePageNameByApp = (app, type) => generatePageName(getPageNameList(type === "page" ? getPageList(app) : getPageFragmentList(app)), type);
|
|
997
|
-
const isFixed = (node) => node.style?.position === "fixed";
|
|
998
1004
|
const getNodeIndex = (id, parent) => {
|
|
999
1005
|
const items = parent?.items || [];
|
|
1000
1006
|
return items.findIndex((item) => `${item.id}` === `${id}`);
|
|
@@ -1012,11 +1018,14 @@ const getMiddleTop = (node, parentNode, stage) => {
|
|
|
1012
1018
|
height = 0;
|
|
1013
1019
|
}
|
|
1014
1020
|
const { height: parentHeight } = parentNode.style;
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1021
|
+
let wrapperHeightDeal = parentHeight;
|
|
1022
|
+
if (stage.mask && stage.renderer) {
|
|
1023
|
+
const { scrollTop = 0, wrapperHeight } = stage.mask;
|
|
1024
|
+
wrapperHeightDeal = calcValueByFontsize(stage.renderer.getDocument(), wrapperHeight);
|
|
1025
|
+
const scrollTopDeal = calcValueByFontsize(stage.renderer.getDocument(), scrollTop);
|
|
1026
|
+
if (isPage(parentNode)) {
|
|
1027
|
+
return (wrapperHeightDeal - height) / 2 + scrollTopDeal;
|
|
1028
|
+
}
|
|
1020
1029
|
}
|
|
1021
1030
|
return (Math.min(parentHeight, wrapperHeightDeal) - height) / 2;
|
|
1022
1031
|
};
|
|
@@ -1131,22 +1140,13 @@ const fixNodePosition = (config, parent, stage) => {
|
|
|
1131
1140
|
return {
|
|
1132
1141
|
...config.style || {},
|
|
1133
1142
|
top: getMiddleTop(config, parent, stage),
|
|
1134
|
-
left: fixNodeLeft(config, parent, stage?.renderer
|
|
1143
|
+
left: fixNodeLeft(config, parent, stage?.renderer?.contentWindow?.document)
|
|
1135
1144
|
};
|
|
1136
1145
|
};
|
|
1137
1146
|
const serializeConfig = (config) => serialize(config, {
|
|
1138
1147
|
space: 2,
|
|
1139
1148
|
unsafe: true
|
|
1140
1149
|
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
1141
|
-
const traverseNode = (node, cb, parents = []) => {
|
|
1142
|
-
cb(node, parents);
|
|
1143
|
-
if (Array.isArray(node.items) && node.items.length) {
|
|
1144
|
-
parents.push(node);
|
|
1145
|
-
node.items.forEach((item) => {
|
|
1146
|
-
traverseNode(item, cb, [...parents]);
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
};
|
|
1150
1150
|
const moveItemsInContainer = (sourceIndices, parent, targetIndex) => {
|
|
1151
1151
|
sourceIndices.sort((a, b) => a - b);
|
|
1152
1152
|
for (let i = sourceIndices.length - 1; i >= 0; i--) {
|
|
@@ -1703,7 +1703,7 @@ class WebStorage extends BaseService {
|
|
|
1703
1703
|
if (item === null) return null;
|
|
1704
1704
|
switch (protocol) {
|
|
1705
1705
|
case "object" /* OBJECT */:
|
|
1706
|
-
return
|
|
1706
|
+
return getEditorConfig("parseDSL")(`(${item})`);
|
|
1707
1707
|
case "json" /* JSON */:
|
|
1708
1708
|
return JSON.parse(item);
|
|
1709
1709
|
case "number" /* NUMBER */:
|
|
@@ -1915,7 +1915,7 @@ class Editor extends BaseService {
|
|
|
1915
1915
|
* 只有容器拥有布局
|
|
1916
1916
|
*/
|
|
1917
1917
|
async getLayout(parent, node) {
|
|
1918
|
-
if (node && typeof node !== "function" && isFixed(node)) return Layout.FIXED;
|
|
1918
|
+
if (node && typeof node !== "function" && isFixed(node.style || {})) return Layout.FIXED;
|
|
1919
1919
|
if (parent.layout) {
|
|
1920
1920
|
return parent.layout;
|
|
1921
1921
|
}
|
|
@@ -1940,7 +1940,7 @@ class Editor extends BaseService {
|
|
|
1940
1940
|
historyService.resetState();
|
|
1941
1941
|
}
|
|
1942
1942
|
if (node?.id) {
|
|
1943
|
-
this.get("stage")?.renderer
|
|
1943
|
+
this.get("stage")?.renderer?.runtime?.getApp?.()?.page?.emit(
|
|
1944
1944
|
"editor:select",
|
|
1945
1945
|
{
|
|
1946
1946
|
node,
|
|
@@ -2294,7 +2294,7 @@ class Editor extends BaseService {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
async doPaste(config, position = {}) {
|
|
2296
2296
|
propsService.clearRelateId();
|
|
2297
|
-
const doc = this.get("stage")?.renderer
|
|
2297
|
+
const doc = this.get("stage")?.renderer?.contentWindow?.document;
|
|
2298
2298
|
const pasteConfigs = beforePaste(position, cloneDeep(config), doc);
|
|
2299
2299
|
return pasteConfigs;
|
|
2300
2300
|
}
|
|
@@ -2308,7 +2308,7 @@ class Editor extends BaseService {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
if (!node.style) return config;
|
|
2310
2310
|
const stage = this.get("stage");
|
|
2311
|
-
const doc = stage?.renderer
|
|
2311
|
+
const doc = stage?.renderer?.contentWindow?.document;
|
|
2312
2312
|
if (doc) {
|
|
2313
2313
|
const el = getElById()(doc, node.id);
|
|
2314
2314
|
const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
|
|
@@ -2583,9 +2583,9 @@ class Editor extends BaseService {
|
|
|
2583
2583
|
async toggleFixedPosition(dist, src, root) {
|
|
2584
2584
|
const newConfig = cloneDeep(dist);
|
|
2585
2585
|
if (!isPop(src) && newConfig.style?.position) {
|
|
2586
|
-
if (isFixed(newConfig) && !isFixed(src)) {
|
|
2586
|
+
if (isFixed(newConfig.style) && !isFixed(src.style || {})) {
|
|
2587
2587
|
newConfig.style = change2Fixed(newConfig, root);
|
|
2588
|
-
} else if (!isFixed(newConfig) && isFixed(src)) {
|
|
2588
|
+
} else if (!isFixed(newConfig.style) && isFixed(src.style || {})) {
|
|
2589
2589
|
newConfig.style = await Fixed2Other(newConfig, root, this.getLayout);
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
@@ -3230,7 +3230,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
3230
3230
|
});
|
|
3231
3231
|
|
|
3232
3232
|
const _hoisted_1$u = { class: "m-fields-code-select-col" };
|
|
3233
|
-
const _hoisted_2$
|
|
3233
|
+
const _hoisted_2$g = { class: "code-select-container" };
|
|
3234
3234
|
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
3235
3235
|
...{
|
|
3236
3236
|
name: "MFieldsCodeSelectCol"
|
|
@@ -3311,7 +3311,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
3311
3311
|
};
|
|
3312
3312
|
return (_ctx, _cache) => {
|
|
3313
3313
|
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
3314
|
-
createElementVNode("div", _hoisted_2$
|
|
3314
|
+
createElementVNode("div", _hoisted_2$g, [
|
|
3315
3315
|
createVNode(unref(MContainer), {
|
|
3316
3316
|
class: "select",
|
|
3317
3317
|
config: selectConfig,
|
|
@@ -3367,7 +3367,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
3367
3367
|
const emit = __emit;
|
|
3368
3368
|
const { dataSourceService } = inject("services") || {};
|
|
3369
3369
|
const props = __props;
|
|
3370
|
-
const optionComponent =
|
|
3370
|
+
const optionComponent = getDesignConfig("components")?.option;
|
|
3371
3371
|
const options = computed(() => {
|
|
3372
3372
|
const [id, ...fieldNames] = [...props.config.parentFields || [], ...props.model.field];
|
|
3373
3373
|
const ds = dataSourceService?.getDataSourceById(id);
|
|
@@ -3718,7 +3718,7 @@ const useDataSourceMethod = () => {
|
|
|
3718
3718
|
dataSource.value.methods = [];
|
|
3719
3719
|
}
|
|
3720
3720
|
if (values.content) {
|
|
3721
|
-
const parseDSL =
|
|
3721
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
3722
3722
|
if (typeof values.content === "string") {
|
|
3723
3723
|
values.content = parseDSL(values.content);
|
|
3724
3724
|
}
|
|
@@ -3846,7 +3846,7 @@ const zoom = computed(() => uiService.get("zoom") || 1);
|
|
|
3846
3846
|
const uiSelectMode = computed(() => uiService.get("uiSelectMode"));
|
|
3847
3847
|
const getGuideLineKey = (key) => `${key}_${root.value?.id}_${page.value?.id}`;
|
|
3848
3848
|
const useStage = (stageOptions) => {
|
|
3849
|
-
const stage = new
|
|
3849
|
+
const stage = new StageCore__default({
|
|
3850
3850
|
render: stageOptions.render,
|
|
3851
3851
|
runtimeUrl: stageOptions.runtimeUrl,
|
|
3852
3852
|
zoom: stageOptions.zoom ?? zoom.value,
|
|
@@ -3881,7 +3881,7 @@ const useStage = (stageOptions) => {
|
|
|
3881
3881
|
}
|
|
3882
3882
|
}
|
|
3883
3883
|
);
|
|
3884
|
-
stage.mask
|
|
3884
|
+
stage.mask?.setGuides([
|
|
3885
3885
|
getGuideLineFromCache(getGuideLineKey(H_GUIDE_LINE_STORAGE_KEY)),
|
|
3886
3886
|
getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY))
|
|
3887
3887
|
]);
|
|
@@ -4182,7 +4182,7 @@ const useNodeStatus$1 = (nodeData) => {
|
|
|
4182
4182
|
};
|
|
4183
4183
|
|
|
4184
4184
|
const _hoisted_1$t = { class: "m-editor-data-source-fields" };
|
|
4185
|
-
const _hoisted_2$
|
|
4185
|
+
const _hoisted_2$f = { class: "m-editor-data-source-fields-footer" };
|
|
4186
4186
|
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
4187
4187
|
...{
|
|
4188
4188
|
name: "MFieldsDataSourceFields"
|
|
@@ -4439,16 +4439,16 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
4439
4439
|
data: _ctx.model[_ctx.name],
|
|
4440
4440
|
columns: fieldColumns
|
|
4441
4441
|
}, null, 8, ["data"]),
|
|
4442
|
-
createElementVNode("div", _hoisted_2$
|
|
4442
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
4443
4443
|
createVNode(unref(TMagicButton), {
|
|
4444
4444
|
size: "small",
|
|
4445
4445
|
disabled: _ctx.disabled,
|
|
4446
4446
|
plain: "",
|
|
4447
4447
|
onClick: _cache[0] || (_cache[0] = ($event) => newFromJsonHandler())
|
|
4448
4448
|
}, {
|
|
4449
|
-
default: withCtx(() => [
|
|
4449
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
4450
4450
|
createTextVNode("快速添加")
|
|
4451
|
-
]),
|
|
4451
|
+
])),
|
|
4452
4452
|
_: 1
|
|
4453
4453
|
}, 8, ["disabled"]),
|
|
4454
4454
|
createVNode(unref(TMagicButton), {
|
|
@@ -4458,9 +4458,9 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
4458
4458
|
plain: "",
|
|
4459
4459
|
onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
|
|
4460
4460
|
}, {
|
|
4461
|
-
default: withCtx(() => [
|
|
4461
|
+
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
4462
4462
|
createTextVNode("添加")
|
|
4463
|
-
]),
|
|
4463
|
+
])),
|
|
4464
4464
|
_: 1
|
|
4465
4465
|
}, 8, ["disabled"])
|
|
4466
4466
|
]),
|
|
@@ -4531,7 +4531,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
4531
4531
|
const props = __props;
|
|
4532
4532
|
const emit = __emit;
|
|
4533
4533
|
const modelValue = useModel(__props, "modelValue");
|
|
4534
|
-
const optionComponent =
|
|
4534
|
+
const optionComponent = getDesignConfig("components")?.option;
|
|
4535
4535
|
const services = inject("services");
|
|
4536
4536
|
const mForm = inject("mForm");
|
|
4537
4537
|
const eventBus = inject("eventBus");
|
|
@@ -4798,7 +4798,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
4798
4798
|
"last-values": _ctx.lastValues,
|
|
4799
4799
|
"init-values": _ctx.initValues,
|
|
4800
4800
|
values: _ctx.values,
|
|
4801
|
-
prop:
|
|
4801
|
+
prop: _ctx.prop,
|
|
4802
4802
|
onChange: onChangeHandler
|
|
4803
4803
|
}, null, 40, ["config", "model", "name", "disabled", "size", "last-values", "init-values", "values", "prop"])),
|
|
4804
4804
|
_ctx.config.fieldConfig ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
@@ -4827,8 +4827,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
4827
4827
|
});
|
|
4828
4828
|
|
|
4829
4829
|
const _hoisted_1$q = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4830
|
-
const _hoisted_2$
|
|
4831
|
-
const _hoisted_3$
|
|
4830
|
+
const _hoisted_2$e = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4831
|
+
const _hoisted_3$4 = { class: "el-input__inner t-input__inner" };
|
|
4832
4832
|
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
4833
4833
|
...{
|
|
4834
4834
|
name: "MFieldsDataSourceInput"
|
|
@@ -5005,7 +5005,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5005
5005
|
changeHandler(state.value);
|
|
5006
5006
|
};
|
|
5007
5007
|
return (_ctx, _cache) => {
|
|
5008
|
-
return _ctx.disabled || isFocused.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
5008
|
+
return _ctx.disabled || isFocused.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(getDesignConfig)("components")?.autocomplete.component || "el-autocomplete"), mergeProps(
|
|
5009
5009
|
{
|
|
5010
5010
|
key: 0,
|
|
5011
5011
|
class: "tmagic-design-auto-complete",
|
|
@@ -5014,7 +5014,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5014
5014
|
modelValue: state.value,
|
|
5015
5015
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
|
|
5016
5016
|
},
|
|
5017
|
-
unref(
|
|
5017
|
+
unref(getDesignConfig)("components")?.autocomplete.props({
|
|
5018
5018
|
disabled: _ctx.disabled,
|
|
5019
5019
|
size: _ctx.size,
|
|
5020
5020
|
fetchSuggestions: querySearch,
|
|
@@ -5034,7 +5034,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5034
5034
|
default: withCtx(({ item }) => [
|
|
5035
5035
|
createElementVNode("div", _hoisted_1$q, [
|
|
5036
5036
|
createElementVNode("div", null, toDisplayString(item.text), 1),
|
|
5037
|
-
createElementVNode("span", _hoisted_2$
|
|
5037
|
+
createElementVNode("span", _hoisted_2$e, toDisplayString(item.value), 1)
|
|
5038
5038
|
])
|
|
5039
5039
|
]),
|
|
5040
5040
|
_: 1
|
|
@@ -5046,7 +5046,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5046
5046
|
createElementVNode("div", {
|
|
5047
5047
|
class: normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
5048
5048
|
}, [
|
|
5049
|
-
createElementVNode("div", _hoisted_3$
|
|
5049
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
5050
5050
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
|
|
5051
5051
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
5052
5052
|
item.type === "text" ? (openBlock(), createElementBlock("span", {
|
|
@@ -5076,9 +5076,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
5076
5076
|
});
|
|
5077
5077
|
|
|
5078
5078
|
const _hoisted_1$p = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
5079
|
-
const _hoisted_2$
|
|
5080
|
-
const _hoisted_3$
|
|
5081
|
-
const _hoisted_4$
|
|
5079
|
+
const _hoisted_2$d = { style: { "flex": "1" } };
|
|
5080
|
+
const _hoisted_3$3 = { style: { "flex": "1" } };
|
|
5081
|
+
const _hoisted_4$3 = { class: "dialog-footer" };
|
|
5082
5082
|
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
5083
5083
|
...{
|
|
5084
5084
|
name: "MEditorCodeBlockEditor"
|
|
@@ -5198,7 +5198,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
5198
5198
|
height: "500px",
|
|
5199
5199
|
onChange: (formState, code) => {
|
|
5200
5200
|
try {
|
|
5201
|
-
|
|
5201
|
+
getEditorConfig("parseDSL")(code);
|
|
5202
5202
|
return code;
|
|
5203
5203
|
} catch (error) {
|
|
5204
5204
|
tMagicMessage.error(error.message);
|
|
@@ -5287,9 +5287,9 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
5287
5287
|
link: "",
|
|
5288
5288
|
onClick: _cache[0] || (_cache[0] = ($event) => difVisible.value = true)
|
|
5289
5289
|
}, {
|
|
5290
|
-
default: withCtx(() => [
|
|
5290
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
5291
5291
|
createTextVNode("查看修改")
|
|
5292
|
-
]),
|
|
5292
|
+
])),
|
|
5293
5293
|
_: 1
|
|
5294
5294
|
})) : createCommentVNode("", true)
|
|
5295
5295
|
]),
|
|
@@ -5306,14 +5306,14 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
5306
5306
|
fullscreen: ""
|
|
5307
5307
|
}, {
|
|
5308
5308
|
footer: withCtx(() => [
|
|
5309
|
-
createElementVNode("span", _hoisted_4$
|
|
5309
|
+
createElementVNode("span", _hoisted_4$3, [
|
|
5310
5310
|
createVNode(unref(TMagicButton), {
|
|
5311
5311
|
size: "small",
|
|
5312
5312
|
onClick: _cache[4] || (_cache[4] = ($event) => difVisible.value = false)
|
|
5313
5313
|
}, {
|
|
5314
|
-
default: withCtx(() => [
|
|
5314
|
+
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
5315
5315
|
createTextVNode("取消")
|
|
5316
|
-
]),
|
|
5316
|
+
])),
|
|
5317
5317
|
_: 1
|
|
5318
5318
|
}),
|
|
5319
5319
|
createVNode(unref(TMagicButton), {
|
|
@@ -5321,34 +5321,34 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
5321
5321
|
type: "primary",
|
|
5322
5322
|
onClick: diffChange
|
|
5323
5323
|
}, {
|
|
5324
|
-
default: withCtx(() => [
|
|
5324
|
+
default: withCtx(() => _cache[10] || (_cache[10] = [
|
|
5325
5325
|
createTextVNode("确定")
|
|
5326
|
-
]),
|
|
5326
|
+
])),
|
|
5327
5327
|
_: 1
|
|
5328
5328
|
})
|
|
5329
5329
|
])
|
|
5330
5330
|
]),
|
|
5331
5331
|
default: withCtx(() => [
|
|
5332
5332
|
createElementVNode("div", _hoisted_1$p, [
|
|
5333
|
-
createElementVNode("div", _hoisted_2$
|
|
5333
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
5334
5334
|
createVNode(unref(TMagicTag), {
|
|
5335
5335
|
size: "small",
|
|
5336
5336
|
type: "info"
|
|
5337
5337
|
}, {
|
|
5338
|
-
default: withCtx(() => [
|
|
5338
|
+
default: withCtx(() => _cache[7] || (_cache[7] = [
|
|
5339
5339
|
createTextVNode("修改前")
|
|
5340
|
-
]),
|
|
5340
|
+
])),
|
|
5341
5341
|
_: 1
|
|
5342
5342
|
})
|
|
5343
5343
|
]),
|
|
5344
|
-
createElementVNode("div", _hoisted_3$
|
|
5344
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
5345
5345
|
createVNode(unref(TMagicTag), {
|
|
5346
5346
|
size: "small",
|
|
5347
5347
|
type: "success"
|
|
5348
5348
|
}, {
|
|
5349
|
-
default: withCtx(() => [
|
|
5349
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
5350
5350
|
createTextVNode("修改后")
|
|
5351
|
-
]),
|
|
5351
|
+
])),
|
|
5352
5352
|
_: 1
|
|
5353
5353
|
})
|
|
5354
5354
|
])
|
|
@@ -5373,7 +5373,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
|
5373
5373
|
});
|
|
5374
5374
|
|
|
5375
5375
|
const _hoisted_1$o = { class: "m-editor-data-source-methods" };
|
|
5376
|
-
const _hoisted_2$
|
|
5376
|
+
const _hoisted_2$c = { class: "m-editor-data-source-methods-footer" };
|
|
5377
5377
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
5378
5378
|
...{
|
|
5379
5379
|
name: "MFieldsDataSourceMethods"
|
|
@@ -5449,7 +5449,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
5449
5449
|
data: _ctx.model[_ctx.name],
|
|
5450
5450
|
columns: methodColumns
|
|
5451
5451
|
}, null, 8, ["data"]),
|
|
5452
|
-
createElementVNode("div", _hoisted_2$
|
|
5452
|
+
createElementVNode("div", _hoisted_2$c, [
|
|
5453
5453
|
createVNode(unref(TMagicButton), {
|
|
5454
5454
|
size: "small",
|
|
5455
5455
|
type: "primary",
|
|
@@ -5457,9 +5457,9 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
5457
5457
|
plain: "",
|
|
5458
5458
|
onClick: createCodeHandler
|
|
5459
5459
|
}, {
|
|
5460
|
-
default: withCtx(() => [
|
|
5460
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
5461
5461
|
createTextVNode("添加")
|
|
5462
|
-
]),
|
|
5462
|
+
])),
|
|
5463
5463
|
_: 1
|
|
5464
5464
|
}, 8, ["disabled"])
|
|
5465
5465
|
]),
|
|
@@ -5479,7 +5479,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
5479
5479
|
});
|
|
5480
5480
|
|
|
5481
5481
|
const _hoisted_1$n = { class: "m-fields-data-source-method-select" };
|
|
5482
|
-
const _hoisted_2$
|
|
5482
|
+
const _hoisted_2$b = { class: "data-source-method-select-container" };
|
|
5483
5483
|
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
5484
5484
|
...{
|
|
5485
5485
|
name: "MFieldsDataSourceMethodSelect"
|
|
@@ -5567,7 +5567,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
5567
5567
|
};
|
|
5568
5568
|
return (_ctx, _cache) => {
|
|
5569
5569
|
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
5570
|
-
createElementVNode("div", _hoisted_2$
|
|
5570
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
5571
5571
|
createVNode(unref(MContainer), {
|
|
5572
5572
|
class: "select",
|
|
5573
5573
|
config: cascaderConfig.value,
|
|
@@ -5611,7 +5611,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
5611
5611
|
});
|
|
5612
5612
|
|
|
5613
5613
|
const _hoisted_1$m = { class: "m-editor-data-source-fields" };
|
|
5614
|
-
const _hoisted_2$
|
|
5614
|
+
const _hoisted_2$a = { class: "m-editor-data-source-fields-footer" };
|
|
5615
5615
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
5616
5616
|
...{
|
|
5617
5617
|
name: "MFieldsDataSourceMocks"
|
|
@@ -5821,7 +5821,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
5821
5821
|
data: _ctx.model[_ctx.name],
|
|
5822
5822
|
columns
|
|
5823
5823
|
}, null, 8, ["data"]),
|
|
5824
|
-
createElementVNode("div", _hoisted_2$
|
|
5824
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
5825
5825
|
createVNode(unref(TMagicButton), {
|
|
5826
5826
|
size: "small",
|
|
5827
5827
|
type: "primary",
|
|
@@ -5829,9 +5829,9 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
5829
5829
|
plain: "",
|
|
5830
5830
|
onClick: _cache[0] || (_cache[0] = ($event) => newHandler())
|
|
5831
5831
|
}, {
|
|
5832
|
-
default: withCtx(() => [
|
|
5832
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
5833
5833
|
createTextVNode("添加")
|
|
5834
|
-
]),
|
|
5834
|
+
])),
|
|
5835
5835
|
_: 1
|
|
5836
5836
|
}, 8, ["disabled"])
|
|
5837
5837
|
]),
|
|
@@ -6086,7 +6086,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
6086
6086
|
});
|
|
6087
6087
|
|
|
6088
6088
|
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
6089
|
-
const _hoisted_2$
|
|
6089
|
+
const _hoisted_2$9 = {
|
|
6090
6090
|
key: 1,
|
|
6091
6091
|
class: "fullWidth"
|
|
6092
6092
|
};
|
|
@@ -6374,7 +6374,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6374
6374
|
model: _ctx.model,
|
|
6375
6375
|
config: tableConfig.value,
|
|
6376
6376
|
onChange: onChangeHandler
|
|
6377
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
6377
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
6378
6378
|
createVNode(unref(TMagicButton), {
|
|
6379
6379
|
class: "create-button",
|
|
6380
6380
|
type: "primary",
|
|
@@ -6382,9 +6382,9 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
6382
6382
|
disabled: _ctx.disabled,
|
|
6383
6383
|
onClick: _cache[0] || (_cache[0] = ($event) => addEvent())
|
|
6384
6384
|
}, {
|
|
6385
|
-
default: withCtx(() => [
|
|
6385
|
+
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
6386
6386
|
createTextVNode("添加事件")
|
|
6387
|
-
]),
|
|
6387
|
+
])),
|
|
6388
6388
|
_: 1
|
|
6389
6389
|
}, 8, ["size", "disabled"]),
|
|
6390
6390
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model[_ctx.name], (cardItem, index) => {
|
|
@@ -6430,10 +6430,6 @@ const _hoisted_1$j = {
|
|
|
6430
6430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6431
6431
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
6432
6432
|
};
|
|
6433
|
-
const _hoisted_2$b = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
6434
|
-
const _hoisted_4$6 = [
|
|
6435
|
-
_hoisted_2$b
|
|
6436
|
-
];
|
|
6437
6433
|
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
6438
6434
|
...{
|
|
6439
6435
|
name: "MEditorCodeIcon"
|
|
@@ -6441,14 +6437,15 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
6441
6437
|
__name: "CodeIcon",
|
|
6442
6438
|
setup(__props) {
|
|
6443
6439
|
return (_ctx, _cache) => {
|
|
6444
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$j,
|
|
6440
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$j, _cache[0] || (_cache[0] = [
|
|
6441
|
+
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)
|
|
6442
|
+
]));
|
|
6445
6443
|
};
|
|
6446
6444
|
}
|
|
6447
6445
|
});
|
|
6448
6446
|
|
|
6449
6447
|
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
6450
|
-
const _hoisted_2$
|
|
6451
|
-
const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
6448
|
+
const _hoisted_2$8 = { key: 0 };
|
|
6452
6449
|
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
6453
6450
|
...{
|
|
6454
6451
|
name: "MFieldsKeyValue"
|
|
@@ -6508,7 +6505,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
6508
6505
|
};
|
|
6509
6506
|
return (_ctx, _cache) => {
|
|
6510
6507
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
6511
|
-
!showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
6508
|
+
!showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
6512
6509
|
(openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
|
|
6513
6510
|
return openBlock(), createElementBlock("div", {
|
|
6514
6511
|
class: "m-fields-key-value-item",
|
|
@@ -6522,7 +6519,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
6522
6519
|
size: _ctx.size,
|
|
6523
6520
|
onChange: keyChangeHandler
|
|
6524
6521
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
6525
|
-
|
|
6522
|
+
_cache[1] || (_cache[1] = createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1)),
|
|
6526
6523
|
createVNode(unref(TMagicInput), {
|
|
6527
6524
|
placeholder: "value",
|
|
6528
6525
|
modelValue: records.value[index][1],
|
|
@@ -6551,9 +6548,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
6551
6548
|
icon: unref(Plus),
|
|
6552
6549
|
onClick: addHandler
|
|
6553
6550
|
}, {
|
|
6554
|
-
default: withCtx(() => [
|
|
6551
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
6555
6552
|
createTextVNode("添加")
|
|
6556
|
-
]),
|
|
6553
|
+
])),
|
|
6557
6554
|
_: 1
|
|
6558
6555
|
}, 8, ["size", "disabled", "icon"])
|
|
6559
6556
|
])) : createCommentVNode("", true),
|
|
@@ -6582,7 +6579,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
6582
6579
|
});
|
|
6583
6580
|
|
|
6584
6581
|
const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
|
|
6585
|
-
const _hoisted_2$
|
|
6582
|
+
const _hoisted_2$7 = { class: "page-fragment-select-container" };
|
|
6586
6583
|
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
6587
6584
|
...{
|
|
6588
6585
|
name: "MFieldsPageFragmentSelect"
|
|
@@ -6630,7 +6627,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
6630
6627
|
return (_ctx, _cache) => {
|
|
6631
6628
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
6632
6629
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
6633
|
-
createElementVNode("div", _hoisted_2$
|
|
6630
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
6634
6631
|
createVNode(_component_m_form_container, {
|
|
6635
6632
|
class: "select",
|
|
6636
6633
|
config: selectConfig,
|
|
@@ -6745,9 +6742,9 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
6745
6742
|
link: "",
|
|
6746
6743
|
style: { "padding": "0" }
|
|
6747
6744
|
}, {
|
|
6748
|
-
default: withCtx(() => [
|
|
6745
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
6749
6746
|
createTextVNode("取消")
|
|
6750
|
-
]),
|
|
6747
|
+
])),
|
|
6751
6748
|
_: 1
|
|
6752
6749
|
}, 8, ["icon", "disabled", "size"])
|
|
6753
6750
|
])) : (openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
@@ -6804,9 +6801,9 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
6804
6801
|
size: _ctx.size,
|
|
6805
6802
|
onClick: startSelect
|
|
6806
6803
|
}, {
|
|
6807
|
-
default: withCtx(() => [
|
|
6804
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
6808
6805
|
createTextVNode("点击此处选择")
|
|
6809
|
-
]),
|
|
6806
|
+
])),
|
|
6810
6807
|
_: 1
|
|
6811
6808
|
}, 8, ["disabled", "size"])
|
|
6812
6809
|
]),
|
|
@@ -7003,7 +7000,7 @@ const _hoisted_1$f = {
|
|
|
7003
7000
|
key: 1,
|
|
7004
7001
|
class: "menu-item-text"
|
|
7005
7002
|
};
|
|
7006
|
-
const _hoisted_2$
|
|
7003
|
+
const _hoisted_2$6 = { class: "el-dropdown-link menubar-menu-button" };
|
|
7007
7004
|
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
7008
7005
|
...{
|
|
7009
7006
|
name: "MEditorToolButton"
|
|
@@ -7140,7 +7137,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
7140
7137
|
})) : createCommentVNode("", true)
|
|
7141
7138
|
]),
|
|
7142
7139
|
default: withCtx(() => [
|
|
7143
|
-
createElementVNode("span", _hoisted_2$
|
|
7140
|
+
createElementVNode("span", _hoisted_2$6, [
|
|
7144
7141
|
createTextVNode(toDisplayString(_ctx.data.text), 1),
|
|
7145
7142
|
createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
|
|
7146
7143
|
default: withCtx(() => [
|
|
@@ -7385,8 +7382,9 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
7385
7382
|
createVNode(unref(TMagicPopover), {
|
|
7386
7383
|
"popper-class": "page-bar-popover",
|
|
7387
7384
|
placement: "top",
|
|
7385
|
+
trigger: "hover",
|
|
7388
7386
|
width: 160,
|
|
7389
|
-
|
|
7387
|
+
"destroy-on-close": true
|
|
7390
7388
|
}, {
|
|
7391
7389
|
reference: withCtx(() => [
|
|
7392
7390
|
createVNode(unref(TMagicIcon), { class: "m-editor-page-list-menu-icon" }, {
|
|
@@ -7464,9 +7462,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
7464
7462
|
});
|
|
7465
7463
|
|
|
7466
7464
|
const _hoisted_1$c = { class: "m-editor-page-bar-tabs" };
|
|
7467
|
-
const _hoisted_2$
|
|
7468
|
-
const _hoisted_3$
|
|
7469
|
-
const _hoisted_4$
|
|
7465
|
+
const _hoisted_2$5 = ["page-id", "onClick"];
|
|
7466
|
+
const _hoisted_3$2 = { class: "m-editor-page-bar-title" };
|
|
7467
|
+
const _hoisted_4$2 = ["title"];
|
|
7470
7468
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
7471
7469
|
...{
|
|
7472
7470
|
name: "MEditorPageBar"
|
|
@@ -7573,18 +7571,19 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
7573
7571
|
"page-id": item.id,
|
|
7574
7572
|
onClick: ($event) => switchPage(item.id)
|
|
7575
7573
|
}, [
|
|
7576
|
-
createElementVNode("div", _hoisted_3$
|
|
7574
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
7577
7575
|
renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
7578
7576
|
createElementVNode("span", {
|
|
7579
7577
|
title: item.name
|
|
7580
|
-
}, toDisplayString(item.name || item.id), 9, _hoisted_4$
|
|
7578
|
+
}, toDisplayString(item.name || item.id), 9, _hoisted_4$2)
|
|
7581
7579
|
])
|
|
7582
7580
|
]),
|
|
7583
7581
|
createVNode(unref(TMagicPopover), {
|
|
7584
7582
|
"popper-class": "page-bar-popover",
|
|
7585
7583
|
placement: "top",
|
|
7584
|
+
trigger: "hover",
|
|
7586
7585
|
width: 160,
|
|
7587
|
-
|
|
7586
|
+
"destroy-on-close": true
|
|
7588
7587
|
}, {
|
|
7589
7588
|
reference: withCtx(() => [
|
|
7590
7589
|
createVNode(unref(TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
@@ -7618,7 +7617,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
7618
7617
|
]),
|
|
7619
7618
|
_: 2
|
|
7620
7619
|
}, 1024)
|
|
7621
|
-
], 10, _hoisted_2$
|
|
7620
|
+
], 10, _hoisted_2$5);
|
|
7622
7621
|
}), 128))
|
|
7623
7622
|
]),
|
|
7624
7623
|
_: 3
|
|
@@ -7629,9 +7628,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
7629
7628
|
});
|
|
7630
7629
|
|
|
7631
7630
|
const _hoisted_1$b = { class: "m-editor-empty-panel" };
|
|
7632
|
-
const _hoisted_2$
|
|
7633
|
-
const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
|
|
7634
|
-
const _hoisted_4$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面片", -1);
|
|
7631
|
+
const _hoisted_2$4 = { class: "m-editor-empty-content" };
|
|
7635
7632
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
7636
7633
|
...{
|
|
7637
7634
|
name: "MEditorAddPageBox"
|
|
@@ -7655,7 +7652,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
7655
7652
|
};
|
|
7656
7653
|
return (_ctx, _cache) => {
|
|
7657
7654
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
7658
|
-
createElementVNode("div", _hoisted_2$
|
|
7655
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
7659
7656
|
createElementVNode("div", {
|
|
7660
7657
|
class: "m-editor-empty-button",
|
|
7661
7658
|
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(unref(NodeType).PAGE))
|
|
@@ -7663,7 +7660,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
7663
7660
|
createElementVNode("div", null, [
|
|
7664
7661
|
createVNode(_sfc_main$Y, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
7665
7662
|
]),
|
|
7666
|
-
|
|
7663
|
+
_cache[2] || (_cache[2] = createElementVNode("p", null, "新增页面", -1))
|
|
7667
7664
|
]),
|
|
7668
7665
|
!_ctx.disabledPageFragment ? (openBlock(), createElementBlock("div", {
|
|
7669
7666
|
key: 0,
|
|
@@ -7673,7 +7670,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
7673
7670
|
createElementVNode("div", null, [
|
|
7674
7671
|
createVNode(_sfc_main$Y, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
7675
7672
|
]),
|
|
7676
|
-
|
|
7673
|
+
_cache[3] || (_cache[3] = createElementVNode("p", null, "新增页面片", -1))
|
|
7677
7674
|
])) : createCommentVNode("", true)
|
|
7678
7675
|
])
|
|
7679
7676
|
]);
|
|
@@ -7746,7 +7743,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
7746
7743
|
});
|
|
7747
7744
|
const saveCode = (value) => {
|
|
7748
7745
|
try {
|
|
7749
|
-
const parseDSL =
|
|
7746
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
7750
7747
|
editorService?.set("root", parseDSL(value));
|
|
7751
7748
|
} catch (e) {
|
|
7752
7749
|
console.error(e);
|
|
@@ -8153,6 +8150,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8153
8150
|
timer && clearTimeout(timer);
|
|
8154
8151
|
timer = setTimeout(() => {
|
|
8155
8152
|
emit("search", filterText.value);
|
|
8153
|
+
timer = null;
|
|
8156
8154
|
}, 300);
|
|
8157
8155
|
};
|
|
8158
8156
|
return (_ctx, _cache) => {
|
|
@@ -8180,9 +8178,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
8180
8178
|
});
|
|
8181
8179
|
|
|
8182
8180
|
const _hoisted_1$9 = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
|
|
8183
|
-
const _hoisted_2$
|
|
8184
|
-
const _hoisted_3$
|
|
8185
|
-
const _hoisted_4$
|
|
8181
|
+
const _hoisted_2$3 = { class: "tree-node-label" };
|
|
8182
|
+
const _hoisted_3$1 = { class: "tree-node-tool" };
|
|
8183
|
+
const _hoisted_4$1 = {
|
|
8186
8184
|
key: 0,
|
|
8187
8185
|
class: "m-editor-tree-node-children"
|
|
8188
8186
|
};
|
|
@@ -8196,7 +8194,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8196
8194
|
parent: {},
|
|
8197
8195
|
parentsId: { default: () => [] },
|
|
8198
8196
|
nodeStatusMap: {},
|
|
8199
|
-
indent: { default: 0 }
|
|
8197
|
+
indent: { default: 0 },
|
|
8198
|
+
nextLevelIndentIncrement: { default: 11 }
|
|
8200
8199
|
},
|
|
8201
8200
|
emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
8202
8201
|
setup(__props, { emit: __emit }) {
|
|
@@ -8270,18 +8269,18 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8270
8269
|
onClick: nodeClickHandler
|
|
8271
8270
|
}, [
|
|
8272
8271
|
renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
8273
|
-
createElementVNode("div", _hoisted_2$
|
|
8272
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
8274
8273
|
renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
8275
8274
|
createTextVNode(toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
8276
8275
|
])
|
|
8277
8276
|
]),
|
|
8278
|
-
createElementVNode("div", _hoisted_3$
|
|
8277
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
8279
8278
|
renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
|
|
8280
8279
|
])
|
|
8281
8280
|
])
|
|
8282
8281
|
])
|
|
8283
8282
|
], 38),
|
|
8284
|
-
hasChildren.value && expanded.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
8283
|
+
hasChildren.value && expanded.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
8285
8284
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.items, (item) => {
|
|
8286
8285
|
return openBlock(), createBlock(_component_TreeNode, {
|
|
8287
8286
|
key: item.id,
|
|
@@ -8289,7 +8288,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
8289
8288
|
parent: _ctx.data,
|
|
8290
8289
|
parentsId: [..._ctx.parentsId, _ctx.data.id],
|
|
8291
8290
|
"node-status-map": _ctx.nodeStatusMap,
|
|
8292
|
-
indent: _ctx.indent +
|
|
8291
|
+
indent: _ctx.indent + _ctx.nextLevelIndentIncrement
|
|
8293
8292
|
}, {
|
|
8294
8293
|
"tree-node-content": withCtx(({ data: nodeData }) => [
|
|
8295
8294
|
renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
|
|
@@ -8324,6 +8323,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8324
8323
|
data: {},
|
|
8325
8324
|
nodeStatusMap: {},
|
|
8326
8325
|
indent: { default: 0 },
|
|
8326
|
+
nextLevelIndentIncrement: {},
|
|
8327
8327
|
emptyText: { default: "暂无数据" }
|
|
8328
8328
|
},
|
|
8329
8329
|
emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
|
|
@@ -8343,6 +8343,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8343
8343
|
key: item.id,
|
|
8344
8344
|
data: item,
|
|
8345
8345
|
indent: _ctx.indent,
|
|
8346
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8346
8347
|
"node-status-map": _ctx.nodeStatusMap
|
|
8347
8348
|
}, {
|
|
8348
8349
|
"tree-node-content": withCtx(({ data: nodeData }) => [
|
|
@@ -8355,7 +8356,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
8355
8356
|
renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
|
|
8356
8357
|
]),
|
|
8357
8358
|
_: 2
|
|
8358
|
-
}, 1032, ["data", "indent", "node-status-map"]);
|
|
8359
|
+
}, 1032, ["data", "indent", "next-level-indent-increment", "node-status-map"]);
|
|
8359
8360
|
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
8360
8361
|
createElementVNode("p", null, toDisplayString(_ctx.emptyText), 1)
|
|
8361
8362
|
]))
|
|
@@ -8370,6 +8371,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
8370
8371
|
},
|
|
8371
8372
|
__name: "CodeBlockList",
|
|
8372
8373
|
props: {
|
|
8374
|
+
indent: {},
|
|
8375
|
+
nextLevelIndentIncrement: {},
|
|
8373
8376
|
customError: { type: Function }
|
|
8374
8377
|
},
|
|
8375
8378
|
emits: ["edit", "remove"],
|
|
@@ -8463,6 +8466,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
8463
8466
|
return openBlock(), createBlock(_sfc_main$m, {
|
|
8464
8467
|
data: codeList.value,
|
|
8465
8468
|
"node-status-map": unref(nodeStatusMap),
|
|
8469
|
+
indent: _ctx.indent,
|
|
8470
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8466
8471
|
onNodeClick: clickHandler
|
|
8467
8472
|
}, {
|
|
8468
8473
|
"tree-node-label": withCtx(({ data }) => [
|
|
@@ -8511,7 +8516,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
8511
8516
|
})
|
|
8512
8517
|
]),
|
|
8513
8518
|
_: 3
|
|
8514
|
-
}, 8, ["data", "node-status-map"]);
|
|
8519
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8515
8520
|
};
|
|
8516
8521
|
}
|
|
8517
8522
|
});
|
|
@@ -8523,6 +8528,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
8523
8528
|
},
|
|
8524
8529
|
__name: "CodeBlockListPanel",
|
|
8525
8530
|
props: {
|
|
8531
|
+
indent: {},
|
|
8532
|
+
nextLevelIndentIncrement: {},
|
|
8526
8533
|
customError: { type: Function }
|
|
8527
8534
|
},
|
|
8528
8535
|
setup(__props) {
|
|
@@ -8551,9 +8558,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
8551
8558
|
size: "small",
|
|
8552
8559
|
onClick: unref(createCodeBlock)
|
|
8553
8560
|
}, {
|
|
8554
|
-
default: withCtx(() => [
|
|
8561
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
8555
8562
|
createTextVNode("新增")
|
|
8556
|
-
]),
|
|
8563
|
+
])),
|
|
8557
8564
|
_: 1
|
|
8558
8565
|
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
8559
8566
|
renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
@@ -8563,6 +8570,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
8563
8570
|
ref_key: "codeBlockList",
|
|
8564
8571
|
ref: codeBlockList,
|
|
8565
8572
|
"custom-error": _ctx.customError,
|
|
8573
|
+
indent: _ctx.indent,
|
|
8574
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8566
8575
|
onEdit: unref(editCode),
|
|
8567
8576
|
onRemove: unref(deleteCode)
|
|
8568
8577
|
}, {
|
|
@@ -8573,7 +8582,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
8573
8582
|
})
|
|
8574
8583
|
]),
|
|
8575
8584
|
_: 3
|
|
8576
|
-
}, 8, ["custom-error", "onEdit", "onRemove"])
|
|
8585
|
+
}, 8, ["custom-error", "indent", "next-level-indent-increment", "onEdit", "onRemove"])
|
|
8577
8586
|
]),
|
|
8578
8587
|
_: 3
|
|
8579
8588
|
}),
|
|
@@ -8701,6 +8710,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
8701
8710
|
name: "MEditorDataSourceList"
|
|
8702
8711
|
},
|
|
8703
8712
|
__name: "DataSourceList",
|
|
8713
|
+
props: {
|
|
8714
|
+
indent: {},
|
|
8715
|
+
nextLevelIndentIncrement: {}
|
|
8716
|
+
},
|
|
8704
8717
|
emits: ["edit", "remove"],
|
|
8705
8718
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8706
8719
|
const emit = __emit;
|
|
@@ -8796,6 +8809,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
8796
8809
|
return openBlock(), createBlock(_sfc_main$m, {
|
|
8797
8810
|
data: list.value,
|
|
8798
8811
|
"node-status-map": unref(nodeStatusMap),
|
|
8812
|
+
indent: _ctx.indent,
|
|
8813
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8799
8814
|
onNodeClick: clickHandler
|
|
8800
8815
|
}, {
|
|
8801
8816
|
"tree-node-label": withCtx(({ data }) => [
|
|
@@ -8841,7 +8856,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
8841
8856
|
renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
|
|
8842
8857
|
]),
|
|
8843
8858
|
_: 3
|
|
8844
|
-
}, 8, ["data", "node-status-map"]);
|
|
8859
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment"]);
|
|
8845
8860
|
};
|
|
8846
8861
|
}
|
|
8847
8862
|
});
|
|
@@ -8852,6 +8867,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
8852
8867
|
name: "MEditorDataSourceListPanel"
|
|
8853
8868
|
},
|
|
8854
8869
|
__name: "DataSourceListPanel",
|
|
8870
|
+
props: {
|
|
8871
|
+
indent: {},
|
|
8872
|
+
nextLevelIndentIncrement: {}
|
|
8873
|
+
},
|
|
8855
8874
|
setup(__props) {
|
|
8856
8875
|
const eventBus = inject("eventBus");
|
|
8857
8876
|
const { dataSourceService } = inject("services") || {};
|
|
@@ -8897,16 +8916,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
8897
8916
|
key: 0,
|
|
8898
8917
|
placement: "right",
|
|
8899
8918
|
trigger: "hover",
|
|
8900
|
-
"popper-class": "data-source-list-panel-add-menu"
|
|
8919
|
+
"popper-class": "data-source-list-panel-add-menu",
|
|
8920
|
+
"destroy-on-close": true
|
|
8901
8921
|
}, {
|
|
8902
8922
|
reference: withCtx(() => [
|
|
8903
8923
|
createVNode(unref(TMagicButton), {
|
|
8904
8924
|
type: "primary",
|
|
8905
8925
|
size: "small"
|
|
8906
8926
|
}, {
|
|
8907
|
-
default: withCtx(() => [
|
|
8927
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
8908
8928
|
createTextVNode("新增")
|
|
8909
|
-
]),
|
|
8929
|
+
])),
|
|
8910
8930
|
_: 1
|
|
8911
8931
|
})
|
|
8912
8932
|
]),
|
|
@@ -8931,9 +8951,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
8931
8951
|
createVNode(_sfc_main$i, {
|
|
8932
8952
|
ref_key: "dataSourceList",
|
|
8933
8953
|
ref: dataSourceList,
|
|
8954
|
+
indent: _ctx.indent,
|
|
8955
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
8934
8956
|
onEdit: unref(editHandler),
|
|
8935
8957
|
onRemove: removeHandler
|
|
8936
|
-
}, null, 8, ["onEdit"])
|
|
8958
|
+
}, null, 8, ["indent", "next-level-indent-increment", "onEdit"])
|
|
8937
8959
|
]),
|
|
8938
8960
|
_: 3
|
|
8939
8961
|
}),
|
|
@@ -9123,18 +9145,6 @@ const _hoisted_1$5 = {
|
|
|
9123
9145
|
fill: "currentColor",
|
|
9124
9146
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9125
9147
|
};
|
|
9126
|
-
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("path", {
|
|
9127
|
-
"fill-rule": "evenodd",
|
|
9128
|
-
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"
|
|
9129
|
-
}, null, -1);
|
|
9130
|
-
const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
9131
|
-
"fill-rule": "evenodd",
|
|
9132
|
-
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"
|
|
9133
|
-
}, null, -1);
|
|
9134
|
-
const _hoisted_4$2 = [
|
|
9135
|
-
_hoisted_2$4,
|
|
9136
|
-
_hoisted_3$2
|
|
9137
|
-
];
|
|
9138
9148
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
9139
9149
|
...{
|
|
9140
9150
|
name: "MEditorFolderMinusIcon"
|
|
@@ -9142,7 +9152,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
9142
9152
|
__name: "FolderMinusIcon",
|
|
9143
9153
|
setup(__props) {
|
|
9144
9154
|
return (_ctx, _cache) => {
|
|
9145
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$5,
|
|
9155
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$5, _cache[0] || (_cache[0] = [
|
|
9156
|
+
createElementVNode("path", {
|
|
9157
|
+
"fill-rule": "evenodd",
|
|
9158
|
+
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"
|
|
9159
|
+
}, null, -1),
|
|
9160
|
+
createElementVNode("path", {
|
|
9161
|
+
"fill-rule": "evenodd",
|
|
9162
|
+
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"
|
|
9163
|
+
}, null, -1)
|
|
9164
|
+
]));
|
|
9146
9165
|
};
|
|
9147
9166
|
}
|
|
9148
9167
|
});
|
|
@@ -9181,8 +9200,8 @@ const usePasteMenu = (menu) => ({
|
|
|
9181
9200
|
const stage = services?.editorService?.get("stage");
|
|
9182
9201
|
const rect = menu.value.$el.getBoundingClientRect();
|
|
9183
9202
|
const parentRect = stage?.container?.getBoundingClientRect();
|
|
9184
|
-
const initialLeft = calcValueByFontsize(stage?.renderer
|
|
9185
|
-
const initialTop = calcValueByFontsize(stage?.renderer
|
|
9203
|
+
const initialLeft = calcValueByFontsize(stage?.renderer?.getDocument(), (rect.left || 0) - (parentRect?.left || 0)) / services.uiService.get("zoom");
|
|
9204
|
+
const initialTop = calcValueByFontsize(stage?.renderer?.getDocument(), (rect.top || 0) - (parentRect?.top || 0)) / services.uiService.get("zoom");
|
|
9186
9205
|
services?.editorService?.paste({ left: initialLeft, top: initialTop });
|
|
9187
9206
|
} else {
|
|
9188
9207
|
services?.editorService?.paste();
|
|
@@ -9827,6 +9846,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
9827
9846
|
__name: "LayerPanel",
|
|
9828
9847
|
props: {
|
|
9829
9848
|
layerContentMenu: {},
|
|
9849
|
+
indent: {},
|
|
9850
|
+
nextLevelIndentIncrement: {},
|
|
9830
9851
|
customContentMenu: { type: Function }
|
|
9831
9852
|
},
|
|
9832
9853
|
setup(__props) {
|
|
@@ -9876,6 +9897,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
9876
9897
|
ref: tree,
|
|
9877
9898
|
data: nodeData.value,
|
|
9878
9899
|
"node-status-map": unref(nodeStatusMap),
|
|
9900
|
+
indent: _ctx.indent,
|
|
9901
|
+
"next-level-indent-increment": _ctx.nextLevelIndentIncrement,
|
|
9879
9902
|
onNodeDragover: unref(handleDragOver),
|
|
9880
9903
|
onNodeDragstart: unref(handleDragStart),
|
|
9881
9904
|
onNodeDragleave: unref(handleDragLeave),
|
|
@@ -9896,7 +9919,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
9896
9919
|
renderSlot(_ctx.$slots, "layer-node-label", { data: nodeData2 })
|
|
9897
9920
|
]),
|
|
9898
9921
|
_: 3
|
|
9899
|
-
}, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : createCommentVNode("", true),
|
|
9922
|
+
}, 8, ["data", "node-status-map", "indent", "next-level-indent-increment", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : createCommentVNode("", true),
|
|
9900
9923
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
9901
9924
|
createVNode(_sfc_main$e, {
|
|
9902
9925
|
ref_key: "menu",
|
|
@@ -9914,7 +9937,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
9914
9937
|
});
|
|
9915
9938
|
|
|
9916
9939
|
const _hoisted_1$4 = ["onClick", "onDragstart"];
|
|
9917
|
-
const _hoisted_2$
|
|
9940
|
+
const _hoisted_2$2 = ["title"];
|
|
9918
9941
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
9919
9942
|
...{
|
|
9920
9943
|
name: "MEditorComponentListPanel"
|
|
@@ -9965,7 +9988,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
9965
9988
|
globalThis.clearTimeout(timeout);
|
|
9966
9989
|
timeout = void 0;
|
|
9967
9990
|
}
|
|
9968
|
-
const doc = stage.value?.renderer
|
|
9991
|
+
const doc = stage.value?.renderer?.getDocument();
|
|
9969
9992
|
if (doc && stageOptions?.containerHighlightClassName) {
|
|
9970
9993
|
removeClassNameByClassName(doc, stageOptions.containerHighlightClassName);
|
|
9971
9994
|
}
|
|
@@ -10032,7 +10055,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
10032
10055
|
}, 1032, ["disabled", "content"]),
|
|
10033
10056
|
createElementVNode("span", {
|
|
10034
10057
|
title: item.text
|
|
10035
|
-
}, toDisplayString(item.text), 9, _hoisted_2$
|
|
10058
|
+
}, toDisplayString(item.text), 9, _hoisted_2$2)
|
|
10036
10059
|
])
|
|
10037
10060
|
], 40, _hoisted_1$4);
|
|
10038
10061
|
}), 128))
|
|
@@ -10056,13 +10079,13 @@ const _hoisted_1$3 = {
|
|
|
10056
10079
|
key: 0,
|
|
10057
10080
|
class: "m-editor-sidebar"
|
|
10058
10081
|
};
|
|
10059
|
-
const _hoisted_2$
|
|
10060
|
-
const _hoisted_3
|
|
10061
|
-
const _hoisted_4
|
|
10082
|
+
const _hoisted_2$1 = { class: "m-editor-sidebar-header" };
|
|
10083
|
+
const _hoisted_3 = ["draggable", "onClick", "onDragend"];
|
|
10084
|
+
const _hoisted_4 = {
|
|
10062
10085
|
key: 1,
|
|
10063
10086
|
class: "magic-editor-tab-panel-title"
|
|
10064
10087
|
};
|
|
10065
|
-
const _hoisted_5
|
|
10088
|
+
const _hoisted_5 = { class: "m-editor-slide-list-box" };
|
|
10066
10089
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
10067
10090
|
...{
|
|
10068
10091
|
name: "MEditorSidebar"
|
|
@@ -10075,6 +10098,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10075
10098
|
items: [SideItemKey.COMPONENT_LIST, SideItemKey.LAYER, SideItemKey.CODE_BLOCK, SideItemKey.DATA_SOURCE]
|
|
10076
10099
|
}) },
|
|
10077
10100
|
layerContentMenu: {},
|
|
10101
|
+
indent: {},
|
|
10102
|
+
nextLevelIndentIncrement: {},
|
|
10078
10103
|
customContentMenu: {}
|
|
10079
10104
|
},
|
|
10080
10105
|
setup(__props, { expose: __expose }) {
|
|
@@ -10115,7 +10140,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10115
10140
|
text: "已选组件",
|
|
10116
10141
|
props: {
|
|
10117
10142
|
layerContentMenu: props.layerContentMenu,
|
|
10118
|
-
customContentMenu: props.customContentMenu
|
|
10143
|
+
customContentMenu: props.customContentMenu,
|
|
10144
|
+
indent: props.indent,
|
|
10145
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10119
10146
|
},
|
|
10120
10147
|
component: _sfc_main$c,
|
|
10121
10148
|
slots: {}
|
|
@@ -10126,6 +10153,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10126
10153
|
icon: EditPen,
|
|
10127
10154
|
text: "代码编辑",
|
|
10128
10155
|
component: _sfc_main$k,
|
|
10156
|
+
props: {
|
|
10157
|
+
indent: props.indent,
|
|
10158
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10159
|
+
},
|
|
10129
10160
|
slots: {}
|
|
10130
10161
|
},
|
|
10131
10162
|
[SideItemKey.DATA_SOURCE]: {
|
|
@@ -10134,6 +10165,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10134
10165
|
icon: Coin,
|
|
10135
10166
|
text: "数据源",
|
|
10136
10167
|
component: _sfc_main$h,
|
|
10168
|
+
props: {
|
|
10169
|
+
indent: props.indent,
|
|
10170
|
+
nextLevelIndentIncrement: props.nextLevelIndentIncrement
|
|
10171
|
+
},
|
|
10137
10172
|
slots: {}
|
|
10138
10173
|
}
|
|
10139
10174
|
};
|
|
@@ -10188,7 +10223,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10188
10223
|
return (_ctx, _cache) => {
|
|
10189
10224
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
10190
10225
|
_ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
10191
|
-
createElementVNode("div", _hoisted_2$
|
|
10226
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
10192
10227
|
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
10193
10228
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
10194
10229
|
class: normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
|
|
@@ -10204,8 +10239,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10204
10239
|
key: 0,
|
|
10205
10240
|
icon: config.icon
|
|
10206
10241
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
10207
|
-
config.text ? (openBlock(), createElementBlock("div", _hoisted_4
|
|
10208
|
-
], 46, _hoisted_3
|
|
10242
|
+
config.text ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(config.text), 1)) : createCommentVNode("", true)
|
|
10243
|
+
], 46, _hoisted_3)), [
|
|
10209
10244
|
[vShow, !unref(floatBoxStates)[config.$key]?.status]
|
|
10210
10245
|
]);
|
|
10211
10246
|
}), 128))
|
|
@@ -10360,7 +10395,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
10360
10395
|
}
|
|
10361
10396
|
}, {
|
|
10362
10397
|
body: withCtx(() => [
|
|
10363
|
-
createElementVNode("div", _hoisted_5
|
|
10398
|
+
createElementVNode("div", _hoisted_5, [
|
|
10364
10399
|
config && unref(floatBoxStates)[config.$key].status ? (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({
|
|
10365
10400
|
key: 0,
|
|
10366
10401
|
ref_for: true
|
|
@@ -10591,7 +10626,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
10591
10626
|
if (!stage2) return;
|
|
10592
10627
|
nextTick(() => unWatch());
|
|
10593
10628
|
stage2.on("select", (el, event) => {
|
|
10594
|
-
const els = stage2.renderer
|
|
10629
|
+
const els = stage2.renderer?.getElementsFromPoint(event) || [];
|
|
10595
10630
|
const ids = els.map((el2) => getIdFromEl()(el2)).filter((id) => Boolean(id));
|
|
10596
10631
|
buttonVisible.value = ids.length > 3;
|
|
10597
10632
|
filterTextChangeHandler(ids);
|
|
@@ -10690,7 +10725,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10690
10725
|
watch(stage, (stage2) => {
|
|
10691
10726
|
if (stage2) {
|
|
10692
10727
|
stage2.on("dblclick", async (event) => {
|
|
10693
|
-
const el = await stage2.actionManager
|
|
10728
|
+
const el = await stage2.actionManager?.getElementFromPoint(event) || null;
|
|
10694
10729
|
services?.stageOverlayService.openOverlay(el);
|
|
10695
10730
|
});
|
|
10696
10731
|
} else {
|
|
@@ -10705,11 +10740,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10705
10740
|
subStage.mount(stageOverlay2);
|
|
10706
10741
|
const { mask, renderer } = subStage;
|
|
10707
10742
|
const { contentWindow } = renderer;
|
|
10708
|
-
mask
|
|
10743
|
+
mask?.showRule(false);
|
|
10709
10744
|
services?.stageOverlayService.updateOverlay();
|
|
10710
10745
|
contentWindow?.magic.onRuntimeReady({});
|
|
10711
10746
|
}
|
|
10712
10747
|
});
|
|
10748
|
+
onBeforeUnmount(() => {
|
|
10749
|
+
services?.stageOverlayService.get("stage")?.destroy();
|
|
10750
|
+
services?.stageOverlayService.set("stage", null);
|
|
10751
|
+
});
|
|
10713
10752
|
const closeOverlayHandler = () => {
|
|
10714
10753
|
services?.stageOverlayService.closeOverlay();
|
|
10715
10754
|
};
|
|
@@ -10747,32 +10786,6 @@ const _hoisted_1$2 = {
|
|
|
10747
10786
|
fill: "none",
|
|
10748
10787
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10749
10788
|
};
|
|
10750
|
-
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
10751
|
-
"fill-rule": "evenodd",
|
|
10752
|
-
"clip-rule": "evenodd",
|
|
10753
|
-
d: "M2 4H21V6H2V4Z",
|
|
10754
|
-
fill: "black",
|
|
10755
|
-
"fill-opacity": "0.9"
|
|
10756
|
-
}, null, -1);
|
|
10757
|
-
const _hoisted_3 = /* @__PURE__ */ createElementVNode("path", {
|
|
10758
|
-
"fill-rule": "evenodd",
|
|
10759
|
-
"clip-rule": "evenodd",
|
|
10760
|
-
d: "M5 11H18V13H5V11Z",
|
|
10761
|
-
fill: "black",
|
|
10762
|
-
"fill-opacity": "0.9"
|
|
10763
|
-
}, null, -1);
|
|
10764
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("path", {
|
|
10765
|
-
"fill-rule": "evenodd",
|
|
10766
|
-
"clip-rule": "evenodd",
|
|
10767
|
-
d: "M2 18H21V20H2V18Z",
|
|
10768
|
-
fill: "black",
|
|
10769
|
-
"fill-opacity": "0.9"
|
|
10770
|
-
}, null, -1);
|
|
10771
|
-
const _hoisted_5 = [
|
|
10772
|
-
_hoisted_2$1,
|
|
10773
|
-
_hoisted_3,
|
|
10774
|
-
_hoisted_4
|
|
10775
|
-
];
|
|
10776
10789
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
10777
10790
|
...{
|
|
10778
10791
|
name: "MEditorCenterIcon"
|
|
@@ -10780,7 +10793,29 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
10780
10793
|
__name: "CenterIcon",
|
|
10781
10794
|
setup(__props) {
|
|
10782
10795
|
return (_ctx, _cache) => {
|
|
10783
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$2,
|
|
10796
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
|
|
10797
|
+
createElementVNode("path", {
|
|
10798
|
+
"fill-rule": "evenodd",
|
|
10799
|
+
"clip-rule": "evenodd",
|
|
10800
|
+
d: "M2 4H21V6H2V4Z",
|
|
10801
|
+
fill: "black",
|
|
10802
|
+
"fill-opacity": "0.9"
|
|
10803
|
+
}, null, -1),
|
|
10804
|
+
createElementVNode("path", {
|
|
10805
|
+
"fill-rule": "evenodd",
|
|
10806
|
+
"clip-rule": "evenodd",
|
|
10807
|
+
d: "M5 11H18V13H5V11Z",
|
|
10808
|
+
fill: "black",
|
|
10809
|
+
"fill-opacity": "0.9"
|
|
10810
|
+
}, null, -1),
|
|
10811
|
+
createElementVNode("path", {
|
|
10812
|
+
"fill-rule": "evenodd",
|
|
10813
|
+
"clip-rule": "evenodd",
|
|
10814
|
+
d: "M2 18H21V20H2V18Z",
|
|
10815
|
+
fill: "black",
|
|
10816
|
+
"fill-opacity": "0.9"
|
|
10817
|
+
}, null, -1)
|
|
10818
|
+
]));
|
|
10784
10819
|
};
|
|
10785
10820
|
}
|
|
10786
10821
|
});
|
|
@@ -10961,6 +10996,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
10961
10996
|
});
|
|
10962
10997
|
});
|
|
10963
10998
|
});
|
|
10999
|
+
onBeforeUnmount(() => {
|
|
11000
|
+
stage?.destroy();
|
|
11001
|
+
});
|
|
10964
11002
|
watch(zoom, (zoom2) => {
|
|
10965
11003
|
if (!stage || !zoom2) return;
|
|
10966
11004
|
stage.setZoom(zoom2);
|
|
@@ -11001,7 +11039,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
11001
11039
|
services?.keybindingService.unregisterEl("stage");
|
|
11002
11040
|
services?.editorService.off("root-change", rootChangeHandler);
|
|
11003
11041
|
});
|
|
11004
|
-
const parseDSL =
|
|
11042
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11005
11043
|
const contextmenuHandler = (e) => {
|
|
11006
11044
|
e.preventDefault();
|
|
11007
11045
|
menu.value?.show(e);
|
|
@@ -11018,7 +11056,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
11018
11056
|
const config = parseDSL(`(${data})`);
|
|
11019
11057
|
if (!config || config.dragType !== DragType.COMPONENT_LIST) return;
|
|
11020
11058
|
e.preventDefault();
|
|
11021
|
-
const doc = stage?.renderer
|
|
11059
|
+
const doc = stage?.renderer?.contentWindow?.document;
|
|
11022
11060
|
const parentEl = doc?.querySelector(`.${stageOptions?.containerHighlightClassName}`);
|
|
11023
11061
|
let parent = page.value;
|
|
11024
11062
|
const parentId = getIdFromEl()(parentEl);
|
|
@@ -11252,7 +11290,7 @@ class CodeBlock extends BaseService {
|
|
|
11252
11290
|
if (codeDsl[id] && !force) return;
|
|
11253
11291
|
const codeConfigProcessed = cloneDeep(codeConfig);
|
|
11254
11292
|
if (codeConfigProcessed.content) {
|
|
11255
|
-
const parseDSL =
|
|
11293
|
+
const parseDSL = getEditorConfig("parseDSL");
|
|
11256
11294
|
if (typeof codeConfigProcessed.content === "string") {
|
|
11257
11295
|
codeConfigProcessed.content = parseDSL(codeConfigProcessed.content);
|
|
11258
11296
|
}
|
|
@@ -11961,6 +11999,10 @@ class StageOverlay extends BaseService {
|
|
|
11961
11999
|
const subStage = this.get("stage");
|
|
11962
12000
|
const wrapDiv = this.get("wrapDiv");
|
|
11963
12001
|
subStage?.destroy();
|
|
12002
|
+
for (let i = 0, l = wrapDiv.children.length; i < l; i++) {
|
|
12003
|
+
const child = wrapDiv.children[i];
|
|
12004
|
+
child.remove();
|
|
12005
|
+
}
|
|
11964
12006
|
wrapDiv.remove();
|
|
11965
12007
|
this.set("stage", null);
|
|
11966
12008
|
this.set("sourceEl", null);
|
|
@@ -11986,7 +12028,7 @@ class StageOverlay extends BaseService {
|
|
|
11986
12028
|
autoScrollIntoView: false,
|
|
11987
12029
|
render: async (stage) => {
|
|
11988
12030
|
this.copyDocumentElement();
|
|
11989
|
-
const rootEls = stage.renderer
|
|
12031
|
+
const rootEls = stage.renderer?.getDocument()?.body.children;
|
|
11990
12032
|
if (rootEls) {
|
|
11991
12033
|
Array.from(rootEls).forEach((element) => {
|
|
11992
12034
|
if (["SCRIPT", "STYLE"].includes(element.tagName)) {
|
|
@@ -12015,8 +12057,8 @@ class StageOverlay extends BaseService {
|
|
|
12015
12057
|
copyDocumentElement() {
|
|
12016
12058
|
const subStage = this.get("stage");
|
|
12017
12059
|
const stage = editorService.get("stage");
|
|
12018
|
-
const doc = subStage?.renderer
|
|
12019
|
-
const documentElement = stage?.renderer
|
|
12060
|
+
const doc = subStage?.renderer?.getDocument();
|
|
12061
|
+
const documentElement = stage?.renderer?.getDocument()?.documentElement;
|
|
12020
12062
|
if (doc && documentElement) {
|
|
12021
12063
|
doc.replaceChild(documentElement.cloneNode(true), doc.documentElement);
|
|
12022
12064
|
}
|
|
@@ -12034,12 +12076,13 @@ class StageOverlay extends BaseService {
|
|
|
12034
12076
|
height: ${sourceEl?.scrollHeight}px;
|
|
12035
12077
|
background-color: #fff;
|
|
12036
12078
|
`;
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12079
|
+
for (let i = 0, l = wrapDiv.children.length; i < l; i++) {
|
|
12080
|
+
const child = wrapDiv.children[i];
|
|
12081
|
+
child.remove();
|
|
12082
|
+
}
|
|
12040
12083
|
wrapDiv.appendChild(contentEl);
|
|
12041
12084
|
setTimeout(() => {
|
|
12042
|
-
subStage?.renderer
|
|
12085
|
+
subStage?.renderer?.contentWindow?.magic.onPageElUpdate(wrapDiv);
|
|
12043
12086
|
});
|
|
12044
12087
|
if (await stageOptions?.canSelect?.(contentEl)) {
|
|
12045
12088
|
const id = getIdFromEl()(contentEl);
|
|
@@ -12279,7 +12322,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
12279
12322
|
};
|
|
12280
12323
|
const getApp = () => {
|
|
12281
12324
|
const stage = editorService.get("stage");
|
|
12282
|
-
return stage?.renderer
|
|
12325
|
+
return stage?.renderer?.runtime?.getApp?.();
|
|
12283
12326
|
};
|
|
12284
12327
|
const updateDataSourceSchema = () => {
|
|
12285
12328
|
const root = editorService.get("root");
|
|
@@ -12312,7 +12355,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
12312
12355
|
delete root.dataSourceCondDeps[id];
|
|
12313
12356
|
}
|
|
12314
12357
|
};
|
|
12315
|
-
const collectedHandler = (nodes, deep) => {
|
|
12358
|
+
const collectedHandler = debounce((nodes, deep) => {
|
|
12316
12359
|
const root = editorService.get("root");
|
|
12317
12360
|
const stage = editorService.get("stage");
|
|
12318
12361
|
if (!root || !stage) return;
|
|
@@ -12347,7 +12390,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
12347
12390
|
});
|
|
12348
12391
|
});
|
|
12349
12392
|
});
|
|
12350
|
-
};
|
|
12393
|
+
}, 300);
|
|
12351
12394
|
depService.on("add-target", targetAddHandler);
|
|
12352
12395
|
depService.on("remove-target", targetRemoveHandler);
|
|
12353
12396
|
depService.on("collected", collectedHandler);
|
|
@@ -12471,6 +12514,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12471
12514
|
disabledPageFragment: { type: Boolean },
|
|
12472
12515
|
disabledStageOverlay: { type: Boolean },
|
|
12473
12516
|
disabledShowSrc: { type: Boolean },
|
|
12517
|
+
treeIndent: {},
|
|
12518
|
+
treeNextLevelIndentIncrement: {},
|
|
12474
12519
|
render: { type: Function },
|
|
12475
12520
|
updateDragEl: { type: Function },
|
|
12476
12521
|
canSelect: { type: Function },
|
|
@@ -12547,7 +12592,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12547
12592
|
createVNode(_sfc_main$a, {
|
|
12548
12593
|
data: _ctx.sidebar,
|
|
12549
12594
|
"layer-content-menu": _ctx.layerContentMenu,
|
|
12550
|
-
"custom-content-menu": _ctx.customContentMenu
|
|
12595
|
+
"custom-content-menu": _ctx.customContentMenu,
|
|
12596
|
+
indent: _ctx.treeIndent,
|
|
12597
|
+
"next-level-indent-increment": _ctx.treeNextLevelIndentIncrement
|
|
12551
12598
|
}, {
|
|
12552
12599
|
"layer-panel-header": withCtx(() => [
|
|
12553
12600
|
renderSlot(_ctx.$slots, "layer-panel-header")
|
|
@@ -12589,7 +12636,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12589
12636
|
renderSlot(_ctx.$slots, "data-source-panel-search")
|
|
12590
12637
|
]),
|
|
12591
12638
|
_: 3
|
|
12592
|
-
}, 8, ["data", "layer-content-menu", "custom-content-menu"])
|
|
12639
|
+
}, 8, ["data", "layer-content-menu", "custom-content-menu", "indent", "next-level-indent-increment"])
|
|
12593
12640
|
])
|
|
12594
12641
|
]),
|
|
12595
12642
|
workspace: withCtx(() => [
|
|
@@ -12659,8 +12706,11 @@ const defaultInstallOpt = {
|
|
|
12659
12706
|
const index = {
|
|
12660
12707
|
install: (app, opt) => {
|
|
12661
12708
|
const option = Object.assign(defaultInstallOpt, opt || {});
|
|
12709
|
+
app.use(designPlugin__default, opt || {});
|
|
12710
|
+
app.use(formPlugin__default, opt || {});
|
|
12711
|
+
app.use(tablePlugin__default);
|
|
12662
12712
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
12663
|
-
|
|
12713
|
+
setEditorConfig(option);
|
|
12664
12714
|
app.component(`${_sfc_main.name || "MEditor"}`, _sfc_main);
|
|
12665
12715
|
app.component("magic-code-editor", _sfc_main$X);
|
|
12666
12716
|
app.component("m-fields-ui-select", _sfc_main$B);
|
|
@@ -12683,4 +12733,4 @@ const index = {
|
|
|
12683
12733
|
}
|
|
12684
12734
|
};
|
|
12685
12735
|
|
|
12686
|
-
export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$L as CodeBlockEditor, _sfc_main$l as CodeBlockList, _sfc_main$k as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$U as CodeSelect, _sfc_main$S as CodeSelectCol, ColumnLayout, _sfc_main$b as ComponentListPanel, _sfc_main$R as CondOpSelect, _sfc_main$g as ContentMenu, _sfc_main$j as DataSourceConfigPanel, _sfc_main$N as DataSourceFieldSelect, _sfc_main$P as DataSourceFields, _sfc_main$M as DataSourceInput, _sfc_main$J as DataSourceMethodSelect, _sfc_main$K as DataSourceMethods, _sfc_main$I as DataSourceMocks, _sfc_main$H as DataSourceSelect, _sfc_main$G as DisplayConds, DragType, _sfc_main$F as EventSelect, Fixed2Other, _sfc_main$Q as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$Y as Icon, IdleTask, KeyBindingCommand, _sfc_main$D as KeyValue, Keys, LayerOffset, _sfc_main$c as LayerPanel, Layout, _sfc_main$z as LayoutContainer, _sfc_main$C as PageFragmentSelect, _sfc_main$p as PropsPanel, _sfc_main$A as Resizer, ScrollViewer, SideItemKey, _sfc_main$z as SplitView, _sfc_main$X as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$y as ToolButton, _sfc_main$m as Tree, _sfc_main$n as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, eqOptions, error, eventTabConfig, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields,
|
|
12736
|
+
export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$L as CodeBlockEditor, _sfc_main$l as CodeBlockList, _sfc_main$k as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$U as CodeSelect, _sfc_main$S as CodeSelectCol, ColumnLayout, _sfc_main$b as ComponentListPanel, _sfc_main$R as CondOpSelect, _sfc_main$g as ContentMenu, _sfc_main$j as DataSourceConfigPanel, _sfc_main$N as DataSourceFieldSelect, _sfc_main$P as DataSourceFields, _sfc_main$M as DataSourceInput, _sfc_main$J as DataSourceMethodSelect, _sfc_main$K as DataSourceMethods, _sfc_main$I as DataSourceMocks, _sfc_main$H as DataSourceSelect, _sfc_main$G as DisplayConds, DragType, _sfc_main$F as EventSelect, Fixed2Other, _sfc_main$Q as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$Y as Icon, IdleTask, KeyBindingCommand, _sfc_main$D as KeyValue, Keys, LayerOffset, _sfc_main$c as LayerPanel, Layout, _sfc_main$z as LayoutContainer, _sfc_main$C as PageFragmentSelect, _sfc_main$p as PropsPanel, _sfc_main$A as Resizer, ScrollViewer, SideItemKey, _sfc_main$z as SplitView, _sfc_main$X as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$y as ToolButton, _sfc_main$m as Tree, _sfc_main$n as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, eqOptions, error, eventTabConfig, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getDefaultConfig, getDisplayField, getEditorConfig, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, log, moveItemsInContainer, numberOptions, propsService, removeDataSourceFieldPrefix, serializeConfig, setChildrenLayout, setEditorConfig, setLayout, stageOverlayService, storageService, styleTabConfig, uiService, updateStatus, useCodeBlockEdit, useDataSourceMethod, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus$1 as useNodeStatus, useStage, useWindowRect, warn };
|