@react-native-oh-tpl/react-native-gesture-handler 2.12.6-1 → 2.12.6-2
Sign up to get free protection for your applications and to get access to all the features.
- package/harmony/gesture_handler/LICENSE +21 -0
- package/harmony/gesture_handler/OAT.xml +44 -0
- package/harmony/gesture_handler/README.OpenSource +11 -0
- package/harmony/gesture_handler/README.md +1 -0
- package/harmony/gesture_handler/build-profile.json5 +7 -7
- package/harmony/gesture_handler/hvigorfile.ts +2 -2
- package/harmony/gesture_handler/index.ets +2 -2
- package/harmony/gesture_handler/oh-package.json5 +13 -11
- package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +8 -8
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +33 -33
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +14 -14
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +60 -60
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +17 -17
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +11 -11
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +60 -60
- package/harmony/gesture_handler/src/main/ets/CircularBuffer.ts +42 -42
- package/harmony/gesture_handler/src/main/ets/Event.ts +67 -67
- package/harmony/gesture_handler/src/main/ets/EventDispatcher.ts +37 -37
- package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +663 -663
- package/harmony/gesture_handler/src/main/ets/GestureHandlerArkUIAdapter.ets +201 -201
- package/harmony/gesture_handler/src/main/ets/GestureHandlerFactory.ts +44 -44
- package/harmony/gesture_handler/src/main/ets/GestureHandlerOrchestrator.ts +280 -280
- package/harmony/gesture_handler/src/main/ets/GestureHandlerPackage.ts +22 -22
- package/harmony/gesture_handler/src/main/ets/GestureHandlerRegistry.ts +27 -27
- package/harmony/gesture_handler/src/main/ets/InteractionManager.ts +108 -108
- package/harmony/gesture_handler/src/main/ets/LeastSquareSolver.ts +182 -182
- package/harmony/gesture_handler/src/main/ets/NativeViewGestureHandler.ts +114 -114
- package/harmony/gesture_handler/src/main/ets/OutgoingEvent.ts +33 -33
- package/harmony/gesture_handler/src/main/ets/PanGestureHandler.ts +327 -327
- package/harmony/gesture_handler/src/main/ets/PointerTracker.ts +239 -239
- package/harmony/gesture_handler/src/main/ets/RNGHError.ts +4 -4
- package/harmony/gesture_handler/src/main/ets/RNGHLogger.ts +28 -28
- package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandler.ets +57 -57
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +36 -36
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +125 -125
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +56 -55
- package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +10 -10
- package/harmony/gesture_handler/src/main/ets/State.ts +46 -46
- package/harmony/gesture_handler/src/main/ets/TapGestureHandler.ts +205 -205
- package/harmony/gesture_handler/src/main/ets/Vector2D.ts +36 -36
- package/harmony/gesture_handler/src/main/ets/VelocityTracker.ts +98 -98
- package/harmony/gesture_handler/src/main/ets/View.ts +70 -70
- package/harmony/gesture_handler/src/main/ets/ViewRegistry.ts +42 -42
- package/harmony/gesture_handler/src/main/ets/pages/Index.ets +16 -16
- package/harmony/gesture_handler/src/main/ets/webviewability/WebviewAbility.ts +41 -41
- package/harmony/gesture_handler/src/main/module.json5 +6 -6
- package/harmony/gesture_handler/src/main/resources/base/element/color.json +7 -7
- package/harmony/gesture_handler/src/main/resources/base/element/string.json +15 -15
- package/harmony/gesture_handler/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/gesture_handler/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/gesture_handler/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/gesture_handler.har +0 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +9 -9
- package/lib/commonjs/components/touchables/TouchableOpacity.js +2 -2
- package/lib/commonjs/handlers/createNativeWrapper.js +6 -6
- package/lib/commonjs/handlers/gestures/GestureDetector.js +3 -3
- package/lib/module/components/touchables/GenericTouchable.js +9 -9
- package/lib/module/components/touchables/TouchableOpacity.js +2 -2
- package/lib/module/handlers/createNativeWrapper.js +6 -6
- package/lib/module/handlers/gestures/GestureDetector.js +3 -3
- package/package.json +70 -70
- package/src/RNGestureHandlerModule.ts +6 -6
- package/src/components/GestureButtons.tsx +334 -334
- package/src/components/GestureHandlerButton.tsx +5 -5
- package/src/components/GestureHandlerRootView.tsx +34 -34
- package/src/components/RNGestureHandlerButton.tsx +23 -23
- package/src/components/touchables/GenericTouchable.tsx +301 -301
- package/src/components/touchables/TouchableOpacity.tsx +76 -76
- package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -14
- package/src/components/touchables/index.ts +7 -7
- package/src/handlers/NativeViewGestureHandler.ts +55 -55
- package/src/handlers/PanGestureHandler.ts +327 -327
- package/src/handlers/TapGestureHandler.ts +95 -95
- package/src/handlers/createHandler.tsx +535 -535
- package/src/handlers/createNativeWrapper.tsx +81 -81
- package/src/handlers/gestureHandlerCommon.ts +15 -15
- package/src/handlers/gestures/GestureDetector.tsx +823 -823
- package/src/index.ts +172 -172
- package/src/init.ts +18 -18
@@ -1,68 +1,68 @@
|
|
1
|
-
export interface HitSlop {
|
2
|
-
left?: number;
|
3
|
-
right?: number;
|
4
|
-
top?: number;
|
5
|
-
bottom?: number;
|
6
|
-
horizontal?: number;
|
7
|
-
vertical?: number;
|
8
|
-
width?: number;
|
9
|
-
height?: number;
|
10
|
-
}
|
11
|
-
|
12
|
-
export const Directions = {
|
13
|
-
RIGHT: 1,
|
14
|
-
LEFT: 2,
|
15
|
-
UP: 4,
|
16
|
-
DOWN: 8,
|
17
|
-
} as const;
|
18
|
-
|
19
|
-
export enum PointerType {
|
20
|
-
NONE = 'none',
|
21
|
-
MOUSE = 'mouse',
|
22
|
-
TOUCH = 'touch',
|
23
|
-
PEN = 'pen',
|
24
|
-
}
|
25
|
-
|
26
|
-
export enum EventType {
|
27
|
-
DOWN,
|
28
|
-
ADDITIONAL_POINTER_DOWN,
|
29
|
-
UP,
|
30
|
-
ADDITIONAL_POINTER_UP,
|
31
|
-
MOVE,
|
32
|
-
ENTER,
|
33
|
-
OUT,
|
34
|
-
CANCEL,
|
35
|
-
}
|
36
|
-
|
37
|
-
export type Touch = {id: number, x: number, y: number, absoluteX: number, absoluteY: number}
|
38
|
-
|
39
|
-
export enum TouchEventType {
|
40
|
-
UNDETERMINED = 0,
|
41
|
-
DOWN = 1,
|
42
|
-
MOVE = 2,
|
43
|
-
UP = 3,
|
44
|
-
CANCELLED = 4,
|
45
|
-
}
|
46
|
-
|
47
|
-
export interface AdaptedEvent {
|
48
|
-
x: number;
|
49
|
-
y: number;
|
50
|
-
offsetX: number;
|
51
|
-
offsetY: number;
|
52
|
-
pointerId: number;
|
53
|
-
eventType: EventType;
|
54
|
-
pointerType: PointerType;
|
55
|
-
buttons: number;
|
56
|
-
time: number;
|
57
|
-
allTouches?: Touch[];
|
58
|
-
changedTouches?: Touch[];
|
59
|
-
touchEventType?: TouchEventType;
|
60
|
-
}
|
61
|
-
|
62
|
-
export interface TrackerElement {
|
63
|
-
lastX: number;
|
64
|
-
lastY: number;
|
65
|
-
timeStamp: number;
|
66
|
-
velocityX: number;
|
67
|
-
velocityY: number;
|
1
|
+
export interface HitSlop {
|
2
|
+
left?: number;
|
3
|
+
right?: number;
|
4
|
+
top?: number;
|
5
|
+
bottom?: number;
|
6
|
+
horizontal?: number;
|
7
|
+
vertical?: number;
|
8
|
+
width?: number;
|
9
|
+
height?: number;
|
10
|
+
}
|
11
|
+
|
12
|
+
export const Directions = {
|
13
|
+
RIGHT: 1,
|
14
|
+
LEFT: 2,
|
15
|
+
UP: 4,
|
16
|
+
DOWN: 8,
|
17
|
+
} as const;
|
18
|
+
|
19
|
+
export enum PointerType {
|
20
|
+
NONE = 'none',
|
21
|
+
MOUSE = 'mouse',
|
22
|
+
TOUCH = 'touch',
|
23
|
+
PEN = 'pen',
|
24
|
+
}
|
25
|
+
|
26
|
+
export enum EventType {
|
27
|
+
DOWN,
|
28
|
+
ADDITIONAL_POINTER_DOWN,
|
29
|
+
UP,
|
30
|
+
ADDITIONAL_POINTER_UP,
|
31
|
+
MOVE,
|
32
|
+
ENTER,
|
33
|
+
OUT,
|
34
|
+
CANCEL,
|
35
|
+
}
|
36
|
+
|
37
|
+
export type Touch = {id: number, x: number, y: number, absoluteX: number, absoluteY: number}
|
38
|
+
|
39
|
+
export enum TouchEventType {
|
40
|
+
UNDETERMINED = 0,
|
41
|
+
DOWN = 1,
|
42
|
+
MOVE = 2,
|
43
|
+
UP = 3,
|
44
|
+
CANCELLED = 4,
|
45
|
+
}
|
46
|
+
|
47
|
+
export interface AdaptedEvent {
|
48
|
+
x: number;
|
49
|
+
y: number;
|
50
|
+
offsetX: number;
|
51
|
+
offsetY: number;
|
52
|
+
pointerId: number;
|
53
|
+
eventType: EventType;
|
54
|
+
pointerType: PointerType;
|
55
|
+
buttons: number;
|
56
|
+
time: number;
|
57
|
+
allTouches?: Touch[];
|
58
|
+
changedTouches?: Touch[];
|
59
|
+
touchEventType?: TouchEventType;
|
60
|
+
}
|
61
|
+
|
62
|
+
export interface TrackerElement {
|
63
|
+
lastX: number;
|
64
|
+
lastY: number;
|
65
|
+
timeStamp: number;
|
66
|
+
velocityX: number;
|
67
|
+
velocityY: number;
|
68
68
|
}
|
@@ -1,38 +1,38 @@
|
|
1
|
-
import { RNInstance } from "rnoh/ts"
|
2
|
-
import { GestureStateChangeEvent, GestureUpdateEvent, GestureTouchEvent } from "./OutgoingEvent"
|
3
|
-
import { RNGHLogger } from './RNGHLogger'
|
4
|
-
|
5
|
-
export interface EventDispatcher {
|
6
|
-
onGestureHandlerStateChange(event: GestureStateChangeEvent): void
|
7
|
-
onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent): void
|
8
|
-
}
|
9
|
-
|
10
|
-
export class JSEventDispatcher implements EventDispatcher {
|
11
|
-
constructor(private rnInstance: RNInstance, private logger: RNGHLogger) {
|
12
|
-
}
|
13
|
-
|
14
|
-
public onGestureHandlerStateChange(event: GestureStateChangeEvent) {
|
15
|
-
this.logger.info(`onGestureHandlerStateChange`)
|
16
|
-
this.rnInstance.emitDeviceEvent("onGestureHandlerStateChange", event)
|
17
|
-
}
|
18
|
-
|
19
|
-
public onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent) {
|
20
|
-
this.logger.info(`onGestureHandlerEvent`)
|
21
|
-
this.rnInstance.emitDeviceEvent("onGestureHandlerEvent", event)
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
export class AnimatedEventDispatcher implements EventDispatcher {
|
26
|
-
constructor(private rnInstance: RNInstance, private logger: RNGHLogger, private viewTag: number) {
|
27
|
-
}
|
28
|
-
|
29
|
-
public onGestureHandlerStateChange(event: GestureStateChangeEvent) {
|
30
|
-
this.logger.info(`onGestureHandlerStateChange`)
|
31
|
-
this.rnInstance.emitDeviceEvent("onGestureHandlerStateChange", event)
|
32
|
-
}
|
33
|
-
|
34
|
-
public onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent) {
|
35
|
-
this.logger.info(`onGestureHandlerEvent`)
|
36
|
-
this.rnInstance.emitComponentEvent(this.viewTag, "onGestureHandlerEvent", event)
|
37
|
-
}
|
1
|
+
import { RNInstance } from "rnoh/ts"
|
2
|
+
import { GestureStateChangeEvent, GestureUpdateEvent, GestureTouchEvent } from "./OutgoingEvent"
|
3
|
+
import { RNGHLogger } from './RNGHLogger'
|
4
|
+
|
5
|
+
export interface EventDispatcher {
|
6
|
+
onGestureHandlerStateChange(event: GestureStateChangeEvent): void
|
7
|
+
onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent): void
|
8
|
+
}
|
9
|
+
|
10
|
+
export class JSEventDispatcher implements EventDispatcher {
|
11
|
+
constructor(private rnInstance: RNInstance, private logger: RNGHLogger) {
|
12
|
+
}
|
13
|
+
|
14
|
+
public onGestureHandlerStateChange(event: GestureStateChangeEvent) {
|
15
|
+
this.logger.info(`onGestureHandlerStateChange`)
|
16
|
+
this.rnInstance.emitDeviceEvent("onGestureHandlerStateChange", event)
|
17
|
+
}
|
18
|
+
|
19
|
+
public onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent) {
|
20
|
+
this.logger.info(`onGestureHandlerEvent`)
|
21
|
+
this.rnInstance.emitDeviceEvent("onGestureHandlerEvent", event)
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
export class AnimatedEventDispatcher implements EventDispatcher {
|
26
|
+
constructor(private rnInstance: RNInstance, private logger: RNGHLogger, private viewTag: number) {
|
27
|
+
}
|
28
|
+
|
29
|
+
public onGestureHandlerStateChange(event: GestureStateChangeEvent) {
|
30
|
+
this.logger.info(`onGestureHandlerStateChange`)
|
31
|
+
this.rnInstance.emitDeviceEvent("onGestureHandlerStateChange", event)
|
32
|
+
}
|
33
|
+
|
34
|
+
public onGestureHandlerEvent(event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent) {
|
35
|
+
this.logger.info(`onGestureHandlerEvent`)
|
36
|
+
this.rnInstance.emitComponentEvent(this.viewTag, "onGestureHandlerEvent", event)
|
37
|
+
}
|
38
38
|
}
|