@react-native-oh-tpl/react-native-gesture-handler 2.12.6-2 → 2.12.9
Sign up to get free protection for your applications and to get access to all the features.
- package/harmony/gesture_handler/BuildProfile.ets +5 -0
- package/harmony/gesture_handler/build-profile.json5 +13 -2
- package/harmony/gesture_handler/hvigorfile.ts +1 -1
- package/harmony/gesture_handler/index.ets +1 -1
- package/harmony/gesture_handler/oh-package-lock.json5 +17 -0
- package/harmony/gesture_handler/oh-package.json5 +10 -11
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +75 -6
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +14 -8
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +4 -28
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentInstance.h +27 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +32 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +17 -12
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +5 -2
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerPackage.h +72 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +4 -28
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentInstance.h +78 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +25 -0
- package/harmony/gesture_handler/src/main/ets/EventDispatcher.ts +16 -1
- package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +2 -2
- package/harmony/gesture_handler/src/main/ets/{GestureHandlerArkUIAdapter.ets → GestureHandlerArkUIAdapter.ts} +2 -1
- package/harmony/gesture_handler/src/main/ets/GestureHandlerPackage.ts +2 -2
- package/harmony/gesture_handler/src/main/ets/OutgoingEvent.ts +5 -5
- package/harmony/gesture_handler/src/main/ets/RNGHLogger.ts +20 -1
- package/harmony/gesture_handler/src/main/ets/{RNGHRootTouchHandler.ets → RNGHRootTouchHandlerArkTS.ts} +5 -3
- package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandlerCAPI.ts +87 -0
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +4 -3
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +65 -7
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +7 -11
- package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +17 -5
- package/harmony/gesture_handler/src/main/ets/View.ts +1 -1
- package/harmony/gesture_handler/src/main/ets/ViewRegistry.ts +1 -1
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerButton.ts +140 -0
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +25 -0
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerRootView.ts +101 -0
- package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +3 -0
- package/harmony/gesture_handler/src/main/ets/types.ts +25 -0
- package/harmony/gesture_handler/src/main/module.json5 +6 -6
- package/harmony/gesture_handler/ts.ts +2 -1
- package/harmony/gesture_handler.har +0 -0
- package/lib/commonjs/RNGestureHandlerModule.js +6 -3
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +5 -13
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +31 -28
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/index.js +42 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +10 -0
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +3 -2
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +3 -11
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/handlers/createHandler.js +20 -19
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/index.js +6 -14
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js +3 -0
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/typescript/RNGestureHandlerModule.d.ts +2 -6
- package/lib/typescript/RNGestureHandlerModule.d.ts.map +1 -1
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -6
- package/lib/typescript/components/GestureHandlerRootView.d.ts.map +1 -1
- package/lib/typescript/handlers/createHandler.d.ts +11 -11
- package/lib/typescript/handlers/createHandler.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +9 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +15 -0
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts.map +1 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +15 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +7 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts.map +1 -0
- package/package.json +9 -13
- package/src/RNGestureHandlerModule.ts +3 -4
- package/src/components/GestureHandlerRootView.tsx +4 -15
- package/src/handlers/createHandler.tsx +4 -5
- package/src/index.ts +13 -13
- package/src/specs/NativeRNGestureHandlerModule.ts +26 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
- package/README.md +0 -1
- package/harmony/gesture_handler/LICENSE +0 -21
- package/harmony/gesture_handler/OAT.xml +0 -44
- package/harmony/gesture_handler/README.OpenSource +0 -11
- package/harmony/gesture_handler/README.md +0 -1
- package/lib/commonjs/components/GestureButtons.js +0 -186
- package/lib/commonjs/components/GestureButtons.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.js +0 -9
- package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/RNGestureHandlerButton.js +0 -23
- package/lib/commonjs/components/RNGestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +0 -247
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -58
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -18
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/index.js +0 -21
- package/lib/commonjs/components/touchables/index.js.map +0 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -19
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +0 -103
- package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +0 -22
- package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +0 -64
- package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -22
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +0 -554
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +0 -1
- package/lib/commonjs/init.js +0 -24
- package/lib/commonjs/init.js.map +0 -1
- package/lib/module/components/GestureButtons.js +0 -168
- package/lib/module/components/GestureButtons.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.js +0 -3
- package/lib/module/components/GestureHandlerButton.js.map +0 -1
- package/lib/module/components/RNGestureHandlerButton.js +0 -17
- package/lib/module/components/RNGestureHandlerButton.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchable.js +0 -238
- package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/module/components/touchables/TouchableOpacity.js +0 -49
- package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -9
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/module/components/touchables/index.js +0 -8
- package/lib/module/components/touchables/index.js.map +0 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -12
- package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/handlers/PanGestureHandler.js +0 -92
- package/lib/module/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -14
- package/lib/module/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/handlers/createNativeWrapper.js +0 -57
- package/lib/module/handlers/createNativeWrapper.js.map +0 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -15
- package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector.js +0 -543
- package/lib/module/handlers/gestures/GestureDetector.js.map +0 -1
- package/lib/module/init.js +0 -17
- package/lib/module/init.js.map +0 -1
- package/lib/typescript/components/GestureButtons.d.ts +0 -122
- package/lib/typescript/components/GestureButtons.d.ts.map +0 -1
- package/lib/typescript/components/GestureHandlerButton.d.ts +0 -5
- package/lib/typescript/components/GestureHandlerButton.d.ts.map +0 -1
- package/lib/typescript/components/RNGestureHandlerButton.d.ts +0 -2
- package/lib/typescript/components/RNGestureHandlerButton.d.ts.map +0 -1
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -68
- package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +0 -1
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -26
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts.map +0 -1
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -8
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts.map +0 -1
- package/lib/typescript/components/touchables/index.d.ts +0 -4
- package/lib/typescript/components/touchables/index.d.ts.map +0 -1
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -29
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -140
- package/lib/typescript/handlers/PanGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -58
- package/lib/typescript/handlers/TapGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -4
- package/lib/typescript/handlers/createNativeWrapper.d.ts.map +0 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -2
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts.map +0 -1
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +0 -24
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts.map +0 -1
- package/lib/typescript/init.d.ts +0 -3
- package/lib/typescript/init.d.ts.map +0 -1
- package/src/components/GestureButtons.tsx +0 -334
- package/src/components/GestureHandlerButton.tsx +0 -5
- package/src/components/RNGestureHandlerButton.tsx +0 -23
- package/src/components/touchables/GenericTouchable.tsx +0 -301
- package/src/components/touchables/TouchableOpacity.tsx +0 -76
- package/src/components/touchables/TouchableWithoutFeedback.tsx +0 -14
- package/src/components/touchables/index.ts +0 -7
- package/src/handlers/NativeViewGestureHandler.ts +0 -55
- package/src/handlers/PanGestureHandler.ts +0 -327
- package/src/handlers/TapGestureHandler.ts +0 -95
- package/src/handlers/createNativeWrapper.tsx +0 -81
- package/src/handlers/gestureHandlerCommon.ts +0 -15
- package/src/handlers/gestures/GestureDetector.tsx +0 -823
- package/src/init.ts +0 -18
@@ -1,543 +0,0 @@
|
|
1
|
-
var _Reanimated$default;
|
2
|
-
/**
|
3
|
-
* Why is this file patched?
|
4
|
-
* - replacing import to RNGestureHandlerModule - original code uses (old) Native Modules but RNOH supports only Turbo Modules
|
5
|
-
*/
|
6
|
-
|
7
|
-
import React, { useContext, useEffect, useRef, useState } from 'react';
|
8
|
-
import { BaseGesture, CALLBACK_TYPE } from 'react-native-gesture-handler/src/handlers/gestures/gesture';
|
9
|
-
import { Reanimated } from 'react-native-gesture-handler/src/handlers/gestures/reanimatedWrapper';
|
10
|
-
import { registerHandler, unregisterHandler } from 'react-native-gesture-handler/src/handlers/handlersRegistry';
|
11
|
-
import { RNGestureHandlerModule } from '../../RNGestureHandlerModule'; // RNGH: patch
|
12
|
-
import { baseGestureHandlerWithMonitorProps, filterConfig, findNodeHandle } from 'react-native-gesture-handler/src/handlers/gestureHandlerCommon';
|
13
|
-
import { scheduleFlushOperations } from '../gestureHandlerCommon'; // RNGH: patch
|
14
|
-
import { GestureStateManager } from 'react-native-gesture-handler/src/handlers/gestures/gestureStateManager';
|
15
|
-
import { flingGestureHandlerProps } from 'react-native-gesture-handler/src/handlers/FlingGestureHandler';
|
16
|
-
import { forceTouchGestureHandlerProps } from 'react-native-gesture-handler/src/handlers/ForceTouchGestureHandler';
|
17
|
-
import { longPressGestureHandlerProps } from 'react-native-gesture-handler/src/handlers/LongPressGestureHandler';
|
18
|
-
import { panGestureHandlerProps, panGestureHandlerCustomNativeProps } from 'react-native-gesture-handler/src/handlers/PanGestureHandler';
|
19
|
-
import { tapGestureHandlerProps } from 'react-native-gesture-handler/src/handlers/TapGestureHandler';
|
20
|
-
import { State } from 'react-native-gesture-handler/src/State';
|
21
|
-
import { TouchEventType } from 'react-native-gesture-handler/src/TouchEventType';
|
22
|
-
import { ActionType } from 'react-native-gesture-handler/src/ActionType';
|
23
|
-
import { isFabric, isJestEnv, REACT_NATIVE_VERSION, tagMessage } from 'react-native-gesture-handler/src/utils';
|
24
|
-
import { getShadowNodeFromRef } from 'react-native-gesture-handler/src/getShadowNodeFromRef';
|
25
|
-
import { Platform } from 'react-native';
|
26
|
-
import { onGestureHandlerEvent } from 'react-native-gesture-handler/src/handlers/gestures/eventReceiver';
|
27
|
-
import { RNRenderer } from 'react-native-gesture-handler/src/RNRenderer';
|
28
|
-
import { isNewWebImplementationEnabled } from 'react-native-gesture-handler/src/EnableNewWebImplementation';
|
29
|
-
import { nativeViewGestureHandlerProps } from 'react-native-gesture-handler/src/handlers/NativeViewGestureHandler';
|
30
|
-
import GestureHandlerRootViewContext from 'react-native-gesture-handler/src/GestureHandlerRootViewContext';
|
31
|
-
const ALLOWED_PROPS = [...baseGestureHandlerWithMonitorProps, ...tapGestureHandlerProps, ...panGestureHandlerProps, ...panGestureHandlerCustomNativeProps, ...longPressGestureHandlerProps, ...forceTouchGestureHandlerProps, ...flingGestureHandlerProps, ...nativeViewGestureHandlerProps];
|
32
|
-
function convertToHandlerTag(ref) {
|
33
|
-
if (typeof ref === 'number') {
|
34
|
-
return ref;
|
35
|
-
} else if (ref instanceof BaseGesture) {
|
36
|
-
return ref.handlerTag;
|
37
|
-
} else {
|
38
|
-
var _ref$current;
|
39
|
-
// @ts-ignore in this case it should be a ref either to gesture object or
|
40
|
-
// a gesture handler component, in both cases handlerTag property exists
|
41
|
-
return ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.handlerTag) ?? -1;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
function extractValidHandlerTags(interactionGroup) {
|
45
|
-
var _interactionGroup$map;
|
46
|
-
return (interactionGroup === null || interactionGroup === void 0 || (_interactionGroup$map = interactionGroup.map(convertToHandlerTag)) === null || _interactionGroup$map === void 0 ? void 0 : _interactionGroup$map.filter(tag => tag > 0)) ?? [];
|
47
|
-
}
|
48
|
-
function dropHandlers(preparedGesture) {
|
49
|
-
for (const handler of preparedGesture.config) {
|
50
|
-
RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);
|
51
|
-
unregisterHandler(handler.handlerTag, handler.config.testId);
|
52
|
-
}
|
53
|
-
scheduleFlushOperations();
|
54
|
-
}
|
55
|
-
function checkGestureCallbacksForWorklets(gesture) {
|
56
|
-
// if a gesture is explicitly marked to run on the JS thread there is no need to check
|
57
|
-
// if callbacks are worklets as the user is aware they will be ran on the JS thread
|
58
|
-
if (gesture.config.runOnJS) {
|
59
|
-
return;
|
60
|
-
}
|
61
|
-
const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);
|
62
|
-
const areSomeWorklets = gesture.handlers.isWorklet.includes(true);
|
63
|
-
|
64
|
-
// if some of the callbacks are worklets and some are not, and the gesture is not
|
65
|
-
// explicitly marked with `.runOnJS(true)` show an error
|
66
|
-
if (areSomeNotWorklets && areSomeWorklets) {
|
67
|
-
console.error(tagMessage(`Some of the callbacks in the gesture are worklets and some are not. Either make sure that all calbacks are marked as 'worklet' if you wish to run them on the UI thread or use '.runOnJS(true)' modifier on the gesture explicitly to run all callbacks on the JS thread.`));
|
68
|
-
}
|
69
|
-
}
|
70
|
-
function attachHandlers({
|
71
|
-
preparedGesture,
|
72
|
-
gestureConfig,
|
73
|
-
gesture,
|
74
|
-
viewTag,
|
75
|
-
webEventHandlersRef,
|
76
|
-
mountedRef
|
77
|
-
}) {
|
78
|
-
if (!preparedGesture.firstExecution) {
|
79
|
-
gestureConfig.initialize();
|
80
|
-
} else {
|
81
|
-
preparedGesture.firstExecution = false;
|
82
|
-
}
|
83
|
-
|
84
|
-
// use queueMicrotask to extract handlerTags, because all refs should be initialized
|
85
|
-
// when it's ran
|
86
|
-
queueMicrotask(() => {
|
87
|
-
if (!mountedRef.current) {
|
88
|
-
return;
|
89
|
-
}
|
90
|
-
gestureConfig.prepare();
|
91
|
-
});
|
92
|
-
for (const handler of gesture) {
|
93
|
-
checkGestureCallbacksForWorklets(handler);
|
94
|
-
RNGestureHandlerModule.createGestureHandler(handler.handlerName, handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS));
|
95
|
-
registerHandler(handler.handlerTag, handler, handler.config.testId);
|
96
|
-
}
|
97
|
-
|
98
|
-
// use queueMicrotask to extract handlerTags, because all refs should be initialized
|
99
|
-
// when it's ran
|
100
|
-
queueMicrotask(() => {
|
101
|
-
if (!mountedRef.current) {
|
102
|
-
return;
|
103
|
-
}
|
104
|
-
for (const handler of gesture) {
|
105
|
-
let requireToFail = [];
|
106
|
-
if (handler.config.requireToFail) {
|
107
|
-
requireToFail = extractValidHandlerTags(handler.config.requireToFail);
|
108
|
-
}
|
109
|
-
let simultaneousWith = [];
|
110
|
-
if (handler.config.simultaneousWith) {
|
111
|
-
simultaneousWith = extractValidHandlerTags(handler.config.simultaneousWith);
|
112
|
-
}
|
113
|
-
RNGestureHandlerModule.updateGestureHandler(handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS, {
|
114
|
-
simultaneousHandlers: simultaneousWith,
|
115
|
-
waitFor: requireToFail
|
116
|
-
}));
|
117
|
-
}
|
118
|
-
scheduleFlushOperations();
|
119
|
-
});
|
120
|
-
preparedGesture.config = gesture;
|
121
|
-
for (const gesture of preparedGesture.config) {
|
122
|
-
const actionType = gesture.shouldUseReanimated ? ActionType.REANIMATED_WORKLET : ActionType.JS_FUNCTION_NEW_API;
|
123
|
-
if (Platform.OS === 'web') {
|
124
|
-
RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, ActionType.JS_FUNCTION_OLD_API,
|
125
|
-
// ignored on web
|
126
|
-
webEventHandlersRef);
|
127
|
-
} else {
|
128
|
-
RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, actionType);
|
129
|
-
}
|
130
|
-
}
|
131
|
-
if (preparedGesture.animatedHandlers) {
|
132
|
-
const isAnimatedGesture = g => g.shouldUseReanimated;
|
133
|
-
preparedGesture.animatedHandlers.value = gesture.filter(isAnimatedGesture).map(g => g.handlers);
|
134
|
-
}
|
135
|
-
}
|
136
|
-
function updateHandlers(preparedGesture, gestureConfig, gesture, mountedRef) {
|
137
|
-
gestureConfig.prepare();
|
138
|
-
for (let i = 0; i < gesture.length; i++) {
|
139
|
-
const handler = preparedGesture.config[i];
|
140
|
-
checkGestureCallbacksForWorklets(handler);
|
141
|
-
|
142
|
-
// only update handlerTag when it's actually different, it may be the same
|
143
|
-
// if gesture config object is wrapped with useMemo
|
144
|
-
if (gesture[i].handlerTag !== handler.handlerTag) {
|
145
|
-
gesture[i].handlerTag = handler.handlerTag;
|
146
|
-
gesture[i].handlers.handlerTag = handler.handlerTag;
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
// use queueMicrotask to extract handlerTags, because when it's ran, all refs should be updated
|
151
|
-
// and handlerTags in BaseGesture references should be updated in the loop above (we need to wait
|
152
|
-
// in case of external relations)
|
153
|
-
queueMicrotask(() => {
|
154
|
-
if (!mountedRef.current) {
|
155
|
-
return;
|
156
|
-
}
|
157
|
-
for (let i = 0; i < gesture.length; i++) {
|
158
|
-
const handler = preparedGesture.config[i];
|
159
|
-
handler.config = gesture[i].config;
|
160
|
-
handler.handlers = gesture[i].handlers;
|
161
|
-
const requireToFail = extractValidHandlerTags(handler.config.requireToFail);
|
162
|
-
const simultaneousWith = extractValidHandlerTags(handler.config.simultaneousWith);
|
163
|
-
RNGestureHandlerModule.updateGestureHandler(handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS, {
|
164
|
-
simultaneousHandlers: simultaneousWith,
|
165
|
-
waitFor: requireToFail
|
166
|
-
}));
|
167
|
-
registerHandler(handler.handlerTag, handler, handler.config.testId);
|
168
|
-
}
|
169
|
-
if (preparedGesture.animatedHandlers) {
|
170
|
-
const previousHandlersValue = preparedGesture.animatedHandlers.value ?? [];
|
171
|
-
const newHandlersValue = preparedGesture.config.filter(g => g.shouldUseReanimated) // ignore gestures that shouldn't run on UI
|
172
|
-
.map(g => g.handlers);
|
173
|
-
|
174
|
-
// if amount of gesture configs changes, we need to update the callbacks in shared value
|
175
|
-
let shouldUpdateSharedValue = previousHandlersValue.length !== newHandlersValue.length;
|
176
|
-
if (!shouldUpdateSharedValue) {
|
177
|
-
// if the amount is the same, we need to check if any of the configs inside has changed
|
178
|
-
for (let i = 0; i < newHandlersValue.length; i++) {
|
179
|
-
if (
|
180
|
-
// we can use the `gestureId` prop as it's unique for every config instance
|
181
|
-
newHandlersValue[i].gestureId !== previousHandlersValue[i].gestureId) {
|
182
|
-
shouldUpdateSharedValue = true;
|
183
|
-
break;
|
184
|
-
}
|
185
|
-
}
|
186
|
-
}
|
187
|
-
if (shouldUpdateSharedValue) {
|
188
|
-
preparedGesture.animatedHandlers.value = newHandlersValue;
|
189
|
-
}
|
190
|
-
}
|
191
|
-
scheduleFlushOperations();
|
192
|
-
});
|
193
|
-
}
|
194
|
-
function needsToReattach(preparedGesture, gesture) {
|
195
|
-
if (gesture.length !== preparedGesture.config.length) {
|
196
|
-
return true;
|
197
|
-
}
|
198
|
-
for (let i = 0; i < gesture.length; i++) {
|
199
|
-
if (gesture[i].handlerName !== preparedGesture.config[i].handlerName || gesture[i].shouldUseReanimated !== preparedGesture.config[i].shouldUseReanimated) {
|
200
|
-
return true;
|
201
|
-
}
|
202
|
-
}
|
203
|
-
return false;
|
204
|
-
}
|
205
|
-
function isStateChangeEvent(event) {
|
206
|
-
'worklet';
|
207
|
-
|
208
|
-
// @ts-ignore Yes, the oldState prop is missing on GestureTouchEvent, that's the point
|
209
|
-
return event.oldState != null;
|
210
|
-
}
|
211
|
-
function isTouchEvent(event) {
|
212
|
-
'worklet';
|
213
|
-
|
214
|
-
return event.eventType != null;
|
215
|
-
}
|
216
|
-
function getHandler(type, gesture) {
|
217
|
-
'worklet';
|
218
|
-
|
219
|
-
switch (type) {
|
220
|
-
case CALLBACK_TYPE.BEGAN:
|
221
|
-
return gesture.onBegin;
|
222
|
-
case CALLBACK_TYPE.START:
|
223
|
-
return gesture.onStart;
|
224
|
-
case CALLBACK_TYPE.UPDATE:
|
225
|
-
return gesture.onUpdate;
|
226
|
-
case CALLBACK_TYPE.CHANGE:
|
227
|
-
return gesture.onChange;
|
228
|
-
case CALLBACK_TYPE.END:
|
229
|
-
return gesture.onEnd;
|
230
|
-
case CALLBACK_TYPE.FINALIZE:
|
231
|
-
return gesture.onFinalize;
|
232
|
-
case CALLBACK_TYPE.TOUCHES_DOWN:
|
233
|
-
return gesture.onTouchesDown;
|
234
|
-
case CALLBACK_TYPE.TOUCHES_MOVE:
|
235
|
-
return gesture.onTouchesMove;
|
236
|
-
case CALLBACK_TYPE.TOUCHES_UP:
|
237
|
-
return gesture.onTouchesUp;
|
238
|
-
case CALLBACK_TYPE.TOUCHES_CANCELLED:
|
239
|
-
return gesture.onTouchesCancelled;
|
240
|
-
}
|
241
|
-
}
|
242
|
-
function touchEventTypeToCallbackType(eventType) {
|
243
|
-
'worklet';
|
244
|
-
|
245
|
-
switch (eventType) {
|
246
|
-
case TouchEventType.TOUCHES_DOWN:
|
247
|
-
return CALLBACK_TYPE.TOUCHES_DOWN;
|
248
|
-
case TouchEventType.TOUCHES_MOVE:
|
249
|
-
return CALLBACK_TYPE.TOUCHES_MOVE;
|
250
|
-
case TouchEventType.TOUCHES_UP:
|
251
|
-
return CALLBACK_TYPE.TOUCHES_UP;
|
252
|
-
case TouchEventType.TOUCHES_CANCELLED:
|
253
|
-
return CALLBACK_TYPE.TOUCHES_CANCELLED;
|
254
|
-
}
|
255
|
-
return CALLBACK_TYPE.UNDEFINED;
|
256
|
-
}
|
257
|
-
function runWorklet(type, gesture, event, ...args) {
|
258
|
-
'worklet';
|
259
|
-
|
260
|
-
const handler = getHandler(type, gesture);
|
261
|
-
if (gesture.isWorklet[type]) {
|
262
|
-
// @ts-ignore Logic below makes sure the correct event is send to the
|
263
|
-
// correct handler.
|
264
|
-
handler === null || handler === void 0 || handler(event, ...args);
|
265
|
-
} else if (handler) {
|
266
|
-
console.warn(tagMessage('Animated gesture callback must be a worklet'));
|
267
|
-
}
|
268
|
-
}
|
269
|
-
function useAnimatedGesture(preparedGesture, needsRebuild) {
|
270
|
-
if (!Reanimated) {
|
271
|
-
return;
|
272
|
-
}
|
273
|
-
|
274
|
-
// Hooks are called conditionally, but the condition is whether the
|
275
|
-
// react-native-reanimated is installed, which shouldn't change while running
|
276
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
277
|
-
const sharedHandlersCallbacks = Reanimated.useSharedValue(null);
|
278
|
-
|
279
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
280
|
-
const lastUpdateEvent = Reanimated.useSharedValue([]);
|
281
|
-
|
282
|
-
// not every gesture needs a state controller, init them lazily
|
283
|
-
const stateControllers = [];
|
284
|
-
const callback = event => {
|
285
|
-
'worklet';
|
286
|
-
|
287
|
-
const currentCallback = sharedHandlersCallbacks.value;
|
288
|
-
if (!currentCallback) {
|
289
|
-
return;
|
290
|
-
}
|
291
|
-
for (let i = 0; i < currentCallback.length; i++) {
|
292
|
-
const gesture = currentCallback[i];
|
293
|
-
if (event.handlerTag === gesture.handlerTag) {
|
294
|
-
if (isStateChangeEvent(event)) {
|
295
|
-
if (event.oldState === State.UNDETERMINED && event.state === State.BEGAN) {
|
296
|
-
runWorklet(CALLBACK_TYPE.BEGAN, gesture, event);
|
297
|
-
} else if ((event.oldState === State.BEGAN || event.oldState === State.UNDETERMINED) && event.state === State.ACTIVE) {
|
298
|
-
runWorklet(CALLBACK_TYPE.START, gesture, event);
|
299
|
-
lastUpdateEvent.value[gesture.handlerTag] = undefined;
|
300
|
-
} else if (event.oldState !== event.state && event.state === State.END) {
|
301
|
-
if (event.oldState === State.ACTIVE) {
|
302
|
-
runWorklet(CALLBACK_TYPE.END, gesture, event, true);
|
303
|
-
}
|
304
|
-
runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, true);
|
305
|
-
} else if ((event.state === State.FAILED || event.state === State.CANCELLED) && event.state !== event.oldState) {
|
306
|
-
if (event.oldState === State.ACTIVE) {
|
307
|
-
runWorklet(CALLBACK_TYPE.END, gesture, event, false);
|
308
|
-
}
|
309
|
-
runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, false);
|
310
|
-
}
|
311
|
-
} else if (isTouchEvent(event)) {
|
312
|
-
if (!stateControllers[i]) {
|
313
|
-
stateControllers[i] = GestureStateManager.create(event.handlerTag);
|
314
|
-
}
|
315
|
-
if (event.eventType !== TouchEventType.UNDETERMINED) {
|
316
|
-
runWorklet(touchEventTypeToCallbackType(event.eventType), gesture, event, stateControllers[i]);
|
317
|
-
}
|
318
|
-
} else {
|
319
|
-
runWorklet(CALLBACK_TYPE.UPDATE, gesture, event);
|
320
|
-
if (gesture.onChange && gesture.changeEventCalculator) {
|
321
|
-
var _gesture$changeEventC;
|
322
|
-
runWorklet(CALLBACK_TYPE.CHANGE, gesture, (_gesture$changeEventC = gesture.changeEventCalculator) === null || _gesture$changeEventC === void 0 ? void 0 : _gesture$changeEventC.call(gesture, event, lastUpdateEvent.value[gesture.handlerTag]));
|
323
|
-
lastUpdateEvent.value[gesture.handlerTag] = event;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
}
|
327
|
-
}
|
328
|
-
};
|
329
|
-
|
330
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
331
|
-
const event = Reanimated.useEvent(callback, ['onGestureHandlerStateChange', 'onGestureHandlerEvent'], needsRebuild);
|
332
|
-
preparedGesture.animatedEventHandler = event;
|
333
|
-
preparedGesture.animatedHandlers = sharedHandlersCallbacks;
|
334
|
-
}
|
335
|
-
|
336
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
337
|
-
function validateDetectorChildren(ref) {
|
338
|
-
// finds the first native view under the Wrap component and traverses the fiber tree upwards
|
339
|
-
// to check whether there is more than one native view as a pseudo-direct child of GestureDetector
|
340
|
-
// i.e. this is not ok:
|
341
|
-
// Wrap
|
342
|
-
// |
|
343
|
-
// / \
|
344
|
-
// / \
|
345
|
-
// / \
|
346
|
-
// / \
|
347
|
-
// NativeView NativeView
|
348
|
-
//
|
349
|
-
// but this is fine:
|
350
|
-
// Wrap
|
351
|
-
// |
|
352
|
-
// NativeView
|
353
|
-
// |
|
354
|
-
// / \
|
355
|
-
// / \
|
356
|
-
// / \
|
357
|
-
// / \
|
358
|
-
// NativeView NativeView
|
359
|
-
if (__DEV__ && Platform.OS !== 'web') {
|
360
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
361
|
-
const wrapType = REACT_NATIVE_VERSION.minor > 63 || REACT_NATIVE_VERSION.major > 0 ?
|
362
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
363
|
-
ref._reactInternals.elementType :
|
364
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
365
|
-
ref._reactInternalFiber.elementType;
|
366
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
367
|
-
let instance = RNRenderer.findHostInstance_DEPRECATED(ref)._internalFiberInstanceHandleDEV;
|
368
|
-
|
369
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
370
|
-
while (instance && instance.elementType !== wrapType) {
|
371
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
372
|
-
if (instance.sibling) {
|
373
|
-
throw new Error('GestureDetector has more than one native view as its children. This can happen if you are using a custom component that renders multiple views, like React.Fragment. You should wrap content of GestureDetector with a <View> or <Animated.View>.');
|
374
|
-
}
|
375
|
-
|
376
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
377
|
-
instance = instance.return;
|
378
|
-
}
|
379
|
-
}
|
380
|
-
}
|
381
|
-
const applyUserSelectProp = (userSelect, gesture) => {
|
382
|
-
for (const g of gesture.toGestureArray()) {
|
383
|
-
g.config.userSelect = userSelect;
|
384
|
-
}
|
385
|
-
};
|
386
|
-
export const GestureDetector = props => {
|
387
|
-
const rootViewContext = useContext(GestureHandlerRootViewContext);
|
388
|
-
if (__DEV__ && !rootViewContext && !isJestEnv() && Platform.OS !== 'web' && Platform.OS !== "harmony") {
|
389
|
-
// RNOH: patch
|
390
|
-
throw new Error('GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
|
391
|
-
}
|
392
|
-
const gestureConfig = props.gesture;
|
393
|
-
if (props.userSelect) {
|
394
|
-
applyUserSelectProp(props.userSelect, gestureConfig);
|
395
|
-
}
|
396
|
-
const gesture = gestureConfig.toGestureArray();
|
397
|
-
const useReanimatedHook = gesture.some(g => g.shouldUseReanimated);
|
398
|
-
|
399
|
-
// store state in ref to prevent unnecessary renders
|
400
|
-
const state = useRef({
|
401
|
-
firstRender: true,
|
402
|
-
viewRef: null,
|
403
|
-
previousViewTag: -1,
|
404
|
-
forceReattach: false
|
405
|
-
}).current;
|
406
|
-
const mountedRef = useRef(false);
|
407
|
-
const webEventHandlersRef = useRef({
|
408
|
-
onGestureHandlerEvent: e => {
|
409
|
-
onGestureHandlerEvent(e.nativeEvent);
|
410
|
-
},
|
411
|
-
onGestureHandlerStateChange: isNewWebImplementationEnabled() ? e => {
|
412
|
-
onGestureHandlerEvent(e.nativeEvent);
|
413
|
-
} : undefined
|
414
|
-
});
|
415
|
-
const [renderState, setRenderState] = useState(false);
|
416
|
-
function forceRender() {
|
417
|
-
setRenderState(!renderState);
|
418
|
-
}
|
419
|
-
const preparedGesture = React.useRef({
|
420
|
-
config: gesture,
|
421
|
-
animatedEventHandler: null,
|
422
|
-
animatedHandlers: null,
|
423
|
-
firstExecution: true,
|
424
|
-
useReanimatedHook: useReanimatedHook
|
425
|
-
}).current;
|
426
|
-
if (useReanimatedHook !== preparedGesture.useReanimatedHook) {
|
427
|
-
throw new Error(tagMessage('You cannot change the thread the callbacks are ran on while the app is running'));
|
428
|
-
}
|
429
|
-
function onHandlersUpdate(skipConfigUpdate) {
|
430
|
-
// if the underlying view has changed we need to reattach handlers to the new view
|
431
|
-
const viewTag = findNodeHandle(state.viewRef);
|
432
|
-
const forceReattach = viewTag !== state.previousViewTag;
|
433
|
-
if (forceReattach || needsToReattach(preparedGesture, gesture)) {
|
434
|
-
validateDetectorChildren(state.viewRef);
|
435
|
-
dropHandlers(preparedGesture);
|
436
|
-
attachHandlers({
|
437
|
-
preparedGesture,
|
438
|
-
gestureConfig,
|
439
|
-
gesture,
|
440
|
-
webEventHandlersRef,
|
441
|
-
viewTag,
|
442
|
-
mountedRef
|
443
|
-
});
|
444
|
-
state.previousViewTag = viewTag;
|
445
|
-
state.forceReattach = forceReattach;
|
446
|
-
if (forceReattach) {
|
447
|
-
forceRender();
|
448
|
-
}
|
449
|
-
} else if (!skipConfigUpdate) {
|
450
|
-
updateHandlers(preparedGesture, gestureConfig, gesture, mountedRef);
|
451
|
-
}
|
452
|
-
}
|
453
|
-
|
454
|
-
// Reanimated event should be rebuilt only when gestures are reattached, otherwise
|
455
|
-
// config update will be enough as all necessary items are stored in shared values anyway
|
456
|
-
const needsToRebuildReanimatedEvent = preparedGesture.firstExecution || needsToReattach(preparedGesture, gesture) || state.forceReattach;
|
457
|
-
state.forceReattach = false;
|
458
|
-
if (preparedGesture.firstExecution) {
|
459
|
-
gestureConfig.initialize();
|
460
|
-
}
|
461
|
-
if (useReanimatedHook) {
|
462
|
-
// Whether animatedGesture or gesture is used shouldn't change while the app is running
|
463
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
464
|
-
useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);
|
465
|
-
}
|
466
|
-
useEffect(() => {
|
467
|
-
const viewTag = findNodeHandle(state.viewRef);
|
468
|
-
state.firstRender = true;
|
469
|
-
mountedRef.current = true;
|
470
|
-
validateDetectorChildren(state.viewRef);
|
471
|
-
attachHandlers({
|
472
|
-
preparedGesture,
|
473
|
-
gestureConfig,
|
474
|
-
gesture,
|
475
|
-
webEventHandlersRef,
|
476
|
-
viewTag,
|
477
|
-
mountedRef
|
478
|
-
});
|
479
|
-
return () => {
|
480
|
-
mountedRef.current = false;
|
481
|
-
dropHandlers(preparedGesture);
|
482
|
-
};
|
483
|
-
}, []);
|
484
|
-
useEffect(() => {
|
485
|
-
if (!state.firstRender) {
|
486
|
-
onHandlersUpdate();
|
487
|
-
} else {
|
488
|
-
state.firstRender = false;
|
489
|
-
}
|
490
|
-
}, [props]);
|
491
|
-
const refFunction = ref => {
|
492
|
-
if (ref !== null) {
|
493
|
-
// @ts-ignore Just setting the view ref
|
494
|
-
state.viewRef = ref;
|
495
|
-
|
496
|
-
// if it's the first render, also set the previousViewTag to prevent reattaching gestures when not needed
|
497
|
-
if (state.previousViewTag === -1) {
|
498
|
-
state.previousViewTag = findNodeHandle(state.viewRef);
|
499
|
-
}
|
500
|
-
|
501
|
-
// pass true as `skipConfigUpdate`, here we only want to trigger the eventual reattaching of handlers
|
502
|
-
// in case the view has changed, while config update would be handled be the `useEffect` above
|
503
|
-
onHandlersUpdate(true);
|
504
|
-
if (isFabric()) {
|
505
|
-
const node = getShadowNodeFromRef(ref);
|
506
|
-
if (global.isFormsStackingContext(node) === false) {
|
507
|
-
console.error(tagMessage('GestureDetector has received a child that may get view-flattened. ' + '\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'));
|
508
|
-
}
|
509
|
-
}
|
510
|
-
}
|
511
|
-
};
|
512
|
-
if (useReanimatedHook) {
|
513
|
-
return /*#__PURE__*/React.createElement(AnimatedWrap, {
|
514
|
-
ref: refFunction,
|
515
|
-
onGestureHandlerEvent: preparedGesture.animatedEventHandler
|
516
|
-
}, props.children);
|
517
|
-
} else {
|
518
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
519
|
-
ref: refFunction
|
520
|
-
}, props.children);
|
521
|
-
}
|
522
|
-
};
|
523
|
-
class Wrap extends React.Component {
|
524
|
-
render() {
|
525
|
-
try {
|
526
|
-
// I don't think that fighting with types over such a simple function is worth it
|
527
|
-
// The only thing it does is add 'collapsable: false' to the child component
|
528
|
-
// to make sure it is in the native view hierarchy so the detector can find
|
529
|
-
// correct viewTag to attach to.
|
530
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
531
|
-
const child = React.Children.only(this.props.children);
|
532
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
533
|
-
collapsable: false
|
534
|
-
},
|
535
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
536
|
-
child.props.children);
|
537
|
-
} catch (e) {
|
538
|
-
throw new Error(tagMessage(`GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
|
539
|
-
}
|
540
|
-
}
|
541
|
-
}
|
542
|
-
const AnimatedWrap = (Reanimated === null || Reanimated === void 0 || (_Reanimated$default = Reanimated.default) === null || _Reanimated$default === void 0 ? void 0 : _Reanimated$default.createAnimatedComponent(Wrap)) ?? Wrap;
|
543
|
-
//# sourceMappingURL=GestureDetector.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["React","useContext","useEffect","useRef","useState","BaseGesture","CALLBACK_TYPE","Reanimated","registerHandler","unregisterHandler","RNGestureHandlerModule","baseGestureHandlerWithMonitorProps","filterConfig","findNodeHandle","scheduleFlushOperations","GestureStateManager","flingGestureHandlerProps","forceTouchGestureHandlerProps","longPressGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","tapGestureHandlerProps","State","TouchEventType","ActionType","isFabric","isJestEnv","REACT_NATIVE_VERSION","tagMessage","getShadowNodeFromRef","Platform","onGestureHandlerEvent","RNRenderer","isNewWebImplementationEnabled","nativeViewGestureHandlerProps","GestureHandlerRootViewContext","ALLOWED_PROPS","convertToHandlerTag","ref","handlerTag","_ref$current","current","extractValidHandlerTags","interactionGroup","_interactionGroup$map","map","filter","tag","dropHandlers","preparedGesture","handler","config","dropGestureHandler","testId","checkGestureCallbacksForWorklets","gesture","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","attachHandlers","gestureConfig","viewTag","webEventHandlersRef","mountedRef","firstExecution","initialize","queueMicrotask","prepare","createGestureHandler","handlerName","requireToFail","simultaneousWith","updateGestureHandler","simultaneousHandlers","waitFor","actionType","shouldUseReanimated","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","OS","attachGestureHandler","JS_FUNCTION_OLD_API","animatedHandlers","isAnimatedGesture","g","value","updateHandlers","i","length","previousHandlersValue","newHandlersValue","shouldUpdateSharedValue","gestureId","needsToReattach","isStateChangeEvent","event","oldState","isTouchEvent","eventType","getHandler","type","BEGAN","onBegin","START","onStart","UPDATE","onUpdate","CHANGE","onChange","END","onEnd","FINALIZE","onFinalize","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","touchEventTypeToCallbackType","UNDEFINED","runWorklet","args","warn","useAnimatedGesture","needsRebuild","sharedHandlersCallbacks","useSharedValue","lastUpdateEvent","stateControllers","callback","currentCallback","UNDETERMINED","state","ACTIVE","undefined","FAILED","CANCELLED","create","changeEventCalculator","_gesture$changeEventC","call","useEvent","animatedEventHandler","validateDetectorChildren","__DEV__","wrapType","minor","major","_reactInternals","elementType","_reactInternalFiber","instance","findHostInstance_DEPRECATED","_internalFiberInstanceHandleDEV","sibling","Error","return","applyUserSelectProp","userSelect","toGestureArray","GestureDetector","props","rootViewContext","useReanimatedHook","some","firstRender","viewRef","previousViewTag","forceReattach","e","nativeEvent","onGestureHandlerStateChange","renderState","setRenderState","forceRender","onHandlersUpdate","skipConfigUpdate","needsToRebuildReanimatedEvent","refFunction","node","global","isFormsStackingContext","createElement","AnimatedWrap","children","Wrap","Component","render","child","Children","only","cloneElement","collapsable","_Reanimated$default","default","createAnimatedComponent"],"sourceRoot":"..\\..\\..\\..\\src","sources":["handlers/gestures/GestureDetector.tsx"],"mappings":";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,CAAC;IACH,CAAC,CAAC,OAAOf,CAAC,EAAE;MACV,MAAM,IAAId,KAAK,CACbvI,UAAU,CACP,2KACH,CACF,CAAC;IACH;EACF;AACF;AAEA,MAAMmK,YAAY,GAAG,CAAAxL,UAAU,aAAVA,UAAU,gBAAAkM,mBAAA,GAAVlM,UAAU,CAAEmM,OAAO,cAAAD,mBAAA,uBAAnBA,mBAAA,CAAqBE,uBAAuB,CAACV,IAAI,CAAC,KAAIA,IAAI"}
|
package/lib/module/init.js
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { startListening } from 'react-native-gesture-handler/src/handlers/gestures/eventReceiver';
|
2
|
-
import { RNGestureHandlerModule } from './RNGestureHandlerModule';
|
3
|
-
import { isFabric } from 'react-native-gesture-handler/src/utils';
|
4
|
-
let fabricInitialized = false;
|
5
|
-
export function initialize() {
|
6
|
-
startListening();
|
7
|
-
}
|
8
|
-
|
9
|
-
// since isFabric() may give wrong results before the first render, we call this
|
10
|
-
// method during render of GestureHandlerRootView
|
11
|
-
export function maybeInitializeFabric() {
|
12
|
-
if (isFabric() && !fabricInitialized) {
|
13
|
-
RNGestureHandlerModule.install();
|
14
|
-
fabricInitialized = true;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
//# sourceMappingURL=init.js.map
|
package/lib/module/init.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["startListening","RNGestureHandlerModule","isFabric","fabricInitialized","initialize","maybeInitializeFabric","install"],"sourceRoot":"..\\..\\src","sources":["init.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kEAAkE;AACjG,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,QAAQ,QAAQ,wCAAwC;AAEjE,IAAIC,iBAAiB,GAAG,KAAK;AAE7B,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC3BJ,cAAc,CAAC,CAAC;AAClB;;AAEA;AACA;AACA,OAAO,SAASK,qBAAqBA,CAAA,EAAG;EACtC,IAAIH,QAAQ,CAAC,CAAC,IAAI,CAACC,iBAAiB,EAAE;IACpCF,sBAAsB,CAACK,OAAO,CAAC,CAAC;IAChCH,iBAAiB,GAAG,IAAI;EAC1B;AACF"}
|