@tmagic/editor 1.5.0-beta.0 → 1.5.0-beta.1

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.
package/dist/style.css CHANGED
@@ -783,12 +783,16 @@
783
783
  height: 22px;
784
784
  margin-right: 5px;
785
785
  }
786
- .data-source-list-panel-add-menu .tmagic-design-button {
787
- width: 100%;
788
- text-align: left;
786
+ .data-source-list-panel-add-menu {
787
+ padding: 4px 0;
789
788
  }
790
- .data-source-list-panel-add-menu .tmagic-design-button span {
791
- width: 100%;
789
+ .data-source-list-panel-add-menu .menu-item {
790
+ cursor: pointer;
791
+ transition: all 0.2s ease 0s;
792
+ padding: 5px 14px;
793
+ }
794
+ .data-source-list-panel-add-menu .menu-item:hover {
795
+ background-color: #f3f5f9;
792
796
  }
793
797
  .m-editor-data-source-fields {
794
798
  width: 100%;
@@ -3230,7 +3230,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
3230
3230
  });
3231
3231
 
3232
3232
  const _hoisted_1$u = { class: "m-fields-code-select-col" };
3233
- const _hoisted_2$k = { class: "code-select-container" };
3233
+ const _hoisted_2$j = { class: "code-select-container" };
3234
3234
  const _sfc_main$S = /* @__PURE__ */ defineComponent({
3235
3235
  ...{
3236
3236
  name: "MFieldsCodeSelectCol"
@@ -3311,7 +3311,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
3311
3311
  };
3312
3312
  return (_ctx, _cache) => {
3313
3313
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
3314
- createElementVNode("div", _hoisted_2$k, [
3314
+ createElementVNode("div", _hoisted_2$j, [
3315
3315
  createVNode(unref(MContainer), {
3316
3316
  class: "select",
3317
3317
  config: selectConfig,
@@ -4061,6 +4061,68 @@ const useEditorContentHeight = () => {
4061
4061
  };
4062
4062
  };
4063
4063
 
4064
+ const useFilter = (nodeData, nodeStatusMap, filterNodeMethod) => {
4065
+ const filterIsMatch = (value, data) => {
4066
+ const string = !Array.isArray(value) ? [value] : value;
4067
+ if (!string.length) {
4068
+ return true;
4069
+ }
4070
+ return string.some((v) => filterNodeMethod(v, data));
4071
+ };
4072
+ const filter = (text) => {
4073
+ if (!nodeData.value.length) return;
4074
+ nodeData.value.forEach((node) => {
4075
+ traverseNode(node, (node2, parents) => {
4076
+ if (!nodeStatusMap.value) return;
4077
+ const visible = filterIsMatch(text, node2);
4078
+ if (visible && parents.length) {
4079
+ parents.forEach((parent) => {
4080
+ updateStatus(nodeStatusMap.value, parent.id, {
4081
+ visible,
4082
+ expand: true
4083
+ });
4084
+ });
4085
+ }
4086
+ updateStatus(nodeStatusMap.value, node2.id, {
4087
+ visible
4088
+ });
4089
+ });
4090
+ });
4091
+ };
4092
+ return {
4093
+ filterText: ref(""),
4094
+ filterTextChangeHandler(text) {
4095
+ filter(text);
4096
+ }
4097
+ };
4098
+ };
4099
+
4100
+ const useGetSo = (target, emit) => {
4101
+ let getso;
4102
+ const isDraging = ref(false);
4103
+ onMounted(() => {
4104
+ if (!target.value) return;
4105
+ getso = new Gesto(target.value, {
4106
+ container: window,
4107
+ pinchOutside: true
4108
+ }).on("drag", (e) => {
4109
+ if (!target.value) return;
4110
+ emit("change", e);
4111
+ }).on("dragStart", () => {
4112
+ isDraging.value = true;
4113
+ }).on("dragEnd", () => {
4114
+ isDraging.value = false;
4115
+ });
4116
+ });
4117
+ onBeforeUnmount(() => {
4118
+ getso?.unset();
4119
+ isDraging.value = false;
4120
+ });
4121
+ return {
4122
+ isDraging
4123
+ };
4124
+ };
4125
+
4064
4126
  const useNextFloatBoxPosition = (uiService, parent) => {
4065
4127
  const boxPosition = ref({
4066
4128
  left: 0,
@@ -4085,8 +4147,42 @@ const useNextFloatBoxPosition = (uiService, parent) => {
4085
4147
  };
4086
4148
  };
4087
4149
 
4150
+ const createPageNodeStatus$1 = (nodeData, initialLayerNodeStatus) => {
4151
+ const map = /* @__PURE__ */ new Map();
4152
+ nodeData.forEach(
4153
+ (node) => traverseNode(node, (node2) => {
4154
+ map.set(
4155
+ node2.id,
4156
+ initialLayerNodeStatus?.get(node2.id) || {
4157
+ visible: true,
4158
+ expand: false,
4159
+ selected: false,
4160
+ draggable: false
4161
+ }
4162
+ );
4163
+ })
4164
+ );
4165
+ return map;
4166
+ };
4167
+ const useNodeStatus$1 = (nodeData) => {
4168
+ const nodeStatusMap = ref(/* @__PURE__ */ new Map());
4169
+ watch(
4170
+ nodeData,
4171
+ (nodeData2) => {
4172
+ nodeStatusMap.value = createPageNodeStatus$1(nodeData2, nodeStatusMap.value);
4173
+ },
4174
+ {
4175
+ immediate: true,
4176
+ deep: true
4177
+ }
4178
+ );
4179
+ return {
4180
+ nodeStatusMap
4181
+ };
4182
+ };
4183
+
4088
4184
  const _hoisted_1$t = { class: "m-editor-data-source-fields" };
4089
- const _hoisted_2$j = { class: "m-editor-data-source-fields-footer" };
4185
+ const _hoisted_2$i = { class: "m-editor-data-source-fields-footer" };
4090
4186
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
4091
4187
  ...{
4092
4188
  name: "MFieldsDataSourceFields"
@@ -4343,7 +4439,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
4343
4439
  data: _ctx.model[_ctx.name],
4344
4440
  columns: fieldColumns
4345
4441
  }, null, 8, ["data"]),
4346
- createElementVNode("div", _hoisted_2$j, [
4442
+ createElementVNode("div", _hoisted_2$i, [
4347
4443
  createVNode(unref(TMagicButton), {
4348
4444
  size: "small",
4349
4445
  disabled: _ctx.disabled,
@@ -4731,7 +4827,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4731
4827
  });
4732
4828
 
4733
4829
  const _hoisted_1$q = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
4734
- const _hoisted_2$i = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
4830
+ const _hoisted_2$h = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
4735
4831
  const _hoisted_3$8 = { class: "el-input__inner t-input__inner" };
4736
4832
  const _sfc_main$M = /* @__PURE__ */ defineComponent({
4737
4833
  ...{
@@ -4938,7 +5034,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4938
5034
  default: withCtx(({ item }) => [
4939
5035
  createElementVNode("div", _hoisted_1$q, [
4940
5036
  createElementVNode("div", null, toDisplayString(item.text), 1),
4941
- createElementVNode("span", _hoisted_2$i, toDisplayString(item.value), 1)
5037
+ createElementVNode("span", _hoisted_2$h, toDisplayString(item.value), 1)
4942
5038
  ])
4943
5039
  ]),
4944
5040
  _: 1
@@ -4980,7 +5076,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4980
5076
  });
4981
5077
 
4982
5078
  const _hoisted_1$p = { style: { "display": "flex", "margin-bottom": "10px" } };
4983
- const _hoisted_2$h = { style: { "flex": "1" } };
5079
+ const _hoisted_2$g = { style: { "flex": "1" } };
4984
5080
  const _hoisted_3$7 = { style: { "flex": "1" } };
4985
5081
  const _hoisted_4$7 = { class: "dialog-footer" };
4986
5082
  const _sfc_main$L = /* @__PURE__ */ defineComponent({
@@ -5234,7 +5330,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
5234
5330
  ]),
5235
5331
  default: withCtx(() => [
5236
5332
  createElementVNode("div", _hoisted_1$p, [
5237
- createElementVNode("div", _hoisted_2$h, [
5333
+ createElementVNode("div", _hoisted_2$g, [
5238
5334
  createVNode(unref(TMagicTag), {
5239
5335
  size: "small",
5240
5336
  type: "info"
@@ -5277,7 +5373,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
5277
5373
  });
5278
5374
 
5279
5375
  const _hoisted_1$o = { class: "m-editor-data-source-methods" };
5280
- const _hoisted_2$g = { class: "m-editor-data-source-methods-footer" };
5376
+ const _hoisted_2$f = { class: "m-editor-data-source-methods-footer" };
5281
5377
  const _sfc_main$K = /* @__PURE__ */ defineComponent({
5282
5378
  ...{
5283
5379
  name: "MFieldsDataSourceMethods"
@@ -5353,7 +5449,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
5353
5449
  data: _ctx.model[_ctx.name],
5354
5450
  columns: methodColumns
5355
5451
  }, null, 8, ["data"]),
5356
- createElementVNode("div", _hoisted_2$g, [
5452
+ createElementVNode("div", _hoisted_2$f, [
5357
5453
  createVNode(unref(TMagicButton), {
5358
5454
  size: "small",
5359
5455
  type: "primary",
@@ -5383,7 +5479,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
5383
5479
  });
5384
5480
 
5385
5481
  const _hoisted_1$n = { class: "m-fields-data-source-method-select" };
5386
- const _hoisted_2$f = { class: "data-source-method-select-container" };
5482
+ const _hoisted_2$e = { class: "data-source-method-select-container" };
5387
5483
  const _sfc_main$J = /* @__PURE__ */ defineComponent({
5388
5484
  ...{
5389
5485
  name: "MFieldsDataSourceMethodSelect"
@@ -5471,7 +5567,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5471
5567
  };
5472
5568
  return (_ctx, _cache) => {
5473
5569
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
5474
- createElementVNode("div", _hoisted_2$f, [
5570
+ createElementVNode("div", _hoisted_2$e, [
5475
5571
  createVNode(unref(MContainer), {
5476
5572
  class: "select",
5477
5573
  config: cascaderConfig.value,
@@ -5515,7 +5611,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
5515
5611
  });
5516
5612
 
5517
5613
  const _hoisted_1$m = { class: "m-editor-data-source-fields" };
5518
- const _hoisted_2$e = { class: "m-editor-data-source-fields-footer" };
5614
+ const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
5519
5615
  const _sfc_main$I = /* @__PURE__ */ defineComponent({
5520
5616
  ...{
5521
5617
  name: "MFieldsDataSourceMocks"
@@ -5725,7 +5821,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5725
5821
  data: _ctx.model[_ctx.name],
5726
5822
  columns
5727
5823
  }, null, 8, ["data"]),
5728
- createElementVNode("div", _hoisted_2$e, [
5824
+ createElementVNode("div", _hoisted_2$d, [
5729
5825
  createVNode(unref(TMagicButton), {
5730
5826
  size: "small",
5731
5827
  type: "primary",
@@ -5990,7 +6086,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5990
6086
  });
5991
6087
 
5992
6088
  const _hoisted_1$k = { class: "m-fields-event-select" };
5993
- const _hoisted_2$d = {
6089
+ const _hoisted_2$c = {
5994
6090
  key: 1,
5995
6091
  class: "fullWidth"
5996
6092
  };
@@ -6278,7 +6374,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6278
6374
  model: _ctx.model,
6279
6375
  config: tableConfig.value,
6280
6376
  onChange: onChangeHandler
6281
- }, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$d, [
6377
+ }, null, 8, ["size", "disabled", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$c, [
6282
6378
  createVNode(unref(TMagicButton), {
6283
6379
  class: "create-button",
6284
6380
  type: "primary",
@@ -6334,9 +6430,9 @@ const _hoisted_1$j = {
6334
6430
  xmlns: "http://www.w3.org/2000/svg",
6335
6431
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
6336
6432
  };
6337
- const _hoisted_2$c = /* @__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);
6433
+ const _hoisted_2$b = /* @__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);
6338
6434
  const _hoisted_4$6 = [
6339
- _hoisted_2$c
6435
+ _hoisted_2$b
6340
6436
  ];
6341
6437
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
6342
6438
  ...{
@@ -6351,7 +6447,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6351
6447
  });
6352
6448
 
6353
6449
  const _hoisted_1$i = { class: "m-fields-key-value" };
6354
- const _hoisted_2$b = { key: 0 };
6450
+ const _hoisted_2$a = { key: 0 };
6355
6451
  const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
6356
6452
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
6357
6453
  ...{
@@ -6412,7 +6508,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6412
6508
  };
6413
6509
  return (_ctx, _cache) => {
6414
6510
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
6415
- !showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
6511
+ !showCode.value ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
6416
6512
  (openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
6417
6513
  return openBlock(), createElementBlock("div", {
6418
6514
  class: "m-fields-key-value-item",
@@ -6486,7 +6582,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6486
6582
  });
6487
6583
 
6488
6584
  const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
6489
- const _hoisted_2$a = { class: "page-fragment-select-container" };
6585
+ const _hoisted_2$9 = { class: "page-fragment-select-container" };
6490
6586
  const _sfc_main$C = /* @__PURE__ */ defineComponent({
6491
6587
  ...{
6492
6588
  name: "MFieldsPageFragmentSelect"
@@ -6534,7 +6630,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6534
6630
  return (_ctx, _cache) => {
6535
6631
  const _component_m_form_container = resolveComponent("m-form-container");
6536
6632
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
6537
- createElementVNode("div", _hoisted_2$a, [
6633
+ createElementVNode("div", _hoisted_2$9, [
6538
6634
  createVNode(_component_m_form_container, {
6539
6635
  class: "select",
6540
6636
  config: selectConfig,
@@ -6721,32 +6817,6 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
6721
6817
  }
6722
6818
  });
6723
6819
 
6724
- const useGetSo = (target, emit) => {
6725
- let getso;
6726
- const isDraging = ref(false);
6727
- onMounted(() => {
6728
- if (!target.value) return;
6729
- getso = new Gesto(target.value, {
6730
- container: window,
6731
- pinchOutside: true
6732
- }).on("drag", (e) => {
6733
- if (!target.value) return;
6734
- emit("change", e);
6735
- }).on("dragStart", () => {
6736
- isDraging.value = true;
6737
- }).on("dragEnd", () => {
6738
- isDraging.value = false;
6739
- });
6740
- });
6741
- onBeforeUnmount(() => {
6742
- getso?.unset();
6743
- isDraging.value = false;
6744
- });
6745
- return {
6746
- isDraging
6747
- };
6748
- };
6749
-
6750
6820
  const _sfc_main$A = /* @__PURE__ */ defineComponent({
6751
6821
  ...{
6752
6822
  name: "MEditorResizer"
@@ -6933,7 +7003,7 @@ const _hoisted_1$f = {
6933
7003
  key: 1,
6934
7004
  class: "menu-item-text"
6935
7005
  };
6936
- const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
7006
+ const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
6937
7007
  const _sfc_main$y = /* @__PURE__ */ defineComponent({
6938
7008
  ...{
6939
7009
  name: "MEditorToolButton"
@@ -7070,7 +7140,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7070
7140
  })) : createCommentVNode("", true)
7071
7141
  ]),
7072
7142
  default: withCtx(() => [
7073
- createElementVNode("span", _hoisted_2$9, [
7143
+ createElementVNode("span", _hoisted_2$8, [
7074
7144
  createTextVNode(toDisplayString(_ctx.data.text), 1),
7075
7145
  createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
7076
7146
  default: withCtx(() => [
@@ -7394,7 +7464,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
7394
7464
  });
7395
7465
 
7396
7466
  const _hoisted_1$c = { class: "m-editor-page-bar-tabs" };
7397
- const _hoisted_2$8 = ["page-id", "onClick"];
7467
+ const _hoisted_2$7 = ["page-id", "onClick"];
7398
7468
  const _hoisted_3$5 = { class: "m-editor-page-bar-title" };
7399
7469
  const _hoisted_4$5 = ["title"];
7400
7470
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
@@ -7548,7 +7618,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
7548
7618
  ]),
7549
7619
  _: 2
7550
7620
  }, 1024)
7551
- ], 10, _hoisted_2$8);
7621
+ ], 10, _hoisted_2$7);
7552
7622
  }), 128))
7553
7623
  ]),
7554
7624
  _: 3
@@ -7559,7 +7629,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
7559
7629
  });
7560
7630
 
7561
7631
  const _hoisted_1$b = { class: "m-editor-empty-panel" };
7562
- const _hoisted_2$7 = { class: "m-editor-empty-content" };
7632
+ const _hoisted_2$6 = { class: "m-editor-empty-content" };
7563
7633
  const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
7564
7634
  const _hoisted_4$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面片", -1);
7565
7635
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
@@ -7585,7 +7655,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
7585
7655
  };
7586
7656
  return (_ctx, _cache) => {
7587
7657
  return openBlock(), createElementBlock("div", _hoisted_1$b, [
7588
- createElementVNode("div", _hoisted_2$7, [
7658
+ createElementVNode("div", _hoisted_2$6, [
7589
7659
  createElementVNode("div", {
7590
7660
  class: "m-editor-empty-button",
7591
7661
  onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(unref(NodeType).PAGE))
@@ -8110,7 +8180,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8110
8180
  });
8111
8181
 
8112
8182
  const _hoisted_1$9 = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
8113
- const _hoisted_2$6 = { class: "tree-node-label" };
8183
+ const _hoisted_2$5 = { class: "tree-node-label" };
8114
8184
  const _hoisted_3$3 = { class: "tree-node-tool" };
8115
8185
  const _hoisted_4$3 = {
8116
8186
  key: 0,
@@ -8200,7 +8270,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8200
8270
  onClick: nodeClickHandler
8201
8271
  }, [
8202
8272
  renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
8203
- createElementVNode("div", _hoisted_2$6, [
8273
+ createElementVNode("div", _hoisted_2$5, [
8204
8274
  renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
8205
8275
  createTextVNode(toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
8206
8276
  ])
@@ -8294,76 +8364,6 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
8294
8364
  }
8295
8365
  });
8296
8366
 
8297
- const useFilter = (nodeData, nodeStatusMap, filterNodeMethod) => {
8298
- const filterIsMatch = (value, data) => {
8299
- const string = !Array.isArray(value) ? [value] : value;
8300
- if (!string.length) {
8301
- return true;
8302
- }
8303
- return string.some((v) => filterNodeMethod(v, data));
8304
- };
8305
- const filter = (text) => {
8306
- if (!nodeData.value.length) return;
8307
- nodeData.value.forEach((node) => {
8308
- traverseNode(node, (node2, parents) => {
8309
- if (!nodeStatusMap.value) return;
8310
- const visible = filterIsMatch(text, node2);
8311
- if (visible && parents.length) {
8312
- parents.forEach((parent) => {
8313
- updateStatus(nodeStatusMap.value, parent.id, {
8314
- visible,
8315
- expand: true
8316
- });
8317
- });
8318
- }
8319
- updateStatus(nodeStatusMap.value, node2.id, {
8320
- visible
8321
- });
8322
- });
8323
- });
8324
- };
8325
- return {
8326
- filterText: ref(""),
8327
- filterTextChangeHandler(text) {
8328
- filter(text);
8329
- }
8330
- };
8331
- };
8332
-
8333
- const createPageNodeStatus$1 = (nodeData, initialLayerNodeStatus) => {
8334
- const map = /* @__PURE__ */ new Map();
8335
- nodeData.forEach(
8336
- (node) => traverseNode(node, (node2) => {
8337
- map.set(
8338
- node2.id,
8339
- initialLayerNodeStatus?.get(node2.id) || {
8340
- visible: true,
8341
- expand: false,
8342
- selected: false,
8343
- draggable: false
8344
- }
8345
- );
8346
- })
8347
- );
8348
- return map;
8349
- };
8350
- const useNodeStatus$1 = (nodeData) => {
8351
- const nodeStatusMap = ref(/* @__PURE__ */ new Map());
8352
- watch(
8353
- nodeData,
8354
- (nodeData2) => {
8355
- nodeStatusMap.value = createPageNodeStatus$1(nodeData2, nodeStatusMap.value);
8356
- },
8357
- {
8358
- immediate: true,
8359
- deep: true
8360
- }
8361
- );
8362
- return {
8363
- nodeStatusMap
8364
- };
8365
- };
8366
-
8367
8367
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
8368
8368
  ...{
8369
8369
  name: "MEditorCodeBlockList"
@@ -8847,7 +8847,6 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
8847
8847
  });
8848
8848
 
8849
8849
  const _hoisted_1$6 = { class: "search-wrapper" };
8850
- const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
8851
8850
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
8852
8851
  ...{
8853
8852
  name: "MEditorDataSourceListPanel"
@@ -8896,7 +8895,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
8896
8895
  createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
8897
8896
  unref(editable) ? (openBlock(), createBlock(unref(TMagicPopover), {
8898
8897
  key: 0,
8899
- placement: "right"
8898
+ placement: "right",
8899
+ trigger: "hover",
8900
+ "popper-class": "data-source-list-panel-add-menu"
8900
8901
  }, {
8901
8902
  reference: withCtx(() => [
8902
8903
  createVNode(unref(TMagicButton), {
@@ -8910,20 +8911,18 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
8910
8911
  })
8911
8912
  ]),
8912
8913
  default: withCtx(() => [
8913
- createElementVNode("div", _hoisted_2$5, [
8914
- (openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
8915
- return openBlock(), createBlock(_sfc_main$y, {
8916
- data: {
8917
- type: "button",
8918
- text: item.text,
8919
- handler: () => {
8920
- addHandler(item.type);
8921
- }
8922
- },
8923
- key: index
8924
- }, null, 8, ["data"]);
8925
- }), 128))
8926
- ])
8914
+ (openBlock(true), createElementBlock(Fragment, null, renderList(datasourceTypeList.value, (item, index) => {
8915
+ return openBlock(), createBlock(_sfc_main$y, {
8916
+ data: {
8917
+ type: "button",
8918
+ text: item.text,
8919
+ handler: () => {
8920
+ addHandler(item.type);
8921
+ }
8922
+ },
8923
+ key: index
8924
+ }, null, 8, ["data"]);
8925
+ }), 128))
8927
8926
  ]),
8928
8927
  _: 1
8929
8928
  })) : createCommentVNode("", true),
@@ -10082,7 +10081,22 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10082
10081
  const props = __props;
10083
10082
  const services = inject("services");
10084
10083
  const columnLeftWidth = computed(() => services?.uiService.get("columnWidth")[ColumnLayout.LEFT] || 0);
10085
- const { height: columnLeftHeight } = useEditorContentHeight();
10084
+ const { height: editorContentHeight } = useEditorContentHeight();
10085
+ const columnLeftHeight = ref(0);
10086
+ const unWatchEditorContentHeight = watch(
10087
+ editorContentHeight,
10088
+ (height) => {
10089
+ if (height) {
10090
+ columnLeftHeight.value = height * 0.5;
10091
+ nextTick().then(() => {
10092
+ unWatchEditorContentHeight();
10093
+ });
10094
+ }
10095
+ },
10096
+ {
10097
+ immediate: true
10098
+ }
10099
+ );
10086
10100
  const activeTabName = ref(props.data?.status);
10087
10101
  const getItemConfig = (data) => {
10088
10102
  const map = {
@@ -10336,8 +10350,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
10336
10350
  key: config.$key ?? index,
10337
10351
  visible: unref(floatBoxStates)[config.$key].status,
10338
10352
  "onUpdate:visible": ($event) => unref(floatBoxStates)[config.$key].status = $event,
10339
- height: unref(columnLeftHeight),
10340
- "onUpdate:height": _cache[1] || (_cache[1] = ($event) => isRef(columnLeftHeight) ? columnLeftHeight.value = $event : null),
10353
+ height: columnLeftHeight.value,
10354
+ "onUpdate:height": _cache[1] || (_cache[1] = ($event) => columnLeftHeight.value = $event),
10341
10355
  width: columnLeftWidth.value,
10342
10356
  title: config.text,
10343
10357
  position: {
@@ -12669,4 +12683,4 @@ const index = {
12669
12683
  }
12670
12684
  };
12671
12685
 
12672
- export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$L as CodeBlockEditor, _sfc_main$l as CodeBlockList, _sfc_main$k as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$U as CodeSelect, _sfc_main$S as CodeSelectCol, ColumnLayout, _sfc_main$b as ComponentListPanel, _sfc_main$R as CondOpSelect, _sfc_main$g as ContentMenu, _sfc_main$j as DataSourceConfigPanel, _sfc_main$N as DataSourceFieldSelect, _sfc_main$P as DataSourceFields, _sfc_main$M as DataSourceInput, _sfc_main$J as DataSourceMethodSelect, _sfc_main$K as DataSourceMethods, _sfc_main$I as DataSourceMocks, _sfc_main$H as DataSourceSelect, _sfc_main$G as DisplayConds, DragType, _sfc_main$F as EventSelect, Fixed2Other, _sfc_main$Q as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$Y as Icon, IdleTask, KeyBindingCommand, _sfc_main$D as KeyValue, Keys, LayerOffset, _sfc_main$c as LayerPanel, Layout, _sfc_main$z as LayoutContainer, _sfc_main$C as PageFragmentSelect, _sfc_main$p as PropsPanel, _sfc_main$A as Resizer, ScrollViewer, SideItemKey, _sfc_main$z as SplitView, _sfc_main$X as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$y as ToolButton, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, eqOptions, error, eventTabConfig, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getConfig, getDefaultConfig, getDisplayField, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, moveItemsInContainer, numberOptions, propsService, removeDataSourceFieldPrefix, serializeConfig, setChildrenLayout, setConfig, setLayout, stageOverlayService, storageService, styleTabConfig, traverseNode, uiService, updateStatus, useCodeBlockEdit, useDataSourceMethod, useEditorContentHeight, useFloatBox, useStage, useWindowRect, warn };
12686
+ export { CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$L as CodeBlockEditor, _sfc_main$l as CodeBlockList, _sfc_main$k as CodeBlockListPanel, CodeDeleteErrorType, _sfc_main$U as CodeSelect, _sfc_main$S as CodeSelectCol, ColumnLayout, _sfc_main$b as ComponentListPanel, _sfc_main$R as CondOpSelect, _sfc_main$g as ContentMenu, _sfc_main$j as DataSourceConfigPanel, _sfc_main$N as DataSourceFieldSelect, _sfc_main$P as DataSourceFields, _sfc_main$M as DataSourceInput, _sfc_main$J as DataSourceMethodSelect, _sfc_main$K as DataSourceMethods, _sfc_main$I as DataSourceMocks, _sfc_main$H as DataSourceSelect, _sfc_main$G as DisplayConds, DragType, _sfc_main$F as EventSelect, Fixed2Other, _sfc_main$Q as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$Y as Icon, IdleTask, KeyBindingCommand, _sfc_main$D as KeyValue, Keys, LayerOffset, _sfc_main$c as LayerPanel, Layout, _sfc_main$z as LayoutContainer, _sfc_main$C as PageFragmentSelect, _sfc_main$p as PropsPanel, _sfc_main$A as Resizer, ScrollViewer, SideItemKey, _sfc_main$z as SplitView, _sfc_main$X as TMagicCodeEditor, _sfc_main as TMagicEditor, _sfc_main$y as ToolButton, _sfc_main$m as Tree, _sfc_main$n as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, displayTabConfig, editorService, eqOptions, error, eventTabConfig, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getConfig, getDefaultConfig, getDisplayField, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, moveItemsInContainer, numberOptions, propsService, removeDataSourceFieldPrefix, serializeConfig, setChildrenLayout, setConfig, setLayout, stageOverlayService, storageService, styleTabConfig, traverseNode, uiService, updateStatus, useCodeBlockEdit, useDataSourceMethod, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useNextFloatBoxPosition, useNodeStatus$1 as useNodeStatus, useStage, useWindowRect, warn };