@tmagic/editor 1.3.0-alpha.1 → 1.3.0-alpha.3

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 (91) hide show
  1. package/dist/tmagic-editor.js +853 -516
  2. package/dist/tmagic-editor.js.map +1 -1
  3. package/dist/tmagic-editor.umd.cjs +853 -515
  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 +6 -2
  19. package/src/fields/CodeSelectCol.vue +6 -2
  20. package/src/fields/DataSourceFields.vue +5 -1
  21. package/src/fields/DataSourceInput.vue +357 -0
  22. package/src/fields/EventSelect.vue +8 -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/initService.ts +67 -0
  29. package/src/layouts/AddPageBox.vue +5 -1
  30. package/src/layouts/CodeEditor.vue +5 -1
  31. package/src/layouts/Framework.vue +5 -1
  32. package/src/layouts/NavMenu.vue +5 -1
  33. package/src/layouts/PropsPanel.vue +5 -1
  34. package/src/layouts/Resizer.vue +5 -1
  35. package/src/layouts/sidebar/ComponentListPanel.vue +5 -1
  36. package/src/layouts/sidebar/LayerMenu.vue +5 -1
  37. package/src/layouts/sidebar/LayerPanel.vue +5 -1
  38. package/src/layouts/sidebar/Sidebar.vue +11 -7
  39. package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +5 -1
  40. package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -1
  41. package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +4 -0
  42. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +4 -0
  43. package/src/layouts/workspace/Breadcrumb.vue +5 -1
  44. package/src/layouts/workspace/PageBar.vue +5 -1
  45. package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
  46. package/src/layouts/workspace/Stage.vue +5 -1
  47. package/src/layouts/workspace/ViewerMenu.vue +5 -1
  48. package/src/layouts/workspace/Workspace.vue +5 -1
  49. package/src/services/dep.ts +3 -0
  50. package/types/Editor.vue.d.ts +1 -1
  51. package/types/components/CodeDraftEditor.vue.d.ts +6 -3
  52. package/types/components/ContentMenu.vue.d.ts +8 -5
  53. package/types/components/FunctionEditor.vue.d.ts +66 -45
  54. package/types/components/Icon.vue.d.ts +2 -2
  55. package/types/components/Layout.vue.d.ts +9 -6
  56. package/types/components/ScrollBar.vue.d.ts +1 -1
  57. package/types/components/ScrollViewer.vue.d.ts +8 -5
  58. package/types/components/SearchInput.vue.d.ts +1 -1
  59. package/types/components/ToolButton.vue.d.ts +8 -5
  60. package/types/fields/Code.vue.d.ts +1 -1
  61. package/types/fields/CodeLink.vue.d.ts +9 -9
  62. package/types/fields/CodeSelect.vue.d.ts +10 -7
  63. package/types/fields/CodeSelectCol.vue.d.ts +8 -5
  64. package/types/fields/DataSourceFields.vue.d.ts +8 -5
  65. package/types/fields/DataSourceInput.vue.d.ts +54 -0
  66. package/types/fields/EventSelect.vue.d.ts +3 -3
  67. package/types/fields/KeyValue.vue.d.ts +8 -5
  68. package/types/fields/UISelect.vue.d.ts +1 -1
  69. package/types/icons/AppManageIcon.vue.d.ts +1 -1
  70. package/types/icons/CodeIcon.vue.d.ts +1 -1
  71. package/types/index.d.ts +1 -0
  72. package/types/layouts/AddPageBox.vue.d.ts +1 -1
  73. package/types/layouts/CodeEditor.vue.d.ts +7 -4
  74. package/types/layouts/Framework.vue.d.ts +13 -10
  75. package/types/layouts/NavMenu.vue.d.ts +7 -4
  76. package/types/layouts/PropsPanel.vue.d.ts +2 -2
  77. package/types/layouts/Resizer.vue.d.ts +2 -2
  78. package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
  79. package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
  80. package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
  81. package/types/layouts/sidebar/Sidebar.vue.d.ts +18 -15
  82. package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +4 -4
  83. package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -7
  84. package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +1 -1
  85. package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +3 -3
  86. package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
  87. package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
  88. package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
  89. package/types/layouts/workspace/Stage.vue.d.ts +2 -2
  90. package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
  91. package/types/layouts/workspace/Workspace.vue.d.ts +8 -8
@@ -23,16 +23,16 @@
23
23
 
24
24
  const monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
25
25
 
26
- const __default__$w = vue.defineComponent({
27
- name: "MEditorCode"
28
- });
29
- const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
30
- ...__default__$w,
26
+ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
27
+ ...{
28
+ name: "MEditorCode"
29
+ },
30
+ __name: "Code",
31
31
  props: {
32
- model: null,
33
- name: null,
34
- config: null,
35
- prop: null
32
+ model: {},
33
+ name: {},
34
+ config: {},
35
+ prop: {}
36
36
  },
37
37
  emits: ["change"],
38
38
  setup(__props, { emit }) {
@@ -46,26 +46,26 @@
46
46
  return (_ctx, _cache) => {
47
47
  const _component_magic_code_editor = vue.resolveComponent("magic-code-editor");
48
48
  return vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
49
- style: vue.normalizeStyle(`height: ${vue.unref(height)}`),
50
- "init-values": __props.model[__props.name],
51
- language: vue.unref(language),
52
- options: __props.config.options,
49
+ style: vue.normalizeStyle(`height: ${height.value}`),
50
+ "init-values": _ctx.model[_ctx.name],
51
+ language: language.value,
52
+ options: _ctx.config.options,
53
53
  onSave: save
54
54
  }, null, 8, ["style", "init-values", "language", "options"]);
55
55
  };
56
56
  }
57
57
  });
58
58
 
59
- const __default__$v = vue.defineComponent({
60
- name: "MEditorCodeLink"
61
- });
62
- const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
63
- ...__default__$v,
59
+ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
60
+ ...{
61
+ name: "MEditorCodeLink"
62
+ },
63
+ __name: "CodeLink",
64
64
  props: {
65
- config: null,
66
- model: null,
67
- name: null,
68
- prop: null
65
+ config: {},
66
+ model: {},
67
+ name: {},
68
+ prop: {}
69
69
  },
70
70
  emits: ["change"],
71
71
  setup(__props, { emit }) {
@@ -120,7 +120,7 @@
120
120
  return (_ctx, _cache) => {
121
121
  const _component_m_fields_link = vue.resolveComponent("m-fields-link");
122
122
  return vue.openBlock(), vue.createBlock(_component_m_fields_link, {
123
- config: vue.unref(formConfig),
123
+ config: formConfig.value,
124
124
  model: modelValue,
125
125
  name: "form",
126
126
  onChange: changeHandler
@@ -129,17 +129,17 @@
129
129
  }
130
130
  });
131
131
 
132
- const __default__$u = vue.defineComponent({
133
- name: "MEditorCodeSelect"
134
- });
135
- const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
136
- ...__default__$u,
132
+ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
133
+ ...{
134
+ name: "MEditorCodeSelect"
135
+ },
136
+ __name: "CodeSelect",
137
137
  props: {
138
- config: null,
139
- model: null,
140
- prop: null,
141
- name: null,
142
- size: null
138
+ config: {},
139
+ model: {},
140
+ prop: {},
141
+ name: {},
142
+ size: {}
143
143
  },
144
144
  emits: ["change"],
145
145
  setup(__props, { emit }) {
@@ -175,13 +175,13 @@
175
175
  return (_ctx, _cache) => {
176
176
  const _component_m_form_container = vue.resolveComponent("m-form-container");
177
177
  return vue.openBlock(), vue.createElementBlock("div", {
178
- class: vue.normalizeClass(["m-fields-code-select", __props.config.className])
178
+ class: vue.normalizeClass(["m-fields-code-select", _ctx.config.className])
179
179
  }, [
180
180
  vue.createVNode(vue.unref(design.TMagicCard), null, {
181
181
  default: vue.withCtx(() => [
182
182
  vue.createVNode(_component_m_form_container, {
183
- config: vue.unref(codeConfig),
184
- model: __props.model[__props.name],
183
+ config: codeConfig.value,
184
+ model: _ctx.model[_ctx.name],
185
185
  onChange: changeHandler
186
186
  }, null, 8, ["config", "model"])
187
187
  ]),
@@ -192,18 +192,18 @@
192
192
  }
193
193
  });
194
194
 
195
- const _hoisted_1$n = ["src"];
196
- const __default__$t = vue.defineComponent({
197
- name: "MEditorIcon"
198
- });
199
- const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
200
- ...__default__$t,
195
+ const _hoisted_1$m = ["src"];
196
+ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
197
+ ...{
198
+ name: "MEditorIcon"
199
+ },
200
+ __name: "Icon",
201
201
  props: {
202
- icon: null
202
+ icon: {}
203
203
  },
204
204
  setup(__props) {
205
205
  return (_ctx, _cache) => {
206
- return !__props.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
206
+ return !_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
207
207
  key: 0,
208
208
  class: "magic-editor-icon"
209
209
  }, {
@@ -211,23 +211,23 @@
211
211
  vue.createVNode(vue.unref(iconsVue.Edit))
212
212
  ]),
213
213
  _: 1
214
- })) : typeof __props.icon === "string" && __props.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
214
+ })) : typeof _ctx.icon === "string" && _ctx.icon.startsWith("http") ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
215
215
  key: 1,
216
216
  class: "magic-editor-icon"
217
217
  }, {
218
218
  default: vue.withCtx(() => [
219
- vue.createElementVNode("img", { src: __props.icon }, null, 8, _hoisted_1$n)
219
+ vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$m)
220
220
  ]),
221
221
  _: 1
222
- })) : typeof __props.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
222
+ })) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
223
223
  key: 2,
224
- class: vue.normalizeClass(["magic-editor-icon", __props.icon])
224
+ class: vue.normalizeClass(["magic-editor-icon", _ctx.icon])
225
225
  }, null, 2)) : (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicIcon), {
226
226
  key: 3,
227
227
  class: "magic-editor-icon"
228
228
  }, {
229
229
  default: vue.withCtx(() => [
230
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(__props.icon))))
230
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.toRaw(_ctx.icon))))
231
231
  ]),
232
232
  _: 1
233
233
  }));
@@ -235,19 +235,19 @@
235
235
  }
236
236
  });
237
237
 
238
- const _hoisted_1$m = { class: "m-fields-code-select-col" };
238
+ const _hoisted_1$l = { class: "m-fields-code-select-col" };
239
239
  const _hoisted_2$e = { class: "code-select-container" };
240
- const __default__$s = vue.defineComponent({
241
- name: "MEditorCodeSelectCol"
242
- });
243
- const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
244
- ...__default__$s,
240
+ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
241
+ ...{
242
+ name: "MEditorCodeSelectCol"
243
+ },
244
+ __name: "CodeSelectCol",
245
245
  props: {
246
- config: null,
247
- model: null,
248
- prop: null,
249
- name: null,
250
- size: null
246
+ config: {},
247
+ model: {},
248
+ prop: {},
249
+ name: {},
250
+ size: {}
251
251
  },
252
252
  emits: ["change"],
253
253
  setup(__props, { emit }) {
@@ -329,23 +329,23 @@
329
329
  };
330
330
  return (_ctx, _cache) => {
331
331
  const _component_m_form_container = vue.resolveComponent("m-form-container");
332
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
332
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
333
333
  vue.createElementVNode("div", _hoisted_2$e, [
334
334
  vue.createVNode(_component_m_form_container, {
335
335
  class: "select",
336
336
  config: selectConfig,
337
- model: __props.model,
337
+ model: _ctx.model,
338
338
  onChange: onParamsChangeHandler
339
339
  }, null, 8, ["model"]),
340
- vue.createVNode(_sfc_main$A, {
340
+ vue.createVNode(_sfc_main$B, {
341
341
  class: "icon",
342
- icon: vue.unref(editable) ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
342
+ icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
343
343
  onClick: editCode
344
344
  }, null, 8, ["icon"])
345
345
  ]),
346
346
  vue.createVNode(_component_m_form_container, {
347
347
  config: codeParamsConfig.value,
348
- model: __props.model,
348
+ model: _ctx.model,
349
349
  onChange: onParamsChangeHandler
350
350
  }, null, 8, ["config", "model"])
351
351
  ]);
@@ -353,17 +353,19 @@
353
353
  }
354
354
  });
355
355
 
356
- const _hoisted_1$l = { class: "m-editor-data-source-fields" };
356
+ const _hoisted_1$k = { class: "m-editor-data-source-fields" };
357
357
  const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
358
- const _hoisted_3$8 = /* @__PURE__ */ vue.createTextVNode("添加");
359
- const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
358
+ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
359
+ ...{
360
+ name: "MEditorDataSourceFields"
361
+ },
360
362
  __name: "DataSourceFields",
361
363
  props: {
362
- config: null,
363
- model: null,
364
- prop: null,
364
+ config: {},
365
+ model: {},
366
+ prop: {},
365
367
  disabled: { type: Boolean, default: false },
366
- name: null
368
+ name: {}
367
369
  },
368
370
  emits: ["change"],
369
371
  setup(__props, { emit }) {
@@ -459,7 +461,7 @@
459
461
  {
460
462
  validator: ({ value, callback }, { model, parent }) => {
461
463
  const index = parent.findIndex((item) => item.name === value);
462
- if (model.index === -1 && index > -1 || model.index > -1 && index !== model.index) {
464
+ if (model.index === -1 && index > -1 || model.index > -1 && index > -1 && index !== model.index) {
463
465
  return callback(`属性key(${value})已存在`);
464
466
  }
465
467
  callback();
@@ -499,21 +501,21 @@
499
501
  }
500
502
  ];
501
503
  return (_ctx, _cache) => {
502
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
504
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
503
505
  vue.createVNode(vue.unref(table.MagicTable), {
504
- data: __props.model[__props.name],
506
+ data: _ctx.model[_ctx.name],
505
507
  columns: filedColumns
506
508
  }, null, 8, ["data"]),
507
509
  vue.createElementVNode("div", _hoisted_2$d, [
508
510
  vue.createVNode(vue.unref(design.TMagicButton), {
509
511
  size: "small",
510
512
  type: "primary",
511
- disabled: __props.disabled,
513
+ disabled: _ctx.disabled,
512
514
  plain: "",
513
515
  onClick: _cache[0] || (_cache[0] = ($event) => newHandler())
514
516
  }, {
515
517
  default: vue.withCtx(() => [
516
- _hoisted_3$8
518
+ vue.createTextVNode("添加")
517
519
  ]),
518
520
  _: 1
519
521
  }, 8, ["disabled"])
@@ -524,7 +526,7 @@
524
526
  title: filedTitle.value,
525
527
  config: dataSourceFieldsConfig,
526
528
  values: fieldValues.value,
527
- parentValues: __props.model[__props.name],
529
+ parentValues: _ctx.model[_ctx.name],
528
530
  onSubmit: fieldChange
529
531
  }, null, 8, ["title", "values", "parentValues"])
530
532
  ]);
@@ -532,23 +534,287 @@
532
534
  }
533
535
  });
534
536
 
535
- const _hoisted_1$k = { class: "m-fields-event-select" };
536
- const _hoisted_2$c = {
537
+ const _hoisted_1$j = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
538
+ const _hoisted_2$c = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
539
+ const _hoisted_3$5 = { class: "el-input__inner" };
540
+ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
541
+ ...{
542
+ name: "MEditorDataSourceInput"
543
+ },
544
+ __name: "DataSourceInput",
545
+ props: {
546
+ config: {},
547
+ model: {},
548
+ name: {},
549
+ prop: {},
550
+ disabled: { type: Boolean, default: false },
551
+ lastValues: {},
552
+ size: {}
553
+ },
554
+ emits: ["change"],
555
+ setup(__props, { emit }) {
556
+ const props = __props;
557
+ const { dataSourceService } = vue.inject("services") || {};
558
+ const autocomplete = vue.ref();
559
+ const isFocused = vue.ref(false);
560
+ const state = vue.ref("");
561
+ const displayState = vue.ref([]);
562
+ const input = vue.computed(() => autocomplete.value?.inputRef?.input);
563
+ const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
564
+ const setDisplayState = () => {
565
+ displayState.value = [];
566
+ const matches = state.value.matchAll(/\{\{([\s\S]+?)\}\}/g);
567
+ let index = 0;
568
+ for (const match of matches) {
569
+ if (typeof match.index === "undefined")
570
+ break;
571
+ displayState.value.push({
572
+ type: "text",
573
+ value: state.value.substring(index, match.index)
574
+ });
575
+ let dsText = "";
576
+ let ds;
577
+ let fields;
578
+ match[1].split(".").forEach((item, index2) => {
579
+ if (index2 === 0) {
580
+ ds = dataSources.value.find((ds2) => ds2.id === item);
581
+ dsText += ds?.title || item;
582
+ fields = ds?.fields;
583
+ return;
584
+ }
585
+ const field = fields?.find((field2) => field2.name === item);
586
+ fields = field?.fields;
587
+ dsText += `.${field?.title || item}`;
588
+ });
589
+ displayState.value.push({
590
+ type: "var",
591
+ value: dsText
592
+ });
593
+ index = match.index + match[0].length;
594
+ }
595
+ if (index < state.value.length) {
596
+ displayState.value.push({
597
+ type: "text",
598
+ value: state.value.substring(index)
599
+ });
600
+ }
601
+ };
602
+ vue.watch(
603
+ () => props.model[props.name],
604
+ (value = "") => {
605
+ state.value = value;
606
+ setDisplayState();
607
+ },
608
+ { immediate: true }
609
+ );
610
+ const mouseupHandler = async () => {
611
+ isFocused.value = true;
612
+ await vue.nextTick();
613
+ autocomplete.value?.focus();
614
+ };
615
+ const blurHandler = () => {
616
+ isFocused.value = false;
617
+ setDisplayState();
618
+ };
619
+ const changeHandler = (v) => {
620
+ emit("change", v);
621
+ };
622
+ let inputText = "";
623
+ const inputHandler = (v) => {
624
+ if (!v) {
625
+ inputText = v;
626
+ }
627
+ };
628
+ const isRightCurlyBracket = (selectionStart = 0) => {
629
+ const lastChar = inputText.substring(selectionStart - 1, selectionStart);
630
+ return lastChar === "}";
631
+ };
632
+ const getSelectionStart = () => {
633
+ let selectionStart = input.value?.selectionStart || 0;
634
+ if (isRightCurlyBracket(selectionStart)) {
635
+ selectionStart -= 1;
636
+ }
637
+ return selectionStart;
638
+ };
639
+ const curCharIsLeftCurlyBracket = (leftCurlyBracketIndex) => leftCurlyBracketIndex > -1 && leftCurlyBracketIndex === getSelectionStart() - 1;
640
+ const curCharIsDot = (dotIndex) => dotIndex > -1 && dotIndex === getSelectionStart() - 1;
641
+ const dsQuerySearch = (queryString, leftCurlyBracketIndex, cb) => {
642
+ let result = [];
643
+ if (curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
644
+ result = dataSources.value;
645
+ } else if (leftCurlyBracketIndex > -1) {
646
+ const queryName = queryString.substring(leftCurlyBracketIndex + 1).toLowerCase();
647
+ result = dataSources.value.filter((ds) => ds.title?.toLowerCase().includes(queryName) || ds.id.includes(queryName));
648
+ }
649
+ cb(
650
+ result.map((ds) => ({
651
+ value: ds.id,
652
+ text: ds.title,
653
+ type: "dataSource"
654
+ }))
655
+ );
656
+ };
657
+ const fieldQuerySearch = (queryString, leftAngleIndex, dotIndex, cb) => {
658
+ let result = [];
659
+ const dsKey = queryString.substring(leftAngleIndex + 1, dotIndex);
660
+ const keys = dsKey.split(".");
661
+ const ds = dataSources.value.find((ds2) => ds2.id === keys.shift());
662
+ if (!ds) {
663
+ return;
664
+ }
665
+ let fields = ds.fields || [];
666
+ let key = keys.shift();
667
+ while (key) {
668
+ for (const field of fields) {
669
+ if (field.name === key) {
670
+ fields = field.fields || [];
671
+ key = keys.shift();
672
+ break;
673
+ }
674
+ }
675
+ }
676
+ if (curCharIsDot(dotIndex)) {
677
+ result = fields || [];
678
+ } else if (dotIndex > -1) {
679
+ const queryName = queryString.substring(dotIndex + 1).toLowerCase();
680
+ result = fields.filter(
681
+ (field) => field.name?.toLowerCase().includes(queryName) || field.title?.toLowerCase().includes(queryName)
682
+ ) || [];
683
+ }
684
+ cb(
685
+ result.map((field) => ({
686
+ value: field.name,
687
+ text: field.title,
688
+ type: "field"
689
+ }))
690
+ );
691
+ };
692
+ const querySearch = (queryString, cb) => {
693
+ inputText = queryString;
694
+ const selectionStart = getSelectionStart();
695
+ const curQueryString = queryString.substring(0, selectionStart);
696
+ const fieldKeyStringLastIndex = curQueryString.lastIndexOf(".");
697
+ const dsKeyStringLastIndex = curQueryString.lastIndexOf("{");
698
+ const isFieldTip = fieldKeyStringLastIndex > dsKeyStringLastIndex;
699
+ if (isFieldTip) {
700
+ fieldQuerySearch(curQueryString, dsKeyStringLastIndex, fieldKeyStringLastIndex, cb);
701
+ } else {
702
+ dsQuerySearch(curQueryString, dsKeyStringLastIndex, cb);
703
+ }
704
+ };
705
+ const selectHandler = async ({ value, type }) => {
706
+ const isDataSource = type === "dataSource";
707
+ const selectionStart = input.value?.selectionStart || 0;
708
+ let startText = inputText.substring(0, selectionStart);
709
+ const dotIndex = startText.lastIndexOf(".");
710
+ const leftCurlyBracketIndex = startText.lastIndexOf("{");
711
+ const endText = inputText.substring(selectionStart);
712
+ let suggestText = value;
713
+ if (isDataSource) {
714
+ if (!curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
715
+ startText = startText.substring(0, leftCurlyBracketIndex + 1);
716
+ }
717
+ if (!isRightCurlyBracket(selectionStart + 1)) {
718
+ suggestText = `${suggestText}}`;
719
+ }
720
+ suggestText = `{${suggestText}}`;
721
+ } else if (!curCharIsDot(dotIndex)) {
722
+ startText = startText.substring(0, dotIndex + 1);
723
+ }
724
+ state.value = `${startText}${suggestText}${endText}`;
725
+ await vue.nextTick();
726
+ let newSelectionStart = 0;
727
+ if (isDataSource) {
728
+ newSelectionStart = leftCurlyBracketIndex + suggestText.length - 1;
729
+ } else {
730
+ newSelectionStart = dotIndex + suggestText.length + 1;
731
+ }
732
+ input.value?.setSelectionRange(newSelectionStart, newSelectionStart);
733
+ };
734
+ return (_ctx, _cache) => {
735
+ return _ctx.disabled || isFocused.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(design.getConfig)("components")?.autocomplete.component || "el-autocomplete"), vue.mergeProps(
736
+ {
737
+ key: 0,
738
+ class: "tmagic-design-auto-complete",
739
+ ref_key: "autocomplete",
740
+ ref: autocomplete,
741
+ modelValue: state.value,
742
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
743
+ },
744
+ vue.unref(design.getConfig)("components")?.autocomplete.props({
745
+ disabled: _ctx.disabled,
746
+ size: _ctx.size,
747
+ fetchSuggestions: querySearch,
748
+ triggerOnFocus: false,
749
+ clearable: true
750
+ }) || {},
751
+ {
752
+ style: { "width": "100%" },
753
+ onBlur: blurHandler,
754
+ onChange: changeHandler,
755
+ onInput: inputHandler,
756
+ onSelect: selectHandler
757
+ }
758
+ ), {
759
+ suffix: vue.withCtx(() => [
760
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
761
+ ]),
762
+ default: vue.withCtx(({ item }) => [
763
+ vue.createElementVNode("div", _hoisted_1$j, [
764
+ vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
765
+ vue.createElementVNode("span", _hoisted_2$c, vue.toDisplayString(item.value), 1)
766
+ ])
767
+ ]),
768
+ _: 1
769
+ }, 16, ["modelValue"])) : (vue.openBlock(), vue.createElementBlock("div", {
770
+ key: 1,
771
+ class: vue.normalizeClass(`el-input el-input--${_ctx.size}`),
772
+ onMouseup: mouseupHandler
773
+ }, [
774
+ vue.createElementVNode("div", {
775
+ class: vue.normalizeClass(`el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
776
+ }, [
777
+ vue.createElementVNode("div", _hoisted_3$5, [
778
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(displayState.value, (item, index) => {
779
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
780
+ item.type === "text" ? (vue.openBlock(), vue.createElementBlock("span", {
781
+ key: index,
782
+ style: { "margin-right": "2px" }
783
+ }, vue.toDisplayString(item.value), 1)) : vue.createCommentVNode("", true),
784
+ item.type === "var" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTag), {
785
+ key: index,
786
+ size: _ctx.size
787
+ }, {
788
+ default: vue.withCtx(() => [
789
+ vue.createTextVNode(vue.toDisplayString(item.value), 1)
790
+ ]),
791
+ _: 2
792
+ }, 1032, ["size"])) : vue.createCommentVNode("", true)
793
+ ], 64);
794
+ }), 256))
795
+ ])
796
+ ], 2)
797
+ ], 34));
798
+ };
799
+ }
800
+ });
801
+
802
+ const _hoisted_1$i = { class: "m-fields-event-select" };
803
+ const _hoisted_2$b = {
537
804
  key: 1,
538
805
  class: "fullWidth"
539
806
  };
540
- const _hoisted_3$7 = /* @__PURE__ */ vue.createTextVNode("添加事件");
541
- const __default__$r = vue.defineComponent({
542
- name: "MEditorEventSelect"
543
- });
544
807
  const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
545
- ...__default__$r,
808
+ ...{
809
+ name: "MEditorEventSelect"
810
+ },
811
+ __name: "EventSelect",
546
812
  props: {
547
- config: null,
548
- model: null,
549
- prop: null,
550
- name: null,
551
- size: null
813
+ config: {},
814
+ model: {},
815
+ prop: {},
816
+ name: {},
817
+ size: {}
552
818
  },
553
819
  emits: ["change"],
554
820
  setup(__props, { emit }) {
@@ -699,16 +965,16 @@
699
965
  const _component_m_form_table = vue.resolveComponent("m-form-table");
700
966
  const _component_m_form_container = vue.resolveComponent("m-form-container");
701
967
  const _component_m_form_panel = vue.resolveComponent("m-form-panel");
702
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
703
- vue.unref(isOldVersion) ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
968
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
969
+ isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
704
970
  key: 0,
705
971
  ref: "eventForm",
706
972
  size: props.size,
707
- model: __props.model,
973
+ model: _ctx.model,
708
974
  name: "events",
709
- config: vue.unref(tableConfig),
975
+ config: tableConfig.value,
710
976
  onChange: onChangeHandler
711
- }, null, 8, ["size", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
977
+ }, null, 8, ["size", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, [
712
978
  vue.createVNode(vue.unref(design.TMagicButton), {
713
979
  class: "create-button",
714
980
  type: "primary",
@@ -716,21 +982,21 @@
716
982
  onClick: _cache[0] || (_cache[0] = ($event) => addEvent())
717
983
  }, {
718
984
  default: vue.withCtx(() => [
719
- _hoisted_3$7
985
+ vue.createTextVNode("添加事件")
720
986
  ]),
721
987
  _: 1
722
988
  }),
723
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.model[__props.name], (cardItem, index) => {
989
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.model[_ctx.name], (cardItem, index) => {
724
990
  return vue.openBlock(), vue.createBlock(_component_m_form_panel, {
725
991
  key: index,
726
- config: vue.unref(actionsConfig),
992
+ config: actionsConfig.value,
727
993
  model: cardItem,
728
994
  onChange: onChangeHandler
729
995
  }, {
730
996
  header: vue.withCtx(() => [
731
997
  vue.createVNode(_component_m_form_container, {
732
998
  class: "fullWidth",
733
- config: vue.unref(eventNameConfig),
999
+ config: eventNameConfig.value,
734
1000
  model: cardItem,
735
1001
  onChange: onChangeHandler
736
1002
  }, null, 8, ["config", "model"]),
@@ -750,19 +1016,21 @@
750
1016
  }
751
1017
  });
752
1018
 
753
- const _hoisted_1$j = { class: "m-fields-key-value" };
754
- const _hoisted_2$b = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
755
- const _hoisted_3$6 = /* @__PURE__ */ vue.createTextVNode("添加");
1019
+ const _hoisted_1$h = { class: "m-fields-key-value" };
1020
+ const _hoisted_2$a = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
756
1021
  const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
1022
+ ...{
1023
+ name: "MEditorKeyValue"
1024
+ },
757
1025
  __name: "KeyValue",
758
1026
  props: {
759
- config: null,
760
- model: null,
761
- name: null,
762
- prop: null,
1027
+ config: {},
1028
+ model: {},
1029
+ name: {},
1030
+ prop: {},
763
1031
  disabled: { type: Boolean, default: false },
764
- lastValues: null,
765
- size: null
1032
+ lastValues: {},
1033
+ size: {}
766
1034
  },
767
1035
  emits: ["change"],
768
1036
  setup(__props, { emit }) {
@@ -793,7 +1061,7 @@
793
1061
  records.value.splice(index, 1);
794
1062
  };
795
1063
  return (_ctx, _cache) => {
796
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
1064
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
797
1065
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
798
1066
  return vue.openBlock(), vue.createElementBlock("div", {
799
1067
  class: "m-fields-key-value-item",
@@ -803,23 +1071,23 @@
803
1071
  placeholder: "key",
804
1072
  modelValue: records.value[index][0],
805
1073
  "onUpdate:modelValue": ($event) => records.value[index][0] = $event,
806
- disabled: __props.disabled,
807
- size: __props.size,
1074
+ disabled: _ctx.disabled,
1075
+ size: _ctx.size,
808
1076
  onChange: keyChangeHandler
809
1077
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
810
- _hoisted_2$b,
1078
+ _hoisted_2$a,
811
1079
  vue.createVNode(vue.unref(design.TMagicInput), {
812
1080
  placeholder: "value",
813
1081
  modelValue: records.value[index][1],
814
1082
  "onUpdate:modelValue": ($event) => records.value[index][1] = $event,
815
- disabled: __props.disabled,
816
- size: __props.size,
1083
+ disabled: _ctx.disabled,
1084
+ size: _ctx.size,
817
1085
  onChange: valueChangeHandler
818
1086
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
819
1087
  vue.createVNode(vue.unref(design.TMagicButton), {
820
1088
  class: "m-fileds-key-value-delete",
821
1089
  type: "danger",
822
- size: __props.size,
1090
+ size: _ctx.size,
823
1091
  circle: "",
824
1092
  plain: "",
825
1093
  icon: vue.unref(iconsVue.Delete),
@@ -829,13 +1097,13 @@
829
1097
  }), 128)),
830
1098
  vue.createVNode(vue.unref(design.TMagicButton), {
831
1099
  type: "primary",
832
- size: __props.size,
1100
+ size: _ctx.size,
833
1101
  plain: "",
834
1102
  icon: vue.unref(iconsVue.Plus),
835
1103
  onClick: addHandler
836
1104
  }, {
837
1105
  default: vue.withCtx(() => [
838
- _hoisted_3$6
1106
+ vue.createTextVNode("添加")
839
1107
  ]),
840
1108
  _: 1
841
1109
  }, 8, ["size", "icon"])
@@ -844,17 +1112,16 @@
844
1112
  }
845
1113
  });
846
1114
 
847
- const _hoisted_1$i = /* @__PURE__ */ vue.createTextVNode("取消");
848
- const __default__$q = vue.defineComponent({
849
- name: "MEditorUISelect"
850
- });
851
1115
  const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
852
- ...__default__$q,
1116
+ ...{
1117
+ name: "MEditorUISelect"
1118
+ },
1119
+ __name: "UISelect",
853
1120
  props: {
854
- config: null,
855
- model: null,
856
- prop: null,
857
- name: null
1121
+ config: {},
1122
+ model: {},
1123
+ prop: {},
1124
+ name: {}
858
1125
  },
859
1126
  emits: ["change"],
860
1127
  setup(__props, { emit }) {
@@ -911,7 +1178,7 @@
911
1178
  style: { "padding": "0" }
912
1179
  }, {
913
1180
  default: vue.withCtx(() => [
914
- _hoisted_1$i
1181
+ vue.createTextVNode("取消")
915
1182
  ]),
916
1183
  _: 1
917
1184
  }, 8, ["icon"])
@@ -921,7 +1188,7 @@
921
1188
  onClick: startSelect,
922
1189
  style: { "display": "flex" }
923
1190
  }, [
924
- vue.unref(val) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
1191
+ val.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
925
1192
  key: 0,
926
1193
  content: "清除"
927
1194
  }, {
@@ -937,7 +1204,7 @@
937
1204
  _: 1
938
1205
  })) : vue.createCommentVNode("", true),
939
1206
  vue.createVNode(vue.unref(design.TMagicTooltip), {
940
- content: vue.unref(val) ? vue.unref(toName) + "_" + vue.unref(val) : "点击此处选择"
1207
+ content: val.value ? toName.value + "_" + val.value : "点击此处选择"
941
1208
  }, {
942
1209
  default: vue.withCtx(() => [
943
1210
  vue.createVNode(vue.unref(design.TMagicButton), {
@@ -945,7 +1212,7 @@
945
1212
  style: { "padding": "0", "margin": "0" }
946
1213
  }, {
947
1214
  default: vue.withCtx(() => [
948
- vue.createTextVNode(vue.toDisplayString(vue.unref(val) ? vue.unref(toName) + "_" + vue.unref(val) : "点击此处选择"), 1)
1215
+ vue.createTextVNode(vue.toDisplayString(val.value ? toName.value + "_" + val.value : "点击此处选择"), 1)
949
1216
  ]),
950
1217
  _: 1
951
1218
  })
@@ -959,15 +1226,15 @@
959
1226
 
960
1227
  const UISelect_vue_vue_type_style_index_0_lang = '';
961
1228
 
962
- const __default__$p = vue.defineComponent({
963
- name: "MEditorCodeEditor"
964
- });
965
1229
  const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
966
- ...__default__$p,
1230
+ ...{
1231
+ name: "MEditorCodeEditor"
1232
+ },
1233
+ __name: "CodeEditor",
967
1234
  props: {
968
- initValues: null,
969
- modifiedValues: null,
970
- type: null,
1235
+ initValues: {},
1236
+ modifiedValues: {},
1237
+ type: {},
971
1238
  language: { default: "javascript" },
972
1239
  options: { default: () => ({
973
1240
  tabSize: 2
@@ -975,7 +1242,7 @@
975
1242
  autoSave: { type: Boolean, default: true }
976
1243
  },
977
1244
  emits: ["initd", "save"],
978
- setup(__props, { expose, emit }) {
1245
+ setup(__props, { expose: __expose, emit }) {
979
1246
  const props = __props;
980
1247
  const toString = (v, language) => {
981
1248
  let value = "";
@@ -1066,7 +1333,7 @@
1066
1333
  vue.onUnmounted(() => {
1067
1334
  resizeObserver.disconnect();
1068
1335
  });
1069
- expose({
1336
+ __expose({
1070
1337
  getEditor() {
1071
1338
  return vsEditor || vsDiffEditor;
1072
1339
  },
@@ -1092,11 +1359,11 @@
1092
1359
  };
1093
1360
  const getConfig = (key) => $TMAGIC_EDITOR[key];
1094
1361
 
1095
- const __default__$o = vue.defineComponent({
1096
- name: "MEditorResizer"
1097
- });
1098
1362
  const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
1099
- ...__default__$o,
1363
+ ...{
1364
+ name: "MEditorResizer"
1365
+ },
1366
+ __name: "Resizer",
1100
1367
  emits: ["change"],
1101
1368
  setup(__props, { emit }) {
1102
1369
  const target = vue.ref();
@@ -1128,20 +1395,20 @@
1128
1395
  }
1129
1396
  });
1130
1397
 
1131
- const __default__$n = vue.defineComponent({
1132
- name: "MEditorLayout"
1133
- });
1134
1398
  const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
1135
- ...__default__$n,
1399
+ ...{
1400
+ name: "MEditorLayout"
1401
+ },
1402
+ __name: "Layout",
1136
1403
  props: {
1137
- left: null,
1138
- right: null,
1404
+ left: {},
1405
+ right: {},
1139
1406
  minLeft: { default: 46 },
1140
1407
  minRight: { default: 1 },
1141
1408
  minCenter: { default: 5 },
1142
- leftClass: null,
1143
- rightClass: null,
1144
- centerClass: null
1409
+ leftClass: {},
1410
+ rightClass: {},
1411
+ centerClass: {}
1145
1412
  },
1146
1413
  emits: ["update:left", "change", "update:right"],
1147
1414
  setup(__props, { emit }) {
@@ -1233,26 +1500,26 @@
1233
1500
  ref: el,
1234
1501
  class: "m-editor-layout"
1235
1502
  }, [
1236
- vue.unref(hasLeft) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1503
+ hasLeft.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1237
1504
  vue.createElementVNode("div", {
1238
- class: vue.normalizeClass(["m-editor-layout-left", __props.leftClass]),
1239
- style: vue.normalizeStyle(`width: ${__props.left}px`)
1505
+ class: vue.normalizeClass(["m-editor-layout-left", _ctx.leftClass]),
1506
+ style: vue.normalizeStyle(`width: ${_ctx.left}px`)
1240
1507
  }, [
1241
1508
  vue.renderSlot(_ctx.$slots, "left")
1242
1509
  ], 6),
1243
1510
  vue.createVNode(_sfc_main$t, { onChange: changeLeft })
1244
1511
  ], 64)) : vue.createCommentVNode("", true),
1245
1512
  vue.createElementVNode("div", {
1246
- class: vue.normalizeClass(["m-editor-layout-center", __props.centerClass]),
1513
+ class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
1247
1514
  style: vue.normalizeStyle(`width: ${center.value}px`)
1248
1515
  }, [
1249
1516
  vue.renderSlot(_ctx.$slots, "center")
1250
1517
  ], 6),
1251
- vue.unref(hasRight) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
1518
+ hasRight.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
1252
1519
  vue.createVNode(_sfc_main$t, { onChange: changeRight }),
1253
1520
  vue.createElementVNode("div", {
1254
- class: vue.normalizeClass(["m-editor-layout-right", __props.rightClass]),
1255
- style: vue.normalizeStyle(`width: ${__props.right}px`)
1521
+ class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
1522
+ style: vue.normalizeStyle(`width: ${_ctx.right}px`)
1256
1523
  }, [
1257
1524
  vue.renderSlot(_ctx.$slots, "right")
1258
1525
  ], 6)
@@ -3116,14 +3383,14 @@
3116
3383
  return stage;
3117
3384
  };
3118
3385
 
3119
- const _hoisted_1$h = { class: "m-editor-empty-panel" };
3120
- const _hoisted_2$a = { class: "m-editor-empty-content" };
3121
- const _hoisted_3$5 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
3122
- const __default__$m = vue.defineComponent({
3123
- name: "MEditorAddPageBox"
3124
- });
3386
+ const _hoisted_1$g = { class: "m-editor-empty-panel" };
3387
+ const _hoisted_2$9 = { class: "m-editor-empty-content" };
3388
+ const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
3125
3389
  const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
3126
- ...__default__$m,
3390
+ ...{
3391
+ name: "MEditorAddPageBox"
3392
+ },
3393
+ __name: "AddPageBox",
3127
3394
  setup(__props) {
3128
3395
  const services = vue.inject("services");
3129
3396
  const clickHandler = () => {
@@ -3139,16 +3406,16 @@
3139
3406
  });
3140
3407
  };
3141
3408
  return (_ctx, _cache) => {
3142
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
3143
- vue.createElementVNode("div", _hoisted_2$a, [
3409
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
3410
+ vue.createElementVNode("div", _hoisted_2$9, [
3144
3411
  vue.createElementVNode("div", {
3145
3412
  class: "m-editor-empty-button",
3146
3413
  onClick: clickHandler
3147
3414
  }, [
3148
3415
  vue.createElementVNode("div", null, [
3149
- vue.createVNode(_sfc_main$A, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
3416
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
3150
3417
  ]),
3151
- _hoisted_3$5
3418
+ _hoisted_3$4
3152
3419
  ])
3153
3420
  ])
3154
3421
  ]);
@@ -3156,25 +3423,25 @@
3156
3423
  }
3157
3424
  });
3158
3425
 
3159
- const _hoisted_1$g = { class: "m-editor" };
3160
- const __default__$l = vue.defineComponent({
3161
- name: "MEditorFramework"
3162
- });
3426
+ const _hoisted_1$f = { class: "m-editor" };
3427
+ const DEFAULT_LEFT_COLUMN_WIDTH = 310;
3428
+ const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
3429
+ const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
3430
+ const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
3163
3431
  const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
3164
- ...__default__$l,
3432
+ ...{
3433
+ name: "MEditorFramework"
3434
+ },
3435
+ __name: "Framework",
3165
3436
  props: {
3166
3437
  codeOptions: { default: () => ({}) }
3167
3438
  },
3168
3439
  setup(__props) {
3169
- const DEFAULT_LEFT_COLUMN_WIDTH = 310;
3170
- const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
3171
3440
  const { editorService, uiService } = vue.inject("services") || {};
3172
3441
  const root = vue.computed(() => editorService?.get("root"));
3173
3442
  const nodes = vue.computed(() => editorService?.get("nodes") || []);
3174
3443
  const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
3175
3444
  const showSrc = vue.computed(() => uiService?.get("showSrc"));
3176
- const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
3177
- const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
3178
3445
  const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
3179
3446
  const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY));
3180
3447
  const columnWidth = vue.ref({
@@ -3230,13 +3497,13 @@
3230
3497
  };
3231
3498
  return (_ctx, _cache) => {
3232
3499
  const _component_magic_code_editor = vue.resolveComponent("magic-code-editor");
3233
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
3500
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
3234
3501
  vue.renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
3235
- vue.unref(showSrc) ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
3502
+ showSrc.value ? (vue.openBlock(), vue.createBlock(_component_magic_code_editor, {
3236
3503
  key: 0,
3237
3504
  class: "m-editor-content",
3238
- "init-values": vue.unref(root),
3239
- options: __props.codeOptions,
3505
+ "init-values": root.value,
3506
+ options: _ctx.codeOptions,
3240
3507
  onSave: saveCode
3241
3508
  }, null, 8, ["init-values", "options"])) : (vue.openBlock(), vue.createBlock(_sfc_main$s, {
3242
3509
  key: 1,
@@ -3256,13 +3523,13 @@
3256
3523
  vue.renderSlot(_ctx.$slots, "sidebar")
3257
3524
  ]),
3258
3525
  center: vue.withCtx(() => [
3259
- vue.unref(pageLength) > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
3526
+ pageLength.value > 0 ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
3260
3527
  vue.createVNode(_sfc_main$r)
3261
3528
  ])
3262
3529
  ]),
3263
3530
  _: 2
3264
3531
  }, [
3265
- vue.unref(pageLength) > 0 && vue.unref(nodes).length === 1 ? {
3532
+ pageLength.value > 0 && nodes.value.length === 1 ? {
3266
3533
  name: "right",
3267
3534
  fn: vue.withCtx(() => [
3268
3535
  vue.createVNode(vue.unref(design.TMagicScrollbar), null, {
@@ -3271,7 +3538,8 @@
3271
3538
  ]),
3272
3539
  _: 3
3273
3540
  })
3274
- ])
3541
+ ]),
3542
+ key: "0"
3275
3543
  } : void 0
3276
3544
  ]), 1032, ["left", "right"]))
3277
3545
  ]);
@@ -3279,16 +3547,16 @@
3279
3547
  }
3280
3548
  });
3281
3549
 
3282
- const _hoisted_1$f = {
3550
+ const _hoisted_1$e = {
3283
3551
  key: 1,
3284
3552
  class: "menu-item-text"
3285
3553
  };
3286
- const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
3287
- const __default__$k = vue.defineComponent({
3288
- name: "MEditorToolButton"
3289
- });
3554
+ const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
3290
3555
  const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
3291
- ...__default__$k,
3556
+ ...{
3557
+ name: "MEditorToolButton"
3558
+ },
3559
+ __name: "ToolButton",
3292
3560
  props: {
3293
3561
  data: { default: () => ({
3294
3562
  type: "text",
@@ -3353,35 +3621,35 @@
3353
3621
  }
3354
3622
  };
3355
3623
  return (_ctx, _cache) => {
3356
- return vue.unref(display) ? (vue.openBlock(), vue.createElementBlock("div", {
3624
+ return display.value ? (vue.openBlock(), vue.createElementBlock("div", {
3357
3625
  key: 0,
3358
- class: vue.normalizeClass(["menu-item", `${__props.data.type} ${__props.data.className || ""}`]),
3359
- onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(__props.data, $event)),
3360
- onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(__props.data, $event)),
3361
- onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(__props.data, $event))
3626
+ class: vue.normalizeClass(["menu-item", `${_ctx.data.type} ${_ctx.data.className || ""}`]),
3627
+ onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(_ctx.data, $event)),
3628
+ onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
3629
+ onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
3362
3630
  }, [
3363
- __props.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
3631
+ _ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDivider), {
3364
3632
  key: 0,
3365
- direction: __props.data.direction || "vertical"
3366
- }, null, 8, ["direction"])) : __props.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, vue.toDisplayString(__props.data.text), 1)) : __props.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
3367
- __props.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3633
+ direction: _ctx.data.direction || "vertical"
3634
+ }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
3635
+ _ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
3368
3636
  key: 0,
3369
3637
  effect: "dark",
3370
3638
  placement: "bottom-start",
3371
- content: __props.data.tooltip
3639
+ content: _ctx.data.tooltip
3372
3640
  }, {
3373
3641
  default: vue.withCtx(() => [
3374
3642
  vue.createVNode(vue.unref(design.TMagicButton), {
3375
3643
  size: "small",
3376
3644
  text: "",
3377
- disabled: vue.unref(disabled)
3645
+ disabled: disabled.value
3378
3646
  }, {
3379
3647
  default: vue.withCtx(() => [
3380
- __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
3648
+ _ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$B, {
3381
3649
  key: 0,
3382
- icon: __props.data.icon
3650
+ icon: _ctx.data.icon
3383
3651
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
3384
- vue.createElementVNode("span", null, vue.toDisplayString(__props.data.text), 1)
3652
+ vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
3385
3653
  ]),
3386
3654
  _: 1
3387
3655
  }, 8, ["disabled"])
@@ -3391,30 +3659,30 @@
3391
3659
  key: 1,
3392
3660
  size: "small",
3393
3661
  text: "",
3394
- disabled: vue.unref(disabled)
3662
+ disabled: disabled.value
3395
3663
  }, {
3396
3664
  default: vue.withCtx(() => [
3397
- __props.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
3665
+ _ctx.data.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$B, {
3398
3666
  key: 0,
3399
- icon: __props.data.icon
3667
+ icon: _ctx.data.icon
3400
3668
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
3401
- vue.createElementVNode("span", null, vue.toDisplayString(__props.data.text), 1)
3669
+ vue.createElementVNode("span", null, vue.toDisplayString(_ctx.data.text), 1)
3402
3670
  ]),
3403
3671
  _: 1
3404
3672
  }, 8, ["disabled"]))
3405
- ], 64)) : __props.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
3673
+ ], 64)) : _ctx.data.type === "dropdown" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdown), {
3406
3674
  key: 3,
3407
3675
  trigger: "click",
3408
- disabled: vue.unref(disabled),
3676
+ disabled: disabled.value,
3409
3677
  onCommand: dropdownHandler
3410
3678
  }, {
3411
3679
  dropdown: vue.withCtx(() => [
3412
- __props.data.items && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
3680
+ _ctx.data.items && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownMenu), { key: 0 }, {
3413
3681
  default: vue.withCtx(() => [
3414
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.data.items, (subItem, index) => {
3682
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.data.items, (subItem, index) => {
3415
3683
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDropdownItem), {
3416
3684
  key: index,
3417
- command: { data: __props.data, subItem }
3685
+ command: { data: _ctx.data, subItem }
3418
3686
  }, {
3419
3687
  default: vue.withCtx(() => [
3420
3688
  vue.createTextVNode(vue.toDisplayString(subItem.text), 1)
@@ -3427,8 +3695,8 @@
3427
3695
  })) : vue.createCommentVNode("", true)
3428
3696
  ]),
3429
3697
  default: vue.withCtx(() => [
3430
- vue.createElementVNode("span", _hoisted_2$9, [
3431
- vue.createTextVNode(vue.toDisplayString(__props.data.text), 1),
3698
+ vue.createElementVNode("span", _hoisted_2$8, [
3699
+ vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
3432
3700
  vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
3433
3701
  default: vue.withCtx(() => [
3434
3702
  vue.createVNode(vue.unref(iconsVue.ArrowDown))
@@ -3438,17 +3706,17 @@
3438
3706
  ])
3439
3707
  ]),
3440
3708
  _: 1
3441
- }, 8, ["disabled"])) : __props.data.type === "component" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.data.component), vue.normalizeProps(vue.mergeProps({ key: 4 }, __props.data.props || {})), null, 16)) : vue.createCommentVNode("", true)
3709
+ }, 8, ["disabled"])) : _ctx.data.type === "component" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.data.component), vue.normalizeProps(vue.mergeProps({ key: 4 }, _ctx.data.props || {})), null, 16)) : vue.createCommentVNode("", true)
3442
3710
  ], 34)) : vue.createCommentVNode("", true);
3443
3711
  };
3444
3712
  }
3445
3713
  });
3446
3714
 
3447
- const __default__$j = vue.defineComponent({
3448
- name: "MEditorNavMenu"
3449
- });
3450
3715
  const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
3451
- ...__default__$j,
3716
+ ...{
3717
+ name: "MEditorNavMenu"
3718
+ },
3719
+ __name: "NavMenu",
3452
3720
  props: {
3453
3721
  data: { default: () => ({}) },
3454
3722
  height: { default: 35 }
@@ -3597,15 +3865,15 @@
3597
3865
  return (_ctx, _cache) => {
3598
3866
  return vue.openBlock(), vue.createElementBlock("div", {
3599
3867
  class: "m-editor-nav-menu",
3600
- style: vue.normalizeStyle({ height: `${__props.height}px` })
3868
+ style: vue.normalizeStyle({ height: `${_ctx.height}px` })
3601
3869
  }, [
3602
3870
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(keys), (key) => {
3603
3871
  return vue.openBlock(), vue.createElementBlock("div", {
3604
3872
  class: vue.normalizeClass(`menu-${key}`),
3605
3873
  key,
3606
- style: vue.normalizeStyle(`width: ${vue.unref(columnWidth)?.[key]}px`)
3874
+ style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
3607
3875
  }, [
3608
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(buttons)[key], (item, index) => {
3876
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
3609
3877
  return vue.openBlock(), vue.createBlock(_sfc_main$p, {
3610
3878
  data: item,
3611
3879
  key: index
@@ -3618,14 +3886,14 @@
3618
3886
  }
3619
3887
  });
3620
3888
 
3621
- const _hoisted_1$e = { class: "m-editor-props-panel" };
3622
- const __default__$i = vue.defineComponent({
3623
- name: "MEditorPropsPanel"
3624
- });
3889
+ const _hoisted_1$d = { class: "m-editor-props-panel" };
3625
3890
  const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
3626
- ...__default__$i,
3891
+ ...{
3892
+ name: "MEditorPropsPanel"
3893
+ },
3894
+ __name: "PropsPanel",
3627
3895
  emits: ["mounted"],
3628
- setup(__props, { expose, emit }) {
3896
+ setup(__props, { expose: __expose, emit }) {
3629
3897
  const internalInstance = vue.getCurrentInstance();
3630
3898
  const values = vue.ref({});
3631
3899
  const configForm = vue.ref();
@@ -3666,16 +3934,16 @@
3666
3934
  design.tMagicMessage.error(e.message);
3667
3935
  }
3668
3936
  };
3669
- expose({ submit });
3937
+ __expose({ submit });
3670
3938
  return (_ctx, _cache) => {
3671
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
3939
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
3672
3940
  vue.renderSlot(_ctx.$slots, "props-panel-header"),
3673
3941
  vue.createVNode(vue.unref(form.MForm), {
3674
3942
  ref_key: "configForm",
3675
3943
  ref: configForm,
3676
- class: vue.normalizeClass(`m-editor-props-panel ${vue.unref(propsPanelSize)}`),
3677
- "popper-class": `m-editor-props-panel-popper ${vue.unref(propsPanelSize)}`,
3678
- size: vue.unref(propsPanelSize),
3944
+ class: vue.normalizeClass(`m-editor-props-panel ${propsPanelSize.value}`),
3945
+ "popper-class": `m-editor-props-panel-popper ${propsPanelSize.value}`,
3946
+ size: propsPanelSize.value,
3679
3947
  "init-values": values.value,
3680
3948
  config: curFormConfig.value,
3681
3949
  onChange: submit
@@ -3686,6 +3954,9 @@
3686
3954
  });
3687
3955
 
3688
3956
  const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
3957
+ ...{
3958
+ name: "MEditorSearchInput"
3959
+ },
3689
3960
  __name: "SearchInput",
3690
3961
  emits: ["search"],
3691
3962
  setup(__props, { emit }) {
@@ -3717,80 +3988,77 @@
3717
3988
  }
3718
3989
  });
3719
3990
 
3720
- const _export_sfc = (sfc, props) => {
3721
- const target = sfc.__vccOpts || sfc;
3722
- for (const [key, val] of props) {
3723
- target[key] = val;
3724
- }
3725
- return target;
3726
- };
3727
-
3728
- const _sfc_main$l = {};
3729
-
3730
- const _hoisted_1$d = { xmlns: "http://www.w3.org/2000/svg" };
3731
- const _hoisted_2$8 = /*#__PURE__*/vue.createElementVNode("g", {
3991
+ const _hoisted_1$c = { xmlns: "http://www.w3.org/2000/svg" };
3992
+ const _hoisted_2$7 = /* @__PURE__ */ vue.createElementVNode("g", {
3732
3993
  fill: "#7C878E",
3733
3994
  "fill-rule": "evenodd"
3734
3995
  }, [
3735
- /*#__PURE__*/vue.createElementVNode("path", {
3996
+ /* @__PURE__ */ vue.createElementVNode("path", {
3736
3997
  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",
3737
3998
  "fill-rule": "nonzero"
3738
3999
  }),
3739
- /*#__PURE__*/vue.createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
4000
+ /* @__PURE__ */ vue.createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
3740
4001
  ], -1);
3741
- const _hoisted_3$4 = [
3742
- _hoisted_2$8
4002
+ const _hoisted_3$3 = [
4003
+ _hoisted_2$7
3743
4004
  ];
4005
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
4006
+ ...{
4007
+ name: "MEditorAppManageIcon"
4008
+ },
4009
+ __name: "AppManageIcon",
4010
+ setup(__props) {
4011
+ return (_ctx, _cache) => {
4012
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$c, _hoisted_3$3);
4013
+ };
4014
+ }
4015
+ });
3744
4016
 
3745
- function _sfc_render$2(_ctx, _cache) {
3746
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, _hoisted_3$4))
3747
- }
3748
- const AppManageIcon = /*#__PURE__*/_export_sfc(_sfc_main$l, [['render',_sfc_render$2]]);
3749
-
3750
- const _sfc_main$k = {};
3751
-
3752
- const _hoisted_1$c = {
4017
+ const _hoisted_1$b = {
3753
4018
  viewBox: "0 0 32 32",
3754
4019
  version: "1.1",
3755
4020
  xmlns: "http://www.w3.org/2000/svg",
3756
4021
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
3757
4022
  };
3758
- const _hoisted_2$7 = /*#__PURE__*/vue.createStaticVNode("<defs><rect id=\"path-1\" x=\"0\" y=\"0\" width=\"32\" height=\"32\"></rect></defs><g id=\"组件规范\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g id=\"03图标\" transform=\"translate(-561.000000, -2356.000000)\"><g id=\"icon/line/Universal/code\" transform=\"translate(561.000000, 2356.000000)\"><g id=\"路径\"><mask id=\"mask-2\" fill=\"white\"><use xlink:href=\"#path-1\"></use></mask><use id=\"蒙版\" fill=\"#D8D8D8\" opacity=\"0\" xlink:href=\"#path-1\"></use><path d=\"M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z\" id=\"形状\" fill=\"#1D1F24\" mask=\"url(#mask-2)\"></path></g></g><g id=\"icon切图\" transform=\"translate(226.000000, 1782.000000)\"></g></g></g>", 2);
3759
- const _hoisted_4$4 = [
3760
- _hoisted_2$7
4023
+ const _hoisted_2$6 = /* @__PURE__ */ vue.createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
4024
+ const _hoisted_4$3 = [
4025
+ _hoisted_2$6
3761
4026
  ];
4027
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
4028
+ ...{
4029
+ name: "MEditorCodeIcon"
4030
+ },
4031
+ __name: "CodeIcon",
4032
+ setup(__props) {
4033
+ return (_ctx, _cache) => {
4034
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$b, _hoisted_4$3);
4035
+ };
4036
+ }
4037
+ });
3762
4038
 
3763
- function _sfc_render$1(_ctx, _cache) {
3764
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$c, _hoisted_4$4))
3765
- }
3766
- const CodeIcon = /*#__PURE__*/_export_sfc(_sfc_main$k, [['render',_sfc_render$1]]);
3767
-
3768
- const _hoisted_1$b = {
4039
+ const _hoisted_1$a = {
3769
4040
  key: 0,
3770
4041
  class: "m-editor-content-bottom"
3771
4042
  };
3772
- const _hoisted_2$6 = /* @__PURE__ */ vue.createTextVNode("确认");
3773
- const _hoisted_3$3 = /* @__PURE__ */ vue.createTextVNode("关闭");
3774
- const _hoisted_4$3 = {
4043
+ const _hoisted_2$5 = {
3775
4044
  key: 1,
3776
4045
  class: "m-editor-content-bottom"
3777
4046
  };
3778
- const _hoisted_5$2 = /* @__PURE__ */ vue.createTextVNode("关闭");
3779
- const __default__$h = vue.defineComponent({
3780
- name: "MEditorCodeDraftEditor"
3781
- });
3782
4047
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
3783
- ...__default__$h,
4048
+ ...{
4049
+ name: "MEditorCodeDraftEditor"
4050
+ },
4051
+ __name: "CodeDraftEditor",
3784
4052
  props: {
3785
- id: null,
3786
- content: null,
4053
+ id: {},
4054
+ content: {},
3787
4055
  editable: { type: Boolean, default: true },
3788
4056
  autoSaveDraft: { type: Boolean, default: true },
3789
- codeOptions: null,
3790
- language: null
4057
+ codeOptions: {},
4058
+ language: {}
3791
4059
  },
3792
4060
  emits: ["close", "saveAndClose"],
3793
- setup(__props, { expose, emit }) {
4061
+ setup(__props, { expose: __expose, emit }) {
3794
4062
  const props = __props;
3795
4063
  const services = vue.inject("services");
3796
4064
  const codeContent = vue.ref("");
@@ -3855,7 +4123,7 @@
3855
4123
  codeEditor.value.focus();
3856
4124
  }
3857
4125
  };
3858
- expose({
4126
+ __expose({
3859
4127
  saveAndClose,
3860
4128
  close
3861
4129
  });
@@ -3869,10 +4137,10 @@
3869
4137
  class: "m-editor-container",
3870
4138
  "init-values": `${codeContent.value}`,
3871
4139
  onSave: saveCodeDraft,
3872
- language: __props.language,
3873
- options: vue.unref(codeOptions)
4140
+ language: _ctx.language,
4141
+ options: codeOptions.value
3874
4142
  }, null, 8, ["init-values", "language", "options"]),
3875
- __props.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
4143
+ _ctx.editable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
3876
4144
  vue.createVNode(vue.unref(design.TMagicButton), {
3877
4145
  type: "primary",
3878
4146
  class: "button",
@@ -3889,7 +4157,7 @@
3889
4157
  onClick: saveAndClose
3890
4158
  }, {
3891
4159
  default: vue.withCtx(() => [
3892
- _hoisted_2$6
4160
+ vue.createTextVNode("确认")
3893
4161
  ]),
3894
4162
  _: 1
3895
4163
  }),
@@ -3898,11 +4166,11 @@
3898
4166
  onClick: close
3899
4167
  }, {
3900
4168
  default: vue.withCtx(() => [
3901
- _hoisted_3$3
4169
+ vue.createTextVNode("关闭")
3902
4170
  ]),
3903
4171
  _: 1
3904
4172
  })
3905
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
4173
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, [
3906
4174
  vue.createVNode(vue.unref(design.TMagicButton), {
3907
4175
  type: "primary",
3908
4176
  class: "button",
@@ -3918,7 +4186,7 @@
3918
4186
  onClick: close
3919
4187
  }, {
3920
4188
  default: vue.withCtx(() => [
3921
- _hoisted_5$2
4189
+ vue.createTextVNode("关闭")
3922
4190
  ]),
3923
4191
  _: 1
3924
4192
  })
@@ -3928,25 +4196,25 @@
3928
4196
  }
3929
4197
  });
3930
4198
 
3931
- const _hoisted_1$a = { class: "code-name-wrapper" };
3932
- const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
4199
+ const _hoisted_1$9 = { class: "code-name-wrapper" };
4200
+ const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
3933
4201
  const _hoisted_3$2 = { class: "code-name-wrapper" };
3934
4202
  const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "code-name-label" }, "参数", -1);
3935
- const __default__$g = vue.defineComponent({
3936
- name: "MEditorFunctionEditor"
3937
- });
3938
4203
  const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
3939
- ...__default__$g,
4204
+ ...{
4205
+ name: "MEditorFunctionEditor"
4206
+ },
4207
+ __name: "FunctionEditor",
3940
4208
  props: {
3941
- id: null,
3942
- name: null,
3943
- content: null,
4209
+ id: {},
4210
+ name: {},
4211
+ content: {},
3944
4212
  editable: { type: Boolean, default: true },
3945
4213
  autoSaveDraft: { type: Boolean, default: true },
3946
- codeOptions: null,
3947
- paramsColConfig: null
4214
+ codeOptions: {},
4215
+ paramsColConfig: {}
3948
4216
  },
3949
- setup(__props, { expose }) {
4217
+ setup(__props, { expose: __expose }) {
3950
4218
  const props = __props;
3951
4219
  const defaultParamColConfig = {
3952
4220
  type: "row",
@@ -4047,20 +4315,20 @@
4047
4315
  services?.codeBlockService.setCodeEditorShowStatus(false);
4048
4316
  };
4049
4317
  const codeDraftEditor = vue.ref();
4050
- expose({
4318
+ __expose({
4051
4319
  codeDraftEditor
4052
4320
  });
4053
4321
  return (_ctx, _cache) => {
4054
4322
  const _component_m_form_table = vue.resolveComponent("m-form-table");
4055
4323
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCard), { shadow: "never" }, {
4056
4324
  header: vue.withCtx(() => [
4057
- vue.createElementVNode("div", _hoisted_1$a, [
4058
- _hoisted_2$5,
4325
+ vue.createElementVNode("div", _hoisted_1$9, [
4326
+ _hoisted_2$4,
4059
4327
  vue.createVNode(vue.unref(design.TMagicInput), {
4060
4328
  class: "code-name-input",
4061
4329
  modelValue: codeName.value,
4062
4330
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => codeName.value = $event),
4063
- disabled: !__props.editable
4331
+ disabled: !_ctx.editable
4064
4332
  }, null, 8, ["modelValue", "disabled"])
4065
4333
  ]),
4066
4334
  vue.createElementVNode("div", _hoisted_3$2, [
@@ -4080,11 +4348,11 @@
4080
4348
  vue.createVNode(_sfc_main$j, {
4081
4349
  ref_key: "codeDraftEditor",
4082
4350
  ref: codeDraftEditor,
4083
- id: __props.id,
4351
+ id: _ctx.id,
4084
4352
  content: codeContent.value,
4085
- editable: __props.editable,
4086
- autoSaveDraft: __props.autoSaveDraft,
4087
- codeOptions: __props.codeOptions,
4353
+ editable: _ctx.editable,
4354
+ autoSaveDraft: _ctx.autoSaveDraft,
4355
+ codeOptions: _ctx.codeOptions,
4088
4356
  language: "javascript",
4089
4357
  onSaveAndClose: saveAndClose,
4090
4358
  onClose: close
@@ -4096,17 +4364,17 @@
4096
4364
  }
4097
4365
  });
4098
4366
 
4099
- const _hoisted_1$9 = {
4367
+ const _hoisted_1$8 = {
4100
4368
  key: 0,
4101
4369
  class: "m-editor-code-block-editor-panel"
4102
4370
  };
4103
- const __default__$f = vue.defineComponent({
4104
- name: "MEditorCodeBlockEditor"
4105
- });
4106
4371
  const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
4107
- ...__default__$f,
4372
+ ...{
4373
+ name: "MEditorCodeBlockEditor"
4374
+ },
4375
+ __name: "CodeBlockEditor",
4108
4376
  props: {
4109
- paramsColConfig: null
4377
+ paramsColConfig: {}
4110
4378
  },
4111
4379
  setup(__props) {
4112
4380
  const services = vue.inject("services");
@@ -4153,7 +4421,7 @@
4153
4421
  "append-to-body": true,
4154
4422
  "show-close": false,
4155
4423
  "close-on-click-modal": true,
4156
- size: vue.unref(size),
4424
+ size: size.value,
4157
4425
  "before-close": handleClose
4158
4426
  }, {
4159
4427
  default: vue.withCtx(() => [
@@ -4164,17 +4432,17 @@
4164
4432
  class: "code-editor-layout"
4165
4433
  }, {
4166
4434
  center: vue.withCtx(() => [
4167
- !vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
4168
- vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: vue.unref(id) }),
4435
+ !vue.unref(lodashEs.isEmpty)(codeConfig.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
4436
+ vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: id.value }),
4169
4437
  codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
4170
4438
  key: 0,
4171
4439
  ref_key: "functionEditor",
4172
4440
  ref: functionEditor,
4173
- id: vue.unref(id),
4441
+ id: id.value,
4174
4442
  name: codeConfig.value.name,
4175
4443
  content: codeConfig.value.content,
4176
- paramsColConfig: __props.paramsColConfig,
4177
- editable: !!vue.unref(editable),
4444
+ paramsColConfig: _ctx.paramsColConfig,
4445
+ editable: !!editable.value,
4178
4446
  autoSaveDraft: true,
4179
4447
  codeOptions: vue.unref(codeOptions)
4180
4448
  }, null, 8, ["id", "name", "content", "paramsColConfig", "editable", "codeOptions"])) : vue.createCommentVNode("", true)
@@ -4189,22 +4457,21 @@
4189
4457
  }
4190
4458
  });
4191
4459
 
4192
- const _hoisted_1$8 = { class: "search-wrapper" };
4193
- const _hoisted_2$4 = /* @__PURE__ */ vue.createTextVNode("新增");
4194
- const _hoisted_3$1 = ["id"];
4195
- const _hoisted_4$1 = { class: "list-item" };
4196
- const _hoisted_5$1 = {
4460
+ const _hoisted_1$7 = { class: "search-wrapper" };
4461
+ const _hoisted_2$3 = ["id"];
4462
+ const _hoisted_3$1 = { class: "list-item" };
4463
+ const _hoisted_4$1 = {
4197
4464
  key: 2,
4198
4465
  class: "right-tool"
4199
4466
  };
4200
- const __default__$e = vue.defineComponent({
4201
- name: "MEditorCodeBlockList"
4202
- });
4203
4467
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
4204
- ...__default__$e,
4468
+ ...{
4469
+ name: "MEditorCodeBlockList"
4470
+ },
4471
+ __name: "CodeBlockList",
4205
4472
  props: {
4206
- customError: null,
4207
- paramsColConfig: null
4473
+ customError: { type: Function },
4474
+ paramsColConfig: {}
4208
4475
  },
4209
4476
  setup(__props) {
4210
4477
  const props = __props;
@@ -4293,9 +4560,9 @@
4293
4560
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
4294
4561
  default: vue.withCtx(() => [
4295
4562
  vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
4296
- vue.createElementVNode("div", _hoisted_1$8, [
4563
+ vue.createElementVNode("div", _hoisted_1$7, [
4297
4564
  vue.createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
4298
- vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
4565
+ editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
4299
4566
  key: 0,
4300
4567
  class: "create-code-button",
4301
4568
  type: "primary",
@@ -4303,7 +4570,7 @@
4303
4570
  onClick: createCodeBlock
4304
4571
  }, {
4305
4572
  default: vue.withCtx(() => [
4306
- _hoisted_2$4
4573
+ vue.createTextVNode("新增")
4307
4574
  ]),
4308
4575
  _: 1
4309
4576
  })) : vue.createCommentVNode("", true)
@@ -4315,9 +4582,9 @@
4315
4582
  class: "magic-editor-layer-tree",
4316
4583
  "node-key": "id",
4317
4584
  "empty-text": "暂无代码块",
4318
- "default-expanded-keys": vue.unref(expandedKeys),
4585
+ "default-expanded-keys": expandedKeys.value,
4319
4586
  "expand-on-click-node": false,
4320
- data: vue.unref(codeList),
4587
+ data: codeList.value,
4321
4588
  props: treeProps,
4322
4589
  "highlight-current": true,
4323
4590
  "filter-node-method": filterNode,
@@ -4328,41 +4595,41 @@
4328
4595
  id: data.id,
4329
4596
  class: "list-container"
4330
4597
  }, [
4331
- vue.createElementVNode("div", _hoisted_4$1, [
4332
- data.type === "code" ? (vue.openBlock(), vue.createBlock(CodeIcon, {
4598
+ vue.createElementVNode("div", _hoisted_3$1, [
4599
+ data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$k, {
4333
4600
  key: 0,
4334
4601
  class: "codeIcon"
4335
4602
  })) : vue.createCommentVNode("", true),
4336
- data.type === "node" ? (vue.openBlock(), vue.createBlock(AppManageIcon, {
4603
+ data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
4337
4604
  key: 1,
4338
4605
  class: "compIcon"
4339
4606
  })) : vue.createCommentVNode("", true),
4340
4607
  vue.createElementVNode("span", {
4341
4608
  class: vue.normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
4342
4609
  }, vue.toDisplayString(data.name) + " (" + vue.toDisplayString(data.id) + ")", 3),
4343
- data.type === "code" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [
4610
+ data.type === "code" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
4344
4611
  vue.createVNode(vue.unref(design.TMagicTooltip), {
4345
4612
  effect: "dark",
4346
- content: vue.unref(editable) ? "编辑" : "查看",
4613
+ content: editable.value ? "编辑" : "查看",
4347
4614
  placement: "bottom"
4348
4615
  }, {
4349
4616
  default: vue.withCtx(() => [
4350
- vue.createVNode(_sfc_main$A, {
4351
- icon: vue.unref(editable) ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
4617
+ vue.createVNode(_sfc_main$B, {
4618
+ icon: editable.value ? vue.unref(iconsVue.Edit) : vue.unref(iconsVue.View),
4352
4619
  class: "edit-icon",
4353
4620
  onClick: vue.withModifiers(($event) => editCode(`${data.id}`), ["stop"])
4354
4621
  }, null, 8, ["icon", "onClick"])
4355
4622
  ]),
4356
4623
  _: 2
4357
4624
  }, 1032, ["content"]),
4358
- vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
4625
+ editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
4359
4626
  key: 0,
4360
4627
  effect: "dark",
4361
4628
  content: "删除",
4362
4629
  placement: "bottom"
4363
4630
  }, {
4364
4631
  default: vue.withCtx(() => [
4365
- vue.createVNode(_sfc_main$A, {
4632
+ vue.createVNode(_sfc_main$B, {
4366
4633
  icon: vue.unref(iconsVue.Close),
4367
4634
  class: "edit-icon",
4368
4635
  onClick: vue.withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
@@ -4376,13 +4643,13 @@
4376
4643
  })
4377
4644
  ])) : vue.createCommentVNode("", true)
4378
4645
  ])
4379
- ], 8, _hoisted_3$1)
4646
+ ], 8, _hoisted_2$3)
4380
4647
  ]),
4381
4648
  _: 3
4382
4649
  }, 8, ["default-expanded-keys", "data"]),
4383
- vue.unref(isShowCodeBlockEditor) ? (vue.openBlock(), vue.createBlock(_sfc_main$h, {
4650
+ isShowCodeBlockEditor.value ? (vue.openBlock(), vue.createBlock(_sfc_main$h, {
4384
4651
  key: 0,
4385
- paramsColConfig: __props.paramsColConfig
4652
+ paramsColConfig: _ctx.paramsColConfig
4386
4653
  }, {
4387
4654
  "code-block-edit-panel-header": vue.withCtx(({ id }) => [
4388
4655
  vue.renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
@@ -4396,16 +4663,17 @@
4396
4663
  }
4397
4664
  });
4398
4665
 
4399
- const _hoisted_1$7 = /* @__PURE__ */ vue.createTextVNode("确定");
4400
- const _hoisted_2$3 = /* @__PURE__ */ vue.createTextVNode("关闭");
4401
4666
  const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
4667
+ ...{
4668
+ name: "MEditorDataSourceConfigPanel"
4669
+ },
4402
4670
  __name: "DataSourceConfigPanel",
4403
4671
  props: {
4404
- title: null,
4405
- values: null
4672
+ title: {},
4673
+ values: {}
4406
4674
  },
4407
4675
  emits: ["submit"],
4408
- setup(__props, { expose, emit }) {
4676
+ setup(__props, { expose: __expose, emit }) {
4409
4677
  const props = __props;
4410
4678
  const type = vue.ref("base");
4411
4679
  const services = vue.inject("services");
@@ -4436,7 +4704,7 @@
4436
4704
  const hide = () => {
4437
4705
  visible.value = false;
4438
4706
  };
4439
- expose({
4707
+ __expose({
4440
4708
  show() {
4441
4709
  visible.value = true;
4442
4710
  },
@@ -4446,12 +4714,12 @@
4446
4714
  return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicDrawer), {
4447
4715
  modelValue: visible.value,
4448
4716
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
4449
- title: __props.title,
4717
+ title: _ctx.title,
4450
4718
  "close-on-press-escape": true,
4451
4719
  "append-to-body": true,
4452
4720
  "show-close": true,
4453
4721
  "close-on-click-modal": true,
4454
- size: vue.unref(size)
4722
+ size: size.value
4455
4723
  }, {
4456
4724
  footer: vue.withCtx(() => [
4457
4725
  vue.createElementVNode("div", null, [
@@ -4460,13 +4728,13 @@
4460
4728
  onClick: submitHandler
4461
4729
  }, {
4462
4730
  default: vue.withCtx(() => [
4463
- _hoisted_1$7
4731
+ vue.createTextVNode("确定")
4464
4732
  ]),
4465
4733
  _: 1
4466
4734
  }),
4467
4735
  vue.createVNode(vue.unref(design.TMagicButton), { onClick: hide }, {
4468
4736
  default: vue.withCtx(() => [
4469
- _hoisted_2$3
4737
+ vue.createTextVNode("关闭")
4470
4738
  ]),
4471
4739
  _: 1
4472
4740
  })
@@ -4476,7 +4744,7 @@
4476
4744
  vue.createVNode(vue.unref(form.MForm), {
4477
4745
  ref_key: "form",
4478
4746
  ref: form$1,
4479
- config: vue.unref(dataSourceConfig),
4747
+ config: dataSourceConfig.value,
4480
4748
  "init-values": initValues.value,
4481
4749
  onChange: changeHandler
4482
4750
  }, null, 8, ["config", "init-values"])
@@ -4488,18 +4756,17 @@
4488
4756
  });
4489
4757
 
4490
4758
  const _hoisted_1$6 = { class: "search-wrapper" };
4491
- const _hoisted_2$2 = /* @__PURE__ */ vue.createTextVNode("新增");
4492
- const _hoisted_3 = ["id"];
4493
- const _hoisted_4 = { class: "list-item" };
4494
- const _hoisted_5 = {
4759
+ const _hoisted_2$2 = ["id"];
4760
+ const _hoisted_3 = { class: "list-item" };
4761
+ const _hoisted_4 = {
4495
4762
  key: 2,
4496
4763
  class: "right-tool"
4497
4764
  };
4498
- const __default__$d = vue.defineComponent({
4499
- name: "MEditorDataSourceListPanel"
4500
- });
4501
4765
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
4502
- ...__default__$d,
4766
+ ...{
4767
+ name: "MEditorDataSourceListPanel"
4768
+ },
4769
+ __name: "DataSourceListPanel",
4503
4770
  setup(__props) {
4504
4771
  const services = vue.inject("services", {});
4505
4772
  const { dataSourceService, depService } = vue.inject("services") || {};
@@ -4565,7 +4832,7 @@
4565
4832
  onClick: addHandler
4566
4833
  }, {
4567
4834
  default: vue.withCtx(() => [
4568
- _hoisted_2$2
4835
+ vue.createTextVNode("新增")
4569
4836
  ]),
4570
4837
  _: 1
4571
4838
  })
@@ -4578,7 +4845,7 @@
4578
4845
  "empty-text": "暂无代码块",
4579
4846
  "default-expand-all": "",
4580
4847
  "expand-on-click-node": false,
4581
- data: vue.unref(list),
4848
+ data: list.value,
4582
4849
  "highlight-current": true
4583
4850
  }, {
4584
4851
  default: vue.withCtx(({ data }) => [
@@ -4586,13 +4853,13 @@
4586
4853
  id: data.id,
4587
4854
  class: "list-container"
4588
4855
  }, [
4589
- vue.createElementVNode("div", _hoisted_4, [
4590
- data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
4856
+ vue.createElementVNode("div", _hoisted_3, [
4857
+ data.type === "code" ? (vue.openBlock(), vue.createBlock(_sfc_main$B, {
4591
4858
  key: 0,
4592
4859
  class: "codeIcon",
4593
4860
  icon: vue.unref(iconsVue.Coin)
4594
4861
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
4595
- data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
4862
+ data.type === "node" ? (vue.openBlock(), vue.createBlock(_sfc_main$B, {
4596
4863
  key: 1,
4597
4864
  class: "compIcon",
4598
4865
  icon: vue.unref(iconsVue.Aim)
@@ -4600,14 +4867,14 @@
4600
4867
  vue.createElementVNode("span", {
4601
4868
  class: vue.normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
4602
4869
  }, vue.toDisplayString(data.name) + "(" + vue.toDisplayString(data.id) + ")", 3),
4603
- data.type === "code" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
4870
+ data.type === "code" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
4604
4871
  vue.createVNode(vue.unref(design.TMagicTooltip), {
4605
4872
  effect: "dark",
4606
4873
  content: "编辑",
4607
4874
  placement: "bottom"
4608
4875
  }, {
4609
4876
  default: vue.withCtx(() => [
4610
- vue.createVNode(_sfc_main$A, {
4877
+ vue.createVNode(_sfc_main$B, {
4611
4878
  class: "edit-icon",
4612
4879
  icon: vue.unref(iconsVue.Edit),
4613
4880
  onClick: vue.withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
@@ -4621,7 +4888,7 @@
4621
4888
  placement: "bottom"
4622
4889
  }, {
4623
4890
  default: vue.withCtx(() => [
4624
- vue.createVNode(_sfc_main$A, {
4891
+ vue.createVNode(_sfc_main$B, {
4625
4892
  icon: vue.unref(iconsVue.Close),
4626
4893
  class: "edit-icon",
4627
4894
  onClick: vue.withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
@@ -4635,7 +4902,7 @@
4635
4902
  })
4636
4903
  ])) : vue.createCommentVNode("", true)
4637
4904
  ])
4638
- ], 8, _hoisted_3)
4905
+ ], 8, _hoisted_2$2)
4639
4906
  ]),
4640
4907
  _: 3
4641
4908
  }, 8, ["data"]),
@@ -4654,11 +4921,11 @@
4654
4921
  });
4655
4922
 
4656
4923
  const _hoisted_1$5 = ["onClick", "onDragstart"];
4657
- const __default__$c = vue.defineComponent({
4658
- name: "MEditorComponentListPanel"
4659
- });
4660
4924
  const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
4661
- ...__default__$c,
4925
+ ...{
4926
+ name: "MEditorComponentListPanel"
4927
+ },
4928
+ __name: "ComponentListPanel",
4662
4929
  setup(__props) {
4663
4930
  const searchText = vue.ref("");
4664
4931
  const filterTextChangeHandler = (v) => {
@@ -4731,18 +4998,18 @@
4731
4998
  vue.renderSlot(_ctx.$slots, "component-list-panel-header"),
4732
4999
  vue.createVNode(vue.unref(design.TMagicCollapse), {
4733
5000
  class: "ui-component-panel",
4734
- "model-value": vue.unref(collapseValue)
5001
+ "model-value": collapseValue.value
4735
5002
  }, {
4736
5003
  default: vue.withCtx(() => [
4737
5004
  vue.createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
4738
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(list), (group, index) => {
5005
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
4739
5006
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
4740
5007
  group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
4741
5008
  key: index,
4742
5009
  name: `${index}`
4743
5010
  }, {
4744
5011
  title: vue.withCtx(() => [
4745
- vue.createVNode(_sfc_main$A, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
5012
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Grid) }, null, 8, ["icon"]),
4746
5013
  vue.createTextVNode(vue.toDisplayString(group.title), 1)
4747
5014
  ]),
4748
5015
  default: vue.withCtx(() => [
@@ -4757,7 +5024,7 @@
4757
5024
  onDrag: dragHandler
4758
5025
  }, [
4759
5026
  vue.renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
4760
- vue.createVNode(_sfc_main$A, {
5027
+ vue.createVNode(_sfc_main$B, {
4761
5028
  icon: item.icon
4762
5029
  }, null, 8, ["icon"]),
4763
5030
  vue.createVNode(vue.unref(design.TMagicTooltip), {
@@ -4788,17 +5055,17 @@
4788
5055
  }
4789
5056
  });
4790
5057
 
4791
- const __default__$b = vue.defineComponent({
4792
- name: "MEditorContentMenu"
4793
- });
4794
5058
  const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
4795
- ...__default__$b,
5059
+ ...{
5060
+ name: "MEditorContentMenu"
5061
+ },
5062
+ __name: "ContentMenu",
4796
5063
  props: {
4797
5064
  menuData: { default: () => [] },
4798
5065
  isSubMenu: { type: Boolean, default: false }
4799
5066
  },
4800
5067
  emits: ["hide", "show"],
4801
- setup(__props, { expose, emit }) {
5068
+ setup(__props, { expose: __expose, emit }) {
4802
5069
  const props = __props;
4803
5070
  const menu = vue.ref();
4804
5071
  const subMenu = vue.ref();
@@ -4865,13 +5132,13 @@
4865
5132
  return;
4866
5133
  globalThis.removeEventListener("mousedown", hideHandler, true);
4867
5134
  });
4868
- expose({
5135
+ __expose({
4869
5136
  hide,
4870
5137
  show
4871
5138
  });
4872
5139
  return (_ctx, _cache) => {
4873
5140
  const _component_content_menu = vue.resolveComponent("content-menu", true);
4874
- return __props.menuData.length ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
5141
+ return _ctx.menuData.length ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
4875
5142
  key: 0,
4876
5143
  class: "magic-editor-content-menu",
4877
5144
  ref_key: "menu",
@@ -4879,7 +5146,7 @@
4879
5146
  style: vue.normalizeStyle(menuStyle.value)
4880
5147
  }, [
4881
5148
  vue.createElementVNode("div", null, [
4882
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.menuData, (item, index) => {
5149
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
4883
5150
  return vue.openBlock(), vue.createBlock(_sfc_main$p, {
4884
5151
  "event-type": "mouseup",
4885
5152
  data: item,
@@ -4906,15 +5173,15 @@
4906
5173
  }
4907
5174
  });
4908
5175
 
4909
- const __default__$a = vue.defineComponent({
4910
- name: "MEditorLayerMenu"
4911
- });
4912
5176
  const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
4913
- ...__default__$a,
5177
+ ...{
5178
+ name: "MEditorLayerMenu"
5179
+ },
5180
+ __name: "LayerMenu",
4914
5181
  props: {
4915
- layerContentMenu: null
5182
+ layerContentMenu: {}
4916
5183
  },
4917
- setup(__props, { expose }) {
5184
+ setup(__props, { expose: __expose }) {
4918
5185
  const props = __props;
4919
5186
  const services = vue.inject("services");
4920
5187
  const menu = vue.ref();
@@ -4996,12 +5263,12 @@
4996
5263
  const show = (e) => {
4997
5264
  menu.value?.show(e);
4998
5265
  };
4999
- expose({
5266
+ __expose({
5000
5267
  show
5001
5268
  });
5002
5269
  return (_ctx, _cache) => {
5003
5270
  return vue.openBlock(), vue.createBlock(_sfc_main$c, {
5004
- "menu-data": vue.unref(menuData),
5271
+ "menu-data": menuData.value,
5005
5272
  ref_key: "menu",
5006
5273
  ref: menu,
5007
5274
  style: { "overflow": "initial" }
@@ -5011,16 +5278,16 @@
5011
5278
  });
5012
5279
 
5013
5280
  const _hoisted_1$4 = ["id", "onMouseenter"];
5014
- const __default__$9 = vue.defineComponent({
5015
- name: "MEditorLayerPanel"
5016
- });
5281
+ const throttleTime = 150;
5017
5282
  const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
5018
- ...__default__$9,
5283
+ ...{
5284
+ name: "MEditorLayerPanel"
5285
+ },
5286
+ __name: "LayerPanel",
5019
5287
  props: {
5020
- layerContentMenu: null
5288
+ layerContentMenu: {}
5021
5289
  },
5022
5290
  setup(__props) {
5023
- const throttleTime = 150;
5024
5291
  const services = vue.inject("services");
5025
5292
  const editorService = services?.editorService;
5026
5293
  const tree = vue.ref();
@@ -5214,7 +5481,7 @@
5214
5481
  default: vue.withCtx(() => [
5215
5482
  vue.renderSlot(_ctx.$slots, "layer-panel-header"),
5216
5483
  vue.createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
5217
- vue.unref(values).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
5484
+ values.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
5218
5485
  key: 0,
5219
5486
  class: "magic-editor-layer-tree",
5220
5487
  ref_key: "tree",
@@ -5225,14 +5492,14 @@
5225
5492
  "default-expanded-keys": expandedKeys.value,
5226
5493
  "default-checked-keys": checkedKeys.value,
5227
5494
  "current-node-key": currentNodeKey.value,
5228
- data: vue.unref(values),
5495
+ data: values.value,
5229
5496
  "expand-on-click-node": false,
5230
- "highlight-current": !vue.unref(isMultiSelect),
5497
+ "highlight-current": !isMultiSelect.value,
5231
5498
  "check-on-click-node": true,
5232
5499
  props: treeProps,
5233
5500
  "filter-node-method": filterNode,
5234
5501
  "allow-drop": allowDrop,
5235
- "show-checkbox": vue.unref(isMultiSelect),
5502
+ "show-checkbox": isMultiSelect.value,
5236
5503
  onNodeClick: clickHandler,
5237
5504
  onNodeContextmenu: contextmenu,
5238
5505
  onNodeDragEnd: handleDragEnd,
@@ -5262,7 +5529,7 @@
5262
5529
  vue.createVNode(_sfc_main$b, {
5263
5530
  ref_key: "menu",
5264
5531
  ref: menu,
5265
- "layer-content-menu": __props.layerContentMenu
5532
+ "layer-content-menu": _ctx.layerContentMenu
5266
5533
  }, null, 8, ["layer-content-menu"])
5267
5534
  ]))
5268
5535
  ]),
@@ -5276,19 +5543,19 @@
5276
5543
  key: 1,
5277
5544
  class: "magic-editor-tab-panel-title"
5278
5545
  };
5279
- const __default__$8 = vue.defineComponent({
5280
- name: "MEditorSidebar"
5281
- });
5282
5546
  const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
5283
- ...__default__$8,
5547
+ ...{
5548
+ name: "MEditorSidebar"
5549
+ },
5550
+ __name: "Sidebar",
5284
5551
  props: {
5285
5552
  data: { default: () => ({ type: "tabs", status: "组件", items: ["component-list", "layer", "code-block", "data-source"] }) },
5286
- layerContentMenu: null
5553
+ layerContentMenu: {}
5287
5554
  },
5288
- setup(__props, { expose }) {
5555
+ setup(__props, { expose: __expose }) {
5289
5556
  const props = __props;
5290
- const tabPaneComponent = design.getConfig("components").tabPane;
5291
- const tabsComponent = design.getConfig("components").tabs;
5557
+ const tabPaneComponent = design.getConfig("components")?.tabPane;
5558
+ const tabsComponent = design.getConfig("components")?.tabs;
5292
5559
  const activeTabName = vue.ref(props.data?.status);
5293
5560
  const getItemConfig = (data) => {
5294
5561
  const map = {
@@ -5337,26 +5604,26 @@
5337
5604
  activeTabName.value = status || "0";
5338
5605
  }
5339
5606
  );
5340
- expose({
5607
+ __expose({
5341
5608
  activeTabName
5342
5609
  });
5343
5610
  return (_ctx, _cache) => {
5344
- return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent).component), vue.mergeProps({
5611
+ return _ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent)?.component || "el-tabs"), vue.mergeProps({
5345
5612
  key: 0,
5346
5613
  modelValue: activeTabName.value,
5347
5614
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
5348
5615
  class: "m-editor-sidebar tmagic-design-tabs"
5349
- }, vue.unref(tabsComponent).props({ type: "card", tabPosition: "left" })), {
5616
+ }, vue.unref(tabsComponent)?.props({ type: "card", tabPosition: "left" }) || {}), {
5350
5617
  default: vue.withCtx(() => [
5351
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(sideBarItems), (config, index) => {
5352
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent).component), vue.mergeProps(vue.unref(tabPaneComponent).props({ name: config.text }), {
5618
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
5619
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent)?.component || "el-tab-pane"), vue.mergeProps(vue.unref(tabPaneComponent)?.props({ name: config.text, lazy: config.lazy }) || {}, {
5353
5620
  key: config.$key || index
5354
5621
  }), {
5355
5622
  label: vue.withCtx(() => [
5356
5623
  (vue.openBlock(), vue.createElementBlock("div", {
5357
5624
  key: config.text
5358
5625
  }, [
5359
- config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$A, {
5626
+ config.icon ? (vue.openBlock(), vue.createBlock(_sfc_main$B, {
5360
5627
  key: 0,
5361
5628
  icon: config.icon
5362
5629
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
@@ -5369,7 +5636,8 @@
5369
5636
  name: "component-list-panel-header",
5370
5637
  fn: vue.withCtx(() => [
5371
5638
  config.$key === "component-list" ? vue.renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
5372
- ])
5639
+ ]),
5640
+ key: "0"
5373
5641
  } : void 0,
5374
5642
  config.$key === "component-list" || config.slots?.componentListItem ? {
5375
5643
  name: "component-list-item",
@@ -5381,19 +5649,22 @@
5381
5649
  key: 1,
5382
5650
  component
5383
5651
  }, null, 8, ["component"])) : vue.createCommentVNode("", true)
5384
- ])
5652
+ ]),
5653
+ key: "1"
5385
5654
  } : void 0,
5386
5655
  config.$key === "layer" || config.slots?.layerPanelHeader ? {
5387
5656
  name: "layer-panel-header",
5388
5657
  fn: vue.withCtx(() => [
5389
5658
  config.$key === "layer" ? vue.renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
5390
- ])
5659
+ ]),
5660
+ key: "2"
5391
5661
  } : void 0,
5392
5662
  config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
5393
5663
  name: "code-block-panel-header",
5394
5664
  fn: vue.withCtx(() => [
5395
5665
  config.$key === "code-block" ? vue.renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
5396
- ])
5666
+ ]),
5667
+ key: "3"
5397
5668
  } : void 0,
5398
5669
  config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
5399
5670
  name: "code-block-panel-tool",
@@ -5403,7 +5674,8 @@
5403
5674
  id,
5404
5675
  data
5405
5676
  }) : config.slots?.codeBlockPanelTool ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : vue.createCommentVNode("", true)
5406
- ])
5677
+ ]),
5678
+ key: "4"
5407
5679
  } : void 0,
5408
5680
  config.$key === "code-block" || config.slots?.codeBlockEditPanelHeader ? {
5409
5681
  name: "code-block-edit-panel-header",
@@ -5412,7 +5684,8 @@
5412
5684
  key: 0,
5413
5685
  id
5414
5686
  }) : config.slots?.codeBlockEditPanelHeader ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(config.slots.codeBlockEditPanelHeader), { key: 1 })) : vue.createCommentVNode("", true)
5415
- ])
5687
+ ]),
5688
+ key: "5"
5416
5689
  } : void 0,
5417
5690
  config.$key === "layer" || config.slots?.layerNodeContent ? {
5418
5691
  name: "layer-node-content",
@@ -5426,7 +5699,8 @@
5426
5699
  data: nodeData,
5427
5700
  node
5428
5701
  }, null, 8, ["data", "node"])) : vue.createCommentVNode("", true)
5429
- ])
5702
+ ]),
5703
+ key: "6"
5430
5704
  } : void 0
5431
5705
  ]), 1040)) : vue.createCommentVNode("", true)
5432
5706
  ]),
@@ -5445,11 +5719,11 @@
5445
5719
  class: "m-editor-breadcrumb"
5446
5720
  };
5447
5721
  const _hoisted_2$1 = { key: 0 };
5448
- const __default__$7 = vue.defineComponent({
5449
- name: "MEditorBreadcrumb"
5450
- });
5451
5722
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
5452
- ...__default__$7,
5723
+ ...{
5724
+ name: "MEditorBreadcrumb"
5725
+ },
5726
+ __name: "Breadcrumb",
5453
5727
  setup(__props) {
5454
5728
  const services = vue.inject("services");
5455
5729
  const editorService = services?.editorService;
@@ -5462,14 +5736,14 @@
5462
5736
  editorService?.get("stage")?.select(node2.id);
5463
5737
  };
5464
5738
  return (_ctx, _cache) => {
5465
- return vue.unref(nodes).length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
5466
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(path), (item, index) => {
5739
+ return nodes.value.length === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
5740
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(path.value, (item, index) => {
5467
5741
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5468
5742
  key: item.id
5469
5743
  }, [
5470
5744
  vue.createVNode(vue.unref(design.TMagicButton), {
5471
5745
  text: "",
5472
- disabled: item.id === vue.unref(node)?.id,
5746
+ disabled: item.id === node.value?.id,
5473
5747
  onClick: ($event) => select(item)
5474
5748
  }, {
5475
5749
  default: vue.withCtx(() => [
@@ -5477,7 +5751,7 @@
5477
5751
  ]),
5478
5752
  _: 2
5479
5753
  }, 1032, ["disabled", "onClick"]),
5480
- index < vue.unref(path).length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$1, "/")) : vue.createCommentVNode("", true)
5754
+ index < path.value.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$1, "/")) : vue.createCommentVNode("", true)
5481
5755
  ], 64);
5482
5756
  }), 128))
5483
5757
  ])) : vue.createCommentVNode("", true);
@@ -5489,11 +5763,11 @@
5489
5763
  key: 1,
5490
5764
  style: { "width": "21px" }
5491
5765
  };
5492
- const __default__$6 = vue.defineComponent({
5493
- name: "MEditorPageBarScrollContainer"
5494
- });
5495
5766
  const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
5496
- ...__default__$6,
5767
+ ...{
5768
+ name: "MEditorPageBarScrollContainer"
5769
+ },
5770
+ __name: "PageBarScrollContainer",
5497
5771
  setup(__props) {
5498
5772
  const services = vue.inject("services");
5499
5773
  const editorService = services?.editorService;
@@ -5571,22 +5845,22 @@
5571
5845
  ref_key: "pageBar",
5572
5846
  ref: pageBar
5573
5847
  }, [
5574
- vue.unref(showAddPageButton) ? (vue.openBlock(), vue.createElementBlock("div", {
5848
+ showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", {
5575
5849
  key: 0,
5576
5850
  id: "m-editor-page-bar-add-icon",
5577
5851
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5578
5852
  onClick: addPage
5579
5853
  }, [
5580
- vue.createVNode(_sfc_main$A, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
5854
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
5581
5855
  ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1)),
5582
5856
  canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
5583
5857
  key: 2,
5584
5858
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5585
5859
  onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
5586
5860
  }, [
5587
- vue.createVNode(_sfc_main$A, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
5861
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.ArrowLeftBold) }, null, 8, ["icon"])
5588
5862
  ])) : vue.createCommentVNode("", true),
5589
- vue.unref(pageLength) ? (vue.openBlock(), vue.createElementBlock("div", {
5863
+ pageLength.value ? (vue.openBlock(), vue.createElementBlock("div", {
5590
5864
  key: 3,
5591
5865
  class: "m-editor-page-bar-items",
5592
5866
  ref_key: "itemsContainer",
@@ -5600,7 +5874,7 @@
5600
5874
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
5601
5875
  onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
5602
5876
  }, [
5603
- vue.createVNode(_sfc_main$A, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
5877
+ vue.createVNode(_sfc_main$B, { icon: vue.unref(iconsVue.ArrowRightBold) }, null, 8, ["icon"])
5604
5878
  ])) : vue.createCommentVNode("", true)
5605
5879
  ], 512);
5606
5880
  };
@@ -5609,11 +5883,11 @@
5609
5883
 
5610
5884
  const _hoisted_1 = ["onClick"];
5611
5885
  const _hoisted_2 = { class: "m-editor-page-bar-title" };
5612
- const __default__$5 = vue.defineComponent({
5613
- name: "MEditorPageBar"
5614
- });
5615
5886
  const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
5616
- ...__default__$5,
5887
+ ...{
5888
+ name: "MEditorPageBar"
5889
+ },
5890
+ __name: "PageBar",
5617
5891
  setup(__props) {
5618
5892
  const services = vue.inject("services");
5619
5893
  const editorService = services?.editorService;
@@ -5635,9 +5909,9 @@
5635
5909
  return (_ctx, _cache) => {
5636
5910
  return vue.openBlock(), vue.createBlock(_sfc_main$7, null, {
5637
5911
  default: vue.withCtx(() => [
5638
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(root) && vue.unref(root).items || [], (item) => {
5912
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(root.value && root.value.items || [], (item) => {
5639
5913
  return vue.openBlock(), vue.createElementBlock("div", {
5640
- class: vue.normalizeClass(["m-editor-page-bar-item", { active: vue.unref(page)?.id === item.id }]),
5914
+ class: vue.normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
5641
5915
  key: item.key,
5642
5916
  onClick: ($event) => switchPage(item)
5643
5917
  }, [
@@ -5830,16 +6104,16 @@
5830
6104
  };
5831
6105
  }
5832
6106
 
5833
- const __default__$4 = vue.defineComponent({
5834
- name: "MEditorScrollBar"
5835
- });
5836
6107
  const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
5837
- ...__default__$4,
6108
+ ...{
6109
+ name: "MEditorScrollBar"
6110
+ },
6111
+ __name: "ScrollBar",
5838
6112
  props: {
5839
- size: null,
5840
- scrollSize: null,
6113
+ size: {},
6114
+ scrollSize: {},
5841
6115
  isHorizontal: { type: Boolean },
5842
- pos: null
6116
+ pos: {}
5843
6117
  },
5844
6118
  emits: ["scroll"],
5845
6119
  setup(__props, { emit }) {
@@ -5904,13 +6178,13 @@
5904
6178
  return vue.openBlock(), vue.createElementBlock("div", {
5905
6179
  ref_key: "bar",
5906
6180
  ref: bar,
5907
- class: vue.normalizeClass(["m-editor-scroll-bar", __props.isHorizontal ? "horizontal" : "vertical"])
6181
+ class: vue.normalizeClass(["m-editor-scroll-bar", _ctx.isHorizontal ? "horizontal" : "vertical"])
5908
6182
  }, [
5909
6183
  vue.createElementVNode("div", {
5910
6184
  ref_key: "thumb",
5911
6185
  ref: thumb,
5912
6186
  class: "m-editor-scroll-bar-thumb",
5913
- style: vue.normalizeStyle(vue.unref(thumbStyle))
6187
+ style: vue.normalizeStyle(thumbStyle.value)
5914
6188
  }, null, 4)
5915
6189
  ], 2);
5916
6190
  };
@@ -5919,11 +6193,11 @@
5919
6193
 
5920
6194
  const ScrollBar_vue_vue_type_style_index_0_lang = '';
5921
6195
 
5922
- const __default__$3 = vue.defineComponent({
5923
- name: "MEditorScrollViewer"
5924
- });
5925
6196
  const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
5926
- ...__default__$3,
6197
+ ...{
6198
+ name: "MEditorScrollViewer"
6199
+ },
6200
+ __name: "ScrollViewer",
5927
6201
  props: {
5928
6202
  width: { default: 0 },
5929
6203
  height: { default: 0 },
@@ -5935,7 +6209,7 @@
5935
6209
  height: 0
5936
6210
  }) }
5937
6211
  },
5938
- setup(__props, { expose }) {
6212
+ setup(__props, { expose: __expose }) {
5939
6213
  const props = __props;
5940
6214
  const container = vue.ref();
5941
6215
  const el = vue.ref();
@@ -5989,7 +6263,7 @@
5989
6263
  left: hOffset.value
5990
6264
  });
5991
6265
  };
5992
- expose({
6266
+ __expose({
5993
6267
  container
5994
6268
  });
5995
6269
  return (_ctx, _cache) => {
@@ -6001,23 +6275,23 @@
6001
6275
  vue.createElementVNode("div", {
6002
6276
  ref_key: "el",
6003
6277
  ref: el,
6004
- style: vue.normalizeStyle(vue.unref(style))
6278
+ style: vue.normalizeStyle(style.value)
6005
6279
  }, [
6006
6280
  vue.renderSlot(_ctx.$slots, "default")
6007
6281
  ], 4),
6008
- scrollHeight.value > __props.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
6282
+ scrollHeight.value > _ctx.wrapHeight ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
6009
6283
  key: 0,
6010
6284
  "scroll-size": scrollHeight.value,
6011
- size: __props.wrapHeight,
6285
+ size: _ctx.wrapHeight,
6012
6286
  pos: vOffset.value,
6013
6287
  onScroll: vScrollHandler
6014
6288
  }, null, 8, ["scroll-size", "size", "pos"])) : vue.createCommentVNode("", true),
6015
- scrollWidth.value > __props.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
6289
+ scrollWidth.value > _ctx.wrapWidth ? (vue.openBlock(), vue.createBlock(_sfc_main$5, {
6016
6290
  key: 1,
6017
6291
  "is-horizontal": true,
6018
6292
  "scroll-size": scrollWidth.value,
6019
6293
  pos: hOffset.value,
6020
- size: __props.wrapWidth,
6294
+ size: _ctx.wrapWidth,
6021
6295
  onScroll: hScrollHandler
6022
6296
  }, null, 8, ["scroll-size", "pos", "size"])) : vue.createCommentVNode("", true)
6023
6297
  ], 512);
@@ -6025,16 +6299,16 @@
6025
6299
  }
6026
6300
  });
6027
6301
 
6028
- const __default__$2 = vue.defineComponent({
6029
- name: "MEditorViewerMenu"
6030
- });
6031
6302
  const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
6032
- ...__default__$2,
6303
+ ...{
6304
+ name: "MEditorViewerMenu"
6305
+ },
6306
+ __name: "ViewerMenu",
6033
6307
  props: {
6034
6308
  isMultiSelect: { type: Boolean, default: false },
6035
- stageContentMenu: null
6309
+ stageContentMenu: {}
6036
6310
  },
6037
- setup(__props, { expose }) {
6311
+ setup(__props, { expose: __expose }) {
6038
6312
  const props = __props;
6039
6313
  const services = vue.inject("services");
6040
6314
  const editorService = services?.editorService;
@@ -6169,10 +6443,10 @@
6169
6443
  const data = await storageService.getItem(COPY_STORAGE_KEY);
6170
6444
  canPaste.value = data !== "undefined" && !!data;
6171
6445
  };
6172
- expose({ show });
6446
+ __expose({ show });
6173
6447
  return (_ctx, _cache) => {
6174
6448
  return vue.openBlock(), vue.createBlock(_sfc_main$c, {
6175
- "menu-data": vue.unref(menuData),
6449
+ "menu-data": menuData.value,
6176
6450
  ref_key: "menu",
6177
6451
  ref: menu
6178
6452
  }, null, 8, ["menu-data"]);
@@ -6180,13 +6454,13 @@
6180
6454
  }
6181
6455
  });
6182
6456
 
6183
- const __default__$1 = vue.defineComponent({
6184
- name: "MEditorStage"
6185
- });
6186
6457
  const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
6187
- ...__default__$1,
6458
+ ...{
6459
+ name: "MEditorStage"
6460
+ },
6461
+ __name: "Stage",
6188
6462
  props: {
6189
- stageContentMenu: null
6463
+ stageContentMenu: {}
6190
6464
  },
6191
6465
  setup(__props) {
6192
6466
  let stage = null;
@@ -6311,11 +6585,11 @@
6311
6585
  class: "m-editor-stage",
6312
6586
  ref_key: "stageWrap",
6313
6587
  ref: stageWrap,
6314
- width: vue.unref(stageRect)?.width,
6315
- height: vue.unref(stageRect)?.height,
6316
- "wrap-width": vue.unref(stageContainerRect)?.width,
6317
- "wrap-height": vue.unref(stageContainerRect)?.height,
6318
- zoom: vue.unref(zoom),
6588
+ width: stageRect.value?.width,
6589
+ height: stageRect.value?.height,
6590
+ "wrap-width": stageContainerRect.value?.width,
6591
+ "wrap-height": stageContainerRect.value?.height,
6592
+ zoom: zoom.value,
6319
6593
  "correction-scroll-size": {
6320
6594
  width: 60,
6321
6595
  height: 50
@@ -6326,7 +6600,7 @@
6326
6600
  class: "m-editor-stage-container",
6327
6601
  ref_key: "stageContainer",
6328
6602
  ref: stageContainer,
6329
- style: vue.normalizeStyle(`transform: scale(${vue.unref(zoom)});`),
6603
+ style: vue.normalizeStyle(`transform: scale(${zoom.value});`),
6330
6604
  onContextmenu: contextmenuHandler,
6331
6605
  onDrop: dropHandler,
6332
6606
  onDragover: dragoverHandler
@@ -6335,8 +6609,8 @@
6335
6609
  vue.createVNode(_sfc_main$3, {
6336
6610
  ref_key: "menu",
6337
6611
  ref: menu,
6338
- "is-multi-select": vue.unref(isMultiSelect),
6339
- "stage-content-menu": __props.stageContentMenu
6612
+ "is-multi-select": isMultiSelect.value,
6613
+ "stage-content-menu": _ctx.stageContentMenu
6340
6614
  }, null, 8, ["is-multi-select", "stage-content-menu"])
6341
6615
  ]))
6342
6616
  ]),
@@ -6346,13 +6620,13 @@
6346
6620
  }
6347
6621
  });
6348
6622
 
6349
- const __default__ = vue.defineComponent({
6350
- name: "MEditorWorkspace"
6351
- });
6352
6623
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
6353
- ...__default__,
6624
+ ...{
6625
+ name: "MEditorWorkspace"
6626
+ },
6627
+ __name: "Workspace",
6354
6628
  props: {
6355
- stageContentMenu: null
6629
+ stageContentMenu: {}
6356
6630
  },
6357
6631
  setup(__props) {
6358
6632
  const services = vue.inject("services");
@@ -6464,9 +6738,9 @@
6464
6738
  }, [
6465
6739
  vue.createVNode(_sfc_main$8),
6466
6740
  vue.renderSlot(_ctx.$slots, "stage", {}, () => [
6467
- vue.unref(page) ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
6741
+ page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
6468
6742
  key: 0,
6469
- "stage-content-menu": __props.stageContentMenu
6743
+ "stage-content-menu": _ctx.stageContentMenu
6470
6744
  }, null, 8, ["stage-content-menu"])) : vue.createCommentVNode("", true)
6471
6745
  ]),
6472
6746
  vue.renderSlot(_ctx.$slots, "workspace-content"),
@@ -7098,6 +7372,7 @@
7098
7372
  });
7099
7373
  });
7100
7374
  });
7375
+ this.emit("collected", nodes, deep);
7101
7376
  }
7102
7377
  /**
7103
7378
  * 清除依赖
@@ -7126,6 +7401,7 @@
7126
7401
  const fullKey = prop ? `${prop}.${key}` : key;
7127
7402
  if (target.isTarget(key, value)) {
7128
7403
  target.updateDep(node, fullKey);
7404
+ this.emit("update-dep", node, fullKey);
7129
7405
  } else if (!keyIsItems && Array.isArray(value)) {
7130
7406
  value.forEach((item, index) => {
7131
7407
  collectTarget(item, `${fullKey}.${index}`);
@@ -7400,6 +7676,42 @@
7400
7676
  });
7401
7677
  };
7402
7678
  const initServiceEvents = (props, emit, { editorService, codeBlockService, dataSourceService, depService }) => {
7679
+ const getApp = () => {
7680
+ const stage = editorService.get("stage");
7681
+ return stage?.renderer.runtime?.getApp?.();
7682
+ };
7683
+ const updateDataSoucreSchema = () => {
7684
+ const root = editorService.get("root");
7685
+ if (root?.dataSources) {
7686
+ getApp()?.dataSourceManager?.updateSchema(root.dataSources);
7687
+ }
7688
+ };
7689
+ const upateNodeWhenDataSourceChange = (nodes) => {
7690
+ const root = editorService.get("root");
7691
+ const stage = editorService.get("stage");
7692
+ if (!root || !stage)
7693
+ return;
7694
+ const app = getApp();
7695
+ if (!app)
7696
+ return;
7697
+ if (app.dsl) {
7698
+ app.dsl.dataSourceDeps = root.dataSourceDeps;
7699
+ app.dsl.dataSources = root.dataSources;
7700
+ }
7701
+ updateDataSoucreSchema();
7702
+ nodes.forEach((node) => {
7703
+ const deps = Object.values(root.dataSourceDeps || {});
7704
+ deps.forEach((dep) => {
7705
+ if (dep[node.id]) {
7706
+ stage.update({
7707
+ config: lodashEs.cloneDeep(node),
7708
+ parentId: editorService.getParentById(node.id)?.id,
7709
+ root: lodashEs.cloneDeep(root)
7710
+ });
7711
+ }
7712
+ });
7713
+ });
7714
+ };
7403
7715
  const targetAddHandler = (target) => {
7404
7716
  if (target.type !== "data-source")
7405
7717
  return;
@@ -7417,8 +7729,16 @@
7417
7729
  return;
7418
7730
  delete root.dataSourceDeps[id];
7419
7731
  };
7732
+ const depUpdateHandler = (node) => {
7733
+ upateNodeWhenDataSourceChange([node]);
7734
+ };
7735
+ const collectedHandler = (nodes) => {
7736
+ upateNodeWhenDataSourceChange(nodes);
7737
+ };
7420
7738
  depService.on("add-target", targetAddHandler);
7421
7739
  depService.on("remove-target", targetRemoveHandler);
7740
+ depService.on("dep-update", depUpdateHandler);
7741
+ depService.on("collected", collectedHandler);
7422
7742
  const rootChangeHandler = async (value, preValue) => {
7423
7743
  const nodeId = editorService.get("node")?.id || props.defaultSelected;
7424
7744
  let node;
@@ -7486,14 +7806,20 @@
7486
7806
  codeBlockService.on("remove", codeBlockRemoveHandler);
7487
7807
  const dataSourceAddHandler = (config) => {
7488
7808
  depService.addTarget(createDataSourceTarget(config.id, config));
7809
+ getApp()?.dataSourceManager?.addDataSource(config);
7489
7810
  };
7490
7811
  const dataSourceUpdateHandler = (config) => {
7491
7812
  if (config.title) {
7492
7813
  depService.getTarget(config.id).name = config.title;
7493
7814
  }
7815
+ const root = editorService.get("root");
7816
+ const targets = depService.getTargets("data-source");
7817
+ const nodes = utils.getNodes(Object.keys(targets[config.id].deps), root?.items);
7818
+ upateNodeWhenDataSourceChange(nodes);
7494
7819
  };
7495
7820
  const dataSourceRemoveHandler = (id) => {
7496
7821
  depService.removeTarget(id);
7822
+ getApp()?.dataSourceManager?.removeDataSource(id);
7497
7823
  };
7498
7824
  dataSourceService.on("add", dataSourceAddHandler);
7499
7825
  dataSourceService.on("update", dataSourceUpdateHandler);
@@ -7501,6 +7827,8 @@
7501
7827
  vue.onUnmounted(() => {
7502
7828
  depService.off("add-target", targetAddHandler);
7503
7829
  depService.off("remove-target", targetRemoveHandler);
7830
+ depService.off("dep-update", depUpdateHandler);
7831
+ depService.off("collected", collectedHandler);
7504
7832
  editorService.off("history-change", historyChangeHandler);
7505
7833
  editorService.off("root-change", rootChangeHandler);
7506
7834
  editorService.off("add", nodeAddHandler);
@@ -7515,7 +7843,7 @@
7515
7843
  };
7516
7844
 
7517
7845
  const _sfc_main = vue.defineComponent({
7518
- name: "m-editor",
7846
+ name: "MEditor",
7519
7847
  components: {
7520
7848
  TMagicNavMenu: _sfc_main$o,
7521
7849
  Sidebar: _sfc_main$9,
@@ -7562,6 +7890,14 @@
7562
7890
  }
7563
7891
  });
7564
7892
 
7893
+ const _export_sfc = (sfc, props) => {
7894
+ const target = sfc.__vccOpts || sfc;
7895
+ for (const [key, val] of props) {
7896
+ target[key] = val;
7897
+ }
7898
+ return target;
7899
+ };
7900
+
7565
7901
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
7566
7902
  const _component_TMagicNavMenu = vue.resolveComponent("TMagicNavMenu");
7567
7903
  const _component_Sidebar = vue.resolveComponent("Sidebar");
@@ -7662,14 +7998,15 @@
7662
7998
  setConfig(option);
7663
7999
  app.component(Editor.name, Editor);
7664
8000
  app.component("m-fields-ui-select", _sfc_main$v);
7665
- app.component("m-fields-code-link", _sfc_main$C);
7666
- app.component("m-fields-vs-code", _sfc_main$D);
8001
+ app.component("m-fields-code-link", _sfc_main$D);
8002
+ app.component("m-fields-vs-code", _sfc_main$E);
7667
8003
  app.component("magic-code-editor", _sfc_main$u);
7668
- app.component("m-fields-code-select", _sfc_main$B);
7669
- app.component("m-fields-code-select-col", _sfc_main$z);
8004
+ app.component("m-fields-code-select", _sfc_main$C);
8005
+ app.component("m-fields-code-select-col", _sfc_main$A);
7670
8006
  app.component("m-fields-event-select", _sfc_main$x);
7671
- app.component("m-fields-data-source-fields", _sfc_main$y);
8007
+ app.component("m-fields-data-source-fields", _sfc_main$z);
7672
8008
  app.component("m-fields-key-value", _sfc_main$w);
8009
+ app.component("m-fields-data-source-input", _sfc_main$y);
7673
8010
  }
7674
8011
  };
7675
8012
 
@@ -7677,16 +8014,17 @@
7677
8014
  exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
7678
8015
  exports.CodeBlockList = _sfc_main$g;
7679
8016
  exports.CodeDeleteErrorType = CodeDeleteErrorType;
7680
- exports.CodeSelect = _sfc_main$B;
7681
- exports.CodeSelectCol = _sfc_main$z;
8017
+ exports.CodeSelect = _sfc_main$C;
8018
+ exports.CodeSelectCol = _sfc_main$A;
7682
8019
  exports.ColumnLayout = ColumnLayout;
7683
8020
  exports.ComponentListPanel = _sfc_main$d;
7684
8021
  exports.ContentMenu = _sfc_main$c;
7685
- exports.DataSourceFields = _sfc_main$y;
8022
+ exports.DataSourceFields = _sfc_main$z;
8023
+ exports.DataSourceInput = _sfc_main$y;
7686
8024
  exports.EventSelect = _sfc_main$x;
7687
8025
  exports.Fixed2Other = Fixed2Other;
7688
8026
  exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
7689
- exports.Icon = _sfc_main$A;
8027
+ exports.Icon = _sfc_main$B;
7690
8028
  exports.KeyValue = _sfc_main$w;
7691
8029
  exports.Keys = Keys;
7692
8030
  exports.LayerOffset = LayerOffset;