react-native-gesture-handler 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (633) hide show
  1. package/RNGestureHandler.podspec +8 -0
  2. package/android/build.gradle +9 -3
  3. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
  4. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
  5. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
  6. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
  7. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
  8. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
  9. package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
  10. package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
  11. package/apple/RNGestureHandlerButton.mm +12 -2
  12. package/lib/commonjs/ActionType.js +3 -3
  13. package/lib/commonjs/ActionType.js.map +1 -1
  14. package/lib/commonjs/Directions.js +8 -11
  15. package/lib/commonjs/Directions.js.map +1 -1
  16. package/lib/commonjs/EnableNewWebImplementation.js +10 -2
  17. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
  18. package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
  19. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
  20. package/lib/commonjs/PlatformConstants.js +6 -1
  21. package/lib/commonjs/PlatformConstants.js.map +1 -1
  22. package/lib/commonjs/PlatformConstants.web.js +3 -1
  23. package/lib/commonjs/PlatformConstants.web.js.map +1 -1
  24. package/lib/commonjs/PointerType.js +5 -3
  25. package/lib/commonjs/PointerType.js.map +1 -1
  26. package/lib/commonjs/RNGestureHandlerModule.js +6 -2
  27. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  28. package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
  29. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  30. package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
  31. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  32. package/lib/commonjs/RNRenderer.js +3 -1
  33. package/lib/commonjs/RNRenderer.js.map +1 -1
  34. package/lib/commonjs/RNRenderer.web.js +2 -1
  35. package/lib/commonjs/RNRenderer.web.js.map +1 -1
  36. package/lib/commonjs/State.js +3 -4
  37. package/lib/commonjs/State.js.map +1 -1
  38. package/lib/commonjs/TouchEventType.js +3 -3
  39. package/lib/commonjs/TouchEventType.js.map +1 -1
  40. package/lib/commonjs/components/DrawerLayout.js +115 -90
  41. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  42. package/lib/commonjs/components/GestureButtons.js +81 -28
  43. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  44. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
  45. package/lib/commonjs/components/GestureComponents.js +37 -26
  46. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  47. package/lib/commonjs/components/GestureComponents.web.js +27 -13
  48. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  49. package/lib/commonjs/components/GestureHandlerButton.js +6 -2
  50. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  51. package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
  52. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
  53. package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
  54. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  55. package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
  56. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  57. package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
  58. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
  59. package/lib/commonjs/components/Pressable/Pressable.js +77 -29
  60. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
  61. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
  62. package/lib/commonjs/components/Pressable/index.js +3 -1
  63. package/lib/commonjs/components/Pressable/index.js.map +1 -1
  64. package/lib/commonjs/components/Pressable/utils.js +20 -5
  65. package/lib/commonjs/components/Pressable/utils.js.map +1 -1
  66. package/lib/commonjs/components/ReanimatedDrawerLayout.js +86 -44
  67. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
  68. package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
  69. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
  70. package/lib/commonjs/components/Swipeable.js +75 -34
  71. package/lib/commonjs/components/Swipeable.js.map +1 -1
  72. package/lib/commonjs/components/Text.js +28 -10
  73. package/lib/commonjs/components/Text.js.map +1 -1
  74. package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
  75. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
  76. package/lib/commonjs/components/touchables/ExtraButtonProps.js +2 -0
  77. package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
  78. package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
  79. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  80. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
  81. package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
  82. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  83. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
  84. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  85. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
  86. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
  87. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  88. package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
  89. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  90. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +25 -13
  91. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  92. package/lib/commonjs/components/touchables/index.js +12 -7
  93. package/lib/commonjs/components/touchables/index.js.map +1 -1
  94. package/lib/commonjs/findNodeHandle.js +4 -1
  95. package/lib/commonjs/findNodeHandle.js.map +1 -1
  96. package/lib/commonjs/findNodeHandle.web.js +14 -5
  97. package/lib/commonjs/findNodeHandle.web.js.map +1 -1
  98. package/lib/commonjs/getReactNativeVersion.js +6 -1
  99. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  100. package/lib/commonjs/getReactNativeVersion.web.js +1 -0
  101. package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
  102. package/lib/commonjs/getShadowNodeFromRef.js +14 -13
  103. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  104. package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
  105. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
  106. package/lib/commonjs/ghQueueMicrotask.js +2 -1
  107. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  108. package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
  109. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  110. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
  111. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  112. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
  113. package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
  114. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  115. package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
  116. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  117. package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
  118. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  119. package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
  120. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  121. package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
  122. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  123. package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
  124. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
  125. package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
  126. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  127. package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
  128. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  129. package/lib/commonjs/handlers/createHandler.js +146 -59
  130. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  131. package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
  132. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  133. package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
  134. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
  135. package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
  136. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
  137. package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
  138. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  139. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
  140. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
  141. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  142. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +21 -13
  143. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  144. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
  145. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  146. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
  147. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  148. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
  149. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  150. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
  151. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  152. package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
  153. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
  154. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  155. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
  156. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  157. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
  158. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  159. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
  160. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  161. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
  162. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  163. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
  164. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  165. package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
  166. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  167. package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
  168. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  169. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
  170. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  171. package/lib/commonjs/handlers/gestures/gesture.js +84 -44
  172. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  173. package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
  174. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  175. package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
  176. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  177. package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
  178. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  179. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
  180. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  181. package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
  182. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  183. package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
  184. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  185. package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
  186. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
  187. package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
  188. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  189. package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
  190. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  191. package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
  192. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  193. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
  194. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
  195. package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
  196. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  197. package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
  198. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  199. package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
  200. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
  201. package/lib/commonjs/handlers/handlersRegistry.js +21 -6
  202. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  203. package/lib/commonjs/handlers/utils.js +26 -6
  204. package/lib/commonjs/handlers/utils.js.map +1 -1
  205. package/lib/commonjs/index.js +104 -75
  206. package/lib/commonjs/index.js.map +1 -1
  207. package/lib/commonjs/init.js +11 -4
  208. package/lib/commonjs/init.js.map +1 -1
  209. package/lib/commonjs/jestUtils/index.js +5 -4
  210. package/lib/commonjs/jestUtils/index.js.map +1 -1
  211. package/lib/commonjs/jestUtils/jestUtils.js +83 -19
  212. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  213. package/lib/commonjs/mocks.js +15 -5
  214. package/lib/commonjs/mocks.js.map +1 -1
  215. package/lib/commonjs/mountRegistry.js +12 -3
  216. package/lib/commonjs/mountRegistry.js.map +1 -1
  217. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
  218. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
  219. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
  220. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  221. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
  222. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  223. package/lib/commonjs/typeUtils.js.map +1 -1
  224. package/lib/commonjs/utils.js +37 -13
  225. package/lib/commonjs/utils.js.map +1 -1
  226. package/lib/commonjs/web/Gestures.js +23 -5
  227. package/lib/commonjs/web/Gestures.js.map +1 -1
  228. package/lib/commonjs/web/constants.js +4 -2
  229. package/lib/commonjs/web/constants.js.map +1 -1
  230. package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
  231. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  232. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
  233. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  234. package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
  235. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  236. package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
  237. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  238. package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
  239. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
  240. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
  241. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
  242. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  243. package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
  244. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
  245. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
  246. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  247. package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
  248. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  249. package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
  250. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  251. package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
  252. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  253. package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
  254. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  255. package/lib/commonjs/web/interfaces.js +17 -9
  256. package/lib/commonjs/web/interfaces.js.map +1 -1
  257. package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
  258. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
  259. package/lib/commonjs/web/tools/EventManager.js +41 -7
  260. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  261. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
  262. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
  263. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  264. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
  265. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  266. package/lib/commonjs/web/tools/InteractionManager.js +22 -5
  267. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  268. package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
  269. package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
  270. package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
  271. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  272. package/lib/commonjs/web/tools/NodeManager.js +14 -7
  273. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  274. package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
  275. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  276. package/lib/commonjs/web/tools/PointerTracker.js +45 -9
  277. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  278. package/lib/commonjs/web/tools/Vector.js +18 -3
  279. package/lib/commonjs/web/tools/Vector.js.map +1 -1
  280. package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
  281. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  282. package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
  283. package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
  284. package/lib/commonjs/web/utils.js +76 -27
  285. package/lib/commonjs/web/utils.js.map +1 -1
  286. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
  287. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
  288. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
  289. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
  290. package/lib/commonjs/web_hammer/Errors.js +3 -0
  291. package/lib/commonjs/web_hammer/Errors.js.map +1 -1
  292. package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
  293. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
  294. package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
  295. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
  296. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
  297. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  298. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
  299. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
  300. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
  301. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
  302. package/lib/commonjs/web_hammer/NodeManager.js +16 -9
  303. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  304. package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
  305. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
  306. package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
  307. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
  308. package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
  309. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
  310. package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
  311. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
  312. package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
  313. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
  314. package/lib/commonjs/web_hammer/constants.js +26 -13
  315. package/lib/commonjs/web_hammer/constants.js.map +1 -1
  316. package/lib/commonjs/web_hammer/utils.js +14 -4
  317. package/lib/commonjs/web_hammer/utils.js.map +1 -1
  318. package/lib/module/ActionType.js +1 -3
  319. package/lib/module/ActionType.js.map +1 -1
  320. package/lib/module/Directions.js +3 -9
  321. package/lib/module/Directions.js.map +1 -1
  322. package/lib/module/EnableNewWebImplementation.js +5 -2
  323. package/lib/module/EnableNewWebImplementation.js.map +1 -1
  324. package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
  325. package/lib/module/PlatformConstants.js +1 -0
  326. package/lib/module/PlatformConstants.js.map +1 -1
  327. package/lib/module/PlatformConstants.web.js +1 -0
  328. package/lib/module/PlatformConstants.web.js.map +1 -1
  329. package/lib/module/PointerType.js +4 -3
  330. package/lib/module/PointerType.js.map +1 -1
  331. package/lib/module/RNGestureHandlerModule.js +0 -1
  332. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  333. package/lib/module/RNGestureHandlerModule.web.js +20 -10
  334. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  335. package/lib/module/RNGestureHandlerModule.windows.js +17 -18
  336. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  337. package/lib/module/RNRenderer.js.map +1 -1
  338. package/lib/module/RNRenderer.web.js.map +1 -1
  339. package/lib/module/State.js +1 -4
  340. package/lib/module/State.js.map +1 -1
  341. package/lib/module/TouchEventType.js +1 -3
  342. package/lib/module/TouchEventType.js.map +1 -1
  343. package/lib/module/components/DrawerLayout.js +99 -80
  344. package/lib/module/components/DrawerLayout.js.map +1 -1
  345. package/lib/module/components/GestureButtons.js +55 -19
  346. package/lib/module/components/GestureButtons.js.map +1 -1
  347. package/lib/module/components/GestureButtonsProps.js.map +1 -1
  348. package/lib/module/components/GestureComponents.js +12 -17
  349. package/lib/module/components/GestureComponents.js.map +1 -1
  350. package/lib/module/components/GestureComponents.web.js +4 -4
  351. package/lib/module/components/GestureComponents.web.js.map +1 -1
  352. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  353. package/lib/module/components/GestureHandlerButton.web.js +2 -1
  354. package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
  355. package/lib/module/components/GestureHandlerRootView.android.js +2 -1
  356. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  357. package/lib/module/components/GestureHandlerRootView.js +2 -1
  358. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  359. package/lib/module/components/GestureHandlerRootView.web.js +2 -1
  360. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
  361. package/lib/module/components/Pressable/Pressable.js +59 -26
  362. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  363. package/lib/module/components/Pressable/PressableProps.js.map +1 -1
  364. package/lib/module/components/Pressable/index.js.map +1 -1
  365. package/lib/module/components/Pressable/utils.js +14 -4
  366. package/lib/module/components/Pressable/utils.js.map +1 -1
  367. package/lib/module/components/ReanimatedDrawerLayout.js +66 -40
  368. package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
  369. package/lib/module/components/ReanimatedSwipeable.js +30 -14
  370. package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
  371. package/lib/module/components/Swipeable.js +59 -28
  372. package/lib/module/components/Swipeable.js.map +1 -1
  373. package/lib/module/components/Text.js +15 -7
  374. package/lib/module/components/Text.js.map +1 -1
  375. package/lib/module/components/gestureHandlerRootHOC.js +2 -2
  376. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
  377. package/lib/module/components/touchables/ExtraButtonProps.js +2 -0
  378. package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
  379. package/lib/module/components/touchables/GenericTouchable.js +63 -34
  380. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  381. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
  382. package/lib/module/components/touchables/TouchableHighlight.js +24 -15
  383. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  384. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
  385. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  386. package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
  387. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
  388. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  389. package/lib/module/components/touchables/TouchableOpacity.js +16 -10
  390. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  391. package/lib/module/components/touchables/TouchableWithoutFeedback.js +15 -10
  392. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  393. package/lib/module/components/touchables/index.js.map +1 -1
  394. package/lib/module/findNodeHandle.js.map +1 -1
  395. package/lib/module/findNodeHandle.web.js +11 -5
  396. package/lib/module/findNodeHandle.web.js.map +1 -1
  397. package/lib/module/getReactNativeVersion.js.map +1 -1
  398. package/lib/module/getReactNativeVersion.web.js.map +1 -1
  399. package/lib/module/getShadowNodeFromRef.js +13 -13
  400. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  401. package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
  402. package/lib/module/ghQueueMicrotask.js.map +1 -1
  403. package/lib/module/handlers/FlingGestureHandler.js +0 -6
  404. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  405. package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
  406. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  407. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
  408. package/lib/module/handlers/LongPressGestureHandler.js +0 -6
  409. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  410. package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
  411. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  412. package/lib/module/handlers/PanGestureHandler.js +19 -8
  413. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  414. package/lib/module/handlers/PinchGestureHandler.js +0 -2
  415. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  416. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  417. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
  418. package/lib/module/handlers/RotationGestureHandler.js +0 -2
  419. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  420. package/lib/module/handlers/TapGestureHandler.js +0 -6
  421. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  422. package/lib/module/handlers/createHandler.js +119 -57
  423. package/lib/module/handlers/createHandler.js.map +1 -1
  424. package/lib/module/handlers/createNativeWrapper.js +22 -15
  425. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  426. package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
  427. package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
  428. package/lib/module/handlers/gestureHandlerCommon.js +4 -9
  429. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  430. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
  431. package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
  432. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  433. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +7 -8
  434. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  435. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
  436. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  437. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
  438. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  439. package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
  440. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  441. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
  442. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  443. package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
  444. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
  445. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  446. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
  447. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  448. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
  449. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  450. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
  451. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  452. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
  453. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  454. package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
  455. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  456. package/lib/module/handlers/gestures/eventReceiver.js +38 -14
  457. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  458. package/lib/module/handlers/gestures/flingGesture.js +9 -5
  459. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  460. package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
  461. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  462. package/lib/module/handlers/gestures/gesture.js +73 -44
  463. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  464. package/lib/module/handlers/gestures/gestureComposition.js +24 -16
  465. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  466. package/lib/module/handlers/gestures/gestureObjects.js +14 -1
  467. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  468. package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
  469. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  470. package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
  471. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  472. package/lib/module/handlers/gestures/hoverGesture.js +18 -9
  473. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  474. package/lib/module/handlers/gestures/longPressGesture.js +11 -6
  475. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  476. package/lib/module/handlers/gestures/manualGesture.js +4 -0
  477. package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
  478. package/lib/module/handlers/gestures/nativeGesture.js +9 -5
  479. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  480. package/lib/module/handlers/gestures/panGesture.js +41 -18
  481. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  482. package/lib/module/handlers/gestures/pinchGesture.js +7 -2
  483. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  484. package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
  485. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
  486. package/lib/module/handlers/gestures/rotationGesture.js +7 -2
  487. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  488. package/lib/module/handlers/gestures/tapGesture.js +19 -10
  489. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  490. package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
  491. package/lib/module/handlers/handlersRegistry.js +5 -0
  492. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  493. package/lib/module/handlers/utils.js +13 -4
  494. package/lib/module/handlers/utils.js.map +1 -1
  495. package/lib/module/index.js.map +1 -1
  496. package/lib/module/init.js +2 -3
  497. package/lib/module/init.js.map +1 -1
  498. package/lib/module/jestUtils/index.js.map +1 -1
  499. package/lib/module/jestUtils/jestUtils.js +66 -20
  500. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  501. package/lib/module/mocks.js +7 -3
  502. package/lib/module/mocks.js.map +1 -1
  503. package/lib/module/mountRegistry.js +10 -3
  504. package/lib/module/mountRegistry.js.map +1 -1
  505. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
  506. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  507. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  508. package/lib/module/typeUtils.js.map +1 -1
  509. package/lib/module/utils.js +15 -6
  510. package/lib/module/utils.js.map +1 -1
  511. package/lib/module/web/Gestures.js +1 -2
  512. package/lib/module/web/Gestures.js.map +1 -1
  513. package/lib/module/web/constants.js.map +1 -1
  514. package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
  515. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  516. package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
  517. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  518. package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
  519. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  520. package/lib/module/web/handlers/GestureHandler.js +181 -61
  521. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  522. package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
  523. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  524. package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
  525. package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
  526. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  527. package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
  528. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  529. package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
  530. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  531. package/lib/module/web/handlers/PanGestureHandler.js +114 -7
  532. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  533. package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
  534. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  535. package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
  536. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  537. package/lib/module/web/handlers/TapGestureHandler.js +59 -5
  538. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  539. package/lib/module/web/interfaces.js +14 -9
  540. package/lib/module/web/interfaces.js.map +1 -1
  541. package/lib/module/web/tools/CircularBuffer.js +13 -3
  542. package/lib/module/web/tools/CircularBuffer.js.map +1 -1
  543. package/lib/module/web/tools/EventManager.js +39 -7
  544. package/lib/module/web/tools/EventManager.js.map +1 -1
  545. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
  546. package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
  547. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  548. package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
  549. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  550. package/lib/module/web/tools/InteractionManager.js +19 -5
  551. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  552. package/lib/module/web/tools/KeyboardEventManager.js +19 -3
  553. package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
  554. package/lib/module/web/tools/LeastSquareSolver.js +65 -30
  555. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  556. package/lib/module/web/tools/NodeManager.js +12 -7
  557. package/lib/module/web/tools/NodeManager.js.map +1 -1
  558. package/lib/module/web/tools/PointerEventManager.js +35 -9
  559. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  560. package/lib/module/web/tools/PointerTracker.js +39 -8
  561. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  562. package/lib/module/web/tools/Vector.js +14 -3
  563. package/lib/module/web/tools/Vector.js.map +1 -1
  564. package/lib/module/web/tools/VelocityTracker.js +25 -8
  565. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  566. package/lib/module/web/tools/WheelEventManager.js +10 -3
  567. package/lib/module/web/tools/WheelEventManager.js.map +1 -1
  568. package/lib/module/web/utils.js +57 -22
  569. package/lib/module/web/utils.js.map +1 -1
  570. package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
  571. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
  572. package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
  573. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
  574. package/lib/module/web_hammer/Errors.js +1 -0
  575. package/lib/module/web_hammer/Errors.js.map +1 -1
  576. package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
  577. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
  578. package/lib/module/web_hammer/GestureHandler.js +130 -53
  579. package/lib/module/web_hammer/GestureHandler.js.map +1 -1
  580. package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
  581. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  582. package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
  583. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
  584. package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
  585. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
  586. package/lib/module/web_hammer/NodeManager.js +8 -6
  587. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  588. package/lib/module/web_hammer/PanGestureHandler.js +40 -6
  589. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
  590. package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
  591. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
  592. package/lib/module/web_hammer/PressGestureHandler.js +34 -13
  593. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
  594. package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
  595. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
  596. package/lib/module/web_hammer/TapGestureHandler.js +45 -31
  597. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
  598. package/lib/module/web_hammer/constants.js +1 -2
  599. package/lib/module/web_hammer/constants.js.map +1 -1
  600. package/lib/module/web_hammer/utils.js +2 -2
  601. package/lib/module/web_hammer/utils.js.map +1 -1
  602. package/lib/typescript/components/GestureComponents.d.ts +1 -1
  603. package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
  604. package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
  605. package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
  606. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
  607. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
  608. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
  609. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
  610. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
  611. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
  612. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
  613. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
  614. package/lib/typescript/utils.d.ts +1 -0
  615. package/lib/typescript/web/utils.d.ts +2 -0
  616. package/package.json +9 -8
  617. package/src/components/GestureComponents.tsx +1 -1
  618. package/src/components/ReanimatedDrawerLayout.tsx +17 -4
  619. package/src/components/Text.tsx +5 -0
  620. package/src/components/touchables/ExtraButtonProps.ts +7 -0
  621. package/src/components/touchables/GenericTouchable.tsx +0 -2
  622. package/src/components/touchables/GenericTouchableProps.ts +2 -0
  623. package/src/components/touchables/TouchableHighlight.tsx +2 -2
  624. package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
  625. package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
  626. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -8
  627. package/src/components/touchables/TouchableOpacity.tsx +2 -2
  628. package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
  629. package/src/handlers/createHandler.tsx +20 -9
  630. package/src/handlers/createNativeWrapper.tsx +7 -3
  631. package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
  632. package/src/utils.ts +6 -0
  633. package/src/web/utils.ts +21 -3
@@ -1,8 +1,8 @@
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); }
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
2
3
  import * as React from 'react';
3
4
  import { useImperativeHandle, useRef } from 'react';
4
5
  import { NativeViewGestureHandler, nativeViewProps } from './NativeViewGestureHandler';
5
-
6
6
  /*
7
7
  * This array should consist of:
8
8
  * - All keys in propTypes from NativeGestureHandler
@@ -10,9 +10,11 @@ import { NativeViewGestureHandler, nativeViewProps } from './NativeViewGestureHa
10
10
  * - 'onGestureHandlerEvent'
11
11
  * - 'onGestureHandlerStateChange'
12
12
  */
13
+
13
14
  const NATIVE_WRAPPER_PROPS_FILTER = [...nativeViewProps, 'onGestureHandlerEvent', 'onGestureHandlerStateChange'];
14
15
  export default function createNativeWrapper(Component, config = {}) {
15
16
  var _Component$render;
17
+
16
18
  const ComponentWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {
17
19
  // Filter out props that should be passed to gesture handler wrapper
18
20
  const {
@@ -21,6 +23,7 @@ export default function createNativeWrapper(Component, config = {}) {
21
23
  } = Object.keys(props).reduce((res, key) => {
22
24
  // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
23
25
  const allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
26
+
24
27
  if (allowedKeys.includes(key)) {
25
28
  // @ts-ignore FIXME(TS)
26
29
  res.gestureHandlerProps[key] = props[key];
@@ -28,28 +31,33 @@ export default function createNativeWrapper(Component, config = {}) {
28
31
  // @ts-ignore FIXME(TS)
29
32
  res.childProps[key] = props[key];
30
33
  }
34
+
31
35
  return res;
32
36
  }, {
33
- gestureHandlerProps: {
34
- ...config
37
+ gestureHandlerProps: { ...config
35
38
  },
36
39
  // Watch out not to modify config
37
40
  childProps: {
38
- enabled: props.enabled
41
+ enabled: props.enabled,
42
+ hitSlop: props.hitSlop,
43
+ testID: props.testID
39
44
  }
40
45
  });
41
- const _ref = useRef();
42
- const _gestureHandlerRef = useRef();
43
- useImperativeHandle(ref,
44
- // @ts-ignore TODO(TS) decide how nulls work in this context
46
+
47
+ const _ref = useRef(null);
48
+
49
+ const _gestureHandlerRef = useRef(null);
50
+
51
+ useImperativeHandle(ref, // @ts-ignore TODO(TS) decide how nulls work in this context
45
52
  () => {
46
- const node = _gestureHandlerRef.current;
47
- // Add handlerTag for relations config
53
+ const node = _gestureHandlerRef.current; // Add handlerTag for relations config
54
+
48
55
  if (_ref.current && node) {
49
56
  // @ts-ignore FIXME(TS) think about createHandler return type
50
57
  _ref.current.handlerTag = node.handlerTag;
51
58
  return _ref.current;
52
59
  }
60
+
53
61
  return null;
54
62
  }, [_ref, _gestureHandlerRef]);
55
63
  return /*#__PURE__*/React.createElement(NativeViewGestureHandler, _extends({}, gestureHandlerProps, {
@@ -58,11 +66,10 @@ export default function createNativeWrapper(Component, config = {}) {
58
66
  }), /*#__PURE__*/React.createElement(Component, _extends({}, childProps, {
59
67
  ref: _ref
60
68
  })));
61
- });
69
+ }); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
62
70
 
63
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
64
- 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
65
- Component === null || Component === void 0 || (_Component$render = Component.render) === null || _Component$render === void 0 ? void 0 : _Component$render.name) || typeof Component === 'string' && Component || 'ComponentWrapper';
71
+ 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
72
+ Component === null || Component === void 0 ? void 0 : (_Component$render = Component.render) === null || _Component$render === void 0 ? void 0 : _Component$render.name) || typeof Component === 'string' && Component || 'ComponentWrapper';
66
73
  return ComponentWrapper;
67
74
  }
68
75
  //# sourceMappingURL=createNativeWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useImperativeHandle","useRef","NativeViewGestureHandler","nativeViewProps","NATIVE_WRAPPER_PROPS_FILTER","createNativeWrapper","Component","config","_Component$render","ComponentWrapper","forwardRef","props","ref","gestureHandlerProps","childProps","Object","keys","reduce","res","key","allowedKeys","includes","enabled","_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, childProps } = 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.gestureHandlerProps[key] = props[key];\n } else {\n // @ts-ignore FIXME(TS)\n res.childProps[key] = props[key];\n }\n return res;\n },\n {\n gestureHandlerProps: { ...config }, // Watch out not to modify config\n childProps: { enabled: props.enabled } as P,\n }\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 // @ts-ignore TODO(TS)\n ref={_gestureHandlerRef}>\n <Component {...childProps} 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;\n}\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAEnD,SACEC,wBAAwB,EAExBC,eAAe,QACV,4BAA4B;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,CAClC,GAAGD,eAAe,EAClB,uBAAuB,EACvB,6BAA6B,CACrB;AAEV,eAAe,SAASE,mBAAmBA,CACzCC,SAAiC,EACjCC,MAA+C,GAAG,CAAC,CAAC,EACpD;EAAA,IAAAC,iBAAA;EACA,MAAMC,gBAAgB,gBAAGV,KAAK,CAACW,UAAU,CAGvC,CAACC,KAAK,EAAEC,GAAG,KAAK;IAChB;IACA,MAAM;MAAEC,mBAAmB;MAAEC;IAAW,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACL,KAAK,CAAC,CAACM,MAAM,CACnE,CAACC,GAAG,EAAEC,GAAG,KAAK;MACZ;MACA,MAAMC,WAA8B,GAAGhB,2BAA2B;MAClE,IAAIgB,WAAW,CAACC,QAAQ,CAACF,GAAG,CAAC,EAAE;QAC7B;QACAD,GAAG,CAACL,mBAAmB,CAACM,GAAG,CAAC,GAAGR,KAAK,CAACQ,GAAG,CAAC;MAC3C,CAAC,MAAM;QACL;QACAD,GAAG,CAACJ,UAAU,CAACK,GAAG,CAAC,GAAGR,KAAK,CAACQ,GAAG,CAAC;MAClC;MACA,OAAOD,GAAG;IACZ,CAAC,EACD;MACEL,mBAAmB,EAAE;QAAE,GAAGN;MAAO,CAAC;MAAE;MACpCO,UAAU,EAAE;QAAEQ,OAAO,EAAEX,KAAK,CAACW;MAAQ;IACvC,CACF,CAAC;IACD,MAAMC,IAAI,GAAGtB,MAAM,CAAyB,CAAC;IAC7C,MAAMuB,kBAAkB,GAAGvB,MAAM,CAAyB,CAAC;IAC3DD,mBAAmB,CACjBY,GAAG;IACH;IACA,MAAM;MACJ,MAAMa,IAAI,GAAGD,kBAAkB,CAACE,OAAO;MACvC;MACA,IAAIH,IAAI,CAACG,OAAO,IAAID,IAAI,EAAE;QACxB;QACAF,IAAI,CAACG,OAAO,CAACC,UAAU,GAAGF,IAAI,CAACE,UAAU;QACzC,OAAOJ,IAAI,CAACG,OAAO;MACrB;MACA,OAAO,IAAI;IACb,CAAC,EACD,CAACH,IAAI,EAAEC,kBAAkB,CAC3B,CAAC;IACD,oBACEzB,KAAA,CAAA6B,aAAA,CAAC1B,wBAAwB,EAAA2B,QAAA,KACnBhB,mBAAmB;MACvB;MACAD,GAAG,EAAEY;IAAmB,iBACxBzB,KAAA,CAAA6B,aAAA,CAACtB,SAAS,EAAAuB,QAAA,KAAKf,UAAU;MAAEF,GAAG,EAAEW;IAAK,EAAE,CACf,CAAC;EAE/B,CAAC,CAAC;;EAEF;EACAd,gBAAgB,CAACqB,WAAW,GAC1B,CAAAxB,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEwB,WAAW,MACtB;EACAxB,SAAS,aAATA,SAAS,gBAAAE,iBAAA,GAATF,SAAS,CAAEyB,MAAM,cAAAvB,iBAAA,uBAAjBA,iBAAA,CAAmBwB,IAAI,KACtB,OAAO1B,SAAS,KAAK,QAAQ,IAAIA,SAAU,IAC5C,kBAAkB;EAEpB,OAAOG,gBAAgB;AACzB","ignoreList":[]}
1
+ {"version":3,"sources":["createNativeWrapper.tsx"],"names":["React","useImperativeHandle","useRef","NativeViewGestureHandler","nativeViewProps","NATIVE_WRAPPER_PROPS_FILTER","createNativeWrapper","Component","config","ComponentWrapper","forwardRef","props","ref","gestureHandlerProps","childProps","Object","keys","reduce","res","key","allowedKeys","includes","enabled","hitSlop","testID","_ref","_gestureHandlerRef","node","current","handlerTag","displayName","render","name"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,mBAAT,EAA8BC,MAA9B,QAA4C,OAA5C;AAEA,SACEC,wBADF,EAGEC,eAHF,QAIO,4BAJP;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,2BAA2B,GAAG,CAClC,GAAGD,eAD+B,EAElC,uBAFkC,EAGlC,6BAHkC,CAApC;AAMA,eAAe,SAASE,mBAAT,CACbC,SADa,EAEbC,MAA+C,GAAG,EAFrC,EAGb;AAAA;;AACA,QAAMC,gBAAgB,gBAAGT,KAAK,CAACU,UAAN,CAGvB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChB;AACA,UAAM;AAAEC,MAAAA,mBAAF;AAAuBC,MAAAA;AAAvB,QAAsCC,MAAM,CAACC,IAAP,CAAYL,KAAZ,EAAmBM,MAAnB,CAC1C,CAACC,GAAD,EAAMC,GAAN,KAAc;AACZ;AACA,YAAMC,WAA8B,GAAGf,2BAAvC;;AACA,UAAIe,WAAW,CAACC,QAAZ,CAAqBF,GAArB,CAAJ,EAA+B;AAC7B;AACAD,QAAAA,GAAG,CAACL,mBAAJ,CAAwBM,GAAxB,IAA+BR,KAAK,CAACQ,GAAD,CAApC;AACD,OAHD,MAGO;AACL;AACAD,QAAAA,GAAG,CAACJ,UAAJ,CAAeK,GAAf,IAAsBR,KAAK,CAACQ,GAAD,CAA3B;AACD;;AACD,aAAOD,GAAP;AACD,KAZyC,EAa1C;AACEL,MAAAA,mBAAmB,EAAE,EAAE,GAAGL;AAAL,OADvB;AACsC;AACpCM,MAAAA,UAAU,EAAE;AACVQ,QAAAA,OAAO,EAAEX,KAAK,CAACW,OADL;AAEVC,QAAAA,OAAO,EAAEZ,KAAK,CAACY,OAFL;AAGVC,QAAAA,MAAM,EAAEb,KAAK,CAACa;AAHJ;AAFd,KAb0C,CAA5C;;AAsBA,UAAMC,IAAI,GAAGvB,MAAM,CAAyB,IAAzB,CAAnB;;AACA,UAAMwB,kBAAkB,GAAGxB,MAAM,CAAyB,IAAzB,CAAjC;;AACAD,IAAAA,mBAAmB,CACjBW,GADiB,EAEjB;AACA,UAAM;AACJ,YAAMe,IAAI,GAAGD,kBAAkB,CAACE,OAAhC,CADI,CAEJ;;AACA,UAAIH,IAAI,CAACG,OAAL,IAAgBD,IAApB,EAA0B;AACxB;AACAF,QAAAA,IAAI,CAACG,OAAL,CAAaC,UAAb,GAA0BF,IAAI,CAACE,UAA/B;AACA,eAAOJ,IAAI,CAACG,OAAZ;AACD;;AACD,aAAO,IAAP;AACD,KAZgB,EAajB,CAACH,IAAD,EAAOC,kBAAP,CAbiB,CAAnB;AAeA,wBACE,oBAAC,wBAAD,eACMb,mBADN;AAEE;AACA,MAAA,GAAG,EAAEa;AAHP,qBAIE,oBAAC,SAAD,eAAeZ,UAAf;AAA2B,MAAA,GAAG,EAAEW;AAAhC,OAJF,CADF;AAQD,GApDwB,CAAzB,CADA,CAuDA;;AACAhB,EAAAA,gBAAgB,CAACqB,WAAjB,GACE,CAAAvB,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEuB,WAAX,OACA;AACAvB,EAAAA,SAFA,aAEAA,SAFA,4CAEAA,SAAS,CAAEwB,MAFX,sDAEA,kBAAmBC,IAFnB,KAGC,OAAOzB,SAAP,KAAqB,QAArB,IAAiCA,SAHlC,IAIA,kBALF;AAOA,SAAOE,gBAAP;AACD","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, childProps } = 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.gestureHandlerProps[key] = props[key];\n } else {\n // @ts-ignore FIXME(TS)\n res.childProps[key] = props[key];\n }\n return res;\n },\n {\n gestureHandlerProps: { ...config }, // Watch out not to modify config\n childProps: {\n enabled: props.enabled,\n hitSlop: props.hitSlop,\n testID: props.testID,\n } as P,\n }\n );\n const _ref = useRef<React.ComponentType<P>>(null);\n const _gestureHandlerRef = useRef<React.ComponentType<P>>(null);\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 // @ts-ignore TODO(TS)\n ref={_gestureHandlerRef}>\n <Component {...childProps} 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;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["customDirectEventTypes"],"sources":["customDirectEventTypes.ts"],"sourcesContent":["// @ts-ignore - its taken straight from RN\nexport { customDirectEventTypes } from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry';\n"],"mappings":"AAAA;AACA,SAASA,sBAAsB,QAAQ,qEAAqE","ignoreList":[]}
1
+ {"version":3,"sources":["customDirectEventTypes.ts"],"names":["customDirectEventTypes"],"mappings":"AAAA;AACA,SAASA,sBAAT,QAAuC,qEAAvC","sourcesContent":["// @ts-ignore - its taken straight from RN\nexport { customDirectEventTypes } from 'react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["customDirectEventTypes"],"sources":["customDirectEventTypes.web.ts"],"sourcesContent":["// customDirectEventTypes doesn't exist in react-native-web, therefore importing it\n// directly in createHandler.tsx would end in crash.\nconst customDirectEventTypes = {};\n\nexport { customDirectEventTypes };\n"],"mappings":"AAAA;AACA;AACA,MAAMA,sBAAsB,GAAG,CAAC,CAAC;AAEjC,SAASA,sBAAsB","ignoreList":[]}
1
+ {"version":3,"sources":["customDirectEventTypes.web.ts"],"names":["customDirectEventTypes"],"mappings":"AAAA;AACA;AACA,MAAMA,sBAAsB,GAAG,EAA/B;AAEA,SAASA,sBAAT","sourcesContent":["// customDirectEventTypes doesn't exist in react-native-web, therefore importing it\n// directly in createHandler.tsx would end in crash.\nconst customDirectEventTypes = {};\n\nexport { customDirectEventTypes };\n"]}
@@ -2,23 +2,18 @@
2
2
  // Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof
3
3
  // e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.
4
4
  // See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.
5
-
6
5
  const commonProps = ['id', 'enabled', 'shouldCancelWhenOutside', 'hitSlop', 'cancelsTouchesInView', 'userSelect', 'activeCursor', 'mouseButton', 'enableContextMenu', 'touchAction'];
7
6
  const componentInteractionProps = ['waitFor', 'simultaneousHandlers', 'blocksHandlers'];
8
7
  export const baseGestureHandlerProps = [...commonProps, ...componentInteractionProps, 'onBegan', 'onFailed', 'onCancelled', 'onActivated', 'onEnded', 'onGestureEvent', 'onHandlerStateChange'];
9
8
  export const baseGestureHandlerWithDetectorProps = [...commonProps, 'needsPointerData', 'manualActivation'];
10
- export let MouseButton = /*#__PURE__*/function (MouseButton) {
9
+ export let MouseButton;
10
+
11
+ (function (MouseButton) {
11
12
  MouseButton[MouseButton["LEFT"] = 1] = "LEFT";
12
13
  MouseButton[MouseButton["RIGHT"] = 2] = "RIGHT";
13
14
  MouseButton[MouseButton["MIDDLE"] = 4] = "MIDDLE";
14
15
  MouseButton[MouseButton["BUTTON_4"] = 8] = "BUTTON_4";
15
16
  MouseButton[MouseButton["BUTTON_5"] = 16] = "BUTTON_5";
16
17
  MouseButton[MouseButton["ALL"] = 31] = "ALL";
17
- return MouseButton;
18
- }({});
19
-
20
- // TODO(TS) events in handlers
21
-
22
- // Events payloads are types instead of interfaces due to TS limitation.
23
- // See https://github.com/microsoft/TypeScript/issues/15300 for more info.
18
+ })(MouseButton || (MouseButton = {}));
24
19
  //# sourceMappingURL=gestureHandlerCommon.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["commonProps","componentInteractionProps","baseGestureHandlerProps","baseGestureHandlerWithDetectorProps","MouseButton"],"sources":["gestureHandlerCommon.ts"],"sourcesContent":["// Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.\n// Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof\n// e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.\n// See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.\nimport * as React from 'react';\n\nimport { State } from '../State';\nimport { TouchEventType } from '../TouchEventType';\nimport { ValueOf } from '../typeUtils';\nimport { PointerType } from '../PointerType';\n\nconst commonProps = [\n 'id',\n 'enabled',\n 'shouldCancelWhenOutside',\n 'hitSlop',\n 'cancelsTouchesInView',\n 'userSelect',\n 'activeCursor',\n 'mouseButton',\n 'enableContextMenu',\n 'touchAction',\n] as const;\n\nconst componentInteractionProps = [\n 'waitFor',\n 'simultaneousHandlers',\n 'blocksHandlers',\n] as const;\n\nexport const baseGestureHandlerProps = [\n ...commonProps,\n ...componentInteractionProps,\n 'onBegan',\n 'onFailed',\n 'onCancelled',\n 'onActivated',\n 'onEnded',\n 'onGestureEvent',\n 'onHandlerStateChange',\n] as const;\n\nexport const baseGestureHandlerWithDetectorProps = [\n ...commonProps,\n 'needsPointerData',\n 'manualActivation',\n];\n\nexport interface GestureEventPayload {\n handlerTag: number;\n numberOfPointers: number;\n state: ValueOf<typeof State>;\n pointerType: PointerType;\n}\nexport interface HandlerStateChangeEventPayload extends GestureEventPayload {\n oldState: ValueOf<typeof State>;\n}\n\nexport type HitSlop =\n | number\n | null\n | undefined\n | Partial<\n Record<\n 'left' | 'right' | 'top' | 'bottom' | 'vertical' | 'horizontal',\n number\n >\n >\n | Record<'width' | 'left', number>\n | Record<'width' | 'right', number>\n | Record<'height' | 'top', number>\n | Record<'height' | 'bottom', number>;\n\nexport type UserSelect = 'none' | 'auto' | 'text';\nexport type ActiveCursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'e-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'col-resize'\n | 'row-resize'\n | 'all-scroll'\n | 'zoom-in'\n | 'zoom-out';\n\nexport enum MouseButton {\n LEFT = 1,\n RIGHT = 2,\n MIDDLE = 4,\n BUTTON_4 = 8,\n BUTTON_5 = 16,\n ALL = 31,\n}\n\nexport type TouchAction =\n | 'auto'\n | 'none'\n | 'pan-x'\n | 'pan-left'\n | 'pan-right'\n | 'pan-y'\n | 'pan-up'\n | 'pan-down'\n | 'pinch-zoom'\n | 'manipulation'\n | 'inherit'\n | 'initial'\n | 'revert'\n | 'revert-layer'\n | 'unset';\n\n// TODO(TS) events in handlers\n\nexport interface GestureEvent<ExtraEventPayloadT = Record<string, unknown>> {\n nativeEvent: Readonly<GestureEventPayload & ExtraEventPayloadT>;\n}\nexport interface HandlerStateChangeEvent<\n ExtraEventPayloadT = Record<string, unknown>,\n> {\n nativeEvent: Readonly<HandlerStateChangeEventPayload & ExtraEventPayloadT>;\n}\n\nexport type TouchData = {\n id: number;\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n};\n\nexport type GestureTouchEvent = {\n handlerTag: number;\n numberOfTouches: number;\n state: ValueOf<typeof State>;\n eventType: TouchEventType;\n allTouches: TouchData[];\n changedTouches: TouchData[];\n pointerType: PointerType;\n};\n\nexport type GestureUpdateEvent<GestureEventPayloadT = Record<string, unknown>> =\n GestureEventPayload & GestureEventPayloadT;\n\nexport type GestureStateChangeEvent<\n GestureStateChangeEventPayloadT = Record<string, unknown>,\n> = HandlerStateChangeEventPayload & GestureStateChangeEventPayloadT;\n\nexport type CommonGestureConfig = {\n enabled?: boolean;\n shouldCancelWhenOutside?: boolean;\n hitSlop?: HitSlop;\n userSelect?: UserSelect;\n activeCursor?: ActiveCursor;\n mouseButton?: MouseButton;\n enableContextMenu?: boolean;\n touchAction?: TouchAction;\n};\n\n// Events payloads are types instead of interfaces due to TS limitation.\n// See https://github.com/microsoft/TypeScript/issues/15300 for more info.\nexport type BaseGestureHandlerProps<\n ExtraEventPayloadT extends Record<string, unknown> = Record<string, unknown>,\n> = CommonGestureConfig & {\n id?: string;\n waitFor?: React.Ref<unknown> | React.Ref<unknown>[];\n simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n testID?: string;\n cancelsTouchesInView?: boolean;\n // TODO(TS) - fix event types\n onBegan?: (event: HandlerStateChangeEvent) => void;\n onFailed?: (event: HandlerStateChangeEvent) => void;\n onCancelled?: (event: HandlerStateChangeEvent) => void;\n onActivated?: (event: HandlerStateChangeEvent) => void;\n onEnded?: (event: HandlerStateChangeEvent) => void;\n\n // TODO(TS) consider using NativeSyntheticEvent\n onGestureEvent?: (event: GestureEvent<ExtraEventPayloadT>) => void;\n onHandlerStateChange?: (\n event: HandlerStateChangeEvent<ExtraEventPayloadT>\n ) => void;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAQA,MAAMA,WAAW,GAAG,CAClB,IAAI,EACJ,SAAS,EACT,yBAAyB,EACzB,SAAS,EACT,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,aAAa,CACL;AAEV,MAAMC,yBAAyB,GAAG,CAChC,SAAS,EACT,sBAAsB,EACtB,gBAAgB,CACR;AAEV,OAAO,MAAMC,uBAAuB,GAAG,CACrC,GAAGF,WAAW,EACd,GAAGC,yBAAyB,EAC5B,SAAS,EACT,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,sBAAsB,CACd;AAEV,OAAO,MAAME,mCAAmC,GAAG,CACjD,GAAGH,WAAW,EACd,kBAAkB,EAClB,kBAAkB,CACnB;AAkED,WAAYI,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AA0BvB;;AA+CA;AACA","ignoreList":[]}
1
+ {"version":3,"sources":["gestureHandlerCommon.ts"],"names":["commonProps","componentInteractionProps","baseGestureHandlerProps","baseGestureHandlerWithDetectorProps","MouseButton"],"mappings":"AAAA;AACA;AACA;AACA;AAQA,MAAMA,WAAW,GAAG,CAClB,IADkB,EAElB,SAFkB,EAGlB,yBAHkB,EAIlB,SAJkB,EAKlB,sBALkB,EAMlB,YANkB,EAOlB,cAPkB,EAQlB,aARkB,EASlB,mBATkB,EAUlB,aAVkB,CAApB;AAaA,MAAMC,yBAAyB,GAAG,CAChC,SADgC,EAEhC,sBAFgC,EAGhC,gBAHgC,CAAlC;AAMA,OAAO,MAAMC,uBAAuB,GAAG,CACrC,GAAGF,WADkC,EAErC,GAAGC,yBAFkC,EAGrC,SAHqC,EAIrC,UAJqC,EAKrC,aALqC,EAMrC,aANqC,EAOrC,SAPqC,EAQrC,gBARqC,EASrC,sBATqC,CAAhC;AAYP,OAAO,MAAME,mCAAmC,GAAG,CACjD,GAAGH,WAD8C,EAEjD,kBAFiD,EAGjD,kBAHiD,CAA5C;AAsEP,WAAYI,WAAZ;;WAAYA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["// Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.\n// Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof\n// e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.\n// See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.\nimport * as React from 'react';\n\nimport { State } from '../State';\nimport { TouchEventType } from '../TouchEventType';\nimport { ValueOf } from '../typeUtils';\nimport { PointerType } from '../PointerType';\n\nconst commonProps = [\n 'id',\n 'enabled',\n 'shouldCancelWhenOutside',\n 'hitSlop',\n 'cancelsTouchesInView',\n 'userSelect',\n 'activeCursor',\n 'mouseButton',\n 'enableContextMenu',\n 'touchAction',\n] as const;\n\nconst componentInteractionProps = [\n 'waitFor',\n 'simultaneousHandlers',\n 'blocksHandlers',\n] as const;\n\nexport const baseGestureHandlerProps = [\n ...commonProps,\n ...componentInteractionProps,\n 'onBegan',\n 'onFailed',\n 'onCancelled',\n 'onActivated',\n 'onEnded',\n 'onGestureEvent',\n 'onHandlerStateChange',\n] as const;\n\nexport const baseGestureHandlerWithDetectorProps = [\n ...commonProps,\n 'needsPointerData',\n 'manualActivation',\n];\n\nexport interface GestureEventPayload {\n handlerTag: number;\n numberOfPointers: number;\n state: ValueOf<typeof State>;\n pointerType: PointerType;\n}\nexport interface HandlerStateChangeEventPayload extends GestureEventPayload {\n oldState: ValueOf<typeof State>;\n}\n\nexport type HitSlop =\n | number\n | null\n | undefined\n | Partial<\n Record<\n 'left' | 'right' | 'top' | 'bottom' | 'vertical' | 'horizontal',\n number\n >\n >\n | Record<'width' | 'left', number>\n | Record<'width' | 'right', number>\n | Record<'height' | 'top', number>\n | Record<'height' | 'bottom', number>;\n\nexport type UserSelect = 'none' | 'auto' | 'text';\nexport type ActiveCursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'e-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'col-resize'\n | 'row-resize'\n | 'all-scroll'\n | 'zoom-in'\n | 'zoom-out';\n\nexport enum MouseButton {\n LEFT = 1,\n RIGHT = 2,\n MIDDLE = 4,\n BUTTON_4 = 8,\n BUTTON_5 = 16,\n ALL = 31,\n}\n\nexport type TouchAction =\n | 'auto'\n | 'none'\n | 'pan-x'\n | 'pan-left'\n | 'pan-right'\n | 'pan-y'\n | 'pan-up'\n | 'pan-down'\n | 'pinch-zoom'\n | 'manipulation'\n | 'inherit'\n | 'initial'\n | 'revert'\n | 'revert-layer'\n | 'unset';\n\n// TODO(TS) events in handlers\n\nexport interface GestureEvent<ExtraEventPayloadT = Record<string, unknown>> {\n nativeEvent: Readonly<GestureEventPayload & ExtraEventPayloadT>;\n}\nexport interface HandlerStateChangeEvent<\n ExtraEventPayloadT = Record<string, unknown>,\n> {\n nativeEvent: Readonly<HandlerStateChangeEventPayload & ExtraEventPayloadT>;\n}\n\nexport type TouchData = {\n id: number;\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n};\n\nexport type GestureTouchEvent = {\n handlerTag: number;\n numberOfTouches: number;\n state: ValueOf<typeof State>;\n eventType: TouchEventType;\n allTouches: TouchData[];\n changedTouches: TouchData[];\n pointerType: PointerType;\n};\n\nexport type GestureUpdateEvent<GestureEventPayloadT = Record<string, unknown>> =\n GestureEventPayload & GestureEventPayloadT;\n\nexport type GestureStateChangeEvent<\n GestureStateChangeEventPayloadT = Record<string, unknown>,\n> = HandlerStateChangeEventPayload & GestureStateChangeEventPayloadT;\n\nexport type CommonGestureConfig = {\n enabled?: boolean;\n shouldCancelWhenOutside?: boolean;\n hitSlop?: HitSlop;\n userSelect?: UserSelect;\n activeCursor?: ActiveCursor;\n mouseButton?: MouseButton;\n enableContextMenu?: boolean;\n touchAction?: TouchAction;\n};\n\n// Events payloads are types instead of interfaces due to TS limitation.\n// See https://github.com/microsoft/TypeScript/issues/15300 for more info.\nexport type BaseGestureHandlerProps<\n ExtraEventPayloadT extends Record<string, unknown> = Record<string, unknown>,\n> = CommonGestureConfig & {\n id?: string;\n waitFor?: React.Ref<unknown> | React.Ref<unknown>[];\n simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n testID?: string;\n cancelsTouchesInView?: boolean;\n // TODO(TS) - fix event types\n onBegan?: (event: HandlerStateChangeEvent) => void;\n onFailed?: (event: HandlerStateChangeEvent) => void;\n onCancelled?: (event: HandlerStateChangeEvent) => void;\n onActivated?: (event: HandlerStateChangeEvent) => void;\n onEnded?: (event: HandlerStateChangeEvent) => void;\n\n // TODO(TS) consider using NativeSyntheticEvent\n onGestureEvent?: (event: GestureEvent<ExtraEventPayloadT>) => void;\n onHandlerStateChange?: (\n event: HandlerStateChangeEvent<ExtraEventPayloadT>\n ) => void;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["gestureHandlerTypesCompat.ts"],"sourcesContent":["import type {\n BaseButtonProps,\n BorderlessButtonProps,\n RawButtonProps,\n RectButtonProps,\n} from '../components/GestureButtonsProps';\nimport {\n GestureEvent,\n GestureEventPayload,\n HandlerStateChangeEvent,\n HandlerStateChangeEventPayload,\n} from './gestureHandlerCommon';\nimport type { FlingGestureHandlerProps } from './FlingGestureHandler';\nimport type {\n FlingGestureHandlerEventPayload,\n ForceTouchGestureHandlerEventPayload,\n LongPressGestureHandlerEventPayload,\n PanGestureHandlerEventPayload,\n PinchGestureHandlerEventPayload,\n RotationGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n NativeViewGestureHandlerPayload,\n} from './GestureHandlerEventPayload';\nimport type { ForceTouchGestureHandlerProps } from './ForceTouchGestureHandler';\nimport type { LongPressGestureHandlerProps } from './LongPressGestureHandler';\nimport type { PanGestureHandlerProps } from './PanGestureHandler';\nimport type { PinchGestureHandlerProps } from './PinchGestureHandler';\nimport type { RotationGestureHandlerProps } from './RotationGestureHandler';\nimport type { TapGestureHandlerProps } from './TapGestureHandler';\nimport type { NativeViewGestureHandlerProps } from './NativeViewGestureHandler';\n\n// Events\nexport type GestureHandlerGestureEventNativeEvent = GestureEventPayload;\nexport type GestureHandlerStateChangeNativeEvent =\n HandlerStateChangeEventPayload;\nexport type GestureHandlerGestureEvent = GestureEvent;\nexport type GestureHandlerStateChangeEvent = HandlerStateChangeEvent;\n// Gesture handlers events\nexport type NativeViewGestureHandlerGestureEvent =\n GestureEvent<NativeViewGestureHandlerPayload>;\nexport type NativeViewGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<NativeViewGestureHandlerPayload>;\n\nexport type TapGestureHandlerGestureEvent =\n GestureEvent<TapGestureHandlerEventPayload>;\nexport type TapGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<TapGestureHandlerEventPayload>;\n\nexport type ForceTouchGestureHandlerGestureEvent =\n GestureEvent<ForceTouchGestureHandlerEventPayload>;\nexport type ForceTouchGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<ForceTouchGestureHandlerEventPayload>;\n\nexport type LongPressGestureHandlerGestureEvent =\n GestureEvent<LongPressGestureHandlerEventPayload>;\nexport type LongPressGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<LongPressGestureHandlerEventPayload>;\n\nexport type PanGestureHandlerGestureEvent =\n GestureEvent<PanGestureHandlerEventPayload>;\nexport type PanGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<PanGestureHandlerEventPayload>;\n\nexport type PinchGestureHandlerGestureEvent =\n GestureEvent<PinchGestureHandlerEventPayload>;\nexport type PinchGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<PinchGestureHandlerEventPayload>;\n\nexport type RotationGestureHandlerGestureEvent =\n GestureEvent<RotationGestureHandlerEventPayload>;\nexport type RotationGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<RotationGestureHandlerEventPayload>;\n\nexport type FlingGestureHandlerGestureEvent =\n GestureEvent<FlingGestureHandlerEventPayload>;\nexport type FlingGestureHandlerStateChangeEvent =\n HandlerStateChangeEvent<FlingGestureHandlerEventPayload>;\n\n// Handlers properties\nexport type NativeViewGestureHandlerProperties = NativeViewGestureHandlerProps;\nexport type TapGestureHandlerProperties = TapGestureHandlerProps;\nexport type LongPressGestureHandlerProperties = LongPressGestureHandlerProps;\nexport type PanGestureHandlerProperties = PanGestureHandlerProps;\nexport type PinchGestureHandlerProperties = PinchGestureHandlerProps;\nexport type RotationGestureHandlerProperties = RotationGestureHandlerProps;\nexport type FlingGestureHandlerProperties = FlingGestureHandlerProps;\nexport type ForceTouchGestureHandlerProperties = ForceTouchGestureHandlerProps;\n// Button props\nexport type RawButtonProperties = RawButtonProps;\nexport type BaseButtonProperties = BaseButtonProps;\nexport type RectButtonProperties = RectButtonProps;\nexport type BorderlessButtonProperties = BorderlessButtonProps;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,4 +1,5 @@
1
1
  var _Reanimated$default$c, _Reanimated$default;
2
+
2
3
  import React from 'react';
3
4
  import { Reanimated } from '../reanimatedWrapper';
4
5
  import { tagMessage } from '../../../utils';
@@ -13,13 +14,13 @@ export class Wrap extends React.Component {
13
14
  const child = React.Children.only(this.props.children);
14
15
  return /*#__PURE__*/React.cloneElement(child, {
15
16
  collapsable: false
16
- },
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
17
+ }, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
18
18
  child.props.children);
19
19
  } catch (e) {
20
20
  throw new Error(tagMessage(`GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
21
21
  }
22
22
  }
23
+
23
24
  }
24
- export const AnimatedWrap = (_Reanimated$default$c = Reanimated === null || Reanimated === void 0 || (_Reanimated$default = Reanimated.default) === null || _Reanimated$default === void 0 ? void 0 : _Reanimated$default.createAnimatedComponent(Wrap)) !== null && _Reanimated$default$c !== void 0 ? _Reanimated$default$c : Wrap;
25
+ export const AnimatedWrap = (_Reanimated$default$c = Reanimated === null || Reanimated === void 0 ? void 0 : (_Reanimated$default = Reanimated.default) === null || _Reanimated$default === void 0 ? void 0 : _Reanimated$default.createAnimatedComponent(Wrap)) !== null && _Reanimated$default$c !== void 0 ? _Reanimated$default$c : Wrap;
25
26
  //# sourceMappingURL=Wrap.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Reanimated","tagMessage","Wrap","Component","render","child","Children","only","props","children","cloneElement","collapsable","e","Error","AnimatedWrap","_Reanimated$default$c","_Reanimated$default","default","createAnimatedComponent"],"sources":["Wrap.tsx"],"sourcesContent":["import React from 'react';\nimport { Reanimated } from '../reanimatedWrapper';\nimport { tagMessage } from '../../../utils';\n\nexport class Wrap extends React.Component<{\n onGestureHandlerEvent?: unknown;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n}> {\n render() {\n try {\n // I don't think that fighting with types over such a simple function is worth it\n // The only thing it does is add 'collapsable: false' to the child component\n // to make sure it is in the native view hierarchy so the detector can find\n // correct viewTag to attach to.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(this.props.children);\n return React.cloneElement(\n child,\n { collapsable: false },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n}\n\nexport const AnimatedWrap =\n Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,OAAO,MAAMC,IAAI,SAASH,KAAK,CAACI,SAAS,CAItC;EACDC,MAAMA,CAAA,EAAG;IACP,IAAI;MACF;MACA;MACA;MACA;MACA;MACA,MAAMC,KAAU,GAAGN,KAAK,CAACO,QAAQ,CAACC,IAAI,CAAC,IAAI,CAACC,KAAK,CAACC,QAAQ,CAAC;MAC3D,oBAAOV,KAAK,CAACW,YAAY,CACvBL,KAAK,EACL;QAAEM,WAAW,EAAE;MAAM,CAAC;MACtB;MACAN,KAAK,CAACG,KAAK,CAACC,QACd,CAAC;IACH,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,MAAM,IAAIC,KAAK,CACbZ,UAAU,CACR,2KACF,CACF,CAAC;IACH;EACF;AACF;AAEA,OAAO,MAAMa,YAAY,IAAAC,qBAAA,GACvBf,UAAU,aAAVA,UAAU,gBAAAgB,mBAAA,GAAVhB,UAAU,CAAEiB,OAAO,cAAAD,mBAAA,uBAAnBA,mBAAA,CAAqBE,uBAAuB,CAAChB,IAAI,CAAC,cAAAa,qBAAA,cAAAA,qBAAA,GAAIb,IAAI","ignoreList":[]}
1
+ {"version":3,"sources":["Wrap.tsx"],"names":["React","Reanimated","tagMessage","Wrap","Component","render","child","Children","only","props","children","cloneElement","collapsable","e","Error","AnimatedWrap","default","createAnimatedComponent"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,UAAT,QAA2B,sBAA3B;AACA,SAASC,UAAT,QAA2B,gBAA3B;AAEA,OAAO,MAAMC,IAAN,SAAmBH,KAAK,CAACI,SAAzB,CAIJ;AACDC,EAAAA,MAAM,GAAG;AACP,QAAI;AACF;AACA;AACA;AACA;AACA;AACA,YAAMC,KAAU,GAAGN,KAAK,CAACO,QAAN,CAAeC,IAAf,CAAoB,KAAKC,KAAL,CAAWC,QAA/B,CAAnB;AACA,0BAAOV,KAAK,CAACW,YAAN,CACLL,KADK,EAEL;AAAEM,QAAAA,WAAW,EAAE;AAAf,OAFK,EAGL;AACAN,MAAAA,KAAK,CAACG,KAAN,CAAYC,QAJP,CAAP;AAMD,KAbD,CAaE,OAAOG,CAAP,EAAU;AACV,YAAM,IAAIC,KAAJ,CACJZ,UAAU,CACP,2KADO,CADN,CAAN;AAKD;AACF;;AAtBA;AAyBH,OAAO,MAAMa,YAAY,4BACvBd,UADuB,aACvBA,UADuB,8CACvBA,UAAU,CAAEe,OADW,wDACvB,oBAAqBC,uBAArB,CAA6Cd,IAA7C,CADuB,yEAC+BA,IADjD","sourcesContent":["import React from 'react';\nimport { Reanimated } from '../reanimatedWrapper';\nimport { tagMessage } from '../../../utils';\n\nexport class Wrap extends React.Component<{\n onGestureHandlerEvent?: unknown;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n}> {\n render() {\n try {\n // I don't think that fighting with types over such a simple function is worth it\n // The only thing it does is add 'collapsable: false' to the child component\n // to make sure it is in the native view hierarchy so the detector can find\n // correct viewTag to attach to.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(this.props.children);\n return React.cloneElement(\n child,\n { collapsable: false },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n}\n\nexport const AnimatedWrap =\n Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\n"]}
@@ -1,21 +1,21 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { tagMessage } from '../../../utils';
3
+ import { isRNSVGNode } from '../../../web/utils';
3
4
  export const Wrap = /*#__PURE__*/forwardRef(({
4
5
  children
5
6
  }, ref) => {
6
7
  try {
7
- var _Object$getPrototypeO;
8
8
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
9
  const child = React.Children.only(children);
10
- const isRNSVGNode = ((_Object$getPrototypeO = Object.getPrototypeOf(child === null || child === void 0 ? void 0 : child.type)) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name) === 'WebShape';
11
- if (isRNSVGNode) {
10
+
11
+ if (isRNSVGNode(child)) {
12
12
  const clone = /*#__PURE__*/React.cloneElement(child, {
13
13
  ref
14
- },
15
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
14
+ }, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
16
15
  child.props.children);
17
16
  return clone;
18
17
  }
18
+
19
19
  return /*#__PURE__*/React.createElement("div", {
20
20
  ref: ref,
21
21
  style: {
@@ -25,9 +25,8 @@ export const Wrap = /*#__PURE__*/forwardRef(({
25
25
  } catch (e) {
26
26
  throw new Error(tagMessage(`GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
27
27
  }
28
- });
29
-
30
- // On web we never take a path with Reanimated,
28
+ }); // On web we never take a path with Reanimated,
31
29
  // therefore we can simply export Wrap
30
+
32
31
  export const AnimatedWrap = Wrap;
33
32
  //# sourceMappingURL=Wrap.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","tagMessage","Wrap","children","ref","_Object$getPrototypeO","child","Children","only","isRNSVGNode","Object","getPrototypeOf","type","name","clone","cloneElement","props","createElement","style","display","e","Error","AnimatedWrap"],"sources":["Wrap.web.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { LegacyRef, PropsWithChildren } from 'react';\nimport { tagMessage } from '../../../utils';\n\nexport const Wrap = forwardRef<HTMLDivElement, PropsWithChildren<{}>>(\n ({ children }, ref) => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(children);\n\n const isRNSVGNode =\n Object.getPrototypeOf(child?.type)?.name === 'WebShape';\n\n if (isRNSVGNode) {\n const clone = React.cloneElement(\n child,\n { ref },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n\n return clone;\n }\n\n return (\n <div\n ref={ref as LegacyRef<HTMLDivElement>}\n style={{ display: 'contents' }}>\n {child}\n </div>\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n);\n\n// On web we never take a path with Reanimated,\n// therefore we can simply export Wrap\nexport const AnimatedWrap = Wrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,OAAO,MAAMC,IAAI,gBAAGF,UAAU,CAC5B,CAAC;EAAEG;AAAS,CAAC,EAAEC,GAAG,KAAK;EACrB,IAAI;IAAA,IAAAC,qBAAA;IACF;IACA,MAAMC,KAAU,GAAGP,KAAK,CAACQ,QAAQ,CAACC,IAAI,CAACL,QAAQ,CAAC;IAEhD,MAAMM,WAAW,GACf,EAAAJ,qBAAA,GAAAK,MAAM,CAACC,cAAc,CAACL,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEM,IAAI,CAAC,cAAAP,qBAAA,uBAAlCA,qBAAA,CAAoCQ,IAAI,MAAK,UAAU;IAEzD,IAAIJ,WAAW,EAAE;MACf,MAAMK,KAAK,gBAAGf,KAAK,CAACgB,YAAY,CAC9BT,KAAK,EACL;QAAEF;MAAI,CAAC;MACP;MACAE,KAAK,CAACU,KAAK,CAACb,QACd,CAAC;MAED,OAAOW,KAAK;IACd;IAEA,oBACEf,KAAA,CAAAkB,aAAA;MACEb,GAAG,EAAEA,GAAiC;MACtCc,KAAK,EAAE;QAAEC,OAAO,EAAE;MAAW;IAAE,GAC9Bb,KACE,CAAC;EAEV,CAAC,CAAC,OAAOc,CAAC,EAAE;IACV,MAAM,IAAIC,KAAK,CACbpB,UAAU,CACR,2KACF,CACF,CAAC;EACH;AACF,CACF,CAAC;;AAED;AACA;AACA,OAAO,MAAMqB,YAAY,GAAGpB,IAAI","ignoreList":[]}
1
+ {"version":3,"sources":["Wrap.web.tsx"],"names":["React","forwardRef","tagMessage","isRNSVGNode","Wrap","children","ref","child","Children","only","clone","cloneElement","props","display","e","Error","AnimatedWrap"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AAEA,SAASC,UAAT,QAA2B,gBAA3B;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA,OAAO,MAAMC,IAAI,gBAAGH,UAAU,CAC5B,CAAC;AAAEI,EAAAA;AAAF,CAAD,EAAeC,GAAf,KAAuB;AACrB,MAAI;AACF;AACA,UAAMC,KAAU,GAAGP,KAAK,CAACQ,QAAN,CAAeC,IAAf,CAAoBJ,QAApB,CAAnB;;AAEA,QAAIF,WAAW,CAACI,KAAD,CAAf,EAAwB;AACtB,YAAMG,KAAK,gBAAGV,KAAK,CAACW,YAAN,CACZJ,KADY,EAEZ;AAAED,QAAAA;AAAF,OAFY,EAGZ;AACAC,MAAAA,KAAK,CAACK,KAAN,CAAYP,QAJA,CAAd;AAOA,aAAOK,KAAP;AACD;;AAED,wBACE;AACE,MAAA,GAAG,EAAEJ,GADP;AAEE,MAAA,KAAK,EAAE;AAAEO,QAAAA,OAAO,EAAE;AAAX;AAFT,OAGGN,KAHH,CADF;AAOD,GAtBD,CAsBE,OAAOO,CAAP,EAAU;AACV,UAAM,IAAIC,KAAJ,CACJb,UAAU,CACP,2KADO,CADN,CAAN;AAKD;AACF,CA/B2B,CAAvB,C,CAkCP;AACA;;AACA,OAAO,MAAMc,YAAY,GAAGZ,IAArB","sourcesContent":["import React, { forwardRef } from 'react';\nimport type { LegacyRef, PropsWithChildren } from 'react';\nimport { tagMessage } from '../../../utils';\nimport { isRNSVGNode } from '../../../web/utils';\n\nexport const Wrap = forwardRef<HTMLDivElement, PropsWithChildren<{}>>(\n ({ children }, ref) => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(children);\n\n if (isRNSVGNode(child)) {\n const clone = React.cloneElement(\n child,\n { ref },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n\n return clone;\n }\n\n return (\n <div\n ref={ref as LegacyRef<HTMLDivElement>}\n style={{ display: 'contents' }}>\n {child}\n </div>\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n);\n\n// On web we never take a path with Reanimated,\n// therefore we can simply export Wrap\nexport const AnimatedWrap = Wrap;\n"]}
@@ -13,47 +13,55 @@ export function attachHandlers({
13
13
  viewTag,
14
14
  webEventHandlersRef
15
15
  }) {
16
- gestureConfig.initialize();
17
-
18
- // Use queueMicrotask to extract handlerTags, because all refs should be initialized
16
+ gestureConfig.initialize(); // Use queueMicrotask to extract handlerTags, because all refs should be initialized
19
17
  // when it's ran
18
+
20
19
  ghQueueMicrotask(() => {
21
20
  if (!preparedGesture.isMounted) {
22
21
  return;
23
22
  }
23
+
24
24
  gestureConfig.prepare();
25
25
  });
26
+
26
27
  for (const handler of gesturesToAttach) {
27
28
  checkGestureCallbacksForWorklets(handler);
28
29
  RNGestureHandlerModule.createGestureHandler(handler.handlerName, handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS));
29
30
  registerHandler(handler.handlerTag, handler, handler.config.testId);
30
- }
31
-
32
- // Use queueMicrotask to extract handlerTags, because all refs should be initialized
31
+ } // Use queueMicrotask to extract handlerTags, because all refs should be initialized
33
32
  // when it's ran
33
+
34
+
34
35
  ghQueueMicrotask(() => {
35
36
  if (!preparedGesture.isMounted) {
36
37
  return;
37
38
  }
39
+
38
40
  for (const handler of gesturesToAttach) {
39
41
  RNGestureHandlerModule.updateGestureHandler(handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS, extractGestureRelations(handler)));
40
42
  }
43
+
41
44
  scheduleFlushOperations();
42
45
  });
46
+
43
47
  for (const gesture of gesturesToAttach) {
44
48
  const actionType = gesture.shouldUseReanimated ? ActionType.REANIMATED_WORKLET : ActionType.JS_FUNCTION_NEW_API;
49
+
45
50
  if (Platform.OS === 'web') {
46
- RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, ActionType.JS_FUNCTION_OLD_API,
47
- // Ignored on web
51
+ RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, ActionType.JS_FUNCTION_OLD_API, // Ignored on web
48
52
  webEventHandlersRef);
49
53
  } else {
50
54
  RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, actionType);
51
55
  }
56
+
52
57
  MountRegistry.gestureWillMount(gesture);
53
58
  }
59
+
54
60
  preparedGesture.attachedGestures = gesturesToAttach;
61
+
55
62
  if (preparedGesture.animatedHandlers) {
56
63
  const isAnimatedGesture = g => g.shouldUseReanimated;
64
+
57
65
  preparedGesture.animatedHandlers.value = gesturesToAttach.filter(isAnimatedGesture).map(g => g.handlers);
58
66
  }
59
67
  }
@@ -1 +1 @@
1
- {"version":3,"names":["registerHandler","RNGestureHandlerModule","filterConfig","scheduleFlushOperations","ActionType","Platform","ghQueueMicrotask","extractGestureRelations","checkGestureCallbacksForWorklets","ALLOWED_PROPS","MountRegistry","attachHandlers","preparedGesture","gestureConfig","gesturesToAttach","viewTag","webEventHandlersRef","initialize","isMounted","prepare","handler","createGestureHandler","handlerName","handlerTag","config","testId","updateGestureHandler","gesture","actionType","shouldUseReanimated","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","OS","attachGestureHandler","JS_FUNCTION_OLD_API","gestureWillMount","attachedGestures","animatedHandlers","isAnimatedGesture","g","value","filter","map","handlers"],"sources":["attachHandlers.ts"],"sourcesContent":["import React from 'react';\nimport { GestureType, HandlerCallbacks } from '../gesture';\nimport { registerHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { filterConfig, scheduleFlushOperations } from '../../utils';\nimport { ComposedGesture } from '../gestureComposition';\nimport { ActionType } from '../../../ActionType';\nimport { Platform } from 'react-native';\nimport type RNGestureHandlerModuleWeb from '../../../RNGestureHandlerModule.web';\nimport { ghQueueMicrotask } from '../../../ghQueueMicrotask';\nimport { AttachedGestureState, WebEventHandler } from './types';\nimport {\n extractGestureRelations,\n checkGestureCallbacksForWorklets,\n ALLOWED_PROPS,\n} from './utils';\nimport { MountRegistry } from '../../../mountRegistry';\n\ninterface AttachHandlersConfig {\n preparedGesture: AttachedGestureState;\n gestureConfig: ComposedGesture | GestureType;\n gesturesToAttach: GestureType[];\n viewTag: number;\n webEventHandlersRef: React.RefObject<WebEventHandler>;\n}\n\nexport function attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n viewTag,\n webEventHandlersRef,\n}: AttachHandlersConfig) {\n gestureConfig.initialize();\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n gestureConfig.prepare();\n });\n\n for (const handler of gesturesToAttach) {\n checkGestureCallbacksForWorklets(handler);\n RNGestureHandlerModule.createGestureHandler(\n handler.handlerName,\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS)\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n for (const handler of gesturesToAttach) {\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(\n handler.config,\n ALLOWED_PROPS,\n extractGestureRelations(handler)\n )\n );\n }\n\n scheduleFlushOperations();\n });\n\n for (const gesture of gesturesToAttach) {\n const actionType = gesture.shouldUseReanimated\n ? ActionType.REANIMATED_WORKLET\n : ActionType.JS_FUNCTION_NEW_API;\n\n if (Platform.OS === 'web') {\n (\n RNGestureHandlerModule.attachGestureHandler as typeof RNGestureHandlerModuleWeb.attachGestureHandler\n )(\n gesture.handlerTag,\n viewTag,\n ActionType.JS_FUNCTION_OLD_API, // Ignored on web\n webEventHandlersRef\n );\n } else {\n RNGestureHandlerModule.attachGestureHandler(\n gesture.handlerTag,\n viewTag,\n actionType\n );\n }\n\n MountRegistry.gestureWillMount(gesture);\n }\n\n preparedGesture.attachedGestures = gesturesToAttach;\n\n if (preparedGesture.animatedHandlers) {\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\n\n preparedGesture.animatedHandlers.value = gesturesToAttach\n .filter(isAnimatedGesture)\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n}\n"],"mappings":"AAEA,SAASA,eAAe,QAAQ,wBAAwB;AACxD,OAAOC,sBAAsB,MAAM,iCAAiC;AACpE,SAASC,YAAY,EAAEC,uBAAuB,QAAQ,aAAa;AAEnE,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,gBAAgB,QAAQ,2BAA2B;AAE5D,SACEC,uBAAuB,EACvBC,gCAAgC,EAChCC,aAAa,QACR,SAAS;AAChB,SAASC,aAAa,QAAQ,wBAAwB;AAUtD,OAAO,SAASC,cAAcA,CAAC;EAC7BC,eAAe;EACfC,aAAa;EACbC,gBAAgB;EAChBC,OAAO;EACPC;AACoB,CAAC,EAAE;EACvBH,aAAa,CAACI,UAAU,CAAC,CAAC;;EAE1B;EACA;EACAX,gBAAgB,CAAC,MAAM;IACrB,IAAI,CAACM,eAAe,CAACM,SAAS,EAAE;MAC9B;IACF;IACAL,aAAa,CAACM,OAAO,CAAC,CAAC;EACzB,CAAC,CAAC;EAEF,KAAK,MAAMC,OAAO,IAAIN,gBAAgB,EAAE;IACtCN,gCAAgC,CAACY,OAAO,CAAC;IACzCnB,sBAAsB,CAACoB,oBAAoB,CACzCD,OAAO,CAACE,WAAW,EACnBF,OAAO,CAACG,UAAU,EAClBrB,YAAY,CAACkB,OAAO,CAACI,MAAM,EAAEf,aAAa,CAC5C,CAAC;IAEDT,eAAe,CAACoB,OAAO,CAACG,UAAU,EAAEH,OAAO,EAAEA,OAAO,CAACI,MAAM,CAACC,MAAM,CAAC;EACrE;;EAEA;EACA;EACAnB,gBAAgB,CAAC,MAAM;IACrB,IAAI,CAACM,eAAe,CAACM,SAAS,EAAE;MAC9B;IACF;IACA,KAAK,MAAME,OAAO,IAAIN,gBAAgB,EAAE;MACtCb,sBAAsB,CAACyB,oBAAoB,CACzCN,OAAO,CAACG,UAAU,EAClBrB,YAAY,CACVkB,OAAO,CAACI,MAAM,EACdf,aAAa,EACbF,uBAAuB,CAACa,OAAO,CACjC,CACF,CAAC;IACH;IAEAjB,uBAAuB,CAAC,CAAC;EAC3B,CAAC,CAAC;EAEF,KAAK,MAAMwB,OAAO,IAAIb,gBAAgB,EAAE;IACtC,MAAMc,UAAU,GAAGD,OAAO,CAACE,mBAAmB,GAC1CzB,UAAU,CAAC0B,kBAAkB,GAC7B1B,UAAU,CAAC2B,mBAAmB;IAElC,IAAI1B,QAAQ,CAAC2B,EAAE,KAAK,KAAK,EAAE;MAEvB/B,sBAAsB,CAACgC,oBAAoB,CAE3CN,OAAO,CAACJ,UAAU,EAClBR,OAAO,EACPX,UAAU,CAAC8B,mBAAmB;MAAE;MAChClB,mBACF,CAAC;IACH,CAAC,MAAM;MACLf,sBAAsB,CAACgC,oBAAoB,CACzCN,OAAO,CAACJ,UAAU,EAClBR,OAAO,EACPa,UACF,CAAC;IACH;IAEAlB,aAAa,CAACyB,gBAAgB,CAACR,OAAO,CAAC;EACzC;EAEAf,eAAe,CAACwB,gBAAgB,GAAGtB,gBAAgB;EAEnD,IAAIF,eAAe,CAACyB,gBAAgB,EAAE;IACpC,MAAMC,iBAAiB,GAAIC,CAAc,IAAKA,CAAC,CAACV,mBAAmB;IAEnEjB,eAAe,CAACyB,gBAAgB,CAACG,KAAK,GAAG1B,gBAAgB,CACtD2B,MAAM,CAACH,iBAAiB,CAAC,CACzBI,GAAG,CAAEH,CAAC,IAAKA,CAAC,CAACI,QAAQ,CAErB;EACL;AACF","ignoreList":[]}
1
+ {"version":3,"sources":["attachHandlers.ts"],"names":["registerHandler","RNGestureHandlerModule","filterConfig","scheduleFlushOperations","ActionType","Platform","ghQueueMicrotask","extractGestureRelations","checkGestureCallbacksForWorklets","ALLOWED_PROPS","MountRegistry","attachHandlers","preparedGesture","gestureConfig","gesturesToAttach","viewTag","webEventHandlersRef","initialize","isMounted","prepare","handler","createGestureHandler","handlerName","handlerTag","config","testId","updateGestureHandler","gesture","actionType","shouldUseReanimated","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","OS","attachGestureHandler","JS_FUNCTION_OLD_API","gestureWillMount","attachedGestures","animatedHandlers","isAnimatedGesture","g","value","filter","map","handlers"],"mappings":"AAEA,SAASA,eAAT,QAAgC,wBAAhC;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,SAASC,YAAT,EAAuBC,uBAAvB,QAAsD,aAAtD;AAEA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,QAAT,QAAyB,cAAzB;AAEA,SAASC,gBAAT,QAAiC,2BAAjC;AAEA,SACEC,uBADF,EAEEC,gCAFF,EAGEC,aAHF,QAIO,SAJP;AAKA,SAASC,aAAT,QAA8B,wBAA9B;AAUA,OAAO,SAASC,cAAT,CAAwB;AAC7BC,EAAAA,eAD6B;AAE7BC,EAAAA,aAF6B;AAG7BC,EAAAA,gBAH6B;AAI7BC,EAAAA,OAJ6B;AAK7BC,EAAAA;AAL6B,CAAxB,EAMkB;AACvBH,EAAAA,aAAa,CAACI,UAAd,GADuB,CAGvB;AACA;;AACAX,EAAAA,gBAAgB,CAAC,MAAM;AACrB,QAAI,CAACM,eAAe,CAACM,SAArB,EAAgC;AAC9B;AACD;;AACDL,IAAAA,aAAa,CAACM,OAAd;AACD,GALe,CAAhB;;AAOA,OAAK,MAAMC,OAAX,IAAsBN,gBAAtB,EAAwC;AACtCN,IAAAA,gCAAgC,CAACY,OAAD,CAAhC;AACAnB,IAAAA,sBAAsB,CAACoB,oBAAvB,CACED,OAAO,CAACE,WADV,EAEEF,OAAO,CAACG,UAFV,EAGErB,YAAY,CAACkB,OAAO,CAACI,MAAT,EAAiBf,aAAjB,CAHd;AAMAT,IAAAA,eAAe,CAACoB,OAAO,CAACG,UAAT,EAAqBH,OAArB,EAA8BA,OAAO,CAACI,MAAR,CAAeC,MAA7C,CAAf;AACD,GArBsB,CAuBvB;AACA;;;AACAnB,EAAAA,gBAAgB,CAAC,MAAM;AACrB,QAAI,CAACM,eAAe,CAACM,SAArB,EAAgC;AAC9B;AACD;;AACD,SAAK,MAAME,OAAX,IAAsBN,gBAAtB,EAAwC;AACtCb,MAAAA,sBAAsB,CAACyB,oBAAvB,CACEN,OAAO,CAACG,UADV,EAEErB,YAAY,CACVkB,OAAO,CAACI,MADE,EAEVf,aAFU,EAGVF,uBAAuB,CAACa,OAAD,CAHb,CAFd;AAQD;;AAEDjB,IAAAA,uBAAuB;AACxB,GAhBe,CAAhB;;AAkBA,OAAK,MAAMwB,OAAX,IAAsBb,gBAAtB,EAAwC;AACtC,UAAMc,UAAU,GAAGD,OAAO,CAACE,mBAAR,GACfzB,UAAU,CAAC0B,kBADI,GAEf1B,UAAU,CAAC2B,mBAFf;;AAIA,QAAI1B,QAAQ,CAAC2B,EAAT,KAAgB,KAApB,EAA2B;AAEvB/B,MAAAA,sBAAsB,CAACgC,oBADzB,CAGEN,OAAO,CAACJ,UAHV,EAIER,OAJF,EAKEX,UAAU,CAAC8B,mBALb,EAKkC;AAChClB,MAAAA,mBANF;AAQD,KATD,MASO;AACLf,MAAAA,sBAAsB,CAACgC,oBAAvB,CACEN,OAAO,CAACJ,UADV,EAEER,OAFF,EAGEa,UAHF;AAKD;;AAEDlB,IAAAA,aAAa,CAACyB,gBAAd,CAA+BR,OAA/B;AACD;;AAEDf,EAAAA,eAAe,CAACwB,gBAAhB,GAAmCtB,gBAAnC;;AAEA,MAAIF,eAAe,CAACyB,gBAApB,EAAsC;AACpC,UAAMC,iBAAiB,GAAIC,CAAD,IAAoBA,CAAC,CAACV,mBAAhD;;AAEAjB,IAAAA,eAAe,CAACyB,gBAAhB,CAAiCG,KAAjC,GAAyC1B,gBAAgB,CACtD2B,MADsC,CAC/BH,iBAD+B,EAEtCI,GAFsC,CAEjCH,CAAD,IAAOA,CAAC,CAACI,QAFyB,CAAzC;AAKD;AACF","sourcesContent":["import React from 'react';\nimport { GestureType, HandlerCallbacks } from '../gesture';\nimport { registerHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { filterConfig, scheduleFlushOperations } from '../../utils';\nimport { ComposedGesture } from '../gestureComposition';\nimport { ActionType } from '../../../ActionType';\nimport { Platform } from 'react-native';\nimport type RNGestureHandlerModuleWeb from '../../../RNGestureHandlerModule.web';\nimport { ghQueueMicrotask } from '../../../ghQueueMicrotask';\nimport { AttachedGestureState, WebEventHandler } from './types';\nimport {\n extractGestureRelations,\n checkGestureCallbacksForWorklets,\n ALLOWED_PROPS,\n} from './utils';\nimport { MountRegistry } from '../../../mountRegistry';\n\ninterface AttachHandlersConfig {\n preparedGesture: AttachedGestureState;\n gestureConfig: ComposedGesture | GestureType;\n gesturesToAttach: GestureType[];\n viewTag: number;\n webEventHandlersRef: React.RefObject<WebEventHandler>;\n}\n\nexport function attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n viewTag,\n webEventHandlersRef,\n}: AttachHandlersConfig) {\n gestureConfig.initialize();\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n gestureConfig.prepare();\n });\n\n for (const handler of gesturesToAttach) {\n checkGestureCallbacksForWorklets(handler);\n RNGestureHandlerModule.createGestureHandler(\n handler.handlerName,\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS)\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n for (const handler of gesturesToAttach) {\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(\n handler.config,\n ALLOWED_PROPS,\n extractGestureRelations(handler)\n )\n );\n }\n\n scheduleFlushOperations();\n });\n\n for (const gesture of gesturesToAttach) {\n const actionType = gesture.shouldUseReanimated\n ? ActionType.REANIMATED_WORKLET\n : ActionType.JS_FUNCTION_NEW_API;\n\n if (Platform.OS === 'web') {\n (\n RNGestureHandlerModule.attachGestureHandler as typeof RNGestureHandlerModuleWeb.attachGestureHandler\n )(\n gesture.handlerTag,\n viewTag,\n ActionType.JS_FUNCTION_OLD_API, // Ignored on web\n webEventHandlersRef\n );\n } else {\n RNGestureHandlerModule.attachGestureHandler(\n gesture.handlerTag,\n viewTag,\n actionType\n );\n }\n\n MountRegistry.gestureWillMount(gesture);\n }\n\n preparedGesture.attachedGestures = gesturesToAttach;\n\n if (preparedGesture.animatedHandlers) {\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\n\n preparedGesture.animatedHandlers.value = gesturesToAttach\n .filter(isAnimatedGesture)\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n}\n"]}
@@ -8,6 +8,7 @@ export function dropHandlers(preparedGesture) {
8
8
  unregisterHandler(handler.handlerTag, handler.config.testId);
9
9
  MountRegistry.gestureWillUnmount(handler);
10
10
  }
11
+
11
12
  scheduleFlushOperations();
12
13
  }
13
14
  //# sourceMappingURL=dropHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["unregisterHandler","RNGestureHandlerModule","scheduleFlushOperations","MountRegistry","dropHandlers","preparedGesture","handler","attachedGestures","dropGestureHandler","handlerTag","config","testId","gestureWillUnmount"],"sources":["dropHandlers.ts"],"sourcesContent":["import { unregisterHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { scheduleFlushOperations } from '../../utils';\nimport { AttachedGestureState } from './types';\nimport { MountRegistry } from '../../../mountRegistry';\n\nexport function dropHandlers(preparedGesture: AttachedGestureState) {\n for (const handler of preparedGesture.attachedGestures) {\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\n\n unregisterHandler(handler.handlerTag, handler.config.testId);\n\n MountRegistry.gestureWillUnmount(handler);\n }\n\n scheduleFlushOperations();\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,wBAAwB;AAC1D,OAAOC,sBAAsB,MAAM,iCAAiC;AACpE,SAASC,uBAAuB,QAAQ,aAAa;AAErD,SAASC,aAAa,QAAQ,wBAAwB;AAEtD,OAAO,SAASC,YAAYA,CAACC,eAAqC,EAAE;EAClE,KAAK,MAAMC,OAAO,IAAID,eAAe,CAACE,gBAAgB,EAAE;IACtDN,sBAAsB,CAACO,kBAAkB,CAACF,OAAO,CAACG,UAAU,CAAC;IAE7DT,iBAAiB,CAACM,OAAO,CAACG,UAAU,EAAEH,OAAO,CAACI,MAAM,CAACC,MAAM,CAAC;IAE5DR,aAAa,CAACS,kBAAkB,CAACN,OAAO,CAAC;EAC3C;EAEAJ,uBAAuB,CAAC,CAAC;AAC3B","ignoreList":[]}
1
+ {"version":3,"sources":["dropHandlers.ts"],"names":["unregisterHandler","RNGestureHandlerModule","scheduleFlushOperations","MountRegistry","dropHandlers","preparedGesture","handler","attachedGestures","dropGestureHandler","handlerTag","config","testId","gestureWillUnmount"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,wBAAlC;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,SAASC,uBAAT,QAAwC,aAAxC;AAEA,SAASC,aAAT,QAA8B,wBAA9B;AAEA,OAAO,SAASC,YAAT,CAAsBC,eAAtB,EAA6D;AAClE,OAAK,MAAMC,OAAX,IAAsBD,eAAe,CAACE,gBAAtC,EAAwD;AACtDN,IAAAA,sBAAsB,CAACO,kBAAvB,CAA0CF,OAAO,CAACG,UAAlD;AAEAT,IAAAA,iBAAiB,CAACM,OAAO,CAACG,UAAT,EAAqBH,OAAO,CAACI,MAAR,CAAeC,MAApC,CAAjB;AAEAR,IAAAA,aAAa,CAACS,kBAAd,CAAiCN,OAAjC;AACD;;AAEDJ,EAAAA,uBAAuB;AACxB","sourcesContent":["import { unregisterHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { scheduleFlushOperations } from '../../utils';\nimport { AttachedGestureState } from './types';\nimport { MountRegistry } from '../../../mountRegistry';\n\nexport function dropHandlers(preparedGesture: AttachedGestureState) {\n for (const handler of preparedGesture.attachedGestures) {\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\n\n unregisterHandler(handler.handlerTag, handler.config.testId);\n\n MountRegistry.gestureWillUnmount(handler);\n }\n\n scheduleFlushOperations();\n}\n"]}
@@ -13,19 +13,24 @@ import { Wrap, AnimatedWrap } from './Wrap';
13
13
  import { useDetectorUpdater } from './useDetectorUpdater';
14
14
  import { useViewRefHandler } from './useViewRefHandler';
15
15
  import { useMountReactions } from './useMountReactions';
16
+
16
17
  function propagateDetectorConfig(props, gesture) {
17
18
  const keysToPropagate = ['userSelect', 'enableContextMenu', 'touchAction'];
19
+
18
20
  for (const key of keysToPropagate) {
19
21
  const value = props[key];
22
+
20
23
  if (value === undefined) {
21
24
  continue;
22
25
  }
26
+
23
27
  for (const g of gesture.toGestureArray()) {
24
28
  const config = g.config;
25
29
  config[key] = value;
26
30
  }
27
31
  }
28
32
  }
33
+
29
34
  /**
30
35
  * `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.
31
36
  *
@@ -43,17 +48,18 @@ function propagateDetectorConfig(props, gesture) {
43
48
  */
44
49
  export const GestureDetector = props => {
45
50
  const rootViewContext = useContext(GestureHandlerRootViewContext);
51
+
46
52
  if (__DEV__ && !rootViewContext && !isTestEnv() && Platform.OS !== 'web') {
47
53
  throw new Error('GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
48
- }
54
+ } // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders
55
+
49
56
 
50
- // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders
51
57
  const gestureConfig = props.gesture;
52
58
  propagateDetectorConfig(props, gestureConfig);
53
59
  const gesturesToAttach = useMemo(() => gestureConfig.toGestureArray(), [gestureConfig]);
54
60
  const shouldUseReanimated = gesturesToAttach.some(g => g.shouldUseReanimated);
55
- const webEventHandlersRef = useWebEventHandlers();
56
- // Store state in ref to prevent unnecessary renders
61
+ const webEventHandlersRef = useWebEventHandlers(); // Store state in ref to prevent unnecessary renders
62
+
57
63
  const state = useRef({
58
64
  firstRender: true,
59
65
  viewRef: null,
@@ -68,10 +74,9 @@ export const GestureDetector = props => {
68
74
  isMounted: false
69
75
  }).current;
70
76
  const updateAttachedGestures = useDetectorUpdater(state, preparedGesture, gesturesToAttach, gestureConfig, webEventHandlersRef);
71
- const refHandler = useViewRefHandler(state, updateAttachedGestures);
72
-
73
- // Reanimated event should be rebuilt only when gestures are reattached, otherwise
77
+ const refHandler = useViewRefHandler(state, updateAttachedGestures); // Reanimated event should be rebuilt only when gestures are reattached, otherwise
74
78
  // config update will be enough as all necessary items are stored in shared values anyway
79
+
75
80
  const needsToRebuildReanimatedEvent = state.firstRender || state.forceRebuildReanimatedEvent || needsToReattach(preparedGesture, gesturesToAttach);
76
81
  state.forceRebuildReanimatedEvent = false;
77
82
  useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);
@@ -98,6 +103,7 @@ export const GestureDetector = props => {
98
103
  }
99
104
  }, [props]);
100
105
  useMountReactions(updateAttachedGestures, preparedGesture);
106
+
101
107
  if (shouldUseReanimated) {
102
108
  return /*#__PURE__*/React.createElement(AnimatedWrap, {
103
109
  ref: refHandler,
@@ -1 +1 @@
1
- {"version":3,"names":["React","useContext","useEffect","useLayoutEffect","useMemo","useRef","Platform","findNodeHandle","isTestEnv","GestureHandlerRootViewContext","useAnimatedGesture","attachHandlers","needsToReattach","dropHandlers","useWebEventHandlers","Wrap","AnimatedWrap","useDetectorUpdater","useViewRefHandler","useMountReactions","propagateDetectorConfig","props","gesture","keysToPropagate","key","value","undefined","g","toGestureArray","config","GestureDetector","rootViewContext","__DEV__","OS","Error","gestureConfig","gesturesToAttach","shouldUseReanimated","some","webEventHandlersRef","state","firstRender","viewRef","previousViewTag","forceRebuildReanimatedEvent","current","preparedGesture","attachedGestures","animatedEventHandler","animatedHandlers","isMounted","updateAttachedGestures","refHandler","needsToRebuildReanimatedEvent","viewTag","createElement","ref","onGestureHandlerEvent","children"],"sources":["index.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, {\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { Platform } from 'react-native';\nimport findNodeHandle from '../../../findNodeHandle';\nimport { GestureType } from '../gesture';\nimport { UserSelect, TouchAction } from '../../gestureHandlerCommon';\nimport { ComposedGesture } from '../gestureComposition';\nimport { isTestEnv } from '../../../utils';\n\nimport GestureHandlerRootViewContext from '../../../GestureHandlerRootViewContext';\nimport { AttachedGestureState, GestureDetectorState } from './types';\nimport { useAnimatedGesture } from './useAnimatedGesture';\nimport { attachHandlers } from './attachHandlers';\nimport { needsToReattach } from './needsToReattach';\nimport { dropHandlers } from './dropHandlers';\nimport { useWebEventHandlers } from './utils';\nimport { Wrap, AnimatedWrap } from './Wrap';\nimport { useDetectorUpdater } from './useDetectorUpdater';\nimport { useViewRefHandler } from './useViewRefHandler';\nimport { useMountReactions } from './useMountReactions';\n\nfunction propagateDetectorConfig(\n props: GestureDetectorProps,\n gesture: ComposedGesture | GestureType\n) {\n const keysToPropagate: (keyof GestureDetectorProps)[] = [\n 'userSelect',\n 'enableContextMenu',\n 'touchAction',\n ];\n\n for (const key of keysToPropagate) {\n const value = props[key];\n if (value === undefined) {\n continue;\n }\n\n for (const g of gesture.toGestureArray()) {\n const config = g.config as { [key: string]: unknown };\n config[key] = value;\n }\n }\n}\n\ninterface GestureDetectorProps {\n children?: React.ReactNode;\n /**\n * A gesture object containing the configuration and callbacks.\n * Can be any of:\n * - base gestures (`Tap`, `Pan`, ...)\n * - `ComposedGesture` (`Race`, `Simultaneous`, `Exclusive`)\n */\n gesture: ComposedGesture | GestureType;\n /**\n * #### Web only\n * This parameter allows to specify which `userSelect` property should be applied to underlying view.\n * Possible values are `\"none\" | \"auto\" | \"text\"`. Default value is set to `\"none\"`.\n */\n userSelect?: UserSelect;\n /**\n * #### Web only\n * Specifies whether context menu should be enabled after clicking on underlying view with right mouse button.\n * Default value is set to `false`.\n */\n enableContextMenu?: boolean;\n /**\n * #### Web only\n * This parameter allows to specify which `touchAction` property should be applied to underlying view.\n * Supports all CSS touch-action values (e.g. `\"none\"`, `\"pan-y\"`). Default value is set to `\"none\"`.\n */\n touchAction?: TouchAction;\n}\n\n/**\n * `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.\n *\n * ### Props\n * - `gesture`\n * - `userSelect` (**Web only**)\n * - `enableContextMenu` (**Web only**)\n * - `touchAction` (**Web only**)\n *\n * ### Remarks\n * - Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed.\n * - Using the same instance of a gesture across multiple Gesture Detectors is not possible.\n *\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture-detector\n */\nexport const GestureDetector = (props: GestureDetectorProps) => {\n const rootViewContext = useContext(GestureHandlerRootViewContext);\n if (__DEV__ && !rootViewContext && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n 'GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders\n const gestureConfig = props.gesture;\n propagateDetectorConfig(props, gestureConfig);\n\n const gesturesToAttach = useMemo(\n () => gestureConfig.toGestureArray(),\n [gestureConfig]\n );\n const shouldUseReanimated = gesturesToAttach.some(\n (g) => g.shouldUseReanimated\n );\n\n const webEventHandlersRef = useWebEventHandlers();\n // Store state in ref to prevent unnecessary renders\n const state = useRef<GestureDetectorState>({\n firstRender: true,\n viewRef: null,\n previousViewTag: -1,\n forceRebuildReanimatedEvent: false,\n }).current;\n\n const preparedGesture = React.useRef<AttachedGestureState>({\n attachedGestures: [],\n animatedEventHandler: null,\n animatedHandlers: null,\n shouldUseReanimated: shouldUseReanimated,\n isMounted: false,\n }).current;\n\n const updateAttachedGestures = useDetectorUpdater(\n state,\n preparedGesture,\n gesturesToAttach,\n gestureConfig,\n webEventHandlersRef\n );\n\n const refHandler = useViewRefHandler(state, updateAttachedGestures);\n\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\n // config update will be enough as all necessary items are stored in shared values anyway\n const needsToRebuildReanimatedEvent =\n state.firstRender ||\n state.forceRebuildReanimatedEvent ||\n needsToReattach(preparedGesture, gesturesToAttach);\n state.forceRebuildReanimatedEvent = false;\n\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\n\n useLayoutEffect(() => {\n const viewTag = findNodeHandle(state.viewRef) as number;\n preparedGesture.isMounted = true;\n\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n webEventHandlersRef,\n viewTag,\n });\n\n return () => {\n preparedGesture.isMounted = false;\n dropHandlers(preparedGesture);\n };\n }, []);\n\n useEffect(() => {\n if (state.firstRender) {\n state.firstRender = false;\n } else {\n updateAttachedGestures();\n }\n }, [props]);\n\n useMountReactions(updateAttachedGestures, preparedGesture);\n\n if (shouldUseReanimated) {\n return (\n <AnimatedWrap\n ref={refHandler}\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\n {props.children}\n </AnimatedWrap>\n );\n } else {\n return <Wrap ref={refHandler}>{props.children}</Wrap>;\n }\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"sources":["index.tsx"],"names":["React","useContext","useEffect","useLayoutEffect","useMemo","useRef","Platform","findNodeHandle","isTestEnv","GestureHandlerRootViewContext","useAnimatedGesture","attachHandlers","needsToReattach","dropHandlers","useWebEventHandlers","Wrap","AnimatedWrap","useDetectorUpdater","useViewRefHandler","useMountReactions","propagateDetectorConfig","props","gesture","keysToPropagate","key","value","undefined","g","toGestureArray","config","GestureDetector","rootViewContext","__DEV__","OS","Error","gestureConfig","gesturesToAttach","shouldUseReanimated","some","webEventHandlersRef","state","firstRender","viewRef","previousViewTag","forceRebuildReanimatedEvent","current","preparedGesture","attachedGestures","animatedEventHandler","animatedHandlers","isMounted","updateAttachedGestures","refHandler","needsToRebuildReanimatedEvent","viewTag","children"],"mappings":"AAAA;AACA,OAAOA,KAAP,IACEC,UADF,EAEEC,SAFF,EAGEC,eAHF,EAIEC,OAJF,EAKEC,MALF,QAMO,OANP;AAOA,SAASC,QAAT,QAAyB,cAAzB;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AAIA,SAASC,SAAT,QAA0B,gBAA1B;AAEA,OAAOC,6BAAP,MAA0C,wCAA1C;AAEA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,mBAAT,QAAoC,SAApC;AACA,SAASC,IAAT,EAAeC,YAAf,QAAmC,QAAnC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;;AAEA,SAASC,uBAAT,CACEC,KADF,EAEEC,OAFF,EAGE;AACA,QAAMC,eAA+C,GAAG,CACtD,YADsD,EAEtD,mBAFsD,EAGtD,aAHsD,CAAxD;;AAMA,OAAK,MAAMC,GAAX,IAAkBD,eAAlB,EAAmC;AACjC,UAAME,KAAK,GAAGJ,KAAK,CAACG,GAAD,CAAnB;;AACA,QAAIC,KAAK,KAAKC,SAAd,EAAyB;AACvB;AACD;;AAED,SAAK,MAAMC,CAAX,IAAgBL,OAAO,CAACM,cAAR,EAAhB,EAA0C;AACxC,YAAMC,MAAM,GAAGF,CAAC,CAACE,MAAjB;AACAA,MAAAA,MAAM,CAACL,GAAD,CAAN,GAAcC,KAAd;AACD;AACF;AACF;;AA+BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,eAAe,GAAIT,KAAD,IAAiC;AAC9D,QAAMU,eAAe,GAAG9B,UAAU,CAACQ,6BAAD,CAAlC;;AACA,MAAIuB,OAAO,IAAI,CAACD,eAAZ,IAA+B,CAACvB,SAAS,EAAzC,IAA+CF,QAAQ,CAAC2B,EAAT,KAAgB,KAAnE,EAA0E;AACxE,UAAM,IAAIC,KAAJ,CACJ,wNADI,CAAN;AAGD,GAN6D,CAQ9D;;;AACA,QAAMC,aAAa,GAAGd,KAAK,CAACC,OAA5B;AACAF,EAAAA,uBAAuB,CAACC,KAAD,EAAQc,aAAR,CAAvB;AAEA,QAAMC,gBAAgB,GAAGhC,OAAO,CAC9B,MAAM+B,aAAa,CAACP,cAAd,EADwB,EAE9B,CAACO,aAAD,CAF8B,CAAhC;AAIA,QAAME,mBAAmB,GAAGD,gBAAgB,CAACE,IAAjB,CACzBX,CAAD,IAAOA,CAAC,CAACU,mBADiB,CAA5B;AAIA,QAAME,mBAAmB,GAAGzB,mBAAmB,EAA/C,CApB8D,CAqB9D;;AACA,QAAM0B,KAAK,GAAGnC,MAAM,CAAuB;AACzCoC,IAAAA,WAAW,EAAE,IAD4B;AAEzCC,IAAAA,OAAO,EAAE,IAFgC;AAGzCC,IAAAA,eAAe,EAAE,CAAC,CAHuB;AAIzCC,IAAAA,2BAA2B,EAAE;AAJY,GAAvB,CAAN,CAKXC,OALH;AAOA,QAAMC,eAAe,GAAG9C,KAAK,CAACK,MAAN,CAAmC;AACzD0C,IAAAA,gBAAgB,EAAE,EADuC;AAEzDC,IAAAA,oBAAoB,EAAE,IAFmC;AAGzDC,IAAAA,gBAAgB,EAAE,IAHuC;AAIzDZ,IAAAA,mBAAmB,EAAEA,mBAJoC;AAKzDa,IAAAA,SAAS,EAAE;AAL8C,GAAnC,EAMrBL,OANH;AAQA,QAAMM,sBAAsB,GAAGlC,kBAAkB,CAC/CuB,KAD+C,EAE/CM,eAF+C,EAG/CV,gBAH+C,EAI/CD,aAJ+C,EAK/CI,mBAL+C,CAAjD;AAQA,QAAMa,UAAU,GAAGlC,iBAAiB,CAACsB,KAAD,EAAQW,sBAAR,CAApC,CA7C8D,CA+C9D;AACA;;AACA,QAAME,6BAA6B,GACjCb,KAAK,CAACC,WAAN,IACAD,KAAK,CAACI,2BADN,IAEAhC,eAAe,CAACkC,eAAD,EAAkBV,gBAAlB,CAHjB;AAIAI,EAAAA,KAAK,CAACI,2BAAN,GAAoC,KAApC;AAEAlC,EAAAA,kBAAkB,CAACoC,eAAD,EAAkBO,6BAAlB,CAAlB;AAEAlD,EAAAA,eAAe,CAAC,MAAM;AACpB,UAAMmD,OAAO,GAAG/C,cAAc,CAACiC,KAAK,CAACE,OAAP,CAA9B;AACAI,IAAAA,eAAe,CAACI,SAAhB,GAA4B,IAA5B;AAEAvC,IAAAA,cAAc,CAAC;AACbmC,MAAAA,eADa;AAEbX,MAAAA,aAFa;AAGbC,MAAAA,gBAHa;AAIbG,MAAAA,mBAJa;AAKbe,MAAAA;AALa,KAAD,CAAd;AAQA,WAAO,MAAM;AACXR,MAAAA,eAAe,CAACI,SAAhB,GAA4B,KAA5B;AACArC,MAAAA,YAAY,CAACiC,eAAD,CAAZ;AACD,KAHD;AAID,GAhBc,EAgBZ,EAhBY,CAAf;AAkBA5C,EAAAA,SAAS,CAAC,MAAM;AACd,QAAIsC,KAAK,CAACC,WAAV,EAAuB;AACrBD,MAAAA,KAAK,CAACC,WAAN,GAAoB,KAApB;AACD,KAFD,MAEO;AACLU,MAAAA,sBAAsB;AACvB;AACF,GANQ,EAMN,CAAC9B,KAAD,CANM,CAAT;AAQAF,EAAAA,iBAAiB,CAACgC,sBAAD,EAAyBL,eAAzB,CAAjB;;AAEA,MAAIT,mBAAJ,EAAyB;AACvB,wBACE,oBAAC,YAAD;AACE,MAAA,GAAG,EAAEe,UADP;AAEE,MAAA,qBAAqB,EAAEN,eAAe,CAACE;AAFzC,OAGG3B,KAAK,CAACkC,QAHT,CADF;AAOD,GARD,MAQO;AACL,wBAAO,oBAAC,IAAD;AAAM,MAAA,GAAG,EAAEH;AAAX,OAAwB/B,KAAK,CAACkC,QAA9B,CAAP;AACD;AACF,CAhGM","sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, {\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { Platform } from 'react-native';\nimport findNodeHandle from '../../../findNodeHandle';\nimport { GestureType } from '../gesture';\nimport { UserSelect, TouchAction } from '../../gestureHandlerCommon';\nimport { ComposedGesture } from '../gestureComposition';\nimport { isTestEnv } from '../../../utils';\n\nimport GestureHandlerRootViewContext from '../../../GestureHandlerRootViewContext';\nimport { AttachedGestureState, GestureDetectorState } from './types';\nimport { useAnimatedGesture } from './useAnimatedGesture';\nimport { attachHandlers } from './attachHandlers';\nimport { needsToReattach } from './needsToReattach';\nimport { dropHandlers } from './dropHandlers';\nimport { useWebEventHandlers } from './utils';\nimport { Wrap, AnimatedWrap } from './Wrap';\nimport { useDetectorUpdater } from './useDetectorUpdater';\nimport { useViewRefHandler } from './useViewRefHandler';\nimport { useMountReactions } from './useMountReactions';\n\nfunction propagateDetectorConfig(\n props: GestureDetectorProps,\n gesture: ComposedGesture | GestureType\n) {\n const keysToPropagate: (keyof GestureDetectorProps)[] = [\n 'userSelect',\n 'enableContextMenu',\n 'touchAction',\n ];\n\n for (const key of keysToPropagate) {\n const value = props[key];\n if (value === undefined) {\n continue;\n }\n\n for (const g of gesture.toGestureArray()) {\n const config = g.config as { [key: string]: unknown };\n config[key] = value;\n }\n }\n}\n\ninterface GestureDetectorProps {\n children?: React.ReactNode;\n /**\n * A gesture object containing the configuration and callbacks.\n * Can be any of:\n * - base gestures (`Tap`, `Pan`, ...)\n * - `ComposedGesture` (`Race`, `Simultaneous`, `Exclusive`)\n */\n gesture: ComposedGesture | GestureType;\n /**\n * #### Web only\n * This parameter allows to specify which `userSelect` property should be applied to underlying view.\n * Possible values are `\"none\" | \"auto\" | \"text\"`. Default value is set to `\"none\"`.\n */\n userSelect?: UserSelect;\n /**\n * #### Web only\n * Specifies whether context menu should be enabled after clicking on underlying view with right mouse button.\n * Default value is set to `false`.\n */\n enableContextMenu?: boolean;\n /**\n * #### Web only\n * This parameter allows to specify which `touchAction` property should be applied to underlying view.\n * Supports all CSS touch-action values (e.g. `\"none\"`, `\"pan-y\"`). Default value is set to `\"none\"`.\n */\n touchAction?: TouchAction;\n}\n\n/**\n * `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.\n *\n * ### Props\n * - `gesture`\n * - `userSelect` (**Web only**)\n * - `enableContextMenu` (**Web only**)\n * - `touchAction` (**Web only**)\n *\n * ### Remarks\n * - Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed.\n * - Using the same instance of a gesture across multiple Gesture Detectors is not possible.\n *\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture-detector\n */\nexport const GestureDetector = (props: GestureDetectorProps) => {\n const rootViewContext = useContext(GestureHandlerRootViewContext);\n if (__DEV__ && !rootViewContext && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n 'GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders\n const gestureConfig = props.gesture;\n propagateDetectorConfig(props, gestureConfig);\n\n const gesturesToAttach = useMemo(\n () => gestureConfig.toGestureArray(),\n [gestureConfig]\n );\n const shouldUseReanimated = gesturesToAttach.some(\n (g) => g.shouldUseReanimated\n );\n\n const webEventHandlersRef = useWebEventHandlers();\n // Store state in ref to prevent unnecessary renders\n const state = useRef<GestureDetectorState>({\n firstRender: true,\n viewRef: null,\n previousViewTag: -1,\n forceRebuildReanimatedEvent: false,\n }).current;\n\n const preparedGesture = React.useRef<AttachedGestureState>({\n attachedGestures: [],\n animatedEventHandler: null,\n animatedHandlers: null,\n shouldUseReanimated: shouldUseReanimated,\n isMounted: false,\n }).current;\n\n const updateAttachedGestures = useDetectorUpdater(\n state,\n preparedGesture,\n gesturesToAttach,\n gestureConfig,\n webEventHandlersRef\n );\n\n const refHandler = useViewRefHandler(state, updateAttachedGestures);\n\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\n // config update will be enough as all necessary items are stored in shared values anyway\n const needsToRebuildReanimatedEvent =\n state.firstRender ||\n state.forceRebuildReanimatedEvent ||\n needsToReattach(preparedGesture, gesturesToAttach);\n state.forceRebuildReanimatedEvent = false;\n\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\n\n useLayoutEffect(() => {\n const viewTag = findNodeHandle(state.viewRef) as number;\n preparedGesture.isMounted = true;\n\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n webEventHandlersRef,\n viewTag,\n });\n\n return () => {\n preparedGesture.isMounted = false;\n dropHandlers(preparedGesture);\n };\n }, []);\n\n useEffect(() => {\n if (state.firstRender) {\n state.firstRender = false;\n } else {\n updateAttachedGestures();\n }\n }, [props]);\n\n useMountReactions(updateAttachedGestures, preparedGesture);\n\n if (shouldUseReanimated) {\n return (\n <AnimatedWrap\n ref={refHandler}\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\n {props.children}\n </AnimatedWrap>\n );\n } else {\n return <Wrap ref={refHandler}>{props.children}</Wrap>;\n }\n};\n"]}
@@ -6,11 +6,13 @@ export function needsToReattach(preparedGesture, newGestures) {
6
6
  if (newGestures.length !== preparedGesture.attachedGestures.length) {
7
7
  return true;
8
8
  }
9
+
9
10
  for (let i = 0; i < newGestures.length; i++) {
10
11
  if (newGestures[i].handlerName !== preparedGesture.attachedGestures[i].handlerName || newGestures[i].shouldUseReanimated !== preparedGesture.attachedGestures[i].shouldUseReanimated) {
11
12
  return true;
12
13
  }
13
14
  }
15
+
14
16
  return false;
15
17
  }
16
18
  //# sourceMappingURL=needsToReattach.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["needsToReattach","preparedGesture","newGestures","length","attachedGestures","i","handlerName","shouldUseReanimated"],"sources":["needsToReattach.ts"],"sourcesContent":["import { GestureType } from '../gesture';\nimport { AttachedGestureState } from './types';\n\n// Checks whether the gesture should be reattached to the view, this will happen when:\n// - The number of gestures in the preparedGesture is different than the number of gestures in the gesture\n// - The handlerName is different in any of the gestures\n// - At least one of the gestures changed the thread it runs on\nexport function needsToReattach(\n preparedGesture: AttachedGestureState,\n newGestures: GestureType[]\n) {\n if (newGestures.length !== preparedGesture.attachedGestures.length) {\n return true;\n }\n for (let i = 0; i < newGestures.length; i++) {\n if (\n newGestures[i].handlerName !==\n preparedGesture.attachedGestures[i].handlerName ||\n newGestures[i].shouldUseReanimated !==\n preparedGesture.attachedGestures[i].shouldUseReanimated\n ) {\n return true;\n }\n }\n\n return false;\n}\n"],"mappings":"AAGA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAC7BC,eAAqC,EACrCC,WAA0B,EAC1B;EACA,IAAIA,WAAW,CAACC,MAAM,KAAKF,eAAe,CAACG,gBAAgB,CAACD,MAAM,EAAE;IAClE,OAAO,IAAI;EACb;EACA,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,WAAW,CAACC,MAAM,EAAEE,CAAC,EAAE,EAAE;IAC3C,IACEH,WAAW,CAACG,CAAC,CAAC,CAACC,WAAW,KACxBL,eAAe,CAACG,gBAAgB,CAACC,CAAC,CAAC,CAACC,WAAW,IACjDJ,WAAW,CAACG,CAAC,CAAC,CAACE,mBAAmB,KAChCN,eAAe,CAACG,gBAAgB,CAACC,CAAC,CAAC,CAACE,mBAAmB,EACzD;MACA,OAAO,IAAI;IACb;EACF;EAEA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"sources":["needsToReattach.ts"],"names":["needsToReattach","preparedGesture","newGestures","length","attachedGestures","i","handlerName","shouldUseReanimated"],"mappings":"AAGA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAT,CACLC,eADK,EAELC,WAFK,EAGL;AACA,MAAIA,WAAW,CAACC,MAAZ,KAAuBF,eAAe,CAACG,gBAAhB,CAAiCD,MAA5D,EAAoE;AAClE,WAAO,IAAP;AACD;;AACD,OAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,WAAW,CAACC,MAAhC,EAAwCE,CAAC,EAAzC,EAA6C;AAC3C,QACEH,WAAW,CAACG,CAAD,CAAX,CAAeC,WAAf,KACEL,eAAe,CAACG,gBAAhB,CAAiCC,CAAjC,EAAoCC,WADtC,IAEAJ,WAAW,CAACG,CAAD,CAAX,CAAeE,mBAAf,KACEN,eAAe,CAACG,gBAAhB,CAAiCC,CAAjC,EAAoCE,mBAJxC,EAKE;AACA,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD","sourcesContent":["import { GestureType } from '../gesture';\nimport { AttachedGestureState } from './types';\n\n// Checks whether the gesture should be reattached to the view, this will happen when:\n// - The number of gestures in the preparedGesture is different than the number of gestures in the gesture\n// - The handlerName is different in any of the gestures\n// - At least one of the gestures changed the thread it runs on\nexport function needsToReattach(\n preparedGesture: AttachedGestureState,\n newGestures: GestureType[]\n) {\n if (newGestures.length !== preparedGesture.attachedGestures.length) {\n return true;\n }\n for (let i = 0; i < newGestures.length; i++) {\n if (\n newGestures[i].handlerName !==\n preparedGesture.attachedGestures[i].handlerName ||\n newGestures[i].shouldUseReanimated !==\n preparedGesture.attachedGestures[i].shouldUseReanimated\n ) {\n return true;\n }\n }\n\n return false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { GestureType, HandlerCallbacks } from '../gesture';\nimport { SharedValue } from '../reanimatedWrapper';\nimport { HandlerStateChangeEvent } from '../../gestureHandlerCommon';\n\nexport interface AttachedGestureState {\n // Array of gestures that should be attached to the view under that gesture detector\n attachedGestures: GestureType[];\n // Event handler for the gesture, returned by `useEvent` from Reanimated\n animatedEventHandler: unknown;\n // Shared value that's responsible for transferring the callbacks to the UI thread handler\n animatedHandlers: SharedValue<\n HandlerCallbacks<Record<string, unknown>>[] | null\n > | null;\n // Whether `useAnimatedGesture` should be called inside detector\n shouldUseReanimated: boolean;\n // Whether the GestureDetector is mounted\n isMounted: boolean;\n}\n\nexport interface GestureDetectorState {\n firstRender: boolean;\n viewRef: React.Component | null;\n previousViewTag: number;\n forceRebuildReanimatedEvent: boolean;\n}\n\nexport interface WebEventHandler {\n onGestureHandlerEvent: (event: HandlerStateChangeEvent<unknown>) => void;\n onGestureHandlerStateChange?: (\n event: HandlerStateChangeEvent<unknown>\n ) => void;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}