react-native-gesture-handler 2.17.1 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (428) hide show
  1. package/ReanimatedSwipeable/package.json +6 -0
  2. package/android/build.gradle +0 -103
  3. package/android/gradle.properties +0 -7
  4. package/android/paper/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +22 -10
  5. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +1 -1
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +16 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +7 -8
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +14 -4
  9. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +3 -1
  10. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +3 -1
  11. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +2 -1
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +8 -7
  13. package/android/src/main/jni/cpp-adapter.cpp +5 -3
  14. package/apple/Handlers/RNFlingHandler.m +1 -0
  15. package/apple/Handlers/RNForceTouchHandler.m +2 -0
  16. package/apple/Handlers/RNLongPressHandler.m +2 -1
  17. package/apple/Handlers/RNManualHandler.m +1 -0
  18. package/apple/Handlers/RNNativeViewHandler.mm +31 -27
  19. package/apple/Handlers/RNPanHandler.m +1 -0
  20. package/apple/Handlers/RNPinchHandler.m +1 -0
  21. package/apple/Handlers/RNRotationHandler.m +1 -0
  22. package/apple/Handlers/RNTapHandler.m +1 -0
  23. package/apple/RNGestureHandlerModule.mm +3 -2
  24. package/apple/RNRootViewGestureRecognizer.m +5 -0
  25. package/lib/commonjs/Directions.js +2 -2
  26. package/lib/commonjs/Directions.js.map +1 -1
  27. package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
  28. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  29. package/lib/commonjs/components/DrawerLayout.js +2 -2
  30. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  31. package/lib/commonjs/components/GestureButtons.js +3 -3
  32. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  33. package/lib/commonjs/components/GestureButtonsProps.js +6 -0
  34. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -0
  35. package/lib/commonjs/components/GestureComponents.js +1 -1
  36. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  37. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  38. package/lib/commonjs/components/GestureHandlerRootView.android.js +1 -1
  39. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  40. package/lib/commonjs/components/GestureHandlerRootView.js +1 -1
  41. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  42. package/lib/commonjs/components/Pressable/Pressable.js +334 -0
  43. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -0
  44. package/lib/commonjs/components/Pressable/PressableProps.js +6 -0
  45. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -0
  46. package/lib/commonjs/components/Pressable/index.js +24 -0
  47. package/lib/commonjs/components/Pressable/index.js.map +1 -0
  48. package/lib/commonjs/components/Pressable/utils.js +136 -0
  49. package/lib/commonjs/components/Pressable/utils.js.map +1 -0
  50. package/lib/commonjs/components/ReanimatedSwipeable.js +317 -0
  51. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -0
  52. package/lib/commonjs/components/Swipeable.js +3 -3
  53. package/lib/commonjs/components/Swipeable.js.map +1 -1
  54. package/lib/commonjs/components/touchables/GenericTouchable.js +4 -4
  55. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  56. package/lib/commonjs/components/touchables/GenericTouchableProps.js +6 -0
  57. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -0
  58. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  59. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +1 -1
  60. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  61. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +6 -0
  62. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
  63. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  64. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  65. package/lib/commonjs/getShadowNodeFromRef.js +2 -2
  66. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  67. package/lib/commonjs/ghQueueMicrotask.js +3 -4
  68. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  69. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  70. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  71. package/lib/commonjs/handlers/GestureHandlerEventPayload.js +2 -0
  72. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -0
  73. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  74. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  75. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  76. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  77. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  78. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  79. package/lib/commonjs/handlers/createHandler.js +21 -19
  80. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  81. package/lib/commonjs/handlers/createNativeWrapper.js +3 -3
  82. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  83. package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -86
  84. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  85. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  86. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -9
  87. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  88. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +2 -2
  89. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  90. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
  91. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  92. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +21 -31
  93. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  94. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
  95. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  96. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +5 -5
  97. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  98. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  99. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  100. package/lib/commonjs/handlers/gestures/gesture.js +7 -7
  101. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  102. package/lib/commonjs/handlers/gestures/gestureComposition.js +5 -5
  103. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  104. package/lib/commonjs/handlers/gestures/gestureStateManager.js +1 -1
  105. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  106. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  107. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  108. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  109. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  110. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  111. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  112. package/lib/commonjs/handlers/getNextHandlerTag.js +12 -0
  113. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -0
  114. package/lib/commonjs/handlers/handlersRegistry.js +0 -6
  115. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  116. package/lib/commonjs/handlers/utils.js +91 -0
  117. package/lib/commonjs/handlers/utils.js.map +1 -0
  118. package/lib/commonjs/index.js +8 -0
  119. package/lib/commonjs/index.js.map +1 -1
  120. package/lib/commonjs/init.js +1 -1
  121. package/lib/commonjs/init.js.map +1 -1
  122. package/lib/commonjs/jestUtils/jestUtils.js +2 -2
  123. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  124. package/lib/commonjs/mocks.js +2 -2
  125. package/lib/commonjs/mocks.js.map +1 -1
  126. package/lib/commonjs/utils.js +1 -1
  127. package/lib/commonjs/utils.js.map +1 -1
  128. package/lib/commonjs/web/Gestures.js +1 -1
  129. package/lib/commonjs/web/Gestures.js.map +1 -1
  130. package/lib/commonjs/web/detectors/RotationGestureDetector.js +1 -1
  131. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  132. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +4 -4
  133. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  134. package/lib/commonjs/web/handlers/FlingGestureHandler.js +1 -1
  135. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  136. package/lib/commonjs/web/handlers/GestureHandler.js +6 -11
  137. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  138. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +1 -1
  139. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  140. package/lib/commonjs/web/handlers/PanGestureHandler.js +1 -1
  141. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  142. package/lib/commonjs/web/handlers/TapGestureHandler.js +1 -1
  143. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  144. package/lib/commonjs/web/tools/EventManager.js +2 -2
  145. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  146. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +4 -11
  147. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  148. package/lib/commonjs/web/tools/LeastSquareSolver.js +18 -18
  149. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  150. package/lib/commonjs/web/tools/PointerEventManager.js +2 -2
  151. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  152. package/lib/commonjs/web/tools/PointerTracker.js +1 -1
  153. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  154. package/lib/commonjs/web/tools/TouchEventManager.js +4 -4
  155. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  156. package/lib/commonjs/web/tools/VelocityTracker.js +6 -6
  157. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  158. package/lib/commonjs/web_hammer/NodeManager.js +2 -0
  159. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  160. package/lib/module/Directions.js +2 -2
  161. package/lib/module/Directions.js.map +1 -1
  162. package/lib/module/RNGestureHandlerModule.web.js +2 -2
  163. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  164. package/lib/module/components/DrawerLayout.js +2 -2
  165. package/lib/module/components/DrawerLayout.js.map +1 -1
  166. package/lib/module/components/GestureButtons.js +3 -3
  167. package/lib/module/components/GestureButtons.js.map +1 -1
  168. package/lib/module/components/GestureButtonsProps.js +2 -0
  169. package/lib/module/components/GestureButtonsProps.js.map +1 -0
  170. package/lib/module/components/GestureComponents.js +1 -1
  171. package/lib/module/components/GestureComponents.js.map +1 -1
  172. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  173. package/lib/module/components/GestureHandlerRootView.android.js +1 -1
  174. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  175. package/lib/module/components/GestureHandlerRootView.js +1 -1
  176. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  177. package/lib/module/components/Pressable/Pressable.js +309 -0
  178. package/lib/module/components/Pressable/Pressable.js.map +1 -0
  179. package/lib/module/components/Pressable/PressableProps.js +2 -0
  180. package/lib/module/components/Pressable/PressableProps.js.map +1 -0
  181. package/lib/module/components/Pressable/index.js +3 -0
  182. package/lib/module/components/Pressable/index.js.map +1 -0
  183. package/lib/module/components/Pressable/utils.js +120 -0
  184. package/lib/module/components/Pressable/utils.js.map +1 -0
  185. package/lib/module/components/ReanimatedSwipeable.js +293 -0
  186. package/lib/module/components/ReanimatedSwipeable.js.map +1 -0
  187. package/lib/module/components/Swipeable.js +3 -3
  188. package/lib/module/components/Swipeable.js.map +1 -1
  189. package/lib/module/components/touchables/GenericTouchable.js +4 -4
  190. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  191. package/lib/module/components/touchables/GenericTouchableProps.js +2 -0
  192. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -0
  193. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  194. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +1 -1
  195. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  196. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +2 -0
  197. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
  198. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  199. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  200. package/lib/module/getShadowNodeFromRef.js +2 -2
  201. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  202. package/lib/module/ghQueueMicrotask.js +3 -4
  203. package/lib/module/ghQueueMicrotask.js.map +1 -1
  204. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  205. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  206. package/lib/module/handlers/GestureHandlerEventPayload.js +2 -0
  207. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -0
  208. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  209. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  210. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  211. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  212. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  213. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  214. package/lib/module/handlers/createHandler.js +6 -5
  215. package/lib/module/handlers/createHandler.js.map +1 -1
  216. package/lib/module/handlers/createNativeWrapper.js +3 -3
  217. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  218. package/lib/module/handlers/gestureHandlerCommon.js +0 -72
  219. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  220. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  221. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +4 -4
  222. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  223. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -1
  224. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  225. package/lib/module/handlers/gestures/GestureDetector/index.js +1 -1
  226. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  227. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +18 -28
  228. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  229. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
  230. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  231. package/lib/module/handlers/gestures/GestureDetector/utils.js +5 -5
  232. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  233. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  234. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  235. package/lib/module/handlers/gestures/gesture.js +6 -6
  236. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  237. package/lib/module/handlers/gestures/gestureComposition.js +5 -5
  238. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  239. package/lib/module/handlers/gestures/gestureStateManager.js +1 -1
  240. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  241. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  242. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  243. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  244. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  245. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  246. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  247. package/lib/module/handlers/getNextHandlerTag.js +5 -0
  248. package/lib/module/handlers/getNextHandlerTag.js.map +1 -0
  249. package/lib/module/handlers/handlersRegistry.js +0 -4
  250. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  251. package/lib/module/handlers/utils.js +73 -0
  252. package/lib/module/handlers/utils.js.map +1 -0
  253. package/lib/module/index.js +1 -0
  254. package/lib/module/index.js.map +1 -1
  255. package/lib/module/init.js +1 -1
  256. package/lib/module/init.js.map +1 -1
  257. package/lib/module/jestUtils/jestUtils.js +2 -2
  258. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  259. package/lib/module/mocks.js +2 -2
  260. package/lib/module/mocks.js.map +1 -1
  261. package/lib/module/utils.js +1 -1
  262. package/lib/module/utils.js.map +1 -1
  263. package/lib/module/web/Gestures.js +1 -1
  264. package/lib/module/web/Gestures.js.map +1 -1
  265. package/lib/module/web/detectors/RotationGestureDetector.js +1 -1
  266. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  267. package/lib/module/web/detectors/ScaleGestureDetector.js +4 -4
  268. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  269. package/lib/module/web/handlers/FlingGestureHandler.js +1 -1
  270. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  271. package/lib/module/web/handlers/GestureHandler.js +6 -11
  272. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  273. package/lib/module/web/handlers/NativeViewGestureHandler.js +1 -1
  274. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  275. package/lib/module/web/handlers/PanGestureHandler.js +1 -1
  276. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  277. package/lib/module/web/handlers/TapGestureHandler.js +1 -1
  278. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  279. package/lib/module/web/tools/EventManager.js +2 -2
  280. package/lib/module/web/tools/EventManager.js.map +1 -1
  281. package/lib/module/web/tools/GestureHandlerWebDelegate.js +4 -11
  282. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  283. package/lib/module/web/tools/LeastSquareSolver.js +18 -18
  284. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  285. package/lib/module/web/tools/PointerEventManager.js +2 -2
  286. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  287. package/lib/module/web/tools/PointerTracker.js +1 -1
  288. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  289. package/lib/module/web/tools/TouchEventManager.js +4 -4
  290. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  291. package/lib/module/web/tools/VelocityTracker.js +6 -6
  292. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  293. package/lib/module/web_hammer/NodeManager.js +1 -1
  294. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  295. package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -1
  296. package/lib/typescript/components/GestureButtons.d.ts +2 -85
  297. package/lib/typescript/components/GestureButtonsProps.d.ts +99 -0
  298. package/lib/typescript/components/GestureHandlerButton.d.ts +1 -1
  299. package/lib/typescript/components/Pressable/Pressable.d.ts +3 -0
  300. package/lib/typescript/components/Pressable/PressableProps.d.ts +116 -0
  301. package/lib/typescript/components/Pressable/index.d.ts +2 -0
  302. package/lib/typescript/components/Pressable/utils.d.ts +15 -0
  303. package/lib/typescript/components/ReanimatedSwipeable.d.ts +125 -0
  304. package/lib/typescript/components/touchables/GenericTouchable.d.ts +4 -16
  305. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +14 -0
  306. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -1
  307. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -9
  308. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +9 -0
  309. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +1 -1
  310. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -1
  311. package/lib/typescript/handlers/FlingGestureHandler.d.ts +2 -6
  312. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +1 -10
  313. package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +159 -0
  314. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -35
  315. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +2 -6
  316. package/lib/typescript/handlers/PanGestureHandler.d.ts +3 -51
  317. package/lib/typescript/handlers/PinchGestureHandler.d.ts +2 -23
  318. package/lib/typescript/handlers/RotationGestureHandler.d.ts +2 -23
  319. package/lib/typescript/handlers/TapGestureHandler.d.ts +2 -6
  320. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -5
  321. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +10 -9
  322. package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +1 -0
  323. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -0
  324. package/lib/typescript/handlers/gestures/flingGesture.d.ts +2 -1
  325. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +2 -1
  326. package/lib/typescript/handlers/gestures/gesture.d.ts +2 -8
  327. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +2 -1
  328. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +2 -1
  329. package/lib/typescript/handlers/gestures/panGesture.d.ts +2 -1
  330. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +1 -1
  331. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +1 -1
  332. package/lib/typescript/handlers/gestures/tapGesture.d.ts +2 -1
  333. package/lib/typescript/handlers/getNextHandlerTag.d.ts +1 -0
  334. package/lib/typescript/handlers/handlersRegistry.d.ts +1 -2
  335. package/lib/typescript/handlers/utils.d.ts +6 -0
  336. package/lib/typescript/index.d.ts +12 -9
  337. package/lib/typescript/jestUtils/jestUtils.d.ts +9 -7
  338. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +1 -0
  339. package/lib/typescript/web/handlers/GestureHandler.d.ts +1 -0
  340. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +1 -0
  341. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +1 -0
  342. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +1 -0
  343. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -0
  344. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +1 -0
  345. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +1 -0
  346. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +1 -0
  347. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +1 -0
  348. package/lib/typescript/web_hammer/NodeManager.d.ts +4 -5
  349. package/package.json +14 -16
  350. package/src/Directions.ts +2 -2
  351. package/src/RNGestureHandlerModule.web.ts +2 -2
  352. package/src/components/DrawerLayout.tsx +7 -9
  353. package/src/components/GestureButtons.tsx +13 -123
  354. package/src/components/GestureButtonsProps.ts +115 -0
  355. package/src/components/GestureComponents.tsx +1 -1
  356. package/src/components/GestureHandlerButton.tsx +1 -1
  357. package/src/components/GestureHandlerRootView.android.tsx +1 -1
  358. package/src/components/GestureHandlerRootView.tsx +1 -1
  359. package/src/components/Pressable/Pressable.tsx +398 -0
  360. package/src/components/Pressable/PressableProps.tsx +149 -0
  361. package/src/components/Pressable/index.ts +2 -0
  362. package/src/components/Pressable/utils.ts +180 -0
  363. package/src/components/ReanimatedSwipeable.tsx +629 -0
  364. package/src/components/Swipeable.tsx +6 -6
  365. package/src/components/touchables/GenericTouchable.tsx +9 -36
  366. package/src/components/touchables/GenericTouchableProps.ts +26 -0
  367. package/src/components/touchables/TouchableHighlight.tsx +2 -4
  368. package/src/components/touchables/TouchableNativeFeedback.android.tsx +7 -17
  369. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +12 -0
  370. package/src/components/touchables/TouchableOpacity.tsx +3 -5
  371. package/src/components/touchables/TouchableWithoutFeedback.tsx +2 -1
  372. package/src/getShadowNodeFromRef.ts +2 -2
  373. package/src/ghQueueMicrotask.ts +7 -4
  374. package/src/handlers/FlingGestureHandler.ts +1 -6
  375. package/src/handlers/ForceTouchGestureHandler.ts +1 -12
  376. package/src/handlers/GestureHandlerEventPayload.ts +184 -0
  377. package/src/handlers/LongPressGestureHandler.ts +1 -40
  378. package/src/handlers/NativeViewGestureHandler.ts +1 -7
  379. package/src/handlers/PanGestureHandler.ts +1 -58
  380. package/src/handlers/PinchGestureHandler.ts +1 -27
  381. package/src/handlers/RotationGestureHandler.ts +1 -27
  382. package/src/handlers/TapGestureHandler.ts +1 -6
  383. package/src/handlers/createHandler.tsx +6 -11
  384. package/src/handlers/createNativeWrapper.tsx +3 -3
  385. package/src/handlers/gestureHandlerCommon.ts +3 -79
  386. package/src/handlers/gestureHandlerTypesCompat.ts +16 -30
  387. package/src/handlers/gestures/GestureDetector/Wrap.tsx +1 -1
  388. package/src/handlers/gestures/GestureDetector/attachHandlers.ts +4 -7
  389. package/src/handlers/gestures/GestureDetector/dropHandlers.ts +1 -1
  390. package/src/handlers/gestures/GestureDetector/index.tsx +1 -1
  391. package/src/handlers/gestures/GestureDetector/updateHandlers.ts +20 -30
  392. package/src/handlers/gestures/GestureDetector/useDetectorUpdater.ts +1 -1
  393. package/src/handlers/gestures/GestureDetector/utils.ts +5 -5
  394. package/src/handlers/gestures/flingGesture.ts +2 -4
  395. package/src/handlers/gestures/forceTouchGesture.ts +2 -4
  396. package/src/handlers/gestures/gesture.ts +17 -15
  397. package/src/handlers/gestures/gestureComposition.ts +5 -5
  398. package/src/handlers/gestures/gestureStateManager.ts +1 -1
  399. package/src/handlers/gestures/longPressGesture.ts +2 -4
  400. package/src/handlers/gestures/nativeGesture.ts +2 -4
  401. package/src/handlers/gestures/panGesture.ts +2 -4
  402. package/src/handlers/gestures/pinchGesture.ts +1 -1
  403. package/src/handlers/gestures/rotationGesture.ts +1 -1
  404. package/src/handlers/gestures/tapGesture.ts +2 -4
  405. package/src/handlers/getNextHandlerTag.ts +5 -0
  406. package/src/handlers/handlersRegistry.ts +0 -6
  407. package/src/handlers/utils.ts +75 -0
  408. package/src/index.ts +25 -36
  409. package/src/init.ts +1 -1
  410. package/src/jestUtils/jestUtils.ts +12 -10
  411. package/src/mocks.ts +2 -2
  412. package/src/utils.ts +1 -1
  413. package/src/web/Gestures.ts +1 -1
  414. package/src/web/detectors/RotationGestureDetector.ts +1 -1
  415. package/src/web/detectors/ScaleGestureDetector.ts +4 -4
  416. package/src/web/handlers/FlingGestureHandler.ts +1 -1
  417. package/src/web/handlers/GestureHandler.ts +8 -14
  418. package/src/web/handlers/NativeViewGestureHandler.ts +3 -3
  419. package/src/web/handlers/PanGestureHandler.ts +1 -1
  420. package/src/web/handlers/TapGestureHandler.ts +1 -1
  421. package/src/web/tools/EventManager.ts +2 -2
  422. package/src/web/tools/GestureHandlerWebDelegate.ts +3 -8
  423. package/src/web/tools/LeastSquareSolver.ts +18 -18
  424. package/src/web/tools/PointerEventManager.ts +2 -2
  425. package/src/web/tools/PointerTracker.ts +2 -1
  426. package/src/web/tools/TouchEventManager.ts +4 -4
  427. package/src/web/tools/VelocityTracker.ts +6 -6
  428. package/src/web_hammer/NodeManager.ts +2 -11
@@ -69,17 +69,17 @@ class Matrix {
69
69
  }
70
70
  }
71
71
 
72
- /// An nth degree polynomial fit to a dataset.
72
+ // An nth degree polynomial fit to a dataset.
73
73
  class PolynomialFit {
74
- /// The polynomial coefficients of the fit.
75
- ///
76
- /// For each `i`, the element `coefficients[i]` is the coefficient of
77
- /// the `i`-th power of the variable.
74
+ // The polynomial coefficients of the fit.
75
+ //
76
+ // For each `i`, the element `coefficients[i]` is the coefficient of
77
+ // the `i`-th power of the variable.
78
78
  public coefficients: number[];
79
79
 
80
- /// Creates a polynomial fit of the given degree.
81
- ///
82
- /// There are n + 1 coefficients in a fit of degree n.
80
+ // Creates a polynomial fit of the given degree.
81
+ //
82
+ // There are n + 1 coefficients in a fit of degree n.
83
83
  constructor(degree: number) {
84
84
  this.coefficients = new Array<number>(degree + 1);
85
85
  }
@@ -87,27 +87,27 @@ class PolynomialFit {
87
87
 
88
88
  const precisionErrorTolerance = 1e-10;
89
89
 
90
- /// Uses the least-squares algorithm to fit a polynomial to a set of data.
90
+ // Uses the least-squares algorithm to fit a polynomial to a set of data.
91
91
  export default class LeastSquareSolver {
92
- /// The x-coordinates of each data point.
92
+ // The x-coordinates of each data point.
93
93
  private x: number[];
94
- /// The y-coordinates of each data point.
94
+ // The y-coordinates of each data point.
95
95
  private y: number[];
96
- /// The weight to use for each data point.
96
+ // The weight to use for each data point.
97
97
  private w: number[];
98
98
 
99
- /// Creates a least-squares solver.
100
- ///
101
- /// The [x], [y], and [w] arguments must not be null.
99
+ // Creates a least-squares solver.
100
+ //
101
+ // The [x], [y], and [w] arguments must not be null.
102
102
  constructor(x: number[], y: number[], w: number[]) {
103
103
  this.x = x;
104
104
  this.y = y;
105
105
  this.w = w;
106
106
  }
107
107
 
108
- /// Fits a polynomial of the given degree to the data points.
109
- ///
110
- /// When there is not enough data to fit a curve null is returned.
108
+ // Fits a polynomial of the given degree to the data points.
109
+ //
110
+ // When there is not enough data to fit a curve null is returned.
111
111
  public solve(degree: number): PolynomialFit | null {
112
112
  if (degree > this.x.length) {
113
113
  // Not enough data to fit a curve.
@@ -197,8 +197,8 @@ export default class PointerEventManager extends EventManager<HTMLElement> {
197
197
  const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.CANCEL);
198
198
 
199
199
  if (this.trackedPointers.has(adaptedEvent.pointerId)) {
200
- // in some cases the `pointerup` event is not fired, but `lostpointercapture` is
201
- // we simulate the `pointercancel` event here to make sure the gesture handler stops tracking it
200
+ // In some cases the `pointerup` event is not fired, but `lostpointercapture` is.
201
+ // Here we simulate the `pointercancel` event to make sure the gesture handler stops tracking it.
202
202
  this.onPointerCancel(adaptedEvent);
203
203
 
204
204
  this.activePointersCounter = 0;
@@ -86,7 +86,7 @@ export default class PointerTracker {
86
86
  this.cachedRelativeAverages = this.getRelativeCoordsAverage();
87
87
  }
88
88
 
89
- //Mapping TouchEvents ID
89
+ // Mapping TouchEvents ID
90
90
  private mapTouchEventId(id: number): void {
91
91
  for (const [mappedId, touchId] of this.touchEventsIds) {
92
92
  if (isNaN(touchId)) {
@@ -156,6 +156,7 @@ export default class PointerTracker {
156
156
  // This may happen when pointers have already been removed from tracker (i.e. pointerup event).
157
157
  // In situation when NaN would be sent as a response, we return cached value.
158
158
  // That prevents handlers from crashing
159
+
159
160
  public getAbsoluteCoordsAverage() {
160
161
  const coordsSum = this.getAbsoluteCoordsSum();
161
162
 
@@ -20,7 +20,7 @@ export default class TouchEventManager extends EventManager<HTMLElement> {
20
20
  x: adaptedEvent.x,
21
21
  y: adaptedEvent.y,
22
22
  }) ||
23
- //@ts-ignore touchType field does exist
23
+ // @ts-ignore touchType field does exist
24
24
  event.changedTouches[i].touchType === 'stylus'
25
25
  ) {
26
26
  continue;
@@ -45,7 +45,7 @@ export default class TouchEventManager extends EventManager<HTMLElement> {
45
45
  i,
46
46
  TouchEventType.MOVE
47
47
  );
48
- //@ts-ignore touchType field does exist
48
+ // @ts-ignore touchType field does exist
49
49
  if (event.changedTouches[i].touchType === 'stylus') {
50
50
  continue;
51
51
  }
@@ -89,7 +89,7 @@ export default class TouchEventManager extends EventManager<HTMLElement> {
89
89
  break;
90
90
  }
91
91
 
92
- //@ts-ignore touchType field does exist
92
+ // @ts-ignore touchType field does exist
93
93
  if (event.changedTouches[i].touchType === 'stylus') {
94
94
  continue;
95
95
  }
@@ -121,7 +121,7 @@ export default class TouchEventManager extends EventManager<HTMLElement> {
121
121
  TouchEventType.CANCELLED
122
122
  );
123
123
 
124
- //@ts-ignore touchType field does exist
124
+ // @ts-ignore touchType field does exist
125
125
  if (event.changedTouches[i].touchType === 'stylus') {
126
126
  continue;
127
127
  }
@@ -18,12 +18,12 @@ export default class VelocityTracker {
18
18
  this.samples.push(event);
19
19
  }
20
20
 
21
- /// Returns an estimate of the velocity of the object being tracked by the
22
- /// tracker given the current information available to the tracker.
23
- ///
24
- /// Information is added using [addPosition].
25
- ///
26
- /// Returns null if there is no data on which to base an estimate.
21
+ // Returns an estimate of the velocity of the object being tracked by the
22
+ // tracker given the current information available to the tracker.
23
+ //
24
+ // Information is added using [addPosition].
25
+ //
26
+ // Returns null if there is no data on which to base an estimate.
27
27
  private getVelocityEstimate(): [number, number] | null {
28
28
  const x = [];
29
29
  const y = [];
@@ -1,10 +1,4 @@
1
- import { ValueOf } from '../typeUtils';
2
- import { HammerGestures } from '../web/Gestures';
3
-
4
- const gestures: Record<
5
- number,
6
- InstanceType<ValueOf<typeof HammerGestures>>
7
- > = {};
1
+ export const gestures: Record<number, any> = {};
8
2
 
9
3
  export function getHandler(tag: number) {
10
4
  if (tag in gestures) {
@@ -14,10 +8,7 @@ export function getHandler(tag: number) {
14
8
  throw new Error(`No handler for tag ${tag}`);
15
9
  }
16
10
 
17
- export function createGestureHandler(
18
- handlerTag: number,
19
- handler: InstanceType<ValueOf<typeof HammerGestures>>
20
- ) {
11
+ export function createGestureHandler(handlerTag: number, handler: any) {
21
12
  if (handlerTag in gestures) {
22
13
  throw new Error(`Handler with tag ${handlerTag} already exists`);
23
14
  }