react-native-gesture-handler 2.22.1 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (677) hide show
  1. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
  2. package/android/src/main/jni/cpp-adapter.cpp +19 -12
  3. package/apple/RNGestureHandler.mm +15 -8
  4. package/apple/RNGestureHandlerModule.mm +17 -5
  5. package/lib/commonjs/ActionType.js +3 -3
  6. package/lib/commonjs/ActionType.js.map +1 -1
  7. package/lib/commonjs/Directions.js +11 -8
  8. package/lib/commonjs/Directions.js.map +1 -1
  9. package/lib/commonjs/EnableNewWebImplementation.js +2 -10
  10. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
  11. package/lib/commonjs/GestureHandlerRootViewContext.js +2 -7
  12. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
  13. package/lib/commonjs/PlatformConstants.js +1 -6
  14. package/lib/commonjs/PlatformConstants.js.map +1 -1
  15. package/lib/commonjs/PlatformConstants.web.js +1 -3
  16. package/lib/commonjs/PlatformConstants.web.js.map +1 -1
  17. package/lib/commonjs/PointerType.js +3 -5
  18. package/lib/commonjs/PointerType.js.map +1 -1
  19. package/lib/commonjs/RNGestureHandlerModule.js +2 -6
  20. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  21. package/lib/commonjs/RNGestureHandlerModule.web.js +13 -39
  22. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  23. package/lib/commonjs/RNGestureHandlerModule.windows.js +22 -32
  24. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  25. package/lib/commonjs/RNRenderer.js +1 -3
  26. package/lib/commonjs/RNRenderer.js.map +1 -1
  27. package/lib/commonjs/RNRenderer.web.js +1 -2
  28. package/lib/commonjs/RNRenderer.web.js.map +1 -1
  29. package/lib/commonjs/State.js +4 -3
  30. package/lib/commonjs/State.js.map +1 -1
  31. package/lib/commonjs/TouchEventType.js +3 -3
  32. package/lib/commonjs/TouchEventType.js.map +1 -1
  33. package/lib/commonjs/components/DrawerLayout.js +96 -115
  34. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  35. package/lib/commonjs/components/GestureButtons.js +36 -80
  36. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  37. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
  38. package/lib/commonjs/components/GestureComponents.js +26 -37
  39. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  40. package/lib/commonjs/components/GestureComponents.web.js +13 -27
  41. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  42. package/lib/commonjs/components/GestureHandlerButton.js +2 -6
  43. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  44. package/lib/commonjs/components/GestureHandlerButton.web.js +4 -12
  45. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
  46. package/lib/commonjs/components/GestureHandlerRootView.android.js +4 -15
  47. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  48. package/lib/commonjs/components/GestureHandlerRootView.js +4 -14
  49. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  50. package/lib/commonjs/components/GestureHandlerRootView.web.js +4 -13
  51. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
  52. package/lib/commonjs/components/Pressable/Pressable.js +46 -78
  53. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
  54. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
  55. package/lib/commonjs/components/Pressable/index.js +1 -3
  56. package/lib/commonjs/components/Pressable/index.js.map +1 -1
  57. package/lib/commonjs/components/Pressable/utils.js +5 -20
  58. package/lib/commonjs/components/Pressable/utils.js.map +1 -1
  59. package/lib/commonjs/components/ReanimatedDrawerLayout.js +38 -76
  60. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
  61. package/lib/commonjs/components/ReanimatedSwipeable.js +61 -59
  62. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
  63. package/lib/commonjs/components/Swipeable.js +34 -75
  64. package/lib/commonjs/components/Swipeable.js.map +1 -1
  65. package/lib/commonjs/components/Text.js +18 -26
  66. package/lib/commonjs/components/Text.js.map +1 -1
  67. package/lib/commonjs/components/gestureHandlerRootHOC.js +5 -14
  68. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
  69. package/lib/commonjs/components/touchables/GenericTouchable.js +40 -76
  70. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  71. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
  72. package/lib/commonjs/components/touchables/TouchableHighlight.js +20 -33
  73. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  74. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +17 -31
  75. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  76. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -4
  77. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
  78. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  79. package/lib/commonjs/components/touchables/TouchableOpacity.js +17 -24
  80. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  81. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +12 -13
  82. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  83. package/lib/commonjs/components/touchables/index.js +7 -12
  84. package/lib/commonjs/components/touchables/index.js.map +1 -1
  85. package/lib/commonjs/findNodeHandle.js +1 -4
  86. package/lib/commonjs/findNodeHandle.js.map +1 -1
  87. package/lib/commonjs/findNodeHandle.web.js +9 -10
  88. package/lib/commonjs/findNodeHandle.web.js.map +1 -1
  89. package/lib/commonjs/getReactNativeVersion.js +1 -6
  90. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  91. package/lib/commonjs/getReactNativeVersion.web.js +0 -1
  92. package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
  93. package/lib/commonjs/getShadowNodeFromRef.js +13 -14
  94. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  95. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -1
  96. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
  97. package/lib/commonjs/ghQueueMicrotask.js +1 -2
  98. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  99. package/lib/commonjs/handlers/FlingGestureHandler.js +16 -10
  100. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  101. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +20 -23
  102. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  103. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
  104. package/lib/commonjs/handlers/LongPressGestureHandler.js +16 -10
  105. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  106. package/lib/commonjs/handlers/NativeViewGestureHandler.js +17 -12
  107. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  108. package/lib/commonjs/handlers/PanGestureHandler.js +20 -31
  109. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  110. package/lib/commonjs/handlers/PinchGestureHandler.js +14 -8
  111. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  112. package/lib/commonjs/handlers/PressabilityDebugView.js +0 -1
  113. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  114. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -1
  115. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
  116. package/lib/commonjs/handlers/RotationGestureHandler.js +14 -8
  117. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  118. package/lib/commonjs/handlers/TapGestureHandler.js +16 -10
  119. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  120. package/lib/commonjs/handlers/createHandler.js +55 -135
  121. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  122. package/lib/commonjs/handlers/createNativeWrapper.js +17 -27
  123. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  124. package/lib/commonjs/handlers/customDirectEventTypes.js +0 -1
  125. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
  126. package/lib/commonjs/handlers/customDirectEventTypes.web.js +1 -2
  127. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
  128. package/lib/commonjs/handlers/gestureHandlerCommon.js +9 -10
  129. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  130. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
  131. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +5 -14
  132. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  133. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +10 -20
  134. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  135. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -29
  136. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  137. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +1 -10
  138. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  139. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +12 -37
  140. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  141. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -3
  142. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  143. package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
  144. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +12 -24
  145. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  146. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -48
  147. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  148. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +3 -13
  149. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  150. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +2 -9
  151. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  152. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +8 -16
  153. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  154. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +28 -56
  155. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  156. package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -46
  157. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  158. package/lib/commonjs/handlers/gestures/flingGesture.js +5 -12
  159. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  160. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +8 -19
  161. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  162. package/lib/commonjs/handlers/gestures/gesture.js +44 -84
  163. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  164. package/lib/commonjs/handlers/gestures/gestureComposition.js +17 -31
  165. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  166. package/lib/commonjs/handlers/gestures/gestureObjects.js +1 -27
  167. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  168. package/lib/commonjs/handlers/gestures/gestureStateManager.js +3 -9
  169. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  170. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +2 -7
  171. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  172. package/lib/commonjs/handlers/gestures/hoverGesture.js +11 -25
  173. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  174. package/lib/commonjs/handlers/gestures/longPressGesture.js +6 -14
  175. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  176. package/lib/commonjs/handlers/gestures/manualGesture.js +0 -6
  177. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
  178. package/lib/commonjs/handlers/gestures/nativeGesture.js +5 -12
  179. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  180. package/lib/commonjs/handlers/gestures/panGesture.js +18 -43
  181. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  182. package/lib/commonjs/handlers/gestures/pinchGesture.js +2 -9
  183. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  184. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +1 -8
  185. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
  186. package/lib/commonjs/handlers/gestures/rotationGesture.js +2 -9
  187. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  188. package/lib/commonjs/handlers/gestures/tapGesture.js +10 -22
  189. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  190. package/lib/commonjs/handlers/getNextHandlerTag.js +0 -1
  191. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
  192. package/lib/commonjs/handlers/handlersRegistry.js +11 -21
  193. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  194. package/lib/commonjs/handlers/utils.js +6 -26
  195. package/lib/commonjs/handlers/utils.js.map +1 -1
  196. package/lib/commonjs/index.js +75 -104
  197. package/lib/commonjs/index.js.map +1 -1
  198. package/lib/commonjs/init.js +4 -11
  199. package/lib/commonjs/init.js.map +1 -1
  200. package/lib/commonjs/jestUtils/index.js +4 -5
  201. package/lib/commonjs/jestUtils/index.js.map +1 -1
  202. package/lib/commonjs/jestUtils/jestUtils.js +19 -83
  203. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  204. package/lib/commonjs/mocks.js +5 -15
  205. package/lib/commonjs/mocks.js.map +1 -1
  206. package/lib/commonjs/mountRegistry.js +3 -12
  207. package/lib/commonjs/mountRegistry.js.map +1 -1
  208. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +1 -5
  209. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
  210. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +2 -7
  211. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  212. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +2 -7
  213. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  214. package/lib/commonjs/typeUtils.js.map +1 -1
  215. package/lib/commonjs/utils.js +15 -30
  216. package/lib/commonjs/utils.js.map +1 -1
  217. package/lib/commonjs/web/Gestures.js +5 -23
  218. package/lib/commonjs/web/Gestures.js.map +1 -1
  219. package/lib/commonjs/web/constants.js +2 -4
  220. package/lib/commonjs/web/constants.js.map +1 -1
  221. package/lib/commonjs/web/detectors/RotationGestureDetector.js +26 -62
  222. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  223. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +36 -65
  224. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  225. package/lib/commonjs/web/handlers/FlingGestureHandler.js +12 -55
  226. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  227. package/lib/commonjs/web/handlers/GestureHandler.js +160 -273
  228. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  229. package/lib/commonjs/web/handlers/HoverGestureHandler.js +8 -21
  230. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
  231. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
  232. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +12 -53
  233. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  234. package/lib/commonjs/web/handlers/ManualGestureHandler.js +1 -11
  235. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
  236. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +21 -62
  237. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  238. package/lib/commonjs/web/handlers/PanGestureHandler.js +23 -138
  239. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  240. package/lib/commonjs/web/handlers/PinchGestureHandler.js +19 -56
  241. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  242. package/lib/commonjs/web/handlers/RotationGestureHandler.js +16 -54
  243. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  244. package/lib/commonjs/web/handlers/TapGestureHandler.js +10 -71
  245. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  246. package/lib/commonjs/web/interfaces.js +9 -17
  247. package/lib/commonjs/web/interfaces.js.map +1 -1
  248. package/lib/commonjs/web/tools/CircularBuffer.js +17 -29
  249. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
  250. package/lib/commonjs/web/tools/EventManager.js +7 -41
  251. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  252. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
  253. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +51 -118
  254. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  255. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +37 -58
  256. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  257. package/lib/commonjs/web/tools/InteractionManager.js +21 -40
  258. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  259. package/lib/commonjs/web/tools/KeyboardEventManager.js +4 -26
  260. package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
  261. package/lib/commonjs/web/tools/LeastSquareSolver.js +30 -67
  262. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  263. package/lib/commonjs/web/tools/NodeManager.js +9 -16
  264. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  265. package/lib/commonjs/web/tools/PointerEventManager.js +10 -45
  266. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  267. package/lib/commonjs/web/tools/PointerTracker.js +24 -60
  268. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  269. package/lib/commonjs/web/tools/Vector.js +3 -18
  270. package/lib/commonjs/web/tools/Vector.js.map +1 -1
  271. package/lib/commonjs/web/tools/VelocityTracker.js +10 -32
  272. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  273. package/lib/commonjs/web/tools/WheelEventManager.js +4 -17
  274. package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
  275. package/lib/commonjs/web/utils.js +26 -55
  276. package/lib/commonjs/web/utils.js.map +1 -1
  277. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +7 -19
  278. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
  279. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +3 -13
  280. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
  281. package/lib/commonjs/web_hammer/Errors.js +0 -3
  282. package/lib/commonjs/web_hammer/Errors.js.map +1 -1
  283. package/lib/commonjs/web_hammer/FlingGestureHandler.js +13 -44
  284. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
  285. package/lib/commonjs/web_hammer/GestureHandler.js +55 -142
  286. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
  287. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +2 -11
  288. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  289. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +5 -19
  290. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
  291. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +16 -24
  292. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
  293. package/lib/commonjs/web_hammer/NodeManager.js +9 -16
  294. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  295. package/lib/commonjs/web_hammer/PanGestureHandler.js +8 -49
  296. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
  297. package/lib/commonjs/web_hammer/PinchGestureHandler.js +2 -11
  298. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
  299. package/lib/commonjs/web_hammer/PressGestureHandler.js +15 -43
  300. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
  301. package/lib/commonjs/web_hammer/RotationGestureHandler.js +2 -13
  302. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
  303. package/lib/commonjs/web_hammer/TapGestureHandler.js +33 -52
  304. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
  305. package/lib/commonjs/web_hammer/constants.js +13 -26
  306. package/lib/commonjs/web_hammer/constants.js.map +1 -1
  307. package/lib/commonjs/web_hammer/utils.js +4 -14
  308. package/lib/commonjs/web_hammer/utils.js.map +1 -1
  309. package/lib/module/ActionType.js +3 -1
  310. package/lib/module/ActionType.js.map +1 -1
  311. package/lib/module/Directions.js +9 -3
  312. package/lib/module/Directions.js.map +1 -1
  313. package/lib/module/EnableNewWebImplementation.js +2 -5
  314. package/lib/module/EnableNewWebImplementation.js.map +1 -1
  315. package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
  316. package/lib/module/PlatformConstants.js +0 -1
  317. package/lib/module/PlatformConstants.js.map +1 -1
  318. package/lib/module/PlatformConstants.web.js +0 -1
  319. package/lib/module/PlatformConstants.web.js.map +1 -1
  320. package/lib/module/PointerType.js +3 -4
  321. package/lib/module/PointerType.js.map +1 -1
  322. package/lib/module/RNGestureHandlerModule.js +1 -0
  323. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  324. package/lib/module/RNGestureHandlerModule.web.js +12 -22
  325. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  326. package/lib/module/RNGestureHandlerModule.windows.js +18 -17
  327. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  328. package/lib/module/RNRenderer.js.map +1 -1
  329. package/lib/module/RNRenderer.web.js.map +1 -1
  330. package/lib/module/State.js +4 -1
  331. package/lib/module/State.js.map +1 -1
  332. package/lib/module/TouchEventType.js +3 -1
  333. package/lib/module/TouchEventType.js.map +1 -1
  334. package/lib/module/components/DrawerLayout.js +87 -99
  335. package/lib/module/components/DrawerLayout.js.map +1 -1
  336. package/lib/module/components/GestureButtons.js +27 -55
  337. package/lib/module/components/GestureButtons.js.map +1 -1
  338. package/lib/module/components/GestureButtonsProps.js.map +1 -1
  339. package/lib/module/components/GestureComponents.js +17 -12
  340. package/lib/module/components/GestureComponents.js.map +1 -1
  341. package/lib/module/components/GestureComponents.web.js +4 -4
  342. package/lib/module/components/GestureComponents.web.js.map +1 -1
  343. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  344. package/lib/module/components/GestureHandlerButton.web.js +1 -2
  345. package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
  346. package/lib/module/components/GestureHandlerRootView.android.js +1 -2
  347. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  348. package/lib/module/components/GestureHandlerRootView.js +1 -2
  349. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  350. package/lib/module/components/GestureHandlerRootView.web.js +1 -2
  351. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
  352. package/lib/module/components/Pressable/Pressable.js +44 -61
  353. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  354. package/lib/module/components/Pressable/PressableProps.js.map +1 -1
  355. package/lib/module/components/Pressable/index.js.map +1 -1
  356. package/lib/module/components/Pressable/utils.js +4 -14
  357. package/lib/module/components/Pressable/utils.js.map +1 -1
  358. package/lib/module/components/ReanimatedDrawerLayout.js +34 -56
  359. package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
  360. package/lib/module/components/ReanimatedSwipeable.js +57 -44
  361. package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
  362. package/lib/module/components/Swipeable.js +28 -59
  363. package/lib/module/components/Swipeable.js.map +1 -1
  364. package/lib/module/components/Text.js +14 -13
  365. package/lib/module/components/Text.js.map +1 -1
  366. package/lib/module/components/gestureHandlerRootHOC.js +2 -2
  367. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
  368. package/lib/module/components/touchables/GenericTouchable.js +34 -63
  369. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  370. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
  371. package/lib/module/components/touchables/TouchableHighlight.js +16 -23
  372. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  373. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +11 -19
  374. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  375. package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
  376. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
  377. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  378. package/lib/module/components/touchables/TouchableOpacity.js +13 -14
  379. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  380. package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -2
  381. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  382. package/lib/module/components/touchables/index.js.map +1 -1
  383. package/lib/module/findNodeHandle.js.map +1 -1
  384. package/lib/module/findNodeHandle.web.js +9 -8
  385. package/lib/module/findNodeHandle.web.js.map +1 -1
  386. package/lib/module/getReactNativeVersion.js.map +1 -1
  387. package/lib/module/getReactNativeVersion.web.js.map +1 -1
  388. package/lib/module/getShadowNodeFromRef.js +13 -13
  389. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  390. package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
  391. package/lib/module/ghQueueMicrotask.js.map +1 -1
  392. package/lib/module/handlers/FlingGestureHandler.js +13 -0
  393. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  394. package/lib/module/handlers/ForceTouchGestureHandler.js +16 -8
  395. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  396. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
  397. package/lib/module/handlers/LongPressGestureHandler.js +13 -0
  398. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  399. package/lib/module/handlers/NativeViewGestureHandler.js +13 -0
  400. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  401. package/lib/module/handlers/PanGestureHandler.js +15 -19
  402. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  403. package/lib/module/handlers/PinchGestureHandler.js +13 -0
  404. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  405. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  406. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
  407. package/lib/module/handlers/RotationGestureHandler.js +13 -0
  408. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  409. package/lib/module/handlers/TapGestureHandler.js +13 -0
  410. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  411. package/lib/module/handlers/createHandler.js +54 -108
  412. package/lib/module/handlers/createHandler.js.map +1 -1
  413. package/lib/module/handlers/createNativeWrapper.js +12 -17
  414. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  415. package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
  416. package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
  417. package/lib/module/handlers/gestureHandlerCommon.js +9 -4
  418. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  419. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
  420. package/lib/module/handlers/gestures/GestureDetector/Wrap.js +3 -4
  421. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  422. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +5 -6
  423. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  424. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +8 -16
  425. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  426. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -1
  427. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  428. package/lib/module/handlers/gestures/GestureDetector/index.js +9 -15
  429. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  430. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -2
  431. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  432. package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
  433. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +11 -14
  434. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  435. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -39
  436. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  437. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
  438. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  439. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +2 -6
  440. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  441. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -9
  442. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  443. package/lib/module/handlers/gestures/GestureDetector/utils.js +25 -30
  444. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  445. package/lib/module/handlers/gestures/eventReceiver.js +14 -38
  446. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  447. package/lib/module/handlers/gestures/flingGesture.js +5 -9
  448. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  449. package/lib/module/handlers/gestures/forceTouchGesture.js +8 -17
  450. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  451. package/lib/module/handlers/gestures/gesture.js +44 -73
  452. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  453. package/lib/module/handlers/gestures/gestureComposition.js +16 -24
  454. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  455. package/lib/module/handlers/gestures/gestureObjects.js +1 -14
  456. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  457. package/lib/module/handlers/gestures/gestureStateManager.js +3 -4
  458. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  459. package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -1
  460. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  461. package/lib/module/handlers/gestures/hoverGesture.js +9 -18
  462. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  463. package/lib/module/handlers/gestures/longPressGesture.js +6 -11
  464. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  465. package/lib/module/handlers/gestures/manualGesture.js +0 -4
  466. package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
  467. package/lib/module/handlers/gestures/nativeGesture.js +5 -9
  468. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  469. package/lib/module/handlers/gestures/panGesture.js +18 -41
  470. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  471. package/lib/module/handlers/gestures/pinchGesture.js +2 -7
  472. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  473. package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -5
  474. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
  475. package/lib/module/handlers/gestures/rotationGesture.js +2 -7
  476. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  477. package/lib/module/handlers/gestures/tapGesture.js +10 -19
  478. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  479. package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
  480. package/lib/module/handlers/handlersRegistry.js +6 -8
  481. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  482. package/lib/module/handlers/utils.js +4 -13
  483. package/lib/module/handlers/utils.js.map +1 -1
  484. package/lib/module/index.js.map +1 -1
  485. package/lib/module/init.js +3 -2
  486. package/lib/module/init.js.map +1 -1
  487. package/lib/module/jestUtils/index.js.map +1 -1
  488. package/lib/module/jestUtils/jestUtils.js +20 -66
  489. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  490. package/lib/module/mocks.js +3 -7
  491. package/lib/module/mocks.js.map +1 -1
  492. package/lib/module/mountRegistry.js +3 -10
  493. package/lib/module/mountRegistry.js.map +1 -1
  494. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
  495. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  496. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  497. package/lib/module/typeUtils.js.map +1 -1
  498. package/lib/module/utils.js +8 -13
  499. package/lib/module/utils.js.map +1 -1
  500. package/lib/module/web/Gestures.js +2 -1
  501. package/lib/module/web/Gestures.js.map +1 -1
  502. package/lib/module/web/constants.js.map +1 -1
  503. package/lib/module/web/detectors/RotationGestureDetector.js +26 -59
  504. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  505. package/lib/module/web/detectors/ScaleGestureDetector.js +36 -61
  506. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  507. package/lib/module/web/handlers/FlingGestureHandler.js +11 -45
  508. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  509. package/lib/module/web/handlers/GestureHandler.js +159 -259
  510. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  511. package/lib/module/web/handlers/HoverGestureHandler.js +7 -13
  512. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  513. package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
  514. package/lib/module/web/handlers/LongPressGestureHandler.js +11 -46
  515. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  516. package/lib/module/web/handlers/ManualGestureHandler.js +0 -6
  517. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  518. package/lib/module/web/handlers/NativeViewGestureHandler.js +20 -54
  519. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  520. package/lib/module/web/handlers/PanGestureHandler.js +22 -129
  521. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  522. package/lib/module/web/handlers/PinchGestureHandler.js +18 -48
  523. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  524. package/lib/module/web/handlers/RotationGestureHandler.js +15 -46
  525. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  526. package/lib/module/web/handlers/TapGestureHandler.js +9 -63
  527. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  528. package/lib/module/web/interfaces.js +9 -14
  529. package/lib/module/web/interfaces.js.map +1 -1
  530. package/lib/module/web/tools/CircularBuffer.js +17 -27
  531. package/lib/module/web/tools/CircularBuffer.js.map +1 -1
  532. package/lib/module/web/tools/EventManager.js +7 -39
  533. package/lib/module/web/tools/EventManager.js.map +1 -1
  534. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
  535. package/lib/module/web/tools/GestureHandlerOrchestrator.js +50 -111
  536. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  537. package/lib/module/web/tools/GestureHandlerWebDelegate.js +36 -47
  538. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  539. package/lib/module/web/tools/InteractionManager.js +21 -35
  540. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  541. package/lib/module/web/tools/KeyboardEventManager.js +3 -19
  542. package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
  543. package/lib/module/web/tools/LeastSquareSolver.js +30 -65
  544. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  545. package/lib/module/web/tools/NodeManager.js +9 -14
  546. package/lib/module/web/tools/NodeManager.js.map +1 -1
  547. package/lib/module/web/tools/PointerEventManager.js +9 -35
  548. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  549. package/lib/module/web/tools/PointerTracker.js +23 -54
  550. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  551. package/lib/module/web/tools/Vector.js +3 -14
  552. package/lib/module/web/tools/Vector.js.map +1 -1
  553. package/lib/module/web/tools/VelocityTracker.js +9 -26
  554. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  555. package/lib/module/web/tools/WheelEventManager.js +3 -10
  556. package/lib/module/web/tools/WheelEventManager.js.map +1 -1
  557. package/lib/module/web/utils.js +21 -40
  558. package/lib/module/web/utils.js.map +1 -1
  559. package/lib/module/web_hammer/DiscreteGestureHandler.js +4 -13
  560. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
  561. package/lib/module/web_hammer/DraggingGestureHandler.js +0 -5
  562. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
  563. package/lib/module/web_hammer/Errors.js +0 -1
  564. package/lib/module/web_hammer/Errors.js.map +1 -1
  565. package/lib/module/web_hammer/FlingGestureHandler.js +10 -35
  566. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
  567. package/lib/module/web_hammer/GestureHandler.js +53 -130
  568. package/lib/module/web_hammer/GestureHandler.js.map +1 -1
  569. package/lib/module/web_hammer/IndiscreteGestureHandler.js +1 -6
  570. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  571. package/lib/module/web_hammer/LongPressGestureHandler.js +2 -11
  572. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
  573. package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
  574. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
  575. package/lib/module/web_hammer/NodeManager.js +6 -8
  576. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  577. package/lib/module/web_hammer/PanGestureHandler.js +6 -40
  578. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
  579. package/lib/module/web_hammer/PinchGestureHandler.js +0 -5
  580. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
  581. package/lib/module/web_hammer/PressGestureHandler.js +13 -34
  582. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
  583. package/lib/module/web_hammer/RotationGestureHandler.js +0 -6
  584. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
  585. package/lib/module/web_hammer/TapGestureHandler.js +31 -45
  586. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
  587. package/lib/module/web_hammer/constants.js +2 -1
  588. package/lib/module/web_hammer/constants.js.map +1 -1
  589. package/lib/module/web_hammer/utils.js +2 -2
  590. package/lib/module/web_hammer/utils.js.map +1 -1
  591. package/lib/typescript/components/DrawerLayout.d.ts +27 -0
  592. package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
  593. package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
  594. package/lib/typescript/components/Pressable/index.d.ts +1 -1
  595. package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
  596. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
  597. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
  598. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
  599. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
  600. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
  601. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
  602. package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
  603. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
  604. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
  605. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
  606. package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
  607. package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
  608. package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
  609. package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
  610. package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
  611. package/lib/typescript/index.d.ts +1 -1
  612. package/lib/typescript/utils.d.ts +1 -1
  613. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
  614. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
  615. package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
  616. package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
  617. package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
  618. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
  619. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
  620. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
  621. package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
  622. package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
  623. package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
  624. package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
  625. package/package.json +2 -2
  626. package/src/RNGestureHandlerModule.web.ts +2 -2
  627. package/src/components/DrawerLayout.tsx +29 -0
  628. package/src/components/GestureButtons.tsx +13 -2
  629. package/src/components/GestureButtonsProps.ts +31 -2
  630. package/src/components/Pressable/Pressable.tsx +22 -5
  631. package/src/components/Pressable/PressableProps.tsx +4 -11
  632. package/src/components/Pressable/index.ts +4 -1
  633. package/src/components/ReanimatedSwipeable.tsx +97 -66
  634. package/src/components/Text.tsx +13 -4
  635. package/src/components/touchables/TouchableHighlight.tsx +5 -0
  636. package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
  637. package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
  638. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
  639. package/src/components/touchables/TouchableOpacity.tsx +5 -0
  640. package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
  641. package/src/findNodeHandle.web.ts +6 -0
  642. package/src/handlers/FlingGestureHandler.ts +10 -0
  643. package/src/handlers/ForceTouchGestureHandler.ts +9 -0
  644. package/src/handlers/LongPressGestureHandler.ts +10 -0
  645. package/src/handlers/NativeViewGestureHandler.ts +10 -0
  646. package/src/handlers/PanGestureHandler.ts +10 -0
  647. package/src/handlers/PinchGestureHandler.ts +10 -0
  648. package/src/handlers/RotationGestureHandler.ts +10 -0
  649. package/src/handlers/TapGestureHandler.ts +10 -0
  650. package/src/handlers/createHandler.tsx +11 -4
  651. package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
  652. package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
  653. package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
  654. package/src/handlers/handlersRegistry.ts +7 -3
  655. package/src/index.ts +4 -1
  656. package/src/utils.ts +2 -2
  657. package/src/web/detectors/RotationGestureDetector.ts +22 -22
  658. package/src/web/detectors/ScaleGestureDetector.ts +24 -24
  659. package/src/web/handlers/FlingGestureHandler.ts +6 -7
  660. package/src/web/handlers/GestureHandler.ts +115 -105
  661. package/src/web/handlers/HoverGestureHandler.ts +2 -2
  662. package/src/web/handlers/IGestureHandler.ts +12 -13
  663. package/src/web/handlers/LongPressGestureHandler.ts +7 -7
  664. package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
  665. package/src/web/handlers/PanGestureHandler.ts +17 -17
  666. package/src/web/handlers/PinchGestureHandler.ts +17 -21
  667. package/src/web/handlers/RotationGestureHandler.ts +12 -12
  668. package/src/web/handlers/TapGestureHandler.ts +4 -6
  669. package/src/web/tools/CircularBuffer.ts +15 -15
  670. package/src/web/tools/GestureHandlerDelegate.ts +1 -1
  671. package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
  672. package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
  673. package/src/web/tools/InteractionManager.ts +16 -16
  674. package/src/web/tools/NodeManager.ts +2 -2
  675. package/src/web/tools/PointerTracker.ts +20 -20
  676. package/src/web/tools/Vector.ts +1 -1
  677. package/src/web/tools/VelocityTracker.ts +1 -1
@@ -3,15 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ContinousBaseGesture = exports.BaseGesture = exports.Gesture = exports.CALLBACK_TYPE = void 0;
7
-
6
+ exports.Gesture = exports.ContinousBaseGesture = exports.CALLBACK_TYPE = exports.BaseGesture = void 0;
8
7
  var _getNextHandlerTag = require("../getNextHandlerTag");
9
-
10
8
  var _utils = require("../../utils");
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ // Allow adding a ref to a gesture handler
11
13
 
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
- const CALLBACK_TYPE = {
14
+ const CALLBACK_TYPE = exports.CALLBACK_TYPE = {
15
15
  UNDEFINED: 0,
16
16
  BEGAN: 1,
17
17
  START: 2,
@@ -23,204 +23,185 @@ const CALLBACK_TYPE = {
23
23
  TOUCHES_MOVE: 8,
24
24
  TOUCHES_UP: 9,
25
25
  TOUCHES_CANCELLED: 10
26
- }; // Allow using CALLBACK_TYPE as object and type
27
- // eslint-disable-next-line @typescript-eslint/no-redeclare
26
+ };
28
27
 
29
- exports.CALLBACK_TYPE = CALLBACK_TYPE;
28
+ // Allow using CALLBACK_TYPE as object and type
29
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
30
30
 
31
31
  class Gesture {}
32
-
33
32
  exports.Gesture = Gesture;
34
33
  let nextGestureId = 0;
35
-
36
34
  class BaseGesture extends Gesture {
37
35
  constructor() {
38
- super(); // Used to check whether the gesture config has been updated when wrapping it
36
+ super();
37
+
38
+ // Used to check whether the gesture config has been updated when wrapping it
39
39
  // with `useMemo`. Since every config will have a unique id, when the dependencies
40
40
  // don't change, the config won't be recreated and the id will stay the same.
41
41
  // If the id is different, it means that the config has changed and the gesture
42
42
  // needs to be updated.
43
-
44
43
  _defineProperty(this, "gestureId", -1);
45
-
46
44
  _defineProperty(this, "handlerTag", -1);
47
-
48
45
  _defineProperty(this, "handlerName", '');
49
-
50
46
  _defineProperty(this, "config", {});
51
-
52
47
  _defineProperty(this, "handlers", {
53
48
  gestureId: -1,
54
49
  handlerTag: -1,
55
50
  isWorklet: []
56
51
  });
57
-
58
52
  this.gestureId = nextGestureId++;
59
53
  this.handlers.gestureId = this.gestureId;
60
54
  }
61
-
62
55
  addDependency(key, gesture) {
63
56
  const value = this.config[key];
64
57
  this.config[key] = value ? Array().concat(value, gesture) : [gesture];
65
58
  }
59
+
66
60
  /**
67
61
  * Sets a `ref` to the gesture object, allowing for interoperability with the old API.
68
62
  * @param ref
69
63
  */
70
-
71
-
72
64
  withRef(ref) {
73
65
  this.config.ref = ref;
74
66
  return this;
75
- } // eslint-disable-next-line @typescript-eslint/ban-types
76
-
67
+ }
77
68
 
69
+ // eslint-disable-next-line @typescript-eslint/ban-types
78
70
  isWorklet(callback) {
79
71
  // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
80
72
  return callback.__workletHash !== undefined;
81
73
  }
74
+
82
75
  /**
83
76
  * Set the callback that is being called when given gesture handler starts receiving touches.
84
77
  * At the moment of this callback the handler is in `BEGAN` state and we don't know yet if it will recognize the gesture at all.
85
78
  * @param callback
86
79
  */
87
-
88
-
89
80
  onBegin(callback) {
90
81
  this.handlers.onBegin = callback;
91
82
  this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);
92
83
  return this;
93
84
  }
85
+
94
86
  /**
95
87
  * Set the callback that is being called when the gesture is recognized by the handler and it transitions to the `ACTIVE` state.
96
88
  * @param callback
97
89
  */
98
-
99
-
100
90
  onStart(callback) {
101
91
  this.handlers.onStart = callback;
102
92
  this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);
103
93
  return this;
104
94
  }
95
+
105
96
  /**
106
97
  * Set the callback that is being called when the gesture that was recognized by the handler finishes and handler reaches `END` state.
107
98
  * It will be called only if the handler was previously in the `ACTIVE` state.
108
99
  * @param callback
109
100
  */
110
-
111
-
112
101
  onEnd(callback) {
113
- this.handlers.onEnd = callback; // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
114
-
102
+ this.handlers.onEnd = callback;
103
+ // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
115
104
  this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);
116
105
  return this;
117
106
  }
107
+
118
108
  /**
119
109
  * Set the callback that is being called when the handler finalizes handling gesture - the gesture was recognized and has finished or it failed to recognize.
120
110
  * @param callback
121
111
  */
122
-
123
-
124
112
  onFinalize(callback) {
125
- this.handlers.onFinalize = callback; // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
126
-
113
+ this.handlers.onFinalize = callback;
114
+ // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false
127
115
  this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);
128
116
  return this;
129
117
  }
118
+
130
119
  /**
131
120
  * Set the `onTouchesDown` callback which is called every time a pointer is placed on the screen.
132
121
  * @param callback
133
122
  */
134
-
135
-
136
123
  onTouchesDown(callback) {
137
124
  this.config.needsPointerData = true;
138
125
  this.handlers.onTouchesDown = callback;
139
126
  this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] = this.isWorklet(callback);
140
127
  return this;
141
128
  }
129
+
142
130
  /**
143
131
  * Set the `onTouchesMove` callback which is called every time a pointer is moved on the screen.
144
132
  * @param callback
145
133
  */
146
-
147
-
148
134
  onTouchesMove(callback) {
149
135
  this.config.needsPointerData = true;
150
136
  this.handlers.onTouchesMove = callback;
151
137
  this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] = this.isWorklet(callback);
152
138
  return this;
153
139
  }
140
+
154
141
  /**
155
142
  * Set the `onTouchesUp` callback which is called every time a pointer is lifted from the screen.
156
143
  * @param callback
157
144
  */
158
-
159
-
160
145
  onTouchesUp(callback) {
161
146
  this.config.needsPointerData = true;
162
147
  this.handlers.onTouchesUp = callback;
163
148
  this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] = this.isWorklet(callback);
164
149
  return this;
165
150
  }
151
+
166
152
  /**
167
153
  * Set the `onTouchesCancelled` callback which is called every time a pointer stops being tracked, for example when the gesture finishes.
168
154
  * @param callback
169
155
  */
170
-
171
-
172
156
  onTouchesCancelled(callback) {
173
157
  this.config.needsPointerData = true;
174
158
  this.handlers.onTouchesCancelled = callback;
175
159
  this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] = this.isWorklet(callback);
176
160
  return this;
177
161
  }
162
+
178
163
  /**
179
164
  * Indicates whether the given handler should be analyzing stream of touch events or not.
180
165
  * @param enabled
181
166
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#enabledvalue-boolean
182
167
  */
183
-
184
-
185
168
  enabled(enabled) {
186
169
  this.config.enabled = enabled;
187
170
  return this;
188
171
  }
172
+
189
173
  /**
190
174
  * When true the handler will cancel or fail recognition (depending on its current state) whenever the finger leaves the area of the connected view.
191
175
  * @param value
192
176
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#shouldcancelwhenoutsidevalue-boolean
193
177
  */
194
-
195
-
196
178
  shouldCancelWhenOutside(value) {
197
179
  this.config.shouldCancelWhenOutside = value;
198
180
  return this;
199
181
  }
182
+
200
183
  /**
201
184
  * This parameter enables control over what part of the connected view area can be used to begin recognizing the gesture.
202
185
  * When a negative number is provided the bounds of the view will reduce the area by the given number of points in each of the sides evenly.
203
186
  * @param hitSlop
204
187
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#hitslopsettings
205
188
  */
206
-
207
-
208
189
  hitSlop(hitSlop) {
209
190
  this.config.hitSlop = hitSlop;
210
191
  return this;
211
192
  }
193
+
212
194
  /**
213
195
  * #### Web only
214
196
  * This parameter allows to specify which `cursor` should be used when gesture activates.
215
197
  * Supports all CSS cursor values (e.g. `"grab"`, `"zoom-in"`). Default value is set to `"auto"`.
216
198
  * @param activeCursor
217
199
  */
218
-
219
-
220
200
  activeCursor(activeCursor) {
221
201
  this.config.activeCursor = activeCursor;
222
202
  return this;
223
203
  }
204
+
224
205
  /**
225
206
  * #### Web & Android only
226
207
  * Allows users to choose which mouse button should handler respond to.
@@ -229,118 +210,101 @@ class BaseGesture extends Gesture {
229
210
  * @param mouseButton
230
211
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#mousebuttonvalue-mousebutton-web--android-only
231
212
  */
232
-
233
-
234
213
  mouseButton(mouseButton) {
235
214
  this.config.mouseButton = mouseButton;
236
215
  return this;
237
216
  }
217
+
238
218
  /**
239
219
  * When `react-native-reanimated` is installed, the callbacks passed to the gestures are automatically workletized and run on the UI thread when called.
240
220
  * This option allows for changing this behavior: when `true`, all the callbacks will be run on the JS thread instead of the UI thread, regardless of whether they are worklets or not.
241
221
  * Defaults to `false`.
242
222
  * @param runOnJS
243
223
  */
244
-
245
-
246
224
  runOnJS(runOnJS) {
247
225
  this.config.runOnJS = runOnJS;
248
226
  return this;
249
227
  }
228
+
250
229
  /**
251
230
  * Allows gestures across different components to be recognized simultaneously.
252
231
  * @param gestures
253
232
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#simultaneouswithexternalgesture
254
233
  */
255
-
256
-
257
234
  simultaneousWithExternalGesture(...gestures) {
258
235
  for (const gesture of gestures) {
259
236
  this.addDependency('simultaneousWith', gesture);
260
237
  }
261
-
262
238
  return this;
263
239
  }
240
+
264
241
  /**
265
242
  * Allows to delay activation of the handler until all handlers passed as arguments to this method fail (or don't begin at all).
266
243
  * @param gestures
267
244
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#requireexternalgesturetofail
268
245
  */
269
-
270
-
271
246
  requireExternalGestureToFail(...gestures) {
272
247
  for (const gesture of gestures) {
273
248
  this.addDependency('requireToFail', gesture);
274
249
  }
275
-
276
250
  return this;
277
251
  }
252
+
278
253
  /**
279
254
  * Works similarily to `requireExternalGestureToFail` but the direction of the relation is reversed - instead of being one-to-many relation, it's many-to-one.
280
255
  * @param gestures
281
256
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#blocksexternalgesture
282
257
  */
283
-
284
-
285
258
  blocksExternalGesture(...gestures) {
286
259
  for (const gesture of gestures) {
287
260
  this.addDependency('blocksHandlers', gesture);
288
261
  }
289
-
290
262
  return this;
291
263
  }
264
+
292
265
  /**
293
266
  * Sets a `testID` property for gesture object, allowing for querying for it in tests.
294
267
  * @param id
295
268
  */
296
-
297
-
298
269
  withTestId(id) {
299
270
  this.config.testId = id;
300
271
  return this;
301
272
  }
273
+
302
274
  /**
303
275
  * #### iOS only
304
276
  * When `true`, the handler will cancel touches for native UI components (`UIButton`, `UISwitch`, etc) it's attached to when it becomes `ACTIVE`.
305
277
  * Default value is `true`.
306
278
  * @param value
307
279
  */
308
-
309
-
310
280
  cancelsTouchesInView(value) {
311
281
  this.config.cancelsTouchesInView = value;
312
282
  return this;
313
283
  }
314
-
315
284
  initialize() {
316
285
  this.handlerTag = (0, _getNextHandlerTag.getNextHandlerTag)();
317
- this.handlers = { ...this.handlers,
286
+ this.handlers = {
287
+ ...this.handlers,
318
288
  handlerTag: this.handlerTag
319
289
  };
320
-
321
290
  if (this.config.ref) {
322
291
  this.config.ref.current = this;
323
292
  }
324
293
  }
325
-
326
294
  toGestureArray() {
327
295
  return [this];
328
- } // eslint-disable-next-line @typescript-eslint/no-empty-function
329
-
296
+ }
330
297
 
298
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
331
299
  prepare() {}
332
-
333
300
  get shouldUseReanimated() {
334
301
  // Use Reanimated when runOnJS isn't set explicitly,
335
302
  // all defined callbacks are worklets
336
303
  // and remote debugging is disabled
337
304
  return this.config.runOnJS !== true && !this.handlers.isWorklet.includes(false) && !(0, _utils.isRemoteDebuggingEnabled)();
338
305
  }
339
-
340
306
  }
341
-
342
307
  exports.BaseGesture = BaseGesture;
343
-
344
308
  class ContinousBaseGesture extends BaseGesture {
345
309
  /**
346
310
  * Set the callback that is being called every time the gesture receives an update while it's active.
@@ -351,31 +315,27 @@ class ContinousBaseGesture extends BaseGesture {
351
315
  this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);
352
316
  return this;
353
317
  }
318
+
354
319
  /**
355
320
  * Set the callback that is being called every time the gesture receives an update while it's active.
356
321
  * This callback will receive information about change in value in relation to the last received event.
357
322
  * @param callback
358
323
  */
359
-
360
-
361
324
  onChange(callback) {
362
325
  this.handlers.onChange = callback;
363
326
  this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);
364
327
  return this;
365
328
  }
329
+
366
330
  /**
367
331
  * When `true` the handler will not activate by itself even if its activation criteria are met.
368
332
  * Instead you can manipulate its state using state manager.
369
333
  * @param manualActivation
370
334
  */
371
-
372
-
373
335
  manualActivation(manualActivation) {
374
336
  this.config.manualActivation = manualActivation;
375
337
  return this;
376
338
  }
377
-
378
339
  }
379
-
380
340
  exports.ContinousBaseGesture = ContinousBaseGesture;
381
341
  //# sourceMappingURL=gesture.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["gesture.ts"],"names":["CALLBACK_TYPE","UNDEFINED","BEGAN","START","UPDATE","CHANGE","END","FINALIZE","TOUCHES_DOWN","TOUCHES_MOVE","TOUCHES_UP","TOUCHES_CANCELLED","Gesture","nextGestureId","BaseGesture","constructor","gestureId","handlerTag","isWorklet","handlers","addDependency","key","gesture","value","config","Array","concat","withRef","ref","callback","__workletHash","undefined","onBegin","onStart","onEnd","onFinalize","onTouchesDown","needsPointerData","onTouchesMove","onTouchesUp","onTouchesCancelled","enabled","shouldCancelWhenOutside","hitSlop","activeCursor","mouseButton","runOnJS","simultaneousWithExternalGesture","gestures","requireExternalGestureToFail","blocksExternalGesture","withTestId","id","testId","cancelsTouchesInView","initialize","current","toGestureArray","prepare","shouldUseReanimated","includes","ContinousBaseGesture","onUpdate","onChange","manualActivation"],"mappings":";;;;;;;AASA;;AAaA;;;;AAiEO,MAAMA,aAAa,GAAG;AAC3BC,EAAAA,SAAS,EAAE,CADgB;AAE3BC,EAAAA,KAAK,EAAE,CAFoB;AAG3BC,EAAAA,KAAK,EAAE,CAHoB;AAI3BC,EAAAA,MAAM,EAAE,CAJmB;AAK3BC,EAAAA,MAAM,EAAE,CALmB;AAM3BC,EAAAA,GAAG,EAAE,CANsB;AAO3BC,EAAAA,QAAQ,EAAE,CAPiB;AAQ3BC,EAAAA,YAAY,EAAE,CARa;AAS3BC,EAAAA,YAAY,EAAE,CATa;AAU3BC,EAAAA,UAAU,EAAE,CAVe;AAW3BC,EAAAA,iBAAiB,EAAE;AAXQ,CAAtB,C,CAcP;AACA;;;;AAGO,MAAeC,OAAf,CAAuB;;;AAoB9B,IAAIC,aAAa,GAAG,CAApB;;AACO,MAAeC,WAAf,SAEGF,OAFH,CAEW;AAWhBG,EAAAA,WAAW,GAAG;AACZ,YADY,CAGZ;AACA;AACA;AACA;AACA;;AAPY,uCAVM,CAAC,CAUP;;AAAA,wCATM,CAAC,CASP;;AAAA,yCARO,EAQP;;AAAA,oCAPqB,EAOrB;;AAAA,sCANqC;AACjDC,MAAAA,SAAS,EAAE,CAAC,CADqC;AAEjDC,MAAAA,UAAU,EAAE,CAAC,CAFoC;AAGjDC,MAAAA,SAAS,EAAE;AAHsC,KAMrC;;AAQZ,SAAKF,SAAL,GAAiBH,aAAa,EAA9B;AACA,SAAKM,QAAL,CAAcH,SAAd,GAA0B,KAAKA,SAA/B;AACD;;AAEOI,EAAAA,aAAa,CAC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9Se;;;;AAiTX,MAAeC,oBAAf,SAGG/C,WAHH,CAG8B;AACnC;AACF;AACA;AACA;AACEgD,EAAAA,QAAQ,CAACjC,QAAD,EAA+D;AACrE,SAAKV,QAAL,CAAc2C,QAAd,GAAyBjC,QAAzB;AACA,SAAKV,QAAL,CAAcD,SAAd,CAAwBlB,aAAa,CAACI,MAAtC,IAAgD,KAAKc,SAAL,CAAeW,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEkC,EAAAA,QAAQ,CACNlC,QADM,EAIN;AACA,SAAKV,QAAL,CAAc4C,QAAd,GAAyBlC,QAAzB;AACA,SAAKV,QAAL,CAAcD,SAAd,CAAwBlB,aAAa,CAACK,MAAtC,IAAgD,KAAKa,SAAL,CAAeW,QAAf,CAAhD;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEmC,EAAAA,gBAAgB,CAACA,gBAAD,EAA4B;AAC1C,SAAKxC,MAAL,CAAYwC,gBAAZ,GAA+BA,gBAA/B;AACA,WAAO,IAAP;AACD;;AAlCkC","sourcesContent":["import {\n HitSlop,\n CommonGestureConfig,\n GestureTouchEvent,\n GestureStateChangeEvent,\n GestureUpdateEvent,\n ActiveCursor,\n MouseButton,\n} from '../gestureHandlerCommon';\nimport { getNextHandlerTag } from '../getNextHandlerTag';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport type {\n FlingGestureHandlerEventPayload,\n ForceTouchGestureHandlerEventPayload,\n LongPressGestureHandlerEventPayload,\n PanGestureHandlerEventPayload,\n PinchGestureHandlerEventPayload,\n RotationGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n NativeViewGestureHandlerPayload,\n HoverGestureHandlerEventPayload,\n} from '../GestureHandlerEventPayload';\nimport { isRemoteDebuggingEnabled } from '../../utils';\n\nexport type GestureType =\n | BaseGesture<Record<string, unknown>>\n | BaseGesture<Record<string, never>>\n | BaseGesture<TapGestureHandlerEventPayload>\n | BaseGesture<PanGestureHandlerEventPayload>\n | BaseGesture<LongPressGestureHandlerEventPayload>\n | BaseGesture<RotationGestureHandlerEventPayload>\n | BaseGesture<PinchGestureHandlerEventPayload>\n | BaseGesture<FlingGestureHandlerEventPayload>\n | BaseGesture<ForceTouchGestureHandlerEventPayload>\n | BaseGesture<NativeViewGestureHandlerPayload>\n | BaseGesture<HoverGestureHandlerEventPayload>;\n\nexport type GestureRef =\n | number\n | GestureType\n | React.RefObject<GestureType | undefined>\n | React.RefObject<React.ComponentType | undefined>; // Allow adding a ref to a gesture handler\nexport interface BaseGestureConfig\n extends CommonGestureConfig,\n Record<string, unknown> {\n ref?: React.MutableRefObject<GestureType | undefined>;\n requireToFail?: GestureRef[];\n simultaneousWith?: GestureRef[];\n blocksHandlers?: GestureRef[];\n needsPointerData?: boolean;\n manualActivation?: boolean;\n runOnJS?: boolean;\n testId?: string;\n cancelsTouchesInView?: boolean;\n}\n\ntype TouchEventHandlerType = (\n event: GestureTouchEvent,\n stateManager: GestureStateManagerType\n) => void;\n\nexport type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {\n gestureId: number;\n handlerTag: number;\n onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onStart?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onEnd?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onFinalize?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onUpdate?: (event: GestureUpdateEvent<EventPayloadT>) => void;\n onChange?: (event: any) => void;\n onTouchesDown?: TouchEventHandlerType;\n onTouchesMove?: TouchEventHandlerType;\n onTouchesUp?: TouchEventHandlerType;\n onTouchesCancelled?: TouchEventHandlerType;\n changeEventCalculator?: (\n current: GestureUpdateEvent<Record<string, unknown>>,\n previous?: GestureUpdateEvent<Record<string, unknown>>\n ) => GestureUpdateEvent<Record<string, unknown>>;\n isWorklet: boolean[];\n};\n\nexport const CALLBACK_TYPE = {\n UNDEFINED: 0,\n BEGAN: 1,\n START: 2,\n UPDATE: 3,\n CHANGE: 4,\n END: 5,\n FINALIZE: 6,\n TOUCHES_DOWN: 7,\n TOUCHES_MOVE: 8,\n TOUCHES_UP: 9,\n TOUCHES_CANCELLED: 10,\n} as const;\n\n// Allow using CALLBACK_TYPE as object and type\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type CALLBACK_TYPE = (typeof CALLBACK_TYPE)[keyof typeof CALLBACK_TYPE];\n\nexport abstract class Gesture {\n /**\n * Return array of gestures, providing the same interface for creating and updating\n * handlers, no matter which object was used to create gesture instance.\n */\n abstract toGestureArray(): GestureType[];\n\n /**\n * Assign handlerTag to the gesture instance and set ref.current (if a ref is set)\n */\n abstract initialize(): void;\n\n /**\n * Make sure that values of properties defining relations are arrays. Do any necessary\n * preprocessing required to configure relations between handlers. Called just before\n * updating the handler on the native side.\n */\n abstract prepare(): void;\n}\n\nlet nextGestureId = 0;\nexport abstract class BaseGesture<\n EventPayloadT extends Record<string, unknown>,\n> extends Gesture {\n private gestureId = -1;\n public handlerTag = -1;\n public handlerName = '';\n public config: BaseGestureConfig = {};\n public handlers: HandlerCallbacks<EventPayloadT> = {\n gestureId: -1,\n handlerTag: -1,\n isWorklet: [],\n };\n\n constructor() {\n super();\n\n // Used to check whether the gesture config has been updated when wrapping it\n // with `useMemo`. Since every config will have a unique id, when the dependencies\n // don't change, the config won't be recreated and the id will stay the same.\n // If the id is different, it means that the config has changed and the gesture\n // needs to be updated.\n this.gestureId = nextGestureId++;\n this.handlers.gestureId = this.gestureId;\n }\n\n private addDependency(\n key: 'simultaneousWith' | 'requireToFail' | 'blocksHandlers',\n gesture: Exclude<GestureRef, number>\n ) {\n const value = this.config[key];\n this.config[key] = value\n ? Array<GestureRef>().concat(value, gesture)\n : [gesture];\n }\n\n /**\n * Sets a `ref` to the gesture object, allowing for interoperability with the old API.\n * @param ref\n */\n withRef(ref: React.MutableRefObject<GestureType | undefined>) {\n this.config.ref = ref;\n return this;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n protected isWorklet(callback: Function) {\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n return callback.__workletHash !== undefined;\n }\n\n /**\n * Set the callback that is being called when given gesture handler starts receiving touches.\n * At the moment of this callback the handler is in `BEGAN` state and we don't know yet if it will recognize the gesture at all.\n * @param callback\n */\n onBegin(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onBegin = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the gesture is recognized by the handler and it transitions to the `ACTIVE` state.\n * @param callback\n */\n onStart(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onStart = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the gesture that was recognized by the handler finishes and handler reaches `END` state.\n * It will be called only if the handler was previously in the `ACTIVE` state.\n * @param callback\n */\n onEnd(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onEnd = callback;\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the handler finalizes handling gesture - the gesture was recognized and has finished or it failed to recognize.\n * @param callback\n */\n onFinalize(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onFinalize = callback;\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the `onTouchesDown` callback which is called every time a pointer is placed on the screen.\n * @param callback\n */\n onTouchesDown(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesDown = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesMove` callback which is called every time a pointer is moved on the screen.\n * @param callback\n */\n onTouchesMove(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesMove = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesUp` callback which is called every time a pointer is lifted from the screen.\n * @param callback\n */\n onTouchesUp(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesUp = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesCancelled` callback which is called every time a pointer stops being tracked, for example when the gesture finishes.\n * @param callback\n */\n onTouchesCancelled(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesCancelled = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Indicates whether the given handler should be analyzing stream of touch events or not.\n * @param enabled\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#enabledvalue-boolean\n */\n enabled(enabled: boolean) {\n this.config.enabled = enabled;\n return this;\n }\n\n /**\n * When true the handler will cancel or fail recognition (depending on its current state) whenever the finger leaves the area of the connected view.\n * @param value\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#shouldcancelwhenoutsidevalue-boolean\n */\n shouldCancelWhenOutside(value: boolean) {\n this.config.shouldCancelWhenOutside = value;\n return this;\n }\n\n /**\n * This parameter enables control over what part of the connected view area can be used to begin recognizing the gesture.\n * When a negative number is provided the bounds of the view will reduce the area by the given number of points in each of the sides evenly.\n * @param hitSlop\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#hitslopsettings\n */\n hitSlop(hitSlop: HitSlop) {\n this.config.hitSlop = hitSlop;\n return this;\n }\n\n /**\n * #### Web only\n * This parameter allows to specify which `cursor` should be used when gesture activates.\n * Supports all CSS cursor values (e.g. `\"grab\"`, `\"zoom-in\"`). Default value is set to `\"auto\"`.\n * @param activeCursor\n */\n activeCursor(activeCursor: ActiveCursor) {\n this.config.activeCursor = activeCursor;\n return this;\n }\n\n /**\n * #### Web & Android only\n * Allows users to choose which mouse button should handler respond to.\n * Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`.\n * Default value is set to `MouseButton.LEFT`.\n * @param mouseButton\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#mousebuttonvalue-mousebutton-web--android-only\n */\n mouseButton(mouseButton: MouseButton) {\n this.config.mouseButton = mouseButton;\n return this;\n }\n\n /**\n * When `react-native-reanimated` is installed, the callbacks passed to the gestures are automatically workletized and run on the UI thread when called.\n * This option allows for changing this behavior: when `true`, all the callbacks will be run on the JS thread instead of the UI thread, regardless of whether they are worklets or not.\n * Defaults to `false`.\n * @param runOnJS\n */\n runOnJS(runOnJS: boolean) {\n this.config.runOnJS = runOnJS;\n return this;\n }\n\n /**\n * Allows gestures across different components to be recognized simultaneously.\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#simultaneouswithexternalgesture\n */\n simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('simultaneousWith', gesture);\n }\n return this;\n }\n\n /**\n * Allows to delay activation of the handler until all handlers passed as arguments to this method fail (or don't begin at all).\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#requireexternalgesturetofail\n */\n requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('requireToFail', gesture);\n }\n return this;\n }\n\n /**\n * Works similarily to `requireExternalGestureToFail` but the direction of the relation is reversed - instead of being one-to-many relation, it's many-to-one.\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#blocksexternalgesture\n */\n blocksExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('blocksHandlers', gesture);\n }\n return this;\n }\n\n /**\n * Sets a `testID` property for gesture object, allowing for querying for it in tests.\n * @param id\n */\n withTestId(id: string) {\n this.config.testId = id;\n return this;\n }\n\n /**\n * #### iOS only\n * When `true`, the handler will cancel touches for native UI components (`UIButton`, `UISwitch`, etc) it's attached to when it becomes `ACTIVE`.\n * Default value is `true`.\n * @param value\n */\n cancelsTouchesInView(value: boolean) {\n this.config.cancelsTouchesInView = value;\n return this;\n }\n\n initialize() {\n this.handlerTag = getNextHandlerTag();\n\n this.handlers = { ...this.handlers, handlerTag: this.handlerTag };\n\n if (this.config.ref) {\n this.config.ref.current = this as GestureType;\n }\n }\n\n toGestureArray(): GestureType[] {\n return [this as GestureType];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n prepare() {}\n\n get shouldUseReanimated(): boolean {\n // Use Reanimated when runOnJS isn't set explicitly,\n // all defined callbacks are worklets\n // and remote debugging is disabled\n return (\n this.config.runOnJS !== true &&\n !this.handlers.isWorklet.includes(false) &&\n !isRemoteDebuggingEnabled()\n );\n }\n}\n\nexport abstract class ContinousBaseGesture<\n EventPayloadT extends Record<string, unknown>,\n EventChangePayloadT extends Record<string, unknown>,\n> extends BaseGesture<EventPayloadT> {\n /**\n * Set the callback that is being called every time the gesture receives an update while it's active.\n * @param callback\n */\n onUpdate(callback: (event: GestureUpdateEvent<EventPayloadT>) => void) {\n this.handlers.onUpdate = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called every time the gesture receives an update while it's active.\n * This callback will receive information about change in value in relation to the last received event.\n * @param callback\n */\n onChange(\n callback: (\n event: GestureUpdateEvent<EventPayloadT & EventChangePayloadT>\n ) => void\n ) {\n this.handlers.onChange = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * When `true` the handler will not activate by itself even if its activation criteria are met.\n * Instead you can manipulate its state using state manager.\n * @param manualActivation\n */\n manualActivation(manualActivation: boolean) {\n this.config.manualActivation = manualActivation;\n return this;\n }\n}\n"]}
1
+ {"version":3,"names":["_getNextHandlerTag","require","_utils","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CALLBACK_TYPE","exports","UNDEFINED","BEGAN","START","UPDATE","CHANGE","END","FINALIZE","TOUCHES_DOWN","TOUCHES_MOVE","TOUCHES_UP","TOUCHES_CANCELLED","Gesture","nextGestureId","BaseGesture","constructor","gestureId","handlerTag","isWorklet","handlers","addDependency","key","gesture","config","Array","concat","withRef","ref","callback","__workletHash","undefined","onBegin","onStart","onEnd","onFinalize","onTouchesDown","needsPointerData","onTouchesMove","onTouchesUp","onTouchesCancelled","enabled","shouldCancelWhenOutside","hitSlop","activeCursor","mouseButton","runOnJS","simultaneousWithExternalGesture","gestures","requireExternalGestureToFail","blocksExternalGesture","withTestId","id","testId","cancelsTouchesInView","initialize","getNextHandlerTag","current","toGestureArray","prepare","shouldUseReanimated","includes","isRemoteDebuggingEnabled","ContinousBaseGesture","onUpdate","onChange","manualActivation"],"sources":["gesture.ts"],"sourcesContent":["import {\n HitSlop,\n CommonGestureConfig,\n GestureTouchEvent,\n GestureStateChangeEvent,\n GestureUpdateEvent,\n ActiveCursor,\n MouseButton,\n} from '../gestureHandlerCommon';\nimport { getNextHandlerTag } from '../getNextHandlerTag';\nimport { GestureStateManagerType } from './gestureStateManager';\nimport type {\n FlingGestureHandlerEventPayload,\n ForceTouchGestureHandlerEventPayload,\n LongPressGestureHandlerEventPayload,\n PanGestureHandlerEventPayload,\n PinchGestureHandlerEventPayload,\n RotationGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n NativeViewGestureHandlerPayload,\n HoverGestureHandlerEventPayload,\n} from '../GestureHandlerEventPayload';\nimport { isRemoteDebuggingEnabled } from '../../utils';\n\nexport type GestureType =\n | BaseGesture<Record<string, unknown>>\n | BaseGesture<Record<string, never>>\n | BaseGesture<TapGestureHandlerEventPayload>\n | BaseGesture<PanGestureHandlerEventPayload>\n | BaseGesture<LongPressGestureHandlerEventPayload>\n | BaseGesture<RotationGestureHandlerEventPayload>\n | BaseGesture<PinchGestureHandlerEventPayload>\n | BaseGesture<FlingGestureHandlerEventPayload>\n | BaseGesture<ForceTouchGestureHandlerEventPayload>\n | BaseGesture<NativeViewGestureHandlerPayload>\n | BaseGesture<HoverGestureHandlerEventPayload>;\n\nexport type GestureRef =\n | number\n | GestureType\n | React.RefObject<GestureType | undefined>\n | React.RefObject<React.ComponentType | undefined>; // Allow adding a ref to a gesture handler\nexport interface BaseGestureConfig\n extends CommonGestureConfig,\n Record<string, unknown> {\n ref?: React.MutableRefObject<GestureType | undefined>;\n requireToFail?: GestureRef[];\n simultaneousWith?: GestureRef[];\n blocksHandlers?: GestureRef[];\n needsPointerData?: boolean;\n manualActivation?: boolean;\n runOnJS?: boolean;\n testId?: string;\n cancelsTouchesInView?: boolean;\n}\n\ntype TouchEventHandlerType = (\n event: GestureTouchEvent,\n stateManager: GestureStateManagerType\n) => void;\n\nexport type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {\n gestureId: number;\n handlerTag: number;\n onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onStart?: (event: GestureStateChangeEvent<EventPayloadT>) => void;\n onEnd?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onFinalize?: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void;\n onUpdate?: (event: GestureUpdateEvent<EventPayloadT>) => void;\n onChange?: (event: any) => void;\n onTouchesDown?: TouchEventHandlerType;\n onTouchesMove?: TouchEventHandlerType;\n onTouchesUp?: TouchEventHandlerType;\n onTouchesCancelled?: TouchEventHandlerType;\n changeEventCalculator?: (\n current: GestureUpdateEvent<Record<string, unknown>>,\n previous?: GestureUpdateEvent<Record<string, unknown>>\n ) => GestureUpdateEvent<Record<string, unknown>>;\n isWorklet: boolean[];\n};\n\nexport const CALLBACK_TYPE = {\n UNDEFINED: 0,\n BEGAN: 1,\n START: 2,\n UPDATE: 3,\n CHANGE: 4,\n END: 5,\n FINALIZE: 6,\n TOUCHES_DOWN: 7,\n TOUCHES_MOVE: 8,\n TOUCHES_UP: 9,\n TOUCHES_CANCELLED: 10,\n} as const;\n\n// Allow using CALLBACK_TYPE as object and type\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type CALLBACK_TYPE = (typeof CALLBACK_TYPE)[keyof typeof CALLBACK_TYPE];\n\nexport abstract class Gesture {\n /**\n * Return array of gestures, providing the same interface for creating and updating\n * handlers, no matter which object was used to create gesture instance.\n */\n abstract toGestureArray(): GestureType[];\n\n /**\n * Assign handlerTag to the gesture instance and set ref.current (if a ref is set)\n */\n abstract initialize(): void;\n\n /**\n * Make sure that values of properties defining relations are arrays. Do any necessary\n * preprocessing required to configure relations between handlers. Called just before\n * updating the handler on the native side.\n */\n abstract prepare(): void;\n}\n\nlet nextGestureId = 0;\nexport abstract class BaseGesture<\n EventPayloadT extends Record<string, unknown>,\n> extends Gesture {\n private gestureId = -1;\n public handlerTag = -1;\n public handlerName = '';\n public config: BaseGestureConfig = {};\n public handlers: HandlerCallbacks<EventPayloadT> = {\n gestureId: -1,\n handlerTag: -1,\n isWorklet: [],\n };\n\n constructor() {\n super();\n\n // Used to check whether the gesture config has been updated when wrapping it\n // with `useMemo`. Since every config will have a unique id, when the dependencies\n // don't change, the config won't be recreated and the id will stay the same.\n // If the id is different, it means that the config has changed and the gesture\n // needs to be updated.\n this.gestureId = nextGestureId++;\n this.handlers.gestureId = this.gestureId;\n }\n\n private addDependency(\n key: 'simultaneousWith' | 'requireToFail' | 'blocksHandlers',\n gesture: Exclude<GestureRef, number>\n ) {\n const value = this.config[key];\n this.config[key] = value\n ? Array<GestureRef>().concat(value, gesture)\n : [gesture];\n }\n\n /**\n * Sets a `ref` to the gesture object, allowing for interoperability with the old API.\n * @param ref\n */\n withRef(ref: React.MutableRefObject<GestureType | undefined>) {\n this.config.ref = ref;\n return this;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n protected isWorklet(callback: Function) {\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n return callback.__workletHash !== undefined;\n }\n\n /**\n * Set the callback that is being called when given gesture handler starts receiving touches.\n * At the moment of this callback the handler is in `BEGAN` state and we don't know yet if it will recognize the gesture at all.\n * @param callback\n */\n onBegin(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onBegin = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.BEGAN] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the gesture is recognized by the handler and it transitions to the `ACTIVE` state.\n * @param callback\n */\n onStart(callback: (event: GestureStateChangeEvent<EventPayloadT>) => void) {\n this.handlers.onStart = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.START] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the gesture that was recognized by the handler finishes and handler reaches `END` state.\n * It will be called only if the handler was previously in the `ACTIVE` state.\n * @param callback\n */\n onEnd(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onEnd = callback;\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.END] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called when the handler finalizes handling gesture - the gesture was recognized and has finished or it failed to recognize.\n * @param callback\n */\n onFinalize(\n callback: (\n event: GestureStateChangeEvent<EventPayloadT>,\n success: boolean\n ) => void\n ) {\n this.handlers.onFinalize = callback;\n // @ts-ignore if callback is a worklet, the property will be available, if not then the check will return false\n this.handlers.isWorklet[CALLBACK_TYPE.FINALIZE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the `onTouchesDown` callback which is called every time a pointer is placed on the screen.\n * @param callback\n */\n onTouchesDown(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesDown = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_DOWN] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesMove` callback which is called every time a pointer is moved on the screen.\n * @param callback\n */\n onTouchesMove(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesMove = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_MOVE] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesUp` callback which is called every time a pointer is lifted from the screen.\n * @param callback\n */\n onTouchesUp(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesUp = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_UP] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Set the `onTouchesCancelled` callback which is called every time a pointer stops being tracked, for example when the gesture finishes.\n * @param callback\n */\n onTouchesCancelled(callback: TouchEventHandlerType) {\n this.config.needsPointerData = true;\n this.handlers.onTouchesCancelled = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.TOUCHES_CANCELLED] =\n this.isWorklet(callback);\n\n return this;\n }\n\n /**\n * Indicates whether the given handler should be analyzing stream of touch events or not.\n * @param enabled\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#enabledvalue-boolean\n */\n enabled(enabled: boolean) {\n this.config.enabled = enabled;\n return this;\n }\n\n /**\n * When true the handler will cancel or fail recognition (depending on its current state) whenever the finger leaves the area of the connected view.\n * @param value\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#shouldcancelwhenoutsidevalue-boolean\n */\n shouldCancelWhenOutside(value: boolean) {\n this.config.shouldCancelWhenOutside = value;\n return this;\n }\n\n /**\n * This parameter enables control over what part of the connected view area can be used to begin recognizing the gesture.\n * When a negative number is provided the bounds of the view will reduce the area by the given number of points in each of the sides evenly.\n * @param hitSlop\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#hitslopsettings\n */\n hitSlop(hitSlop: HitSlop) {\n this.config.hitSlop = hitSlop;\n return this;\n }\n\n /**\n * #### Web only\n * This parameter allows to specify which `cursor` should be used when gesture activates.\n * Supports all CSS cursor values (e.g. `\"grab\"`, `\"zoom-in\"`). Default value is set to `\"auto\"`.\n * @param activeCursor\n */\n activeCursor(activeCursor: ActiveCursor) {\n this.config.activeCursor = activeCursor;\n return this;\n }\n\n /**\n * #### Web & Android only\n * Allows users to choose which mouse button should handler respond to.\n * Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`.\n * Default value is set to `MouseButton.LEFT`.\n * @param mouseButton\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#mousebuttonvalue-mousebutton-web--android-only\n */\n mouseButton(mouseButton: MouseButton) {\n this.config.mouseButton = mouseButton;\n return this;\n }\n\n /**\n * When `react-native-reanimated` is installed, the callbacks passed to the gestures are automatically workletized and run on the UI thread when called.\n * This option allows for changing this behavior: when `true`, all the callbacks will be run on the JS thread instead of the UI thread, regardless of whether they are worklets or not.\n * Defaults to `false`.\n * @param runOnJS\n */\n runOnJS(runOnJS: boolean) {\n this.config.runOnJS = runOnJS;\n return this;\n }\n\n /**\n * Allows gestures across different components to be recognized simultaneously.\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#simultaneouswithexternalgesture\n */\n simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('simultaneousWith', gesture);\n }\n return this;\n }\n\n /**\n * Allows to delay activation of the handler until all handlers passed as arguments to this method fail (or don't begin at all).\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#requireexternalgesturetofail\n */\n requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('requireToFail', gesture);\n }\n return this;\n }\n\n /**\n * Works similarily to `requireExternalGestureToFail` but the direction of the relation is reversed - instead of being one-to-many relation, it's many-to-one.\n * @param gestures\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#blocksexternalgesture\n */\n blocksExternalGesture(...gestures: Exclude<GestureRef, number>[]) {\n for (const gesture of gestures) {\n this.addDependency('blocksHandlers', gesture);\n }\n return this;\n }\n\n /**\n * Sets a `testID` property for gesture object, allowing for querying for it in tests.\n * @param id\n */\n withTestId(id: string) {\n this.config.testId = id;\n return this;\n }\n\n /**\n * #### iOS only\n * When `true`, the handler will cancel touches for native UI components (`UIButton`, `UISwitch`, etc) it's attached to when it becomes `ACTIVE`.\n * Default value is `true`.\n * @param value\n */\n cancelsTouchesInView(value: boolean) {\n this.config.cancelsTouchesInView = value;\n return this;\n }\n\n initialize() {\n this.handlerTag = getNextHandlerTag();\n\n this.handlers = { ...this.handlers, handlerTag: this.handlerTag };\n\n if (this.config.ref) {\n this.config.ref.current = this as GestureType;\n }\n }\n\n toGestureArray(): GestureType[] {\n return [this as GestureType];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n prepare() {}\n\n get shouldUseReanimated(): boolean {\n // Use Reanimated when runOnJS isn't set explicitly,\n // all defined callbacks are worklets\n // and remote debugging is disabled\n return (\n this.config.runOnJS !== true &&\n !this.handlers.isWorklet.includes(false) &&\n !isRemoteDebuggingEnabled()\n );\n }\n}\n\nexport abstract class ContinousBaseGesture<\n EventPayloadT extends Record<string, unknown>,\n EventChangePayloadT extends Record<string, unknown>,\n> extends BaseGesture<EventPayloadT> {\n /**\n * Set the callback that is being called every time the gesture receives an update while it's active.\n * @param callback\n */\n onUpdate(callback: (event: GestureUpdateEvent<EventPayloadT>) => void) {\n this.handlers.onUpdate = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.UPDATE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * Set the callback that is being called every time the gesture receives an update while it's active.\n * This callback will receive information about change in value in relation to the last received event.\n * @param callback\n */\n onChange(\n callback: (\n event: GestureUpdateEvent<EventPayloadT & EventChangePayloadT>\n ) => void\n ) {\n this.handlers.onChange = callback;\n this.handlers.isWorklet[CALLBACK_TYPE.CHANGE] = this.isWorklet(callback);\n return this;\n }\n\n /**\n * When `true` the handler will not activate by itself even if its activation criteria are met.\n * Instead you can manipulate its state using state manager.\n * @param manualActivation\n */\n manualActivation(manualActivation: boolean) {\n this.config.manualActivation = manualActivation;\n return this;\n }\n}\n"],"mappings":";;;;;;AASA,IAAAA,kBAAA,GAAAC,OAAA;AAaA,IAAAC,MAAA,GAAAD,OAAA;AAAuD,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,C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BAAoB,SAGhChD,WAAW,CAAgB;EACnC;AACF;AACA;AACA;EACEiD,QAAQA,CAACnC,QAA4D,EAAE;IACrE,IAAI,CAACT,QAAQ,CAAC4C,QAAQ,GAAGnC,QAAQ;IACjC,IAAI,CAACT,QAAQ,CAACD,SAAS,CAACnB,aAAa,CAACK,MAAM,CAAC,GAAG,IAAI,CAACc,SAAS,CAACU,QAAQ,CAAC;IACxE,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEoC,QAAQA,CACNpC,QAES,EACT;IACA,IAAI,CAACT,QAAQ,CAAC6C,QAAQ,GAAGpC,QAAQ;IACjC,IAAI,CAACT,QAAQ,CAACD,SAAS,CAACnB,aAAa,CAACM,MAAM,CAAC,GAAG,IAAI,CAACa,SAAS,CAACU,QAAQ,CAAC;IACxE,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEqC,gBAAgBA,CAACA,gBAAyB,EAAE;IAC1C,IAAI,CAAC1C,MAAM,CAAC0C,gBAAgB,GAAGA,gBAAgB;IAC/C,OAAO,IAAI;EACb;AACF;AAACjE,OAAA,CAAA8D,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -3,12 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ExclusiveGesture = exports.SimultaneousGesture = exports.ComposedGesture = void 0;
7
-
6
+ exports.SimultaneousGesture = exports.ExclusiveGesture = exports.ComposedGesture = void 0;
8
7
  var _gesture = require("./gesture");
9
-
10
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
-
8
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
11
  function extendRelation(currentRelation, extendWith) {
13
12
  if (currentRelation === undefined) {
14
13
  return [...extendWith];
@@ -16,26 +15,22 @@ function extendRelation(currentRelation, extendWith) {
16
15
  return [...currentRelation, ...extendWith];
17
16
  }
18
17
  }
19
-
20
18
  class ComposedGesture extends _gesture.Gesture {
21
19
  constructor(...gestures) {
22
20
  super();
23
-
24
21
  _defineProperty(this, "gestures", []);
25
-
26
22
  _defineProperty(this, "simultaneousGestures", []);
27
-
28
23
  _defineProperty(this, "requireGesturesToFail", []);
29
-
30
24
  this.gestures = gestures;
31
25
  }
32
-
33
26
  prepareSingleGesture(gesture, simultaneousGestures, requireGesturesToFail) {
34
27
  if (gesture instanceof _gesture.BaseGesture) {
35
- const newConfig = { ...gesture.config
36
- }; // No need to extend `blocksHandlers` here, because it's not changed in composition.
37
- // The same effect is achieved by reversing the order of 2 gestures in `Exclusive`
28
+ const newConfig = {
29
+ ...gesture.config
30
+ };
38
31
 
32
+ // No need to extend `blocksHandlers` here, because it's not changed in composition.
33
+ // The same effect is achieved by reversing the order of 2 gestures in `Exclusive`
39
34
  newConfig.simultaneousWith = extendRelation(newConfig.simultaneousWith, simultaneousGestures);
40
35
  newConfig.requireToFail = extendRelation(newConfig.requireToFail, requireGesturesToFail);
41
36
  gesture.config = newConfig;
@@ -45,63 +40,54 @@ class ComposedGesture extends _gesture.Gesture {
45
40
  gesture.prepare();
46
41
  }
47
42
  }
48
-
49
43
  prepare() {
50
44
  for (const gesture of this.gestures) {
51
45
  this.prepareSingleGesture(gesture, this.simultaneousGestures, this.requireGesturesToFail);
52
46
  }
53
47
  }
54
-
55
48
  initialize() {
56
49
  for (const gesture of this.gestures) {
57
50
  gesture.initialize();
58
51
  }
59
52
  }
60
-
61
53
  toGestureArray() {
62
54
  return this.gestures.flatMap(gesture => gesture.toGestureArray());
63
55
  }
64
-
65
56
  }
66
-
67
57
  exports.ComposedGesture = ComposedGesture;
68
-
69
58
  class SimultaneousGesture extends ComposedGesture {
70
59
  prepare() {
71
60
  // This piece of magic works something like this:
72
61
  // for every gesture in the array
73
- const simultaneousArrays = this.gestures.map(gesture => // we take the array it's in
74
- this.gestures // and make a copy without it
75
- .filter(x => x !== gesture) // then we flatmap the result to get list of raw (not composed) gestures
62
+ const simultaneousArrays = this.gestures.map(gesture =>
63
+ // we take the array it's in
64
+ this.gestures
65
+ // and make a copy without it
66
+ .filter(x => x !== gesture)
67
+ // then we flatmap the result to get list of raw (not composed) gestures
76
68
  // this way we don't make the gestures simultaneous with themselves, which is
77
69
  // important when the gesture is `ExclusiveGesture` - we don't want to make
78
70
  // exclusive gestures simultaneous
79
71
  .flatMap(x => x.toGestureArray()));
80
-
81
72
  for (let i = 0; i < this.gestures.length; i++) {
82
73
  this.prepareSingleGesture(this.gestures[i], simultaneousArrays[i], this.requireGesturesToFail);
83
74
  }
84
75
  }
85
-
86
76
  }
87
-
88
77
  exports.SimultaneousGesture = SimultaneousGesture;
89
-
90
78
  class ExclusiveGesture extends ComposedGesture {
91
79
  prepare() {
92
80
  // Transforms the array of gestures into array of grouped raw (not composed) gestures
93
81
  // i.e. [gesture1, gesture2, ComposedGesture(gesture3, gesture4)] -> [[gesture1], [gesture2], [gesture3, gesture4]]
94
82
  const gestureArrays = this.gestures.map(gesture => gesture.toGestureArray());
95
83
  let requireToFail = [];
96
-
97
84
  for (let i = 0; i < this.gestures.length; i++) {
98
- this.prepareSingleGesture(this.gestures[i], this.simultaneousGestures, this.requireGesturesToFail.concat(requireToFail)); // Every group gets to wait for all groups before it
85
+ this.prepareSingleGesture(this.gestures[i], this.simultaneousGestures, this.requireGesturesToFail.concat(requireToFail));
99
86
 
87
+ // Every group gets to wait for all groups before it
100
88
  requireToFail = requireToFail.concat(gestureArrays[i]);
101
89
  }
102
90
  }
103
-
104
91
  }
105
-
106
92
  exports.ExclusiveGesture = ExclusiveGesture;
107
93
  //# sourceMappingURL=gestureComposition.js.map