@tmagic/stage 1.8.0-beta.4 → 1.8.0-beta.5
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/es/StageCore.js +4 -1
- package/dist/es/StageFlashHighlight.js +17 -25
- package/dist/es/const.js +3 -1
- package/dist/es/index.js +2 -2
- package/dist/tmagic-stage.umd.cjs +22 -24
- package/package.json +2 -2
- package/src/StageCore.ts +4 -1
- package/src/StageFlashHighlight.ts +21 -28
- package/src/const.ts +3 -0
- package/src/types.ts +5 -0
- package/types/index.d.ts +10 -7
package/dist/es/StageCore.js
CHANGED
|
@@ -39,7 +39,10 @@ var StageCore = class extends EventEmitter {
|
|
|
39
39
|
disabledRule: config.disabledRule
|
|
40
40
|
});
|
|
41
41
|
this.actionManager = new ActionManager(this.getActionManagerConfig(config));
|
|
42
|
-
this.flashHighlight = new StageFlashHighlight({
|
|
42
|
+
this.flashHighlight = new StageFlashHighlight({
|
|
43
|
+
container: this.mask.content,
|
|
44
|
+
updateDragEl: config.updateDragEl
|
|
45
|
+
});
|
|
43
46
|
this.initRenderEvent();
|
|
44
47
|
this.initActionEvent();
|
|
45
48
|
this.initMaskEvent();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZIndex } from "./const.js";
|
|
2
|
-
import
|
|
1
|
+
import { FLASH_EL_ID_PREFIX, ZIndex } from "./const.js";
|
|
2
|
+
import TargetShadow from "./TargetShadow.js";
|
|
3
3
|
import { getDocument, injectStyle } from "@tmagic/core";
|
|
4
4
|
//#region packages/stage/src/StageFlashHighlight.ts
|
|
5
5
|
/** 闪烁提示节点的 class name */
|
|
@@ -14,13 +14,17 @@ var FLASH_DURATION = 1500;
|
|
|
14
14
|
* 帮助用户快速定位组件在画布中的位置。
|
|
15
15
|
*/
|
|
16
16
|
var StageFlashHighlight = class {
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
el;
|
|
17
|
+
/** 复用 TargetShadow 负责节点的定位校准(updateDragEl、fixed、滚动偏移等) */
|
|
18
|
+
targetShadow;
|
|
20
19
|
timer;
|
|
21
20
|
styleEl;
|
|
22
21
|
constructor(config) {
|
|
23
|
-
this.
|
|
22
|
+
this.targetShadow = new TargetShadow({
|
|
23
|
+
container: config.container,
|
|
24
|
+
updateDragEl: config.updateDragEl,
|
|
25
|
+
zIndex: ZIndex.SELECTED_EL,
|
|
26
|
+
idPrefix: FLASH_EL_ID_PREFIX
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* 在目标元素所在区域做一次高亮闪烁
|
|
@@ -30,23 +34,11 @@ var StageFlashHighlight = class {
|
|
|
30
34
|
if (!el) return;
|
|
31
35
|
this.injectStyle();
|
|
32
36
|
this.clear();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
flashEl.
|
|
37
|
-
flashEl.style.
|
|
38
|
-
position: absolute;
|
|
39
|
-
box-sizing: border-box;
|
|
40
|
-
pointer-events: none;
|
|
41
|
-
transform: ${transform};
|
|
42
|
-
left: ${offset.left}px;
|
|
43
|
-
top: ${offset.top}px;
|
|
44
|
-
width: ${el.clientWidth}px;
|
|
45
|
-
height: ${el.clientHeight}px;
|
|
46
|
-
z-index: ${ZIndex.SELECTED_EL};
|
|
47
|
-
`;
|
|
48
|
-
this.container.appendChild(flashEl);
|
|
49
|
-
this.el = flashEl;
|
|
37
|
+
const flashEl = this.targetShadow.update(el);
|
|
38
|
+
flashEl.classList.add(FLASH_TIP_CLASS_NAME);
|
|
39
|
+
flashEl.style.boxSizing = "border-box";
|
|
40
|
+
flashEl.style.pointerEvents = "none";
|
|
41
|
+
flashEl.style.border = "";
|
|
50
42
|
this.timer = globalThis.setTimeout(() => {
|
|
51
43
|
this.clear();
|
|
52
44
|
}, FLASH_DURATION);
|
|
@@ -59,14 +51,14 @@ var StageFlashHighlight = class {
|
|
|
59
51
|
globalThis.clearTimeout(this.timer);
|
|
60
52
|
this.timer = void 0;
|
|
61
53
|
}
|
|
62
|
-
this.
|
|
63
|
-
this.el = void 0;
|
|
54
|
+
this.targetShadow.destroyEl();
|
|
64
55
|
}
|
|
65
56
|
/**
|
|
66
57
|
* 销毁实例
|
|
67
58
|
*/
|
|
68
59
|
destroy() {
|
|
69
60
|
this.clear();
|
|
61
|
+
this.targetShadow.destroy();
|
|
70
62
|
this.styleEl?.remove();
|
|
71
63
|
this.styleEl = void 0;
|
|
72
64
|
}
|
package/dist/es/const.js
CHANGED
|
@@ -5,6 +5,8 @@ var GHOST_EL_ID_PREFIX = "ghost_el_";
|
|
|
5
5
|
var DRAG_EL_ID_PREFIX = "drag_el_";
|
|
6
6
|
/** 高亮时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
7
7
|
var HIGHLIGHT_EL_ID_PREFIX = "highlight_el_";
|
|
8
|
+
/** 闪烁提示时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
9
|
+
var FLASH_EL_ID_PREFIX = "flash_el_";
|
|
8
10
|
var CONTAINER_HIGHLIGHT_CLASS_NAME = "tmagic-stage-container-highlight";
|
|
9
11
|
var PAGE_CLASS = "magic-ui-page";
|
|
10
12
|
/** 默认放到缩小倍数 */
|
|
@@ -88,4 +90,4 @@ var StageDragStatus = /* @__PURE__ */ function(StageDragStatus) {
|
|
|
88
90
|
return StageDragStatus;
|
|
89
91
|
}({});
|
|
90
92
|
//#endregion
|
|
91
|
-
export { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragStatus, ZIndex };
|
|
93
|
+
export { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, FLASH_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragStatus, ZIndex };
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragStatus, ZIndex } from "./const.js";
|
|
1
|
+
import { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, FLASH_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragStatus, ZIndex } from "./const.js";
|
|
2
2
|
import { addSelectedClassName, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up } from "./util.js";
|
|
3
3
|
import MoveableActionsAble_default from "./MoveableActionsAble.js";
|
|
4
4
|
import StageDragResize from "./StageDragResize.js";
|
|
@@ -9,4 +9,4 @@ export * from "moveable";
|
|
|
9
9
|
//#region packages/stage/src/index.ts
|
|
10
10
|
var src_default = StageCore;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, MoveableActionsAble_default as MoveableActionsAble, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragResize, StageDragStatus, StageMask, StageRender, ZIndex, addSelectedClassName, src_default as default, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up };
|
|
12
|
+
export { AbleActionEventType, CONTAINER_HIGHLIGHT_CLASS_NAME, ContainerHighlightType, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, FLASH_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GuidesType, HIGHLIGHT_EL_ID_PREFIX, Mode, MouseButton, MoveableActionsAble_default as MoveableActionsAble, PAGE_CLASS, RenderType, SELECTED_CLASS, SelectStatus, StageDragResize, StageDragStatus, StageMask, StageRender, ZIndex, addSelectedClassName, src_default as default, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up };
|
|
@@ -2175,6 +2175,8 @@
|
|
|
2175
2175
|
var DRAG_EL_ID_PREFIX = "drag_el_";
|
|
2176
2176
|
/** 高亮时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
2177
2177
|
var HIGHLIGHT_EL_ID_PREFIX = "highlight_el_";
|
|
2178
|
+
/** 闪烁提示时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
2179
|
+
var FLASH_EL_ID_PREFIX = "flash_el_";
|
|
2178
2180
|
var CONTAINER_HIGHLIGHT_CLASS_NAME = "tmagic-stage-container-highlight";
|
|
2179
2181
|
var PAGE_CLASS = "magic-ui-page";
|
|
2180
2182
|
/** 默认放到缩小倍数 */
|
|
@@ -4006,13 +4008,17 @@
|
|
|
4006
4008
|
* 帮助用户快速定位组件在画布中的位置。
|
|
4007
4009
|
*/
|
|
4008
4010
|
var StageFlashHighlight = class {
|
|
4009
|
-
/**
|
|
4010
|
-
|
|
4011
|
-
el;
|
|
4011
|
+
/** 复用 TargetShadow 负责节点的定位校准(updateDragEl、fixed、滚动偏移等) */
|
|
4012
|
+
targetShadow;
|
|
4012
4013
|
timer;
|
|
4013
4014
|
styleEl;
|
|
4014
4015
|
constructor(config) {
|
|
4015
|
-
this.
|
|
4016
|
+
this.targetShadow = new TargetShadow({
|
|
4017
|
+
container: config.container,
|
|
4018
|
+
updateDragEl: config.updateDragEl,
|
|
4019
|
+
zIndex: ZIndex.SELECTED_EL,
|
|
4020
|
+
idPrefix: FLASH_EL_ID_PREFIX
|
|
4021
|
+
});
|
|
4016
4022
|
}
|
|
4017
4023
|
/**
|
|
4018
4024
|
* 在目标元素所在区域做一次高亮闪烁
|
|
@@ -4022,23 +4028,11 @@
|
|
|
4022
4028
|
if (!el) return;
|
|
4023
4029
|
this.injectStyle();
|
|
4024
4030
|
this.clear();
|
|
4025
|
-
const
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
flashEl.
|
|
4029
|
-
flashEl.style.
|
|
4030
|
-
position: absolute;
|
|
4031
|
-
box-sizing: border-box;
|
|
4032
|
-
pointer-events: none;
|
|
4033
|
-
transform: ${transform};
|
|
4034
|
-
left: ${offset.left}px;
|
|
4035
|
-
top: ${offset.top}px;
|
|
4036
|
-
width: ${el.clientWidth}px;
|
|
4037
|
-
height: ${el.clientHeight}px;
|
|
4038
|
-
z-index: ${ZIndex.SELECTED_EL};
|
|
4039
|
-
`;
|
|
4040
|
-
this.container.appendChild(flashEl);
|
|
4041
|
-
this.el = flashEl;
|
|
4031
|
+
const flashEl = this.targetShadow.update(el);
|
|
4032
|
+
flashEl.classList.add(FLASH_TIP_CLASS_NAME);
|
|
4033
|
+
flashEl.style.boxSizing = "border-box";
|
|
4034
|
+
flashEl.style.pointerEvents = "none";
|
|
4035
|
+
flashEl.style.border = "";
|
|
4042
4036
|
this.timer = globalThis.setTimeout(() => {
|
|
4043
4037
|
this.clear();
|
|
4044
4038
|
}, FLASH_DURATION);
|
|
@@ -4051,14 +4045,14 @@
|
|
|
4051
4045
|
globalThis.clearTimeout(this.timer);
|
|
4052
4046
|
this.timer = void 0;
|
|
4053
4047
|
}
|
|
4054
|
-
this.
|
|
4055
|
-
this.el = void 0;
|
|
4048
|
+
this.targetShadow.destroyEl();
|
|
4056
4049
|
}
|
|
4057
4050
|
/**
|
|
4058
4051
|
* 销毁实例
|
|
4059
4052
|
*/
|
|
4060
4053
|
destroy() {
|
|
4061
4054
|
this.clear();
|
|
4055
|
+
this.targetShadow.destroy();
|
|
4062
4056
|
this.styleEl?.remove();
|
|
4063
4057
|
this.styleEl = void 0;
|
|
4064
4058
|
}
|
|
@@ -4717,7 +4711,10 @@
|
|
|
4717
4711
|
disabledRule: config.disabledRule
|
|
4718
4712
|
});
|
|
4719
4713
|
this.actionManager = new ActionManager(this.getActionManagerConfig(config));
|
|
4720
|
-
this.flashHighlight = new StageFlashHighlight({
|
|
4714
|
+
this.flashHighlight = new StageFlashHighlight({
|
|
4715
|
+
container: this.mask.content,
|
|
4716
|
+
updateDragEl: config.updateDragEl
|
|
4717
|
+
});
|
|
4721
4718
|
this.initRenderEvent();
|
|
4722
4719
|
this.initActionEvent();
|
|
4723
4720
|
this.initMaskEvent();
|
|
@@ -5040,6 +5037,7 @@
|
|
|
5040
5037
|
exports.ContainerHighlightType = ContainerHighlightType;
|
|
5041
5038
|
exports.DEFAULT_ZOOM = DEFAULT_ZOOM;
|
|
5042
5039
|
exports.DRAG_EL_ID_PREFIX = DRAG_EL_ID_PREFIX;
|
|
5040
|
+
exports.FLASH_EL_ID_PREFIX = FLASH_EL_ID_PREFIX;
|
|
5043
5041
|
exports.GHOST_EL_ID_PREFIX = GHOST_EL_ID_PREFIX;
|
|
5044
5042
|
exports.GuidesType = GuidesType;
|
|
5045
5043
|
exports.HIGHLIGHT_EL_ID_PREFIX = HIGHLIGHT_EL_ID_PREFIX;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-beta.
|
|
2
|
+
"version": "1.8.0-beta.5",
|
|
3
3
|
"name": "@tmagic/stage",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
|
-
"@tmagic/core": "1.8.0-beta.
|
|
47
|
+
"@tmagic/core": "1.8.0-beta.5"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"typescript": {
|
package/src/StageCore.ts
CHANGED
|
@@ -83,7 +83,10 @@ export default class StageCore extends EventEmitter {
|
|
|
83
83
|
disabledRule: config.disabledRule,
|
|
84
84
|
});
|
|
85
85
|
this.actionManager = new ActionManager(this.getActionManagerConfig(config));
|
|
86
|
-
this.flashHighlight = new StageFlashHighlight({
|
|
86
|
+
this.flashHighlight = new StageFlashHighlight({
|
|
87
|
+
container: this.mask.content,
|
|
88
|
+
updateDragEl: config.updateDragEl,
|
|
89
|
+
});
|
|
87
90
|
|
|
88
91
|
this.initRenderEvent();
|
|
89
92
|
this.initActionEvent();
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
import { getDocument, injectStyle } from '@tmagic/core';
|
|
20
20
|
|
|
21
|
-
import { ZIndex } from './const';
|
|
22
|
-
import
|
|
21
|
+
import { FLASH_EL_ID_PREFIX, ZIndex } from './const';
|
|
22
|
+
import TargetShadow from './TargetShadow';
|
|
23
|
+
import type { StageFlashHighlightConfig } from './types';
|
|
23
24
|
|
|
24
25
|
/** 闪烁提示节点的 class name */
|
|
25
26
|
export const FLASH_TIP_CLASS_NAME = 'tmagic-stage-flash-tip';
|
|
@@ -34,14 +35,18 @@ const FLASH_DURATION = 1500;
|
|
|
34
35
|
* 帮助用户快速定位组件在画布中的位置。
|
|
35
36
|
*/
|
|
36
37
|
export default class StageFlashHighlight {
|
|
37
|
-
/**
|
|
38
|
-
private
|
|
39
|
-
private el?: HTMLElement;
|
|
38
|
+
/** 复用 TargetShadow 负责节点的定位校准(updateDragEl、fixed、滚动偏移等) */
|
|
39
|
+
private targetShadow: TargetShadow;
|
|
40
40
|
private timer?: NodeJS.Timeout;
|
|
41
41
|
private styleEl?: HTMLStyleElement;
|
|
42
42
|
|
|
43
|
-
constructor(config:
|
|
44
|
-
this.
|
|
43
|
+
constructor(config: StageFlashHighlightConfig) {
|
|
44
|
+
this.targetShadow = new TargetShadow({
|
|
45
|
+
container: config.container,
|
|
46
|
+
updateDragEl: config.updateDragEl,
|
|
47
|
+
zIndex: ZIndex.SELECTED_EL,
|
|
48
|
+
idPrefix: FLASH_EL_ID_PREFIX,
|
|
49
|
+
});
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
/**
|
|
@@ -52,27 +57,15 @@ export default class StageFlashHighlight {
|
|
|
52
57
|
if (!el) return;
|
|
53
58
|
|
|
54
59
|
this.injectStyle();
|
|
60
|
+
// 先销毁旧节点再 update,确保每次都拿到全新节点,让闪烁动画重新播放
|
|
55
61
|
this.clear();
|
|
56
62
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
flashEl.style.
|
|
63
|
-
position: absolute;
|
|
64
|
-
box-sizing: border-box;
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
transform: ${transform};
|
|
67
|
-
left: ${offset.left}px;
|
|
68
|
-
top: ${offset.top}px;
|
|
69
|
-
width: ${el.clientWidth}px;
|
|
70
|
-
height: ${el.clientHeight}px;
|
|
71
|
-
z-index: ${ZIndex.SELECTED_EL};
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
this.container.appendChild(flashEl);
|
|
75
|
-
this.el = flashEl;
|
|
63
|
+
const flashEl = this.targetShadow.update(el);
|
|
64
|
+
flashEl.classList.add(FLASH_TIP_CLASS_NAME);
|
|
65
|
+
flashEl.style.boxSizing = 'border-box';
|
|
66
|
+
flashEl.style.pointerEvents = 'none';
|
|
67
|
+
// getTargetElStyle 会写入 target 的内联 border,需清掉以让动画 class 的边框生效
|
|
68
|
+
flashEl.style.border = '';
|
|
76
69
|
|
|
77
70
|
this.timer = globalThis.setTimeout(() => {
|
|
78
71
|
this.clear();
|
|
@@ -87,8 +80,7 @@ export default class StageFlashHighlight {
|
|
|
87
80
|
globalThis.clearTimeout(this.timer);
|
|
88
81
|
this.timer = undefined;
|
|
89
82
|
}
|
|
90
|
-
this.
|
|
91
|
-
this.el = undefined;
|
|
83
|
+
this.targetShadow.destroyEl();
|
|
92
84
|
}
|
|
93
85
|
|
|
94
86
|
/**
|
|
@@ -96,6 +88,7 @@ export default class StageFlashHighlight {
|
|
|
96
88
|
*/
|
|
97
89
|
public destroy(): void {
|
|
98
90
|
this.clear();
|
|
91
|
+
this.targetShadow.destroy();
|
|
99
92
|
this.styleEl?.remove();
|
|
100
93
|
this.styleEl = undefined;
|
|
101
94
|
}
|
package/src/const.ts
CHANGED
|
@@ -25,6 +25,9 @@ export const DRAG_EL_ID_PREFIX = 'drag_el_';
|
|
|
25
25
|
/** 高亮时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
26
26
|
export const HIGHLIGHT_EL_ID_PREFIX = 'highlight_el_';
|
|
27
27
|
|
|
28
|
+
/** 闪烁提示时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
29
|
+
export const FLASH_EL_ID_PREFIX = 'flash_el_';
|
|
30
|
+
|
|
28
31
|
export const CONTAINER_HIGHLIGHT_CLASS_NAME = 'tmagic-stage-container-highlight';
|
|
29
32
|
|
|
30
33
|
export const PAGE_CLASS = 'magic-ui-page';
|
package/src/types.ts
CHANGED
|
@@ -269,6 +269,11 @@ export interface TargetShadowConfig {
|
|
|
269
269
|
idPrefix?: string;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
export interface StageFlashHighlightConfig {
|
|
273
|
+
container: HTMLElement;
|
|
274
|
+
updateDragEl?: UpdateDragEl;
|
|
275
|
+
}
|
|
276
|
+
|
|
272
277
|
export interface RuleOptions {
|
|
273
278
|
guidesOptions?: Partial<GuidesOptions>;
|
|
274
279
|
disabledRule?: boolean;
|
package/types/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare const GHOST_EL_ID_PREFIX = "ghost_el_";
|
|
|
13
13
|
declare const DRAG_EL_ID_PREFIX = "drag_el_";
|
|
14
14
|
/** 高亮时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
15
15
|
declare const HIGHLIGHT_EL_ID_PREFIX = "highlight_el_";
|
|
16
|
+
/** 闪烁提示时需要在蒙层中创建一个占位节点,该节点的id前缀 */
|
|
17
|
+
declare const FLASH_EL_ID_PREFIX = "flash_el_";
|
|
16
18
|
declare const CONTAINER_HIGHLIGHT_CLASS_NAME = "tmagic-stage-container-highlight";
|
|
17
19
|
declare const PAGE_CLASS = "magic-ui-page";
|
|
18
20
|
/** 默认放到缩小倍数 */
|
|
@@ -368,6 +370,10 @@ interface TargetShadowConfig {
|
|
|
368
370
|
updateDragEl?: UpdateDragEl;
|
|
369
371
|
idPrefix?: string;
|
|
370
372
|
}
|
|
373
|
+
interface StageFlashHighlightConfig {
|
|
374
|
+
container: HTMLElement;
|
|
375
|
+
updateDragEl?: UpdateDragEl;
|
|
376
|
+
}
|
|
371
377
|
interface RuleOptions {
|
|
372
378
|
guidesOptions?: Partial<GuidesOptions$1>;
|
|
373
379
|
disabledRule?: boolean;
|
|
@@ -603,14 +609,11 @@ declare class ActionManager extends EventEmitter$1 {
|
|
|
603
609
|
* 帮助用户快速定位组件在画布中的位置。
|
|
604
610
|
*/
|
|
605
611
|
declare class StageFlashHighlight {
|
|
606
|
-
/**
|
|
607
|
-
private
|
|
608
|
-
private el?;
|
|
612
|
+
/** 复用 TargetShadow 负责节点的定位校准(updateDragEl、fixed、滚动偏移等) */
|
|
613
|
+
private targetShadow;
|
|
609
614
|
private timer?;
|
|
610
615
|
private styleEl?;
|
|
611
|
-
constructor(config:
|
|
612
|
-
container: HTMLElement;
|
|
613
|
-
});
|
|
616
|
+
constructor(config: StageFlashHighlightConfig);
|
|
614
617
|
/**
|
|
615
618
|
* 在目标元素所在区域做一次高亮闪烁
|
|
616
619
|
* @param el 选中组件的Dom节点元素
|
|
@@ -1146,4 +1149,4 @@ declare const _default: (handler: (type: AbleActionEventType) => void, customize
|
|
|
1146
1149
|
render(moveable: MoveableManagerInterface<any, any>, React: Renderer): any;
|
|
1147
1150
|
};
|
|
1148
1151
|
//#endregion
|
|
1149
|
-
export { AbleActionEventType, AbleCustomizedButton, ActionManagerConfig, ActionManagerEvents, CONTAINER_HIGHLIGHT_CLASS_NAME, CanDropIn, CanSelect, ContainerHighlightType, CoreEvents, CustomizeMoveableOptions, CustomizeMoveableOptionsCallbackConfig, CustomizeMoveableOptionsFunction, CustomizeRender, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, DelayedMarkContainer, DrEvents, DragResizeHelperConfig, GHOST_EL_ID_PREFIX, GetElementsFromPoint, GetRenderDocument, GetRootContainer, GetTargetElement, GuidesEventData, type GuidesOptions, GuidesType, HIGHLIGHT_EL_ID_PREFIX, IsContainer, Magic, MarkContainerEnd, MaskEvents, Mode, MouseButton, _default as MoveableActionsAble, MoveableOptionsManagerConfig, MultiDrEvents, Offset, PAGE_CLASS, Point, Rect, RemoveData, RemoveEventData, RenderEvents, RenderType, RuleOptions, Runtime, RuntimeWindow, SELECTED_CLASS, SelectStatus, SortEventData, StageCoreConfig, StageDragResize, StageDragResizeConfig, StageDragStatus, StageHighlightConfig, StageMask, StageMaskConfig, StageMultiDragResizeConfig, StageRender, StageRenderConfig, TargetElement, TargetShadowConfig, UpdateData, UpdateDragEl, UpdateEventData, ZIndex, addSelectedClassName, StageCore as default, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up };
|
|
1152
|
+
export { AbleActionEventType, AbleCustomizedButton, ActionManagerConfig, ActionManagerEvents, CONTAINER_HIGHLIGHT_CLASS_NAME, CanDropIn, CanSelect, ContainerHighlightType, CoreEvents, CustomizeMoveableOptions, CustomizeMoveableOptionsCallbackConfig, CustomizeMoveableOptionsFunction, CustomizeRender, DEFAULT_ZOOM, DRAG_EL_ID_PREFIX, DelayedMarkContainer, DrEvents, DragResizeHelperConfig, FLASH_EL_ID_PREFIX, GHOST_EL_ID_PREFIX, GetElementsFromPoint, GetRenderDocument, GetRootContainer, GetTargetElement, GuidesEventData, type GuidesOptions, GuidesType, HIGHLIGHT_EL_ID_PREFIX, IsContainer, Magic, MarkContainerEnd, MaskEvents, Mode, MouseButton, _default as MoveableActionsAble, MoveableOptionsManagerConfig, MultiDrEvents, Offset, PAGE_CLASS, Point, Rect, RemoveData, RemoveEventData, RenderEvents, RenderType, RuleOptions, Runtime, RuntimeWindow, SELECTED_CLASS, SelectStatus, SortEventData, StageCoreConfig, StageDragResize, StageDragResizeConfig, StageDragStatus, StageFlashHighlightConfig, StageHighlightConfig, StageMask, StageMaskConfig, StageMultiDragResizeConfig, StageRender, StageRenderConfig, TargetElement, TargetShadowConfig, UpdateData, UpdateDragEl, UpdateEventData, ZIndex, addSelectedClassName, StageCore as default, down, getAbsolutePosition, getBorderWidth, getMarginValue, getMode, getOffset, getScrollParent, getTargetElStyle, isAbsolute, isFixed, isFixedParent, isMoveableButton, isRelative, isStatic, removeSelectedClassName, up };
|