@tmagic/stage 1.5.5 → 1.5.7
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/tmagic-stage.js +17 -18
- package/dist/tmagic-stage.umd.cjs +2552 -76
- package/package.json +3 -12
- package/src/ActionManager.ts +2 -3
- package/src/DragResizeHelper.ts +1 -1
- package/src/StageCore.ts +2 -2
- package/src/StageDragResize.ts +1 -1
- package/src/StageMask.ts +1 -1
- package/src/StageMultiDragResize.ts +1 -1
- package/src/StageRender.ts +2 -2
- package/src/TargetShadow.ts +1 -1
- package/src/types.ts +1 -1
- package/src/util.ts +1 -1
- package/types/index.d.ts +1 -2
package/dist/tmagic-stage.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
2
|
-
import { removeClassName, getIdFromEl, guid, setIdToEl, getElById, calcValueByFontsize, addClassName, removeClassNameByClassName, getDocument, createDiv, injectStyle, isSameDomain, getHost } from '@tmagic/
|
|
2
|
+
import { removeClassName, getIdFromEl, guid, setIdToEl, getElById, calcValueByFontsize, addClassName, removeClassNameByClassName, Env, getDocument, createDiv, injectStyle, isSameDomain, getHost } from '@tmagic/core';
|
|
3
3
|
import KeyController from 'keycon';
|
|
4
4
|
import { merge, throttle } from 'lodash-es';
|
|
5
|
-
import { Env } from '@tmagic/core';
|
|
6
5
|
import MoveableHelper from 'moveable-helper';
|
|
7
6
|
import Moveable__default from 'moveable';
|
|
8
7
|
export * from 'moveable';
|
|
@@ -294,7 +293,7 @@ class TargetShadow {
|
|
|
294
293
|
}
|
|
295
294
|
destroyEl() {
|
|
296
295
|
this.el?.remove();
|
|
297
|
-
this.el =
|
|
296
|
+
this.el = undefined;
|
|
298
297
|
}
|
|
299
298
|
destroyEls() {
|
|
300
299
|
this.els.forEach((el) => {
|
|
@@ -454,7 +453,7 @@ class DragResizeHelper {
|
|
|
454
453
|
}
|
|
455
454
|
destroyGhostEl() {
|
|
456
455
|
this.ghostEl?.remove();
|
|
457
|
-
this.ghostEl =
|
|
456
|
+
this.ghostEl = undefined;
|
|
458
457
|
}
|
|
459
458
|
clear() {
|
|
460
459
|
this.moveableHelper.clear();
|
|
@@ -803,7 +802,7 @@ class MoveableOptionsManager extends EventEmitter {
|
|
|
803
802
|
top: 0,
|
|
804
803
|
left: 0,
|
|
805
804
|
right: this.container.clientWidth,
|
|
806
|
-
bottom: isSortable ?
|
|
805
|
+
bottom: isSortable ? undefined : this.container.clientHeight
|
|
807
806
|
}
|
|
808
807
|
};
|
|
809
808
|
const differenceOptions = isMultiSelect ? this.getMultiOptions() : this.getSingleOptions();
|
|
@@ -953,7 +952,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
953
952
|
select(el, event) {
|
|
954
953
|
if (!el) {
|
|
955
954
|
this.moveable?.destroy();
|
|
956
|
-
this.moveable =
|
|
955
|
+
this.moveable = undefined;
|
|
957
956
|
return;
|
|
958
957
|
}
|
|
959
958
|
if (!this.moveable || el !== this.target) {
|
|
@@ -1054,7 +1053,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
1054
1053
|
if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
|
|
1055
1054
|
if (timeout) {
|
|
1056
1055
|
globalThis.clearTimeout(timeout);
|
|
1057
|
-
timeout =
|
|
1056
|
+
timeout = undefined;
|
|
1058
1057
|
}
|
|
1059
1058
|
timeout = this.delayedMarkContainer(e.inputEvent, [this.target]);
|
|
1060
1059
|
this.dragStatus = StageDragStatus.ING;
|
|
@@ -1062,7 +1061,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
1062
1061
|
}).on("dragEnd", () => {
|
|
1063
1062
|
if (timeout) {
|
|
1064
1063
|
globalThis.clearTimeout(timeout);
|
|
1065
|
-
timeout =
|
|
1064
|
+
timeout = undefined;
|
|
1066
1065
|
}
|
|
1067
1066
|
const parentEl = this.markContainerEnd();
|
|
1068
1067
|
if (this.dragStatus === StageDragStatus.ING) {
|
|
@@ -1216,17 +1215,17 @@ class StageHighlight extends EventEmitter$1 {
|
|
|
1216
1215
|
if (!this.moveable || !this.target) return;
|
|
1217
1216
|
this.moveable.zoom = 0;
|
|
1218
1217
|
this.moveable.updateRect();
|
|
1219
|
-
this.target =
|
|
1218
|
+
this.target = undefined;
|
|
1220
1219
|
}
|
|
1221
1220
|
/**
|
|
1222
1221
|
* 销毁实例
|
|
1223
1222
|
*/
|
|
1224
1223
|
destroy() {
|
|
1225
|
-
this.target =
|
|
1224
|
+
this.target = undefined;
|
|
1226
1225
|
this.moveable?.destroy();
|
|
1227
1226
|
this.targetShadow?.destroy();
|
|
1228
|
-
this.moveable =
|
|
1229
|
-
this.targetShadow =
|
|
1227
|
+
this.moveable = undefined;
|
|
1228
|
+
this.targetShadow = undefined;
|
|
1230
1229
|
}
|
|
1231
1230
|
}
|
|
1232
1231
|
|
|
@@ -1296,7 +1295,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1296
1295
|
}).on("dragGroup", (e) => {
|
|
1297
1296
|
if (timeout) {
|
|
1298
1297
|
globalThis.clearTimeout(timeout);
|
|
1299
|
-
timeout =
|
|
1298
|
+
timeout = undefined;
|
|
1300
1299
|
}
|
|
1301
1300
|
timeout = this.delayedMarkContainer(e.inputEvent, this.targetList);
|
|
1302
1301
|
this.dragResizeHelper.onDragGroup(e);
|
|
@@ -1304,7 +1303,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1304
1303
|
}).on("dragGroupEnd", () => {
|
|
1305
1304
|
if (timeout) {
|
|
1306
1305
|
globalThis.clearTimeout(timeout);
|
|
1307
|
-
timeout =
|
|
1306
|
+
timeout = undefined;
|
|
1308
1307
|
}
|
|
1309
1308
|
const parentEl = this.markContainerEnd();
|
|
1310
1309
|
this.update(false, parentEl);
|
|
@@ -1603,7 +1602,7 @@ class ActionManager extends EventEmitter {
|
|
|
1603
1602
|
this.emit("highlight", el);
|
|
1604
1603
|
}
|
|
1605
1604
|
clearHighlight() {
|
|
1606
|
-
this.setHighlightEl(
|
|
1605
|
+
this.setHighlightEl(undefined);
|
|
1607
1606
|
this.highlightLayer?.clearHighlight();
|
|
1608
1607
|
}
|
|
1609
1608
|
/**
|
|
@@ -1647,7 +1646,7 @@ class ActionManager extends EventEmitter {
|
|
|
1647
1646
|
this.addContainerHighlightClassName(event, excludeElList);
|
|
1648
1647
|
}, this.containerHighlightDuration);
|
|
1649
1648
|
}
|
|
1650
|
-
return
|
|
1649
|
+
return undefined;
|
|
1651
1650
|
}
|
|
1652
1651
|
getDragStatus() {
|
|
1653
1652
|
return this.dr?.getDragStatus();
|
|
@@ -2407,7 +2406,7 @@ class StageRender extends EventEmitter$1 {
|
|
|
2407
2406
|
this.iframe?.removeEventListener("load", this.iframeLoadHandler);
|
|
2408
2407
|
this.contentWindow = null;
|
|
2409
2408
|
this.iframe?.remove();
|
|
2410
|
-
this.iframe =
|
|
2409
|
+
this.iframe = undefined;
|
|
2411
2410
|
this.removeAllListeners();
|
|
2412
2411
|
}
|
|
2413
2412
|
on(eventName, listener) {
|
|
@@ -2627,7 +2626,7 @@ class StageCore extends EventEmitter$1 {
|
|
|
2627
2626
|
actionManager?.destroy();
|
|
2628
2627
|
pageResizeObserver?.disconnect();
|
|
2629
2628
|
this.removeAllListeners();
|
|
2630
|
-
this.container =
|
|
2629
|
+
this.container = undefined;
|
|
2631
2630
|
this.renderer = null;
|
|
2632
2631
|
this.mask = null;
|
|
2633
2632
|
this.actionManager = null;
|