@tmagic/editor 1.8.0-beta.16 → 1.8.0-beta.17

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.
@@ -59,6 +59,9 @@
59
59
  border-radius: 0;
60
60
  border-bottom: 0;
61
61
  }
62
+ .tmagic-design-card.tmagic-design-card--flat.m-flat-hide-body .el-card__header {
63
+ border-bottom: 0 !important;
64
+ }
62
65
  .tmagic-design-card.tmagic-design-card--flat.m-fields-group-list-item {
63
66
  margin-bottom: 0;
64
67
  }
@@ -67,18 +70,22 @@
67
70
  }
68
71
  .tmagic-design-card.tmagic-design-card--flat .el-card__header {
69
72
  border-bottom: none;
70
- padding: 16px;
73
+ padding: 8px 16px;
71
74
  }
72
75
  .tmagic-design-card.tmagic-design-card--flat .el-card__header:hover {
73
76
  background: transparent;
74
77
  box-shadow: none;
75
78
  cursor: default;
76
79
  }
80
+ .tmagic-design-card.tmagic-design-card--flat .m-fields-group-list-footer {
81
+ margin-bottom: 4px;
82
+ margin-top: 4px;
83
+ }
77
84
  .tmagic-design-card.tmagic-design-card--flat .el-card__body {
78
85
  padding: 0 16px 0 16px;
79
86
  }
80
87
  .tmagic-design-card.tmagic-design-card--flat .el-card__body .tmagic-design-form-item:not(tbody .tmagic-design-form-item) {
81
- margin-bottom: 16px;
88
+ margin-bottom: 8px;
82
89
  }
83
90
  .tmagic-design-card.tmagic-design-card--flat .el-card__body > .m-container-row {
84
91
  overflow-x: hidden;
@@ -95,7 +102,7 @@
95
102
  }
96
103
  .m-split-title-card-container > .tmagic-design-card.tmagic-design-card--flat > .el-card__body {
97
104
  background-color: #fff;
98
- padding-top: 16px;
105
+ padding-top: 8px;
99
106
  }
100
107
 
101
108
  .tmagic-design-color-picker-input {
@@ -465,12 +472,16 @@ fieldset.m-fieldset .m-form-tip {
465
472
  gap: 8px;
466
473
  }
467
474
  .m-fields-group-list .m-fields-group-list-footer {
468
- display: flex;
469
475
  justify-content: space-between;
470
476
  margin-top: 10px;
471
477
  margin-bottom: 16px;
472
478
  }
473
479
 
480
+ /** 最外层的groupList需要每个item需要增加空白区域界限时,增加outer-gorup_list可以实现 */
481
+ .m-container-group-list.outer-gorup_list > .m-fields-group-list > .m-fields-group-list-item {
482
+ margin-bottom: 10px;
483
+ }
484
+
474
485
  .m-form-panel .el-card__header:hover {
475
486
  background: #f2f6fc;
476
487
  }
@@ -666,6 +677,12 @@ fieldset.m-fieldset .m-form-tip {
666
677
  .m-form.m-form--magic-admin .m-form-container .m-form-container-expand {
667
678
  text-align: left;
668
679
  }
680
+ .m-form.m-form--magic-admin .m-fields-group-list .el-table__empty-block .el-table__empty-text {
681
+ width: 100%;
682
+ background-color: rgba(0, 0, 0, 0.03);
683
+ margin-top: 8px;
684
+ border-radius: 4px;
685
+ }
669
686
 
670
687
  .tmagic-design-input.search-input {
671
688
  background: #fff;
@@ -2011,20 +2028,23 @@ fieldset.m-fieldset .m-form-tip {
2011
2028
  margin-bottom: 18px;
2012
2029
  }
2013
2030
  .m-fields-code-select .code-select-content > .m-fields-group-list > .tmagic-design-card--flat > .el-card__header {
2014
- padding: 16px 0;
2031
+ padding: 8px 0;
2015
2032
  }
2016
2033
  .m-fields-code-select .create-button.fullWidth {
2017
2034
  width: 100%;
2018
- margin: 0 0 16px 0;
2035
+ margin: 0 0 8px 0;
2019
2036
  }
2020
2037
 
2021
2038
  .m-fields-event-select {
2022
2039
  width: 100%;
2023
2040
  }
2024
2041
  .m-fields-event-select .fullWidth {
2025
- width: 100%;
2042
+ width: calc(100% - 32px);
2026
2043
  box-sizing: border-box;
2027
2044
  }
2045
+ .m-fields-event-select .fullWidth.create-button {
2046
+ width: 100%;
2047
+ }
2028
2048
  .m-fields-event-select .event-select-container {
2029
2049
  padding: 0 16px;
2030
2050
  }
@@ -2032,13 +2052,13 @@ fieldset.m-fieldset .m-form-tip {
2032
2052
  border-bottom: 1px solid #ebeef5;
2033
2053
  }
2034
2054
  .m-fields-event-select .event-select-container > .el-card.tmagic-design-card--flat > .el-card__body {
2035
- padding-bottom: 16px;
2055
+ padding-bottom: 8px;
2036
2056
  }
2037
2057
  .m-fields-event-select .event-select-container > .el-card.tmagic-design-card--flat > .el-card__body .m-fields-group-list-footer div {
2038
2058
  justify-content: flex-start !important;
2039
2059
  }
2040
2060
  .m-fields-event-select .event-select-container > .el-card.tmagic-design-card--flat > .el-card__body .el-card.tmagic-design-card--flat > .el-card__header {
2041
- padding: 16px 0;
2061
+ padding: 8px 0;
2042
2062
  }
2043
2063
  .m-fields-event-select .event-select-code {
2044
2064
  margin-left: 20px;
@@ -2092,18 +2112,19 @@ fieldset.m-fieldset .m-form-tip {
2092
2112
  .event-item-header {
2093
2113
  position: relative;
2094
2114
  width: 100%;
2115
+ display: flex;
2116
+ align-items: center;
2117
+ justify-content: space-between;
2095
2118
  }
2096
2119
  .event-item-header .event-item-title {
2097
2120
  color: #0f1113;
2098
2121
  font-size: 16px;
2099
2122
  font-weight: 500;
2100
2123
  line-height: 24px;
2101
- margin-bottom: 16px;
2124
+ margin-bottom: 8px;
2102
2125
  }
2103
2126
  .event-item-header .event-item-delete-button {
2104
- position: absolute;
2105
- right: 0;
2106
- top: 0;
2127
+ color: #0f1113;
2107
2128
  }
2108
2129
  .event-item-header .el-form-item .el-form-item.is-error {
2109
2130
  margin-bottom: 18px;
@@ -8976,6 +8976,7 @@
8976
8976
  containerHighlightClassName: stageOptions.containerHighlightClassName,
8977
8977
  containerHighlightDuration: stageOptions.containerHighlightDuration,
8978
8978
  containerHighlightType: stageOptions.containerHighlightType,
8979
+ containerHighlightAddOnly: stageOptions.containerHighlightAddOnly,
8979
8980
  disabledDragStart: stageOptions.disabledDragStart,
8980
8981
  renderType: stageOptions.renderType,
8981
8982
  canSelect: (el, event, stop) => {
@@ -9655,6 +9656,9 @@
9655
9656
  });
9656
9657
  }, 1);
9657
9658
  };
9659
+ globalThis.cancelIdleCallback = globalThis.cancelIdleCallback || function(handle) {
9660
+ clearTimeout(handle);
9661
+ };
9658
9662
  var IdleTask = class extends events.EventEmitter {
9659
9663
  taskList = [];
9660
9664
  hightLevelTaskList = [];
@@ -12744,7 +12748,7 @@
12744
12748
  class: "m-editor-history-list-item-saved",
12745
12749
  title: "该记录为最近一次保存的状态"
12746
12750
  };
12747
- var _hoisted_5$5 = {
12751
+ var _hoisted_5$4 = {
12748
12752
  key: 1,
12749
12753
  class: "m-editor-history-list-item-actions"
12750
12754
  };
@@ -12906,7 +12910,7 @@
12906
12910
  (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["m-editor-history-list-item-op", `op-${__props.group.opType}`]) }, (0, vue.toDisplayString)((0, vue.unref)(opLabel)(__props.group.opType)), 3),
12907
12911
  (0, vue.createElementVNode)("span", _hoisted_3$12, (0, vue.toDisplayString)(__props.group.desc), 1),
12908
12912
  headSaved.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$9, "已保存")) : (0, vue.createCommentVNode)("v-if", true),
12909
- !merged.value && (headRevertable.value || headDiffable.value || canHeadGoto.value) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$5, [
12913
+ !merged.value && (headRevertable.value || headDiffable.value || canHeadGoto.value) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$4, [
12910
12914
  headRevertable.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
12911
12915
  key: 0,
12912
12916
  class: "m-editor-history-list-item-revert",
@@ -13016,7 +13020,7 @@
13016
13020
  key: 1,
13017
13021
  class: "m-editor-history-list-item-actions"
13018
13022
  };
13019
- var _hoisted_5$4 = ["title"];
13023
+ var _hoisted_5$3 = ["title"];
13020
13024
  var InitialRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
13021
13025
  name: "MEditorHistoryListInitialRow",
13022
13026
  __name: "InitialRow",
@@ -13078,7 +13082,7 @@
13078
13082
  key: 2,
13079
13083
  class: "m-editor-history-list-item-time",
13080
13084
  title: timeTitle.value
13081
- }, (0, vue.toDisplayString)(time.value), 9, _hoisted_5$4)) : (0, vue.createCommentVNode)("v-if", true)
13085
+ }, (0, vue.toDisplayString)(time.value), 9, _hoisted_5$3)) : (0, vue.createCommentVNode)("v-if", true)
13082
13086
  ], 10, _hoisted_1$66);
13083
13087
  };
13084
13088
  }
@@ -13460,7 +13464,7 @@
13460
13464
  }));
13461
13465
  //#endregion
13462
13466
  //#region packages/editor/src/layouts/history-list/HistoryDiffDialog.vue?vue&type=script&setup=true&lang.ts
13463
- var _hoisted_1$62, _hoisted_2$19, _hoisted_3$7, _hoisted_4$6, _hoisted_5$3, _hoisted_6$2, _hoisted_7, HistoryDiffDialog_vue_vue_type_script_setup_true_lang_default;
13467
+ var _hoisted_1$62, _hoisted_2$19, _hoisted_3$7, _hoisted_4$6, _hoisted_5$2, _hoisted_6$2, _hoisted_7, HistoryDiffDialog_vue_vue_type_script_setup_true_lang_default;
13464
13468
  var init_HistoryDiffDialog_vue_vue_type_script_setup_true_lang = __esmMin((() => {
13465
13469
  init_lodash();
13466
13470
  init_CompareForm();
@@ -13475,7 +13479,7 @@
13475
13479
  };
13476
13480
  _hoisted_3$7 = { class: "m-editor-history-diff-dialog-header" };
13477
13481
  _hoisted_4$6 = { class: "m-editor-history-diff-dialog-target" };
13478
- _hoisted_5$3 = { class: "m-editor-history-diff-dialog-controls" };
13482
+ _hoisted_5$2 = { class: "m-editor-history-diff-dialog-controls" };
13479
13483
  _hoisted_6$2 = { class: "m-editor-history-diff-dialog-legend" };
13480
13484
  _hoisted_7 = {
13481
13485
  key: 0,
@@ -13655,7 +13659,7 @@
13655
13659
  }))]),
13656
13660
  default: (0, vue.withCtx)(() => [payload.value && visible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$62, [
13657
13661
  __props.onConfirm ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$19, "仅回滚有差异的字段")) : (0, vue.createCommentVNode)("v-if", true),
13658
- (0, vue.createElementVNode)("div", _hoisted_3$7, [(0, vue.createElementVNode)("span", _hoisted_4$6, (0, vue.toDisplayString)(targetText.value), 1), (0, vue.createElementVNode)("div", _hoisted_5$3, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicRadioGroup), {
13662
+ (0, vue.createElementVNode)("div", _hoisted_3$7, [(0, vue.createElementVNode)("span", _hoisted_4$6, (0, vue.toDisplayString)(targetText.value), 1), (0, vue.createElementVNode)("div", _hoisted_5$2, [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicRadioGroup), {
13659
13663
  modelValue: viewMode.value,
13660
13664
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => viewMode.value = $event),
13661
13665
  size: "small",
@@ -14800,6 +14804,7 @@
14800
14804
  containerHighlightClassName: _tmagic_stage.CONTAINER_HIGHLIGHT_CLASS_NAME,
14801
14805
  containerHighlightDuration: 800,
14802
14806
  containerHighlightType: _tmagic_stage.ContainerHighlightType.DEFAULT,
14807
+ containerHighlightAddOnly: false,
14803
14808
  disabledShowSrc: false,
14804
14809
  disabledDataSource: false,
14805
14810
  disabledCodeBlock: false,
@@ -17884,7 +17889,7 @@
17884
17889
  return;
17885
17890
  }
17886
17891
  if (timeout || !stage.value) return;
17887
- timeout = stage.value.delayedMarkContainer(e);
17892
+ timeout = stage.value.delayedMarkContainer(e, [], true);
17888
17893
  };
17889
17894
  return (_ctx, _cache) => {
17890
17895
  return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicScrollbar), null, {
@@ -17952,7 +17957,7 @@
17952
17957
  key: 1,
17953
17958
  class: "magic-editor-tab-panel-title"
17954
17959
  };
17955
- var _hoisted_5$2 = {
17960
+ var _hoisted_5$1 = {
17956
17961
  key: 0,
17957
17962
  class: "m-editor-sidebar-tips"
17958
17963
  };
@@ -18196,7 +18201,7 @@
18196
18201
  `${index}`
18197
18202
  ].includes(activeTabName.value)]]);
18198
18203
  }), 128)),
18199
- tipsBarVisible.value && collecting.value && taskLength.value > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$2, [(0, vue.createElementVNode)("span", null, "依赖收集中(剩余任务:" + (0, vue.toDisplayString)(taskLength.value) + ")", 1), (0, vue.createVNode)(Icon_default, {
18204
+ tipsBarVisible.value && collecting.value && taskLength.value > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$1, [(0, vue.createElementVNode)("span", null, "依赖收集中(剩余任务:" + (0, vue.toDisplayString)(taskLength.value) + ")", 1), (0, vue.createVNode)(Icon_default, {
18200
18205
  icon: (0, vue.unref)(_element_plus_icons_vue.Close),
18201
18206
  class: "close-icon",
18202
18207
  onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(($event) => tipsBarVisible.value = false, ["stop"]))
@@ -19232,6 +19237,9 @@
19232
19237
  idleTask = new IdleTask();
19233
19238
  watcher = new _tmagic_core.Watcher({ initialTargets: (0, vue.reactive)({}) });
19234
19239
  waitingWorker;
19240
+ resolveWaitingWorker;
19241
+ workerGeneration = 0;
19242
+ activeBatches = /* @__PURE__ */ new Set();
19235
19243
  constructor() {
19236
19244
  super();
19237
19245
  this.idleTask.on("update-task-length", throttle(({ length }) => {
@@ -19281,33 +19289,36 @@
19281
19289
  }
19282
19290
  async collectIdle(nodes, depExtendedData = {}, deep = false, type) {
19283
19291
  if (this.waitingWorker) await this.waitingWorker;
19284
- this.set("collecting", true);
19285
- let startTask = false;
19292
+ const batch = {
19293
+ nodes,
19294
+ deep,
19295
+ pending: 0,
19296
+ dsPending: 0,
19297
+ collectedEmitted: false,
19298
+ dsSettled: false,
19299
+ resolve: () => {}
19300
+ };
19286
19301
  this.watcher.collectByCallback(nodes, type, ({ node, target }) => {
19287
- startTask = true;
19288
- this.enqueueTask(node, target, depExtendedData, deep);
19302
+ this.enqueueTask(node, target, depExtendedData, deep, batch);
19289
19303
  });
19304
+ if (batch.pending === 0) {
19305
+ this.emit("collected", nodes, deep);
19306
+ this.updateCollectingState();
19307
+ return true;
19308
+ }
19309
+ this.activeBatches.add(batch);
19310
+ this.set("collecting", true);
19290
19311
  return new Promise((resolve) => {
19291
- if (!startTask) {
19292
- this.emit("collected", nodes, deep);
19293
- this.set("collecting", false);
19294
- resolve();
19295
- return;
19296
- }
19297
- this.idleTask.once("finish", () => {
19298
- this.emit("collected", nodes, deep);
19299
- this.set("collecting", false);
19300
- });
19301
- this.idleTask.once("hight-level-finish", () => {
19302
- this.emit("ds-collected", nodes, deep);
19303
- resolve();
19304
- });
19312
+ batch.resolve = resolve;
19305
19313
  });
19306
19314
  }
19307
19315
  collectByWorker(dsl) {
19308
19316
  this.set("collecting", true);
19317
+ this.workerGeneration += 1;
19318
+ const generation = this.workerGeneration;
19309
19319
  const { promise, resolve: waitingResolve } = Promise.withResolvers();
19310
19320
  this.waitingWorker = promise;
19321
+ this.resolveWaitingWorker = waitingResolve;
19311
19322
  return new Promise((resolve) => {
19312
19323
  const worker = new WorkerWrapper();
19313
19324
  worker.postMessage({ dsl: (0, serialize_javascript.default)(dsl) });
@@ -19318,6 +19329,10 @@
19318
19329
  resolve({});
19319
19330
  };
19320
19331
  }).then((depsData) => {
19332
+ if (generation !== this.workerGeneration) {
19333
+ waitingResolve();
19334
+ return depsData;
19335
+ }
19321
19336
  (0, _tmagic_core.traverseTarget)(this.watcher.getTargetsList(), (target) => {
19322
19337
  if (depsData[target.type]?.[target.id]) {
19323
19338
  target.deps = (0, vue.reactive)(depsData[target.type][target.id]);
@@ -19330,6 +19345,10 @@
19330
19345
  this.emit("collected", dsl.items, true);
19331
19346
  this.emit("ds-collected", dsl.items, true);
19332
19347
  waitingResolve();
19348
+ if (this.waitingWorker === promise) {
19349
+ this.waitingWorker = void 0;
19350
+ this.resolveWaitingWorker = void 0;
19351
+ }
19333
19352
  return depsData;
19334
19353
  });
19335
19354
  }
@@ -19351,6 +19370,7 @@
19351
19370
  return this.watcher.hasSpecifiedTypeTarget(type);
19352
19371
  }
19353
19372
  clearIdleTasks() {
19373
+ this.abortActiveBatches();
19354
19374
  this.idleTask.clearTasks();
19355
19375
  }
19356
19376
  on(eventName, listener) {
@@ -19360,6 +19380,11 @@
19360
19380
  return super.once(eventName, listener);
19361
19381
  }
19362
19382
  reset() {
19383
+ this.abortActiveBatches();
19384
+ this.workerGeneration += 1;
19385
+ this.resolveWaitingWorker?.();
19386
+ this.resolveWaitingWorker = void 0;
19387
+ this.waitingWorker = void 0;
19363
19388
  this.idleTask.clearTasks();
19364
19389
  for (const type of Object.keys(this.watcher.getTargetsList())) this.removeTargets(type);
19365
19390
  this.set("collecting", false);
@@ -19384,18 +19409,63 @@
19384
19409
  if (dep.data?.pageId && dep.data.pageId === depExtendedData.pageId) delete target.deps[depKey];
19385
19410
  }
19386
19411
  }
19387
- enqueueTask(node, target, depExtendedData, deep) {
19412
+ enqueueTask(node, target, depExtendedData, deep, batch) {
19413
+ const isDataSource = target.type === _tmagic_core.DepTargetType.DATA_SOURCE;
19414
+ batch.pending += 1;
19415
+ if (isDataSource) batch.dsPending += 1;
19388
19416
  this.idleTask.enqueueTask(({ node, deep, target }) => {
19389
- this.collectNode(node, target, depExtendedData, deep);
19417
+ try {
19418
+ this.collectNode(node, target, depExtendedData, deep);
19419
+ } finally {
19420
+ this.onBatchTaskDone(batch, isDataSource);
19421
+ }
19390
19422
  }, {
19391
19423
  node,
19392
19424
  deep: false,
19393
19425
  target
19394
- }, target.type === _tmagic_core.DepTargetType.DATA_SOURCE);
19426
+ }, isDataSource);
19395
19427
  if (deep && Array.isArray(node.items) && node.items.length) node.items.forEach((item) => {
19396
- this.enqueueTask(item, target, depExtendedData, deep);
19428
+ this.enqueueTask(item, target, depExtendedData, deep, batch);
19397
19429
  });
19398
19430
  }
19431
+ onBatchTaskDone(batch, isDataSource) {
19432
+ if (isDataSource) {
19433
+ batch.dsPending -= 1;
19434
+ if (batch.dsPending === 0) this.settleBatchDs(batch);
19435
+ }
19436
+ batch.pending -= 1;
19437
+ if (batch.pending === 0) this.finishBatch(batch);
19438
+ }
19439
+ settleBatchDs(batch) {
19440
+ if (batch.dsSettled) return;
19441
+ batch.dsSettled = true;
19442
+ this.emit("ds-collected", batch.nodes, batch.deep);
19443
+ batch.resolve(true);
19444
+ }
19445
+ finishBatch(batch) {
19446
+ if (!batch.collectedEmitted) {
19447
+ batch.collectedEmitted = true;
19448
+ this.emit("collected", batch.nodes, batch.deep);
19449
+ }
19450
+ this.settleBatchDs(batch);
19451
+ this.activeBatches.delete(batch);
19452
+ this.updateCollectingState();
19453
+ }
19454
+ /**
19455
+ * idleTask 被清空时,在途批次的任务不会再执行,必须主动结算,
19456
+ * 否则对应的 collectIdle Promise 永远不会 resolve(collecting 卡在 true、once 监听器泄漏)。
19457
+ * 收集被中断(通常紧跟一次全量重新收集),因此不再 emit collected/ds-collected,仅结算 Promise。
19458
+ */
19459
+ abortActiveBatches() {
19460
+ if (!this.activeBatches.size) return;
19461
+ const batches = [...this.activeBatches];
19462
+ this.activeBatches.clear();
19463
+ for (const batch of batches) batch.resolve(false);
19464
+ this.updateCollectingState();
19465
+ }
19466
+ updateCollectingState() {
19467
+ this.set("collecting", this.activeBatches.size > 0);
19468
+ }
19399
19469
  };
19400
19470
  var dep_default = new Dep();
19401
19471
  //#endregion
@@ -19839,15 +19909,15 @@
19839
19909
  return pageId;
19840
19910
  };
19841
19911
  const collectIdle = (nodes, deep, type) => Promise.all(nodes.map((node) => {
19842
- if (node.type === _tmagic_core.NodeType.ROOT) return Promise.resolve();
19912
+ if (node.type === _tmagic_core.NodeType.ROOT) return Promise.resolve(true);
19843
19913
  return depService.collectIdle([node], { pageId: getPageIdByNode(node) }, deep, type);
19844
- }));
19914
+ })).then((results) => results.every(Boolean));
19845
19915
  (0, vue.watch)(() => editorService.get("stage"), (stage) => {
19846
19916
  if (!stage) return;
19847
19917
  stage.on("rerender", async () => {
19848
19918
  const node = editorService.get("node");
19849
19919
  if (!node) return;
19850
- await collectIdle([node], true, _tmagic_core.DepTargetType.DATA_SOURCE);
19920
+ if (!await collectIdle([node], true, _tmagic_core.DepTargetType.DATA_SOURCE)) return;
19851
19921
  updateStageNode(node);
19852
19922
  });
19853
19923
  });
@@ -19934,8 +20004,8 @@
19934
20004
  })();
19935
20005
  };
19936
20006
  const nodeAddHandler = (nodes) => {
19937
- collectIdle(nodes, true).then(() => {
19938
- updateStageNodes(nodes);
20007
+ collectIdle(nodes, true).then((completed) => {
20008
+ if (completed) updateStageNodes(nodes);
19939
20009
  });
19940
20010
  };
19941
20011
  const nodeUpdateHandler = (data) => {
@@ -19964,8 +20034,8 @@
19964
20034
  else normalNodes.push(newNode);
19965
20035
  if (needRecollectNodes.length) {
19966
20036
  const handler = async () => {
19967
- await collectIdle(needRecollectNodes, true, _tmagic_core.DepTargetType.DATA_SOURCE);
19968
- await collectIdle(needRecollectNodes, true, _tmagic_core.DepTargetType.DATA_SOURCE_COND);
20037
+ if (!await collectIdle(needRecollectNodes, true, _tmagic_core.DepTargetType.DATA_SOURCE)) return;
20038
+ if (!await collectIdle(needRecollectNodes, true, _tmagic_core.DepTargetType.DATA_SOURCE_COND)) return;
19969
20039
  updateStageNodes(needRecollectNodes);
19970
20040
  };
19971
20041
  handler();
@@ -19978,8 +20048,8 @@
19978
20048
  depService.clear(nodes);
19979
20049
  };
19980
20050
  const historyChangeHandler = (page) => {
19981
- collectIdle([page], true).then(() => {
19982
- updateStageNode(page);
20051
+ collectIdle([page], true).then((completed) => {
20052
+ if (completed) updateStageNode(page);
19983
20053
  });
19984
20054
  };
19985
20055
  editorService.on("history-change", historyChangeHandler);
@@ -20039,7 +20109,13 @@
20039
20109
  depService.addTarget((0, _tmagic_core.createDataSourceMethodTarget)(config, (0, vue.reactive)({})));
20040
20110
  collectIdlePromises = [collectIdle(root.items, true, _tmagic_core.DepTargetType.DATA_SOURCE_METHOD)];
20041
20111
  }
20042
- Promise.all(collectIdlePromises).then(() => updateDataSourceSchema()).then(() => updateDsData()).then(() => updateStageNodes(root.items));
20112
+ const handler = async () => {
20113
+ if (!(await Promise.all(collectIdlePromises)).every(Boolean)) return;
20114
+ updateDataSourceSchema();
20115
+ await updateDsData();
20116
+ updateStageNodes(root.items);
20117
+ };
20118
+ handler();
20043
20119
  }
20044
20120
  } else if (root?.dataSources) updateDsData();
20045
20121
  };
@@ -20053,11 +20129,11 @@
20053
20129
  if (!root) return;
20054
20130
  const handler = async () => {
20055
20131
  const nodes = (0, _tmagic_utils.getNodes)(Object.keys(root.dataSourceDeps?.[id] || {}), root.items);
20056
- await Promise.all([
20132
+ if (!(await Promise.all([
20057
20133
  collectIdle(nodes, false, _tmagic_core.DepTargetType.DATA_SOURCE),
20058
20134
  collectIdle(nodes, false, _tmagic_core.DepTargetType.DATA_SOURCE_COND),
20059
20135
  collectIdle(nodes, false, _tmagic_core.DepTargetType.DATA_SOURCE_METHOD)
20060
- ]);
20136
+ ])).every(Boolean)) return;
20061
20137
  updateDataSourceSchema();
20062
20138
  (await getTMagicApp())?.dataSourceManager?.removeDataSource(id);
20063
20139
  updateStageNodes(nodes);
@@ -20150,6 +20226,7 @@
20150
20226
  containerHighlightClassName: {},
20151
20227
  containerHighlightDuration: {},
20152
20228
  containerHighlightType: {},
20229
+ containerHighlightAddOnly: { type: Boolean },
20153
20230
  stageRect: {},
20154
20231
  codeOptions: {},
20155
20232
  disabledDragStart: { type: Boolean },
@@ -20220,6 +20297,7 @@
20220
20297
  containerHighlightClassName: props.containerHighlightClassName,
20221
20298
  containerHighlightDuration: props.containerHighlightDuration,
20222
20299
  containerHighlightType: props.containerHighlightType,
20300
+ containerHighlightAddOnly: props.containerHighlightAddOnly,
20223
20301
  disabledDragStart: props.disabledDragStart,
20224
20302
  renderType: props.renderType,
20225
20303
  guidesOptions: props.guidesOptions,
@@ -22575,7 +22653,6 @@
22575
22653
  };
22576
22654
  var _hoisted_3$3 = { class: "event-select-header" };
22577
22655
  var _hoisted_4$2 = { class: "event-item-header" };
22578
- var _hoisted_5$1 = { class: "event-item-title" };
22579
22656
  var EventSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
22580
22657
  name: "MFieldsEventSelect",
22581
22658
  __name: "EventSelect",
@@ -22656,6 +22733,12 @@
22656
22733
  typeMatch: true,
22657
22734
  trigger: "blur"
22658
22735
  }],
22736
+ onChange: (_mForm, _v, { setModel }) => {
22737
+ setModel("to", "");
22738
+ setModel("method", "");
22739
+ setModel("codeId", "");
22740
+ setModel("dataSourceMethod", []);
22741
+ },
22659
22742
  ...props.config.actionTypeConfig
22660
22743
  };
22661
22744
  });
@@ -22666,7 +22749,7 @@
22666
22749
  type: "ui-select",
22667
22750
  labelPosition: "left",
22668
22751
  display: (_mForm, { model }) => model.actionType === _tmagic_core.ActionType.COMP,
22669
- onChange: (_MForm, _v, { setModel }) => {
22752
+ onChange: (_mForm, _v, { setModel }) => {
22670
22753
  setModel("method", "");
22671
22754
  },
22672
22755
  rules: [{
@@ -22873,46 +22956,42 @@
22873
22956
  model: entry.cardItem,
22874
22957
  "last-values": entry.lastCardItem,
22875
22958
  "is-compare": isCompareMode.value,
22876
- "hide-expand": true,
22959
+ "hide-expand": false,
22877
22960
  "label-width": __props.config.labelWidth || "100px",
22878
22961
  onChange: onChangeHandler
22879
22962
  }, {
22880
- header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_4$2, [
22881
- (0, vue.createElementVNode)("div", _hoisted_5$1, "事件" + (0, vue.toDisplayString)(Number(entry.index) + 1), 1),
22882
- (0, vue.createVNode)((0, vue.unref)(_tmagic_form.MContainer), {
22883
- class: "fullWidth",
22884
- config: eventNameConfig.value,
22885
- model: entry.cardItem,
22886
- "last-values": entry.lastCardItem,
22887
- "is-compare": isCompareMode.value,
22888
- disabled: __props.disabled,
22889
- size: __props.size,
22890
- prop: `${__props.prop}.${entry.index}`,
22891
- onChange: eventNameChangeHandler
22892
- }, null, 8, [
22893
- "config",
22894
- "model",
22895
- "last-values",
22896
- "is-compare",
22897
- "disabled",
22898
- "size",
22899
- "prop"
22900
- ]),
22901
- !isCompareMode.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
22902
- key: 0,
22903
- class: "event-item-delete-button",
22904
- link: "",
22905
- icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
22906
- disabled: __props.disabled,
22907
- size: __props.size,
22908
- onClick: ($event) => removeEvent(Number(entry.index))
22909
- }, null, 8, [
22910
- "icon",
22911
- "disabled",
22912
- "size",
22913
- "onClick"
22914
- ])) : (0, vue.createCommentVNode)("v-if", true)
22915
- ])]),
22963
+ header: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_4$2, [(0, vue.createVNode)((0, vue.unref)(_tmagic_form.MContainer), {
22964
+ class: "fullWidth",
22965
+ config: eventNameConfig.value,
22966
+ model: entry.cardItem,
22967
+ "last-values": entry.lastCardItem,
22968
+ "is-compare": isCompareMode.value,
22969
+ disabled: __props.disabled,
22970
+ size: __props.size,
22971
+ prop: `${__props.prop}.${entry.index}`,
22972
+ onChange: eventNameChangeHandler
22973
+ }, null, 8, [
22974
+ "config",
22975
+ "model",
22976
+ "last-values",
22977
+ "is-compare",
22978
+ "disabled",
22979
+ "size",
22980
+ "prop"
22981
+ ]), !isCompareMode.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
22982
+ key: 0,
22983
+ class: "event-item-delete-button",
22984
+ link: "",
22985
+ icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
22986
+ disabled: __props.disabled,
22987
+ size: __props.size,
22988
+ onClick: ($event) => removeEvent(Number(entry.index))
22989
+ }, null, 8, [
22990
+ "icon",
22991
+ "disabled",
22992
+ "size",
22993
+ "onClick"
22994
+ ])) : (0, vue.createCommentVNode)("v-if", true)])]),
22916
22995
  _: 2
22917
22996
  }, 1032, [
22918
22997
  "disabled",
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.0-beta.16",
2
+ "version": "1.8.0-beta.17",
3
3
  "name": "@tmagic/editor",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -58,11 +58,11 @@
58
58
  "moveable": "^0.53.0",
59
59
  "serialize-javascript": "^7.0.0",
60
60
  "sortablejs": "^1.15.6",
61
- "@tmagic/design": "1.8.0-beta.16",
62
- "@tmagic/stage": "1.8.0-beta.16",
63
- "@tmagic/form": "1.8.0-beta.16",
64
- "@tmagic/utils": "1.8.0-beta.16",
65
- "@tmagic/table": "1.8.0-beta.16"
61
+ "@tmagic/form": "1.8.0-beta.17",
62
+ "@tmagic/design": "1.8.0-beta.17",
63
+ "@tmagic/utils": "1.8.0-beta.17",
64
+ "@tmagic/table": "1.8.0-beta.17",
65
+ "@tmagic/stage": "1.8.0-beta.17"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/events": "^3.0.3",
@@ -76,7 +76,7 @@
76
76
  "type-fest": "^5.2.0",
77
77
  "typescript": "^6.0.3",
78
78
  "vue": "^3.5.40",
79
- "@tmagic/core": "1.8.0-beta.16"
79
+ "@tmagic/core": "1.8.0-beta.17"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "typescript": {
package/src/Editor.vue CHANGED
@@ -218,6 +218,7 @@ const stageOptions: StageOptions = {
218
218
  containerHighlightClassName: props.containerHighlightClassName,
219
219
  containerHighlightDuration: props.containerHighlightDuration,
220
220
  containerHighlightType: props.containerHighlightType,
221
+ containerHighlightAddOnly: props.containerHighlightAddOnly,
221
222
  disabledDragStart: props.disabledDragStart,
222
223
  renderType: props.renderType,
223
224
  guidesOptions: props.guidesOptions,