react-native-gesture-handler 2.22.0 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (678) 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 +133 -98
  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 +33 -32
  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 +130 -84
  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 +28 -22
  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 +194 -113
  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/createNativeWrapper.tsx +10 -4
  652. package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
  653. package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
  654. package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
  655. package/src/handlers/handlersRegistry.ts +7 -3
  656. package/src/index.ts +4 -1
  657. package/src/utils.ts +2 -2
  658. package/src/web/detectors/RotationGestureDetector.ts +22 -22
  659. package/src/web/detectors/ScaleGestureDetector.ts +24 -24
  660. package/src/web/handlers/FlingGestureHandler.ts +6 -7
  661. package/src/web/handlers/GestureHandler.ts +115 -105
  662. package/src/web/handlers/HoverGestureHandler.ts +2 -2
  663. package/src/web/handlers/IGestureHandler.ts +12 -13
  664. package/src/web/handlers/LongPressGestureHandler.ts +7 -7
  665. package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
  666. package/src/web/handlers/PanGestureHandler.ts +17 -17
  667. package/src/web/handlers/PinchGestureHandler.ts +17 -21
  668. package/src/web/handlers/RotationGestureHandler.ts +12 -12
  669. package/src/web/handlers/TapGestureHandler.ts +4 -6
  670. package/src/web/tools/CircularBuffer.ts +15 -15
  671. package/src/web/tools/GestureHandlerDelegate.ts +1 -1
  672. package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
  673. package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
  674. package/src/web/tools/InteractionManager.ts +16 -16
  675. package/src/web/tools/NodeManager.ts +2 -2
  676. package/src/web/tools/PointerTracker.ts +20 -20
  677. package/src/web/tools/Vector.ts +1 -1
  678. package/src/web/tools/VelocityTracker.ts +1 -1
@@ -1,5 +1,6 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
1
+ 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; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ 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); }
3
4
  /* eslint-disable @typescript-eslint/no-empty-function */
4
5
  import { State } from '../../State';
5
6
  import { TouchEventType, EventTypes } from '../interfaces';
@@ -9,48 +10,37 @@ import PointerTracker from '../tools/PointerTracker';
9
10
  import { MouseButton } from '../../handlers/gestureHandlerCommon';
10
11
  import { PointerType } from '../../PointerType';
11
12
  export default class GestureHandler {
12
- // Orchestrator properties
13
13
  constructor(delegate) {
14
14
  _defineProperty(this, "lastSentState", null);
15
-
16
- _defineProperty(this, "currentState", State.UNDETERMINED);
17
-
18
- _defineProperty(this, "shouldCancelWhenOutside", false);
19
-
15
+ _defineProperty(this, "_state", State.UNDETERMINED);
16
+ _defineProperty(this, "_shouldCancelWhenOutside", false);
20
17
  _defineProperty(this, "hasCustomActivationCriteria", false);
21
-
22
- _defineProperty(this, "enabled", false);
23
-
18
+ _defineProperty(this, "_enabled", false);
24
19
  _defineProperty(this, "viewRef", void 0);
25
-
26
20
  _defineProperty(this, "propsRef", void 0);
27
-
28
- _defineProperty(this, "handlerTag", void 0);
29
-
30
- _defineProperty(this, "config", {
21
+ _defineProperty(this, "_handlerTag", void 0);
22
+ _defineProperty(this, "_config", {
31
23
  enabled: false
32
24
  });
33
-
34
- _defineProperty(this, "tracker", new PointerTracker());
35
-
36
- _defineProperty(this, "activationIndex", 0);
37
-
38
- _defineProperty(this, "awaiting", false);
39
-
40
- _defineProperty(this, "active", false);
41
-
42
- _defineProperty(this, "shouldResetProgress", false);
43
-
44
- _defineProperty(this, "pointerType", PointerType.MOUSE);
45
-
46
- _defineProperty(this, "delegate", void 0);
47
-
25
+ _defineProperty(this, "_tracker", new PointerTracker());
26
+ // Orchestrator properties
27
+ _defineProperty(this, "_activationIndex", 0);
28
+ _defineProperty(this, "_awaiting", false);
29
+ _defineProperty(this, "_active", false);
30
+ _defineProperty(this, "_shouldResetProgress", false);
31
+ _defineProperty(this, "_pointerType", PointerType.MOUSE);
32
+ _defineProperty(this, "_delegate", void 0);
33
+ //
34
+ // Events Sending
35
+ //
48
36
  _defineProperty(this, "sendEvent", (newState, oldState) => {
49
37
  const {
50
38
  onGestureHandlerEvent,
51
39
  onGestureHandlerStateChange
52
40
  } = this.propsRef.current;
53
- const resultEvent = this.transformEventData(newState, oldState); // In the new API oldState field has to be undefined, unless we send event state changed
41
+ const resultEvent = this.transformEventData(newState, oldState);
42
+
43
+ // In the new API oldState field has to be undefined, unless we send event state changed
54
44
  // Here the order is flipped to avoid workarounds such as making backup of the state and setting it to undefined first, then changing it back
55
45
  // Flipping order with setting oldState to undefined solves issue, when events were being sent twice instead of once
56
46
  // However, this may cause trouble in the future (but for now we don't know that)
@@ -59,26 +49,24 @@ export default class GestureHandler {
59
49
  this.lastSentState = newState;
60
50
  invokeNullableMethod(onGestureHandlerStateChange, resultEvent);
61
51
  }
62
-
63
- if (this.currentState === State.ACTIVE) {
52
+ if (this.state === State.ACTIVE) {
64
53
  resultEvent.nativeEvent.oldState = undefined;
65
54
  invokeNullableMethod(onGestureHandlerEvent, resultEvent);
66
55
  }
67
56
  });
57
+ this._delegate = delegate;
58
+ }
68
59
 
69
- this.delegate = delegate;
70
- } //
60
+ //
71
61
  // Initializing handler
72
62
  //
73
63
 
74
-
75
64
  init(viewRef, propsRef) {
76
65
  this.propsRef = propsRef;
77
66
  this.viewRef = viewRef;
78
- this.currentState = State.UNDETERMINED;
67
+ this.state = State.UNDETERMINED;
79
68
  this.delegate.init(viewRef, this);
80
69
  }
81
-
82
70
  attachEventManager(manager) {
83
71
  manager.setOnPointerDown(this.onPointerDown.bind(this));
84
72
  manager.setOnPointerAdd(this.onPointerAdd.bind(this));
@@ -93,284 +81,218 @@ export default class GestureHandler {
93
81
  manager.setOnPointerMoveOut(this.onPointerMoveOut.bind(this));
94
82
  manager.setOnWheel(this.onWheel.bind(this));
95
83
  manager.registerListeners();
96
- } //
84
+ }
85
+
86
+ //
97
87
  // Resetting handler
98
88
  //
99
89
 
100
-
101
90
  onCancel() {}
102
-
103
91
  onReset() {}
104
-
105
92
  resetProgress() {}
106
-
107
93
  reset() {
108
94
  this.tracker.resetTracker();
109
95
  this.onReset();
110
96
  this.resetProgress();
111
97
  this.delegate.reset();
112
- this.currentState = State.UNDETERMINED;
113
- } //
98
+ this.state = State.UNDETERMINED;
99
+ }
100
+
101
+ //
114
102
  // State logic
115
103
  //
116
104
 
117
-
118
105
  moveToState(newState, sendIfDisabled) {
119
- if (this.currentState === newState) {
106
+ if (this.state === newState) {
120
107
  return;
121
108
  }
122
-
123
- const oldState = this.currentState;
124
- this.currentState = newState;
125
-
126
- if (this.tracker.getTrackedPointersCount() > 0 && this.config.needsPointerData && this.isFinished()) {
109
+ const oldState = this.state;
110
+ this.state = newState;
111
+ if (this.tracker.trackedPointersCount > 0 && this.config.needsPointerData && this.isFinished()) {
127
112
  this.cancelTouches();
128
113
  }
129
-
130
- GestureHandlerOrchestrator.getInstance().onHandlerStateChange(this, newState, oldState, sendIfDisabled);
114
+ GestureHandlerOrchestrator.instance.onHandlerStateChange(this, newState, oldState, sendIfDisabled);
131
115
  this.onStateChange(newState, oldState);
132
-
133
116
  if (!this.enabled && this.isFinished()) {
134
- this.currentState = State.UNDETERMINED;
117
+ this.state = State.UNDETERMINED;
135
118
  }
136
119
  }
137
-
138
120
  onStateChange(_newState, _oldState) {}
139
-
140
121
  begin() {
141
122
  if (!this.checkHitSlop()) {
142
123
  return;
143
124
  }
144
-
145
- if (this.currentState === State.UNDETERMINED) {
125
+ if (this.state === State.UNDETERMINED) {
146
126
  this.moveToState(State.BEGAN);
147
127
  }
148
128
  }
129
+
149
130
  /**
150
131
  * @param {boolean} sendIfDisabled - Used when handler becomes disabled. With this flag orchestrator will be forced to send fail event
151
132
  */
152
-
153
-
154
133
  fail(sendIfDisabled) {
155
- if (this.currentState === State.ACTIVE || this.currentState === State.BEGAN) {
134
+ if (this.state === State.ACTIVE || this.state === State.BEGAN) {
156
135
  // Here the order of calling the delegate and moveToState is important.
157
136
  // At this point we can use currentState as previuos state, because immediately after changing cursor we call moveToState method.
158
137
  this.delegate.onFail();
159
138
  this.moveToState(State.FAILED, sendIfDisabled);
160
139
  }
161
-
162
140
  this.resetProgress();
163
141
  }
142
+
164
143
  /**
165
144
  * @param {boolean} sendIfDisabled - Used when handler becomes disabled. With this flag orchestrator will be forced to send cancel event
166
145
  */
167
-
168
-
169
146
  cancel(sendIfDisabled) {
170
- if (this.currentState === State.ACTIVE || this.currentState === State.UNDETERMINED || this.currentState === State.BEGAN) {
171
- this.onCancel(); // Same as above - order matters
147
+ if (this.state === State.ACTIVE || this.state === State.UNDETERMINED || this.state === State.BEGAN) {
148
+ this.onCancel();
172
149
 
150
+ // Same as above - order matters
173
151
  this.delegate.onCancel();
174
152
  this.moveToState(State.CANCELLED, sendIfDisabled);
175
153
  }
176
154
  }
177
-
178
155
  activate(force = false) {
179
- if ((this.config.manualActivation !== true || force) && (this.currentState === State.UNDETERMINED || this.currentState === State.BEGAN)) {
156
+ if ((this.config.manualActivation !== true || force) && (this.state === State.UNDETERMINED || this.state === State.BEGAN)) {
180
157
  this.delegate.onActivate();
181
158
  this.moveToState(State.ACTIVE);
182
159
  }
183
160
  }
184
-
185
161
  end() {
186
- if (this.currentState === State.BEGAN || this.currentState === State.ACTIVE) {
162
+ if (this.state === State.BEGAN || this.state === State.ACTIVE) {
187
163
  // Same as above - order matters
188
164
  this.delegate.onEnd();
189
165
  this.moveToState(State.END);
190
166
  }
191
-
192
167
  this.resetProgress();
193
- } //
194
- // Methods for orchestrator
195
- //
196
-
197
-
198
- isAwaiting() {
199
- return this.awaiting;
200
- }
201
-
202
- setAwaiting(value) {
203
- this.awaiting = value;
204
168
  }
205
169
 
206
- isActive() {
207
- return this.active;
208
- }
209
-
210
- setActive(value) {
211
- this.active = value;
212
- }
170
+ //
171
+ // Methods for orchestrator
172
+ //
213
173
 
214
174
  getShouldResetProgress() {
215
175
  return this.shouldResetProgress;
216
176
  }
217
-
218
177
  setShouldResetProgress(value) {
219
178
  this.shouldResetProgress = value;
220
179
  }
221
-
222
- getActivationIndex() {
223
- return this.activationIndex;
224
- }
225
-
226
- setActivationIndex(value) {
227
- this.activationIndex = value;
228
- }
229
-
230
180
  shouldWaitForHandlerFailure(handler) {
231
181
  if (handler === this) {
232
182
  return false;
233
183
  }
234
-
235
- return InteractionManager.getInstance().shouldWaitForHandlerFailure(this, handler);
184
+ return InteractionManager.instance.shouldWaitForHandlerFailure(this, handler);
236
185
  }
237
-
238
186
  shouldRequireToWaitForFailure(handler) {
239
187
  if (handler === this) {
240
188
  return false;
241
189
  }
242
-
243
- return InteractionManager.getInstance().shouldRequireHandlerToWaitForFailure(this, handler);
190
+ return InteractionManager.instance.shouldRequireHandlerToWaitForFailure(this, handler);
244
191
  }
245
-
246
192
  shouldRecognizeSimultaneously(handler) {
247
193
  if (handler === this) {
248
194
  return true;
249
195
  }
250
-
251
- return InteractionManager.getInstance().shouldRecognizeSimultaneously(this, handler);
196
+ return InteractionManager.instance.shouldRecognizeSimultaneously(this, handler);
252
197
  }
253
-
254
198
  shouldBeCancelledByOther(handler) {
255
199
  if (handler === this) {
256
200
  return false;
257
201
  }
202
+ return InteractionManager.instance.shouldHandlerBeCancelledBy(this, handler);
203
+ }
258
204
 
259
- return InteractionManager.getInstance().shouldHandlerBeCancelledBy(this, handler);
260
- } //
205
+ //
261
206
  // Event actions
262
207
  //
263
208
 
264
-
265
209
  onPointerDown(event) {
266
- GestureHandlerOrchestrator.getInstance().recordHandlerIfNotPresent(this);
210
+ GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(this);
267
211
  this.pointerType = event.pointerType;
268
-
269
212
  if (this.pointerType === PointerType.TOUCH) {
270
- GestureHandlerOrchestrator.getInstance().cancelMouseAndPenGestures(this);
271
- } // TODO: Bring back touch events along with introducing `handleDown` method that will handle handler specific stuff
272
-
273
- } // Adding another pointer to existing ones
274
-
213
+ GestureHandlerOrchestrator.instance.cancelMouseAndPenGestures(this);
214
+ }
275
215
 
216
+ // TODO: Bring back touch events along with introducing `handleDown` method that will handle handler specific stuff
217
+ }
218
+ // Adding another pointer to existing ones
276
219
  onPointerAdd(event) {
277
220
  this.tryToSendTouchEvent(event);
278
221
  }
279
-
280
222
  onPointerUp(event) {
281
223
  this.tryToSendTouchEvent(event);
282
- } // Removing pointer, when there is more than one pointers
283
-
284
-
224
+ }
225
+ // Removing pointer, when there is more than one pointers
285
226
  onPointerRemove(event) {
286
227
  this.tryToSendTouchEvent(event);
287
228
  }
288
-
289
229
  onPointerMove(event) {
290
230
  this.tryToSendMoveEvent(false, event);
291
231
  }
292
-
293
232
  onPointerLeave(event) {
294
233
  if (this.shouldCancelWhenOutside) {
295
- switch (this.currentState) {
234
+ switch (this.state) {
296
235
  case State.ACTIVE:
297
236
  this.cancel();
298
237
  break;
299
-
300
238
  case State.BEGAN:
301
239
  this.fail();
302
240
  break;
303
241
  }
304
-
305
242
  return;
306
243
  }
307
-
308
244
  this.tryToSendTouchEvent(event);
309
245
  }
310
-
311
246
  onPointerEnter(event) {
312
247
  this.tryToSendTouchEvent(event);
313
248
  }
314
-
315
249
  onPointerCancel(event) {
316
250
  this.tryToSendTouchEvent(event);
317
251
  this.cancel();
318
252
  this.reset();
319
253
  }
320
-
321
254
  onPointerOutOfBounds(event) {
322
255
  this.tryToSendMoveEvent(true, event);
323
256
  }
324
-
325
- onPointerMoveOver(_event) {// Used only by hover gesture handler atm
257
+ onPointerMoveOver(_event) {
258
+ // Used only by hover gesture handler atm
326
259
  }
327
-
328
- onPointerMoveOut(_event) {// Used only by hover gesture handler atm
260
+ onPointerMoveOut(_event) {
261
+ // Used only by hover gesture handler atm
329
262
  }
330
-
331
- onWheel(_event) {// Used only by pan gesture handler
263
+ onWheel(_event) {
264
+ // Used only by pan gesture handler
332
265
  }
333
-
334
266
  tryToSendMoveEvent(out, event) {
335
267
  if (out && this.shouldCancelWhenOutside || !this.enabled) {
336
268
  return;
337
269
  }
338
-
339
270
  if (this.active) {
340
- this.sendEvent(this.currentState, this.currentState);
271
+ this.sendEvent(this.state, this.state);
341
272
  }
342
-
343
273
  this.tryToSendTouchEvent(event);
344
274
  }
345
-
346
275
  tryToSendTouchEvent(event) {
347
276
  if (this.config.needsPointerData) {
348
277
  this.sendTouchEvent(event);
349
278
  }
350
279
  }
351
-
352
280
  sendTouchEvent(event) {
353
281
  if (!this.enabled) {
354
282
  return;
355
283
  }
356
-
357
284
  const {
358
285
  onGestureHandlerEvent
359
286
  } = this.propsRef.current;
360
287
  const touchEvent = this.transformTouchEvent(event);
361
-
362
288
  if (touchEvent) {
363
289
  invokeNullableMethod(onGestureHandlerEvent, touchEvent);
364
290
  }
365
- } //
366
- // Events Sending
367
- //
368
-
369
-
291
+ }
370
292
  transformEventData(newState, oldState) {
371
293
  return {
372
294
  nativeEvent: {
373
- numberOfPointers: this.tracker.getTrackedPointersCount(),
295
+ numberOfPointers: this.tracker.trackedPointersCount,
374
296
  state: newState,
375
297
  pointerInside: this.delegate.isPointerInBounds(this.tracker.getAbsoluteCoordsAverage()),
376
298
  ...this.transformNativeEvent(),
@@ -382,20 +304,19 @@ export default class GestureHandler {
382
304
  timeStamp: Date.now()
383
305
  };
384
306
  }
385
-
386
307
  transformTouchEvent(event) {
387
308
  const rect = this.delegate.measureView();
388
309
  const all = [];
389
310
  const changed = [];
390
- const trackerData = this.tracker.getData(); // This if handles edge case where all pointers have been cancelled
311
+ const trackerData = this.tracker.trackedPointers;
312
+
313
+ // This if handles edge case where all pointers have been cancelled
391
314
  // When pointercancel is triggered, reset method is called. This means that tracker will be reset after first pointer being cancelled
392
315
  // The problem is, that handler will receive another pointercancel event from the rest of the pointers
393
316
  // To avoid crashing, we don't send event if tracker tracks no pointers, i.e. has been reset
394
-
395
317
  if (trackerData.size === 0 || !trackerData.has(event.pointerId)) {
396
318
  return;
397
319
  }
398
-
399
320
  trackerData.forEach((element, key) => {
400
321
  const id = this.tracker.getMappedTouchEventId(key);
401
322
  all.push({
@@ -405,9 +326,10 @@ export default class GestureHandler {
405
326
  absoluteX: element.abosoluteCoords.x,
406
327
  absoluteY: element.abosoluteCoords.y
407
328
  });
408
- }); // Each pointer sends its own event, so we want changed touches to contain only the pointer that has changed.
409
- // However, if the event is cancel, we want to cancel all pointers to avoid crashes
329
+ });
410
330
 
331
+ // Each pointer sends its own event, so we want changed touches to contain only the pointer that has changed.
332
+ // However, if the event is cancel, we want to cancel all pointers to avoid crashes
411
333
  if (event.eventType !== EventTypes.CANCEL) {
412
334
  changed.push({
413
335
  id: this.tracker.getMappedTouchEventId(event.pointerId),
@@ -428,42 +350,35 @@ export default class GestureHandler {
428
350
  });
429
351
  });
430
352
  }
431
-
432
353
  let eventType = TouchEventType.UNDETERMINED;
433
-
434
354
  switch (event.eventType) {
435
355
  case EventTypes.DOWN:
436
356
  case EventTypes.ADDITIONAL_POINTER_DOWN:
437
357
  eventType = TouchEventType.DOWN;
438
358
  break;
439
-
440
359
  case EventTypes.UP:
441
360
  case EventTypes.ADDITIONAL_POINTER_UP:
442
361
  eventType = TouchEventType.UP;
443
362
  break;
444
-
445
363
  case EventTypes.MOVE:
446
364
  eventType = TouchEventType.MOVE;
447
365
  break;
448
-
449
366
  case EventTypes.CANCEL:
450
367
  eventType = TouchEventType.CANCELLED;
451
368
  break;
452
- } // Here, when we receive up event, we want to decrease number of touches
369
+ }
370
+
371
+ // Here, when we receive up event, we want to decrease number of touches
453
372
  // That's because we want handler to send information that there's one pointer less
454
373
  // However, we still want this pointer to be present in allTouches array, so that its data can be accessed
455
-
456
-
457
374
  let numberOfTouches = all.length;
458
-
459
375
  if (event.eventType === EventTypes.UP || event.eventType === EventTypes.ADDITIONAL_POINTER_UP) {
460
376
  --numberOfTouches;
461
377
  }
462
-
463
378
  return {
464
379
  nativeEvent: {
465
380
  handlerTag: this.handlerTag,
466
- state: this.currentState,
381
+ state: this.state,
467
382
  eventType: eventType,
468
383
  changedTouches: changed,
469
384
  allTouches: all,
@@ -473,17 +388,14 @@ export default class GestureHandler {
473
388
  timeStamp: Date.now()
474
389
  };
475
390
  }
476
-
477
391
  cancelTouches() {
478
392
  const rect = this.delegate.measureView();
479
393
  const all = [];
480
394
  const changed = [];
481
- const trackerData = this.tracker.getData();
482
-
395
+ const trackerData = this.tracker.trackedPointers;
483
396
  if (trackerData.size === 0) {
484
397
  return;
485
398
  }
486
-
487
399
  trackerData.forEach((element, key) => {
488
400
  const id = this.tracker.getMappedTouchEventId(key);
489
401
  all.push({
@@ -504,7 +416,7 @@ export default class GestureHandler {
504
416
  const cancelEvent = {
505
417
  nativeEvent: {
506
418
  handlerTag: this.handlerTag,
507
- state: this.currentState,
419
+ state: this.state,
508
420
  eventType: TouchEventType.CANCELLED,
509
421
  changedTouches: changed,
510
422
  allTouches: all,
@@ -518,7 +430,6 @@ export default class GestureHandler {
518
430
  } = this.propsRef.current;
519
431
  invokeNullableMethod(onGestureHandlerEvent, cancelEvent);
520
432
  }
521
-
522
433
  transformNativeEvent() {
523
434
  // Those properties are shared by most handlers and if not this method will be overriden
524
435
  const lastCoords = this.tracker.getAbsoluteCoordsAverage();
@@ -529,47 +440,41 @@ export default class GestureHandler {
529
440
  absoluteX: lastCoords.x,
530
441
  absoluteY: lastCoords.y
531
442
  };
532
- } //
443
+ }
444
+
445
+ //
533
446
  // Handling config
534
447
  //
535
448
 
536
-
537
449
  updateGestureConfig({
538
450
  enabled = true,
539
451
  ...props
540
452
  }) {
541
- this.config = {
453
+ this._config = {
542
454
  enabled: enabled,
543
455
  ...props
544
456
  };
545
457
  this.enabled = enabled;
546
458
  this.delegate.onEnabledChange(enabled);
547
-
548
459
  if (this.config.shouldCancelWhenOutside !== undefined) {
549
- this.setShouldCancelWhenOutside(this.config.shouldCancelWhenOutside);
460
+ this.shouldCancelWhenOutside = this.config.shouldCancelWhenOutside;
550
461
  }
551
-
552
462
  this.validateHitSlops();
553
-
554
463
  if (this.enabled) {
555
464
  return;
556
465
  }
557
-
558
- switch (this.currentState) {
466
+ switch (this.state) {
559
467
  case State.ACTIVE:
560
468
  this.fail(true);
561
469
  break;
562
-
563
470
  case State.UNDETERMINED:
564
- GestureHandlerOrchestrator.getInstance().removeHandlerFromOrchestrator(this);
471
+ GestureHandlerOrchestrator.instance.removeHandlerFromOrchestrator(this);
565
472
  break;
566
-
567
473
  default:
568
474
  this.cancel(true);
569
475
  break;
570
476
  }
571
477
  }
572
-
573
478
  checkCustomActivationCriteria(criterias) {
574
479
  for (const key in this.config) {
575
480
  if (criterias.indexOf(key) >= 0) {
@@ -577,34 +482,27 @@ export default class GestureHandler {
577
482
  }
578
483
  }
579
484
  }
580
-
581
485
  validateHitSlops() {
582
486
  if (!this.config.hitSlop) {
583
487
  return;
584
488
  }
585
-
586
489
  if (this.config.hitSlop.left !== undefined && this.config.hitSlop.right !== undefined && this.config.hitSlop.width !== undefined) {
587
490
  throw new Error('HitSlop Error: Cannot define left, right and width at the same time');
588
491
  }
589
-
590
492
  if (this.config.hitSlop.width !== undefined && this.config.hitSlop.left === undefined && this.config.hitSlop.right === undefined) {
591
493
  throw new Error('HitSlop Error: When width is defined, either left or right has to be defined');
592
494
  }
593
-
594
495
  if (this.config.hitSlop.height !== undefined && this.config.hitSlop.top !== undefined && this.config.hitSlop.bottom !== undefined) {
595
496
  throw new Error('HitSlop Error: Cannot define top, bottom and height at the same time');
596
497
  }
597
-
598
498
  if (this.config.hitSlop.height !== undefined && this.config.hitSlop.top === undefined && this.config.hitSlop.bottom === undefined) {
599
499
  throw new Error('HitSlop Error: When height is defined, either top or bottom has to be defined');
600
500
  }
601
501
  }
602
-
603
502
  checkHitSlop() {
604
503
  if (!this.config.hitSlop) {
605
504
  return true;
606
505
  }
607
-
608
506
  const {
609
507
  width,
610
508
  height
@@ -613,33 +511,26 @@ export default class GestureHandler {
613
511
  let top = 0;
614
512
  let right = width;
615
513
  let bottom = height;
616
-
617
514
  if (this.config.hitSlop.horizontal !== undefined) {
618
515
  left -= this.config.hitSlop.horizontal;
619
516
  right += this.config.hitSlop.horizontal;
620
517
  }
621
-
622
518
  if (this.config.hitSlop.vertical !== undefined) {
623
519
  top -= this.config.hitSlop.vertical;
624
520
  bottom += this.config.hitSlop.vertical;
625
521
  }
626
-
627
522
  if (this.config.hitSlop.left !== undefined) {
628
523
  left = -this.config.hitSlop.left;
629
524
  }
630
-
631
525
  if (this.config.hitSlop.right !== undefined) {
632
526
  right = width + this.config.hitSlop.right;
633
527
  }
634
-
635
528
  if (this.config.hitSlop.top !== undefined) {
636
529
  top = -this.config.hitSlop.top;
637
530
  }
638
-
639
531
  if (this.config.hitSlop.bottom !== undefined) {
640
532
  bottom = width + this.config.hitSlop.bottom;
641
533
  }
642
-
643
534
  if (this.config.hitSlop.width !== undefined) {
644
535
  if (this.config.hitSlop.left !== undefined) {
645
536
  right = left + this.config.hitSlop.width;
@@ -647,7 +538,6 @@ export default class GestureHandler {
647
538
  left = right - this.config.hitSlop.width;
648
539
  }
649
540
  }
650
-
651
541
  if (this.config.hitSlop.height !== undefined) {
652
542
  if (this.config.hitSlop.top !== undefined) {
653
543
  bottom = top + this.config.hitSlop.height;
@@ -655,7 +545,6 @@ export default class GestureHandler {
655
545
  top = bottom - this.config.hitSlop.height;
656
546
  }
657
547
  }
658
-
659
548
  const rect = this.delegate.measureView();
660
549
  const {
661
550
  x,
@@ -665,107 +554,119 @@ export default class GestureHandler {
665
554
  const offsetY = y - rect.pageY;
666
555
  return offsetX >= left && offsetX <= right && offsetY >= top && offsetY <= bottom;
667
556
  }
668
-
669
557
  isButtonInConfig(mouseButton) {
670
558
  return !mouseButton || !this.config.mouseButton && mouseButton === MouseButton.LEFT || this.config.mouseButton && mouseButton & this.config.mouseButton;
671
559
  }
672
-
673
560
  resetConfig() {}
674
-
675
561
  onDestroy() {
676
562
  this.delegate.destroy(this.config);
677
- } //
563
+ }
564
+
565
+ //
678
566
  // Getters and setters
679
567
  //
680
568
 
681
-
682
- getTag() {
683
- return this.handlerTag;
569
+ get handlerTag() {
570
+ return this._handlerTag;
684
571
  }
685
-
686
- setTag(tag) {
687
- this.handlerTag = tag;
572
+ set handlerTag(value) {
573
+ this._handlerTag = value;
688
574
  }
689
-
690
- getConfig() {
691
- return this.config;
575
+ get config() {
576
+ return this._config;
692
577
  }
693
-
694
- getDelegate() {
695
- return this.delegate;
578
+ get delegate() {
579
+ return this._delegate;
696
580
  }
697
-
698
- getTracker() {
699
- return this.tracker;
581
+ get tracker() {
582
+ return this._tracker;
700
583
  }
701
-
702
- getTrackedPointersID() {
703
- return this.tracker.getTrackedPointersID();
584
+ get state() {
585
+ return this._state;
704
586
  }
705
-
706
- getState() {
707
- return this.currentState;
587
+ set state(value) {
588
+ this._state = value;
708
589
  }
709
-
710
- isEnabled() {
711
- return this.enabled;
590
+ get shouldCancelWhenOutside() {
591
+ return this._shouldCancelWhenOutside;
712
592
  }
713
-
714
- isFinished() {
715
- return this.currentState === State.END || this.currentState === State.FAILED || this.currentState === State.CANCELLED;
593
+ set shouldCancelWhenOutside(value) {
594
+ this._shouldCancelWhenOutside = value;
716
595
  }
717
-
718
- setShouldCancelWhenOutside(shouldCancel) {
719
- this.shouldCancelWhenOutside = shouldCancel;
596
+ get enabled() {
597
+ return this._enabled;
720
598
  }
721
-
722
- getShouldCancelWhenOutside() {
723
- return this.shouldCancelWhenOutside;
599
+ set enabled(value) {
600
+ this._enabled = value;
724
601
  }
725
-
726
- getPointerType() {
727
- return this.pointerType;
602
+ get pointerType() {
603
+ return this._pointerType;
604
+ }
605
+ set pointerType(value) {
606
+ this._pointerType = value;
607
+ }
608
+ get active() {
609
+ return this._active;
610
+ }
611
+ set active(value) {
612
+ this._active = value;
613
+ }
614
+ get awaiting() {
615
+ return this._awaiting;
616
+ }
617
+ set awaiting(value) {
618
+ this._awaiting = value;
619
+ }
620
+ get activationIndex() {
621
+ return this._activationIndex;
622
+ }
623
+ set activationIndex(value) {
624
+ this._activationIndex = value;
625
+ }
626
+ get shouldResetProgress() {
627
+ return this._shouldResetProgress;
628
+ }
629
+ set shouldResetProgress(value) {
630
+ this._shouldResetProgress = value;
631
+ }
632
+ getTrackedPointersID() {
633
+ return this.tracker.trackedPointersIDs;
634
+ }
635
+ isFinished() {
636
+ return this.state === State.END || this.state === State.FAILED || this.state === State.CANCELLED;
728
637
  }
729
-
730
638
  }
731
-
732
639
  function invokeNullableMethod(method, event) {
733
640
  if (!method) {
734
641
  return;
735
642
  }
736
-
737
643
  if (typeof method === 'function') {
738
644
  method(event);
739
645
  return;
740
646
  }
741
-
742
647
  if ('__getHandler' in method && typeof method.__getHandler === 'function') {
743
648
  const handler = method.__getHandler();
744
-
745
649
  invokeNullableMethod(handler, event);
746
650
  return;
747
651
  }
748
-
749
652
  if (!('__nodeConfig' in method)) {
750
653
  return;
751
654
  }
752
-
753
655
  const {
754
656
  argMapping
755
657
  } = method.__nodeConfig;
756
-
757
658
  if (!Array.isArray(argMapping)) {
758
659
  return;
759
660
  }
760
-
761
661
  for (const [index, [key, value]] of argMapping.entries()) {
762
662
  if (!(key in event.nativeEvent)) {
763
663
  continue;
764
- } // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
765
-
664
+ }
766
665
 
767
- const nativeValue = event.nativeEvent[key]; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
666
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
667
+ const nativeValue = event.nativeEvent[key];
768
668
 
669
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
769
670
  if (value !== null && value !== void 0 && value.setValue) {
770
671
  // Reanimated API
771
672
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
@@ -775,7 +676,6 @@ function invokeNullableMethod(method, event) {
775
676
  method.__nodeConfig.argMapping[index] = [key, nativeValue];
776
677
  }
777
678
  }
778
-
779
679
  return;
780
680
  }
781
681
  //# sourceMappingURL=GestureHandler.js.map