@tmagic/editor 1.3.0-beta.6 → 1.3.0-beta.7

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 (34) hide show
  1. package/dist/style.css +57 -56
  2. package/dist/tmagic-editor.js +487 -390
  3. package/dist/tmagic-editor.js.map +1 -1
  4. package/dist/tmagic-editor.umd.cjs +505 -408
  5. package/dist/tmagic-editor.umd.cjs.map +1 -1
  6. package/package.json +10 -10
  7. package/src/Editor.vue +8 -0
  8. package/src/components/Tree.vue +66 -0
  9. package/src/components/TreeNode.vue +142 -0
  10. package/src/layouts/sidebar/Sidebar.vue +13 -0
  11. package/src/layouts/sidebar/data-source/DataSourceList.vue +4 -2
  12. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +8 -2
  13. package/src/layouts/sidebar/layer/LayerPanel.vue +40 -31
  14. package/src/layouts/sidebar/layer/use-click.ts +105 -0
  15. package/src/layouts/sidebar/layer/use-drag.ts +1 -1
  16. package/src/layouts/sidebar/layer/use-filter.ts +1 -12
  17. package/src/layouts/sidebar/layer/use-keybinding.ts +6 -2
  18. package/src/layouts/sidebar/layer/use-node-status.ts +4 -2
  19. package/src/theme/layer-panel.scss +2 -74
  20. package/src/theme/theme.scss +1 -0
  21. package/src/theme/tree.scss +72 -0
  22. package/src/type.ts +16 -1
  23. package/src/utils/tree.ts +15 -0
  24. package/types/{layouts/sidebar/layer/LayerNode.vue.d.ts → components/Tree.vue.d.ts} +19 -17
  25. package/types/components/TreeNode.vue.d.ts +47 -0
  26. package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +2 -6
  27. package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +7 -1
  28. package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +1 -1
  29. package/types/layouts/sidebar/layer/use-click.d.ts +106 -0
  30. package/types/layouts/sidebar/layer/use-filter.d.ts +0 -1
  31. package/types/layouts/sidebar/layer/use-keybinding.d.ts +2 -1
  32. package/types/type.d.ts +20 -1
  33. package/types/utils/tree.d.ts +3 -0
  34. package/src/layouts/sidebar/layer/LayerNode.vue +0 -208
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, Teleport, createElementVNode, normalizeClass, normalizeStyle, createVNode, unref, computed, reactive, resolveComponent, inject, withCtx, Fragment, createTextVNode, createCommentVNode, toRaw, resolveDynamicComponent, nextTick, mergeProps, toDisplayString, renderList, watchEffect, withModifiers, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, withDirectives, vShow, createStaticVNode, Transition, provide, toHandlers, mergeDefaults } from 'vue';
2
- import { FullScreen, Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, CopyDocument, DocumentCopy, Files, Hide, ArrowRight, Goods, List, EditPen, Top, Bottom, ArrowLeftBold, ArrowRightBold, CaretBottom } from '@element-plus/icons-vue';
1
+ import { defineComponent, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, createBlock, Teleport, createElementVNode, normalizeClass, normalizeStyle, createVNode, unref, computed, reactive, resolveComponent, inject, withCtx, Fragment, createTextVNode, createCommentVNode, toRaw, resolveDynamicComponent, nextTick, mergeProps, toDisplayString, renderList, watchEffect, withModifiers, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, withDirectives, vShow, createStaticVNode, provide, Transition, toHandlers, mergeDefaults } from 'vue';
2
+ import { FullScreen, Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, ArrowRight, CopyDocument, DocumentCopy, Files, Hide, Goods, List, EditPen, Top, Bottom, ArrowLeftBold, ArrowRightBold, CaretBottom } from '@element-plus/icons-vue';
3
3
  import { throttle, isEmpty, cloneDeep, mergeWith, isObject, uniq, map, has, pick, keys } from 'lodash-es';
4
4
  import * as monaco from 'monaco-editor';
5
5
  import serialize from 'serialize-javascript';
@@ -7,7 +7,7 @@ import { TMagicButton, TMagicCard, tMagicMessage, TMagicDialog, TMagicTag, tMagi
7
7
  import { HookType, NodeType, ActionType } from '@tmagic/schema';
8
8
  import { MFormDrawer, MForm, createValues, MSelect } from '@tmagic/form';
9
9
  import { MagicTable } from '@tmagic/table';
10
- import { guid, isPop, getNodePath, isNumber, isPage, toLine, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, getDefaultValueFromFields, addClassName, removeClassName, getKeys, removeClassNameByClassName, getNodes, isObject as isObject$1 } from '@tmagic/utils';
10
+ import { guid, isPop, getNodePath, isNumber, isPage, toLine, DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, getDefaultValueFromFields, getKeys, addClassName, removeClassName, removeClassNameByClassName, getNodes, isObject as isObject$1 } from '@tmagic/utils';
11
11
  import Gesto from 'gesto';
12
12
  import StageCore, { GuidesType, StageDragStatus, getOffset, calcValueByFontsize, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType } from '@tmagic/stage';
13
13
  import { EventEmitter } from 'events';
@@ -20,10 +20,10 @@ const setConfig = (option) => {
20
20
  };
21
21
  const getConfig = (key) => $TMAGIC_EDITOR[key];
22
22
 
23
- const _hoisted_1$w = {
23
+ const _hoisted_1$x = {
24
24
  class: /* @__PURE__ */ normalizeClass(`magic-code-editor`)
25
25
  };
26
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
26
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
27
27
  ...{
28
28
  name: "MEditorCodeEditor"
29
29
  },
@@ -180,7 +180,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
180
180
  }
181
181
  });
182
182
  return (_ctx, _cache) => {
183
- return openBlock(), createElementBlock("div", _hoisted_1$w, [
183
+ return openBlock(), createElementBlock("div", _hoisted_1$x, [
184
184
  (openBlock(), createBlock(Teleport, {
185
185
  to: "body",
186
186
  disabled: !fullScreen.value
@@ -208,7 +208,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
208
208
  }
209
209
  });
210
210
 
211
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
211
+ const _sfc_main$S = /* @__PURE__ */ defineComponent({
212
212
  ...{
213
213
  name: "MEditorCode"
214
214
  },
@@ -232,7 +232,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
232
232
  emit("change", v);
233
233
  };
234
234
  return (_ctx, _cache) => {
235
- return openBlock(), createBlock(_sfc_main$S, {
235
+ return openBlock(), createBlock(_sfc_main$T, {
236
236
  height: _ctx.config.height,
237
237
  "init-values": _ctx.model[_ctx.name],
238
238
  language: _ctx.config.language,
@@ -247,7 +247,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
247
247
  }
248
248
  });
249
249
 
250
- const _sfc_main$Q = /* @__PURE__ */ defineComponent({
250
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
251
251
  ...{
252
252
  name: "MEditorCodeLink"
253
253
  },
@@ -326,7 +326,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
326
326
  }
327
327
  });
328
328
 
329
- const _sfc_main$P = /* @__PURE__ */ defineComponent({
329
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
330
330
  ...{
331
331
  name: "MEditorCodeSelect"
332
332
  },
@@ -398,11 +398,11 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
398
398
  }
399
399
  });
400
400
 
401
- const _hoisted_1$v = { style: { "display": "flex", "margin-bottom": "10px" } };
401
+ const _hoisted_1$w = { style: { "display": "flex", "margin-bottom": "10px" } };
402
402
  const _hoisted_2$p = { style: { "flex": "1" } };
403
403
  const _hoisted_3$b = { style: { "flex": "1" } };
404
404
  const _hoisted_4$7 = { class: "dialog-footer" };
405
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
405
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
406
406
  ...{
407
407
  name: "MEditorCodeBlockEditor"
408
408
  },
@@ -644,7 +644,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
644
644
  ])
645
645
  ]),
646
646
  default: withCtx(() => [
647
- createElementVNode("div", _hoisted_1$v, [
647
+ createElementVNode("div", _hoisted_1$w, [
648
648
  createElementVNode("div", _hoisted_2$p, [
649
649
  createVNode(unref(TMagicTag), {
650
650
  size: "small",
@@ -668,7 +668,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
668
668
  })
669
669
  ])
670
670
  ]),
671
- difVisible.value ? (openBlock(), createBlock(_sfc_main$S, {
671
+ difVisible.value ? (openBlock(), createBlock(_sfc_main$T, {
672
672
  key: 0,
673
673
  ref_key: "magicVsEditor",
674
674
  ref: magicVsEditor,
@@ -2955,7 +2955,7 @@ const getDefaultConfig = async (addNode, parentNode) => {
2955
2955
  return newNode;
2956
2956
  };
2957
2957
 
2958
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
2958
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
2959
2959
  ...{
2960
2960
  name: "MEditorCodeParams"
2961
2961
  },
@@ -3004,8 +3004,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
3004
3004
  }
3005
3005
  });
3006
3006
 
3007
- const _hoisted_1$u = ["src"];
3008
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
3007
+ const _hoisted_1$v = ["src"];
3008
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
3009
3009
  ...{
3010
3010
  name: "MEditorIcon"
3011
3011
  },
@@ -3029,7 +3029,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
3029
3029
  class: "magic-editor-icon"
3030
3030
  }, {
3031
3031
  default: withCtx(() => [
3032
- createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$u)
3032
+ createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$v)
3033
3033
  ]),
3034
3034
  _: 1
3035
3035
  })) : typeof _ctx.icon === "string" ? (openBlock(), createElementBlock("i", {
@@ -3106,9 +3106,9 @@ const useCodeBlockEdit = (codeBlockService) => {
3106
3106
  };
3107
3107
  };
3108
3108
 
3109
- const _hoisted_1$t = { class: "m-fields-code-select-col" };
3109
+ const _hoisted_1$u = { class: "m-fields-code-select-col" };
3110
3110
  const _hoisted_2$o = { class: "code-select-container" };
3111
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
3111
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
3112
3112
  ...{
3113
3113
  name: "MEditorCodeSelectCol"
3114
3114
  },
@@ -3180,7 +3180,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3180
3180
  const { codeBlockEditor, codeConfig, editCode, submitCodeBlockHandler } = useCodeBlockEdit(services?.codeBlockService);
3181
3181
  return (_ctx, _cache) => {
3182
3182
  const _component_m_form_container = resolveComponent("m-form-container");
3183
- return openBlock(), createElementBlock("div", _hoisted_1$t, [
3183
+ return openBlock(), createElementBlock("div", _hoisted_1$u, [
3184
3184
  createElementVNode("div", _hoisted_2$o, [
3185
3185
  createVNode(_component_m_form_container, {
3186
3186
  class: "select",
@@ -3189,14 +3189,14 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3189
3189
  size: _ctx.size,
3190
3190
  onChange: onParamsChangeHandler
3191
3191
  }, null, 8, ["model", "size"]),
3192
- _ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$M, {
3192
+ _ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$N, {
3193
3193
  key: 0,
3194
3194
  class: "icon",
3195
3195
  icon: !_ctx.disabled ? unref(Edit) : unref(View),
3196
3196
  onClick: _cache[0] || (_cache[0] = ($event) => unref(editCode)(_ctx.model[_ctx.name]))
3197
3197
  }, null, 8, ["icon"])) : createCommentVNode("", true)
3198
3198
  ]),
3199
- paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$N, {
3199
+ paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$O, {
3200
3200
  key: 0,
3201
3201
  name: "params",
3202
3202
  model: _ctx.model,
@@ -3204,7 +3204,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3204
3204
  "params-config": paramsConfig.value,
3205
3205
  onChange: onParamsChangeHandler
3206
3206
  }, null, 8, ["model", "size", "params-config"])) : createCommentVNode("", true),
3207
- unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$O, {
3207
+ unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$P, {
3208
3208
  key: 1,
3209
3209
  ref_key: "codeBlockEditor",
3210
3210
  ref: codeBlockEditor,
@@ -3217,9 +3217,9 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3217
3217
  }
3218
3218
  });
3219
3219
 
3220
- const _hoisted_1$s = { class: "m-editor-data-source-fields" };
3220
+ const _hoisted_1$t = { class: "m-editor-data-source-fields" };
3221
3221
  const _hoisted_2$n = { class: "m-editor-data-source-fields-footer" };
3222
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
3222
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3223
3223
  ...{
3224
3224
  name: "MEditorDataSourceFields"
3225
3225
  },
@@ -3450,7 +3450,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3450
3450
  }
3451
3451
  };
3452
3452
  return (_ctx, _cache) => {
3453
- return openBlock(), createElementBlock("div", _hoisted_1$s, [
3453
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
3454
3454
  createVNode(unref(MagicTable), {
3455
3455
  data: _ctx.model[_ctx.name],
3456
3456
  columns: fieldColumns
@@ -3507,7 +3507,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3507
3507
  }
3508
3508
  });
3509
3509
 
3510
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
3510
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3511
3511
  __name: "DataSourceFieldSelect",
3512
3512
  props: {
3513
3513
  config: {},
@@ -3561,10 +3561,10 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3561
3561
  }
3562
3562
  });
3563
3563
 
3564
- const _hoisted_1$r = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
3564
+ const _hoisted_1$s = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
3565
3565
  const _hoisted_2$m = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
3566
3566
  const _hoisted_3$a = { class: "el-input__inner" };
3567
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
3567
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3568
3568
  ...{
3569
3569
  name: "MEditorDataSourceInput"
3570
3570
  },
@@ -3753,10 +3753,10 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3753
3753
  }
3754
3754
  ), {
3755
3755
  suffix: withCtx(() => [
3756
- createVNode(_sfc_main$M, { icon: unref(Coin) }, null, 8, ["icon"])
3756
+ createVNode(_sfc_main$N, { icon: unref(Coin) }, null, 8, ["icon"])
3757
3757
  ]),
3758
3758
  default: withCtx(({ item }) => [
3759
- createElementVNode("div", _hoisted_1$r, [
3759
+ createElementVNode("div", _hoisted_1$s, [
3760
3760
  createElementVNode("div", null, toDisplayString(item.text), 1),
3761
3761
  createElementVNode("span", _hoisted_2$m, toDisplayString(item.value), 1)
3762
3762
  ])
@@ -3788,7 +3788,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3788
3788
  }, 1032, ["size"])) : createCommentVNode("", true)
3789
3789
  ], 64);
3790
3790
  }), 256)),
3791
- createVNode(_sfc_main$M, {
3791
+ createVNode(_sfc_main$N, {
3792
3792
  class: "tmagic-data-source-input-icon",
3793
3793
  icon: unref(Coin)
3794
3794
  }, null, 8, ["icon"])
@@ -3871,9 +3871,9 @@ const useDataSourceMethod = () => {
3871
3871
  };
3872
3872
  };
3873
3873
 
3874
- const _hoisted_1$q = { class: "m-editor-data-source-methods" };
3874
+ const _hoisted_1$r = { class: "m-editor-data-source-methods" };
3875
3875
  const _hoisted_2$l = { class: "m-editor-data-source-methods-footer" };
3876
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
3876
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3877
3877
  ...{
3878
3878
  name: "MEditorDataSourceMethods"
3879
3879
  },
@@ -3942,7 +3942,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
3942
3942
  emit("change", props.model[props.name]);
3943
3943
  };
3944
3944
  return (_ctx, _cache) => {
3945
- return openBlock(), createElementBlock("div", _hoisted_1$q, [
3945
+ return openBlock(), createElementBlock("div", _hoisted_1$r, [
3946
3946
  createVNode(unref(MagicTable), {
3947
3947
  data: _ctx.model[_ctx.name],
3948
3948
  columns: methodColumns
@@ -3961,7 +3961,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
3961
3961
  _: 1
3962
3962
  }, 8, ["disabled"])
3963
3963
  ]),
3964
- unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$O, {
3964
+ unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$P, {
3965
3965
  key: 0,
3966
3966
  ref_key: "codeBlockEditor",
3967
3967
  ref: codeBlockEditor,
@@ -3976,9 +3976,9 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
3976
3976
  }
3977
3977
  });
3978
3978
 
3979
- const _hoisted_1$p = { class: "m-fields-data-source-method-select" };
3979
+ const _hoisted_1$q = { class: "m-fields-data-source-method-select" };
3980
3980
  const _hoisted_2$k = { class: "data-source-method-select-container" };
3981
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
3981
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
3982
3982
  ...{
3983
3983
  name: "MEditorDataSourceMethodSelect"
3984
3984
  },
@@ -4060,7 +4060,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4060
4060
  };
4061
4061
  return (_ctx, _cache) => {
4062
4062
  const _component_m_form_container = resolveComponent("m-form-container");
4063
- return openBlock(), createElementBlock("div", _hoisted_1$p, [
4063
+ return openBlock(), createElementBlock("div", _hoisted_1$q, [
4064
4064
  createElementVNode("div", _hoisted_2$k, [
4065
4065
  createVNode(_component_m_form_container, {
4066
4066
  class: "select",
@@ -4068,14 +4068,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4068
4068
  model: _ctx.model,
4069
4069
  onChange: onChangeHandler
4070
4070
  }, null, 8, ["config", "model"]),
4071
- _ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$M, {
4071
+ _ctx.model[_ctx.name] ? (openBlock(), createBlock(_sfc_main$N, {
4072
4072
  key: 0,
4073
4073
  class: "icon",
4074
4074
  icon: !_ctx.disabled ? unref(Edit) : unref(View),
4075
4075
  onClick: editCodeHandler
4076
4076
  }, null, 8, ["icon"])) : createCommentVNode("", true)
4077
4077
  ]),
4078
- paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$N, {
4078
+ paramsConfig.value.length ? (openBlock(), createBlock(_sfc_main$O, {
4079
4079
  key: 0,
4080
4080
  name: "params",
4081
4081
  model: _ctx.model,
@@ -4084,7 +4084,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4084
4084
  "params-config": paramsConfig.value,
4085
4085
  onChange: onChangeHandler
4086
4086
  }, null, 8, ["model", "size", "disabled", "params-config"])) : createCommentVNode("", true),
4087
- unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$O, {
4087
+ unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$P, {
4088
4088
  key: 1,
4089
4089
  ref_key: "codeBlockEditor",
4090
4090
  ref: codeBlockEditor,
@@ -4097,9 +4097,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4097
4097
  }
4098
4098
  });
4099
4099
 
4100
- const _hoisted_1$o = { class: "m-editor-data-source-fields" };
4100
+ const _hoisted_1$p = { class: "m-editor-data-source-fields" };
4101
4101
  const _hoisted_2$j = { class: "m-editor-data-source-fields-footer" };
4102
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
4102
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
4103
4103
  ...{
4104
4104
  name: "MEditorDataSourceMocks"
4105
4105
  },
@@ -4185,7 +4185,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
4185
4185
  const columns = [
4186
4186
  {
4187
4187
  type: "expand",
4188
- component: _sfc_main$S,
4188
+ component: _sfc_main$T,
4189
4189
  props: (row) => ({
4190
4190
  initValues: row.data,
4191
4191
  language: "json",
@@ -4294,7 +4294,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
4294
4294
  });
4295
4295
  };
4296
4296
  return (_ctx, _cache) => {
4297
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
4297
+ return openBlock(), createElementBlock("div", _hoisted_1$p, [
4298
4298
  createVNode(unref(MagicTable), {
4299
4299
  data: _ctx.model[_ctx.name],
4300
4300
  columns
@@ -4330,7 +4330,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
4330
4330
  }
4331
4331
  });
4332
4332
 
4333
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
4333
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
4334
4334
  ...{
4335
4335
  name: "MEditorDataSourceSelect"
4336
4336
  },
@@ -4385,12 +4385,12 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
4385
4385
  }
4386
4386
  });
4387
4387
 
4388
- const _hoisted_1$n = { class: "m-fields-event-select" };
4388
+ const _hoisted_1$o = { class: "m-fields-event-select" };
4389
4389
  const _hoisted_2$i = {
4390
4390
  key: 1,
4391
4391
  class: "fullWidth"
4392
4392
  };
4393
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
4393
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
4394
4394
  ...{
4395
4395
  name: "MEditorEventSelect"
4396
4396
  },
@@ -4592,7 +4592,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
4592
4592
  const _component_m_form_table = resolveComponent("m-form-table");
4593
4593
  const _component_m_form_container = resolveComponent("m-form-container");
4594
4594
  const _component_m_form_panel = resolveComponent("m-form-panel");
4595
- return openBlock(), createElementBlock("div", _hoisted_1$n, [
4595
+ return openBlock(), createElementBlock("div", _hoisted_1$o, [
4596
4596
  isOldVersion.value ? (openBlock(), createBlock(_component_m_form_table, {
4597
4597
  key: 0,
4598
4598
  ref: "eventForm",
@@ -4652,9 +4652,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
4652
4652
  }
4653
4653
  });
4654
4654
 
4655
- const _hoisted_1$m = { class: "m-fields-key-value" };
4655
+ const _hoisted_1$n = { class: "m-fields-key-value" };
4656
4656
  const _hoisted_2$h = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
4657
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
4657
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
4658
4658
  ...{
4659
4659
  name: "MEditorKeyValue"
4660
4660
  },
@@ -4700,7 +4700,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
4700
4700
  emit("change", getValue());
4701
4701
  };
4702
4702
  return (_ctx, _cache) => {
4703
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
4703
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
4704
4704
  (openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
4705
4705
  return openBlock(), createElementBlock("div", {
4706
4706
  class: "m-fields-key-value-item",
@@ -4753,12 +4753,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
4753
4753
  }
4754
4754
  });
4755
4755
 
4756
- const _hoisted_1$l = {
4756
+ const _hoisted_1$m = {
4757
4757
  key: 1,
4758
4758
  class: "m-fields-ui-select",
4759
4759
  style: { "display": "flex" }
4760
4760
  };
4761
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
4761
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
4762
4762
  ...{
4763
4763
  name: "MEditorUISelect"
4764
4764
  },
@@ -4847,7 +4847,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
4847
4847
  ]),
4848
4848
  _: 1
4849
4849
  }, 8, ["icon", "disabled", "size"])
4850
- ])) : (openBlock(), createElementBlock("div", _hoisted_1$l, [
4850
+ ])) : (openBlock(), createElementBlock("div", _hoisted_1$m, [
4851
4851
  val.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4852
4852
  createVNode(unref(TMagicTooltip), {
4853
4853
  content: "清除",
@@ -4944,7 +4944,7 @@ const useGetSo = (target, emit) => {
4944
4944
  };
4945
4945
  };
4946
4946
 
4947
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
4947
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
4948
4948
  ...{
4949
4949
  name: "MEditorResizer"
4950
4950
  },
@@ -4965,7 +4965,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
4965
4965
  }
4966
4966
  });
4967
4967
 
4968
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
4968
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
4969
4969
  ...{
4970
4970
  name: "MEditorLayout"
4971
4971
  },
@@ -5077,7 +5077,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5077
5077
  }, [
5078
5078
  renderSlot(_ctx.$slots, "left")
5079
5079
  ], 6),
5080
- createVNode(_sfc_main$A, { onChange: changeLeft })
5080
+ createVNode(_sfc_main$B, { onChange: changeLeft })
5081
5081
  ], 64)) : createCommentVNode("", true),
5082
5082
  createElementVNode("div", {
5083
5083
  class: normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
@@ -5086,7 +5086,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5086
5086
  renderSlot(_ctx.$slots, "center")
5087
5087
  ], 6),
5088
5088
  hasRight.value && _ctx.$slots.right ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
5089
- createVNode(_sfc_main$A, { onChange: changeRight }),
5089
+ createVNode(_sfc_main$B, { onChange: changeRight }),
5090
5090
  createElementVNode("div", {
5091
5091
  class: normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
5092
5092
  style: normalizeStyle(`width: ${_ctx.right}px`)
@@ -5099,10 +5099,10 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5099
5099
  }
5100
5100
  });
5101
5101
 
5102
- const _hoisted_1$k = { class: "m-editor-empty-panel" };
5102
+ const _hoisted_1$l = { class: "m-editor-empty-panel" };
5103
5103
  const _hoisted_2$g = { class: "m-editor-empty-content" };
5104
5104
  const _hoisted_3$9 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
5105
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
5105
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5106
5106
  ...{
5107
5107
  name: "MEditorAddPageBox"
5108
5108
  },
@@ -5122,14 +5122,14 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
5122
5122
  });
5123
5123
  };
5124
5124
  return (_ctx, _cache) => {
5125
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
5125
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
5126
5126
  createElementVNode("div", _hoisted_2$g, [
5127
5127
  createElementVNode("div", {
5128
5128
  class: "m-editor-empty-button",
5129
5129
  onClick: clickHandler
5130
5130
  }, [
5131
5131
  createElementVNode("div", null, [
5132
- createVNode(_sfc_main$M, { icon: unref(Plus) }, null, 8, ["icon"])
5132
+ createVNode(_sfc_main$N, { icon: unref(Plus) }, null, 8, ["icon"])
5133
5133
  ]),
5134
5134
  _hoisted_3$9
5135
5135
  ])
@@ -5143,7 +5143,7 @@ const DEFAULT_LEFT_COLUMN_WIDTH = 310;
5143
5143
  const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
5144
5144
  const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
5145
5145
  const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
5146
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
5146
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
5147
5147
  ...{
5148
5148
  name: "MEditorFramework"
5149
5149
  },
@@ -5220,13 +5220,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
5220
5220
  renderSlot(_ctx.$slots, "nav"),
5221
5221
  renderSlot(_ctx.$slots, "content-before"),
5222
5222
  showSrc.value ? renderSlot(_ctx.$slots, "src-code", { key: 0 }, () => [
5223
- createVNode(_sfc_main$S, {
5223
+ createVNode(_sfc_main$T, {
5224
5224
  class: "m-editor-content",
5225
5225
  "init-values": root.value,
5226
5226
  options: unref(codeOptions),
5227
5227
  onSave: saveCode
5228
5228
  }, null, 8, ["init-values", "options"])
5229
- ]) : (openBlock(), createBlock(_sfc_main$z, {
5229
+ ]) : (openBlock(), createBlock(_sfc_main$A, {
5230
5230
  key: 1,
5231
5231
  class: "m-editor-content",
5232
5232
  "left-class": "m-editor-framework-left",
@@ -5245,7 +5245,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
5245
5245
  ]),
5246
5246
  center: withCtx(() => [
5247
5247
  pageLength.value > 0 ? renderSlot(_ctx.$slots, "workspace", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
5248
- createVNode(_sfc_main$y)
5248
+ createVNode(_sfc_main$z)
5249
5249
  ])
5250
5250
  ]),
5251
5251
  _: 2
@@ -5270,12 +5270,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
5270
5270
  }
5271
5271
  });
5272
5272
 
5273
- const _hoisted_1$j = {
5273
+ const _hoisted_1$k = {
5274
5274
  key: 1,
5275
5275
  class: "menu-item-text"
5276
5276
  };
5277
5277
  const _hoisted_2$f = { class: "el-dropdown-link menubar-menu-button" };
5278
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
5278
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
5279
5279
  ...{
5280
5280
  name: "MEditorToolButton"
5281
5281
  },
@@ -5354,7 +5354,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
5354
5354
  _ctx.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
5355
5355
  key: 0,
5356
5356
  direction: _ctx.data.direction || "vertical"
5357
- }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$j, toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
5357
+ }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$k, toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
5358
5358
  _ctx.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
5359
5359
  key: 0,
5360
5360
  effect: "dark",
@@ -5368,7 +5368,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
5368
5368
  disabled: disabled.value
5369
5369
  }, {
5370
5370
  default: withCtx(() => [
5371
- _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$M, {
5371
+ _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$N, {
5372
5372
  key: 0,
5373
5373
  icon: _ctx.data.icon
5374
5374
  }, null, 8, ["icon"])) : createCommentVNode("", true),
@@ -5386,7 +5386,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
5386
5386
  title: _ctx.data.text
5387
5387
  }, {
5388
5388
  default: withCtx(() => [
5389
- _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$M, {
5389
+ _ctx.data.icon ? (openBlock(), createBlock(_sfc_main$N, {
5390
5390
  key: 0,
5391
5391
  icon: _ctx.data.icon
5392
5392
  }, null, 8, ["icon"])) : createCommentVNode("", true),
@@ -5436,7 +5436,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
5436
5436
  }
5437
5437
  });
5438
5438
 
5439
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
5439
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
5440
5440
  ...{
5441
5441
  name: "MEditorNavMenu"
5442
5442
  },
@@ -5598,7 +5598,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
5598
5598
  style: normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
5599
5599
  }, [
5600
5600
  (openBlock(true), createElementBlock(Fragment, null, renderList(buttons.value[key], (item, index) => {
5601
- return openBlock(), createBlock(_sfc_main$w, {
5601
+ return openBlock(), createBlock(_sfc_main$x, {
5602
5602
  data: item,
5603
5603
  key: index
5604
5604
  }, null, 8, ["data"]);
@@ -5610,8 +5610,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
5610
5610
  }
5611
5611
  });
5612
5612
 
5613
- const _hoisted_1$i = { class: "m-editor-props-panel" };
5614
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
5613
+ const _hoisted_1$j = { class: "m-editor-props-panel" };
5614
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
5615
5615
  ...{
5616
5616
  name: "MEditorPropsPanel"
5617
5617
  },
@@ -5664,7 +5664,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
5664
5664
  };
5665
5665
  __expose({ configForm, submit });
5666
5666
  return (_ctx, _cache) => {
5667
- return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$i, [
5667
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$j, [
5668
5668
  renderSlot(_ctx.$slots, "props-panel-header"),
5669
5669
  createVNode(unref(MForm), {
5670
5670
  ref_key: "configForm",
@@ -5684,7 +5684,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
5684
5684
  }
5685
5685
  });
5686
5686
 
5687
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
5687
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
5688
5688
  ...{
5689
5689
  name: "MEditorSearchInput"
5690
5690
  },
@@ -5723,7 +5723,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
5723
5723
  }
5724
5724
  });
5725
5725
 
5726
- const _hoisted_1$h = { xmlns: "http://www.w3.org/2000/svg" };
5726
+ const _hoisted_1$i = { xmlns: "http://www.w3.org/2000/svg" };
5727
5727
  const _hoisted_2$e = /* @__PURE__ */ createElementVNode("g", {
5728
5728
  fill: "#7C878E",
5729
5729
  "fill-rule": "evenodd"
@@ -5737,19 +5737,19 @@ const _hoisted_2$e = /* @__PURE__ */ createElementVNode("g", {
5737
5737
  const _hoisted_3$8 = [
5738
5738
  _hoisted_2$e
5739
5739
  ];
5740
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
5740
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
5741
5741
  ...{
5742
5742
  name: "MEditorAppManageIcon"
5743
5743
  },
5744
5744
  __name: "AppManageIcon",
5745
5745
  setup(__props) {
5746
5746
  return (_ctx, _cache) => {
5747
- return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$8);
5747
+ return openBlock(), createElementBlock("svg", _hoisted_1$i, _hoisted_3$8);
5748
5748
  };
5749
5749
  }
5750
5750
  });
5751
5751
 
5752
- const _hoisted_1$g = {
5752
+ const _hoisted_1$h = {
5753
5753
  viewBox: "0 0 32 32",
5754
5754
  version: "1.1",
5755
5755
  xmlns: "http://www.w3.org/2000/svg",
@@ -5759,25 +5759,25 @@ const _hoisted_2$d = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1"
5759
5759
  const _hoisted_4$6 = [
5760
5760
  _hoisted_2$d
5761
5761
  ];
5762
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
5762
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
5763
5763
  ...{
5764
5764
  name: "MEditorCodeIcon"
5765
5765
  },
5766
5766
  __name: "CodeIcon",
5767
5767
  setup(__props) {
5768
5768
  return (_ctx, _cache) => {
5769
- return openBlock(), createElementBlock("svg", _hoisted_1$g, _hoisted_4$6);
5769
+ return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_4$6);
5770
5770
  };
5771
5771
  }
5772
5772
  });
5773
5773
 
5774
- const _hoisted_1$f = ["id"];
5774
+ const _hoisted_1$g = ["id"];
5775
5775
  const _hoisted_2$c = { class: "list-item" };
5776
5776
  const _hoisted_3$7 = {
5777
5777
  key: 2,
5778
5778
  class: "right-tool"
5779
5779
  };
5780
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
5780
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
5781
5781
  ...{
5782
5782
  name: "MEditorCodeBlockList"
5783
5783
  },
@@ -5879,11 +5879,11 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5879
5879
  class: "list-container"
5880
5880
  }, [
5881
5881
  createElementVNode("div", _hoisted_2$c, [
5882
- data.type === "code" ? (openBlock(), createBlock(_sfc_main$r, {
5882
+ data.type === "code" ? (openBlock(), createBlock(_sfc_main$s, {
5883
5883
  key: 0,
5884
5884
  class: "codeIcon"
5885
5885
  })) : createCommentVNode("", true),
5886
- data.type === "node" ? (openBlock(), createBlock(_sfc_main$s, {
5886
+ data.type === "node" ? (openBlock(), createBlock(_sfc_main$t, {
5887
5887
  key: 1,
5888
5888
  class: "compIcon"
5889
5889
  })) : createCommentVNode("", true),
@@ -5897,7 +5897,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5897
5897
  placement: "bottom"
5898
5898
  }, {
5899
5899
  default: withCtx(() => [
5900
- createVNode(_sfc_main$M, {
5900
+ createVNode(_sfc_main$N, {
5901
5901
  icon: editable.value ? unref(Edit) : unref(View),
5902
5902
  class: "edit-icon",
5903
5903
  onClick: withModifiers(($event) => editCode(data.id), ["stop"])
@@ -5912,7 +5912,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5912
5912
  placement: "bottom"
5913
5913
  }, {
5914
5914
  default: withCtx(() => [
5915
- createVNode(_sfc_main$M, {
5915
+ createVNode(_sfc_main$N, {
5916
5916
  icon: unref(Close),
5917
5917
  class: "edit-icon",
5918
5918
  onClick: withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
@@ -5926,7 +5926,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5926
5926
  })
5927
5927
  ])) : createCommentVNode("", true)
5928
5928
  ])
5929
- ], 8, _hoisted_1$f)
5929
+ ], 8, _hoisted_1$g)
5930
5930
  ]),
5931
5931
  _: 3
5932
5932
  }, 8, ["default-expanded-keys", "data"]);
@@ -5934,8 +5934,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5934
5934
  }
5935
5935
  });
5936
5936
 
5937
- const _hoisted_1$e = { class: "search-wrapper" };
5938
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
5937
+ const _hoisted_1$f = { class: "search-wrapper" };
5938
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
5939
5939
  ...{
5940
5940
  name: "MEditorCodeBlockListPanel"
5941
5941
  },
@@ -5955,8 +5955,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
5955
5955
  return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
5956
5956
  default: withCtx(() => [
5957
5957
  renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
5958
- createElementVNode("div", _hoisted_1$e, [
5959
- createVNode(_sfc_main$t, { onSearch: filterTextChangeHandler }),
5958
+ createElementVNode("div", _hoisted_1$f, [
5959
+ createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
5960
5960
  editable.value ? (openBlock(), createBlock(unref(TMagicButton), {
5961
5961
  key: 0,
5962
5962
  class: "create-code-button",
@@ -5972,7 +5972,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
5972
5972
  renderSlot(_ctx.$slots, "code-block-panel-search")
5973
5973
  ])
5974
5974
  ]),
5975
- createVNode(_sfc_main$q, {
5975
+ createVNode(_sfc_main$r, {
5976
5976
  ref_key: "codeBlockList",
5977
5977
  ref: codeBlockList,
5978
5978
  "custom-error": _ctx.customError,
@@ -5987,7 +5987,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
5987
5987
  ]),
5988
5988
  _: 3
5989
5989
  }, 8, ["custom-error", "onEdit", "onRemove"]),
5990
- unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$O, {
5990
+ unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$P, {
5991
5991
  key: 0,
5992
5992
  ref_key: "codeBlockEditor",
5993
5993
  ref: codeBlockEditor,
@@ -6002,7 +6002,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
6002
6002
  }
6003
6003
  });
6004
6004
 
6005
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
6005
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
6006
6006
  ...{
6007
6007
  name: "MEditorDataSourceConfigPanel"
6008
6008
  },
@@ -6056,13 +6056,13 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
6056
6056
  }
6057
6057
  });
6058
6058
 
6059
- const _hoisted_1$d = ["id"];
6059
+ const _hoisted_1$e = ["id"];
6060
6060
  const _hoisted_2$b = { class: "list-item" };
6061
6061
  const _hoisted_3$6 = {
6062
6062
  key: 2,
6063
6063
  class: "right-tool"
6064
6064
  };
6065
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
6065
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
6066
6066
  ...{
6067
6067
  name: "MEditorDataSourceList"
6068
6068
  },
@@ -6158,12 +6158,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6158
6158
  class: "list-container"
6159
6159
  }, [
6160
6160
  createElementVNode("div", _hoisted_2$b, [
6161
- data.type === "code" ? (openBlock(), createBlock(_sfc_main$M, {
6161
+ data.type === "code" ? (openBlock(), createBlock(_sfc_main$N, {
6162
6162
  key: 0,
6163
6163
  class: "codeIcon",
6164
6164
  icon: unref(Coin)
6165
6165
  }, null, 8, ["icon"])) : createCommentVNode("", true),
6166
- data.type === "node" ? (openBlock(), createBlock(_sfc_main$M, {
6166
+ data.type === "node" ? (openBlock(), createBlock(_sfc_main$N, {
6167
6167
  key: 1,
6168
6168
  class: "compIcon",
6169
6169
  icon: unref(Aim)
@@ -6178,7 +6178,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6178
6178
  placement: "bottom"
6179
6179
  }, {
6180
6180
  default: withCtx(() => [
6181
- createVNode(_sfc_main$M, {
6181
+ createVNode(_sfc_main$N, {
6182
6182
  icon: editable.value ? unref(Edit) : unref(View),
6183
6183
  class: "edit-icon",
6184
6184
  onClick: withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
@@ -6193,7 +6193,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6193
6193
  placement: "bottom"
6194
6194
  }, {
6195
6195
  default: withCtx(() => [
6196
- createVNode(_sfc_main$M, {
6196
+ createVNode(_sfc_main$N, {
6197
6197
  icon: unref(Close),
6198
6198
  class: "edit-icon",
6199
6199
  onClick: withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
@@ -6201,13 +6201,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6201
6201
  ]),
6202
6202
  _: 2
6203
6203
  }, 1024)) : createCommentVNode("", true),
6204
- renderSlot(_ctx.$slots, "data-source-panel-tool", {
6205
- id: data.id,
6206
- data: data.codeBlockContent
6207
- })
6204
+ renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
6208
6205
  ])) : createCommentVNode("", true)
6209
6206
  ])
6210
- ], 8, _hoisted_1$d)
6207
+ ], 8, _hoisted_1$e)
6211
6208
  ]),
6212
6209
  _: 3
6213
6210
  }, 8, ["data"]);
@@ -6215,9 +6212,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6215
6212
  }
6216
6213
  });
6217
6214
 
6218
- const _hoisted_1$c = { class: "search-wrapper" };
6215
+ const _hoisted_1$d = { class: "search-wrapper" };
6219
6216
  const _hoisted_2$a = { class: "data-source-list-panel-add-menu" };
6220
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
6217
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
6221
6218
  ...{
6222
6219
  name: "MEditorDataSourceListPanel"
6223
6220
  },
@@ -6277,8 +6274,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6277
6274
  return (_ctx, _cache) => {
6278
6275
  return openBlock(), createBlock(unref(TMagicScrollbar), { class: "data-source-list-panel m-editor-dep-list-panel" }, {
6279
6276
  default: withCtx(() => [
6280
- createElementVNode("div", _hoisted_1$c, [
6281
- createVNode(_sfc_main$t, { onSearch: filterTextChangeHandler }),
6277
+ createElementVNode("div", _hoisted_1$d, [
6278
+ createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
6282
6279
  editable.value ? (openBlock(), createBlock(unref(TMagicPopover), {
6283
6280
  key: 0,
6284
6281
  placement: "right"
@@ -6297,7 +6294,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6297
6294
  default: withCtx(() => [
6298
6295
  createElementVNode("div", _hoisted_2$a, [
6299
6296
  (openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
6300
- return openBlock(), createBlock(_sfc_main$w, {
6297
+ return openBlock(), createBlock(_sfc_main$x, {
6301
6298
  data: {
6302
6299
  type: "button",
6303
6300
  text: item.text,
@@ -6313,11 +6310,16 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6313
6310
  _: 1
6314
6311
  })) : createCommentVNode("", true)
6315
6312
  ]),
6316
- createVNode(_sfc_main$n, {
6313
+ createVNode(_sfc_main$o, {
6317
6314
  onEdit: editHandler,
6318
6315
  onRemove: removeHandler
6316
+ }, {
6317
+ "data-source-panel-tool": withCtx(({ data }) => [
6318
+ renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
6319
+ ]),
6320
+ _: 3
6319
6321
  }),
6320
- createVNode(_sfc_main$o, {
6322
+ createVNode(_sfc_main$p, {
6321
6323
  ref_key: "editDialog",
6322
6324
  ref: editDialog,
6323
6325
  disabled: !editable.value,
@@ -6326,13 +6328,187 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6326
6328
  onSubmit: submitDataSourceHandler
6327
6329
  }, null, 8, ["disabled", "values", "title"])
6328
6330
  ]),
6329
- _: 1
6331
+ _: 3
6330
6332
  });
6331
6333
  };
6332
6334
  }
6333
6335
  });
6334
6336
 
6337
+ const updateStatus = (nodeStatusMap, id, status) => {
6338
+ const nodeStatus = nodeStatusMap.get(id);
6339
+ if (!nodeStatus)
6340
+ return;
6341
+ getKeys(status).forEach((key) => {
6342
+ if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
6343
+ nodeStatus[key] = Boolean(status[key]);
6344
+ }
6345
+ });
6346
+ };
6347
+
6348
+ const _hoisted_1$c = ["draggable", "data-node-id", "data-is-container"];
6349
+ const _hoisted_2$9 = { class: "tree-node-label" };
6350
+ const _hoisted_3$5 = { class: "tree-node-tool" };
6351
+ const _hoisted_4$5 = {
6352
+ key: 0,
6353
+ class: "m-editor-tree-node-children"
6354
+ };
6355
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
6356
+ ...{
6357
+ name: "MEditorTreeNode"
6358
+ },
6359
+ __name: "TreeNode",
6360
+ props: {
6361
+ data: {},
6362
+ nodeStatusMap: {},
6363
+ indent: { default: 0 }
6364
+ },
6365
+ emits: ["node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
6366
+ setup(__props, { emit }) {
6367
+ const props = __props;
6368
+ const treeEmit = inject("treeEmit");
6369
+ const nodeStatus = computed(
6370
+ () => props.nodeStatusMap?.get(props.data.id) || {
6371
+ selected: false,
6372
+ expand: false,
6373
+ visible: false,
6374
+ draggable: false
6375
+ }
6376
+ );
6377
+ const expanded = computed(() => nodeStatus.value.expand);
6378
+ const selected = computed(() => nodeStatus.value.selected);
6379
+ const visible = computed(() => nodeStatus.value.visible);
6380
+ const draggable = computed(() => nodeStatus.value.draggable);
6381
+ const hasChilren = computed(() => props.data.items && props.data.items.length > 0);
6382
+ const handleDragStart = (event) => {
6383
+ treeEmit?.("node-dragstart", event, props.data);
6384
+ };
6385
+ const handleDragLeave = (event) => {
6386
+ treeEmit?.("node-dragleave", event, props.data);
6387
+ };
6388
+ const handleDragEnd = (event) => {
6389
+ treeEmit?.("node-dragend", event, props.data);
6390
+ };
6391
+ const nodeContentmenuHandler = (event) => {
6392
+ treeEmit?.("node-contextmenu", event, props.data);
6393
+ };
6394
+ const mouseenterHandler = (event) => {
6395
+ treeEmit?.("node-mouseenter", event, props.data);
6396
+ };
6397
+ const expandHandler = () => {
6398
+ updateStatus(props.nodeStatusMap, props.data.id, {
6399
+ expand: !expanded.value
6400
+ });
6401
+ };
6402
+ const nodeClickHandler = (event) => {
6403
+ treeEmit?.("node-click", event, props.data);
6404
+ };
6405
+ return (_ctx, _cache) => {
6406
+ const _component_TreeNode = resolveComponent("TreeNode", true);
6407
+ return withDirectives((openBlock(), createElementBlock("div", {
6408
+ class: "m-editor-tree-node",
6409
+ draggable: draggable.value,
6410
+ "data-node-id": _ctx.data.id,
6411
+ "data-is-container": Array.isArray(_ctx.data.items),
6412
+ onDragstart: handleDragStart,
6413
+ onDragleave: handleDragLeave,
6414
+ onDragend: handleDragEnd
6415
+ }, [
6416
+ createElementVNode("div", {
6417
+ class: normalizeClass(["tree-node", { selected: selected.value, expanded: expanded.value }]),
6418
+ style: normalizeStyle(`padding-left: ${_ctx.indent}px`),
6419
+ onContextmenu: nodeContentmenuHandler,
6420
+ onMouseenter: mouseenterHandler
6421
+ }, [
6422
+ createVNode(_sfc_main$N, {
6423
+ class: "expand-icon",
6424
+ style: normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
6425
+ icon: expanded.value ? unref(ArrowDown) : unref(ArrowRight),
6426
+ onClick: expandHandler
6427
+ }, null, 8, ["style", "icon"]),
6428
+ createElementVNode("div", {
6429
+ class: "tree-node-content",
6430
+ onClick: nodeClickHandler
6431
+ }, [
6432
+ renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
6433
+ createElementVNode("div", _hoisted_2$9, toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
6434
+ createElementVNode("div", _hoisted_3$5, [
6435
+ renderSlot(_ctx.$slots, "tree-node-tool", { data: _ctx.data })
6436
+ ])
6437
+ ])
6438
+ ])
6439
+ ], 38),
6440
+ hasChilren.value && expanded.value ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
6441
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.items, (item) => {
6442
+ return openBlock(), createBlock(_component_TreeNode, {
6443
+ key: item.id,
6444
+ data: item,
6445
+ "node-status-map": _ctx.nodeStatusMap,
6446
+ indent: _ctx.indent + 11
6447
+ }, {
6448
+ "tree-node-content": withCtx(({ data: nodeData }) => [
6449
+ renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
6450
+ ]),
6451
+ "tree-node-tool": withCtx(({ data: nodeData }) => [
6452
+ renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
6453
+ ]),
6454
+ _: 2
6455
+ }, 1032, ["data", "node-status-map", "indent"]);
6456
+ }), 128))
6457
+ ])) : createCommentVNode("", true)
6458
+ ], 40, _hoisted_1$c)), [
6459
+ [vShow, visible.value]
6460
+ ]);
6461
+ };
6462
+ }
6463
+ });
6464
+
6465
+ const _hoisted_1$b = { key: 1 };
6335
6466
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
6467
+ ...{
6468
+ name: "MEditorTree"
6469
+ },
6470
+ __name: "Tree",
6471
+ props: {
6472
+ data: {},
6473
+ nodeStatusMap: {},
6474
+ indent: { default: 0 },
6475
+ emptyText: { default: "暂无数据" }
6476
+ },
6477
+ emits: ["node-dragover", "node-dragstart", "node-dragleave", "node-dragend", "node-contextmenu", "node-mouseenter", "node-click"],
6478
+ setup(__props, { emit }) {
6479
+ provide("treeEmit", emit);
6480
+ const handleDragOver = (event) => {
6481
+ emit("node-dragover", event);
6482
+ };
6483
+ return (_ctx, _cache) => {
6484
+ return openBlock(), createElementBlock("div", {
6485
+ class: "m-editor-tree",
6486
+ onDragover: handleDragOver
6487
+ }, [
6488
+ _ctx.data?.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.data, (item) => {
6489
+ return openBlock(), createBlock(_sfc_main$m, {
6490
+ key: item.id,
6491
+ data: item,
6492
+ indent: _ctx.indent,
6493
+ "node-status-map": _ctx.nodeStatusMap
6494
+ }, {
6495
+ "tree-node-content": withCtx(({ data: nodeData }) => [
6496
+ renderSlot(_ctx.$slots, "tree-node-content", { data: nodeData })
6497
+ ]),
6498
+ "tree-node-tool": withCtx(({ data: nodeData }) => [
6499
+ renderSlot(_ctx.$slots, "tree-node-tool", { data: nodeData })
6500
+ ]),
6501
+ _: 2
6502
+ }, 1032, ["data", "indent", "node-status-map"]);
6503
+ }), 128)) : (openBlock(), createElementBlock("div", _hoisted_1$b, [
6504
+ createElementVNode("p", null, toDisplayString(_ctx.emptyText), 1)
6505
+ ]))
6506
+ ], 32);
6507
+ };
6508
+ }
6509
+ });
6510
+
6511
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
6336
6512
  ...{
6337
6513
  name: "MEditorContentMenu"
6338
6514
  },
@@ -6465,7 +6641,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6465
6641
  renderSlot(_ctx.$slots, "title"),
6466
6642
  createElementVNode("div", null, [
6467
6643
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuData, (item, index) => {
6468
- return openBlock(), createBlock(_sfc_main$w, {
6644
+ return openBlock(), createBlock(_sfc_main$x, {
6469
6645
  "event-type": "mouseup",
6470
6646
  ref_for: true,
6471
6647
  ref_key: "buttons",
@@ -6500,7 +6676,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
6500
6676
  }
6501
6677
  });
6502
6678
 
6503
- const _hoisted_1$b = {
6679
+ const _hoisted_1$a = {
6504
6680
  width: "1em",
6505
6681
  height: "1em",
6506
6682
  viewBox: "0 0 16 16",
@@ -6508,26 +6684,26 @@ const _hoisted_1$b = {
6508
6684
  fill: "currentColor",
6509
6685
  xmlns: "http://www.w3.org/2000/svg"
6510
6686
  };
6511
- const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("path", {
6687
+ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("path", {
6512
6688
  "fill-rule": "evenodd",
6513
6689
  d: "M9.828 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H9.828zm-2.95-1.707L7.587 3H2.19c-.24 0-.47.042-.684.12L1.5 2.98a1 1 0 0 1 1-.98h3.672a1 1 0 0 1 .707.293z"
6514
6690
  }, null, -1);
6515
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("path", {
6691
+ const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("path", {
6516
6692
  "fill-rule": "evenodd",
6517
6693
  d: "M11 11.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z"
6518
6694
  }, null, -1);
6519
- const _hoisted_4$5 = [
6520
- _hoisted_2$9,
6521
- _hoisted_3$5
6695
+ const _hoisted_4$4 = [
6696
+ _hoisted_2$8,
6697
+ _hoisted_3$4
6522
6698
  ];
6523
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
6699
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6524
6700
  ...{
6525
6701
  name: "MEditorFolderMinusIcon"
6526
6702
  },
6527
6703
  __name: "FolderMinusIcon",
6528
6704
  setup(__props) {
6529
6705
  return (_ctx, _cache) => {
6530
- return openBlock(), createElementBlock("svg", _hoisted_1$b, _hoisted_4$5);
6706
+ return openBlock(), createElementBlock("svg", _hoisted_1$a, _hoisted_4$4);
6531
6707
  };
6532
6708
  }
6533
6709
  });
@@ -6607,7 +6783,7 @@ const useMoveToMenu = (services) => {
6607
6783
  };
6608
6784
  };
6609
6785
 
6610
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
6786
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6611
6787
  ...{
6612
6788
  name: "MEditorLayerMenu"
6613
6789
  },
@@ -6670,7 +6846,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6670
6846
  {
6671
6847
  type: "button",
6672
6848
  text: "全部折叠",
6673
- icon: _sfc_main$k,
6849
+ icon: _sfc_main$j,
6674
6850
  display: () => isPage(node.value),
6675
6851
  handler: () => {
6676
6852
  emit("collapse-all");
@@ -6696,7 +6872,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6696
6872
  show
6697
6873
  });
6698
6874
  return (_ctx, _cache) => {
6699
- return openBlock(), createBlock(_sfc_main$l, {
6875
+ return openBlock(), createBlock(_sfc_main$k, {
6700
6876
  "menu-data": menuData.value,
6701
6877
  ref_key: "menu",
6702
6878
  ref: menu,
@@ -6706,7 +6882,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6706
6882
  }
6707
6883
  });
6708
6884
 
6709
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
6885
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
6710
6886
  __name: "LayerNodeTool",
6711
6887
  props: {
6712
6888
  data: {}
@@ -6725,12 +6901,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6725
6901
  };
6726
6902
  return (_ctx, _cache) => {
6727
6903
  return _ctx.data.type !== "page" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
6728
- _ctx.data.visible === false ? (openBlock(), createBlock(_sfc_main$M, {
6904
+ _ctx.data.visible === false ? (openBlock(), createBlock(_sfc_main$N, {
6729
6905
  key: 0,
6730
6906
  icon: unref(Hide),
6731
6907
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => setNodeVisible(true), ["stop"])),
6732
6908
  title: "点击显示"
6733
- }, null, 8, ["icon"])) : (openBlock(), createBlock(_sfc_main$M, {
6909
+ }, null, 8, ["icon"])) : (openBlock(), createBlock(_sfc_main$N, {
6734
6910
  key: 1,
6735
6911
  icon: unref(View),
6736
6912
  onClick: _cache[1] || (_cache[1] = withModifiers(($event) => setNodeVisible(false), ["stop"])),
@@ -6742,6 +6918,75 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6742
6918
  }
6743
6919
  });
6744
6920
 
6921
+ const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
6922
+ const select = async (data) => {
6923
+ if (!data.id) {
6924
+ throw new Error("没有id");
6925
+ }
6926
+ if (isCtrlKeyDown.value) {
6927
+ multiSelect(data);
6928
+ } else {
6929
+ await services?.editorService.select(data);
6930
+ services?.editorService.get("stage")?.select(data.id);
6931
+ }
6932
+ };
6933
+ const multiSelect = async (data) => {
6934
+ const nodes = services?.editorService.get("nodes") || [];
6935
+ const newNodes = [];
6936
+ let isCancel = false;
6937
+ nodes.forEach((node) => {
6938
+ if (node.id === data.id) {
6939
+ isCancel = true;
6940
+ return;
6941
+ }
6942
+ newNodes.push(node.id);
6943
+ });
6944
+ if (!isCancel || newNodes.length === 0) {
6945
+ newNodes.push(data.id);
6946
+ }
6947
+ await services?.editorService.multiSelect(newNodes);
6948
+ services?.editorService.get("stage")?.multiSelect(newNodes);
6949
+ };
6950
+ const throttleTime = 300;
6951
+ const highlightHandler = throttle((event, data) => {
6952
+ highlight(data);
6953
+ }, throttleTime);
6954
+ const highlight = (data) => {
6955
+ services?.editorService?.highlight(data);
6956
+ services?.editorService?.get("stage")?.highlight(data.id);
6957
+ };
6958
+ const nodeClickHandler = (event, data) => {
6959
+ if (!nodeStatusMap?.value)
6960
+ return;
6961
+ if (services?.uiService.get("uiSelectMode")) {
6962
+ document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: data }));
6963
+ return;
6964
+ }
6965
+ if (data.items && data.items.length > 0 && !isCtrlKeyDown.value) {
6966
+ updateStatus(nodeStatusMap.value, data.id, {
6967
+ expand: true
6968
+ });
6969
+ }
6970
+ nextTick(() => {
6971
+ select(data);
6972
+ });
6973
+ };
6974
+ const menu = ref();
6975
+ return {
6976
+ menu,
6977
+ nodeClickHandler,
6978
+ nodeContentmenuHandler(event, data) {
6979
+ event.preventDefault();
6980
+ const nodes = services?.editorService.get("nodes") || [];
6981
+ if (nodes.length < 2 || !nodes.includes(data)) {
6982
+ nodeClickHandler(event, data);
6983
+ }
6984
+ menu.value?.show(event);
6985
+ },
6986
+ highlightHandler
6987
+ };
6988
+ };
6989
+
6745
6990
  const dragState = {
6746
6991
  dragOverNodeId: "",
6747
6992
  dropType: "",
@@ -6786,7 +7031,7 @@ const useDrag = (services) => {
6786
7031
  if (!event.target)
6787
7032
  return;
6788
7033
  const targetEl = getNodeEl(event.target);
6789
- if (!targetEl)
7034
+ if (!targetEl?.draggable)
6790
7035
  return;
6791
7036
  const labelEl = targetEl.children[0];
6792
7037
  if (!labelEl)
@@ -6860,16 +7105,6 @@ const useDrag = (services) => {
6860
7105
  };
6861
7106
  };
6862
7107
 
6863
- const updateStatus = (nodeStatusMap, id, status) => {
6864
- const nodeStatus = nodeStatusMap.get(id);
6865
- if (!nodeStatus)
6866
- return;
6867
- getKeys(status).forEach((key) => {
6868
- if (nodeStatus[key] !== void 0 && status[key] !== void 0) {
6869
- nodeStatus[key] = Boolean(status[key]);
6870
- }
6871
- });
6872
- };
6873
7108
  const useFilter = (nodeStatusMap, page) => {
6874
7109
  const filterIsMatch = (value, data) => {
6875
7110
  if (!value) {
@@ -6914,179 +7149,6 @@ const useFilter = (nodeStatusMap, page) => {
6914
7149
  };
6915
7150
  };
6916
7151
 
6917
- const _hoisted_1$a = ["draggable", "data-node-id", "data-is-container"];
6918
- const _hoisted_2$8 = { class: "layer-node-label" };
6919
- const _hoisted_3$4 = { class: "layer-node-tool" };
6920
- const _hoisted_4$4 = {
6921
- key: 0,
6922
- class: "magic-editor-layer-node-children"
6923
- };
6924
- const throttleTime = 300;
6925
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
6926
- ...{
6927
- name: "MEditorLayerNode"
6928
- },
6929
- __name: "LayerNode",
6930
- props: {
6931
- data: {},
6932
- parent: {},
6933
- indent: { default: 0 },
6934
- filterText: { default: "" },
6935
- isCtrlKeyDown: { type: Boolean, default: false }
6936
- },
6937
- emits: ["node-contextmenu"],
6938
- setup(__props, { emit }) {
6939
- const props = __props;
6940
- const services = inject("services");
6941
- const nodeStatusMap = inject("nodeStatusMap");
6942
- const editorService = services?.editorService;
6943
- const uiService = services?.uiService;
6944
- const nodeStatus = computed(
6945
- () => nodeStatusMap?.value?.get(props.data.id) || {
6946
- selected: false,
6947
- expand: false,
6948
- visible: false
6949
- }
6950
- );
6951
- const expanded = computed(() => nodeStatus.value.expand);
6952
- const selected = computed(() => nodeStatus.value.selected);
6953
- const visible = computed(() => nodeStatus.value.visible);
6954
- const hasChilren = computed(() => props.data.items?.length > 0);
6955
- const nodeEl = ref();
6956
- const { handleDragStart, handleDragEnd, handleDragLeave } = useDrag(services);
6957
- const expandHandler = () => {
6958
- if (!nodeStatusMap?.value)
6959
- return;
6960
- updateStatus(nodeStatusMap.value, props.data.id, {
6961
- expand: !expanded.value
6962
- });
6963
- };
6964
- const nodeClickHandler = () => {
6965
- if (!nodeStatusMap?.value)
6966
- return;
6967
- if (uiService?.get("uiSelectMode")) {
6968
- document.dispatchEvent(new CustomEvent(UI_SELECT_MODE_EVENT_NAME, { detail: props.data }));
6969
- return;
6970
- }
6971
- if (hasChilren.value && !props.isCtrlKeyDown) {
6972
- updateStatus(nodeStatusMap.value, props.data.id, {
6973
- expand: true
6974
- });
6975
- }
6976
- nextTick(() => {
6977
- select(props.data);
6978
- });
6979
- };
6980
- const contextmenuHandler = (event) => {
6981
- event.preventDefault();
6982
- const nodes = editorService?.get("nodes") || [];
6983
- if (nodes.length < 2 || !nodes.includes(props.data)) {
6984
- nodeClickHandler();
6985
- }
6986
- emit("node-contextmenu", event, props.data);
6987
- };
6988
- const nodeContentmenuHandler = (event, node) => {
6989
- emit("node-contextmenu", event, node);
6990
- };
6991
- const select = async (data) => {
6992
- if (!data.id) {
6993
- throw new Error("没有id");
6994
- }
6995
- if (props.isCtrlKeyDown) {
6996
- multiSelect(data);
6997
- } else {
6998
- await editorService?.select(data);
6999
- editorService?.get("stage")?.select(data.id);
7000
- }
7001
- };
7002
- const multiSelect = async (data) => {
7003
- const nodes = editorService?.get("nodes") || [];
7004
- const newNodes = [];
7005
- let isCancel = false;
7006
- nodes.forEach((node) => {
7007
- if (node.id === data.id) {
7008
- isCancel = true;
7009
- return;
7010
- }
7011
- newNodes.push(node.id);
7012
- });
7013
- if (!isCancel || newNodes.length === 0) {
7014
- newNodes.push(data.id);
7015
- }
7016
- await editorService?.multiSelect(newNodes);
7017
- editorService?.get("stage")?.multiSelect(newNodes);
7018
- };
7019
- const highlightHandler = throttle(() => {
7020
- highlight();
7021
- }, throttleTime);
7022
- const highlight = () => {
7023
- editorService?.highlight(props.data);
7024
- editorService?.get("stage")?.highlight(props.data.id);
7025
- };
7026
- return (_ctx, _cache) => {
7027
- const _component_LayerNode = resolveComponent("LayerNode", true);
7028
- return withDirectives((openBlock(), createElementBlock("div", {
7029
- class: "magic-editor-layer-node",
7030
- ref_key: "nodeEl",
7031
- ref: nodeEl,
7032
- draggable: !unref(isPage)(_ctx.data),
7033
- "data-node-id": _ctx.data.id,
7034
- "data-is-container": Array.isArray(_ctx.data.items),
7035
- onDragstart: _cache[1] || (_cache[1] = //@ts-ignore
7036
- (...args) => unref(handleDragStart) && unref(handleDragStart)(...args)),
7037
- onDragleave: _cache[2] || (_cache[2] = //@ts-ignore
7038
- (...args) => unref(handleDragLeave) && unref(handleDragLeave)(...args)),
7039
- onDragend: _cache[3] || (_cache[3] = ($event) => unref(handleDragEnd)($event, _ctx.data))
7040
- }, [
7041
- createElementVNode("div", {
7042
- class: normalizeClass(["layer-node", { selected: selected.value, expanded: expanded.value }]),
7043
- style: normalizeStyle(`padding-left: ${_ctx.indent}px`),
7044
- onContextmenu: contextmenuHandler,
7045
- onMouseenter: _cache[0] || (_cache[0] = ($event) => unref(highlightHandler)())
7046
- }, [
7047
- createVNode(_sfc_main$M, {
7048
- class: "expand-icon",
7049
- style: normalizeStyle(hasChilren.value ? "" : "color: transparent; cursor: default"),
7050
- icon: expanded.value ? unref(ArrowDown) : unref(ArrowRight),
7051
- onClick: expandHandler
7052
- }, null, 8, ["style", "icon"]),
7053
- createElementVNode("div", {
7054
- class: "layer-node-content",
7055
- onClick: nodeClickHandler
7056
- }, [
7057
- renderSlot(_ctx.$slots, "layer-node-content", { data: _ctx.data }, () => [
7058
- createElementVNode("div", _hoisted_2$8, toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1),
7059
- createElementVNode("div", _hoisted_3$4, [
7060
- createVNode(_sfc_main$i, { data: _ctx.data }, null, 8, ["data"])
7061
- ])
7062
- ])
7063
- ])
7064
- ], 38),
7065
- hasChilren.value && expanded.value ? (openBlock(), createElementBlock("div", _hoisted_4$4, [
7066
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.items, (item) => {
7067
- return openBlock(), createBlock(_component_LayerNode, {
7068
- data: item,
7069
- parent: _ctx.data,
7070
- key: item.id,
7071
- indent: _ctx.indent + 11,
7072
- "filter-text": _ctx.filterText,
7073
- "is-ctrl-key-down": _ctx.isCtrlKeyDown,
7074
- onNodeContextmenu: nodeContentmenuHandler
7075
- }, {
7076
- "layer-node-content": withCtx(({ data: nodeData }) => [
7077
- renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData })
7078
- ]),
7079
- _: 2
7080
- }, 1032, ["data", "parent", "indent", "filter-text", "is-ctrl-key-down"]);
7081
- }), 128))
7082
- ])) : createCommentVNode("", true)
7083
- ], 40, _hoisted_1$a)), [
7084
- [vShow, visible.value]
7085
- ]);
7086
- };
7087
- }
7088
- });
7089
-
7090
7152
  var KeyBindingContainerKey = /* @__PURE__ */ ((KeyBindingContainerKey2) => {
7091
7153
  KeyBindingContainerKey2["STAGE"] = "stage";
7092
7154
  KeyBindingContainerKey2["LAYER_PANEL"] = "layer-panel";
@@ -7238,7 +7300,7 @@ const useKeybinding = (services, contianer) => {
7238
7300
  watchEffect(() => {
7239
7301
  if (contianer.value) {
7240
7302
  globalThis.addEventListener("blur", windowBlurHandler);
7241
- keybindingService?.registeEl(KeyBindingContainerKey.LAYER_PANEL, contianer.value);
7303
+ keybindingService?.registeEl(KeyBindingContainerKey.LAYER_PANEL, contianer.value.$el);
7242
7304
  } else {
7243
7305
  globalThis.removeEventListener("blur", windowBlurHandler);
7244
7306
  keybindingService?.unregisteEl(KeyBindingContainerKey.LAYER_PANEL);
@@ -7254,14 +7316,16 @@ const createPageNodeStatus = (services, pageId) => {
7254
7316
  map.set(pageId, {
7255
7317
  visible: true,
7256
7318
  expand: true,
7257
- selected: true
7319
+ selected: true,
7320
+ draggable: false
7258
7321
  });
7259
7322
  services?.editorService.getNodeById(pageId)?.items.forEach(
7260
7323
  (node) => traverseNode(node, (node2) => {
7261
7324
  map.set(node2.id, {
7262
7325
  visible: true,
7263
7326
  expand: false,
7264
- selected: false
7327
+ selected: false,
7328
+ draggable: true
7265
7329
  });
7266
7330
  })
7267
7331
  );
@@ -7311,7 +7375,8 @@ const useNodeStatus = (services, page) => {
7311
7375
  nodeStatusMap.value?.set(node2.id, {
7312
7376
  visible: true,
7313
7377
  expand: Array.isArray(node2.items),
7314
- selected: true
7378
+ selected: true,
7379
+ draggable: true
7315
7380
  });
7316
7381
  });
7317
7382
  });
@@ -7340,13 +7405,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
7340
7405
  setup(__props) {
7341
7406
  const services = inject("services");
7342
7407
  const editorService = services?.editorService;
7343
- const layerTreeContainer = ref();
7408
+ const tree = ref();
7344
7409
  const page = computed(() => editorService?.get("page"));
7345
- const root = computed(() => editorService?.get("root"));
7346
7410
  const { nodeStatusMap } = useNodeStatus(services, page);
7347
- const { isCtrlKeyDown } = useKeybinding(services, layerTreeContainer);
7348
- provide("nodeStatusMap", nodeStatusMap);
7349
- const { filterText, filterTextChangeHandler } = useFilter(nodeStatusMap, page);
7411
+ const { isCtrlKeyDown } = useKeybinding(services, tree);
7412
+ const { filterTextChangeHandler } = useFilter(nodeStatusMap, page);
7350
7413
  const collapseAllHandler = () => {
7351
7414
  if (!page.value || !nodeStatusMap.value)
7352
7415
  return;
@@ -7358,40 +7421,45 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
7358
7421
  status.expand = false;
7359
7422
  }
7360
7423
  };
7361
- const menu = ref();
7362
- const contextmenu = (event) => {
7363
- event.preventDefault();
7364
- menu.value?.show(event);
7365
- };
7366
- const { handleDragOver } = useDrag(services);
7424
+ const { handleDragStart, handleDragEnd, handleDragLeave, handleDragOver } = useDrag(services);
7425
+ const {
7426
+ menu,
7427
+ nodeClickHandler,
7428
+ nodeContentmenuHandler,
7429
+ highlightHandler: mouseenterHandler
7430
+ } = useClick(services, isCtrlKeyDown, nodeStatusMap);
7367
7431
  return (_ctx, _cache) => {
7368
- return openBlock(), createBlock(unref(TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
7432
+ return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-layer-panel" }, {
7369
7433
  default: withCtx(() => [
7370
7434
  renderSlot(_ctx.$slots, "layer-panel-header"),
7371
- createVNode(_sfc_main$t, { onSearch: unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
7372
- createElementVNode("div", {
7373
- class: "magic-editor-layer-tree",
7374
- ref_key: "layerTreeContainer",
7375
- ref: layerTreeContainer,
7435
+ createVNode(_sfc_main$u, { onSearch: unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
7436
+ page.value && unref(nodeStatusMap) ? (openBlock(), createBlock(_sfc_main$l, {
7437
+ key: 0,
7376
7438
  tabindex: "-1",
7377
- onDragover: _cache[0] || (_cache[0] = //@ts-ignore
7378
- (...args) => unref(handleDragOver) && unref(handleDragOver)(...args))
7379
- }, [
7380
- page.value && root.value ? (openBlock(), createBlock(_sfc_main$h, {
7381
- key: 0,
7382
- data: page.value,
7383
- "filter-text": unref(filterText),
7384
- "is-ctrl-key-down": unref(isCtrlKeyDown),
7385
- onNodeContextmenu: contextmenu
7386
- }, {
7387
- "layer-node-content": withCtx(({ data: nodeData }) => [
7388
- renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData })
7389
- ]),
7390
- _: 3
7391
- }, 8, ["data", "filter-text", "is-ctrl-key-down"])) : createCommentVNode("", true)
7392
- ], 544),
7439
+ ref_key: "tree",
7440
+ ref: tree,
7441
+ data: [page.value],
7442
+ "node-status-map": unref(nodeStatusMap),
7443
+ onNodeDragover: unref(handleDragOver),
7444
+ onNodeDragstart: unref(handleDragStart),
7445
+ onNodeDragleave: unref(handleDragLeave),
7446
+ onNodeDragend: unref(handleDragEnd),
7447
+ onNodeContextmenu: unref(nodeContentmenuHandler),
7448
+ onNodeMouseenter: unref(mouseenterHandler),
7449
+ onNodeClick: unref(nodeClickHandler)
7450
+ }, {
7451
+ "tree-node-tool": withCtx(({ data: nodeData }) => [
7452
+ renderSlot(_ctx.$slots, "layer-node-tool", { data: nodeData }, () => [
7453
+ createVNode(_sfc_main$h, { data: nodeData }, null, 8, ["data"])
7454
+ ])
7455
+ ]),
7456
+ "tree-node-content": withCtx(({ data: nodeData }) => [
7457
+ renderSlot(_ctx.$slots, "layer-node-content", { data: nodeData })
7458
+ ]),
7459
+ _: 3
7460
+ }, 8, ["data", "node-status-map", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : createCommentVNode("", true),
7393
7461
  (openBlock(), createBlock(Teleport, { to: "body" }, [
7394
- createVNode(_sfc_main$j, {
7462
+ createVNode(_sfc_main$i, {
7395
7463
  ref_key: "menu",
7396
7464
  ref: menu,
7397
7465
  "layer-content-menu": _ctx.layerContentMenu,
@@ -7487,7 +7555,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7487
7555
  "model-value": collapseValue.value
7488
7556
  }, {
7489
7557
  default: withCtx(() => [
7490
- createVNode(_sfc_main$t, { onSearch: filterTextChangeHandler }),
7558
+ createVNode(_sfc_main$u, { onSearch: filterTextChangeHandler }),
7491
7559
  (openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (group, index) => {
7492
7560
  return openBlock(), createElementBlock(Fragment, null, [
7493
7561
  group.items && group.items.length ? (openBlock(), createBlock(unref(TMagicCollapseItem), {
@@ -7495,7 +7563,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7495
7563
  name: `${index}`
7496
7564
  }, {
7497
7565
  title: withCtx(() => [
7498
- createVNode(_sfc_main$M, { icon: unref(Grid) }, null, 8, ["icon"]),
7566
+ createVNode(_sfc_main$N, { icon: unref(Grid) }, null, 8, ["icon"]),
7499
7567
  createTextVNode(toDisplayString(group.title), 1)
7500
7568
  ]),
7501
7569
  default: withCtx(() => [
@@ -7516,7 +7584,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
7516
7584
  content: item.desc
7517
7585
  }, {
7518
7586
  default: withCtx(() => [
7519
- createVNode(_sfc_main$M, {
7587
+ createVNode(_sfc_main$N, {
7520
7588
  icon: item.icon
7521
7589
  }, null, 8, ["icon"])
7522
7590
  ]),
@@ -7591,7 +7659,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7591
7659
  type: "component",
7592
7660
  icon: EditPen,
7593
7661
  text: "代码编辑",
7594
- component: _sfc_main$p,
7662
+ component: _sfc_main$q,
7595
7663
  slots: {}
7596
7664
  },
7597
7665
  "data-source": {
@@ -7599,7 +7667,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7599
7667
  type: "component",
7600
7668
  icon: Coin,
7601
7669
  text: "数据源",
7602
- component: _sfc_main$m,
7670
+ component: _sfc_main$n,
7603
7671
  slots: {}
7604
7672
  }
7605
7673
  };
@@ -7624,7 +7692,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7624
7692
  key: config.$key ?? index,
7625
7693
  onClick: ($event) => activeTabName.value = config.text || `${index}`
7626
7694
  }, [
7627
- config.icon ? (openBlock(), createBlock(_sfc_main$M, {
7695
+ config.icon ? (openBlock(), createBlock(_sfc_main$N, {
7628
7696
  key: 0,
7629
7697
  icon: config.icon
7630
7698
  }, null, 8, ["icon"])) : createCommentVNode("", true),
@@ -7695,6 +7763,29 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
7695
7763
  }, null, 8, ["data"])) : createCommentVNode("", true)
7696
7764
  ]),
7697
7765
  key: "5"
7766
+ } : void 0,
7767
+ config.$key === "layer" || config.slots?.layerNodeTool ? {
7768
+ name: "layer-node-tool",
7769
+ fn: withCtx(({ data: nodeData }) => [
7770
+ config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-node-tool", {
7771
+ key: 0,
7772
+ data: nodeData
7773
+ }) : config.slots?.layerNodeTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerNodeTool), {
7774
+ key: 1,
7775
+ data: nodeData
7776
+ }, null, 8, ["data"])) : createCommentVNode("", true)
7777
+ ]),
7778
+ key: "6"
7779
+ } : void 0,
7780
+ config.$key === "data-source" || config.slots?.codeBlockPanelTool ? {
7781
+ name: "data-source-panel-tool",
7782
+ fn: withCtx(({ data }) => [
7783
+ config.$key === "data-source" ? renderSlot(_ctx.$slots, "data-source-panel-tool", {
7784
+ key: 0,
7785
+ data
7786
+ }) : config.slots?.DataSourcePanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.DataSourcePanelTool), { key: 1 })) : createCommentVNode("", true)
7787
+ ]),
7788
+ key: "7"
7698
7789
  } : void 0
7699
7790
  ]), 1040)) : createCommentVNode("", true)
7700
7791
  ])), [
@@ -8322,7 +8413,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8322
8413
  content: _ctx.pinned ? "取消置于顶层自动隐藏" : "置于顶层不消失"
8323
8414
  }, {
8324
8415
  default: withCtx(() => [
8325
- createVNode(_sfc_main$M, {
8416
+ createVNode(_sfc_main$N, {
8326
8417
  style: { "margin-left": "10px", "cursor": "pointer" },
8327
8418
  icon: _ctx.pinned ? _sfc_main$a : _sfc_main$b,
8328
8419
  onClick: pinHandler
@@ -8338,7 +8429,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8338
8429
  onClick: closeHandler
8339
8430
  }, {
8340
8431
  default: withCtx(() => [
8341
- createVNode(_sfc_main$M, { icon: unref(Close) }, null, 8, ["icon"])
8432
+ createVNode(_sfc_main$N, { icon: unref(Close) }, null, 8, ["icon"])
8342
8433
  ]),
8343
8434
  _: 1
8344
8435
  })
@@ -8465,7 +8556,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
8465
8556
  menu.value?.hide();
8466
8557
  };
8467
8558
  return (_ctx, _cache) => {
8468
- return openBlock(), createBlock(_sfc_main$l, {
8559
+ return openBlock(), createBlock(_sfc_main$k, {
8469
8560
  ref_key: "menu",
8470
8561
  ref: menu,
8471
8562
  class: "magic-editor-node-list-menu",
@@ -8651,7 +8742,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
8651
8742
  };
8652
8743
  __expose({ show });
8653
8744
  return (_ctx, _cache) => {
8654
- return openBlock(), createBlock(_sfc_main$l, {
8745
+ return openBlock(), createBlock(_sfc_main$k, {
8655
8746
  "menu-data": menuData.value,
8656
8747
  ref_key: "menu",
8657
8748
  ref: menu
@@ -8984,14 +9075,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
8984
9075
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
8985
9076
  onClick: addPage
8986
9077
  }, [
8987
- createVNode(_sfc_main$M, { icon: unref(Plus) }, null, 8, ["icon"])
9078
+ createVNode(_sfc_main$N, { icon: unref(Plus) }, null, 8, ["icon"])
8988
9079
  ])) : (openBlock(), createElementBlock("div", _hoisted_1$2)),
8989
9080
  canScroll.value ? (openBlock(), createElementBlock("div", {
8990
9081
  key: 2,
8991
9082
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
8992
9083
  onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
8993
9084
  }, [
8994
- createVNode(_sfc_main$M, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
9085
+ createVNode(_sfc_main$N, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
8995
9086
  ])) : createCommentVNode("", true),
8996
9087
  pageLength.value ? (openBlock(), createElementBlock("div", {
8997
9088
  key: 3,
@@ -9007,7 +9098,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
9007
9098
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
9008
9099
  onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
9009
9100
  }, [
9010
- createVNode(_sfc_main$M, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
9101
+ createVNode(_sfc_main$N, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
9011
9102
  ])) : createCommentVNode("", true)
9012
9103
  ], 512);
9013
9104
  };
@@ -9079,7 +9170,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
9079
9170
  default: withCtx(() => [
9080
9171
  createElementVNode("div", null, [
9081
9172
  renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
9082
- createVNode(_sfc_main$w, {
9173
+ createVNode(_sfc_main$x, {
9083
9174
  data: {
9084
9175
  type: "button",
9085
9176
  text: "复制",
@@ -9087,7 +9178,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
9087
9178
  handler: () => copy(item)
9088
9179
  }
9089
9180
  }, null, 8, ["data"]),
9090
- createVNode(_sfc_main$w, {
9181
+ createVNode(_sfc_main$x, {
9091
9182
  data: {
9092
9183
  type: "button",
9093
9184
  text: "删除",
@@ -10264,13 +10355,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10264
10355
  );
10265
10356
  __expose(services);
10266
10357
  return (_ctx, _cache) => {
10267
- return openBlock(), createBlock(_sfc_main$x, null, {
10358
+ return openBlock(), createBlock(_sfc_main$y, null, {
10268
10359
  header: withCtx(() => [
10269
10360
  renderSlot(_ctx.$slots, "header")
10270
10361
  ]),
10271
10362
  nav: withCtx(() => [
10272
10363
  renderSlot(_ctx.$slots, "nav", { editorService: unref(editorService) }, () => [
10273
- createVNode(_sfc_main$v, { data: _ctx.menu }, null, 8, ["data"])
10364
+ createVNode(_sfc_main$w, { data: _ctx.menu }, null, 8, ["data"])
10274
10365
  ])
10275
10366
  ]),
10276
10367
  "content-before": withCtx(() => [
@@ -10291,6 +10382,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10291
10382
  "layer-node-content": withCtx(({ data }) => [
10292
10383
  renderSlot(_ctx.$slots, "layer-node-content", { data })
10293
10384
  ]),
10385
+ "layer-node-tool": withCtx(({ data }) => [
10386
+ renderSlot(_ctx.$slots, "layer-node-tool", { data })
10387
+ ]),
10294
10388
  "component-list-panel-header": withCtx(() => [
10295
10389
  renderSlot(_ctx.$slots, "component-list-panel-header")
10296
10390
  ]),
@@ -10306,6 +10400,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10306
10400
  data
10307
10401
  })
10308
10402
  ]),
10403
+ "data-source-panel-tool": withCtx(({ data }) => [
10404
+ renderSlot(_ctx.$slots, "data-source-panel-tool", { data })
10405
+ ]),
10309
10406
  _: 3
10310
10407
  }, 8, ["data", "layer-content-menu"])
10311
10408
  ])
@@ -10331,7 +10428,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10331
10428
  ]),
10332
10429
  "props-panel": withCtx(() => [
10333
10430
  renderSlot(_ctx.$slots, "props-panel", {}, () => [
10334
- createVNode(_sfc_main$u, {
10431
+ createVNode(_sfc_main$v, {
10335
10432
  "extend-state": _ctx.extendFormState,
10336
10433
  onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance))
10337
10434
  }, {
@@ -10369,23 +10466,23 @@ const index = {
10369
10466
  app.config.globalProperties.$TMAGIC_EDITOR = option;
10370
10467
  setConfig(option);
10371
10468
  app.component(_sfc_main.name, _sfc_main);
10372
- app.component("m-fields-ui-select", _sfc_main$B);
10373
- app.component("m-fields-code-link", _sfc_main$Q);
10374
- app.component("m-fields-vs-code", _sfc_main$R);
10375
- app.component("magic-code-editor", _sfc_main$S);
10376
- app.component("m-fields-code-select", _sfc_main$P);
10377
- app.component("m-fields-code-select-col", _sfc_main$L);
10378
- app.component("m-fields-event-select", _sfc_main$D);
10379
- app.component("m-fields-data-source-fields", _sfc_main$K);
10380
- app.component("m-fields-data-source-mocks", _sfc_main$F);
10381
- app.component("m-fields-key-value", _sfc_main$C);
10382
- app.component("m-fields-data-source-input", _sfc_main$I);
10383
- app.component("m-fields-data-source-select", _sfc_main$E);
10384
- app.component("m-fields-data-source-methods", _sfc_main$H);
10385
- app.component("m-fields-data-source-method-select", _sfc_main$G);
10386
- app.component("m-fields-data-source-field-select", _sfc_main$J);
10469
+ app.component("m-fields-ui-select", _sfc_main$C);
10470
+ app.component("m-fields-code-link", _sfc_main$R);
10471
+ app.component("m-fields-vs-code", _sfc_main$S);
10472
+ app.component("magic-code-editor", _sfc_main$T);
10473
+ app.component("m-fields-code-select", _sfc_main$Q);
10474
+ app.component("m-fields-code-select-col", _sfc_main$M);
10475
+ app.component("m-fields-event-select", _sfc_main$E);
10476
+ app.component("m-fields-data-source-fields", _sfc_main$L);
10477
+ app.component("m-fields-data-source-mocks", _sfc_main$G);
10478
+ app.component("m-fields-key-value", _sfc_main$D);
10479
+ app.component("m-fields-data-source-input", _sfc_main$J);
10480
+ app.component("m-fields-data-source-select", _sfc_main$F);
10481
+ app.component("m-fields-data-source-methods", _sfc_main$I);
10482
+ app.component("m-fields-data-source-method-select", _sfc_main$H);
10483
+ app.component("m-fields-data-source-field-select", _sfc_main$K);
10387
10484
  }
10388
10485
  };
10389
10486
 
10390
- export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$O as CodeBlockEditor, _sfc_main$q as CodeBlockList, _sfc_main$p as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$P as CodeSelect, _sfc_main$L as CodeSelectCol, ColumnLayout, _sfc_main$f as ComponentListPanel, _sfc_main$l as ContentMenu, _sfc_main$J as DataSourceFieldSelect, _sfc_main$K as DataSourceFields, _sfc_main$I as DataSourceInput, _sfc_main$G as DataSourceMethodSelect, _sfc_main$H as DataSourceMethods, _sfc_main$F as DataSourceMocks, _sfc_main$E as DataSourceSelect, DepTargetType, DragType, _sfc_main$D as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$M as Icon, KeyBindingCommand, _sfc_main$C as KeyValue, Keys, LayerOffset, _sfc_main$g as LayerPanel, Layout, _sfc_main$z as LayoutContainer, _sfc_main$u as PropsPanel, _sfc_main$A as Resizer, _sfc_main$z as SplitView, _sfc_main$S as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$w as ToolButton, UI_SELECT_MODE_EVENT_NAME, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, error, eventTabConfig, eventsService, fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getDisplayField, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, styleTabConfig, traverseNode, uiService, useCodeBlockEdit, useDataSourceMethod, useStage, warn };
10487
+ export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$P as CodeBlockEditor, _sfc_main$r as CodeBlockList, _sfc_main$q as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$Q as CodeSelect, _sfc_main$M as CodeSelectCol, ColumnLayout, _sfc_main$f as ComponentListPanel, _sfc_main$k as ContentMenu, _sfc_main$K as DataSourceFieldSelect, _sfc_main$L as DataSourceFields, _sfc_main$J as DataSourceInput, _sfc_main$H as DataSourceMethodSelect, _sfc_main$I as DataSourceMethods, _sfc_main$G as DataSourceMocks, _sfc_main$F as DataSourceSelect, DepTargetType, DragType, _sfc_main$E as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$N as Icon, KeyBindingCommand, _sfc_main$D as KeyValue, Keys, LayerOffset, _sfc_main$g as LayerPanel, Layout, _sfc_main$A as LayoutContainer, _sfc_main$v as PropsPanel, _sfc_main$B as Resizer, _sfc_main$A as SplitView, _sfc_main$T as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$x as ToolButton, UI_SELECT_MODE_EVENT_NAME, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, error, eventTabConfig, eventsService, fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getDisplayField, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, styleTabConfig, traverseNode, uiService, useCodeBlockEdit, useDataSourceMethod, useStage, warn };
10391
10488
  //# sourceMappingURL=tmagic-editor.js.map