@tmagic/editor 1.3.0-alpha.22 → 1.3.0-alpha.24

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.
@@ -2301,12 +2301,14 @@ let Editor$1 = class Editor extends BaseService {
2301
2301
  const doc = stage?.renderer.contentWindow?.document;
2302
2302
  if (doc) {
2303
2303
  const el = doc.getElementById(`${node.id}`);
2304
- const parentEl = el?.offsetParent;
2304
+ const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
2305
2305
  if (parentEl && el) {
2306
2306
  node.style.left = (parentEl.clientWidth - el.clientWidth) / 2;
2307
+ node.style.right = "";
2307
2308
  }
2308
2309
  } else if (parent.style && isNumber(parent.style?.width) && isNumber(node.style?.width)) {
2309
2310
  node.style.left = (parent.style.width - node.style.width) / 2;
2311
+ node.style.right = "";
2310
2312
  }
2311
2313
  return node;
2312
2314
  }
@@ -2418,21 +2420,43 @@ let Editor$1 = class Editor extends BaseService {
2418
2420
  if (!node || isPage(node))
2419
2421
  return;
2420
2422
  const { style, id, type } = node;
2421
- if (!style || style.position !== "absolute")
2423
+ if (!style || !["absolute", "fixed"].includes(style.position))
2422
2424
  return;
2423
- if (top && !isNumber(style.top))
2424
- return;
2425
- if (left && !isNumber(style.left))
2426
- return;
2427
- this.update({
2425
+ const update = (style2) => this.update({
2428
2426
  id,
2429
2427
  type,
2430
- style: {
2431
- ...style,
2432
- left: Number(style.left) + left,
2433
- top: Number(style.top) + top
2434
- }
2428
+ style: style2
2435
2429
  });
2430
+ if (top) {
2431
+ if (isNumber(style.top)) {
2432
+ update({
2433
+ ...style,
2434
+ top: Number(style.top) + Number(top),
2435
+ bottom: ""
2436
+ });
2437
+ } else if (isNumber(style.bottom)) {
2438
+ update({
2439
+ ...style,
2440
+ bottom: Number(style.bottom) - Number(top),
2441
+ top: ""
2442
+ });
2443
+ }
2444
+ }
2445
+ if (left) {
2446
+ if (isNumber(style.left)) {
2447
+ update({
2448
+ ...style,
2449
+ left: Number(style.left) + Number(left),
2450
+ right: ""
2451
+ });
2452
+ } else if (isNumber(style.right)) {
2453
+ update({
2454
+ ...style,
2455
+ right: Number(style.right) - Number(left),
2456
+ left: ""
2457
+ });
2458
+ }
2459
+ }
2436
2460
  }
2437
2461
  resetState() {
2438
2462
  this.set("root", null);
@@ -2743,7 +2767,7 @@ const useCodeBlockEdit = (codeBlockService) => {
2743
2767
  };
2744
2768
 
2745
2769
  const _hoisted_1$p = { class: "m-fields-code-select-col" };
2746
- const _hoisted_2$h = { class: "code-select-container" };
2770
+ const _hoisted_2$i = { class: "code-select-container" };
2747
2771
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
2748
2772
  ...{
2749
2773
  name: "MEditorCodeSelectCol"
@@ -2778,6 +2802,14 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2778
2802
  };
2779
2803
  const codeDsl = computed(() => services?.codeBlockService.getCodeDsl());
2780
2804
  const paramsConfig = ref(getParamItemsConfig(props.model[props.name]));
2805
+ watch(
2806
+ () => props.model[props.name],
2807
+ (v, preV) => {
2808
+ if (v !== preV) {
2809
+ paramsConfig.value = getParamItemsConfig(v);
2810
+ }
2811
+ }
2812
+ );
2781
2813
  const selectConfig = {
2782
2814
  type: "select",
2783
2815
  text: "代码块",
@@ -2811,7 +2843,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2811
2843
  return (_ctx, _cache) => {
2812
2844
  const _component_m_form_container = resolveComponent("m-form-container");
2813
2845
  return openBlock(), createElementBlock("div", _hoisted_1$p, [
2814
- createElementVNode("div", _hoisted_2$h, [
2846
+ createElementVNode("div", _hoisted_2$i, [
2815
2847
  createVNode(_component_m_form_container, {
2816
2848
  class: "select",
2817
2849
  config: selectConfig,
@@ -2847,7 +2879,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
2847
2879
  });
2848
2880
 
2849
2881
  const _hoisted_1$o = { class: "m-editor-data-source-fields" };
2850
- const _hoisted_2$g = { class: "m-editor-data-source-fields-footer" };
2882
+ const _hoisted_2$h = { class: "m-editor-data-source-fields-footer" };
2851
2883
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
2852
2884
  ...{
2853
2885
  name: "MEditorDataSourceFields"
@@ -3004,7 +3036,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
3004
3036
  data: _ctx.model[_ctx.name],
3005
3037
  columns: fieldColumns
3006
3038
  }, null, 8, ["data"]),
3007
- createElementVNode("div", _hoisted_2$g, [
3039
+ createElementVNode("div", _hoisted_2$h, [
3008
3040
  createVNode(unref(TMagicButton), {
3009
3041
  size: "small",
3010
3042
  type: "primary",
@@ -3083,8 +3115,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
3083
3115
  });
3084
3116
 
3085
3117
  const _hoisted_1$n = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
3086
- const _hoisted_2$f = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
3087
- const _hoisted_3$5 = { class: "el-input__inner" };
3118
+ const _hoisted_2$g = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
3119
+ const _hoisted_3$6 = { class: "el-input__inner" };
3088
3120
  const _sfc_main$B = /* @__PURE__ */ defineComponent({
3089
3121
  ...{
3090
3122
  name: "MEditorDataSourceInput"
@@ -3279,7 +3311,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3279
3311
  default: withCtx(({ item }) => [
3280
3312
  createElementVNode("div", _hoisted_1$n, [
3281
3313
  createElementVNode("div", null, toDisplayString(item.text), 1),
3282
- createElementVNode("span", _hoisted_2$f, toDisplayString(item.value), 1)
3314
+ createElementVNode("span", _hoisted_2$g, toDisplayString(item.value), 1)
3283
3315
  ])
3284
3316
  ]),
3285
3317
  _: 1
@@ -3291,7 +3323,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
3291
3323
  createElementVNode("div", {
3292
3324
  class: normalizeClass(`tmagic-data-source-input-text-wrapper el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
3293
3325
  }, [
3294
- createElementVNode("div", _hoisted_3$5, [
3326
+ createElementVNode("div", _hoisted_3$6, [
3295
3327
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
3296
3328
  return openBlock(), createElementBlock(Fragment, null, [
3297
3329
  item.type === "text" ? (openBlock(), createElementBlock("span", {
@@ -3393,7 +3425,7 @@ const useDataSourceMethod = () => {
3393
3425
  };
3394
3426
 
3395
3427
  const _hoisted_1$m = { class: "m-editor-data-source-methods" };
3396
- const _hoisted_2$e = { class: "m-editor-data-source-methods-footer" };
3428
+ const _hoisted_2$f = { class: "m-editor-data-source-methods-footer" };
3397
3429
  const _sfc_main$A = /* @__PURE__ */ defineComponent({
3398
3430
  ...{
3399
3431
  name: "MEditorDataSourceMethods"
@@ -3468,7 +3500,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3468
3500
  data: _ctx.model[_ctx.name],
3469
3501
  columns: methodColumns
3470
3502
  }, null, 8, ["data"]),
3471
- createElementVNode("div", _hoisted_2$e, [
3503
+ createElementVNode("div", _hoisted_2$f, [
3472
3504
  createVNode(unref(TMagicButton), {
3473
3505
  size: "small",
3474
3506
  type: "primary",
@@ -3497,7 +3529,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
3497
3529
  });
3498
3530
 
3499
3531
  const _hoisted_1$l = { class: "m-fields-data-source-method-select" };
3500
- const _hoisted_2$d = { class: "data-source-method-select-container" };
3532
+ const _hoisted_2$e = { class: "data-source-method-select-container" };
3501
3533
  const _sfc_main$z = /* @__PURE__ */ defineComponent({
3502
3534
  ...{
3503
3535
  name: "MEditorDataSourceMethodSelect"
@@ -3577,7 +3609,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3577
3609
  return (_ctx, _cache) => {
3578
3610
  const _component_m_form_container = resolveComponent("m-form-container");
3579
3611
  return openBlock(), createElementBlock("div", _hoisted_1$l, [
3580
- createElementVNode("div", _hoisted_2$d, [
3612
+ createElementVNode("div", _hoisted_2$e, [
3581
3613
  createVNode(_component_m_form_container, {
3582
3614
  class: "select",
3583
3615
  config: cascaderConfig,
@@ -3669,7 +3701,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3669
3701
  });
3670
3702
 
3671
3703
  const _hoisted_1$k = { class: "m-fields-event-select" };
3672
- const _hoisted_2$c = {
3704
+ const _hoisted_2$d = {
3673
3705
  key: 1,
3674
3706
  class: "fullWidth"
3675
3707
  };
@@ -3873,7 +3905,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3873
3905
  model: _ctx.model,
3874
3906
  config: tableConfig.value,
3875
3907
  onChange: onChangeHandler
3876
- }, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$c, [
3908
+ }, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$d, [
3877
3909
  createVNode(unref(TMagicButton), {
3878
3910
  class: "create-button",
3879
3911
  type: "primary",
@@ -3923,7 +3955,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
3923
3955
  });
3924
3956
 
3925
3957
  const _hoisted_1$j = { class: "m-fields-key-value" };
3926
- const _hoisted_2$b = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
3958
+ const _hoisted_2$c = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
3927
3959
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
3928
3960
  ...{
3929
3961
  name: "MEditorKeyValue"
@@ -3983,7 +4015,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
3983
4015
  size: _ctx.size,
3984
4016
  onChange: keyChangeHandler
3985
4017
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
3986
- _hoisted_2$b,
4018
+ _hoisted_2$c,
3987
4019
  createVNode(unref(TMagicInput), {
3988
4020
  placeholder: "value",
3989
4021
  modelValue: records.value[index][1],
@@ -4362,8 +4394,8 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
4362
4394
  });
4363
4395
 
4364
4396
  const _hoisted_1$h = { class: "m-editor-empty-panel" };
4365
- const _hoisted_2$a = { class: "m-editor-empty-content" };
4366
- const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
4397
+ const _hoisted_2$b = { class: "m-editor-empty-content" };
4398
+ const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
4367
4399
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
4368
4400
  ...{
4369
4401
  name: "MEditorAddPageBox"
@@ -4385,7 +4417,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4385
4417
  };
4386
4418
  return (_ctx, _cache) => {
4387
4419
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
4388
- createElementVNode("div", _hoisted_2$a, [
4420
+ createElementVNode("div", _hoisted_2$b, [
4389
4421
  createElementVNode("div", {
4390
4422
  class: "m-editor-empty-button",
4391
4423
  onClick: clickHandler
@@ -4393,7 +4425,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4393
4425
  createElementVNode("div", null, [
4394
4426
  createVNode(_sfc_main$F, { icon: unref(Plus) }, null, 8, ["icon"])
4395
4427
  ]),
4396
- _hoisted_3$4
4428
+ _hoisted_3$5
4397
4429
  ])
4398
4430
  ])
4399
4431
  ]);
@@ -4536,7 +4568,7 @@ const _hoisted_1$g = {
4536
4568
  key: 1,
4537
4569
  class: "menu-item-text"
4538
4570
  };
4539
- const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
4571
+ const _hoisted_2$a = { class: "el-dropdown-link menubar-menu-button" };
4540
4572
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
4541
4573
  ...{
4542
4574
  name: "MEditorToolButton"
@@ -4680,7 +4712,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
4680
4712
  })) : createCommentVNode("", true)
4681
4713
  ]),
4682
4714
  default: withCtx(() => [
4683
- createElementVNode("span", _hoisted_2$9, [
4715
+ createElementVNode("span", _hoisted_2$a, [
4684
4716
  createTextVNode(toDisplayString(_ctx.data.text), 1),
4685
4717
  createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
4686
4718
  default: withCtx(() => [
@@ -4981,7 +5013,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
4981
5013
  });
4982
5014
 
4983
5015
  const _hoisted_1$e = { xmlns: "http://www.w3.org/2000/svg" };
4984
- const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("g", {
5016
+ const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("g", {
4985
5017
  fill: "#7C878E",
4986
5018
  "fill-rule": "evenodd"
4987
5019
  }, [
@@ -4991,8 +5023,8 @@ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("g", {
4991
5023
  }),
4992
5024
  /* @__PURE__ */ createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
4993
5025
  ], -1);
4994
- const _hoisted_3$3 = [
4995
- _hoisted_2$8
5026
+ const _hoisted_3$4 = [
5027
+ _hoisted_2$9
4996
5028
  ];
4997
5029
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
4998
5030
  ...{
@@ -5001,7 +5033,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
5001
5033
  __name: "AppManageIcon",
5002
5034
  setup(__props) {
5003
5035
  return (_ctx, _cache) => {
5004
- return openBlock(), createElementBlock("svg", _hoisted_1$e, _hoisted_3$3);
5036
+ return openBlock(), createElementBlock("svg", _hoisted_1$e, _hoisted_3$4);
5005
5037
  };
5006
5038
  }
5007
5039
  });
@@ -5012,9 +5044,9 @@ const _hoisted_1$d = {
5012
5044
  xmlns: "http://www.w3.org/2000/svg",
5013
5045
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
5014
5046
  };
5015
- const _hoisted_2$7 = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
5016
- const _hoisted_4$1 = [
5017
- _hoisted_2$7
5047
+ const _hoisted_2$8 = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
5048
+ const _hoisted_4$2 = [
5049
+ _hoisted_2$8
5018
5050
  ];
5019
5051
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
5020
5052
  ...{
@@ -5023,14 +5055,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
5023
5055
  __name: "CodeIcon",
5024
5056
  setup(__props) {
5025
5057
  return (_ctx, _cache) => {
5026
- return openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_4$1);
5058
+ return openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_4$2);
5027
5059
  };
5028
5060
  }
5029
5061
  });
5030
5062
 
5031
5063
  const _hoisted_1$c = ["id"];
5032
- const _hoisted_2$6 = { class: "list-item" };
5033
- const _hoisted_3$2 = {
5064
+ const _hoisted_2$7 = { class: "list-item" };
5065
+ const _hoisted_3$3 = {
5034
5066
  key: 2,
5035
5067
  class: "right-tool"
5036
5068
  };
@@ -5135,7 +5167,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5135
5167
  id: data.id,
5136
5168
  class: "list-container"
5137
5169
  }, [
5138
- createElementVNode("div", _hoisted_2$6, [
5170
+ createElementVNode("div", _hoisted_2$7, [
5139
5171
  data.type === "code" ? (openBlock(), createBlock(_sfc_main$l, {
5140
5172
  key: 0,
5141
5173
  class: "codeIcon"
@@ -5147,7 +5179,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5147
5179
  createElementVNode("span", {
5148
5180
  class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
5149
5181
  }, toDisplayString(data.name) + " (" + toDisplayString(data.id) + ")", 3),
5150
- data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
5182
+ data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
5151
5183
  createVNode(unref(TMagicTooltip), {
5152
5184
  effect: "dark",
5153
5185
  content: editable.value ? "编辑" : "查看",
@@ -5331,8 +5363,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
5331
5363
  });
5332
5364
 
5333
5365
  const _hoisted_1$a = ["id"];
5334
- const _hoisted_2$5 = { class: "list-item" };
5335
- const _hoisted_3$1 = {
5366
+ const _hoisted_2$6 = { class: "list-item" };
5367
+ const _hoisted_3$2 = {
5336
5368
  key: 2,
5337
5369
  class: "right-tool"
5338
5370
  };
@@ -5431,7 +5463,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5431
5463
  id: data.id,
5432
5464
  class: "list-container"
5433
5465
  }, [
5434
- createElementVNode("div", _hoisted_2$5, [
5466
+ createElementVNode("div", _hoisted_2$6, [
5435
5467
  data.type === "code" ? (openBlock(), createBlock(_sfc_main$F, {
5436
5468
  key: 0,
5437
5469
  class: "codeIcon",
@@ -5445,7 +5477,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5445
5477
  createElementVNode("span", {
5446
5478
  class: normalizeClass(["name", { code: data.type === "ds", hook: data.type === "key" }])
5447
5479
  }, toDisplayString(data.type === "key" ? data.name : `${data.name}(${data.id})`), 3),
5448
- data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
5480
+ data.type === "ds" ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
5449
5481
  createVNode(unref(TMagicTooltip), {
5450
5482
  effect: "dark",
5451
5483
  content: editable.value ? "编辑" : "查看",
@@ -5490,7 +5522,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5490
5522
  });
5491
5523
 
5492
5524
  const _hoisted_1$9 = { class: "search-wrapper" };
5493
- const _hoisted_2$4 = { class: "data-source-list-panel-add-menu" };
5525
+ const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
5494
5526
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
5495
5527
  ...{
5496
5528
  name: "MEditorDataSourceListPanel"
@@ -5563,7 +5595,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
5563
5595
  })
5564
5596
  ]),
5565
5597
  default: withCtx(() => [
5566
- createElementVNode("div", _hoisted_2$4, [
5598
+ createElementVNode("div", _hoisted_2$5, [
5567
5599
  (openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
5568
5600
  return openBlock(), createBlock(_sfc_main$q, {
5569
5601
  data: {
@@ -5601,7 +5633,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
5601
5633
  });
5602
5634
 
5603
5635
  const _hoisted_1$8 = ["onClick", "onDragstart"];
5604
- const _hoisted_2$3 = ["title"];
5636
+ const _hoisted_2$4 = ["title"];
5605
5637
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
5606
5638
  ...{
5607
5639
  name: "MEditorComponentListPanel"
@@ -5710,7 +5742,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
5710
5742
  }, null, 8, ["title", "icon"]),
5711
5743
  createElementVNode("span", {
5712
5744
  title: item.text
5713
- }, toDisplayString(item.text), 9, _hoisted_2$3)
5745
+ }, toDisplayString(item.text), 9, _hoisted_2$4)
5714
5746
  ])
5715
5747
  ], 40, _hoisted_1$8);
5716
5748
  }), 128))
@@ -6378,6 +6410,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
6378
6410
  });
6379
6411
 
6380
6412
  const _hoisted_1$5 = {
6413
+ key: 0,
6414
+ class: "m-editor-sidebar"
6415
+ };
6416
+ const _hoisted_2$3 = { class: "m-editor-sidebar-header" };
6417
+ const _hoisted_3$1 = ["onClick"];
6418
+ const _hoisted_4$1 = {
6381
6419
  key: 1,
6382
6420
  class: "magic-editor-tab-panel-title"
6383
6421
  };
@@ -6392,8 +6430,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
6392
6430
  },
6393
6431
  setup(__props, { expose: __expose }) {
6394
6432
  const props = __props;
6395
- const tabPaneComponent = getConfig$1("components")?.tabPane;
6396
- const tabsComponent = getConfig$1("components")?.tabs;
6397
6433
  const activeTabName = ref(props.data?.status);
6398
6434
  const getItemConfig = (data) => {
6399
6435
  const map = {
@@ -6446,98 +6482,94 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
6446
6482
  activeTabName
6447
6483
  });
6448
6484
  return (_ctx, _cache) => {
6449
- return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabsComponent)?.component || "el-tabs"), mergeProps({
6450
- key: 0,
6451
- modelValue: activeTabName.value,
6452
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
6453
- class: "m-editor-sidebar tmagic-design-tabs"
6454
- }, unref(tabsComponent)?.props({ type: "card", tabPosition: "left" }) || {}), {
6455
- default: withCtx(() => [
6485
+ return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
6486
+ createElementVNode("div", _hoisted_2$3, [
6456
6487
  (openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
6457
- return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps(unref(tabPaneComponent)?.props({ name: config.text, lazy: config.lazy }) || {}, {
6458
- key: config.$key || index
6459
- }), {
6460
- label: withCtx(() => [
6461
- (openBlock(), createElementBlock("div", {
6462
- key: config.text
6463
- }, [
6464
- config.icon ? (openBlock(), createBlock(_sfc_main$F, {
6465
- key: 0,
6466
- icon: config.icon
6467
- }, null, 8, ["icon"])) : createCommentVNode("", true),
6468
- config.text ? (openBlock(), createElementBlock("div", _hoisted_1$5, toDisplayString(config.text), 1)) : createCommentVNode("", true)
6469
- ]))
6470
- ]),
6471
- default: withCtx(() => [
6472
- config ? (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({ key: 0 }, config.props || {}, toHandlers(config?.listeners || {})), createSlots({ _: 2 }, [
6473
- config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
6474
- name: "component-list-panel-header",
6475
- fn: withCtx(() => [
6476
- config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
6477
- ]),
6478
- key: "0"
6479
- } : void 0,
6480
- config.$key === "component-list" || config.slots?.componentListItem ? {
6481
- name: "component-list-item",
6482
- fn: withCtx(({ component }) => [
6483
- config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-item", {
6484
- key: 0,
6485
- component
6486
- }) : config.slots?.componentListItem ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListItem), {
6487
- key: 1,
6488
- component
6489
- }, null, 8, ["component"])) : createCommentVNode("", true)
6490
- ]),
6491
- key: "1"
6492
- } : void 0,
6493
- config.$key === "layer" || config.slots?.layerPanelHeader ? {
6494
- name: "layer-panel-header",
6495
- fn: withCtx(() => [
6496
- config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
6497
- ]),
6498
- key: "2"
6499
- } : void 0,
6500
- config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
6501
- name: "code-block-panel-header",
6502
- fn: withCtx(() => [
6503
- config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
6504
- ]),
6505
- key: "3"
6506
- } : void 0,
6507
- config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
6508
- name: "code-block-panel-tool",
6509
- fn: withCtx(({ id, data }) => [
6510
- config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-tool", {
6511
- key: 0,
6512
- id,
6513
- data
6514
- }) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
6515
- ]),
6516
- key: "4"
6517
- } : void 0,
6518
- config.$key === "layer" || config.slots?.layerNodeContent ? {
6519
- name: "layer-node-content",
6520
- fn: withCtx(({ data: nodeData, node }) => [
6521
- config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-node-content", {
6522
- key: 0,
6523
- data: nodeData,
6524
- node
6525
- }) : config.slots?.layerNodeContent ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerNodeContent), {
6526
- key: 1,
6527
- data: nodeData,
6528
- node
6529
- }, null, 8, ["data", "node"])) : createCommentVNode("", true)
6530
- ]),
6531
- key: "5"
6532
- } : void 0
6533
- ]), 1040)) : createCommentVNode("", true)
6534
- ]),
6535
- _: 2
6536
- }, 1040);
6488
+ return openBlock(), createElementBlock("div", {
6489
+ class: normalizeClass(["m-editor-sidebar-header-item", { "is-active": activeTabName.value === config.text }]),
6490
+ key: config.$key ?? index,
6491
+ onClick: ($event) => activeTabName.value = config.text || `${index}`
6492
+ }, [
6493
+ config.icon ? (openBlock(), createBlock(_sfc_main$F, {
6494
+ key: 0,
6495
+ icon: config.icon
6496
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
6497
+ config.text ? (openBlock(), createElementBlock("div", _hoisted_4$1, toDisplayString(config.text), 1)) : createCommentVNode("", true)
6498
+ ], 10, _hoisted_3$1);
6537
6499
  }), 128))
6538
6500
  ]),
6539
- _: 3
6540
- }, 16, ["modelValue"])) : createCommentVNode("", true);
6501
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
6502
+ return withDirectives((openBlock(), createElementBlock("div", {
6503
+ class: "m-editor-sidebar-content",
6504
+ key: config.$key ?? index
6505
+ }, [
6506
+ config ? (openBlock(), createBlock(resolveDynamicComponent(config.component), mergeProps({ key: 0 }, config.props || {}, toHandlers(config?.listeners || {})), createSlots({ _: 2 }, [
6507
+ config.$key === "component-list" || config.slots?.componentListPanelHeader ? {
6508
+ name: "component-list-panel-header",
6509
+ fn: withCtx(() => [
6510
+ config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
6511
+ ]),
6512
+ key: "0"
6513
+ } : void 0,
6514
+ config.$key === "component-list" || config.slots?.componentListItem ? {
6515
+ name: "component-list-item",
6516
+ fn: withCtx(({ component }) => [
6517
+ config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-item", {
6518
+ key: 0,
6519
+ component
6520
+ }) : config.slots?.componentListItem ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListItem), {
6521
+ key: 1,
6522
+ component
6523
+ }, null, 8, ["component"])) : createCommentVNode("", true)
6524
+ ]),
6525
+ key: "1"
6526
+ } : void 0,
6527
+ config.$key === "layer" || config.slots?.layerPanelHeader ? {
6528
+ name: "layer-panel-header",
6529
+ fn: withCtx(() => [
6530
+ config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
6531
+ ]),
6532
+ key: "2"
6533
+ } : void 0,
6534
+ config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
6535
+ name: "code-block-panel-header",
6536
+ fn: withCtx(() => [
6537
+ config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
6538
+ ]),
6539
+ key: "3"
6540
+ } : void 0,
6541
+ config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
6542
+ name: "code-block-panel-tool",
6543
+ fn: withCtx(({ id, data }) => [
6544
+ config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-tool", {
6545
+ key: 0,
6546
+ id,
6547
+ data
6548
+ }) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
6549
+ ]),
6550
+ key: "4"
6551
+ } : void 0,
6552
+ config.$key === "layer" || config.slots?.layerNodeContent ? {
6553
+ name: "layer-node-content",
6554
+ fn: withCtx(({ data: nodeData, node }) => [
6555
+ config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-node-content", {
6556
+ key: 0,
6557
+ data: nodeData,
6558
+ node
6559
+ }) : config.slots?.layerNodeContent ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerNodeContent), {
6560
+ key: 1,
6561
+ data: nodeData,
6562
+ node
6563
+ }, null, 8, ["data", "node"])) : createCommentVNode("", true)
6564
+ ]),
6565
+ key: "5"
6566
+ } : void 0
6567
+ ]), 1040)) : createCommentVNode("", true)
6568
+ ])), [
6569
+ [vShow, activeTabName.value === config.text]
6570
+ ]);
6571
+ }), 128))
6572
+ ])) : createCommentVNode("", true);
6541
6573
  };
6542
6574
  }
6543
6575
  });