@tmagic/editor 1.2.0-beta.2 → 1.2.0-beta.20
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 +41 -28
- package/dist/tmagic-editor.mjs +1641 -1257
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +1648 -1259
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +11 -10
- package/src/Editor.vue +48 -30
- package/src/components/CodeDraftEditor.vue +145 -0
- package/src/components/ContentMenu.vue +4 -4
- package/src/components/FunctionEditor.vue +145 -0
- package/src/components/Icon.vue +7 -5
- package/src/components/Layout.vue +149 -0
- package/src/components/ScrollBar.vue +1 -1
- package/src/components/ScrollViewer.vue +10 -1
- package/src/components/ToolButton.vue +30 -15
- package/src/fields/Code.vue +1 -1
- package/src/fields/CodeLink.vue +1 -1
- package/src/fields/CodeSelect.vue +89 -110
- package/src/fields/UISelect.vue +9 -8
- package/src/index.ts +1 -0
- package/src/layouts/AddPageBox.vue +3 -2
- package/src/layouts/CodeEditor.vue +2 -3
- package/src/layouts/Framework.vue +62 -40
- package/src/layouts/NavMenu.vue +1 -1
- package/src/layouts/PropsPanel.vue +11 -13
- package/src/layouts/Resizer.vue +1 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +15 -13
- package/src/layouts/sidebar/LayerMenu.vue +9 -7
- package/src/layouts/sidebar/LayerPanel.vue +277 -177
- package/src/layouts/sidebar/Sidebar.vue +113 -27
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +34 -85
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -89
- package/src/layouts/workspace/Breadcrumb.vue +32 -0
- package/src/layouts/workspace/PageBar.vue +12 -11
- package/src/layouts/workspace/PageBarScrollContainer.vue +1 -1
- package/src/layouts/workspace/Stage.vue +26 -9
- package/src/layouts/workspace/ViewerMenu.vue +11 -9
- package/src/layouts/workspace/Workspace.vue +10 -3
- package/src/services/BaseService.ts +1 -1
- package/src/services/codeBlock.ts +118 -125
- package/src/services/editor.ts +35 -16
- package/src/services/history.ts +4 -14
- package/src/services/props.ts +1 -1
- package/src/theme/breadcrumb.scss +6 -0
- package/src/theme/code-block.scss +30 -21
- package/src/theme/component-list-panel.scss +3 -7
- package/src/theme/layer-panel.scss +7 -2
- package/src/theme/theme.scss +1 -0
- package/src/type.ts +76 -50
- package/src/utils/editor.ts +9 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/props.ts +2 -2
- package/src/utils/scroll-viewer.ts +18 -2
- package/src/utils/stage.ts +9 -2
- package/types/Editor.vue.d.ts +42 -29
- package/types/components/CodeDraftEditor.vue.d.ts +148 -0
- package/types/components/ContentMenu.vue.d.ts +1 -3
- package/types/components/FunctionEditor.vue.d.ts +120 -0
- package/types/components/Icon.vue.d.ts +1 -3
- package/types/{layouts → components}/Layout.vue.d.ts +12 -1
- package/types/components/ScrollBar.vue.d.ts +1 -3
- package/types/components/ScrollViewer.vue.d.ts +45 -1
- package/types/components/ToolButton.vue.d.ts +1 -3
- package/types/fields/Code.vue.d.ts +1 -3
- package/types/fields/CodeLink.vue.d.ts +1 -3
- package/types/fields/CodeSelect.vue.d.ts +10 -12
- package/types/fields/UISelect.vue.d.ts +1 -3
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +1 -3
- package/types/layouts/CodeEditor.vue.d.ts +6 -15
- package/types/layouts/NavMenu.vue.d.ts +1 -3
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +25 -9
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +38 -886
- package/types/layouts/sidebar/Sidebar.vue.d.ts +10 -5
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +1 -1
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +6 -5
- package/types/layouts/{sidebar/TabPane.vue.d.ts → workspace/Breadcrumb.vue.d.ts} +5 -43
- package/types/layouts/workspace/Stage.vue.d.ts +25 -8
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +6 -3
- package/types/layouts/workspace/Workspace.vue.d.ts +23 -5
- package/types/services/BaseService.d.ts +1 -1
- package/types/services/codeBlock.d.ts +56 -36
- package/types/services/editor.d.ts +4 -6
- package/types/services/history.d.ts +4 -14
- package/types/services/props.d.ts +2 -2
- package/types/services/ui.d.ts +1 -1
- package/types/type.d.ts +64 -48
- package/types/utils/editor.d.ts +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/props.d.ts +1 -1
- package/types/utils/scroll-viewer.d.ts +5 -0
- package/src/layouts/Layout.vue +0 -100
- package/src/layouts/sidebar/TabPane.vue +0 -116
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.
|
|
5
|
-
})(this, (function (exports, vue, serialize,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('lodash-es'), require('@tmagic/form'), require('@tmagic/schema'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('monaco-editor'), require('@tmagic/stage'), require('gesto'), require('@tmagic/utils'), require('events'), require('@tmagic/core'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', 'lodash-es', '@tmagic/form', '@tmagic/schema', '@element-plus/icons-vue', '@tmagic/design', 'monaco-editor', '@tmagic/stage', 'gesto', '@tmagic/utils', 'events', '@tmagic/core', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.lodashEs, global.form, global.schema, global.iconsVue, global.design, global.monaco, global.StageCore, global.Gesto, global.utils, global.events, global.core, global.KeyController));
|
|
5
|
+
})(this, (function (exports, vue, serialize, lodashEs, form, schema, iconsVue, design, monaco, StageCore, Gesto, utils, events, core, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
8
8
|
|
|
@@ -30,8 +30,11 @@
|
|
|
30
30
|
const Gesto__default = /*#__PURE__*/_interopDefaultLegacy(Gesto);
|
|
31
31
|
const KeyController__default = /*#__PURE__*/_interopDefaultLegacy(KeyController);
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const __default__$t = vue.defineComponent({
|
|
34
|
+
name: "MEditorCode"
|
|
35
|
+
});
|
|
36
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
37
|
+
...__default__$t,
|
|
35
38
|
props: {
|
|
36
39
|
model: null,
|
|
37
40
|
name: null,
|
|
@@ -60,8 +63,11 @@
|
|
|
60
63
|
}
|
|
61
64
|
});
|
|
62
65
|
|
|
63
|
-
const
|
|
64
|
-
|
|
66
|
+
const __default__$s = vue.defineComponent({
|
|
67
|
+
name: "MEditorCodeLink"
|
|
68
|
+
});
|
|
69
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
70
|
+
...__default__$s,
|
|
65
71
|
props: {
|
|
66
72
|
config: null,
|
|
67
73
|
model: null,
|
|
@@ -130,57 +136,12 @@
|
|
|
130
136
|
}
|
|
131
137
|
});
|
|
132
138
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var LayerOffset = /* @__PURE__ */ ((LayerOffset2) => {
|
|
140
|
-
LayerOffset2["TOP"] = "top";
|
|
141
|
-
LayerOffset2["BOTTOM"] = "bottom";
|
|
142
|
-
return LayerOffset2;
|
|
143
|
-
})(LayerOffset || {});
|
|
144
|
-
var Layout = /* @__PURE__ */ ((Layout2) => {
|
|
145
|
-
Layout2["FLEX"] = "flex";
|
|
146
|
-
Layout2["FIXED"] = "fixed";
|
|
147
|
-
Layout2["RELATIVE"] = "relative";
|
|
148
|
-
Layout2["ABSOLUTE"] = "absolute";
|
|
149
|
-
return Layout2;
|
|
150
|
-
})(Layout || {});
|
|
151
|
-
var Keys = /* @__PURE__ */ ((Keys2) => {
|
|
152
|
-
Keys2["ESCAPE"] = "Space";
|
|
153
|
-
return Keys2;
|
|
154
|
-
})(Keys || {});
|
|
155
|
-
const H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
|
|
156
|
-
const V_GUIDE_LINE_STORAGE_KEY = "$MagicStageVerticalGuidelinesData";
|
|
157
|
-
var CodeEditorMode = /* @__PURE__ */ ((CodeEditorMode2) => {
|
|
158
|
-
CodeEditorMode2["LIST"] = "list";
|
|
159
|
-
CodeEditorMode2["EDITOR"] = "editor";
|
|
160
|
-
return CodeEditorMode2;
|
|
161
|
-
})(CodeEditorMode || {});
|
|
162
|
-
var CodeDeleteErrorType = /* @__PURE__ */ ((CodeDeleteErrorType2) => {
|
|
163
|
-
CodeDeleteErrorType2["UNDELETEABLE"] = "undeleteable";
|
|
164
|
-
CodeDeleteErrorType2["BIND"] = "bind";
|
|
165
|
-
return CodeDeleteErrorType2;
|
|
166
|
-
})(CodeDeleteErrorType || {});
|
|
167
|
-
var CodeSelectOp = /* @__PURE__ */ ((CodeSelectOp2) => {
|
|
168
|
-
CodeSelectOp2["ADD"] = "add";
|
|
169
|
-
CodeSelectOp2["DELETE"] = "delete";
|
|
170
|
-
CodeSelectOp2["CHANGE"] = "change";
|
|
171
|
-
return CodeSelectOp2;
|
|
172
|
-
})(CodeSelectOp || {});
|
|
173
|
-
|
|
174
|
-
const _hoisted_1$d = { class: "tool-bar" };
|
|
175
|
-
const _hoisted_2$6 = /* @__PURE__ */ vue.createElementVNode("path", {
|
|
176
|
-
fill: "currentColor",
|
|
177
|
-
d: "m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414L23 12zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414L3.828 12z"
|
|
178
|
-
}, null, -1);
|
|
179
|
-
const _hoisted_3$3 = [
|
|
180
|
-
_hoisted_2$6
|
|
181
|
-
];
|
|
182
|
-
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
183
|
-
__name: "CodeSelect",
|
|
139
|
+
const _hoisted_1$g = { class: "m-fields-code-select" };
|
|
140
|
+
const __default__$r = vue.defineComponent({
|
|
141
|
+
name: "MEditorCodeSelect"
|
|
142
|
+
});
|
|
143
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
144
|
+
...__default__$r,
|
|
184
145
|
props: {
|
|
185
146
|
config: null,
|
|
186
147
|
model: null,
|
|
@@ -192,125 +153,107 @@
|
|
|
192
153
|
setup(__props, { emit }) {
|
|
193
154
|
const props = __props;
|
|
194
155
|
const services = vue.inject("services");
|
|
195
|
-
const
|
|
156
|
+
const mForm = vue.inject("mForm");
|
|
157
|
+
const codeDsl = vue.computed(() => services?.codeBlockService.getCodeDslSync());
|
|
158
|
+
const tableConfig = vue.computed(() => {
|
|
196
159
|
const defaultConfig = {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
160
|
+
dropSort: true,
|
|
161
|
+
enableFullscreen: false,
|
|
162
|
+
border: true,
|
|
163
|
+
items: [
|
|
164
|
+
{
|
|
165
|
+
type: "select",
|
|
166
|
+
label: "\u4EE3\u7801\u5757",
|
|
167
|
+
name: "codeId",
|
|
168
|
+
width: "200px",
|
|
169
|
+
options: () => {
|
|
170
|
+
if (codeDsl.value) {
|
|
171
|
+
return lodashEs.map(codeDsl.value, (value, key) => ({
|
|
172
|
+
text: `${value.name}\uFF08${key}\uFF09`,
|
|
173
|
+
label: `${value.name}\uFF08${key}\uFF09`,
|
|
174
|
+
value: key
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
return [];
|
|
178
|
+
},
|
|
179
|
+
onChange: (formState, codeId, { model }) => {
|
|
180
|
+
model.params = {};
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "params",
|
|
185
|
+
label: "\u53C2\u6570",
|
|
186
|
+
defaultValue: {},
|
|
187
|
+
itemsFunction: (row) => {
|
|
188
|
+
const paramsConfig = getParamsConfig(row.codeId);
|
|
189
|
+
if (!row.params)
|
|
190
|
+
row.params = {};
|
|
191
|
+
if (lodashEs.isEmpty(row.params)) {
|
|
192
|
+
form.createValues(mForm, paramsConfig, {}, row.params);
|
|
193
|
+
}
|
|
194
|
+
return paramsConfig;
|
|
195
|
+
}
|
|
206
196
|
}
|
|
207
|
-
|
|
208
|
-
}
|
|
197
|
+
]
|
|
209
198
|
};
|
|
210
199
|
return {
|
|
211
200
|
...defaultConfig,
|
|
212
|
-
...props.config.
|
|
201
|
+
...props.config.tableConfig
|
|
213
202
|
};
|
|
214
203
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
});
|
|
228
|
-
const changeHandler = async (value) => {
|
|
229
|
-
let codeIds = value;
|
|
230
|
-
if (typeof value === "string") {
|
|
231
|
-
multiple.value = false;
|
|
232
|
-
lastTagSnapshot = [lastTagSnapshot];
|
|
233
|
-
codeIds = value ? [value] : [];
|
|
234
|
-
}
|
|
235
|
-
await setCombineRelation(codeIds);
|
|
236
|
-
emit("change", value);
|
|
237
|
-
};
|
|
238
|
-
const setCombineRelation = async (codeIds) => {
|
|
239
|
-
const { id = "" } = services?.editorService.get("node") || {};
|
|
240
|
-
let opFlag = CodeSelectOp.CHANGE;
|
|
241
|
-
let diffValues = codeIds;
|
|
242
|
-
if (multiple.value) {
|
|
243
|
-
opFlag = codeIds.length < lastTagSnapshot.length ? CodeSelectOp.DELETE : CodeSelectOp.ADD;
|
|
244
|
-
diffValues = lodashEs.xor(codeIds, lastTagSnapshot);
|
|
204
|
+
vue.watch(
|
|
205
|
+
() => props.model[props.name],
|
|
206
|
+
(value) => {
|
|
207
|
+
if (lodashEs.isEmpty(value)) {
|
|
208
|
+
props.model[props.name] = {
|
|
209
|
+
hookType: schema.HookType.CODE,
|
|
210
|
+
hookData: []
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
immediate: true
|
|
245
216
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
};
|
|
250
|
-
const setCombineIds = async (codeIds) => {
|
|
251
|
-
combineIds.value = codeIds;
|
|
252
|
-
await services?.codeBlockService.setCombineIds(codeIds);
|
|
217
|
+
);
|
|
218
|
+
const changeHandler = async () => {
|
|
219
|
+
emit("change", props.model[props.name]);
|
|
253
220
|
};
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
221
|
+
const getParamsConfig = (codeId) => {
|
|
222
|
+
if (!codeDsl.value)
|
|
223
|
+
return [];
|
|
224
|
+
const paramStatements = codeDsl.value[codeId]?.params;
|
|
225
|
+
if (lodashEs.isEmpty(paramStatements))
|
|
226
|
+
return [];
|
|
227
|
+
return paramStatements.map((paramState) => ({
|
|
228
|
+
name: paramState.name,
|
|
229
|
+
text: paramState.name,
|
|
230
|
+
labelWidth: "100px",
|
|
231
|
+
type: "text"
|
|
232
|
+
}));
|
|
262
233
|
};
|
|
263
234
|
return (_ctx, _cache) => {
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
model: __props.model,
|
|
276
|
-
prop: __props.prop,
|
|
277
|
-
name: __props.name,
|
|
278
|
-
size: __props.size,
|
|
279
|
-
onChange: changeHandler
|
|
280
|
-
}, null, 8, ["config", "model", "prop", "name", "size"])
|
|
281
|
-
]),
|
|
282
|
-
default: vue.withCtx(() => [
|
|
283
|
-
vue.createElementVNode("div", _hoisted_1$d, [
|
|
284
|
-
vue.createVNode(_component_el_tooltip, {
|
|
285
|
-
class: "tool-item",
|
|
286
|
-
effect: "dark",
|
|
287
|
-
content: "\u67E5\u770B\u4EE3\u7801\u5757",
|
|
288
|
-
placement: "top"
|
|
289
|
-
}, {
|
|
290
|
-
default: vue.withCtx(() => [
|
|
291
|
-
(vue.openBlock(), vue.createElementBlock("svg", {
|
|
292
|
-
onClick: viewHandler,
|
|
293
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
294
|
-
viewBox: "0 0 24 24",
|
|
295
|
-
width: "15px",
|
|
296
|
-
height: "15px",
|
|
297
|
-
"data-v-65a7fb6c": ""
|
|
298
|
-
}, _hoisted_3$3))
|
|
299
|
-
]),
|
|
300
|
-
_: 1
|
|
301
|
-
})
|
|
302
|
-
])
|
|
303
|
-
]),
|
|
304
|
-
_: 1
|
|
305
|
-
})
|
|
235
|
+
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
236
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
237
|
+
vue.createVNode(_component_m_form_table, {
|
|
238
|
+
config: vue.unref(tableConfig),
|
|
239
|
+
model: __props.model[__props.name],
|
|
240
|
+
name: "hookData",
|
|
241
|
+
enableToggleMode: false,
|
|
242
|
+
prop: __props.prop,
|
|
243
|
+
size: __props.size,
|
|
244
|
+
onChange: changeHandler
|
|
245
|
+
}, null, 8, ["config", "model", "prop", "size"])
|
|
306
246
|
]);
|
|
307
247
|
};
|
|
308
248
|
}
|
|
309
249
|
});
|
|
310
250
|
|
|
311
|
-
const _hoisted_1$
|
|
312
|
-
const
|
|
313
|
-
|
|
251
|
+
const _hoisted_1$f = /* @__PURE__ */ vue.createTextVNode("\u53D6\u6D88");
|
|
252
|
+
const __default__$q = vue.defineComponent({
|
|
253
|
+
name: "MEditorUISelect"
|
|
254
|
+
});
|
|
255
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
256
|
+
...__default__$q,
|
|
314
257
|
props: {
|
|
315
258
|
config: null,
|
|
316
259
|
model: null,
|
|
@@ -360,21 +303,19 @@
|
|
|
360
303
|
}
|
|
361
304
|
};
|
|
362
305
|
return (_ctx, _cache) => {
|
|
363
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
364
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
365
306
|
return uiSelectMode.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
366
307
|
key: 0,
|
|
367
308
|
class: "m-fields-ui-select",
|
|
368
309
|
onClick: cancelHandler
|
|
369
310
|
}, [
|
|
370
|
-
vue.createVNode(
|
|
311
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
371
312
|
type: "danger",
|
|
372
313
|
icon: vue.unref(iconsVue.Delete),
|
|
373
314
|
text: "",
|
|
374
315
|
style: { "padding": "0" }
|
|
375
316
|
}, {
|
|
376
317
|
default: vue.withCtx(() => [
|
|
377
|
-
_hoisted_1$
|
|
318
|
+
_hoisted_1$f
|
|
378
319
|
]),
|
|
379
320
|
_: 1
|
|
380
321
|
}, 8, ["icon"])
|
|
@@ -384,12 +325,12 @@
|
|
|
384
325
|
onClick: startSelect,
|
|
385
326
|
style: { "display": "flex" }
|
|
386
327
|
}, [
|
|
387
|
-
vue.unref(val) ? (vue.openBlock(), vue.createBlock(
|
|
328
|
+
vue.unref(val) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
388
329
|
key: 0,
|
|
389
330
|
content: "\u6E05\u9664"
|
|
390
331
|
}, {
|
|
391
332
|
default: vue.withCtx(() => [
|
|
392
|
-
vue.createVNode(
|
|
333
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
393
334
|
style: { "padding": "0" },
|
|
394
335
|
type: "danger",
|
|
395
336
|
icon: vue.unref(iconsVue.Close),
|
|
@@ -399,11 +340,11 @@
|
|
|
399
340
|
]),
|
|
400
341
|
_: 1
|
|
401
342
|
})) : vue.createCommentVNode("", true),
|
|
402
|
-
vue.createVNode(
|
|
343
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
403
344
|
content: vue.unref(val) ? vue.unref(toName) + "_" + vue.unref(val) : "\u70B9\u51FB\u6B64\u5904\u9009\u62E9"
|
|
404
345
|
}, {
|
|
405
346
|
default: vue.withCtx(() => [
|
|
406
|
-
vue.createVNode(
|
|
347
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
407
348
|
text: "",
|
|
408
349
|
style: { "padding": "0", "margin": "0" }
|
|
409
350
|
}, {
|
|
@@ -422,12 +363,15 @@
|
|
|
422
363
|
|
|
423
364
|
const UISelect_vue_vue_type_style_index_0_lang = '';
|
|
424
365
|
|
|
425
|
-
const
|
|
426
|
-
|
|
366
|
+
const __default__$p = vue.defineComponent({
|
|
367
|
+
name: "MEditorCodeEditor"
|
|
368
|
+
});
|
|
369
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
370
|
+
...__default__$p,
|
|
427
371
|
props: {
|
|
428
372
|
initValues: null,
|
|
429
373
|
modifiedValues: null,
|
|
430
|
-
type:
|
|
374
|
+
type: null,
|
|
431
375
|
language: { default: "javascript" },
|
|
432
376
|
options: { default: () => ({
|
|
433
377
|
tabSize: 2
|
|
@@ -552,6 +496,255 @@
|
|
|
552
496
|
};
|
|
553
497
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
554
498
|
|
|
499
|
+
const __default__$o = vue.defineComponent({
|
|
500
|
+
name: "MEditorResizer"
|
|
501
|
+
});
|
|
502
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
503
|
+
...__default__$o,
|
|
504
|
+
emits: ["change"],
|
|
505
|
+
setup(__props, { emit }) {
|
|
506
|
+
const target = vue.ref();
|
|
507
|
+
let getso;
|
|
508
|
+
vue.onMounted(() => {
|
|
509
|
+
if (!target.value)
|
|
510
|
+
return;
|
|
511
|
+
getso = new Gesto__default.default(target.value, {
|
|
512
|
+
container: window,
|
|
513
|
+
pinchOutside: true
|
|
514
|
+
}).on("drag", (e) => {
|
|
515
|
+
if (!target.value)
|
|
516
|
+
return;
|
|
517
|
+
emit("change", e.deltaX);
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
vue.onUnmounted(() => {
|
|
521
|
+
getso?.unset();
|
|
522
|
+
});
|
|
523
|
+
return (_ctx, _cache) => {
|
|
524
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
525
|
+
ref_key: "target",
|
|
526
|
+
ref: target,
|
|
527
|
+
class: "m-editor-resizer"
|
|
528
|
+
}, [
|
|
529
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
530
|
+
], 512);
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
const __default__$n = vue.defineComponent({
|
|
536
|
+
name: "MEditorLayout"
|
|
537
|
+
});
|
|
538
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
539
|
+
...__default__$n,
|
|
540
|
+
props: {
|
|
541
|
+
left: null,
|
|
542
|
+
right: null,
|
|
543
|
+
minLeft: { default: 46 },
|
|
544
|
+
minRight: { default: 1 },
|
|
545
|
+
minCenter: { default: 1 },
|
|
546
|
+
leftClass: null,
|
|
547
|
+
rightClass: null,
|
|
548
|
+
centerClass: null
|
|
549
|
+
},
|
|
550
|
+
emits: ["update:left", "change", "update:right"],
|
|
551
|
+
setup(__props, { emit }) {
|
|
552
|
+
const props = __props;
|
|
553
|
+
const el = vue.ref();
|
|
554
|
+
const hasLeft = vue.computed(() => typeof props.left !== "undefined");
|
|
555
|
+
const hasRight = vue.computed(() => typeof props.left !== "undefined");
|
|
556
|
+
const getCenterWidth = (clientWidth2, left, right) => {
|
|
557
|
+
let center2 = clientWidth2 - left - right;
|
|
558
|
+
if (center2 < props.minCenter) {
|
|
559
|
+
center2 = props.minCenter;
|
|
560
|
+
if (left < right) {
|
|
561
|
+
right = clientWidth2 - left - props.minCenter;
|
|
562
|
+
} else {
|
|
563
|
+
left = clientWidth2 - right - props.minCenter;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
center: center2,
|
|
568
|
+
left,
|
|
569
|
+
right
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
let clientWidth = 0;
|
|
573
|
+
const resizerObserver = new ResizeObserver((entries) => {
|
|
574
|
+
for (const { contentRect } of entries) {
|
|
575
|
+
clientWidth = contentRect.width;
|
|
576
|
+
let left = props.left || 0;
|
|
577
|
+
let right = props.right || 0;
|
|
578
|
+
if (left > clientWidth) {
|
|
579
|
+
left = clientWidth / 3;
|
|
580
|
+
}
|
|
581
|
+
if (right > clientWidth) {
|
|
582
|
+
right = clientWidth / 3;
|
|
583
|
+
}
|
|
584
|
+
const columnWidth = getCenterWidth(clientWidth, left, right);
|
|
585
|
+
center.value = columnWidth.center;
|
|
586
|
+
emit("change", {
|
|
587
|
+
left: columnWidth.left,
|
|
588
|
+
center: center.value,
|
|
589
|
+
right: columnWidth.right
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
vue.onMounted(() => {
|
|
594
|
+
if (el.value) {
|
|
595
|
+
resizerObserver.observe(el.value);
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
vue.onUnmounted(() => {
|
|
599
|
+
resizerObserver.disconnect();
|
|
600
|
+
});
|
|
601
|
+
const center = vue.ref(0);
|
|
602
|
+
const changeLeft = (deltaX) => {
|
|
603
|
+
if (typeof props.left === "undefined")
|
|
604
|
+
return;
|
|
605
|
+
let left = Math.max(props.left + deltaX, props.minLeft) || 0;
|
|
606
|
+
emit("update:left", left);
|
|
607
|
+
if (clientWidth - left - (props.right || 0) <= 0) {
|
|
608
|
+
left = props.left;
|
|
609
|
+
}
|
|
610
|
+
const columnWidth = getCenterWidth(clientWidth, left, props.right || 0);
|
|
611
|
+
center.value = columnWidth.center;
|
|
612
|
+
emit("change", {
|
|
613
|
+
left: columnWidth.left,
|
|
614
|
+
center: center.value,
|
|
615
|
+
right: columnWidth.right
|
|
616
|
+
});
|
|
617
|
+
};
|
|
618
|
+
const changeRight = (deltaX) => {
|
|
619
|
+
if (typeof props.right === "undefined")
|
|
620
|
+
return;
|
|
621
|
+
let right = Math.max(props.right - deltaX, props.minRight) || 0;
|
|
622
|
+
emit("update:right", right);
|
|
623
|
+
if (clientWidth - (props.left || 0) - right <= 0) {
|
|
624
|
+
right = props.right;
|
|
625
|
+
}
|
|
626
|
+
const columnWidth = getCenterWidth(clientWidth, props.left || 0, right);
|
|
627
|
+
center.value = columnWidth.center;
|
|
628
|
+
emit("change", {
|
|
629
|
+
left: columnWidth.left,
|
|
630
|
+
center: center.value,
|
|
631
|
+
right: columnWidth.right
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
return (_ctx, _cache) => {
|
|
635
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
636
|
+
ref_key: "el",
|
|
637
|
+
ref: el,
|
|
638
|
+
class: "m-editor-layout"
|
|
639
|
+
}, [
|
|
640
|
+
vue.unref(hasLeft) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
641
|
+
vue.createElementVNode("div", {
|
|
642
|
+
class: vue.normalizeClass(["m-editor-layout-left", __props.leftClass]),
|
|
643
|
+
style: vue.normalizeStyle(`width: ${__props.left}px`)
|
|
644
|
+
}, [
|
|
645
|
+
vue.renderSlot(_ctx.$slots, "left")
|
|
646
|
+
], 6),
|
|
647
|
+
vue.createVNode(_sfc_main$p, { onChange: changeLeft })
|
|
648
|
+
], 64)) : vue.createCommentVNode("", true),
|
|
649
|
+
vue.createElementVNode("div", {
|
|
650
|
+
class: vue.normalizeClass(["m-editor-layout-center", __props.centerClass]),
|
|
651
|
+
style: vue.normalizeStyle(`width: ${center.value}px`)
|
|
652
|
+
}, [
|
|
653
|
+
vue.renderSlot(_ctx.$slots, "center")
|
|
654
|
+
], 6),
|
|
655
|
+
vue.unref(hasRight) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
656
|
+
vue.createVNode(_sfc_main$p, { onChange: changeRight }),
|
|
657
|
+
vue.createElementVNode("div", {
|
|
658
|
+
class: vue.normalizeClass(["m-editor-layout-right", __props.rightClass]),
|
|
659
|
+
style: vue.normalizeStyle(`width: ${__props.right}px`)
|
|
660
|
+
}, [
|
|
661
|
+
vue.renderSlot(_ctx.$slots, "right")
|
|
662
|
+
], 6)
|
|
663
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
664
|
+
], 512);
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
const _hoisted_1$e = ["src"];
|
|
670
|
+
const __default__$m = vue.defineComponent({
|
|
671
|
+
name: "MEditorIcon"
|
|
672
|
+
});
|
|
673
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
674
|
+
...__default__$m,
|
|
675
|
+
props: {
|
|
676
|
+
icon: null
|
|
677
|
+
},
|
|
678
|
+
setup(__props) {
|
|
679
|
+
return (_ctx, _cache) => {
|
|
680
|
+
return !__props.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
681
|
+
key: 0,
|
|
682
|
+
class: "magic-editor-icon"
|
|
683
|
+
}, {
|
|
684
|
+
default: vue.withCtx(() => [
|
|
685
|
+
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
686
|
+
]),
|
|
687
|
+
_: 1
|
|
688
|
+
})) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
689
|
+
key: 1,
|
|
690
|
+
class: "magic-editor-icon"
|
|
691
|
+
}, {
|
|
692
|
+
default: vue.withCtx(() => [
|
|
693
|
+
vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$e)
|
|
694
|
+
]),
|
|
695
|
+
_: 1
|
|
696
|
+
})) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
697
|
+
key: 2,
|
|
698
|
+
class: vue.normalizeClass(["magic-editor-icon", __props.icon])
|
|
699
|
+
}, null, 2)) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
|
|
700
|
+
key: 3,
|
|
701
|
+
class: "magic-editor-icon"
|
|
702
|
+
}, {
|
|
703
|
+
default: vue.withCtx(() => [
|
|
704
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(__props.icon))))
|
|
705
|
+
]),
|
|
706
|
+
_: 1
|
|
707
|
+
}));
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
var ColumnLayout = /* @__PURE__ */ ((ColumnLayout2) => {
|
|
713
|
+
ColumnLayout2["LEFT"] = "left";
|
|
714
|
+
ColumnLayout2["CENTER"] = "center";
|
|
715
|
+
ColumnLayout2["RIGHT"] = "right";
|
|
716
|
+
return ColumnLayout2;
|
|
717
|
+
})(ColumnLayout || {});
|
|
718
|
+
var LayerOffset = /* @__PURE__ */ ((LayerOffset2) => {
|
|
719
|
+
LayerOffset2["TOP"] = "top";
|
|
720
|
+
LayerOffset2["BOTTOM"] = "bottom";
|
|
721
|
+
return LayerOffset2;
|
|
722
|
+
})(LayerOffset || {});
|
|
723
|
+
var Layout = /* @__PURE__ */ ((Layout2) => {
|
|
724
|
+
Layout2["FLEX"] = "flex";
|
|
725
|
+
Layout2["FIXED"] = "fixed";
|
|
726
|
+
Layout2["RELATIVE"] = "relative";
|
|
727
|
+
Layout2["ABSOLUTE"] = "absolute";
|
|
728
|
+
return Layout2;
|
|
729
|
+
})(Layout || {});
|
|
730
|
+
var Keys = /* @__PURE__ */ ((Keys2) => {
|
|
731
|
+
Keys2["ESCAPE"] = "Space";
|
|
732
|
+
return Keys2;
|
|
733
|
+
})(Keys || {});
|
|
734
|
+
const H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
|
|
735
|
+
const V_GUIDE_LINE_STORAGE_KEY = "$MagicStageVerticalGuidelinesData";
|
|
736
|
+
var CodeEditorMode = /* @__PURE__ */ ((CodeEditorMode2) => {
|
|
737
|
+
CodeEditorMode2["LIST"] = "list";
|
|
738
|
+
CodeEditorMode2["EDITOR"] = "editor";
|
|
739
|
+
return CodeEditorMode2;
|
|
740
|
+
})(CodeEditorMode || {});
|
|
741
|
+
var CodeDeleteErrorType = /* @__PURE__ */ ((CodeDeleteErrorType2) => {
|
|
742
|
+
CodeDeleteErrorType2["UNDELETEABLE"] = "undeleteable";
|
|
743
|
+
CodeDeleteErrorType2["BIND"] = "bind";
|
|
744
|
+
return CodeDeleteErrorType2;
|
|
745
|
+
})(CodeDeleteErrorType || {});
|
|
746
|
+
const CODE_DRAFT_STORAGE_KEY = "magicCodeDraft";
|
|
747
|
+
|
|
555
748
|
const log = (...args) => {
|
|
556
749
|
if (process.env.NODE_ENV === "development") {
|
|
557
750
|
console.log("magic editor: ", ...args);
|
|
@@ -700,7 +893,8 @@
|
|
|
700
893
|
editable: true,
|
|
701
894
|
mode: CodeEditorMode.EDITOR,
|
|
702
895
|
combineIds: [],
|
|
703
|
-
undeletableList: []
|
|
896
|
+
undeletableList: [],
|
|
897
|
+
relations: {}
|
|
704
898
|
});
|
|
705
899
|
constructor() {
|
|
706
900
|
super([
|
|
@@ -718,31 +912,40 @@
|
|
|
718
912
|
"deleteCodeDslByIds"
|
|
719
913
|
]);
|
|
720
914
|
}
|
|
721
|
-
async setCodeDsl(
|
|
722
|
-
this.state.codeDsl =
|
|
915
|
+
async setCodeDsl(codeDsl2) {
|
|
916
|
+
this.state.codeDsl = codeDsl2;
|
|
723
917
|
await editorService.setCodeDsl(this.state.codeDsl);
|
|
724
918
|
info("[code-block]:code-dsl-change", this.state.codeDsl);
|
|
725
919
|
this.emit("code-dsl-change", this.state.codeDsl);
|
|
726
920
|
}
|
|
727
921
|
async getCodeDsl(forceRefresh = false) {
|
|
922
|
+
return this.getCodeDslSync(forceRefresh);
|
|
923
|
+
}
|
|
924
|
+
getCodeDslSync(forceRefresh = false) {
|
|
728
925
|
if (!this.state.codeDsl || forceRefresh) {
|
|
729
|
-
this.state.codeDsl =
|
|
926
|
+
this.state.codeDsl = editorService.getCodeDslSync();
|
|
730
927
|
}
|
|
731
928
|
return this.state.codeDsl;
|
|
732
929
|
}
|
|
733
|
-
async getCodeContentById(
|
|
734
|
-
if (!
|
|
930
|
+
async getCodeContentById(id2) {
|
|
931
|
+
if (!id2)
|
|
735
932
|
return null;
|
|
736
933
|
const totalCodeDsl = await this.getCodeDsl();
|
|
737
934
|
if (!totalCodeDsl)
|
|
738
935
|
return null;
|
|
739
|
-
return totalCodeDsl[
|
|
936
|
+
return totalCodeDsl[id2] ?? null;
|
|
740
937
|
}
|
|
741
938
|
async setCodeDslById(id, codeConfig) {
|
|
742
939
|
let codeDsl = await this.getCodeDsl();
|
|
940
|
+
const codeConfigProcessed = codeConfig;
|
|
941
|
+
if (codeConfig.content) {
|
|
942
|
+
codeConfigProcessed.content = eval(codeConfig.content);
|
|
943
|
+
}
|
|
743
944
|
if (!codeDsl) {
|
|
744
945
|
codeDsl = {
|
|
745
|
-
[id]:
|
|
946
|
+
[id]: {
|
|
947
|
+
...codeConfigProcessed
|
|
948
|
+
}
|
|
746
949
|
};
|
|
747
950
|
} else {
|
|
748
951
|
const existContent = codeDsl[id] || {};
|
|
@@ -750,15 +953,15 @@
|
|
|
750
953
|
...codeDsl,
|
|
751
954
|
[id]: {
|
|
752
955
|
...existContent,
|
|
753
|
-
...
|
|
956
|
+
...codeConfigProcessed
|
|
754
957
|
}
|
|
755
958
|
};
|
|
756
959
|
}
|
|
757
960
|
await this.setCodeDsl(codeDsl);
|
|
758
961
|
}
|
|
759
962
|
async getCodeDslByIds(ids) {
|
|
760
|
-
const
|
|
761
|
-
return lodashEs.pick(
|
|
963
|
+
const codeDsl2 = await this.getCodeDsl();
|
|
964
|
+
return lodashEs.pick(codeDsl2, ids);
|
|
762
965
|
}
|
|
763
966
|
async setCodeEditorShowStatus(status) {
|
|
764
967
|
this.state.isShowCodeEditor = status;
|
|
@@ -766,10 +969,10 @@
|
|
|
766
969
|
getCodeEditorShowStatus() {
|
|
767
970
|
return this.state.isShowCodeEditor;
|
|
768
971
|
}
|
|
769
|
-
setCodeEditorContent(status,
|
|
770
|
-
if (!
|
|
972
|
+
setCodeEditorContent(status, id2) {
|
|
973
|
+
if (!id2)
|
|
771
974
|
return;
|
|
772
|
-
this.setId(
|
|
975
|
+
this.setId(id2);
|
|
773
976
|
this.state.isShowCodeEditor = status;
|
|
774
977
|
}
|
|
775
978
|
async getCurrentDsl() {
|
|
@@ -781,10 +984,10 @@
|
|
|
781
984
|
async setEditStatus(status) {
|
|
782
985
|
this.state.editable = status;
|
|
783
986
|
}
|
|
784
|
-
setId(
|
|
785
|
-
if (!
|
|
987
|
+
setId(id2) {
|
|
988
|
+
if (!id2)
|
|
786
989
|
return;
|
|
787
|
-
this.state.id =
|
|
990
|
+
this.state.id = id2;
|
|
788
991
|
}
|
|
789
992
|
getId() {
|
|
790
993
|
return this.state.id;
|
|
@@ -798,64 +1001,20 @@
|
|
|
798
1001
|
async setCombineIds(ids) {
|
|
799
1002
|
this.state.combineIds = ids;
|
|
800
1003
|
}
|
|
801
|
-
getCombineIds() {
|
|
802
|
-
return this.state.combineIds;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
const
|
|
806
|
-
if (!
|
|
807
|
-
return;
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
} catch (e) {
|
|
818
|
-
error(e);
|
|
819
|
-
throw new Error("\u89E3\u7ED1\u4EE3\u7801\u5757\u5931\u8D25");
|
|
820
|
-
}
|
|
821
|
-
} else if (opFlag === CodeSelectOp.ADD) {
|
|
822
|
-
try {
|
|
823
|
-
diffCodeIds.forEach((codeId) => {
|
|
824
|
-
const compsContent = codeDsl[codeId].comps;
|
|
825
|
-
const existHooks = compsContent?.[compId];
|
|
826
|
-
if (lodashEs.isEmpty(existHooks)) {
|
|
827
|
-
codeDsl[codeId].comps = {
|
|
828
|
-
...codeDsl[codeId].comps || {},
|
|
829
|
-
[compId]: [hook]
|
|
830
|
-
};
|
|
831
|
-
} else {
|
|
832
|
-
existHooks?.push(hook);
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
} catch (e) {
|
|
836
|
-
error(e);
|
|
837
|
-
throw new Error("\u7ED1\u5B9A\u4EE3\u7801\u5757\u5931\u8D25");
|
|
838
|
-
}
|
|
839
|
-
} else if (opFlag === CodeSelectOp.CHANGE) {
|
|
840
|
-
lodashEs.forIn(codeDsl, (codeBlockContent, codeId) => {
|
|
841
|
-
if (codeId === diffCodeIds[0]) {
|
|
842
|
-
codeBlockContent.comps = {
|
|
843
|
-
...codeBlockContent?.comps || {},
|
|
844
|
-
[compId]: [hook]
|
|
845
|
-
};
|
|
846
|
-
} else if (lodashEs.isEmpty(diffCodeIds) || codeId !== diffCodeIds[0]) {
|
|
847
|
-
const compHooks = codeBlockContent?.comps?.[compId];
|
|
848
|
-
if (!compHooks)
|
|
849
|
-
return true;
|
|
850
|
-
const index = compHooks.findIndex((hookName) => hookName === hook);
|
|
851
|
-
if (index !== -1) {
|
|
852
|
-
compHooks.splice(index, 1);
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
this.setCodeDsl(codeDsl);
|
|
1004
|
+
getCombineIds() {
|
|
1005
|
+
return this.state.combineIds;
|
|
1006
|
+
}
|
|
1007
|
+
refreshCombineInfo() {
|
|
1008
|
+
const root = editorService.get("root");
|
|
1009
|
+
if (!root)
|
|
1010
|
+
return null;
|
|
1011
|
+
const relations = {};
|
|
1012
|
+
this.recurseMNode(root, relations);
|
|
1013
|
+
this.state.relations = relations;
|
|
1014
|
+
return this.state.relations;
|
|
1015
|
+
}
|
|
1016
|
+
getCombineInfo() {
|
|
1017
|
+
return this.state.relations;
|
|
859
1018
|
}
|
|
860
1019
|
getUndeletableList() {
|
|
861
1020
|
return this.state.undeletableList;
|
|
@@ -863,6 +1022,15 @@
|
|
|
863
1022
|
async setUndeleteableList(codeIds) {
|
|
864
1023
|
this.state.undeletableList = codeIds;
|
|
865
1024
|
}
|
|
1025
|
+
setCodeDraft(codeId, content) {
|
|
1026
|
+
globalThis.localStorage.setItem(`${CODE_DRAFT_STORAGE_KEY}_${codeId}`, content);
|
|
1027
|
+
}
|
|
1028
|
+
getCodeDraft(codeId) {
|
|
1029
|
+
return globalThis.localStorage.getItem(`${CODE_DRAFT_STORAGE_KEY}_${codeId}`);
|
|
1030
|
+
}
|
|
1031
|
+
removeCodeDraft(codeId) {
|
|
1032
|
+
globalThis.localStorage.removeItem(`${CODE_DRAFT_STORAGE_KEY}_${codeId}`);
|
|
1033
|
+
}
|
|
866
1034
|
async deleteCodeDslByIds(codeIds) {
|
|
867
1035
|
const currentDsl = await this.getCodeDsl();
|
|
868
1036
|
const newDsl = lodashEs.omit(currentDsl, codeIds);
|
|
@@ -878,11 +1046,11 @@
|
|
|
878
1046
|
return await this.getUniqueId();
|
|
879
1047
|
}
|
|
880
1048
|
async deleteCompsInRelation(node) {
|
|
881
|
-
const
|
|
882
|
-
if (!
|
|
1049
|
+
const codeDsl2 = lodashEs.cloneDeep(await this.getCodeDsl());
|
|
1050
|
+
if (!codeDsl2)
|
|
883
1051
|
return;
|
|
884
|
-
this.
|
|
885
|
-
this.setCodeDsl(
|
|
1052
|
+
this.refreshRelationDeep(node, codeDsl2);
|
|
1053
|
+
this.setCodeDsl(codeDsl2);
|
|
886
1054
|
}
|
|
887
1055
|
destroy() {
|
|
888
1056
|
this.state.isShowCodeEditor = false;
|
|
@@ -893,16 +1061,39 @@
|
|
|
893
1061
|
this.state.combineIds = [];
|
|
894
1062
|
this.state.undeletableList = [];
|
|
895
1063
|
}
|
|
896
|
-
|
|
1064
|
+
refreshRelationDeep(node, codeDsl2) {
|
|
897
1065
|
if (!node.id)
|
|
898
1066
|
return;
|
|
899
|
-
lodashEs.forIn(
|
|
1067
|
+
lodashEs.forIn(codeDsl2, (codeBlockContent) => {
|
|
900
1068
|
const compsContent = codeBlockContent.comps || {};
|
|
901
1069
|
codeBlockContent.comps = lodashEs.omit(compsContent, node.id);
|
|
902
1070
|
});
|
|
903
1071
|
if (!lodashEs.isEmpty(node.items)) {
|
|
904
1072
|
node.items.forEach((item) => {
|
|
905
|
-
this.
|
|
1073
|
+
this.refreshRelationDeep(item, codeDsl2);
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
recurseMNode(node, relations) {
|
|
1078
|
+
lodashEs.forIn(node, (value, key) => {
|
|
1079
|
+
if (value?.hookType === schema.HookType.CODE && !lodashEs.isEmpty(value.hookData)) {
|
|
1080
|
+
value.hookData.forEach((relationItem) => {
|
|
1081
|
+
if (!relationItem.codeId)
|
|
1082
|
+
return;
|
|
1083
|
+
if (!relations[relationItem.codeId]) {
|
|
1084
|
+
relations[relationItem.codeId] = {};
|
|
1085
|
+
}
|
|
1086
|
+
const codeItem = relations[relationItem.codeId];
|
|
1087
|
+
if (lodashEs.isEmpty(codeItem[node.id])) {
|
|
1088
|
+
codeItem[node.id] = [];
|
|
1089
|
+
}
|
|
1090
|
+
codeItem[node.id].push(key);
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
if (!lodashEs.isEmpty(node.items)) {
|
|
1095
|
+
node.items.forEach((item) => {
|
|
1096
|
+
this.recurseMNode(item, relations);
|
|
906
1097
|
});
|
|
907
1098
|
}
|
|
908
1099
|
}
|
|
@@ -986,6 +1177,7 @@
|
|
|
986
1177
|
this.state.pageSteps[this.state.pageId] = undoRedo;
|
|
987
1178
|
}
|
|
988
1179
|
this.setCanUndoRedo();
|
|
1180
|
+
this.emit("page-change", this.state.pageSteps[this.state.pageId]);
|
|
989
1181
|
}
|
|
990
1182
|
empty() {
|
|
991
1183
|
this.state.pageId = void 0;
|
|
@@ -1271,6 +1463,10 @@
|
|
|
1271
1463
|
left: fixNodeLeft(config, parent, stage?.renderer.contentWindow?.document)
|
|
1272
1464
|
};
|
|
1273
1465
|
};
|
|
1466
|
+
const serializeConfig = (config) => serialize__default.default(config, {
|
|
1467
|
+
space: 2,
|
|
1468
|
+
unsafe: true
|
|
1469
|
+
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
1274
1470
|
|
|
1275
1471
|
class Props extends BaseService {
|
|
1276
1472
|
state = vue.reactive({
|
|
@@ -1312,7 +1508,7 @@
|
|
|
1312
1508
|
this.setPropsValue(utils.toLine(type), values[type]);
|
|
1313
1509
|
});
|
|
1314
1510
|
}
|
|
1315
|
-
setPropsValue(type, value) {
|
|
1511
|
+
async setPropsValue(type, value) {
|
|
1316
1512
|
this.state.propsValueMap[type] = value;
|
|
1317
1513
|
}
|
|
1318
1514
|
async getPropsValue(type, { inputEvent, ...defaultValue } = {}) {
|
|
@@ -1444,6 +1640,13 @@
|
|
|
1444
1640
|
}
|
|
1445
1641
|
return parentNode;
|
|
1446
1642
|
};
|
|
1643
|
+
const getDefaultConfig = async (addNode, parentNode) => {
|
|
1644
|
+
const { type, inputEvent, ...config } = addNode;
|
|
1645
|
+
const layout = await editorService.getLayout(vue.toRaw(parentNode), addNode);
|
|
1646
|
+
const newNode = { ...vue.toRaw(await propsService.getPropsValue(type, config)) };
|
|
1647
|
+
newNode.style = getInitPositionStyle(newNode.style, layout);
|
|
1648
|
+
return newNode;
|
|
1649
|
+
};
|
|
1447
1650
|
|
|
1448
1651
|
class Editor$1 extends BaseService {
|
|
1449
1652
|
state = vue.reactive({
|
|
@@ -1473,7 +1676,7 @@
|
|
|
1473
1676
|
"copy",
|
|
1474
1677
|
"paste",
|
|
1475
1678
|
"doPaste",
|
|
1476
|
-
"
|
|
1679
|
+
"doAlignCenter",
|
|
1477
1680
|
"alignCenter",
|
|
1478
1681
|
"moveLayer",
|
|
1479
1682
|
"moveToContainer",
|
|
@@ -1652,6 +1855,9 @@
|
|
|
1652
1855
|
}
|
|
1653
1856
|
const newNodes = await Promise.all(
|
|
1654
1857
|
addNodes.map((node) => {
|
|
1858
|
+
if (utils.isPage(node)) {
|
|
1859
|
+
return this.doAdd(node, this.get("root"));
|
|
1860
|
+
}
|
|
1655
1861
|
const parentNode = parent && typeof parent !== "function" ? parent : getAddParent(node);
|
|
1656
1862
|
if (!parentNode)
|
|
1657
1863
|
throw new Error("\u672A\u627E\u5230\u7236\u5143\u7D20");
|
|
@@ -1670,7 +1876,9 @@
|
|
|
1670
1876
|
stage?.select(newNodes[0].id);
|
|
1671
1877
|
}
|
|
1672
1878
|
}
|
|
1673
|
-
|
|
1879
|
+
if (!utils.isPage(newNodes[0])) {
|
|
1880
|
+
this.pushHistoryState();
|
|
1881
|
+
}
|
|
1674
1882
|
this.emit("add", newNodes);
|
|
1675
1883
|
return Array.isArray(addNode) ? newNodes : newNodes[0];
|
|
1676
1884
|
}
|
|
@@ -1712,7 +1920,9 @@
|
|
|
1712
1920
|
async remove(nodeOrNodeList) {
|
|
1713
1921
|
const nodes = Array.isArray(nodeOrNodeList) ? nodeOrNodeList : [nodeOrNodeList];
|
|
1714
1922
|
await Promise.all(nodes.map((node) => this.doRemove(node)));
|
|
1715
|
-
|
|
1923
|
+
if (!utils.isPage(nodes[0])) {
|
|
1924
|
+
this.pushHistoryState();
|
|
1925
|
+
}
|
|
1716
1926
|
this.emit("remove", nodes);
|
|
1717
1927
|
}
|
|
1718
1928
|
async doUpdate(config) {
|
|
@@ -1724,6 +1934,9 @@
|
|
|
1724
1934
|
const node = lodashEs.cloneDeep(vue.toRaw(info.node));
|
|
1725
1935
|
let newConfig = await this.toggleFixedPosition(vue.toRaw(config), node, this.get("root"));
|
|
1726
1936
|
newConfig = lodashEs.mergeWith(lodashEs.cloneDeep(node), newConfig, (objValue, srcValue) => {
|
|
1937
|
+
if (lodashEs.isObject(srcValue) && Array.isArray(objValue)) {
|
|
1938
|
+
return srcValue;
|
|
1939
|
+
}
|
|
1727
1940
|
if (Array.isArray(srcValue)) {
|
|
1728
1941
|
return srcValue;
|
|
1729
1942
|
}
|
|
@@ -1747,10 +1960,10 @@
|
|
|
1747
1960
|
newConfig = setLayout(newConfig, newLayout);
|
|
1748
1961
|
}
|
|
1749
1962
|
parentNodeItems[index] = newConfig;
|
|
1750
|
-
const nodes = this.get("nodes");
|
|
1963
|
+
const nodes = this.get("nodes") || [];
|
|
1751
1964
|
const targetIndex = nodes.findIndex((nodeItem) => `${nodeItem.id}` === `${newConfig.id}`);
|
|
1752
1965
|
nodes.splice(targetIndex, 1, newConfig);
|
|
1753
|
-
this.set("nodes", nodes);
|
|
1966
|
+
this.set("nodes", [...nodes]);
|
|
1754
1967
|
this.get("stage")?.update({
|
|
1755
1968
|
config: lodashEs.cloneDeep(newConfig),
|
|
1756
1969
|
parentId: parent.id,
|
|
@@ -1767,6 +1980,7 @@
|
|
|
1767
1980
|
const newNodes = await Promise.all(nodes.map((node) => this.doUpdate(node)));
|
|
1768
1981
|
this.pushHistoryState();
|
|
1769
1982
|
this.emit("update", newNodes);
|
|
1983
|
+
codeBlockService.refreshCombineInfo();
|
|
1770
1984
|
return Array.isArray(config) ? newNodes : newNodes[0];
|
|
1771
1985
|
}
|
|
1772
1986
|
async sort(id1, id2) {
|
|
@@ -1797,7 +2011,7 @@
|
|
|
1797
2011
|
if (!Array.isArray(config))
|
|
1798
2012
|
return;
|
|
1799
2013
|
const pasteConfigs = await this.doPaste(config, position);
|
|
1800
|
-
return this.add(pasteConfigs);
|
|
2014
|
+
return this.add(pasteConfigs, this.get("parent"));
|
|
1801
2015
|
}
|
|
1802
2016
|
async doPaste(config, position = {}) {
|
|
1803
2017
|
const pasteConfigs = await beforePaste(position, lodashEs.cloneDeep(config));
|
|
@@ -1832,7 +2046,11 @@
|
|
|
1832
2046
|
const stage = this.get("stage");
|
|
1833
2047
|
const newNodes = await Promise.all(nodes.map((node) => this.doAlignCenter(node)));
|
|
1834
2048
|
const newNode = await this.update(newNodes);
|
|
1835
|
-
|
|
2049
|
+
if (newNodes.length > 1) {
|
|
2050
|
+
await stage?.multiSelect(newNodes.map((node) => node.id));
|
|
2051
|
+
} else {
|
|
2052
|
+
await stage?.select(newNodes[0].id);
|
|
2053
|
+
}
|
|
1836
2054
|
return newNode;
|
|
1837
2055
|
}
|
|
1838
2056
|
async moveLayer(offset) {
|
|
@@ -1939,6 +2157,12 @@
|
|
|
1939
2157
|
return null;
|
|
1940
2158
|
return root.codeBlocks || null;
|
|
1941
2159
|
}
|
|
2160
|
+
getCodeDslSync() {
|
|
2161
|
+
const root = this.get("root");
|
|
2162
|
+
if (!root)
|
|
2163
|
+
return null;
|
|
2164
|
+
return root.codeBlocks || null;
|
|
2165
|
+
}
|
|
1942
2166
|
async setCodeDsl(codeDsl) {
|
|
1943
2167
|
if (!this.state.root)
|
|
1944
2168
|
return;
|
|
@@ -2253,14 +2477,14 @@
|
|
|
2253
2477
|
{
|
|
2254
2478
|
name: "created",
|
|
2255
2479
|
text: "created",
|
|
2256
|
-
|
|
2257
|
-
|
|
2480
|
+
labelWidth: "100px",
|
|
2481
|
+
type: "code-select"
|
|
2258
2482
|
},
|
|
2259
2483
|
{
|
|
2260
2484
|
name: "mounted",
|
|
2261
2485
|
text: "mounted",
|
|
2262
|
-
|
|
2263
|
-
|
|
2486
|
+
labelWidth: "100px",
|
|
2487
|
+
type: "code-select"
|
|
2264
2488
|
}
|
|
2265
2489
|
]
|
|
2266
2490
|
}
|
|
@@ -2372,12 +2596,14 @@
|
|
|
2372
2596
|
getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY))
|
|
2373
2597
|
]);
|
|
2374
2598
|
stage.on("select", (el) => {
|
|
2599
|
+
if (`${editorService.get("node")?.id}` === el.id && editorService.get("nodes").length === 1)
|
|
2600
|
+
return;
|
|
2375
2601
|
editorService.select(el.id);
|
|
2376
2602
|
});
|
|
2377
2603
|
stage.on("highlight", (el) => {
|
|
2378
2604
|
editorService.highlight(el.id);
|
|
2379
2605
|
});
|
|
2380
|
-
stage.on("
|
|
2606
|
+
stage.on("multi-select", (els) => {
|
|
2381
2607
|
editorService.multiSelect(els.map((el) => el.id));
|
|
2382
2608
|
});
|
|
2383
2609
|
stage.on("update", (ev) => {
|
|
@@ -2392,7 +2618,12 @@
|
|
|
2392
2618
|
stage.on("sort", (ev) => {
|
|
2393
2619
|
editorService.sort(ev.src, ev.dist);
|
|
2394
2620
|
});
|
|
2395
|
-
stage.on("
|
|
2621
|
+
stage.on("select-parent", () => {
|
|
2622
|
+
const parent = editorService.get("parent");
|
|
2623
|
+
editorService.select(parent);
|
|
2624
|
+
editorService.get("stage").select(parent.id);
|
|
2625
|
+
});
|
|
2626
|
+
stage.on("change-guides", (e) => {
|
|
2396
2627
|
uiService.set("showGuides", true);
|
|
2397
2628
|
if (!root.value || !page.value)
|
|
2398
2629
|
return;
|
|
@@ -2408,11 +2639,14 @@
|
|
|
2408
2639
|
return stage;
|
|
2409
2640
|
};
|
|
2410
2641
|
|
|
2411
|
-
const _hoisted_1$
|
|
2412
|
-
const _hoisted_2$
|
|
2413
|
-
const _hoisted_3$
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2642
|
+
const _hoisted_1$d = { class: "m-editor-empty-panel" };
|
|
2643
|
+
const _hoisted_2$7 = { class: "m-editor-empty-content" };
|
|
2644
|
+
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u65B0\u589E\u9875\u9762", -1);
|
|
2645
|
+
const __default__$l = vue.defineComponent({
|
|
2646
|
+
name: "MEditorAddPageBox"
|
|
2647
|
+
});
|
|
2648
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
2649
|
+
...__default__$l,
|
|
2416
2650
|
setup(__props) {
|
|
2417
2651
|
const services = vue.inject("services");
|
|
2418
2652
|
const clickHandler = () => {
|
|
@@ -2425,22 +2659,16 @@
|
|
|
2425
2659
|
});
|
|
2426
2660
|
};
|
|
2427
2661
|
return (_ctx, _cache) => {
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
vue.createElementVNode("div", _hoisted_2$5, [
|
|
2662
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
|
|
2663
|
+
vue.createElementVNode("div", _hoisted_2$7, [
|
|
2431
2664
|
vue.createElementVNode("div", {
|
|
2432
2665
|
class: "m-editor-empty-button",
|
|
2433
2666
|
onClick: clickHandler
|
|
2434
2667
|
}, [
|
|
2435
2668
|
vue.createElementVNode("div", null, [
|
|
2436
|
-
vue.createVNode(
|
|
2437
|
-
default: vue.withCtx(() => [
|
|
2438
|
-
vue.createVNode(vue.unref(iconsVue.Plus))
|
|
2439
|
-
]),
|
|
2440
|
-
_: 1
|
|
2441
|
-
})
|
|
2669
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
2442
2670
|
]),
|
|
2443
|
-
_hoisted_3$
|
|
2671
|
+
_hoisted_3$4
|
|
2444
2672
|
])
|
|
2445
2673
|
])
|
|
2446
2674
|
]);
|
|
@@ -2448,137 +2676,12 @@
|
|
|
2448
2676
|
}
|
|
2449
2677
|
});
|
|
2450
2678
|
|
|
2451
|
-
const
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
setup(__props, { emit }) {
|
|
2455
|
-
const target = vue.ref();
|
|
2456
|
-
let getso;
|
|
2457
|
-
vue.onMounted(() => {
|
|
2458
|
-
if (!target.value)
|
|
2459
|
-
return;
|
|
2460
|
-
getso = new Gesto__default.default(target.value, {
|
|
2461
|
-
container: window,
|
|
2462
|
-
pinchOutside: true
|
|
2463
|
-
}).on("drag", (e) => {
|
|
2464
|
-
if (!target.value)
|
|
2465
|
-
return;
|
|
2466
|
-
emit("change", e.deltaX);
|
|
2467
|
-
});
|
|
2468
|
-
});
|
|
2469
|
-
vue.onUnmounted(() => {
|
|
2470
|
-
getso?.unset();
|
|
2471
|
-
});
|
|
2472
|
-
return (_ctx, _cache) => {
|
|
2473
|
-
return vue.openBlock(), vue.createElementBlock("span", {
|
|
2474
|
-
ref_key: "target",
|
|
2475
|
-
ref: target,
|
|
2476
|
-
class: "m-editor-resizer"
|
|
2477
|
-
}, [
|
|
2478
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
2479
|
-
], 512);
|
|
2480
|
-
};
|
|
2481
|
-
}
|
|
2679
|
+
const _hoisted_1$c = { class: "m-editor" };
|
|
2680
|
+
const __default__$k = vue.defineComponent({
|
|
2681
|
+
name: "MEditorFramework"
|
|
2482
2682
|
});
|
|
2483
|
-
|
|
2484
2683
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
2485
|
-
|
|
2486
|
-
props: {
|
|
2487
|
-
left: null,
|
|
2488
|
-
right: null,
|
|
2489
|
-
minLeft: { default: 1 },
|
|
2490
|
-
minRight: { default: 1 },
|
|
2491
|
-
leftClass: null,
|
|
2492
|
-
rightClass: null,
|
|
2493
|
-
centerClass: null
|
|
2494
|
-
},
|
|
2495
|
-
emits: ["update:left", "change", "update:right"],
|
|
2496
|
-
setup(__props, { emit }) {
|
|
2497
|
-
const props = __props;
|
|
2498
|
-
const el = vue.ref();
|
|
2499
|
-
let clientWidth = 0;
|
|
2500
|
-
const resizerObserver = new ResizeObserver((entries) => {
|
|
2501
|
-
for (const { contentRect } of entries) {
|
|
2502
|
-
clientWidth = contentRect.width;
|
|
2503
|
-
center.value = clientWidth - (props.left || 0) - (props.right || 0);
|
|
2504
|
-
emit("change", {
|
|
2505
|
-
left: props.left,
|
|
2506
|
-
center: center.value,
|
|
2507
|
-
right: props.right
|
|
2508
|
-
});
|
|
2509
|
-
}
|
|
2510
|
-
});
|
|
2511
|
-
vue.onMounted(() => {
|
|
2512
|
-
if (el.value) {
|
|
2513
|
-
resizerObserver.observe(el.value);
|
|
2514
|
-
}
|
|
2515
|
-
});
|
|
2516
|
-
vue.onUnmounted(() => {
|
|
2517
|
-
resizerObserver.disconnect();
|
|
2518
|
-
});
|
|
2519
|
-
const center = vue.ref(0);
|
|
2520
|
-
const changeLeft = (deltaX) => {
|
|
2521
|
-
if (typeof props.left === "undefined")
|
|
2522
|
-
return;
|
|
2523
|
-
const left = Math.max(props.left + deltaX, props.minLeft) || 0;
|
|
2524
|
-
emit("update:left", left);
|
|
2525
|
-
center.value = clientWidth - left - (props.right || 0);
|
|
2526
|
-
emit("change", {
|
|
2527
|
-
left,
|
|
2528
|
-
center: center.value,
|
|
2529
|
-
right: props.right
|
|
2530
|
-
});
|
|
2531
|
-
};
|
|
2532
|
-
const changeRight = (deltaX) => {
|
|
2533
|
-
if (typeof props.right === "undefined")
|
|
2534
|
-
return;
|
|
2535
|
-
const right = Math.max(props.right - deltaX, props.minRight) || 0;
|
|
2536
|
-
emit("update:right", right);
|
|
2537
|
-
center.value = clientWidth - (props.left || 0) - right;
|
|
2538
|
-
emit("change", {
|
|
2539
|
-
left: props.left,
|
|
2540
|
-
center: center.value,
|
|
2541
|
-
right
|
|
2542
|
-
});
|
|
2543
|
-
};
|
|
2544
|
-
return (_ctx, _cache) => {
|
|
2545
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2546
|
-
ref_key: "el",
|
|
2547
|
-
ref: el,
|
|
2548
|
-
class: "m-editor-layout"
|
|
2549
|
-
}, [
|
|
2550
|
-
typeof props.left !== "undefined" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
2551
|
-
vue.createElementVNode("div", {
|
|
2552
|
-
class: vue.normalizeClass(["m-editor-layout-left", __props.leftClass]),
|
|
2553
|
-
style: vue.normalizeStyle(`width: ${__props.left}px`)
|
|
2554
|
-
}, [
|
|
2555
|
-
vue.renderSlot(_ctx.$slots, "left")
|
|
2556
|
-
], 6),
|
|
2557
|
-
vue.createVNode(_sfc_main$m, { onChange: changeLeft })
|
|
2558
|
-
], 64)) : vue.createCommentVNode("", true),
|
|
2559
|
-
vue.createElementVNode("div", {
|
|
2560
|
-
class: vue.normalizeClass(["m-editor-layout-center", __props.centerClass]),
|
|
2561
|
-
style: vue.normalizeStyle(`width: ${center.value}px`)
|
|
2562
|
-
}, [
|
|
2563
|
-
vue.renderSlot(_ctx.$slots, "center")
|
|
2564
|
-
], 6),
|
|
2565
|
-
typeof props.right !== "undefined" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
2566
|
-
vue.createVNode(_sfc_main$m, { onChange: changeRight }),
|
|
2567
|
-
vue.createElementVNode("div", {
|
|
2568
|
-
class: vue.normalizeClass(["m-editor-layout-right", __props.rightClass]),
|
|
2569
|
-
style: vue.normalizeStyle(`width: ${__props.right}px`)
|
|
2570
|
-
}, [
|
|
2571
|
-
vue.renderSlot(_ctx.$slots, "right")
|
|
2572
|
-
], 6)
|
|
2573
|
-
], 64)) : vue.createCommentVNode("", true)
|
|
2574
|
-
], 512);
|
|
2575
|
-
};
|
|
2576
|
-
}
|
|
2577
|
-
});
|
|
2578
|
-
|
|
2579
|
-
const _hoisted_1$a = { class: "m-editor" };
|
|
2580
|
-
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2581
|
-
__name: "Framework",
|
|
2684
|
+
...__default__$k,
|
|
2582
2685
|
props: {
|
|
2583
2686
|
codeOptions: { default: () => ({}) }
|
|
2584
2687
|
},
|
|
@@ -2587,48 +2690,64 @@
|
|
|
2587
2690
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
2588
2691
|
const { editorService, uiService } = vue.inject("services") || {};
|
|
2589
2692
|
const root = vue.computed(() => editorService?.get("root"));
|
|
2693
|
+
const nodes = vue.computed(() => editorService?.get("nodes") || []);
|
|
2590
2694
|
const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
|
|
2591
2695
|
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
2696
|
+
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
2697
|
+
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
2698
|
+
const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
|
|
2699
|
+
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY));
|
|
2592
2700
|
const columnWidth = vue.ref({
|
|
2593
|
-
left:
|
|
2701
|
+
left: leftColumnWidthCacheData,
|
|
2594
2702
|
center: 0,
|
|
2595
|
-
right:
|
|
2703
|
+
right: RightColumnWidthCacheData
|
|
2596
2704
|
});
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
columnWidth.value.
|
|
2601
|
-
columnWidth.value.
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2705
|
+
vue.watch(
|
|
2706
|
+
pageLength,
|
|
2707
|
+
(length) => {
|
|
2708
|
+
const left = columnWidth.value.left || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
2709
|
+
columnWidth.value.left = left;
|
|
2710
|
+
if (length <= 0) {
|
|
2711
|
+
columnWidth.value.right = void 0;
|
|
2712
|
+
columnWidth.value.center = globalThis.document.body.clientWidth - left;
|
|
2713
|
+
} else {
|
|
2714
|
+
const right = columnWidth.value.right || RightColumnWidthCacheData || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
2715
|
+
columnWidth.value.right = right;
|
|
2716
|
+
columnWidth.value.center = globalThis.document.body.clientWidth - left - right;
|
|
2717
|
+
}
|
|
2718
|
+
uiService?.set("columnWidth", columnWidth);
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
immediate: true
|
|
2605
2722
|
}
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2723
|
+
);
|
|
2724
|
+
vue.watch(
|
|
2725
|
+
() => columnWidth.value.right,
|
|
2726
|
+
(right) => {
|
|
2727
|
+
if (typeof right === "undefined")
|
|
2728
|
+
return;
|
|
2729
|
+
globalThis.localStorage.setItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, `${right}`);
|
|
2730
|
+
}
|
|
2731
|
+
);
|
|
2732
|
+
vue.watch(
|
|
2733
|
+
() => columnWidth.value.left,
|
|
2734
|
+
(left) => {
|
|
2735
|
+
globalThis.localStorage.setItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, `${left}`);
|
|
2612
2736
|
}
|
|
2737
|
+
);
|
|
2738
|
+
const columnWidthChange = (columnWidth2) => {
|
|
2739
|
+
uiService?.set("columnWidth", columnWidth2);
|
|
2613
2740
|
};
|
|
2614
|
-
const
|
|
2615
|
-
const columnWidthCacheData = globalThis.localStorage.getItem(COLUMN_WIDTH_STORAGE_KEY);
|
|
2616
|
-
if (columnWidthCacheData) {
|
|
2741
|
+
const saveCode = (value) => {
|
|
2617
2742
|
try {
|
|
2618
|
-
|
|
2619
|
-
columnWidth.value = columnWidthCache;
|
|
2743
|
+
editorService?.set("root", eval(value));
|
|
2620
2744
|
} catch (e) {
|
|
2621
2745
|
console.error(e);
|
|
2622
2746
|
}
|
|
2623
|
-
}
|
|
2624
|
-
const columnWidthChange = (columnWidth2) => {
|
|
2625
|
-
uiService?.set("columnWidth", columnWidth2);
|
|
2626
|
-
globalThis.localStorage.setItem(COLUMN_WIDTH_STORAGE_KEY, JSON.stringify(columnWidth2));
|
|
2627
2747
|
};
|
|
2628
2748
|
return (_ctx, _cache) => {
|
|
2629
2749
|
const _component_magic_code_editor = vue.resolveComponent("magic-code-editor");
|
|
2630
|
-
|
|
2631
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
2750
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
2632
2751
|
vue.renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
|
|
2633
2752
|
vue.unref(showSrc) ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
|
|
2634
2753
|
key: 0,
|
|
@@ -2636,95 +2755,57 @@
|
|
|
2636
2755
|
"init-values": vue.unref(root),
|
|
2637
2756
|
options: __props.codeOptions,
|
|
2638
2757
|
onSave: saveCode
|
|
2639
|
-
}, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2640
|
-
key: 1,
|
|
2641
|
-
class: "m-editor-content",
|
|
2642
|
-
"left-class": "m-editor-framework-left",
|
|
2643
|
-
"center-class": "m-editor-framework-center",
|
|
2644
|
-
"right-class": "m-editor-framework-right",
|
|
2645
|
-
left: columnWidth.value.left,
|
|
2646
|
-
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => columnWidth.value.left = $event),
|
|
2647
|
-
right: columnWidth.value.right,
|
|
2648
|
-
"onUpdate:right": _cache[1] || (_cache[1] = ($event) => columnWidth.value.right = $event),
|
|
2649
|
-
"min-left": 45,
|
|
2650
|
-
"min-right": 1,
|
|
2651
|
-
onChange: columnWidthChange
|
|
2652
|
-
}, vue.createSlots({
|
|
2653
|
-
left: vue.withCtx(() => [
|
|
2654
|
-
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
2655
|
-
]),
|
|
2656
|
-
center: vue.withCtx(() => [
|
|
2657
|
-
vue.unref(pageLength) > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
2658
|
-
vue.createVNode(_sfc_main$
|
|
2659
|
-
])
|
|
2660
|
-
]),
|
|
2661
|
-
_: 2
|
|
2662
|
-
}, [
|
|
2663
|
-
vue.unref(pageLength) > 0 ? {
|
|
2664
|
-
name: "right",
|
|
2665
|
-
fn: vue.withCtx(() => [
|
|
2666
|
-
vue.createVNode(
|
|
2667
|
-
default: vue.withCtx(() => [
|
|
2668
|
-
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
2669
|
-
]),
|
|
2670
|
-
_: 3
|
|
2671
|
-
})
|
|
2672
|
-
])
|
|
2673
|
-
} : void 0
|
|
2674
|
-
]), 1032, ["left", "right"]))
|
|
2675
|
-
]);
|
|
2676
|
-
};
|
|
2677
|
-
}
|
|
2678
|
-
});
|
|
2679
|
-
|
|
2680
|
-
const _hoisted_1$9 = ["src"];
|
|
2681
|
-
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2682
|
-
__name: "Icon",
|
|
2683
|
-
props: {
|
|
2684
|
-
icon: null
|
|
2685
|
-
},
|
|
2686
|
-
setup(__props) {
|
|
2687
|
-
return (_ctx, _cache) => {
|
|
2688
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
2689
|
-
return !__props.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2690
|
-
key: 0,
|
|
2691
|
-
class: "magic-editor-icon"
|
|
2692
|
-
}, {
|
|
2693
|
-
default: vue.withCtx(() => [
|
|
2694
|
-
vue.createVNode(vue.unref(iconsVue.Edit))
|
|
2695
|
-
]),
|
|
2696
|
-
_: 1
|
|
2697
|
-
})) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2698
|
-
key: 1,
|
|
2699
|
-
class: "magic-editor-icon"
|
|
2700
|
-
}, {
|
|
2701
|
-
default: vue.withCtx(() => [
|
|
2702
|
-
vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$9)
|
|
2703
|
-
]),
|
|
2704
|
-
_: 1
|
|
2705
|
-
})) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
2706
|
-
key: 2,
|
|
2707
|
-
class: vue.normalizeClass(["magic-editor-icon", __props.icon])
|
|
2708
|
-
}, null, 2)) : (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
2709
|
-
key: 3,
|
|
2710
|
-
class: "magic-editor-icon"
|
|
2711
|
-
}, {
|
|
2712
|
-
default: vue.withCtx(() => [
|
|
2713
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(__props.icon))))
|
|
2714
|
-
]),
|
|
2715
|
-
_: 1
|
|
2716
|
-
}));
|
|
2758
|
+
}, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
2759
|
+
key: 1,
|
|
2760
|
+
class: "m-editor-content",
|
|
2761
|
+
"left-class": "m-editor-framework-left",
|
|
2762
|
+
"center-class": "m-editor-framework-center",
|
|
2763
|
+
"right-class": "m-editor-framework-right",
|
|
2764
|
+
left: columnWidth.value.left,
|
|
2765
|
+
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => columnWidth.value.left = $event),
|
|
2766
|
+
right: columnWidth.value.right,
|
|
2767
|
+
"onUpdate:right": _cache[1] || (_cache[1] = ($event) => columnWidth.value.right = $event),
|
|
2768
|
+
"min-left": 45,
|
|
2769
|
+
"min-right": 1,
|
|
2770
|
+
onChange: columnWidthChange
|
|
2771
|
+
}, vue.createSlots({
|
|
2772
|
+
left: vue.withCtx(() => [
|
|
2773
|
+
vue.renderSlot(_ctx.$slots, "sidebar")
|
|
2774
|
+
]),
|
|
2775
|
+
center: vue.withCtx(() => [
|
|
2776
|
+
vue.unref(pageLength) > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
2777
|
+
vue.createVNode(_sfc_main$m)
|
|
2778
|
+
])
|
|
2779
|
+
]),
|
|
2780
|
+
_: 2
|
|
2781
|
+
}, [
|
|
2782
|
+
vue.unref(pageLength) > 0 && vue.unref(nodes).length === 1 ? {
|
|
2783
|
+
name: "right",
|
|
2784
|
+
fn: vue.withCtx(() => [
|
|
2785
|
+
vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
|
|
2786
|
+
default: vue.withCtx(() => [
|
|
2787
|
+
vue.renderSlot(_ctx.$slots, "props-panel")
|
|
2788
|
+
]),
|
|
2789
|
+
_: 3
|
|
2790
|
+
})
|
|
2791
|
+
])
|
|
2792
|
+
} : void 0
|
|
2793
|
+
]), 1032, ["left", "right"]))
|
|
2794
|
+
]);
|
|
2717
2795
|
};
|
|
2718
2796
|
}
|
|
2719
2797
|
});
|
|
2720
2798
|
|
|
2721
|
-
const _hoisted_1$
|
|
2799
|
+
const _hoisted_1$b = {
|
|
2722
2800
|
key: 1,
|
|
2723
2801
|
class: "menu-item-text"
|
|
2724
2802
|
};
|
|
2725
|
-
const _hoisted_2$
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2803
|
+
const _hoisted_2$6 = { class: "el-dropdown-link menubar-menu-button" };
|
|
2804
|
+
const __default__$j = vue.defineComponent({
|
|
2805
|
+
name: "MEditorToolButton"
|
|
2806
|
+
});
|
|
2807
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
2808
|
+
...__default__$j,
|
|
2728
2809
|
props: {
|
|
2729
2810
|
data: { default: () => ({
|
|
2730
2811
|
type: "text",
|
|
@@ -2789,13 +2870,6 @@
|
|
|
2789
2870
|
}
|
|
2790
2871
|
};
|
|
2791
2872
|
return (_ctx, _cache) => {
|
|
2792
|
-
const _component_el_divider = vue.resolveComponent("el-divider");
|
|
2793
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
2794
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
2795
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
2796
|
-
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
2797
|
-
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
2798
|
-
const _component_el_dropdown = vue.resolveComponent("el-dropdown");
|
|
2799
2873
|
return vue.unref(display) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2800
2874
|
key: 0,
|
|
2801
2875
|
class: vue.normalizeClass(["menu-item", `${__props.data.type} ${__props.data.className || ""}`]),
|
|
@@ -2803,24 +2877,24 @@
|
|
|
2803
2877
|
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(__props.data, $event)),
|
|
2804
2878
|
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(__props.data, $event))
|
|
2805
2879
|
}, [
|
|
2806
|
-
__props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(
|
|
2880
|
+
__props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
|
|
2807
2881
|
key: 0,
|
|
2808
2882
|
direction: __props.data.direction || "vertical"
|
|
2809
|
-
}, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2810
|
-
__props.data.tooltip ? (vue.openBlock(), vue.createBlock(
|
|
2883
|
+
}, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, vue.toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
2884
|
+
__props.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
2811
2885
|
key: 0,
|
|
2812
2886
|
effect: "dark",
|
|
2813
2887
|
placement: "bottom-start",
|
|
2814
2888
|
content: __props.data.tooltip
|
|
2815
2889
|
}, {
|
|
2816
2890
|
default: vue.withCtx(() => [
|
|
2817
|
-
vue.createVNode(
|
|
2891
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
2818
2892
|
size: "small",
|
|
2819
2893
|
text: "",
|
|
2820
2894
|
disabled: vue.unref(disabled)
|
|
2821
2895
|
}, {
|
|
2822
2896
|
default: vue.withCtx(() => [
|
|
2823
|
-
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2897
|
+
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
2824
2898
|
key: 0,
|
|
2825
2899
|
icon: __props.data.icon
|
|
2826
2900
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -2830,14 +2904,14 @@
|
|
|
2830
2904
|
}, 8, ["disabled"])
|
|
2831
2905
|
]),
|
|
2832
2906
|
_: 1
|
|
2833
|
-
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(
|
|
2907
|
+
}, 8, ["content"])) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
2834
2908
|
key: 1,
|
|
2835
2909
|
size: "small",
|
|
2836
2910
|
text: "",
|
|
2837
2911
|
disabled: vue.unref(disabled)
|
|
2838
2912
|
}, {
|
|
2839
2913
|
default: vue.withCtx(() => [
|
|
2840
|
-
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
2914
|
+
__props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
2841
2915
|
key: 0,
|
|
2842
2916
|
icon: __props.data.icon
|
|
2843
2917
|
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -2845,17 +2919,17 @@
|
|
|
2845
2919
|
]),
|
|
2846
2920
|
_: 1
|
|
2847
2921
|
}, 8, ["disabled"]))
|
|
2848
|
-
], 64)) : __props.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(
|
|
2922
|
+
], 64)) : __props.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
|
|
2849
2923
|
key: 3,
|
|
2850
2924
|
trigger: "click",
|
|
2851
2925
|
disabled: vue.unref(disabled),
|
|
2852
2926
|
onCommand: dropdownHandler
|
|
2853
2927
|
}, {
|
|
2854
2928
|
dropdown: vue.withCtx(() => [
|
|
2855
|
-
__props.data.items && __props.data.items.length ? (vue.openBlock(), vue.createBlock(
|
|
2929
|
+
__props.data.items && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
|
|
2856
2930
|
default: vue.withCtx(() => [
|
|
2857
2931
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.data.items, (subItem, index) => {
|
|
2858
|
-
return vue.openBlock(), vue.createBlock(
|
|
2932
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
|
|
2859
2933
|
key: index,
|
|
2860
2934
|
command: { data: __props.data, subItem }
|
|
2861
2935
|
}, {
|
|
@@ -2870,9 +2944,9 @@
|
|
|
2870
2944
|
})) : vue.createCommentVNode("", true)
|
|
2871
2945
|
]),
|
|
2872
2946
|
default: vue.withCtx(() => [
|
|
2873
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
2947
|
+
vue.createElementVNode("span", _hoisted_2$6, [
|
|
2874
2948
|
vue.createTextVNode(vue.toDisplayString(__props.data.text), 1),
|
|
2875
|
-
vue.createVNode(
|
|
2949
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
2876
2950
|
default: vue.withCtx(() => [
|
|
2877
2951
|
vue.createVNode(vue.unref(iconsVue.ArrowDown))
|
|
2878
2952
|
]),
|
|
@@ -2887,8 +2961,11 @@
|
|
|
2887
2961
|
}
|
|
2888
2962
|
});
|
|
2889
2963
|
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2964
|
+
const __default__$i = vue.defineComponent({
|
|
2965
|
+
name: "MEditorNavMenu"
|
|
2966
|
+
});
|
|
2967
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
2968
|
+
...__default__$i,
|
|
2892
2969
|
props: {
|
|
2893
2970
|
data: { default: () => ({}) },
|
|
2894
2971
|
height: { default: 35 }
|
|
@@ -3043,7 +3120,7 @@
|
|
|
3043
3120
|
style: vue.normalizeStyle(`width: ${vue.unref(columnWidth)?.[key]}px`)
|
|
3044
3121
|
}, [
|
|
3045
3122
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(buttons)[key], (item, index) => {
|
|
3046
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
3123
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
3047
3124
|
data: item,
|
|
3048
3125
|
key: index
|
|
3049
3126
|
}, null, 8, ["data"]);
|
|
@@ -3055,9 +3132,12 @@
|
|
|
3055
3132
|
}
|
|
3056
3133
|
});
|
|
3057
3134
|
|
|
3058
|
-
const _hoisted_1$
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3135
|
+
const _hoisted_1$a = { class: "m-editor-props-panel" };
|
|
3136
|
+
const __default__$h = vue.defineComponent({
|
|
3137
|
+
name: "MEditorPropsPanel"
|
|
3138
|
+
});
|
|
3139
|
+
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
3140
|
+
...__default__$h,
|
|
3061
3141
|
emits: ["mounted"],
|
|
3062
3142
|
setup(__props, { expose, emit }) {
|
|
3063
3143
|
const internalInstance = vue.getCurrentInstance();
|
|
@@ -3066,7 +3146,9 @@
|
|
|
3066
3146
|
const curFormConfig = vue.ref([]);
|
|
3067
3147
|
const services = vue.inject("services");
|
|
3068
3148
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
3069
|
-
const propsPanelSize = vue.computed(
|
|
3149
|
+
const propsPanelSize = vue.computed(
|
|
3150
|
+
() => services?.uiService.get("propsPanelSize") || "small"
|
|
3151
|
+
);
|
|
3070
3152
|
const stage = vue.computed(() => services?.editorService.get("stage"));
|
|
3071
3153
|
const init = async () => {
|
|
3072
3154
|
if (!node.value) {
|
|
@@ -3093,21 +3175,15 @@
|
|
|
3093
3175
|
services?.editorService.update(values2);
|
|
3094
3176
|
} catch (e) {
|
|
3095
3177
|
console.error(e);
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
duration: 1e4,
|
|
3099
|
-
showClose: true,
|
|
3100
|
-
message: e.message,
|
|
3101
|
-
dangerouslyUseHTMLString: true
|
|
3102
|
-
});
|
|
3178
|
+
design.tMagicMessage.closeAll();
|
|
3179
|
+
design.tMagicMessage.error(e.message);
|
|
3103
3180
|
}
|
|
3104
3181
|
};
|
|
3105
3182
|
expose({ submit });
|
|
3106
3183
|
return (_ctx, _cache) => {
|
|
3107
|
-
|
|
3108
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
3184
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
3109
3185
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
3110
|
-
vue.createVNode(
|
|
3186
|
+
vue.createVNode(vue.unref(form.MForm), {
|
|
3111
3187
|
ref_key: "configForm",
|
|
3112
3188
|
ref: configForm,
|
|
3113
3189
|
class: vue.normalizeClass(`m-editor-props-panel ${vue.unref(propsPanelSize)}`),
|
|
@@ -3122,43 +3198,328 @@
|
|
|
3122
3198
|
}
|
|
3123
3199
|
});
|
|
3124
3200
|
|
|
3125
|
-
const _hoisted_1$
|
|
3126
|
-
|
|
3127
|
-
const _hoisted_3$1 = { class: "code-name" };
|
|
3128
|
-
const _hoisted_4$1 = { class: "code-name-wrapper" };
|
|
3129
|
-
const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "\u4EE3\u7801\u5757\u540D\u79F0", -1);
|
|
3130
|
-
const _hoisted_6$1 = { class: "m-editor-wrapper" };
|
|
3131
|
-
const _hoisted_7$1 = {
|
|
3132
|
-
key: 1,
|
|
3201
|
+
const _hoisted_1$9 = {
|
|
3202
|
+
key: 0,
|
|
3133
3203
|
class: "m-editor-content-bottom"
|
|
3134
3204
|
};
|
|
3135
|
-
const
|
|
3136
|
-
const
|
|
3137
|
-
const
|
|
3138
|
-
key:
|
|
3205
|
+
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4FDD\u5B58");
|
|
3206
|
+
const _hoisted_3$3 = /* @__PURE__ */ vue.createTextVNode("\u5173\u95ED");
|
|
3207
|
+
const _hoisted_4$2 = {
|
|
3208
|
+
key: 1,
|
|
3139
3209
|
class: "m-editor-content-bottom"
|
|
3140
3210
|
};
|
|
3141
|
-
const
|
|
3211
|
+
const _hoisted_5$1 = /* @__PURE__ */ vue.createTextVNode("\u5173\u95ED");
|
|
3212
|
+
const __default__$g = vue.defineComponent({
|
|
3213
|
+
name: "MEditorCodeDraftEditor"
|
|
3214
|
+
});
|
|
3215
|
+
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
3216
|
+
...__default__$g,
|
|
3217
|
+
props: {
|
|
3218
|
+
id: null,
|
|
3219
|
+
content: null,
|
|
3220
|
+
editable: { type: Boolean, default: true },
|
|
3221
|
+
autoSaveDraft: { type: Boolean, default: true },
|
|
3222
|
+
codeOptions: null,
|
|
3223
|
+
language: null
|
|
3224
|
+
},
|
|
3225
|
+
emits: ["save", "close", "saveAndClose"],
|
|
3226
|
+
setup(__props, { emit }) {
|
|
3227
|
+
const props = __props;
|
|
3228
|
+
const services = vue.inject("services");
|
|
3229
|
+
const codeContent = vue.ref("");
|
|
3230
|
+
const editorContent = vue.ref("");
|
|
3231
|
+
const codeEditor = vue.ref();
|
|
3232
|
+
const originCodeContent = vue.ref("");
|
|
3233
|
+
const isFullScreen = vue.ref(false);
|
|
3234
|
+
const codeOptions = vue.computed(() => ({
|
|
3235
|
+
...props.codeOptions,
|
|
3236
|
+
readOnly: !props.editable
|
|
3237
|
+
}));
|
|
3238
|
+
vue.watchEffect(() => {
|
|
3239
|
+
codeContent.value = props.content;
|
|
3240
|
+
if (!originCodeContent.value) {
|
|
3241
|
+
originCodeContent.value = codeContent.value;
|
|
3242
|
+
}
|
|
3243
|
+
const codeDraft = services?.codeBlockService.getCodeDraft(props.id);
|
|
3244
|
+
if (codeDraft) {
|
|
3245
|
+
codeContent.value = codeDraft;
|
|
3246
|
+
}
|
|
3247
|
+
});
|
|
3248
|
+
const saveCodeDraft = async (codeValue) => {
|
|
3249
|
+
if (!props.autoSaveDraft)
|
|
3250
|
+
return;
|
|
3251
|
+
if (originCodeContent.value === codeValue) {
|
|
3252
|
+
services?.codeBlockService.removeCodeDraft(props.id);
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3255
|
+
services?.codeBlockService.setCodeDraft(props.id, codeValue);
|
|
3256
|
+
design.tMagicMessage.success(`\u4EE3\u7801\u8349\u7A3F\u4FDD\u5B58\u6210\u529F ${utils.datetimeFormatter(new Date())}`);
|
|
3257
|
+
};
|
|
3258
|
+
const saveCode = () => {
|
|
3259
|
+
if (!codeEditor.value || !props.editable)
|
|
3260
|
+
return;
|
|
3261
|
+
editorContent.value = codeEditor.value.getEditor()?.getValue();
|
|
3262
|
+
emit("save", editorContent.value);
|
|
3263
|
+
};
|
|
3264
|
+
const saveAndClose = () => {
|
|
3265
|
+
if (!codeEditor.value || !props.editable)
|
|
3266
|
+
return;
|
|
3267
|
+
editorContent.value = codeEditor.value.getEditor()?.getValue();
|
|
3268
|
+
emit("saveAndClose", editorContent.value);
|
|
3269
|
+
};
|
|
3270
|
+
const close = async () => {
|
|
3271
|
+
const codeDraft = services?.codeBlockService.getCodeDraft(props.id);
|
|
3272
|
+
if (codeDraft) {
|
|
3273
|
+
design.tMagicMessageBox.confirm("\u60A8\u6709\u4EE3\u7801\u4FEE\u6539\u672A\u4FDD\u5B58\uFF0C\u662F\u5426\u4FDD\u5B58\u540E\u518D\u5173\u95ED\uFF1F", "\u63D0\u793A", {
|
|
3274
|
+
confirmButtonText: "\u786E\u8BA4",
|
|
3275
|
+
cancelButtonText: "\u53D6\u6D88",
|
|
3276
|
+
type: "warning"
|
|
3277
|
+
}).then(async () => {
|
|
3278
|
+
saveAndClose();
|
|
3279
|
+
}).catch(() => {
|
|
3280
|
+
services?.codeBlockService.removeCodeDraft(props.id);
|
|
3281
|
+
emit("close");
|
|
3282
|
+
});
|
|
3283
|
+
} else {
|
|
3284
|
+
emit("close");
|
|
3285
|
+
}
|
|
3286
|
+
};
|
|
3287
|
+
const toggleFullScreen = () => {
|
|
3288
|
+
isFullScreen.value = !isFullScreen.value;
|
|
3289
|
+
if (codeEditor.value) {
|
|
3290
|
+
codeEditor.value.focus();
|
|
3291
|
+
}
|
|
3292
|
+
};
|
|
3293
|
+
return (_ctx, _cache) => {
|
|
3294
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3295
|
+
class: vue.normalizeClass(["m-editor-wrapper", isFullScreen.value ? "fullScreen" : "normal"])
|
|
3296
|
+
}, [
|
|
3297
|
+
vue.createVNode(_sfc_main$q, {
|
|
3298
|
+
ref_key: "codeEditor",
|
|
3299
|
+
ref: codeEditor,
|
|
3300
|
+
class: "m-editor-container",
|
|
3301
|
+
"init-values": `${codeContent.value}`,
|
|
3302
|
+
onSave: saveCodeDraft,
|
|
3303
|
+
language: __props.language,
|
|
3304
|
+
options: vue.unref(codeOptions)
|
|
3305
|
+
}, null, 8, ["init-values", "language", "options"]),
|
|
3306
|
+
__props.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
|
|
3307
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3308
|
+
type: "primary",
|
|
3309
|
+
class: "button",
|
|
3310
|
+
onClick: toggleFullScreen
|
|
3311
|
+
}, {
|
|
3312
|
+
default: vue.withCtx(() => [
|
|
3313
|
+
vue.createTextVNode(vue.toDisplayString(isFullScreen.value ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F"), 1)
|
|
3314
|
+
]),
|
|
3315
|
+
_: 1
|
|
3316
|
+
}),
|
|
3317
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3318
|
+
type: "primary",
|
|
3319
|
+
class: "button",
|
|
3320
|
+
onClick: saveCode
|
|
3321
|
+
}, {
|
|
3322
|
+
default: vue.withCtx(() => [
|
|
3323
|
+
_hoisted_2$5
|
|
3324
|
+
]),
|
|
3325
|
+
_: 1
|
|
3326
|
+
}),
|
|
3327
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3328
|
+
type: "primary",
|
|
3329
|
+
class: "button",
|
|
3330
|
+
onClick: close
|
|
3331
|
+
}, {
|
|
3332
|
+
default: vue.withCtx(() => [
|
|
3333
|
+
_hoisted_3$3
|
|
3334
|
+
]),
|
|
3335
|
+
_: 1
|
|
3336
|
+
})
|
|
3337
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
|
|
3338
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3339
|
+
type: "primary",
|
|
3340
|
+
class: "button",
|
|
3341
|
+
onClick: toggleFullScreen
|
|
3342
|
+
}, {
|
|
3343
|
+
default: vue.withCtx(() => [
|
|
3344
|
+
vue.createTextVNode(vue.toDisplayString(isFullScreen.value ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F"), 1)
|
|
3345
|
+
]),
|
|
3346
|
+
_: 1
|
|
3347
|
+
}),
|
|
3348
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
3349
|
+
type: "primary",
|
|
3350
|
+
class: "button",
|
|
3351
|
+
onClick: close
|
|
3352
|
+
}, {
|
|
3353
|
+
default: vue.withCtx(() => [
|
|
3354
|
+
_hoisted_5$1
|
|
3355
|
+
]),
|
|
3356
|
+
_: 1
|
|
3357
|
+
})
|
|
3358
|
+
]))
|
|
3359
|
+
], 2);
|
|
3360
|
+
};
|
|
3361
|
+
}
|
|
3362
|
+
});
|
|
3363
|
+
|
|
3364
|
+
const _hoisted_1$8 = { class: "code-name-wrapper" };
|
|
3365
|
+
const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "\u4EE3\u7801\u5757\u540D\u79F0", -1);
|
|
3366
|
+
const _hoisted_3$2 = { class: "code-name-wrapper" };
|
|
3367
|
+
const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "\u53C2\u6570\u5B9A\u4E49", -1);
|
|
3368
|
+
const __default__$f = vue.defineComponent({
|
|
3369
|
+
name: "MEditorFunctionEditor"
|
|
3370
|
+
});
|
|
3371
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
3372
|
+
...__default__$f,
|
|
3373
|
+
props: {
|
|
3374
|
+
id: null,
|
|
3375
|
+
name: null,
|
|
3376
|
+
content: null,
|
|
3377
|
+
editable: { type: Boolean, default: true },
|
|
3378
|
+
autoSaveDraft: { type: Boolean, default: true },
|
|
3379
|
+
codeOptions: null
|
|
3380
|
+
},
|
|
3381
|
+
emits: ["change", "field-input"],
|
|
3382
|
+
setup(__props, { emit }) {
|
|
3383
|
+
const props = __props;
|
|
3384
|
+
const tableConfig = {
|
|
3385
|
+
border: true,
|
|
3386
|
+
enableFullscreen: false,
|
|
3387
|
+
name: "params",
|
|
3388
|
+
maxHeight: "150px",
|
|
3389
|
+
items: [
|
|
3390
|
+
{
|
|
3391
|
+
type: "text",
|
|
3392
|
+
label: "\u53C2\u6570\u540D",
|
|
3393
|
+
name: "name"
|
|
3394
|
+
}
|
|
3395
|
+
]
|
|
3396
|
+
};
|
|
3397
|
+
const services = vue.inject("services");
|
|
3398
|
+
const codeName = vue.ref("");
|
|
3399
|
+
const codeContent = vue.ref("");
|
|
3400
|
+
const evalRes = vue.ref(true);
|
|
3401
|
+
vue.provide("mForm", {
|
|
3402
|
+
$emit: emit,
|
|
3403
|
+
setField: () => {
|
|
3404
|
+
}
|
|
3405
|
+
});
|
|
3406
|
+
const tableModel = vue.ref();
|
|
3407
|
+
vue.watchEffect(() => {
|
|
3408
|
+
codeName.value = props.name;
|
|
3409
|
+
codeContent.value = props.content;
|
|
3410
|
+
});
|
|
3411
|
+
const initTableModel = () => {
|
|
3412
|
+
const codeDsl = services?.codeBlockService.getCodeDslSync();
|
|
3413
|
+
if (!codeDsl)
|
|
3414
|
+
return;
|
|
3415
|
+
tableModel.value = {
|
|
3416
|
+
params: codeDsl[props.id]?.params || []
|
|
3417
|
+
};
|
|
3418
|
+
};
|
|
3419
|
+
initTableModel();
|
|
3420
|
+
const beforeSave = (codeValue) => {
|
|
3421
|
+
try {
|
|
3422
|
+
eval(codeValue);
|
|
3423
|
+
return true;
|
|
3424
|
+
} catch (e) {
|
|
3425
|
+
design.tMagicMessage.error(e.stack);
|
|
3426
|
+
return false;
|
|
3427
|
+
}
|
|
3428
|
+
};
|
|
3429
|
+
const saveCode = async (codeValue2) => {
|
|
3430
|
+
if (!props.editable)
|
|
3431
|
+
return;
|
|
3432
|
+
evalRes.value = beforeSave(codeValue2);
|
|
3433
|
+
if (evalRes.value) {
|
|
3434
|
+
await services?.codeBlockService.setCodeDslById(props.id, {
|
|
3435
|
+
name: codeName.value,
|
|
3436
|
+
content: codeValue2,
|
|
3437
|
+
params: tableModel.value?.params || []
|
|
3438
|
+
});
|
|
3439
|
+
design.tMagicMessage.success("\u4EE3\u7801\u4FDD\u5B58\u6210\u529F");
|
|
3440
|
+
services?.codeBlockService.removeCodeDraft(props.id);
|
|
3441
|
+
}
|
|
3442
|
+
};
|
|
3443
|
+
const saveAndClose = async (codeValue2) => {
|
|
3444
|
+
await saveCode(codeValue2);
|
|
3445
|
+
if (evalRes.value) {
|
|
3446
|
+
close();
|
|
3447
|
+
}
|
|
3448
|
+
};
|
|
3449
|
+
const close = () => {
|
|
3450
|
+
services?.codeBlockService.setCodeEditorShowStatus(false);
|
|
3451
|
+
};
|
|
3452
|
+
return (_ctx, _cache) => {
|
|
3453
|
+
const _component_m_form_table = vue.resolveComponent("m-form-table");
|
|
3454
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), { shadow: "never" }, {
|
|
3455
|
+
header: vue.withCtx(() => [
|
|
3456
|
+
vue.createElementVNode("div", _hoisted_1$8, [
|
|
3457
|
+
_hoisted_2$4,
|
|
3458
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3459
|
+
class: "code-name-input",
|
|
3460
|
+
modelValue: codeName.value,
|
|
3461
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => codeName.value = $event),
|
|
3462
|
+
disabled: !__props.editable
|
|
3463
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
3464
|
+
]),
|
|
3465
|
+
vue.createElementVNode("div", _hoisted_3$2, [
|
|
3466
|
+
_hoisted_4$1,
|
|
3467
|
+
vue.createVNode(_component_m_form_table, {
|
|
3468
|
+
style: { "width": "320px" },
|
|
3469
|
+
config: tableConfig,
|
|
3470
|
+
model: tableModel.value,
|
|
3471
|
+
enableToggleMode: false,
|
|
3472
|
+
name: "params",
|
|
3473
|
+
prop: "params",
|
|
3474
|
+
size: "small"
|
|
3475
|
+
}, null, 8, ["model"])
|
|
3476
|
+
])
|
|
3477
|
+
]),
|
|
3478
|
+
default: vue.withCtx(() => [
|
|
3479
|
+
vue.createVNode(_sfc_main$h, {
|
|
3480
|
+
id: __props.id,
|
|
3481
|
+
content: codeContent.value,
|
|
3482
|
+
editable: __props.editable,
|
|
3483
|
+
autoSaveDraft: __props.autoSaveDraft,
|
|
3484
|
+
codeOptions: __props.codeOptions,
|
|
3485
|
+
language: "javascript",
|
|
3486
|
+
onSave: saveCode,
|
|
3487
|
+
onSaveAndClose: saveAndClose,
|
|
3488
|
+
onClose: close
|
|
3489
|
+
}, null, 8, ["id", "content", "editable", "autoSaveDraft", "codeOptions"])
|
|
3490
|
+
]),
|
|
3491
|
+
_: 1
|
|
3492
|
+
});
|
|
3493
|
+
};
|
|
3494
|
+
}
|
|
3495
|
+
});
|
|
3496
|
+
|
|
3497
|
+
const _hoisted_1$7 = ["id"];
|
|
3498
|
+
const _hoisted_2$3 = { class: "list-item" };
|
|
3499
|
+
const _hoisted_3$1 = { class: "code-name" };
|
|
3500
|
+
const __default__$e = vue.defineComponent({
|
|
3501
|
+
name: "MEditorCodeBlockEditor"
|
|
3502
|
+
});
|
|
3142
3503
|
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
3143
|
-
|
|
3504
|
+
...__default__$e,
|
|
3144
3505
|
setup(__props) {
|
|
3145
3506
|
const services = vue.inject("services");
|
|
3146
|
-
const
|
|
3507
|
+
const codeOptions = vue.inject("codeOptions", {});
|
|
3147
3508
|
const left = vue.ref(200);
|
|
3148
3509
|
const currentTitle = vue.ref("");
|
|
3149
3510
|
const codeConfig = vue.ref(null);
|
|
3150
3511
|
const state = vue.reactive({
|
|
3151
3512
|
codeList: []
|
|
3152
3513
|
});
|
|
3153
|
-
const isShowCodeBlockEditor = vue.computed(
|
|
3154
|
-
() => codeConfig.value && services?.codeBlockService.getCodeEditorShowStatus() || false
|
|
3155
|
-
);
|
|
3156
3514
|
const mode = vue.computed(() => services?.codeBlockService.getMode());
|
|
3157
3515
|
const id = vue.computed(() => services?.codeBlockService.getId() || "");
|
|
3158
3516
|
const editable = vue.computed(() => services?.codeBlockService.getEditStatus());
|
|
3159
3517
|
const selectedIds = vue.computed(() => services?.codeBlockService.getCombineIds() || []);
|
|
3160
3518
|
vue.watchEffect(async () => {
|
|
3161
|
-
codeConfig.value = await services?.codeBlockService.getCodeContentById(id.value) || null;
|
|
3519
|
+
codeConfig.value = lodashEs.cloneDeep(await services?.codeBlockService.getCodeContentById(id.value)) || null;
|
|
3520
|
+
if (!codeConfig.value)
|
|
3521
|
+
return;
|
|
3522
|
+
codeConfig.value.content = serializeConfig(codeConfig.value.content);
|
|
3162
3523
|
});
|
|
3163
3524
|
vue.watchEffect(async () => {
|
|
3164
3525
|
const codeDsl = await services?.codeBlockService.getCodeDslByIds(selectedIds.value) || null;
|
|
@@ -3173,52 +3534,24 @@
|
|
|
3173
3534
|
});
|
|
3174
3535
|
currentTitle.value = state.codeList[0]?.name || "";
|
|
3175
3536
|
});
|
|
3176
|
-
const saveCode = async () => {
|
|
3177
|
-
if (!codeEditor.value || !codeConfig.value || !editable.value)
|
|
3178
|
-
return true;
|
|
3179
|
-
try {
|
|
3180
|
-
const codeContent = codeEditor.value.getEditor()?.getValue();
|
|
3181
|
-
codeConfig.value.content = eval(codeContent);
|
|
3182
|
-
} catch (e) {
|
|
3183
|
-
elementPlus.ElMessage.error(e.stack);
|
|
3184
|
-
return false;
|
|
3185
|
-
}
|
|
3186
|
-
await services?.codeBlockService.setCodeDslById(id.value, {
|
|
3187
|
-
name: codeConfig.value.name,
|
|
3188
|
-
content: codeConfig.value.content
|
|
3189
|
-
});
|
|
3190
|
-
elementPlus.ElMessage.success("\u4EE3\u7801\u4FDD\u5B58\u6210\u529F");
|
|
3191
|
-
return true;
|
|
3192
|
-
};
|
|
3193
|
-
const saveAndClose = async () => {
|
|
3194
|
-
const saveRes = await saveCode();
|
|
3195
|
-
if (saveRes) {
|
|
3196
|
-
await services?.codeBlockService.setCodeEditorShowStatus(false);
|
|
3197
|
-
}
|
|
3198
|
-
};
|
|
3199
3537
|
const selectHandler = (data) => {
|
|
3200
3538
|
services?.codeBlockService.setId(data.id);
|
|
3201
3539
|
currentTitle.value = data.name;
|
|
3202
3540
|
};
|
|
3203
3541
|
return (_ctx, _cache) => {
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
3207
|
-
const _component_el_card = vue.resolveComponent("el-card");
|
|
3208
|
-
const _component_el_dialog = vue.resolveComponent("el-dialog");
|
|
3209
|
-
return vue.openBlock(), vue.createBlock(_component_el_dialog, {
|
|
3210
|
-
modelValue: vue.unref(isShowCodeBlockEditor),
|
|
3211
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(isShowCodeBlockEditor) ? isShowCodeBlockEditor.value = $event : null),
|
|
3542
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDialog), {
|
|
3543
|
+
"model-value": true,
|
|
3212
3544
|
class: "code-editor-dialog",
|
|
3213
3545
|
title: currentTitle.value,
|
|
3214
3546
|
fullscreen: true,
|
|
3215
|
-
"
|
|
3216
|
-
"append-to-body": true
|
|
3547
|
+
"close-on-press-escape": false,
|
|
3548
|
+
"append-to-body": true,
|
|
3549
|
+
"show-close": false
|
|
3217
3550
|
}, {
|
|
3218
3551
|
default: vue.withCtx(() => [
|
|
3219
|
-
vue.createVNode(_sfc_main$
|
|
3552
|
+
vue.createVNode(_sfc_main$o, {
|
|
3220
3553
|
left: left.value,
|
|
3221
|
-
"onUpdate:left": _cache[
|
|
3554
|
+
"onUpdate:left": _cache[0] || (_cache[0] = ($event) => left.value = $event),
|
|
3222
3555
|
"min-left": 45,
|
|
3223
3556
|
class: "code-editor-layout"
|
|
3224
3557
|
}, vue.createSlots({
|
|
@@ -3230,72 +3563,15 @@
|
|
|
3230
3563
|
])
|
|
3231
3564
|
}, [
|
|
3232
3565
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: vue.unref(id) }),
|
|
3233
|
-
vue.
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
disabled: !vue.unref(editable)
|
|
3243
|
-
}, null, 8, ["modelValue", "disabled"])) : vue.createCommentVNode("", true)
|
|
3244
|
-
])
|
|
3245
|
-
]),
|
|
3246
|
-
default: vue.withCtx(() => [
|
|
3247
|
-
vue.createElementVNode("div", _hoisted_6$1, [
|
|
3248
|
-
codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$o, {
|
|
3249
|
-
key: 0,
|
|
3250
|
-
ref_key: "codeEditor",
|
|
3251
|
-
ref: codeEditor,
|
|
3252
|
-
class: "m-editor-container",
|
|
3253
|
-
"init-values": `${codeConfig.value.content}`,
|
|
3254
|
-
onSave: saveCode,
|
|
3255
|
-
options: {
|
|
3256
|
-
tabSize: 2,
|
|
3257
|
-
fontSize: 16,
|
|
3258
|
-
formatOnPaste: true,
|
|
3259
|
-
readOnly: !vue.unref(editable)
|
|
3260
|
-
}
|
|
3261
|
-
}, null, 8, ["init-values", "options"])) : vue.createCommentVNode("", true),
|
|
3262
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, [
|
|
3263
|
-
vue.createVNode(_component_el_button, {
|
|
3264
|
-
type: "primary",
|
|
3265
|
-
class: "button",
|
|
3266
|
-
onClick: saveCode
|
|
3267
|
-
}, {
|
|
3268
|
-
default: vue.withCtx(() => [
|
|
3269
|
-
_hoisted_8$1
|
|
3270
|
-
]),
|
|
3271
|
-
_: 1
|
|
3272
|
-
}),
|
|
3273
|
-
vue.createVNode(_component_el_button, {
|
|
3274
|
-
type: "primary",
|
|
3275
|
-
class: "button",
|
|
3276
|
-
onClick: saveAndClose
|
|
3277
|
-
}, {
|
|
3278
|
-
default: vue.withCtx(() => [
|
|
3279
|
-
_hoisted_9$1
|
|
3280
|
-
]),
|
|
3281
|
-
_: 1
|
|
3282
|
-
})
|
|
3283
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
3284
|
-
vue.createVNode(_component_el_button, {
|
|
3285
|
-
type: "primary",
|
|
3286
|
-
class: "button",
|
|
3287
|
-
onClick: saveAndClose
|
|
3288
|
-
}, {
|
|
3289
|
-
default: vue.withCtx(() => [
|
|
3290
|
-
_hoisted_11
|
|
3291
|
-
]),
|
|
3292
|
-
_: 1
|
|
3293
|
-
})
|
|
3294
|
-
]))
|
|
3295
|
-
])
|
|
3296
|
-
]),
|
|
3297
|
-
_: 1
|
|
3298
|
-
})
|
|
3566
|
+
codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$g, {
|
|
3567
|
+
key: 0,
|
|
3568
|
+
id: vue.unref(id),
|
|
3569
|
+
name: codeConfig.value.name,
|
|
3570
|
+
content: codeConfig.value.content,
|
|
3571
|
+
editable: !!vue.unref(editable),
|
|
3572
|
+
autoSaveDraft: vue.unref(mode) === vue.unref(CodeEditorMode).EDITOR,
|
|
3573
|
+
codeOptions: vue.unref(codeOptions)
|
|
3574
|
+
}, null, 8, ["id", "name", "content", "editable", "autoSaveDraft", "codeOptions"])) : vue.createCommentVNode("", true)
|
|
3299
3575
|
], 2)) : vue.createCommentVNode("", true)
|
|
3300
3576
|
]),
|
|
3301
3577
|
_: 2
|
|
@@ -3303,16 +3579,15 @@
|
|
|
3303
3579
|
vue.unref(mode) === vue.unref(CodeEditorMode).LIST ? {
|
|
3304
3580
|
name: "left",
|
|
3305
3581
|
fn: vue.withCtx(() => [
|
|
3306
|
-
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(
|
|
3582
|
+
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
3307
3583
|
key: 0,
|
|
3308
|
-
|
|
3584
|
+
class: "side-tree",
|
|
3309
3585
|
"node-key": "id",
|
|
3310
3586
|
"empty-text": "\u6682\u65E0\u4EE3\u7801\u5757",
|
|
3311
3587
|
data: state.codeList,
|
|
3312
3588
|
"highlight-current": true,
|
|
3313
|
-
onNodeClick: selectHandler,
|
|
3314
3589
|
"current-node-key": state.codeList[0].id,
|
|
3315
|
-
|
|
3590
|
+
onNodeClick: selectHandler
|
|
3316
3591
|
}, {
|
|
3317
3592
|
default: vue.withCtx(({ data }) => [
|
|
3318
3593
|
vue.createElementVNode("div", {
|
|
@@ -3322,7 +3597,7 @@
|
|
|
3322
3597
|
vue.createElementVNode("div", _hoisted_2$3, [
|
|
3323
3598
|
vue.createElementVNode("div", _hoisted_3$1, vue.toDisplayString(data.name) + "\uFF08" + vue.toDisplayString(data.id) + "\uFF09", 1)
|
|
3324
3599
|
])
|
|
3325
|
-
], 8, _hoisted_1$
|
|
3600
|
+
], 8, _hoisted_1$7)
|
|
3326
3601
|
]),
|
|
3327
3602
|
_: 1
|
|
3328
3603
|
}, 8, ["data", "current-node-key"])) : vue.createCommentVNode("", true)
|
|
@@ -3331,12 +3606,12 @@
|
|
|
3331
3606
|
]), 1032, ["left"])
|
|
3332
3607
|
]),
|
|
3333
3608
|
_: 3
|
|
3334
|
-
}, 8, ["
|
|
3609
|
+
}, 8, ["title"]);
|
|
3335
3610
|
};
|
|
3336
3611
|
}
|
|
3337
3612
|
});
|
|
3338
3613
|
|
|
3339
|
-
const _hoisted_1$
|
|
3614
|
+
const _hoisted_1$6 = { class: "m-editor-code-block-list" };
|
|
3340
3615
|
const _hoisted_2$2 = { class: "code-header-wrapper" };
|
|
3341
3616
|
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u65B0\u589E");
|
|
3342
3617
|
const _hoisted_4 = ["id"];
|
|
@@ -3358,8 +3633,11 @@
|
|
|
3358
3633
|
d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
|
|
3359
3634
|
})
|
|
3360
3635
|
], -1);
|
|
3636
|
+
const __default__$d = vue.defineComponent({
|
|
3637
|
+
name: "MEditorCodeBlockList"
|
|
3638
|
+
});
|
|
3361
3639
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
3362
|
-
|
|
3640
|
+
...__default__$d,
|
|
3363
3641
|
props: {
|
|
3364
3642
|
customError: null
|
|
3365
3643
|
},
|
|
@@ -3367,41 +3645,38 @@
|
|
|
3367
3645
|
const props = __props;
|
|
3368
3646
|
const services = vue.inject("services");
|
|
3369
3647
|
const state = vue.reactive({
|
|
3370
|
-
codeList: []
|
|
3371
|
-
bindComps: {}
|
|
3648
|
+
codeList: []
|
|
3372
3649
|
});
|
|
3373
3650
|
const editable = vue.computed(() => services?.codeBlockService.getEditStatus());
|
|
3374
|
-
const
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
const
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
id: compId,
|
|
3384
|
-
name: getCompName(compId)
|
|
3651
|
+
const isShowCodeBlockEditor = vue.computed(() => services?.codeBlockService.getCodeEditorShowStatus() || false);
|
|
3652
|
+
const codeCombineInfo = vue.ref(null);
|
|
3653
|
+
const getBindCompsByCodeId = (codeId) => {
|
|
3654
|
+
if (!codeCombineInfo.value || !codeCombineInfo.value[codeId])
|
|
3655
|
+
return [];
|
|
3656
|
+
const bindCompsId = Object.keys(codeCombineInfo.value[codeId]);
|
|
3657
|
+
return bindCompsId.map((compId) => ({
|
|
3658
|
+
compId,
|
|
3659
|
+
compName: getCompName(compId)
|
|
3385
3660
|
}));
|
|
3386
|
-
state.bindComps[codeId] = compsInfo;
|
|
3387
3661
|
};
|
|
3388
3662
|
const initList = async () => {
|
|
3389
|
-
const codeDsl = await services?.codeBlockService.getCodeDsl() || null;
|
|
3390
|
-
|
|
3663
|
+
const codeDsl = lodashEs.cloneDeep(await services?.codeBlockService.getCodeDsl()) || null;
|
|
3664
|
+
codeCombineInfo.value = lodashEs.cloneDeep(services?.codeBlockService.getCombineInfo()) || null;
|
|
3665
|
+
if (!codeDsl || !codeCombineInfo.value)
|
|
3391
3666
|
return;
|
|
3392
3667
|
state.codeList = [];
|
|
3393
3668
|
lodashEs.forIn(codeDsl, (value, codeId) => {
|
|
3394
|
-
getBindCompsByCodeId(codeId, value);
|
|
3395
3669
|
state.codeList.push({
|
|
3396
3670
|
id: codeId,
|
|
3397
3671
|
name: value.name,
|
|
3398
3672
|
codeBlockContent: value,
|
|
3399
|
-
showRelation: true
|
|
3673
|
+
showRelation: true,
|
|
3674
|
+
combineInfo: getBindCompsByCodeId(codeId)
|
|
3400
3675
|
});
|
|
3401
3676
|
});
|
|
3402
3677
|
};
|
|
3403
3678
|
vue.watch(
|
|
3404
|
-
() => services?.codeBlockService.
|
|
3679
|
+
[() => services?.codeBlockService.getCodeDslSync(), () => services?.codeBlockService.refreshCombineInfo()],
|
|
3405
3680
|
() => {
|
|
3406
3681
|
initList();
|
|
3407
3682
|
},
|
|
@@ -3410,31 +3685,18 @@
|
|
|
3410
3685
|
deep: true
|
|
3411
3686
|
}
|
|
3412
3687
|
);
|
|
3413
|
-
vue.watch(
|
|
3414
|
-
() => services?.editorService.get("node"),
|
|
3415
|
-
(curNode) => {
|
|
3416
|
-
if (!curNode?.id)
|
|
3417
|
-
return;
|
|
3418
|
-
lodashEs.forIn(state.bindComps, (bindCompInfo) => {
|
|
3419
|
-
bindCompInfo.forEach((comp) => {
|
|
3420
|
-
if (comp.id === curNode.id) {
|
|
3421
|
-
comp.name = curNode.name;
|
|
3422
|
-
}
|
|
3423
|
-
});
|
|
3424
|
-
});
|
|
3425
|
-
}
|
|
3426
|
-
);
|
|
3427
3688
|
const createCodeBlock = async () => {
|
|
3428
3689
|
const { codeBlockService } = services || {};
|
|
3429
3690
|
if (!codeBlockService) {
|
|
3430
|
-
|
|
3691
|
+
design.tMagicMessage.error("\u65B0\u589E\u4EE3\u7801\u5757\u5931\u8D25");
|
|
3431
3692
|
return;
|
|
3432
3693
|
}
|
|
3433
3694
|
const codeConfig = {
|
|
3434
3695
|
name: "\u4EE3\u7801\u5757",
|
|
3435
|
-
content: `() => {
|
|
3696
|
+
content: `({app, params}) => {
|
|
3436
3697
|
// place your code here
|
|
3437
|
-
}
|
|
3698
|
+
}`,
|
|
3699
|
+
params: []
|
|
3438
3700
|
};
|
|
3439
3701
|
await codeBlockService.setMode(CodeEditorMode.EDITOR);
|
|
3440
3702
|
const id = await codeBlockService.getUniqueId();
|
|
@@ -3446,7 +3708,8 @@
|
|
|
3446
3708
|
services?.codeBlockService.setCodeEditorContent(true, key);
|
|
3447
3709
|
};
|
|
3448
3710
|
const deleteCode = (key) => {
|
|
3449
|
-
const
|
|
3711
|
+
const currentCode = state.codeList.find((codeItem) => codeItem.id === key);
|
|
3712
|
+
const existBinds = !lodashEs.isEmpty(currentCode?.combineInfo);
|
|
3450
3713
|
const undeleteableList = services?.codeBlockService.getUndeletableList() || [];
|
|
3451
3714
|
if (!existBinds && !undeleteableList.includes(key)) {
|
|
3452
3715
|
services?.codeBlockService.deleteCodeDslByIds([key]);
|
|
@@ -3454,7 +3717,7 @@
|
|
|
3454
3717
|
if (typeof props.customError === "function") {
|
|
3455
3718
|
props.customError(key, existBinds ? CodeDeleteErrorType.BIND : CodeDeleteErrorType.UNDELETEABLE);
|
|
3456
3719
|
} else {
|
|
3457
|
-
|
|
3720
|
+
design.tMagicMessage.error("\u4EE3\u7801\u5757\u5220\u9664\u5931\u8D25");
|
|
3458
3721
|
}
|
|
3459
3722
|
}
|
|
3460
3723
|
};
|
|
@@ -3486,14 +3749,10 @@
|
|
|
3486
3749
|
stage?.select(compId);
|
|
3487
3750
|
};
|
|
3488
3751
|
return (_ctx, _cache) => {
|
|
3489
|
-
|
|
3490
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
3491
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
3492
|
-
const _component_el_tree = vue.resolveComponent("el-tree");
|
|
3493
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
3752
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
3494
3753
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
3495
3754
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
3496
|
-
vue.createVNode(
|
|
3755
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3497
3756
|
class: vue.normalizeClass([vue.unref(editable) ? "code-filter-input" : "code-filter-input-no-btn"]),
|
|
3498
3757
|
size: "small",
|
|
3499
3758
|
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
@@ -3502,7 +3761,7 @@
|
|
|
3502
3761
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
3503
3762
|
onInput: filterTextChangeHandler
|
|
3504
3763
|
}, null, 8, ["class", "modelValue"]),
|
|
3505
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(
|
|
3764
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3506
3765
|
key: 0,
|
|
3507
3766
|
class: "create-code-button",
|
|
3508
3767
|
type: "primary",
|
|
@@ -3516,7 +3775,7 @@
|
|
|
3516
3775
|
})) : vue.createCommentVNode("", true)
|
|
3517
3776
|
])
|
|
3518
3777
|
]),
|
|
3519
|
-
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(
|
|
3778
|
+
!vue.unref(lodashEs.isEmpty)(state.codeList) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
3520
3779
|
key: 0,
|
|
3521
3780
|
ref_key: "tree",
|
|
3522
3781
|
ref: tree,
|
|
@@ -3533,15 +3792,15 @@
|
|
|
3533
3792
|
class: "list-container"
|
|
3534
3793
|
}, [
|
|
3535
3794
|
vue.createElementVNode("div", _hoisted_5, [
|
|
3536
|
-
vue.createElementVNode("
|
|
3795
|
+
vue.createElementVNode("span", _hoisted_6, vue.toDisplayString(data.name) + "\uFF08" + vue.toDisplayString(data.id) + "\uFF09", 1),
|
|
3537
3796
|
vue.createElementVNode("div", _hoisted_7, [
|
|
3538
|
-
vue.createVNode(
|
|
3797
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
3539
3798
|
effect: "dark",
|
|
3540
3799
|
content: vue.unref(editable) ? "\u7F16\u8F91" : "\u67E5\u770B",
|
|
3541
3800
|
placement: "bottom"
|
|
3542
3801
|
}, {
|
|
3543
3802
|
default: vue.withCtx(() => [
|
|
3544
|
-
vue.createVNode(_sfc_main$
|
|
3803
|
+
vue.createVNode(_sfc_main$n, {
|
|
3545
3804
|
icon: vue.unref(editable) ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
|
|
3546
3805
|
class: "edit-icon",
|
|
3547
3806
|
onClick: vue.withModifiers(($event) => editCode(`${data.id}`), ["stop"])
|
|
@@ -3549,14 +3808,14 @@
|
|
|
3549
3808
|
]),
|
|
3550
3809
|
_: 2
|
|
3551
3810
|
}, 1032, ["content"]),
|
|
3552
|
-
|
|
3811
|
+
data.combineInfo && data.combineInfo.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3553
3812
|
key: 0,
|
|
3554
3813
|
effect: "dark",
|
|
3555
3814
|
content: "\u67E5\u770B\u7ED1\u5B9A\u5173\u7CFB",
|
|
3556
3815
|
placement: "bottom"
|
|
3557
3816
|
}, {
|
|
3558
3817
|
default: vue.withCtx(() => [
|
|
3559
|
-
vue.createVNode(_sfc_main$
|
|
3818
|
+
vue.createVNode(_sfc_main$n, {
|
|
3560
3819
|
icon: vue.unref(iconsVue.Link),
|
|
3561
3820
|
class: "edit-icon",
|
|
3562
3821
|
onClick: vue.withModifiers(($event) => toggleCombineRelation(data), ["stop"])
|
|
@@ -3564,14 +3823,14 @@
|
|
|
3564
3823
|
]),
|
|
3565
3824
|
_: 2
|
|
3566
3825
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
3567
|
-
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(
|
|
3826
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
3568
3827
|
key: 1,
|
|
3569
3828
|
effect: "dark",
|
|
3570
3829
|
content: "\u5220\u9664",
|
|
3571
3830
|
placement: "bottom"
|
|
3572
3831
|
}, {
|
|
3573
3832
|
default: vue.withCtx(() => [
|
|
3574
|
-
vue.createVNode(_sfc_main$
|
|
3833
|
+
vue.createVNode(_sfc_main$n, {
|
|
3575
3834
|
icon: vue.unref(iconsVue.Close),
|
|
3576
3835
|
class: "edit-icon",
|
|
3577
3836
|
onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -3585,18 +3844,18 @@
|
|
|
3585
3844
|
})
|
|
3586
3845
|
])
|
|
3587
3846
|
]),
|
|
3588
|
-
data.showRelation &&
|
|
3847
|
+
data.showRelation && data.combineInfo && data.combineInfo.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
|
|
3589
3848
|
_hoisted_9,
|
|
3590
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
3591
|
-
return vue.openBlock(), vue.createBlock(
|
|
3849
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(data.combineInfo, (comp, index) => {
|
|
3850
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3592
3851
|
key: index,
|
|
3593
3852
|
class: "code-comp",
|
|
3594
3853
|
size: "small",
|
|
3595
3854
|
plain: true,
|
|
3596
|
-
onClick: vue.withModifiers(($event) => selectComp(comp.
|
|
3855
|
+
onClick: vue.withModifiers(($event) => selectComp(comp.compId), ["stop"])
|
|
3597
3856
|
}, {
|
|
3598
3857
|
default: vue.withCtx(() => [
|
|
3599
|
-
vue.createTextVNode(vue.toDisplayString(comp.
|
|
3858
|
+
vue.createTextVNode(vue.toDisplayString(comp.compName), 1)
|
|
3600
3859
|
]),
|
|
3601
3860
|
_: 2
|
|
3602
3861
|
}, 1032, ["onClick"]);
|
|
@@ -3606,21 +3865,23 @@
|
|
|
3606
3865
|
]),
|
|
3607
3866
|
_: 3
|
|
3608
3867
|
}, 8, ["data"])) : vue.createCommentVNode("", true),
|
|
3609
|
-
vue.
|
|
3868
|
+
vue.unref(isShowCodeBlockEditor) ? (vue.openBlock(), vue.createBlock(_sfc_main$f, { key: 1 }, {
|
|
3610
3869
|
"code-block-edit-panel-header": vue.withCtx(({ id }) => [
|
|
3611
3870
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
|
|
3612
3871
|
]),
|
|
3613
3872
|
_: 3
|
|
3614
|
-
})
|
|
3873
|
+
})) : vue.createCommentVNode("", true)
|
|
3615
3874
|
]);
|
|
3616
3875
|
};
|
|
3617
3876
|
}
|
|
3618
3877
|
});
|
|
3619
3878
|
|
|
3620
|
-
const _hoisted_1$
|
|
3621
|
-
const
|
|
3879
|
+
const _hoisted_1$5 = ["onClick", "onDragstart"];
|
|
3880
|
+
const __default__$c = vue.defineComponent({
|
|
3881
|
+
name: "MEditorComponentListPanel"
|
|
3882
|
+
});
|
|
3622
3883
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
3623
|
-
|
|
3884
|
+
...__default__$c,
|
|
3624
3885
|
setup(__props) {
|
|
3625
3886
|
const searchText = vue.ref("");
|
|
3626
3887
|
const services = vue.inject("services");
|
|
@@ -3633,7 +3894,7 @@
|
|
|
3633
3894
|
}))
|
|
3634
3895
|
);
|
|
3635
3896
|
const collapseValue = vue.computed(
|
|
3636
|
-
() => Array(list.value?.length).fill(1).map((x, i) => i)
|
|
3897
|
+
() => Array(list.value?.length).fill(1).map((x, i) => `${i}`)
|
|
3637
3898
|
);
|
|
3638
3899
|
let timeout;
|
|
3639
3900
|
let clientX;
|
|
@@ -3685,36 +3946,31 @@
|
|
|
3685
3946
|
timeout = stage.value.getAddContainerHighlightClassNameTimeout(e);
|
|
3686
3947
|
};
|
|
3687
3948
|
return (_ctx, _cache) => {
|
|
3688
|
-
|
|
3689
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
3690
|
-
const _component_el_collapse_item = vue.resolveComponent("el-collapse-item");
|
|
3691
|
-
const _component_el_collapse = vue.resolveComponent("el-collapse");
|
|
3692
|
-
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
3693
|
-
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, null, {
|
|
3949
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), null, {
|
|
3694
3950
|
default: vue.withCtx(() => [
|
|
3695
3951
|
vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
3696
|
-
vue.createVNode(
|
|
3952
|
+
vue.createVNode(vue.unref(design.TMagicCollapse), {
|
|
3697
3953
|
class: "ui-component-panel",
|
|
3698
3954
|
"model-value": vue.unref(collapseValue)
|
|
3699
3955
|
}, {
|
|
3700
3956
|
default: vue.withCtx(() => [
|
|
3701
|
-
vue.createVNode(
|
|
3702
|
-
"prefix-icon": "el-icon-search",
|
|
3957
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
3703
3958
|
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
3704
3959
|
class: "search-input",
|
|
3705
3960
|
size: "small",
|
|
3706
3961
|
clearable: "",
|
|
3962
|
+
"prefix-icon": vue.unref(iconsVue.Search),
|
|
3707
3963
|
modelValue: searchText.value,
|
|
3708
3964
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event)
|
|
3709
|
-
}, null, 8, ["modelValue"]),
|
|
3965
|
+
}, null, 8, ["prefix-icon", "modelValue"]),
|
|
3710
3966
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(list), (group, index) => {
|
|
3711
3967
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3712
|
-
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(
|
|
3968
|
+
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
3713
3969
|
key: index,
|
|
3714
|
-
name: index
|
|
3970
|
+
name: `${index}`
|
|
3715
3971
|
}, {
|
|
3716
3972
|
title: vue.withCtx(() => [
|
|
3717
|
-
|
|
3973
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
|
|
3718
3974
|
vue.createTextVNode(vue.toDisplayString(group.title), 1)
|
|
3719
3975
|
]),
|
|
3720
3976
|
default: vue.withCtx(() => [
|
|
@@ -3729,10 +3985,10 @@
|
|
|
3729
3985
|
onDrag: dragHandler
|
|
3730
3986
|
}, [
|
|
3731
3987
|
vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
3732
|
-
vue.createVNode(_sfc_main$
|
|
3988
|
+
vue.createVNode(_sfc_main$n, {
|
|
3733
3989
|
icon: item.icon
|
|
3734
3990
|
}, null, 8, ["icon"]),
|
|
3735
|
-
vue.createVNode(
|
|
3991
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
3736
3992
|
effect: "dark",
|
|
3737
3993
|
placement: "bottom",
|
|
3738
3994
|
content: item.text
|
|
@@ -3743,7 +3999,7 @@
|
|
|
3743
3999
|
_: 2
|
|
3744
4000
|
}, 1032, ["content"])
|
|
3745
4001
|
])
|
|
3746
|
-
], 40,
|
|
4002
|
+
], 40, _hoisted_1$5);
|
|
3747
4003
|
}), 128))
|
|
3748
4004
|
]),
|
|
3749
4005
|
_: 2
|
|
@@ -3760,8 +4016,11 @@
|
|
|
3760
4016
|
}
|
|
3761
4017
|
});
|
|
3762
4018
|
|
|
4019
|
+
const __default__$b = vue.defineComponent({
|
|
4020
|
+
name: "MEditorContentMenu"
|
|
4021
|
+
});
|
|
3763
4022
|
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
3764
|
-
|
|
4023
|
+
...__default__$b,
|
|
3765
4024
|
props: {
|
|
3766
4025
|
menuData: { default: () => [] },
|
|
3767
4026
|
isSubMenu: { type: Boolean, default: false }
|
|
@@ -3840,7 +4099,7 @@
|
|
|
3840
4099
|
});
|
|
3841
4100
|
return (_ctx, _cache) => {
|
|
3842
4101
|
const _component_content_menu = vue.resolveComponent("content-menu", true);
|
|
3843
|
-
return __props.menuData.length
|
|
4102
|
+
return __props.menuData.length ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
3844
4103
|
key: 0,
|
|
3845
4104
|
class: "magic-editor-content-menu",
|
|
3846
4105
|
ref_key: "menu",
|
|
@@ -3849,7 +4108,7 @@
|
|
|
3849
4108
|
}, [
|
|
3850
4109
|
vue.createElementVNode("div", null, [
|
|
3851
4110
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.menuData, (item, index) => {
|
|
3852
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
4111
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$k, {
|
|
3853
4112
|
"event-type": "mouseup",
|
|
3854
4113
|
data: item,
|
|
3855
4114
|
key: index,
|
|
@@ -3868,21 +4127,29 @@
|
|
|
3868
4127
|
onHide: hide
|
|
3869
4128
|
}, null, 8, ["menu-data"])
|
|
3870
4129
|
]))
|
|
3871
|
-
], 4))
|
|
4130
|
+
], 4)), [
|
|
4131
|
+
[vue.vShow, visible.value]
|
|
4132
|
+
]) : vue.createCommentVNode("", true);
|
|
3872
4133
|
};
|
|
3873
4134
|
}
|
|
3874
4135
|
});
|
|
3875
4136
|
|
|
4137
|
+
const __default__$a = vue.defineComponent({
|
|
4138
|
+
name: "MEditorLayerMenu"
|
|
4139
|
+
});
|
|
3876
4140
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
3877
|
-
|
|
4141
|
+
...__default__$a,
|
|
4142
|
+
props: {
|
|
4143
|
+
layerContentMenu: null
|
|
4144
|
+
},
|
|
3878
4145
|
setup(__props, { expose }) {
|
|
4146
|
+
const props = __props;
|
|
3879
4147
|
const services = vue.inject("services");
|
|
3880
4148
|
const menu = vue.ref();
|
|
3881
4149
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
3882
4150
|
const isRoot = vue.computed(() => node.value?.type === schema.NodeType.ROOT);
|
|
3883
4151
|
const isPage = vue.computed(() => node.value?.type === schema.NodeType.PAGE);
|
|
3884
4152
|
const componentList = vue.computed(() => services?.componentListService.getList() || []);
|
|
3885
|
-
const layerContentMenu = vue.inject("layerContentMenu", []);
|
|
3886
4153
|
const createMenuItems = (group) => group.items.map((component) => ({
|
|
3887
4154
|
text: component.text,
|
|
3888
4155
|
type: "button",
|
|
@@ -3937,7 +4204,7 @@
|
|
|
3937
4204
|
{
|
|
3938
4205
|
type: "button",
|
|
3939
4206
|
text: "\u590D\u5236",
|
|
3940
|
-
icon: vue.markRaw(iconsVue.
|
|
4207
|
+
icon: vue.markRaw(iconsVue.CopyDocument),
|
|
3941
4208
|
display: () => !isRoot.value,
|
|
3942
4209
|
handler: () => {
|
|
3943
4210
|
node.value && services?.editorService.copy(node.value);
|
|
@@ -3952,7 +4219,7 @@
|
|
|
3952
4219
|
node.value && services?.editorService.remove(node.value);
|
|
3953
4220
|
}
|
|
3954
4221
|
},
|
|
3955
|
-
...layerContentMenu
|
|
4222
|
+
...props.layerContentMenu
|
|
3956
4223
|
]);
|
|
3957
4224
|
const show = (e) => {
|
|
3958
4225
|
menu.value?.show(e);
|
|
@@ -3971,398 +4238,365 @@
|
|
|
3971
4238
|
}
|
|
3972
4239
|
});
|
|
3973
4240
|
|
|
3974
|
-
const
|
|
3975
|
-
const
|
|
3976
|
-
|
|
3977
|
-
throw new Error("\u6CA1\u6709id");
|
|
3978
|
-
}
|
|
3979
|
-
await editorService?.select(data);
|
|
3980
|
-
editorService?.get("stage")?.select(data.id);
|
|
3981
|
-
};
|
|
3982
|
-
const highlight = (data, editorService) => {
|
|
3983
|
-
if (!data?.id) {
|
|
3984
|
-
throw new Error("\u6CA1\u6709id");
|
|
3985
|
-
}
|
|
3986
|
-
editorService?.highlight(data);
|
|
3987
|
-
editorService?.get("stage")?.highlight(data.id);
|
|
3988
|
-
};
|
|
3989
|
-
const useDrop = (tree, editorService) => ({
|
|
3990
|
-
allowDrop: (draggingNode, dropNode, type) => {
|
|
3991
|
-
const { data } = dropNode || {};
|
|
3992
|
-
const { data: ingData } = draggingNode;
|
|
3993
|
-
const { type: ingType } = ingData;
|
|
3994
|
-
if (ingType !== schema.NodeType.PAGE && data.type === schema.NodeType.PAGE)
|
|
3995
|
-
return false;
|
|
3996
|
-
if (ingType === schema.NodeType.PAGE && data.type !== schema.NodeType.PAGE)
|
|
3997
|
-
return false;
|
|
3998
|
-
if (!data || !data.type)
|
|
3999
|
-
return false;
|
|
4000
|
-
if (["prev", "next"].includes(type))
|
|
4001
|
-
return true;
|
|
4002
|
-
if (data.items || data.type === "container")
|
|
4003
|
-
return true;
|
|
4004
|
-
return false;
|
|
4005
|
-
},
|
|
4006
|
-
async handleDragEnd(e) {
|
|
4007
|
-
if (!tree.value)
|
|
4008
|
-
return;
|
|
4009
|
-
const { data: node } = e;
|
|
4010
|
-
const parent = editorService?.getParentById(node.id, false);
|
|
4011
|
-
const layout = await editorService?.getLayout(parent);
|
|
4012
|
-
node.style.position = layout;
|
|
4013
|
-
if (layout === Layout.RELATIVE) {
|
|
4014
|
-
node.style.top = 0;
|
|
4015
|
-
node.style.left = 0;
|
|
4016
|
-
}
|
|
4017
|
-
const { data } = tree.value;
|
|
4018
|
-
const [page] = data;
|
|
4019
|
-
editorService?.update(page);
|
|
4020
|
-
}
|
|
4241
|
+
const _hoisted_1$4 = ["id", "onMouseenter"];
|
|
4242
|
+
const __default__$9 = vue.defineComponent({
|
|
4243
|
+
name: "MEditorLayerPanel"
|
|
4021
4244
|
});
|
|
4022
|
-
const
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4245
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
4246
|
+
...__default__$9,
|
|
4247
|
+
props: {
|
|
4248
|
+
layerContentMenu: null
|
|
4249
|
+
},
|
|
4250
|
+
setup(__props) {
|
|
4251
|
+
const throttleTime = 150;
|
|
4252
|
+
const services = vue.inject("services");
|
|
4253
|
+
const tree = vue.ref();
|
|
4254
|
+
const menu = vue.ref();
|
|
4255
|
+
const editorService = services?.editorService;
|
|
4256
|
+
const page = vue.computed(() => editorService?.get("page"));
|
|
4257
|
+
const values = vue.computed(() => page.value ? [page.value] : []);
|
|
4258
|
+
const selectedNodes = vue.ref([]);
|
|
4259
|
+
const selectedIds = vue.computed(() => selectedNodes.value.map((node) => node.id));
|
|
4260
|
+
const isMultiSelectStatus = vue.ref(false);
|
|
4261
|
+
const spliceNodeKey = vue.ref();
|
|
4262
|
+
const filterText = vue.ref("");
|
|
4263
|
+
const defaultExpandedKeys = vue.computed(() => selectedIds.value.length > 0 ? selectedIds.value : []);
|
|
4264
|
+
editorService?.on("remove", () => {
|
|
4265
|
+
setTimeout(() => {
|
|
4266
|
+
tree.value?.getNode(editorService.get("node").id)?.updateChildren();
|
|
4267
|
+
}, 0);
|
|
4268
|
+
});
|
|
4269
|
+
const select = async (data) => {
|
|
4270
|
+
if (!data.id) {
|
|
4271
|
+
throw new Error("\u6CA1\u6709id");
|
|
4272
|
+
}
|
|
4273
|
+
await editorService?.select(data);
|
|
4274
|
+
editorService?.get("stage")?.select(data.id);
|
|
4275
|
+
};
|
|
4276
|
+
const multiSelect = async (data) => {
|
|
4277
|
+
await editorService?.multiSelect(data);
|
|
4278
|
+
editorService?.get("stage")?.multiSelect(data);
|
|
4279
|
+
};
|
|
4280
|
+
const highlight = (data) => {
|
|
4281
|
+
if (!data?.id) {
|
|
4282
|
+
throw new Error("\u6CA1\u6709id");
|
|
4283
|
+
}
|
|
4284
|
+
editorService?.highlight(data);
|
|
4285
|
+
editorService?.get("stage")?.highlight(data.id);
|
|
4286
|
+
};
|
|
4287
|
+
const expandedKeys = /* @__PURE__ */ new Map();
|
|
4288
|
+
const allowDrop = (draggingNode, dropNode, type) => {
|
|
4289
|
+
const { data } = dropNode || {};
|
|
4290
|
+
const { data: ingData } = draggingNode;
|
|
4291
|
+
const { type: ingType } = ingData;
|
|
4292
|
+
if (ingType !== schema.NodeType.PAGE && data.type === schema.NodeType.PAGE)
|
|
4293
|
+
return false;
|
|
4294
|
+
if (ingType === schema.NodeType.PAGE && data.type !== schema.NodeType.PAGE)
|
|
4295
|
+
return false;
|
|
4296
|
+
if (!data || !data.type)
|
|
4297
|
+
return false;
|
|
4298
|
+
if (["prev", "next"].includes(type))
|
|
4299
|
+
return true;
|
|
4300
|
+
if (data.items || data.type === "container")
|
|
4301
|
+
return true;
|
|
4302
|
+
return false;
|
|
4303
|
+
};
|
|
4304
|
+
const handleDragEnd = async (e) => {
|
|
4305
|
+
if (!tree.value)
|
|
4306
|
+
return;
|
|
4307
|
+
const { data: node } = e;
|
|
4308
|
+
const parent = editorService?.getParentById(node.id, false);
|
|
4309
|
+
const layout = await editorService?.getLayout(parent);
|
|
4310
|
+
node.style.position = layout;
|
|
4311
|
+
if (layout === Layout.RELATIVE) {
|
|
4312
|
+
node.style.top = 0;
|
|
4313
|
+
node.style.left = 0;
|
|
4314
|
+
}
|
|
4315
|
+
const data = tree.value.getData();
|
|
4316
|
+
const [page2] = data;
|
|
4317
|
+
editorService?.update(page2);
|
|
4318
|
+
};
|
|
4319
|
+
const loadItems = (node, resolve) => {
|
|
4320
|
+
if (Array.isArray(node.data)) {
|
|
4321
|
+
return resolve(node.data);
|
|
4322
|
+
}
|
|
4323
|
+
if (Array.isArray(node.data?.items)) {
|
|
4324
|
+
return resolve(node.data?.items);
|
|
4325
|
+
}
|
|
4326
|
+
resolve([]);
|
|
4327
|
+
};
|
|
4328
|
+
const handleCollapse = (data) => {
|
|
4329
|
+
expandedKeys.delete(data.id);
|
|
4330
|
+
};
|
|
4331
|
+
const handleExpand = (data) => {
|
|
4332
|
+
const parent = editorService?.getParentById(data.id);
|
|
4333
|
+
if (!parent?.id)
|
|
4334
|
+
return;
|
|
4335
|
+
expandedKeys.set(parent.id, parent.id);
|
|
4336
|
+
};
|
|
4337
|
+
const filterNode = (value, data) => {
|
|
4338
|
+
if (!value) {
|
|
4339
|
+
return true;
|
|
4340
|
+
}
|
|
4341
|
+
let name = "";
|
|
4342
|
+
if (data.name) {
|
|
4343
|
+
name = data.name;
|
|
4344
|
+
} else if (data.items) {
|
|
4345
|
+
name = "container";
|
|
4346
|
+
}
|
|
4347
|
+
return `${data.id}${name}${data.type}`.indexOf(value) !== -1;
|
|
4348
|
+
};
|
|
4349
|
+
const filterTextChangeHandler = (val) => {
|
|
4350
|
+
tree.value?.filter(val);
|
|
4351
|
+
};
|
|
4352
|
+
const expandNodes = async () => {
|
|
4028
4353
|
if (!tree.value)
|
|
4029
4354
|
return;
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
vue.watchEffect(() => {
|
|
4034
|
-
if (!tree.value)
|
|
4035
|
-
return;
|
|
4036
|
-
if (!editorService)
|
|
4037
|
-
return;
|
|
4038
|
-
node.value = editorService.get("node");
|
|
4039
|
-
if (!node.value)
|
|
4040
|
-
return;
|
|
4041
|
-
tree.value.setCurrentKey(node.value.id, true);
|
|
4042
|
-
const parent = editorService.get("parent");
|
|
4043
|
-
if (!parent?.id)
|
|
4044
|
-
return;
|
|
4045
|
-
const treeNode = tree.value.getNode(parent.id);
|
|
4046
|
-
treeNode?.updateChildren();
|
|
4047
|
-
setTimeout(() => {
|
|
4048
|
-
tree.value && Object.entries(tree.value.store.nodesMap).forEach(([id, node2]) => {
|
|
4049
|
-
if (node2.expanded && node2.data.items) {
|
|
4355
|
+
await vue.nextTick();
|
|
4356
|
+
tree.value && Object.entries(tree.value.getStore().nodesMap).forEach(([id, node]) => {
|
|
4357
|
+
if (node.expanded && node.data.items) {
|
|
4050
4358
|
expandedKeys.set(id, id);
|
|
4051
4359
|
}
|
|
4052
4360
|
});
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4361
|
+
expandedKeys.forEach((key) => {
|
|
4362
|
+
if (!tree.value)
|
|
4363
|
+
return;
|
|
4364
|
+
tree.value.getNode(key)?.expand();
|
|
4365
|
+
});
|
|
4366
|
+
};
|
|
4367
|
+
vue.watch(
|
|
4368
|
+
() => editorService?.get("nodes"),
|
|
4369
|
+
(nodes) => {
|
|
4370
|
+
selectedNodes.value = nodes ?? [];
|
|
4061
4371
|
}
|
|
4062
|
-
|
|
4063
|
-
|
|
4372
|
+
);
|
|
4373
|
+
const setTreeKeyStatus = () => {
|
|
4374
|
+
if (!tree.value)
|
|
4375
|
+
return;
|
|
4376
|
+
if (selectedIds.value.length === 0) {
|
|
4377
|
+
tree.value.setCheckedKeys([]);
|
|
4378
|
+
tree.value.setCurrentKey();
|
|
4379
|
+
} else if (selectedIds.value.length === 1 && !isMultiSelectStatus.value) {
|
|
4380
|
+
tree.value.setCurrentKey(selectedIds.value[0], true);
|
|
4381
|
+
tree.value.setCheckedKeys([]);
|
|
4382
|
+
} else {
|
|
4383
|
+
tree.value.setCheckedKeys(selectedIds.value);
|
|
4384
|
+
tree.value.setCurrentKey();
|
|
4064
4385
|
}
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
handleCollapse: (data) => {
|
|
4071
|
-
expandedKeys.delete(data.id);
|
|
4072
|
-
},
|
|
4073
|
-
handleExpand: (data) => {
|
|
4074
|
-
const parent = editorService?.getParentById(data.id);
|
|
4386
|
+
};
|
|
4387
|
+
vue.watch([selectedIds, tree], async () => {
|
|
4388
|
+
if (!tree.value || !editorService)
|
|
4389
|
+
return;
|
|
4390
|
+
const parent = editorService.get("parent");
|
|
4075
4391
|
if (!parent?.id)
|
|
4076
4392
|
return;
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
const menu = vue.ref();
|
|
4393
|
+
const treeNode = tree.value.getNode(parent.id);
|
|
4394
|
+
treeNode?.updateChildren();
|
|
4395
|
+
await expandNodes();
|
|
4396
|
+
setTreeKeyStatus();
|
|
4397
|
+
});
|
|
4398
|
+
const mouseenterHandler = () => {
|
|
4399
|
+
tree.value?.$el.focus();
|
|
4400
|
+
};
|
|
4401
|
+
const mouseleaveHandler = () => {
|
|
4402
|
+
tree.value?.$el.blur();
|
|
4403
|
+
isMultiSelectStatus.value = false;
|
|
4404
|
+
};
|
|
4405
|
+
let keycon;
|
|
4406
|
+
vue.onMounted(() => {
|
|
4407
|
+
keycon = new KeyController__default.default(tree.value?.$el);
|
|
4408
|
+
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
4409
|
+
const ctrl = isMac ? "meta" : "ctrl";
|
|
4410
|
+
keycon.keydown(ctrl, (e) => {
|
|
4411
|
+
e.inputEvent.preventDefault();
|
|
4412
|
+
isMultiSelectStatus.value = true;
|
|
4413
|
+
}).keyup(ctrl, (e) => {
|
|
4414
|
+
e.inputEvent.preventDefault();
|
|
4415
|
+
isMultiSelectStatus.value = false;
|
|
4416
|
+
});
|
|
4417
|
+
});
|
|
4418
|
+
vue.onUnmounted(() => {
|
|
4419
|
+
keycon.destroy();
|
|
4420
|
+
});
|
|
4106
4421
|
const clicked = vue.ref(false);
|
|
4107
|
-
const
|
|
4422
|
+
const highlightNode = vue.computed(() => editorService?.get("highlightNode"));
|
|
4108
4423
|
const highlightHandler = lodashEs.throttle((data) => {
|
|
4109
|
-
highlight(data
|
|
4424
|
+
highlight(data);
|
|
4110
4425
|
}, throttleTime);
|
|
4111
4426
|
const toggleClickFlag = () => {
|
|
4112
4427
|
clicked.value = !clicked.value;
|
|
4113
4428
|
};
|
|
4114
|
-
const
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4429
|
+
const canHighlight = (data) => {
|
|
4430
|
+
if (clicked.value)
|
|
4431
|
+
return false;
|
|
4432
|
+
return data.id === highlightNode?.value?.id && !selectedIds.value.includes(data.id) && spliceNodeKey.value !== data.id;
|
|
4433
|
+
};
|
|
4434
|
+
vue.watch(isMultiSelectStatus, () => {
|
|
4435
|
+
if (isMultiSelectStatus.value && selectedNodes.value.length === 1 && selectedNodes.value[0].type === schema.NodeType.PAGE) {
|
|
4436
|
+
selectedNodes.value = [];
|
|
4437
|
+
}
|
|
4122
4438
|
});
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4439
|
+
const multiClickHandler = (data) => {
|
|
4440
|
+
if (!data?.id) {
|
|
4441
|
+
throw new Error("\u6CA1\u6709id");
|
|
4442
|
+
}
|
|
4443
|
+
if (data.type === schema.NodeType.PAGE) {
|
|
4444
|
+
tree.value?.setCheckedKeys([]);
|
|
4445
|
+
return;
|
|
4446
|
+
}
|
|
4447
|
+
const index = selectedNodes.value.findIndex((node) => node.id === data.id);
|
|
4448
|
+
if (index !== -1) {
|
|
4449
|
+
selectedNodes.value.splice(index, 1);
|
|
4450
|
+
spliceNodeKey.value = data.id;
|
|
4451
|
+
} else {
|
|
4452
|
+
selectedNodes.value = [...selectedNodes.value, data];
|
|
4453
|
+
}
|
|
4454
|
+
tree.value?.setCheckedKeys(selectedIds.value);
|
|
4455
|
+
multiSelect(selectedIds.value);
|
|
4456
|
+
};
|
|
4457
|
+
const clickHandler = (data) => {
|
|
4458
|
+
if (!isMultiSelectStatus.value) {
|
|
4133
4459
|
if (services?.uiService.get("uiSelectMode")) {
|
|
4134
4460
|
document.dispatchEvent(new CustomEvent("ui-select", { detail: data }));
|
|
4135
4461
|
return;
|
|
4136
4462
|
}
|
|
4137
4463
|
tree.value?.setCurrentKey(data.id);
|
|
4138
|
-
select(data
|
|
4139
|
-
}
|
|
4140
|
-
|
|
4141
|
-
event.preventDefault();
|
|
4142
|
-
await select(data, editorService);
|
|
4143
|
-
menu.value?.show(event);
|
|
4464
|
+
select(data);
|
|
4465
|
+
} else {
|
|
4466
|
+
multiClickHandler(data);
|
|
4144
4467
|
}
|
|
4145
4468
|
};
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
for (const [key, val] of props) {
|
|
4152
|
-
target[key] = val;
|
|
4153
|
-
}
|
|
4154
|
-
return target;
|
|
4155
|
-
};
|
|
4156
|
-
|
|
4157
|
-
const _hoisted_1$3 = ["id", "onMouseenter"];
|
|
4158
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4159
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
4160
|
-
const _component_el_tree = vue.resolveComponent("el-tree");
|
|
4161
|
-
const _component_layer_menu = vue.resolveComponent("layer-menu");
|
|
4162
|
-
const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
|
|
4163
|
-
return vue.openBlock(), vue.createBlock(_component_el_scrollbar, { class: "magic-editor-layer-panel" }, {
|
|
4164
|
-
default: vue.withCtx(() => [
|
|
4165
|
-
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4166
|
-
vue.createVNode(_component_el_input, {
|
|
4167
|
-
class: "filterInput",
|
|
4168
|
-
size: "small",
|
|
4169
|
-
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4170
|
-
clearable: "",
|
|
4171
|
-
modelValue: _ctx.filterText,
|
|
4172
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filterText = $event),
|
|
4173
|
-
onChange: _ctx.filterTextChangeHandler
|
|
4174
|
-
}, null, 8, ["modelValue", "onChange"]),
|
|
4175
|
-
_ctx.values.length ? (vue.openBlock(), vue.createBlock(_component_el_tree, {
|
|
4176
|
-
key: 0,
|
|
4177
|
-
ref: "tree",
|
|
4178
|
-
"node-key": "id",
|
|
4179
|
-
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4180
|
-
draggable: "",
|
|
4181
|
-
"default-expanded-keys": _ctx.expandedKeys,
|
|
4182
|
-
load: _ctx.loadItems,
|
|
4183
|
-
data: _ctx.values,
|
|
4184
|
-
"expand-on-click-node": false,
|
|
4185
|
-
"highlight-current": true,
|
|
4186
|
-
props: {
|
|
4187
|
-
children: "items"
|
|
4188
|
-
},
|
|
4189
|
-
"filter-node-method": _ctx.filterNode,
|
|
4190
|
-
"allow-drop": _ctx.allowDrop,
|
|
4191
|
-
onNodeClick: _ctx.clickHandler,
|
|
4192
|
-
onNodeContextmenu: _ctx.contextmenu,
|
|
4193
|
-
onNodeDragEnd: _ctx.handleDragEnd,
|
|
4194
|
-
onNodeCollapse: _ctx.handleCollapse,
|
|
4195
|
-
onNodeExpand: _ctx.handleExpand
|
|
4196
|
-
}, {
|
|
4197
|
-
default: vue.withCtx(({ node, data }) => [
|
|
4198
|
-
vue.createElementVNode("div", {
|
|
4199
|
-
id: data.id,
|
|
4200
|
-
class: vue.normalizeClass(["cus-tree-node", { "cus-tree-node-hover": _ctx.canHighlight && data.id === _ctx.highlightNode?.id }]),
|
|
4201
|
-
onMousedown: _cache[1] || (_cache[1] = (...args) => _ctx.toggleClickFlag && _ctx.toggleClickFlag(...args)),
|
|
4202
|
-
onMouseup: _cache[2] || (_cache[2] = (...args) => _ctx.toggleClickFlag && _ctx.toggleClickFlag(...args)),
|
|
4203
|
-
onMouseenter: ($event) => _ctx.highlightHandler(data)
|
|
4204
|
-
}, [
|
|
4205
|
-
vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4206
|
-
node,
|
|
4207
|
-
data
|
|
4208
|
-
}, () => [
|
|
4209
|
-
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
4210
|
-
])
|
|
4211
|
-
], 42, _hoisted_1$3)
|
|
4212
|
-
]),
|
|
4213
|
-
_: 3
|
|
4214
|
-
}, 8, ["default-expanded-keys", "load", "data", "filter-node-method", "allow-drop", "onNodeClick", "onNodeContextmenu", "onNodeDragEnd", "onNodeCollapse", "onNodeExpand"])) : vue.createCommentVNode("", true),
|
|
4215
|
-
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
4216
|
-
vue.createVNode(_component_layer_menu, { ref: "menu" }, null, 512)
|
|
4217
|
-
]))
|
|
4218
|
-
]),
|
|
4219
|
-
_: 3
|
|
4220
|
-
});
|
|
4221
|
-
}
|
|
4222
|
-
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$1]]);
|
|
4223
|
-
|
|
4224
|
-
const _hoisted_1$2 = {
|
|
4225
|
-
key: 1,
|
|
4226
|
-
class: "magic-editor-tab-panel-title"
|
|
4227
|
-
};
|
|
4228
|
-
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
4229
|
-
__name: "TabPane",
|
|
4230
|
-
props: {
|
|
4231
|
-
data: null
|
|
4232
|
-
},
|
|
4233
|
-
setup(__props) {
|
|
4234
|
-
const props = __props;
|
|
4235
|
-
const config = vue.computed(() => {
|
|
4236
|
-
if (typeof props.data !== "string") {
|
|
4237
|
-
return props.data;
|
|
4238
|
-
}
|
|
4239
|
-
switch (props.data) {
|
|
4240
|
-
case "component-list":
|
|
4241
|
-
return {
|
|
4242
|
-
type: "component",
|
|
4243
|
-
icon: iconsVue.Coin,
|
|
4244
|
-
text: "\u7EC4\u4EF6",
|
|
4245
|
-
component: _sfc_main$d,
|
|
4246
|
-
slots: {}
|
|
4247
|
-
};
|
|
4248
|
-
case "layer":
|
|
4249
|
-
return {
|
|
4250
|
-
type: "component",
|
|
4251
|
-
icon: iconsVue.Files,
|
|
4252
|
-
text: "\u5DF2\u9009\u7EC4\u4EF6",
|
|
4253
|
-
component: LayerPanel,
|
|
4254
|
-
slots: {}
|
|
4255
|
-
};
|
|
4256
|
-
case "code-block":
|
|
4257
|
-
return {
|
|
4258
|
-
type: "component",
|
|
4259
|
-
icon: iconsVue.EditPen,
|
|
4260
|
-
text: "\u4EE3\u7801\u7F16\u8F91",
|
|
4261
|
-
component: _sfc_main$e,
|
|
4262
|
-
slots: {}
|
|
4263
|
-
};
|
|
4264
|
-
default:
|
|
4265
|
-
return void 0;
|
|
4266
|
-
}
|
|
4267
|
-
});
|
|
4469
|
+
const contextmenu = async (event, data) => {
|
|
4470
|
+
event.preventDefault();
|
|
4471
|
+
await select(data);
|
|
4472
|
+
menu.value?.show(event);
|
|
4473
|
+
};
|
|
4268
4474
|
return (_ctx, _cache) => {
|
|
4269
|
-
|
|
4270
|
-
return vue.unref(config) ? (vue.openBlock(), vue.createBlock(_component_el_tab_pane, {
|
|
4271
|
-
key: 0,
|
|
4272
|
-
name: vue.unref(config).text
|
|
4273
|
-
}, {
|
|
4274
|
-
label: vue.withCtx(() => [
|
|
4275
|
-
(vue.openBlock(), vue.createElementBlock("div", {
|
|
4276
|
-
key: vue.unref(config).text
|
|
4277
|
-
}, [
|
|
4278
|
-
vue.unref(config).icon ? (vue.openBlock(), vue.createBlock(_sfc_main$j, {
|
|
4279
|
-
key: 0,
|
|
4280
|
-
icon: vue.unref(config).icon
|
|
4281
|
-
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
4282
|
-
vue.unref(config).text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, vue.toDisplayString(vue.unref(config).text), 1)) : vue.createCommentVNode("", true)
|
|
4283
|
-
]))
|
|
4284
|
-
]),
|
|
4475
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
|
|
4285
4476
|
default: vue.withCtx(() => [
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4477
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4478
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4479
|
+
modelValue: filterText.value,
|
|
4480
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
4481
|
+
class: "search-input",
|
|
4482
|
+
size: "small",
|
|
4483
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4484
|
+
clearable: "",
|
|
4485
|
+
"prefix-icon": vue.unref(iconsVue.Search),
|
|
4486
|
+
onChange: filterTextChangeHandler
|
|
4487
|
+
}, null, 8, ["modelValue", "prefix-icon"]),
|
|
4488
|
+
vue.unref(values).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
4489
|
+
key: 0,
|
|
4490
|
+
tabindex: "-1",
|
|
4491
|
+
class: "magic-editor-layer-tree",
|
|
4492
|
+
ref_key: "tree",
|
|
4493
|
+
ref: tree,
|
|
4494
|
+
"node-key": "id",
|
|
4495
|
+
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4496
|
+
draggable: "",
|
|
4497
|
+
"default-expanded-keys": vue.unref(defaultExpandedKeys),
|
|
4498
|
+
load: loadItems,
|
|
4499
|
+
data: vue.unref(values),
|
|
4500
|
+
"default-expand-all": true,
|
|
4501
|
+
"expand-on-click-node": false,
|
|
4502
|
+
"highlight-current": true,
|
|
4503
|
+
props: {
|
|
4504
|
+
children: "items"
|
|
4505
|
+
},
|
|
4506
|
+
"filter-node-method": filterNode,
|
|
4507
|
+
"allow-drop": allowDrop,
|
|
4508
|
+
"show-checkbox": isMultiSelectStatus.value || vue.unref(selectedIds).length > 1,
|
|
4509
|
+
onNodeClick: clickHandler,
|
|
4510
|
+
onNodeContextmenu: contextmenu,
|
|
4511
|
+
onNodeDragEnd: handleDragEnd,
|
|
4512
|
+
onNodeCollapse: handleCollapse,
|
|
4513
|
+
onNodeExpand: handleExpand,
|
|
4514
|
+
onCheck: multiClickHandler,
|
|
4515
|
+
onMousedown: toggleClickFlag,
|
|
4516
|
+
onMouseup: toggleClickFlag,
|
|
4517
|
+
onMouseenter: mouseenterHandler,
|
|
4518
|
+
onMouseleave: mouseleaveHandler
|
|
4519
|
+
}, {
|
|
4520
|
+
default: vue.withCtx(({ node, data }) => [
|
|
4521
|
+
vue.createElementVNode("div", {
|
|
4522
|
+
id: data.id,
|
|
4523
|
+
class: vue.normalizeClass(["cus-tree-node", { "cus-tree-node-hover": canHighlight(data) }]),
|
|
4524
|
+
onMouseenter: ($event) => vue.unref(highlightHandler)(data)
|
|
4525
|
+
}, [
|
|
4526
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4527
|
+
node,
|
|
4323
4528
|
data
|
|
4324
|
-
}
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
fn: vue.withCtx(({ data: nodeData, node }) => [
|
|
4339
|
-
__props.data === "layer" ? vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4340
|
-
key: 0,
|
|
4341
|
-
data: nodeData,
|
|
4342
|
-
node
|
|
4343
|
-
}) : vue.unref(config).slots?.layerNodeContent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(config).slots.layerNodeContent), {
|
|
4344
|
-
key: 1,
|
|
4345
|
-
data: nodeData,
|
|
4346
|
-
node
|
|
4347
|
-
}, null, 8, ["data", "node"])) : vue.createCommentVNode("", true)
|
|
4348
|
-
])
|
|
4349
|
-
} : void 0
|
|
4350
|
-
]), 1040))
|
|
4529
|
+
}, () => [
|
|
4530
|
+
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
4531
|
+
])
|
|
4532
|
+
], 42, _hoisted_1$4)
|
|
4533
|
+
]),
|
|
4534
|
+
_: 3
|
|
4535
|
+
}, 8, ["default-expanded-keys", "data", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
4536
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
4537
|
+
vue.createVNode(_sfc_main$b, {
|
|
4538
|
+
ref_key: "menu",
|
|
4539
|
+
ref: menu,
|
|
4540
|
+
"layer-content-menu": __props.layerContentMenu
|
|
4541
|
+
}, null, 8, ["layer-content-menu"])
|
|
4542
|
+
]))
|
|
4351
4543
|
]),
|
|
4352
4544
|
_: 3
|
|
4353
|
-
}
|
|
4545
|
+
});
|
|
4354
4546
|
};
|
|
4355
4547
|
}
|
|
4356
4548
|
});
|
|
4357
4549
|
|
|
4358
|
-
const
|
|
4359
|
-
|
|
4550
|
+
const _hoisted_1$3 = {
|
|
4551
|
+
key: 1,
|
|
4552
|
+
class: "magic-editor-tab-panel-title"
|
|
4553
|
+
};
|
|
4554
|
+
const __default__$8 = vue.defineComponent({
|
|
4555
|
+
name: "MEditorSidebar"
|
|
4556
|
+
});
|
|
4557
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
4558
|
+
...__default__$8,
|
|
4360
4559
|
props: {
|
|
4361
|
-
data: { default: () => ({ type: "tabs", status: "\u7EC4\u4EF6", items: ["component-list", "layer", "code-block"] }) }
|
|
4560
|
+
data: { default: () => ({ type: "tabs", status: "\u7EC4\u4EF6", items: ["component-list", "layer", "code-block"] }) },
|
|
4561
|
+
layerContentMenu: null
|
|
4362
4562
|
},
|
|
4363
4563
|
setup(__props, { expose }) {
|
|
4364
4564
|
const props = __props;
|
|
4565
|
+
const uiComponent = design.getConfig("components").tabPane;
|
|
4365
4566
|
const activeTabName = vue.ref(props.data?.status);
|
|
4567
|
+
const getItemConfig = (data) => {
|
|
4568
|
+
const map = {
|
|
4569
|
+
"component-list": {
|
|
4570
|
+
$key: "component-list",
|
|
4571
|
+
type: "component",
|
|
4572
|
+
icon: iconsVue.Coin,
|
|
4573
|
+
text: "\u7EC4\u4EF6",
|
|
4574
|
+
component: _sfc_main$d,
|
|
4575
|
+
slots: {}
|
|
4576
|
+
},
|
|
4577
|
+
layer: {
|
|
4578
|
+
$key: "layer",
|
|
4579
|
+
type: "component",
|
|
4580
|
+
icon: iconsVue.Files,
|
|
4581
|
+
text: "\u5DF2\u9009\u7EC4\u4EF6",
|
|
4582
|
+
props: {
|
|
4583
|
+
layerContentMenu: props.layerContentMenu
|
|
4584
|
+
},
|
|
4585
|
+
component: _sfc_main$a,
|
|
4586
|
+
slots: {}
|
|
4587
|
+
},
|
|
4588
|
+
"code-block": {
|
|
4589
|
+
$key: "code-block",
|
|
4590
|
+
type: "component",
|
|
4591
|
+
icon: iconsVue.EditPen,
|
|
4592
|
+
text: "\u4EE3\u7801\u7F16\u8F91",
|
|
4593
|
+
component: _sfc_main$e,
|
|
4594
|
+
slots: {}
|
|
4595
|
+
}
|
|
4596
|
+
};
|
|
4597
|
+
return typeof data === "string" ? map[data] : data;
|
|
4598
|
+
};
|
|
4599
|
+
const sideBarItems = vue.computed(() => props.data.items.map((item) => getItemConfig(item)));
|
|
4366
4600
|
vue.watch(
|
|
4367
4601
|
() => props.data.status,
|
|
4368
4602
|
(status) => {
|
|
@@ -4373,8 +4607,7 @@
|
|
|
4373
4607
|
activeTabName
|
|
4374
4608
|
});
|
|
4375
4609
|
return (_ctx, _cache) => {
|
|
4376
|
-
|
|
4377
|
-
return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(_component_el_tabs, {
|
|
4610
|
+
return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTabs), {
|
|
4378
4611
|
key: 0,
|
|
4379
4612
|
class: "m-editor-sidebar",
|
|
4380
4613
|
modelValue: activeTabName.value,
|
|
@@ -4383,60 +4616,91 @@
|
|
|
4383
4616
|
"tab-position": "left"
|
|
4384
4617
|
}, {
|
|
4385
4618
|
default: vue.withCtx(() => [
|
|
4386
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
4387
|
-
return vue.openBlock(), vue.createBlock(
|
|
4619
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(sideBarItems), (config, index) => {
|
|
4620
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent).component), {
|
|
4388
4621
|
key: index,
|
|
4389
|
-
|
|
4390
|
-
},
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4622
|
+
name: config.text
|
|
4623
|
+
}, {
|
|
4624
|
+
label: vue.withCtx(() => [
|
|
4625
|
+
(vue.openBlock(), vue.createElementBlock("div", {
|
|
4626
|
+
key: config.text
|
|
4627
|
+
}, [
|
|
4628
|
+
config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$n, {
|
|
4629
|
+
key: 0,
|
|
4630
|
+
icon: config.icon
|
|
4631
|
+
}, null, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
4632
|
+
config.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, vue.toDisplayString(config.text), 1)) : vue.createCommentVNode("", true)
|
|
4633
|
+
]))
|
|
4634
|
+
]),
|
|
4635
|
+
default: vue.withCtx(() => [
|
|
4636
|
+
config ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.component), vue.mergeProps({ key: 0 }, config.props || {}, vue.toHandlers(config?.listeners || {})), vue.createSlots({ _: 2 }, [
|
|
4637
|
+
config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
|
|
4638
|
+
name: "component-list-panel-header",
|
|
4639
|
+
fn: vue.withCtx(() => [
|
|
4640
|
+
config.$key === "component-list" ? vue.renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
4641
|
+
])
|
|
4642
|
+
} : void 0,
|
|
4643
|
+
config.$key === "component-list" || config.slots?.componentListItem ? {
|
|
4644
|
+
name: "component-list-item",
|
|
4645
|
+
fn: vue.withCtx(({ component }) => [
|
|
4646
|
+
config.$key === "component-list" ? vue.renderSlot(_ctx.$slots, "component-list-item", {
|
|
4647
|
+
key: 0,
|
|
4648
|
+
component
|
|
4649
|
+
}) : config.slots?.componentListItem ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.componentListItem), {
|
|
4650
|
+
key: 1,
|
|
4651
|
+
component
|
|
4652
|
+
}, null, 8, ["component"])) : vue.createCommentVNode("", true)
|
|
4653
|
+
])
|
|
4654
|
+
} : void 0,
|
|
4655
|
+
config.$key === "layer" || config.slots?.layerPanelHeader ? {
|
|
4656
|
+
name: "layer-panel-header",
|
|
4657
|
+
fn: vue.withCtx(() => [
|
|
4658
|
+
config.$key === "layer" ? vue.renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
4659
|
+
])
|
|
4660
|
+
} : void 0,
|
|
4661
|
+
config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
|
|
4662
|
+
name: "code-block-panel-header",
|
|
4663
|
+
fn: vue.withCtx(() => [
|
|
4664
|
+
config.$key === "code-block" ? vue.renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
4665
|
+
])
|
|
4666
|
+
} : void 0,
|
|
4667
|
+
config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
|
|
4668
|
+
name: "code-block-panel-tool",
|
|
4669
|
+
fn: vue.withCtx(({ id, data }) => [
|
|
4670
|
+
config.$key === "code-block" ? vue.renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
4671
|
+
key: 0,
|
|
4672
|
+
id,
|
|
4673
|
+
data
|
|
4674
|
+
}) : config.slots?.codeBlockPanelTool ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : vue.createCommentVNode("", true)
|
|
4675
|
+
])
|
|
4676
|
+
} : void 0,
|
|
4677
|
+
config.$key === "code-block" || config.slots?.codeBlockEditPanelHeader ? {
|
|
4678
|
+
name: "code-block-edit-panel-header",
|
|
4679
|
+
fn: vue.withCtx(({ id }) => [
|
|
4680
|
+
config.$key === "code-block" ? vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", {
|
|
4681
|
+
key: 0,
|
|
4682
|
+
id
|
|
4683
|
+
}) : config.slots?.codeBlockEditPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockEditPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
|
|
4684
|
+
])
|
|
4685
|
+
} : void 0,
|
|
4686
|
+
config.$key === "layer" || config.slots?.layerNodeContent ? {
|
|
4687
|
+
name: "layer-node-content",
|
|
4688
|
+
fn: vue.withCtx(({ data: nodeData, node }) => [
|
|
4689
|
+
config.$key === "layer" ? vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4690
|
+
key: 0,
|
|
4691
|
+
data: nodeData,
|
|
4692
|
+
node
|
|
4693
|
+
}) : config.slots?.layerNodeContent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.layerNodeContent), {
|
|
4694
|
+
key: 1,
|
|
4695
|
+
data: nodeData,
|
|
4696
|
+
node
|
|
4697
|
+
}, null, 8, ["data", "node"])) : vue.createCommentVNode("", true)
|
|
4698
|
+
])
|
|
4699
|
+
} : void 0
|
|
4700
|
+
]), 1040)) : vue.createCommentVNode("", true)
|
|
4701
|
+
]),
|
|
4702
|
+
_: 2
|
|
4703
|
+
}, 1032, ["name"]);
|
|
4440
4704
|
}), 128))
|
|
4441
4705
|
]),
|
|
4442
4706
|
_: 3
|
|
@@ -4445,12 +4709,60 @@
|
|
|
4445
4709
|
}
|
|
4446
4710
|
});
|
|
4447
4711
|
|
|
4712
|
+
const _hoisted_1$2 = {
|
|
4713
|
+
key: 0,
|
|
4714
|
+
class: "m-editor-breadcrumb"
|
|
4715
|
+
};
|
|
4716
|
+
const _hoisted_2$1 = { key: 0 };
|
|
4717
|
+
const __default__$7 = vue.defineComponent({
|
|
4718
|
+
name: "MEditorBreadcrumb"
|
|
4719
|
+
});
|
|
4720
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
4721
|
+
...__default__$7,
|
|
4722
|
+
setup(__props) {
|
|
4723
|
+
const services = vue.inject("services");
|
|
4724
|
+
const editorService = services?.editorService;
|
|
4725
|
+
const node = vue.computed(() => editorService?.get("node"));
|
|
4726
|
+
const nodes = vue.computed(() => editorService?.get("nodes") || []);
|
|
4727
|
+
const root = vue.computed(() => editorService?.get("root"));
|
|
4728
|
+
const path = vue.computed(() => utils.getNodePath(node.value?.id || "", root.value?.items || []));
|
|
4729
|
+
const select = async (node2) => {
|
|
4730
|
+
await editorService?.select(node2);
|
|
4731
|
+
editorService?.get("stage")?.select(node2.id);
|
|
4732
|
+
};
|
|
4733
|
+
return (_ctx, _cache) => {
|
|
4734
|
+
return vue.unref(nodes).length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
4735
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(path), (item, index) => {
|
|
4736
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
4737
|
+
key: item.id
|
|
4738
|
+
}, [
|
|
4739
|
+
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4740
|
+
text: "",
|
|
4741
|
+
disabled: item.id === vue.unref(node)?.id,
|
|
4742
|
+
onClick: ($event) => select(item)
|
|
4743
|
+
}, {
|
|
4744
|
+
default: vue.withCtx(() => [
|
|
4745
|
+
vue.createTextVNode(vue.toDisplayString(item.name), 1)
|
|
4746
|
+
]),
|
|
4747
|
+
_: 2
|
|
4748
|
+
}, 1032, ["disabled", "onClick"]),
|
|
4749
|
+
index < vue.unref(path).length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$1, "/")) : vue.createCommentVNode("", true)
|
|
4750
|
+
], 64);
|
|
4751
|
+
}), 128))
|
|
4752
|
+
])) : vue.createCommentVNode("", true);
|
|
4753
|
+
};
|
|
4754
|
+
}
|
|
4755
|
+
});
|
|
4756
|
+
|
|
4448
4757
|
const _hoisted_1$1 = {
|
|
4449
4758
|
key: 1,
|
|
4450
4759
|
style: { "width": "21px" }
|
|
4451
4760
|
};
|
|
4761
|
+
const __default__$6 = vue.defineComponent({
|
|
4762
|
+
name: "MEditorPageBarScrollContainer"
|
|
4763
|
+
});
|
|
4452
4764
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
4453
|
-
|
|
4765
|
+
...__default__$6,
|
|
4454
4766
|
setup(__props) {
|
|
4455
4767
|
const services = vue.inject("services");
|
|
4456
4768
|
const editorService = services?.editorService;
|
|
@@ -4531,14 +4843,14 @@
|
|
|
4531
4843
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4532
4844
|
onClick: addPage
|
|
4533
4845
|
}, [
|
|
4534
|
-
vue.createVNode(_sfc_main$
|
|
4846
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
|
|
4535
4847
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1)),
|
|
4536
4848
|
canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4537
4849
|
key: 2,
|
|
4538
4850
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4539
4851
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
4540
4852
|
}, [
|
|
4541
|
-
vue.createVNode(_sfc_main$
|
|
4853
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
|
|
4542
4854
|
])) : vue.createCommentVNode("", true),
|
|
4543
4855
|
vue.unref(pageLength) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4544
4856
|
key: 3,
|
|
@@ -4554,7 +4866,7 @@
|
|
|
4554
4866
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
4555
4867
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
4556
4868
|
}, [
|
|
4557
|
-
vue.createVNode(_sfc_main$
|
|
4869
|
+
vue.createVNode(_sfc_main$n, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
|
|
4558
4870
|
])) : vue.createCommentVNode("", true)
|
|
4559
4871
|
], 512);
|
|
4560
4872
|
};
|
|
@@ -4563,8 +4875,11 @@
|
|
|
4563
4875
|
|
|
4564
4876
|
const _hoisted_1 = ["onClick"];
|
|
4565
4877
|
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
4878
|
+
const __default__$5 = vue.defineComponent({
|
|
4879
|
+
name: "MEditorPageBar"
|
|
4880
|
+
});
|
|
4566
4881
|
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
4567
|
-
|
|
4882
|
+
...__default__$5,
|
|
4568
4883
|
setup(__props) {
|
|
4569
4884
|
const services = vue.inject("services");
|
|
4570
4885
|
const editorService = services?.editorService;
|
|
@@ -4584,9 +4899,6 @@
|
|
|
4584
4899
|
editorService?.remove(node);
|
|
4585
4900
|
};
|
|
4586
4901
|
return (_ctx, _cache) => {
|
|
4587
|
-
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
4588
|
-
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
4589
|
-
const _component_el_popover = vue.resolveComponent("el-popover");
|
|
4590
4902
|
return vue.openBlock(), vue.createBlock(_sfc_main$7, null, {
|
|
4591
4903
|
default: vue.withCtx(() => [
|
|
4592
4904
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(root) && vue.unref(root).items || [], (item) => {
|
|
@@ -4597,7 +4909,7 @@
|
|
|
4597
4909
|
}, [
|
|
4598
4910
|
vue.createElementVNode("div", _hoisted_2, [
|
|
4599
4911
|
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: item }, () => [
|
|
4600
|
-
vue.createVNode(
|
|
4912
|
+
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
4601
4913
|
effect: "dark",
|
|
4602
4914
|
placement: "top-start",
|
|
4603
4915
|
content: item.name
|
|
@@ -4609,14 +4921,14 @@
|
|
|
4609
4921
|
}, 1032, ["content"])
|
|
4610
4922
|
])
|
|
4611
4923
|
]),
|
|
4612
|
-
vue.createVNode(
|
|
4924
|
+
vue.createVNode(vue.unref(design.TMagicPopover), {
|
|
4613
4925
|
"popper-class": "page-bar-popover",
|
|
4614
4926
|
placement: "top",
|
|
4615
4927
|
width: 160,
|
|
4616
4928
|
trigger: "hover"
|
|
4617
4929
|
}, {
|
|
4618
4930
|
reference: vue.withCtx(() => [
|
|
4619
|
-
vue.createVNode(
|
|
4931
|
+
vue.createVNode(vue.unref(design.TMagicIcon), { class: "m-editor-page-bar-menu-icon" }, {
|
|
4620
4932
|
default: vue.withCtx(() => [
|
|
4621
4933
|
vue.createVNode(vue.unref(iconsVue.CaretBottom))
|
|
4622
4934
|
]),
|
|
@@ -4626,7 +4938,7 @@
|
|
|
4626
4938
|
default: vue.withCtx(() => [
|
|
4627
4939
|
vue.createElementVNode("div", null, [
|
|
4628
4940
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
4629
|
-
vue.createVNode(_sfc_main$
|
|
4941
|
+
vue.createVNode(_sfc_main$k, {
|
|
4630
4942
|
data: {
|
|
4631
4943
|
type: "button",
|
|
4632
4944
|
text: "\u590D\u5236",
|
|
@@ -4634,7 +4946,7 @@
|
|
|
4634
4946
|
handler: () => copy(item)
|
|
4635
4947
|
}
|
|
4636
4948
|
}, null, 8, ["data"]),
|
|
4637
|
-
vue.createVNode(_sfc_main$
|
|
4949
|
+
vue.createVNode(_sfc_main$k, {
|
|
4638
4950
|
data: {
|
|
4639
4951
|
type: "button",
|
|
4640
4952
|
text: "\u5220\u9664",
|
|
@@ -4668,6 +4980,10 @@
|
|
|
4668
4980
|
height = 0;
|
|
4669
4981
|
translateXCorrectionValue = 0;
|
|
4670
4982
|
translateYCorrectionValue = 0;
|
|
4983
|
+
correctionScrollSize = {
|
|
4984
|
+
width: 0,
|
|
4985
|
+
height: 0
|
|
4986
|
+
};
|
|
4671
4987
|
resizeObserver = new ResizeObserver(() => {
|
|
4672
4988
|
this.setSize();
|
|
4673
4989
|
this.setScrollSize();
|
|
@@ -4677,6 +4993,12 @@
|
|
|
4677
4993
|
this.container = options.container;
|
|
4678
4994
|
this.target = options.target;
|
|
4679
4995
|
this.zoom = options.zoom;
|
|
4996
|
+
if (this.correctionScrollSize) {
|
|
4997
|
+
this.correctionScrollSize = {
|
|
4998
|
+
...this.correctionScrollSize,
|
|
4999
|
+
...options.correctionScrollSize
|
|
5000
|
+
};
|
|
5001
|
+
}
|
|
4680
5002
|
this.container.addEventListener("wheel", this.wheelHandler, false);
|
|
4681
5003
|
this.setSize();
|
|
4682
5004
|
this.setScrollSize();
|
|
@@ -4739,9 +5061,9 @@
|
|
|
4739
5061
|
}
|
|
4740
5062
|
setScrollSize = () => {
|
|
4741
5063
|
const targetRect = this.target.getBoundingClientRect();
|
|
4742
|
-
this.scrollWidth = targetRect.width * this.zoom +
|
|
5064
|
+
this.scrollWidth = targetRect.width * this.zoom + this.correctionScrollSize.width;
|
|
4743
5065
|
const targetMarginTop = Number(this.target.style.marginTop) || 0;
|
|
4744
|
-
this.scrollHeight = (targetRect.height + targetMarginTop) * this.zoom +
|
|
5066
|
+
this.scrollHeight = (targetRect.height + targetMarginTop) * this.zoom + this.correctionScrollSize.height;
|
|
4745
5067
|
let left;
|
|
4746
5068
|
let top;
|
|
4747
5069
|
if (this.scrollWidth < this.width) {
|
|
@@ -4774,8 +5096,11 @@
|
|
|
4774
5096
|
};
|
|
4775
5097
|
}
|
|
4776
5098
|
|
|
5099
|
+
const __default__$4 = vue.defineComponent({
|
|
5100
|
+
name: "MEditorScrollBar"
|
|
5101
|
+
});
|
|
4777
5102
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
4778
|
-
|
|
5103
|
+
...__default__$4,
|
|
4779
5104
|
props: {
|
|
4780
5105
|
size: null,
|
|
4781
5106
|
scrollSize: null,
|
|
@@ -4860,14 +5185,21 @@
|
|
|
4860
5185
|
|
|
4861
5186
|
const ScrollBar_vue_vue_type_style_index_0_lang = '';
|
|
4862
5187
|
|
|
5188
|
+
const __default__$3 = vue.defineComponent({
|
|
5189
|
+
name: "MEditorScrollViewer"
|
|
5190
|
+
});
|
|
4863
5191
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
4864
|
-
|
|
5192
|
+
...__default__$3,
|
|
4865
5193
|
props: {
|
|
4866
5194
|
width: { default: 0 },
|
|
4867
5195
|
height: { default: 0 },
|
|
4868
5196
|
wrapWidth: { default: 0 },
|
|
4869
5197
|
wrapHeight: { default: 0 },
|
|
4870
|
-
zoom: { default: 1 }
|
|
5198
|
+
zoom: { default: 1 },
|
|
5199
|
+
correctionScrollSize: { default: () => ({
|
|
5200
|
+
width: 0,
|
|
5201
|
+
height: 0
|
|
5202
|
+
}) }
|
|
4871
5203
|
},
|
|
4872
5204
|
setup(__props, { expose }) {
|
|
4873
5205
|
const props = __props;
|
|
@@ -4890,7 +5222,8 @@
|
|
|
4890
5222
|
scrollViewer = new ScrollViewer({
|
|
4891
5223
|
container: container.value,
|
|
4892
5224
|
target: el.value,
|
|
4893
|
-
zoom: props.zoom
|
|
5225
|
+
zoom: props.zoom,
|
|
5226
|
+
correctionScrollSize: props.correctionScrollSize
|
|
4894
5227
|
});
|
|
4895
5228
|
scrollViewer.on("scroll", (data) => {
|
|
4896
5229
|
hOffset.value = data.scrollLeft;
|
|
@@ -4958,10 +5291,14 @@
|
|
|
4958
5291
|
}
|
|
4959
5292
|
});
|
|
4960
5293
|
|
|
5294
|
+
const __default__$2 = vue.defineComponent({
|
|
5295
|
+
name: "MEditorViewerMenu"
|
|
5296
|
+
});
|
|
4961
5297
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
4962
|
-
|
|
5298
|
+
...__default__$2,
|
|
4963
5299
|
props: {
|
|
4964
|
-
isMultiSelect: { type: Boolean, default: false }
|
|
5300
|
+
isMultiSelect: { type: Boolean, default: false },
|
|
5301
|
+
stageContentMenu: null
|
|
4965
5302
|
},
|
|
4966
5303
|
setup(__props, { expose }) {
|
|
4967
5304
|
const props = __props;
|
|
@@ -4974,8 +5311,7 @@
|
|
|
4974
5311
|
const nodes = vue.computed(() => editorService?.get("nodes"));
|
|
4975
5312
|
const parent = vue.computed(() => editorService?.get("parent"));
|
|
4976
5313
|
const stage = vue.computed(() => editorService?.get("stage"));
|
|
4977
|
-
const
|
|
4978
|
-
const menuData = vue.reactive([
|
|
5314
|
+
const menuData = vue.computed(() => [
|
|
4979
5315
|
{
|
|
4980
5316
|
type: "button",
|
|
4981
5317
|
text: "\u6C34\u5E73\u5C45\u4E2D",
|
|
@@ -4989,7 +5325,7 @@
|
|
|
4989
5325
|
{
|
|
4990
5326
|
type: "button",
|
|
4991
5327
|
text: "\u590D\u5236",
|
|
4992
|
-
icon: vue.markRaw(iconsVue.
|
|
5328
|
+
icon: vue.markRaw(iconsVue.CopyDocument),
|
|
4993
5329
|
handler: () => {
|
|
4994
5330
|
nodes.value && editorService?.copy(nodes.value);
|
|
4995
5331
|
canPaste.value = true;
|
|
@@ -4998,6 +5334,7 @@
|
|
|
4998
5334
|
{
|
|
4999
5335
|
type: "button",
|
|
5000
5336
|
text: "\u7C98\u8D34",
|
|
5337
|
+
icon: vue.markRaw(iconsVue.DocumentCopy),
|
|
5001
5338
|
display: () => canPaste.value,
|
|
5002
5339
|
handler: () => {
|
|
5003
5340
|
const rect = menu.value?.$el.getBoundingClientRect();
|
|
@@ -5077,7 +5414,7 @@
|
|
|
5077
5414
|
editorService?.get("stage").clearGuides();
|
|
5078
5415
|
}
|
|
5079
5416
|
},
|
|
5080
|
-
...stageContentMenu
|
|
5417
|
+
...props.stageContentMenu
|
|
5081
5418
|
]);
|
|
5082
5419
|
vue.watch(
|
|
5083
5420
|
parent,
|
|
@@ -5101,7 +5438,7 @@
|
|
|
5101
5438
|
expose({ show });
|
|
5102
5439
|
return (_ctx, _cache) => {
|
|
5103
5440
|
return vue.openBlock(), vue.createBlock(_sfc_main$c, {
|
|
5104
|
-
"menu-data": menuData,
|
|
5441
|
+
"menu-data": vue.unref(menuData),
|
|
5105
5442
|
ref_key: "menu",
|
|
5106
5443
|
ref: menu
|
|
5107
5444
|
}, null, 8, ["menu-data"]);
|
|
@@ -5109,8 +5446,14 @@
|
|
|
5109
5446
|
}
|
|
5110
5447
|
});
|
|
5111
5448
|
|
|
5449
|
+
const __default__$1 = vue.defineComponent({
|
|
5450
|
+
name: "MEditorStage"
|
|
5451
|
+
});
|
|
5112
5452
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
5113
|
-
|
|
5453
|
+
...__default__$1,
|
|
5454
|
+
props: {
|
|
5455
|
+
stageContentMenu: null
|
|
5456
|
+
},
|
|
5114
5457
|
setup(__props) {
|
|
5115
5458
|
let stage = null;
|
|
5116
5459
|
let runtime = null;
|
|
@@ -5127,7 +5470,7 @@
|
|
|
5127
5470
|
const zoom = vue.computed(() => services?.uiService.get("zoom") || 1);
|
|
5128
5471
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
5129
5472
|
vue.watchEffect(() => {
|
|
5130
|
-
if (stage)
|
|
5473
|
+
if (stage || !page.value)
|
|
5131
5474
|
return;
|
|
5132
5475
|
if (!stageContainer.value)
|
|
5133
5476
|
return;
|
|
@@ -5157,6 +5500,14 @@
|
|
|
5157
5500
|
runtime.updateRootConfig?.(lodashEs.cloneDeep(vue.toRaw(root2)));
|
|
5158
5501
|
}
|
|
5159
5502
|
});
|
|
5503
|
+
vue.watch(page, (page2) => {
|
|
5504
|
+
if (runtime && page2) {
|
|
5505
|
+
runtime.updatePageId?.(page2.id);
|
|
5506
|
+
vue.nextTick(() => {
|
|
5507
|
+
stage?.select(page2.id);
|
|
5508
|
+
});
|
|
5509
|
+
}
|
|
5510
|
+
});
|
|
5160
5511
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
5161
5512
|
for (const { contentRect } of entries) {
|
|
5162
5513
|
services?.uiService.set("stageContainerRect", {
|
|
@@ -5229,7 +5580,11 @@
|
|
|
5229
5580
|
height: vue.unref(stageRect)?.height,
|
|
5230
5581
|
"wrap-width": vue.unref(stageContainerRect)?.width,
|
|
5231
5582
|
"wrap-height": vue.unref(stageContainerRect)?.height,
|
|
5232
|
-
zoom: vue.unref(zoom)
|
|
5583
|
+
zoom: vue.unref(zoom),
|
|
5584
|
+
"correction-scroll-size": {
|
|
5585
|
+
width: 60,
|
|
5586
|
+
height: 50
|
|
5587
|
+
}
|
|
5233
5588
|
}, {
|
|
5234
5589
|
default: vue.withCtx(() => [
|
|
5235
5590
|
vue.createElementVNode("div", {
|
|
@@ -5245,8 +5600,9 @@
|
|
|
5245
5600
|
vue.createVNode(_sfc_main$3, {
|
|
5246
5601
|
ref_key: "menu",
|
|
5247
5602
|
ref: menu,
|
|
5248
|
-
"is-multi-select": vue.unref(isMultiSelect)
|
|
5249
|
-
|
|
5603
|
+
"is-multi-select": vue.unref(isMultiSelect),
|
|
5604
|
+
"stage-content-menu": __props.stageContentMenu
|
|
5605
|
+
}, null, 8, ["is-multi-select", "stage-content-menu"])
|
|
5250
5606
|
]))
|
|
5251
5607
|
]),
|
|
5252
5608
|
_: 1
|
|
@@ -5255,8 +5611,14 @@
|
|
|
5255
5611
|
}
|
|
5256
5612
|
});
|
|
5257
5613
|
|
|
5614
|
+
const __default__ = vue.defineComponent({
|
|
5615
|
+
name: "MEditorWorkspace"
|
|
5616
|
+
});
|
|
5258
5617
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
5259
|
-
|
|
5618
|
+
...__default__,
|
|
5619
|
+
props: {
|
|
5620
|
+
stageContentMenu: null
|
|
5621
|
+
},
|
|
5260
5622
|
setup(__props) {
|
|
5261
5623
|
const services = vue.inject("services");
|
|
5262
5624
|
const workspace = vue.ref();
|
|
@@ -5365,10 +5727,12 @@
|
|
|
5365
5727
|
ref_key: "workspace",
|
|
5366
5728
|
ref: workspace
|
|
5367
5729
|
}, [
|
|
5730
|
+
vue.createVNode(_sfc_main$8),
|
|
5368
5731
|
vue.renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
5369
|
-
(vue.openBlock(), vue.createBlock(_sfc_main$2, {
|
|
5370
|
-
key:
|
|
5371
|
-
|
|
5732
|
+
vue.unref(page) ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
|
|
5733
|
+
key: 0,
|
|
5734
|
+
"stage-content-menu": __props.stageContentMenu
|
|
5735
|
+
}, null, 8, ["stage-content-menu"])) : vue.createCommentVNode("", true)
|
|
5372
5736
|
]),
|
|
5373
5737
|
vue.renderSlot(_ctx.$slots, "workspace-content"),
|
|
5374
5738
|
vue.createVNode(_sfc_main$6, null, {
|
|
@@ -5408,11 +5772,11 @@
|
|
|
5408
5772
|
const _sfc_main = vue.defineComponent({
|
|
5409
5773
|
name: "m-editor",
|
|
5410
5774
|
components: {
|
|
5411
|
-
NavMenu: _sfc_main$
|
|
5412
|
-
Sidebar: _sfc_main$
|
|
5775
|
+
NavMenu: _sfc_main$j,
|
|
5776
|
+
Sidebar: _sfc_main$9,
|
|
5413
5777
|
Workspace: _sfc_main$1,
|
|
5414
|
-
PropsPanel: _sfc_main$
|
|
5415
|
-
Framework: _sfc_main$
|
|
5778
|
+
PropsPanel: _sfc_main$i,
|
|
5779
|
+
Framework: _sfc_main$l
|
|
5416
5780
|
},
|
|
5417
5781
|
props: {
|
|
5418
5782
|
modelValue: {
|
|
@@ -5427,6 +5791,10 @@
|
|
|
5427
5791
|
sidebar: {
|
|
5428
5792
|
type: Object
|
|
5429
5793
|
},
|
|
5794
|
+
menu: {
|
|
5795
|
+
type: Object,
|
|
5796
|
+
default: () => ({ left: [], right: [] })
|
|
5797
|
+
},
|
|
5430
5798
|
layerContentMenu: {
|
|
5431
5799
|
type: Array,
|
|
5432
5800
|
default: () => []
|
|
@@ -5435,10 +5803,6 @@
|
|
|
5435
5803
|
type: Array,
|
|
5436
5804
|
default: () => []
|
|
5437
5805
|
},
|
|
5438
|
-
menu: {
|
|
5439
|
-
type: Object,
|
|
5440
|
-
default: () => ({ left: [], right: [] })
|
|
5441
|
-
},
|
|
5442
5806
|
render: {
|
|
5443
5807
|
type: Function
|
|
5444
5808
|
},
|
|
@@ -5472,7 +5836,7 @@
|
|
|
5472
5836
|
},
|
|
5473
5837
|
containerHighlightClassName: {
|
|
5474
5838
|
type: String,
|
|
5475
|
-
default: StageCore.
|
|
5839
|
+
default: StageCore.CONTAINER_HIGHLIGHT_CLASS_NAME
|
|
5476
5840
|
},
|
|
5477
5841
|
containerHighlightDuration: {
|
|
5478
5842
|
type: Number,
|
|
@@ -5496,14 +5860,23 @@
|
|
|
5496
5860
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
5497
5861
|
setup(props, { emit }) {
|
|
5498
5862
|
editorService.on("root-change", (value) => {
|
|
5499
|
-
const
|
|
5500
|
-
|
|
5501
|
-
if (nodeId
|
|
5502
|
-
editorService.
|
|
5503
|
-
}
|
|
5863
|
+
const nodeId = editorService.get("node")?.id || props.defaultSelected;
|
|
5864
|
+
let node;
|
|
5865
|
+
if (nodeId) {
|
|
5866
|
+
node = editorService.getNodeById(nodeId);
|
|
5867
|
+
}
|
|
5868
|
+
if (node && node !== value) {
|
|
5869
|
+
editorService.select(node.id);
|
|
5870
|
+
} else if (value?.items?.length) {
|
|
5871
|
+
editorService.select(value.items[0]);
|
|
5872
|
+
} else if (value?.id) {
|
|
5504
5873
|
editorService.set("nodes", [value]);
|
|
5874
|
+
editorService.set("parent", null);
|
|
5875
|
+
editorService.set("page", null);
|
|
5876
|
+
}
|
|
5877
|
+
if (vue.toRaw(value) !== vue.toRaw(editorService.get("root"))) {
|
|
5878
|
+
emit("update:modelValue", value);
|
|
5505
5879
|
}
|
|
5506
|
-
emit("update:modelValue", vue.toRaw(editorService.get("root")));
|
|
5507
5880
|
});
|
|
5508
5881
|
vue.watch(
|
|
5509
5882
|
() => props.modelValue,
|
|
@@ -5585,8 +5958,7 @@
|
|
|
5585
5958
|
codeBlockService
|
|
5586
5959
|
};
|
|
5587
5960
|
vue.provide("services", services);
|
|
5588
|
-
vue.provide("
|
|
5589
|
-
vue.provide("stageContentMenu", props.stageContentMenu);
|
|
5961
|
+
vue.provide("codeOptions", props.codeOptions);
|
|
5590
5962
|
vue.provide(
|
|
5591
5963
|
"stageOptions",
|
|
5592
5964
|
vue.reactive({
|
|
@@ -5606,21 +5978,32 @@
|
|
|
5606
5978
|
}
|
|
5607
5979
|
});
|
|
5608
5980
|
|
|
5981
|
+
const _export_sfc = (sfc, props) => {
|
|
5982
|
+
const target = sfc.__vccOpts || sfc;
|
|
5983
|
+
for (const [key, val] of props) {
|
|
5984
|
+
target[key] = val;
|
|
5985
|
+
}
|
|
5986
|
+
return target;
|
|
5987
|
+
};
|
|
5988
|
+
|
|
5609
5989
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5610
|
-
const
|
|
5611
|
-
const
|
|
5612
|
-
const
|
|
5613
|
-
const
|
|
5614
|
-
const
|
|
5615
|
-
return vue.openBlock(), vue.createBlock(
|
|
5990
|
+
const _component_NavMenu = vue.resolveComponent("NavMenu");
|
|
5991
|
+
const _component_Sidebar = vue.resolveComponent("Sidebar");
|
|
5992
|
+
const _component_Workspace = vue.resolveComponent("Workspace");
|
|
5993
|
+
const _component_PropsPanel = vue.resolveComponent("PropsPanel");
|
|
5994
|
+
const _component_Framework = vue.resolveComponent("Framework");
|
|
5995
|
+
return vue.openBlock(), vue.createBlock(_component_Framework, { "code-options": _ctx.codeOptions }, {
|
|
5616
5996
|
nav: vue.withCtx(() => [
|
|
5617
5997
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: _ctx.editorService }, () => [
|
|
5618
|
-
vue.createVNode(
|
|
5998
|
+
vue.createVNode(_component_NavMenu, { data: _ctx.menu }, null, 8, ["data"])
|
|
5619
5999
|
])
|
|
5620
6000
|
]),
|
|
5621
6001
|
sidebar: vue.withCtx(() => [
|
|
5622
6002
|
vue.renderSlot(_ctx.$slots, "sidebar", { editorService: _ctx.editorService }, () => [
|
|
5623
|
-
vue.createVNode(
|
|
6003
|
+
vue.createVNode(_component_Sidebar, {
|
|
6004
|
+
data: _ctx.sidebar,
|
|
6005
|
+
"layer-content-menu": _ctx.layerContentMenu
|
|
6006
|
+
}, {
|
|
5624
6007
|
"layer-panel-header": vue.withCtx(() => [
|
|
5625
6008
|
vue.renderSlot(_ctx.$slots, "layer-panel-header")
|
|
5626
6009
|
]),
|
|
@@ -5649,12 +6032,12 @@
|
|
|
5649
6032
|
vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
|
|
5650
6033
|
]),
|
|
5651
6034
|
_: 3
|
|
5652
|
-
}, 8, ["data"])
|
|
6035
|
+
}, 8, ["data", "layer-content-menu"])
|
|
5653
6036
|
])
|
|
5654
6037
|
]),
|
|
5655
6038
|
workspace: vue.withCtx(() => [
|
|
5656
6039
|
vue.renderSlot(_ctx.$slots, "workspace", { editorService: _ctx.editorService }, () => [
|
|
5657
|
-
vue.createVNode(
|
|
6040
|
+
vue.createVNode(_component_Workspace, { "stage-content-menu": _ctx.stageContentMenu }, {
|
|
5658
6041
|
stage: vue.withCtx(() => [
|
|
5659
6042
|
vue.renderSlot(_ctx.$slots, "stage")
|
|
5660
6043
|
]),
|
|
@@ -5668,12 +6051,12 @@
|
|
|
5668
6051
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page })
|
|
5669
6052
|
]),
|
|
5670
6053
|
_: 3
|
|
5671
|
-
})
|
|
6054
|
+
}, 8, ["stage-content-menu"])
|
|
5672
6055
|
])
|
|
5673
6056
|
]),
|
|
5674
6057
|
"props-panel": vue.withCtx(() => [
|
|
5675
6058
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
5676
|
-
vue.createVNode(
|
|
6059
|
+
vue.createVNode(_component_PropsPanel, {
|
|
5677
6060
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
|
|
5678
6061
|
}, {
|
|
5679
6062
|
"props-panel-header": vue.withCtx(() => [
|
|
@@ -5700,35 +6083,37 @@
|
|
|
5700
6083
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
5701
6084
|
setConfig(option);
|
|
5702
6085
|
app.component(Editor.name, Editor);
|
|
5703
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
5704
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
5705
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
5706
|
-
app.component("magic-code-editor", _sfc_main$
|
|
5707
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
6086
|
+
app.component("m-fields-ui-select", _sfc_main$r);
|
|
6087
|
+
app.component("m-fields-code-link", _sfc_main$t);
|
|
6088
|
+
app.component("m-fields-vs-code", _sfc_main$u);
|
|
6089
|
+
app.component("magic-code-editor", _sfc_main$q);
|
|
6090
|
+
app.component("m-fields-code-select", _sfc_main$s);
|
|
5708
6091
|
}
|
|
5709
6092
|
};
|
|
5710
6093
|
|
|
6094
|
+
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
5711
6095
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
5712
6096
|
exports.CodeBlockList = _sfc_main$e;
|
|
5713
6097
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
5714
6098
|
exports.CodeEditorMode = CodeEditorMode;
|
|
5715
|
-
exports.CodeSelect = _sfc_main$
|
|
5716
|
-
exports.CodeSelectOp = CodeSelectOp;
|
|
6099
|
+
exports.CodeSelect = _sfc_main$s;
|
|
5717
6100
|
exports.ColumnLayout = ColumnLayout;
|
|
5718
6101
|
exports.ComponentListPanel = _sfc_main$d;
|
|
5719
6102
|
exports.ContentMenu = _sfc_main$c;
|
|
5720
6103
|
exports.Fixed2Other = Fixed2Other;
|
|
5721
6104
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
5722
|
-
exports.Icon = _sfc_main$
|
|
6105
|
+
exports.Icon = _sfc_main$n;
|
|
5723
6106
|
exports.Keys = Keys;
|
|
5724
6107
|
exports.LayerOffset = LayerOffset;
|
|
5725
|
-
exports.LayerPanel =
|
|
6108
|
+
exports.LayerPanel = _sfc_main$a;
|
|
5726
6109
|
exports.Layout = Layout;
|
|
5727
|
-
exports.
|
|
5728
|
-
exports.
|
|
6110
|
+
exports.LayoutContainer = _sfc_main$o;
|
|
6111
|
+
exports.PropsPanel = _sfc_main$i;
|
|
6112
|
+
exports.TMagicCodeEditor = _sfc_main$q;
|
|
5729
6113
|
exports.TMagicEditor = Editor;
|
|
5730
|
-
exports.ToolButton = _sfc_main$
|
|
6114
|
+
exports.ToolButton = _sfc_main$k;
|
|
5731
6115
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
6116
|
+
exports.beforePaste = beforePaste;
|
|
5732
6117
|
exports.change2Fixed = change2Fixed;
|
|
5733
6118
|
exports.codeBlockService = codeBlockService;
|
|
5734
6119
|
exports.debug = debug;
|
|
@@ -5741,18 +6126,22 @@
|
|
|
5741
6126
|
exports.fixNodePosition = fixNodePosition;
|
|
5742
6127
|
exports.generatePageName = generatePageName;
|
|
5743
6128
|
exports.generatePageNameByApp = generatePageNameByApp;
|
|
6129
|
+
exports.getAddParent = getAddParent;
|
|
5744
6130
|
exports.getConfig = getConfig;
|
|
6131
|
+
exports.getDefaultConfig = getDefaultConfig;
|
|
5745
6132
|
exports.getGuideLineFromCache = getGuideLineFromCache;
|
|
5746
6133
|
exports.getInitPositionStyle = getInitPositionStyle;
|
|
5747
6134
|
exports.getNodeIndex = getNodeIndex;
|
|
5748
6135
|
exports.getPageList = getPageList;
|
|
5749
6136
|
exports.getPageNameList = getPageNameList;
|
|
6137
|
+
exports.getPositionInContainer = getPositionInContainer;
|
|
5750
6138
|
exports.getRelativeStyle = getRelativeStyle;
|
|
5751
6139
|
exports.historyService = historyService;
|
|
5752
6140
|
exports.info = info;
|
|
5753
6141
|
exports.isFixed = isFixed;
|
|
5754
6142
|
exports.log = log;
|
|
5755
6143
|
exports.propsService = propsService;
|
|
6144
|
+
exports.serializeConfig = serializeConfig;
|
|
5756
6145
|
exports.setConfig = setConfig;
|
|
5757
6146
|
exports.setLayout = setLayout;
|
|
5758
6147
|
exports.storageService = storageService;
|