@tmagic/stage 1.4.7 → 1.4.8

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.
@@ -139,27 +139,21 @@ const isFixedParent = (el) => {
139
139
  return fixed;
140
140
  };
141
141
  const getMode = (el) => {
142
- if (isFixedParent(el))
143
- return Mode.FIXED;
142
+ if (isFixedParent(el)) return Mode.FIXED;
144
143
  const style = getComputedStyle(el);
145
- if (isStatic(style) || isRelative(style))
146
- return Mode.SORTABLE;
144
+ if (isStatic(style) || isRelative(style)) return Mode.SORTABLE;
147
145
  return Mode.ABSOLUTE;
148
146
  };
149
147
  const getScrollParent = (element, includeHidden = false) => {
150
148
  let style = getComputedStyle(element);
151
149
  const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
152
- if (isFixed(style))
153
- return null;
150
+ if (isFixed(style)) return null;
154
151
  for (let parent = element; parent.parentElement; ) {
155
152
  parent = parent.parentElement;
156
- if (parent.tagName === "HTML")
157
- return parent;
153
+ if (parent.tagName === "HTML") return parent;
158
154
  style = getComputedStyle(parent);
159
- if (isAbsolute(style) && isStatic(style))
160
- continue;
161
- if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX))
162
- return parent;
155
+ if (isAbsolute(style) && isStatic(style)) continue;
156
+ if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;
163
157
  }
164
158
  return null;
165
159
  };
@@ -167,8 +161,7 @@ const removeSelectedClassName = (doc) => {
167
161
  const oldEl = doc.querySelector(`.${SELECTED_CLASS}`);
168
162
  if (oldEl) {
169
163
  removeClassName(oldEl, SELECTED_CLASS);
170
- if (oldEl.parentNode)
171
- removeClassName(oldEl.parentNode, `${SELECTED_CLASS}-parent`);
164
+ if (oldEl.parentNode) removeClassName(oldEl.parentNode, `${SELECTED_CLASS}-parent`);
172
165
  doc.querySelectorAll(`.${SELECTED_CLASS}-parents`).forEach((item) => {
173
166
  removeClassName(item, `${SELECTED_CLASS}-parents`);
174
167
  });
@@ -216,13 +209,10 @@ const up = (deltaTop, target) => {
216
209
  let swapIndex = upEls.length - 1;
217
210
  for (let i = upEls.length - 1; i >= 0; i--) {
218
211
  const ele = upEls[i];
219
- if (!ele)
220
- continue;
221
- if (ele.style.position === "fixed")
222
- continue;
212
+ if (!ele) continue;
213
+ if (ele.style.position === "fixed") continue;
223
214
  addUpH += ele.clientHeight / 2;
224
- if (-deltaTop <= addUpH)
225
- break;
215
+ if (-deltaTop <= addUpH) break;
226
216
  addUpH += ele.clientHeight / 2;
227
217
  swapIndex = i;
228
218
  }
@@ -497,13 +487,11 @@ class DragResizeHelper {
497
487
  const frameSnapShot = this.framesSnapShot.find(
498
488
  (frameItem) => frameItem.id === ev.target.id.replace(DRAG_EL_ID_PREFIX, "")
499
489
  );
500
- if (!frameSnapShot)
501
- return;
490
+ if (!frameSnapShot) return;
502
491
  const targeEl = this.targetList.find(
503
492
  (targetItem) => targetItem.id === ev.target.id.replace(DRAG_EL_ID_PREFIX, "")
504
493
  );
505
- if (!targeEl)
506
- return;
494
+ if (!targeEl) return;
507
495
  const isParentIncluded = this.targetList.find((targetItem) => targetItem.id === targeEl.parentElement?.id);
508
496
  if (!isParentIncluded) {
509
497
  const { marginLeft, marginTop } = getMarginValue(targeEl);
@@ -526,13 +514,11 @@ class DragResizeHelper {
526
514
  const frameSnapShot = this.framesSnapShot.find(
527
515
  (frameItem) => ev.target.id.startsWith(DRAG_EL_ID_PREFIX) && ev.target.id.endsWith(frameItem.id)
528
516
  );
529
- if (!frameSnapShot)
530
- return;
517
+ if (!frameSnapShot) return;
531
518
  const targeEl = this.targetList.find(
532
519
  (targetItem) => ev.target.id.startsWith(DRAG_EL_ID_PREFIX) && ev.target.id.endsWith(targetItem.id)
533
520
  );
534
- if (!targeEl)
535
- return;
521
+ if (!targeEl) return;
536
522
  const isParentIncluded = this.targetList.find((targetItem) => targetItem.id === targeEl.parentElement?.id);
537
523
  if (!isParentIncluded) {
538
524
  const { marginLeft, marginTop } = getMarginValue(targeEl);
@@ -570,14 +556,12 @@ class DragResizeHelper {
570
556
  * 多选状态设置多个节点的快照
571
557
  */
572
558
  setFramesSnapShot(events) {
573
- if (this.framesSnapShot.length > 0)
574
- return;
559
+ if (this.framesSnapShot.length > 0) return;
575
560
  events.forEach((ev) => {
576
561
  const matchEventTarget = this.targetList.find(
577
562
  (targetItem) => ev.target.id.startsWith(DRAG_EL_ID_PREFIX) && ev.target.id.endsWith(targetItem.id)
578
563
  );
579
- if (!matchEventTarget)
580
- return;
564
+ if (!matchEventTarget) return;
581
565
  this.framesSnapShot.push({
582
566
  left: matchEventTarget.offsetLeft,
583
567
  top: matchEventTarget.offsetTop,
@@ -879,16 +863,13 @@ class MoveableOptionsManager extends EventEmitter {
879
863
  const frame = globalThis.document.createDocumentFragment();
880
864
  for (const element of allElList) {
881
865
  let node = element.element || element;
882
- if (!node || typeof node === "string")
883
- continue;
866
+ if (!node || typeof node === "string") continue;
884
867
  if (typeof node === "function") {
885
868
  node = node();
886
869
  }
887
- if (this.isInElementList(node, selectedElList))
888
- continue;
870
+ if (this.isInElementList(node, selectedElList)) continue;
889
871
  const { width, height } = node.getBoundingClientRect();
890
- if (!width || !height)
891
- continue;
872
+ if (!width || !height) continue;
892
873
  const { left, top } = getOffset(node);
893
874
  const elementGuideline = globalThis.document.createElement("div");
894
875
  elementGuideline.style.cssText = `position: absolute;width: ${width}px;height: ${height}px;top: ${top}px;left: ${left}px`;
@@ -905,8 +886,7 @@ class MoveableOptionsManager extends EventEmitter {
905
886
  */
906
887
  isInElementList(ele, eleList) {
907
888
  for (const eleItem of eleList) {
908
- if (ele === eleItem)
909
- return true;
889
+ if (ele === eleItem) return true;
910
890
  }
911
891
  return false;
912
892
  }
@@ -965,10 +945,8 @@ class StageDragResize extends MoveableOptionsManager {
965
945
  * 初始化选中框并渲染出来
966
946
  */
967
947
  updateMoveable(el = this.target) {
968
- if (!this.moveable)
969
- return;
970
- if (!el)
971
- throw new Error("未选中任何节点");
948
+ if (!this.moveable) return;
949
+ if (!el) throw new Error("未选中任何节点");
972
950
  const options = this.init(el);
973
951
  Object.entries(options).forEach(([key, value]) => {
974
952
  this.moveable[key] = value;
@@ -976,8 +954,7 @@ class StageDragResize extends MoveableOptionsManager {
976
954
  this.moveable.updateRect();
977
955
  }
978
956
  clearSelectStatus() {
979
- if (!this.moveable)
980
- return;
957
+ if (!this.moveable) return;
981
958
  this.dragResizeHelper.destroyShadowEl();
982
959
  this.moveable.target = null;
983
960
  this.moveable.updateRect();
@@ -1026,16 +1003,13 @@ class StageDragResize extends MoveableOptionsManager {
1026
1003
  this.bindScaleEvent();
1027
1004
  }
1028
1005
  bindResizeEvent() {
1029
- if (!this.moveable)
1030
- throw new Error("moveable 未初始化");
1006
+ if (!this.moveable) throw new Error("moveable 未初始化");
1031
1007
  this.moveable.on("resizeStart", (e) => {
1032
- if (!this.target)
1033
- return;
1008
+ if (!this.target) return;
1034
1009
  this.dragStatus = StageDragStatus.START;
1035
1010
  this.dragResizeHelper.onResizeStart(e);
1036
1011
  }).on("resize", (e) => {
1037
- if (!this.moveable || !this.target || !this.dragResizeHelper.getShadowEl())
1038
- return;
1012
+ if (!this.moveable || !this.target || !this.dragResizeHelper.getShadowEl()) return;
1039
1013
  this.dragStatus = StageDragStatus.ING;
1040
1014
  this.dragResizeHelper.onResize(e);
1041
1015
  }).on("resizeEnd", () => {
@@ -1044,18 +1018,15 @@ class StageDragResize extends MoveableOptionsManager {
1044
1018
  });
1045
1019
  }
1046
1020
  bindDragEvent() {
1047
- if (!this.moveable)
1048
- throw new Error("moveable 未初始化");
1021
+ if (!this.moveable) throw new Error("moveable 未初始化");
1049
1022
  let timeout;
1050
1023
  this.moveable.on("dragStart", (e) => {
1051
- if (!this.target)
1052
- throw new Error("未选中组件");
1024
+ if (!this.target) throw new Error("未选中组件");
1053
1025
  this.dragStatus = StageDragStatus.START;
1054
1026
  this.dragResizeHelper.onDragStart(e);
1055
1027
  this.emit("drag-start", e);
1056
1028
  }).on("drag", (e) => {
1057
- if (!this.target || !this.dragResizeHelper.getShadowEl())
1058
- return;
1029
+ if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
1059
1030
  if (timeout) {
1060
1031
  globalThis.clearTimeout(timeout);
1061
1032
  timeout = void 0;
@@ -1087,14 +1058,12 @@ class StageDragResize extends MoveableOptionsManager {
1087
1058
  });
1088
1059
  }
1089
1060
  bindRotateEvent() {
1090
- if (!this.moveable)
1091
- throw new Error("moveable 未初始化");
1061
+ if (!this.moveable) throw new Error("moveable 未初始化");
1092
1062
  this.moveable.on("rotateStart", (e) => {
1093
1063
  this.dragStatus = StageDragStatus.START;
1094
1064
  this.dragResizeHelper.onRotateStart(e);
1095
1065
  }).on("rotate", (e) => {
1096
- if (!this.target || !this.dragResizeHelper.getShadowEl())
1097
- return;
1066
+ if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
1098
1067
  this.dragStatus = StageDragStatus.ING;
1099
1068
  this.dragResizeHelper.onRotate(e);
1100
1069
  }).on("rotateEnd", (e) => {
@@ -1116,14 +1085,12 @@ class StageDragResize extends MoveableOptionsManager {
1116
1085
  });
1117
1086
  }
1118
1087
  bindScaleEvent() {
1119
- if (!this.moveable)
1120
- throw new Error("moveable 未初始化");
1088
+ if (!this.moveable) throw new Error("moveable 未初始化");
1121
1089
  this.moveable.on("scaleStart", (e) => {
1122
1090
  this.dragStatus = StageDragStatus.START;
1123
1091
  this.dragResizeHelper.onScaleStart(e);
1124
1092
  }).on("scale", (e) => {
1125
- if (!this.target || !this.dragResizeHelper.getShadowEl())
1126
- return;
1093
+ if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
1127
1094
  this.dragStatus = StageDragStatus.ING;
1128
1095
  this.dragResizeHelper.onScale(e);
1129
1096
  }).on("scaleEnd", (e) => {
@@ -1145,8 +1112,7 @@ class StageDragResize extends MoveableOptionsManager {
1145
1112
  });
1146
1113
  }
1147
1114
  sort() {
1148
- if (!this.target || !this.dragResizeHelper.getGhostEl())
1149
- throw new Error("未知错误");
1115
+ if (!this.target || !this.dragResizeHelper.getGhostEl()) throw new Error("未知错误");
1150
1116
  const { top } = this.dragResizeHelper.getGhostEl().getBoundingClientRect();
1151
1117
  const { top: oriTop } = this.target.getBoundingClientRect();
1152
1118
  const deltaTop = top - oriTop;
@@ -1164,11 +1130,9 @@ class StageDragResize extends MoveableOptionsManager {
1164
1130
  }
1165
1131
  }
1166
1132
  update(isResize = false, parentEl = null) {
1167
- if (!this.target)
1168
- return;
1133
+ if (!this.target) return;
1169
1134
  const doc = this.getRenderDocument();
1170
- if (!doc)
1171
- return;
1135
+ if (!doc) return;
1172
1136
  const rect = this.dragResizeHelper.getUpdatedElRect(this.target, parentEl, doc);
1173
1137
  this.emit("update", {
1174
1138
  data: [
@@ -1204,8 +1168,7 @@ class StageHighlight extends EventEmitter$1 {
1204
1168
  * @param el 选中组件的Dom节点元素
1205
1169
  */
1206
1170
  highlight(el) {
1207
- if (!el || el === this.target)
1208
- return;
1171
+ if (!el || el === this.target) return;
1209
1172
  this.target = el;
1210
1173
  this.targetShadow?.update(el);
1211
1174
  if (this.moveable) {
@@ -1224,8 +1187,7 @@ class StageHighlight extends EventEmitter$1 {
1224
1187
  * 清空高亮
1225
1188
  */
1226
1189
  clearHighlight() {
1227
- if (!this.moveable || !this.target)
1228
- return;
1190
+ if (!this.moveable || !this.target) return;
1229
1191
  this.moveable.zoom = 0;
1230
1192
  this.moveable.updateRect();
1231
1193
  this.target = void 0;
@@ -1344,10 +1306,8 @@ class StageMultiDragResize extends MoveableOptionsManager {
1344
1306
  return true;
1345
1307
  }
1346
1308
  updateMoveable(eleList = this.targetList) {
1347
- if (!this.moveableForMulti)
1348
- return;
1349
- if (!eleList)
1350
- throw new Error("未选中任何节点");
1309
+ if (!this.moveableForMulti) return;
1310
+ if (!eleList) throw new Error("未选中任何节点");
1351
1311
  this.targetList = eleList;
1352
1312
  this.dragResizeHelper.setTargetList(eleList);
1353
1313
  const options = this.getOptions(true, {
@@ -1362,8 +1322,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
1362
1322
  * 清除多选状态
1363
1323
  */
1364
1324
  clearSelectStatus() {
1365
- if (!this.moveableForMulti)
1366
- return;
1325
+ if (!this.moveableForMulti) return;
1367
1326
  this.dragResizeHelper.clearMultiSelectStatus();
1368
1327
  this.moveableForMulti.target = null;
1369
1328
  this.moveableForMulti.updateTarget();
@@ -1387,11 +1346,9 @@ class StageMultiDragResize extends MoveableOptionsManager {
1387
1346
  * @param isResize 是否进行大小缩放
1388
1347
  */
1389
1348
  update(isResize = false, parentEl = null) {
1390
- if (this.targetList.length === 0)
1391
- return;
1349
+ if (this.targetList.length === 0) return;
1392
1350
  const doc = this.getRenderDocument();
1393
- if (!doc)
1394
- return;
1351
+ if (!doc) return;
1395
1352
  const data = this.targetList.map((targetItem) => {
1396
1353
  const rect = this.dragResizeHelper.getUpdatedElRect(targetItem, parentEl, doc);
1397
1354
  return {
@@ -1542,8 +1499,7 @@ class ActionManager extends EventEmitter {
1542
1499
  const stop = () => stopped = true;
1543
1500
  for (const el of els) {
1544
1501
  if (!el.id.startsWith(GHOST_EL_ID_PREFIX) && await this.isElCanSelect(el, event, stop)) {
1545
- if (stopped)
1546
- break;
1502
+ if (stopped) break;
1547
1503
  return el;
1548
1504
  }
1549
1505
  }
@@ -1558,8 +1514,7 @@ class ActionManager extends EventEmitter {
1558
1514
  */
1559
1515
  async isElCanSelect(el, event, stop) {
1560
1516
  const canSelectByProp = await this.canSelect(el, event, stop);
1561
- if (!canSelectByProp)
1562
- return false;
1517
+ if (!canSelectByProp) return false;
1563
1518
  if (this.isMultiSelectStatus) {
1564
1519
  return this.canMultiSelect(el, stop);
1565
1520
  }
@@ -1613,8 +1568,7 @@ class ActionManager extends EventEmitter {
1613
1568
  this.clearHighlight();
1614
1569
  return;
1615
1570
  }
1616
- if (el === this.highlightedEl || !el)
1617
- return;
1571
+ if (el === this.highlightedEl || !el) return;
1618
1572
  this.highlightLayer.highlight(el);
1619
1573
  this.highlightedEl = el;
1620
1574
  this.emit("highlight", el);
@@ -1642,8 +1596,7 @@ class ActionManager extends EventEmitter {
1642
1596
  */
1643
1597
  async addContainerHighlightClassName(event, excludeElList) {
1644
1598
  const doc = this.getRenderDocument();
1645
- if (!doc)
1646
- return;
1599
+ if (!doc) return;
1647
1600
  const els = this.getElementsFromPoint(event);
1648
1601
  for (const el of els) {
1649
1602
  if (!el.id.startsWith(GHOST_EL_ID_PREFIX) && await this.isContainer?.(el) && !excludeElList.includes(el)) {
@@ -1709,8 +1662,7 @@ class ActionManager extends EventEmitter {
1709
1662
  this.emit("select-parent");
1710
1663
  }).on(AbleActionEventType.REMOVE, () => {
1711
1664
  const drTarget = this.dr.getTarget();
1712
- if (!drTarget)
1713
- return;
1665
+ if (!drTarget) return;
1714
1666
  const data = {
1715
1667
  data: [{ el: drTarget }]
1716
1668
  };
@@ -1737,8 +1689,7 @@ class ActionManager extends EventEmitter {
1737
1689
  multiDr?.on("update", (data) => {
1738
1690
  this.emit("multi-update", data);
1739
1691
  }).on("change-to-select", (id, e) => {
1740
- if (this.isMultiSelectStatus)
1741
- return;
1692
+ if (this.isMultiSelectStatus) return;
1742
1693
  this.emit("change-to-select", id, e);
1743
1694
  });
1744
1695
  return multiDr;
@@ -1769,8 +1720,7 @@ class ActionManager extends EventEmitter {
1769
1720
  */
1770
1721
  async beforeMultiSelect(event) {
1771
1722
  const el = await this.getElementFromPoint(event);
1772
- if (!el)
1773
- return;
1723
+ if (!el) return;
1774
1724
  if (this.selectedEl && !this.selectedEl.className.includes(PAGE_CLASS)) {
1775
1725
  this.selectedElList.push(this.selectedEl);
1776
1726
  this.setSelectedEl(null);
@@ -1848,8 +1798,7 @@ class ActionManager extends EventEmitter {
1848
1798
  this.clearHighlight();
1849
1799
  event.stopImmediatePropagation();
1850
1800
  event.stopPropagation();
1851
- if (this.isStopTriggerSelect(event))
1852
- return;
1801
+ if (this.isStopTriggerSelect(event)) return;
1853
1802
  this.container.removeEventListener("mousemove", this.mouseMoveHandler);
1854
1803
  if (this.isMultiSelectStatus) {
1855
1804
  await this.beforeMultiSelect(event);
@@ -1858,17 +1807,14 @@ class ActionManager extends EventEmitter {
1858
1807
  }
1859
1808
  } else {
1860
1809
  const el = await this.getElementFromPoint(event);
1861
- if (!el)
1862
- return;
1810
+ if (!el) return;
1863
1811
  this.emit("before-select", el, event);
1864
1812
  }
1865
1813
  getDocument().addEventListener("mouseup", this.mouseUpHandler);
1866
1814
  };
1867
1815
  isStopTriggerSelect(event) {
1868
- if (event.button !== MouseButton.LEFT && event.button !== MouseButton.RIGHT)
1869
- return true;
1870
- if (!event.target)
1871
- return true;
1816
+ if (event.button !== MouseButton.LEFT && event.button !== MouseButton.RIGHT) return true;
1817
+ if (!event.target) return true;
1872
1818
  const targetClassList = event.target.classList;
1873
1819
  if (!this.isMultiSelectStatus && targetClassList.contains("moveable-area")) {
1874
1820
  return true;
@@ -2110,8 +2056,7 @@ class StageMask extends Rule {
2110
2056
  * @param page 页面Dom节点
2111
2057
  */
2112
2058
  observe(page) {
2113
- if (!page)
2114
- return;
2059
+ if (!page) return;
2115
2060
  this.page = page;
2116
2061
  this.initObserverIntersection();
2117
2062
  this.initObserverWrapper();
@@ -2139,19 +2084,16 @@ class StageMask extends Rule {
2139
2084
  * @param el 将蒙层挂载到该Dom节点上
2140
2085
  */
2141
2086
  mount(el) {
2142
- if (!this.content)
2143
- throw new Error("content 不存在");
2087
+ if (!this.content) throw new Error("content 不存在");
2144
2088
  el.appendChild(this.wrapper);
2145
2089
  }
2146
2090
  setLayout(el) {
2147
2091
  this.setMode(isFixedParent(el) ? Mode.FIXED : Mode.ABSOLUTE);
2148
2092
  }
2149
2093
  scrollIntoView(el) {
2150
- if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth)
2151
- return;
2094
+ if (!this.page || el.getBoundingClientRect().left >= this.page.scrollWidth) return;
2152
2095
  el.scrollIntoView();
2153
- if (!this.pageScrollParent)
2154
- return;
2096
+ if (!this.pageScrollParent) return;
2155
2097
  this.scrollLeft = this.pageScrollParent.scrollLeft;
2156
2098
  this.scrollTop = this.pageScrollParent.scrollTop;
2157
2099
  this.scroll();
@@ -2275,23 +2217,16 @@ class StageMask extends Rule {
2275
2217
  * 由于滚动容器变化等因素,会导致当前滚动的距离不正确
2276
2218
  */
2277
2219
  fixScrollValue() {
2278
- if (this.scrollTop < 0)
2279
- this.scrollTop = 0;
2280
- if (this.scrollLeft < 0)
2281
- this.scrollLeft = 0;
2282
- if (this.maxScrollTop < this.scrollTop)
2283
- this.scrollTop = this.maxScrollTop;
2284
- if (this.maxScrollLeft < this.scrollLeft)
2285
- this.scrollLeft = this.maxScrollLeft;
2220
+ if (this.scrollTop < 0) this.scrollTop = 0;
2221
+ if (this.scrollLeft < 0) this.scrollLeft = 0;
2222
+ if (this.maxScrollTop < this.scrollTop) this.scrollTop = this.maxScrollTop;
2223
+ if (this.maxScrollLeft < this.scrollLeft) this.scrollLeft = this.maxScrollLeft;
2286
2224
  }
2287
2225
  mouseWheelHandler = (event) => {
2288
- if (!this.page)
2289
- throw new Error("page 未初始化");
2226
+ if (!this.page) throw new Error("page 未初始化");
2290
2227
  const { deltaY, deltaX } = event;
2291
- if (this.page.clientHeight < this.wrapperHeight && deltaY)
2292
- return;
2293
- if (this.page.clientWidth < this.wrapperWidth && deltaX)
2294
- return;
2228
+ if (this.page.clientHeight < this.wrapperHeight && deltaY) return;
2229
+ if (this.page.clientWidth < this.wrapperWidth && deltaX) return;
2295
2230
  if (this.maxScrollTop > 0) {
2296
2231
  this.scrollTop = this.scrollTop + deltaY;
2297
2232
  }
@@ -2377,8 +2312,7 @@ class StageRender extends EventEmitter$1 {
2377
2312
  }
2378
2313
  }
2379
2314
  getRuntime = () => {
2380
- if (this.runtime)
2381
- return Promise.resolve(this.runtime);
2315
+ if (this.runtime) return Promise.resolve(this.runtime);
2382
2316
  return new Promise((resolve) => {
2383
2317
  const listener = (runtime) => {
2384
2318
  this.off("runtime-ready", listener);
@@ -2463,8 +2397,7 @@ class StageRender extends EventEmitter$1 {
2463
2397
  if (!this.contentWindow?.magic) {
2464
2398
  this.postTmagicRuntimeReady();
2465
2399
  }
2466
- if (!this.contentWindow)
2467
- return;
2400
+ if (!this.contentWindow) return;
2468
2401
  if (this.customizedRender) {
2469
2402
  const el = await this.customizedRender();
2470
2403
  if (el) {
@@ -2523,8 +2456,7 @@ class StageCore extends EventEmitter$1 {
2523
2456
  */
2524
2457
  async select(id, event) {
2525
2458
  const el = this.renderer.getTargetElement(id);
2526
- if (el === this.actionManager.getSelectedEl())
2527
- return;
2459
+ if (el === this.actionManager.getSelectedEl()) return;
2528
2460
  await this.renderer.select([id]);
2529
2461
  el && this.mask.setLayout(el);
2530
2462
  this.actionManager.select(el, event);
@@ -2538,8 +2470,7 @@ class StageCore extends EventEmitter$1 {
2538
2470
  */
2539
2471
  async multiSelect(ids) {
2540
2472
  const els = ids.map((id) => this.renderer.getTargetElement(id)).filter((el) => Boolean(el));
2541
- if (els.length === 0)
2542
- return;
2473
+ if (els.length === 0) return;
2543
2474
  const lastEl = els[els.length - 1];
2544
2475
  const isReduceSelect = els.length < this.actionManager.getSelectedElList().length;
2545
2476
  await this.renderer.select(ids);