react-native-gesture-handler 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/RNGestureHandler.podspec +2 -1
  2. package/android/build.gradle +10 -2
  3. package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandler.kt +14 -2
  4. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
  5. package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
  6. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +11 -3
  7. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +3 -41
  8. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +6 -0
  9. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +10 -54
  10. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +2 -0
  11. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +6 -0
  12. package/ios/RNGHTouchEventType.h +9 -0
  13. package/ios/RNGestureHandler.h +2 -2
  14. package/ios/RNGestureHandler.m +21 -8
  15. package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcuserdata/jakubpiasecki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  16. package/ios/RNGestureHandler.xcodeproj/xcuserdata/jakubpiasecki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
  17. package/ios/RNGestureHandlerButton.h +1 -0
  18. package/ios/RNGestureHandlerButton.m +9 -1
  19. package/ios/RNGestureHandlerButtonComponentView.mm +14 -1
  20. package/ios/RNGestureHandlerButtonManager.m +4 -1
  21. package/ios/RNGestureHandlerEvents.h +2 -2
  22. package/ios/RNGestureHandlerEvents.m +2 -2
  23. package/ios/RNGestureHandlerManager.h +2 -0
  24. package/ios/RNGestureHandlerManager.mm +30 -20
  25. package/ios/RNGestureHandlerModule.mm +18 -0
  26. package/ios/RNGestureHandlerPointerTracker.h +2 -2
  27. package/ios/RNGestureHandlerPointerTracker.m +9 -6
  28. package/ios/RNGestureHandlerRegistry.h +1 -0
  29. package/ios/RNGestureHandlerRegistry.m +10 -0
  30. package/jest-utils/package.json +6 -0
  31. package/lib/commonjs/GestureHandlerRootView.android.js +7 -1
  32. package/lib/commonjs/GestureHandlerRootView.android.js.map +1 -1
  33. package/lib/commonjs/GestureHandlerRootView.js +6 -0
  34. package/lib/commonjs/GestureHandlerRootView.js.map +1 -1
  35. package/lib/commonjs/GestureHandlerRootView.web.js +19 -0
  36. package/lib/commonjs/GestureHandlerRootView.web.js.map +1 -0
  37. package/lib/commonjs/RNGestureHandlerModule.js +5 -0
  38. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  39. package/lib/commonjs/RNGestureHandlerModule.web.js +4 -1
  40. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  41. package/lib/commonjs/{EventType.js → TouchEventType.js} +4 -4
  42. package/lib/commonjs/TouchEventType.js.map +1 -0
  43. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  44. package/lib/commonjs/components/GestureHandlerButton.js +1 -1
  45. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  46. package/lib/commonjs/components/touchables/GenericTouchable.js +2 -0
  47. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  48. package/lib/commonjs/components/touchables/TouchableOpacity.js +3 -1
  49. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  50. package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js +4 -6
  51. package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  52. package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js +4 -6
  53. package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  54. package/lib/commonjs/getShadowNodeFromRef.js +12 -9
  55. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  56. package/lib/commonjs/handlers/createHandler.js +10 -14
  57. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  58. package/lib/commonjs/handlers/gestureHandlerCommon.js +18 -1
  59. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  60. package/lib/commonjs/handlers/gestures/GestureDetector.js +41 -21
  61. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  62. package/lib/commonjs/handlers/gestures/eventReceiver.js +6 -5
  63. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  64. package/lib/commonjs/handlers/gestures/gesture.js +11 -2
  65. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  66. package/lib/commonjs/index.js +0 -14
  67. package/lib/commonjs/index.js.map +1 -1
  68. package/lib/commonjs/init.js +10 -1
  69. package/lib/commonjs/init.js.map +1 -1
  70. package/lib/commonjs/jestUtils/index.js +20 -0
  71. package/lib/commonjs/jestUtils/index.js.map +1 -0
  72. package/lib/commonjs/{jestUtils.js → jestUtils/jestUtils.js} +12 -12
  73. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
  74. package/lib/commonjs/utils.js +23 -1
  75. package/lib/commonjs/utils.js.map +1 -1
  76. package/lib/commonjs/web/GestureHandler.js +4 -1
  77. package/lib/commonjs/web/GestureHandler.js.map +1 -1
  78. package/lib/module/GestureHandlerRootView.android.js +7 -2
  79. package/lib/module/GestureHandlerRootView.android.js.map +1 -1
  80. package/lib/module/GestureHandlerRootView.js +5 -0
  81. package/lib/module/GestureHandlerRootView.js.map +1 -1
  82. package/lib/module/GestureHandlerRootView.web.js +6 -0
  83. package/lib/module/GestureHandlerRootView.web.js.map +1 -0
  84. package/lib/module/RNGestureHandlerModule.js +5 -0
  85. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  86. package/lib/module/RNGestureHandlerModule.web.js +4 -1
  87. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  88. package/lib/module/{EventType.js → TouchEventType.js} +2 -2
  89. package/lib/module/TouchEventType.js.map +1 -0
  90. package/lib/module/components/GestureButtons.js.map +1 -1
  91. package/lib/module/components/GestureHandlerButton.js +2 -2
  92. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  93. package/lib/module/components/touchables/GenericTouchable.js +2 -0
  94. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  95. package/lib/module/components/touchables/TouchableOpacity.js +4 -2
  96. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  97. package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js +5 -7
  98. package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  99. package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js +5 -8
  100. package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  101. package/lib/module/getShadowNodeFromRef.js +11 -8
  102. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  103. package/lib/module/handlers/createHandler.js +10 -17
  104. package/lib/module/handlers/createHandler.js.map +1 -1
  105. package/lib/module/handlers/gestureHandlerCommon.js +11 -1
  106. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  107. package/lib/module/handlers/gestures/GestureDetector.js +41 -22
  108. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  109. package/lib/module/handlers/gestures/eventReceiver.js +6 -7
  110. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  111. package/lib/module/handlers/gestures/gesture.js +10 -2
  112. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  113. package/lib/module/index.js +0 -1
  114. package/lib/module/index.js.map +1 -1
  115. package/lib/module/init.js +6 -1
  116. package/lib/module/init.js.map +1 -1
  117. package/lib/module/jestUtils/index.js +2 -0
  118. package/lib/module/jestUtils/index.js.map +1 -0
  119. package/lib/module/{jestUtils.js → jestUtils/jestUtils.js} +12 -12
  120. package/lib/module/jestUtils/jestUtils.js.map +1 -0
  121. package/lib/module/utils.js +17 -1
  122. package/lib/module/utils.js.map +1 -1
  123. package/lib/module/web/GestureHandler.js +4 -1
  124. package/lib/module/web/GestureHandler.js.map +1 -1
  125. package/lib/typescript/GestureHandlerRootView.web.d.ts +5 -0
  126. package/lib/typescript/RNGestureHandlerModule.d.ts +1 -0
  127. package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -0
  128. package/lib/typescript/{EventType.d.ts → TouchEventType.d.ts} +2 -2
  129. package/lib/typescript/components/GestureButtons.d.ts +18 -6
  130. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -1
  131. package/lib/typescript/fabric/RNGestureHandlerButtonNativeComponent.d.ts +13 -0
  132. package/lib/typescript/fabric/RNGestureHandlerRootViewNativeComponent.d.ts +5 -0
  133. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  134. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +5 -3
  135. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +0 -3
  136. package/lib/typescript/handlers/gestures/eventReceiver.d.ts +2 -0
  137. package/lib/typescript/handlers/gestures/gesture.d.ts +2 -0
  138. package/lib/typescript/index.d.ts +0 -1
  139. package/lib/typescript/init.d.ts +1 -0
  140. package/lib/typescript/jestUtils/index.d.ts +1 -0
  141. package/lib/typescript/{jestUtils.d.ts → jestUtils/jestUtils.d.ts} +18 -18
  142. package/lib/typescript/utils.d.ts +2 -0
  143. package/lib/typescript/web/GestureHandler.d.ts +1 -1
  144. package/package.json +5 -2
  145. package/src/GestureHandlerRootView.android.tsx +8 -2
  146. package/src/GestureHandlerRootView.tsx +6 -0
  147. package/src/GestureHandlerRootView.web.tsx +12 -0
  148. package/src/RNGestureHandlerModule.ts +7 -0
  149. package/src/RNGestureHandlerModule.web.ts +2 -0
  150. package/src/{EventType.ts → TouchEventType.ts} +2 -2
  151. package/src/components/GestureButtons.tsx +21 -7
  152. package/src/components/GestureHandlerButton.tsx +2 -2
  153. package/src/components/touchables/GenericTouchable.tsx +2 -0
  154. package/src/components/touchables/TouchableOpacity.tsx +6 -2
  155. package/src/fabric/RNGestureHandlerButtonNativeComponent.ts +27 -0
  156. package/src/fabric/RNGestureHandlerRootViewNativeComponent.ts +12 -0
  157. package/src/getShadowNodeFromRef.ts +12 -9
  158. package/src/handlers/createHandler.ts +7 -17
  159. package/src/handlers/gestureHandlerCommon.ts +19 -2
  160. package/src/handlers/gestures/GestureDetector.tsx +64 -31
  161. package/src/handlers/gestures/eventReceiver.ts +6 -6
  162. package/src/handlers/gestures/gesture.ts +13 -2
  163. package/src/index.ts +0 -1
  164. package/src/init.ts +8 -1
  165. package/src/jestUtils/index.ts +1 -0
  166. package/src/{jestUtils.ts → jestUtils/jestUtils.ts} +21 -21
  167. package/src/utils.ts +20 -0
  168. package/src/web/GestureHandler.ts +7 -1
  169. package/ios/RNTouchEventType.h +0 -9
  170. package/lib/commonjs/EventType.js.map +0 -1
  171. package/lib/commonjs/jestUtils.js.map +0 -1
  172. package/lib/module/EventType.js.map +0 -1
  173. package/lib/module/jestUtils.js.map +0 -1
  174. package/src/fabric/RNGestureHandlerButtonNativeComponent.js +0 -27
  175. package/src/fabric/RNGestureHandlerRootViewNativeComponent.js +0 -19
@@ -5,7 +5,7 @@ import { BaseGesture, CALLBACK_TYPE } from './gesture';
5
5
  import { Reanimated } from './reanimatedWrapper';
6
6
  import { registerHandler, unregisterHandler } from '../handlersRegistry';
7
7
  import RNGestureHandlerModule from '../../RNGestureHandlerModule';
8
- import { baseGestureHandlerWithMonitorProps, filterConfig, findNodeHandle } from '../gestureHandlerCommon';
8
+ import { baseGestureHandlerWithMonitorProps, filterConfig, findNodeHandle, scheduleFlushOperations } from '../gestureHandlerCommon';
9
9
  import { GestureStateManager } from './gestureStateManager';
10
10
  import { flingGestureHandlerProps } from '../FlingGestureHandler';
11
11
  import { forceTouchGestureHandlerProps } from '../ForceTouchGestureHandler';
@@ -13,10 +13,12 @@ import { longPressGestureHandlerProps } from '../LongPressGestureHandler';
13
13
  import { panGestureHandlerProps, panGestureHandlerCustomNativeProps } from '../PanGestureHandler';
14
14
  import { tapGestureHandlerProps } from '../TapGestureHandler';
15
15
  import { State } from '../../State';
16
- import { EventType } from '../../EventType';
16
+ import { TouchEventType } from '../../TouchEventType';
17
17
  import { ActionType } from '../../ActionType';
18
18
  import { isFabric, tagMessage } from '../../utils';
19
19
  import { getShadowNodeFromRef } from '../../getShadowNodeFromRef';
20
+ import { Platform } from 'react-native';
21
+ import { onGestureHandlerEvent } from './eventReceiver';
20
22
  const ALLOWED_PROPS = [...baseGestureHandlerWithMonitorProps, ...tapGestureHandlerProps, ...panGestureHandlerProps, ...panGestureHandlerCustomNativeProps, ...longPressGestureHandlerProps, ...forceTouchGestureHandlerProps, ...flingGestureHandlerProps];
21
23
 
22
24
  function convertToHandlerTag(ref) {
@@ -44,6 +46,8 @@ function dropHandlers(preparedGesture) {
44
46
  RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);
45
47
  unregisterHandler(handler.handlerTag, handler.config.testId);
46
48
  }
49
+
50
+ scheduleFlushOperations();
47
51
  }
48
52
 
49
53
  function checkGestureCallbacksForWorklets(gesture) {
@@ -66,7 +70,8 @@ function attachHandlers({
66
70
  preparedGesture,
67
71
  gestureConfig,
68
72
  gesture,
69
- viewTag
73
+ viewTag,
74
+ webEventHandlersRef
70
75
  }) {
71
76
  if (!preparedGesture.firstExecution) {
72
77
  gestureConfig === null || gestureConfig === void 0 ? void 0 : gestureConfig.initialize();
@@ -83,10 +88,13 @@ function attachHandlers({
83
88
  for (const handler of gesture) {
84
89
  checkGestureCallbacksForWorklets(handler);
85
90
  RNGestureHandlerModule.createGestureHandler(handler.handlerName, handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS));
86
- registerHandler(handler.handlerTag, handler, handler.config.testId); // use setImmediate to extract handlerTags, because all refs should be initialized
87
- // when it's ran
91
+ registerHandler(handler.handlerTag, handler, handler.config.testId);
92
+ } // use setImmediate to extract handlerTags, because all refs should be initialized
93
+ // when it's ran
94
+
88
95
 
89
- setImmediate(() => {
96
+ setImmediate(() => {
97
+ for (const handler of gesture) {
90
98
  let requireToFail = [];
91
99
 
92
100
  if (handler.config.requireToFail) {
@@ -103,14 +111,21 @@ function attachHandlers({
103
111
  simultaneousHandlers: simultaneousWith,
104
112
  waitFor: requireToFail
105
113
  }));
106
- });
107
- }
114
+ }
108
115
 
116
+ scheduleFlushOperations();
117
+ });
109
118
  preparedGesture.config = gesture;
110
119
 
111
120
  for (const gesture of preparedGesture.config) {
112
121
  const actionType = gesture.shouldUseReanimated ? ActionType.REANIMATED_WORKLET : ActionType.JS_FUNCTION_NEW_API;
113
- RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, actionType);
122
+
123
+ if (Platform.OS === 'web') {
124
+ RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, ActionType.JS_FUNCTION_OLD_API, // ignored on web
125
+ webEventHandlersRef);
126
+ } else {
127
+ RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, actionType);
128
+ }
114
129
  }
115
130
 
116
131
  if (preparedGesture.animatedHandlers) {
@@ -155,6 +170,8 @@ function updateHandlers(preparedGesture, gestureConfig, gesture) {
155
170
  preparedGesture.animatedHandlers.value = preparedGesture.config.filter(g => g.shouldUseReanimated) // ignore gestures that shouldn't run on UI
156
171
  .map(g => g.handlers);
157
172
  }
173
+
174
+ scheduleFlushOperations();
158
175
  });
159
176
  }
160
177
 
@@ -229,16 +246,16 @@ function useAnimatedGesture(preparedGesture, needsRebuild) {
229
246
  'worklet';
230
247
 
231
248
  switch (eventType) {
232
- case EventType.TOUCHES_DOWN:
249
+ case TouchEventType.TOUCHES_DOWN:
233
250
  return CALLBACK_TYPE.TOUCHES_DOWN;
234
251
 
235
- case EventType.TOUCHES_MOVE:
252
+ case TouchEventType.TOUCHES_MOVE:
236
253
  return CALLBACK_TYPE.TOUCHES_MOVE;
237
254
 
238
- case EventType.TOUCHES_UP:
255
+ case TouchEventType.TOUCHES_UP:
239
256
  return CALLBACK_TYPE.TOUCHES_UP;
240
257
 
241
- case EventType.TOUCHES_CANCELLED:
258
+ case TouchEventType.TOUCHES_CANCELLED:
242
259
  return CALLBACK_TYPE.TOUCHES_CANCELLED;
243
260
  }
244
261
 
@@ -305,7 +322,7 @@ function useAnimatedGesture(preparedGesture, needsRebuild) {
305
322
  stateControllers[i] = GestureStateManager.create(event.handlerTag);
306
323
  }
307
324
 
308
- if (event.eventType !== EventType.UNDETERMINED) {
325
+ if (event.eventType !== TouchEventType.UNDETERMINED) {
309
326
  runWorklet(touchEventTypeToCallbackType(event.eventType), gesture, event, stateControllers[i]);
310
327
  }
311
328
  } else {
@@ -336,6 +353,11 @@ export const GestureDetector = props => {
336
353
  const useReanimatedHook = gesture.some(g => g.shouldUseReanimated);
337
354
  const viewRef = useRef(null);
338
355
  const firstRenderRef = useRef(true);
356
+ const webEventHandlersRef = useRef({
357
+ onGestureHandlerEvent: e => {
358
+ onGestureHandlerEvent(e.nativeEvent);
359
+ }
360
+ });
339
361
  const preparedGesture = React.useRef({
340
362
  config: gesture,
341
363
  animatedEventHandler: null,
@@ -371,7 +393,8 @@ export const GestureDetector = props => {
371
393
  preparedGesture,
372
394
  gestureConfig,
373
395
  gesture,
374
- viewTag
396
+ viewTag,
397
+ webEventHandlersRef
375
398
  });
376
399
  return () => {
377
400
  dropHandlers(preparedGesture);
@@ -387,7 +410,8 @@ export const GestureDetector = props => {
387
410
  preparedGesture,
388
411
  gestureConfig,
389
412
  gesture,
390
- viewTag
413
+ viewTag,
414
+ webEventHandlersRef
391
415
  });
392
416
  } else {
393
417
  updateHandlers(preparedGesture, gestureConfig, gesture);
@@ -406,12 +430,7 @@ export const GestureDetector = props => {
406
430
  const node = getShadowNodeFromRef(ref);
407
431
 
408
432
  if (global.isFormsStackingContext(node) === false) {
409
- setImmediate(() => {
410
- // For some weird reason, console.error on iOS delays
411
- // the execution of RNGestureHandlerModule.attachGestureHandler,
412
- // so that's why we use setImmediate here.
413
- 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}>`.'));
414
- });
433
+ 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}>`.'));
415
434
  }
416
435
  }
417
436
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureDetector.tsx"],"names":["React","useEffect","useRef","BaseGesture","CALLBACK_TYPE","Reanimated","registerHandler","unregisterHandler","RNGestureHandlerModule","baseGestureHandlerWithMonitorProps","filterConfig","findNodeHandle","GestureStateManager","flingGestureHandlerProps","forceTouchGestureHandlerProps","longPressGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","tapGestureHandlerProps","State","EventType","ActionType","isFabric","tagMessage","getShadowNodeFromRef","ALLOWED_PROPS","convertToHandlerTag","ref","handlerTag","current","extractValidHandlerTags","interactionGroup","map","filter","tag","dropHandlers","preparedGesture","handler","config","dropGestureHandler","testId","checkGestureCallbacksForWorklets","gesture","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","attachHandlers","gestureConfig","viewTag","firstExecution","initialize","setImmediate","prepare","createGestureHandler","handlerName","requireToFail","simultaneousWith","updateGestureHandler","simultaneousHandlers","waitFor","actionType","shouldUseReanimated","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","attachGestureHandler","animatedHandlers","isAnimatedGesture","g","value","updateHandlers","i","length","needsToReattach","useAnimatedGesture","needsRebuild","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","sharedHandlersCallbacks","useSharedValue","lastUpdateEvent","stateControllers","callback","currentCallback","UNDETERMINED","state","ACTIVE","undefined","FAILED","CANCELLED","create","changeEventCalculator","useEvent","animatedEventHandler","GestureDetector","props","toGestureArray","useReanimatedHook","some","viewRef","firstRenderRef","Error","needsToRebuildReanimatedEvent","refFunction","node","global","isFormsStackingContext","children","Wrap","Component","render","child","Children","only","cloneElement","collapsable","AnimatedWrap","default","createAnimatedComponent"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,QAAyC,OAAzC;AACA,SAGEC,WAHF,EAKEC,aALF,QAMO,WANP;AAOA,SAASC,UAAT,QAAwC,qBAAxC;AACA,SAASC,eAAT,EAA0BC,iBAA1B,QAAmD,qBAAnD;AACA,OAAOC,sBAAP,MAAmC,8BAAnC;AACA,SACEC,kCADF,EAEEC,YAFF,EAGEC,cAHF,QAOO,yBAPP;AAQA,SACEC,mBADF,QAGO,uBAHP;AAIA,SAASC,wBAAT,QAAyC,wBAAzC;AACA,SAASC,6BAAT,QAA8C,6BAA9C;AACA,SAASC,4BAAT,QAA6C,4BAA7C;AACA,SACEC,sBADF,EAEEC,kCAFF,QAGO,sBAHP;AAIA,SAASC,sBAAT,QAAuC,sBAAvC;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,aAArC;AACA,SAASC,oBAAT,QAAqC,4BAArC;AAMA,MAAMC,aAAa,GAAG,CACpB,GAAGhB,kCADiB,EAEpB,GAAGS,sBAFiB,EAGpB,GAAGF,sBAHiB,EAIpB,GAAGC,kCAJiB,EAKpB,GAAGF,4BALiB,EAMpB,GAAGD,6BANiB,EAOpB,GAAGD,wBAPiB,CAAtB;;AAoBA,SAASa,mBAAT,CAA6BC,GAA7B,EAAsD;AACpD,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AAC3B,WAAOA,GAAP;AACD,GAFD,MAEO,IAAIA,GAAG,YAAYxB,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K,CAACY,QAHT,CADF;AAOD,GARD,MAQO;AACL,wBAAO,oBAAC,IAAD;AAAM,MAAA,GAAG,EAAEJ;AAAX,OAAyBR,KAAK,CAACY,QAA/B,CAAP;AACD;AACF,CA9GM;;AAgHP,MAAMC,IAAN,SAAmB9I,KAAK,CAAC+I,SAAzB,CAAwE;AACtEC,EAAAA,MAAM,GAAG;AACP;AACA;AACA;AACA;AACA;AACA,UAAMC,KAAU,GAAGjJ,KAAK,CAACkJ,QAAN,CAAeC,IAAf,CAAoB,KAAKlB,KAAL,CAAWY,QAA/B,CAAnB;AACA,wBAAO7I,KAAK,CAACoJ,YAAN,CACLH,KADK,EAEL;AAAEI,MAAAA,WAAW,EAAE;AAAf,KAFK,EAGL;AACAJ,IAAAA,KAAK,CAAChB,KAAN,CAAYY,QAJP,CAAP;AAMD;;AAdqE;;AAiBxE,MAAMS,YAAY,4BAAGjJ,UAAH,aAAGA,UAAH,8CAAGA,UAAU,CAAEkJ,OAAf,wDAAG,oBAAqBC,uBAArB,CAA6CV,IAA7C,CAAH,yEAAyDA,IAA3E","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport {\n GestureType,\n HandlerCallbacks,\n BaseGesture,\n GestureRef,\n CALLBACK_TYPE,\n} from './gesture';\nimport { Reanimated, SharedValue } from './reanimatedWrapper';\nimport { registerHandler, unregisterHandler } from '../handlersRegistry';\nimport RNGestureHandlerModule from '../../RNGestureHandlerModule';\nimport {\n baseGestureHandlerWithMonitorProps,\n filterConfig,\n findNodeHandle,\n GestureTouchEvent,\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from '../gestureHandlerCommon';\nimport {\n GestureStateManager,\n GestureStateManagerType,\n} from './gestureStateManager';\nimport { flingGestureHandlerProps } from '../FlingGestureHandler';\nimport { forceTouchGestureHandlerProps } from '../ForceTouchGestureHandler';\nimport { longPressGestureHandlerProps } from '../LongPressGestureHandler';\nimport {\n panGestureHandlerProps,\n panGestureHandlerCustomNativeProps,\n} from '../PanGestureHandler';\nimport { tapGestureHandlerProps } from '../TapGestureHandler';\nimport { State } from '../../State';\nimport { EventType } from '../../EventType';\nimport { ComposedGesture } from './gestureComposition';\nimport { ActionType } from '../../ActionType';\nimport { isFabric, tagMessage } from '../../utils';\nimport { getShadowNodeFromRef } from '../../getShadowNodeFromRef';\n\ndeclare global {\n function isFormsStackingContext(node: unknown): boolean | null; // JSI function\n}\n\nconst ALLOWED_PROPS = [\n ...baseGestureHandlerWithMonitorProps,\n ...tapGestureHandlerProps,\n ...panGestureHandlerProps,\n ...panGestureHandlerCustomNativeProps,\n ...longPressGestureHandlerProps,\n ...forceTouchGestureHandlerProps,\n ...flingGestureHandlerProps,\n];\n\nexport type GestureConfigReference = {\n config: GestureType[];\n animatedEventHandler: unknown;\n animatedHandlers: SharedValue<\n HandlerCallbacks<Record<string, unknown>>[] | null\n > | null;\n firstExecution: boolean;\n useReanimatedHook: boolean;\n};\n\nfunction convertToHandlerTag(ref: GestureRef): number {\n if (typeof ref === 'number') {\n return ref;\n } else if (ref instanceof BaseGesture) {\n return ref.handlerTag;\n } else {\n // @ts-ignore in this case it should be a ref either to gesture object or\n // a gesture handler component, in both cases handlerTag property exists\n return ref.current?.handlerTag ?? -1;\n }\n}\n\nfunction extractValidHandlerTags(interactionGroup: GestureRef[] | undefined) {\n return (\n interactionGroup?.map(convertToHandlerTag)?.filter((tag) => tag > 0) ?? []\n );\n}\n\nfunction dropHandlers(preparedGesture: GestureConfigReference) {\n for (const handler of preparedGesture.config) {\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\n\n unregisterHandler(handler.handlerTag, handler.config.testId);\n }\n}\n\nfunction checkGestureCallbacksForWorklets(gesture: GestureType) {\n // if a gesture is explicitly marked to run on the JS thread there is no need to check\n // if callbacks are worklets as the user is aware they will be ran on the JS thread\n if (gesture.config.runOnJS) {\n return;\n }\n\n const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);\n const areSomeWorklets = gesture.handlers.isWorklet.includes(true);\n\n // if some of the callbacks are worklets and some are not, and the gesture is not\n // explicitly marked with `.runOnJS(true)` show an error\n if (areSomeNotWorklets && areSomeWorklets) {\n console.error(\n tagMessage(\n `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.`\n )\n );\n }\n}\n\ninterface AttachHandlersConfig {\n preparedGesture: GestureConfigReference;\n gestureConfig: ComposedGesture | GestureType | undefined;\n gesture: GestureType[];\n viewTag: number;\n}\n\nfunction attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n}: AttachHandlersConfig) {\n if (!preparedGesture.firstExecution) {\n gestureConfig?.initialize();\n } else {\n preparedGesture.firstExecution = false;\n }\n\n // use setImmediate to extract handlerTags, because all refs should be initialized\n // when it's ran\n setImmediate(() => {\n gestureConfig?.prepare();\n });\n\n for (const handler of gesture) {\n checkGestureCallbacksForWorklets(handler);\n\n RNGestureHandlerModule.createGestureHandler(\n handler.handlerName,\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS)\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n\n // use setImmediate to extract handlerTags, because all refs should be initialized\n // when it's ran\n setImmediate(() => {\n let requireToFail: number[] = [];\n if (handler.config.requireToFail) {\n requireToFail = extractValidHandlerTags(handler.config.requireToFail);\n }\n\n let simultaneousWith: number[] = [];\n if (handler.config.simultaneousWith) {\n simultaneousWith = extractValidHandlerTags(\n handler.config.simultaneousWith\n );\n }\n\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS, {\n simultaneousHandlers: simultaneousWith,\n waitFor: requireToFail,\n })\n );\n });\n }\n preparedGesture.config = gesture;\n\n for (const gesture of preparedGesture.config) {\n const actionType = gesture.shouldUseReanimated\n ? ActionType.REANIMATED_WORKLET\n : ActionType.JS_FUNCTION_NEW_API;\n\n RNGestureHandlerModule.attachGestureHandler(\n gesture.handlerTag,\n viewTag,\n actionType\n );\n }\n\n if (preparedGesture.animatedHandlers) {\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\n\n preparedGesture.animatedHandlers.value = (gesture\n .filter(isAnimatedGesture)\n .map((g) => g.handlers) as unknown) as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n}\n\nfunction updateHandlers(\n preparedGesture: GestureConfigReference,\n gestureConfig: ComposedGesture | GestureType | undefined,\n gesture: GestureType[]\n) {\n gestureConfig?.prepare();\n\n for (let i = 0; i < gesture.length; i++) {\n const handler = preparedGesture.config[i];\n checkGestureCallbacksForWorklets(handler);\n\n // only update handlerTag when it's actually different, it may be the same\n // if gesture config object is wrapped with useMemo\n if (gesture[i].handlerTag !== handler.handlerTag) {\n gesture[i].handlerTag = handler.handlerTag;\n gesture[i].handlers.handlerTag = handler.handlerTag;\n }\n }\n\n // use setImmediate to extract handlerTags, because when it's ran, all refs should be updated\n // and handlerTags in BaseGesture references should be updated in the loop above (we need to wait\n // in case of external relations)\n setImmediate(() => {\n for (let i = 0; i < gesture.length; i++) {\n const handler = preparedGesture.config[i];\n\n handler.config = gesture[i].config;\n handler.handlers = gesture[i].handlers;\n\n const requireToFail = extractValidHandlerTags(\n handler.config.requireToFail\n );\n\n const simultaneousWith = extractValidHandlerTags(\n handler.config.simultaneousWith\n );\n\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS, {\n simultaneousHandlers: simultaneousWith,\n waitFor: requireToFail,\n })\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n if (preparedGesture.animatedHandlers) {\n preparedGesture.animatedHandlers.value = (preparedGesture.config\n .filter((g) => g.shouldUseReanimated) // ignore gestures that shouldn't run on UI\n .map((g) => g.handlers) as unknown) as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n });\n}\n\nfunction needsToReattach(\n preparedGesture: GestureConfigReference,\n gesture: GestureType[]\n) {\n if (gesture.length !== preparedGesture.config.length) {\n return true;\n }\n for (let i = 0; i < gesture.length; i++) {\n if (\n gesture[i].handlerName !== preparedGesture.config[i].handlerName ||\n gesture[i].shouldUseReanimated !==\n preparedGesture.config[i].shouldUseReanimated\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction useAnimatedGesture(\n preparedGesture: GestureConfigReference,\n needsRebuild: boolean\n) {\n if (!Reanimated) {\n return;\n }\n\n function isStateChangeEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n ): event is GestureStateChangeEvent {\n 'worklet';\n // @ts-ignore Yes, the oldState prop is missing on GestureTouchEvent, that's the point\n return event.oldState != null;\n }\n\n function isTouchEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n ): event is GestureTouchEvent {\n 'worklet';\n return event.eventType != null;\n }\n\n function getHandler(\n type: CALLBACK_TYPE,\n gesture: HandlerCallbacks<Record<string, unknown>>\n ) {\n 'worklet';\n switch (type) {\n case CALLBACK_TYPE.BEGAN:\n return gesture.onBegin;\n case CALLBACK_TYPE.START:\n return gesture.onStart;\n case CALLBACK_TYPE.UPDATE:\n return gesture.onUpdate;\n case CALLBACK_TYPE.CHANGE:\n return gesture.onChange;\n case CALLBACK_TYPE.END:\n return gesture.onEnd;\n case CALLBACK_TYPE.FINALIZE:\n return gesture.onFinalize;\n case CALLBACK_TYPE.TOUCHES_DOWN:\n return gesture.onTouchesDown;\n case CALLBACK_TYPE.TOUCHES_MOVE:\n return gesture.onTouchesMove;\n case CALLBACK_TYPE.TOUCHES_UP:\n return gesture.onTouchesUp;\n case CALLBACK_TYPE.TOUCHES_CANCELLED:\n return gesture.onTouchesCancelled;\n }\n }\n\n function touchEventTypeToCallbackType(eventType: EventType): CALLBACK_TYPE {\n 'worklet';\n switch (eventType) {\n case EventType.TOUCHES_DOWN:\n return CALLBACK_TYPE.TOUCHES_DOWN;\n case EventType.TOUCHES_MOVE:\n return CALLBACK_TYPE.TOUCHES_MOVE;\n case EventType.TOUCHES_UP:\n return CALLBACK_TYPE.TOUCHES_UP;\n case EventType.TOUCHES_CANCELLED:\n return CALLBACK_TYPE.TOUCHES_CANCELLED;\n }\n return CALLBACK_TYPE.UNDEFINED;\n }\n\n function runWorklet(\n type: CALLBACK_TYPE,\n gesture: HandlerCallbacks<Record<string, unknown>>,\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent,\n ...args: any[]\n ) {\n 'worklet';\n const handler = getHandler(type, gesture);\n if (gesture.isWorklet[type]) {\n // @ts-ignore Logic below makes sure the correct event is send to the\n // correct handler.\n handler?.(event, ...args);\n } else if (handler) {\n console.warn(tagMessage('Animated gesture callback must be a worklet'));\n }\n }\n\n // Hooks are called conditionally, but the condition is whether the\n // react-native-reanimated is installed, which shouldn't change while running\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const sharedHandlersCallbacks = Reanimated.useSharedValue<\n HandlerCallbacks<Record<string, unknown>>[] | null\n >(null);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const lastUpdateEvent = Reanimated.useSharedValue<\n (GestureUpdateEvent | undefined)[]\n >([]);\n\n // not every gesture needs a state controller, init them lazily\n const stateControllers: GestureStateManagerType[] = [];\n\n const callback = (\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent\n ) => {\n 'worklet';\n\n const currentCallback = sharedHandlersCallbacks.value;\n if (!currentCallback) {\n return;\n }\n\n for (let i = 0; i < currentCallback.length; i++) {\n const gesture = currentCallback[i];\n\n if (event.handlerTag === gesture.handlerTag) {\n if (isStateChangeEvent(event)) {\n if (\n event.oldState === State.UNDETERMINED &&\n event.state === State.BEGAN\n ) {\n runWorklet(CALLBACK_TYPE.BEGAN, gesture, event);\n } else if (\n (event.oldState === State.BEGAN ||\n event.oldState === State.UNDETERMINED) &&\n event.state === State.ACTIVE\n ) {\n runWorklet(CALLBACK_TYPE.START, gesture, event);\n lastUpdateEvent.value[gesture.handlerTag] = undefined;\n } else if (\n event.oldState !== event.state &&\n event.state === State.END\n ) {\n if (event.oldState === State.ACTIVE) {\n runWorklet(CALLBACK_TYPE.END, gesture, event, true);\n }\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, true);\n } else if (\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\n event.state !== event.oldState\n ) {\n if (event.oldState === State.ACTIVE) {\n runWorklet(CALLBACK_TYPE.END, gesture, event, false);\n }\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, false);\n }\n } else if (isTouchEvent(event)) {\n if (!stateControllers[i]) {\n stateControllers[i] = GestureStateManager.create(event.handlerTag);\n }\n\n if (event.eventType !== EventType.UNDETERMINED) {\n runWorklet(\n touchEventTypeToCallbackType(event.eventType),\n gesture,\n event,\n stateControllers[i]\n );\n }\n } else {\n runWorklet(CALLBACK_TYPE.UPDATE, gesture, event);\n\n if (gesture.onChange && gesture.changeEventCalculator) {\n runWorklet(\n CALLBACK_TYPE.CHANGE,\n gesture,\n gesture.changeEventCalculator?.(\n event,\n lastUpdateEvent.value[gesture.handlerTag]\n )\n );\n\n lastUpdateEvent.value[gesture.handlerTag] = event;\n }\n }\n }\n }\n };\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const event = Reanimated.useEvent(\n callback,\n ['onGestureHandlerStateChange', 'onGestureHandlerEvent'],\n needsRebuild\n );\n\n preparedGesture.animatedEventHandler = event;\n preparedGesture.animatedHandlers = sharedHandlersCallbacks;\n}\n\ninterface GestureDetectorProps {\n gesture?: ComposedGesture | GestureType;\n}\nexport const GestureDetector: React.FunctionComponent<GestureDetectorProps> = (\n props\n) => {\n const gestureConfig = props.gesture;\n const gesture = gestureConfig?.toGestureArray?.() ?? [];\n const useReanimatedHook = gesture.some((g) => g.shouldUseReanimated);\n const viewRef = useRef(null);\n const firstRenderRef = useRef(true);\n\n const preparedGesture = React.useRef<GestureConfigReference>({\n config: gesture,\n animatedEventHandler: null,\n animatedHandlers: null,\n firstExecution: true,\n useReanimatedHook: useReanimatedHook,\n }).current;\n\n if (useReanimatedHook !== preparedGesture.useReanimatedHook) {\n throw new Error(\n tagMessage(\n 'You cannot change the thread the callbacks are ran on while the app is running'\n )\n );\n }\n\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\n // config update will be enough as all necessary items are stored in shared values anyway\n const needsToRebuildReanimatedEvent =\n preparedGesture.firstExecution || needsToReattach(preparedGesture, gesture);\n\n if (preparedGesture.firstExecution) {\n gestureConfig?.initialize?.();\n }\n\n if (useReanimatedHook) {\n // Whether animatedGesture or gesture is used shouldn't change while the app is running\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\n }\n\n useEffect(() => {\n firstRenderRef.current = true;\n const viewTag = findNodeHandle(viewRef.current) as number;\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n });\n\n return () => {\n dropHandlers(preparedGesture);\n };\n }, []);\n\n useEffect(() => {\n if (!firstRenderRef.current) {\n const viewTag = findNodeHandle(viewRef.current) as number;\n\n if (needsToReattach(preparedGesture, gesture)) {\n dropHandlers(preparedGesture);\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n });\n } else {\n updateHandlers(preparedGesture, gestureConfig, gesture);\n }\n } else {\n firstRenderRef.current = false;\n }\n }, [props]);\n\n const refFunction = (ref: unknown) => {\n if (ref !== null) {\n //@ts-ignore Just setting the ref\n viewRef.current = ref;\n\n if (isFabric()) {\n const node = getShadowNodeFromRef(ref);\n if (global.isFormsStackingContext(node) === false) {\n setImmediate(() => {\n // For some weird reason, console.error on iOS delays\n // the execution of RNGestureHandlerModule.attachGestureHandler,\n // so that's why we use setImmediate here.\n console.error(\n tagMessage(\n 'GestureDetector has received a child that may get view-flattened. ' +\n '\\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'\n )\n );\n });\n }\n }\n }\n };\n\n if (useReanimatedHook) {\n return (\n <AnimatedWrap\n ref={refFunction}\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\n {props.children}\n </AnimatedWrap>\n );\n } else {\n return <Wrap ref={refFunction}>{props.children}</Wrap>;\n }\n};\n\nclass Wrap extends React.Component<{ onGestureHandlerEvent?: unknown }> {\n render() {\n // I don't think that fighting with types over such a simple function is worth it\n // The only thing it does is add 'collapsable: false' to the child component\n // to make sure it is in the native view hierarchy so the detector can find\n // correct viewTag to attach to.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(this.props.children);\n return React.cloneElement(\n child,\n { collapsable: false },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n }\n}\n\nconst AnimatedWrap = Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\n"]}
1
+ {"version":3,"sources":["GestureDetector.tsx"],"names":["React","useEffect","useRef","BaseGesture","CALLBACK_TYPE","Reanimated","registerHandler","unregisterHandler","RNGestureHandlerModule","baseGestureHandlerWithMonitorProps","filterConfig","findNodeHandle","scheduleFlushOperations","GestureStateManager","flingGestureHandlerProps","forceTouchGestureHandlerProps","longPressGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","tapGestureHandlerProps","State","TouchEventType","ActionType","isFabric","tagMessage","getShadowNodeFromRef","Platform","onGestureHandlerEvent","ALLOWED_PROPS","convertToHandlerTag","ref","handlerTag","current","extractValidHandlerTags","interactionGroup","map","filter","tag","dropHandlers","preparedGesture","handler","config","dropGestureHandler","testId","checkGestureCallbacksForWorklets","gesture","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","attachHandlers","gestureConfig","viewTag","webEventHandlersRef","firstExecution","initialize","setImmediate","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","needsToReattach","useAnimatedGesture","needsRebuild","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","sharedHandlersCallbacks","useSharedValue","lastUpdateEvent","stateControllers","callback","currentCallback","UNDETERMINED","state","ACTIVE","undefined","FAILED","CANCELLED","create","changeEventCalculator","useEvent","animatedEventHandler","GestureDetector","props","toGestureArray","useReanimatedHook","some","viewRef","firstRenderRef","e","nativeEvent","Error","needsToRebuildReanimatedEvent","refFunction","node","global","isFormsStackingContext","children","Wrap","Component","render","child","Children","only","cloneElement","collapsable","AnimatedWrap","default","createAnimatedComponent"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,QAAyC,OAAzC;AACA,SAGEC,WAHF,EAKEC,aALF,QAMO,WANP;AAOA,SAASC,UAAT,QAAwC,qBAAxC;AACA,SAASC,eAAT,EAA0BC,iBAA1B,QAAmD,qBAAnD;AACA,OAAOC,sBAAP,MAAmC,8BAAnC;AACA,SACEC,kCADF,EAEEC,YAFF,EAGEC,cAHF,EAQEC,uBARF,QASO,yBATP;AAUA,SACEC,mBADF,QAGO,uBAHP;AAIA,SAASC,wBAAT,QAAyC,wBAAzC;AACA,SAASC,6BAAT,QAA8C,6BAA9C;AACA,SAASC,4BAAT,QAA6C,4BAA7C;AACA,SACEC,sBADF,EAEEC,kCAFF,QAGO,sBAHP;AAIA,SAASC,sBAAT,QAAuC,sBAAvC;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,cAAT,QAA+B,sBAA/B;AAEA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,QAAT,EAAmBC,UAAnB,QAAqC,aAArC;AACA,SAAS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AAGzJ,KAAK,CAAC0J,QAAN,CAAeC,IAAf,CAAoB,KAAKpB,KAAL,CAAWc,QAA/B,CAAnB;AACA,wBAAOrJ,KAAK,CAAC4J,YAAN,CACLH,KADK,EAEL;AAAEI,MAAAA,WAAW,EAAE;AAAf,KAFK,EAGL;AACAJ,IAAAA,KAAK,CAAClB,KAAN,CAAYc,QAJP,CAAP;AAMD;;AAdqE;;AAiBxE,MAAMS,YAAY,4BAAGzJ,UAAH,aAAGA,UAAH,8CAAGA,UAAU,CAAE0J,OAAf,wDAAG,oBAAqBC,uBAArB,CAA6CV,IAA7C,CAAH,yEAAyDA,IAA3E","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport {\n GestureType,\n HandlerCallbacks,\n BaseGesture,\n GestureRef,\n CALLBACK_TYPE,\n} from './gesture';\nimport { Reanimated, SharedValue } from './reanimatedWrapper';\nimport { registerHandler, unregisterHandler } from '../handlersRegistry';\nimport RNGestureHandlerModule from '../../RNGestureHandlerModule';\nimport {\n baseGestureHandlerWithMonitorProps,\n filterConfig,\n findNodeHandle,\n GestureTouchEvent,\n GestureUpdateEvent,\n GestureStateChangeEvent,\n HandlerStateChangeEvent,\n scheduleFlushOperations,\n} from '../gestureHandlerCommon';\nimport {\n GestureStateManager,\n GestureStateManagerType,\n} from './gestureStateManager';\nimport { flingGestureHandlerProps } from '../FlingGestureHandler';\nimport { forceTouchGestureHandlerProps } from '../ForceTouchGestureHandler';\nimport { longPressGestureHandlerProps } from '../LongPressGestureHandler';\nimport {\n panGestureHandlerProps,\n panGestureHandlerCustomNativeProps,\n} from '../PanGestureHandler';\nimport { tapGestureHandlerProps } from '../TapGestureHandler';\nimport { State } from '../../State';\nimport { TouchEventType } from '../../TouchEventType';\nimport { ComposedGesture } from './gestureComposition';\nimport { ActionType } from '../../ActionType';\nimport { isFabric, tagMessage } from '../../utils';\nimport { getShadowNodeFromRef } from '../../getShadowNodeFromRef';\nimport { Platform } from 'react-native';\nimport type RNGestureHandlerModuleWeb from '../../RNGestureHandlerModule.web';\nimport { onGestureHandlerEvent } from './eventReceiver';\n\ndeclare const global: {\n isFormsStackingContext: (node: unknown) => boolean | null; // JSI function\n};\n\nconst ALLOWED_PROPS = [\n ...baseGestureHandlerWithMonitorProps,\n ...tapGestureHandlerProps,\n ...panGestureHandlerProps,\n ...panGestureHandlerCustomNativeProps,\n ...longPressGestureHandlerProps,\n ...forceTouchGestureHandlerProps,\n ...flingGestureHandlerProps,\n];\n\nexport type GestureConfigReference = {\n config: GestureType[];\n animatedEventHandler: unknown;\n animatedHandlers: SharedValue<\n HandlerCallbacks<Record<string, unknown>>[] | null\n > | null;\n firstExecution: boolean;\n useReanimatedHook: boolean;\n};\n\nfunction convertToHandlerTag(ref: GestureRef): number {\n if (typeof ref === 'number') {\n return ref;\n } else if (ref instanceof BaseGesture) {\n return ref.handlerTag;\n } else {\n // @ts-ignore in this case it should be a ref either to gesture object or\n // a gesture handler component, in both cases handlerTag property exists\n return ref.current?.handlerTag ?? -1;\n }\n}\n\nfunction extractValidHandlerTags(interactionGroup: GestureRef[] | undefined) {\n return (\n interactionGroup?.map(convertToHandlerTag)?.filter((tag) => tag > 0) ?? []\n );\n}\n\nfunction dropHandlers(preparedGesture: GestureConfigReference) {\n for (const handler of preparedGesture.config) {\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\n\n unregisterHandler(handler.handlerTag, handler.config.testId);\n }\n\n scheduleFlushOperations();\n}\n\nfunction checkGestureCallbacksForWorklets(gesture: GestureType) {\n // if a gesture is explicitly marked to run on the JS thread there is no need to check\n // if callbacks are worklets as the user is aware they will be ran on the JS thread\n if (gesture.config.runOnJS) {\n return;\n }\n\n const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);\n const areSomeWorklets = gesture.handlers.isWorklet.includes(true);\n\n // if some of the callbacks are worklets and some are not, and the gesture is not\n // explicitly marked with `.runOnJS(true)` show an error\n if (areSomeNotWorklets && areSomeWorklets) {\n console.error(\n tagMessage(\n `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.`\n )\n );\n }\n}\n\ninterface WebEventHandler {\n onGestureHandlerEvent: (event: HandlerStateChangeEvent<unknown>) => void;\n}\n\ninterface AttachHandlersConfig {\n preparedGesture: GestureConfigReference;\n gestureConfig: ComposedGesture | GestureType | undefined;\n gesture: GestureType[];\n viewTag: number;\n webEventHandlersRef: React.RefObject<WebEventHandler>;\n}\n\nfunction attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n webEventHandlersRef,\n}: AttachHandlersConfig) {\n if (!preparedGesture.firstExecution) {\n gestureConfig?.initialize();\n } else {\n preparedGesture.firstExecution = false;\n }\n\n // use setImmediate to extract handlerTags, because all refs should be initialized\n // when it's ran\n setImmediate(() => {\n gestureConfig?.prepare();\n });\n\n for (const handler of gesture) {\n checkGestureCallbacksForWorklets(handler);\n\n RNGestureHandlerModule.createGestureHandler(\n handler.handlerName,\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS)\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n // use setImmediate to extract handlerTags, because all refs should be initialized\n // when it's ran\n setImmediate(() => {\n for (const handler of gesture) {\n let requireToFail: number[] = [];\n if (handler.config.requireToFail) {\n requireToFail = extractValidHandlerTags(handler.config.requireToFail);\n }\n\n let simultaneousWith: number[] = [];\n if (handler.config.simultaneousWith) {\n simultaneousWith = extractValidHandlerTags(\n handler.config.simultaneousWith\n );\n }\n\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS, {\n simultaneousHandlers: simultaneousWith,\n waitFor: requireToFail,\n })\n );\n }\n\n scheduleFlushOperations();\n });\n\n preparedGesture.config = gesture;\n\n for (const gesture of preparedGesture.config) {\n const actionType = gesture.shouldUseReanimated\n ? ActionType.REANIMATED_WORKLET\n : ActionType.JS_FUNCTION_NEW_API;\n\n if (Platform.OS === 'web') {\n (RNGestureHandlerModule.attachGestureHandler as typeof RNGestureHandlerModuleWeb.attachGestureHandler)(\n gesture.handlerTag,\n viewTag,\n ActionType.JS_FUNCTION_OLD_API, // ignored on web\n webEventHandlersRef\n );\n } else {\n RNGestureHandlerModule.attachGestureHandler(\n gesture.handlerTag,\n viewTag,\n actionType\n );\n }\n }\n\n if (preparedGesture.animatedHandlers) {\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\n\n preparedGesture.animatedHandlers.value = (gesture\n .filter(isAnimatedGesture)\n .map((g) => g.handlers) as unknown) as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n}\n\nfunction updateHandlers(\n preparedGesture: GestureConfigReference,\n gestureConfig: ComposedGesture | GestureType | undefined,\n gesture: GestureType[]\n) {\n gestureConfig?.prepare();\n\n for (let i = 0; i < gesture.length; i++) {\n const handler = preparedGesture.config[i];\n checkGestureCallbacksForWorklets(handler);\n\n // only update handlerTag when it's actually different, it may be the same\n // if gesture config object is wrapped with useMemo\n if (gesture[i].handlerTag !== handler.handlerTag) {\n gesture[i].handlerTag = handler.handlerTag;\n gesture[i].handlers.handlerTag = handler.handlerTag;\n }\n }\n\n // use setImmediate to extract handlerTags, because when it's ran, all refs should be updated\n // and handlerTags in BaseGesture references should be updated in the loop above (we need to wait\n // in case of external relations)\n setImmediate(() => {\n for (let i = 0; i < gesture.length; i++) {\n const handler = preparedGesture.config[i];\n\n handler.config = gesture[i].config;\n handler.handlers = gesture[i].handlers;\n\n const requireToFail = extractValidHandlerTags(\n handler.config.requireToFail\n );\n\n const simultaneousWith = extractValidHandlerTags(\n handler.config.simultaneousWith\n );\n\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS, {\n simultaneousHandlers: simultaneousWith,\n waitFor: requireToFail,\n })\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n if (preparedGesture.animatedHandlers) {\n preparedGesture.animatedHandlers.value = (preparedGesture.config\n .filter((g) => g.shouldUseReanimated) // ignore gestures that shouldn't run on UI\n .map((g) => g.handlers) as unknown) as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n\n scheduleFlushOperations();\n });\n}\n\nfunction needsToReattach(\n preparedGesture: GestureConfigReference,\n gesture: GestureType[]\n) {\n if (gesture.length !== preparedGesture.config.length) {\n return true;\n }\n for (let i = 0; i < gesture.length; i++) {\n if (\n gesture[i].handlerName !== preparedGesture.config[i].handlerName ||\n gesture[i].shouldUseReanimated !==\n preparedGesture.config[i].shouldUseReanimated\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction useAnimatedGesture(\n preparedGesture: GestureConfigReference,\n needsRebuild: boolean\n) {\n if (!Reanimated) {\n return;\n }\n\n function isStateChangeEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n ): event is GestureStateChangeEvent {\n 'worklet';\n // @ts-ignore Yes, the oldState prop is missing on GestureTouchEvent, that's the point\n return event.oldState != null;\n }\n\n function isTouchEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n ): event is GestureTouchEvent {\n 'worklet';\n return event.eventType != null;\n }\n\n function getHandler(\n type: CALLBACK_TYPE,\n gesture: HandlerCallbacks<Record<string, unknown>>\n ) {\n 'worklet';\n switch (type) {\n case CALLBACK_TYPE.BEGAN:\n return gesture.onBegin;\n case CALLBACK_TYPE.START:\n return gesture.onStart;\n case CALLBACK_TYPE.UPDATE:\n return gesture.onUpdate;\n case CALLBACK_TYPE.CHANGE:\n return gesture.onChange;\n case CALLBACK_TYPE.END:\n return gesture.onEnd;\n case CALLBACK_TYPE.FINALIZE:\n return gesture.onFinalize;\n case CALLBACK_TYPE.TOUCHES_DOWN:\n return gesture.onTouchesDown;\n case CALLBACK_TYPE.TOUCHES_MOVE:\n return gesture.onTouchesMove;\n case CALLBACK_TYPE.TOUCHES_UP:\n return gesture.onTouchesUp;\n case CALLBACK_TYPE.TOUCHES_CANCELLED:\n return gesture.onTouchesCancelled;\n }\n }\n\n function touchEventTypeToCallbackType(\n eventType: TouchEventType\n ): CALLBACK_TYPE {\n 'worklet';\n switch (eventType) {\n case TouchEventType.TOUCHES_DOWN:\n return CALLBACK_TYPE.TOUCHES_DOWN;\n case TouchEventType.TOUCHES_MOVE:\n return CALLBACK_TYPE.TOUCHES_MOVE;\n case TouchEventType.TOUCHES_UP:\n return CALLBACK_TYPE.TOUCHES_UP;\n case TouchEventType.TOUCHES_CANCELLED:\n return CALLBACK_TYPE.TOUCHES_CANCELLED;\n }\n return CALLBACK_TYPE.UNDEFINED;\n }\n\n function runWorklet(\n type: CALLBACK_TYPE,\n gesture: HandlerCallbacks<Record<string, unknown>>,\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent,\n ...args: any[]\n ) {\n 'worklet';\n const handler = getHandler(type, gesture);\n if (gesture.isWorklet[type]) {\n // @ts-ignore Logic below makes sure the correct event is send to the\n // correct handler.\n handler?.(event, ...args);\n } else if (handler) {\n console.warn(tagMessage('Animated gesture callback must be a worklet'));\n }\n }\n\n // Hooks are called conditionally, but the condition is whether the\n // react-native-reanimated is installed, which shouldn't change while running\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const sharedHandlersCallbacks = Reanimated.useSharedValue<\n HandlerCallbacks<Record<string, unknown>>[] | null\n >(null);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const lastUpdateEvent = Reanimated.useSharedValue<\n (GestureUpdateEvent | undefined)[]\n >([]);\n\n // not every gesture needs a state controller, init them lazily\n const stateControllers: GestureStateManagerType[] = [];\n\n const callback = (\n event: GestureStateChangeEvent | GestureUpdateEvent | GestureTouchEvent\n ) => {\n 'worklet';\n\n const currentCallback = sharedHandlersCallbacks.value;\n if (!currentCallback) {\n return;\n }\n\n for (let i = 0; i < currentCallback.length; i++) {\n const gesture = currentCallback[i];\n\n if (event.handlerTag === gesture.handlerTag) {\n if (isStateChangeEvent(event)) {\n if (\n event.oldState === State.UNDETERMINED &&\n event.state === State.BEGAN\n ) {\n runWorklet(CALLBACK_TYPE.BEGAN, gesture, event);\n } else if (\n (event.oldState === State.BEGAN ||\n event.oldState === State.UNDETERMINED) &&\n event.state === State.ACTIVE\n ) {\n runWorklet(CALLBACK_TYPE.START, gesture, event);\n lastUpdateEvent.value[gesture.handlerTag] = undefined;\n } else if (\n event.oldState !== event.state &&\n event.state === State.END\n ) {\n if (event.oldState === State.ACTIVE) {\n runWorklet(CALLBACK_TYPE.END, gesture, event, true);\n }\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, true);\n } else if (\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\n event.state !== event.oldState\n ) {\n if (event.oldState === State.ACTIVE) {\n runWorklet(CALLBACK_TYPE.END, gesture, event, false);\n }\n runWorklet(CALLBACK_TYPE.FINALIZE, gesture, event, false);\n }\n } else if (isTouchEvent(event)) {\n if (!stateControllers[i]) {\n stateControllers[i] = GestureStateManager.create(event.handlerTag);\n }\n\n if (event.eventType !== TouchEventType.UNDETERMINED) {\n runWorklet(\n touchEventTypeToCallbackType(event.eventType),\n gesture,\n event,\n stateControllers[i]\n );\n }\n } else {\n runWorklet(CALLBACK_TYPE.UPDATE, gesture, event);\n\n if (gesture.onChange && gesture.changeEventCalculator) {\n runWorklet(\n CALLBACK_TYPE.CHANGE,\n gesture,\n gesture.changeEventCalculator?.(\n event,\n lastUpdateEvent.value[gesture.handlerTag]\n )\n );\n\n lastUpdateEvent.value[gesture.handlerTag] = event;\n }\n }\n }\n }\n };\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const event = Reanimated.useEvent(\n callback,\n ['onGestureHandlerStateChange', 'onGestureHandlerEvent'],\n needsRebuild\n );\n\n preparedGesture.animatedEventHandler = event;\n preparedGesture.animatedHandlers = sharedHandlersCallbacks;\n}\n\ninterface GestureDetectorProps {\n gesture?: ComposedGesture | GestureType;\n}\nexport const GestureDetector: React.FunctionComponent<GestureDetectorProps> = (\n props\n) => {\n const gestureConfig = props.gesture;\n const gesture = gestureConfig?.toGestureArray?.() ?? [];\n const useReanimatedHook = gesture.some((g) => g.shouldUseReanimated);\n const viewRef = useRef(null);\n const firstRenderRef = useRef(true);\n const webEventHandlersRef = useRef<WebEventHandler>({\n onGestureHandlerEvent: (e: HandlerStateChangeEvent<unknown>) => {\n onGestureHandlerEvent(e.nativeEvent);\n },\n });\n\n const preparedGesture = React.useRef<GestureConfigReference>({\n config: gesture,\n animatedEventHandler: null,\n animatedHandlers: null,\n firstExecution: true,\n useReanimatedHook: useReanimatedHook,\n }).current;\n\n if (useReanimatedHook !== preparedGesture.useReanimatedHook) {\n throw new Error(\n tagMessage(\n 'You cannot change the thread the callbacks are ran on while the app is running'\n )\n );\n }\n\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\n // config update will be enough as all necessary items are stored in shared values anyway\n const needsToRebuildReanimatedEvent =\n preparedGesture.firstExecution || needsToReattach(preparedGesture, gesture);\n\n if (preparedGesture.firstExecution) {\n gestureConfig?.initialize?.();\n }\n\n if (useReanimatedHook) {\n // Whether animatedGesture or gesture is used shouldn't change while the app is running\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\n }\n\n useEffect(() => {\n firstRenderRef.current = true;\n const viewTag = findNodeHandle(viewRef.current) as number;\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n webEventHandlersRef,\n });\n\n return () => {\n dropHandlers(preparedGesture);\n };\n }, []);\n\n useEffect(() => {\n if (!firstRenderRef.current) {\n const viewTag = findNodeHandle(viewRef.current) as number;\n\n if (needsToReattach(preparedGesture, gesture)) {\n dropHandlers(preparedGesture);\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesture,\n viewTag,\n webEventHandlersRef,\n });\n } else {\n updateHandlers(preparedGesture, gestureConfig, gesture);\n }\n } else {\n firstRenderRef.current = false;\n }\n }, [props]);\n\n const refFunction = (ref: unknown) => {\n if (ref !== null) {\n //@ts-ignore Just setting the ref\n viewRef.current = ref;\n\n if (isFabric()) {\n const node = getShadowNodeFromRef(ref);\n if (global.isFormsStackingContext(node) === false) {\n console.error(\n tagMessage(\n 'GestureDetector has received a child that may get view-flattened. ' +\n '\\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'\n )\n );\n }\n }\n }\n };\n\n if (useReanimatedHook) {\n return (\n <AnimatedWrap\n ref={refFunction}\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\n {props.children}\n </AnimatedWrap>\n );\n } else {\n return <Wrap ref={refFunction}>{props.children}</Wrap>;\n }\n};\n\nclass Wrap extends React.Component<{ onGestureHandlerEvent?: unknown }> {\n render() {\n // I don't think that fighting with types over such a simple function is worth it\n // The only thing it does is add 'collapsable: false' to the child component\n // to make sure it is in the native view hierarchy so the detector can find\n // correct viewTag to attach to.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(this.props.children);\n return React.cloneElement(\n child,\n { collapsable: false },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n }\n}\n\nconst AnimatedWrap = Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { DeviceEventEmitter } from 'react-native';
2
2
  import { State } from '../../State';
3
- import { EventType } from '../../EventType';
3
+ import { TouchEventType } from '../../TouchEventType';
4
4
  import { findHandler, findOldGestureHandler } from '../handlersRegistry';
5
5
  import { tagMessage } from '../../utils';
6
6
  let gestureHandlerEventSubscription = null;
@@ -31,7 +31,7 @@ function isTouchEvent(event) {
31
31
  return event.eventType != null;
32
32
  }
33
33
 
34
- function onGestureHandlerEvent(event) {
34
+ export function onGestureHandlerEvent(event) {
35
35
  var _handler$handlers7, _handler$handlers7$on, _handler$handlers8, _handler$handlers8$on, _handler$handlers9, _handler$handlers9$on, _handler$handlers10, _handler$handlers10$o;
36
36
 
37
37
  const handler = findHandler(event.handlerTag);
@@ -72,19 +72,19 @@ function onGestureHandlerEvent(event) {
72
72
  }
73
73
  } else if (isTouchEvent(event)) {
74
74
  switch (event.eventType) {
75
- case EventType.TOUCHES_DOWN:
75
+ case TouchEventType.TOUCHES_DOWN:
76
76
  (_handler$handlers7 = handler.handlers) === null || _handler$handlers7 === void 0 ? void 0 : (_handler$handlers7$on = _handler$handlers7.onTouchesDown) === null || _handler$handlers7$on === void 0 ? void 0 : _handler$handlers7$on.call(_handler$handlers7, event, dummyStateManager);
77
77
  break;
78
78
 
79
- case EventType.TOUCHES_MOVE:
79
+ case TouchEventType.TOUCHES_MOVE:
80
80
  (_handler$handlers8 = handler.handlers) === null || _handler$handlers8 === void 0 ? void 0 : (_handler$handlers8$on = _handler$handlers8.onTouchesMove) === null || _handler$handlers8$on === void 0 ? void 0 : _handler$handlers8$on.call(_handler$handlers8, event, dummyStateManager);
81
81
  break;
82
82
 
83
- case EventType.TOUCHES_UP:
83
+ case TouchEventType.TOUCHES_UP:
84
84
  (_handler$handlers9 = handler.handlers) === null || _handler$handlers9 === void 0 ? void 0 : (_handler$handlers9$on = _handler$handlers9.onTouchesUp) === null || _handler$handlers9$on === void 0 ? void 0 : _handler$handlers9$on.call(_handler$handlers9, event, dummyStateManager);
85
85
  break;
86
86
 
87
- case EventType.TOUCHES_CANCELLED:
87
+ case TouchEventType.TOUCHES_CANCELLED:
88
88
  (_handler$handlers10 = handler.handlers) === null || _handler$handlers10 === void 0 ? void 0 : (_handler$handlers10$o = _handler$handlers10.onTouchesCancelled) === null || _handler$handlers10$o === void 0 ? void 0 : _handler$handlers10$o.call(_handler$handlers10, event, dummyStateManager);
89
89
  break;
90
90
  }
@@ -118,7 +118,6 @@ function onGestureHandlerEvent(event) {
118
118
  }
119
119
  }
120
120
  }
121
-
122
121
  export function startListening() {
123
122
  stopListening();
124
123
  gestureHandlerEventSubscription = DeviceEventEmitter.addListener('onGestureHandlerEvent', onGestureHandlerEvent);
@@ -1 +1 @@
1
- {"version":3,"sources":["eventReceiver.ts"],"names":["DeviceEventEmitter","State","EventType","findHandler","findOldGestureHandler","tagMessage","gestureHandlerEventSubscription","gestureHandlerStateChangeEventSubscription","warningMessage","dummyStateManager","begin","console","warn","activate","end","fail","lastUpdateEvent","isStateChangeEvent","event","oldState","isTouchEvent","eventType","onGestureHandlerEvent","handler","handlerTag","UNDETERMINED","state","BEGAN","handlers","onBegin","ACTIVE","onStart","END","onEnd","onFinalize","undefined","FAILED","CANCELLED","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","onUpdate","onChange","changeEventCalculator","oldHandler","nativeEvent","onGestureStateChange","onGestureEvent","startListening","stopListening","addListener","remove"],"mappings":"AAAA,SAASA,kBAAT,QAAwD,cAAxD;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAOA,SAASC,WAAT,EAAsBC,qBAAtB,QAAmD,qBAAnD;AAEA,SAASC,UAAT,QAA2B,aAA3B;AAEA,IAAIC,+BAA2D,GAAG,IAAlE;AACA,IAAIC,0CAAsE,GAAG,IAA7E;AAEA,MAAMC,cAAc,GAAGH,UAAU,CAC/B,uFAD+B,CAAjC;AAIA,MAAMI,iBAA0C,GAAG;AACjDC,EAAAA,KAAK,EAAE,MAAM;AACXC,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cAAb;AACD,GAHgD;AAIjDK,EAAAA,QAAQ,EAAE,MAAM;AACdF,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cAAb;AACD,GANgD;AAOjDM,EAAAA,GAAG,EAAE,MAAM;AACTH,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cAAb;AACD,GATgD;AAUjDO,EAAAA,IAAI,EAAE,MAAM;AACVJ,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cAAb;AACD;AAZgD,CAAnD;AAeA,MAAMQ,eAAmD,GAAG,EAA5D;;AAEA,SAASC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,IAAlC;AACD;;AAED,MAAIC,0CAAJ,EAAgD;AAC9CA,IAAAA,0CAA0C,CAACiD,MAA3C;AACAjD,IAAAA,0CAA0C,GAAG,IAA7C;AACD;AACF","sourcesContent":["import { DeviceEventEmitter, EmitterSubscription } from 'react-native';\nimport { State } from '../../State';\nimport { EventType } from '../../EventType';\nimport {\n GestureTouchEvent,\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from '../gestureHandlerCommon';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport { findHandler, findOldGestureHandler } from '../handlersRegistry';\nimport { BaseGesture } from './gesture';\nimport { tagMessage } from '../../utils';\n\nlet gestureHandlerEventSubscription: EmitterSubscription | null = null;\nlet gestureHandlerStateChangeEventSubscription: EmitterSubscription | null = null;\n\nconst warningMessage = tagMessage(\n 'You have to use react-native-reanimated in order to control the state of the gesture.'\n);\n\nconst dummyStateManager: GestureStateManagerType = {\n begin: () => {\n console.warn(warningMessage);\n },\n activate: () => {\n console.warn(warningMessage);\n },\n end: () => {\n console.warn(warningMessage);\n },\n fail: () => {\n console.warn(warningMessage);\n },\n};\n\nconst lastUpdateEvent: (GestureUpdateEvent | undefined)[] = [];\n\nfunction isStateChangeEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureStateChangeEvent {\n // @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point\n return event.oldState != null;\n}\n\nfunction isTouchEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureTouchEvent {\n return event.eventType != null;\n}\n\nfunction onGestureHandlerEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n) {\n const handler = findHandler(event.handlerTag) as BaseGesture<\n Record<string, unknown>\n >;\n\n if (handler) {\n if (isStateChangeEvent(event)) {\n if (\n event.oldState === State.UNDETERMINED &&\n event.state === State.BEGAN\n ) {\n handler.handlers.onBegin?.(event);\n } else if (\n (event.oldState === State.BEGAN ||\n event.oldState === State.UNDETERMINED) &&\n event.state === State.ACTIVE\n ) {\n handler.handlers.onStart?.(event);\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n } else if (event.oldState !== event.state && event.state === State.END) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, true);\n }\n handler.handlers.onFinalize?.(event, true);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n } else if (\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\n event.oldState !== event.state\n ) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, false);\n }\n handler.handlers.onFinalize?.(event, false);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n }\n } else if (isTouchEvent(event)) {\n switch (event.eventType) {\n case EventType.TOUCHES_DOWN:\n handler.handlers?.onTouchesDown?.(event, dummyStateManager);\n break;\n case EventType.TOUCHES_MOVE:\n handler.handlers?.onTouchesMove?.(event, dummyStateManager);\n break;\n case EventType.TOUCHES_UP:\n handler.handlers?.onTouchesUp?.(event, dummyStateManager);\n break;\n case EventType.TOUCHES_CANCELLED:\n handler.handlers?.onTouchesCancelled?.(event, dummyStateManager);\n break;\n }\n } else {\n handler.handlers.onUpdate?.(event);\n\n if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {\n handler.handlers.onChange?.(\n handler.handlers.changeEventCalculator?.(\n event,\n lastUpdateEvent[handler.handlers.handlerTag]\n )\n );\n\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n }\n }\n } else {\n const oldHandler = findOldGestureHandler(event.handlerTag);\n if (oldHandler) {\n const nativeEvent = { nativeEvent: event };\n if (isStateChangeEvent(event)) {\n oldHandler.onGestureStateChange(nativeEvent);\n } else {\n oldHandler.onGestureEvent(nativeEvent);\n }\n return;\n }\n }\n}\n\nexport function startListening() {\n stopListening();\n\n gestureHandlerEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerEvent',\n onGestureHandlerEvent\n );\n\n gestureHandlerStateChangeEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerStateChange',\n onGestureHandlerEvent\n );\n}\n\nexport function stopListening() {\n if (gestureHandlerEventSubscription) {\n gestureHandlerEventSubscription.remove();\n gestureHandlerEventSubscription = null;\n }\n\n if (gestureHandlerStateChangeEventSubscription) {\n gestureHandlerStateChangeEventSubscription.remove();\n gestureHandlerStateChangeEventSubscription = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["eventReceiver.ts"],"names":["DeviceEventEmitter","State","TouchEventType","findHandler","findOldGestureHandler","tagMessage","gestureHandlerEventSubscription","gestureHandlerStateChangeEventSubscription","warningMessage","dummyStateManager","begin","console","warn","activate","end","fail","lastUpdateEvent","isStateChangeEvent","event","oldState","isTouchEvent","eventType","onGestureHandlerEvent","handler","handlerTag","UNDETERMINED","state","BEGAN","handlers","onBegin","ACTIVE","onStart","END","onEnd","onFinalize","undefined","FAILED","CANCELLED","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","onUpdate","onChange","changeEventCalculator","oldHandler","nativeEvent","onGestureStateChange","onGestureEvent","startListening","stopListening","addListener","remove"],"mappings":"AAAA,SAASA,kBAAT,QAAwD,cAAxD;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,cAAT,QAA+B,sBAA/B;AAOA,SAASC,WAAT,EAAsBC,qBAAtB,QAAmD,qBAAnD;AAEA,SAASC,UAAT,QAA2B,aAA3B;AAEA,IAAIC,+BAA2D,GAAG,IAAlE;AACA,IAAIC,0CAAsE,GAAG,IAA7E;AAEA,MAAMC,cAAc,GAAGH,UAAU,CAC/B,uFAD+B,CAAjC;AAIA,MAAMI,iBAA0C,GAAG;AACjDC,EAAAA,KAAK,EAAE,MAAM;AACXC,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cAAb;AACD,GAHgD;AAIjDK,EAAAA,QAAQ,EAAE,MAAM;AACdF,IAAAA,OAAO,CAACC,IAAR,CAAaJ,cA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ADgC,EAEhCjC,qBAFgC,CAAlC;AAKAf,EAAAA,0CAA0C,GAAGP,kBAAkB,CAACuD,WAAnB,CAC3C,6BAD2C,EAE3CjC,qBAF2C,CAA7C;AAID;AAED,OAAO,SAASgC,aAAT,GAAyB;AAC9B,MAAIhD,+BAAJ,EAAqC;AACnCA,IAAAA,+BAA+B,CAACkD,MAAhC;AACAlD,IAAAA,+BAA+B,GAAG,IAAlC;AACD;;AAED,MAAIC,0CAAJ,EAAgD;AAC9CA,IAAAA,0CAA0C,CAACiD,MAA3C;AACAjD,IAAAA,0CAA0C,GAAG,IAA7C;AACD;AACF","sourcesContent":["import { DeviceEventEmitter, EmitterSubscription } from 'react-native';\nimport { State } from '../../State';\nimport { TouchEventType } from '../../TouchEventType';\nimport {\n GestureTouchEvent,\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from '../gestureHandlerCommon';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport { findHandler, findOldGestureHandler } from '../handlersRegistry';\nimport { BaseGesture } from './gesture';\nimport { tagMessage } from '../../utils';\n\nlet gestureHandlerEventSubscription: EmitterSubscription | null = null;\nlet gestureHandlerStateChangeEventSubscription: EmitterSubscription | null = null;\n\nconst warningMessage = tagMessage(\n 'You have to use react-native-reanimated in order to control the state of the gesture.'\n);\n\nconst dummyStateManager: GestureStateManagerType = {\n begin: () => {\n console.warn(warningMessage);\n },\n activate: () => {\n console.warn(warningMessage);\n },\n end: () => {\n console.warn(warningMessage);\n },\n fail: () => {\n console.warn(warningMessage);\n },\n};\n\nconst lastUpdateEvent: (GestureUpdateEvent | undefined)[] = [];\n\nfunction isStateChangeEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureStateChangeEvent {\n // @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point\n return event.oldState != null;\n}\n\nfunction isTouchEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureTouchEvent {\n return event.eventType != null;\n}\n\nexport function onGestureHandlerEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n) {\n const handler = findHandler(event.handlerTag) as BaseGesture<\n Record<string, unknown>\n >;\n\n if (handler) {\n if (isStateChangeEvent(event)) {\n if (\n event.oldState === State.UNDETERMINED &&\n event.state === State.BEGAN\n ) {\n handler.handlers.onBegin?.(event);\n } else if (\n (event.oldState === State.BEGAN ||\n event.oldState === State.UNDETERMINED) &&\n event.state === State.ACTIVE\n ) {\n handler.handlers.onStart?.(event);\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n } else if (event.oldState !== event.state && event.state === State.END) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, true);\n }\n handler.handlers.onFinalize?.(event, true);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n } else if (\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\n event.oldState !== event.state\n ) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, false);\n }\n handler.handlers.onFinalize?.(event, false);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n }\n } else if (isTouchEvent(event)) {\n switch (event.eventType) {\n case TouchEventType.TOUCHES_DOWN:\n handler.handlers?.onTouchesDown?.(event, dummyStateManager);\n break;\n case TouchEventType.TOUCHES_MOVE:\n handler.handlers?.onTouchesMove?.(event, dummyStateManager);\n break;\n case TouchEventType.TOUCHES_UP:\n handler.handlers?.onTouchesUp?.(event, dummyStateManager);\n break;\n case TouchEventType.TOUCHES_CANCELLED:\n handler.handlers?.onTouchesCancelled?.(event, dummyStateManager);\n break;\n }\n } else {\n handler.handlers.onUpdate?.(event);\n\n if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {\n handler.handlers.onChange?.(\n handler.handlers.changeEventCalculator?.(\n event,\n lastUpdateEvent[handler.handlers.handlerTag]\n )\n );\n\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n }\n }\n } else {\n const oldHandler = findOldGestureHandler(event.handlerTag);\n if (oldHandler) {\n const nativeEvent = { nativeEvent: event };\n if (isStateChangeEvent(event)) {\n oldHandler.onGestureStateChange(nativeEvent);\n } else {\n oldHandler.onGestureEvent(nativeEvent);\n }\n return;\n }\n }\n}\n\nexport function startListening() {\n stopListening();\n\n gestureHandlerEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerEvent',\n onGestureHandlerEvent\n );\n\n gestureHandlerStateChangeEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerStateChange',\n onGestureHandlerEvent\n );\n}\n\nexport function stopListening() {\n if (gestureHandlerEventSubscription) {\n gestureHandlerEventSubscription.remove();\n gestureHandlerEventSubscription = null;\n }\n\n if (gestureHandlerStateChangeEventSubscription) {\n gestureHandlerStateChangeEventSubscription.remove();\n gestureHandlerStateChangeEventSubscription = null;\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
3
  import { getNextHandlerTag } from '../handlersRegistry';
4
+ import { isRemoteDebuggingEnabled } from '../../utils';
4
5
  export const CALLBACK_TYPE = {
5
6
  UNDEFINED: 0,
6
7
  BEGAN: 1,
@@ -144,6 +145,11 @@ export class BaseGesture extends Gesture {
144
145
  return this;
145
146
  }
146
147
 
148
+ cancelsTouchesInView(value) {
149
+ this.config.cancelsTouchesInView = value;
150
+ return this;
151
+ }
152
+
147
153
  initialize() {
148
154
  this.handlerTag = getNextHandlerTag();
149
155
  this.handlers = { ...this.handlers,
@@ -163,8 +169,10 @@ export class BaseGesture extends Gesture {
163
169
  prepare() {}
164
170
 
165
171
  get shouldUseReanimated() {
166
- // use Reanimated when runOnJS isn't set explicitly and all defined callbacks are worklets
167
- return this.config.runOnJS !== true && !this.handlers.isWorklet.includes(false);
172
+ // use Reanimated when runOnJS isn't set explicitly,
173
+ // and all defined callbacks are worklets,
174
+ // and remote debugging is disabled
175
+ return this.config.runOnJS !== true && !this.handlers.isWorklet.includes(false) && !isRemoteDebuggingEnabled();
168
176
  }
169
177
 
170
178
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["gesture.ts"],"names":["getNextHandlerTag","CALLBACK_TYPE","UNDEFINED","BEGAN","START","UPDATE","CHANGE","END","FINALIZE","TOUCHES_DOWN","TOUCHES_MOVE","TOUCHES_UP","TOUCHES_CANCELLED","Gesture","BaseGesture","handlerTag","isWorklet","addDependency","key","gesture","value","config","Array","concat","withRef","ref","callback","__workletHash","undefined","onBegin","handlers","onStart","onEnd","onFinalize","onTouchesDown","needsPointerData","onTouchesMove","onTouchesUp","onTouchesCancelled","enabled","shouldCancelWhenOutside","hitSlop","runOnJS","simultaneousWithExternalGesture","gestures","requireExternalGestureToFail","withTestId","id","testId","initialize","current","toGestureArray","prepare","shouldUseReanimated","includes","ContinousBaseGesture","onUpdate","onChange","manualActivation"],"mappings":";;AASA,SAASA,iBAAT,QAAkC,qBAAlC;AAoEA,OAAO,MAAMC,aAAa,GAAG;AAC3BC,EAAAA,SAAS,EAAE,CADgB;AAE3BC,EAAAA,KAAK,EAAE,CAFoB;AAG3BC,EAAAA,KAAK,EAAE,CAHoB;AAI3BC,EAAAA,MAAM,EAAE,CAJmB;AAK3BC,EAAAA,MAAM,EAAE,CALmB;AAM3BC,EAAAA,GAAG,EAAE,CANsB;AAO3BC,EAAAA,QAAQ,EAAE,CAPiB;AAQ3BC,EAAAA,YAAY,EAAE,CARa;AAS3BC,EAAAA,YAAY,EAAE,CATa;AAU3BC,EAAAA,UAAU,EAAE,CAVe;AAW3BC,EAAAA,iBAAiB,EAAE;AAXQ,CAAtB,C,CAcP;AACA;;AAGA,OAAO,MAAeC,OAAf,CAAuB;AAoB9B,OAAO,MAAeC,WAAf,SAEGD,OAFH,CAEW;AAAA;AAAA;;AAAA,wCACI,CAAC,CADL;;AAAA,yCAEK,EAFL;;AAAA,oCAGmB,EAHnB;;AAAA,sCAImC;AACjDE,MAAAA,UAAU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ACF;;AAEDC,EAAAA,cAAc,GAAkB;AAC9B,WAAO,CAAC,IAAD,CAAP;AACD,GA7Je,CA+JhB;;;AACAC,EAAAA,OAAO,GAAG,CAAE;;AAEW,MAAnBC,mBAAmB,GAAY;AACjC;AACA,WACE,KAAKhC,MAAL,CAAYqB,OAAZ,KAAwB,IAAxB,IAAgC,CAAC,KAAKZ,QAAL,CAAcd,SAAd,CAAwBsC,QAAxB,CAAiC,KAAjC,CADnC;AAGD;;AAvKe;AA0KlB,OAAO,MAAeC,oBAAf,SAGGzC,WAHH,CAG8B;AACnC0C,EAAAA,QAAQ,CAAC9B,QAAD,EAA+D;AACrE,SAAKI,QAAL,CAAc0B,QAAd,GAAyB9B,QAAzB;AACA,SAAKI,QAAL,CAAcd,SAAd,CAAwBf,aAAa,CAACI,MAAtC,IAAgD,KAAKW,SAAL,CAAeU,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;;AAED+B,EAAAA,QAAQ,CACN/B,QADM,EAIN;AACA,SAAKI,QAAL,CAAc2B,QAAd,GAAyB/B,QAAzB;AACA,SAAKI,QAAL,CAAcd,SAAd,CAAwBf,aAAa,CAACK,MAAtC,IAAgD,KAAKU,SAAL,CAAeU,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;;AAEDgC,EAAAA,gBAAgB,CAACA,gBAAD,EAA4B;AAC1C,SAAKrC,MAAL,CAAYqC,gBAAZ,GAA+BA,gBAA/B;AACA,WAAO,IAAP;AACD;;AApBkC","sourcesContent":["import { FlingGestureHandlerEventPayload } from '../FlingGestureHandler';\nimport { ForceTouchGestureHandlerEventPayload } from '../ForceTouchGestureHandler';\nimport {\n HitSlop,\n CommonGestureConfig,\n GestureTouchEvent,\n GestureStateChangeEvent,\n GestureUpdateEvent,\n} from '../gestureHandlerCommon';\nimport { getNextHandlerTag } from '../handlersRegistry';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport { LongPressGestureHandlerEventPayload } from '../LongPressGestureHandler';\nimport { PanGestureHandlerEventPayload } from '../PanGestureHandler';\nimport { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';\nimport { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';\nimport { TapGestureHandlerEventPayload } from '../TapGestureHandler';\nimport { NativeViewGestureHandlerPayload } from '../NativeViewGestureHandler';\n\nexport type GestureType =\n | BaseGesture<Record<string, unknown>>\n | BaseGesture<Record<string, never>>\n | BaseGesture<TapGestureHandlerEventPayload>\n | BaseGesture<PanGestureHandlerEventPayload>\n | BaseGesture<LongPressGestureHandlerEventPayload>\n | BaseGesture<RotationGestureHandlerEventPayload>\n | BaseGesture<PinchGestureHandlerEventPayload>\n | BaseGesture<FlingGestureHandlerEventPayload>\n | BaseGesture<ForceTouchGestureHandlerEventPayload>\n | BaseGesture<NativeViewGestureHandlerPayload>;\n\nexport type GestureRef =\n | number\n | GestureType\n | React.RefObject<GestureType | undefined>\n | React.RefObject<React.ComponentType | undefined>; // allow adding a ref to a gesture handler\nexport interface BaseGestureConfig\n extends CommonGestureConfig,\n Record<string, unknown> {\n ref?: React.MutableRefObject<GestureType | undefined>;\n requireToFail?: GestureRef[];\n simultaneousWith?: GestureRef[];\n needsPointerData?: boolean;\n manualActivation?: boolean;\n runOnJS?: boolean;\n testId?: string;\n}\n\ntype TouchEventHandlerType = (\n event: GestureTouchEvent,\n stateManager: GestureStateManagerType\n) => void;\n\nexport type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {\n handlerTag: number;\n onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onStart?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onEnd?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onFinalize?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onUpdate?: (event: GestureUpdateEvent<EventPayloadT>) => void;\n onChange?: (event: any) => void;\n onTouchesDown?: TouchEventHandlerType;\n onTouchesMove?: TouchEventHandlerType;\n onTouchesUp?: TouchEventHandlerType;\n onTouchesCancelled?: TouchEventHandlerType;\n changeEventCalculator?: (\n current: GestureUpdateEvent<Record<string, unknown>>,\n previous?: GestureUpdateEvent<Record<string, unknown>>\n ) => GestureUpdateEvent<Record<string, unknown>>;\n isWorklet: boolean[];\n};\n\nexport const CALLBACK_TYPE = {\n UNDEFINED: 0,\n BEGAN: 1,\n START: 2,\n UPDATE: 3,\n CHANGE: 4,\n END: 5,\n FINALIZE: 6,\n TOUCHES_DOWN: 7,\n TOUCHES_MOVE: 8,\n TOUCHES_UP: 9,\n TOUCHES_CANCELLED: 10,\n} as const;\n\n// Allow using CALLBACK_TYPE as object and type\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type CALLBACK_TYPE = typeof CALLBACK_TYPE[keyof typeof CALLBACK_TYPE];\n\nexport abstract class Gesture {\n /**\n * Return array of gestures, providing the same interface for creating and updating\n * handlers, no matter which object was used to create gesture instance.\n */\n abstract toGestureArray(): GestureType[];\n\n /**\n * Assign handlerTag to the gesture instance and set ref.current (if a ref is set)\n */\n abstract initialize(): void;\n\n /**\n * Make sure that values of properties defining relations are arrays. Do any necessary\n * preprocessing required to configure relations between handlers. Called just before\n * updating the handler on the native side.\n */\n abstract prepare(): void;\n}\n\nexport abstract class BaseGesture<\n EventPayloadT extends Record<string, unknown>\n> extends Gesture {\n public handlerTag = -1;\n public handlerName = '';\n public config: BaseGestureConfig = {};\n public handlers: HandlerCallbacks<EventPayloadT> = {\n handlerTag: -1,\n isWorklet: [],\n };\n\n private addDependency(\n key: 'simultaneousWith' | 'requireToFail',\n gesture: Exclude<GestureRef, number>\n ) {\n const value = this.config[key];\n this.config[key] = value\n ? Array<GestureRef>().concat(value, gesture)\n : [gesture];\n }\n\n withRef(ref: React.MutableRefObject<GestureType | undefined>) {\n this.config.ref = ref;\n return this;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n protected isWorklet(callback: Function) {\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n return callback.__workletHash !== undefined;\n }\n\n onBegin(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onBegin = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);\n return this;\n }\n\n onStart(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onStart = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);\n return this;\n }\n\n onEnd(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onEnd = callback;\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);\n return this;\n }\n\n onFinalize(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onFinalize = callback;\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);\n return this;\n }\n\n onTouchesDown(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesDown = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesMove(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesMove = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesUp(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesUp = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesCancelled(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesCancelled = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n enabled(enabled: boolean) {\n this.config.enabled = enabled;\n return this;\n }\n\n shouldCancelWhenOutside(value: boolean) {\n this.config.shouldCancelWhenOutside = value;\n return this;\n }\n\n hitSlop(hitSlop: HitSlop) {\n this.config.hitSlop = hitSlop;\n return this;\n }\n\n runOnJS(runOnJS: boolean) {\n this.config.runOnJS = runOnJS;\n return this;\n }\n\n simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('simultaneousWith', gesture);\n }\n return this;\n }\n\n requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('requireToFail', gesture);\n }\n return this;\n }\n\n withTestId(id: string) {\n this.config.testId = id;\n return this;\n }\n\n initialize() {\n this.handlerTag = getNextHandlerTag();\n\n this.handlers = { ...this.handlers, handlerTag: this.handlerTag };\n\n if (this.config.ref) {\n this.config.ref.current = this as GestureType;\n }\n }\n\n toGestureArray(): GestureType[] {\n return [this as GestureType];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n prepare() {}\n\n get shouldUseReanimated(): boolean {\n // use Reanimated when runOnJS isn't set explicitly and all defined callbacks are worklets\n return (\n this.config.runOnJS !== true && !this.handlers.isWorklet.includes(false)\n );\n }\n}\n\nexport abstract class ContinousBaseGesture<\n EventPayloadT extends Record<string, unknown>,\n EventChangePayloadT extends Record<string, unknown>\n> extends BaseGesture<EventPayloadT> {\n onUpdate(callback: (event: GestureUpdateEvent<EventPayloadT>) => void) {\n this.handlers.onUpdate = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<EventPayloadT & EventChangePayloadT>\n ) => void\n ) {\n this.handlers.onChange = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);\n return this;\n }\n\n manualActivation(manualActivation: boolean) {\n this.config.manualActivation = manualActivation;\n return this;\n }\n}\n"]}
1
+ {"version":3,"sources":["gesture.ts"],"names":["getNextHandlerTag","isRemoteDebuggingEnabled","CALLBACK_TYPE","UNDEFINED","BEGAN","START","UPDATE","CHANGE","END","FINALIZE","TOUCHES_DOWN","TOUCHES_MOVE","TOUCHES_UP","TOUCHES_CANCELLED","Gesture","BaseGesture","handlerTag","isWorklet","addDependency","key","gesture","value","config","Array","concat","withRef","ref","callback","__workletHash","undefined","onBegin","handlers","onStart","onEnd","onFinalize","onTouchesDown","needsPointerData","onTouchesMove","onTouchesUp","onTouchesCancelled","enabled","shouldCancelWhenOutside","hitSlop","runOnJS","simultaneousWithExternalGesture","gestures","requireExternalGestureToFail","withTestId","id","testId","cancelsTouchesInView","initialize","current","toGestureArray","prepare","shouldUseReanimated","includes","ContinousBaseGesture","onUpdate","onChange","manualActivation"],"mappings":";;AASA,SAASA,iBAAT,QAAkC,qBAAlC;AAQA,SAASC,wBAAT,QAAyC,aAAzC;AA8DA,OAAO,MAAMC,aAAa,GAAG;AAC3BC,EAAAA,SAAS,EAAE,CADgB;AAE3BC,EAAAA,KAAK,EAAE,CAFoB;AAG3BC,EAAAA,KAAK,EAAE,CAHoB;AAI3BC,EAAAA,MAAM,EAAE,CAJmB;AAK3BC,EAAAA,MAAM,EAAE,CALmB;AAM3BC,EAAAA,GAAG,EAAE,CANsB;AAO3BC,EAAAA,QAAQ,EAAE,CAPiB;AAQ3BC,EAAAA,YAAY,EAAE,CARa;AAS3BC,EAAAA,YAAY,EAAE,CATa;AAU3BC,EAAAA,UAAU,EAAE,CAVe;AAW3BC,EAAAA,iBAAiB,EAAE;AAXQ,CAAtB,C,CAcP;AACA;;AAGA,OAAO,MAAeC,OAAf,CAAuB;AAoB9B,OAAO,MAAeC,WAAf,SAEGD,OAFH,CAEW;AAAA;AAAA;;AAAA,wCACI,CAAC,CADL;;AAAA,yCAEK,EAFL;;AAAA,oCAGmB,EAHnB;;AAAA,sCAImC;AACjDE,MAAAA,UAAU,EA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AAEA,QAAI,KAAKM,MAAL,CAAYI,GAAhB,EAAqB;AACnB,WAAKJ,MAAL,CAAYI,GAAZ,CAAgB0B,OAAhB,GAA0B,IAA1B;AACD;AACF;;AAEDC,EAAAA,cAAc,GAAkB;AAC9B,WAAO,CAAC,IAAD,CAAP;AACD,GAlKe,CAoKhB;;;AACAC,EAAAA,OAAO,GAAG,CAAE;;AAEW,MAAnBC,mBAAmB,GAAY;AACjC;AACA;AACA;AACA,WACE,KAAKjC,MAAL,CAAYqB,OAAZ,KAAwB,IAAxB,IACA,CAAC,KAAKZ,QAAL,CAAcd,SAAd,CAAwBuC,QAAxB,CAAiC,KAAjC,CADD,IAEA,CAACvD,wBAAwB,EAH3B;AAKD;;AAhLe;AAmLlB,OAAO,MAAewD,oBAAf,SAGG1C,WAHH,CAG8B;AACnC2C,EAAAA,QAAQ,CAAC/B,QAAD,EAA+D;AACrE,SAAKI,QAAL,CAAc2B,QAAd,GAAyB/B,QAAzB;AACA,SAAKI,QAAL,CAAcd,SAAd,CAAwBf,aAAa,CAACI,MAAtC,IAAgD,KAAKW,SAAL,CAAeU,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;;AAEDgC,EAAAA,QAAQ,CACNhC,QADM,EAIN;AACA,SAAKI,QAAL,CAAc4B,QAAd,GAAyBhC,QAAzB;AACA,SAAKI,QAAL,CAAcd,SAAd,CAAwBf,aAAa,CAACK,MAAtC,IAAgD,KAAKU,SAAL,CAAeU,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;;AAEDiC,EAAAA,gBAAgB,CAACA,gBAAD,EAA4B;AAC1C,SAAKtC,MAAL,CAAYsC,gBAAZ,GAA+BA,gBAA/B;AACA,WAAO,IAAP;AACD;;AApBkC","sourcesContent":["import { FlingGestureHandlerEventPayload } from '../FlingGestureHandler';\nimport { ForceTouchGestureHandlerEventPayload } from '../ForceTouchGestureHandler';\nimport {\n HitSlop,\n CommonGestureConfig,\n GestureTouchEvent,\n GestureStateChangeEvent,\n GestureUpdateEvent,\n} from '../gestureHandlerCommon';\nimport { getNextHandlerTag } from '../handlersRegistry';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport { LongPressGestureHandlerEventPayload } from '../LongPressGestureHandler';\nimport { PanGestureHandlerEventPayload } from '../PanGestureHandler';\nimport { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';\nimport { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';\nimport { TapGestureHandlerEventPayload } from '../TapGestureHandler';\nimport { NativeViewGestureHandlerPayload } from '../NativeViewGestureHandler';\nimport { isRemoteDebuggingEnabled } from '../../utils';\n\nexport type GestureType =\n | BaseGesture<Record<string, unknown>>\n | BaseGesture<Record<string, never>>\n | BaseGesture<TapGestureHandlerEventPayload>\n | BaseGesture<PanGestureHandlerEventPayload>\n | BaseGesture<LongPressGestureHandlerEventPayload>\n | BaseGesture<RotationGestureHandlerEventPayload>\n | BaseGesture<PinchGestureHandlerEventPayload>\n | BaseGesture<FlingGestureHandlerEventPayload>\n | BaseGesture<ForceTouchGestureHandlerEventPayload>\n | BaseGesture<NativeViewGestureHandlerPayload>;\n\nexport type GestureRef =\n | number\n | GestureType\n | React.RefObject<GestureType | undefined>\n | React.RefObject<React.ComponentType | undefined>; // allow adding a ref to a gesture handler\nexport interface BaseGestureConfig\n extends CommonGestureConfig,\n Record<string, unknown> {\n ref?: React.MutableRefObject<GestureType | undefined>;\n requireToFail?: GestureRef[];\n simultaneousWith?: GestureRef[];\n needsPointerData?: boolean;\n manualActivation?: boolean;\n runOnJS?: boolean;\n testId?: string;\n cancelsTouchesInView?: boolean;\n}\n\ntype TouchEventHandlerType = (\n event: GestureTouchEvent,\n stateManager: GestureStateManagerType\n) => void;\n\nexport type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {\n handlerTag: number;\n onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onStart?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onEnd?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onFinalize?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onUpdate?: (event: GestureUpdateEvent<EventPayloadT>) => void;\n onChange?: (event: any) => void;\n onTouchesDown?: TouchEventHandlerType;\n onTouchesMove?: TouchEventHandlerType;\n onTouchesUp?: TouchEventHandlerType;\n onTouchesCancelled?: TouchEventHandlerType;\n changeEventCalculator?: (\n current: GestureUpdateEvent<Record<string, unknown>>,\n previous?: GestureUpdateEvent<Record<string, unknown>>\n ) => GestureUpdateEvent<Record<string, unknown>>;\n isWorklet: boolean[];\n};\n\nexport const CALLBACK_TYPE = {\n UNDEFINED: 0,\n BEGAN: 1,\n START: 2,\n UPDATE: 3,\n CHANGE: 4,\n END: 5,\n FINALIZE: 6,\n TOUCHES_DOWN: 7,\n TOUCHES_MOVE: 8,\n TOUCHES_UP: 9,\n TOUCHES_CANCELLED: 10,\n} as const;\n\n// Allow using CALLBACK_TYPE as object and type\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type CALLBACK_TYPE = typeof CALLBACK_TYPE[keyof typeof CALLBACK_TYPE];\n\nexport abstract class Gesture {\n /**\n * Return array of gestures, providing the same interface for creating and updating\n * handlers, no matter which object was used to create gesture instance.\n */\n abstract toGestureArray(): GestureType[];\n\n /**\n * Assign handlerTag to the gesture instance and set ref.current (if a ref is set)\n */\n abstract initialize(): void;\n\n /**\n * Make sure that values of properties defining relations are arrays. Do any necessary\n * preprocessing required to configure relations between handlers. Called just before\n * updating the handler on the native side.\n */\n abstract prepare(): void;\n}\n\nexport abstract class BaseGesture<\n EventPayloadT extends Record<string, unknown>\n> extends Gesture {\n public handlerTag = -1;\n public handlerName = '';\n public config: BaseGestureConfig = {};\n public handlers: HandlerCallbacks<EventPayloadT> = {\n handlerTag: -1,\n isWorklet: [],\n };\n\n private addDependency(\n key: 'simultaneousWith' | 'requireToFail',\n gesture: Exclude<GestureRef, number>\n ) {\n const value = this.config[key];\n this.config[key] = value\n ? Array<GestureRef>().concat(value, gesture)\n : [gesture];\n }\n\n withRef(ref: React.MutableRefObject<GestureType | undefined>) {\n this.config.ref = ref;\n return this;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n protected isWorklet(callback: Function) {\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n return callback.__workletHash !== undefined;\n }\n\n onBegin(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onBegin = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);\n return this;\n }\n\n onStart(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onStart = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);\n return this;\n }\n\n onEnd(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onEnd = callback;\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);\n return this;\n }\n\n onFinalize(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onFinalize = callback;\n //@ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);\n return this;\n }\n\n onTouchesDown(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesDown = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesMove(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesMove = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesUp(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesUp = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n onTouchesCancelled(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesCancelled = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] = this.isWorklet(\n callback\n );\n\n return this;\n }\n\n enabled(enabled: boolean) {\n this.config.enabled = enabled;\n return this;\n }\n\n shouldCancelWhenOutside(value: boolean) {\n this.config.shouldCancelWhenOutside = value;\n return this;\n }\n\n hitSlop(hitSlop: HitSlop) {\n this.config.hitSlop = hitSlop;\n return this;\n }\n\n runOnJS(runOnJS: boolean) {\n this.config.runOnJS = runOnJS;\n return this;\n }\n\n simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('simultaneousWith', gesture);\n }\n return this;\n }\n\n requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('requireToFail', gesture);\n }\n return this;\n }\n\n withTestId(id: string) {\n this.config.testId = id;\n return this;\n }\n\n cancelsTouchesInView(value: boolean) {\n this.config.cancelsTouchesInView = value;\n return this;\n }\n\n initialize() {\n this.handlerTag = getNextHandlerTag();\n\n this.handlers = { ...this.handlers, handlerTag: this.handlerTag };\n\n if (this.config.ref) {\n this.config.ref.current = this as GestureType;\n }\n }\n\n toGestureArray(): GestureType[] {\n return [this as GestureType];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n prepare() {}\n\n get shouldUseReanimated(): boolean {\n // use Reanimated when runOnJS isn't set explicitly,\n // and all defined callbacks are worklets,\n // and remote debugging is disabled\n return (\n this.config.runOnJS !== true &&\n !this.handlers.isWorklet.includes(false) &&\n !isRemoteDebuggingEnabled()\n );\n }\n}\n\nexport abstract class ContinousBaseGesture<\n EventPayloadT extends Record<string, unknown>,\n EventChangePayloadT extends Record<string, unknown>\n> extends BaseGesture<EventPayloadT> {\n onUpdate(callback: (event: GestureUpdateEvent<EventPayloadT>) => void) {\n this.handlers.onUpdate = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<EventPayloadT & EventChangePayloadT>\n ) => void\n ) {\n this.handlers.onChange = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);\n return this;\n }\n\n manualActivation(manualActivation: boolean) {\n this.config.manualActivation = manualActivation;\n return this;\n }\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { initialize } from './init';
2
2
  export { Directions } from './Directions';
3
3
  export { State } from './State';
4
- export { getByGestureTestId, fireGestureHandler } from './jestUtils';
5
4
  export { default as gestureHandlerRootHOC } from './gestureHandlerRootHOC';
6
5
  export { default as GestureHandlerRootView } from './GestureHandlerRootView';
7
6
  export { TapGestureHandler } from './handlers/TapGestureHandler';
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["initialize","Directions","State","getByGestureTestId","fireGestureHandler","default","gestureHandlerRootHOC","GestureHandlerRootView","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PanGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","createNativeWrapper","GestureDetector","GestureObjects","Gesture","NativeViewGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","Switch","TextInput","DrawerLayoutAndroid","FlatList","Swipeable","DrawerLayout"],"mappings":"AAAA,SAASA,UAAT,QAA2B,QAA3B;AAEA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,kBAAT,EAA6BC,kBAA7B,QAAuD,aAAvD;AACA,SAASC,OAAO,IAAIC,qBAApB,QAAiD,yBAAjD;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,0BAAlD;AA+CA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,wBAAT,QAAyC,qCAAzC;AACA,SAASC,uBAAT,QAAwC,oCAAxC;AACA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAASC,sBAAT,QAAuC,mCAAvC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAAST,OAAO,IAAIU,mBAApB,QAA+C,gCAA/C;AAKA,SAASC,eAAT,QAAgC,qCAAhC;AACA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,oCAA1C;AAiBA,SAASC,wBAAT,QAAyC,qCAAzC;AAOA,SACEC,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,gBAJF,QAKO,6BALP;AAMA,SACEC,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,QAKO,yBALP;AAMA,SACEC,UADF,EAEEC,MAFF,EAGEC,SAHF,EAIEC,mBAJF,EAKEC,QALF,QAMO,gCANP;AA8CA,SAAS3B,OAAO,IAAI4B,SAApB,QAAqC,wBAArC;AASA,SAAS5B,OAAO,IAAI6B,YAApB,QAAwC,2BAAxC;AAEAlC,UAAU","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { getByGestureTestId, fireGestureHandler } from './jestUtils';\nexport { default as gestureHandlerRootHOC } from './gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n} from './components/GestureButtons';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n} from './components/GestureComponents';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\ninitialize();\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["initialize","Directions","State","default","gestureHandlerRootHOC","GestureHandlerRootView","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PanGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","createNativeWrapper","GestureDetector","GestureObjects","Gesture","NativeViewGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","Switch","TextInput","DrawerLayoutAndroid","FlatList","Swipeable","DrawerLayout"],"mappings":"AAAA,SAASA,UAAT,QAA2B,QAA3B;AAEA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,OAAO,IAAIC,qBAApB,QAAiD,yBAAjD;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,0BAAlD;AA+CA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,wBAAT,QAAyC,qCAAzC;AACA,SAASC,uBAAT,QAAwC,oCAAxC;AACA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAASC,sBAAT,QAAuC,mCAAvC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAAST,OAAO,IAAIU,mBAApB,QAA+C,gCAA/C;AAKA,SAASC,eAAT,QAAgC,qCAAhC;AACA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,oCAA1C;AAiBA,SAASC,wBAAT,QAAyC,qCAAzC;AAOA,SACEC,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,gBAJF,QAKO,6BALP;AAMA,SACEC,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,QAKO,yBALP;AAMA,SACEC,UADF,EAEEC,MAFF,EAGEC,SAHF,EAIEC,mBAJF,EAKEC,QALF,QAMO,gCANP;AA8CA,SAAS3B,OAAO,IAAI4B,SAApB,QAAqC,wBAArC;AASA,SAAS5B,OAAO,IAAI6B,YAApB,QAAwC,2BAAxC;AAEAhC,UAAU","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { default as gestureHandlerRootHOC } from './gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n} from './components/GestureButtons';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n} from './components/GestureComponents';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\ninitialize();\n"]}