@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/tmagic-editor.js +800 -514
  2. package/dist/tmagic-editor.js.map +1 -1
  3. package/dist/tmagic-editor.umd.cjs +801 -514
  4. package/dist/tmagic-editor.umd.cjs.map +1 -1
  5. package/package.json +17 -18
  6. package/src/Editor.vue +1 -1
  7. package/src/components/CodeDraftEditor.vue +5 -1
  8. package/src/components/ContentMenu.vue +5 -1
  9. package/src/components/FunctionEditor.vue +6 -1
  10. package/src/components/Icon.vue +5 -1
  11. package/src/components/Layout.vue +5 -1
  12. package/src/components/ScrollBar.vue +5 -1
  13. package/src/components/ScrollViewer.vue +5 -1
  14. package/src/components/SearchInput.vue +4 -0
  15. package/src/components/ToolButton.vue +5 -1
  16. package/src/fields/Code.vue +5 -1
  17. package/src/fields/CodeLink.vue +5 -1
  18. package/src/fields/CodeSelect.vue +8 -2
  19. package/src/fields/CodeSelectCol.vue +6 -2
  20. package/src/fields/DataSourceFields.vue +4 -0
  21. package/src/fields/DataSourceInput.vue +357 -0
  22. package/src/fields/EventSelect.vue +9 -3
  23. package/src/fields/KeyValue.vue +4 -0
  24. package/src/fields/UISelect.vue +5 -1
  25. package/src/icons/AppManageIcon.vue +5 -1
  26. package/src/icons/CodeIcon.vue +5 -1
  27. package/src/index.ts +3 -0
  28. package/src/layouts/AddPageBox.vue +5 -1
  29. package/src/layouts/CodeEditor.vue +5 -1
  30. package/src/layouts/Framework.vue +5 -1
  31. package/src/layouts/NavMenu.vue +5 -1
  32. package/src/layouts/PropsPanel.vue +5 -1
  33. package/src/layouts/Resizer.vue +5 -1
  34. package/src/layouts/sidebar/ComponentListPanel.vue +5 -1
  35. package/src/layouts/sidebar/LayerMenu.vue +5 -1
  36. package/src/layouts/sidebar/LayerPanel.vue +5 -1
  37. package/src/layouts/sidebar/Sidebar.vue +11 -7
  38. package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +5 -1
  39. package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -1
  40. package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +4 -0
  41. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +4 -0
  42. package/src/layouts/workspace/Breadcrumb.vue +5 -1
  43. package/src/layouts/workspace/PageBar.vue +5 -1
  44. package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
  45. package/src/layouts/workspace/Stage.vue +5 -1
  46. package/src/layouts/workspace/ViewerMenu.vue +5 -1
  47. package/src/layouts/workspace/Workspace.vue +5 -1
  48. package/types/Editor.vue.d.ts +1 -1
  49. package/types/components/CodeDraftEditor.vue.d.ts +6 -3
  50. package/types/components/ContentMenu.vue.d.ts +8 -5
  51. package/types/components/FunctionEditor.vue.d.ts +66 -45
  52. package/types/components/Icon.vue.d.ts +2 -2
  53. package/types/components/Layout.vue.d.ts +9 -6
  54. package/types/components/ScrollBar.vue.d.ts +1 -1
  55. package/types/components/ScrollViewer.vue.d.ts +8 -5
  56. package/types/components/SearchInput.vue.d.ts +1 -1
  57. package/types/components/ToolButton.vue.d.ts +8 -5
  58. package/types/fields/Code.vue.d.ts +1 -1
  59. package/types/fields/CodeLink.vue.d.ts +9 -9
  60. package/types/fields/CodeSelect.vue.d.ts +10 -7
  61. package/types/fields/CodeSelectCol.vue.d.ts +8 -5
  62. package/types/fields/DataSourceFields.vue.d.ts +8 -5
  63. package/types/fields/DataSourceInput.vue.d.ts +54 -0
  64. package/types/fields/EventSelect.vue.d.ts +3 -3
  65. package/types/fields/KeyValue.vue.d.ts +8 -5
  66. package/types/fields/UISelect.vue.d.ts +1 -1
  67. package/types/icons/AppManageIcon.vue.d.ts +1 -1
  68. package/types/icons/CodeIcon.vue.d.ts +1 -1
  69. package/types/index.d.ts +1 -0
  70. package/types/layouts/AddPageBox.vue.d.ts +1 -1
  71. package/types/layouts/CodeEditor.vue.d.ts +7 -4
  72. package/types/layouts/Framework.vue.d.ts +13 -10
  73. package/types/layouts/NavMenu.vue.d.ts +7 -4
  74. package/types/layouts/PropsPanel.vue.d.ts +2 -2
  75. package/types/layouts/Resizer.vue.d.ts +2 -2
  76. package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
  77. package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
  78. package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
  79. package/types/layouts/sidebar/Sidebar.vue.d.ts +18 -15
  80. package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +4 -4
  81. package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -7
  82. package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +1 -1
  83. package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +3 -3
  84. package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
  85. package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
  86. package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
  87. package/types/layouts/workspace/Stage.vue.d.ts +2 -2
  88. package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
  89. package/types/layouts/workspace/Workspace.vue.d.ts +8 -8
@@ -1,9 +1,9 @@
1
- import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeStyle, unref, reactive, watch, createElementBlock, normalizeClass, createVNode, withCtx, createElementVNode, resolveDynamicComponent, toRaw, inject, ref, createTextVNode, Fragment, renderList, watchEffect, withModifiers, createCommentVNode, toDisplayString, onMounted, onUnmounted, renderSlot, createSlots, normalizeProps, mergeProps, markRaw, getCurrentInstance, createStaticVNode, withDirectives, Teleport, vShow, nextTick, toHandlers, provide } from 'vue';
1
+ import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeStyle, reactive, watch, createElementBlock, normalizeClass, createVNode, unref, withCtx, createElementVNode, resolveDynamicComponent, toRaw, inject, ref, createTextVNode, mergeProps, toDisplayString, Fragment, renderList, createCommentVNode, nextTick, watchEffect, withModifiers, onMounted, onUnmounted, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, createStaticVNode, withDirectives, Teleport, vShow, toHandlers, provide } from 'vue';
2
2
  import serialize from 'serialize-javascript';
3
3
  import { isEmpty, map, has, throttle, cloneDeep, mergeWith, isObject, uniq, forIn, difference, union, pick, keys } from 'lodash-es';
4
- import { TMagicCard, TMagicIcon, TMagicButton, tMagicMessageBox, TMagicInput, TMagicTooltip, TMagicScrollbar, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, tMagicMessage, TMagicDrawer, TMagicTree, TMagicCollapse, TMagicCollapseItem, getConfig as getConfig$1, TMagicPopover } from '@tmagic/design';
4
+ import { TMagicCard, TMagicIcon, TMagicButton, tMagicMessageBox, getConfig as getConfig$1, TMagicTag, TMagicInput, TMagicTooltip, TMagicScrollbar, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, tMagicMessage, TMagicDrawer, TMagicTree, TMagicCollapse, TMagicCollapseItem, TMagicPopover } from '@tmagic/design';
5
5
  import { HookType, ActionType, NodeType } from '@tmagic/schema';
6
- import { Edit, View, Delete, Plus, Close, ArrowDown, Grid, Memo, FullScreen, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Coin, Aim, Files, CopyDocument, Goods, List, EditPen, ArrowLeftBold, ArrowRightBold, CaretBottom, DocumentCopy, Top, Bottom } from '@element-plus/icons-vue';
6
+ import { Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, FullScreen, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, Files, CopyDocument, Goods, List, EditPen, ArrowLeftBold, ArrowRightBold, CaretBottom, DocumentCopy, Top, Bottom } from '@element-plus/icons-vue';
7
7
  import { createValues, MFormDialog, MForm } from '@tmagic/form';
8
8
  import { MagicTable } from '@tmagic/table';
9
9
  import * as monaco from 'monaco-editor';
@@ -14,16 +14,16 @@ import StageCore, { GuidesType, getOffset, calcValueByFontsize, CONTAINER_HIGHLI
14
14
  import { EventEmitter } from 'events';
15
15
  import { DEFAULT_EVENTS, DEFAULT_METHODS } from '@tmagic/core';
16
16
 
17
- const __default__$w = defineComponent({
18
- name: "MEditorCode"
19
- });
20
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
21
- ...__default__$w,
17
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
18
+ ...{
19
+ name: "MEditorCode"
20
+ },
21
+ __name: "Code",
22
22
  props: {
23
- model: null,
24
- name: null,
25
- config: null,
26
- prop: null
23
+ model: {},
24
+ name: {},
25
+ config: {},
26
+ prop: {}
27
27
  },
28
28
  emits: ["change"],
29
29
  setup(__props, { emit }) {
@@ -37,26 +37,26 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
37
37
  return (_ctx, _cache) => {
38
38
  const _component_magic_code_editor = resolveComponent("magic-code-editor");
39
39
  return openBlock(), createBlock(_component_magic_code_editor, {
40
- style: normalizeStyle(`height: ${unref(height)}`),
41
- "init-values": __props.model[__props.name],
42
- language: unref(language),
43
- options: __props.config.options,
40
+ style: normalizeStyle(`height: ${height.value}`),
41
+ "init-values": _ctx.model[_ctx.name],
42
+ language: language.value,
43
+ options: _ctx.config.options,
44
44
  onSave: save
45
45
  }, null, 8, ["style", "init-values", "language", "options"]);
46
46
  };
47
47
  }
48
48
  });
49
49
 
50
- const __default__$v = defineComponent({
51
- name: "MEditorCodeLink"
52
- });
53
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
54
- ...__default__$v,
50
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
51
+ ...{
52
+ name: "MEditorCodeLink"
53
+ },
54
+ __name: "CodeLink",
55
55
  props: {
56
- config: null,
57
- model: null,
58
- name: null,
59
- prop: null
56
+ config: {},
57
+ model: {},
58
+ name: {},
59
+ prop: {}
60
60
  },
61
61
  emits: ["change"],
62
62
  setup(__props, { emit }) {
@@ -111,7 +111,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
111
111
  return (_ctx, _cache) => {
112
112
  const _component_m_fields_link = resolveComponent("m-fields-link");
113
113
  return openBlock(), createBlock(_component_m_fields_link, {
114
- config: unref(formConfig),
114
+ config: formConfig.value,
115
115
  model: modelValue,
116
116
  name: "form",
117
117
  onChange: changeHandler
@@ -120,17 +120,17 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
120
120
  }
121
121
  });
122
122
 
123
- const __default__$u = defineComponent({
124
- name: "MEditorCodeSelect"
125
- });
126
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
127
- ...__default__$u,
123
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
124
+ ...{
125
+ name: "MEditorCodeSelect"
126
+ },
127
+ __name: "CodeSelect",
128
128
  props: {
129
- config: null,
130
- model: null,
131
- prop: null,
132
- name: null,
133
- size: null
129
+ config: {},
130
+ model: {},
131
+ prop: {},
132
+ name: {},
133
+ size: {}
134
134
  },
135
135
  emits: ["change"],
136
136
  setup(__props, { emit }) {
@@ -139,6 +139,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
139
139
  type: "group-list",
140
140
  name: "hookData",
141
141
  enableToggleMode: false,
142
+ expandAll: true,
143
+ titleKey: "codeId",
142
144
  items: [
143
145
  {
144
146
  type: "code-select-col",
@@ -166,13 +168,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
166
168
  return (_ctx, _cache) => {
167
169
  const _component_m_form_container = resolveComponent("m-form-container");
168
170
  return openBlock(), createElementBlock("div", {
169
- class: normalizeClass(["m-fields-code-select", __props.config.className])
171
+ class: normalizeClass(["m-fields-code-select", _ctx.config.className])
170
172
  }, [
171
173
  createVNode(unref(TMagicCard), null, {
172
174
  default: withCtx(() => [
173
175
  createVNode(_component_m_form_container, {
174
- config: unref(codeConfig),
175
- model: __props.model[__props.name],
176
+ config: codeConfig.value,
177
+ model: _ctx.model[_ctx.name],
176
178
  onChange: changeHandler
177
179
  }, null, 8, ["config", "model"])
178
180
  ]),
@@ -183,18 +185,18 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
183
185
  }
184
186
  });
185
187
 
186
- const _hoisted_1$n = ["src"];
187
- const __default__$t = defineComponent({
188
- name: "MEditorIcon"
189
- });
190
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
191
- ...__default__$t,
188
+ const _hoisted_1$m = ["src"];
189
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
190
+ ...{
191
+ name: "MEditorIcon"
192
+ },
193
+ __name: "Icon",
192
194
  props: {
193
- icon: null
195
+ icon: {}
194
196
  },
195
197
  setup(__props) {
196
198
  return (_ctx, _cache) => {
197
- return !__props.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
199
+ return !_ctx.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
198
200
  key: 0,
199
201
  class: "magic-editor-icon"
200
202
  }, {
@@ -202,23 +204,23 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
202
204
  createVNode(unref(Edit))
203
205
  ]),
204
206
  _: 1
205
- })) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (openBlock(), createBlock(unref(TMagicIcon), {
207
+ })) : typeof _ctx.icon === "string" && _ctx.icon.startsWith("http") ? (openBlock(), createBlock(unref(TMagicIcon), {
206
208
  key: 1,
207
209
  class: "magic-editor-icon"
208
210
  }, {
209
211
  default: withCtx(() => [
210
- createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$n)
212
+ createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$m)
211
213
  ]),
212
214
  _: 1
213
- })) : typeof __props.icon === "string" ? (openBlock(), createElementBlock("i", {
215
+ })) : typeof _ctx.icon === "string" ? (openBlock(), createElementBlock("i", {
214
216
  key: 2,
215
- class: normalizeClass(["magic-editor-icon", __props.icon])
217
+ class: normalizeClass(["magic-editor-icon", _ctx.icon])
216
218
  }, null, 2)) : (openBlock(), createBlock(unref(TMagicIcon), {
217
219
  key: 3,
218
220
  class: "magic-editor-icon"
219
221
  }, {
220
222
  default: withCtx(() => [
221
- (openBlock(), createBlock(resolveDynamicComponent(toRaw(__props.icon))))
223
+ (openBlock(), createBlock(resolveDynamicComponent(toRaw(_ctx.icon))))
222
224
  ]),
223
225
  _: 1
224
226
  }));
@@ -226,19 +228,19 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
226
228
  }
227
229
  });
228
230
 
229
- const _hoisted_1$m = { class: "m-fields-code-select-col" };
231
+ const _hoisted_1$l = { class: "m-fields-code-select-col" };
230
232
  const _hoisted_2$e = { class: "code-select-container" };
231
- const __default__$s = defineComponent({
232
- name: "MEditorCodeSelectCol"
233
- });
234
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
235
- ...__default__$s,
233
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
234
+ ...{
235
+ name: "MEditorCodeSelectCol"
236
+ },
237
+ __name: "CodeSelectCol",
236
238
  props: {
237
- config: null,
238
- model: null,
239
- prop: null,
240
- name: null,
241
- size: null
239
+ config: {},
240
+ model: {},
241
+ prop: {},
242
+ name: {},
243
+ size: {}
242
244
  },
243
245
  emits: ["change"],
244
246
  setup(__props, { emit }) {
@@ -320,23 +322,23 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
320
322
  };
321
323
  return (_ctx, _cache) => {
322
324
  const _component_m_form_container = resolveComponent("m-form-container");
323
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
325
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
324
326
  createElementVNode("div", _hoisted_2$e, [
325
327
  createVNode(_component_m_form_container, {
326
328
  class: "select",
327
329
  config: selectConfig,
328
- model: __props.model,
330
+ model: _ctx.model,
329
331
  onChange: onParamsChangeHandler
330
332
  }, null, 8, ["model"]),
331
- createVNode(_sfc_main$A, {
333
+ createVNode(_sfc_main$B, {
332
334
  class: "icon",
333
- icon: unref(editable) ? unref(Edit) : unref(View),
335
+ icon: editable.value ? unref(Edit) : unref(View),
334
336
  onClick: editCode
335
337
  }, null, 8, ["icon"])
336
338
  ]),
337
339
  createVNode(_component_m_form_container, {
338
340
  config: codeParamsConfig.value,
339
- model: __props.model,
341
+ model: _ctx.model,
340
342
  onChange: onParamsChangeHandler
341
343
  }, null, 8, ["config", "model"])
342
344
  ]);
@@ -344,17 +346,19 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
344
346
  }
345
347
  });
346
348
 
347
- const _hoisted_1$l = { class: "m-editor-data-source-fields" };
349
+ const _hoisted_1$k = { class: "m-editor-data-source-fields" };
348
350
  const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
349
- const _hoisted_3$8 = /* @__PURE__ */ createTextVNode("添加");
350
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
351
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
352
+ ...{
353
+ name: "MEditorDataSourceFields"
354
+ },
351
355
  __name: "DataSourceFields",
352
356
  props: {
353
- config: null,
354
- model: null,
355
- prop: null,
357
+ config: {},
358
+ model: {},
359
+ prop: {},
356
360
  disabled: { type: Boolean, default: false },
357
- name: null
361
+ name: {}
358
362
  },
359
363
  emits: ["change"],
360
364
  setup(__props, { emit }) {
@@ -490,21 +494,21 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
490
494
  }
491
495
  ];
492
496
  return (_ctx, _cache) => {
493
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
497
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
494
498
  createVNode(unref(MagicTable), {
495
- data: __props.model[__props.name],
499
+ data: _ctx.model[_ctx.name],
496
500
  columns: filedColumns
497
501
  }, null, 8, ["data"]),
498
502
  createElementVNode("div", _hoisted_2$d, [
499
503
  createVNode(unref(TMagicButton), {
500
504
  size: "small",
501
505
  type: "primary",
502
- disabled: __props.disabled,
506
+ disabled: _ctx.disabled,
503
507
  plain: "",
504
508
  onClick: _cache[0] || (_cache[0] = ($event) => newHandler())
505
509
  }, {
506
510
  default: withCtx(() => [
507
- _hoisted_3$8
511
+ createTextVNode("添加")
508
512
  ]),
509
513
  _: 1
510
514
  }, 8, ["disabled"])
@@ -515,7 +519,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
515
519
  title: filedTitle.value,
516
520
  config: dataSourceFieldsConfig,
517
521
  values: fieldValues.value,
518
- parentValues: __props.model[__props.name],
522
+ parentValues: _ctx.model[_ctx.name],
519
523
  onSubmit: fieldChange
520
524
  }, null, 8, ["title", "values", "parentValues"])
521
525
  ]);
@@ -523,23 +527,287 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
523
527
  }
524
528
  });
525
529
 
526
- const _hoisted_1$k = { class: "m-fields-event-select" };
527
- const _hoisted_2$c = {
530
+ const _hoisted_1$j = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
531
+ const _hoisted_2$c = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
532
+ const _hoisted_3$5 = { class: "el-input__inner" };
533
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
534
+ ...{
535
+ name: "MEditorDataSourceInput"
536
+ },
537
+ __name: "DataSourceInput",
538
+ props: {
539
+ config: {},
540
+ model: {},
541
+ name: {},
542
+ prop: {},
543
+ disabled: { type: Boolean, default: false },
544
+ lastValues: {},
545
+ size: {}
546
+ },
547
+ emits: ["change"],
548
+ setup(__props, { emit }) {
549
+ const props = __props;
550
+ const { dataSourceService } = inject("services") || {};
551
+ const autocomplete = ref();
552
+ const isFocused = ref(false);
553
+ const state = ref("");
554
+ const displayState = ref([]);
555
+ const input = computed(() => autocomplete.value?.inputRef?.input);
556
+ const dataSources = computed(() => dataSourceService?.get("dataSources") || []);
557
+ const setDisplayState = () => {
558
+ displayState.value = [];
559
+ const matches = state.value.matchAll(/\{\{([\s\S]+?)\}\}/g);
560
+ let index = 0;
561
+ for (const match of matches) {
562
+ if (typeof match.index === "undefined")
563
+ break;
564
+ displayState.value.push({
565
+ type: "text",
566
+ value: state.value.substring(index, match.index)
567
+ });
568
+ let dsText = "";
569
+ let ds;
570
+ let fields;
571
+ match[1].split(".").forEach((item, index2) => {
572
+ if (index2 === 0) {
573
+ ds = dataSources.value.find((ds2) => ds2.id === item);
574
+ dsText += ds?.title || item;
575
+ fields = ds?.fields;
576
+ return;
577
+ }
578
+ const field = fields?.find((field2) => field2.name === item);
579
+ fields = field?.fields;
580
+ dsText += `.${field?.title || item}`;
581
+ });
582
+ displayState.value.push({
583
+ type: "var",
584
+ value: dsText
585
+ });
586
+ index = match.index + match[0].length;
587
+ }
588
+ if (index < state.value.length) {
589
+ displayState.value.push({
590
+ type: "text",
591
+ value: state.value.substring(index)
592
+ });
593
+ }
594
+ };
595
+ watch(
596
+ () => props.model[props.name],
597
+ (value = "") => {
598
+ state.value = value;
599
+ setDisplayState();
600
+ },
601
+ { immediate: true }
602
+ );
603
+ const mouseupHandler = async () => {
604
+ isFocused.value = true;
605
+ await nextTick();
606
+ autocomplete.value?.focus();
607
+ };
608
+ const blurHandler = () => {
609
+ isFocused.value = false;
610
+ setDisplayState();
611
+ };
612
+ const changeHandler = (v) => {
613
+ emit("change", v);
614
+ };
615
+ let inputText = "";
616
+ const inputHandler = (v) => {
617
+ if (!v) {
618
+ inputText = v;
619
+ }
620
+ };
621
+ const isRightCurlyBracket = (selectionStart = 0) => {
622
+ const lastChar = inputText.substring(selectionStart - 1, selectionStart);
623
+ return lastChar === "}";
624
+ };
625
+ const getSelectionStart = () => {
626
+ let selectionStart = input.value?.selectionStart || 0;
627
+ if (isRightCurlyBracket(selectionStart)) {
628
+ selectionStart -= 1;
629
+ }
630
+ return selectionStart;
631
+ };
632
+ const curCharIsLeftCurlyBracket = (leftCurlyBracketIndex) => leftCurlyBracketIndex > -1 && leftCurlyBracketIndex === getSelectionStart() - 1;
633
+ const curCharIsDot = (dotIndex) => dotIndex > -1 && dotIndex === getSelectionStart() - 1;
634
+ const dsQuerySearch = (queryString, leftCurlyBracketIndex, cb) => {
635
+ let result = [];
636
+ if (curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
637
+ result = dataSources.value;
638
+ } else if (leftCurlyBracketIndex > -1) {
639
+ const queryName = queryString.substring(leftCurlyBracketIndex + 1).toLowerCase();
640
+ result = dataSources.value.filter((ds) => ds.title?.toLowerCase().includes(queryName) || ds.id.includes(queryName));
641
+ }
642
+ cb(
643
+ result.map((ds) => ({
644
+ value: ds.id,
645
+ text: ds.title,
646
+ type: "dataSource"
647
+ }))
648
+ );
649
+ };
650
+ const fieldQuerySearch = (queryString, leftAngleIndex, dotIndex, cb) => {
651
+ let result = [];
652
+ const dsKey = queryString.substring(leftAngleIndex + 1, dotIndex);
653
+ const keys = dsKey.split(".");
654
+ const ds = dataSources.value.find((ds2) => ds2.id === keys.shift());
655
+ if (!ds) {
656
+ return;
657
+ }
658
+ let fields = ds.fields || [];
659
+ let key = keys.shift();
660
+ while (key) {
661
+ for (const field of fields) {
662
+ if (field.name === key) {
663
+ fields = field.fields || [];
664
+ key = keys.shift();
665
+ break;
666
+ }
667
+ }
668
+ }
669
+ if (curCharIsDot(dotIndex)) {
670
+ result = fields || [];
671
+ } else if (dotIndex > -1) {
672
+ const queryName = queryString.substring(dotIndex + 1).toLowerCase();
673
+ result = fields.filter(
674
+ (field) => field.name?.toLowerCase().includes(queryName) || field.title?.toLowerCase().includes(queryName)
675
+ ) || [];
676
+ }
677
+ cb(
678
+ result.map((field) => ({
679
+ value: field.name,
680
+ text: field.title,
681
+ type: "field"
682
+ }))
683
+ );
684
+ };
685
+ const querySearch = (queryString, cb) => {
686
+ inputText = queryString;
687
+ const selectionStart = getSelectionStart();
688
+ const curQueryString = queryString.substring(0, selectionStart);
689
+ const fieldKeyStringLastIndex = curQueryString.lastIndexOf(".");
690
+ const dsKeyStringLastIndex = curQueryString.lastIndexOf("{");
691
+ const isFieldTip = fieldKeyStringLastIndex > dsKeyStringLastIndex;
692
+ if (isFieldTip) {
693
+ fieldQuerySearch(curQueryString, dsKeyStringLastIndex, fieldKeyStringLastIndex, cb);
694
+ } else {
695
+ dsQuerySearch(curQueryString, dsKeyStringLastIndex, cb);
696
+ }
697
+ };
698
+ const selectHandler = async ({ value, type }) => {
699
+ const isDataSource = type === "dataSource";
700
+ const selectionStart = input.value?.selectionStart || 0;
701
+ let startText = inputText.substring(0, selectionStart);
702
+ const dotIndex = startText.lastIndexOf(".");
703
+ const leftCurlyBracketIndex = startText.lastIndexOf("{");
704
+ const endText = inputText.substring(selectionStart);
705
+ let suggestText = value;
706
+ if (isDataSource) {
707
+ if (!curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
708
+ startText = startText.substring(0, leftCurlyBracketIndex + 1);
709
+ }
710
+ if (!isRightCurlyBracket(selectionStart + 1)) {
711
+ suggestText = `${suggestText}}`;
712
+ }
713
+ suggestText = `{${suggestText}}`;
714
+ } else if (!curCharIsDot(dotIndex)) {
715
+ startText = startText.substring(0, dotIndex + 1);
716
+ }
717
+ state.value = `${startText}${suggestText}${endText}`;
718
+ await nextTick();
719
+ let newSelectionStart = 0;
720
+ if (isDataSource) {
721
+ newSelectionStart = leftCurlyBracketIndex + suggestText.length - 1;
722
+ } else {
723
+ newSelectionStart = dotIndex + suggestText.length + 1;
724
+ }
725
+ input.value?.setSelectionRange(newSelectionStart, newSelectionStart);
726
+ };
727
+ return (_ctx, _cache) => {
728
+ return _ctx.disabled || isFocused.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(getConfig$1)("components")?.autocomplete.component || "el-autocomplete"), mergeProps(
729
+ {
730
+ key: 0,
731
+ class: "tmagic-design-auto-complete",
732
+ ref_key: "autocomplete",
733
+ ref: autocomplete,
734
+ modelValue: state.value,
735
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
736
+ },
737
+ unref(getConfig$1)("components")?.autocomplete.props({
738
+ disabled: _ctx.disabled,
739
+ size: _ctx.size,
740
+ fetchSuggestions: querySearch,
741
+ triggerOnFocus: false,
742
+ clearable: true
743
+ }) || {},
744
+ {
745
+ style: { "width": "100%" },
746
+ onBlur: blurHandler,
747
+ onChange: changeHandler,
748
+ onInput: inputHandler,
749
+ onSelect: selectHandler
750
+ }
751
+ ), {
752
+ suffix: withCtx(() => [
753
+ createVNode(_sfc_main$B, { icon: unref(Coin) }, null, 8, ["icon"])
754
+ ]),
755
+ default: withCtx(({ item }) => [
756
+ createElementVNode("div", _hoisted_1$j, [
757
+ createElementVNode("div", null, toDisplayString(item.text), 1),
758
+ createElementVNode("span", _hoisted_2$c, toDisplayString(item.value), 1)
759
+ ])
760
+ ]),
761
+ _: 1
762
+ }, 16, ["modelValue"])) : (openBlock(), createElementBlock("div", {
763
+ key: 1,
764
+ class: normalizeClass(`el-input el-input--${_ctx.size}`),
765
+ onMouseup: mouseupHandler
766
+ }, [
767
+ createElementVNode("div", {
768
+ class: normalizeClass(`el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
769
+ }, [
770
+ createElementVNode("div", _hoisted_3$5, [
771
+ (openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
772
+ return openBlock(), createElementBlock(Fragment, null, [
773
+ item.type === "text" ? (openBlock(), createElementBlock("span", {
774
+ key: index,
775
+ style: { "margin-right": "2px" }
776
+ }, toDisplayString(item.value), 1)) : createCommentVNode("", true),
777
+ item.type === "var" ? (openBlock(), createBlock(unref(TMagicTag), {
778
+ key: index,
779
+ size: _ctx.size
780
+ }, {
781
+ default: withCtx(() => [
782
+ createTextVNode(toDisplayString(item.value), 1)
783
+ ]),
784
+ _: 2
785
+ }, 1032, ["size"])) : createCommentVNode("", true)
786
+ ], 64);
787
+ }), 256))
788
+ ])
789
+ ], 2)
790
+ ], 34));
791
+ };
792
+ }
793
+ });
794
+
795
+ const _hoisted_1$i = { class: "m-fields-event-select" };
796
+ const _hoisted_2$b = {
528
797
  key: 1,
529
798
  class: "fullWidth"
530
799
  };
531
- const _hoisted_3$7 = /* @__PURE__ */ createTextVNode("添加事件");
532
- const __default__$r = defineComponent({
533
- name: "MEditorEventSelect"
534
- });
535
800
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
536
- ...__default__$r,
801
+ ...{
802
+ name: "MEditorEventSelect"
803
+ },
804
+ __name: "EventSelect",
537
805
  props: {
538
- config: null,
539
- model: null,
540
- prop: null,
541
- name: null,
542
- size: null
806
+ config: {},
807
+ model: {},
808
+ prop: {},
809
+ name: {},
810
+ size: {}
543
811
  },
544
812
  emits: ["change"],
545
813
  setup(__props, { emit }) {
@@ -656,6 +924,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
656
924
  {
657
925
  type: "group-list",
658
926
  name: "actions",
927
+ expandAll: true,
659
928
  enableToggleMode: false,
660
929
  items: [actionTypeConfig.value, targetCompConfig.value, compActionConfig.value, codeActionConfig.value]
661
930
  }
@@ -690,16 +959,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
690
959
  const _component_m_form_table = resolveComponent("m-form-table");
691
960
  const _component_m_form_container = resolveComponent("m-form-container");
692
961
  const _component_m_form_panel = resolveComponent("m-form-panel");
693
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
694
- unref(isOldVersion) ? (openBlock(), createBlock(_component_m_form_table, {
962
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
963
+ isOldVersion.value ? (openBlock(), createBlock(_component_m_form_table, {
695
964
  key: 0,
696
965
  ref: "eventForm",
697
966
  size: props.size,
698
- model: __props.model,
967
+ model: _ctx.model,
699
968
  name: "events",
700
- config: unref(tableConfig),
969
+ config: tableConfig.value,
701
970
  onChange: onChangeHandler
702
- }, null, 8, ["size", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$c, [
971
+ }, null, 8, ["size", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$b, [
703
972
  createVNode(unref(TMagicButton), {
704
973
  class: "create-button",
705
974
  type: "primary",
@@ -707,21 +976,21 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
707
976
  onClick: _cache[0] || (_cache[0] = ($event) => addEvent())
708
977
  }, {
709
978
  default: withCtx(() => [
710
- _hoisted_3$7
979
+ createTextVNode("添加事件")
711
980
  ]),
712
981
  _: 1
713
982
  }),
714
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.model[__props.name], (cardItem, index) => {
983
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model[_ctx.name], (cardItem, index) => {
715
984
  return openBlock(), createBlock(_component_m_form_panel, {
716
985
  key: index,
717
- config: unref(actionsConfig),
986
+ config: actionsConfig.value,
718
987
  model: cardItem,
719
988
  onChange: onChangeHandler
720
989
  }, {
721
990
  header: withCtx(() => [
722
991
  createVNode(_component_m_form_container, {
723
992
  class: "fullWidth",
724
- config: unref(eventNameConfig),
993
+ config: eventNameConfig.value,
725
994
  model: cardItem,
726
995
  onChange: onChangeHandler
727
996
  }, null, 8, ["config", "model"]),
@@ -741,19 +1010,21 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
741
1010
  }
742
1011
  });
743
1012
 
744
- const _hoisted_1$j = { class: "m-fields-key-value" };
745
- const _hoisted_2$b = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
746
- const _hoisted_3$6 = /* @__PURE__ */ createTextVNode("添加");
1013
+ const _hoisted_1$h = { class: "m-fields-key-value" };
1014
+ const _hoisted_2$a = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
747
1015
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
1016
+ ...{
1017
+ name: "MEditorKeyValue"
1018
+ },
748
1019
  __name: "KeyValue",
749
1020
  props: {
750
- config: null,
751
- model: null,
752
- name: null,
753
- prop: null,
1021
+ config: {},
1022
+ model: {},
1023
+ name: {},
1024
+ prop: {},
754
1025
  disabled: { type: Boolean, default: false },
755
- lastValues: null,
756
- size: null
1026
+ lastValues: {},
1027
+ size: {}
757
1028
  },
758
1029
  emits: ["change"],
759
1030
  setup(__props, { emit }) {
@@ -784,7 +1055,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
784
1055
  records.value.splice(index, 1);
785
1056
  };
786
1057
  return (_ctx, _cache) => {
787
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
1058
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
788
1059
  (openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
789
1060
  return openBlock(), createElementBlock("div", {
790
1061
  class: "m-fields-key-value-item",
@@ -794,23 +1065,23 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
794
1065
  placeholder: "key",
795
1066
  modelValue: records.value[index][0],
796
1067
  "onUpdate:modelValue": ($event) => records.value[index][0] = $event,
797
- disabled: __props.disabled,
798
- size: __props.size,
1068
+ disabled: _ctx.disabled,
1069
+ size: _ctx.size,
799
1070
  onChange: keyChangeHandler
800
1071
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
801
- _hoisted_2$b,
1072
+ _hoisted_2$a,
802
1073
  createVNode(unref(TMagicInput), {
803
1074
  placeholder: "value",
804
1075
  modelValue: records.value[index][1],
805
1076
  "onUpdate:modelValue": ($event) => records.value[index][1] = $event,
806
- disabled: __props.disabled,
807
- size: __props.size,
1077
+ disabled: _ctx.disabled,
1078
+ size: _ctx.size,
808
1079
  onChange: valueChangeHandler
809
1080
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
810
1081
  createVNode(unref(TMagicButton), {
811
1082
  class: "m-fileds-key-value-delete",
812
1083
  type: "danger",
813
- size: __props.size,
1084
+ size: _ctx.size,
814
1085
  circle: "",
815
1086
  plain: "",
816
1087
  icon: unref(Delete),
@@ -820,13 +1091,13 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
820
1091
  }), 128)),
821
1092
  createVNode(unref(TMagicButton), {
822
1093
  type: "primary",
823
- size: __props.size,
1094
+ size: _ctx.size,
824
1095
  plain: "",
825
1096
  icon: unref(Plus),
826
1097
  onClick: addHandler
827
1098
  }, {
828
1099
  default: withCtx(() => [
829
- _hoisted_3$6
1100
+ createTextVNode("添加")
830
1101
  ]),
831
1102
  _: 1
832
1103
  }, 8, ["size", "icon"])
@@ -835,17 +1106,16 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
835
1106
  }
836
1107
  });
837
1108
 
838
- const _hoisted_1$i = /* @__PURE__ */ createTextVNode("取消");
839
- const __default__$q = defineComponent({
840
- name: "MEditorUISelect"
841
- });
842
1109
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
843
- ...__default__$q,
1110
+ ...{
1111
+ name: "MEditorUISelect"
1112
+ },
1113
+ __name: "UISelect",
844
1114
  props: {
845
- config: null,
846
- model: null,
847
- prop: null,
848
- name: null
1115
+ config: {},
1116
+ model: {},
1117
+ prop: {},
1118
+ name: {}
849
1119
  },
850
1120
  emits: ["change"],
851
1121
  setup(__props, { emit }) {
@@ -902,7 +1172,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
902
1172
  style: { "padding": "0" }
903
1173
  }, {
904
1174
  default: withCtx(() => [
905
- _hoisted_1$i
1175
+ createTextVNode("取消")
906
1176
  ]),
907
1177
  _: 1
908
1178
  }, 8, ["icon"])
@@ -912,7 +1182,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
912
1182
  onClick: startSelect,
913
1183
  style: { "display": "flex" }
914
1184
  }, [
915
- unref(val) ? (openBlock(), createBlock(unref(TMagicTooltip), {
1185
+ val.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
916
1186
  key: 0,
917
1187
  content: "清除"
918
1188
  }, {
@@ -928,7 +1198,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
928
1198
  _: 1
929
1199
  })) : createCommentVNode("", true),
930
1200
  createVNode(unref(TMagicTooltip), {
931
- content: unref(val) ? unref(toName) + "_" + unref(val) : "点击此处选择"
1201
+ content: val.value ? toName.value + "_" + val.value : "点击此处选择"
932
1202
  }, {
933
1203
  default: withCtx(() => [
934
1204
  createVNode(unref(TMagicButton), {
@@ -936,7 +1206,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
936
1206
  style: { "padding": "0", "margin": "0" }
937
1207
  }, {
938
1208
  default: withCtx(() => [
939
- createTextVNode(toDisplayString(unref(val) ? unref(toName) + "_" + unref(val) : "点击此处选择"), 1)
1209
+ createTextVNode(toDisplayString(val.value ? toName.value + "_" + val.value : "点击此处选择"), 1)
940
1210
  ]),
941
1211
  _: 1
942
1212
  })
@@ -950,15 +1220,15 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
950
1220
 
951
1221
  const UISelect_vue_vue_type_style_index_0_lang = '';
952
1222
 
953
- const __default__$p = defineComponent({
954
- name: "MEditorCodeEditor"
955
- });
956
1223
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
957
- ...__default__$p,
1224
+ ...{
1225
+ name: "MEditorCodeEditor"
1226
+ },
1227
+ __name: "CodeEditor",
958
1228
  props: {
959
- initValues: null,
960
- modifiedValues: null,
961
- type: null,
1229
+ initValues: {},
1230
+ modifiedValues: {},
1231
+ type: {},
962
1232
  language: { default: "javascript" },
963
1233
  options: { default: () => ({
964
1234
  tabSize: 2
@@ -966,7 +1236,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
966
1236
  autoSave: { type: Boolean, default: true }
967
1237
  },
968
1238
  emits: ["initd", "save"],
969
- setup(__props, { expose, emit }) {
1239
+ setup(__props, { expose: __expose, emit }) {
970
1240
  const props = __props;
971
1241
  const toString = (v, language) => {
972
1242
  let value = "";
@@ -1057,7 +1327,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1057
1327
  onUnmounted(() => {
1058
1328
  resizeObserver.disconnect();
1059
1329
  });
1060
- expose({
1330
+ __expose({
1061
1331
  getEditor() {
1062
1332
  return vsEditor || vsDiffEditor;
1063
1333
  },
@@ -1083,11 +1353,11 @@ const setConfig = (option) => {
1083
1353
  };
1084
1354
  const getConfig = (key) => $TMAGIC_EDITOR[key];
1085
1355
 
1086
- const __default__$o = defineComponent({
1087
- name: "MEditorResizer"
1088
- });
1089
1356
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
1090
- ...__default__$o,
1357
+ ...{
1358
+ name: "MEditorResizer"
1359
+ },
1360
+ __name: "Resizer",
1091
1361
  emits: ["change"],
1092
1362
  setup(__props, { emit }) {
1093
1363
  const target = ref();
@@ -1119,20 +1389,20 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
1119
1389
  }
1120
1390
  });
1121
1391
 
1122
- const __default__$n = defineComponent({
1123
- name: "MEditorLayout"
1124
- });
1125
1392
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
1126
- ...__default__$n,
1393
+ ...{
1394
+ name: "MEditorLayout"
1395
+ },
1396
+ __name: "Layout",
1127
1397
  props: {
1128
- left: null,
1129
- right: null,
1398
+ left: {},
1399
+ right: {},
1130
1400
  minLeft: { default: 46 },
1131
1401
  minRight: { default: 1 },
1132
1402
  minCenter: { default: 5 },
1133
- leftClass: null,
1134
- rightClass: null,
1135
- centerClass: null
1403
+ leftClass: {},
1404
+ rightClass: {},
1405
+ centerClass: {}
1136
1406
  },
1137
1407
  emits: ["update:left", "change", "update:right"],
1138
1408
  setup(__props, { emit }) {
@@ -1224,26 +1494,26 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1224
1494
  ref: el,
1225
1495
  class: "m-editor-layout"
1226
1496
  }, [
1227
- unref(hasLeft) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1497
+ hasLeft.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1228
1498
  createElementVNode("div", {
1229
- class: normalizeClass(["m-editor-layout-left", __props.leftClass]),
1230
- style: normalizeStyle(`width: ${__props.left}px`)
1499
+ class: normalizeClass(["m-editor-layout-left", _ctx.leftClass]),
1500
+ style: normalizeStyle(`width: ${_ctx.left}px`)
1231
1501
  }, [
1232
1502
  renderSlot(_ctx.$slots, "left")
1233
1503
  ], 6),
1234
1504
  createVNode(_sfc_main$t, { onChange: changeLeft })
1235
1505
  ], 64)) : createCommentVNode("", true),
1236
1506
  createElementVNode("div", {
1237
- class: normalizeClass(["m-editor-layout-center", __props.centerClass]),
1507
+ class: normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
1238
1508
  style: normalizeStyle(`width: ${center.value}px`)
1239
1509
  }, [
1240
1510
  renderSlot(_ctx.$slots, "center")
1241
1511
  ], 6),
1242
- unref(hasRight) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1512
+ hasRight.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1243
1513
  createVNode(_sfc_main$t, { onChange: changeRight }),
1244
1514
  createElementVNode("div", {
1245
- class: normalizeClass(["m-editor-layout-right", __props.rightClass]),
1246
- style: normalizeStyle(`width: ${__props.right}px`)
1515
+ class: normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
1516
+ style: normalizeStyle(`width: ${_ctx.right}px`)
1247
1517
  }, [
1248
1518
  renderSlot(_ctx.$slots, "right")
1249
1519
  ], 6)
@@ -3107,14 +3377,14 @@ const useStage = (stageOptions) => {
3107
3377
  return stage;
3108
3378
  };
3109
3379
 
3110
- const _hoisted_1$h = { class: "m-editor-empty-panel" };
3111
- const _hoisted_2$a = { class: "m-editor-empty-content" };
3112
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
3113
- const __default__$m = defineComponent({
3114
- name: "MEditorAddPageBox"
3115
- });
3380
+ const _hoisted_1$g = { class: "m-editor-empty-panel" };
3381
+ const _hoisted_2$9 = { class: "m-editor-empty-content" };
3382
+ const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
3116
3383
  const _sfc_main$r = /* @__PURE__ */ defineComponent({
3117
- ...__default__$m,
3384
+ ...{
3385
+ name: "MEditorAddPageBox"
3386
+ },
3387
+ __name: "AddPageBox",
3118
3388
  setup(__props) {
3119
3389
  const services = inject("services");
3120
3390
  const clickHandler = () => {
@@ -3130,16 +3400,16 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3130
3400
  });
3131
3401
  };
3132
3402
  return (_ctx, _cache) => {
3133
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
3134
- createElementVNode("div", _hoisted_2$a, [
3403
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [
3404
+ createElementVNode("div", _hoisted_2$9, [
3135
3405
  createElementVNode("div", {
3136
3406
  class: "m-editor-empty-button",
3137
3407
  onClick: clickHandler
3138
3408
  }, [
3139
3409
  createElementVNode("div", null, [
3140
- createVNode(_sfc_main$A, { icon: unref(Plus) }, null, 8, ["icon"])
3410
+ createVNode(_sfc_main$B, { icon: unref(Plus) }, null, 8, ["icon"])
3141
3411
  ]),
3142
- _hoisted_3$5
3412
+ _hoisted_3$4
3143
3413
  ])
3144
3414
  ])
3145
3415
  ]);
@@ -3147,25 +3417,25 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
3147
3417
  }
3148
3418
  });
3149
3419
 
3150
- const _hoisted_1$g = { class: "m-editor" };
3151
- const __default__$l = defineComponent({
3152
- name: "MEditorFramework"
3153
- });
3420
+ const _hoisted_1$f = { class: "m-editor" };
3421
+ const DEFAULT_LEFT_COLUMN_WIDTH = 310;
3422
+ const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
3423
+ const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
3424
+ const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
3154
3425
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
3155
- ...__default__$l,
3426
+ ...{
3427
+ name: "MEditorFramework"
3428
+ },
3429
+ __name: "Framework",
3156
3430
  props: {
3157
3431
  codeOptions: { default: () => ({}) }
3158
3432
  },
3159
3433
  setup(__props) {
3160
- const DEFAULT_LEFT_COLUMN_WIDTH = 310;
3161
- const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
3162
3434
  const { editorService, uiService } = inject("services") || {};
3163
3435
  const root = computed(() => editorService?.get("root"));
3164
3436
  const nodes = computed(() => editorService?.get("nodes") || []);
3165
3437
  const pageLength = computed(() => editorService?.get("pageLength") || 0);
3166
3438
  const showSrc = computed(() => uiService?.get("showSrc"));
3167
- const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
3168
- const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
3169
3439
  const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
3170
3440
  const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY));
3171
3441
  const columnWidth = ref({
@@ -3221,13 +3491,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3221
3491
  };
3222
3492
  return (_ctx, _cache) => {
3223
3493
  const _component_magic_code_editor = resolveComponent("magic-code-editor");
3224
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
3494
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
3225
3495
  renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
3226
- unref(showSrc) ? (openBlock(), createBlock(_component_magic_code_editor, {
3496
+ showSrc.value ? (openBlock(), createBlock(_component_magic_code_editor, {
3227
3497
  key: 0,
3228
3498
  class: "m-editor-content",
3229
- "init-values": unref(root),
3230
- options: __props.codeOptions,
3499
+ "init-values": root.value,
3500
+ options: _ctx.codeOptions,
3231
3501
  onSave: saveCode
3232
3502
  }, null, 8, ["init-values", "options"])) : (openBlock(), createBlock(_sfc_main$s, {
3233
3503
  key: 1,
@@ -3247,13 +3517,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3247
3517
  renderSlot(_ctx.$slots, "sidebar")
3248
3518
  ]),
3249
3519
  center: withCtx(() => [
3250
- unref(pageLength) > 0 ? renderSlot(_ctx.$slots, "workspace", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
3520
+ pageLength.value > 0 ? renderSlot(_ctx.$slots, "workspace", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
3251
3521
  createVNode(_sfc_main$r)
3252
3522
  ])
3253
3523
  ]),
3254
3524
  _: 2
3255
3525
  }, [
3256
- unref(pageLength) > 0 && unref(nodes).length === 1 ? {
3526
+ pageLength.value > 0 && nodes.value.length === 1 ? {
3257
3527
  name: "right",
3258
3528
  fn: withCtx(() => [
3259
3529
  createVNode(unref(TMagicScrollbar), null, {
@@ -3262,7 +3532,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3262
3532
  ]),
3263
3533
  _: 3
3264
3534
  })
3265
- ])
3535
+ ]),
3536
+ key: "0"
3266
3537
  } : void 0
3267
3538
  ]), 1032, ["left", "right"]))
3268
3539
  ]);
@@ -3270,16 +3541,16 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
3270
3541
  }
3271
3542
  });
3272
3543
 
3273
- const _hoisted_1$f = {
3544
+ const _hoisted_1$e = {
3274
3545
  key: 1,
3275
3546
  class: "menu-item-text"
3276
3547
  };
3277
- const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
3278
- const __default__$k = defineComponent({
3279
- name: "MEditorToolButton"
3280
- });
3548
+ const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
3281
3549
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
3282
- ...__default__$k,
3550
+ ...{
3551
+ name: "MEditorToolButton"
3552
+ },
3553
+ __name: "ToolButton",
3283
3554
  props: {
3284
3555
  data: { default: () => ({
3285
3556
  type: "text",
@@ -3344,35 +3615,35 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3344
3615
  }
3345
3616
  };
3346
3617
  return (_ctx, _cache) => {
3347
- return unref(display) ? (openBlock(), createElementBlock("div", {
3618
+ return display.value ? (openBlock(), createElementBlock("div", {
3348
3619
  key: 0,
3349
- class: normalizeClass(["menu-item", `${__props.data.type} ${__props.data.className || ""}`]),
3350
- onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(__props.data, $event)),
3351
- onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(__props.data, $event)),
3352
- onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(__props.data, $event))
3620
+ class: normalizeClass(["menu-item", `${_ctx.data.type} ${_ctx.data.className || ""}`]),
3621
+ onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(_ctx.data, $event)),
3622
+ onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
3623
+ onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
3353
3624
  }, [
3354
- __props.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
3625
+ _ctx.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
3355
3626
  key: 0,
3356
- direction: __props.data.direction || "vertical"
3357
- }, null, 8, ["direction"])) : __props.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$f, toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3358
- __props.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
3627
+ direction: _ctx.data.direction || "vertical"
3628
+ }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$e, toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3629
+ _ctx.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
3359
3630
  key: 0,
3360
3631
  effect: "dark",
3361
3632
  placement: "bottom-start",
3362
- content: __props.data.tooltip
3633
+ content: _ctx.data.tooltip
3363
3634
  }, {
3364
3635
  default: withCtx(() => [
3365
3636
  createVNode(unref(TMagicButton), {
3366
3637
  size: "small",
3367
3638
  text: "",
3368
- disabled: unref(disabled)
3639
+ disabled: disabled.value
3369
3640
  }, {
3370
3641
  default: withCtx(() => [
3371
- __props.data.icon ? (openBlock(), createBlock(_sfc_main$A, {
3642
+ _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$B, {
3372
3643
  key: 0,
3373
- icon: __props.data.icon
3644
+ icon: _ctx.data.icon
3374
3645
  }, null, 8, ["icon"])) : createCommentVNode("", true),
3375
- createElementVNode("span", null, toDisplayString(__props.data.text), 1)
3646
+ createElementVNode("span", null, toDisplayString(_ctx.data.text), 1)
3376
3647
  ]),
3377
3648
  _: 1
3378
3649
  }, 8, ["disabled"])
@@ -3382,30 +3653,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3382
3653
  key: 1,
3383
3654
  size: "small",
3384
3655
  text: "",
3385
- disabled: unref(disabled)
3656
+ disabled: disabled.value
3386
3657
  }, {
3387
3658
  default: withCtx(() => [
3388
- __props.data.icon ? (openBlock(), createBlock(_sfc_main$A, {
3659
+ _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$B, {
3389
3660
  key: 0,
3390
- icon: __props.data.icon
3661
+ icon: _ctx.data.icon
3391
3662
  }, null, 8, ["icon"])) : createCommentVNode("", true),
3392
- createElementVNode("span", null, toDisplayString(__props.data.text), 1)
3663
+ createElementVNode("span", null, toDisplayString(_ctx.data.text), 1)
3393
3664
  ]),
3394
3665
  _: 1
3395
3666
  }, 8, ["disabled"]))
3396
- ], 64)) : __props.data.type === "dropdown" ? (openBlock(), createBlock(unref(TMagicDropdown), {
3667
+ ], 64)) : _ctx.data.type === "dropdown" ? (openBlock(), createBlock(unref(TMagicDropdown), {
3397
3668
  key: 3,
3398
3669
  trigger: "click",
3399
- disabled: unref(disabled),
3670
+ disabled: disabled.value,
3400
3671
  onCommand: dropdownHandler
3401
3672
  }, {
3402
3673
  dropdown: withCtx(() => [
3403
- __props.data.items && __props.data.items.length ? (openBlock(), createBlock(unref(TMagicDropdownMenu), { key: 0 }, {
3674
+ _ctx.data.items && _ctx.data.items.length ? (openBlock(), createBlock(unref(TMagicDropdownMenu), { key: 0 }, {
3404
3675
  default: withCtx(() => [
3405
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.data.items, (subItem, index) => {
3676
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.items, (subItem, index) => {
3406
3677
  return openBlock(), createBlock(unref(TMagicDropdownItem), {
3407
3678
  key: index,
3408
- command: { data: __props.data, subItem }
3679
+ command: { data: _ctx.data, subItem }
3409
3680
  }, {
3410
3681
  default: withCtx(() => [
3411
3682
  createTextVNode(toDisplayString(subItem.text), 1)
@@ -3418,8 +3689,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3418
3689
  })) : createCommentVNode("", true)
3419
3690
  ]),
3420
3691
  default: withCtx(() => [
3421
- createElementVNode("span", _hoisted_2$9, [
3422
- createTextVNode(toDisplayString(__props.data.text), 1),
3692
+ createElementVNode("span", _hoisted_2$8, [
3693
+ createTextVNode(toDisplayString(_ctx.data.text), 1),
3423
3694
  createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
3424
3695
  default: withCtx(() => [
3425
3696
  createVNode(unref(ArrowDown))
@@ -3429,17 +3700,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3429
3700
  ])
3430
3701
  ]),
3431
3702
  _: 1
3432
- }, 8, ["disabled"])) : __props.data.type === "component" ? (openBlock(), createBlock(resolveDynamicComponent(__props.data.component), normalizeProps(mergeProps({ key: 4 }, __props.data.props || {})), null, 16)) : createCommentVNode("", true)
3703
+ }, 8, ["disabled"])) : _ctx.data.type === "component" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.data.component), normalizeProps(mergeProps({ key: 4 }, _ctx.data.props || {})), null, 16)) : createCommentVNode("", true)
3433
3704
  ], 34)) : createCommentVNode("", true);
3434
3705
  };
3435
3706
  }
3436
3707
  });
3437
3708
 
3438
- const __default__$j = defineComponent({
3439
- name: "MEditorNavMenu"
3440
- });
3441
3709
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
3442
- ...__default__$j,
3710
+ ...{
3711
+ name: "MEditorNavMenu"
3712
+ },
3713
+ __name: "NavMenu",
3443
3714
  props: {
3444
3715
  data: { default: () => ({}) },
3445
3716
  height: { default: 35 }
@@ -3588,15 +3859,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
3588
3859
  return (_ctx, _cache) => {
3589
3860
  return openBlock(), createElementBlock("div", {
3590
3861
  class: "m-editor-nav-menu",
3591
- style: normalizeStyle({ height: `${__props.height}px` })
3862
+ style: normalizeStyle({ height: `${_ctx.height}px` })
3592
3863
  }, [
3593
3864
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys), (key) => {
3594
3865
  return openBlock(), createElementBlock("div", {
3595
3866
  class: normalizeClass(`menu-${key}`),
3596
3867
  key,
3597
- style: normalizeStyle(`width: ${unref(columnWidth)?.[key]}px`)
3868
+ style: normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
3598
3869
  }, [
3599
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(buttons)[key], (item, index) => {
3870
+ (openBlock(true), createElementBlock(Fragment, null, renderList(buttons.value[key], (item, index) => {
3600
3871
  return openBlock(), createBlock(_sfc_main$p, {
3601
3872
  data: item,
3602
3873
  key: index
@@ -3609,14 +3880,14 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
3609
3880
  }
3610
3881
  });
3611
3882
 
3612
- const _hoisted_1$e = { class: "m-editor-props-panel" };
3613
- const __default__$i = defineComponent({
3614
- name: "MEditorPropsPanel"
3615
- });
3883
+ const _hoisted_1$d = { class: "m-editor-props-panel" };
3616
3884
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
3617
- ...__default__$i,
3885
+ ...{
3886
+ name: "MEditorPropsPanel"
3887
+ },
3888
+ __name: "PropsPanel",
3618
3889
  emits: ["mounted"],
3619
- setup(__props, { expose, emit }) {
3890
+ setup(__props, { expose: __expose, emit }) {
3620
3891
  const internalInstance = getCurrentInstance();
3621
3892
  const values = ref({});
3622
3893
  const configForm = ref();
@@ -3657,16 +3928,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3657
3928
  tMagicMessage.error(e.message);
3658
3929
  }
3659
3930
  };
3660
- expose({ submit });
3931
+ __expose({ submit });
3661
3932
  return (_ctx, _cache) => {
3662
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
3933
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
3663
3934
  renderSlot(_ctx.$slots, "props-panel-header"),
3664
3935
  createVNode(unref(MForm), {
3665
3936
  ref_key: "configForm",
3666
3937
  ref: configForm,
3667
- class: normalizeClass(`m-editor-props-panel ${unref(propsPanelSize)}`),
3668
- "popper-class": `m-editor-props-panel-popper ${unref(propsPanelSize)}`,
3669
- size: unref(propsPanelSize),
3938
+ class: normalizeClass(`m-editor-props-panel ${propsPanelSize.value}`),
3939
+ "popper-class": `m-editor-props-panel-popper ${propsPanelSize.value}`,
3940
+ size: propsPanelSize.value,
3670
3941
  "init-values": values.value,
3671
3942
  config: curFormConfig.value,
3672
3943
  onChange: submit
@@ -3677,6 +3948,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3677
3948
  });
3678
3949
 
3679
3950
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
3951
+ ...{
3952
+ name: "MEditorSearchInput"
3953
+ },
3680
3954
  __name: "SearchInput",
3681
3955
  emits: ["search"],
3682
3956
  setup(__props, { emit }) {
@@ -3708,80 +3982,77 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
3708
3982
  }
3709
3983
  });
3710
3984
 
3711
- const _export_sfc = (sfc, props) => {
3712
- const target = sfc.__vccOpts || sfc;
3713
- for (const [key, val] of props) {
3714
- target[key] = val;
3715
- }
3716
- return target;
3717
- };
3718
-
3719
- const _sfc_main$l = {};
3720
-
3721
- const _hoisted_1$d = { xmlns: "http://www.w3.org/2000/svg" };
3722
- const _hoisted_2$8 = /*#__PURE__*/createElementVNode("g", {
3985
+ const _hoisted_1$c = { xmlns: "http://www.w3.org/2000/svg" };
3986
+ const _hoisted_2$7 = /* @__PURE__ */ createElementVNode("g", {
3723
3987
  fill: "#7C878E",
3724
3988
  "fill-rule": "evenodd"
3725
3989
  }, [
3726
- /*#__PURE__*/createElementVNode("path", {
3990
+ /* @__PURE__ */ createElementVNode("path", {
3727
3991
  d: "M15.3,5.5 L8,0 L0.7,5.5 L8,11 L15.3,5.5 Z M8,2.5 L12,5.5 L8,8.5 L4,5.5 L8,2.5 Z",
3728
3992
  "fill-rule": "nonzero"
3729
3993
  }),
3730
- /*#__PURE__*/createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
3994
+ /* @__PURE__ */ createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
3731
3995
  ], -1);
3732
- const _hoisted_3$4 = [
3733
- _hoisted_2$8
3996
+ const _hoisted_3$3 = [
3997
+ _hoisted_2$7
3734
3998
  ];
3999
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
4000
+ ...{
4001
+ name: "MEditorAppManageIcon"
4002
+ },
4003
+ __name: "AppManageIcon",
4004
+ setup(__props) {
4005
+ return (_ctx, _cache) => {
4006
+ return openBlock(), createElementBlock("svg", _hoisted_1$c, _hoisted_3$3);
4007
+ };
4008
+ }
4009
+ });
3735
4010
 
3736
- function _sfc_render$2(_ctx, _cache) {
3737
- return (openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_3$4))
3738
- }
3739
- const AppManageIcon = /*#__PURE__*/_export_sfc(_sfc_main$l, [['render',_sfc_render$2]]);
3740
-
3741
- const _sfc_main$k = {};
3742
-
3743
- const _hoisted_1$c = {
4011
+ const _hoisted_1$b = {
3744
4012
  viewBox: "0 0 32 32",
3745
4013
  version: "1.1",
3746
4014
  xmlns: "http://www.w3.org/2000/svg",
3747
4015
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
3748
4016
  };
3749
- const _hoisted_2$7 = /*#__PURE__*/createStaticVNode("<defs><rect id=\"path-1\" x=\"0\" y=\"0\" width=\"32\" height=\"32\"></rect></defs><g id=\"组件规范\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g id=\"03图标\" transform=\"translate(-561.000000, -2356.000000)\"><g id=\"icon/line/Universal/code\" transform=\"translate(561.000000, 2356.000000)\"><g id=\"路径\"><mask id=\"mask-2\" fill=\"white\"><use xlink:href=\"#path-1\"></use></mask><use id=\"蒙版\" fill=\"#D8D8D8\" opacity=\"0\" xlink:href=\"#path-1\"></use><path d=\"M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z\" id=\"形状\" fill=\"#1D1F24\" mask=\"url(#mask-2)\"></path></g></g><g id=\"icon切图\" transform=\"translate(226.000000, 1782.000000)\"></g></g></g>", 2);
3750
- const _hoisted_4$4 = [
3751
- _hoisted_2$7
4017
+ const _hoisted_2$6 = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
4018
+ const _hoisted_4$3 = [
4019
+ _hoisted_2$6
3752
4020
  ];
4021
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
4022
+ ...{
4023
+ name: "MEditorCodeIcon"
4024
+ },
4025
+ __name: "CodeIcon",
4026
+ setup(__props) {
4027
+ return (_ctx, _cache) => {
4028
+ return openBlock(), createElementBlock("svg", _hoisted_1$b, _hoisted_4$3);
4029
+ };
4030
+ }
4031
+ });
3753
4032
 
3754
- function _sfc_render$1(_ctx, _cache) {
3755
- return (openBlock(), createElementBlock("svg", _hoisted_1$c, _hoisted_4$4))
3756
- }
3757
- const CodeIcon = /*#__PURE__*/_export_sfc(_sfc_main$k, [['render',_sfc_render$1]]);
3758
-
3759
- const _hoisted_1$b = {
4033
+ const _hoisted_1$a = {
3760
4034
  key: 0,
3761
4035
  class: "m-editor-content-bottom"
3762
4036
  };
3763
- const _hoisted_2$6 = /* @__PURE__ */ createTextVNode("确认");
3764
- const _hoisted_3$3 = /* @__PURE__ */ createTextVNode("关闭");
3765
- const _hoisted_4$3 = {
4037
+ const _hoisted_2$5 = {
3766
4038
  key: 1,
3767
4039
  class: "m-editor-content-bottom"
3768
4040
  };
3769
- const _hoisted_5$2 = /* @__PURE__ */ createTextVNode("关闭");
3770
- const __default__$h = defineComponent({
3771
- name: "MEditorCodeDraftEditor"
3772
- });
3773
4041
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
3774
- ...__default__$h,
4042
+ ...{
4043
+ name: "MEditorCodeDraftEditor"
4044
+ },
4045
+ __name: "CodeDraftEditor",
3775
4046
  props: {
3776
- id: null,
3777
- content: null,
4047
+ id: {},
4048
+ content: {},
3778
4049
  editable: { type: Boolean, default: true },
3779
4050
  autoSaveDraft: { type: Boolean, default: true },
3780
- codeOptions: null,
3781
- language: null
4051
+ codeOptions: {},
4052
+ language: {}
3782
4053
  },
3783
4054
  emits: ["close", "saveAndClose"],
3784
- setup(__props, { expose, emit }) {
4055
+ setup(__props, { expose: __expose, emit }) {
3785
4056
  const props = __props;
3786
4057
  const services = inject("services");
3787
4058
  const codeContent = ref("");
@@ -3846,7 +4117,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3846
4117
  codeEditor.value.focus();
3847
4118
  }
3848
4119
  };
3849
- expose({
4120
+ __expose({
3850
4121
  saveAndClose,
3851
4122
  close
3852
4123
  });
@@ -3860,10 +4131,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3860
4131
  class: "m-editor-container",
3861
4132
  "init-values": `${codeContent.value}`,
3862
4133
  onSave: saveCodeDraft,
3863
- language: __props.language,
3864
- options: unref(codeOptions)
4134
+ language: _ctx.language,
4135
+ options: codeOptions.value
3865
4136
  }, null, 8, ["init-values", "language", "options"]),
3866
- __props.editable ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
4137
+ _ctx.editable ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
3867
4138
  createVNode(unref(TMagicButton), {
3868
4139
  type: "primary",
3869
4140
  class: "button",
@@ -3880,7 +4151,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3880
4151
  onClick: saveAndClose
3881
4152
  }, {
3882
4153
  default: withCtx(() => [
3883
- _hoisted_2$6
4154
+ createTextVNode("确认")
3884
4155
  ]),
3885
4156
  _: 1
3886
4157
  }),
@@ -3889,11 +4160,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3889
4160
  onClick: close
3890
4161
  }, {
3891
4162
  default: withCtx(() => [
3892
- _hoisted_3$3
4163
+ createTextVNode("关闭")
3893
4164
  ]),
3894
4165
  _: 1
3895
4166
  })
3896
- ])) : (openBlock(), createElementBlock("div", _hoisted_4$3, [
4167
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2$5, [
3897
4168
  createVNode(unref(TMagicButton), {
3898
4169
  type: "primary",
3899
4170
  class: "button",
@@ -3909,7 +4180,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3909
4180
  onClick: close
3910
4181
  }, {
3911
4182
  default: withCtx(() => [
3912
- _hoisted_5$2
4183
+ createTextVNode("关闭")
3913
4184
  ]),
3914
4185
  _: 1
3915
4186
  })
@@ -3919,25 +4190,25 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3919
4190
  }
3920
4191
  });
3921
4192
 
3922
- const _hoisted_1$a = { class: "code-name-wrapper" };
3923
- const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
4193
+ const _hoisted_1$9 = { class: "code-name-wrapper" };
4194
+ const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
3924
4195
  const _hoisted_3$2 = { class: "code-name-wrapper" };
3925
4196
  const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "code-name-label" }, "参数", -1);
3926
- const __default__$g = defineComponent({
3927
- name: "MEditorFunctionEditor"
3928
- });
3929
4197
  const _sfc_main$i = /* @__PURE__ */ defineComponent({
3930
- ...__default__$g,
4198
+ ...{
4199
+ name: "MEditorFunctionEditor"
4200
+ },
4201
+ __name: "FunctionEditor",
3931
4202
  props: {
3932
- id: null,
3933
- name: null,
3934
- content: null,
4203
+ id: {},
4204
+ name: {},
4205
+ content: {},
3935
4206
  editable: { type: Boolean, default: true },
3936
4207
  autoSaveDraft: { type: Boolean, default: true },
3937
- codeOptions: null,
3938
- paramsColConfig: null
4208
+ codeOptions: {},
4209
+ paramsColConfig: {}
3939
4210
  },
3940
- setup(__props, { expose }) {
4211
+ setup(__props, { expose: __expose }) {
3941
4212
  const props = __props;
3942
4213
  const defaultParamColConfig = {
3943
4214
  type: "row",
@@ -4038,20 +4309,20 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
4038
4309
  services?.codeBlockService.setCodeEditorShowStatus(false);
4039
4310
  };
4040
4311
  const codeDraftEditor = ref();
4041
- expose({
4312
+ __expose({
4042
4313
  codeDraftEditor
4043
4314
  });
4044
4315
  return (_ctx, _cache) => {
4045
4316
  const _component_m_form_table = resolveComponent("m-form-table");
4046
4317
  return openBlock(), createBlock(unref(TMagicCard), { shadow: "never" }, {
4047
4318
  header: withCtx(() => [
4048
- createElementVNode("div", _hoisted_1$a, [
4049
- _hoisted_2$5,
4319
+ createElementVNode("div", _hoisted_1$9, [
4320
+ _hoisted_2$4,
4050
4321
  createVNode(unref(TMagicInput), {
4051
4322
  class: "code-name-input",
4052
4323
  modelValue: codeName.value,
4053
4324
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => codeName.value = $event),
4054
- disabled: !__props.editable
4325
+ disabled: !_ctx.editable
4055
4326
  }, null, 8, ["modelValue", "disabled"])
4056
4327
  ]),
4057
4328
  createElementVNode("div", _hoisted_3$2, [
@@ -4071,11 +4342,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
4071
4342
  createVNode(_sfc_main$j, {
4072
4343
  ref_key: "codeDraftEditor",
4073
4344
  ref: codeDraftEditor,
4074
- id: __props.id,
4345
+ id: _ctx.id,
4075
4346
  content: codeContent.value,
4076
- editable: __props.editable,
4077
- autoSaveDraft: __props.autoSaveDraft,
4078
- codeOptions: __props.codeOptions,
4347
+ editable: _ctx.editable,
4348
+ autoSaveDraft: _ctx.autoSaveDraft,
4349
+ codeOptions: _ctx.codeOptions,
4079
4350
  language: "javascript",
4080
4351
  onSaveAndClose: saveAndClose,
4081
4352
  onClose: close
@@ -4087,17 +4358,17 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
4087
4358
  }
4088
4359
  });
4089
4360
 
4090
- const _hoisted_1$9 = {
4361
+ const _hoisted_1$8 = {
4091
4362
  key: 0,
4092
4363
  class: "m-editor-code-block-editor-panel"
4093
4364
  };
4094
- const __default__$f = defineComponent({
4095
- name: "MEditorCodeBlockEditor"
4096
- });
4097
4365
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
4098
- ...__default__$f,
4366
+ ...{
4367
+ name: "MEditorCodeBlockEditor"
4368
+ },
4369
+ __name: "CodeBlockEditor",
4099
4370
  props: {
4100
- paramsColConfig: null
4371
+ paramsColConfig: {}
4101
4372
  },
4102
4373
  setup(__props) {
4103
4374
  const services = inject("services");
@@ -4144,7 +4415,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
4144
4415
  "append-to-body": true,
4145
4416
  "show-close": false,
4146
4417
  "close-on-click-modal": true,
4147
- size: unref(size),
4418
+ size: size.value,
4148
4419
  "before-close": handleClose
4149
4420
  }, {
4150
4421
  default: withCtx(() => [
@@ -4155,17 +4426,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
4155
4426
  class: "code-editor-layout"
4156
4427
  }, {
4157
4428
  center: withCtx(() => [
4158
- !unref(isEmpty)(codeConfig.value) ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
4159
- renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: unref(id) }),
4429
+ !unref(isEmpty)(codeConfig.value) ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
4430
+ renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: id.value }),
4160
4431
  codeConfig.value ? (openBlock(), createBlock(_sfc_main$i, {
4161
4432
  key: 0,
4162
4433
  ref_key: "functionEditor",
4163
4434
  ref: functionEditor,
4164
- id: unref(id),
4435
+ id: id.value,
4165
4436
  name: codeConfig.value.name,
4166
4437
  content: codeConfig.value.content,
4167
- paramsColConfig: __props.paramsColConfig,
4168
- editable: !!unref(editable),
4438
+ paramsColConfig: _ctx.paramsColConfig,
4439
+ editable: !!editable.value,
4169
4440
  autoSaveDraft: true,
4170
4441
  codeOptions: unref(codeOptions)
4171
4442
  }, null, 8, ["id", "name", "content", "paramsColConfig", "editable", "codeOptions"])) : createCommentVNode("", true)
@@ -4180,22 +4451,21 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
4180
4451
  }
4181
4452
  });
4182
4453
 
4183
- const _hoisted_1$8 = { class: "search-wrapper" };
4184
- const _hoisted_2$4 = /* @__PURE__ */ createTextVNode("新增");
4185
- const _hoisted_3$1 = ["id"];
4186
- const _hoisted_4$1 = { class: "list-item" };
4187
- const _hoisted_5$1 = {
4454
+ const _hoisted_1$7 = { class: "search-wrapper" };
4455
+ const _hoisted_2$3 = ["id"];
4456
+ const _hoisted_3$1 = { class: "list-item" };
4457
+ const _hoisted_4$1 = {
4188
4458
  key: 2,
4189
4459
  class: "right-tool"
4190
4460
  };
4191
- const __default__$e = defineComponent({
4192
- name: "MEditorCodeBlockList"
4193
- });
4194
4461
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
4195
- ...__default__$e,
4462
+ ...{
4463
+ name: "MEditorCodeBlockList"
4464
+ },
4465
+ __name: "CodeBlockList",
4196
4466
  props: {
4197
- customError: null,
4198
- paramsColConfig: null
4467
+ customError: { type: Function },
4468
+ paramsColConfig: {}
4199
4469
  },
4200
4470
  setup(__props) {
4201
4471
  const props = __props;
@@ -4284,9 +4554,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4284
4554
  return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
4285
4555
  default: withCtx(() => [
4286
4556
  renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
4287
- createElementVNode("div", _hoisted_1$8, [
4557
+ createElementVNode("div", _hoisted_1$7, [
4288
4558
  createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
4289
- unref(editable) ? (openBlock(), createBlock(unref(TMagicButton), {
4559
+ editable.value ? (openBlock(), createBlock(unref(TMagicButton), {
4290
4560
  key: 0,
4291
4561
  class: "create-code-button",
4292
4562
  type: "primary",
@@ -4294,7 +4564,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4294
4564
  onClick: createCodeBlock
4295
4565
  }, {
4296
4566
  default: withCtx(() => [
4297
- _hoisted_2$4
4567
+ createTextVNode("新增")
4298
4568
  ]),
4299
4569
  _: 1
4300
4570
  })) : createCommentVNode("", true)
@@ -4306,9 +4576,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4306
4576
  class: "magic-editor-layer-tree",
4307
4577
  "node-key": "id",
4308
4578
  "empty-text": "暂无代码块",
4309
- "default-expanded-keys": unref(expandedKeys),
4579
+ "default-expanded-keys": expandedKeys.value,
4310
4580
  "expand-on-click-node": false,
4311
- data: unref(codeList),
4581
+ data: codeList.value,
4312
4582
  props: treeProps,
4313
4583
  "highlight-current": true,
4314
4584
  "filter-node-method": filterNode,
@@ -4319,41 +4589,41 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4319
4589
  id: data.id,
4320
4590
  class: "list-container"
4321
4591
  }, [
4322
- createElementVNode("div", _hoisted_4$1, [
4323
- data.type === "code" ? (openBlock(), createBlock(CodeIcon, {
4592
+ createElementVNode("div", _hoisted_3$1, [
4593
+ data.type === "code" ? (openBlock(), createBlock(_sfc_main$k, {
4324
4594
  key: 0,
4325
4595
  class: "codeIcon"
4326
4596
  })) : createCommentVNode("", true),
4327
- data.type === "node" ? (openBlock(), createBlock(AppManageIcon, {
4597
+ data.type === "node" ? (openBlock(), createBlock(_sfc_main$l, {
4328
4598
  key: 1,
4329
4599
  class: "compIcon"
4330
4600
  })) : createCommentVNode("", true),
4331
4601
  createElementVNode("span", {
4332
4602
  class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
4333
4603
  }, toDisplayString(data.name) + " (" + toDisplayString(data.id) + ")", 3),
4334
- data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
4604
+ data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
4335
4605
  createVNode(unref(TMagicTooltip), {
4336
4606
  effect: "dark",
4337
- content: unref(editable) ? "编辑" : "查看",
4607
+ content: editable.value ? "编辑" : "查看",
4338
4608
  placement: "bottom"
4339
4609
  }, {
4340
4610
  default: withCtx(() => [
4341
- createVNode(_sfc_main$A, {
4342
- icon: unref(editable) ? unref(Edit) : unref(View),
4611
+ createVNode(_sfc_main$B, {
4612
+ icon: editable.value ? unref(Edit) : unref(View),
4343
4613
  class: "edit-icon",
4344
4614
  onClick: withModifiers(($event) => editCode(`${data.id}`), ["stop"])
4345
4615
  }, null, 8, ["icon", "onClick"])
4346
4616
  ]),
4347
4617
  _: 2
4348
4618
  }, 1032, ["content"]),
4349
- unref(editable) ? (openBlock(), createBlock(unref(TMagicTooltip), {
4619
+ editable.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
4350
4620
  key: 0,
4351
4621
  effect: "dark",
4352
4622
  content: "删除",
4353
4623
  placement: "bottom"
4354
4624
  }, {
4355
4625
  default: withCtx(() => [
4356
- createVNode(_sfc_main$A, {
4626
+ createVNode(_sfc_main$B, {
4357
4627
  icon: unref(Close),
4358
4628
  class: "edit-icon",
4359
4629
  onClick: withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
@@ -4367,13 +4637,13 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4367
4637
  })
4368
4638
  ])) : createCommentVNode("", true)
4369
4639
  ])
4370
- ], 8, _hoisted_3$1)
4640
+ ], 8, _hoisted_2$3)
4371
4641
  ]),
4372
4642
  _: 3
4373
4643
  }, 8, ["default-expanded-keys", "data"]),
4374
- unref(isShowCodeBlockEditor) ? (openBlock(), createBlock(_sfc_main$h, {
4644
+ isShowCodeBlockEditor.value ? (openBlock(), createBlock(_sfc_main$h, {
4375
4645
  key: 0,
4376
- paramsColConfig: __props.paramsColConfig
4646
+ paramsColConfig: _ctx.paramsColConfig
4377
4647
  }, {
4378
4648
  "code-block-edit-panel-header": withCtx(({ id }) => [
4379
4649
  renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
@@ -4387,16 +4657,17 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
4387
4657
  }
4388
4658
  });
4389
4659
 
4390
- const _hoisted_1$7 = /* @__PURE__ */ createTextVNode("确定");
4391
- const _hoisted_2$3 = /* @__PURE__ */ createTextVNode("关闭");
4392
4660
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
4661
+ ...{
4662
+ name: "MEditorDataSourceConfigPanel"
4663
+ },
4393
4664
  __name: "DataSourceConfigPanel",
4394
4665
  props: {
4395
- title: null,
4396
- values: null
4666
+ title: {},
4667
+ values: {}
4397
4668
  },
4398
4669
  emits: ["submit"],
4399
- setup(__props, { expose, emit }) {
4670
+ setup(__props, { expose: __expose, emit }) {
4400
4671
  const props = __props;
4401
4672
  const type = ref("base");
4402
4673
  const services = inject("services");
@@ -4427,7 +4698,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4427
4698
  const hide = () => {
4428
4699
  visible.value = false;
4429
4700
  };
4430
- expose({
4701
+ __expose({
4431
4702
  show() {
4432
4703
  visible.value = true;
4433
4704
  },
@@ -4437,12 +4708,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4437
4708
  return openBlock(), createBlock(unref(TMagicDrawer), {
4438
4709
  modelValue: visible.value,
4439
4710
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
4440
- title: __props.title,
4711
+ title: _ctx.title,
4441
4712
  "close-on-press-escape": true,
4442
4713
  "append-to-body": true,
4443
4714
  "show-close": true,
4444
4715
  "close-on-click-modal": true,
4445
- size: unref(size)
4716
+ size: size.value
4446
4717
  }, {
4447
4718
  footer: withCtx(() => [
4448
4719
  createElementVNode("div", null, [
@@ -4451,13 +4722,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4451
4722
  onClick: submitHandler
4452
4723
  }, {
4453
4724
  default: withCtx(() => [
4454
- _hoisted_1$7
4725
+ createTextVNode("确定")
4455
4726
  ]),
4456
4727
  _: 1
4457
4728
  }),
4458
4729
  createVNode(unref(TMagicButton), { onClick: hide }, {
4459
4730
  default: withCtx(() => [
4460
- _hoisted_2$3
4731
+ createTextVNode("关闭")
4461
4732
  ]),
4462
4733
  _: 1
4463
4734
  })
@@ -4467,7 +4738,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4467
4738
  createVNode(unref(MForm), {
4468
4739
  ref_key: "form",
4469
4740
  ref: form,
4470
- config: unref(dataSourceConfig),
4741
+ config: dataSourceConfig.value,
4471
4742
  "init-values": initValues.value,
4472
4743
  onChange: changeHandler
4473
4744
  }, null, 8, ["config", "init-values"])
@@ -4479,18 +4750,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
4479
4750
  });
4480
4751
 
4481
4752
  const _hoisted_1$6 = { class: "search-wrapper" };
4482
- const _hoisted_2$2 = /* @__PURE__ */ createTextVNode("新增");
4483
- const _hoisted_3 = ["id"];
4484
- const _hoisted_4 = { class: "list-item" };
4485
- const _hoisted_5 = {
4753
+ const _hoisted_2$2 = ["id"];
4754
+ const _hoisted_3 = { class: "list-item" };
4755
+ const _hoisted_4 = {
4486
4756
  key: 2,
4487
4757
  class: "right-tool"
4488
4758
  };
4489
- const __default__$d = defineComponent({
4490
- name: "MEditorDataSourceListPanel"
4491
- });
4492
4759
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
4493
- ...__default__$d,
4760
+ ...{
4761
+ name: "MEditorDataSourceListPanel"
4762
+ },
4763
+ __name: "DataSourceListPanel",
4494
4764
  setup(__props) {
4495
4765
  const services = inject("services", {});
4496
4766
  const { dataSourceService, depService } = inject("services") || {};
@@ -4556,7 +4826,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4556
4826
  onClick: addHandler
4557
4827
  }, {
4558
4828
  default: withCtx(() => [
4559
- _hoisted_2$2
4829
+ createTextVNode("新增")
4560
4830
  ]),
4561
4831
  _: 1
4562
4832
  })
@@ -4569,7 +4839,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4569
4839
  "empty-text": "暂无代码块",
4570
4840
  "default-expand-all": "",
4571
4841
  "expand-on-click-node": false,
4572
- data: unref(list),
4842
+ data: list.value,
4573
4843
  "highlight-current": true
4574
4844
  }, {
4575
4845
  default: withCtx(({ data }) => [
@@ -4577,13 +4847,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4577
4847
  id: data.id,
4578
4848
  class: "list-container"
4579
4849
  }, [
4580
- createElementVNode("div", _hoisted_4, [
4581
- data.type === "code" ? (openBlock(), createBlock(_sfc_main$A, {
4850
+ createElementVNode("div", _hoisted_3, [
4851
+ data.type === "code" ? (openBlock(), createBlock(_sfc_main$B, {
4582
4852
  key: 0,
4583
4853
  class: "codeIcon",
4584
4854
  icon: unref(Coin)
4585
4855
  }, null, 8, ["icon"])) : createCommentVNode("", true),
4586
- data.type === "node" ? (openBlock(), createBlock(_sfc_main$A, {
4856
+ data.type === "node" ? (openBlock(), createBlock(_sfc_main$B, {
4587
4857
  key: 1,
4588
4858
  class: "compIcon",
4589
4859
  icon: unref(Aim)
@@ -4591,14 +4861,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4591
4861
  createElementVNode("span", {
4592
4862
  class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
4593
4863
  }, toDisplayString(data.name) + "(" + toDisplayString(data.id) + ")", 3),
4594
- data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_5, [
4864
+ data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_4, [
4595
4865
  createVNode(unref(TMagicTooltip), {
4596
4866
  effect: "dark",
4597
4867
  content: "编辑",
4598
4868
  placement: "bottom"
4599
4869
  }, {
4600
4870
  default: withCtx(() => [
4601
- createVNode(_sfc_main$A, {
4871
+ createVNode(_sfc_main$B, {
4602
4872
  class: "edit-icon",
4603
4873
  icon: unref(Edit),
4604
4874
  onClick: withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
@@ -4612,7 +4882,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4612
4882
  placement: "bottom"
4613
4883
  }, {
4614
4884
  default: withCtx(() => [
4615
- createVNode(_sfc_main$A, {
4885
+ createVNode(_sfc_main$B, {
4616
4886
  icon: unref(Close),
4617
4887
  class: "edit-icon",
4618
4888
  onClick: withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
@@ -4626,7 +4896,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4626
4896
  })
4627
4897
  ])) : createCommentVNode("", true)
4628
4898
  ])
4629
- ], 8, _hoisted_3)
4899
+ ], 8, _hoisted_2$2)
4630
4900
  ]),
4631
4901
  _: 3
4632
4902
  }, 8, ["data"]),
@@ -4645,11 +4915,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
4645
4915
  });
4646
4916
 
4647
4917
  const _hoisted_1$5 = ["onClick", "onDragstart"];
4648
- const __default__$c = defineComponent({
4649
- name: "MEditorComponentListPanel"
4650
- });
4651
4918
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
4652
- ...__default__$c,
4919
+ ...{
4920
+ name: "MEditorComponentListPanel"
4921
+ },
4922
+ __name: "ComponentListPanel",
4653
4923
  setup(__props) {
4654
4924
  const searchText = ref("");
4655
4925
  const filterTextChangeHandler = (v) => {
@@ -4722,18 +4992,18 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4722
4992
  renderSlot(_ctx.$slots, "component-list-panel-header"),
4723
4993
  createVNode(unref(TMagicCollapse), {
4724
4994
  class: "ui-component-panel",
4725
- "model-value": unref(collapseValue)
4995
+ "model-value": collapseValue.value
4726
4996
  }, {
4727
4997
  default: withCtx(() => [
4728
4998
  createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
4729
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (group, index) => {
4999
+ (openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (group, index) => {
4730
5000
  return openBlock(), createElementBlock(Fragment, null, [
4731
5001
  group.items && group.items.length ? (openBlock(), createBlock(unref(TMagicCollapseItem), {
4732
5002
  key: index,
4733
5003
  name: `${index}`
4734
5004
  }, {
4735
5005
  title: withCtx(() => [
4736
- createVNode(_sfc_main$A, { icon: unref(Grid) }, null, 8, ["icon"]),
5006
+ createVNode(_sfc_main$B, { icon: unref(Grid) }, null, 8, ["icon"]),
4737
5007
  createTextVNode(toDisplayString(group.title), 1)
4738
5008
  ]),
4739
5009
  default: withCtx(() => [
@@ -4748,7 +5018,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4748
5018
  onDrag: dragHandler
4749
5019
  }, [
4750
5020
  renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
4751
- createVNode(_sfc_main$A, {
5021
+ createVNode(_sfc_main$B, {
4752
5022
  icon: item.icon
4753
5023
  }, null, 8, ["icon"]),
4754
5024
  createVNode(unref(TMagicTooltip), {
@@ -4779,17 +5049,17 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
4779
5049
  }
4780
5050
  });
4781
5051
 
4782
- const __default__$b = defineComponent({
4783
- name: "MEditorContentMenu"
4784
- });
4785
5052
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
4786
- ...__default__$b,
5053
+ ...{
5054
+ name: "MEditorContentMenu"
5055
+ },
5056
+ __name: "ContentMenu",
4787
5057
  props: {
4788
5058
  menuData: { default: () => [] },
4789
5059
  isSubMenu: { type: Boolean, default: false }
4790
5060
  },
4791
5061
  emits: ["hide", "show"],
4792
- setup(__props, { expose, emit }) {
5062
+ setup(__props, { expose: __expose, emit }) {
4793
5063
  const props = __props;
4794
5064
  const menu = ref();
4795
5065
  const subMenu = ref();
@@ -4856,13 +5126,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4856
5126
  return;
4857
5127
  globalThis.removeEventListener("mousedown", hideHandler, true);
4858
5128
  });
4859
- expose({
5129
+ __expose({
4860
5130
  hide,
4861
5131
  show
4862
5132
  });
4863
5133
  return (_ctx, _cache) => {
4864
5134
  const _component_content_menu = resolveComponent("content-menu", true);
4865
- return __props.menuData.length ? withDirectives((openBlock(), createElementBlock("div", {
5135
+ return _ctx.menuData.length ? withDirectives((openBlock(), createElementBlock("div", {
4866
5136
  key: 0,
4867
5137
  class: "magic-editor-content-menu",
4868
5138
  ref_key: "menu",
@@ -4870,7 +5140,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4870
5140
  style: normalizeStyle(menuStyle.value)
4871
5141
  }, [
4872
5142
  createElementVNode("div", null, [
4873
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.menuData, (item, index) => {
5143
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuData, (item, index) => {
4874
5144
  return openBlock(), createBlock(_sfc_main$p, {
4875
5145
  "event-type": "mouseup",
4876
5146
  data: item,
@@ -4897,15 +5167,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
4897
5167
  }
4898
5168
  });
4899
5169
 
4900
- const __default__$a = defineComponent({
4901
- name: "MEditorLayerMenu"
4902
- });
4903
5170
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
4904
- ...__default__$a,
5171
+ ...{
5172
+ name: "MEditorLayerMenu"
5173
+ },
5174
+ __name: "LayerMenu",
4905
5175
  props: {
4906
- layerContentMenu: null
5176
+ layerContentMenu: {}
4907
5177
  },
4908
- setup(__props, { expose }) {
5178
+ setup(__props, { expose: __expose }) {
4909
5179
  const props = __props;
4910
5180
  const services = inject("services");
4911
5181
  const menu = ref();
@@ -4987,12 +5257,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
4987
5257
  const show = (e) => {
4988
5258
  menu.value?.show(e);
4989
5259
  };
4990
- expose({
5260
+ __expose({
4991
5261
  show
4992
5262
  });
4993
5263
  return (_ctx, _cache) => {
4994
5264
  return openBlock(), createBlock(_sfc_main$c, {
4995
- "menu-data": unref(menuData),
5265
+ "menu-data": menuData.value,
4996
5266
  ref_key: "menu",
4997
5267
  ref: menu,
4998
5268
  style: { "overflow": "initial" }
@@ -5002,16 +5272,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
5002
5272
  });
5003
5273
 
5004
5274
  const _hoisted_1$4 = ["id", "onMouseenter"];
5005
- const __default__$9 = defineComponent({
5006
- name: "MEditorLayerPanel"
5007
- });
5275
+ const throttleTime = 150;
5008
5276
  const _sfc_main$a = /* @__PURE__ */ defineComponent({
5009
- ...__default__$9,
5277
+ ...{
5278
+ name: "MEditorLayerPanel"
5279
+ },
5280
+ __name: "LayerPanel",
5010
5281
  props: {
5011
- layerContentMenu: null
5282
+ layerContentMenu: {}
5012
5283
  },
5013
5284
  setup(__props) {
5014
- const throttleTime = 150;
5015
5285
  const services = inject("services");
5016
5286
  const editorService = services?.editorService;
5017
5287
  const tree = ref();
@@ -5205,7 +5475,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5205
5475
  default: withCtx(() => [
5206
5476
  renderSlot(_ctx.$slots, "layer-panel-header"),
5207
5477
  createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
5208
- unref(values).length ? (openBlock(), createBlock(unref(TMagicTree), {
5478
+ values.value.length ? (openBlock(), createBlock(unref(TMagicTree), {
5209
5479
  key: 0,
5210
5480
  class: "magic-editor-layer-tree",
5211
5481
  ref_key: "tree",
@@ -5216,14 +5486,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5216
5486
  "default-expanded-keys": expandedKeys.value,
5217
5487
  "default-checked-keys": checkedKeys.value,
5218
5488
  "current-node-key": currentNodeKey.value,
5219
- data: unref(values),
5489
+ data: values.value,
5220
5490
  "expand-on-click-node": false,
5221
- "highlight-current": !unref(isMultiSelect),
5491
+ "highlight-current": !isMultiSelect.value,
5222
5492
  "check-on-click-node": true,
5223
5493
  props: treeProps,
5224
5494
  "filter-node-method": filterNode,
5225
5495
  "allow-drop": allowDrop,
5226
- "show-checkbox": unref(isMultiSelect),
5496
+ "show-checkbox": isMultiSelect.value,
5227
5497
  onNodeClick: clickHandler,
5228
5498
  onNodeContextmenu: contextmenu,
5229
5499
  onNodeDragEnd: handleDragEnd,
@@ -5253,7 +5523,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5253
5523
  createVNode(_sfc_main$b, {
5254
5524
  ref_key: "menu",
5255
5525
  ref: menu,
5256
- "layer-content-menu": __props.layerContentMenu
5526
+ "layer-content-menu": _ctx.layerContentMenu
5257
5527
  }, null, 8, ["layer-content-menu"])
5258
5528
  ]))
5259
5529
  ]),
@@ -5267,19 +5537,19 @@ const _hoisted_1$3 = {
5267
5537
  key: 1,
5268
5538
  class: "magic-editor-tab-panel-title"
5269
5539
  };
5270
- const __default__$8 = defineComponent({
5271
- name: "MEditorSidebar"
5272
- });
5273
5540
  const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5274
- ...__default__$8,
5541
+ ...{
5542
+ name: "MEditorSidebar"
5543
+ },
5544
+ __name: "Sidebar",
5275
5545
  props: {
5276
5546
  data: { default: () => ({ type: "tabs", status: "组件", items: ["component-list", "layer", "code-block", "data-source"] }) },
5277
- layerContentMenu: null
5547
+ layerContentMenu: {}
5278
5548
  },
5279
- setup(__props, { expose }) {
5549
+ setup(__props, { expose: __expose }) {
5280
5550
  const props = __props;
5281
- const tabPaneComponent = getConfig$1("components").tabPane;
5282
- const tabsComponent = getConfig$1("components").tabs;
5551
+ const tabPaneComponent = getConfig$1("components")?.tabPane;
5552
+ const tabsComponent = getConfig$1("components")?.tabs;
5283
5553
  const activeTabName = ref(props.data?.status);
5284
5554
  const getItemConfig = (data) => {
5285
5555
  const map = {
@@ -5328,26 +5598,26 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5328
5598
  activeTabName.value = status || "0";
5329
5599
  }
5330
5600
  );
5331
- expose({
5601
+ __expose({
5332
5602
  activeTabName
5333
5603
  });
5334
5604
  return (_ctx, _cache) => {
5335
- return __props.data.type === "tabs" && __props.data.items.length ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabsComponent).component), mergeProps({
5605
+ return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabsComponent)?.component || "el-tabs"), mergeProps({
5336
5606
  key: 0,
5337
5607
  modelValue: activeTabName.value,
5338
5608
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
5339
5609
  class: "m-editor-sidebar tmagic-design-tabs"
5340
- }, unref(tabsComponent).props({ type: "card", tabPosition: "left" })), {
5610
+ }, unref(tabsComponent)?.props({ type: "card", tabPosition: "left" }) || {}), {
5341
5611
  default: withCtx(() => [
5342
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(sideBarItems), (config, index) => {
5343
- return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent).component), mergeProps(unref(tabPaneComponent).props({ name: config.text }), {
5612
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
5613
+ return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps(unref(tabPaneComponent)?.props({ name: config.text, lazy: config.lazy }) || {}, {
5344
5614
  key: config.$key || index
5345
5615
  }), {
5346
5616
  label: withCtx(() => [
5347
5617
  (openBlock(), createElementBlock("div", {
5348
5618
  key: config.text
5349
5619
  }, [
5350
- config.icon ? (openBlock(), createBlock(_sfc_main$A, {
5620
+ config.icon ? (openBlock(), createBlock(_sfc_main$B, {
5351
5621
  key: 0,
5352
5622
  icon: config.icon
5353
5623
  }, null, 8, ["icon"])) : createCommentVNode("", true),
@@ -5360,7 +5630,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5360
5630
  name: "component-list-panel-header",
5361
5631
  fn: withCtx(() => [
5362
5632
  config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
5363
- ])
5633
+ ]),
5634
+ key: "0"
5364
5635
  } : void 0,
5365
5636
  config.$key === "component-list" || config.slots?.componentListItem ? {
5366
5637
  name: "component-list-item",
@@ -5372,19 +5643,22 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5372
5643
  key: 1,
5373
5644
  component
5374
5645
  }, null, 8, ["component"])) : createCommentVNode("", true)
5375
- ])
5646
+ ]),
5647
+ key: "1"
5376
5648
  } : void 0,
5377
5649
  config.$key === "layer" || config.slots?.layerPanelHeader ? {
5378
5650
  name: "layer-panel-header",
5379
5651
  fn: withCtx(() => [
5380
5652
  config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
5381
- ])
5653
+ ]),
5654
+ key: "2"
5382
5655
  } : void 0,
5383
5656
  config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
5384
5657
  name: "code-block-panel-header",
5385
5658
  fn: withCtx(() => [
5386
5659
  config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
5387
- ])
5660
+ ]),
5661
+ key: "3"
5388
5662
  } : void 0,
5389
5663
  config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
5390
5664
  name: "code-block-panel-tool",
@@ -5394,7 +5668,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5394
5668
  id,
5395
5669
  data
5396
5670
  }) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
5397
- ])
5671
+ ]),
5672
+ key: "4"
5398
5673
  } : void 0,
5399
5674
  config.$key === "code-block" || config.slots?.codeBlockEditPanelHeader ? {
5400
5675
  name: "code-block-edit-panel-header",
@@ -5403,7 +5678,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5403
5678
  key: 0,
5404
5679
  id
5405
5680
  }) : config.slots?.codeBlockEditPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockEditPanelHeader), { key: 1 })) : createCommentVNode("", true)
5406
- ])
5681
+ ]),
5682
+ key: "5"
5407
5683
  } : void 0,
5408
5684
  config.$key === "layer" || config.slots?.layerNodeContent ? {
5409
5685
  name: "layer-node-content",
@@ -5417,7 +5693,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5417
5693
  data: nodeData,
5418
5694
  node
5419
5695
  }, null, 8, ["data", "node"])) : createCommentVNode("", true)
5420
- ])
5696
+ ]),
5697
+ key: "6"
5421
5698
  } : void 0
5422
5699
  ]), 1040)) : createCommentVNode("", true)
5423
5700
  ]),
@@ -5436,11 +5713,11 @@ const _hoisted_1$2 = {
5436
5713
  class: "m-editor-breadcrumb"
5437
5714
  };
5438
5715
  const _hoisted_2$1 = { key: 0 };
5439
- const __default__$7 = defineComponent({
5440
- name: "MEditorBreadcrumb"
5441
- });
5442
5716
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5443
- ...__default__$7,
5717
+ ...{
5718
+ name: "MEditorBreadcrumb"
5719
+ },
5720
+ __name: "Breadcrumb",
5444
5721
  setup(__props) {
5445
5722
  const services = inject("services");
5446
5723
  const editorService = services?.editorService;
@@ -5453,14 +5730,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5453
5730
  editorService?.get("stage")?.select(node2.id);
5454
5731
  };
5455
5732
  return (_ctx, _cache) => {
5456
- return unref(nodes).length === 1 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
5457
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(path), (item, index) => {
5733
+ return nodes.value.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
5734
+ (openBlock(true), createElementBlock(Fragment, null, renderList(path.value, (item, index) => {
5458
5735
  return openBlock(), createElementBlock(Fragment, {
5459
5736
  key: item.id
5460
5737
  }, [
5461
5738
  createVNode(unref(TMagicButton), {
5462
5739
  text: "",
5463
- disabled: item.id === unref(node)?.id,
5740
+ disabled: item.id === node.value?.id,
5464
5741
  onClick: ($event) => select(item)
5465
5742
  }, {
5466
5743
  default: withCtx(() => [
@@ -5468,7 +5745,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
5468
5745
  ]),
5469
5746
  _: 2
5470
5747
  }, 1032, ["disabled", "onClick"]),
5471
- index < unref(path).length - 1 ? (openBlock(), createElementBlock("span", _hoisted_2$1, "/")) : createCommentVNode("", true)
5748
+ index < path.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_2$1, "/")) : createCommentVNode("", true)
5472
5749
  ], 64);
5473
5750
  }), 128))
5474
5751
  ])) : createCommentVNode("", true);
@@ -5480,11 +5757,11 @@ const _hoisted_1$1 = {
5480
5757
  key: 1,
5481
5758
  style: { "width": "21px" }
5482
5759
  };
5483
- const __default__$6 = defineComponent({
5484
- name: "MEditorPageBarScrollContainer"
5485
- });
5486
5760
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5487
- ...__default__$6,
5761
+ ...{
5762
+ name: "MEditorPageBarScrollContainer"
5763
+ },
5764
+ __name: "PageBarScrollContainer",
5488
5765
  setup(__props) {
5489
5766
  const services = inject("services");
5490
5767
  const editorService = services?.editorService;
@@ -5562,22 +5839,22 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5562
5839
  ref_key: "pageBar",
5563
5840
  ref: pageBar
5564
5841
  }, [
5565
- unref(showAddPageButton) ? (openBlock(), createElementBlock("div", {
5842
+ showAddPageButton.value ? (openBlock(), createElementBlock("div", {
5566
5843
  key: 0,
5567
5844
  id: "m-editor-page-bar-add-icon",
5568
5845
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5569
5846
  onClick: addPage
5570
5847
  }, [
5571
- createVNode(_sfc_main$A, { icon: unref(Plus) }, null, 8, ["icon"])
5848
+ createVNode(_sfc_main$B, { icon: unref(Plus) }, null, 8, ["icon"])
5572
5849
  ])) : (openBlock(), createElementBlock("div", _hoisted_1$1)),
5573
5850
  canScroll.value ? (openBlock(), createElementBlock("div", {
5574
5851
  key: 2,
5575
5852
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5576
5853
  onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
5577
5854
  }, [
5578
- createVNode(_sfc_main$A, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
5855
+ createVNode(_sfc_main$B, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
5579
5856
  ])) : createCommentVNode("", true),
5580
- unref(pageLength) ? (openBlock(), createElementBlock("div", {
5857
+ pageLength.value ? (openBlock(), createElementBlock("div", {
5581
5858
  key: 3,
5582
5859
  class: "m-editor-page-bar-items",
5583
5860
  ref_key: "itemsContainer",
@@ -5591,7 +5868,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5591
5868
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5592
5869
  onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
5593
5870
  }, [
5594
- createVNode(_sfc_main$A, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
5871
+ createVNode(_sfc_main$B, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
5595
5872
  ])) : createCommentVNode("", true)
5596
5873
  ], 512);
5597
5874
  };
@@ -5600,11 +5877,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
5600
5877
 
5601
5878
  const _hoisted_1 = ["onClick"];
5602
5879
  const _hoisted_2 = { class: "m-editor-page-bar-title" };
5603
- const __default__$5 = defineComponent({
5604
- name: "MEditorPageBar"
5605
- });
5606
5880
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5607
- ...__default__$5,
5881
+ ...{
5882
+ name: "MEditorPageBar"
5883
+ },
5884
+ __name: "PageBar",
5608
5885
  setup(__props) {
5609
5886
  const services = inject("services");
5610
5887
  const editorService = services?.editorService;
@@ -5626,9 +5903,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5626
5903
  return (_ctx, _cache) => {
5627
5904
  return openBlock(), createBlock(_sfc_main$7, null, {
5628
5905
  default: withCtx(() => [
5629
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(root) && unref(root).items || [], (item) => {
5906
+ (openBlock(true), createElementBlock(Fragment, null, renderList(root.value && root.value.items || [], (item) => {
5630
5907
  return openBlock(), createElementBlock("div", {
5631
- class: normalizeClass(["m-editor-page-bar-item", { active: unref(page)?.id === item.id }]),
5908
+ class: normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
5632
5909
  key: item.key,
5633
5910
  onClick: ($event) => switchPage(item)
5634
5911
  }, [
@@ -5821,16 +6098,16 @@ class ScrollViewer extends EventEmitter {
5821
6098
  };
5822
6099
  }
5823
6100
 
5824
- const __default__$4 = defineComponent({
5825
- name: "MEditorScrollBar"
5826
- });
5827
6101
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5828
- ...__default__$4,
6102
+ ...{
6103
+ name: "MEditorScrollBar"
6104
+ },
6105
+ __name: "ScrollBar",
5829
6106
  props: {
5830
- size: null,
5831
- scrollSize: null,
6107
+ size: {},
6108
+ scrollSize: {},
5832
6109
  isHorizontal: { type: Boolean },
5833
- pos: null
6110
+ pos: {}
5834
6111
  },
5835
6112
  emits: ["scroll"],
5836
6113
  setup(__props, { emit }) {
@@ -5895,13 +6172,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5895
6172
  return openBlock(), createElementBlock("div", {
5896
6173
  ref_key: "bar",
5897
6174
  ref: bar,
5898
- class: normalizeClass(["m-editor-scroll-bar", __props.isHorizontal ? "horizontal" : "vertical"])
6175
+ class: normalizeClass(["m-editor-scroll-bar", _ctx.isHorizontal ? "horizontal" : "vertical"])
5899
6176
  }, [
5900
6177
  createElementVNode("div", {
5901
6178
  ref_key: "thumb",
5902
6179
  ref: thumb,
5903
6180
  class: "m-editor-scroll-bar-thumb",
5904
- style: normalizeStyle(unref(thumbStyle))
6181
+ style: normalizeStyle(thumbStyle.value)
5905
6182
  }, null, 4)
5906
6183
  ], 2);
5907
6184
  };
@@ -5910,11 +6187,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
5910
6187
 
5911
6188
  const ScrollBar_vue_vue_type_style_index_0_lang = '';
5912
6189
 
5913
- const __default__$3 = defineComponent({
5914
- name: "MEditorScrollViewer"
5915
- });
5916
6190
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5917
- ...__default__$3,
6191
+ ...{
6192
+ name: "MEditorScrollViewer"
6193
+ },
6194
+ __name: "ScrollViewer",
5918
6195
  props: {
5919
6196
  width: { default: 0 },
5920
6197
  height: { default: 0 },
@@ -5926,7 +6203,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5926
6203
  height: 0
5927
6204
  }) }
5928
6205
  },
5929
- setup(__props, { expose }) {
6206
+ setup(__props, { expose: __expose }) {
5930
6207
  const props = __props;
5931
6208
  const container = ref();
5932
6209
  const el = ref();
@@ -5980,7 +6257,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5980
6257
  left: hOffset.value
5981
6258
  });
5982
6259
  };
5983
- expose({
6260
+ __expose({
5984
6261
  container
5985
6262
  });
5986
6263
  return (_ctx, _cache) => {
@@ -5992,23 +6269,23 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
5992
6269
  createElementVNode("div", {
5993
6270
  ref_key: "el",
5994
6271
  ref: el,
5995
- style: normalizeStyle(unref(style))
6272
+ style: normalizeStyle(style.value)
5996
6273
  }, [
5997
6274
  renderSlot(_ctx.$slots, "default")
5998
6275
  ], 4),
5999
- scrollHeight.value > __props.wrapHeight ? (openBlock(), createBlock(_sfc_main$5, {
6276
+ scrollHeight.value > _ctx.wrapHeight ? (openBlock(), createBlock(_sfc_main$5, {
6000
6277
  key: 0,
6001
6278
  "scroll-size": scrollHeight.value,
6002
- size: __props.wrapHeight,
6279
+ size: _ctx.wrapHeight,
6003
6280
  pos: vOffset.value,
6004
6281
  onScroll: vScrollHandler
6005
6282
  }, null, 8, ["scroll-size", "size", "pos"])) : createCommentVNode("", true),
6006
- scrollWidth.value > __props.wrapWidth ? (openBlock(), createBlock(_sfc_main$5, {
6283
+ scrollWidth.value > _ctx.wrapWidth ? (openBlock(), createBlock(_sfc_main$5, {
6007
6284
  key: 1,
6008
6285
  "is-horizontal": true,
6009
6286
  "scroll-size": scrollWidth.value,
6010
6287
  pos: hOffset.value,
6011
- size: __props.wrapWidth,
6288
+ size: _ctx.wrapWidth,
6012
6289
  onScroll: hScrollHandler
6013
6290
  }, null, 8, ["scroll-size", "pos", "size"])) : createCommentVNode("", true)
6014
6291
  ], 512);
@@ -6016,16 +6293,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6016
6293
  }
6017
6294
  });
6018
6295
 
6019
- const __default__$2 = defineComponent({
6020
- name: "MEditorViewerMenu"
6021
- });
6022
6296
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
6023
- ...__default__$2,
6297
+ ...{
6298
+ name: "MEditorViewerMenu"
6299
+ },
6300
+ __name: "ViewerMenu",
6024
6301
  props: {
6025
6302
  isMultiSelect: { type: Boolean, default: false },
6026
- stageContentMenu: null
6303
+ stageContentMenu: {}
6027
6304
  },
6028
- setup(__props, { expose }) {
6305
+ setup(__props, { expose: __expose }) {
6029
6306
  const props = __props;
6030
6307
  const services = inject("services");
6031
6308
  const editorService = services?.editorService;
@@ -6160,10 +6437,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
6160
6437
  const data = await storageService.getItem(COPY_STORAGE_KEY);
6161
6438
  canPaste.value = data !== "undefined" && !!data;
6162
6439
  };
6163
- expose({ show });
6440
+ __expose({ show });
6164
6441
  return (_ctx, _cache) => {
6165
6442
  return openBlock(), createBlock(_sfc_main$c, {
6166
- "menu-data": unref(menuData),
6443
+ "menu-data": menuData.value,
6167
6444
  ref_key: "menu",
6168
6445
  ref: menu
6169
6446
  }, null, 8, ["menu-data"]);
@@ -6171,13 +6448,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
6171
6448
  }
6172
6449
  });
6173
6450
 
6174
- const __default__$1 = defineComponent({
6175
- name: "MEditorStage"
6176
- });
6177
6451
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6178
- ...__default__$1,
6452
+ ...{
6453
+ name: "MEditorStage"
6454
+ },
6455
+ __name: "Stage",
6179
6456
  props: {
6180
- stageContentMenu: null
6457
+ stageContentMenu: {}
6181
6458
  },
6182
6459
  setup(__props) {
6183
6460
  let stage = null;
@@ -6302,11 +6579,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6302
6579
  class: "m-editor-stage",
6303
6580
  ref_key: "stageWrap",
6304
6581
  ref: stageWrap,
6305
- width: unref(stageRect)?.width,
6306
- height: unref(stageRect)?.height,
6307
- "wrap-width": unref(stageContainerRect)?.width,
6308
- "wrap-height": unref(stageContainerRect)?.height,
6309
- zoom: unref(zoom),
6582
+ width: stageRect.value?.width,
6583
+ height: stageRect.value?.height,
6584
+ "wrap-width": stageContainerRect.value?.width,
6585
+ "wrap-height": stageContainerRect.value?.height,
6586
+ zoom: zoom.value,
6310
6587
  "correction-scroll-size": {
6311
6588
  width: 60,
6312
6589
  height: 50
@@ -6317,7 +6594,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6317
6594
  class: "m-editor-stage-container",
6318
6595
  ref_key: "stageContainer",
6319
6596
  ref: stageContainer,
6320
- style: normalizeStyle(`transform: scale(${unref(zoom)});`),
6597
+ style: normalizeStyle(`transform: scale(${zoom.value});`),
6321
6598
  onContextmenu: contextmenuHandler,
6322
6599
  onDrop: dropHandler,
6323
6600
  onDragover: dragoverHandler
@@ -6326,8 +6603,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6326
6603
  createVNode(_sfc_main$3, {
6327
6604
  ref_key: "menu",
6328
6605
  ref: menu,
6329
- "is-multi-select": unref(isMultiSelect),
6330
- "stage-content-menu": __props.stageContentMenu
6606
+ "is-multi-select": isMultiSelect.value,
6607
+ "stage-content-menu": _ctx.stageContentMenu
6331
6608
  }, null, 8, ["is-multi-select", "stage-content-menu"])
6332
6609
  ]))
6333
6610
  ]),
@@ -6337,13 +6614,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6337
6614
  }
6338
6615
  });
6339
6616
 
6340
- const __default__ = defineComponent({
6341
- name: "MEditorWorkspace"
6342
- });
6343
6617
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6344
- ...__default__,
6618
+ ...{
6619
+ name: "MEditorWorkspace"
6620
+ },
6621
+ __name: "Workspace",
6345
6622
  props: {
6346
- stageContentMenu: null
6623
+ stageContentMenu: {}
6347
6624
  },
6348
6625
  setup(__props) {
6349
6626
  const services = inject("services");
@@ -6455,9 +6732,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6455
6732
  }, [
6456
6733
  createVNode(_sfc_main$8),
6457
6734
  renderSlot(_ctx.$slots, "stage", {}, () => [
6458
- unref(page) ? (openBlock(), createBlock(_sfc_main$2, {
6735
+ page.value ? (openBlock(), createBlock(_sfc_main$2, {
6459
6736
  key: 0,
6460
- "stage-content-menu": __props.stageContentMenu
6737
+ "stage-content-menu": _ctx.stageContentMenu
6461
6738
  }, null, 8, ["stage-content-menu"])) : createCommentVNode("", true)
6462
6739
  ]),
6463
6740
  renderSlot(_ctx.$slots, "workspace-content"),
@@ -7560,7 +7837,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
7560
7837
  };
7561
7838
 
7562
7839
  const _sfc_main = defineComponent({
7563
- name: "m-editor",
7840
+ name: "MEditor",
7564
7841
  components: {
7565
7842
  TMagicNavMenu: _sfc_main$o,
7566
7843
  Sidebar: _sfc_main$9,
@@ -7607,6 +7884,14 @@ const _sfc_main = defineComponent({
7607
7884
  }
7608
7885
  });
7609
7886
 
7887
+ const _export_sfc = (sfc, props) => {
7888
+ const target = sfc.__vccOpts || sfc;
7889
+ for (const [key, val] of props) {
7890
+ target[key] = val;
7891
+ }
7892
+ return target;
7893
+ };
7894
+
7610
7895
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7611
7896
  const _component_TMagicNavMenu = resolveComponent("TMagicNavMenu");
7612
7897
  const _component_Sidebar = resolveComponent("Sidebar");
@@ -7707,16 +7992,17 @@ const index = {
7707
7992
  setConfig(option);
7708
7993
  app.component(Editor.name, Editor);
7709
7994
  app.component("m-fields-ui-select", _sfc_main$v);
7710
- app.component("m-fields-code-link", _sfc_main$C);
7711
- app.component("m-fields-vs-code", _sfc_main$D);
7995
+ app.component("m-fields-code-link", _sfc_main$D);
7996
+ app.component("m-fields-vs-code", _sfc_main$E);
7712
7997
  app.component("magic-code-editor", _sfc_main$u);
7713
- app.component("m-fields-code-select", _sfc_main$B);
7714
- app.component("m-fields-code-select-col", _sfc_main$z);
7998
+ app.component("m-fields-code-select", _sfc_main$C);
7999
+ app.component("m-fields-code-select-col", _sfc_main$A);
7715
8000
  app.component("m-fields-event-select", _sfc_main$x);
7716
- app.component("m-fields-data-source-fields", _sfc_main$y);
8001
+ app.component("m-fields-data-source-fields", _sfc_main$z);
7717
8002
  app.component("m-fields-key-value", _sfc_main$w);
8003
+ app.component("m-fields-data-source-input", _sfc_main$y);
7718
8004
  }
7719
8005
  };
7720
8006
 
7721
- export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$g as CodeBlockList, CodeDeleteErrorType, _sfc_main$B as CodeSelect, _sfc_main$z as CodeSelectCol, ColumnLayout, _sfc_main$d as ComponentListPanel, _sfc_main$c as ContentMenu, _sfc_main$y as DataSourceFields, _sfc_main$x as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$A as Icon, _sfc_main$w as KeyValue, Keys, LayerOffset, _sfc_main$a as LayerPanel, Layout, _sfc_main$s as LayoutContainer, _sfc_main$n as PropsPanel, _sfc_main$u as TMagicCodeEditor, Editor as TMagicEditor, _sfc_main$p as ToolButton, V_GUIDE_LINE_STORAGE_KEY, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, editorService, error, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, uiService, useStage, warn };
8007
+ export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$g as CodeBlockList, CodeDeleteErrorType, _sfc_main$C as CodeSelect, _sfc_main$A as CodeSelectCol, ColumnLayout, _sfc_main$d as ComponentListPanel, _sfc_main$c as ContentMenu, _sfc_main$z as DataSourceFields, _sfc_main$y as DataSourceInput, _sfc_main$x as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$B as Icon, _sfc_main$w as KeyValue, Keys, LayerOffset, _sfc_main$a as LayerPanel, Layout, _sfc_main$s as LayoutContainer, _sfc_main$n as PropsPanel, _sfc_main$u as TMagicCodeEditor, Editor as TMagicEditor, _sfc_main$p as ToolButton, V_GUIDE_LINE_STORAGE_KEY, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, editorService, error, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, uiService, useStage, warn };
7722
8008
  //# sourceMappingURL=tmagic-editor.js.map