gl-draw 0.17.0-beta.24 → 0.17.0-beta.26
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/core/BaseObject/PointerEvent.d.ts +1 -0
- package/dist/core/Lead/Pick.d.ts +15 -1
- package/dist/core/Lead/index.d.ts +5 -6
- package/dist/index.js +2 -2
- package/dist/index.module.js +370 -331
- package/dist/index.module2.js +17 -14
- package/dist/index2.js +3 -3
- package/dist/objects/group/index.d.ts +1 -0
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +111 -104
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export default class PointerEvent {
|
|
|
6
6
|
onPointerEvent(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): void;
|
|
7
7
|
onClick(cb: PickFunctionsItem['cb']): void;
|
|
8
8
|
onPointerEnter(cb: PickFunctionsItem['cb']): void;
|
|
9
|
+
onPointerEnterOnStop(cb: PickFunctionsItem['cb']): void;
|
|
9
10
|
onPointerLeave(cb: PickFunctionsItem['cb']): void;
|
|
10
11
|
onPointerMove(cb: PickFunctionsItem['cb']): void;
|
|
11
12
|
onPointerDown(cb: PickFunctionsItem['cb']): void;
|
package/dist/core/Lead/Pick.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { IBaseObject } from "../BaseObject";
|
|
|
2
2
|
import type Pencil from "../Pencil";
|
|
3
3
|
export type PickFunctionsItem = {
|
|
4
4
|
objArr: IBaseObject[] | (() => IBaseObject[]);
|
|
5
|
-
type: 'move' | 'enter' | 'leave' | 'down' | 'click' | 'downOutside';
|
|
5
|
+
type: 'move' | 'enter' | 'leave' | 'down' | 'click' | 'downOutside' | 'enterOnStop';
|
|
6
6
|
cb: (data: {
|
|
7
7
|
baseObject: IBaseObject;
|
|
8
8
|
realBaseObject?: IBaseObject;
|
|
@@ -23,9 +23,19 @@ export default class Pick {
|
|
|
23
23
|
private prevActiveObjects;
|
|
24
24
|
private objCallbackMap;
|
|
25
25
|
private pickListener;
|
|
26
|
+
/** 是否有 enterOnStop 事件注册 */
|
|
27
|
+
private hasEnterOnStopEvent;
|
|
26
28
|
/** 需要检测 cursor 的物体 Map<obj, cursorStyle> */
|
|
27
29
|
private cursorObjects;
|
|
28
30
|
private cursorListenerAdded;
|
|
31
|
+
/** 用于检测鼠标停止移动 */
|
|
32
|
+
private moveStopTimer;
|
|
33
|
+
private moveStopDelay;
|
|
34
|
+
private lastMoveEvent;
|
|
35
|
+
private lastMoveActiveObjects;
|
|
36
|
+
private lastMoveRealActiveObject;
|
|
37
|
+
/** 已经触发过 enterOnStop 的物体,用于防止重复触发 */
|
|
38
|
+
private triggeredEnterOnStopObjects;
|
|
29
39
|
private domElement;
|
|
30
40
|
constructor(pencil: Pencil);
|
|
31
41
|
private addPickListener;
|
|
@@ -33,6 +43,10 @@ export default class Pick {
|
|
|
33
43
|
private processObjectHierarchy;
|
|
34
44
|
private handleLeaveEvents;
|
|
35
45
|
private handleDownOutside;
|
|
46
|
+
/** 处理鼠标停止移动事件 */
|
|
47
|
+
private handleMoveStop;
|
|
48
|
+
/** 触发 enterOnStop 事件 */
|
|
49
|
+
private triggerEnterOnStop;
|
|
36
50
|
/** 重置鼠标样式 */
|
|
37
51
|
private resetCursor;
|
|
38
52
|
/** 添加 cursor 检测监听器 */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Scene } from 'three';
|
|
2
|
-
import Lead from './Lead';
|
|
3
|
-
import Pencil from "../Pencil";
|
|
4
|
-
import Pages from "../Pages";
|
|
1
|
+
import type { Scene } from 'three';
|
|
5
2
|
import type MList from "../MList/MList";
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import Pages from "../Pages";
|
|
4
|
+
import type Pencil from "../Pencil";
|
|
5
|
+
import Lead from './Lead';
|
|
6
|
+
export type LeadParams = {};
|
|
8
7
|
export declare const defaultDrawParams: {};
|
|
9
8
|
interface Options {
|
|
10
9
|
leadParams?: LeadParams;
|