ice-render 0.0.36 → 0.0.39
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/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/ICE.d.ts +2 -2
- package/dist/types/consts/DOM_EVENT_MAPPING_CONSTS.d.ts +21 -0
- package/dist/types/control-panel/ICEControlPanel.d.ts +10 -2
- package/dist/types/control-panel/link-controls/LineControlPanel.d.ts +1 -1
- package/dist/types/control-panel/transform-controls/TransformControlPanel.d.ts +19 -1
- package/dist/types/event/{DOMEventBridge.d.ts → DOMEventDispatcher.d.ts} +6 -4
- package/dist/types/event/{MouseEventInterceptor.d.ts → DOMEventInterceptor.d.ts} +2 -2
- package/dist/types/graphic/ICEComponent.d.ts +18 -1
- package/dist/types/graphic/link/ICELinkHook.d.ts +9 -0
- package/dist/types/graphic/link/ICELinkSlot.d.ts +9 -0
- package/dist/types/graphic/link/ICEPolyLine.d.ts +13 -1
- package/dist/types/index.d.ts +3 -2
- package/package.json +1 -1
- package/dist/types/consts/MOUSE_EVENT_MAPPING_CONSTS.d.ts +0 -13
- package/dist/types/event/KeyboardEventInterceptor.d.ts +0 -0
- package/dist/types/event/TouchEventInterceptor.d.ts +0 -0
|
@@ -41,9 +41,27 @@ export default class TransformControlPanel extends ICEControlPanel {
|
|
|
41
41
|
protected initEvents(): void;
|
|
42
42
|
enable(): void;
|
|
43
43
|
disable(): void;
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @overwrite
|
|
46
|
+
* @method keyboardEvtHandler 键盘事件处理
|
|
47
|
+
* !ICEControlPanel 的 zIndex 总是大于其它组件,当 ICEControlPanel 显示时,总是会优先判定为被选中的组件,会导致对应的 _targetComponent 收不到鼠标和键盘事件,所以 ICEControlPanel 的实现类需要自己考虑是否需要进行事件转发。
|
|
48
|
+
* !如果当前的 targetComponent 不为空,转发键盘事件。
|
|
49
|
+
* @see {ICEControlPanel}
|
|
50
|
+
* @see {ICEComponent}
|
|
51
|
+
* @param evt
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
protected keyboardEvtHandler(evt: any): void;
|
|
45
55
|
private rotateEvtHandler;
|
|
46
56
|
private resizeEvtHandler;
|
|
57
|
+
/**
|
|
58
|
+
* @overwrite
|
|
59
|
+
* @method updateControlPositions 更新内部控制手柄的位置
|
|
60
|
+
*
|
|
61
|
+
* 控制面板每次重绘时,会在 doRender() 方法内部会调用 updateControlPositions() 来 更新控制手柄的位置。
|
|
62
|
+
* @see ICEConrolPanel.doRender()
|
|
63
|
+
*/
|
|
64
|
+
protected updateControlPositions(): void;
|
|
47
65
|
protected updatePanel(): void;
|
|
48
66
|
set targetComponent(component: ICEComponent);
|
|
49
67
|
get targetComponent(): ICEComponent;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import ICE from '../ICE';
|
|
2
2
|
/**
|
|
3
|
-
* @class
|
|
3
|
+
* @class DOMEventDispatcher
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* - DOM 事件转发器,监听事件总线上的事件,转发给 canvas 内部指定的组件。
|
|
6
|
+
* - 原生的鼠标和键盘事件都通过此工具类进行转发。
|
|
6
7
|
*
|
|
8
|
+
* @see {DOMEventInterceptor}
|
|
7
9
|
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
8
10
|
*/
|
|
9
|
-
declare class
|
|
11
|
+
declare class DOMEventDispatcher {
|
|
10
12
|
private selectionCandidates;
|
|
11
13
|
private ice;
|
|
12
14
|
private _stopped;
|
|
@@ -24,4 +26,4 @@ declare class DOMEventBridge {
|
|
|
24
26
|
*/
|
|
25
27
|
private findTargetComponent;
|
|
26
28
|
}
|
|
27
|
-
export default
|
|
29
|
+
export default DOMEventDispatcher;
|
|
@@ -73,9 +73,25 @@ declare abstract class ICEComponent extends ICEEventTarget {
|
|
|
73
73
|
state: any;
|
|
74
74
|
constructor(props?: any);
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* @method initEvents 注册事件
|
|
77
|
+
*
|
|
78
|
+
* 子类可以提供自己的实现,也可以把此方法覆盖成空函数。
|
|
79
|
+
*
|
|
80
|
+
* @see {ICEComponent.keyboardEvtHandler}
|
|
77
81
|
*/
|
|
78
82
|
protected initEvents(): void;
|
|
83
|
+
/**
|
|
84
|
+
* @method keyboardEvtHandler 默认键盘事件处理
|
|
85
|
+
*
|
|
86
|
+
* - ICE 中的所有组件默认都可以接收键盘事件,子类可以覆盖此方法提供自己的实现。
|
|
87
|
+
* - 子类如果不需要响应键盘事件,可以覆盖一个空实现,或者在构造完成之后删掉对键盘事件的监听。
|
|
88
|
+
*
|
|
89
|
+
* !注意,这里只支持标准写法,不再兼容历史的 charCode 和 keyCode 写法。
|
|
90
|
+
* !W3C 标准按键值定义 https://www.w3.org/TR/uievents-key/#key-attribute-value
|
|
91
|
+
* @param evt
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
protected keyboardEvtHandler(evt: any): void;
|
|
79
95
|
/**
|
|
80
96
|
* !Important: 核心方法,FrameManager 会调度此方法进行实际的渲染操作。
|
|
81
97
|
* !Important: 这些方法调用有顺序
|
|
@@ -226,6 +242,7 @@ declare abstract class ICEComponent extends ICEEventTarget {
|
|
|
226
242
|
* - FIXME:立即停止组件上的所有动画效果
|
|
227
243
|
* - 需要清理绑定的事件
|
|
228
244
|
* - 带有子节点的组件需要先销毁子节点,然后再销毁自身。
|
|
245
|
+
* - 子类需要覆盖此方法,释放自己占有的资源。
|
|
229
246
|
*/
|
|
230
247
|
destory(): void;
|
|
231
248
|
}
|
|
@@ -15,6 +15,15 @@ import ICECircle from '../shape/ICECircle';
|
|
|
15
15
|
export default class ICELinkHook extends ICECircle {
|
|
16
16
|
constructor(props?: any);
|
|
17
17
|
protected initEvents(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @overwrite
|
|
20
|
+
* @method keyboardEvtHandler 键盘事件处理
|
|
21
|
+
* !ICELinkHook 不响应键盘事件。
|
|
22
|
+
* @see {ICEComponent.keyboardEvtHandler}
|
|
23
|
+
* @param evt
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
protected keyboardEvtHandler(evt: any): void;
|
|
18
27
|
/**
|
|
19
28
|
*
|
|
20
29
|
* 在 mousedown 事件处理器里面可以直接访问 this.evtBus ,因为能接收到 mousedown 事件说明组件已经渲染出来了。
|
|
@@ -30,6 +30,15 @@ declare class ICELinkSlot extends ICECircle {
|
|
|
30
30
|
*/
|
|
31
31
|
constructor(props?: any);
|
|
32
32
|
protected initEvents(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @overwrite
|
|
35
|
+
* @method keyboardEvtHandler 键盘事件处理
|
|
36
|
+
* !ICELinkSlot 不响应键盘事件。
|
|
37
|
+
* @see {ICEComponent.keyboardEvtHandler}
|
|
38
|
+
* @param evt
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
protected keyboardEvtHandler(evt: any): void;
|
|
33
42
|
protected beforeRenderHandler(evt: ICEEvent): void;
|
|
34
43
|
protected beforeRemoveHandler(evt: ICEEvent): void;
|
|
35
44
|
/**
|
|
@@ -17,12 +17,19 @@ import ICEDotPath from '../ICEDotPath';
|
|
|
17
17
|
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
18
18
|
*/
|
|
19
19
|
declare class ICEPolyLine extends ICEDotPath {
|
|
20
|
-
readonly isLine: true;
|
|
21
20
|
/**
|
|
21
|
+
* 类型标识
|
|
22
|
+
* 用来解决 TypeScript 的 instanceof 兼容性问题, https://github.com/microsoft/TypeScript/issues/22585
|
|
23
|
+
* 仅供内部使用,业务代码不可依赖此属性
|
|
24
|
+
*/
|
|
25
|
+
isLine: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 数据结构:
|
|
22
28
|
* {
|
|
23
29
|
* start:{componnet:ICEComponent,position:'T'},
|
|
24
30
|
* end:{component:ICEComponent,position:'B'}
|
|
25
31
|
* }
|
|
32
|
+
* !注意:此结构与 state 上的 links 结构不同,state.links 只存 id,position 信息,而且会被序列化,此结构不会被序列化。
|
|
26
33
|
*/
|
|
27
34
|
protected links: any;
|
|
28
35
|
/**
|
|
@@ -199,5 +206,10 @@ declare class ICEPolyLine extends ICEDotPath {
|
|
|
199
206
|
* @returns {Array<any>}
|
|
200
207
|
*/
|
|
201
208
|
private getLines;
|
|
209
|
+
/**
|
|
210
|
+
* @overwrite
|
|
211
|
+
* @method destory
|
|
212
|
+
*/
|
|
213
|
+
destory(): void;
|
|
202
214
|
}
|
|
203
215
|
export default ICEPolyLine;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export { default as LineControlPanel } from './control-panel/link-controls/LineC
|
|
|
12
12
|
export { default as ResizeControl } from './control-panel/transform-controls/ResizeControl';
|
|
13
13
|
export { default as RotateControl } from './control-panel/transform-controls/RotateControl';
|
|
14
14
|
export { default as TransformControlPanel } from './control-panel/transform-controls/TransformControlPanel';
|
|
15
|
-
export { default as
|
|
15
|
+
export { default as DOMEventDispatcher } from './event/DOMEventDispatcher';
|
|
16
|
+
export { default as DOMEventInterceptor } from './event/DOMEventInterceptor';
|
|
16
17
|
export { default as EventBus } from './event/EventBus';
|
|
17
18
|
export { default as ICEEventTarget } from './event/ICEEventTarget';
|
|
18
19
|
export { default as GeoLine } from './geometry/GeoLine';
|
|
@@ -25,9 +26,9 @@ export { default as ICEDotPath } from './graphic/ICEDotPath';
|
|
|
25
26
|
export { default as ICEImage } from './graphic/ICEImage';
|
|
26
27
|
export { default as ICEPath } from './graphic/ICEPath';
|
|
27
28
|
export { default as ICEBezier } from './graphic/link/ICEBezier';
|
|
28
|
-
export { default as ICEPolyLine } from './graphic/link/ICEPolyLine';
|
|
29
29
|
export { default as ICELinkHook } from './graphic/link/ICELinkHook';
|
|
30
30
|
export { default as ICELinkSlot } from './graphic/link/ICELinkSlot';
|
|
31
|
+
export { default as ICEPolyLine } from './graphic/link/ICEPolyLine';
|
|
31
32
|
export { default as ICEVisioLink } from './graphic/link/ICEVisioLink';
|
|
32
33
|
export { default as ICECircle } from './graphic/shape/ICECircle';
|
|
33
34
|
export { default as ICEEllipse } from './graphic/shape/ICEEllipse';
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default mouseEvents;
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) 2022 大漠穷秋.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 原生 DOM 事件与 ICE 内部转发事件之间的对应关系
|
|
11
|
-
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
12
|
-
*/
|
|
13
|
-
declare const mouseEvents: string[][];
|
|
File without changes
|
|
File without changes
|