@amazon-devices/react-native-gesture-handler 2.0.1758683737

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 (848) hide show
  1. package/DrawerLayout/package.json +6 -0
  2. package/LICENSE +7 -0
  3. package/README.kepler.md +167 -0
  4. package/RNGestureHandler.podspec +41 -0
  5. package/Swipeable/package.json +6 -0
  6. package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.bundle +67466 -0
  7. package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.map +1 -0
  8. package/SystemModules/amzn__react-native-gesture-handler-2.modules.txt +338 -0
  9. package/SystemModules/amzn__react-native-gesture-handler-2.private.modules.txt +96 -0
  10. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  11. package/THIRD_PARTY_NOTICES.txt +578 -0
  12. package/android/build.gradle +205 -0
  13. package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
  14. package/android/gradle.properties +19 -0
  15. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
  16. package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
  17. package/android/src/fabric/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
  18. package/android/src/fabric/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -0
  19. package/android/src/main/AndroidManifest.xml +3 -0
  20. package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +21 -0
  21. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +100 -0
  22. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +807 -0
  23. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +8 -0
  24. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +707 -0
  25. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +8 -0
  26. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +47 -0
  27. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
  28. package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +100 -0
  29. package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +11 -0
  30. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +257 -0
  31. package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +9 -0
  32. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +322 -0
  33. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +103 -0
  34. package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +23 -0
  35. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +125 -0
  36. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +93 -0
  37. package/android/src/main/java/com/swmansion/gesturehandler/core/ScaleGestureDetector.java +558 -0
  38. package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +168 -0
  39. package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +10 -0
  40. package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +16 -0
  41. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +419 -0
  42. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +15 -0
  43. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +77 -0
  44. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +8 -0
  45. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +67 -0
  46. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +756 -0
  47. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +100 -0
  48. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +142 -0
  49. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
  50. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +78 -0
  51. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +51 -0
  52. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +72 -0
  53. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
  54. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
  55. package/android/src/main/jni/CMakeLists.txt +25 -0
  56. package/android/src/main/jni/cpp-adapter.cpp +44 -0
  57. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
  58. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
  59. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
  60. package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
  61. package/android/src/paper/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
  62. package/ios/Handlers/RNFlingHandler.h +4 -0
  63. package/ios/Handlers/RNFlingHandler.m +152 -0
  64. package/ios/Handlers/RNForceTouchHandler.h +4 -0
  65. package/ios/Handlers/RNForceTouchHandler.m +175 -0
  66. package/ios/Handlers/RNHoverHandler.h +12 -0
  67. package/ios/Handlers/RNHoverHandler.m +152 -0
  68. package/ios/Handlers/RNLongPressHandler.h +12 -0
  69. package/ios/Handlers/RNLongPressHandler.m +183 -0
  70. package/ios/Handlers/RNManualHandler.h +4 -0
  71. package/ios/Handlers/RNManualHandler.m +88 -0
  72. package/ios/Handlers/RNNativeViewHandler.h +15 -0
  73. package/ios/Handlers/RNNativeViewHandler.mm +193 -0
  74. package/ios/Handlers/RNPanHandler.h +12 -0
  75. package/ios/Handlers/RNPanHandler.m +331 -0
  76. package/ios/Handlers/RNPinchHandler.h +12 -0
  77. package/ios/Handlers/RNPinchHandler.m +95 -0
  78. package/ios/Handlers/RNRotationHandler.h +12 -0
  79. package/ios/Handlers/RNRotationHandler.m +93 -0
  80. package/ios/Handlers/RNTapHandler.h +12 -0
  81. package/ios/Handlers/RNTapHandler.m +265 -0
  82. package/ios/RNGHTouchEventType.h +9 -0
  83. package/ios/RNGestureHandler.h +90 -0
  84. package/ios/RNGestureHandler.m +482 -0
  85. package/ios/RNGestureHandler.xcodeproj/project.pbxproj +690 -0
  86. package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  87. package/ios/RNGestureHandlerActionType.h +10 -0
  88. package/ios/RNGestureHandlerButton.h +19 -0
  89. package/ios/RNGestureHandlerButton.m +77 -0
  90. package/ios/RNGestureHandlerButtonComponentView.h +17 -0
  91. package/ios/RNGestureHandlerButtonComponentView.mm +62 -0
  92. package/ios/RNGestureHandlerButtonManager.h +5 -0
  93. package/ios/RNGestureHandlerButtonManager.m +34 -0
  94. package/ios/RNGestureHandlerDirection.h +8 -0
  95. package/ios/RNGestureHandlerEvents.h +65 -0
  96. package/ios/RNGestureHandlerEvents.m +260 -0
  97. package/ios/RNGestureHandlerManager.h +35 -0
  98. package/ios/RNGestureHandlerManager.mm +367 -0
  99. package/ios/RNGestureHandlerModule.h +7 -0
  100. package/ios/RNGestureHandlerModule.mm +320 -0
  101. package/ios/RNGestureHandlerPointerTracker.h +25 -0
  102. package/ios/RNGestureHandlerPointerTracker.m +243 -0
  103. package/ios/RNGestureHandlerRegistry.h +21 -0
  104. package/ios/RNGestureHandlerRegistry.m +63 -0
  105. package/ios/RNGestureHandlerRootViewComponentView.mm +21 -0
  106. package/ios/RNGestureHandlerState.h +10 -0
  107. package/ios/RNGestureHandlerStateManager.h +5 -0
  108. package/ios/RNManualActivationRecognizer.h +10 -0
  109. package/ios/RNManualActivationRecognizer.m +88 -0
  110. package/ios/RNRootViewGestureRecognizer.h +17 -0
  111. package/ios/RNRootViewGestureRecognizer.m +106 -0
  112. package/jest-utils/package.json +6 -0
  113. package/jestSetup.js +7 -0
  114. package/kepler-compatibility.json +8 -0
  115. package/kepler-transformed-package-info.json +3 -0
  116. package/lib/commonjs/ActionType.js +15 -0
  117. package/lib/commonjs/ActionType.js.map +1 -0
  118. package/lib/commonjs/Directions.js +15 -0
  119. package/lib/commonjs/Directions.js.map +1 -0
  120. package/lib/commonjs/EnableNewWebImplementation.js +29 -0
  121. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
  122. package/lib/commonjs/GestureHandlerRootViewContext.js +10 -0
  123. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
  124. package/lib/commonjs/PlatformConstants.js +10 -0
  125. package/lib/commonjs/PlatformConstants.js.map +1 -0
  126. package/lib/commonjs/PlatformConstants.web.js +12 -0
  127. package/lib/commonjs/PlatformConstants.web.js.map +1 -0
  128. package/lib/commonjs/RNGestureHandlerModule.js +23 -0
  129. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
  130. package/lib/commonjs/RNGestureHandlerModule.kepler.js +33 -0
  131. package/lib/commonjs/RNGestureHandlerModule.kepler.js.map +1 -0
  132. package/lib/commonjs/RNGestureHandlerModule.macos.js +113 -0
  133. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
  134. package/lib/commonjs/RNGestureHandlerModule.web.js +123 -0
  135. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
  136. package/lib/commonjs/RNGestureHandlerModule.windows.js +121 -0
  137. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
  138. package/lib/commonjs/RNRenderer.js +14 -0
  139. package/lib/commonjs/RNRenderer.js.map +1 -0
  140. package/lib/commonjs/RNRenderer.web.js +10 -0
  141. package/lib/commonjs/RNRenderer.web.js.map +1 -0
  142. package/lib/commonjs/State.js +19 -0
  143. package/lib/commonjs/State.js.map +1 -0
  144. package/lib/commonjs/TouchEventType.js +16 -0
  145. package/lib/commonjs/TouchEventType.js.map +1 -0
  146. package/lib/commonjs/components/DrawerLayout.js +512 -0
  147. package/lib/commonjs/components/DrawerLayout.js.map +1 -0
  148. package/lib/commonjs/components/GestureButtons.js +194 -0
  149. package/lib/commonjs/components/GestureButtons.js.map +1 -0
  150. package/lib/commonjs/components/GestureComponents.js +104 -0
  151. package/lib/commonjs/components/GestureComponents.js.map +1 -0
  152. package/lib/commonjs/components/GestureComponents.web.js +38 -0
  153. package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
  154. package/lib/commonjs/components/GestureHandlerButton.js +10 -0
  155. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
  156. package/lib/commonjs/components/GestureHandlerButton.web.js +16 -0
  157. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
  158. package/lib/commonjs/components/GestureHandlerRootView.android.js +23 -0
  159. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
  160. package/lib/commonjs/components/GestureHandlerRootView.js +23 -0
  161. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
  162. package/lib/commonjs/components/GestureHandlerRootView.kepler.js +18 -0
  163. package/lib/commonjs/components/GestureHandlerRootView.kepler.js.map +1 -0
  164. package/lib/commonjs/components/GestureHandlerRootView.web.js +18 -0
  165. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
  166. package/lib/commonjs/components/Swipeable.js +345 -0
  167. package/lib/commonjs/components/Swipeable.js.map +1 -0
  168. package/lib/commonjs/components/gestureHandlerRootHOC.js +31 -0
  169. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
  170. package/lib/commonjs/components/touchables/GenericTouchable.js +253 -0
  171. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
  172. package/lib/commonjs/components/touchables/TouchableHighlight.js +90 -0
  173. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
  174. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +84 -0
  175. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
  176. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +9 -0
  177. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
  178. package/lib/commonjs/components/touchables/TouchableOpacity.js +64 -0
  179. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
  180. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +18 -0
  181. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
  182. package/lib/commonjs/components/touchables/index.js +35 -0
  183. package/lib/commonjs/components/touchables/index.js.map +1 -0
  184. package/lib/commonjs/getShadowNodeFromRef.js +27 -0
  185. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -0
  186. package/lib/commonjs/getShadowNodeFromRef.web.js +14 -0
  187. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
  188. package/lib/commonjs/handlers/FlingGestureHandler.js +18 -0
  189. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
  190. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +37 -0
  191. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
  192. package/lib/commonjs/handlers/LongPressGestureHandler.js +20 -0
  193. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
  194. package/lib/commonjs/handlers/NativeViewGestureHandler.js +19 -0
  195. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
  196. package/lib/commonjs/handlers/PanGestureHandler.js +99 -0
  197. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
  198. package/lib/commonjs/handlers/PinchGestureHandler.js +17 -0
  199. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
  200. package/lib/commonjs/handlers/PressabilityDebugView.js +13 -0
  201. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
  202. package/lib/commonjs/handlers/PressabilityDebugView.web.js +11 -0
  203. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
  204. package/lib/commonjs/handlers/RotationGestureHandler.js +17 -0
  205. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
  206. package/lib/commonjs/handlers/TapGestureHandler.js +20 -0
  207. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
  208. package/lib/commonjs/handlers/createHandler.js +402 -0
  209. package/lib/commonjs/handlers/createHandler.js.map +1 -0
  210. package/lib/commonjs/handlers/createNativeWrapper.js +63 -0
  211. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
  212. package/lib/commonjs/handlers/gestureHandlerCommon.js +86 -0
  213. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
  214. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +6 -0
  215. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -0
  216. package/lib/commonjs/handlers/gestures/GestureDetector.js +548 -0
  217. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
  218. package/lib/commonjs/handlers/gestures/eventReceiver.js +125 -0
  219. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
  220. package/lib/commonjs/handlers/gestures/flingGesture.js +27 -0
  221. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
  222. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +54 -0
  223. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
  224. package/lib/commonjs/handlers/gestures/gesture.js +196 -0
  225. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
  226. package/lib/commonjs/handlers/gestures/gestureComposition.js +90 -0
  227. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
  228. package/lib/commonjs/handlers/gestures/gestureObjects.js +73 -0
  229. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
  230. package/lib/commonjs/handlers/gestures/gestureStateManager.js +60 -0
  231. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
  232. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +27 -0
  233. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
  234. package/lib/commonjs/handlers/gestures/hoverGesture.js +60 -0
  235. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
  236. package/lib/commonjs/handlers/gestures/longPressGesture.js +28 -0
  237. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
  238. package/lib/commonjs/handlers/gestures/manualGesture.js +25 -0
  239. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
  240. package/lib/commonjs/handlers/gestures/nativeGesture.js +27 -0
  241. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
  242. package/lib/commonjs/handlers/gestures/panGesture.js +124 -0
  243. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
  244. package/lib/commonjs/handlers/gestures/pinchGesture.js +38 -0
  245. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
  246. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +30 -0
  247. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
  248. package/lib/commonjs/handlers/gestures/rotationGesture.js +38 -0
  249. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
  250. package/lib/commonjs/handlers/gestures/tapGesture.js +48 -0
  251. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
  252. package/lib/commonjs/handlers/handlersRegistry.js +52 -0
  253. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
  254. package/lib/commonjs/index.js +241 -0
  255. package/lib/commonjs/index.js.map +1 -0
  256. package/lib/commonjs/init.js +25 -0
  257. package/lib/commonjs/init.js.map +1 -0
  258. package/lib/commonjs/jestUtils/index.js +19 -0
  259. package/lib/commonjs/jestUtils/index.js.map +1 -0
  260. package/lib/commonjs/jestUtils/jestUtils.js +312 -0
  261. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
  262. package/lib/commonjs/mocks.js +61 -0
  263. package/lib/commonjs/mocks.js.map +1 -0
  264. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
  265. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  266. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js +20 -0
  267. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
  268. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
  269. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  270. package/lib/commonjs/typeUtils.js +2 -0
  271. package/lib/commonjs/typeUtils.js.map +1 -0
  272. package/lib/commonjs/utils.js +64 -0
  273. package/lib/commonjs/utils.js.map +1 -0
  274. package/lib/commonjs/web/constants.js +14 -0
  275. package/lib/commonjs/web/constants.js.map +1 -0
  276. package/lib/commonjs/web/detectors/RotationGestureDetector.js +129 -0
  277. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
  278. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +127 -0
  279. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
  280. package/lib/commonjs/web/handlers/FlingGestureHandler.js +127 -0
  281. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
  282. package/lib/commonjs/web/handlers/GestureHandler.js +668 -0
  283. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
  284. package/lib/commonjs/web/handlers/HoverGestureHandler.js +48 -0
  285. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
  286. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +119 -0
  287. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
  288. package/lib/commonjs/web/handlers/ManualGestureHandler.js +49 -0
  289. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
  290. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +140 -0
  291. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
  292. package/lib/commonjs/web/handlers/PanGestureHandler.js +347 -0
  293. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
  294. package/lib/commonjs/web/handlers/PinchGestureHandler.js +136 -0
  295. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
  296. package/lib/commonjs/web/handlers/RotationGestureHandler.js +146 -0
  297. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
  298. package/lib/commonjs/web/handlers/TapGestureHandler.js +219 -0
  299. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
  300. package/lib/commonjs/web/interfaces.js +44 -0
  301. package/lib/commonjs/web/interfaces.js.map +1 -0
  302. package/lib/commonjs/web/tools/CircularBuffer.js +47 -0
  303. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
  304. package/lib/commonjs/web/tools/EventManager.js +95 -0
  305. package/lib/commonjs/web/tools/EventManager.js.map +1 -0
  306. package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
  307. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
  308. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +305 -0
  309. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
  310. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +93 -0
  311. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  312. package/lib/commonjs/web/tools/InteractionManager.js +99 -0
  313. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
  314. package/lib/commonjs/web/tools/LeastSquareSolver.js +167 -0
  315. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
  316. package/lib/commonjs/web/tools/NodeManager.js +41 -0
  317. package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
  318. package/lib/commonjs/web/tools/PointerEventManager.js +171 -0
  319. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
  320. package/lib/commonjs/web/tools/PointerTracker.js +202 -0
  321. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
  322. package/lib/commonjs/web/tools/TouchEventManager.js +126 -0
  323. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
  324. package/lib/commonjs/web/tools/VelocityTracker.js +89 -0
  325. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
  326. package/lib/commonjs/web/utils.js +14 -0
  327. package/lib/commonjs/web/utils.js.map +1 -0
  328. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +93 -0
  329. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
  330. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +43 -0
  331. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
  332. package/lib/commonjs/web_hammer/Errors.js +13 -0
  333. package/lib/commonjs/web_hammer/Errors.js.map +1 -0
  334. package/lib/commonjs/web_hammer/FlingGestureHandler.js +139 -0
  335. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
  336. package/lib/commonjs/web_hammer/GestureHandler.js +491 -0
  337. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
  338. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +45 -0
  339. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
  340. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +57 -0
  341. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
  342. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +58 -0
  343. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
  344. package/lib/commonjs/web_hammer/NodeManager.js +40 -0
  345. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
  346. package/lib/commonjs/web_hammer/PanGestureHandler.js +167 -0
  347. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
  348. package/lib/commonjs/web_hammer/PinchGestureHandler.js +31 -0
  349. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
  350. package/lib/commonjs/web_hammer/PressGestureHandler.js +160 -0
  351. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
  352. package/lib/commonjs/web_hammer/RotationGestureHandler.js +33 -0
  353. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
  354. package/lib/commonjs/web_hammer/TapGestureHandler.js +173 -0
  355. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
  356. package/lib/commonjs/web_hammer/constants.js +51 -0
  357. package/lib/commonjs/web_hammer/constants.js.map +1 -0
  358. package/lib/commonjs/web_hammer/utils.js +32 -0
  359. package/lib/commonjs/web_hammer/utils.js.map +1 -0
  360. package/lib/module/ActionType.js +9 -0
  361. package/lib/module/ActionType.js.map +1 -0
  362. package/lib/module/Directions.js +9 -0
  363. package/lib/module/Directions.js.map +1 -0
  364. package/lib/module/EnableNewWebImplementation.js +21 -0
  365. package/lib/module/EnableNewWebImplementation.js.map +1 -0
  366. package/lib/module/GestureHandlerRootViewContext.js +3 -0
  367. package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
  368. package/lib/module/PlatformConstants.js +4 -0
  369. package/lib/module/PlatformConstants.js.map +1 -0
  370. package/lib/module/PlatformConstants.web.js +6 -0
  371. package/lib/module/PlatformConstants.web.js.map +1 -0
  372. package/lib/module/RNGestureHandlerModule.js +17 -0
  373. package/lib/module/RNGestureHandlerModule.js.map +1 -0
  374. package/lib/module/RNGestureHandlerModule.kepler.js +24 -0
  375. package/lib/module/RNGestureHandlerModule.kepler.js.map +1 -0
  376. package/lib/module/RNGestureHandlerModule.macos.js +104 -0
  377. package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
  378. package/lib/module/RNGestureHandlerModule.web.js +114 -0
  379. package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
  380. package/lib/module/RNGestureHandlerModule.windows.js +112 -0
  381. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -0
  382. package/lib/module/RNRenderer.js +4 -0
  383. package/lib/module/RNRenderer.js.map +1 -0
  384. package/lib/module/RNRenderer.web.js +4 -0
  385. package/lib/module/RNRenderer.web.js.map +1 -0
  386. package/lib/module/State.js +13 -0
  387. package/lib/module/State.js.map +1 -0
  388. package/lib/module/TouchEventType.js +10 -0
  389. package/lib/module/TouchEventType.js.map +1 -0
  390. package/lib/module/components/DrawerLayout.js +504 -0
  391. package/lib/module/components/DrawerLayout.js.map +1 -0
  392. package/lib/module/components/GestureButtons.js +176 -0
  393. package/lib/module/components/GestureButtons.js.map +1 -0
  394. package/lib/module/components/GestureComponents.js +95 -0
  395. package/lib/module/components/GestureComponents.js.map +1 -0
  396. package/lib/module/components/GestureComponents.web.js +28 -0
  397. package/lib/module/components/GestureComponents.web.js.map +1 -0
  398. package/lib/module/components/GestureHandlerButton.js +3 -0
  399. package/lib/module/components/GestureHandlerButton.js.map +1 -0
  400. package/lib/module/components/GestureHandlerButton.web.js +8 -0
  401. package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
  402. package/lib/module/components/GestureHandlerRootView.android.js +14 -0
  403. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
  404. package/lib/module/components/GestureHandlerRootView.js +14 -0
  405. package/lib/module/components/GestureHandlerRootView.js.map +1 -0
  406. package/lib/module/components/GestureHandlerRootView.kepler.js +9 -0
  407. package/lib/module/components/GestureHandlerRootView.kepler.js.map +1 -0
  408. package/lib/module/components/GestureHandlerRootView.web.js +9 -0
  409. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
  410. package/lib/module/components/Swipeable.js +338 -0
  411. package/lib/module/components/Swipeable.js.map +1 -0
  412. package/lib/module/components/gestureHandlerRootHOC.js +22 -0
  413. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
  414. package/lib/module/components/touchables/GenericTouchable.js +244 -0
  415. package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
  416. package/lib/module/components/touchables/TouchableHighlight.js +81 -0
  417. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
  418. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +74 -0
  419. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
  420. package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -0
  421. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
  422. package/lib/module/components/touchables/TouchableOpacity.js +55 -0
  423. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
  424. package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -0
  425. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
  426. package/lib/module/components/touchables/index.js +5 -0
  427. package/lib/module/components/touchables/index.js.map +1 -0
  428. package/lib/module/getShadowNodeFromRef.js +21 -0
  429. package/lib/module/getShadowNodeFromRef.js.map +1 -0
  430. package/lib/module/getShadowNodeFromRef.web.js +8 -0
  431. package/lib/module/getShadowNodeFromRef.web.js.map +1 -0
  432. package/lib/module/handlers/FlingGestureHandler.js +11 -0
  433. package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
  434. package/lib/module/handlers/ForceTouchGestureHandler.js +30 -0
  435. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
  436. package/lib/module/handlers/LongPressGestureHandler.js +13 -0
  437. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
  438. package/lib/module/handlers/NativeViewGestureHandler.js +12 -0
  439. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
  440. package/lib/module/handlers/PanGestureHandler.js +90 -0
  441. package/lib/module/handlers/PanGestureHandler.js.map +1 -0
  442. package/lib/module/handlers/PinchGestureHandler.js +10 -0
  443. package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
  444. package/lib/module/handlers/PressabilityDebugView.js +3 -0
  445. package/lib/module/handlers/PressabilityDebugView.js.map +1 -0
  446. package/lib/module/handlers/PressabilityDebugView.web.js +5 -0
  447. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -0
  448. package/lib/module/handlers/RotationGestureHandler.js +10 -0
  449. package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
  450. package/lib/module/handlers/TapGestureHandler.js +13 -0
  451. package/lib/module/handlers/TapGestureHandler.js.map +1 -0
  452. package/lib/module/handlers/createHandler.js +395 -0
  453. package/lib/module/handlers/createHandler.js.map +1 -0
  454. package/lib/module/handlers/createNativeWrapper.js +56 -0
  455. package/lib/module/handlers/createNativeWrapper.js.map +1 -0
  456. package/lib/module/handlers/gestureHandlerCommon.js +76 -0
  457. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
  458. package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
  459. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -0
  460. package/lib/module/handlers/gestures/GestureDetector.js +538 -0
  461. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
  462. package/lib/module/handlers/gestures/eventReceiver.js +116 -0
  463. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
  464. package/lib/module/handlers/gestures/flingGesture.js +20 -0
  465. package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
  466. package/lib/module/handlers/gestures/forceTouchGesture.js +47 -0
  467. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
  468. package/lib/module/handlers/gestures/gesture.js +188 -0
  469. package/lib/module/handlers/gestures/gesture.js.map +1 -0
  470. package/lib/module/handlers/gestures/gestureComposition.js +81 -0
  471. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
  472. package/lib/module/handlers/gestures/gestureObjects.js +67 -0
  473. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
  474. package/lib/module/handlers/gestures/gestureStateManager.js +54 -0
  475. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
  476. package/lib/module/handlers/gestures/gestureStateManager.web.js +20 -0
  477. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
  478. package/lib/module/handlers/gestures/hoverGesture.js +53 -0
  479. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
  480. package/lib/module/handlers/gestures/longPressGesture.js +21 -0
  481. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
  482. package/lib/module/handlers/gestures/manualGesture.js +18 -0
  483. package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
  484. package/lib/module/handlers/gestures/nativeGesture.js +20 -0
  485. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
  486. package/lib/module/handlers/gestures/panGesture.js +117 -0
  487. package/lib/module/handlers/gestures/panGesture.js.map +1 -0
  488. package/lib/module/handlers/gestures/pinchGesture.js +31 -0
  489. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
  490. package/lib/module/handlers/gestures/reanimatedWrapper.js +25 -0
  491. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
  492. package/lib/module/handlers/gestures/rotationGesture.js +31 -0
  493. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
  494. package/lib/module/handlers/gestures/tapGesture.js +41 -0
  495. package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
  496. package/lib/module/handlers/handlersRegistry.js +39 -0
  497. package/lib/module/handlers/handlersRegistry.js.map +1 -0
  498. package/lib/module/index.js +25 -0
  499. package/lib/module/index.js.map +1 -0
  500. package/lib/module/init.js +17 -0
  501. package/lib/module/init.js.map +1 -0
  502. package/lib/module/jestUtils/index.js +2 -0
  503. package/lib/module/jestUtils/index.js.map +1 -0
  504. package/lib/module/jestUtils/jestUtils.js +305 -0
  505. package/lib/module/jestUtils/jestUtils.js.map +1 -0
  506. package/lib/module/mocks.js +55 -0
  507. package/lib/module/mocks.js.map +1 -0
  508. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +4 -0
  509. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  510. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js +12 -0
  511. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
  512. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +4 -0
  513. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  514. package/lib/module/typeUtils.js +2 -0
  515. package/lib/module/typeUtils.js.map +1 -0
  516. package/lib/module/utils.js +50 -0
  517. package/lib/module/utils.js.map +1 -0
  518. package/lib/module/web/constants.js +8 -0
  519. package/lib/module/web/constants.js.map +1 -0
  520. package/lib/module/web/detectors/RotationGestureDetector.js +122 -0
  521. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
  522. package/lib/module/web/detectors/ScaleGestureDetector.js +120 -0
  523. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
  524. package/lib/module/web/handlers/FlingGestureHandler.js +119 -0
  525. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
  526. package/lib/module/web/handlers/GestureHandler.js +661 -0
  527. package/lib/module/web/handlers/GestureHandler.js.map +1 -0
  528. package/lib/module/web/handlers/HoverGestureHandler.js +40 -0
  529. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
  530. package/lib/module/web/handlers/LongPressGestureHandler.js +111 -0
  531. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
  532. package/lib/module/web/handlers/ManualGestureHandler.js +41 -0
  533. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
  534. package/lib/module/web/handlers/NativeViewGestureHandler.js +132 -0
  535. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
  536. package/lib/module/web/handlers/PanGestureHandler.js +339 -0
  537. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
  538. package/lib/module/web/handlers/PinchGestureHandler.js +128 -0
  539. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
  540. package/lib/module/web/handlers/RotationGestureHandler.js +138 -0
  541. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
  542. package/lib/module/web/handlers/TapGestureHandler.js +211 -0
  543. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
  544. package/lib/module/web/interfaces.js +38 -0
  545. package/lib/module/web/interfaces.js.map +1 -0
  546. package/lib/module/web/tools/CircularBuffer.js +40 -0
  547. package/lib/module/web/tools/CircularBuffer.js.map +1 -0
  548. package/lib/module/web/tools/EventManager.js +88 -0
  549. package/lib/module/web/tools/EventManager.js.map +1 -0
  550. package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
  551. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
  552. package/lib/module/web/tools/GestureHandlerOrchestrator.js +297 -0
  553. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
  554. package/lib/module/web/tools/GestureHandlerWebDelegate.js +85 -0
  555. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
  556. package/lib/module/web/tools/InteractionManager.js +92 -0
  557. package/lib/module/web/tools/InteractionManager.js.map +1 -0
  558. package/lib/module/web/tools/LeastSquareSolver.js +160 -0
  559. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
  560. package/lib/module/web/tools/NodeManager.js +34 -0
  561. package/lib/module/web/tools/NodeManager.js.map +1 -0
  562. package/lib/module/web/tools/PointerEventManager.js +163 -0
  563. package/lib/module/web/tools/PointerEventManager.js.map +1 -0
  564. package/lib/module/web/tools/PointerTracker.js +194 -0
  565. package/lib/module/web/tools/PointerTracker.js.map +1 -0
  566. package/lib/module/web/tools/TouchEventManager.js +118 -0
  567. package/lib/module/web/tools/TouchEventManager.js.map +1 -0
  568. package/lib/module/web/tools/VelocityTracker.js +81 -0
  569. package/lib/module/web/tools/VelocityTracker.js.map +1 -0
  570. package/lib/module/web/utils.js +8 -0
  571. package/lib/module/web/utils.js.map +1 -0
  572. package/lib/module/web_hammer/DiscreteGestureHandler.js +85 -0
  573. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
  574. package/lib/module/web_hammer/DraggingGestureHandler.js +35 -0
  575. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
  576. package/lib/module/web_hammer/Errors.js +6 -0
  577. package/lib/module/web_hammer/Errors.js.map +1 -0
  578. package/lib/module/web_hammer/FlingGestureHandler.js +131 -0
  579. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
  580. package/lib/module/web_hammer/GestureHandler.js +485 -0
  581. package/lib/module/web_hammer/GestureHandler.js.map +1 -0
  582. package/lib/module/web_hammer/IndiscreteGestureHandler.js +39 -0
  583. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
  584. package/lib/module/web_hammer/LongPressGestureHandler.js +49 -0
  585. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -0
  586. package/lib/module/web_hammer/NativeViewGestureHandler.js +49 -0
  587. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -0
  588. package/lib/module/web_hammer/NodeManager.js +31 -0
  589. package/lib/module/web_hammer/NodeManager.js.map +1 -0
  590. package/lib/module/web_hammer/PanGestureHandler.js +160 -0
  591. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
  592. package/lib/module/web_hammer/PinchGestureHandler.js +24 -0
  593. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
  594. package/lib/module/web_hammer/PressGestureHandler.js +153 -0
  595. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
  596. package/lib/module/web_hammer/RotationGestureHandler.js +26 -0
  597. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
  598. package/lib/module/web_hammer/TapGestureHandler.js +166 -0
  599. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
  600. package/lib/module/web_hammer/constants.js +44 -0
  601. package/lib/module/web_hammer/constants.js.map +1 -0
  602. package/lib/module/web_hammer/utils.js +19 -0
  603. package/lib/module/web_hammer/utils.js.map +1 -0
  604. package/lib/typescript/ActionType.d.ts +7 -0
  605. package/lib/typescript/Directions.d.ts +7 -0
  606. package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
  607. package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
  608. package/lib/typescript/PlatformConstants.d.ts +5 -0
  609. package/lib/typescript/PlatformConstants.web.d.ts +4 -0
  610. package/lib/typescript/RNGestureHandlerModule.d.ts +13 -0
  611. package/lib/typescript/RNGestureHandlerModule.kepler.d.ts +17 -0
  612. package/lib/typescript/RNGestureHandlerModule.macos.d.ts +47 -0
  613. package/lib/typescript/RNGestureHandlerModule.web.d.ts +50 -0
  614. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +48 -0
  615. package/lib/typescript/RNRenderer.d.ts +1 -0
  616. package/lib/typescript/RNRenderer.web.d.ts +3 -0
  617. package/lib/typescript/State.d.ts +9 -0
  618. package/lib/typescript/TouchEventType.d.ts +8 -0
  619. package/lib/typescript/components/DrawerLayout.d.ts +148 -0
  620. package/lib/typescript/components/GestureButtons.d.ts +121 -0
  621. package/lib/typescript/components/GestureComponents.d.ts +22 -0
  622. package/lib/typescript/components/GestureComponents.web.d.ts +8 -0
  623. package/lib/typescript/components/GestureHandlerButton.d.ts +4 -0
  624. package/lib/typescript/components/GestureHandlerButton.web.d.ts +4 -0
  625. package/lib/typescript/components/GestureHandlerRootView.android.d.ts +6 -0
  626. package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -0
  627. package/lib/typescript/components/GestureHandlerRootView.kepler.d.ts +6 -0
  628. package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
  629. package/lib/typescript/components/Swipeable.d.ts +170 -0
  630. package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
  631. package/lib/typescript/components/touchables/GenericTouchable.d.ts +68 -0
  632. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +36 -0
  633. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +45 -0
  634. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +2 -0
  635. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +25 -0
  636. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +7 -0
  637. package/lib/typescript/components/touchables/index.d.ts +7 -0
  638. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
  639. package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
  640. package/lib/typescript/handlers/FlingGestureHandler.d.ts +34 -0
  641. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +44 -0
  642. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +56 -0
  643. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +28 -0
  644. package/lib/typescript/handlers/PanGestureHandler.d.ts +139 -0
  645. package/lib/typescript/handlers/PinchGestureHandler.d.ts +29 -0
  646. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
  647. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
  648. package/lib/typescript/handlers/RotationGestureHandler.d.ts +29 -0
  649. package/lib/typescript/handlers/TapGestureHandler.d.ts +57 -0
  650. package/lib/typescript/handlers/createHandler.d.ts +11 -0
  651. package/lib/typescript/handlers/createNativeWrapper.d.ts +3 -0
  652. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +67 -0
  653. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +42 -0
  654. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +19 -0
  655. package/lib/typescript/handlers/gestures/eventReceiver.d.ts +4 -0
  656. package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
  657. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +15 -0
  658. package/lib/typescript/handlers/gestures/gesture.d.ts +108 -0
  659. package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
  660. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +41 -0
  661. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
  662. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
  663. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
  664. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
  665. package/lib/typescript/handlers/gestures/manualGesture.d.ts +7 -0
  666. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
  667. package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
  668. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +11 -0
  669. package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
  670. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -0
  671. package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
  672. package/lib/typescript/handlers/handlersRegistry.d.ts +14 -0
  673. package/lib/typescript/index.d.ts +52 -0
  674. package/lib/typescript/init.d.ts +2 -0
  675. package/lib/typescript/jestUtils/index.d.ts +1 -0
  676. package/lib/typescript/jestUtils/jestUtils.d.ts +28 -0
  677. package/lib/typescript/mocks.d.ts +44 -0
  678. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -0
  679. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.kepler.d.ts +7 -0
  680. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
  681. package/lib/typescript/typeUtils.d.ts +1 -0
  682. package/lib/typescript/utils.d.ts +12 -0
  683. package/lib/typescript/web/constants.d.ts +7 -0
  684. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +30 -0
  685. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +29 -0
  686. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +27 -0
  687. package/lib/typescript/web/handlers/GestureHandler.d.ts +90 -0
  688. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
  689. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +26 -0
  690. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +12 -0
  691. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +24 -0
  692. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +55 -0
  693. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +28 -0
  694. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +29 -0
  695. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +39 -0
  696. package/lib/typescript/web/interfaces.d.ts +140 -0
  697. package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
  698. package/lib/typescript/web/tools/EventManager.d.ts +34 -0
  699. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
  700. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +30 -0
  701. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
  702. package/lib/typescript/web/tools/InteractionManager.d.ts +16 -0
  703. package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
  704. package/lib/typescript/web/tools/NodeManager.d.ts +11 -0
  705. package/lib/typescript/web/tools/PointerEventManager.d.ts +8 -0
  706. package/lib/typescript/web/tools/PointerTracker.d.ts +53 -0
  707. package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
  708. package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
  709. package/lib/typescript/web/utils.d.ts +4 -0
  710. package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +20 -0
  711. package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +15 -0
  712. package/lib/typescript/web_hammer/Errors.d.ts +3 -0
  713. package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +43 -0
  714. package/lib/typescript/web_hammer/GestureHandler.d.ts +145 -0
  715. package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +40 -0
  716. package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +38 -0
  717. package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +7 -0
  718. package/lib/typescript/web_hammer/NodeManager.d.ts +8 -0
  719. package/lib/typescript/web_hammer/PanGestureHandler.d.ts +56 -0
  720. package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +13 -0
  721. package/lib/typescript/web_hammer/PressGestureHandler.d.ts +83 -0
  722. package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +13 -0
  723. package/lib/typescript/web_hammer/TapGestureHandler.d.ts +57 -0
  724. package/lib/typescript/web_hammer/constants.d.ts +39 -0
  725. package/lib/typescript/web_hammer/utils.d.ts +9 -0
  726. package/package.json +1 -0
  727. package/src/ActionType.ts +9 -0
  728. package/src/Directions.ts +9 -0
  729. package/src/EnableNewWebImplementation.ts +35 -0
  730. package/src/GestureHandlerRootViewContext.ts +3 -0
  731. package/src/PlatformConstants.ts +8 -0
  732. package/src/PlatformConstants.web.ts +5 -0
  733. package/src/RNGestureHandlerModule.kepler.ts +64 -0
  734. package/src/RNGestureHandlerModule.macos.ts +133 -0
  735. package/src/RNGestureHandlerModule.ts +50 -0
  736. package/src/RNGestureHandlerModule.web.ts +146 -0
  737. package/src/RNGestureHandlerModule.windows.ts +144 -0
  738. package/src/RNRenderer.ts +3 -0
  739. package/src/RNRenderer.web.ts +3 -0
  740. package/src/State.ts +13 -0
  741. package/src/TouchEventType.ts +10 -0
  742. package/src/components/DrawerLayout.tsx +743 -0
  743. package/src/components/GestureButtons.tsx +334 -0
  744. package/src/components/GestureComponents.tsx +148 -0
  745. package/src/components/GestureComponents.web.tsx +41 -0
  746. package/src/components/GestureHandlerButton.tsx +5 -0
  747. package/src/components/GestureHandlerButton.web.tsx +6 -0
  748. package/src/components/GestureHandlerRootView.android.tsx +24 -0
  749. package/src/components/GestureHandlerRootView.kepler.tsx +17 -0
  750. package/src/components/GestureHandlerRootView.tsx +23 -0
  751. package/src/components/GestureHandlerRootView.web.tsx +17 -0
  752. package/src/components/Swipeable.tsx +551 -0
  753. package/src/components/gestureHandlerRootHOC.tsx +32 -0
  754. package/src/components/touchables/GenericTouchable.tsx +301 -0
  755. package/src/components/touchables/TouchableHighlight.tsx +115 -0
  756. package/src/components/touchables/TouchableNativeFeedback.android.tsx +91 -0
  757. package/src/components/touchables/TouchableNativeFeedback.tsx +3 -0
  758. package/src/components/touchables/TouchableOpacity.tsx +75 -0
  759. package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -0
  760. package/src/components/touchables/index.ts +7 -0
  761. package/src/getShadowNodeFromRef.ts +22 -0
  762. package/src/getShadowNodeFromRef.web.ts +7 -0
  763. package/src/handlers/FlingGestureHandler.ts +59 -0
  764. package/src/handlers/ForceTouchGestureHandler.ts +90 -0
  765. package/src/handlers/LongPressGestureHandler.ts +88 -0
  766. package/src/handlers/NativeViewGestureHandler.ts +55 -0
  767. package/src/handlers/PanGestureHandler.ts +325 -0
  768. package/src/handlers/PinchGestureHandler.ts +48 -0
  769. package/src/handlers/PressabilityDebugView.tsx +2 -0
  770. package/src/handlers/PressabilityDebugView.web.tsx +4 -0
  771. package/src/handlers/RotationGestureHandler.ts +48 -0
  772. package/src/handlers/TapGestureHandler.ts +94 -0
  773. package/src/handlers/createHandler.tsx +547 -0
  774. package/src/handlers/createNativeWrapper.tsx +80 -0
  775. package/src/handlers/gestureHandlerCommon.ts +244 -0
  776. package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
  777. package/src/handlers/gestures/GestureDetector.tsx +818 -0
  778. package/src/handlers/gestures/eventReceiver.ts +172 -0
  779. package/src/handlers/gestures/flingGesture.ts +27 -0
  780. package/src/handlers/gestures/forceTouchGesture.ts +74 -0
  781. package/src/handlers/gestures/gesture.ts +341 -0
  782. package/src/handlers/gestures/gestureComposition.ts +122 -0
  783. package/src/handlers/gestures/gestureObjects.ts +84 -0
  784. package/src/handlers/gestures/gestureStateManager.ts +62 -0
  785. package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
  786. package/src/handlers/gestures/hoverGesture.ts +83 -0
  787. package/src/handlers/gestures/longPressGesture.ts +28 -0
  788. package/src/handlers/gestures/manualGesture.ts +31 -0
  789. package/src/handlers/gestures/nativeGesture.ts +27 -0
  790. package/src/handlers/gestures/panGesture.ts +152 -0
  791. package/src/handlers/gestures/pinchGesture.ts +51 -0
  792. package/src/handlers/gestures/reanimatedWrapper.ts +56 -0
  793. package/src/handlers/gestures/rotationGesture.ts +51 -0
  794. package/src/handlers/gestures/tapGesture.ts +53 -0
  795. package/src/handlers/handlersRegistry.ts +60 -0
  796. package/src/index.ts +174 -0
  797. package/src/init.ts +18 -0
  798. package/src/jestUtils/index.ts +1 -0
  799. package/src/jestUtils/jestUtils.ts +505 -0
  800. package/src/mocks.ts +67 -0
  801. package/src/specs/RNGestureHandlerButtonNativeComponent.kepler.ts +27 -0
  802. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +20 -0
  803. package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +7 -0
  804. package/src/typeUtils.ts +1 -0
  805. package/src/utils.ts +62 -0
  806. package/src/web/constants.ts +8 -0
  807. package/src/web/detectors/RotationGestureDetector.ts +168 -0
  808. package/src/web/detectors/ScaleGestureDetector.ts +172 -0
  809. package/src/web/handlers/FlingGestureHandler.ts +161 -0
  810. package/src/web/handlers/GestureHandler.ts +850 -0
  811. package/src/web/handlers/HoverGestureHandler.ts +43 -0
  812. package/src/web/handlers/LongPressGestureHandler.ts +125 -0
  813. package/src/web/handlers/ManualGestureHandler.ts +43 -0
  814. package/src/web/handlers/NativeViewGestureHandler.ts +167 -0
  815. package/src/web/handlers/PanGestureHandler.ts +485 -0
  816. package/src/web/handlers/PinchGestureHandler.ts +158 -0
  817. package/src/web/handlers/RotationGestureHandler.ts +172 -0
  818. package/src/web/handlers/TapGestureHandler.ts +273 -0
  819. package/src/web/interfaces.ts +166 -0
  820. package/src/web/tools/CircularBuffer.ts +42 -0
  821. package/src/web/tools/EventManager.ts +104 -0
  822. package/src/web/tools/GestureHandlerDelegate.ts +23 -0
  823. package/src/web/tools/GestureHandlerOrchestrator.ts +398 -0
  824. package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
  825. package/src/web/tools/InteractionManager.ts +123 -0
  826. package/src/web/tools/LeastSquareSolver.ts +182 -0
  827. package/src/web/tools/NodeManager.ts +43 -0
  828. package/src/web/tools/PointerEventManager.ts +193 -0
  829. package/src/web/tools/PointerTracker.ts +240 -0
  830. package/src/web/tools/TouchEventManager.ts +167 -0
  831. package/src/web/tools/VelocityTracker.ts +98 -0
  832. package/src/web/utils.ts +8 -0
  833. package/src/web_hammer/DiscreteGestureHandler.ts +82 -0
  834. package/src/web_hammer/DraggingGestureHandler.ts +34 -0
  835. package/src/web_hammer/Errors.ts +7 -0
  836. package/src/web_hammer/FlingGestureHandler.ts +134 -0
  837. package/src/web_hammer/GestureHandler.ts +598 -0
  838. package/src/web_hammer/IndiscreteGestureHandler.ts +33 -0
  839. package/src/web_hammer/LongPressGestureHandler.ts +56 -0
  840. package/src/web_hammer/NativeViewGestureHandler.ts +47 -0
  841. package/src/web_hammer/NodeManager.ts +42 -0
  842. package/src/web_hammer/PanGestureHandler.ts +226 -0
  843. package/src/web_hammer/PinchGestureHandler.ts +25 -0
  844. package/src/web_hammer/PressGestureHandler.ts +167 -0
  845. package/src/web_hammer/RotationGestureHandler.ts +25 -0
  846. package/src/web_hammer/TapGestureHandler.ts +172 -0
  847. package/src/web_hammer/constants.ts +48 -0
  848. package/src/web_hammer/utils.ts +24 -0
@@ -0,0 +1,395 @@
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); }
5
+ import * as React from 'react';
6
+ import { Platform, UIManager, DeviceEventEmitter } from 'react-native';
7
+ // @ts-ignore - it isn't typed by TS & don't have definitelyTyped types
8
+ import { isEqual as deepEqual } from 'lodash';
9
+ import RNGestureHandlerModule from '../RNGestureHandlerModule';
10
+ import { State } from '../State';
11
+ import { handlerIDToTag, getNextHandlerTag, registerOldGestureHandler } from './handlersRegistry';
12
+ import { filterConfig, findNodeHandle, scheduleFlushOperations } from './gestureHandlerCommon';
13
+ import { isFabric, isJestEnv, tagMessage } from '../utils';
14
+ import { ActionType } from '../ActionType';
15
+ import { PressabilityDebugView } from './PressabilityDebugView';
16
+ import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
17
+
18
+ // amznmod_gesturehandler - Update deep import to align with changes we have pulled early from upstream.
19
+ // @ts-expect-error Untyped as we are unsafely importing a private API
20
+ import * as registry from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry';
21
+ registry.customDirectEventTypes['topOnGestureHandlerStateChange'] = {
22
+ registrationName: 'onGestureHandlerStateChange'
23
+ };
24
+ registry.customDirectEventTypes['topOnGestureHandlerEvent'] = {
25
+ registrationName: 'onGestureHandlerEvent'
26
+ };
27
+ const UIManagerAny = UIManager;
28
+ const customGHEventsConfigFabricAndroid = {
29
+ topOnGestureHandlerEvent: {
30
+ registrationName: 'onGestureHandlerEvent'
31
+ },
32
+ topOnGestureHandlerStateChange: {
33
+ registrationName: 'onGestureHandlerStateChange'
34
+ }
35
+ };
36
+ const customGHEventsConfig = {
37
+ onGestureHandlerEvent: {
38
+ registrationName: 'onGestureHandlerEvent'
39
+ },
40
+ onGestureHandlerStateChange: {
41
+ registrationName: 'onGestureHandlerStateChange'
42
+ },
43
+ // When using React Native Gesture Handler for Animated.event with useNativeDriver: true
44
+ // on Android with Fabric enabled, the native part still sends the native events to JS
45
+ // but prefixed with "top". We cannot simply rename the events above so they are prefixed
46
+ // with "top" instead of "on" because in such case Animated.events would not be registered.
47
+ // That's why we need to register another pair of event names.
48
+ // The incoming events will be queued but never handled.
49
+ // Without this piece of code below, you'll get the following JS error:
50
+ // Unsupported top level event type "topOnGestureHandlerEvent" dispatched
51
+ ...(isFabric() && Platform.OS === 'android' && customGHEventsConfigFabricAndroid)
52
+ };
53
+
54
+ // Add gesture specific events to genericDirectEventTypes object exported from UIManager
55
+ // native module.
56
+ // Once new event types are registered with react it is possible to dispatch these
57
+ // events to all kind of native views.
58
+ UIManagerAny.genericDirectEventTypes = {
59
+ ...UIManagerAny.genericDirectEventTypes,
60
+ ...customGHEventsConfig
61
+ };
62
+ // In newer versions of RN the `genericDirectEventTypes` is located in the object
63
+ // returned by UIManager.getViewManagerConfig('getConstants') or in older RN UIManager.getConstants(), we need to add it there as well to make
64
+ // it compatible with RN 61+
65
+ 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);
66
+ if (UIManagerConstants) {
67
+ UIManagerConstants.genericDirectEventTypes = {
68
+ ...UIManagerConstants.genericDirectEventTypes,
69
+ ...customGHEventsConfig
70
+ };
71
+ }
72
+
73
+ // Wrap JS responder calls and notify gesture handler manager
74
+ const {
75
+ setJSResponder: oldSetJSResponder = () => {
76
+ //no operation
77
+ },
78
+ clearJSResponder: oldClearJSResponder = () => {
79
+ //no operation
80
+ }
81
+ } = UIManagerAny;
82
+ UIManagerAny.setJSResponder = (tag, blockNativeResponder) => {
83
+ RNGestureHandlerModule.handleSetJSResponder(tag, blockNativeResponder);
84
+ oldSetJSResponder(tag, blockNativeResponder);
85
+ };
86
+ UIManagerAny.clearJSResponder = () => {
87
+ RNGestureHandlerModule.handleClearJSResponder();
88
+ oldClearJSResponder();
89
+ };
90
+ let allowTouches = true;
91
+ const DEV_ON_ANDROID = __DEV__ && Platform.OS === 'android';
92
+ // Toggled inspector blocks touch events in order to allow inspecting on Android
93
+ // This needs to be a global variable in order to set initial state for `allowTouches` property in Handler component
94
+ if (DEV_ON_ANDROID) {
95
+ DeviceEventEmitter.addListener('toggleElementInspector', () => {
96
+ allowTouches = !allowTouches;
97
+ });
98
+ }
99
+ function hasUnresolvedRefs(props) {
100
+ // TODO(TS) - add type for extract arg
101
+ const extract = refs => {
102
+ if (!Array.isArray(refs)) {
103
+ return refs && refs.current === null;
104
+ }
105
+ return refs.some(r => r && r.current === null);
106
+ };
107
+ return extract(props['simultaneousHandlers']) || extract(props['waitFor']);
108
+ }
109
+ const stateToPropMappings = {
110
+ [State.UNDETERMINED]: undefined,
111
+ [State.BEGAN]: 'onBegan',
112
+ [State.FAILED]: 'onFailed',
113
+ [State.CANCELLED]: 'onCancelled',
114
+ [State.ACTIVE]: 'onActivated',
115
+ [State.END]: 'onEnded'
116
+ };
117
+
118
+ // TODO(TS) fix event types
119
+
120
+ const UNRESOLVED_REFS_RETRY_LIMIT = 1;
121
+
122
+ // TODO(TS) - make sure that BaseGestureHandlerProps doesn't need other generic parameter to work with custom properties.
123
+ export default function createHandler({
124
+ name,
125
+ allowedProps = [],
126
+ config = {},
127
+ transformProps,
128
+ customNativeProps = []
129
+ }) {
130
+ class Handler extends React.Component {
131
+ constructor(props) {
132
+ super(props);
133
+ _defineProperty(this, "handlerTag", void 0);
134
+ _defineProperty(this, "config", void 0);
135
+ _defineProperty(this, "propsRef", void 0);
136
+ _defineProperty(this, "isMountedRef", void 0);
137
+ _defineProperty(this, "viewNode", void 0);
138
+ _defineProperty(this, "viewTag", void 0);
139
+ _defineProperty(this, "inspectorToggleListener", void 0);
140
+ _defineProperty(this, "onGestureHandlerEvent", event => {
141
+ if (event.nativeEvent.handlerTag === this.handlerTag) {
142
+ if (typeof this.props.onGestureEvent === 'function') {
143
+ var _this$props$onGesture, _this$props;
144
+ (_this$props$onGesture = (_this$props = this.props).onGestureEvent) === null || _this$props$onGesture === void 0 || _this$props$onGesture.call(_this$props, event);
145
+ }
146
+ } else {
147
+ var _this$props$onGesture2, _this$props2;
148
+ (_this$props$onGesture2 = (_this$props2 = this.props).onGestureHandlerEvent) === null || _this$props$onGesture2 === void 0 || _this$props$onGesture2.call(_this$props2, event);
149
+ }
150
+ });
151
+ // TODO(TS) - make sure this is right type for event
152
+ _defineProperty(this, "onGestureHandlerStateChange", event => {
153
+ if (event.nativeEvent.handlerTag === this.handlerTag) {
154
+ if (typeof this.props.onHandlerStateChange === 'function') {
155
+ var _this$props$onHandler, _this$props3;
156
+ (_this$props$onHandler = (_this$props3 = this.props).onHandlerStateChange) === null || _this$props$onHandler === void 0 || _this$props$onHandler.call(_this$props3, event);
157
+ }
158
+ const state = event.nativeEvent.state;
159
+ const stateEventName = stateToPropMappings[state];
160
+ const eventHandler = stateEventName && this.props[stateEventName];
161
+ if (eventHandler && typeof eventHandler === 'function') {
162
+ eventHandler(event);
163
+ }
164
+ } else {
165
+ var _this$props$onGesture3, _this$props4;
166
+ (_this$props$onGesture3 = (_this$props4 = this.props).onGestureHandlerStateChange) === null || _this$props$onGesture3 === void 0 || _this$props$onGesture3.call(_this$props4, event);
167
+ }
168
+ });
169
+ _defineProperty(this, "refHandler", node => {
170
+ this.viewNode = node;
171
+ const child = React.Children.only(this.props.children);
172
+ // TODO(TS) fix ref type
173
+ const {
174
+ ref
175
+ } = child;
176
+ if (ref !== null) {
177
+ if (typeof ref === 'function') {
178
+ ref(node);
179
+ } else {
180
+ ref.current = node;
181
+ }
182
+ }
183
+ });
184
+ _defineProperty(this, "createGestureHandler", newConfig => {
185
+ this.config = newConfig;
186
+ RNGestureHandlerModule.createGestureHandler(name, this.handlerTag, newConfig);
187
+ });
188
+ _defineProperty(this, "attachGestureHandler", newViewTag => {
189
+ this.viewTag = newViewTag;
190
+ if (Platform.OS === 'web') {
191
+ // typecast due to dynamic resolution, attachGestureHandler should have web version signature in this branch
192
+ RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, ActionType.JS_FUNCTION_OLD_API,
193
+ // ignored on web
194
+ this.propsRef);
195
+ } else {
196
+ registerOldGestureHandler(this.handlerTag, {
197
+ onGestureEvent: this.onGestureHandlerEvent,
198
+ onGestureStateChange: this.onGestureHandlerStateChange
199
+ });
200
+ const actionType = ((_this$props5, _this$props6, _this$props7) => {
201
+ if ((_this$props5 = this.props) !== null && _this$props5 !== void 0 && _this$props5.onGestureEvent &&
202
+ // @ts-ignore types not correct?
203
+ 'current' in this.props.onGestureEvent || (_this$props6 = this.props) !== null && _this$props6 !== void 0 && _this$props6.onHandlerStateChange &&
204
+ // @ts-ignore types not correct?
205
+ 'current' in this.props.onHandlerStateChange) {
206
+ // Reanimated worklet
207
+ return ActionType.REANIMATED_WORKLET;
208
+ } else if ((_this$props7 = this.props) !== null && _this$props7 !== void 0 && _this$props7.onGestureEvent &&
209
+ // @ts-ignore types not correct?
210
+ '__isNative' in this.props.onGestureEvent) {
211
+ // Animated.event with useNativeDriver: true
212
+ return ActionType.NATIVE_ANIMATED_EVENT;
213
+ } else {
214
+ // JS callback or Animated.event with useNativeDriver: false
215
+ return ActionType.JS_FUNCTION_OLD_API;
216
+ }
217
+ })();
218
+ RNGestureHandlerModule.attachGestureHandler(this.handlerTag, newViewTag, actionType);
219
+ }
220
+ scheduleFlushOperations();
221
+ });
222
+ _defineProperty(this, "updateGestureHandler", newConfig => {
223
+ this.config = newConfig;
224
+ RNGestureHandlerModule.updateGestureHandler(this.handlerTag, newConfig);
225
+ scheduleFlushOperations();
226
+ });
227
+ this.handlerTag = getNextHandlerTag();
228
+ this.config = {};
229
+ this.propsRef = /*#__PURE__*/React.createRef();
230
+ this.isMountedRef = /*#__PURE__*/React.createRef();
231
+ this.state = {
232
+ allowTouches
233
+ };
234
+ if (props.id) {
235
+ if (handlerIDToTag[props.id] !== undefined) {
236
+ throw new Error(`Handler with ID "${props.id}" already registered`);
237
+ }
238
+ handlerIDToTag[props.id] = this.handlerTag;
239
+ }
240
+ }
241
+ componentDidMount() {
242
+ const props = this.props;
243
+ this.isMountedRef.current = true;
244
+ if (DEV_ON_ANDROID) {
245
+ this.inspectorToggleListener = DeviceEventEmitter.addListener('toggleElementInspector', () => {
246
+ this.setState(_ => ({
247
+ allowTouches
248
+ }));
249
+ this.update(UNRESOLVED_REFS_RETRY_LIMIT);
250
+ });
251
+ }
252
+ if (hasUnresolvedRefs(props)) {
253
+ // If there are unresolved refs (e.g. ".current" has not yet been set)
254
+ // passed as `simultaneousHandlers` or `waitFor`, we enqueue a call to
255
+ // _update method that will try to update native handler props using
256
+ // queueMicrotask. This makes it so update() function gets called after all
257
+ // react components are mounted and we expect the missing ref object to
258
+ // be resolved by then.
259
+ queueMicrotask(() => {
260
+ this.update(UNRESOLVED_REFS_RETRY_LIMIT);
261
+ });
262
+ }
263
+ this.createGestureHandler(filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config));
264
+ this.attachGestureHandler(findNodeHandle(this.viewNode)); // TODO(TS) - check if this can be null
265
+ }
266
+ componentDidUpdate() {
267
+ const viewTag = findNodeHandle(this.viewNode);
268
+ if (this.viewTag !== viewTag) {
269
+ this.attachGestureHandler(viewTag); // TODO(TS) - check interaction between _viewTag & findNodeHandle
270
+ }
271
+ this.update(UNRESOLVED_REFS_RETRY_LIMIT);
272
+ }
273
+ componentWillUnmount() {
274
+ var _this$inspectorToggle;
275
+ (_this$inspectorToggle = this.inspectorToggleListener) === null || _this$inspectorToggle === void 0 || _this$inspectorToggle.remove();
276
+ this.isMountedRef.current = false;
277
+ RNGestureHandlerModule.dropGestureHandler(this.handlerTag);
278
+ scheduleFlushOperations();
279
+ // 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
280
+ const handlerID = this.props.id;
281
+ if (handlerID) {
282
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
283
+ delete handlerIDToTag[handlerID];
284
+ }
285
+ }
286
+ update(remainingTries) {
287
+ if (!this.isMountedRef.current) {
288
+ return;
289
+ }
290
+ const props = this.props;
291
+
292
+ // When ref is set via a function i.e. `ref={(r) => refObject.current = r}` instead of
293
+ // `ref={refObject}` it's possible that it won't be resolved in time. Seems like trying
294
+ // again is easy enough fix.
295
+ if (hasUnresolvedRefs(props) && remainingTries > 0) {
296
+ queueMicrotask(() => {
297
+ this.update(remainingTries - 1);
298
+ });
299
+ } else {
300
+ const newConfig = filterConfig(transformProps ? transformProps(this.props) : this.props, [...allowedProps, ...customNativeProps], config);
301
+ if (!deepEqual(this.config, newConfig)) {
302
+ this.updateGestureHandler(newConfig);
303
+ }
304
+ }
305
+ }
306
+ setNativeProps(updates) {
307
+ const mergedProps = {
308
+ ...this.props,
309
+ ...updates
310
+ };
311
+ const newConfig = filterConfig(transformProps ? transformProps(mergedProps) : mergedProps, [...allowedProps, ...customNativeProps], config);
312
+ this.updateGestureHandler(newConfig);
313
+ }
314
+ render() {
315
+ var _this$props$testID;
316
+ if (__DEV__ && !this.context && !isJestEnv() && Platform.OS !== 'web') {
317
+ 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.');
318
+ }
319
+ let gestureEventHandler = this.onGestureHandlerEvent;
320
+ // Another instance of https://github.com/microsoft/TypeScript/issues/13995
321
+
322
+ const {
323
+ onGestureEvent,
324
+ onGestureHandlerEvent
325
+ } = this.props;
326
+ if (onGestureEvent && typeof onGestureEvent !== 'function') {
327
+ // If it's not a method it should be an native Animated.event
328
+ // object. We set it directly as the handler for the view
329
+ // In this case nested handlers are not going to be supported
330
+ if (onGestureHandlerEvent) {
331
+ throw new Error('Nesting touch handlers with native animated driver is not supported yet');
332
+ }
333
+ gestureEventHandler = onGestureEvent;
334
+ } else {
335
+ if (onGestureHandlerEvent && typeof onGestureHandlerEvent !== 'function') {
336
+ throw new Error('Nesting touch handlers with native animated driver is not supported yet');
337
+ }
338
+ }
339
+ let gestureStateEventHandler = this.onGestureHandlerStateChange;
340
+ // Another instance of https://github.com/microsoft/TypeScript/issues/13995
341
+
342
+ const {
343
+ onHandlerStateChange,
344
+ onGestureHandlerStateChange
345
+ } = this.props;
346
+ if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') {
347
+ // If it's not a method it should be an native Animated.event
348
+ // object. We set it directly as the handler for the view
349
+ // In this case nested handlers are not going to be supported
350
+ if (onGestureHandlerStateChange) {
351
+ throw new Error('Nesting touch handlers with native animated driver is not supported yet');
352
+ }
353
+ gestureStateEventHandler = onHandlerStateChange;
354
+ } else {
355
+ if (onGestureHandlerStateChange && typeof onGestureHandlerStateChange !== 'function') {
356
+ throw new Error('Nesting touch handlers with native animated driver is not supported yet');
357
+ }
358
+ }
359
+ const events = {
360
+ onGestureHandlerEvent: this.state.allowTouches ? gestureEventHandler : undefined,
361
+ onGestureHandlerStateChange: this.state.allowTouches ? gestureStateEventHandler : undefined
362
+ };
363
+ this.propsRef.current = events;
364
+ let child = null;
365
+ try {
366
+ child = React.Children.only(this.props.children);
367
+ } catch (e) {
368
+ 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.`));
369
+ }
370
+ let grandChildren = child.props.children;
371
+ if (__DEV__ && child.type && (child.type === 'RNGestureHandlerButton' || child.type.name === 'View' || child.type.displayName === 'View')) {
372
+ grandChildren = React.Children.toArray(grandChildren);
373
+ grandChildren.push(/*#__PURE__*/React.createElement(PressabilityDebugView, {
374
+ key: "pressabilityDebugView",
375
+ color: "mediumspringgreen",
376
+ hitSlop: child.props.hitSlop
377
+ }));
378
+ }
379
+ return /*#__PURE__*/React.cloneElement(child, {
380
+ ref: this.refHandler,
381
+ collapsable: false,
382
+ ...(isJestEnv() ? {
383
+ handlerType: name,
384
+ handlerTag: this.handlerTag
385
+ } : {}),
386
+ testID: (_this$props$testID = this.props.testID) !== null && _this$props$testID !== void 0 ? _this$props$testID : child.props.testID,
387
+ ...events
388
+ }, grandChildren);
389
+ }
390
+ }
391
+ _defineProperty(Handler, "displayName", name);
392
+ _defineProperty(Handler, "contextType", GestureHandlerRootViewContext);
393
+ return Handler;
394
+ }
395
+ //# sourceMappingURL=createHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Platform","UIManager","DeviceEventEmitter","isEqual","deepEqual","RNGestureHandlerModule","State","handlerIDToTag","getNextHandlerTag","registerOldGestureHandler","filterConfig","findNodeHandle","scheduleFlushOperations","isFabric","isJestEnv","tagMessage","ActionType","PressabilityDebugView","GestureHandlerRootViewContext","registry","customDirectEventTypes","registrationName","UIManagerAny","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","_this$props7","REANIMATED_WORKLET","NATIVE_ANIMATED_EVENT","updateGestureHandler","createRef","isMountedRef","id","Error","componentDidMount","inspectorToggleListener","setState","_","update","queueMicrotask","componentDidUpdate","componentWillUnmount","_this$inspectorToggle","remove","dropGestureHandler","handlerID","remainingTries","setNativeProps","updates","mergedProps","render","_this$props$testID","context","gestureEventHandler","gestureStateEventHandler","events","e","grandChildren","type","displayName","toArray","push","createElement","key","color","hitSlop","cloneElement","refHandler","collapsable","handlerType","testID"],"sources":["createHandler.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Platform,\n UIManager,\n DeviceEventEmitter,\n EmitterSubscription,\n} from 'react-native';\n// @ts-ignore - it isn't typed by TS & don't have definitelyTyped types\nimport { isEqual as deepEqual } from 'lodash';\nimport RNGestureHandlerModule from '../RNGestureHandlerModule';\nimport type RNGestureHandlerModuleWeb from '../RNGestureHandlerModule.web';\nimport { State } from '../State';\nimport {\n handlerIDToTag,\n getNextHandlerTag,\n registerOldGestureHandler,\n} from './handlersRegistry';\n\nimport {\n BaseGestureHandlerProps,\n filterConfig,\n GestureEvent,\n HandlerStateChangeEvent,\n findNodeHandle,\n scheduleFlushOperations,\n} from './gestureHandlerCommon';\nimport { ValueOf } from '../typeUtils';\nimport { isFabric, isJestEnv, tagMessage } from '../utils';\nimport { ActionType } from '../ActionType';\nimport { PressabilityDebugView } from './PressabilityDebugView';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\n\n// amznmod_gesturehandler - Update deep import to align with changes we have pulled early from upstream.\n// @ts-expect-error Untyped as we are unsafely importing a private API\nimport * as registry from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry'\n\nregistry.customDirectEventTypes['topOnGestureHandlerStateChange'] = {\n registrationName: 'onGestureHandlerStateChange'\n}\n\nregistry.customDirectEventTypes['topOnGestureHandlerEvent'] = {\n registrationName: 'onGestureHandlerEvent'\n}\n\nconst UIManagerAny = UIManager as any;\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 operation\n },\n clearJSResponder: oldClearJSResponder = () => {\n //no operation\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\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 queueMicrotask(() => {\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 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 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\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 typeof RNGestureHandlerModuleWeb.attachGestureHandler\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 if (\n (this.props?.onGestureEvent &&\n // @ts-ignore types not correct?\n 'current' in this.props.onGestureEvent) ||\n (this.props?.onHandlerStateChange &&\n // @ts-ignore types not correct?\n 'current' in this.props.onHandlerStateChange)\n ) {\n // Reanimated worklet\n return ActionType.REANIMATED_WORKLET;\n } else if (\n this.props?.onGestureEvent &&\n // @ts-ignore types not correct?\n '__isNative' in this.props.onGestureEvent\n ) {\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\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 queueMicrotask(() => {\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 && !isJestEnv() && 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 ...(isJestEnv()\n ? {\n handlerType: name,\n handlerTag: this.handlerTag,\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;AACA,SAASC,OAAO,IAAIC,SAAS,QAAQ,QAAQ;AAC7C,OAAOC,sBAAsB,MAAM,2BAA2B;AAE9D,SAASC,KAAK,QAAQ,UAAU;AAChC,SACEC,cAAc,EACdC,iBAAiB,EACjBC,yBAAyB,QACpB,oBAAoB;AAE3B,SAEEC,YAAY,EAGZC,cAAc,EACdC,uBAAuB,QAClB,wBAAwB;AAE/B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,UAAU;AAC1D,SAASC,U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AW,EAAEtF,IAAI;UACjBW,UAAU,EAAE,IAAI,CAACA;QACnB,CAAC,GACD,CAAC,CAAC,CAAC;QACP4E,MAAM,GAAAnB,kBAAA,GAAE,IAAI,CAACtF,KAAK,CAACyG,MAAM,cAAAnB,kBAAA,cAAAA,kBAAA,GAAIzC,KAAK,CAAC7C,KAAK,CAACyG,MAAM;QAC/C,GAAGf;MACL,CAAC,EACDE,aACF,CAAC;IACH;EACF;EAAClE,eAAA,CA9WKH,OAAO,iBAIUL,IAAI;EAAAQ,eAAA,CAJrBH,OAAO,iBAKUxD,6BAA6B;EA0WpD,OAAOwD,OAAO;AAChB","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import * as React from 'react';
3
+ import { useImperativeHandle, useRef } from 'react';
4
+ import { NativeViewGestureHandler, nativeViewProps } from './NativeViewGestureHandler';
5
+
6
+ /*
7
+ * This array should consist of:
8
+ * - All keys in propTypes from NativeGestureHandler
9
+ * (and all keys in GestureHandlerPropTypes)
10
+ * - 'onGestureHandlerEvent'
11
+ * - 'onGestureHandlerStateChange'
12
+ */
13
+ const NATIVE_WRAPPER_PROPS_FILTER = [...nativeViewProps, 'onGestureHandlerEvent', 'onGestureHandlerStateChange'];
14
+ export default function createNativeWrapper(Component, config = {}) {
15
+ var _Component$render;
16
+ const ComponentWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
17
+ // filter out props that should be passed to gesture handler wrapper
18
+ const gestureHandlerProps = Object.keys(props).reduce((res, key) => {
19
+ // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
20
+ const allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
21
+ if (allowedKeys.includes(key)) {
22
+ // @ts-ignore FIXME(TS)
23
+ res[key] = props[key];
24
+ }
25
+ return res;
26
+ }, {
27
+ ...config
28
+ } // watch out not to modify config
29
+ );
30
+ const _ref = useRef();
31
+ const _gestureHandlerRef = useRef();
32
+ useImperativeHandle(ref,
33
+ // @ts-ignore TODO(TS) decide how nulls work in this context
34
+ () => {
35
+ const node = _gestureHandlerRef.current;
36
+ // add handlerTag for relations config
37
+ if (_ref.current && node) {
38
+ // @ts-ignore FIXME(TS) think about createHandler return type
39
+ _ref.current.handlerTag = node.handlerTag;
40
+ return _ref.current;
41
+ }
42
+ return null;
43
+ }, [_ref, _gestureHandlerRef]);
44
+ return /*#__PURE__*/React.createElement(NativeViewGestureHandler, _extends({}, gestureHandlerProps, {
45
+ ref: _gestureHandlerRef
46
+ }), /*#__PURE__*/React.createElement(Component, _extends({}, props, {
47
+ ref: _ref
48
+ })));
49
+ });
50
+
51
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
52
+ ComponentWrapper.displayName = (Component === null || Component === void 0 ? void 0 : Component.displayName) || (// @ts-ignore if render doesn't exist it will return undefined and go further
53
+ Component === null || Component === void 0 || (_Component$render = Component.render) === null || _Component$render === void 0 ? void 0 : _Component$render.name) || typeof Component === 'string' && Component || 'ComponentWrapper';
54
+ return ComponentWrapper;
55
+ }
56
+ //# sourceMappingURL=createNativeWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useImperativeHandle","useRef","NativeViewGestureHandler","nativeViewProps","NATIVE_WRAPPER_PROPS_FILTER","createNativeWrapper","Component","config","_Component$render","ComponentWrapper","forwardRef","props","ref","gestureHandlerProps","Object","keys","reduce","res","key","allowedKeys","includes","_ref","_gestureHandlerRef","node","current","handlerTag","createElement","_extends","displayName","render","name"],"sources":["createNativeWrapper.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useImperativeHandle, useRef } from 'react';\n\nimport {\n NativeViewGestureHandler,\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from './NativeViewGestureHandler';\n\n/*\n * This array should consist of:\n * - All keys in propTypes from NativeGestureHandler\n * (and all keys in GestureHandlerPropTypes)\n * - 'onGestureHandlerEvent'\n * - 'onGestureHandlerStateChange'\n */\nconst NATIVE_WRAPPER_PROPS_FILTER = [\n ...nativeViewProps,\n 'onGestureHandlerEvent',\n 'onGestureHandlerStateChange',\n] as const;\n\nexport default function createNativeWrapper<P>(\n Component: React.ComponentType<P>,\n config: Readonly<NativeViewGestureHandlerProps> = {}\n) {\n const ComponentWrapper = React.forwardRef<\n React.ComponentType<any>,\n P & NativeViewGestureHandlerProps\n >((props, ref) => {\n // filter out props that should be passed to gesture handler wrapper\n const gestureHandlerProps = Object.keys(props).reduce(\n (res, key) => {\n // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info\n const allowedKeys: readonly string[] = NATIVE_WRAPPER_PROPS_FILTER;\n if (allowedKeys.includes(key)) {\n // @ts-ignore FIXME(TS)\n res[key] = props[key];\n }\n return res;\n },\n { ...config } // watch out not to modify config\n );\n const _ref = useRef<React.ComponentType<P>>();\n const _gestureHandlerRef = useRef<React.ComponentType<P>>();\n useImperativeHandle(\n ref,\n // @ts-ignore TODO(TS) decide how nulls work in this context\n () => {\n const node = _gestureHandlerRef.current;\n // add handlerTag for relations config\n if (_ref.current && node) {\n // @ts-ignore FIXME(TS) think about createHandler return type\n _ref.current.handlerTag = node.handlerTag;\n return _ref.current;\n }\n return null;\n },\n [_ref, _gestureHandlerRef]\n );\n return (\n <NativeViewGestureHandler\n {...gestureHandlerProps}\n ref={_gestureHandlerRef}>\n {/* @ts-ignore yocto TS error, fixed in newer version, PROJVEGA-277530 */}\n <Component {...props} ref={_ref} />\n </NativeViewGestureHandler>\n );\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ComponentWrapper.displayName =\n Component?.displayName ||\n // @ts-ignore if render doesn't exist it will return undefined and go further\n Component?.render?.name ||\n (typeof Component === 'string' && Component) ||\n 'ComponentWrapper';\n\n return ComponentWrapper;\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,CAC3B,CAAC;IACD,oBACEvB,KAAA,CAAA2B,aAAA,CAACxB,wBAAwB,EAAAyB,QAAA,KACnBd,mBAAmB;MACvBD,GAAG,EAAEU;IAAmB,iBAExBvB,KAAA,CAAA2B,aAAA,CAACpB,SAAS,EAAAqB,QAAA,KAAKhB,KAAK;MAAEC,GAAG,EAAES;IAAK,EAAE,CACV,CAAC;EAE/B,CAAC,CAAC;;EAEF;EACAZ,gBAAgB,CAACmB,WAAW,GAC1B,CAAAtB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEsB,WAAW,MACtB;EACAtB,SAAS,aAATA,SAAS,gBAAAE,iBAAA,GAATF,SAAS,CAAEuB,MAAM,cAAArB,iBAAA,uBAAjBA,iBAAA,CAAmBsB,IAAI,KACtB,OAAOxB,SAAS,KAAK,QAAQ,IAAIA,SAAU,IAC5C,kBAAkB;EAEpB,OAAOG,gBAAgB;AACzB","ignoreList":[]}
@@ -0,0 +1,76 @@
1
+ // Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.
2
+ // Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof
3
+ // e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.
4
+ // See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.
5
+
6
+ import { Platform, findNodeHandle as findNodeHandleRN } from 'react-native';
7
+ import { handlerIDToTag } from './handlersRegistry';
8
+ import { toArray } from '../utils';
9
+ import RNGestureHandlerModule from '../RNGestureHandlerModule';
10
+ const commonProps = ['id', 'enabled', 'shouldCancelWhenOutside', 'hitSlop', 'cancelsTouchesInView', 'userSelect', 'activeCursor'];
11
+ const componentInteractionProps = ['waitFor', 'simultaneousHandlers'];
12
+ export const baseGestureHandlerProps = [...commonProps, ...componentInteractionProps, 'onBegan', 'onFailed', 'onCancelled', 'onActivated', 'onEnded', 'onGestureEvent', 'onHandlerStateChange'];
13
+ export const baseGestureHandlerWithMonitorProps = [...commonProps, 'needsPointerData', 'manualActivation'];
14
+
15
+ //TODO(TS) events in handlers
16
+
17
+ // Events payloads are types instead of interfaces due to TS limitation.
18
+ // See https://github.com/microsoft/TypeScript/issues/15300 for more info.
19
+
20
+ function isConfigParam(param, name) {
21
+ // param !== Object(param) returns false if `param` is a function
22
+ // or an object and returns true if `param` is null
23
+ return param !== undefined && (param !== Object(param) || !('__isNative' in param)) && name !== 'onHandlerStateChange' && name !== 'onGestureEvent';
24
+ }
25
+ export function filterConfig(props, validProps, defaults = {}) {
26
+ const filteredConfig = {
27
+ ...defaults
28
+ };
29
+ for (const key of validProps) {
30
+ let value = props[key];
31
+ if (isConfigParam(value, key)) {
32
+ if (key === 'simultaneousHandlers' || key === 'waitFor') {
33
+ value = transformIntoHandlerTags(props[key]);
34
+ } else if (key === 'hitSlop' && typeof value !== 'object') {
35
+ value = {
36
+ top: value,
37
+ left: value,
38
+ bottom: value,
39
+ right: value
40
+ };
41
+ }
42
+ filteredConfig[key] = value;
43
+ }
44
+ }
45
+ return filteredConfig;
46
+ }
47
+ function transformIntoHandlerTags(handlerIDs) {
48
+ handlerIDs = toArray(handlerIDs);
49
+ if (Platform.OS === 'web') {
50
+ return handlerIDs.map(({
51
+ current
52
+ }) => current).filter(handle => handle);
53
+ }
54
+ // converts handler string IDs into their numeric tags
55
+ return handlerIDs.map(handlerID => {
56
+ var _handlerID$current;
57
+ return handlerIDToTag[handlerID] || ((_handlerID$current = handlerID.current) === null || _handlerID$current === void 0 ? void 0 : _handlerID$current.handlerTag) || -1;
58
+ }).filter(handlerTag => handlerTag > 0);
59
+ }
60
+ export function findNodeHandle(node) {
61
+ if (Platform.OS === 'web') {
62
+ return node;
63
+ }
64
+ return findNodeHandleRN(node);
65
+ }
66
+ let flushOperationsScheduled = false;
67
+ export function scheduleFlushOperations() {
68
+ if (!flushOperationsScheduled) {
69
+ flushOperationsScheduled = true;
70
+ queueMicrotask(() => {
71
+ RNGestureHandlerModule.flushOperations();
72
+ flushOperationsScheduled = false;
73
+ });
74
+ }
75
+ }
76
+ //# sourceMappingURL=gestureHandlerCommon.js.map