@tmagic/editor 1.5.3 → 1.5.5

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 (36) hide show
  1. package/dist/tmagic-editor.js +601 -565
  2. package/dist/tmagic-editor.umd.cjs +600 -564
  3. package/package.json +7 -7
  4. package/src/components/CodeBlockEditor.vue +3 -3
  5. package/src/components/CodeParams.vue +2 -2
  6. package/src/components/ContentMenu.vue +13 -13
  7. package/src/components/FloatingBox.vue +9 -9
  8. package/src/components/Resizer.vue +2 -2
  9. package/src/components/ScrollBar.vue +6 -7
  10. package/src/components/ScrollViewer.vue +6 -6
  11. package/src/components/SplitView.vue +2 -2
  12. package/src/fields/DataSourceInput.vue +3 -3
  13. package/src/fields/DataSourceMethods.vue +4 -4
  14. package/src/hooks/use-code-block-edit.ts +5 -5
  15. package/src/initService.ts +289 -220
  16. package/src/layouts/CodeEditor.vue +6 -6
  17. package/src/layouts/Framework.vue +5 -5
  18. package/src/layouts/NavMenu.vue +6 -3
  19. package/src/layouts/page-bar/PageBar.vue +13 -13
  20. package/src/layouts/page-bar/PageBarScrollContainer.vue +12 -11
  21. package/src/layouts/props-panel/FormPanel.vue +6 -6
  22. package/src/layouts/props-panel/PropsPanel.vue +4 -2
  23. package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +3 -3
  24. package/src/layouts/sidebar/layer/LayerMenu.vue +2 -2
  25. package/src/layouts/sidebar/layer/LayerPanel.vue +5 -4
  26. package/src/layouts/sidebar/layer/use-click.ts +4 -6
  27. package/src/layouts/workspace/viewer/NodeListMenu.vue +5 -5
  28. package/src/layouts/workspace/viewer/Stage.vue +13 -13
  29. package/src/layouts/workspace/viewer/StageOverlay.vue +2 -2
  30. package/src/layouts/workspace/viewer/ViewerMenu.vue +3 -3
  31. package/src/services/componentList.ts +2 -2
  32. package/src/services/dep.ts +10 -4
  33. package/src/services/stageOverlay.ts +2 -2
  34. package/src/services/ui.ts +2 -2
  35. package/src/utils/idle-task.ts +26 -10
  36. package/types/index.d.ts +7 -60
@@ -23,7 +23,7 @@
23
23
 
24
24
  const monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
25
25
 
26
- const _hoisted_1$Y = ["src"];
26
+ const _hoisted_1$10 = ["src"];
27
27
  const _sfc_main$1s = /* @__PURE__ */ vue.defineComponent({
28
28
  ...{
29
29
  name: "MEditorIcon"
@@ -48,7 +48,7 @@
48
48
  class: "magic-editor-icon"
49
49
  }, {
50
50
  default: vue.withCtx(() => [
51
- vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$Y)
51
+ vue.createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$10)
52
52
  ]),
53
53
  _: 1
54
54
  })) : typeof _ctx.icon === "string" ? (vue.openBlock(), vue.createElementBlock("i", {
@@ -76,9 +76,13 @@
76
76
  emmetMonacoEs.emmetHTML(monaco__namespace);
77
77
  emmetMonacoEs.emmetCSS(monaco__namespace, ["css", "scss"]);
78
78
 
79
- const _hoisted_1$X = {
79
+ const _hoisted_1$$ = {
80
80
  class: /* @__PURE__ */ vue.normalizeClass(`magic-code-editor`)
81
81
  };
82
+ const _hoisted_2$o = {
83
+ ref: "codeEditor",
84
+ class: "magic-code-editor-content"
85
+ };
82
86
  const _sfc_main$1r = /* @__PURE__ */ vue.defineComponent({
83
87
  ...{
84
88
  name: "MEditorCodeEditor"
@@ -132,7 +136,7 @@
132
136
  let vsDiffEditor = null;
133
137
  const values = vue.ref("");
134
138
  const loading = vue.ref(false);
135
- const codeEditor = vue.useTemplateRef("codeEditor");
139
+ const codeEditorEl = vue.useTemplateRef("codeEditor");
136
140
  const resizeObserver = new globalThis.ResizeObserver(
137
141
  lodashEs.throttle(() => {
138
142
  vsEditor?.layout();
@@ -153,7 +157,7 @@
153
157
  };
154
158
  const getEditorValue = () => (props.type === "diff" ? vsDiffEditor?.getModifiedEditor().getValue() : vsEditor?.getValue()) || "";
155
159
  const init = async () => {
156
- if (!codeEditor.value) return;
160
+ if (!codeEditorEl.value) return;
157
161
  const options = {
158
162
  value: values.value,
159
163
  language: props.language,
@@ -161,14 +165,14 @@
161
165
  ...props.options
162
166
  };
163
167
  if (props.type === "diff") {
164
- vsDiffEditor = monaco__namespace.editor.createDiffEditor(codeEditor.value, options);
168
+ vsDiffEditor = monaco__namespace.editor.createDiffEditor(codeEditorEl.value, options);
165
169
  } else {
166
- vsEditor = monaco__namespace.editor.create(codeEditor.value, options);
170
+ vsEditor = monaco__namespace.editor.create(codeEditorEl.value, options);
167
171
  }
168
172
  setEditorValue(props.initValues, props.modifiedValues);
169
173
  loading.value = false;
170
174
  emit("initd", vsEditor);
171
- codeEditor.value.addEventListener("keydown", (e) => {
175
+ codeEditorEl.value.addEventListener("keydown", (e) => {
172
176
  if (e.keyCode === 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
173
177
  e.preventDefault();
174
178
  e.stopPropagation();
@@ -186,7 +190,7 @@
186
190
  }
187
191
  });
188
192
  }
189
- resizeObserver.observe(codeEditor.value);
193
+ resizeObserver.observe(codeEditorEl.value);
190
194
  };
191
195
  vue.watch(
192
196
  () => props.initValues,
@@ -236,7 +240,7 @@
236
240
  }
237
241
  });
238
242
  return (_ctx, _cache) => {
239
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
243
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$$, [
240
244
  (vue.openBlock(), vue.createBlock(vue.Teleport, {
241
245
  to: "body",
242
246
  disabled: !fullScreen.value
@@ -256,11 +260,7 @@
256
260
  ]),
257
261
  _: 1
258
262
  }),
259
- vue.createElementVNode("div", {
260
- ref_key: "codeEditor",
261
- ref: codeEditor,
262
- class: "magic-code-editor-content"
263
- }, null, 512)
263
+ vue.createElementVNode("div", _hoisted_2$o, null, 512)
264
264
  ], 6)
265
265
  ], 8, ["disabled"]))
266
266
  ]);
@@ -2830,13 +2830,14 @@
2830
2830
  };
2831
2831
  class IdleTask extends events.EventEmitter {
2832
2832
  taskList = [];
2833
+ hightLevelTaskList = [];
2833
2834
  taskHandle = null;
2834
2835
  constructor() {
2835
2836
  super();
2836
2837
  this.setMaxListeners(1e3);
2837
2838
  }
2838
- enqueueTask(taskHandler, taskData) {
2839
- this.taskList.push({
2839
+ enqueueTask(taskHandler, taskData, isHightLevel = false) {
2840
+ (isHightLevel ? this.hightLevelTaskList : this.taskList).push({
2840
2841
  handler: taskHandler,
2841
2842
  data: taskData
2842
2843
  });
@@ -2845,6 +2846,10 @@
2845
2846
  }
2846
2847
  }
2847
2848
  clearTasks() {
2849
+ if (this.taskHandle) {
2850
+ globalThis.cancelIdleCallback(this.taskHandle);
2851
+ }
2852
+ this.hightLevelTaskList = [];
2848
2853
  this.taskList = [];
2849
2854
  }
2850
2855
  on(eventName, listener) {
@@ -2857,7 +2862,8 @@
2857
2862
  return super.emit(eventName, ...args);
2858
2863
  }
2859
2864
  runTaskQueue(deadline) {
2860
- while (deadline.timeRemaining() > 0 && this.taskList.length) {
2865
+ const { hightLevelTaskList, taskList } = this;
2866
+ while (deadline.timeRemaining() > 0 && (taskList.length || hightLevelTaskList.length)) {
2861
2867
  const timeRemaining = deadline.timeRemaining();
2862
2868
  let times = 0;
2863
2869
  if (timeRemaining <= 5) {
@@ -2870,16 +2876,19 @@
2870
2876
  times = 600;
2871
2877
  }
2872
2878
  for (let i = 0; i < times; i++) {
2873
- const task = this.taskList.shift();
2879
+ const task = hightLevelTaskList.length > 0 ? hightLevelTaskList.shift() : taskList.shift();
2874
2880
  if (task) {
2875
2881
  task.handler(task.data);
2876
2882
  }
2877
- if (this.taskList.length === 0) {
2883
+ if (hightLevelTaskList.length === 0 && taskList.length === 0) {
2878
2884
  break;
2879
2885
  }
2880
2886
  }
2881
2887
  }
2882
- if (this.taskList.length) {
2888
+ if (!hightLevelTaskList.length) {
2889
+ this.emit("hight-level-finish");
2890
+ }
2891
+ if (hightLevelTaskList.length || taskList.length) {
2883
2892
  this.taskHandle = globalThis.requestIdleCallback(this.runTaskQueue.bind(this), { timeout: 300 });
2884
2893
  } else {
2885
2894
  this.taskHandle = 0;
@@ -3041,7 +3050,7 @@
3041
3050
  setup(__props, { emit: __emit }) {
3042
3051
  const props = __props;
3043
3052
  const emit = __emit;
3044
- const form = vue.useTemplateRef("form");
3053
+ const formRef = vue.useTemplateRef("form");
3045
3054
  const getFormConfig = (items = []) => [
3046
3055
  {
3047
3056
  type: "fieldset",
@@ -3064,7 +3073,7 @@
3064
3073
  );
3065
3074
  const onParamsChangeHandler = async (v, eventData) => {
3066
3075
  try {
3067
- const value = await form.value?.submitForm(true);
3076
+ const value = await formRef.value?.submitForm(true);
3068
3077
  emit("change", value, eventData);
3069
3078
  } catch (e) {
3070
3079
  error(e);
@@ -3072,8 +3081,7 @@
3072
3081
  };
3073
3082
  return (_ctx, _cache) => {
3074
3083
  return vue.openBlock(), vue.createBlock(vue.unref(formPlugin.MForm), {
3075
- ref_key: "form",
3076
- ref: form,
3084
+ ref: "form",
3077
3085
  config: codeParamsConfig.value,
3078
3086
  "init-values": _ctx.model,
3079
3087
  disabled: _ctx.disabled,
@@ -3085,8 +3093,8 @@
3085
3093
  }
3086
3094
  });
3087
3095
 
3088
- const _hoisted_1$W = { class: "m-fields-code-select-col" };
3089
- const _hoisted_2$m = { class: "code-select-container" };
3096
+ const _hoisted_1$_ = { class: "m-fields-code-select-col" };
3097
+ const _hoisted_2$n = { class: "code-select-container" };
3090
3098
  const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
3091
3099
  ...{
3092
3100
  name: "MFieldsCodeSelectCol"
@@ -3183,8 +3191,8 @@
3183
3191
  eventBus?.emit("edit-code", id);
3184
3192
  };
3185
3193
  return (_ctx, _cache) => {
3186
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [
3187
- vue.createElementVNode("div", _hoisted_2$m, [
3194
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$_, [
3195
+ vue.createElementVNode("div", _hoisted_2$n, [
3188
3196
  vue.createVNode(vue.unref(formPlugin.MContainer), {
3189
3197
  class: "select",
3190
3198
  config: selectConfig,
@@ -3305,6 +3313,10 @@
3305
3313
  }
3306
3314
  });
3307
3315
 
3316
+ const _hoisted_1$Z = {
3317
+ ref: "title",
3318
+ class: "m-editor-float-box-title"
3319
+ };
3308
3320
  const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
3309
3321
  __name: "FloatingBox",
3310
3322
  props: /* @__PURE__ */ vue.mergeModels({
@@ -3325,8 +3337,8 @@
3325
3337
  const height = vue.useModel(__props, "height");
3326
3338
  const visible = vue.useModel(__props, "visible");
3327
3339
  const props = __props;
3328
- const target = vue.useTemplateRef("target");
3329
- const titleEl = vue.useTemplateRef("titleEl");
3340
+ const targetEl = vue.useTemplateRef("target");
3341
+ const titleEl = vue.useTemplateRef("title");
3330
3342
  const zIndex = designPlugin.useZIndex();
3331
3343
  const curZIndex = vue.ref(0);
3332
3344
  const titleHeight = vue.ref(0);
@@ -3334,8 +3346,8 @@
3334
3346
  if (height.value) {
3335
3347
  return height.value - titleHeight.value;
3336
3348
  }
3337
- if (target.value) {
3338
- return target.value.clientHeight - titleHeight.value;
3349
+ if (targetEl.value) {
3350
+ return targetEl.value.clientHeight - titleHeight.value;
3339
3351
  }
3340
3352
  return "auto";
3341
3353
  });
@@ -3357,7 +3369,7 @@
3357
3369
  const initMoveable = () => {
3358
3370
  moveable = new VanillaMoveable(globalThis.document.body, {
3359
3371
  className: "m-editor-floating-box-moveable",
3360
- target: target.value,
3372
+ target: targetEl.value,
3361
3373
  draggable: true,
3362
3374
  resizable: true,
3363
3375
  edge: true,
@@ -3391,7 +3403,7 @@
3391
3403
  if (visible2) {
3392
3404
  await vue.nextTick();
3393
3405
  curZIndex.value = zIndex.nextZIndex();
3394
- const targetRect = target.value?.getBoundingClientRect();
3406
+ const targetRect = targetEl.value?.getBoundingClientRect();
3395
3407
  if (targetRect) {
3396
3408
  width.value = targetRect.width;
3397
3409
  height.value = targetRect.height;
@@ -3427,10 +3439,10 @@
3427
3439
  const nextZIndex = () => {
3428
3440
  curZIndex.value = zIndex.nextZIndex();
3429
3441
  };
3430
- vue.provide("parentFloating", target);
3442
+ vue.provide("parentFloating", targetEl);
3431
3443
  __expose({
3432
3444
  bodyHeight,
3433
- target,
3445
+ target: targetEl,
3434
3446
  titleEl
3435
3447
  });
3436
3448
  return (_ctx, _cache) => {
@@ -3439,17 +3451,12 @@
3439
3451
  to: "body"
3440
3452
  }, [
3441
3453
  vue.createElementVNode("div", {
3442
- ref_key: "target",
3443
- ref: target,
3454
+ ref: "target",
3444
3455
  class: "m-editor-float-box",
3445
3456
  style: vue.normalizeStyle({ ...style.value, zIndex: curZIndex.value }),
3446
3457
  onMousedown: nextZIndex
3447
3458
  }, [
3448
- vue.createElementVNode("div", {
3449
- ref_key: "titleEl",
3450
- ref: titleEl,
3451
- class: "m-editor-float-box-title"
3452
- }, [
3459
+ vue.createElementVNode("div", _hoisted_1$Z, [
3453
3460
  vue.renderSlot(_ctx.$slots, "title", {}, () => [
3454
3461
  vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
3455
3462
  ]),
@@ -3481,7 +3488,7 @@
3481
3488
  const useCodeBlockEdit = (codeBlockService) => {
3482
3489
  const codeConfig = vue.ref();
3483
3490
  const codeId = vue.ref();
3484
- const codeBlockEditor = vue.useTemplateRef("codeBlockEditor");
3491
+ const codeBlockEditorRef = vue.useTemplateRef("codeBlockEditor");
3485
3492
  const createCodeBlock = async () => {
3486
3493
  if (!codeBlockService) {
3487
3494
  designPlugin.tMagicMessage.error("新增代码块失败");
@@ -3496,7 +3503,7 @@
3496
3503
  };
3497
3504
  codeId.value = await codeBlockService.getUniqueId();
3498
3505
  await vue.nextTick();
3499
- codeBlockEditor.value?.show();
3506
+ codeBlockEditorRef.value?.show();
3500
3507
  };
3501
3508
  const editCode = async (id) => {
3502
3509
  const codeBlock = await codeBlockService?.getCodeContentById(id);
@@ -3514,7 +3521,7 @@
3514
3521
  };
3515
3522
  codeId.value = id;
3516
3523
  await vue.nextTick();
3517
- codeBlockEditor.value?.show();
3524
+ codeBlockEditorRef.value?.show();
3518
3525
  };
3519
3526
  const deleteCode = async (key) => {
3520
3527
  codeBlockService?.deleteCodeDslByIds([key]);
@@ -3522,12 +3529,12 @@
3522
3529
  const submitCodeBlockHandler = async (values) => {
3523
3530
  if (!codeId.value) return;
3524
3531
  await codeBlockService?.setCodeDslById(codeId.value, values);
3525
- codeBlockEditor.value?.hide();
3532
+ codeBlockEditorRef.value?.hide();
3526
3533
  };
3527
3534
  return {
3528
3535
  codeId,
3529
3536
  codeConfig,
3530
- codeBlockEditor,
3537
+ codeBlockEditor: codeBlockEditorRef,
3531
3538
  createCodeBlock,
3532
3539
  editCode,
3533
3540
  deleteCode,
@@ -3535,7 +3542,7 @@
3535
3542
  };
3536
3543
  };
3537
3544
 
3538
- const state = vue.reactive({
3545
+ const state = vue.shallowReactive({
3539
3546
  uiSelectMode: false,
3540
3547
  showSrc: false,
3541
3548
  showStylePanel: true,
@@ -3983,8 +3990,8 @@
3983
3990
  };
3984
3991
  };
3985
3992
 
3986
- const _hoisted_1$V = { class: "m-editor-data-source-fields" };
3987
- const _hoisted_2$l = { class: "m-editor-data-source-fields-footer" };
3993
+ const _hoisted_1$Y = { class: "m-editor-data-source-fields" };
3994
+ const _hoisted_2$m = { class: "m-editor-data-source-fields-footer" };
3988
3995
  const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
3989
3996
  ...{
3990
3997
  name: "MFieldsDataSourceFields"
@@ -4249,12 +4256,12 @@
4249
4256
  const parentFloating = vue.inject("parentFloating", vue.ref(null));
4250
4257
  const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
4251
4258
  return (_ctx, _cache) => {
4252
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
4259
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Y, [
4253
4260
  vue.createVNode(vue.unref(tablePlugin.MagicTable), {
4254
4261
  data: _ctx.model[_ctx.name],
4255
4262
  columns: fieldColumns
4256
4263
  }, null, 8, ["data"]),
4257
- vue.createElementVNode("div", _hoisted_2$l, [
4264
+ vue.createElementVNode("div", _hoisted_2$m, [
4258
4265
  vue.createVNode(vue.unref(designPlugin.TMagicButton), {
4259
4266
  size: "small",
4260
4267
  disabled: _ctx.disabled,
@@ -4327,7 +4334,7 @@
4327
4334
  }
4328
4335
  });
4329
4336
 
4330
- const _hoisted_1$U = { class: "m-editor-data-source-field-select" };
4337
+ const _hoisted_1$X = { class: "m-editor-data-source-field-select" };
4331
4338
  const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
4332
4339
  __name: "FieldSelect",
4333
4340
  props: /* @__PURE__ */ vue.mergeModels({
@@ -4409,7 +4416,7 @@
4409
4416
  eventBus?.emit("edit-data-source", removeDataSourceFieldPrefix(id));
4410
4417
  };
4411
4418
  return (_ctx, _cache) => {
4412
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$U, [
4419
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$X, [
4413
4420
  _ctx.checkStrictly ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4414
4421
  vue.createVNode(vue.unref(designPlugin.TMagicSelect), {
4415
4422
  "model-value": selectDataSourceId.value,
@@ -4491,7 +4498,7 @@
4491
4498
  }
4492
4499
  });
4493
4500
 
4494
- const _hoisted_1$T = { class: "m-fields-data-source-field-select" };
4501
+ const _hoisted_1$W = { class: "m-fields-data-source-field-select" };
4495
4502
  const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
4496
4503
  ...{
4497
4504
  name: "MFieldsDataSourceFieldSelect"
@@ -4593,7 +4600,7 @@
4593
4600
  }
4594
4601
  };
4595
4602
  return (_ctx, _cache) => {
4596
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$T, [
4603
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [
4597
4604
  showDataSourceFieldSelect.value || !_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(_sfc_main$1i, {
4598
4605
  key: 0,
4599
4606
  "model-value": _ctx.model[_ctx.name],
@@ -4641,8 +4648,8 @@
4641
4648
  }
4642
4649
  });
4643
4650
 
4644
- const _hoisted_1$S = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
4645
- const _hoisted_2$k = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
4651
+ const _hoisted_1$V = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
4652
+ const _hoisted_2$l = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
4646
4653
  const _hoisted_3$8 = { class: "el-input__inner t-input__inner" };
4647
4654
  const _sfc_main$1g = /* @__PURE__ */ vue.defineComponent({
4648
4655
  ...{
@@ -4665,11 +4672,11 @@
4665
4672
  const props = __props;
4666
4673
  const emit = __emit;
4667
4674
  const { dataSourceService } = vue.inject("services") || {};
4668
- const autocomplete = vue.useTemplateRef("autocomplete");
4675
+ const autocompleteRef = vue.useTemplateRef("autocomplete");
4669
4676
  const isFocused = vue.ref(false);
4670
4677
  const state = vue.ref("");
4671
4678
  const displayState = vue.ref([]);
4672
- const input = vue.computed(() => autocomplete.value?.inputRef?.input);
4679
+ const input = vue.computed(() => autocompleteRef.value?.inputRef?.input);
4673
4680
  const dataSources = vue.computed(() => dataSourceService?.get("dataSources") || []);
4674
4681
  const setDisplayState = () => {
4675
4682
  displayState.value = getDisplayField(dataSources.value, state.value);
@@ -4688,7 +4695,7 @@
4688
4695
  const focusOffset = selection?.focusOffset || 0;
4689
4696
  isFocused.value = true;
4690
4697
  await vue.nextTick();
4691
- autocomplete.value?.focus();
4698
+ autocompleteRef.value?.focus();
4692
4699
  if (focusOffset && input.value) {
4693
4700
  input.value.setSelectionRange(anchorOffset, focusOffset);
4694
4701
  }
@@ -4824,8 +4831,7 @@
4824
4831
  {
4825
4832
  key: 0,
4826
4833
  class: "tmagic-design-auto-complete",
4827
- ref_key: "autocomplete",
4828
- ref: autocomplete,
4834
+ ref: "autocomplete",
4829
4835
  modelValue: state.value,
4830
4836
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
4831
4837
  },
@@ -4847,9 +4853,9 @@
4847
4853
  vue.createVNode(_sfc_main$1s, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
4848
4854
  ]),
4849
4855
  default: vue.withCtx(({ item }) => [
4850
- vue.createElementVNode("div", _hoisted_1$S, [
4856
+ vue.createElementVNode("div", _hoisted_1$V, [
4851
4857
  vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
4852
- vue.createElementVNode("span", _hoisted_2$k, vue.toDisplayString(item.value), 1)
4858
+ vue.createElementVNode("span", _hoisted_2$l, vue.toDisplayString(item.value), 1)
4853
4859
  ])
4854
4860
  ]),
4855
4861
  _: 1
@@ -4890,8 +4896,8 @@
4890
4896
  }
4891
4897
  });
4892
4898
 
4893
- const _hoisted_1$R = { style: { "display": "flex", "margin-bottom": "10px" } };
4894
- const _hoisted_2$j = { style: { "flex": "1" } };
4899
+ const _hoisted_1$U = { style: { "display": "flex", "margin-bottom": "10px" } };
4900
+ const _hoisted_2$k = { style: { "flex": "1" } };
4895
4901
  const _hoisted_3$7 = { style: { "flex": "1" } };
4896
4902
  const _hoisted_4$5 = { class: "dialog-footer" };
4897
4903
  const _sfc_main$1f = /* @__PURE__ */ vue.defineComponent({
@@ -4920,12 +4926,12 @@
4920
4926
  const { height: codeBlockEditorHeight } = useEditorContentHeight();
4921
4927
  const difVisible = vue.ref(false);
4922
4928
  const { rect: windowRect } = useWindowRect();
4923
- const magicVsEditor = vue.useTemplateRef("magicVsEditor");
4929
+ const magicVsEditorRef = vue.useTemplateRef("magicVsEditor");
4924
4930
  const diffChange = () => {
4925
- if (!magicVsEditor.value || !formBox.value?.form) {
4931
+ if (!magicVsEditorRef.value || !formBox.value?.form) {
4926
4932
  return;
4927
4933
  }
4928
- formBox.value.form.values.content = magicVsEditor.value.getEditorValue();
4934
+ formBox.value.form.values.content = magicVsEditorRef.value.getEditorValue();
4929
4935
  difVisible.value = false;
4930
4936
  };
4931
4937
  const defaultParamColConfig = {
@@ -5144,8 +5150,8 @@
5144
5150
  ])
5145
5151
  ]),
5146
5152
  default: vue.withCtx(() => [
5147
- vue.createElementVNode("div", _hoisted_1$R, [
5148
- vue.createElementVNode("div", _hoisted_2$j, [
5153
+ vue.createElementVNode("div", _hoisted_1$U, [
5154
+ vue.createElementVNode("div", _hoisted_2$k, [
5149
5155
  vue.createVNode(vue.unref(designPlugin.TMagicTag), {
5150
5156
  size: "small",
5151
5157
  type: "info"
@@ -5170,8 +5176,7 @@
5170
5176
  ]),
5171
5177
  difVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1r, {
5172
5178
  key: 0,
5173
- ref_key: "magicVsEditor",
5174
- ref: magicVsEditor,
5179
+ ref: "magicVsEditor",
5175
5180
  type: "diff",
5176
5181
  language: "json",
5177
5182
  initValues: _ctx.content.content,
@@ -5187,8 +5192,8 @@
5187
5192
  }
5188
5193
  });
5189
5194
 
5190
- const _hoisted_1$Q = { class: "m-editor-data-source-methods" };
5191
- const _hoisted_2$i = { class: "m-editor-data-source-methods-footer" };
5195
+ const _hoisted_1$T = { class: "m-editor-data-source-methods" };
5196
+ const _hoisted_2$j = { class: "m-editor-data-source-methods-footer" };
5192
5197
  const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
5193
5198
  ...{
5194
5199
  name: "MFieldsDataSourceMethods"
@@ -5210,7 +5215,7 @@
5210
5215
  const props = __props;
5211
5216
  const emit = __emit;
5212
5217
  const codeConfig = vue.ref();
5213
- const codeBlockEditor = vue.useTemplateRef("codeBlockEditor");
5218
+ const codeBlockEditorRef = vue.useTemplateRef("codeBlockEditor");
5214
5219
  let editIndex = -1;
5215
5220
  const methodColumns = [
5216
5221
  {
@@ -5249,7 +5254,7 @@
5249
5254
  };
5250
5255
  editIndex = index;
5251
5256
  vue.nextTick(() => {
5252
- codeBlockEditor.value?.show();
5257
+ codeBlockEditorRef.value?.show();
5253
5258
  });
5254
5259
  }
5255
5260
  },
@@ -5275,7 +5280,7 @@
5275
5280
  };
5276
5281
  editIndex = -1;
5277
5282
  vue.nextTick(() => {
5278
- codeBlockEditor.value?.show();
5283
+ codeBlockEditorRef.value?.show();
5279
5284
  });
5280
5285
  };
5281
5286
  const submitCodeHandler = (value, data) => {
@@ -5307,15 +5312,15 @@
5307
5312
  }
5308
5313
  editIndex = -1;
5309
5314
  codeConfig.value = void 0;
5310
- codeBlockEditor.value?.hide();
5315
+ codeBlockEditorRef.value?.hide();
5311
5316
  };
5312
5317
  return (_ctx, _cache) => {
5313
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
5318
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$T, [
5314
5319
  vue.createVNode(vue.unref(tablePlugin.MagicTable), {
5315
5320
  data: _ctx.model[_ctx.name],
5316
5321
  columns: methodColumns
5317
5322
  }, null, 8, ["data"]),
5318
- vue.createElementVNode("div", _hoisted_2$i, [
5323
+ vue.createElementVNode("div", _hoisted_2$j, [
5319
5324
  vue.createVNode(vue.unref(designPlugin.TMagicButton), {
5320
5325
  size: "small",
5321
5326
  type: "primary",
@@ -5331,8 +5336,7 @@
5331
5336
  ]),
5332
5337
  codeConfig.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1f, {
5333
5338
  key: 0,
5334
- ref_key: "codeBlockEditor",
5335
- ref: codeBlockEditor,
5339
+ ref: "codeBlockEditor",
5336
5340
  disabled: _ctx.disabled,
5337
5341
  content: codeConfig.value,
5338
5342
  "is-data-source": true,
@@ -5344,8 +5348,8 @@
5344
5348
  }
5345
5349
  });
5346
5350
 
5347
- const _hoisted_1$P = { class: "m-fields-data-source-method-select" };
5348
- const _hoisted_2$h = { class: "data-source-method-select-container" };
5351
+ const _hoisted_1$S = { class: "m-fields-data-source-method-select" };
5352
+ const _hoisted_2$i = { class: "data-source-method-select-container" };
5349
5353
  const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
5350
5354
  ...{
5351
5355
  name: "MFieldsDataSourceMethodSelect"
@@ -5432,8 +5436,8 @@
5432
5436
  eventBus?.emit("edit-data-source", id);
5433
5437
  };
5434
5438
  return (_ctx, _cache) => {
5435
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$P, [
5436
- vue.createElementVNode("div", _hoisted_2$h, [
5439
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$S, [
5440
+ vue.createElementVNode("div", _hoisted_2$i, [
5437
5441
  vue.createVNode(vue.unref(formPlugin.MContainer), {
5438
5442
  class: "select",
5439
5443
  config: cascaderConfig.value,
@@ -5476,8 +5480,8 @@
5476
5480
  }
5477
5481
  });
5478
5482
 
5479
- const _hoisted_1$O = { class: "m-editor-data-source-fields" };
5480
- const _hoisted_2$g = { class: "m-editor-data-source-fields-footer" };
5483
+ const _hoisted_1$R = { class: "m-editor-data-source-fields" };
5484
+ const _hoisted_2$h = { class: "m-editor-data-source-fields-footer" };
5481
5485
  const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
5482
5486
  ...{
5483
5487
  name: "MFieldsDataSourceMocks"
@@ -5682,12 +5686,12 @@
5682
5686
  const parentFloating = vue.inject("parentFloating", vue.ref(null));
5683
5687
  const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
5684
5688
  return (_ctx, _cache) => {
5685
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$O, [
5689
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$R, [
5686
5690
  vue.createVNode(vue.unref(tablePlugin.MagicTable), {
5687
5691
  data: _ctx.model[_ctx.name],
5688
5692
  columns
5689
5693
  }, null, 8, ["data"]),
5690
- vue.createElementVNode("div", _hoisted_2$g, [
5694
+ vue.createElementVNode("div", _hoisted_2$h, [
5691
5695
  vue.createVNode(vue.unref(designPlugin.TMagicButton), {
5692
5696
  size: "small",
5693
5697
  type: "primary",
@@ -5728,7 +5732,7 @@
5728
5732
  }
5729
5733
  });
5730
5734
 
5731
- const _hoisted_1$N = { class: "m-fields-data-source-select" };
5735
+ const _hoisted_1$Q = { class: "m-fields-data-source-select" };
5732
5736
  const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
5733
5737
  ...{
5734
5738
  name: "MFieldsDataSourceSelect"
@@ -5786,7 +5790,7 @@
5786
5790
  eventBus?.emit("edit-data-source", id);
5787
5791
  };
5788
5792
  return (_ctx, _cache) => {
5789
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$N, [
5793
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$Q, [
5790
5794
  vue.createVNode(vue.unref(formPlugin.MSelect), {
5791
5795
  model: _ctx.model,
5792
5796
  name: _ctx.name,
@@ -5954,8 +5958,8 @@
5954
5958
  }
5955
5959
  });
5956
5960
 
5957
- const _hoisted_1$M = { class: "m-fields-event-select" };
5958
- const _hoisted_2$f = {
5961
+ const _hoisted_1$P = { class: "m-fields-event-select" };
5962
+ const _hoisted_2$g = {
5959
5963
  key: 1,
5960
5964
  class: "fullWidth"
5961
5965
  };
@@ -6235,7 +6239,7 @@
6235
6239
  const onChangeHandler = (v, eventData) => emit("change", props.model[props.name], eventData);
6236
6240
  return (_ctx, _cache) => {
6237
6241
  const _component_m_form_table = vue.resolveComponent("m-form-table");
6238
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$M, [
6242
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$P, [
6239
6243
  isOldVersion.value ? (vue.openBlock(), vue.createBlock(_component_m_form_table, {
6240
6244
  key: 0,
6241
6245
  name: "events",
@@ -6244,7 +6248,7 @@
6244
6248
  model: _ctx.model,
6245
6249
  config: tableConfig.value,
6246
6250
  onChange: onChangeHandler
6247
- }, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
6251
+ }, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$g, [
6248
6252
  vue.createVNode(vue.unref(designPlugin.TMagicButton), {
6249
6253
  class: "create-button",
6250
6254
  type: "primary",
@@ -6296,7 +6300,7 @@
6296
6300
  }
6297
6301
  });
6298
6302
 
6299
- const _hoisted_1$L = {
6303
+ const _hoisted_1$O = {
6300
6304
  viewBox: "0 0 32 32",
6301
6305
  version: "1.1",
6302
6306
  xmlns: "http://www.w3.org/2000/svg",
@@ -6309,15 +6313,15 @@
6309
6313
  __name: "CodeIcon",
6310
6314
  setup(__props) {
6311
6315
  return (_ctx, _cache) => {
6312
- return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$L, _cache[0] || (_cache[0] = [
6316
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$O, _cache[0] || (_cache[0] = [
6313
6317
  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)
6314
6318
  ]));
6315
6319
  };
6316
6320
  }
6317
6321
  });
6318
6322
 
6319
- const _hoisted_1$K = { class: "m-fields-key-value" };
6320
- const _hoisted_2$e = { key: 0 };
6323
+ const _hoisted_1$N = { class: "m-fields-key-value" };
6324
+ const _hoisted_2$f = { key: 0 };
6321
6325
  const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
6322
6326
  ...{
6323
6327
  name: "MFieldsKeyValue"
@@ -6380,8 +6384,8 @@
6380
6384
  emit("change", v);
6381
6385
  };
6382
6386
  return (_ctx, _cache) => {
6383
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$K, [
6384
- !showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$e, [
6387
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$N, [
6388
+ !showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
6385
6389
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
6386
6390
  return vue.openBlock(), vue.createElementBlock("div", {
6387
6391
  class: "m-fields-key-value-item",
@@ -6454,8 +6458,8 @@
6454
6458
  }
6455
6459
  });
6456
6460
 
6457
- const _hoisted_1$J = { class: "m-fields-page-fragment-select" };
6458
- const _hoisted_2$d = { class: "page-fragment-select-container" };
6461
+ const _hoisted_1$M = { class: "m-fields-page-fragment-select" };
6462
+ const _hoisted_2$e = { class: "page-fragment-select-container" };
6459
6463
  const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
6460
6464
  ...{
6461
6465
  name: "MFieldsPageFragmentSelect"
@@ -6502,8 +6506,8 @@
6502
6506
  };
6503
6507
  return (_ctx, _cache) => {
6504
6508
  const _component_m_form_container = vue.resolveComponent("m-form-container");
6505
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [
6506
- vue.createElementVNode("div", _hoisted_2$d, [
6509
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$M, [
6510
+ vue.createElementVNode("div", _hoisted_2$e, [
6507
6511
  vue.createVNode(_component_m_form_container, {
6508
6512
  class: "select",
6509
6513
  config: selectConfig,
@@ -6523,8 +6527,8 @@
6523
6527
  }
6524
6528
  });
6525
6529
 
6526
- const _hoisted_1$I = { class: "background-position-container" };
6527
- const _hoisted_2$c = { class: "presets-value-list" };
6530
+ const _hoisted_1$L = { class: "background-position-container" };
6531
+ const _hoisted_2$d = { class: "presets-value-list" };
6528
6532
  const _hoisted_3$6 = { class: "custom-value" };
6529
6533
  const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
6530
6534
  __name: "BackgroundPosition",
@@ -6581,8 +6585,8 @@
6581
6585
  emit("change", v);
6582
6586
  };
6583
6587
  return (_ctx, _cache) => {
6584
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$I, [
6585
- vue.createElementVNode("div", _hoisted_2$c, [
6588
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$L, [
6589
+ vue.createElementVNode("div", _hoisted_2$d, [
6586
6590
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(list), (item, index) => {
6587
6591
  return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
6588
6592
  key: index,
@@ -6624,13 +6628,13 @@
6624
6628
 
6625
6629
  const _sfc_main$14 = {};
6626
6630
 
6627
- const _hoisted_1$H = {
6631
+ const _hoisted_1$K = {
6628
6632
  xmlns: "http://www.w3.org/2000/svg",
6629
6633
  viewBox: "0 0 1024 1024"
6630
6634
  };
6631
6635
 
6632
6636
  function _sfc_render$k(_ctx, _cache) {
6633
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$H, _cache[0] || (_cache[0] = [
6637
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$K, _cache[0] || (_cache[0] = [
6634
6638
  vue.createStaticVNode("<path d=\"M884.736 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C696.32 311.296 712.704 327.68 733.184 327.68l147.456 0c20.48 0 36.864-16.384 36.864-36.864L917.504 139.264C921.6 118.784 905.216 102.4 884.736 102.4zM884.736 290.816l-147.456 0L737.28 139.264l147.456 0L884.736 290.816z\"></path><path d=\"M884.736 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 712.704 905.216 696.32 884.736 696.32zM884.736 884.736l-147.456 0 0-147.456 147.456 0L884.736 884.736z\"></path><path d=\"M884.736 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C921.6 417.792 905.216 401.408 884.736 401.408zM884.736 585.728l-147.456 0 0-147.456 147.456 0L884.736 585.728z\"></path><path d=\"M585.728 401.408l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 417.792 606.208 401.408 585.728 401.408zM585.728 585.728l-147.456 0 0-147.456 147.456 0L585.728 585.728z\"></path><path d=\"M585.728 102.4l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864L622.592 139.264C622.592 118.784 606.208 102.4 585.728 102.4zM585.728 290.816l-147.456 0L438.272 139.264l147.456 0L585.728 290.816z\"></path><path d=\"M585.728 696.32l-147.456 0c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C622.592 712.704 606.208 696.32 585.728 696.32zM585.728 884.736l-147.456 0 0-147.456 147.456 0L585.728 884.736z\"></path><path d=\"M290.816 696.32 139.264 696.32c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 712.704 311.296 696.32 290.816 696.32zM290.816 884.736 139.264 884.736l0-147.456 147.456 0L286.72 884.736z\"></path><path d=\"M290.816 401.408 139.264 401.408c-20.48 0-36.864 16.384-36.864 36.864l0 147.456c0 20.48 16.384 36.864 36.864 36.864l147.456 0c20.48 0 36.864-16.384 36.864-36.864l0-147.456C327.68 417.792 311.296 401.408 290.816 401.408zM290.816 585.728 139.264 585.728l0-147.456 147.456 0L286.72 585.728z\"></path><path d=\"M290.816 102.4 139.264 102.4c-20.48 0-36.864 16.384-36.864 36.864l0 147.456C102.4 311.296 118.784 327.68 139.264 327.68l147.456 0C311.296 327.68 327.68 311.296 327.68 290.816L327.68 139.264C327.68 118.784 311.296 102.4 290.816 102.4zM290.816 290.816 139.264 290.816 139.264 139.264l147.456 0L286.72 290.816z\"></path>", 9)
6635
6639
  ])))
6636
6640
  }
@@ -6638,13 +6642,13 @@
6638
6642
 
6639
6643
  const _sfc_main$13 = {};
6640
6644
 
6641
- const _hoisted_1$G = {
6645
+ const _hoisted_1$J = {
6642
6646
  xmlns: "http://www.w3.org/2000/svg",
6643
6647
  viewBox: "0 0 1024 1024"
6644
6648
  };
6645
6649
 
6646
6650
  function _sfc_render$j(_ctx, _cache) {
6647
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$G, _cache[0] || (_cache[0] = [
6651
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$J, _cache[0] || (_cache[0] = [
6648
6652
  vue.createElementVNode("path", {
6649
6653
  d: "M796.444444 170.666667h-227.555555v682.666666h227.555555V170.666667z m-56.888888 625.777777h-113.777778V227.555556h113.777778v568.888888zM455.111111 170.666667H227.555556v682.666666h227.555555V170.666667zM398.222222 796.444444H284.444444V227.555556h113.777778v568.888888zM910.222222 56.888889h56.888889v910.222222h-56.888889zM56.888889 56.888889h56.888889v910.222222H56.888889z",
6650
6654
  fill: "#333333"
@@ -6655,13 +6659,13 @@
6655
6659
 
6656
6660
  const _sfc_main$12 = {};
6657
6661
 
6658
- const _hoisted_1$F = {
6662
+ const _hoisted_1$I = {
6659
6663
  xmlns: "http://www.w3.org/2000/svg",
6660
6664
  viewBox: "0 0 1024 1024"
6661
6665
  };
6662
6666
 
6663
6667
  function _sfc_render$i(_ctx, _cache) {
6664
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$F, _cache[0] || (_cache[0] = [
6668
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$I, _cache[0] || (_cache[0] = [
6665
6669
  vue.createElementVNode("path", {
6666
6670
  d: "M170.666667 227.555556v227.555555h682.666666V227.555556H170.666667z m625.777777 56.888888v113.777778H227.555556V284.444444h568.888888zM170.666667 568.888889v227.555555h682.666666v-227.555555H170.666667z m625.777777 56.888889v113.777778H227.555556v-113.777778h568.888888zM56.888889 56.888889h910.222222v56.888889H56.888889zM56.888889 910.222222h910.222222v56.888889H56.888889z",
6667
6671
  fill: "#333333"
@@ -6672,13 +6676,13 @@
6672
6676
 
6673
6677
  const _sfc_main$11 = {};
6674
6678
 
6675
- const _hoisted_1$E = {
6679
+ const _hoisted_1$H = {
6676
6680
  xmlns: "http://www.w3.org/2000/svg",
6677
6681
  viewBox: "0 0 1024 1024"
6678
6682
  };
6679
6683
 
6680
6684
  function _sfc_render$h(_ctx, _cache) {
6681
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$E, _cache[0] || (_cache[0] = [
6685
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$H, _cache[0] || (_cache[0] = [
6682
6686
  vue.createElementVNode("path", {
6683
6687
  d: "M912.526651 867.741144 555.540144 510.712681l356.986507-357.000833c11.171434-11.18576 11.171434-29.257348 0-40.443108-11.20111-11.18576-29.272697-11.18576-40.444131 0L515.096013 470.267527 158.096203 113.267716c-11.187807-11.159154-29.258371-11.159154-40.444131 0-11.186783 11.186783-11.186783 29.286 0 40.47176L474.623229 510.712681 117.623419 867.741144c-11.159154 11.172457-11.159154 29.216415 0 40.443108 11.18576 11.17348 29.284977 11.17348 40.47176 0l357.000833-357.027439 356.985484 357.027439c11.171434 11.17348 29.243021 11.17348 40.444131 0C923.698085 896.957559 923.725714 878.913601 912.526651 867.741144z",
6684
6688
  fill: "#5D5D5D"
@@ -6764,13 +6768,13 @@
6764
6768
 
6765
6769
  const _sfc_main$$ = {};
6766
6770
 
6767
- const _hoisted_1$D = {
6771
+ const _hoisted_1$G = {
6768
6772
  xmlns: "http://www.w3.org/2000/svg",
6769
6773
  viewBox: "0 0 1024 1024"
6770
6774
  };
6771
6775
 
6772
6776
  function _sfc_render$g(_ctx, _cache) {
6773
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$D, _cache[0] || (_cache[0] = [
6777
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$G, _cache[0] || (_cache[0] = [
6774
6778
  vue.createElementVNode("path", { d: "M128 810.666667h768v85.333333H128z m0-170.666667h512v85.333333H128z m0-170.666667h768v85.333334H128z m0-341.333333h768v85.333333H128z m0 170.666667h512v85.333333H128z" }, null, -1)
6775
6779
  ])))
6776
6780
  }
@@ -6778,13 +6782,13 @@
6778
6782
 
6779
6783
  const _sfc_main$_ = {};
6780
6784
 
6781
- const _hoisted_1$C = {
6785
+ const _hoisted_1$F = {
6782
6786
  xmlns: "http://www.w3.org/2000/svg",
6783
6787
  viewBox: "0 0 1024 1024"
6784
6788
  };
6785
6789
 
6786
6790
  function _sfc_render$f(_ctx, _cache) {
6787
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$C, _cache[0] || (_cache[0] = [
6791
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$F, _cache[0] || (_cache[0] = [
6788
6792
  vue.createElementVNode("path", { d: "M128 810.666667h768v85.333333H128z m128-170.666667h512v85.333333H256z m-128-170.666667h768v85.333334H128z m0-341.333333h768v85.333333H128z m128 170.666667h512v85.333333H256z" }, null, -1)
6789
6793
  ])))
6790
6794
  }
@@ -6792,13 +6796,13 @@
6792
6796
 
6793
6797
  const _sfc_main$Z = {};
6794
6798
 
6795
- const _hoisted_1$B = {
6799
+ const _hoisted_1$E = {
6796
6800
  xmlns: "http://www.w3.org/2000/svg",
6797
6801
  viewBox: "0 0 1024 1024"
6798
6802
  };
6799
6803
 
6800
6804
  function _sfc_render$e(_ctx, _cache) {
6801
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$B, _cache[0] || (_cache[0] = [
6805
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$E, _cache[0] || (_cache[0] = [
6802
6806
  vue.createElementVNode("path", { d: "M128 128h768v85.333333H128z m0 682.666667h768v85.333333H128z m213.333333-170.666667h554.666667v85.333333H341.333333z m-213.333333-170.666667h768v85.333334H128z m213.333333-170.666666h554.666667v85.333333H341.333333z" }, null, -1)
6803
6807
  ])))
6804
6808
  }
@@ -6888,8 +6892,8 @@
6888
6892
  }
6889
6893
  });
6890
6894
 
6891
- const _hoisted_1$A = { class: "layout-box-container" };
6892
- const _hoisted_2$b = {
6895
+ const _hoisted_1$D = { class: "layout-box-container" };
6896
+ const _hoisted_2$c = {
6893
6897
  key: 0,
6894
6898
  class: "help-txt"
6895
6899
  };
@@ -6945,13 +6949,13 @@
6945
6949
  });
6946
6950
  };
6947
6951
  return (_ctx, _cache) => {
6948
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
6952
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
6949
6953
  (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(list, (item, index) => {
6950
6954
  return vue.createElementVNode("div", {
6951
6955
  key: index,
6952
6956
  class: vue.normalizeClass(item.class)
6953
6957
  }, [
6954
- item.text ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, vue.toDisplayString(item.text), 1)) : vue.createCommentVNode("", true),
6958
+ item.text ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$c, vue.toDisplayString(item.text), 1)) : vue.createCommentVNode("", true),
6955
6959
  vue.createElementVNode("span", _hoisted_3$5, [
6956
6960
  vue.withDirectives(vue.createElementVNode("input", {
6957
6961
  "onUpdate:modelValue": ($event) => _ctx.model[item.name] = $event,
@@ -6971,13 +6975,13 @@
6971
6975
 
6972
6976
  const _sfc_main$W = {};
6973
6977
 
6974
- const _hoisted_1$z = {
6978
+ const _hoisted_1$C = {
6975
6979
  xmlns: "http://www.w3.org/2000/svg",
6976
6980
  viewBox: "0 0 1024 1024"
6977
6981
  };
6978
6982
 
6979
6983
  function _sfc_render$d(_ctx, _cache) {
6980
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$z, _cache[0] || (_cache[0] = [
6984
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$C, _cache[0] || (_cache[0] = [
6981
6985
  vue.createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192z m-96 64a32 32 0 0 1 32 32v448a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32h704z" }, null, -1)
6982
6986
  ])))
6983
6987
  }
@@ -6985,13 +6989,13 @@
6985
6989
 
6986
6990
  const _sfc_main$V = {};
6987
6991
 
6988
- const _hoisted_1$y = {
6992
+ const _hoisted_1$B = {
6989
6993
  xmlns: "http://www.w3.org/2000/svg",
6990
6994
  viewBox: "0 0 1024 1024"
6991
6995
  };
6992
6996
 
6993
6997
  function _sfc_render$c(_ctx, _cache) {
6994
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$y, _cache[0] || (_cache[0] = [
6998
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$B, _cache[0] || (_cache[0] = [
6995
6999
  vue.createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192zM352 256v512H160V256h192z m256 0v512h-192V256h192z m256 0v512h-192V256h192z" }, null, -1)
6996
7000
  ])))
6997
7001
  }
@@ -6999,13 +7003,13 @@
6999
7003
 
7000
7004
  const _sfc_main$U = {};
7001
7005
 
7002
- const _hoisted_1$x = {
7006
+ const _hoisted_1$A = {
7003
7007
  xmlns: "http://www.w3.org/2000/svg",
7004
7008
  viewBox: "0 0 1024 1024"
7005
7009
  };
7006
7010
 
7007
7011
  function _sfc_render$b(_ctx, _cache) {
7008
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$x, _cache[0] || (_cache[0] = [
7012
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$A, _cache[0] || (_cache[0] = [
7009
7013
  vue.createElementVNode("path", { d: "M787.616 651.36a142.72 142.72 0 0 0 52.864 31.904 205.504 205.504 0 0 0 67.264 10.848 245.76 245.76 0 0 0 38.784-2.4c9.504-1.6 19.36-4 30.208-7.04 8.16-2.24 15.968-5.12 23.36-8.32l23.392-10.816V587.52h-8.736c-3.968 3.424-8.96 7.648-15.104 12.544a190.272 190.272 0 0 1-19.936 13.504 120.32 120.32 0 0 1-27.616 12.544 102.528 102.528 0 0 1-62.72-0.576 80 80 0 0 1-29.824-17.088 89.28 89.28 0 0 1-21.664-32.512c-5.696-13.664-8.64-30.784-8.64-51.296 0-19.744 2.72-36.384 7.968-50.08 5.248-13.664 12.384-24.896 20.992-33.056 9.12-8.832 18.816-14.816 29.632-18.816a101.824 101.824 0 0 1 63.68-0.736c9.408 3.136 18.08 7.04 26.112 11.68 13.024 7.808 25.28 16.768 36.672 26.784H1024v-78.72c-6.08-2.88-13.12-6.08-21.12-9.6a205.984 205.984 0 0 0-57.152-15.36 270.016 270.016 0 0 0-37.056-2.304c-24.864 0-47.744 4-68.704 11.84-20.992 7.776-38.432 18.784-52.64 33.6a144.256 144.256 0 0 0-33.632 54.176 207.68 207.68 0 0 0-12.48 70.176c0 27.84 3.968 52.352 12.16 73.568a146.08 146.08 0 0 0 34.176 53.184l0.064 0.416z m-186.112 34.656a122.912 122.912 0 0 0 42.784-21.504c11.2-8.32 20.224-19.296 26.24-31.936 6.56-13.664 9.888-28.704 9.664-43.904 0-22.784-6.272-41.024-18.912-54.72-12.544-13.92-29.664-23.04-51.104-27.36v-2.304c14.4-6.24 26.688-16.448 35.52-29.408 8.384-12.544 12.544-27.008 12.544-43.52 0-14.24-2.944-26.784-9.12-37.6a65.696 65.696 0 0 0-27.936-26.24 117.44 117.44 0 0 0-36.48-12.096A437.312 437.312 0 0 0 526.656 352h-127.552v340.384h143.392c23.84 0 43.52-2.112 59.008-6.4z m-118.112-271.584h7.968c16.544 0 29.472 0.128 38.656 0.352 9.248 0.576 16.864 1.728 23.04 4a26.24 26.24 0 0 1 14.4 13.12c2.656 5.28 4.064 11.072 4.128 16.96 0.16 6.656-1.056 13.248-3.52 19.392a28.064 28.064 0 0 1-15.04 13.696c-7.04 2.912-14.56 4.48-22.208 4.576-9.472 0.32-20.864 0.544-34.24 0.544h-13.184v-72.64z m6.144 215.52h-6.144v-84.8h18.464c12.64 0 24.736 0 36.384 0.256 9.216-0.16 18.432 0.896 27.36 3.2 9.696 2.848 16.544 7.232 20.512 13.12 4 5.92 6.08 14.24 6.08 25.088 0 8.192-1.728 15.488-4.992 21.824-3.232 6.336-9.696 11.392-18.24 15.392-8.544 4-18.24 5.696-28.48 6.272-10.304 0.224-27.392 0.224-51.328 0.224l0.384-0.576z m-378.56-6.016h124.672l23.36 68.416H348.8L224.32 353.728H124.416L0 692.384h87.52l23.488-68.416-0.064-0.032z m62.336-183.552l41.472 121.44h-82.88l41.408-121.44z" }, null, -1)
7010
7014
  ])))
7011
7015
  }
@@ -7013,13 +7017,13 @@
7013
7017
 
7014
7018
  const _sfc_main$T = {};
7015
7019
 
7016
- const _hoisted_1$w = {
7020
+ const _hoisted_1$z = {
7017
7021
  xmlns: "http://www.w3.org/2000/svg",
7018
7022
  viewBox: "0 0 1024 1024"
7019
7023
  };
7020
7024
 
7021
7025
  function _sfc_render$a(_ctx, _cache) {
7022
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$w, _cache[0] || (_cache[0] = [
7026
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$z, _cache[0] || (_cache[0] = [
7023
7027
  vue.createElementVNode("path", { d: "M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192z m-131.936 158.496c65.984 1.824 109.024 32.512 129.184 92.064l-65.952 15.136-1.856-5.664c-9.984-27.52-30.432-42.112-61.376-43.84-46.72 2.784-71.456 35.296-74.208 97.6 1.856 63.2 26.56 96.64 74.24 100.32 37.536-0.928 59.52-23.36 65.92-67.328L960 559.36l-1.792 7.232c-16.96 63.872-60.352 95.84-130.144 95.84-93.44-4.608-142.464-56.8-147.04-156.672 4.576-98.048 53.6-149.792 147.04-155.296z m-568.928 4.128l114.08 302.336H297.6l-22.016-65.984H160.192L138.24 656.96H64l112.672-302.336h82.464z m278.976 0l7.68 0.32c62.816 3.36 96 27.104 99.52 71.136 0 35.744-19.712 59.552-59.104 71.456 42.144 9.184 65.952 32.544 71.456 70.08 0 59.552-37.568 89.344-112.672 89.344h-148.416v-302.336h141.536z m-4.128 173.152H465.28v81.088h67.328c33.92 0 51.296-13.76 52.224-41.248-2.752-25.632-19.68-38.912-50.848-39.84zM217.92 408.224h-1.376l-0.96 7.36c-1.184 7.232-3.168 13.92-5.92 20.128l-34.336 103.04h87.936l-38.464-104.416-2.624-9.024c-1.6-5.888-3.04-11.584-4.256-17.088z m309.184-2.752H465.28v71.456h61.824c29.344-0.928 44.448-13.76 45.376-38.464-0.96-22.016-16.032-32.992-45.376-32.992z" }, null, -1)
7024
7028
  ])))
7025
7029
  }
@@ -7027,13 +7031,13 @@
7027
7031
 
7028
7032
  const _sfc_main$S = {};
7029
7033
 
7030
- const _hoisted_1$v = {
7034
+ const _hoisted_1$y = {
7031
7035
  xmlns: "http://www.w3.org/2000/svg",
7032
7036
  viewBox: "0 0 1024 1024"
7033
7037
  };
7034
7038
 
7035
7039
  function _sfc_render$9(_ctx, _cache) {
7036
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$v, _cache[0] || (_cache[0] = [
7040
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$y, _cache[0] || (_cache[0] = [
7037
7041
  vue.createElementVNode("path", { d: "M931.37 477.14c-43.94-69.49-93.39-125.03-147.99-166.35L663.31 441.46c8.79 21.36 13.63 44.91 13.63 69.62 0 96.27-73.84 174.32-164.95 174.32-21.63 0-42.28-4.39-61.32-12.47l-94.09 102.52a455.097 455.097 0 0 0 155.41 26.2c172.62 0 312.43-85.54 419.59-256.63 12.83-20.43 12.72-47.45-0.21-67.88zM795.52 127.99L682.24 252.82C627.73 231 570.1 220.04 512.11 220.5c-171.15 0-310.99 85.66-419.48 256.75-12.93 20.43-13.04 47.33-0.2 67.78 46.95 75.15 100.3 133.68 160.01 175.82L131.9 853.65l38.9 42.36 663.6-725.76-38.88-42.26zM519.68 438.37c-3.72-0.59-7.46-0.81-11.27-0.81-45.63 0-82.43 39.03-82.43 87.16 0 4.97 0.42 9.81 1.14 14.54l-57.15 60.14-5.92 8.33c-13.15-24.94-20.5-53.68-20.5-84.28 0-96.3 73.84-174.45 164.95-174.45 27.2 0 52.76 6.93 75.4 19.29l-64.22 70.08z m52.05 135.53c21.74-23.26 27.17-55.48 16.31-81.39l-96.42 103.16c26.59 9.08 58.38 1.48 80.11-21.77z" }, null, -1)
7038
7042
  ])))
7039
7043
  }
@@ -7041,13 +7045,13 @@
7041
7045
 
7042
7046
  const _sfc_main$R = {};
7043
7047
 
7044
- const _hoisted_1$u = {
7048
+ const _hoisted_1$x = {
7045
7049
  xmlns: "http://www.w3.org/2000/svg",
7046
7050
  viewBox: "0 0 1024 1024"
7047
7051
  };
7048
7052
 
7049
7053
  function _sfc_render$8(_ctx, _cache) {
7050
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$u, _cache[0] || (_cache[0] = [
7054
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$x, _cache[0] || (_cache[0] = [
7051
7055
  vue.createElementVNode("path", { d: "M896 320H128V0h768v320z m0 320H128v-256h768v256z m-128 192l-256 192-256-192 192-0.032V704h128v128h192z" }, null, -1)
7052
7056
  ])))
7053
7057
  }
@@ -7055,13 +7059,13 @@
7055
7059
 
7056
7060
  const _sfc_main$Q = {};
7057
7061
 
7058
- const _hoisted_1$t = {
7062
+ const _hoisted_1$w = {
7059
7063
  xmlns: "http://www.w3.org/2000/svg",
7060
7064
  viewBox: "0 0 1024 1024"
7061
7065
  };
7062
7066
 
7063
7067
  function _sfc_render$7(_ctx, _cache) {
7064
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$t, _cache[0] || (_cache[0] = [
7068
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$w, _cache[0] || (_cache[0] = [
7065
7069
  vue.createElementVNode("path", { d: "M896 704H128v320h768V704z m0-320H128v256h768v-256z m-128-192l-256-192-256 192 192 0.032V320h128V192h192z" }, null, -1)
7066
7070
  ])))
7067
7071
  }
@@ -7069,13 +7073,13 @@
7069
7073
 
7070
7074
  const _sfc_main$P = {};
7071
7075
 
7072
- const _hoisted_1$s = {
7076
+ const _hoisted_1$v = {
7073
7077
  xmlns: "http://www.w3.org/2000/svg",
7074
7078
  viewBox: "0 0 1024 1024"
7075
7079
  };
7076
7080
 
7077
7081
  function _sfc_render$6(_ctx, _cache) {
7078
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$s, _cache[0] || (_cache[0] = [
7082
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$v, _cache[0] || (_cache[0] = [
7079
7083
  vue.createElementVNode("path", { d: "M320 128v768H0V128h320z m320 0v768h-256V128h256z m192 128l192 256-192 256-0.032-192H704v-128h128V256z" }, null, -1)
7080
7084
  ])))
7081
7085
  }
@@ -7083,13 +7087,13 @@
7083
7087
 
7084
7088
  const _sfc_main$O = {};
7085
7089
 
7086
- const _hoisted_1$r = {
7090
+ const _hoisted_1$u = {
7087
7091
  xmlns: "http://www.w3.org/2000/svg",
7088
7092
  viewBox: "0 0 1024 1024"
7089
7093
  };
7090
7094
 
7091
7095
  function _sfc_render$5(_ctx, _cache) {
7092
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$r, _cache[0] || (_cache[0] = [
7096
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$u, _cache[0] || (_cache[0] = [
7093
7097
  vue.createElementVNode("path", { d: "M704 128v768h320V128H704zM384 128v768h256V128h-256zM192 256l-192 256 192 256 0.032-192H320v-128H192V256z" }, null, -1)
7094
7098
  ])))
7095
7099
  }
@@ -7097,13 +7101,13 @@
7097
7101
 
7098
7102
  const _sfc_main$N = {};
7099
7103
 
7100
- const _hoisted_1$q = {
7104
+ const _hoisted_1$t = {
7101
7105
  xmlns: "http://www.w3.org/2000/svg",
7102
7106
  viewBox: "0 0 1024 1024"
7103
7107
  };
7104
7108
 
7105
7109
  function _sfc_render$4(_ctx, _cache) {
7106
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$q, _cache[0] || (_cache[0] = [
7110
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$t, _cache[0] || (_cache[0] = [
7107
7111
  vue.createElementVNode("path", { d: "M480 1024V0h64v1024h-64z m128-64V64h320v896H608zM96 960V64h320v896H96z" }, null, -1)
7108
7112
  ])))
7109
7113
  }
@@ -7111,13 +7115,13 @@
7111
7115
 
7112
7116
  const _sfc_main$M = {};
7113
7117
 
7114
- const _hoisted_1$p = {
7118
+ const _hoisted_1$s = {
7115
7119
  xmlns: "http://www.w3.org/2000/svg",
7116
7120
  viewBox: "0 0 1024 1024"
7117
7121
  };
7118
7122
 
7119
7123
  function _sfc_render$3(_ctx, _cache) {
7120
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$p, _cache[0] || (_cache[0] = [
7124
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$s, _cache[0] || (_cache[0] = [
7121
7125
  vue.createElementVNode("path", { d: "M416 160H96v704h320V160z m384 0H480v704h320V160z m128-160h-64v1024h64V0z" }, null, -1)
7122
7126
  ])))
7123
7127
  }
@@ -7125,13 +7129,13 @@
7125
7129
 
7126
7130
  const _sfc_main$L = {};
7127
7131
 
7128
- const _hoisted_1$o = {
7132
+ const _hoisted_1$r = {
7129
7133
  xmlns: "http://www.w3.org/2000/svg",
7130
7134
  viewBox: "0 0 1024 1024"
7131
7135
  };
7132
7136
 
7133
7137
  function _sfc_render$2(_ctx, _cache) {
7134
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$o, _cache[0] || (_cache[0] = [
7138
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$r, _cache[0] || (_cache[0] = [
7135
7139
  vue.createElementVNode("path", { d: "M608 160h320v704H608V160zM224 160h320v704H224V160zM96 0h64v1024H96V0z" }, null, -1)
7136
7140
  ])))
7137
7141
  }
@@ -7139,13 +7143,13 @@
7139
7143
 
7140
7144
  const _sfc_main$K = {};
7141
7145
 
7142
- const _hoisted_1$n = {
7146
+ const _hoisted_1$q = {
7143
7147
  xmlns: "http://www.w3.org/2000/svg",
7144
7148
  viewBox: "0 0 1024 1024"
7145
7149
  };
7146
7150
 
7147
7151
  function _sfc_render$1(_ctx, _cache) {
7148
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$n, _cache[0] || (_cache[0] = [
7152
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$q, _cache[0] || (_cache[0] = [
7149
7153
  vue.createElementVNode("path", { d: "M320 864H192v160H128v-160H0V160h128V0h64v160h128v704z m704 0h-128v160h-64v-160h-128V160h128V0h64v160h128v704z" }, null, -1)
7150
7154
  ])))
7151
7155
  }
@@ -7153,13 +7157,13 @@
7153
7157
 
7154
7158
  const _sfc_main$J = {};
7155
7159
 
7156
- const _hoisted_1$m = {
7160
+ const _hoisted_1$p = {
7157
7161
  xmlns: "http://www.w3.org/2000/svg",
7158
7162
  viewBox: "0 0 1024 1024"
7159
7163
  };
7160
7164
 
7161
7165
  function _sfc_render(_ctx, _cache) {
7162
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$m, _cache[0] || (_cache[0] = [
7166
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$p, _cache[0] || (_cache[0] = [
7163
7167
  vue.createElementVNode("path", { d: "M64 1024H0V0h64v1024z m384-160H128V160h320v704z m448 0H576V160h320v704z m128 160h-64V0h64v1024z" }, null, -1)
7164
7168
  ])))
7165
7169
  }
@@ -7315,8 +7319,8 @@
7315
7319
  }
7316
7320
  });
7317
7321
 
7318
- const _hoisted_1$l = { class: "layout-box-container" };
7319
- const _hoisted_2$a = { class: "next-input" };
7322
+ const _hoisted_1$o = { class: "layout-box-container" };
7323
+ const _hoisted_2$b = { class: "next-input" };
7320
7324
  const _hoisted_3$4 = ["onUpdate:modelValue", "title", "onChange"];
7321
7325
  const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
7322
7326
  __name: "Position",
@@ -7350,13 +7354,13 @@
7350
7354
  });
7351
7355
  };
7352
7356
  return (_ctx, _cache) => {
7353
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
7357
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
7354
7358
  (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(list, (item, index) => {
7355
7359
  return vue.createElementVNode("div", {
7356
7360
  key: index,
7357
7361
  class: vue.normalizeClass(item.class)
7358
7362
  }, [
7359
- vue.createElementVNode("span", _hoisted_2$a, [
7363
+ vue.createElementVNode("span", _hoisted_2$b, [
7360
7364
  vue.withDirectives(vue.createElementVNode("input", {
7361
7365
  "onUpdate:modelValue": ($event) => _ctx.model[item.name] = $event,
7362
7366
  title: _ctx.model[item.name],
@@ -7428,8 +7432,8 @@
7428
7432
  }
7429
7433
  });
7430
7434
 
7431
- const _hoisted_1$k = { class: "border-box-container" };
7432
- const _hoisted_2$9 = { class: "border-icon-container" };
7435
+ const _hoisted_1$n = { class: "border-box-container" };
7436
+ const _hoisted_2$a = { class: "border-icon-container" };
7433
7437
  const _hoisted_3$3 = { class: "border-icon-container-row" };
7434
7438
  const _hoisted_4$3 = { class: "border-icon-container-row" };
7435
7439
  const _hoisted_5$1 = { class: "border-icon-container-row" };
@@ -7487,8 +7491,8 @@
7487
7491
  });
7488
7492
  };
7489
7493
  return (_ctx, _cache) => {
7490
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, [
7491
- vue.createElementVNode("div", _hoisted_2$9, [
7494
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
7495
+ vue.createElementVNode("div", _hoisted_2$a, [
7492
7496
  vue.createElementVNode("div", _hoisted_3$3, [
7493
7497
  vue.createElementVNode("div", {
7494
7498
  class: vue.normalizeClass(["border-icon border-icon-top", { active: direction.value === "Top" }]),
@@ -7568,7 +7572,7 @@
7568
7572
  }
7569
7573
  });
7570
7574
 
7571
- const _hoisted_1$j = { class: "m-fields-style-setter" };
7575
+ const _hoisted_1$m = { class: "m-fields-style-setter" };
7572
7576
  const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
7573
7577
  ...{
7574
7578
  name: "MFieldsStyleSetter"
@@ -7618,7 +7622,7 @@
7618
7622
  emit("change", v, eventData);
7619
7623
  };
7620
7624
  return (_ctx, _cache) => {
7621
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
7625
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
7622
7626
  vue.createVNode(vue.unref(designPlugin.TMagicCollapse), { "model-value": collapseValue.value }, {
7623
7627
  default: vue.withCtx(() => [
7624
7628
  (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(list, (item, index) => {
@@ -7648,7 +7652,7 @@
7648
7652
  }
7649
7653
  });
7650
7654
 
7651
- const _hoisted_1$i = {
7655
+ const _hoisted_1$l = {
7652
7656
  key: 1,
7653
7657
  class: "m-fields-ui-select",
7654
7658
  style: { "display": "flex" }
@@ -7751,7 +7755,7 @@
7751
7755
  ])),
7752
7756
  _: 1
7753
7757
  }, 8, ["icon", "disabled", "size"])
7754
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
7758
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
7755
7759
  val.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
7756
7760
  vue.createVNode(vue.unref(designPlugin.TMagicTooltip), {
7757
7761
  content: "清除",
@@ -7826,12 +7830,11 @@
7826
7830
  emits: ["change"],
7827
7831
  setup(__props, { emit: __emit }) {
7828
7832
  const emit = __emit;
7829
- const target = vue.useTemplateRef("target");
7830
- const { isDragging } = useGetSo(target, emit);
7833
+ const targetEl = vue.useTemplateRef("target");
7834
+ const { isDragging } = useGetSo(targetEl, emit);
7831
7835
  return (_ctx, _cache) => {
7832
7836
  return vue.openBlock(), vue.createElementBlock("span", {
7833
- ref_key: "target",
7834
- ref: target,
7837
+ ref: "target",
7835
7838
  class: vue.normalizeClass(["m-editor-resizer", { "m-editor-resizer-dragging": vue.unref(isDragging) }])
7836
7839
  }, [
7837
7840
  vue.renderSlot(_ctx.$slots, "default")
@@ -7860,7 +7863,7 @@
7860
7863
  setup(__props, { expose: __expose, emit: __emit }) {
7861
7864
  const emit = __emit;
7862
7865
  const props = __props;
7863
- const el = vue.useTemplateRef("el");
7866
+ const el = vue.useTemplateRef("target");
7864
7867
  const hasLeft = vue.computed(() => typeof props.left !== "undefined");
7865
7868
  const hasRight = vue.computed(() => typeof props.right !== "undefined");
7866
7869
  const center = vue.ref(0);
@@ -7966,8 +7969,7 @@
7966
7969
  });
7967
7970
  return (_ctx, _cache) => {
7968
7971
  return vue.openBlock(), vue.createElementBlock("div", {
7969
- ref_key: "el",
7970
- ref: el,
7972
+ ref: "target",
7971
7973
  class: "m-editor-layout",
7972
7974
  style: vue.normalizeStyle(`min-width: ${props.minCenter + props.minLeft + props.minRight}px`)
7973
7975
  }, [
@@ -8000,11 +8002,11 @@
8000
8002
  }
8001
8003
  });
8002
8004
 
8003
- const _hoisted_1$h = {
8005
+ const _hoisted_1$k = {
8004
8006
  key: 1,
8005
8007
  class: "menu-item-text"
8006
8008
  };
8007
- const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
8009
+ const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
8008
8010
  const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
8009
8011
  ...{
8010
8012
  name: "MEditorToolButton"
@@ -8076,7 +8078,7 @@
8076
8078
  _ctx.data.type === "divider" ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicDivider), {
8077
8079
  key: 0,
8078
8080
  direction: _ctx.data.direction || "vertical"
8079
- }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
8081
+ }, null, 8, ["direction"])) : _ctx.data.type === "text" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$k, vue.toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
8080
8082
  _ctx.data.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicTooltip), {
8081
8083
  key: 0,
8082
8084
  effect: "dark",
@@ -8141,7 +8143,7 @@
8141
8143
  })) : vue.createCommentVNode("", true)
8142
8144
  ]),
8143
8145
  default: vue.withCtx(() => [
8144
- vue.createElementVNode("span", _hoisted_2$8, [
8146
+ vue.createElementVNode("span", _hoisted_2$9, [
8145
8147
  vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
8146
8148
  vue.createVNode(vue.unref(designPlugin.TMagicIcon), { class: "el-icon--right" }, {
8147
8149
  default: vue.withCtx(() => [
@@ -8158,12 +8160,12 @@
8158
8160
  }
8159
8161
  });
8160
8162
 
8161
- const _hoisted_1$g = {
8163
+ const _hoisted_1$j = {
8162
8164
  key: 0,
8163
8165
  id: "m-editor-page-bar-add-icon",
8164
8166
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon"
8165
8167
  };
8166
- const _hoisted_2$7 = {
8168
+ const _hoisted_2$8 = {
8167
8169
  key: 1,
8168
8170
  style: { "width": "21px" }
8169
8171
  };
@@ -8189,7 +8191,7 @@
8189
8191
  editorService.add(pageConfig);
8190
8192
  };
8191
8193
  return (_ctx, _cache) => {
8192
- return showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
8194
+ return showAddPageButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, [
8193
8195
  vue.createVNode(vue.unref(designPlugin.TMagicPopover), { "popper-class": "data-source-list-panel-add-menu" }, {
8194
8196
  reference: vue.withCtx(() => [
8195
8197
  vue.createVNode(_sfc_main$1s, { icon: vue.unref(iconsVue.Plus) }, null, 8, ["icon"])
@@ -8216,11 +8218,20 @@
8216
8218
  ]),
8217
8219
  _: 1
8218
8220
  })
8219
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7));
8221
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8));
8220
8222
  };
8221
8223
  }
8222
8224
  });
8223
8225
 
8226
+ const _hoisted_1$i = {
8227
+ class: "m-editor-page-bar",
8228
+ ref: "pageBar"
8229
+ };
8230
+ const _hoisted_2$7 = {
8231
+ key: 0,
8232
+ class: "m-editor-page-bar-items",
8233
+ ref: "itemsContainer"
8234
+ };
8224
8235
  const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
8225
8236
  ...{
8226
8237
  name: "MEditorPageBarScrollContainer"
@@ -8235,33 +8246,33 @@
8235
8246
  const services = vue.inject("services");
8236
8247
  const editorService = services?.editorService;
8237
8248
  const uiService = services?.uiService;
8238
- const itemsContainer = vue.useTemplateRef("itemsContainer");
8249
+ const itemsContainerEl = vue.useTemplateRef("itemsContainer");
8239
8250
  const canScroll = vue.ref(false);
8240
8251
  const showAddPageButton = vue.computed(() => uiService?.get("showAddPageButton"));
8241
8252
  const showPageListButton = vue.computed(() => uiService?.get("showPageListButton"));
8242
8253
  const itemsContainerWidth = vue.ref(0);
8254
+ const pageBarEl = vue.useTemplateRef("pageBar");
8243
8255
  const setCanScroll = () => {
8244
- itemsContainerWidth.value = (pageBar.value?.clientWidth || 0) - 37 * 2 - 37 - (showAddPageButton.value ? 37 : 21) - (showPageListButton.value ? 37 : 0);
8256
+ itemsContainerWidth.value = (pageBarEl.value?.clientWidth || 0) - 37 * 2 - 37 - (showAddPageButton.value ? 37 : 21) - (showPageListButton.value ? 37 : 0);
8245
8257
  vue.nextTick(() => {
8246
- if (itemsContainer.value) {
8247
- canScroll.value = itemsContainer.value.scrollWidth - itemsContainerWidth.value > 1;
8258
+ if (itemsContainerEl.value) {
8259
+ canScroll.value = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value > 1;
8248
8260
  }
8249
8261
  });
8250
8262
  };
8251
8263
  const resizeObserver = new ResizeObserver(() => {
8252
8264
  setCanScroll();
8253
8265
  });
8254
- const pageBar = vue.useTemplateRef("pageBar");
8255
8266
  vue.onMounted(() => {
8256
- pageBar.value && resizeObserver.observe(pageBar.value);
8267
+ pageBarEl.value && resizeObserver.observe(pageBarEl.value);
8257
8268
  });
8258
8269
  vue.onBeforeUnmount(() => {
8259
8270
  resizeObserver.disconnect();
8260
8271
  });
8261
8272
  let translateLeft = 0;
8262
8273
  const scroll = (type) => {
8263
- if (!itemsContainer.value || !canScroll.value) return;
8264
- const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
8274
+ if (!itemsContainerEl.value || !canScroll.value) return;
8275
+ const maxScrollLeft = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value;
8265
8276
  if (type === "left") {
8266
8277
  scrollTo(translateLeft + 200);
8267
8278
  } else if (type === "right") {
@@ -8273,8 +8284,8 @@
8273
8284
  }
8274
8285
  };
8275
8286
  const scrollTo = (value) => {
8276
- if (!itemsContainer.value || !canScroll.value) return;
8277
- const maxScrollLeft = itemsContainer.value.scrollWidth - itemsContainerWidth.value;
8287
+ if (!itemsContainerEl.value || !canScroll.value) return;
8288
+ const maxScrollLeft = itemsContainerEl.value.scrollWidth - itemsContainerWidth.value;
8278
8289
  if (value >= 0) {
8279
8290
  value = 0;
8280
8291
  }
@@ -8282,7 +8293,7 @@
8282
8293
  value = -maxScrollLeft;
8283
8294
  }
8284
8295
  translateLeft = value;
8285
- itemsContainer.value.style.transform = `translate(${translateLeft}px, 0px)`;
8296
+ itemsContainerEl.value.style.transform = `translate(${translateLeft}px, 0px)`;
8286
8297
  };
8287
8298
  vue.watch(
8288
8299
  () => props.length,
@@ -8341,18 +8352,9 @@
8341
8352
  }
8342
8353
  });
8343
8354
  return (_ctx, _cache) => {
8344
- return vue.openBlock(), vue.createElementBlock("div", {
8345
- class: "m-editor-page-bar",
8346
- ref_key: "pageBar",
8347
- ref: pageBar
8348
- }, [
8355
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
8349
8356
  vue.renderSlot(_ctx.$slots, "prepend"),
8350
- _ctx.length ? (vue.openBlock(), vue.createElementBlock("div", {
8351
- key: 0,
8352
- class: "m-editor-page-bar-items",
8353
- ref_key: "itemsContainer",
8354
- ref: itemsContainer
8355
- }, [
8357
+ _ctx.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
8356
8358
  vue.renderSlot(_ctx.$slots, "default")
8357
8359
  ], 512)) : vue.createCommentVNode("", true),
8358
8360
  canScroll.value ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -8374,7 +8376,7 @@
8374
8376
  }
8375
8377
  });
8376
8378
 
8377
- const _hoisted_1$f = {
8379
+ const _hoisted_1$h = {
8378
8380
  key: 0,
8379
8381
  id: "m-editor-page-bar-list-icon",
8380
8382
  class: "m-editor-page-bar-item m-editor-page-bar-item-icon"
@@ -8397,7 +8399,7 @@
8397
8399
  await editorService?.select(id);
8398
8400
  };
8399
8401
  return (_ctx, _cache) => {
8400
- return showPageListButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
8402
+ return showPageListButton.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
8401
8403
  vue.createVNode(vue.unref(designPlugin.TMagicPopover), {
8402
8404
  "popper-class": "page-bar-popover",
8403
8405
  placement: "top",
@@ -8437,7 +8439,7 @@
8437
8439
  }
8438
8440
  });
8439
8441
 
8440
- const _hoisted_1$e = { class: "m-editor-page-bar-item m-editor-page-bar-item-icon m-editor-page-bar-search" };
8442
+ const _hoisted_1$g = { class: "m-editor-page-bar-item m-editor-page-bar-item-icon m-editor-page-bar-search" };
8441
8443
  const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
8442
8444
  __name: "Search",
8443
8445
  props: {
@@ -8476,7 +8478,7 @@
8476
8478
  emit("search", values);
8477
8479
  };
8478
8480
  return (_ctx, _cache) => {
8479
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
8481
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
8480
8482
  vue.createVNode(_sfc_main$1s, {
8481
8483
  icon: vue.unref(iconsVue.Search),
8482
8484
  onClick: _cache[0] || (_cache[0] = ($event) => visible.value = !visible.value),
@@ -8501,7 +8503,7 @@
8501
8503
  }
8502
8504
  });
8503
8505
 
8504
- const _hoisted_1$d = { class: "m-editor-page-bar-tabs" };
8506
+ const _hoisted_1$f = { class: "m-editor-page-bar-tabs" };
8505
8507
  const _hoisted_2$6 = ["data-page-id", "onClick"];
8506
8508
  const _hoisted_3$2 = { class: "m-editor-page-bar-title" };
8507
8509
  const _hoisted_4$2 = ["title"];
@@ -8553,38 +8555,37 @@
8553
8555
  const remove = (node) => {
8554
8556
  editorService?.remove(node);
8555
8557
  };
8556
- const pageBarScrollContainer = vue.useTemplateRef("pageBarScrollContainer");
8557
- const pageBarItems = vue.useTemplateRef("pageBarItems");
8558
+ const pageBarScrollContainerRef = vue.useTemplateRef("pageBarScrollContainer");
8559
+ const pageBarItemEls = vue.useTemplateRef("pageBarItems");
8558
8560
  vue.watch(page, (page2) => {
8559
- if (!page2 || !pageBarScrollContainer.value?.itemsContainerWidth || !pageBarItems.value || pageBarItems.value.length < 2) {
8561
+ if (!page2 || !pageBarScrollContainerRef.value?.itemsContainerWidth || !pageBarItemEls.value || pageBarItemEls.value.length < 2) {
8560
8562
  return;
8561
8563
  }
8562
- const firstItem = pageBarItems.value[0];
8563
- const lastItem = pageBarItems.value[pageBarItems.value.length - 1];
8564
+ const firstItem = pageBarItemEls.value[0];
8565
+ const lastItem = pageBarItemEls.value[pageBarItemEls.value.length - 1];
8564
8566
  if (page2.id === firstItem.dataset.pageId) {
8565
- pageBarScrollContainer.value.scroll("start");
8567
+ pageBarScrollContainerRef.value.scroll("start");
8566
8568
  } else if (page2.id === lastItem.dataset.pageId) {
8567
- pageBarScrollContainer.value.scroll("end");
8569
+ pageBarScrollContainerRef.value.scroll("end");
8568
8570
  } else {
8569
- const pageItem = pageBarItems.value.find((item) => item.dataset.pageId === page2.id);
8571
+ const pageItem = pageBarItemEls.value.find((item) => item.dataset.pageId === page2.id);
8570
8572
  if (!pageItem) {
8571
8573
  return;
8572
8574
  }
8573
8575
  const pageItemRect = pageItem.getBoundingClientRect();
8574
8576
  const offsetLeft = pageItemRect.left - firstItem.getBoundingClientRect().left;
8575
- const { itemsContainerWidth } = pageBarScrollContainer.value;
8577
+ const { itemsContainerWidth } = pageBarScrollContainerRef.value;
8576
8578
  const left = itemsContainerWidth - offsetLeft - pageItemRect.width;
8577
- const translateLeft = pageBarScrollContainer.value.getTranslateLeft();
8579
+ const translateLeft = pageBarScrollContainerRef.value.getTranslateLeft();
8578
8580
  if (offsetLeft + translateLeft < 0 || offsetLeft + pageItemRect.width > itemsContainerWidth - translateLeft) {
8579
- pageBarScrollContainer.value.scrollTo(left);
8581
+ pageBarScrollContainerRef.value.scrollTo(left);
8580
8582
  }
8581
8583
  }
8582
8584
  });
8583
8585
  return (_ctx, _cache) => {
8584
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
8586
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
8585
8587
  vue.createVNode(_sfc_main$x, {
8586
- ref_key: "pageBarScrollContainer",
8587
- ref: pageBarScrollContainer,
8588
+ ref: "pageBarScrollContainer",
8588
8589
  "page-bar-sort-options": _ctx.pageBarSortOptions,
8589
8590
  length: list.value.length
8590
8591
  }, {
@@ -8608,8 +8609,7 @@
8608
8609
  return vue.openBlock(), vue.createElementBlock("div", {
8609
8610
  class: vue.normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
8610
8611
  ref_for: true,
8611
- ref_key: "pageBarItems",
8612
- ref: pageBarItems,
8612
+ ref: "pageBarItems",
8613
8613
  key: item.id,
8614
8614
  "data-page-id": item.id,
8615
8615
  onClick: ($event) => switchPage(item.id)
@@ -8670,7 +8670,7 @@
8670
8670
  }
8671
8671
  });
8672
8672
 
8673
- const _hoisted_1$c = { class: "m-editor-empty-panel" };
8673
+ const _hoisted_1$e = { class: "m-editor-empty-panel" };
8674
8674
  const _hoisted_2$5 = { class: "m-editor-empty-content" };
8675
8675
  const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
8676
8676
  ...{
@@ -8694,7 +8694,7 @@
8694
8694
  });
8695
8695
  };
8696
8696
  return (_ctx, _cache) => {
8697
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
8697
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
8698
8698
  vue.createElementVNode("div", _hoisted_2$5, [
8699
8699
  vue.createElementVNode("div", {
8700
8700
  class: "m-editor-empty-button",
@@ -8721,6 +8721,11 @@
8721
8721
  }
8722
8722
  });
8723
8723
 
8724
+ const _hoisted_1$d = {
8725
+ class: "m-editor",
8726
+ ref: "content",
8727
+ style: { "min-width": "180px" }
8728
+ };
8724
8729
  const DEFAULT_LEFT_COLUMN_WIDTH = 310;
8725
8730
  const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
8726
8731
  const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
@@ -8738,8 +8743,8 @@
8738
8743
  setup(__props) {
8739
8744
  const codeOptions = vue.inject("codeOptions", {});
8740
8745
  const { editorService, uiService } = vue.inject("services") || {};
8741
- const content = vue.useTemplateRef("content");
8742
- const splitView = vue.useTemplateRef("splitView");
8746
+ const contentEl = vue.useTemplateRef("content");
8747
+ const splitViewRef = vue.useTemplateRef("splitView");
8743
8748
  const root = vue.computed(() => editorService?.get("root"));
8744
8749
  const page = vue.computed(() => editorService?.get("page"));
8745
8750
  const pageLength = vue.computed(() => editorService?.get("pageLength") || 0);
@@ -8752,7 +8757,7 @@
8752
8757
  right: getRightColumnWidthCacheData()
8753
8758
  });
8754
8759
  vue.watch(pageLength, () => {
8755
- splitView.value?.updateWidth();
8760
+ splitViewRef.value?.updateWidth();
8756
8761
  });
8757
8762
  vue.watch(
8758
8763
  () => uiService?.get("hideSlideBar"),
@@ -8777,8 +8782,8 @@
8777
8782
  });
8778
8783
  });
8779
8784
  vue.onMounted(() => {
8780
- if (content.value) {
8781
- resizerObserver.observe(content.value);
8785
+ if (contentEl.value) {
8786
+ resizerObserver.observe(contentEl.value);
8782
8787
  }
8783
8788
  });
8784
8789
  vue.onBeforeUnmount(() => {
@@ -8793,12 +8798,7 @@
8793
8798
  }
8794
8799
  };
8795
8800
  return (_ctx, _cache) => {
8796
- return vue.openBlock(), vue.createElementBlock("div", {
8797
- class: "m-editor",
8798
- ref_key: "content",
8799
- ref: content,
8800
- style: { "min-width": "180px" }
8801
- }, [
8801
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
8802
8802
  vue.renderSlot(_ctx.$slots, "header"),
8803
8803
  vue.renderSlot(_ctx.$slots, "nav"),
8804
8804
  vue.renderSlot(_ctx.$slots, "content-before"),
@@ -8811,8 +8811,7 @@
8811
8811
  }, null, 8, ["init-values", "options"])
8812
8812
  ]) : (vue.openBlock(), vue.createBlock(_sfc_main$A, {
8813
8813
  key: 1,
8814
- ref_key: "splitView",
8815
- ref: splitView,
8814
+ ref: "splitView",
8816
8815
  class: "m-editor-content",
8817
8816
  "left-class": "m-editor-framework-left",
8818
8817
  "center-class": "m-editor-framework-center",
@@ -9023,8 +9022,9 @@
9023
9022
  });
9024
9023
  return data;
9025
9024
  });
9025
+ const navMenuEl = vue.useTemplateRef("navMenu");
9026
9026
  const resizeObserver = new ResizeObserver(() => {
9027
- const rect = navMenu.value?.getBoundingClientRect();
9027
+ const rect = navMenuEl.value?.getBoundingClientRect();
9028
9028
  if (rect) {
9029
9029
  uiService?.set("navMenuRect", {
9030
9030
  left: rect.left,
@@ -9034,9 +9034,8 @@
9034
9034
  });
9035
9035
  }
9036
9036
  });
9037
- const navMenu = vue.useTemplateRef("navMenu");
9038
9037
  vue.onMounted(() => {
9039
- navMenu.value && resizeObserver.observe(navMenu.value);
9038
+ navMenuEl.value && resizeObserver.observe(navMenuEl.value);
9040
9039
  });
9041
9040
  vue.onBeforeUnmount(() => {
9042
9041
  resizeObserver.disconnect();
@@ -9045,8 +9044,7 @@
9045
9044
  return vue.openBlock(), vue.createElementBlock("div", {
9046
9045
  class: "m-editor-nav-menu",
9047
9046
  style: vue.normalizeStyle({ height: `${_ctx.height}px` }),
9048
- ref_key: "navMenu",
9049
- ref: navMenu
9047
+ ref: "navMenu"
9050
9048
  }, [
9051
9049
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(keys), (key) => {
9052
9050
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -9067,7 +9065,7 @@
9067
9065
  }
9068
9066
  });
9069
9067
 
9070
- const _hoisted_1$b = { class: "m-editor-props-form-panel" };
9068
+ const _hoisted_1$c = { class: "m-editor-props-form-panel" };
9071
9069
  const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
9072
9070
  ...{
9073
9071
  name: "MEditorFormPanel"
@@ -9092,11 +9090,11 @@
9092
9090
  const propsPanelSize = vue.computed(() => services?.uiService.get("propsPanelSize") || "small");
9093
9091
  const { height: editorContentHeight } = useEditorContentHeight();
9094
9092
  const stage = vue.computed(() => services?.editorService.get("stage"));
9095
- const configForm = vue.useTemplateRef("configForm");
9093
+ const configFormRef = vue.useTemplateRef("configForm");
9096
9094
  vue.watchEffect(() => {
9097
- if (configForm.value) {
9098
- configForm.value.formState.stage = stage.value;
9099
- configForm.value.formState.services = services;
9095
+ if (configFormRef.value) {
9096
+ configFormRef.value.formState.stage = stage.value;
9097
+ configFormRef.value.formState.services = services;
9100
9098
  }
9101
9099
  });
9102
9100
  const internalInstance = vue.getCurrentInstance();
@@ -9105,7 +9103,7 @@
9105
9103
  });
9106
9104
  const submit = async (v, eventData) => {
9107
9105
  try {
9108
- const values = await configForm.value?.submitForm();
9106
+ const values = await configFormRef.value?.submitForm();
9109
9107
  emit("submit", values, eventData);
9110
9108
  } catch (e) {
9111
9109
  emit("submit-error", e);
@@ -9117,15 +9115,14 @@
9117
9115
  const saveCode = (values) => {
9118
9116
  emit("submit", props.codeValueKey ? { [props.codeValueKey]: values } : values);
9119
9117
  };
9120
- __expose({ configForm, submit });
9118
+ __expose({ configForm: configFormRef, submit });
9121
9119
  return (_ctx, _cache) => {
9122
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
9120
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
9123
9121
  vue.renderSlot(_ctx.$slots, "props-form-panel-header"),
9124
9122
  vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), null, {
9125
9123
  default: vue.withCtx(() => [
9126
9124
  vue.createVNode(vue.unref(formPlugin.MForm), {
9127
- ref_key: "configForm",
9128
- ref: configForm,
9125
+ ref: "configForm",
9129
9126
  class: vue.normalizeClass(propsPanelSize.value),
9130
9127
  "popper-class": `m-editor-props-panel-popper ${propsPanelSize.value}`,
9131
9128
  "label-width": _ctx.labelWidth,
@@ -9191,7 +9188,7 @@
9191
9188
  };
9192
9189
  };
9193
9190
 
9194
- const _hoisted_1$a = {
9191
+ const _hoisted_1$b = {
9195
9192
  ref: "propsPanel",
9196
9193
  class: "m-editor-props-panel"
9197
9194
  };
@@ -9257,8 +9254,10 @@
9257
9254
  const errorHandler = (e) => {
9258
9255
  emit("form-error", e);
9259
9256
  };
9260
- const mountedHandler = (e) => {
9261
- emit("mounted", e);
9257
+ const mountedHandler = () => {
9258
+ if (propertyFormPanelRef.value) {
9259
+ emit("mounted", propertyFormPanelRef.value);
9260
+ }
9262
9261
  };
9263
9262
  const propsPanelEl = vue.useTemplateRef("propsPanel");
9264
9263
  const widthChange = ({ deltaX }) => {
@@ -9279,7 +9278,7 @@
9279
9278
  submit
9280
9279
  });
9281
9280
  return (_ctx, _cache) => {
9282
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
9281
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
9283
9282
  vue.renderSlot(_ctx.$slots, "props-panel-header"),
9284
9283
  vue.createVNode(_sfc_main$q, {
9285
9284
  ref: "propertyFormPanel",
@@ -9363,9 +9362,9 @@
9363
9362
  setup(__props, { expose: __expose, emit: __emit }) {
9364
9363
  const props = __props;
9365
9364
  const emit = __emit;
9366
- const menu = vue.useTemplateRef("menu");
9367
- const buttons = vue.useTemplateRef("buttons");
9368
- const subMenu = vue.useTemplateRef("subMenu");
9365
+ const menuEl = vue.useTemplateRef("menu");
9366
+ const buttonRefs = vue.useTemplateRef("buttons");
9367
+ const subMenuRef = vue.useTemplateRef("subMenu");
9369
9368
  const visible = vue.ref(false);
9370
9369
  const subMenuData = vue.ref([]);
9371
9370
  const zIndex = designPlugin.useZIndex();
@@ -9379,11 +9378,11 @@
9379
9378
  left: `${menuPosition.value.left + 2}px`,
9380
9379
  zIndex: curZIndex.value
9381
9380
  }));
9382
- const contains = (el) => menu.value?.contains(el) || subMenu.value?.contains(el);
9381
+ const contains = (el) => menuEl.value?.contains(el) || subMenuRef.value?.contains(el);
9383
9382
  const hide = () => {
9384
9383
  if (!visible.value) return;
9385
9384
  visible.value = false;
9386
- subMenu.value?.hide();
9385
+ subMenuRef.value?.hide();
9387
9386
  emit("hide");
9388
9387
  };
9389
9388
  const clickHandler = (event) => {
@@ -9404,7 +9403,7 @@
9404
9403
  hide();
9405
9404
  };
9406
9405
  const setPosition = (e) => {
9407
- const menuHeight = menu.value?.clientHeight || 0;
9406
+ const menuHeight = menuEl.value?.clientHeight || 0;
9408
9407
  let top = e.clientY;
9409
9408
  if (menuHeight + e.clientY > document.body.clientHeight) {
9410
9409
  top = document.body.clientHeight - menuHeight;
@@ -9432,14 +9431,14 @@
9432
9431
  if (!visible.value) {
9433
9432
  return;
9434
9433
  }
9435
- if (menu.value) {
9436
- let y = menu.value.offsetTop;
9437
- if (buttons.value?.[index].$el) {
9438
- const rect = buttons.value?.[index].$el.getBoundingClientRect();
9434
+ if (menuEl.value) {
9435
+ let y = menuEl.value.offsetTop;
9436
+ if (buttonRefs.value?.[index].$el) {
9437
+ const rect = buttonRefs.value?.[index].$el.getBoundingClientRect();
9439
9438
  y = rect.top;
9440
9439
  }
9441
- subMenu.value?.show({
9442
- clientX: menu.value.offsetLeft + menu.value.clientWidth - 2,
9440
+ subMenuRef.value?.show({
9441
+ clientX: menuEl.value.offsetLeft + menuEl.value.clientWidth - 2,
9443
9442
  clientY: y
9444
9443
  });
9445
9444
  }
@@ -9457,7 +9456,7 @@
9457
9456
  globalThis.removeEventListener("mousedown", outsideClickHideHandler, true);
9458
9457
  });
9459
9458
  __expose({
9460
- menu,
9459
+ menu: menuEl,
9461
9460
  menuPosition,
9462
9461
  hide,
9463
9462
  show,
@@ -9470,8 +9469,7 @@
9470
9469
  default: vue.withCtx(() => [
9471
9470
  vue.withDirectives(vue.createElementVNode("div", {
9472
9471
  class: "magic-editor-content-menu",
9473
- ref_key: "menu",
9474
- ref: menu,
9472
+ ref: "menu",
9475
9473
  style: vue.normalizeStyle(menuStyle.value),
9476
9474
  onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseenterHandler()),
9477
9475
  onContextmenu: _cache[1] || (_cache[1] = vue.withModifiers(() => {
@@ -9483,8 +9481,7 @@
9483
9481
  return vue.openBlock(), vue.createBlock(_sfc_main$z, {
9484
9482
  "event-type": "mouseup",
9485
9483
  ref_for: true,
9486
- ref_key: "buttons",
9487
- ref: buttons,
9484
+ ref: "buttons",
9488
9485
  class: vue.normalizeClass({ active: _ctx.active && item.id === _ctx.active }),
9489
9486
  data: item,
9490
9487
  key: index,
@@ -9497,8 +9494,7 @@
9497
9494
  subMenuData.value.length ? (vue.openBlock(), vue.createBlock(_component_content_menu, {
9498
9495
  key: 0,
9499
9496
  class: "sub-menu",
9500
- ref_key: "subMenu",
9501
- ref: subMenu,
9497
+ ref: "subMenu",
9502
9498
  active: _ctx.active,
9503
9499
  "menu-data": subMenuData.value,
9504
9500
  "is-sub-menu": true,
@@ -9556,7 +9552,7 @@
9556
9552
  }
9557
9553
  });
9558
9554
 
9559
- const _hoisted_1$9 = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
9555
+ const _hoisted_1$a = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
9560
9556
  const _hoisted_2$3 = { class: "tree-node-label" };
9561
9557
  const _hoisted_3$1 = { class: "tree-node-tool" };
9562
9558
  const _hoisted_4$1 = {
@@ -9682,14 +9678,14 @@
9682
9678
  }, 1032, ["data", "parent", "parentsId", "node-status-map", "indent"]);
9683
9679
  }), 128))
9684
9680
  ])) : vue.createCommentVNode("", true)
9685
- ], 40, _hoisted_1$9)), [
9681
+ ], 40, _hoisted_1$a)), [
9686
9682
  [vue.vShow, visible.value]
9687
9683
  ]);
9688
9684
  };
9689
9685
  }
9690
9686
  });
9691
9687
 
9692
- const _hoisted_1$8 = {
9688
+ const _hoisted_1$9 = {
9693
9689
  key: 1,
9694
9690
  class: "m-editor-tree-empty"
9695
9691
  };
@@ -9736,7 +9732,7 @@
9736
9732
  ]),
9737
9733
  _: 2
9738
9734
  }, 1032, ["data", "indent", "next-level-indent-increment", "node-status-map"]);
9739
- }), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
9735
+ }), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [
9740
9736
  vue.createElementVNode("p", null, vue.toDisplayString(_ctx.emptyText), 1)
9741
9737
  ]))
9742
9738
  ], 32);
@@ -9987,7 +9983,7 @@
9987
9983
  };
9988
9984
  };
9989
9985
 
9990
- const _hoisted_1$7 = { class: "search-wrapper" };
9986
+ const _hoisted_1$8 = { class: "search-wrapper" };
9991
9987
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
9992
9988
  ...{
9993
9989
  name: "MEditorCodeBlockListPanel"
@@ -10005,9 +10001,9 @@
10005
10001
  const { codeBlockService } = vue.inject("services") || {};
10006
10002
  const editable = vue.computed(() => codeBlockService?.getEditStatus());
10007
10003
  const { codeBlockEditor, codeConfig, editCode, deleteCode, createCodeBlock, submitCodeBlockHandler } = useCodeBlockEdit(codeBlockService);
10008
- const codeBlockList = vue.useTemplateRef("codeBlockList");
10004
+ const codeBlockListRef = vue.useTemplateRef("codeBlockList");
10009
10005
  const filterTextChangeHandler = (val) => {
10010
- codeBlockList.value?.filter(val);
10006
+ codeBlockListRef.value?.filter(val);
10011
10007
  };
10012
10008
  eventBus?.on("edit-code", (id) => {
10013
10009
  editCode(id);
@@ -10017,7 +10013,7 @@
10017
10013
  menuData: contentMenuData,
10018
10014
  contentMenuHideHandler
10019
10015
  } = useContentMenu$1((id) => {
10020
- codeBlockList.value?.deleteCode(id);
10016
+ codeBlockListRef.value?.deleteCode(id);
10021
10017
  });
10022
10018
  const menuData = vue.computed(() => props.customContentMenu(contentMenuData, "code-block"));
10023
10019
  return (_ctx, _cache) => {
@@ -10025,7 +10021,7 @@
10025
10021
  vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-layer-panel" }, {
10026
10022
  default: vue.withCtx(() => [
10027
10023
  vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
10028
- vue.createElementVNode("div", _hoisted_1$7, [
10024
+ vue.createElementVNode("div", _hoisted_1$8, [
10029
10025
  vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
10030
10026
  editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicButton), {
10031
10027
  key: 0,
@@ -10043,8 +10039,7 @@
10043
10039
  ])
10044
10040
  ]),
10045
10041
  vue.createVNode(_sfc_main$k, {
10046
- ref_key: "codeBlockList",
10047
- ref: codeBlockList,
10042
+ ref: "codeBlockList",
10048
10043
  "custom-error": _ctx.customError,
10049
10044
  indent: _ctx.indent,
10050
10045
  "next-level-indent-increment": _ctx.nextLevelIndentIncrement,
@@ -10423,7 +10418,7 @@
10423
10418
  };
10424
10419
  };
10425
10420
 
10426
- const _hoisted_1$6 = { class: "search-wrapper" };
10421
+ const _hoisted_1$7 = { class: "search-wrapper" };
10427
10422
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
10428
10423
  ...{
10429
10424
  name: "MEditorDataSourceListPanel"
@@ -10486,7 +10481,7 @@
10486
10481
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
10487
10482
  vue.createVNode(vue.unref(designPlugin.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
10488
10483
  default: vue.withCtx(() => [
10489
- vue.createElementVNode("div", _hoisted_1$6, [
10484
+ vue.createElementVNode("div", _hoisted_1$7, [
10490
10485
  vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
10491
10486
  vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicPopover), {
10492
10487
  key: 0,
@@ -10558,7 +10553,7 @@
10558
10553
  }
10559
10554
  });
10560
10555
 
10561
- const _hoisted_1$5 = {
10556
+ const _hoisted_1$6 = {
10562
10557
  width: "1em",
10563
10558
  height: "1em",
10564
10559
  viewBox: "0 0 16 16",
@@ -10573,7 +10568,7 @@
10573
10568
  __name: "FolderMinusIcon",
10574
10569
  setup(__props) {
10575
10570
  return (_ctx, _cache) => {
10576
- return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _cache[0] || (_cache[0] = [
10571
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [
10577
10572
  vue.createElementVNode("path", {
10578
10573
  "fill-rule": "evenodd",
10579
10574
  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"
@@ -10671,7 +10666,7 @@
10671
10666
  const props = __props;
10672
10667
  const emit = __emit;
10673
10668
  const services = vue.inject("services");
10674
- const menu = vue.useTemplateRef("menu");
10669
+ const menuRef = vue.useTemplateRef("menu");
10675
10670
  const node = vue.computed(() => services?.editorService.get("node"));
10676
10671
  const nodes = vue.computed(() => services?.editorService.get("nodes"));
10677
10672
  const componentList = vue.computed(() => services?.componentListService.getList() || []);
@@ -10747,7 +10742,7 @@
10747
10742
  )
10748
10743
  );
10749
10744
  const show = (e) => {
10750
- menu.value?.show(e);
10745
+ menuRef.value?.show(e);
10751
10746
  };
10752
10747
  __expose({
10753
10748
  show
@@ -10755,8 +10750,7 @@
10755
10750
  return (_ctx, _cache) => {
10756
10751
  return vue.openBlock(), vue.createBlock(_sfc_main$o, {
10757
10752
  "menu-data": menuData.value,
10758
- ref_key: "menu",
10759
- ref: menu,
10753
+ ref: "menu",
10760
10754
  style: { "overflow": "initial" }
10761
10755
  }, null, 8, ["menu-data"]);
10762
10756
  };
@@ -10798,7 +10792,7 @@
10798
10792
  }
10799
10793
  });
10800
10794
 
10801
- const useClick = (services, isCtrlKeyDown, nodeStatusMap) => {
10795
+ const useClick = (services, isCtrlKeyDown, nodeStatusMap, menuRef) => {
10802
10796
  const isMultiSelect = vue.computed(() => isCtrlKeyDown.value && !services?.editorService.get("disabledMultiSelect"));
10803
10797
  const select = async (data) => {
10804
10798
  if (!data.id) {
@@ -10863,9 +10857,8 @@
10863
10857
  select(data);
10864
10858
  });
10865
10859
  };
10866
- const menu = vue.useTemplateRef("menu");
10867
10860
  return {
10868
- menu,
10861
+ menuRef,
10869
10862
  nodeClickHandler,
10870
10863
  nodeContentMenuHandler(event, data) {
10871
10864
  event.preventDefault();
@@ -10873,7 +10866,7 @@
10873
10866
  if (nodes.length < 2 || !nodes.includes(data)) {
10874
10867
  nodeClickHandler(event, data);
10875
10868
  }
10876
- menu.value?.show(event);
10869
+ menuRef.value?.show(event);
10877
10870
  },
10878
10871
  highlightHandler
10879
10872
  };
@@ -11274,11 +11267,11 @@
11274
11267
  setup(__props) {
11275
11268
  const services = vue.inject("services");
11276
11269
  const editorService = services?.editorService;
11277
- const tree = vue.useTemplateRef("tree");
11270
+ const treeRef = vue.useTemplateRef("tree");
11278
11271
  const page = vue.computed(() => editorService?.get("page"));
11279
11272
  const nodeData = vue.computed(() => !page.value ? [] : [page.value]);
11280
11273
  const { nodeStatusMap } = useNodeStatus(services);
11281
- const { isCtrlKeyDown } = useKeybinding(services, tree);
11274
+ const { isCtrlKeyDown } = useKeybinding(services, treeRef);
11282
11275
  const filterNodeMethod = (v, data) => {
11283
11276
  let name = "";
11284
11277
  if (data.name) {
@@ -11300,12 +11293,12 @@
11300
11293
  }
11301
11294
  };
11302
11295
  const { handleDragStart, handleDragEnd, handleDragLeave, handleDragOver } = useDrag(services);
11296
+ const menuRef = vue.useTemplateRef("menu");
11303
11297
  const {
11304
- menu,
11305
11298
  nodeClickHandler,
11306
11299
  nodeContentMenuHandler,
11307
11300
  highlightHandler: mouseenterHandler
11308
- } = useClick(services, isCtrlKeyDown, nodeStatusMap);
11301
+ } = useClick(services, isCtrlKeyDown, nodeStatusMap, menuRef);
11309
11302
  return (_ctx, _cache) => {
11310
11303
  return vue.openBlock(), vue.createBlock(vue.unref(designPlugin.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
11311
11304
  default: vue.withCtx(() => [
@@ -11314,8 +11307,7 @@
11314
11307
  page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
11315
11308
  key: 0,
11316
11309
  tabindex: "-1",
11317
- ref_key: "tree",
11318
- ref: tree,
11310
+ ref: "tree",
11319
11311
  data: nodeData.value,
11320
11312
  "node-status-map": vue.unref(nodeStatusMap),
11321
11313
  indent: _ctx.indent,
@@ -11343,8 +11335,7 @@
11343
11335
  }, 8, ["data", "node-status-map", "indent", "next-level-indent-increment", "onNodeDragover", "onNodeDragstart", "onNodeDragleave", "onNodeDragend", "onNodeContextmenu", "onNodeMouseenter", "onNodeClick"])) : vue.createCommentVNode("", true),
11344
11336
  (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
11345
11337
  vue.createVNode(_sfc_main$e, {
11346
- ref_key: "menu",
11347
- ref: menu,
11338
+ ref: "menu",
11348
11339
  "layer-content-menu": _ctx.layerContentMenu,
11349
11340
  "custom-content-menu": _ctx.customContentMenu,
11350
11341
  onCollapseAll: collapseAllHandler
@@ -11357,7 +11348,7 @@
11357
11348
  }
11358
11349
  });
11359
11350
 
11360
- const _hoisted_1$4 = ["onClick", "onDragstart"];
11351
+ const _hoisted_1$5 = ["onClick", "onDragstart"];
11361
11352
  const _hoisted_2$2 = ["title"];
11362
11353
  const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
11363
11354
  ...{
@@ -11478,7 +11469,7 @@
11478
11469
  title: item.text
11479
11470
  }, vue.toDisplayString(item.text), 9, _hoisted_2$2)
11480
11471
  ])
11481
- ], 40, _hoisted_1$4);
11472
+ ], 40, _hoisted_1$5);
11482
11473
  }), 128))
11483
11474
  ]),
11484
11475
  _: 2
@@ -11496,7 +11487,7 @@
11496
11487
  }
11497
11488
  });
11498
11489
 
11499
- const _hoisted_1$3 = {
11490
+ const _hoisted_1$4 = {
11500
11491
  key: 0,
11501
11492
  class: "m-editor-sidebar"
11502
11493
  };
@@ -11646,7 +11637,7 @@
11646
11637
  });
11647
11638
  return (_ctx, _cache) => {
11648
11639
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
11649
- _ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
11640
+ _ctx.data.type === "tabs" && _ctx.data.items.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
11650
11641
  vue.createElementVNode("div", _hoisted_2$1, [
11651
11642
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sideBarItems.value, (config, index) => {
11652
11643
  return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
@@ -11851,8 +11842,8 @@
11851
11842
  setup(__props, { emit: __emit }) {
11852
11843
  const props = __props;
11853
11844
  const emit = __emit;
11854
- const bar = vue.useTemplateRef("bar");
11855
- const thumb = vue.useTemplateRef("thumb");
11845
+ const barEl = vue.useTemplateRef("bar");
11846
+ const thumbEl = vue.useTemplateRef("thumb");
11856
11847
  const thumbSize = vue.computed(() => props.size * (props.size / props.scrollSize));
11857
11848
  const thumbPos = vue.computed(() => props.pos / props.scrollSize * props.size);
11858
11849
  const thumbStyle = vue.computed(() => ({
@@ -11861,9 +11852,8 @@
11861
11852
  }));
11862
11853
  let gesto;
11863
11854
  vue.onMounted(() => {
11864
- if (!thumb.value) return;
11865
- const thumbEl = thumb.value;
11866
- gesto = new Gesto(thumbEl, {
11855
+ if (!thumbEl.value) return;
11856
+ gesto = new Gesto(thumbEl.value, {
11867
11857
  container: window
11868
11858
  });
11869
11859
  gesto.on("dragStart", (e) => {
@@ -11872,11 +11862,11 @@
11872
11862
  }).on("drag", (e) => {
11873
11863
  scrollBy(getDelta(e));
11874
11864
  });
11875
- bar.value?.addEventListener("wheel", wheelHandler, false);
11865
+ barEl.value?.addEventListener("wheel", wheelHandler, false);
11876
11866
  });
11877
11867
  vue.onBeforeUnmount(() => {
11878
11868
  if (gesto) gesto.off();
11879
- bar.value?.removeEventListener("wheel", wheelHandler, false);
11869
+ barEl.value?.removeEventListener("wheel", wheelHandler, false);
11880
11870
  });
11881
11871
  const wheelHandler = (e) => {
11882
11872
  const delta = props.isHorizontal ? e.deltaX : e.deltaY;
@@ -11907,13 +11897,11 @@
11907
11897
  };
11908
11898
  return (_ctx, _cache) => {
11909
11899
  return vue.openBlock(), vue.createElementBlock("div", {
11910
- ref_key: "bar",
11911
- ref: bar,
11900
+ ref: "bar",
11912
11901
  class: vue.normalizeClass(["m-editor-scroll-bar", _ctx.isHorizontal ? "horizontal" : "vertical"])
11913
11902
  }, [
11914
11903
  vue.createElementVNode("div", {
11915
- ref_key: "thumb",
11916
- ref: thumb,
11904
+ ref: "thumb",
11917
11905
  class: "m-editor-scroll-bar-thumb",
11918
11906
  style: vue.normalizeStyle(thumbStyle.value)
11919
11907
  }, null, 4)
@@ -11922,6 +11910,10 @@
11922
11910
  }
11923
11911
  });
11924
11912
 
11913
+ const _hoisted_1$3 = {
11914
+ class: "m-editor-scroll-viewer-container",
11915
+ ref: "container"
11916
+ };
11925
11917
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
11926
11918
  ...{
11927
11919
  name: "MEditorScrollViewer"
@@ -11940,8 +11932,8 @@
11940
11932
  },
11941
11933
  setup(__props, { expose: __expose }) {
11942
11934
  const props = __props;
11943
- const container = vue.useTemplateRef("container");
11944
- const el = vue.useTemplateRef("el");
11935
+ const containerEl = vue.useTemplateRef("container");
11936
+ const el = vue.useTemplateRef("target");
11945
11937
  const style = vue.computed(
11946
11938
  () => `
11947
11939
  width: ${utils.isNumber(`${props.width}`) ? `${props.width}px` : props.width};
@@ -11954,9 +11946,9 @@
11954
11946
  const scrollHeight = vue.ref(0);
11955
11947
  let scrollViewer;
11956
11948
  vue.onMounted(() => {
11957
- if (!container.value || !el.value) return;
11949
+ if (!containerEl.value || !el.value) return;
11958
11950
  scrollViewer = new ScrollViewer({
11959
- container: container.value,
11951
+ container: containerEl.value,
11960
11952
  target: el.value,
11961
11953
  zoom: props.zoom,
11962
11954
  correctionScrollSize: props.correctionScrollSize
@@ -11992,17 +11984,12 @@
11992
11984
  });
11993
11985
  };
11994
11986
  __expose({
11995
- container
11987
+ container: containerEl
11996
11988
  });
11997
11989
  return (_ctx, _cache) => {
11998
- return vue.openBlock(), vue.createElementBlock("div", {
11999
- class: "m-editor-scroll-viewer-container",
12000
- ref_key: "container",
12001
- ref: container
12002
- }, [
11990
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
12003
11991
  vue.createElementVNode("div", {
12004
- ref_key: "el",
12005
- ref: el,
11992
+ ref: "target",
12006
11993
  style: vue.normalizeStyle(style.value)
12007
11994
  }, [
12008
11995
  vue.renderSlot(_ctx.$slots, "default")
@@ -12035,8 +12022,8 @@
12035
12022
  const editorService = services?.editorService;
12036
12023
  const visible = vue.ref(false);
12037
12024
  const buttonVisible = vue.ref(false);
12038
- const button = vue.useTemplateRef("button");
12039
- const box = vue.useTemplateRef("box");
12025
+ const buttonEl = vue.useTemplateRef("button");
12026
+ const boxRef = vue.useTemplateRef("box");
12040
12027
  const stage = vue.computed(() => editorService?.get("stage"));
12041
12028
  const page = vue.computed(() => editorService?.get("page"));
12042
12029
  const nodes = vue.computed(() => editorService?.get("nodes") || []);
@@ -12081,12 +12068,12 @@
12081
12068
  top: 0
12082
12069
  });
12083
12070
  vue.watch(visible, async (visible2) => {
12084
- if (!button.value || !visible2) {
12071
+ if (!buttonEl.value || !visible2) {
12085
12072
  return;
12086
12073
  }
12087
12074
  await vue.nextTick();
12088
- const rect = button.value.getBoundingClientRect();
12089
- const height = box.value?.target?.clientHeight || 0;
12075
+ const rect = buttonEl.value.getBoundingClientRect();
12076
+ const height = boxRef.value?.target?.clientHeight || 0;
12090
12077
  menuPosition.value = {
12091
12078
  left: rect.left + rect.width + 5,
12092
12079
  top: rect.top - height / 2 + rect.height / 2
@@ -12100,8 +12087,7 @@
12100
12087
  }, {
12101
12088
  default: vue.withCtx(() => [
12102
12089
  vue.createElementVNode("div", {
12103
- ref_key: "button",
12104
- ref: button,
12090
+ ref: "button",
12105
12091
  class: "m-editor-stage-float-button",
12106
12092
  onClick: _cache[0] || (_cache[0] = ($event) => visible.value = true)
12107
12093
  }, "可选组件", 512)
@@ -12110,8 +12096,7 @@
12110
12096
  })) : vue.createCommentVNode("", true),
12111
12097
  page.value && vue.unref(nodeStatusMap) && buttonVisible.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1k, {
12112
12098
  key: 1,
12113
- ref_key: "box",
12114
- ref: box,
12099
+ ref: "box",
12115
12100
  visible: visible.value,
12116
12101
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
12117
12102
  title: "当前位置下的组件",
@@ -12137,7 +12122,7 @@
12137
12122
  setup(__props) {
12138
12123
  const services = vue.inject("services");
12139
12124
  const stageOptions = vue.inject("stageOptions");
12140
- const stageOverlay = vue.useTemplateRef("stageOverlay");
12125
+ const stageOverlayEl = vue.useTemplateRef("stageOverlay");
12141
12126
  const stageOverlayVisible = vue.computed(() => services?.stageOverlayService.get("stageOverlayVisible"));
12142
12127
  const wrapWidth = vue.computed(() => services?.stageOverlayService.get("wrapWidth") || 0);
12143
12128
  const wrapHeight = vue.computed(() => services?.stageOverlayService.get("wrapHeight") || 0);
@@ -12156,12 +12141,12 @@
12156
12141
  services?.stageOverlayService.closeOverlay();
12157
12142
  }
12158
12143
  });
12159
- vue.watch(stageOverlay, (stageOverlay2) => {
12144
+ vue.watch(stageOverlayEl, (stageOverlay) => {
12160
12145
  if (!services) return;
12161
12146
  const subStage = services.stageOverlayService.createStage(stageOptions);
12162
12147
  services?.stageOverlayService.set("stage", subStage);
12163
- if (stageOverlay2 && subStage) {
12164
- subStage.mount(stageOverlay2);
12148
+ if (stageOverlay && subStage) {
12149
+ subStage.mount(stageOverlay);
12165
12150
  const { mask, renderer } = subStage;
12166
12151
  const { contentWindow } = renderer;
12167
12152
  mask?.showRule(false);
@@ -12193,8 +12178,7 @@
12193
12178
  _: 1
12194
12179
  }),
12195
12180
  vue.createElementVNode("div", {
12196
- ref_key: "stageOverlay",
12197
- ref: stageOverlay,
12181
+ ref: "stageOverlay",
12198
12182
  class: "m-editor-stage-overlay-container",
12199
12183
  style: vue.normalizeStyle(style.value),
12200
12184
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
@@ -12258,7 +12242,7 @@
12258
12242
  const props = __props;
12259
12243
  const services = vue.inject("services");
12260
12244
  const editorService = services?.editorService;
12261
- const menu = vue.useTemplateRef("menu");
12245
+ const menuRef = vue.useTemplateRef("menu");
12262
12246
  const canCenter = vue.ref(false);
12263
12247
  const node = vue.computed(() => editorService?.get("node"));
12264
12248
  const nodes = vue.computed(() => editorService?.get("nodes"));
@@ -12277,7 +12261,7 @@
12277
12261
  }
12278
12262
  },
12279
12263
  useCopyMenu(),
12280
- usePasteMenu(menu),
12264
+ usePasteMenu(menuRef),
12281
12265
  {
12282
12266
  type: "divider",
12283
12267
  direction: "horizontal",
@@ -12359,14 +12343,13 @@
12359
12343
  { immediate: true }
12360
12344
  );
12361
12345
  const show = (e) => {
12362
- menu.value?.show(e);
12346
+ menuRef.value?.show(e);
12363
12347
  };
12364
12348
  __expose({ show });
12365
12349
  return (_ctx, _cache) => {
12366
12350
  return vue.openBlock(), vue.createBlock(_sfc_main$o, {
12367
12351
  "menu-data": menuData.value,
12368
- ref_key: "menu",
12369
- ref: menu
12352
+ ref: "menu"
12370
12353
  }, null, 8, ["menu-data"]);
12371
12354
  };
12372
12355
  }
@@ -12389,9 +12372,9 @@
12389
12372
  let runtime = null;
12390
12373
  const services = vue.inject("services");
12391
12374
  const stageLoading = vue.computed(() => services?.editorService.get("stageLoading") || false);
12392
- const stageWrap = vue.useTemplateRef("stageWrap");
12393
- const stageContainer = vue.useTemplateRef("stageContainer");
12394
- const menu = vue.useTemplateRef("menu");
12375
+ const stageWrapRef = vue.useTemplateRef("stageWrap");
12376
+ const stageContainerEl = vue.useTemplateRef("stageContainer");
12377
+ const menuRef = vue.useTemplateRef("menu");
12395
12378
  const nodes = vue.computed(() => services?.editorService.get("nodes") || []);
12396
12379
  const isMultiSelect = vue.computed(() => nodes.value.length > 1);
12397
12380
  const stageRect = vue.computed(() => services?.uiService.get("stageRect"));
@@ -12402,14 +12385,14 @@
12402
12385
  const node = vue.computed(() => services?.editorService.get("node"));
12403
12386
  vue.watchEffect(() => {
12404
12387
  if (stage || !page.value) return;
12405
- if (!stageContainer.value) return;
12388
+ if (!stageContainerEl.value) return;
12406
12389
  if (!(props.stageOptions?.runtimeUrl || props.stageOptions?.render) || !root.value) return;
12407
12390
  stage = useStage(props.stageOptions);
12408
12391
  stage.on("select", () => {
12409
- stageWrap.value?.container?.focus();
12392
+ stageWrapRef.value?.container?.focus();
12410
12393
  });
12411
12394
  services?.editorService.set("stage", vue.markRaw(stage));
12412
- stage.mount(stageContainer.value);
12395
+ stage.mount(stageContainerEl.value);
12413
12396
  if (!node.value?.id) {
12414
12397
  return;
12415
12398
  }
@@ -12462,9 +12445,9 @@
12462
12445
  }
12463
12446
  });
12464
12447
  vue.onMounted(() => {
12465
- if (stageWrap.value?.container) {
12466
- resizeObserver.observe(stageWrap.value.container);
12467
- services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrap.value.container);
12448
+ if (stageWrapRef.value?.container) {
12449
+ resizeObserver.observe(stageWrapRef.value.container);
12450
+ services?.keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrapRef.value.container);
12468
12451
  }
12469
12452
  });
12470
12453
  vue.onBeforeUnmount(() => {
@@ -12477,7 +12460,7 @@
12477
12460
  const parseDSL = getEditorConfig("parseDSL");
12478
12461
  const contextmenuHandler = (e) => {
12479
12462
  e.preventDefault();
12480
- menu.value?.show(e);
12463
+ menuRef.value?.show(e);
12481
12464
  };
12482
12465
  const dragoverHandler = (e) => {
12483
12466
  if (!e.dataTransfer) return;
@@ -12500,9 +12483,9 @@
12500
12483
  if (parentId) {
12501
12484
  parent = services?.editorService.getNodeById(parentId, false);
12502
12485
  }
12503
- if (parent && stageContainer.value && stage) {
12486
+ if (parent && stageContainerEl.value && stage) {
12504
12487
  const layout = await services?.editorService.getLayout(parent);
12505
- const containerRect = stageContainer.value.getBoundingClientRect();
12488
+ const containerRect = stageContainerEl.value.getBoundingClientRect();
12506
12489
  const { scrollTop, scrollLeft } = stage.mask;
12507
12490
  const { style = {} } = config.data;
12508
12491
  let top = 0;
@@ -12536,8 +12519,7 @@
12536
12519
  const _directive_loading = vue.resolveDirective("loading");
12537
12520
  return vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$8, {
12538
12521
  class: "m-editor-stage",
12539
- ref_key: "stageWrap",
12540
- ref: stageWrap,
12522
+ ref: "stageWrap",
12541
12523
  tabindex: "-1",
12542
12524
  "element-loading-text": "Runtime 加载中...",
12543
12525
  width: stageRect.value?.width,
@@ -12549,14 +12531,13 @@
12549
12531
  width: 60,
12550
12532
  height: 50
12551
12533
  },
12552
- onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(stageWrap)?.container?.focus())
12534
+ onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(stageWrapRef)?.container?.focus())
12553
12535
  }, {
12554
12536
  content: vue.withCtx(() => [
12555
12537
  !_ctx.disabledStageOverlay ? (vue.openBlock(), vue.createBlock(_sfc_main$6, { key: 0 })) : vue.createCommentVNode("", true),
12556
12538
  (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
12557
12539
  vue.createVNode(_sfc_main$4, {
12558
- ref_key: "menu",
12559
- ref: menu,
12540
+ ref: "menu",
12560
12541
  "is-multi-select": isMultiSelect.value,
12561
12542
  "stage-content-menu": _ctx.stageContentMenu,
12562
12543
  "custom-content-menu": _ctx.customContentMenu
@@ -12566,8 +12547,7 @@
12566
12547
  default: vue.withCtx(() => [
12567
12548
  vue.createElementVNode("div", {
12568
12549
  class: "m-editor-stage-container",
12569
- ref_key: "stageContainer",
12570
- ref: stageContainer,
12550
+ ref: "stageContainer",
12571
12551
  style: vue.normalizeStyle(`transform: scale(${zoom.value});`),
12572
12552
  onContextmenu: contextmenuHandler,
12573
12553
  onDrop: dropHandler,
@@ -12908,7 +12888,7 @@
12908
12888
  const codeBlockService = new CodeBlock();
12909
12889
 
12910
12890
  class ComponentList extends BaseService {
12911
- state = vue.reactive({
12891
+ state = vue.shallowReactive({
12912
12892
  list: []
12913
12893
  });
12914
12894
  constructor() {
@@ -13089,7 +13069,7 @@
13089
13069
 
13090
13070
  const idleTask = new IdleTask();
13091
13071
  class Dep extends BaseService {
13092
- state = vue.reactive({
13072
+ state = vue.shallowReactive({
13093
13073
  collecting: false
13094
13074
  });
13095
13075
  watcher = new core.Watcher({ initialTargets: vue.reactive({}) });
@@ -13131,6 +13111,7 @@
13131
13111
  });
13132
13112
  this.set("collecting", false);
13133
13113
  this.emit("collected", nodes, deep);
13114
+ this.emit("ds-collected", nodes, deep);
13134
13115
  }
13135
13116
  collectIdle(nodes, depExtendedData = {}, deep = false, type) {
13136
13117
  this.set("collecting", true);
@@ -13149,17 +13130,20 @@
13149
13130
  idleTask.once("finish", () => {
13150
13131
  this.emit("collected", nodes, deep);
13151
13132
  this.set("collecting", false);
13133
+ });
13134
+ idleTask.once("hight-level-finish", () => {
13135
+ this.emit("ds-collected", nodes, deep);
13152
13136
  resolve();
13153
13137
  });
13154
13138
  });
13155
13139
  }
13156
13140
  collectNode(node, target, depExtendedData = {}, deep = false) {
13157
13141
  if (utils.isPage(node)) {
13158
- Object.entries(target.deps).forEach(([depKey, dep]) => {
13142
+ for (const [depKey, dep] of Object.entries(target.deps)) {
13159
13143
  if (dep.data?.pageId && dep.data.pageId === depExtendedData.pageId) {
13160
13144
  delete target.deps[depKey];
13161
13145
  }
13162
- });
13146
+ }
13163
13147
  } else {
13164
13148
  this.watcher.removeTargetDep(target, node);
13165
13149
  }
@@ -13198,7 +13182,8 @@
13198
13182
  node,
13199
13183
  deep: false,
13200
13184
  target
13201
- }
13185
+ },
13186
+ target.type === core.DepTargetType.DATA_SOURCE
13202
13187
  );
13203
13188
  if (deep && Array.isArray(node.items) && node.items.length) {
13204
13189
  node.items.forEach((item) => {
@@ -13445,7 +13430,7 @@
13445
13430
  sync: ["openOverlay", "closeOverlay", "updateOverlay", "createStage"]
13446
13431
  };
13447
13432
  class StageOverlay extends BaseService {
13448
- state = vue.reactive({
13433
+ state = vue.shallowReactive({
13449
13434
  wrapDiv: document.createElement("div"),
13450
13435
  sourceEl: null,
13451
13436
  contentEl: null,
@@ -13688,10 +13673,12 @@
13688
13673
  (eventMethodList) => {
13689
13674
  const eventsList = {};
13690
13675
  const methodsList = {};
13691
- eventMethodList && Object.keys(eventMethodList).forEach((type) => {
13692
- eventsList[type] = eventMethodList[type].events;
13693
- methodsList[type] = eventMethodList[type].methods;
13694
- });
13676
+ if (eventMethodList) {
13677
+ for (const type of Object.keys(eventMethodList)) {
13678
+ eventsList[type] = eventMethodList[type].events;
13679
+ methodsList[type] = eventMethodList[type].methods;
13680
+ }
13681
+ }
13695
13682
  eventsService.setEvents(eventsList);
13696
13683
  eventsService.setMethods(methodsList);
13697
13684
  },
@@ -13702,9 +13689,12 @@
13702
13689
  vue.watch(
13703
13690
  () => props.datasourceConfigs,
13704
13691
  (configs) => {
13705
- configs && Object.entries(configs).forEach(([key, value]) => {
13692
+ if (!configs) {
13693
+ return;
13694
+ }
13695
+ for (const [key, value] of Object.entries(configs)) {
13706
13696
  dataSourceService.setFormConfig(key, value);
13707
- });
13697
+ }
13708
13698
  },
13709
13699
  {
13710
13700
  immediate: true
@@ -13713,9 +13703,12 @@
13713
13703
  vue.watch(
13714
13704
  () => props.datasourceValues,
13715
13705
  (values) => {
13716
- values && Object.entries(values).forEach(([key, value]) => {
13706
+ if (!values) {
13707
+ return;
13708
+ }
13709
+ for (const [key, value] of Object.entries(values)) {
13717
13710
  dataSourceService.setFormValue(key, value);
13718
- });
13711
+ }
13719
13712
  },
13720
13713
  {
13721
13714
  immediate: true
@@ -13726,16 +13719,18 @@
13726
13719
  (eventMethodList) => {
13727
13720
  const eventsList = {};
13728
13721
  const methodsList = {};
13729
- eventMethodList && Object.keys(eventMethodList).forEach((type) => {
13730
- eventsList[type] = eventMethodList[type].events;
13731
- methodsList[type] = eventMethodList[type].methods;
13732
- });
13733
- Object.entries(eventsList).forEach(([key, value]) => {
13722
+ if (eventMethodList) {
13723
+ for (const type of Object.keys(eventMethodList)) {
13724
+ eventsList[type] = eventMethodList[type].events;
13725
+ methodsList[type] = eventMethodList[type].methods;
13726
+ }
13727
+ }
13728
+ for (const [key, value] of Object.entries(eventsList)) {
13734
13729
  dataSourceService.setFormEvent(key, value);
13735
- });
13736
- Object.entries(methodsList).forEach(([key, value]) => {
13730
+ }
13731
+ for (const [key, value] of Object.entries(methodsList)) {
13737
13732
  dataSourceService.setFormMethod(key, value);
13738
- });
13733
+ }
13739
13734
  },
13740
13735
  {
13741
13736
  immediate: true
@@ -13766,6 +13761,91 @@
13766
13761
  });
13767
13762
  };
13768
13763
  const initServiceEvents = (props, emit, { editorService, codeBlockService, dataSourceService, depService }) => {
13764
+ const getTMagicApp = () => {
13765
+ const renderer = editorService.get("stage")?.renderer;
13766
+ if (!renderer) {
13767
+ return void 0;
13768
+ }
13769
+ if (renderer.runtime) {
13770
+ return renderer.runtime.getApp?.();
13771
+ }
13772
+ return new Promise((resolve) => {
13773
+ const timeout = globalThis.setTimeout(() => {
13774
+ resolve(void 0);
13775
+ }, 1e4);
13776
+ renderer.on("runtime-ready", () => {
13777
+ if (timeout) {
13778
+ globalThis.clearTimeout(timeout);
13779
+ }
13780
+ resolve(renderer.runtime?.getApp?.());
13781
+ });
13782
+ });
13783
+ };
13784
+ const updateStageNodes = (nodes) => {
13785
+ for (const node of nodes) {
13786
+ updateStageNode(node);
13787
+ }
13788
+ };
13789
+ const updateStageNode = (node) => {
13790
+ const root = editorService.get("root");
13791
+ if (!root) return;
13792
+ return editorService.get("stage")?.update({
13793
+ config: lodashEs.cloneDeep(node),
13794
+ parentId: editorService.getParentById(node.id)?.id,
13795
+ root: lodashEs.cloneDeep(root)
13796
+ });
13797
+ };
13798
+ const updateDataSourceSchema = async () => {
13799
+ const root = editorService.get("root");
13800
+ const app = await getTMagicApp();
13801
+ if (!app || !root) {
13802
+ return;
13803
+ }
13804
+ if (app.dsl) {
13805
+ app.dsl.dataSources = root.dataSources;
13806
+ }
13807
+ if (root.dataSources) {
13808
+ app.dataSourceManager?.updateSchema(root.dataSources);
13809
+ }
13810
+ };
13811
+ const dsDepCollectedHandler = async () => {
13812
+ const root = editorService.get("root");
13813
+ const app = await getTMagicApp();
13814
+ if (root && app?.dsl) {
13815
+ app.dsl.dataSourceDeps = root.dataSourceDeps;
13816
+ }
13817
+ };
13818
+ const collectIdle = (nodes, deep, type) => Promise.all(
13819
+ nodes.map((node) => {
13820
+ let pageId;
13821
+ if (utils.isPage(node)) {
13822
+ pageId = node.id;
13823
+ } else {
13824
+ const info = editorService.getNodeInfo(node.id);
13825
+ pageId = info.page?.id;
13826
+ }
13827
+ return depService.collectIdle([node], { pageId }, deep, type);
13828
+ })
13829
+ );
13830
+ vue.watch(
13831
+ () => editorService.get("stage"),
13832
+ (stage) => {
13833
+ if (!stage) {
13834
+ return;
13835
+ }
13836
+ stage.on("rerender", async () => {
13837
+ const node = editorService.get("node");
13838
+ if (!node) return;
13839
+ await collectIdle([node], true, core.DepTargetType.DATA_SOURCE);
13840
+ updateStageNode(node);
13841
+ });
13842
+ }
13843
+ );
13844
+ const initDataSourceDepTarget = (ds) => {
13845
+ depService.addTarget(core.createDataSourceTarget(ds, vue.reactive({})));
13846
+ depService.addTarget(core.createDataSourceMethodTarget(ds, vue.reactive({})));
13847
+ depService.addTarget(core.createDataSourceCondTarget(ds, vue.reactive({})));
13848
+ };
13769
13849
  const rootChangeHandler = async (value, preValue) => {
13770
13850
  if (!value) return;
13771
13851
  value.codeBlocks = value.codeBlocks || {};
@@ -13773,15 +13853,17 @@
13773
13853
  codeBlockService.setCodeDsl(value.codeBlocks);
13774
13854
  dataSourceService.set("dataSources", value.dataSources);
13775
13855
  depService.removeTargets(core.DepTargetType.CODE_BLOCK);
13776
- Object.entries(value.codeBlocks).forEach(([id, code]) => {
13856
+ for (const [id, code] of Object.entries(value.codeBlocks)) {
13777
13857
  depService.addTarget(core.createCodeBlockTarget(id, code));
13778
- });
13779
- dataSourceService.get("dataSources").forEach((ds) => {
13858
+ }
13859
+ for (const ds of dataSourceService.get("dataSources")) {
13780
13860
  initDataSourceDepTarget(ds);
13781
- });
13861
+ }
13782
13862
  if (Array.isArray(value.items)) {
13783
13863
  depService.clearIdleTasks();
13784
- collectIdle(value.items, true);
13864
+ collectIdle(value.items, true).then(() => {
13865
+ updateStageNodes(value.items);
13866
+ });
13785
13867
  } else {
13786
13868
  depService.clear();
13787
13869
  delete value.dataSourceDeps;
@@ -13805,188 +13887,83 @@
13805
13887
  emit("update:modelValue", value);
13806
13888
  }
13807
13889
  };
13808
- const stage = vue.computed(() => editorService.get("stage"));
13809
- vue.watch(stage, (stage2) => {
13810
- if (!stage2) {
13811
- return;
13812
- }
13813
- stage2.on("rerender", () => {
13814
- const node = editorService.get("node");
13815
- if (!node) return;
13816
- collectIdle([node], true).then(() => {
13817
- afterUpdateNodes([node]);
13818
- });
13819
- });
13820
- });
13821
- const getApp = () => stage.value?.renderer?.runtime?.getApp?.();
13822
- const updateDataSourceSchema = (nodes, deep) => {
13823
- const root = editorService.get("root");
13824
- const app = getApp();
13825
- if (root && app?.dsl) {
13826
- app.dsl.dataSourceDeps = root.dataSourceDeps;
13827
- app.dsl.dataSourceCondDeps = root.dataSourceCondDeps;
13828
- app.dsl.dataSources = root.dataSources;
13829
- }
13830
- if (root?.dataSources) {
13831
- getApp()?.dataSourceManager?.updateSchema(root.dataSources);
13832
- }
13833
- if (!root || !stage.value) return;
13834
- const allNodes = [];
13835
- if (deep) {
13836
- nodes.forEach((node) => {
13837
- utils.traverseNode(node, (node2) => {
13838
- if (!allNodes.includes(node2)) {
13839
- allNodes.push(node2);
13840
- }
13841
- });
13842
- });
13843
- } else {
13844
- allNodes.push(...nodes);
13845
- }
13846
- const deps = Object.values(root.dataSourceDeps || {});
13847
- deps.forEach((dep) => {
13848
- Object.keys(dep).forEach((id) => {
13849
- const node = allNodes.find((node2) => node2.id === id);
13850
- node && stage.value?.update({
13851
- config: lodashEs.cloneDeep(node),
13852
- parentId: editorService.getParentById(node.id)?.id,
13853
- root: lodashEs.cloneDeep(root)
13854
- });
13855
- });
13856
- });
13857
- };
13858
- const afterUpdateNodes = (nodes) => {
13859
- const root = editorService.get("root");
13860
- if (!root) return;
13861
- for (const node of nodes) {
13862
- stage.value?.update({
13863
- config: lodashEs.cloneDeep(node),
13864
- parentId: editorService.getParentById(node.id)?.id,
13865
- root: lodashEs.cloneDeep(root)
13866
- });
13867
- }
13868
- };
13869
- const targetAddHandler = (target) => {
13870
- const root = editorService.get("root");
13871
- if (!root) return;
13872
- if (target.type === core.DepTargetType.DATA_SOURCE) {
13873
- if (!root.dataSourceDeps) {
13874
- root.dataSourceDeps = {};
13875
- }
13876
- root.dataSourceDeps[target.id] = target.deps;
13877
- }
13878
- if (target.type === core.DepTargetType.DATA_SOURCE_COND) {
13879
- if (!root.dataSourceCondDeps) {
13880
- root.dataSourceCondDeps = {};
13881
- }
13882
- root.dataSourceCondDeps[target.id] = target.deps;
13883
- }
13884
- };
13885
- const targetRemoveHandler = (id) => {
13886
- const root = editorService.get("root");
13887
- if (!root) return;
13888
- if (root.dataSourceDeps) {
13889
- delete root.dataSourceDeps[id];
13890
- }
13891
- if (root.dataSourceCondDeps) {
13892
- delete root.dataSourceCondDeps[id];
13893
- }
13894
- };
13895
- const depCollectedHandler = () => {
13896
- const root = editorService.get("root");
13897
- if (!root) return;
13898
- const app = getApp();
13899
- if (app?.dsl) {
13900
- app.dsl.dataSourceDeps = root.dataSourceDeps;
13901
- }
13902
- };
13903
- depService.on("add-target", targetAddHandler);
13904
- depService.on("remove-target", targetRemoveHandler);
13905
- depService.on("collected", depCollectedHandler);
13906
- const initDataSourceDepTarget = (ds) => {
13907
- depService.addTarget(core.createDataSourceTarget(ds, vue.reactive({})));
13908
- depService.addTarget(core.createDataSourceMethodTarget(ds, vue.reactive({})));
13909
- depService.addTarget(core.createDataSourceCondTarget(ds, vue.reactive({})));
13910
- };
13911
- const collectIdle = (nodes, deep) => Promise.all(
13912
- nodes.map((node) => {
13913
- let pageId;
13914
- if (utils.isPage(node)) {
13915
- pageId = node.id;
13916
- } else {
13917
- const info = editorService.getNodeInfo(node.id);
13918
- pageId = info.page?.id;
13919
- }
13920
- return depService.collectIdle([node], { pageId }, deep);
13921
- })
13922
- );
13923
- const nodeAddHandler = (nodes) => {
13924
- collectIdle(nodes, true).then(() => {
13925
- afterUpdateNodes(nodes);
13926
- });
13890
+ const nodeAddHandler = async (nodes) => {
13891
+ await collectIdle(nodes, true);
13892
+ updateStageNodes(nodes);
13927
13893
  };
13928
- const nodeUpdateHandler = (data) => {
13894
+ const nodeUpdateHandler = async (data) => {
13929
13895
  const needRecollectNodes = [];
13930
13896
  const normalNodes = [];
13931
- data.forEach(({ newNode, oldNode, changeRecords }) => {
13897
+ for (const { newNode, oldNode, changeRecords } of data) {
13932
13898
  if (changeRecords?.length) {
13933
- for (const record of changeRecords) {
13934
- if (!record.propPath || new RegExp(`${core.NODE_CONDS_KEY}.(\\d)+.cond`).test(record.propPath) || new RegExp(`${core.NODE_CONDS_KEY}.(\\d)+.cond.(\\d)+.value`).test(record.propPath) || record.propPath === core.NODE_CONDS_KEY || utils.isValueIncludeDataSource(record.value)) {
13899
+ forChangeRecords: for (const record of changeRecords) {
13900
+ if (!record.propPath) {
13935
13901
  needRecollectNodes.push(newNode);
13936
- } else {
13937
- normalNodes.push(newNode);
13902
+ break forChangeRecords;
13903
+ }
13904
+ if (new RegExp(`${core.NODE_CONDS_KEY}.(\\d)+.cond`).test(record.propPath) || new RegExp(`${core.NODE_CONDS_KEY}.(\\d)+.cond.(\\d)+.value`).test(record.propPath) || record.propPath === core.NODE_CONDS_KEY || utils.isValueIncludeDataSource(record.value)) {
13905
+ needRecollectNodes.push(newNode);
13906
+ break forChangeRecords;
13907
+ }
13908
+ for (const target of Object.values(depService.getTargets(core.DepTargetType.DATA_SOURCE))) {
13909
+ if (!target.deps[newNode.id]) {
13910
+ continue;
13911
+ }
13912
+ if (target.deps[newNode.id].keys.includes(record.propPath)) {
13913
+ needRecollectNodes.push(newNode);
13914
+ break forChangeRecords;
13915
+ }
13938
13916
  }
13917
+ normalNodes.push(newNode);
13939
13918
  }
13940
13919
  } else if (isIncludeDataSource(newNode, oldNode)) {
13941
13920
  needRecollectNodes.push(newNode);
13942
13921
  } else {
13943
13922
  normalNodes.push(newNode);
13944
13923
  }
13945
- });
13924
+ }
13946
13925
  if (needRecollectNodes.length) {
13947
- collectIdle(needRecollectNodes, true).then(() => {
13948
- afterUpdateNodes(needRecollectNodes);
13949
- });
13950
- } else if (normalNodes.length) {
13951
- afterUpdateNodes(normalNodes);
13926
+ await collectIdle(needRecollectNodes, true, core.DepTargetType.DATA_SOURCE);
13927
+ await collectIdle(needRecollectNodes, true, core.DepTargetType.DATA_SOURCE_COND);
13928
+ updateStageNodes(needRecollectNodes);
13929
+ } else {
13930
+ updateStageNodes(normalNodes);
13931
+ Promise.all([
13932
+ collectIdle(normalNodes, true, core.DepTargetType.CODE_BLOCK),
13933
+ collectIdle(normalNodes, true, core.DepTargetType.DATA_SOURCE_METHOD)
13934
+ ]);
13952
13935
  }
13953
13936
  };
13954
13937
  const nodeRemoveHandler = (nodes) => {
13955
13938
  depService.clear(nodes);
13956
13939
  };
13957
- const historyChangeHandler = (page) => {
13958
- collectIdle([page], true).then(() => {
13959
- updateDataSourceSchema([page], true);
13960
- });
13940
+ const historyChangeHandler = async (page) => {
13941
+ await collectIdle([page], true);
13942
+ updateStageNode(page);
13961
13943
  };
13962
13944
  editorService.on("history-change", historyChangeHandler);
13963
13945
  editorService.on("root-change", rootChangeHandler);
13964
13946
  editorService.on("add", nodeAddHandler);
13965
13947
  editorService.on("remove", nodeRemoveHandler);
13966
13948
  editorService.on("update", nodeUpdateHandler);
13967
- const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
13968
- if (depService.hasTarget(id, core.DepTargetType.CODE_BLOCK)) {
13969
- depService.getTarget(id, core.DepTargetType.CODE_BLOCK).name = codeBlock.name;
13970
- return;
13971
- }
13972
- depService.addTarget(core.createCodeBlockTarget(id, codeBlock));
13973
- };
13974
- const codeBlockRemoveHandler = (id) => {
13975
- depService.removeTarget(id, core.DepTargetType.CODE_BLOCK);
13976
- };
13977
- codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
13978
- codeBlockService.on("remove", codeBlockRemoveHandler);
13979
- const dataSourceAddHandler = (config) => {
13949
+ const dataSourceAddHandler = async (config) => {
13980
13950
  initDataSourceDepTarget(config);
13981
- getApp()?.dataSourceManager?.addDataSource(config);
13951
+ const app = await getTMagicApp();
13952
+ app?.dataSourceManager?.addDataSource(config);
13982
13953
  };
13983
- const dataSourceUpdateHandler = (config, { changeRecords }) => {
13954
+ const dataSourceUpdateHandler = async (config, { changeRecords }) => {
13984
13955
  let needRecollectDep = false;
13956
+ let isModifyField = false;
13957
+ let isModifyMock = false;
13958
+ let isModifyMethod = false;
13985
13959
  for (const changeRecord of changeRecords) {
13986
13960
  if (!changeRecord.propPath) {
13987
13961
  continue;
13988
13962
  }
13989
- needRecollectDep = changeRecord.propPath === "fields" || changeRecord.propPath === "methods" || /fields.(\d)+.name/.test(changeRecord.propPath) || /fields.(\d)+$/.test(changeRecord.propPath) || /methods.(\d)+.name/.test(changeRecord.propPath) || /methods.(\d)+$/.test(changeRecord.propPath);
13963
+ isModifyField = changeRecord.propPath === "fields" || /fields.(\d)+.name/.test(changeRecord.propPath) || /fields.(\d)+$/.test(changeRecord.propPath);
13964
+ isModifyMock = changeRecord.propPath === "mocks";
13965
+ isModifyMethod = changeRecord.propPath === "methods" || /methods.(\d)+.name/.test(changeRecord.propPath) || /methods.(\d)+$/.test(changeRecord.propPath);
13966
+ needRecollectDep = isModifyField || isModifyMock || isModifyMethod;
13990
13967
  if (needRecollectDep) {
13991
13968
  break;
13992
13969
  }
@@ -13997,12 +13974,25 @@
13997
13974
  depService.clearIdleTasks();
13998
13975
  removeDataSourceTarget(config.id);
13999
13976
  initDataSourceDepTarget(config);
14000
- collectIdle(root.items, true).then(() => {
14001
- updateDataSourceSchema(root?.items || [], true);
13977
+ let collectIdlePromises = [];
13978
+ if (isModifyField) {
13979
+ collectIdlePromises = [
13980
+ collectIdle(root.items, true, core.DepTargetType.DATA_SOURCE),
13981
+ collectIdle(root.items, true, core.DepTargetType.DATA_SOURCE_COND)
13982
+ ];
13983
+ } else if (isModifyMock) {
13984
+ collectIdlePromises = [collectIdle(root.items, true, core.DepTargetType.DATA_SOURCE)];
13985
+ } else if (isModifyMethod) {
13986
+ collectIdlePromises = [collectIdle(root.items, true, core.DepTargetType.DATA_SOURCE_METHOD)];
13987
+ }
13988
+ Promise.all(collectIdlePromises).then(() => {
13989
+ updateDataSourceSchema();
13990
+ updateStageNodes(root.items);
14002
13991
  });
14003
13992
  }
14004
13993
  } else if (root?.dataSources) {
14005
- getApp()?.dataSourceManager?.updateSchema(root.dataSources);
13994
+ const app = await getTMagicApp();
13995
+ app?.dataSourceManager?.updateSchema(root.dataSources);
14006
13996
  }
14007
13997
  };
14008
13998
  const removeDataSourceTarget = (id) => {
@@ -14014,18 +14004,64 @@
14014
14004
  const root = editorService.get("root");
14015
14005
  const nodeIds = Object.keys(root?.dataSourceDeps?.[id] || {});
14016
14006
  const nodes = utils.getNodes(nodeIds, root?.items);
14017
- collectIdle(nodes, false).then(() => {
14018
- updateDataSourceSchema(nodes, false);
14007
+ Promise.all([
14008
+ collectIdle(nodes, false, core.DepTargetType.DATA_SOURCE),
14009
+ collectIdle(nodes, false, core.DepTargetType.DATA_SOURCE_COND),
14010
+ collectIdle(nodes, false, core.DepTargetType.DATA_SOURCE_METHOD)
14011
+ ]).then(() => {
14012
+ updateDataSourceSchema();
14013
+ updateStageNodes(nodes);
14019
14014
  });
14020
14015
  removeDataSourceTarget(id);
14021
14016
  };
14022
14017
  dataSourceService.on("add", dataSourceAddHandler);
14023
14018
  dataSourceService.on("update", dataSourceUpdateHandler);
14024
14019
  dataSourceService.on("remove", dataSourceRemoveHandler);
14020
+ const codeBlockAddOrUpdateHandler = (id, codeBlock) => {
14021
+ if (depService.hasTarget(id, core.DepTargetType.CODE_BLOCK)) {
14022
+ depService.getTarget(id, core.DepTargetType.CODE_BLOCK).name = codeBlock.name;
14023
+ return;
14024
+ }
14025
+ depService.addTarget(core.createCodeBlockTarget(id, codeBlock));
14026
+ };
14027
+ const codeBlockRemoveHandler = (id) => {
14028
+ depService.removeTarget(id, core.DepTargetType.CODE_BLOCK);
14029
+ };
14030
+ codeBlockService.on("addOrUpdate", codeBlockAddOrUpdateHandler);
14031
+ codeBlockService.on("remove", codeBlockRemoveHandler);
14032
+ const targetAddHandler = (target) => {
14033
+ const root = editorService.get("root");
14034
+ if (!root) return;
14035
+ if (target.type === core.DepTargetType.DATA_SOURCE) {
14036
+ if (!root.dataSourceDeps) {
14037
+ root.dataSourceDeps = {};
14038
+ }
14039
+ root.dataSourceDeps[target.id] = target.deps;
14040
+ }
14041
+ if (target.type === core.DepTargetType.DATA_SOURCE_COND) {
14042
+ if (!root.dataSourceCondDeps) {
14043
+ root.dataSourceCondDeps = {};
14044
+ }
14045
+ root.dataSourceCondDeps[target.id] = target.deps;
14046
+ }
14047
+ };
14048
+ const targetRemoveHandler = (id) => {
14049
+ const root = editorService.get("root");
14050
+ if (!root) return;
14051
+ if (root.dataSourceDeps) {
14052
+ delete root.dataSourceDeps[id];
14053
+ }
14054
+ if (root.dataSourceCondDeps) {
14055
+ delete root.dataSourceCondDeps[id];
14056
+ }
14057
+ };
14058
+ depService.on("add-target", targetAddHandler);
14059
+ depService.on("remove-target", targetRemoveHandler);
14060
+ depService.on("ds-collected", dsDepCollectedHandler);
14025
14061
  vue.onBeforeUnmount(() => {
14026
14062
  depService.off("add-target", targetAddHandler);
14027
14063
  depService.off("remove-target", targetRemoveHandler);
14028
- depService.off("collected", depCollectedHandler);
14064
+ depService.off("ds-collected", dsDepCollectedHandler);
14029
14065
  editorService.off("history-change", historyChangeHandler);
14030
14066
  editorService.off("root-change", rootChangeHandler);
14031
14067
  editorService.off("add", nodeAddHandler);