@tmagic/stage 1.5.12 → 1.5.13
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 +16 -16
- package/dist/tmagic-stage.umd.cjs +16 -16
- package/package.json +2 -2
- package/types/index.d.ts +3 -2
package/dist/tmagic-stage.js
CHANGED
|
@@ -293,7 +293,7 @@ class TargetShadow {
|
|
|
293
293
|
}
|
|
294
294
|
destroyEl() {
|
|
295
295
|
this.el?.remove();
|
|
296
|
-
this.el =
|
|
296
|
+
this.el = void 0;
|
|
297
297
|
}
|
|
298
298
|
destroyEls() {
|
|
299
299
|
this.els.forEach((el) => {
|
|
@@ -453,7 +453,7 @@ class DragResizeHelper {
|
|
|
453
453
|
}
|
|
454
454
|
destroyGhostEl() {
|
|
455
455
|
this.ghostEl?.remove();
|
|
456
|
-
this.ghostEl =
|
|
456
|
+
this.ghostEl = void 0;
|
|
457
457
|
}
|
|
458
458
|
clear() {
|
|
459
459
|
this.moveableHelper.clear();
|
|
@@ -802,7 +802,7 @@ class MoveableOptionsManager extends EventEmitter {
|
|
|
802
802
|
top: 0,
|
|
803
803
|
left: 0,
|
|
804
804
|
right: this.container.clientWidth,
|
|
805
|
-
bottom: isSortable ?
|
|
805
|
+
bottom: isSortable ? void 0 : this.container.clientHeight
|
|
806
806
|
}
|
|
807
807
|
};
|
|
808
808
|
const differenceOptions = isMultiSelect ? this.getMultiOptions() : this.getSingleOptions();
|
|
@@ -952,7 +952,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
952
952
|
select(el, event) {
|
|
953
953
|
if (!el) {
|
|
954
954
|
this.moveable?.destroy();
|
|
955
|
-
this.moveable =
|
|
955
|
+
this.moveable = void 0;
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
958
|
if (!this.moveable || el !== this.target) {
|
|
@@ -1053,7 +1053,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
1053
1053
|
if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
|
|
1054
1054
|
if (timeout) {
|
|
1055
1055
|
globalThis.clearTimeout(timeout);
|
|
1056
|
-
timeout =
|
|
1056
|
+
timeout = void 0;
|
|
1057
1057
|
}
|
|
1058
1058
|
timeout = this.delayedMarkContainer(e.inputEvent, [this.target]);
|
|
1059
1059
|
this.dragStatus = StageDragStatus.ING;
|
|
@@ -1061,7 +1061,7 @@ class StageDragResize extends MoveableOptionsManager {
|
|
|
1061
1061
|
}).on("dragEnd", () => {
|
|
1062
1062
|
if (timeout) {
|
|
1063
1063
|
globalThis.clearTimeout(timeout);
|
|
1064
|
-
timeout =
|
|
1064
|
+
timeout = void 0;
|
|
1065
1065
|
}
|
|
1066
1066
|
const parentEl = this.markContainerEnd();
|
|
1067
1067
|
if (this.dragStatus === StageDragStatus.ING) {
|
|
@@ -1215,17 +1215,17 @@ class StageHighlight extends EventEmitter$1 {
|
|
|
1215
1215
|
if (!this.moveable || !this.target) return;
|
|
1216
1216
|
this.moveable.zoom = 0;
|
|
1217
1217
|
this.moveable.updateRect();
|
|
1218
|
-
this.target =
|
|
1218
|
+
this.target = void 0;
|
|
1219
1219
|
}
|
|
1220
1220
|
/**
|
|
1221
1221
|
* 销毁实例
|
|
1222
1222
|
*/
|
|
1223
1223
|
destroy() {
|
|
1224
|
-
this.target =
|
|
1224
|
+
this.target = void 0;
|
|
1225
1225
|
this.moveable?.destroy();
|
|
1226
1226
|
this.targetShadow?.destroy();
|
|
1227
|
-
this.moveable =
|
|
1228
|
-
this.targetShadow =
|
|
1227
|
+
this.moveable = void 0;
|
|
1228
|
+
this.targetShadow = void 0;
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
|
|
@@ -1295,7 +1295,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1295
1295
|
}).on("dragGroup", (e) => {
|
|
1296
1296
|
if (timeout) {
|
|
1297
1297
|
globalThis.clearTimeout(timeout);
|
|
1298
|
-
timeout =
|
|
1298
|
+
timeout = void 0;
|
|
1299
1299
|
}
|
|
1300
1300
|
timeout = this.delayedMarkContainer(e.inputEvent, this.targetList);
|
|
1301
1301
|
this.dragResizeHelper.onDragGroup(e);
|
|
@@ -1303,7 +1303,7 @@ class StageMultiDragResize extends MoveableOptionsManager {
|
|
|
1303
1303
|
}).on("dragGroupEnd", () => {
|
|
1304
1304
|
if (timeout) {
|
|
1305
1305
|
globalThis.clearTimeout(timeout);
|
|
1306
|
-
timeout =
|
|
1306
|
+
timeout = void 0;
|
|
1307
1307
|
}
|
|
1308
1308
|
const parentEl = this.markContainerEnd();
|
|
1309
1309
|
this.update(false, parentEl);
|
|
@@ -1602,7 +1602,7 @@ class ActionManager extends EventEmitter {
|
|
|
1602
1602
|
this.emit("highlight", el);
|
|
1603
1603
|
}
|
|
1604
1604
|
clearHighlight() {
|
|
1605
|
-
this.setHighlightEl(
|
|
1605
|
+
this.setHighlightEl(void 0);
|
|
1606
1606
|
this.highlightLayer?.clearHighlight();
|
|
1607
1607
|
}
|
|
1608
1608
|
/**
|
|
@@ -1646,7 +1646,7 @@ class ActionManager extends EventEmitter {
|
|
|
1646
1646
|
this.addContainerHighlightClassName(event, excludeElList);
|
|
1647
1647
|
}, this.containerHighlightDuration);
|
|
1648
1648
|
}
|
|
1649
|
-
return
|
|
1649
|
+
return void 0;
|
|
1650
1650
|
}
|
|
1651
1651
|
getDragStatus() {
|
|
1652
1652
|
return this.dr?.getDragStatus();
|
|
@@ -2409,7 +2409,7 @@ class StageRender extends EventEmitter$1 {
|
|
|
2409
2409
|
this.iframe?.removeEventListener("load", this.iframeLoadHandler);
|
|
2410
2410
|
this.contentWindow = null;
|
|
2411
2411
|
this.iframe?.remove();
|
|
2412
|
-
this.iframe =
|
|
2412
|
+
this.iframe = void 0;
|
|
2413
2413
|
this.removeAllListeners();
|
|
2414
2414
|
}
|
|
2415
2415
|
on(eventName, listener) {
|
|
@@ -2629,7 +2629,7 @@ class StageCore extends EventEmitter$1 {
|
|
|
2629
2629
|
actionManager?.destroy();
|
|
2630
2630
|
pageResizeObserver?.disconnect();
|
|
2631
2631
|
this.removeAllListeners();
|
|
2632
|
-
this.container =
|
|
2632
|
+
this.container = void 0;
|
|
2633
2633
|
this.renderer = null;
|
|
2634
2634
|
this.mask = null;
|
|
2635
2635
|
this.actionManager = null;
|
|
@@ -2766,7 +2766,7 @@
|
|
|
2766
2766
|
}
|
|
2767
2767
|
destroyEl() {
|
|
2768
2768
|
this.el?.remove();
|
|
2769
|
-
this.el =
|
|
2769
|
+
this.el = void 0;
|
|
2770
2770
|
}
|
|
2771
2771
|
destroyEls() {
|
|
2772
2772
|
this.els.forEach((el) => {
|
|
@@ -2926,7 +2926,7 @@
|
|
|
2926
2926
|
}
|
|
2927
2927
|
destroyGhostEl() {
|
|
2928
2928
|
this.ghostEl?.remove();
|
|
2929
|
-
this.ghostEl =
|
|
2929
|
+
this.ghostEl = void 0;
|
|
2930
2930
|
}
|
|
2931
2931
|
clear() {
|
|
2932
2932
|
this.moveableHelper.clear();
|
|
@@ -3275,7 +3275,7 @@
|
|
|
3275
3275
|
top: 0,
|
|
3276
3276
|
left: 0,
|
|
3277
3277
|
right: this.container.clientWidth,
|
|
3278
|
-
bottom: isSortable ?
|
|
3278
|
+
bottom: isSortable ? void 0 : this.container.clientHeight
|
|
3279
3279
|
}
|
|
3280
3280
|
};
|
|
3281
3281
|
const differenceOptions = isMultiSelect ? this.getMultiOptions() : this.getSingleOptions();
|
|
@@ -3425,7 +3425,7 @@
|
|
|
3425
3425
|
select(el, event) {
|
|
3426
3426
|
if (!el) {
|
|
3427
3427
|
this.moveable?.destroy();
|
|
3428
|
-
this.moveable =
|
|
3428
|
+
this.moveable = void 0;
|
|
3429
3429
|
return;
|
|
3430
3430
|
}
|
|
3431
3431
|
if (!this.moveable || el !== this.target) {
|
|
@@ -3526,7 +3526,7 @@
|
|
|
3526
3526
|
if (!this.target || !this.dragResizeHelper.getShadowEl()) return;
|
|
3527
3527
|
if (timeout) {
|
|
3528
3528
|
globalThis.clearTimeout(timeout);
|
|
3529
|
-
timeout =
|
|
3529
|
+
timeout = void 0;
|
|
3530
3530
|
}
|
|
3531
3531
|
timeout = this.delayedMarkContainer(e.inputEvent, [this.target]);
|
|
3532
3532
|
this.dragStatus = StageDragStatus.ING;
|
|
@@ -3534,7 +3534,7 @@
|
|
|
3534
3534
|
}).on("dragEnd", () => {
|
|
3535
3535
|
if (timeout) {
|
|
3536
3536
|
globalThis.clearTimeout(timeout);
|
|
3537
|
-
timeout =
|
|
3537
|
+
timeout = void 0;
|
|
3538
3538
|
}
|
|
3539
3539
|
const parentEl = this.markContainerEnd();
|
|
3540
3540
|
if (this.dragStatus === StageDragStatus.ING) {
|
|
@@ -3688,17 +3688,17 @@
|
|
|
3688
3688
|
if (!this.moveable || !this.target) return;
|
|
3689
3689
|
this.moveable.zoom = 0;
|
|
3690
3690
|
this.moveable.updateRect();
|
|
3691
|
-
this.target =
|
|
3691
|
+
this.target = void 0;
|
|
3692
3692
|
}
|
|
3693
3693
|
/**
|
|
3694
3694
|
* 销毁实例
|
|
3695
3695
|
*/
|
|
3696
3696
|
destroy() {
|
|
3697
|
-
this.target =
|
|
3697
|
+
this.target = void 0;
|
|
3698
3698
|
this.moveable?.destroy();
|
|
3699
3699
|
this.targetShadow?.destroy();
|
|
3700
|
-
this.moveable =
|
|
3701
|
-
this.targetShadow =
|
|
3700
|
+
this.moveable = void 0;
|
|
3701
|
+
this.targetShadow = void 0;
|
|
3702
3702
|
}
|
|
3703
3703
|
}
|
|
3704
3704
|
|
|
@@ -3768,7 +3768,7 @@
|
|
|
3768
3768
|
}).on("dragGroup", (e) => {
|
|
3769
3769
|
if (timeout) {
|
|
3770
3770
|
globalThis.clearTimeout(timeout);
|
|
3771
|
-
timeout =
|
|
3771
|
+
timeout = void 0;
|
|
3772
3772
|
}
|
|
3773
3773
|
timeout = this.delayedMarkContainer(e.inputEvent, this.targetList);
|
|
3774
3774
|
this.dragResizeHelper.onDragGroup(e);
|
|
@@ -3776,7 +3776,7 @@
|
|
|
3776
3776
|
}).on("dragGroupEnd", () => {
|
|
3777
3777
|
if (timeout) {
|
|
3778
3778
|
globalThis.clearTimeout(timeout);
|
|
3779
|
-
timeout =
|
|
3779
|
+
timeout = void 0;
|
|
3780
3780
|
}
|
|
3781
3781
|
const parentEl = this.markContainerEnd();
|
|
3782
3782
|
this.update(false, parentEl);
|
|
@@ -4075,7 +4075,7 @@
|
|
|
4075
4075
|
this.emit("highlight", el);
|
|
4076
4076
|
}
|
|
4077
4077
|
clearHighlight() {
|
|
4078
|
-
this.setHighlightEl(
|
|
4078
|
+
this.setHighlightEl(void 0);
|
|
4079
4079
|
this.highlightLayer?.clearHighlight();
|
|
4080
4080
|
}
|
|
4081
4081
|
/**
|
|
@@ -4119,7 +4119,7 @@
|
|
|
4119
4119
|
this.addContainerHighlightClassName(event, excludeElList);
|
|
4120
4120
|
}, this.containerHighlightDuration);
|
|
4121
4121
|
}
|
|
4122
|
-
return
|
|
4122
|
+
return void 0;
|
|
4123
4123
|
}
|
|
4124
4124
|
getDragStatus() {
|
|
4125
4125
|
return this.dr?.getDragStatus();
|
|
@@ -4882,7 +4882,7 @@
|
|
|
4882
4882
|
this.iframe?.removeEventListener("load", this.iframeLoadHandler);
|
|
4883
4883
|
this.contentWindow = null;
|
|
4884
4884
|
this.iframe?.remove();
|
|
4885
|
-
this.iframe =
|
|
4885
|
+
this.iframe = void 0;
|
|
4886
4886
|
this.removeAllListeners();
|
|
4887
4887
|
}
|
|
4888
4888
|
on(eventName, listener) {
|
|
@@ -5102,7 +5102,7 @@
|
|
|
5102
5102
|
actionManager?.destroy();
|
|
5103
5103
|
pageResizeObserver?.disconnect();
|
|
5104
5104
|
this.removeAllListeners();
|
|
5105
|
-
this.container =
|
|
5105
|
+
this.container = void 0;
|
|
5106
5106
|
this.renderer = null;
|
|
5107
5107
|
this.mask = null;
|
|
5108
5108
|
this.actionManager = null;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.
|
|
2
|
+
"version": "1.5.13",
|
|
3
3
|
"name": "@tmagic/stage",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-stage.umd.cjs",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"typescript": "*",
|
|
45
|
-
"@tmagic/core": "1.5.
|
|
45
|
+
"@tmagic/core": "1.5.13"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"typescript": {
|
package/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _tmagic_editor from '@tmagic/editor';
|
|
|
2
2
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
3
3
|
import { OnResizeStart, OnResize, OnDragStart, OnDrag, OnRotateStart, OnRotate, OnScaleStart, OnScale, OnResizeGroupStart, OnResizeGroup, OnDragGroupStart, OnDragGroup, MoveableOptions, Renderer, MoveableManagerInterface } from 'moveable';
|
|
4
4
|
export * from 'moveable';
|
|
5
|
-
import Core, {
|
|
5
|
+
import Core, { MApp, Id, MNode, MContainer } from '@tmagic/core';
|
|
6
6
|
import Guides, { GuidesOptions } from '@scena/guides';
|
|
7
7
|
export { GuidesOptions } from '@scena/guides';
|
|
8
8
|
import MoveableHelper from 'moveable-helper';
|
|
@@ -1022,4 +1022,5 @@ declare const _default: (handler: (type: AbleActionEventType) => void, customize
|
|
|
1022
1022
|
render(moveable: MoveableManagerInterface<any, any>, React: Renderer): any;
|
|
1023
1023
|
};
|
|
1024
1024
|
|
|
1025
|
-
export { AbleActionEventType,
|
|
1025
|
+
export { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, _default as MoveableActionsAble, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragResize, StageDragStatus, StageMask, StageRender, ZIndex, addSelectedClassName, StageCore as default, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up };
|
|
1026
|
+
export type { AbleCustomizedButton, ActionManagerConfig, ActionManagerEvents, CanSelect, CoreEvents, CustomizeMoveableOptions, CustomizeMoveableOptionsCallbackConfig, CustomizeRender, DelayedMarkContainer, DrEvents, DragResizeHelperConfig, GetElementsFromPoint, GetRenderDocument, GetRootContainer, GetTargetElement, GuidesEventData, IsContainer, Magic, MarkContainerEnd, MaskEvents, MoveableOptionsManagerConfig, MultiDrEvents, Offset, Point, Rect, RemoveData, RemoveEventData, RenderEvents, RuleOptions, Runtime, RuntimeWindow, SortEventData, StageCoreConfig, StageDragResizeConfig, StageHighlightConfig, StageMaskConfig, StageMultiDragResizeConfig, StageRenderConfig, TargetElement, TargetShadowConfig, UpdateData, UpdateDragEl, UpdateEventData };
|