react-native-gesture-handler 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (633) hide show
  1. package/RNGestureHandler.podspec +8 -0
  2. package/android/build.gradle +9 -3
  3. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
  4. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
  5. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
  6. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
  7. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
  8. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
  9. package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
  10. package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
  11. package/apple/RNGestureHandlerButton.mm +12 -2
  12. package/lib/commonjs/ActionType.js +3 -3
  13. package/lib/commonjs/ActionType.js.map +1 -1
  14. package/lib/commonjs/Directions.js +8 -11
  15. package/lib/commonjs/Directions.js.map +1 -1
  16. package/lib/commonjs/EnableNewWebImplementation.js +10 -2
  17. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
  18. package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
  19. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
  20. package/lib/commonjs/PlatformConstants.js +6 -1
  21. package/lib/commonjs/PlatformConstants.js.map +1 -1
  22. package/lib/commonjs/PlatformConstants.web.js +3 -1
  23. package/lib/commonjs/PlatformConstants.web.js.map +1 -1
  24. package/lib/commonjs/PointerType.js +5 -3
  25. package/lib/commonjs/PointerType.js.map +1 -1
  26. package/lib/commonjs/RNGestureHandlerModule.js +6 -2
  27. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  28. package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
  29. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  30. package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
  31. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  32. package/lib/commonjs/RNRenderer.js +3 -1
  33. package/lib/commonjs/RNRenderer.js.map +1 -1
  34. package/lib/commonjs/RNRenderer.web.js +2 -1
  35. package/lib/commonjs/RNRenderer.web.js.map +1 -1
  36. package/lib/commonjs/State.js +3 -4
  37. package/lib/commonjs/State.js.map +1 -1
  38. package/lib/commonjs/TouchEventType.js +3 -3
  39. package/lib/commonjs/TouchEventType.js.map +1 -1
  40. package/lib/commonjs/components/DrawerLayout.js +115 -90
  41. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  42. package/lib/commonjs/components/GestureButtons.js +81 -28
  43. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  44. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
  45. package/lib/commonjs/components/GestureComponents.js +37 -26
  46. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  47. package/lib/commonjs/components/GestureComponents.web.js +27 -13
  48. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  49. package/lib/commonjs/components/GestureHandlerButton.js +6 -2
  50. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  51. package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
  52. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
  53. package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
  54. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  55. package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
  56. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  57. package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
  58. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
  59. package/lib/commonjs/components/Pressable/Pressable.js +77 -29
  60. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
  61. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
  62. package/lib/commonjs/components/Pressable/index.js +3 -1
  63. package/lib/commonjs/components/Pressable/index.js.map +1 -1
  64. package/lib/commonjs/components/Pressable/utils.js +20 -5
  65. package/lib/commonjs/components/Pressable/utils.js.map +1 -1
  66. package/lib/commonjs/components/ReanimatedDrawerLayout.js +86 -44
  67. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
  68. package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
  69. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
  70. package/lib/commonjs/components/Swipeable.js +75 -34
  71. package/lib/commonjs/components/Swipeable.js.map +1 -1
  72. package/lib/commonjs/components/Text.js +28 -10
  73. package/lib/commonjs/components/Text.js.map +1 -1
  74. package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
  75. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
  76. package/lib/commonjs/components/touchables/ExtraButtonProps.js +2 -0
  77. package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
  78. package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
  79. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  80. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
  81. package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
  82. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  83. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
  84. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  85. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
  86. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
  87. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  88. package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
  89. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  90. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +25 -13
  91. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  92. package/lib/commonjs/components/touchables/index.js +12 -7
  93. package/lib/commonjs/components/touchables/index.js.map +1 -1
  94. package/lib/commonjs/findNodeHandle.js +4 -1
  95. package/lib/commonjs/findNodeHandle.js.map +1 -1
  96. package/lib/commonjs/findNodeHandle.web.js +14 -5
  97. package/lib/commonjs/findNodeHandle.web.js.map +1 -1
  98. package/lib/commonjs/getReactNativeVersion.js +6 -1
  99. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  100. package/lib/commonjs/getReactNativeVersion.web.js +1 -0
  101. package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
  102. package/lib/commonjs/getShadowNodeFromRef.js +14 -13
  103. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  104. package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
  105. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
  106. package/lib/commonjs/ghQueueMicrotask.js +2 -1
  107. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  108. package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
  109. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  110. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
  111. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  112. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
  113. package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
  114. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  115. package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
  116. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  117. package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
  118. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  119. package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
  120. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  121. package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
  122. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  123. package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
  124. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
  125. package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
  126. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  127. package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
  128. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  129. package/lib/commonjs/handlers/createHandler.js +146 -59
  130. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  131. package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
  132. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  133. package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
  134. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
  135. package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
  136. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
  137. package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
  138. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  139. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
  140. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
  141. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  142. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +21 -13
  143. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  144. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
  145. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  146. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
  147. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  148. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
  149. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  150. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
  151. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  152. package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
  153. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
  154. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  155. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
  156. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  157. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
  158. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  159. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
  160. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  161. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
  162. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  163. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
  164. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  165. package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
  166. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  167. package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
  168. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  169. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
  170. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  171. package/lib/commonjs/handlers/gestures/gesture.js +84 -44
  172. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  173. package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
  174. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  175. package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
  176. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  177. package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
  178. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  179. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
  180. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  181. package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
  182. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  183. package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
  184. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  185. package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
  186. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
  187. package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
  188. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  189. package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
  190. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  191. package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
  192. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  193. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
  194. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
  195. package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
  196. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  197. package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
  198. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  199. package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
  200. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
  201. package/lib/commonjs/handlers/handlersRegistry.js +21 -6
  202. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  203. package/lib/commonjs/handlers/utils.js +26 -6
  204. package/lib/commonjs/handlers/utils.js.map +1 -1
  205. package/lib/commonjs/index.js +104 -75
  206. package/lib/commonjs/index.js.map +1 -1
  207. package/lib/commonjs/init.js +11 -4
  208. package/lib/commonjs/init.js.map +1 -1
  209. package/lib/commonjs/jestUtils/index.js +5 -4
  210. package/lib/commonjs/jestUtils/index.js.map +1 -1
  211. package/lib/commonjs/jestUtils/jestUtils.js +83 -19
  212. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  213. package/lib/commonjs/mocks.js +15 -5
  214. package/lib/commonjs/mocks.js.map +1 -1
  215. package/lib/commonjs/mountRegistry.js +12 -3
  216. package/lib/commonjs/mountRegistry.js.map +1 -1
  217. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
  218. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
  219. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
  220. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  221. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
  222. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  223. package/lib/commonjs/typeUtils.js.map +1 -1
  224. package/lib/commonjs/utils.js +37 -13
  225. package/lib/commonjs/utils.js.map +1 -1
  226. package/lib/commonjs/web/Gestures.js +23 -5
  227. package/lib/commonjs/web/Gestures.js.map +1 -1
  228. package/lib/commonjs/web/constants.js +4 -2
  229. package/lib/commonjs/web/constants.js.map +1 -1
  230. package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
  231. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  232. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
  233. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  234. package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
  235. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  236. package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
  237. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  238. package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
  239. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
  240. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
  241. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
  242. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  243. package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
  244. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
  245. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
  246. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  247. package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
  248. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  249. package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
  250. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  251. package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
  252. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  253. package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
  254. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  255. package/lib/commonjs/web/interfaces.js +17 -9
  256. package/lib/commonjs/web/interfaces.js.map +1 -1
  257. package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
  258. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
  259. package/lib/commonjs/web/tools/EventManager.js +41 -7
  260. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  261. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
  262. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
  263. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  264. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
  265. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  266. package/lib/commonjs/web/tools/InteractionManager.js +22 -5
  267. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  268. package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
  269. package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
  270. package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
  271. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  272. package/lib/commonjs/web/tools/NodeManager.js +14 -7
  273. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  274. package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
  275. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  276. package/lib/commonjs/web/tools/PointerTracker.js +45 -9
  277. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  278. package/lib/commonjs/web/tools/Vector.js +18 -3
  279. package/lib/commonjs/web/tools/Vector.js.map +1 -1
  280. package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
  281. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  282. package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
  283. package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
  284. package/lib/commonjs/web/utils.js +76 -27
  285. package/lib/commonjs/web/utils.js.map +1 -1
  286. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
  287. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
  288. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
  289. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
  290. package/lib/commonjs/web_hammer/Errors.js +3 -0
  291. package/lib/commonjs/web_hammer/Errors.js.map +1 -1
  292. package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
  293. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
  294. package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
  295. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
  296. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
  297. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  298. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
  299. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
  300. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
  301. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
  302. package/lib/commonjs/web_hammer/NodeManager.js +16 -9
  303. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  304. package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
  305. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
  306. package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
  307. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
  308. package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
  309. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
  310. package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
  311. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
  312. package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
  313. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
  314. package/lib/commonjs/web_hammer/constants.js +26 -13
  315. package/lib/commonjs/web_hammer/constants.js.map +1 -1
  316. package/lib/commonjs/web_hammer/utils.js +14 -4
  317. package/lib/commonjs/web_hammer/utils.js.map +1 -1
  318. package/lib/module/ActionType.js +1 -3
  319. package/lib/module/ActionType.js.map +1 -1
  320. package/lib/module/Directions.js +3 -9
  321. package/lib/module/Directions.js.map +1 -1
  322. package/lib/module/EnableNewWebImplementation.js +5 -2
  323. package/lib/module/EnableNewWebImplementation.js.map +1 -1
  324. package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
  325. package/lib/module/PlatformConstants.js +1 -0
  326. package/lib/module/PlatformConstants.js.map +1 -1
  327. package/lib/module/PlatformConstants.web.js +1 -0
  328. package/lib/module/PlatformConstants.web.js.map +1 -1
  329. package/lib/module/PointerType.js +4 -3
  330. package/lib/module/PointerType.js.map +1 -1
  331. package/lib/module/RNGestureHandlerModule.js +0 -1
  332. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  333. package/lib/module/RNGestureHandlerModule.web.js +20 -10
  334. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  335. package/lib/module/RNGestureHandlerModule.windows.js +17 -18
  336. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  337. package/lib/module/RNRenderer.js.map +1 -1
  338. package/lib/module/RNRenderer.web.js.map +1 -1
  339. package/lib/module/State.js +1 -4
  340. package/lib/module/State.js.map +1 -1
  341. package/lib/module/TouchEventType.js +1 -3
  342. package/lib/module/TouchEventType.js.map +1 -1
  343. package/lib/module/components/DrawerLayout.js +99 -80
  344. package/lib/module/components/DrawerLayout.js.map +1 -1
  345. package/lib/module/components/GestureButtons.js +55 -19
  346. package/lib/module/components/GestureButtons.js.map +1 -1
  347. package/lib/module/components/GestureButtonsProps.js.map +1 -1
  348. package/lib/module/components/GestureComponents.js +12 -17
  349. package/lib/module/components/GestureComponents.js.map +1 -1
  350. package/lib/module/components/GestureComponents.web.js +4 -4
  351. package/lib/module/components/GestureComponents.web.js.map +1 -1
  352. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  353. package/lib/module/components/GestureHandlerButton.web.js +2 -1
  354. package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
  355. package/lib/module/components/GestureHandlerRootView.android.js +2 -1
  356. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  357. package/lib/module/components/GestureHandlerRootView.js +2 -1
  358. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  359. package/lib/module/components/GestureHandlerRootView.web.js +2 -1
  360. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
  361. package/lib/module/components/Pressable/Pressable.js +59 -26
  362. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  363. package/lib/module/components/Pressable/PressableProps.js.map +1 -1
  364. package/lib/module/components/Pressable/index.js.map +1 -1
  365. package/lib/module/components/Pressable/utils.js +14 -4
  366. package/lib/module/components/Pressable/utils.js.map +1 -1
  367. package/lib/module/components/ReanimatedDrawerLayout.js +66 -40
  368. package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
  369. package/lib/module/components/ReanimatedSwipeable.js +30 -14
  370. package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
  371. package/lib/module/components/Swipeable.js +59 -28
  372. package/lib/module/components/Swipeable.js.map +1 -1
  373. package/lib/module/components/Text.js +15 -7
  374. package/lib/module/components/Text.js.map +1 -1
  375. package/lib/module/components/gestureHandlerRootHOC.js +2 -2
  376. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
  377. package/lib/module/components/touchables/ExtraButtonProps.js +2 -0
  378. package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
  379. package/lib/module/components/touchables/GenericTouchable.js +63 -34
  380. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  381. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
  382. package/lib/module/components/touchables/TouchableHighlight.js +24 -15
  383. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  384. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
  385. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  386. package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
  387. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
  388. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  389. package/lib/module/components/touchables/TouchableOpacity.js +16 -10
  390. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  391. package/lib/module/components/touchables/TouchableWithoutFeedback.js +15 -10
  392. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  393. package/lib/module/components/touchables/index.js.map +1 -1
  394. package/lib/module/findNodeHandle.js.map +1 -1
  395. package/lib/module/findNodeHandle.web.js +11 -5
  396. package/lib/module/findNodeHandle.web.js.map +1 -1
  397. package/lib/module/getReactNativeVersion.js.map +1 -1
  398. package/lib/module/getReactNativeVersion.web.js.map +1 -1
  399. package/lib/module/getShadowNodeFromRef.js +13 -13
  400. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  401. package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
  402. package/lib/module/ghQueueMicrotask.js.map +1 -1
  403. package/lib/module/handlers/FlingGestureHandler.js +0 -6
  404. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  405. package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
  406. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  407. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
  408. package/lib/module/handlers/LongPressGestureHandler.js +0 -6
  409. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  410. package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
  411. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  412. package/lib/module/handlers/PanGestureHandler.js +19 -8
  413. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  414. package/lib/module/handlers/PinchGestureHandler.js +0 -2
  415. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  416. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  417. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
  418. package/lib/module/handlers/RotationGestureHandler.js +0 -2
  419. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  420. package/lib/module/handlers/TapGestureHandler.js +0 -6
  421. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  422. package/lib/module/handlers/createHandler.js +119 -57
  423. package/lib/module/handlers/createHandler.js.map +1 -1
  424. package/lib/module/handlers/createNativeWrapper.js +22 -15
  425. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  426. package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
  427. package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
  428. package/lib/module/handlers/gestureHandlerCommon.js +4 -9
  429. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  430. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
  431. package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
  432. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  433. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +7 -8
  434. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  435. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
  436. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  437. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
  438. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  439. package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
  440. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  441. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
  442. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  443. package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
  444. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
  445. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  446. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
  447. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  448. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
  449. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  450. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
  451. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  452. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
  453. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  454. package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
  455. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  456. package/lib/module/handlers/gestures/eventReceiver.js +38 -14
  457. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  458. package/lib/module/handlers/gestures/flingGesture.js +9 -5
  459. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  460. package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
  461. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  462. package/lib/module/handlers/gestures/gesture.js +73 -44
  463. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  464. package/lib/module/handlers/gestures/gestureComposition.js +24 -16
  465. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  466. package/lib/module/handlers/gestures/gestureObjects.js +14 -1
  467. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  468. package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
  469. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  470. package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
  471. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  472. package/lib/module/handlers/gestures/hoverGesture.js +18 -9
  473. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  474. package/lib/module/handlers/gestures/longPressGesture.js +11 -6
  475. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  476. package/lib/module/handlers/gestures/manualGesture.js +4 -0
  477. package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
  478. package/lib/module/handlers/gestures/nativeGesture.js +9 -5
  479. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  480. package/lib/module/handlers/gestures/panGesture.js +41 -18
  481. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  482. package/lib/module/handlers/gestures/pinchGesture.js +7 -2
  483. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  484. package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
  485. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
  486. package/lib/module/handlers/gestures/rotationGesture.js +7 -2
  487. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  488. package/lib/module/handlers/gestures/tapGesture.js +19 -10
  489. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  490. package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
  491. package/lib/module/handlers/handlersRegistry.js +5 -0
  492. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  493. package/lib/module/handlers/utils.js +13 -4
  494. package/lib/module/handlers/utils.js.map +1 -1
  495. package/lib/module/index.js.map +1 -1
  496. package/lib/module/init.js +2 -3
  497. package/lib/module/init.js.map +1 -1
  498. package/lib/module/jestUtils/index.js.map +1 -1
  499. package/lib/module/jestUtils/jestUtils.js +66 -20
  500. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  501. package/lib/module/mocks.js +7 -3
  502. package/lib/module/mocks.js.map +1 -1
  503. package/lib/module/mountRegistry.js +10 -3
  504. package/lib/module/mountRegistry.js.map +1 -1
  505. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
  506. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  507. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  508. package/lib/module/typeUtils.js.map +1 -1
  509. package/lib/module/utils.js +15 -6
  510. package/lib/module/utils.js.map +1 -1
  511. package/lib/module/web/Gestures.js +1 -2
  512. package/lib/module/web/Gestures.js.map +1 -1
  513. package/lib/module/web/constants.js.map +1 -1
  514. package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
  515. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  516. package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
  517. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  518. package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
  519. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  520. package/lib/module/web/handlers/GestureHandler.js +181 -61
  521. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  522. package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
  523. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  524. package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
  525. package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
  526. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  527. package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
  528. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  529. package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
  530. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  531. package/lib/module/web/handlers/PanGestureHandler.js +114 -7
  532. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  533. package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
  534. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  535. package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
  536. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  537. package/lib/module/web/handlers/TapGestureHandler.js +59 -5
  538. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  539. package/lib/module/web/interfaces.js +14 -9
  540. package/lib/module/web/interfaces.js.map +1 -1
  541. package/lib/module/web/tools/CircularBuffer.js +13 -3
  542. package/lib/module/web/tools/CircularBuffer.js.map +1 -1
  543. package/lib/module/web/tools/EventManager.js +39 -7
  544. package/lib/module/web/tools/EventManager.js.map +1 -1
  545. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
  546. package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
  547. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  548. package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
  549. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  550. package/lib/module/web/tools/InteractionManager.js +19 -5
  551. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  552. package/lib/module/web/tools/KeyboardEventManager.js +19 -3
  553. package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
  554. package/lib/module/web/tools/LeastSquareSolver.js +65 -30
  555. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  556. package/lib/module/web/tools/NodeManager.js +12 -7
  557. package/lib/module/web/tools/NodeManager.js.map +1 -1
  558. package/lib/module/web/tools/PointerEventManager.js +35 -9
  559. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  560. package/lib/module/web/tools/PointerTracker.js +39 -8
  561. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  562. package/lib/module/web/tools/Vector.js +14 -3
  563. package/lib/module/web/tools/Vector.js.map +1 -1
  564. package/lib/module/web/tools/VelocityTracker.js +25 -8
  565. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  566. package/lib/module/web/tools/WheelEventManager.js +10 -3
  567. package/lib/module/web/tools/WheelEventManager.js.map +1 -1
  568. package/lib/module/web/utils.js +57 -22
  569. package/lib/module/web/utils.js.map +1 -1
  570. package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
  571. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
  572. package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
  573. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
  574. package/lib/module/web_hammer/Errors.js +1 -0
  575. package/lib/module/web_hammer/Errors.js.map +1 -1
  576. package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
  577. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
  578. package/lib/module/web_hammer/GestureHandler.js +130 -53
  579. package/lib/module/web_hammer/GestureHandler.js.map +1 -1
  580. package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
  581. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  582. package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
  583. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
  584. package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
  585. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
  586. package/lib/module/web_hammer/NodeManager.js +8 -6
  587. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  588. package/lib/module/web_hammer/PanGestureHandler.js +40 -6
  589. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
  590. package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
  591. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
  592. package/lib/module/web_hammer/PressGestureHandler.js +34 -13
  593. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
  594. package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
  595. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
  596. package/lib/module/web_hammer/TapGestureHandler.js +45 -31
  597. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
  598. package/lib/module/web_hammer/constants.js +1 -2
  599. package/lib/module/web_hammer/constants.js.map +1 -1
  600. package/lib/module/web_hammer/utils.js +2 -2
  601. package/lib/module/web_hammer/utils.js.map +1 -1
  602. package/lib/typescript/components/GestureComponents.d.ts +1 -1
  603. package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
  604. package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
  605. package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
  606. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
  607. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
  608. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
  609. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
  610. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
  611. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
  612. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
  613. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
  614. package/lib/typescript/utils.d.ts +1 -0
  615. package/lib/typescript/web/utils.d.ts +2 -0
  616. package/package.json +9 -8
  617. package/src/components/GestureComponents.tsx +1 -1
  618. package/src/components/ReanimatedDrawerLayout.tsx +17 -4
  619. package/src/components/Text.tsx +5 -0
  620. package/src/components/touchables/ExtraButtonProps.ts +7 -0
  621. package/src/components/touchables/GenericTouchable.tsx +0 -2
  622. package/src/components/touchables/GenericTouchableProps.ts +2 -0
  623. package/src/components/touchables/TouchableHighlight.tsx +2 -2
  624. package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
  625. package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
  626. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -8
  627. package/src/components/touchables/TouchableOpacity.tsx +2 -2
  628. package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
  629. package/src/handlers/createHandler.tsx +20 -9
  630. package/src/handlers/createNativeWrapper.tsx +7 -3
  631. package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
  632. package/src/utils.ts +6 -0
  633. package/src/web/utils.ts +21 -3
@@ -1,7 +1,7 @@
1
1
  var _UIManagerAny$getView, _UIManagerAny$getView2, _UIManagerAny$getCons;
2
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
2
+
3
+ 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; }
4
+
5
5
  import * as React from 'react';
6
6
  import { Platform, UIManager, DeviceEventEmitter } from 'react-native';
7
7
  import { customDirectEventTypes } from './customDirectEventTypes';
@@ -11,7 +11,7 @@ import { handlerIDToTag, registerOldGestureHandler, unregisterOldGestureHandler
11
11
  import { getNextHandlerTag } from './getNextHandlerTag';
12
12
  import { filterConfig, scheduleFlushOperations } from './utils';
13
13
  import findNodeHandle from '../findNodeHandle';
14
- import { deepEqual, isFabric, isTestEnv, tagMessage } from '../utils';
14
+ import { deepEqual, isFabric, isReact19, isTestEnv, tagMessage } from '../utils';
15
15
  import { ActionType } from '../ActionType';
16
16
  import { PressabilityDebugView } from './PressabilityDebugView';
17
17
  import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
@@ -45,63 +45,66 @@ const customGHEventsConfig = {
45
45
  // Without this piece of code below, you'll get the following JS error:
46
46
  // Unsupported top level event type "topOnGestureHandlerEvent" dispatched
47
47
  ...(isFabric() && Platform.OS === 'android' && customGHEventsConfigFabricAndroid)
48
- };
49
-
50
- // Add gesture specific events to genericDirectEventTypes object exported from UIManager
48
+ }; // Add gesture specific events to genericDirectEventTypes object exported from UIManager
51
49
  // native module.
52
50
  // Once new event types are registered with react it is possible to dispatch these
53
51
  // events to all kind of native views.
54
- UIManagerAny.genericDirectEventTypes = {
55
- ...UIManagerAny.genericDirectEventTypes,
52
+
53
+ UIManagerAny.genericDirectEventTypes = { ...UIManagerAny.genericDirectEventTypes,
56
54
  ...customGHEventsConfig
57
- };
58
- // In newer versions of RN the `genericDirectEventTypes` is located in the object
55
+ }; // In newer versions of RN the `genericDirectEventTypes` is located in the object
59
56
  // returned by UIManager.getViewManagerConfig('getConstants') or in older RN UIManager.getConstants(), we need to add it there as well to make
60
57
  // it compatible with RN 61+
58
+
61
59
  const UIManagerConstants = (_UIManagerAny$getView = (_UIManagerAny$getView2 = UIManagerAny.getViewManagerConfig) === null || _UIManagerAny$getView2 === void 0 ? void 0 : _UIManagerAny$getView2.call(UIManagerAny, 'getConstants')) !== null && _UIManagerAny$getView !== void 0 ? _UIManagerAny$getView : (_UIManagerAny$getCons = UIManagerAny.getConstants) === null || _UIManagerAny$getCons === void 0 ? void 0 : _UIManagerAny$getCons.call(UIManagerAny);
60
+
62
61
  if (UIManagerConstants) {
63
- UIManagerConstants.genericDirectEventTypes = {
64
- ...UIManagerConstants.genericDirectEventTypes,
62
+ UIManagerConstants.genericDirectEventTypes = { ...UIManagerConstants.genericDirectEventTypes,
65
63
  ...customGHEventsConfig
66
64
  };
67
- }
65
+ } // Wrap JS responder calls and notify gesture handler manager
66
+
68
67
 
69
- // Wrap JS responder calls and notify gesture handler manager
70
68
  const {
71
- setJSResponder: oldSetJSResponder = () => {
72
- // no-op
69
+ setJSResponder: oldSetJSResponder = () => {// no-op
73
70
  },
74
- clearJSResponder: oldClearJSResponder = () => {
75
- // no-op
71
+ clearJSResponder: oldClearJSResponder = () => {// no-op
76
72
  }
77
73
  } = UIManagerAny;
74
+
78
75
  UIManagerAny.setJSResponder = (tag, blockNativeResponder) => {
79
76
  RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);
80
77
  oldSetJSResponder(tag, blockNativeResponder);
81
78
  };
79
+
82
80
  UIManagerAny.clearJSResponder = () => {
83
81
  RNGestureHandlerModule.handleClearJSResponder();
84
82
  oldClearJSResponder();
85
83
  };
84
+
86
85
  let allowTouches = true;
87
- const DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android';
88
- // Toggled inspector blocks touch events in order to allow inspecting on Android
86
+ const DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android'; // Toggled inspector blocks touch events in order to allow inspecting on Android
89
87
  // This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component
88
+
90
89
  if (DEV_ON_ANDROID) {
91
90
  DeviceEventEmitter.addListener('toggleElementInspector', () => {
92
91
  allowTouches = !allowTouches;
93
92
  });
94
93
  }
94
+
95
95
  function hasUnresolvedRefs(props) {
96
96
  // TODO(TS) - add type for extract arg
97
97
  const extract = refs => {
98
98
  if (!Array.isArray(refs)) {
99
99
  return refs && refs.current === null;
100
100
  }
101
+
101
102
  return refs.some(r => r && r.current === null);
102
103
  };
104
+
103
105
  return extract(props['simultaneousHandlers']) || extract(props['waitFor']);
104
106
  }
107
+
105
108
  const stateToPropMappings = {
106
109
  [State.UNDETERMINED]: undefined,
107
110
  [State.BEGAN]: 'onBegan',
@@ -110,12 +113,8 @@ const stateToPropMappings = {
110
113
  [State.ACTIVE]: 'onActivated',
111
114
  [State.END]: 'onEnded'
112
115
  };
116
+ const UNRESOLVED_REFS_RETRY_LIMIT = 1; // TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
113
117
 
114
- // TODO(TS) fix event types
115
-
116
- const UNRESOLVED_REFS_RETRY_LIMIT = 1;
117
-
118
- // TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
119
118
  export default function createHandler({
120
119
  name,
121
120
  allowedProps = [],
@@ -126,79 +125,104 @@ export default function createHandler({
126
125
  class Handler extends React.Component {
127
126
  constructor(props) {
128
127
  super(props);
128
+
129
129
  _defineProperty(this, "handlerTag", void 0);
130
+
130
131
  _defineProperty(this, "config", void 0);
132
+
131
133
  _defineProperty(this, "propsRef", void 0);
134
+
132
135
  _defineProperty(this, "isMountedRef", void 0);
136
+
133
137
  _defineProperty(this, "viewNode", void 0);
138
+
134
139
  _defineProperty(this, "viewTag", void 0);
140
+
135
141
  _defineProperty(this, "inspectorToggleListener", void 0);
142
+
136
143
  _defineProperty(this, "onGestureHandlerEvent", event => {
137
144
  if (event.nativeEvent.handlerTag === this.handlerTag) {
138
145
  if (typeof this.props.onGestureEvent === 'function') {
139
146
  var _this$props$onGesture, _this$props;
140
- (_this$props$onGesture = (_this$props = this.props).onGestureEvent) === null || _this$props$onGesture === void 0 || _this$props$onGesture.call(_this$props, event);
147
+
148
+ (_this$props$onGesture = (_this$props = this.props).onGestureEvent) === null || _this$props$onGesture === void 0 ? void 0 : _this$props$onGesture.call(_this$props, event);
141
149
  }
142
150
  } else {
143
151
  var _this$props$onGesture2, _this$props2;
144
- (_this$props$onGesture2 = (_this$props2 = this.props).onGestureHandlerEvent) === null || _this$props$onGesture2 === void 0 || _this$props$onGesture2.call(_this$props2, event);
152
+
153
+ (_this$props$onGesture2 = (_this$props2 = this.props).onGestureHandlerEvent) === null || _this$props$onGesture2 === void 0 ? void 0 : _this$props$onGesture2.call(_this$props2, event);
145
154
  }
146
155
  });
147
- // TODO(TS) - make sure this is right type for event
156
+
148
157
  _defineProperty(this, "onGestureHandlerStateChange", event => {
149
158
  if (event.nativeEvent.handlerTag === this.handlerTag) {
150
159
  if (typeof this.props.onHandlerStateChange === 'function') {
151
160
  var _this$props$onHandler, _this$props3;
152
- (_this$props$onHandler = (_this$props3 = this.props).onHandlerStateChange) === null || _this$props$onHandler === void 0 || _this$props$onHandler.call(_this$props3, event);
161
+
162
+ (_this$props$onHandler = (_this$props3 = this.props).onHandlerStateChange) === null || _this$props$onHandler === void 0 ? void 0 : _this$props$onHandler.call(_this$props3, event);
153
163
  }
164
+
154
165
  const state = event.nativeEvent.state;
155
166
  const stateEventName = stateToPropMappings[state];
156
167
  const eventHandler = stateEventName && this.props[stateEventName];
168
+
157
169
  if (eventHandler && typeof eventHandler === 'function') {
158
170
  eventHandler(event);
159
171
  }
160
172
  } else {
161
173
  var _this$props$onGesture3, _this$props4;
162
- (_this$props$onGesture3 = (_this$props4 = this.props).onGestureHandlerStateChange) === null || _this$props$onGesture3 === void 0 || _this$props$onGesture3.call(_this$props4, event);
174
+
175
+ (_this$props$onGesture3 = (_this$props4 = this.props).onGestureHandlerStateChange) === null || _this$props$onGesture3 === void 0 ? void 0 : _this$props$onGesture3.call(_this$props4, event);
163
176
  }
164
177
  });
178
+
165
179
  _defineProperty(this, "refHandler", node => {
180
+ var _props;
181
+
166
182
  this.viewNode = node;
167
- const child = React.Children.only(this.props.children);
168
- // TODO(TS) fix ref type
169
- const {
170
- ref
171
- } = child;
172
- if (ref !== null) {
173
- if (typeof ref === 'function') {
174
- ref(node);
175
- } else {
176
- ref.current = node;
177
- }
183
+ const child = React.Children.only(this.props.children); // @ts-ignore Since React 19 ref is accessible as standard prop
184
+ // https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref
185
+
186
+ const ref = isReact19() ? (_props = child.props) === null || _props === void 0 ? void 0 : _props.ref : child === null || child === void 0 ? void 0 : child.ref;
187
+
188
+ if (!ref) {
189
+ return;
190
+ }
191
+
192
+ if (typeof ref === 'function') {
193
+ ref(node);
194
+ } else {
195
+ ref.current = node;
178
196
  }
179
197
  });
198
+
180
199
  _defineProperty(this, "createGestureHandler", newConfig => {
181
200
  this.config = newConfig;
182
201
  RNGestureHandlerModule.createGestureHandler(name, this.handlerTag, newConfig);
183
202
  });
203
+
184
204
  _defineProperty(this, "attachGestureHandler", newViewTag => {
185
205
  this.viewTag = newViewTag;
206
+
186
207
  if (Platform.OS === 'web') {
187
208
  // Typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch
188
- RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, ActionType.JS_FUNCTION_OLD_API,
189
- // ignored on web
209
+ RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, ActionType.JS_FUNCTION_OLD_API, // ignored on web
190
210
  this.propsRef);
191
211
  } else {
192
212
  registerOldGestureHandler(this.handlerTag, {
193
213
  onGestureEvent: this.onGestureHandlerEvent,
194
214
  onGestureStateChange: this.onGestureHandlerStateChange
195
215
  });
196
- const actionType = ((_this$props5, _this$props6) => {
216
+
217
+ const actionType = (() => {
218
+ var _this$props5, _this$props6;
219
+
197
220
  const onGestureEvent = (_this$props5 = this.props) === null || _this$props5 === void 0 ? void 0 : _this$props5.onGestureEvent;
198
221
  const isGestureHandlerWorklet = onGestureEvent && ('current' in onGestureEvent || 'workletEventHandler' in onGestureEvent);
199
222
  const onHandlerStateChange = (_this$props6 = this.props) === null || _this$props6 === void 0 ? void 0 : _this$props6.onHandlerStateChange;
200
223
  const isStateChangeHandlerWorklet = onHandlerStateChange && ('current' in onHandlerStateChange || 'workletEventHandler' in onHandlerStateChange);
201
224
  const isReanimatedHandler = isGestureHandlerWorklet || isStateChangeHandlerWorklet;
225
+
202
226
  if (isReanimatedHandler) {
203
227
  // Reanimated worklet
204
228
  return ActionType.REANIMATED_WORKLET;
@@ -210,18 +234,22 @@ export default function createHandler({
210
234
  return ActionType.JS_FUNCTION_OLD_API;
211
235
  }
212
236
  })();
237
+
213
238
  RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, actionType);
214
239
  }
240
+
215
241
  scheduleFlushOperations();
216
242
  ghQueueMicrotask(() => {
217
243
  MountRegistry.gestureHandlerWillMount(this);
218
244
  });
219
245
  });
246
+
220
247
  _defineProperty(this, "updateGestureHandler", newConfig => {
221
248
  this.config = newConfig;
222
249
  RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);
223
250
  scheduleFlushOperations();
224
251
  });
252
+
225
253
  this.handlerTag = getNextHandlerTag();
226
254
  this.config = {};
227
255
  this.propsRef = /*#__PURE__*/React.createRef();
@@ -229,16 +257,20 @@ export default function createHandler({
229
257
  this.state = {
230
258
  allowTouches
231
259
  };
260
+
232
261
  if (props.id) {
233
262
  if (handlerIDToTag[props.id] !== undefined) {
234
263
  throw new Error(`Handler with ID "${props.id}" already registered`);
235
264
  }
265
+
236
266
  handlerIDToTag[props.id] = this.handlerTag;
237
267
  }
238
268
  }
269
+
239
270
  componentDidMount() {
240
271
  const props = this.props;
241
272
  this.isMountedRef.current = true;
273
+
242
274
  if (DEV_ON_ANDROID) {
243
275
  this.inspectorToggleListener = DeviceEventEmitter.addListener('toggleElementInspector', () => {
244
276
  this.setState(_ => ({
@@ -247,6 +279,7 @@ export default function createHandler({
247
279
  this.update(UNRESOLVED_REFS_RETRY_LIMIT);
248
280
  });
249
281
  }
282
+
250
283
  if (hasUnresolvedRefs(props)) {
251
284
  // If there are unresolved refs (e.g. ".current" has not yet been set)
252
285
  // passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to
@@ -258,76 +291,93 @@ export default function createHandler({
258
291
  this.update(UNRESOLVED_REFS_RETRY_LIMIT);
259
292
  });
260
293
  }
294
+
261
295
  this.createGestureHandler(filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config));
296
+
262
297
  if (!this.viewNode) {
263
298
  throw new Error(`[Gesture Handler] Failed to obtain view for ${Handler.displayName}. Note that old API doesn't support functional components.`);
264
299
  }
300
+
265
301
  this.attachGestureHandler(findNodeHandle(this.viewNode)); // TODO(TS) - check if this can be null
266
302
  }
303
+
267
304
  componentDidUpdate() {
268
305
  const viewTag = findNodeHandle(this.viewNode);
306
+
269
307
  if (this.viewTag !== viewTag) {
270
308
  this.attachGestureHandler(viewTag); // TODO(TS) - check interaction between _viewTag & findNodeHandle
271
309
  }
310
+
272
311
  this.update(UNRESOLVED_REFS_RETRY_LIMIT);
273
312
  }
313
+
274
314
  componentWillUnmount() {
275
315
  var _this$inspectorToggle;
276
- (_this$inspectorToggle = this.inspectorToggleListener) === null || _this$inspectorToggle === void 0 || _this$inspectorToggle.remove();
316
+
317
+ (_this$inspectorToggle = this.inspectorToggleListener) === null || _this$inspectorToggle === void 0 ? void 0 : _this$inspectorToggle.remove();
277
318
  this.isMountedRef.current = false;
319
+
278
320
  if (Platform.OS !== 'web') {
279
321
  unregisterOldGestureHandler(this.handlerTag);
280
322
  }
323
+
281
324
  RNGestureHandlerModule.dropGestureHandler(this.handlerTag);
282
- scheduleFlushOperations();
283
- // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context
325
+ scheduleFlushOperations(); // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context
326
+
284
327
  const handlerID = this.props.id;
328
+
285
329
  if (handlerID) {
286
330
  // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
287
331
  delete handlerIDToTag[handlerID];
288
332
  }
333
+
289
334
  MountRegistry.gestureHandlerWillUnmount(this);
290
335
  }
336
+
291
337
  update(remainingTries) {
292
338
  if (!this.isMountedRef.current) {
293
339
  return;
294
340
  }
295
- const props = this.props;
296
341
 
297
- // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of
342
+ const props = this.props; // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of
298
343
  // `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying
299
344
  // again is easy enough fix.
345
+
300
346
  if (hasUnresolvedRefs(props) && remainingTries > 0) {
301
347
  ghQueueMicrotask(() => {
302
348
  this.update(remainingTries - 1);
303
349
  });
304
350
  } else {
305
351
  const newConfig = filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config);
352
+
306
353
  if (!deepEqual(this.config, newConfig)) {
307
354
  this.updateGestureHandler(newConfig);
308
355
  }
309
356
  }
310
357
  }
358
+
311
359
  setNativeProps(updates) {
312
- const mergedProps = {
313
- ...this.props,
360
+ const mergedProps = { ...this.props,
314
361
  ...updates
315
362
  };
316
363
  const newConfig = filterConfig(transformProps ? transformProps(mergedProps) : mergedProps, [...allowedProps, ...customNativeProps], config);
317
364
  this.updateGestureHandler(newConfig);
318
365
  }
366
+
319
367
  render() {
320
368
  var _this$props$testID;
369
+
321
370
  if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {
322
371
  throw new Error(name + ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
323
372
  }
324
- let gestureEventHandler = this.onGestureHandlerEvent;
325
- // Another instance of https://github.com/microsoft/TypeScript/issues/13995
373
+
374
+ let gestureEventHandler = this.onGestureHandlerEvent; // Another instance of https://github.com/microsoft/TypeScript/issues/13995
326
375
 
327
376
  const {
328
377
  onGestureEvent,
329
378
  onGestureHandlerEvent
330
379
  } = this.props;
380
+
331
381
  if (onGestureEvent && typeof onGestureEvent !== 'function') {
332
382
  // If it's not a method it should be an native Animated.event
333
383
  // object. We set it directly as the handler for the view
@@ -335,19 +385,21 @@ export default function createHandler({
335
385
  if (onGestureHandlerEvent) {
336
386
  throw new Error('Nesting touch handlers with native animated driver is not supported yet');
337
387
  }
388
+
338
389
  gestureEventHandler = onGestureEvent;
339
390
  } else {
340
391
  if (onGestureHandlerEvent && typeof onGestureHandlerEvent !== 'function') {
341
392
  throw new Error('Nesting touch handlers with native animated driver is not supported yet');
342
393
  }
343
394
  }
344
- let gestureStateEventHandler = this.onGestureHandlerStateChange;
345
- // Another instance of https://github.com/microsoft/TypeScript/issues/13995
395
+
396
+ let gestureStateEventHandler = this.onGestureHandlerStateChange; // Another instance of https://github.com/microsoft/TypeScript/issues/13995
346
397
 
347
398
  const {
348
399
  onHandlerStateChange,
349
400
  onGestureHandlerStateChange
350
401
  } = this.props;
402
+
351
403
  if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {
352
404
  // If it's not a method it should be an native Animated.event
353
405
  // object. We set it directly as the handler for the view
@@ -355,32 +407,38 @@ export default function createHandler({
355
407
  if (onGestureHandlerStateChange) {
356
408
  throw new Error('Nesting touch handlers with native animated driver is not supported yet');
357
409
  }
410
+
358
411
  gestureStateEventHandler = onHandlerStateChange;
359
412
  } else {
360
413
  if (onGestureHandlerStateChange && typeof onGestureHandlerStateChange !== 'function') {
361
414
  throw new Error('Nesting touch handlers with native animated driver is not supported yet');
362
415
  }
363
416
  }
417
+
364
418
  const events = {
365
419
  onGestureHandlerEvent: this.state.allowTouches ? gestureEventHandler : undefined,
366
420
  onGestureHandlerStateChange: this.state.allowTouches ? gestureStateEventHandler : undefined
367
421
  };
368
422
  this.propsRef.current = events;
369
423
  let child = null;
424
+
370
425
  try {
371
426
  child = React.Children.only(this.props.children);
372
427
  } catch (e) {
373
428
  throw new Error(tagMessage(`${name} got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
374
429
  }
430
+
375
431
  let grandChildren = child.props.children;
432
+
376
433
  if (__DEV__ && child.type && (child.type === 'RNGestureHandlerButton' || child.type.name === 'View' || child.type.displayName === 'View')) {
377
434
  grandChildren = React.Children.toArray(grandChildren);
378
- grandChildren.push(/*#__PURE__*/React.createElement(PressabilityDebugView, {
435
+ grandChildren.push( /*#__PURE__*/React.createElement(PressabilityDebugView, {
379
436
  key: "pressabilityDebugView",
380
437
  color: "mediumspringgreen",
381
438
  hitSlop: child.props.hitSlop
382
439
  }));
383
440
  }
441
+
384
442
  return /*#__PURE__*/React.cloneElement(child, {
385
443
  ref: this.refHandler,
386
444
  collapsable: false,
@@ -393,9 +451,13 @@ export default function createHandler({
393
451
  ...events
394
452
  }, grandChildren);
395
453
  }
454
+
396
455
  }
456
+
397
457
  _defineProperty(Handler, "displayName", name);
458
+
398
459
  _defineProperty(Handler, "contextType", GestureHandlerRootViewContext);
460
+
399
461
  return Handler;
400
462
  }
401
463
  //# sourceMappingURL=createHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","UIManager","DeviceEventEmitter","customDirectEventTypes","RNGestureHandlerModule","State","handlerIDToTag","registerOldGestureHandler","unregisterOldGestureHandler","getNextHandlerTag","filterConfig","scheduleFlushOperations","findNodeHandle","deepEqual","isFabric","isTestEnv","tagMessage","ActionType","PressabilityDebugView","GestureHandlerRootViewContext","ghQueueMicrotask","MountRegistry","UIManagerAny","topGestureHandlerEvent","registrationName","customGHEventsConfigFabricAndroid","topOnGestureHandlerEvent","topOnGestureHandlerStateChange","customGHEventsConfig","onGestureHandlerEvent","onGestureHandlerStateChange","OS","genericDirectEventTypes","UIManagerConstants","_UIManagerAny$getView","_UIManagerAny$getView2","getViewManagerConfig","call","_UIManagerAny$getCons","getConstants","setJSResponder","oldSetJSResponder","clearJSResponder","oldClearJSResponder","tag","blockNativeResponder","handleSetJSResponder","handleClearJSResponder","allowTouches","DEV_ON_ANDROID","__DEV__","addListener","hasUnresolvedRefs","props","extract","refs","Array","isArray","current","some","r","stateToPropMappings","UNDETERMINED","undefined","BEGAN","FAILED","CANCELLED","ACTIVE","END","UNRESOLVED_REFS_RETRY_LIMIT","createHandler","name","allowedProps","config","transformProps","customNativeProps","Handler","Component","constructor","_defineProperty","event","nativeEvent","handlerTag","onGestureEvent","_this$props$onGesture","_this$props","_this$props$onGesture2","_this$props2","onHandlerStateChange","_this$props$onHandler","_this$props3","state","stateEventName","eventHandler","_this$props$onGesture3","_this$props4","node","viewNode","child","Children","only","children","ref","newConfig","createGestureHandler","newViewTag","viewTag","attachGestureHandler","JS_FUNCTION_OLD_API","propsRef","onGestureStateChange","actionType","_this$props5","_this$props6","isGestureHandlerWorklet","isStateChangeHandlerWorklet","isReanimatedHandler","REANIMATED_WORKLET","NATIVE_ANIMATED_EVENT","gestureHandlerWillMount","updateGestureHandler","createRef","isMountedRef","id","Error","componentDidMount","inspectorToggleListener","setState","_","update","displayName","componentDidUpdate","componentWillUnmount","_this$inspectorToggle","remove","dropGestureHandler","handlerID","gestureHandlerWillUnmount","remainingTries","setNativeProps","updates","mergedProps","render","_this$props$testID","context","gestureEventHandler","gestureStateEventHandler","events","e","grandChildren","type","toArray","push","createElement","key","color","hitSlop","cloneElement","refHandler","collapsable","handlerType","enabled","testID"],"sources":["createHandler.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Platform,\n UIManager,\n DeviceEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { customDirectEventTypes } from './customDirectEventTypes';\nimport RNGestureHandlerModule from '../RNGestureHandlerModule';\nimport { State } from '../State';\nimport {\n handlerIDToTag,\n registerOldGestureHandler,\n unregisterOldGestureHandler,\n} from './handlersRegistry';\nimport { getNextHandlerTag } from './getNextHandlerTag';\n\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from './gestureHandlerCommon';\nimport { filterConfig, scheduleFlushOperations } from './utils';\nimport findNodeHandle from '../findNodeHandle';\nimport { ValueOf } from '../typeUtils';\nimport { deepEqual, isFabric, isTestEnv, tagMessage } from '../utils';\nimport { ActionType } from '../ActionType';\nimport { PressabilityDebugView } from './PressabilityDebugView';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\nimport { ghQueueMicrotask } from '../ghQueueMicrotask';\nimport { MountRegistry } from '../mountRegistry';\n\nconst UIManagerAny = UIManager as any;\n\ncustomDirectEventTypes.topGestureHandlerEvent = {\n registrationName: 'onGestureHandlerEvent',\n};\n\nconst customGHEventsConfigFabricAndroid = {\n topOnGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n topOnGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n};\n\nconst customGHEventsConfig = {\n onGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n onGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n\n // When using React Native Gesture Handler for Animated.event with useNativeDriver: true\n // on Android with Fabric enabled, the native part still sends the native events to JS\n // but prefixed with \"top\". We cannot simply rename the events above so they are prefixed\n // with \"top\" instead of \"on\" because in such case Animated.events would not be registered.\n // That's why we need to register another pair of event names.\n // The incoming events will be queued but never handled.\n // Without this piece of code below, you'll get the following JS error:\n // Unsupported top level event type \"topOnGestureHandlerEvent\" dispatched\n ...(isFabric() &&\n Platform.OS === 'android' &&\n customGHEventsConfigFabricAndroid),\n};\n\n// Add gesture specific events to genericDirectEventTypes object exported from UIManager\n// native module.\n// Once new event types are registered with react it is possible to dispatch these\n// events to all kind of native views.\nUIManagerAny.genericDirectEventTypes = {\n ...UIManagerAny.genericDirectEventTypes,\n ...customGHEventsConfig,\n};\n// In newer versions of RN the `genericDirectEventTypes` is located in the object\n// returned by UIManager.getViewManagerConfig('getConstants') or in older RN UIManager.getConstants(), we need to add it there as well to make\n// it compatible with RN 61+\nconst UIManagerConstants =\n UIManagerAny.getViewManagerConfig?.('getConstants') ??\n UIManagerAny.getConstants?.();\n\nif (UIManagerConstants) {\n UIManagerConstants.genericDirectEventTypes = {\n ...UIManagerConstants.genericDirectEventTypes,\n ...customGHEventsConfig,\n };\n}\n\n// Wrap JS responder calls and notify gesture handler manager\nconst {\n setJSResponder: oldSetJSResponder = () => {\n // no-op\n },\n clearJSResponder: oldClearJSResponder = () => {\n // no-op\n },\n} = UIManagerAny;\nUIManagerAny.setJSResponder = (tag: number, blockNativeResponder: boolean) => {\n RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);\n oldSetJSResponder(tag, blockNativeResponder);\n};\nUIManagerAny.clearJSResponder = () => {\n RNGestureHandlerModule.handleClearJSResponder();\n oldClearJSResponder();\n};\n\nlet allowTouches = true;\nconst DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android';\n// Toggled inspector blocks touch events in order to allow inspecting on Android\n// This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component\nif (DEV_ON_ANDROID) {\n DeviceEventEmitter.addListener('toggleElementInspector', () => {\n allowTouches = !allowTouches;\n });\n}\n\ntype HandlerProps<T extends Record<string, unknown>> = Readonly<\n React.PropsWithChildren<BaseGestureHandlerProps<T>>\n>;\nfunction hasUnresolvedRefs<T extends Record<string, unknown>>(\n props: HandlerProps<T>\n) {\n // TODO(TS) - add type for extract arg\n const extract = (refs: any | any[]) => {\n if (!Array.isArray(refs)) {\n return refs && refs.current === null;\n }\n return refs.some((r) => r && r.current === null);\n };\n return extract(props['simultaneousHandlers']) || extract(props['waitFor']);\n}\n\nconst stateToPropMappings = {\n [State.UNDETERMINED]: undefined,\n [State.BEGAN]: 'onBegan',\n [State.FAILED]: 'onFailed',\n [State.CANCELLED]: 'onCancelled',\n [State.ACTIVE]: 'onActivated',\n [State.END]: 'onEnded',\n} as const;\n\ntype CreateHandlerArgs<HandlerPropsT extends Record<string, unknown>> =\n Readonly<{\n name: string;\n allowedProps: Readonly<Extract<keyof HandlerPropsT, string>[]>;\n config: Readonly<Record<string, unknown>>;\n transformProps?: (props: HandlerPropsT) => HandlerPropsT;\n customNativeProps?: Readonly<string[]>;\n }>;\n\n// TODO(TS) fix event types\ntype InternalEventHandlers = {\n onGestureHandlerEvent?: (event: any) => void;\n onGestureHandlerStateChange?: (event: any) => void;\n};\n\ntype AttachGestureHandlerWeb = (\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n) => void;\n\nconst UNRESOLVED_REFS_RETRY_LIMIT = 1;\n\n// TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.\nexport default function createHandler<\n T extends BaseGestureHandlerProps<U>,\n U extends Record<string, unknown>,\n>({\n name,\n allowedProps = [],\n config = {},\n transformProps,\n customNativeProps = [],\n}: CreateHandlerArgs<T>): React.ComponentType<T & React.RefAttributes<any>> {\n interface HandlerState {\n allowTouches: boolean;\n }\n class Handler extends React.Component<\n T & InternalEventHandlers,\n HandlerState\n > {\n static displayName = name;\n static contextType = GestureHandlerRootViewContext;\n\n private handlerTag: number;\n private config: Record<string, unknown>;\n private propsRef: React.MutableRefObject<unknown>;\n private isMountedRef: React.MutableRefObject<boolean | null>;\n private viewNode: any;\n private viewTag?: number;\n private inspectorToggleListener?: EmitterSubscription;\n\n constructor(props: T & InternalEventHandlers) {\n super(props);\n this.handlerTag = getNextHandlerTag();\n this.config = {};\n this.propsRef = React.createRef();\n this.isMountedRef = React.createRef();\n this.state = { allowTouches };\n if (props.id) {\n if (handlerIDToTag[props.id] !== undefined) {\n throw new Error(`Handler with ID \"${props.id}\" already registered`);\n }\n handlerIDToTag[props.id] = this.handlerTag;\n }\n }\n\n componentDidMount() {\n const props: HandlerProps<U> = this.props;\n this.isMountedRef.current = true;\n\n if (DEV_ON_ANDROID) {\n this.inspectorToggleListener = DeviceEventEmitter.addListener(\n 'toggleElementInspector',\n () => {\n this.setState((_) => ({ allowTouches }));\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n );\n }\n if (hasUnresolvedRefs(props)) {\n // If there are unresolved refs (e.g. \".current\" has not yet been set)\n // passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to\n // _update method that will try to update native handler props using\n // queueMicrotask. This makes it so update() function gets called after all\n // react components are mounted and we expect the missing ref object to\n // be resolved by then.\n ghQueueMicrotask(() => {\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n });\n }\n\n this.createGestureHandler(\n filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n )\n );\n\n if (!this.viewNode) {\n throw new Error(\n `[Gesture Handler] Failed to obtain view for ${Handler.displayName}. Note that old API doesn't support functional components.`\n );\n }\n\n this.attachGestureHandler(findNodeHandle(this.viewNode) as number); // TODO(TS) - check if this can be null\n }\n\n componentDidUpdate() {\n const viewTag = findNodeHandle(this.viewNode);\n if (this.viewTag !== viewTag) {\n this.attachGestureHandler(viewTag as number); // TODO(TS) - check interaction between _viewTag & findNodeHandle\n }\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n\n componentWillUnmount() {\n this.inspectorToggleListener?.remove();\n this.isMountedRef.current = false;\n if (Platform.OS !== 'web') {\n unregisterOldGestureHandler(this.handlerTag);\n }\n RNGestureHandlerModule.dropGestureHandler(this.handlerTag);\n scheduleFlushOperations();\n // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context\n const handlerID: string | undefined = this.props.id;\n if (handlerID) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete handlerIDToTag[handlerID];\n }\n\n MountRegistry.gestureHandlerWillUnmount(this);\n }\n\n private onGestureHandlerEvent = (event: GestureEvent<U>) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onGestureEvent === 'function') {\n this.props.onGestureEvent?.(event);\n }\n } else {\n this.props.onGestureHandlerEvent?.(event);\n }\n };\n\n // TODO(TS) - make sure this is right type for event\n private onGestureHandlerStateChange = (\n event: HandlerStateChangeEvent<U>\n ) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onHandlerStateChange === 'function') {\n this.props.onHandlerStateChange?.(event);\n }\n\n const state: ValueOf<typeof State> = event.nativeEvent.state;\n const stateEventName = stateToPropMappings[state];\n const eventHandler = stateEventName && this.props[stateEventName];\n if (eventHandler && typeof eventHandler === 'function') {\n eventHandler(event);\n }\n } else {\n this.props.onGestureHandlerStateChange?.(event);\n }\n };\n\n private refHandler = (node: any) => {\n this.viewNode = node;\n\n const child = React.Children.only(this.props.children);\n // TODO(TS) fix ref type\n const { ref }: any = child;\n if (ref !== null) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n }\n };\n\n private createGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.config = newConfig;\n\n RNGestureHandlerModule.createGestureHandler(\n name,\n this.handlerTag,\n newConfig\n );\n };\n\n private attachGestureHandler = (newViewTag: number) => {\n this.viewTag = newViewTag;\n\n if (Platform.OS === 'web') {\n // Typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch\n (\n RNGestureHandlerModule.attachGestureHandler as AttachGestureHandlerWeb\n )(\n this.handlerTag,\n newViewTag,\n ActionType.JS_FUNCTION_OLD_API, // ignored on web\n this.propsRef\n );\n } else {\n registerOldGestureHandler(this.handlerTag, {\n onGestureEvent: this.onGestureHandlerEvent,\n onGestureStateChange: this.onGestureHandlerStateChange,\n });\n\n const actionType = (() => {\n const onGestureEvent = this.props?.onGestureEvent;\n const isGestureHandlerWorklet =\n onGestureEvent &&\n ('current' in onGestureEvent ||\n 'workletEventHandler' in onGestureEvent);\n const onHandlerStateChange = this.props?.onHandlerStateChange;\n const isStateChangeHandlerWorklet =\n onHandlerStateChange &&\n ('current' in onHandlerStateChange ||\n 'workletEventHandler' in onHandlerStateChange);\n const isReanimatedHandler =\n isGestureHandlerWorklet || isStateChangeHandlerWorklet;\n if (isReanimatedHandler) {\n // Reanimated worklet\n return ActionType.REANIMATED_WORKLET;\n } else if (onGestureEvent && '__isNative' in onGestureEvent) {\n // Animated.event with useNativeDriver: true\n return ActionType.NATIVE_ANIMATED_EVENT;\n } else {\n // JS callback or Animated.event with useNativeDriver: false\n return ActionType.JS_FUNCTION_OLD_API;\n }\n })();\n\n RNGestureHandlerModule.attachGestureHandler(\n this.handlerTag,\n newViewTag,\n actionType\n );\n }\n\n scheduleFlushOperations();\n\n ghQueueMicrotask(() => {\n MountRegistry.gestureHandlerWillMount(this);\n });\n };\n\n private updateGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.config = newConfig;\n\n RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);\n scheduleFlushOperations();\n };\n\n private update(remainingTries: number) {\n if (!this.isMountedRef.current) {\n return;\n }\n\n const props: HandlerProps<U> = this.props;\n\n // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of\n // `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying\n // again is easy enough fix.\n if (hasUnresolvedRefs(props) && remainingTries > 0) {\n ghQueueMicrotask(() => {\n this.update(remainingTries - 1);\n });\n } else {\n const newConfig = filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n );\n if (!deepEqual(this.config, newConfig)) {\n this.updateGestureHandler(newConfig);\n }\n }\n }\n\n setNativeProps(updates: any) {\n const mergedProps = { ...this.props, ...updates };\n const newConfig = filterConfig(\n transformProps ? transformProps(mergedProps) : mergedProps,\n [...allowedProps, ...customNativeProps],\n config\n );\n this.updateGestureHandler(newConfig);\n }\n\n render() {\n if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n name +\n ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n let gestureEventHandler = this.onGestureHandlerEvent;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureEventHandlers = {\n onGestureEvent?: BaseGestureHandlerProps<U>['onGestureEvent'];\n onGestureHandlerEvent?: InternalEventHandlers['onGestureHandlerEvent'];\n };\n const { onGestureEvent, onGestureHandlerEvent }: OnGestureEventHandlers =\n this.props;\n if (onGestureEvent && typeof onGestureEvent !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerEvent) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureEventHandler = onGestureEvent;\n } else {\n if (\n onGestureHandlerEvent &&\n typeof onGestureHandlerEvent !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n\n let gestureStateEventHandler = this.onGestureHandlerStateChange;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureStateChangeHandlers = {\n onHandlerStateChange?: BaseGestureHandlerProps<U>['onHandlerStateChange'];\n onGestureHandlerStateChange?: InternalEventHandlers['onGestureHandlerStateChange'];\n };\n const {\n onHandlerStateChange,\n onGestureHandlerStateChange,\n }: OnGestureStateChangeHandlers = this.props;\n if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerStateChange) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureStateEventHandler = onHandlerStateChange;\n } else {\n if (\n onGestureHandlerStateChange &&\n typeof onGestureHandlerStateChange !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n const events = {\n onGestureHandlerEvent: this.state.allowTouches\n ? gestureEventHandler\n : undefined,\n onGestureHandlerStateChange: this.state.allowTouches\n ? gestureStateEventHandler\n : undefined,\n };\n\n this.propsRef.current = events;\n\n let child: any = null;\n try {\n child = React.Children.only(this.props.children);\n } catch (e) {\n throw new Error(\n tagMessage(\n `${name} got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n\n let grandChildren = child.props.children;\n if (\n __DEV__ &&\n child.type &&\n (child.type === 'RNGestureHandlerButton' ||\n child.type.name === 'View' ||\n child.type.displayName === 'View')\n ) {\n grandChildren = React.Children.toArray(grandChildren);\n grandChildren.push(\n <PressabilityDebugView\n key=\"pressabilityDebugView\"\n color=\"mediumspringgreen\"\n hitSlop={child.props.hitSlop}\n />\n );\n }\n\n return React.cloneElement(\n child,\n {\n ref: this.refHandler,\n collapsable: false,\n ...(isTestEnv()\n ? {\n handlerType: name,\n handlerTag: this.handlerTag,\n enabled: this.props.enabled,\n }\n : {}),\n testID: this.props.testID ?? child.props.testID,\n ...events,\n },\n grandChildren\n );\n }\n }\n return Handler;\n}\n"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,SAAS,EACTC,kBAAkB,QAEb,cAAc;AACrB,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,OAAOC,sBAAsB,MAAM,2BAA2B;AAC9D,SAASC,KAAK,QAAQ,UAAU;AAChC,SACEC,cAAc,EACdC,yBAAyB,EACzBC,2BAA2B,QACtB,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,qBAAqB;AAOvD,SAASC,YAAY,EAAEC,uBAAuB,QAAQ,SAAS;AAC/D,OAAOC,cAAc,MAAM,mBAAmB;AAE9C,SAASC,SAAS,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,UAAU;AACrE,SAASC,UAAU,QAAQ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,CAACF,aAAa,CAAC;QACrDA,aAAa,CAACG,IAAI,cAChBzJ,KAAA,CAAA0J,aAAA,CAACvI,qBAAqB;UACpBwI,GAAG,EAAC,uBAAuB;UAC3BC,KAAK,EAAC,mBAAmB;UACzBC,OAAO,EAAE1D,KAAK,CAAC7C,KAAK,CAACuG;QAAQ,CAC9B,CACH,CAAC;MACH;MAEA,oBAAO7J,KAAK,CAAC8J,YAAY,CACvB3D,KAAK,EACL;QACEI,GAAG,EAAE,IAAI,CAACwD,UAAU;QACpBC,WAAW,EAAE,KAAK;QAClB,IAAIhJ,SAAS,CAAC,CAAC,GACX;UACEiJ,WAAW,EAAEzF,IAAI;UACjBW,UAAU,EAAE,IAAI,CAACA,UAAU;UAC3B+E,OAAO,EAAE,IAAI,CAAC5G,KAAK,CAAC4G;QACtB,CAAC,GACD,CAAC,CAAC,CAAC;QACPC,MAAM,GAAAnB,kBAAA,GAAE,IAAI,CAAC1F,KAAK,CAAC6G,MAAM,cAAAnB,kBAAA,cAAAA,kBAAA,GAAI7C,KAAK,CAAC7C,KAAK,CAAC6G,MAAM;QAC/C,GAAGf;MACL,CAAC,EACDE,aACF,CAAC;IACH;EACF;EAACtE,eAAA,CA/XKH,OAAO,iBAIUL,IAAI;EAAAQ,eAAA,CAJrBH,OAAO,iBAKUzD,6BAA6B;EA2XpD,OAAOyD,OAAO;AAChB","ignoreList":[]}
1
+ {"version":3,"sources":["createHandler.tsx"],"names":["React","Platform","UIManager","DeviceEventEmitter","customDirectEventTypes","RNGestureHandlerModule","State","handlerIDToTag","registerOldGestureHandler","unregisterOldGestureHandler","getNextHandlerTag","filterConfig","scheduleFlushOperations","findNodeHandle","deepEqual","isFabric","isReact19","isTestEnv","tagMessage","ActionType","PressabilityDebugView","GestureHandlerRootViewContext","ghQueueMicrotask","MountRegistry","UIManagerAny","topGestureHandlerEvent","registrationName","customGHEventsConfigFabricAndroid","topOnGestureHandlerEvent","topOnGestureHandlerStateChange","customGHEventsConfig","onGestureHandlerEvent","onGestureHandlerStateChange","OS","genericDirectEventTypes","UIManagerConstants","getViewManagerConfig","getConstants","setJSResponder","oldSetJSResponder","clearJSResponder","oldClearJSResponder","tag","blockNativeResponder","handleSetJSResponder","handleClearJSResponder","allowTouches","DEV_ON_ANDROID","__DEV__","addListener","hasUnresolvedRefs","props","extract","refs","Array","isArray","current","some","r","stateToPropMappings","UNDETERMINED","undefined","BEGAN","FAILED","CANCELLED","ACTIVE","END","UNRESOLVED_REFS_RETRY_LIMIT","createHandler","name","allowedProps","config","transformProps","customNativeProps","Handler","Component","constructor","event","nativeEvent","handlerTag","onGestureEvent","onHandlerStateChange","state","stateEventName","eventHandler","node","viewNode","child","Children","only","children","ref","newConfig","createGestureHandler","newViewTag","viewTag","attachGestureHandler","JS_FUNCTION_OLD_API","propsRef","onGestureStateChange","actionType","isGestureHandlerWorklet","isStateChangeHandlerWorklet","isReanimatedHandler","REANIMATED_WORKLET","NATIVE_ANIMATED_EVENT","gestureHandlerWillMount","updateGestureHandler","createRef","isMountedRef","id","Error","componentDidMount","inspectorToggleListener","setState","_","update","displayName","componentDidUpdate","componentWillUnmount","remove","dropGestureHandler","handlerID","gestureHandlerWillUnmount","remainingTries","setNativeProps","updates","mergedProps","render","context","gestureEventHandler","gestureStateEventHandler","events","e","grandChildren","type","toArray","push","hitSlop","cloneElement","refHandler","collapsable","handlerType","enabled","testID"],"mappings":";;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,SAFF,EAGEC,kBAHF,QAKO,cALP;AAMA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,OAAOC,sBAAP,MAAmC,2BAAnC;AACA,SAASC,KAAT,QAAsB,UAAtB;AACA,SACEC,cADF,EAEEC,yBAFF,EAGEC,2BAHF,QAIO,oBAJP;AAKA,SAASC,iBAAT,QAAkC,qBAAlC;AAOA,SAASC,YAAT,EAAuBC,uBAAvB,QAAsD,SAAtD;AACA,OAAOC,cAAP,MAA2B,mBAA3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WAAGZ;AAXL,OAFK,EAeLE,aAfK,CAAP;AAiBD;;AA/XD;;AAPwE,kBAIpE5D,OAJoE,iBAQnDL,IARmD;;AAAA,kBAIpEK,OAJoE,iBASnDrD,6BATmD;;AAwY1E,SAAOqD,OAAP;AACD","sourcesContent":["import * as React from 'react';\nimport {\n Platform,\n UIManager,\n DeviceEventEmitter,\n EmitterSubscription,\n} from 'react-native';\nimport { customDirectEventTypes } from './customDirectEventTypes';\nimport RNGestureHandlerModule from '../RNGestureHandlerModule';\nimport { State } from '../State';\nimport {\n handlerIDToTag,\n registerOldGestureHandler,\n unregisterOldGestureHandler,\n} from './handlersRegistry';\nimport { getNextHandlerTag } from './getNextHandlerTag';\n\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from './gestureHandlerCommon';\nimport { filterConfig, scheduleFlushOperations } from './utils';\nimport findNodeHandle from '../findNodeHandle';\nimport { ValueOf } from '../typeUtils';\nimport {\n deepEqual,\n isFabric,\n isReact19,\n isTestEnv,\n tagMessage,\n} from '../utils';\nimport { ActionType } from '../ActionType';\nimport { PressabilityDebugView } from './PressabilityDebugView';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\nimport { ghQueueMicrotask } from '../ghQueueMicrotask';\nimport { MountRegistry } from '../mountRegistry';\nimport { ReactElement } from 'react';\n\nconst UIManagerAny = UIManager as any;\n\ncustomDirectEventTypes.topGestureHandlerEvent = {\n registrationName: 'onGestureHandlerEvent',\n};\n\nconst customGHEventsConfigFabricAndroid = {\n topOnGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n topOnGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n};\n\nconst customGHEventsConfig = {\n onGestureHandlerEvent: { registrationName: 'onGestureHandlerEvent' },\n onGestureHandlerStateChange: {\n registrationName: 'onGestureHandlerStateChange',\n },\n\n // When using React Native Gesture Handler for Animated.event with useNativeDriver: true\n // on Android with Fabric enabled, the native part still sends the native events to JS\n // but prefixed with \"top\". We cannot simply rename the events above so they are prefixed\n // with \"top\" instead of \"on\" because in such case Animated.events would not be registered.\n // That's why we need to register another pair of event names.\n // The incoming events will be queued but never handled.\n // Without this piece of code below, you'll get the following JS error:\n // Unsupported top level event type \"topOnGestureHandlerEvent\" dispatched\n ...(isFabric() &&\n Platform.OS === 'android' &&\n customGHEventsConfigFabricAndroid),\n};\n\n// Add gesture specific events to genericDirectEventTypes object exported from UIManager\n// native module.\n// Once new event types are registered with react it is possible to dispatch these\n// events to all kind of native views.\nUIManagerAny.genericDirectEventTypes = {\n ...UIManagerAny.genericDirectEventTypes,\n ...customGHEventsConfig,\n};\n// In newer versions of RN the `genericDirectEventTypes` is located in the object\n// returned by UIManager.getViewManagerConfig('getConstants') or in older RN UIManager.getConstants(), we need to add it there as well to make\n// it compatible with RN 61+\nconst UIManagerConstants =\n UIManagerAny.getViewManagerConfig?.('getConstants') ??\n UIManagerAny.getConstants?.();\n\nif (UIManagerConstants) {\n UIManagerConstants.genericDirectEventTypes = {\n ...UIManagerConstants.genericDirectEventTypes,\n ...customGHEventsConfig,\n };\n}\n\n// Wrap JS responder calls and notify gesture handler manager\nconst {\n setJSResponder: oldSetJSResponder = () => {\n // no-op\n },\n clearJSResponder: oldClearJSResponder = () => {\n // no-op\n },\n} = UIManagerAny;\nUIManagerAny.setJSResponder = (tag: number, blockNativeResponder: boolean) => {\n RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);\n oldSetJSResponder(tag, blockNativeResponder);\n};\nUIManagerAny.clearJSResponder = () => {\n RNGestureHandlerModule.handleClearJSResponder();\n oldClearJSResponder();\n};\n\nlet allowTouches = true;\nconst DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android';\n// Toggled inspector blocks touch events in order to allow inspecting on Android\n// This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component\nif (DEV_ON_ANDROID) {\n DeviceEventEmitter.addListener('toggleElementInspector', () => {\n allowTouches = !allowTouches;\n });\n}\n\ntype HandlerProps<T extends Record<string, unknown>> = Readonly<\n React.PropsWithChildren<BaseGestureHandlerProps<T>>\n>;\nfunction hasUnresolvedRefs<T extends Record<string, unknown>>(\n props: HandlerProps<T>\n) {\n // TODO(TS) - add type for extract arg\n const extract = (refs: any | any[]) => {\n if (!Array.isArray(refs)) {\n return refs && refs.current === null;\n }\n return refs.some((r) => r && r.current === null);\n };\n return extract(props['simultaneousHandlers']) || extract(props['waitFor']);\n}\n\nconst stateToPropMappings = {\n [State.UNDETERMINED]: undefined,\n [State.BEGAN]: 'onBegan',\n [State.FAILED]: 'onFailed',\n [State.CANCELLED]: 'onCancelled',\n [State.ACTIVE]: 'onActivated',\n [State.END]: 'onEnded',\n} as const;\n\ntype CreateHandlerArgs<HandlerPropsT extends Record<string, unknown>> =\n Readonly<{\n name: string;\n allowedProps: Readonly<Extract<keyof HandlerPropsT, string>[]>;\n config: Readonly<Record<string, unknown>>;\n transformProps?: (props: HandlerPropsT) => HandlerPropsT;\n customNativeProps?: Readonly<string[]>;\n }>;\n\n// TODO(TS) fix event types\ntype InternalEventHandlers = {\n onGestureHandlerEvent?: (event: any) => void;\n onGestureHandlerStateChange?: (event: any) => void;\n};\n\ntype AttachGestureHandlerWeb = (\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n) => void;\n\nconst UNRESOLVED_REFS_RETRY_LIMIT = 1;\n\n// TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.\nexport default function createHandler<\n T extends BaseGestureHandlerProps<U>,\n U extends Record<string, unknown>,\n>({\n name,\n allowedProps = [],\n config = {},\n transformProps,\n customNativeProps = [],\n}: CreateHandlerArgs<T>): React.ComponentType<T & React.RefAttributes<any>> {\n interface HandlerState {\n allowTouches: boolean;\n }\n class Handler extends React.Component<\n T & InternalEventHandlers,\n HandlerState\n > {\n static displayName = name;\n static contextType = GestureHandlerRootViewContext;\n\n private handlerTag: number;\n private config: Record<string, unknown>;\n private propsRef: React.MutableRefObject<unknown>;\n private isMountedRef: React.MutableRefObject<boolean | null>;\n private viewNode: any;\n private viewTag?: number;\n private inspectorToggleListener?: EmitterSubscription;\n\n constructor(props: T & InternalEventHandlers) {\n super(props);\n this.handlerTag = getNextHandlerTag();\n this.config = {};\n this.propsRef = React.createRef();\n this.isMountedRef = React.createRef();\n this.state = { allowTouches };\n if (props.id) {\n if (handlerIDToTag[props.id] !== undefined) {\n throw new Error(`Handler with ID \"${props.id}\" already registered`);\n }\n handlerIDToTag[props.id] = this.handlerTag;\n }\n }\n\n componentDidMount() {\n const props: HandlerProps<U> = this.props;\n this.isMountedRef.current = true;\n\n if (DEV_ON_ANDROID) {\n this.inspectorToggleListener = DeviceEventEmitter.addListener(\n 'toggleElementInspector',\n () => {\n this.setState((_) => ({ allowTouches }));\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n );\n }\n if (hasUnresolvedRefs(props)) {\n // If there are unresolved refs (e.g. \".current\" has not yet been set)\n // passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to\n // _update method that will try to update native handler props using\n // queueMicrotask. This makes it so update() function gets called after all\n // react components are mounted and we expect the missing ref object to\n // be resolved by then.\n ghQueueMicrotask(() => {\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n });\n }\n\n this.createGestureHandler(\n filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n )\n );\n\n if (!this.viewNode) {\n throw new Error(\n `[Gesture Handler] Failed to obtain view for ${Handler.displayName}. Note that old API doesn't support functional components.`\n );\n }\n\n this.attachGestureHandler(findNodeHandle(this.viewNode) as number); // TODO(TS) - check if this can be null\n }\n\n componentDidUpdate() {\n const viewTag = findNodeHandle(this.viewNode);\n if (this.viewTag !== viewTag) {\n this.attachGestureHandler(viewTag as number); // TODO(TS) - check interaction between _viewTag & findNodeHandle\n }\n this.update(UNRESOLVED_REFS_RETRY_LIMIT);\n }\n\n componentWillUnmount() {\n this.inspectorToggleListener?.remove();\n this.isMountedRef.current = false;\n if (Platform.OS !== 'web') {\n unregisterOldGestureHandler(this.handlerTag);\n }\n RNGestureHandlerModule.dropGestureHandler(this.handlerTag);\n scheduleFlushOperations();\n // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context\n const handlerID: string | undefined = this.props.id;\n if (handlerID) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete handlerIDToTag[handlerID];\n }\n\n MountRegistry.gestureHandlerWillUnmount(this);\n }\n\n private onGestureHandlerEvent = (event: GestureEvent<U>) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onGestureEvent === 'function') {\n this.props.onGestureEvent?.(event);\n }\n } else {\n this.props.onGestureHandlerEvent?.(event);\n }\n };\n\n // TODO(TS) - make sure this is right type for event\n private onGestureHandlerStateChange = (\n event: HandlerStateChangeEvent<U>\n ) => {\n if (event.nativeEvent.handlerTag === this.handlerTag) {\n if (typeof this.props.onHandlerStateChange === 'function') {\n this.props.onHandlerStateChange?.(event);\n }\n\n const state: ValueOf<typeof State> = event.nativeEvent.state;\n const stateEventName = stateToPropMappings[state];\n const eventHandler = stateEventName && this.props[stateEventName];\n if (eventHandler && typeof eventHandler === 'function') {\n eventHandler(event);\n }\n } else {\n this.props.onGestureHandlerStateChange?.(event);\n }\n };\n\n private refHandler = (node: any) => {\n this.viewNode = node;\n\n const child = React.Children.only(this.props.children);\n // @ts-ignore Since React 19 ref is accessible as standard prop\n // https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref\n const ref = isReact19() ? (child as ReactElement).props?.ref : child?.ref;\n\n if (!ref) {\n return;\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n };\n\n private createGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.config = newConfig;\n\n RNGestureHandlerModule.createGestureHandler(\n name,\n this.handlerTag,\n newConfig\n );\n };\n\n private attachGestureHandler = (newViewTag: number) => {\n this.viewTag = newViewTag;\n\n if (Platform.OS === 'web') {\n // Typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch\n (\n RNGestureHandlerModule.attachGestureHandler as AttachGestureHandlerWeb\n )(\n this.handlerTag,\n newViewTag,\n ActionType.JS_FUNCTION_OLD_API, // ignored on web\n this.propsRef\n );\n } else {\n registerOldGestureHandler(this.handlerTag, {\n onGestureEvent: this.onGestureHandlerEvent,\n onGestureStateChange: this.onGestureHandlerStateChange,\n });\n\n const actionType = (() => {\n const onGestureEvent = this.props?.onGestureEvent;\n const isGestureHandlerWorklet =\n onGestureEvent &&\n ('current' in onGestureEvent ||\n 'workletEventHandler' in onGestureEvent);\n const onHandlerStateChange = this.props?.onHandlerStateChange;\n const isStateChangeHandlerWorklet =\n onHandlerStateChange &&\n ('current' in onHandlerStateChange ||\n 'workletEventHandler' in onHandlerStateChange);\n const isReanimatedHandler =\n isGestureHandlerWorklet || isStateChangeHandlerWorklet;\n if (isReanimatedHandler) {\n // Reanimated worklet\n return ActionType.REANIMATED_WORKLET;\n } else if (onGestureEvent && '__isNative' in onGestureEvent) {\n // Animated.event with useNativeDriver: true\n return ActionType.NATIVE_ANIMATED_EVENT;\n } else {\n // JS callback or Animated.event with useNativeDriver: false\n return ActionType.JS_FUNCTION_OLD_API;\n }\n })();\n\n RNGestureHandlerModule.attachGestureHandler(\n this.handlerTag,\n newViewTag,\n actionType\n );\n }\n\n scheduleFlushOperations();\n\n ghQueueMicrotask(() => {\n MountRegistry.gestureHandlerWillMount(this);\n });\n };\n\n private updateGestureHandler = (\n newConfig: Readonly<Record<string, unknown>>\n ) => {\n this.config = newConfig;\n\n RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);\n scheduleFlushOperations();\n };\n\n private update(remainingTries: number) {\n if (!this.isMountedRef.current) {\n return;\n }\n\n const props: HandlerProps<U> = this.props;\n\n // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of\n // `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying\n // again is easy enough fix.\n if (hasUnresolvedRefs(props) && remainingTries > 0) {\n ghQueueMicrotask(() => {\n this.update(remainingTries - 1);\n });\n } else {\n const newConfig = filterConfig(\n transformProps ? transformProps(this.props) : this.props,\n [...allowedProps, ...customNativeProps],\n config\n );\n if (!deepEqual(this.config, newConfig)) {\n this.updateGestureHandler(newConfig);\n }\n }\n }\n\n setNativeProps(updates: any) {\n const mergedProps = { ...this.props, ...updates };\n const newConfig = filterConfig(\n transformProps ? transformProps(mergedProps) : mergedProps,\n [...allowedProps, ...customNativeProps],\n config\n );\n this.updateGestureHandler(newConfig);\n }\n\n render() {\n if (__DEV__ && !this.context && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n name +\n ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n let gestureEventHandler = this.onGestureHandlerEvent;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureEventHandlers = {\n onGestureEvent?: BaseGestureHandlerProps<U>['onGestureEvent'];\n onGestureHandlerEvent?: InternalEventHandlers['onGestureHandlerEvent'];\n };\n const { onGestureEvent, onGestureHandlerEvent }: OnGestureEventHandlers =\n this.props;\n if (onGestureEvent && typeof onGestureEvent !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerEvent) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureEventHandler = onGestureEvent;\n } else {\n if (\n onGestureHandlerEvent &&\n typeof onGestureHandlerEvent !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n\n let gestureStateEventHandler = this.onGestureHandlerStateChange;\n // Another instance of https://github.com/microsoft/TypeScript/issues/13995\n type OnGestureStateChangeHandlers = {\n onHandlerStateChange?: BaseGestureHandlerProps<U>['onHandlerStateChange'];\n onGestureHandlerStateChange?: InternalEventHandlers['onGestureHandlerStateChange'];\n };\n const {\n onHandlerStateChange,\n onGestureHandlerStateChange,\n }: OnGestureStateChangeHandlers = this.props;\n if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {\n // If it's not a method it should be an native Animated.event\n // object. We set it directly as the handler for the view\n // In this case nested handlers are not going to be supported\n if (onGestureHandlerStateChange) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n gestureStateEventHandler = onHandlerStateChange;\n } else {\n if (\n onGestureHandlerStateChange &&\n typeof onGestureHandlerStateChange !== 'function'\n ) {\n throw new Error(\n 'Nesting touch handlers with native animated driver is not supported yet'\n );\n }\n }\n const events = {\n onGestureHandlerEvent: this.state.allowTouches\n ? gestureEventHandler\n : undefined,\n onGestureHandlerStateChange: this.state.allowTouches\n ? gestureStateEventHandler\n : undefined,\n };\n\n this.propsRef.current = events;\n\n let child: any = null;\n try {\n child = React.Children.only(this.props.children);\n } catch (e) {\n throw new Error(\n tagMessage(\n `${name} got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n\n let grandChildren = child.props.children;\n if (\n __DEV__ &&\n child.type &&\n (child.type === 'RNGestureHandlerButton' ||\n child.type.name === 'View' ||\n child.type.displayName === 'View')\n ) {\n grandChildren = React.Children.toArray(grandChildren);\n grandChildren.push(\n <PressabilityDebugView\n key=\"pressabilityDebugView\"\n color=\"mediumspringgreen\"\n hitSlop={child.props.hitSlop}\n />\n );\n }\n\n return React.cloneElement(\n child,\n {\n ref: this.refHandler,\n collapsable: false,\n ...(isTestEnv()\n ? {\n handlerType: name,\n handlerTag: this.handlerTag,\n enabled: this.props.enabled,\n }\n : {}),\n testID: this.props.testID ?? child.props.testID,\n ...events,\n },\n grandChildren\n );\n }\n }\n return Handler;\n}\n"]}