react-native-gesture-handler 2.16.0-rc.0 → 2.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (399) hide show
  1. package/README.md +1 -0
  2. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -0
  3. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +9 -0
  4. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +3 -0
  5. package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +2 -2
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/DiagonalDirections.kt +8 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +61 -24
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +17 -22
  9. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +30 -11
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +3 -0
  11. package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +66 -0
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +119 -19
  13. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +2 -2
  14. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +1 -4
  15. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +4 -2
  16. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +1 -1
  17. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +1 -4
  18. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +4 -7
  19. package/apple/Handlers/RNLongPressHandler.m +5 -13
  20. package/apple/Handlers/RNPinchHandler.m +12 -1
  21. package/apple/RNGestureHandler.m +3 -1
  22. package/lib/commonjs/Directions.js +19 -6
  23. package/lib/commonjs/Directions.js.map +1 -1
  24. package/lib/commonjs/RNGestureHandlerModule.js +97 -4
  25. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  26. package/lib/commonjs/RNGestureHandlerModule.native.js +16 -0
  27. package/lib/commonjs/RNGestureHandlerModule.native.js.map +1 -0
  28. package/lib/commonjs/RNRenderer.js +5 -10
  29. package/lib/commonjs/RNRenderer.js.map +1 -1
  30. package/lib/commonjs/RNRenderer.native.js +16 -0
  31. package/lib/commonjs/RNRenderer.native.js.map +1 -0
  32. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  33. package/lib/commonjs/components/GestureComponents.js +19 -82
  34. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  35. package/lib/commonjs/components/GestureComponents.native.js +115 -0
  36. package/lib/commonjs/components/GestureComponents.native.js.map +1 -0
  37. package/lib/commonjs/components/GestureHandlerButton.js +13 -3
  38. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  39. package/lib/commonjs/components/GestureHandlerButton.native.js +14 -0
  40. package/lib/commonjs/components/GestureHandlerButton.native.js.map +1 -0
  41. package/lib/commonjs/components/GestureHandlerRootView.js +0 -6
  42. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  43. package/lib/commonjs/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +7 -1
  44. package/lib/commonjs/components/GestureHandlerRootView.native.js.map +1 -0
  45. package/lib/commonjs/components/Swipeable.js +3 -1
  46. package/lib/commonjs/components/Swipeable.js.map +1 -1
  47. package/lib/commonjs/components/touchables/GenericTouchable.js +1 -0
  48. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  49. package/lib/commonjs/getReactNativeVersion.js +1 -12
  50. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  51. package/lib/commonjs/getReactNativeVersion.native.js +22 -0
  52. package/lib/commonjs/getReactNativeVersion.native.js.map +1 -0
  53. package/lib/commonjs/getShadowNodeFromRef.js +5 -34
  54. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  55. package/lib/commonjs/getShadowNodeFromRef.native.js +44 -0
  56. package/lib/commonjs/getShadowNodeFromRef.native.js.map +1 -0
  57. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  58. package/lib/commonjs/handlers/PressabilityDebugView.js +5 -7
  59. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  60. package/lib/commonjs/handlers/PressabilityDebugView.native.js +14 -0
  61. package/lib/commonjs/handlers/PressabilityDebugView.native.js.map +1 -0
  62. package/lib/commonjs/handlers/createHandler.js +11 -5
  63. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  64. package/lib/commonjs/handlers/customDirectEventTypes.js +11 -0
  65. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -0
  66. package/lib/commonjs/handlers/customDirectEventTypes.native.js +14 -0
  67. package/lib/commonjs/handlers/customDirectEventTypes.native.js.map +1 -0
  68. package/lib/commonjs/handlers/gestureHandlerCommon.js +13 -2
  69. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  70. package/lib/commonjs/handlers/gestures/GestureDetector.js +25 -0
  71. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  72. package/lib/commonjs/handlers/gestures/flingGesture.js +13 -0
  73. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  74. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +17 -0
  75. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  76. package/lib/commonjs/handlers/gestures/gesture.js +135 -0
  77. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  78. package/lib/commonjs/handlers/gestures/gestureObjects.js +66 -0
  79. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  80. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +1 -1
  81. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  82. package/lib/commonjs/handlers/gestures/hoverGesture.js +1 -1
  83. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  84. package/lib/commonjs/handlers/gestures/longPressGesture.js +12 -0
  85. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  86. package/lib/commonjs/handlers/gestures/nativeGesture.js +10 -0
  87. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  88. package/lib/commonjs/handlers/gestures/panGesture.js +76 -0
  89. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  90. package/lib/commonjs/handlers/gestures/tapGesture.js +42 -0
  91. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  92. package/lib/commonjs/index.js +8 -8
  93. package/lib/commonjs/index.js.map +1 -1
  94. package/lib/commonjs/mocks.js +2 -0
  95. package/lib/commonjs/mocks.js.map +1 -1
  96. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  97. package/lib/commonjs/utils.js +5 -1
  98. package/lib/commonjs/utils.js.map +1 -1
  99. package/lib/commonjs/web/Gestures.js +66 -0
  100. package/lib/commonjs/web/Gestures.js.map +1 -0
  101. package/lib/commonjs/web/constants.js +3 -8
  102. package/lib/commonjs/web/constants.js.map +1 -1
  103. package/lib/commonjs/web/handlers/FlingGestureHandler.js +36 -12
  104. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  105. package/lib/commonjs/web/handlers/GestureHandler.js +11 -9
  106. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  107. package/lib/commonjs/web/handlers/IGestureHandler.js +2 -0
  108. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -0
  109. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +5 -6
  110. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  111. package/lib/commonjs/web/handlers/PanGestureHandler.js +3 -1
  112. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  113. package/lib/commonjs/web/interfaces.js +1 -13
  114. package/lib/commonjs/web/interfaces.js.map +1 -1
  115. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  116. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +114 -115
  117. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  118. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +10 -5
  119. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  120. package/lib/commonjs/web/tools/InteractionManager.js +12 -3
  121. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  122. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  123. package/lib/commonjs/web/tools/PointerEventManager.js +55 -27
  124. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  125. package/lib/commonjs/web/tools/TouchEventManager.js +26 -5
  126. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  127. package/lib/commonjs/web/tools/Vector.js +58 -0
  128. package/lib/commonjs/web/tools/Vector.js.map +1 -0
  129. package/lib/commonjs/web/utils.js +9 -1
  130. package/lib/commonjs/web/utils.js.map +1 -1
  131. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  132. package/lib/module/Directions.js +16 -4
  133. package/lib/module/Directions.js.map +1 -1
  134. package/lib/module/RNGestureHandlerModule.js +84 -4
  135. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  136. package/lib/module/RNGestureHandlerModule.native.js +5 -0
  137. package/lib/module/RNGestureHandlerModule.native.js.map +1 -0
  138. package/lib/module/RNRenderer.js +3 -3
  139. package/lib/module/RNRenderer.js.map +1 -1
  140. package/lib/module/RNRenderer.native.js +4 -0
  141. package/lib/module/RNRenderer.native.js.map +1 -0
  142. package/lib/module/components/DrawerLayout.js.map +1 -1
  143. package/lib/module/components/GestureComponents.js +18 -80
  144. package/lib/module/components/GestureComponents.js.map +1 -1
  145. package/lib/module/components/GestureComponents.native.js +90 -0
  146. package/lib/module/components/GestureComponents.native.js.map +1 -0
  147. package/lib/module/components/GestureHandlerButton.js +8 -2
  148. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  149. package/lib/module/components/GestureHandlerButton.native.js +3 -0
  150. package/lib/module/components/GestureHandlerButton.native.js.map +1 -0
  151. package/lib/module/components/GestureHandlerRootView.js +0 -5
  152. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  153. package/lib/module/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +6 -1
  154. package/lib/module/components/GestureHandlerRootView.native.js.map +1 -0
  155. package/lib/module/components/Swipeable.js +3 -1
  156. package/lib/module/components/Swipeable.js.map +1 -1
  157. package/lib/module/components/touchables/GenericTouchable.js +1 -0
  158. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  159. package/lib/module/getReactNativeVersion.js +1 -7
  160. package/lib/module/getReactNativeVersion.js.map +1 -1
  161. package/lib/module/getReactNativeVersion.native.js +10 -0
  162. package/lib/module/getReactNativeVersion.native.js.map +1 -0
  163. package/lib/module/getShadowNodeFromRef.js +4 -33
  164. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  165. package/lib/module/getShadowNodeFromRef.native.js +37 -0
  166. package/lib/module/getShadowNodeFromRef.native.js.map +1 -0
  167. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  168. package/lib/module/handlers/PressabilityDebugView.js +4 -2
  169. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  170. package/lib/module/handlers/PressabilityDebugView.native.js +3 -0
  171. package/lib/module/handlers/PressabilityDebugView.native.js.map +1 -0
  172. package/lib/module/handlers/createHandler.js +11 -6
  173. package/lib/module/handlers/createHandler.js.map +1 -1
  174. package/lib/module/handlers/customDirectEventTypes.js +5 -0
  175. package/lib/module/handlers/customDirectEventTypes.js.map +1 -0
  176. package/lib/module/handlers/customDirectEventTypes.native.js +3 -0
  177. package/lib/module/handlers/customDirectEventTypes.native.js.map +1 -0
  178. package/lib/module/handlers/gestureHandlerCommon.js +11 -1
  179. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  180. package/lib/module/handlers/gestures/GestureDetector.js +25 -0
  181. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  182. package/lib/module/handlers/gestures/flingGesture.js +13 -0
  183. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  184. package/lib/module/handlers/gestures/forceTouchGesture.js +17 -0
  185. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  186. package/lib/module/handlers/gestures/gesture.js +135 -0
  187. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  188. package/lib/module/handlers/gestures/gestureObjects.js +67 -0
  189. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  190. package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -1
  191. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  192. package/lib/module/handlers/gestures/hoverGesture.js +1 -1
  193. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  194. package/lib/module/handlers/gestures/longPressGesture.js +12 -0
  195. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  196. package/lib/module/handlers/gestures/nativeGesture.js +10 -0
  197. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  198. package/lib/module/handlers/gestures/panGesture.js +76 -0
  199. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  200. package/lib/module/handlers/gestures/tapGesture.js +42 -0
  201. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  202. package/lib/module/index.js +1 -1
  203. package/lib/module/index.js.map +1 -1
  204. package/lib/module/mocks.js +2 -0
  205. package/lib/module/mocks.js.map +1 -1
  206. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  207. package/lib/module/utils.js +5 -1
  208. package/lib/module/utils.js.map +1 -1
  209. package/lib/module/web/Gestures.js +39 -0
  210. package/lib/module/web/Gestures.js.map +1 -0
  211. package/lib/module/web/constants.js +1 -6
  212. package/lib/module/web/constants.js.map +1 -1
  213. package/lib/module/web/handlers/FlingGestureHandler.js +34 -12
  214. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  215. package/lib/module/web/handlers/GestureHandler.js +10 -9
  216. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  217. package/lib/module/web/handlers/IGestureHandler.js +2 -0
  218. package/lib/module/web/handlers/IGestureHandler.js.map +1 -0
  219. package/lib/module/web/handlers/NativeViewGestureHandler.js +5 -6
  220. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  221. package/lib/module/web/handlers/PanGestureHandler.js +3 -1
  222. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  223. package/lib/module/web/interfaces.js +0 -11
  224. package/lib/module/web/interfaces.js.map +1 -1
  225. package/lib/module/web/tools/EventManager.js.map +1 -1
  226. package/lib/module/web/tools/GestureHandlerOrchestrator.js +114 -115
  227. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  228. package/lib/module/web/tools/GestureHandlerWebDelegate.js +9 -4
  229. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  230. package/lib/module/web/tools/InteractionManager.js +9 -3
  231. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  232. package/lib/module/web/tools/NodeManager.js.map +1 -1
  233. package/lib/module/web/tools/PointerEventManager.js +53 -26
  234. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  235. package/lib/module/web/tools/TouchEventManager.js +26 -5
  236. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  237. package/lib/module/web/tools/Vector.js +47 -0
  238. package/lib/module/web/tools/Vector.js.map +1 -0
  239. package/lib/module/web/utils.js +2 -0
  240. package/lib/module/web/utils.js.map +1 -1
  241. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  242. package/lib/typescript/Directions.d.ts +7 -0
  243. package/lib/typescript/RNGestureHandlerModule.d.ts +15 -2
  244. package/lib/typescript/RNGestureHandlerModule.native.d.ts +2 -0
  245. package/lib/typescript/RNRenderer.d.ts +3 -1
  246. package/lib/typescript/RNRenderer.native.d.ts +1 -0
  247. package/lib/typescript/components/DrawerLayout.d.ts +1 -2
  248. package/lib/typescript/components/GestureComponents.d.ts +7 -21
  249. package/lib/typescript/components/GestureComponents.native.d.ts +22 -0
  250. package/lib/typescript/components/GestureHandlerButton.d.ts +3 -3
  251. package/lib/typescript/components/GestureHandlerButton.native.d.ts +4 -0
  252. package/lib/typescript/components/touchables/GenericTouchable.d.ts +2 -1
  253. package/lib/typescript/getReactNativeVersion.d.ts +1 -4
  254. package/lib/typescript/getReactNativeVersion.native.d.ts +4 -0
  255. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -1
  256. package/lib/typescript/getShadowNodeFromRef.native.d.ts +1 -0
  257. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  258. package/lib/typescript/handlers/PanGestureHandler.d.ts +4 -4
  259. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -1
  260. package/lib/typescript/handlers/PressabilityDebugView.native.d.ts +1 -0
  261. package/lib/typescript/handlers/customDirectEventTypes.d.ts +2 -0
  262. package/lib/typescript/handlers/customDirectEventTypes.native.d.ts +1 -0
  263. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +11 -2
  264. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +38 -1
  265. package/lib/typescript/handlers/gestures/flingGesture.d.ts +11 -0
  266. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +14 -0
  267. package/lib/typescript/handlers/gestures/gesture.d.ts +114 -2
  268. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +57 -0
  269. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +1 -1
  270. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +10 -0
  271. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +8 -0
  272. package/lib/typescript/handlers/gestures/panGesture.d.ts +67 -4
  273. package/lib/typescript/handlers/gestures/tapGesture.d.ts +35 -0
  274. package/lib/typescript/index.d.ts +1 -1
  275. package/lib/typescript/mocks.d.ts +1 -0
  276. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +4 -1
  277. package/lib/typescript/web/Gestures.d.ts +36 -0
  278. package/lib/typescript/web/constants.d.ts +1 -6
  279. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +3 -3
  280. package/lib/typescript/web/handlers/GestureHandler.d.ts +13 -11
  281. package/lib/typescript/web/handlers/IGestureHandler.d.ts +38 -0
  282. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -0
  283. package/lib/typescript/web/interfaces.d.ts +8 -10
  284. package/lib/typescript/web/tools/EventManager.d.ts +15 -12
  285. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +3 -4
  286. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +7 -5
  287. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -3
  288. package/lib/typescript/web/tools/InteractionManager.d.ts +6 -6
  289. package/lib/typescript/web/tools/NodeManager.d.ts +4 -3
  290. package/lib/typescript/web/tools/PointerEventManager.d.ts +11 -2
  291. package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -1
  292. package/lib/typescript/web/tools/Vector.d.ts +15 -0
  293. package/lib/typescript/web/utils.d.ts +4 -4
  294. package/lib/typescript/web_hammer/NodeManager.d.ts +1 -1
  295. package/package.json +4 -2
  296. package/src/Directions.ts +21 -4
  297. package/src/RNGestureHandlerModule.native.ts +5 -0
  298. package/src/RNGestureHandlerModule.ts +104 -4
  299. package/src/RNRenderer.native.ts +3 -0
  300. package/src/RNRenderer.ts +3 -3
  301. package/src/components/DrawerLayout.tsx +1 -1
  302. package/src/components/GestureComponents.native.tsx +148 -0
  303. package/src/components/GestureComponents.tsx +24 -131
  304. package/src/components/GestureHandlerButton.native.tsx +5 -0
  305. package/src/components/GestureHandlerButton.tsx +5 -4
  306. package/src/components/{GestureHandlerRootView.web.tsx → GestureHandlerRootView.native.tsx} +6 -0
  307. package/src/components/GestureHandlerRootView.tsx +0 -6
  308. package/src/components/Swipeable.tsx +2 -0
  309. package/src/components/touchables/GenericTouchable.tsx +3 -0
  310. package/src/getReactNativeVersion.native.ts +11 -0
  311. package/src/getReactNativeVersion.ts +1 -9
  312. package/src/getShadowNodeFromRef.native.ts +44 -0
  313. package/src/getShadowNodeFromRef.ts +4 -41
  314. package/src/handlers/PanGestureHandler.ts +8 -4
  315. package/src/handlers/PressabilityDebugView.native.tsx +2 -0
  316. package/src/handlers/PressabilityDebugView.tsx +4 -2
  317. package/src/handlers/createHandler.tsx +24 -14
  318. package/src/handlers/customDirectEventTypes.native.ts +2 -0
  319. package/src/handlers/customDirectEventTypes.ts +5 -0
  320. package/src/handlers/gestureHandlerCommon.ts +28 -1
  321. package/src/handlers/gestures/GestureDetector.tsx +62 -4
  322. package/src/handlers/gestures/flingGesture.ts +11 -0
  323. package/src/handlers/gestures/forceTouchGesture.ts +14 -0
  324. package/src/handlers/gestures/gesture.ts +114 -1
  325. package/src/handlers/gestures/gestureObjects.ts +57 -0
  326. package/src/handlers/gestures/gestureStateManager.web.ts +1 -1
  327. package/src/handlers/gestures/hoverGesture.ts +1 -1
  328. package/src/handlers/gestures/longPressGesture.ts +10 -0
  329. package/src/handlers/gestures/nativeGesture.ts +8 -0
  330. package/src/handlers/gestures/panGesture.ts +75 -4
  331. package/src/handlers/gestures/tapGesture.ts +35 -0
  332. package/src/index.ts +1 -1
  333. package/src/mocks.ts +2 -0
  334. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +4 -0
  335. package/src/utils.ts +9 -2
  336. package/src/web/Gestures.ts +41 -0
  337. package/src/web/constants.ts +1 -7
  338. package/src/web/handlers/FlingGestureHandler.ts +54 -24
  339. package/src/web/handlers/GestureHandler.ts +23 -19
  340. package/src/web/handlers/IGestureHandler.ts +50 -0
  341. package/src/web/handlers/NativeViewGestureHandler.ts +5 -6
  342. package/src/web/handlers/PanGestureHandler.ts +4 -0
  343. package/src/web/interfaces.ts +14 -10
  344. package/src/web/tools/EventManager.ts +16 -14
  345. package/src/web/tools/GestureHandlerDelegate.ts +3 -4
  346. package/src/web/tools/GestureHandlerOrchestrator.ts +160 -145
  347. package/src/web/tools/GestureHandlerWebDelegate.ts +14 -9
  348. package/src/web/tools/InteractionManager.ts +18 -12
  349. package/src/web/tools/NodeManager.ts +4 -3
  350. package/src/web/tools/PointerEventManager.ts +181 -166
  351. package/src/web/tools/TouchEventManager.ts +126 -114
  352. package/src/web/tools/Vector.ts +60 -0
  353. package/src/web/utils.ts +7 -4
  354. package/src/web_hammer/NodeManager.ts +1 -1
  355. package/lib/commonjs/RNGestureHandlerModule.web.js +0 -163
  356. package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
  357. package/lib/commonjs/RNRenderer.web.js +0 -11
  358. package/lib/commonjs/RNRenderer.web.js.map +0 -1
  359. package/lib/commonjs/components/GestureComponents.web.js +0 -52
  360. package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
  361. package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
  362. package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
  363. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
  364. package/lib/commonjs/getReactNativeVersion.web.js +0 -11
  365. package/lib/commonjs/getReactNativeVersion.web.js.map +0 -1
  366. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
  367. package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
  368. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
  369. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
  370. package/lib/module/RNGestureHandlerModule.web.js +0 -122
  371. package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
  372. package/lib/module/RNRenderer.web.js +0 -4
  373. package/lib/module/RNRenderer.web.js.map +0 -1
  374. package/lib/module/components/GestureComponents.web.js +0 -28
  375. package/lib/module/components/GestureComponents.web.js.map +0 -1
  376. package/lib/module/components/GestureHandlerButton.web.js +0 -9
  377. package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
  378. package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
  379. package/lib/module/getReactNativeVersion.web.js +0 -4
  380. package/lib/module/getReactNativeVersion.web.js.map +0 -1
  381. package/lib/module/getShadowNodeFromRef.web.js +0 -8
  382. package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
  383. package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
  384. package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
  385. package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -50
  386. package/lib/typescript/RNRenderer.web.d.ts +0 -3
  387. package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
  388. package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
  389. package/lib/typescript/getReactNativeVersion.web.d.ts +0 -1
  390. package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
  391. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
  392. package/src/RNGestureHandlerModule.web.ts +0 -146
  393. package/src/RNRenderer.web.ts +0 -3
  394. package/src/components/GestureComponents.web.tsx +0 -41
  395. package/src/components/GestureHandlerButton.web.tsx +0 -6
  396. package/src/getReactNativeVersion.web.ts +0 -3
  397. package/src/getShadowNodeFromRef.web.ts +0 -7
  398. package/src/handlers/PressabilityDebugView.web.tsx +0 -4
  399. /package/lib/typescript/components/{GestureHandlerRootView.web.d.ts → GestureHandlerRootView.native.d.ts} +0 -0
@@ -18,36 +18,78 @@ class TapGesture extends _gesture.BaseGesture {
18
18
  this.handlerName = 'TapGestureHandler';
19
19
  this.shouldCancelWhenOutside(true);
20
20
  }
21
+ /**
22
+ * Minimum number of pointers (fingers) required to be placed before the gesture activates.
23
+ * Should be a positive integer. The default value is 1.
24
+ * @param minPointers
25
+ */
26
+
21
27
 
22
28
  minPointers(minPointers) {
23
29
  this.config.minPointers = minPointers;
24
30
  return this;
25
31
  }
32
+ /**
33
+ * Number of tap gestures required to activate the gesture.
34
+ * The default value is 1.
35
+ * @param count
36
+ */
37
+
26
38
 
27
39
  numberOfTaps(count) {
28
40
  this.config.numberOfTaps = count;
29
41
  return this;
30
42
  }
43
+ /**
44
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.
45
+ * @param maxDist
46
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number
47
+ */
48
+
31
49
 
32
50
  maxDistance(maxDist) {
33
51
  this.config.maxDist = maxDist;
34
52
  return this;
35
53
  }
54
+ /**
55
+ * Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.
56
+ * The default value is 500.
57
+ * @param duration
58
+ */
59
+
36
60
 
37
61
  maxDuration(duration) {
38
62
  this.config.maxDurationMs = duration;
39
63
  return this;
40
64
  }
65
+ /**
66
+ * Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.
67
+ * The default value is 500.
68
+ * @param delay
69
+ */
70
+
41
71
 
42
72
  maxDelay(delay) {
43
73
  this.config.maxDelayMs = delay;
44
74
  return this;
45
75
  }
76
+ /**
77
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.
78
+ * @param delta
79
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number
80
+ */
81
+
46
82
 
47
83
  maxDeltaX(delta) {
48
84
  this.config.maxDeltaX = delta;
49
85
  return this;
50
86
  }
87
+ /**
88
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.
89
+ * @param delta
90
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number
91
+ */
92
+
51
93
 
52
94
  maxDeltaY(delta) {
53
95
  this.config.maxDeltaY = delta;
@@ -1 +1 @@
1
- {"version":3,"sources":["tapGesture.ts"],"names":["TapGesture","BaseGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;;;;;;AAAA;;;;AAMO,MAAMA,UAAN,SAAyBC,oBAAzB,CAAoE;AAGzEC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAFwC,EAExC;;AAGZ,SAAKC,WAAL,GAAmB,mBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;;AAEDC,EAAAA,WAAW,CAACA,WAAD,EAAsB;AAC/B,SAAKC,MAAL,CAAYD,WAAZ,GAA0BA,WAA1B;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,YAAY,CAACC,KAAD,EAAgB;AAC1B,SAAKF,MAAL,CAAYC,YAAZ,GAA2BC,KAA3B;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAkB;AAC3B,SAAKJ,MAAL,CAAYI,OAAZ,GAAsBA,OAAtB;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKN,MAAL,CAAYO,aAAZ,GAA4BD,QAA5B;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,QAAQ,CAACC,KAAD,EAAgB;AACtB,SAAKT,MAAL,CAAYU,UAAZ,GAAyBD,KAAzB;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,SAAS,CAACC,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYW,SAAZ,GAAwBC,KAAxB;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,SAAS,CAACD,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYa,SAAZ,GAAwBD,KAAxB;AACA,WAAO,IAAP;AACD;;AA3CwE","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport {\n TapGestureConfig,\n TapGestureHandlerEventPayload,\n} from '../TapGestureHandler';\n\nexport class TapGesture extends BaseGesture<TapGestureHandlerEventPayload> {\n public config: BaseGestureConfig & TapGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'TapGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n numberOfTaps(count: number) {\n this.config.numberOfTaps = count;\n return this;\n }\n\n maxDistance(maxDist: number) {\n this.config.maxDist = maxDist;\n return this;\n }\n\n maxDuration(duration: number) {\n this.config.maxDurationMs = duration;\n return this;\n }\n\n maxDelay(delay: number) {\n this.config.maxDelayMs = delay;\n return this;\n }\n\n maxDeltaX(delta: number) {\n this.config.maxDeltaX = delta;\n return this;\n }\n\n maxDeltaY(delta: number) {\n this.config.maxDeltaY = delta;\n return this;\n }\n}\n\nexport type TapGestureType = InstanceType<typeof TapGesture>;\n"]}
1
+ {"version":3,"sources":["tapGesture.ts"],"names":["TapGesture","BaseGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;;;;;;AAAA;;;;AAMO,MAAMA,UAAN,SAAyBC,oBAAzB,CAAoE;AAGzEC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAFwC,EAExC;;AAGZ,SAAKC,WAAL,GAAmB,mBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACA,WAAD,EAAsB;AAC/B,SAAKC,MAAL,CAAYD,WAAZ,GAA0BA,WAA1B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,YAAY,CAACC,KAAD,EAAgB;AAC1B,SAAKF,MAAL,CAAYC,YAAZ,GAA2BC,KAA3B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,OAAD,EAAkB;AAC3B,SAAKJ,MAAL,CAAYI,OAAZ,GAAsBA,OAAtB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKN,MAAL,CAAYO,aAAZ,GAA4BD,QAA5B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,QAAQ,CAACC,KAAD,EAAgB;AACtB,SAAKT,MAAL,CAAYU,UAAZ,GAAyBD,KAAzB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,SAAS,CAACC,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYW,SAAZ,GAAwBC,KAAxB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,SAAS,CAACD,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYa,SAAZ,GAAwBD,KAAxB;AACA,WAAO,IAAP;AACD;;AA9EwE","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport {\n TapGestureConfig,\n TapGestureHandlerEventPayload,\n} from '../TapGestureHandler';\n\nexport class TapGesture extends BaseGesture<TapGestureHandlerEventPayload> {\n public config: BaseGestureConfig & TapGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'TapGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n /**\n * Minimum number of pointers (fingers) required to be placed before the gesture activates.\n * Should be a positive integer. The default value is 1.\n * @param minPointers\n */\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n /**\n * Number of tap gestures required to activate the gesture.\n * The default value is 1.\n * @param count\n */\n numberOfTaps(count: number) {\n this.config.numberOfTaps = count;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.\n * @param maxDist\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number\n */\n maxDistance(maxDist: number) {\n this.config.maxDist = maxDist;\n return this;\n }\n\n /**\n * Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.\n * The default value is 500.\n * @param duration\n */\n maxDuration(duration: number) {\n this.config.maxDurationMs = duration;\n return this;\n }\n\n /**\n * Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.\n * The default value is 500.\n * @param delay\n */\n maxDelay(delay: number) {\n this.config.maxDelayMs = delay;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.\n * @param delta\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number\n */\n maxDeltaX(delta: number) {\n this.config.maxDeltaX = delta;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.\n * @param delta\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number\n */\n maxDeltaY(delta: number) {\n this.config.maxDeltaY = delta;\n return this;\n }\n}\n\nexport type TapGestureType = InstanceType<typeof TapGesture>;\n"]}
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "State", {
15
15
  return _State.State;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "MouseButton", {
19
- enumerable: true,
20
- get: function () {
21
- return _interfaces.MouseButton;
22
- }
23
- });
24
18
  Object.defineProperty(exports, "PointerType", {
25
19
  enumerable: true,
26
20
  get: function () {
@@ -39,6 +33,12 @@ Object.defineProperty(exports, "GestureHandlerRootView", {
39
33
  return _GestureHandlerRootView.default;
40
34
  }
41
35
  });
36
+ Object.defineProperty(exports, "MouseButton", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _gestureHandlerCommon.MouseButton;
40
+ }
41
+ });
42
42
  Object.defineProperty(exports, "TapGestureHandler", {
43
43
  enumerable: true,
44
44
  get: function () {
@@ -232,14 +232,14 @@ var _Directions = require("./Directions");
232
232
 
233
233
  var _State = require("./State");
234
234
 
235
- var _interfaces = require("./web/interfaces");
236
-
237
235
  var _PointerType = require("./PointerType");
238
236
 
239
237
  var _gestureHandlerRootHOC = _interopRequireDefault(require("./components/gestureHandlerRootHOC"));
240
238
 
241
239
  var _GestureHandlerRootView = _interopRequireDefault(require("./components/GestureHandlerRootView"));
242
240
 
241
+ var _gestureHandlerCommon = require("./handlers/gestureHandlerCommon");
242
+
243
243
  var _TapGestureHandler = require("./handlers/TapGestureHandler");
244
244
 
245
245
  var _ForceTouchGestureHandler = require("./handlers/ForceTouchGestureHandler");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA+CA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAkBA;;AAOA;;AAYA;;AAMA;;AAQA;;AAyCA;;AASA;;AAEA;;;;AAKA","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { MouseButton } from './web/interfaces';\nexport { PointerType } from './PointerType';\nexport { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './components/GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PureNativeButton,\n} from './components/GestureButtons';\nexport type {\n TouchableHighlightProps,\n TouchableOpacityProps,\n TouchableWithoutFeedbackProps,\n} from './components/touchables';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n RefreshControl,\n} from './components/GestureComponents';\nexport { HoverEffect } from './handlers/gestures/hoverGesture';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport type { SwipeableProps } from './components/Swipeable';\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\nexport {\n enableExperimentalWebImplementation,\n enableLegacyWebImplementation,\n} from './EnableNewWebImplementation';\n\ninitialize();\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAeA;;AAiCA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAkBA;;AAOA;;AAYA;;AAMA;;AAQA;;AAyCA;;AASA;;AAEA;;;;AAKA","sourcesContent":["import { initialize } from './init';\n\nexport { Directions } from './Directions';\nexport { State } from './State';\nexport { PointerType } from './PointerType';\nexport { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';\nexport { default as GestureHandlerRootView } from './components/GestureHandlerRootView';\nexport type {\n // event types\n GestureEvent,\n HandlerStateChangeEvent,\n // event payloads types\n GestureEventPayload,\n HandlerStateChangeEventPayload,\n // pointer events\n GestureTouchEvent,\n TouchData,\n // new api event types\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from './handlers/gestureHandlerCommon';\nexport { MouseButton } from './handlers/gestureHandlerCommon';\nexport type { GestureType } from './handlers/gestures/gesture';\nexport type {\n TapGestureHandlerEventPayload,\n TapGestureHandlerProps,\n} from './handlers/TapGestureHandler';\nexport type {\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureHandlerProps,\n} from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type {\n LongPressGestureHandlerEventPayload,\n LongPressGestureHandlerProps,\n} from './handlers/LongPressGestureHandler';\nexport type {\n PanGestureHandlerEventPayload,\n PanGestureHandlerProps,\n} from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type {\n PinchGestureHandlerEventPayload,\n PinchGestureHandlerProps,\n} from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type {\n RotationGestureHandlerEventPayload,\n RotationGestureHandlerProps,\n} from './handlers/RotationGestureHandler';\nexport type {\n FlingGestureHandlerEventPayload,\n FlingGestureHandlerProps,\n} from './handlers/FlingGestureHandler';\nexport { TapGestureHandler } from './handlers/TapGestureHandler';\nexport { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';\nexport { LongPressGestureHandler } from './handlers/LongPressGestureHandler';\nexport { PanGestureHandler } from './handlers/PanGestureHandler';\nexport { PinchGestureHandler } from './handlers/PinchGestureHandler';\nexport { RotationGestureHandler } from './handlers/RotationGestureHandler';\nexport { FlingGestureHandler } from './handlers/FlingGestureHandler';\nexport { default as createNativeWrapper } from './handlers/createNativeWrapper';\nexport type {\n NativeViewGestureHandlerPayload,\n NativeViewGestureHandlerProps,\n} from './handlers/NativeViewGestureHandler';\nexport { GestureDetector } from './handlers/gestures/GestureDetector';\nexport { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';\nexport type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';\nexport type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';\nexport type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';\nexport type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';\nexport type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';\nexport type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';\nexport type { NativeGestureType as NativeGesture } from './handlers/gestures/nativeGesture';\nexport type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';\nexport type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture';\nexport type {\n ComposedGestureType as ComposedGesture,\n RaceGestureType as RaceGesture,\n SimultaneousGestureType as SimultaneousGesture,\n ExclusiveGestureType as ExclusiveGesture,\n} from './handlers/gestures/gestureComposition';\nexport type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';\nexport { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';\nexport type {\n RawButtonProps,\n BaseButtonProps,\n RectButtonProps,\n BorderlessButtonProps,\n} from './components/GestureButtons';\nexport {\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PureNativeButton,\n} from './components/GestureButtons';\nexport type {\n TouchableHighlightProps,\n TouchableOpacityProps,\n TouchableWithoutFeedbackProps,\n} from './components/touchables';\nexport {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n} from './components/touchables';\nexport {\n ScrollView,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n FlatList,\n RefreshControl,\n} from './components/GestureComponents';\nexport { HoverEffect } from './handlers/gestures/hoverGesture';\nexport type {\n //events\n GestureHandlerGestureEvent,\n GestureHandlerStateChangeEvent,\n //event payloads\n GestureHandlerGestureEventNativeEvent,\n GestureHandlerStateChangeNativeEvent,\n NativeViewGestureHandlerGestureEvent,\n NativeViewGestureHandlerStateChangeEvent,\n TapGestureHandlerGestureEvent,\n TapGestureHandlerStateChangeEvent,\n ForceTouchGestureHandlerGestureEvent,\n ForceTouchGestureHandlerStateChangeEvent,\n LongPressGestureHandlerGestureEvent,\n LongPressGestureHandlerStateChangeEvent,\n PanGestureHandlerGestureEvent,\n PanGestureHandlerStateChangeEvent,\n PinchGestureHandlerGestureEvent,\n PinchGestureHandlerStateChangeEvent,\n RotationGestureHandlerGestureEvent,\n RotationGestureHandlerStateChangeEvent,\n FlingGestureHandlerGestureEvent,\n FlingGestureHandlerStateChangeEvent,\n // handlers props\n NativeViewGestureHandlerProperties,\n TapGestureHandlerProperties,\n LongPressGestureHandlerProperties,\n PanGestureHandlerProperties,\n PinchGestureHandlerProperties,\n RotationGestureHandlerProperties,\n FlingGestureHandlerProperties,\n ForceTouchGestureHandlerProperties,\n // buttons props\n RawButtonProperties,\n BaseButtonProperties,\n RectButtonProperties,\n BorderlessButtonProperties,\n} from './handlers/gestureHandlerTypesCompat';\n\nexport type { SwipeableProps } from './components/Swipeable';\nexport { default as Swipeable } from './components/Swipeable';\nexport type {\n DrawerLayoutProps,\n DrawerPosition,\n DrawerState,\n DrawerType,\n DrawerLockMode,\n DrawerKeyboardDismissMode,\n} from './components/DrawerLayout';\nexport { default as DrawerLayout } from './components/DrawerLayout';\n\nexport {\n enableExperimentalWebImplementation,\n enableLegacyWebImplementation,\n} from './EnableNewWebImplementation';\n\ninitialize();\n"]}
@@ -20,6 +20,7 @@ const createGestureHandler = NOOP;
20
20
  const dropGestureHandler = NOOP;
21
21
  const updateGestureHandler = NOOP;
22
22
  const flushOperations = NOOP;
23
+ const install = NOOP;
23
24
  const NativeViewGestureHandler = _reactNative.View;
24
25
  const TapGestureHandler = _reactNative.View;
25
26
  const ForceTouchGestureHandler = _reactNative.View;
@@ -58,6 +59,7 @@ var _default = {
58
59
  dropGestureHandler,
59
60
  updateGestureHandler,
60
61
  flushOperations,
62
+ install,
61
63
  // probably can be removed
62
64
  Directions: _Directions.Directions,
63
65
  State: _State.State
@@ -1 +1 @@
1
- {"version":3,"sources":["mocks.ts"],"names":["NOOP","PanGestureHandler","View","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","TouchableNativeFeedback","BaseButton","RectButton","BorderlessButton","TouchableHighlight","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","Directions","State"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAEA,MAAMA,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGC,iBAA1B;AACA,MAAMC,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,oBAAoB,GAAGJ,IAA7B;AACA,MAAMK,kBAAkB,GAAGL,IAA3B;AACA,MAAMM,oBAAoB,GAAGN,IAA7B;AACA,MAAMO,eAAe,GAAGP,IAAxB;AACA,MAAMQ,wBAAwB,GAAGN,iBAAjC;AACA,MAAMO,iBAAiB,GAAGP,iBAA1B;AACA,MAAMQ,wBAAwB,GAAGR,iBAAjC;AACA,MAAMS,uBAAuB,GAAGT,iBAAhC;AACA,MAAMU,mBAAmB,GAAGV,iBAA5B;AACA,MAAMW,sBAAsB,GAAGX,iBAA/B;AACA,MAAMY,mBAAmB,GAAGZ,iBAA5B;AACA,MAAMa,SAAS,GAAGC,oCAAlB;AACA,MAAMC,UAAU,GAAGD,oCAAnB;AACA,MAAME,UAAU,GAAGF,oCAAnB;AACA,MAAMG,gBAAgB,GAAGH,oCAAzB;eAEe;AACbI,EAAAA,kBAAkB,EAAlBA,+BADa;AAEbJ,EAAAA,uBAAuB,EAAvBA,oCAFa;AAGbK,EAAAA,gBAAgB,EAAhBA,6BAHa;AAIbC,EAAAA,wBAAwB,EAAxBA,qCAJa;AAKbC,EAAAA,UAAU,EAAVA,uBALa;AAMbC,EAAAA,QAAQ,EAARA,qBANa;AAObC,EAAAA,MAAM,EAANA,mBAPa;AAQbC,EAAAA,SAAS,EAATA,sBARa;AASbC,EAAAA,mBAAmB,EAAnBA,gCATa;AAUbnB,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbE,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBblB,EAAAA,iBArBa;AAsBbE,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0BbC,EAAAA,eA1Ba;AA2Bb;AACAqB,EAAAA,UAAU,EAAVA,sBA5Ba;AA6BbC,EAAAA,KAAK,EAALA;AA7Ba,C","sourcesContent":["import {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n View,\n} from 'react-native';\nimport { State } from './State';\nimport { Directions } from './Directions';\n\nconst NOOP = () => {\n // do nothing\n};\nconst PanGestureHandler = View;\nconst attachGestureHandler = NOOP;\nconst createGestureHandler = NOOP;\nconst dropGestureHandler = NOOP;\nconst updateGestureHandler = NOOP;\nconst flushOperations = NOOP;\nconst NativeViewGestureHandler = View;\nconst TapGestureHandler = View;\nconst ForceTouchGestureHandler = View;\nconst LongPressGestureHandler = View;\nconst PinchGestureHandler = View;\nconst RotationGestureHandler = View;\nconst FlingGestureHandler = View;\nconst RawButton = TouchableNativeFeedback;\nconst BaseButton = TouchableNativeFeedback;\nconst RectButton = TouchableNativeFeedback;\nconst BorderlessButton = TouchableNativeFeedback;\n\nexport default {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n NativeViewGestureHandler,\n TapGestureHandler,\n ForceTouchGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PanGestureHandler,\n attachGestureHandler,\n createGestureHandler,\n dropGestureHandler,\n updateGestureHandler,\n flushOperations,\n // probably can be removed\n Directions,\n State,\n} as const;\n"]}
1
+ {"version":3,"sources":["mocks.ts"],"names":["NOOP","PanGestureHandler","View","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","install","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","TouchableNativeFeedback","BaseButton","RectButton","BorderlessButton","TouchableHighlight","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","Directions","State"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAEA,MAAMA,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGC,iBAA1B;AACA,MAAMC,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,oBAAoB,GAAGJ,IAA7B;AACA,MAAMK,kBAAkB,GAAGL,IAA3B;AACA,MAAMM,oBAAoB,GAAGN,IAA7B;AACA,MAAMO,eAAe,GAAGP,IAAxB;AACA,MAAMQ,OAAO,GAAGR,IAAhB;AACA,MAAMS,wBAAwB,GAAGP,iBAAjC;AACA,MAAMQ,iBAAiB,GAAGR,iBAA1B;AACA,MAAMS,wBAAwB,GAAGT,iBAAjC;AACA,MAAMU,uBAAuB,GAAGV,iBAAhC;AACA,MAAMW,mBAAmB,GAAGX,iBAA5B;AACA,MAAMY,sBAAsB,GAAGZ,iBAA/B;AACA,MAAMa,mBAAmB,GAAGb,iBAA5B;AACA,MAAMc,SAAS,GAAGC,oCAAlB;AACA,MAAMC,UAAU,GAAGD,oCAAnB;AACA,MAAME,UAAU,GAAGF,oCAAnB;AACA,MAAMG,gBAAgB,GAAGH,oCAAzB;eAEe;AACbI,EAAAA,kBAAkB,EAAlBA,+BADa;AAEbJ,EAAAA,uBAAuB,EAAvBA,oCAFa;AAGbK,EAAAA,gBAAgB,EAAhBA,6BAHa;AAIbC,EAAAA,wBAAwB,EAAxBA,qCAJa;AAKbC,EAAAA,UAAU,EAAVA,uBALa;AAMbC,EAAAA,QAAQ,EAARA,qBANa;AAObC,EAAAA,MAAM,EAANA,mBAPa;AAQbC,EAAAA,SAAS,EAATA,sBARa;AASbC,EAAAA,mBAAmB,EAAnBA,gCATa;AAUbnB,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbE,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBbnB,EAAAA,iBArBa;AAsBbE,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0BbC,EAAAA,eA1Ba;AA2BbC,EAAAA,OA3Ba;AA4Bb;AACAqB,EAAAA,UAAU,EAAVA,sBA7Ba;AA8BbC,EAAAA,KAAK,EAALA;AA9Ba,C","sourcesContent":["import {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n View,\n} from 'react-native';\nimport { State } from './State';\nimport { Directions } from './Directions';\n\nconst NOOP = () => {\n // do nothing\n};\nconst PanGestureHandler = View;\nconst attachGestureHandler = NOOP;\nconst createGestureHandler = NOOP;\nconst dropGestureHandler = NOOP;\nconst updateGestureHandler = NOOP;\nconst flushOperations = NOOP;\nconst install = NOOP;\nconst NativeViewGestureHandler = View;\nconst TapGestureHandler = View;\nconst ForceTouchGestureHandler = View;\nconst LongPressGestureHandler = View;\nconst PinchGestureHandler = View;\nconst RotationGestureHandler = View;\nconst FlingGestureHandler = View;\nconst RawButton = TouchableNativeFeedback;\nconst BaseButton = TouchableNativeFeedback;\nconst RectButton = TouchableNativeFeedback;\nconst BorderlessButton = TouchableNativeFeedback;\n\nexport default {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n NativeViewGestureHandler,\n TapGestureHandler,\n ForceTouchGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PanGestureHandler,\n attachGestureHandler,\n createGestureHandler,\n dropGestureHandler,\n updateGestureHandler,\n flushOperations,\n install,\n // probably can be removed\n Directions,\n State,\n} as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerButtonNativeComponent.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;eAiBe,qCAAoC,wBAApC,C","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type {\n Int32,\n WithDefault,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport type { ViewProps, ColorValue } from 'react-native';\n\ninterface NativeProps extends ViewProps {\n exclusive?: WithDefault<boolean, true>;\n foreground?: boolean;\n borderless?: boolean;\n enabled?: WithDefault<boolean, true>;\n rippleColor?: ColorValue;\n rippleRadius?: Int32;\n touchSoundDisabled?: WithDefault<boolean, false>;\n}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');\n"]}
1
+ {"version":3,"sources":["RNGestureHandlerButtonNativeComponent.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;eAqBe,qCAAoC,wBAApC,C","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type {\n Int32,\n WithDefault,\n Float,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport type { ViewProps, ColorValue } from 'react-native';\n\ninterface NativeProps extends ViewProps {\n exclusive?: WithDefault<boolean, true>;\n foreground?: boolean;\n borderless?: boolean;\n enabled?: WithDefault<boolean, true>;\n rippleColor?: ColorValue;\n rippleRadius?: Int32;\n touchSoundDisabled?: WithDefault<boolean, false>;\n borderWidth?: Float;\n borderColor?: ColorValue;\n borderStyle?: WithDefault<string, 'solid'>;\n}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');\n"]}
@@ -24,6 +24,9 @@ function withPrevAndCurrent(array, mapFn) {
24
24
  const currentArr = [...array];
25
25
  const transformedArr = [];
26
26
  currentArr.forEach((current, i) => {
27
+ // This type cast is fine and solves problem mentioned in https://github.com/software-mansion/react-native-gesture-handler/pull/2867 (namely that `previous` can be undefined).
28
+ // Unfortunately, linter on our CI does not allow this type of casting as it is unnecessary. To bypass that we use eslint-disable.
29
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
27
30
  const previous = previousArr[i];
28
31
  const transformed = mapFn(previous, current);
29
32
  previousArr.push(transformed);
@@ -58,6 +61,7 @@ function isFabric() {
58
61
  function isRemoteDebuggingEnabled() {
59
62
  // react-native-reanimated checks if in remote debugging in the same way
60
63
  // @ts-ignore global is available but node types are not included
61
- return !global.nativeCallSyncHook || global.__REMOTEDEV__;
64
+ const localGlobal = global;
65
+ return (!localGlobal.nativeCallSyncHook || !!localGlobal.__REMOTEDEV__) && !localGlobal.RN$Bridgeless;
62
66
  }
63
67
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["toArray","object","Array","isArray","withPrevAndCurrent","array","mapFn","previousArr","currentArr","transformedArr","forEach","current","i","previous","transformed","push","hasProperty","key","Object","prototype","hasOwnProperty","call","isJestEnv","global","process","env","JEST_WORKER_ID","tagMessage","msg","isFabric","nativeFabricUIManager","isRemoteDebuggingEnabled","nativeCallSyncHook","__REMOTEDEV__"],"mappings":";;;;;;;;;;;;;AAAO,SAASA,OAAT,CAAoBC,MAApB,EAA0C;AAC/C,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAL,EAA4B;AAC1B,WAAO,CAACA,MAAD,CAAP;AACD;;AAED,SAAOA,MAAP;AACD;;AAMM,SAASG,kBAAT,CACLC,KADK,EAELC,KAFK,EAGU;AACf,QAAMC,WAAmC,GAAG,CAAC,IAAD,CAA5C;AACA,QAAMC,UAAU,GAAG,CAAC,GAAGH,KAAJ,CAAnB;AACA,QAAMI,cAA6B,GAAG,EAAtC;AACAD,EAAAA,UAAU,CAACE,OAAX,CAAmB,CAACC,OAAD,EAAUC,CAAV,KAAgB;AACjC,UAAMC,QAAQ,GAAGN,WAAW,CAACK,CAAD,CAA5B;AACA,UAAME,WAAW,GAAGR,KAAK,CAACO,QAAD,EAAWF,OAAX,CAAzB;AACAJ,IAAAA,WAAW,CAACQ,IAAZ,CAAiBD,WAAjB;AACAL,IAAAA,cAAc,CAACM,IAAf,CAAoBD,WAApB;AACD,GALD;AAMA,SAAOL,cAAP;AACD,C,CAED;;;AACO,SAASO,WAAT,CAAqBf,MAArB,EAAqCgB,GAArC,EAAkD;AACvD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCpB,MAArC,EAA6CgB,GAA7C,CAAP;AACD;;AAEM,SAASK,SAAT,GAA8B;AACnC;AACA,SAAON,WAAW,CAACO,MAAD,EAAS,SAAT,CAAX,IAAkC,CAAC,CAACC,OAAO,CAACC,GAAR,CAAYC,cAAvD;AACD;;AAEM,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,SAAQ,kCAAiCA,GAAI,EAA7C;AACD,C,CAED;AACA;;;AACO,SAASC,QAAT,GAA6B;AAAA;;AAClC;AACA,SAAO,CAAC,aAACN,MAAD,oCAAC,QAAQO,qBAAT,CAAR;AACD;;AAEM,SAASC,wBAAT,GAA6C;AAClD;AACA;AACA,SAAO,CAAER,MAAD,CAAgBS,kBAAjB,IAAwCT,MAAD,CAAgBU,aAA9D;AACD","sourcesContent":["export function toArray<T>(object: T | T[]): T[] {\n if (!Array.isArray(object)) {\n return [object];\n }\n\n return object;\n}\n\nexport type withPrevAndCurrentMapFn<T, Transformed> = (\n previous: Transformed | null,\n current: T\n) => Transformed;\nexport function withPrevAndCurrent<T, Transformed>(\n array: T[],\n mapFn: withPrevAndCurrentMapFn<T, Transformed>\n): Transformed[] {\n const previousArr: (null | Transformed)[] = [null];\n const currentArr = [...array];\n const transformedArr: Transformed[] = [];\n currentArr.forEach((current, i) => {\n const previous = previousArr[i];\n const transformed = mapFn(previous, current);\n previousArr.push(transformed);\n transformedArr.push(transformed);\n });\n return transformedArr;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function hasProperty(object: object, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nexport function isJestEnv(): boolean {\n // @ts-ignore Do not use `@types/node` because it will prioritise Node types over RN types which breaks the types (ex. setTimeout) in React Native projects.\n return hasProperty(global, 'process') && !!process.env.JEST_WORKER_ID;\n}\n\nexport function tagMessage(msg: string) {\n return `[react-native-gesture-handler] ${msg}`;\n}\n\n// helper method to check whether Fabric is enabled, however global.nativeFabricUIManager\n// may not be initialized before the first render\nexport function isFabric(): boolean {\n // @ts-expect-error nativeFabricUIManager is not yet included in the RN types\n return !!global?.nativeFabricUIManager;\n}\n\nexport function isRemoteDebuggingEnabled(): boolean {\n // react-native-reanimated checks if in remote debugging in the same way\n // @ts-ignore global is available but node types are not included\n return !(global as any).nativeCallSyncHook || (global as any).__REMOTEDEV__;\n}\n"]}
1
+ {"version":3,"sources":["utils.ts"],"names":["toArray","object","Array","isArray","withPrevAndCurrent","array","mapFn","previousArr","currentArr","transformedArr","forEach","current","i","previous","transformed","push","hasProperty","key","Object","prototype","hasOwnProperty","call","isJestEnv","global","process","env","JEST_WORKER_ID","tagMessage","msg","isFabric","nativeFabricUIManager","isRemoteDebuggingEnabled","localGlobal","nativeCallSyncHook","__REMOTEDEV__","RN$Bridgeless"],"mappings":";;;;;;;;;;;;;AAAO,SAASA,OAAT,CAAoBC,MAApB,EAA0C;AAC/C,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAL,EAA4B;AAC1B,WAAO,CAACA,MAAD,CAAP;AACD;;AAED,SAAOA,MAAP;AACD;;AAMM,SAASG,kBAAT,CACLC,KADK,EAELC,KAFK,EAGU;AACf,QAAMC,WAAmC,GAAG,CAAC,IAAD,CAA5C;AACA,QAAMC,UAAU,GAAG,CAAC,GAAGH,KAAJ,CAAnB;AACA,QAAMI,cAA6B,GAAG,EAAtC;AACAD,EAAAA,UAAU,CAACE,OAAX,CAAmB,CAACC,OAAD,EAAUC,CAAV,KAAgB;AACjC;AACA;AACA;AACA,UAAMC,QAAQ,GAAGN,WAAW,CAACK,CAAD,CAA5B;AACA,UAAME,WAAW,GAAGR,KAAK,CAACO,QAAD,EAAWF,OAAX,CAAzB;AACAJ,IAAAA,WAAW,CAACQ,IAAZ,CAAiBD,WAAjB;AACAL,IAAAA,cAAc,CAACM,IAAf,CAAoBD,WAApB;AACD,GARD;AASA,SAAOL,cAAP;AACD,C,CAED;;;AACO,SAASO,WAAT,CAAqBf,MAArB,EAAqCgB,GAArC,EAAkD;AACvD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCpB,MAArC,EAA6CgB,GAA7C,CAAP;AACD;;AAEM,SAASK,SAAT,GAA8B;AACnC;AACA,SAAON,WAAW,CAACO,MAAD,EAAS,SAAT,CAAX,IAAkC,CAAC,CAACC,OAAO,CAACC,GAAR,CAAYC,cAAvD;AACD;;AAEM,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,SAAQ,kCAAiCA,GAAI,EAA7C;AACD,C,CAED;AACA;;;AACO,SAASC,QAAT,GAA6B;AAAA;;AAClC;AACA,SAAO,CAAC,aAACN,MAAD,oCAAC,QAAQO,qBAAT,CAAR;AACD;;AAEM,SAASC,wBAAT,GAA6C;AAClD;AACA;AACA,QAAMC,WAAW,GAAGT,MAApB;AACA,SACE,CAAC,CAACS,WAAW,CAACC,kBAAb,IAAmC,CAAC,CAACD,WAAW,CAACE,aAAlD,KACA,CAACF,WAAW,CAACG,aAFf;AAID","sourcesContent":["export function toArray<T>(object: T | T[]): T[] {\n if (!Array.isArray(object)) {\n return [object];\n }\n\n return object;\n}\n\nexport type withPrevAndCurrentMapFn<T, Transformed> = (\n previous: Transformed | null,\n current: T\n) => Transformed;\nexport function withPrevAndCurrent<T, Transformed>(\n array: T[],\n mapFn: withPrevAndCurrentMapFn<T, Transformed>\n): Transformed[] {\n const previousArr: (null | Transformed)[] = [null];\n const currentArr = [...array];\n const transformedArr: Transformed[] = [];\n currentArr.forEach((current, i) => {\n // This type cast is fine and solves problem mentioned in https://github.com/software-mansion/react-native-gesture-handler/pull/2867 (namely that `previous` can be undefined).\n // Unfortunately, linter on our CI does not allow this type of casting as it is unnecessary. To bypass that we use eslint-disable.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const previous = previousArr[i] as Transformed | null;\n const transformed = mapFn(previous, current);\n previousArr.push(transformed);\n transformedArr.push(transformed);\n });\n return transformedArr;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function hasProperty(object: object, key: string) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nexport function isJestEnv(): boolean {\n // @ts-ignore Do not use `@types/node` because it will prioritise Node types over RN types which breaks the types (ex. setTimeout) in React Native projects.\n return hasProperty(global, 'process') && !!process.env.JEST_WORKER_ID;\n}\n\nexport function tagMessage(msg: string) {\n return `[react-native-gesture-handler] ${msg}`;\n}\n\n// helper method to check whether Fabric is enabled, however global.nativeFabricUIManager\n// may not be initialized before the first render\nexport function isFabric(): boolean {\n // @ts-expect-error nativeFabricUIManager is not yet included in the RN types\n return !!global?.nativeFabricUIManager;\n}\n\nexport function isRemoteDebuggingEnabled(): boolean {\n // react-native-reanimated checks if in remote debugging in the same way\n // @ts-ignore global is available but node types are not included\n const localGlobal = global as any;\n return (\n (!localGlobal.nativeCallSyncHook || !!localGlobal.__REMOTEDEV__) &&\n !localGlobal.RN$Bridgeless\n );\n}\n"]}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HammerGestures = exports.Gestures = void 0;
7
+
8
+ var _PanGestureHandler = _interopRequireDefault(require("./handlers/PanGestureHandler"));
9
+
10
+ var _TapGestureHandler = _interopRequireDefault(require("./handlers/TapGestureHandler"));
11
+
12
+ var _LongPressGestureHandler = _interopRequireDefault(require("./handlers/LongPressGestureHandler"));
13
+
14
+ var _PinchGestureHandler = _interopRequireDefault(require("./handlers/PinchGestureHandler"));
15
+
16
+ var _RotationGestureHandler = _interopRequireDefault(require("./handlers/RotationGestureHandler"));
17
+
18
+ var _FlingGestureHandler = _interopRequireDefault(require("./handlers/FlingGestureHandler"));
19
+
20
+ var _NativeViewGestureHandler = _interopRequireDefault(require("./handlers/NativeViewGestureHandler"));
21
+
22
+ var _ManualGestureHandler = _interopRequireDefault(require("./handlers/ManualGestureHandler"));
23
+
24
+ var _HoverGestureHandler = _interopRequireDefault(require("./handlers/HoverGestureHandler"));
25
+
26
+ var _NativeViewGestureHandler2 = _interopRequireDefault(require("../web_hammer/NativeViewGestureHandler"));
27
+
28
+ var _PanGestureHandler2 = _interopRequireDefault(require("../web_hammer/PanGestureHandler"));
29
+
30
+ var _TapGestureHandler2 = _interopRequireDefault(require("../web_hammer/TapGestureHandler"));
31
+
32
+ var _LongPressGestureHandler2 = _interopRequireDefault(require("../web_hammer/LongPressGestureHandler"));
33
+
34
+ var _PinchGestureHandler2 = _interopRequireDefault(require("../web_hammer/PinchGestureHandler"));
35
+
36
+ var _RotationGestureHandler2 = _interopRequireDefault(require("../web_hammer/RotationGestureHandler"));
37
+
38
+ var _FlingGestureHandler2 = _interopRequireDefault(require("../web_hammer/FlingGestureHandler"));
39
+
40
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
+
42
+ // Gesture Handlers
43
+ //Hammer Handlers
44
+ const Gestures = {
45
+ NativeViewGestureHandler: _NativeViewGestureHandler.default,
46
+ PanGestureHandler: _PanGestureHandler.default,
47
+ TapGestureHandler: _TapGestureHandler.default,
48
+ LongPressGestureHandler: _LongPressGestureHandler.default,
49
+ PinchGestureHandler: _PinchGestureHandler.default,
50
+ RotationGestureHandler: _RotationGestureHandler.default,
51
+ FlingGestureHandler: _FlingGestureHandler.default,
52
+ ManualGestureHandler: _ManualGestureHandler.default,
53
+ HoverGestureHandler: _HoverGestureHandler.default
54
+ };
55
+ exports.Gestures = Gestures;
56
+ const HammerGestures = {
57
+ NativeViewGestureHandler: _NativeViewGestureHandler2.default,
58
+ PanGestureHandler: _PanGestureHandler2.default,
59
+ TapGestureHandler: _TapGestureHandler2.default,
60
+ LongPressGestureHandler: _LongPressGestureHandler2.default,
61
+ PinchGestureHandler: _PinchGestureHandler2.default,
62
+ RotationGestureHandler: _RotationGestureHandler2.default,
63
+ FlingGestureHandler: _FlingGestureHandler2.default
64
+ };
65
+ exports.HammerGestures = HammerGestures;
66
+ //# sourceMappingURL=Gestures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Gestures.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAlBA;AAWA;AASO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,wBAAwB,EAAxBA,iCADsB;AAEtBC,EAAAA,iBAAiB,EAAjBA,0BAFsB;AAGtBC,EAAAA,iBAAiB,EAAjBA,0BAHsB;AAItBC,EAAAA,uBAAuB,EAAvBA,gCAJsB;AAKtBC,EAAAA,mBAAmB,EAAnBA,4BALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA,+BANsB;AAOtBC,EAAAA,mBAAmB,EAAnBA,4BAPsB;AAQtBC,EAAAA,oBAAoB,EAApBA,6BARsB;AAStBC,EAAAA,mBAAmB,EAAnBA;AATsB,CAAjB;;AAYA,MAAMC,cAAc,GAAG;AAC5BT,EAAAA,wBAAwB,EAAEU,kCADE;AAE5BT,EAAAA,iBAAiB,EAAEU,2BAFS;AAG5BT,EAAAA,iBAAiB,EAAEU,2BAHS;AAI5BT,EAAAA,uBAAuB,EAAEU,iCAJG;AAK5BT,EAAAA,mBAAmB,EAAEU,6BALO;AAM5BT,EAAAA,sBAAsB,EAAEU,gCANI;AAO5BT,EAAAA,mBAAmB,EAAEU;AAPO,CAAvB","sourcesContent":["// Gesture Handlers\nimport PanGestureHandler from './handlers/PanGestureHandler';\nimport TapGestureHandler from './handlers/TapGestureHandler';\nimport LongPressGestureHandler from './handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './handlers/PinchGestureHandler';\nimport RotationGestureHandler from './handlers/RotationGestureHandler';\nimport FlingGestureHandler from './handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './handlers/ManualGestureHandler';\nimport HoverGestureHandler from './handlers/HoverGestureHandler';\n\n//Hammer Handlers\nimport HammerNativeViewGestureHandler from '../web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from '../web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from '../web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from '../web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from '../web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from '../web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from '../web_hammer/FlingGestureHandler';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n HoverGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n"]}
@@ -3,14 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Direction = exports.DEFAULT_TOUCH_SLOP = void 0;
6
+ exports.MINIMAL_FLING_VELOCITY = exports.DEFAULT_TOUCH_SLOP = void 0;
7
7
  const DEFAULT_TOUCH_SLOP = 15;
8
8
  exports.DEFAULT_TOUCH_SLOP = DEFAULT_TOUCH_SLOP;
9
- const Direction = {
10
- RIGHT: 1,
11
- LEFT: 2,
12
- UP: 4,
13
- DOWN: 8
14
- };
15
- exports.Direction = Direction;
9
+ const MINIMAL_FLING_VELOCITY = 0.1;
10
+ exports.MINIMAL_FLING_VELOCITY = MINIMAL_FLING_VELOCITY;
16
11
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.ts"],"names":["DEFAULT_TOUCH_SLOP","Direction","RIGHT","LEFT","UP","DOWN"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAG,EAA3B;;AAEA,MAAMC,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAE,CADgB;AAEvBC,EAAAA,IAAI,EAAE,CAFiB;AAGvBC,EAAAA,EAAE,EAAE,CAHmB;AAIvBC,EAAAA,IAAI,EAAE;AAJiB,CAAlB","sourcesContent":["export const DEFAULT_TOUCH_SLOP = 15;\n\nexport const Direction = {\n RIGHT: 1,\n LEFT: 2,\n UP: 4,\n DOWN: 8,\n};\n"]}
1
+ {"version":3,"sources":["constants.ts"],"names":["DEFAULT_TOUCH_SLOP","MINIMAL_FLING_VELOCITY"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAG,EAA3B;;AACA,MAAMC,sBAAsB,GAAG,GAA/B","sourcesContent":["export const DEFAULT_TOUCH_SLOP = 15;\nexport const MINIMAL_FLING_VELOCITY = 0.1;\n"]}
@@ -7,18 +7,25 @@ exports.default = void 0;
7
7
 
8
8
  var _State = require("../../State");
9
9
 
10
- var _constants = require("../constants");
10
+ var _Directions = require("../../Directions");
11
11
 
12
12
  var _GestureHandler = _interopRequireDefault(require("./GestureHandler"));
13
13
 
14
+ var _Vector = _interopRequireDefault(require("../tools/Vector"));
15
+
16
+ var _utils = require("../utils");
17
+
14
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
19
 
16
20
  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; }
17
21
 
18
22
  const DEFAULT_MAX_DURATION_MS = 800;
19
- const DEFAULT_MIN_ACCEPTABLE_DELTA = 32;
20
- const DEFAULT_DIRECTION = _constants.Direction.RIGHT;
23
+ const DEFAULT_MIN_VELOCITY = 700;
24
+ const DEFAULT_ALIGNMENT_CONE = 30;
25
+ const DEFAULT_DIRECTION = _Directions.Directions.RIGHT;
21
26
  const DEFAULT_NUMBER_OF_TOUCHES_REQUIRED = 1;
27
+ const AXIAL_DEVIATION_COSINE = (0, _utils.coneToDeviation)(DEFAULT_ALIGNMENT_CONE);
28
+ const DIAGONAL_DEVIATION_COSINE = (0, _utils.coneToDeviation)(90 - DEFAULT_ALIGNMENT_CONE);
22
29
 
23
30
  class FlingGestureHandler extends _GestureHandler.default {
24
31
  constructor(...args) {
@@ -30,14 +37,10 @@ class FlingGestureHandler extends _GestureHandler.default {
30
37
 
31
38
  _defineProperty(this, "maxDurationMs", DEFAULT_MAX_DURATION_MS);
32
39
 
33
- _defineProperty(this, "minAcceptableDelta", DEFAULT_MIN_ACCEPTABLE_DELTA);
40
+ _defineProperty(this, "minVelocity", DEFAULT_MIN_VELOCITY);
34
41
 
35
42
  _defineProperty(this, "delayTimeout", void 0);
36
43
 
37
- _defineProperty(this, "startX", 0);
38
-
39
- _defineProperty(this, "startY", 0);
40
-
41
44
  _defineProperty(this, "maxNumberOfPointersSimultaneously", 0);
42
45
 
43
46
  _defineProperty(this, "keyPointer", NaN);
@@ -66,15 +69,27 @@ class FlingGestureHandler extends _GestureHandler.default {
66
69
  }
67
70
 
68
71
  startFling() {
69
- this.startX = this.tracker.getLastX(this.keyPointer);
70
- this.startY = this.tracker.getLastY(this.keyPointer);
71
72
  this.begin();
72
73
  this.maxNumberOfPointersSimultaneously = 1;
73
74
  this.delayTimeout = setTimeout(() => this.fail(), this.maxDurationMs);
74
75
  }
75
76
 
76
77
  tryEndFling() {
77
- if (this.maxNumberOfPointersSimultaneously === this.numberOfPointersRequired && (this.direction & _constants.Direction.RIGHT && this.tracker.getLastX(this.keyPointer) - this.startX > this.minAcceptableDelta || this.direction & _constants.Direction.LEFT && this.startX - this.tracker.getLastX(this.keyPointer) > this.minAcceptableDelta || this.direction & _constants.Direction.UP && this.startY - this.tracker.getLastY(this.keyPointer) > this.minAcceptableDelta || this.direction & _constants.Direction.DOWN && this.tracker.getLastY(this.keyPointer) - this.startY > this.minAcceptableDelta)) {
78
+ const velocityVector = _Vector.default.fromVelocity(this.tracker, this.keyPointer);
79
+
80
+ const getAlignment = (direction, minimalAlignmentCosine) => {
81
+ return (direction & this.direction) === direction && velocityVector.isSimilar(_Vector.default.fromDirection(direction), minimalAlignmentCosine);
82
+ };
83
+
84
+ const axialDirectionsList = Object.values(_Directions.Directions);
85
+ const diagonalDirectionsList = Object.values(_Directions.DiagonalDirections); // list of alignments to all activated directions
86
+
87
+ const axialAlignmentList = axialDirectionsList.map(direction => getAlignment(direction, AXIAL_DEVIATION_COSINE));
88
+ const diagonalAlignmentList = diagonalDirectionsList.map(direction => getAlignment(direction, DIAGONAL_DEVIATION_COSINE));
89
+ const isAligned = axialAlignmentList.some(Boolean) || diagonalAlignmentList.some(Boolean);
90
+ const isFast = velocityVector.magnitude > this.minVelocity;
91
+
92
+ if (this.maxNumberOfPointersSimultaneously === this.numberOfPointersRequired && isAligned && isFast) {
78
93
  clearTimeout(this.delayTimeout);
79
94
  this.activate();
80
95
  return true;
@@ -122,7 +137,7 @@ class FlingGestureHandler extends _GestureHandler.default {
122
137
  }
123
138
  }
124
139
 
125
- onPointerMove(event) {
140
+ pointerMoveAction(event) {
126
141
  this.tracker.track(event);
127
142
 
128
143
  if (this.currentState !== _State.State.BEGAN) {
@@ -130,9 +145,18 @@ class FlingGestureHandler extends _GestureHandler.default {
130
145
  }
131
146
 
132
147
  this.tryEndFling();
148
+ }
149
+
150
+ onPointerMove(event) {
151
+ this.pointerMoveAction(event);
133
152
  super.onPointerMove(event);
134
153
  }
135
154
 
155
+ onPointerOutOfBounds(event) {
156
+ this.pointerMoveAction(event);
157
+ super.onPointerOutOfBounds(event);
158
+ }
159
+
136
160
  onPointerUp(event) {
137
161
  super.onPointerUp(event);
138
162
  this.onUp(event);
@@ -1 +1 @@
1
- {"version":3,"sources":["FlingGestureHandler.ts"],"names":["DEFAULT_MAX_DURATION_MS","DEFAULT_MIN_ACCEPTABLE_DELTA","DEFAULT_DIRECTION","Direction","RIGHT","DEFAULT_NUMBER_OF_TOUCHES_REQUIRED","FlingGestureHandler","GestureHandler","NaN","init","ref","propsRef","updateGestureConfig","enabled","props","config","direction","numberOfPointers","numberOfPointersRequired","startFling","startX","tracker","getLastX","keyPointer","startY","getLastY","begin","maxNumberOfPointersSimultaneously","delayTimeout","setTimeout","fail","maxDurationMs","tryEndFling","minAcceptableDelta","LEFT","UP","DOWN","clearTimeout","activate","endFling","onPointerDown","event","isButtonInConfig","button","addToTracker","pointerId","newPointerAction","onPointerAdd","currentState","State","UNDETERMINED","BEGAN","getTrackedPointersCount","onPointerMove","track","onPointerUp","onUp","onPointerRemove","removeFromTracker","force","end","resetConfig"],"mappings":"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","sourcesContent":["import { State } from '../../State';\nimport { Direction } from '../constants';\nimport { AdaptedEvent, Config } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\n\nconst DEFAULT_MAX_DURATION_MS = 800;\nconst DEFAULT_MIN_ACCEPTABLE_DELTA = 32;\nconst DEFAULT_DIRECTION = Direction.RIGHT;\nconst DEFAULT_NUMBER_OF_TOUCHES_REQUIRED = 1;\n\nexport default class FlingGestureHandler extends GestureHandler {\n private numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n private direction = DEFAULT_DIRECTION;\n\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private minAcceptableDelta = DEFAULT_MIN_ACCEPTABLE_DELTA;\n private delayTimeout!: number;\n\n private startX = 0;\n private startY = 0;\n\n private maxNumberOfPointersSimultaneously = 0;\n private keyPointer = NaN;\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n }\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.direction) {\n this.direction = this.config.direction;\n }\n\n if (this.config.numberOfPointers) {\n this.numberOfPointersRequired = this.config.numberOfPointers;\n }\n }\n\n private startFling(): void {\n this.startX = this.tracker.getLastX(this.keyPointer);\n this.startY = this.tracker.getLastY(this.keyPointer);\n\n this.begin();\n\n this.maxNumberOfPointersSimultaneously = 1;\n\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private tryEndFling(): boolean {\n if (\n this.maxNumberOfPointersSimultaneously ===\n this.numberOfPointersRequired &&\n ((this.direction & Direction.RIGHT &&\n this.tracker.getLastX(this.keyPointer) - this.startX >\n this.minAcceptableDelta) ||\n (this.direction & Direction.LEFT &&\n this.startX - this.tracker.getLastX(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.UP &&\n this.startY - this.tracker.getLastY(this.keyPointer) >\n this.minAcceptableDelta) ||\n (this.direction & Direction.DOWN &&\n this.tracker.getLastY(this.keyPointer) - this.startY >\n this.minAcceptableDelta))\n ) {\n clearTimeout(this.delayTimeout);\n this.activate();\n\n return true;\n }\n\n return false;\n }\n\n private endFling() {\n if (!this.tryEndFling()) {\n this.fail();\n }\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n if (!this.isButtonInConfig(event.button)) {\n return;\n }\n\n this.tracker.addToTracker(event);\n this.keyPointer = event.pointerId;\n\n super.onPointerDown(event);\n this.newPointerAction();\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.newPointerAction();\n }\n\n private newPointerAction(): void {\n if (this.currentState === State.UNDETERMINED) {\n this.startFling();\n }\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n if (\n this.tracker.getTrackedPointersCount() >\n this.maxNumberOfPointersSimultaneously\n ) {\n this.maxNumberOfPointersSimultaneously =\n this.tracker.getTrackedPointersCount();\n }\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.tracker.track(event);\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n super.onPointerMove(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.onUp(event);\n\n this.keyPointer = NaN;\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.onUp(event);\n }\n\n private onUp(event: AdaptedEvent): void {\n if (this.currentState === State.BEGAN) {\n this.endFling();\n }\n\n this.tracker.removeFromTracker(event.pointerId);\n }\n\n public activate(force?: boolean): void {\n super.activate(force);\n this.end();\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n this.numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n this.direction = DEFAULT_DIRECTION;\n }\n}\n"]}
1
+ {"version":3,"sources":["FlingGestureHandler.ts"],"names":["DEFAULT_MAX_DURATION_MS","DEFAULT_MIN_VELOCITY","DEFAULT_ALIGNMENT_CONE","DEFAULT_DIRECTION","Directions","RIGHT","DEFAULT_NUMBER_OF_TOUCHES_REQUIRED","AXIAL_DEVIATION_COSINE","DIAGONAL_DEVIATION_COSINE","FlingGestureHandler","GestureHandler","NaN","init","ref","propsRef","updateGestureConfig","enabled","props","config","direction","numberOfPointers","numberOfPointersRequired","startFling","begin","maxNumberOfPointersSimultaneously","delayTimeout","setTimeout","fail","maxDurationMs","tryEndFling","velocityVector","Vector","fromVelocity","tracker","keyPointer","getAlignment","minimalAlignmentCosine","isSimilar","fromDirection","axialDirectionsList","Object","values","diagonalDirectionsList","DiagonalDirections","axialAlignmentList","map","diagonalAlignmentList","isAligned","some","Boolean","isFast","magnitude","minVelocity","clearTimeout","activate","endFling","onPointerDown","event","isButtonInConfig","button","addToTracker","pointerId","newPointerAction","onPointerAdd","currentState","State","UNDETERMINED","BEGAN","getTrackedPointersCount","pointerMoveAction","track","onPointerMove","onPointerOutOfBounds","onPointerUp","onUp","onPointerRemove","removeFromTracker","force","end","resetConfig"],"mappings":"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","sourcesContent":["import { State } from '../../State';\nimport { DiagonalDirections, Directions } from '../../Directions';\nimport { AdaptedEvent, Config } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\nimport Vector from '../tools/Vector';\nimport { coneToDeviation } from '../utils';\n\nconst DEFAULT_MAX_DURATION_MS = 800;\nconst DEFAULT_MIN_VELOCITY = 700;\nconst DEFAULT_ALIGNMENT_CONE = 30;\nconst DEFAULT_DIRECTION = Directions.RIGHT;\nconst DEFAULT_NUMBER_OF_TOUCHES_REQUIRED = 1;\n\nconst AXIAL_DEVIATION_COSINE = coneToDeviation(DEFAULT_ALIGNMENT_CONE);\nconst DIAGONAL_DEVIATION_COSINE = coneToDeviation(90 - DEFAULT_ALIGNMENT_CONE);\n\nexport default class FlingGestureHandler extends GestureHandler {\n private numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n private direction: Directions = DEFAULT_DIRECTION;\n\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private minVelocity = DEFAULT_MIN_VELOCITY;\n private delayTimeout!: number;\n\n private maxNumberOfPointersSimultaneously = 0;\n private keyPointer = NaN;\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n }\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.direction) {\n this.direction = this.config.direction;\n }\n\n if (this.config.numberOfPointers) {\n this.numberOfPointersRequired = this.config.numberOfPointers;\n }\n }\n\n private startFling(): void {\n this.begin();\n\n this.maxNumberOfPointersSimultaneously = 1;\n\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private tryEndFling(): boolean {\n const velocityVector = Vector.fromVelocity(this.tracker, this.keyPointer);\n\n const getAlignment = (\n direction: Directions | DiagonalDirections,\n minimalAlignmentCosine: number\n ) => {\n return (\n (direction & this.direction) === direction &&\n velocityVector.isSimilar(\n Vector.fromDirection(direction),\n minimalAlignmentCosine\n )\n );\n };\n\n const axialDirectionsList = Object.values(Directions);\n const diagonalDirectionsList = Object.values(DiagonalDirections);\n\n // list of alignments to all activated directions\n const axialAlignmentList = axialDirectionsList.map((direction) =>\n getAlignment(direction, AXIAL_DEVIATION_COSINE)\n );\n\n const diagonalAlignmentList = diagonalDirectionsList.map((direction) =>\n getAlignment(direction, DIAGONAL_DEVIATION_COSINE)\n );\n\n const isAligned =\n axialAlignmentList.some(Boolean) || diagonalAlignmentList.some(Boolean);\n\n const isFast = velocityVector.magnitude > this.minVelocity;\n\n if (\n this.maxNumberOfPointersSimultaneously ===\n this.numberOfPointersRequired &&\n isAligned &&\n isFast\n ) {\n clearTimeout(this.delayTimeout);\n this.activate();\n\n return true;\n }\n\n return false;\n }\n\n private endFling() {\n if (!this.tryEndFling()) {\n this.fail();\n }\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n if (!this.isButtonInConfig(event.button)) {\n return;\n }\n\n this.tracker.addToTracker(event);\n this.keyPointer = event.pointerId;\n\n super.onPointerDown(event);\n this.newPointerAction();\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.newPointerAction();\n }\n\n private newPointerAction(): void {\n if (this.currentState === State.UNDETERMINED) {\n this.startFling();\n }\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n\n if (\n this.tracker.getTrackedPointersCount() >\n this.maxNumberOfPointersSimultaneously\n ) {\n this.maxNumberOfPointersSimultaneously =\n this.tracker.getTrackedPointersCount();\n }\n }\n\n private pointerMoveAction(event: AdaptedEvent): void {\n this.tracker.track(event);\n\n if (this.currentState !== State.BEGAN) {\n return;\n }\n\n this.tryEndFling();\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.pointerMoveAction(event);\n super.onPointerMove(event);\n }\n\n protected onPointerOutOfBounds(event: AdaptedEvent): void {\n this.pointerMoveAction(event);\n super.onPointerOutOfBounds(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.onUp(event);\n\n this.keyPointer = NaN;\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.onUp(event);\n }\n\n private onUp(event: AdaptedEvent): void {\n if (this.currentState === State.BEGAN) {\n this.endFling();\n }\n\n this.tracker.removeFromTracker(event.pointerId);\n }\n\n public activate(force?: boolean): void {\n super.activate(force);\n this.end();\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n this.numberOfPointersRequired = DEFAULT_NUMBER_OF_TOUCHES_REQUIRED;\n this.direction = DEFAULT_DIRECTION;\n }\n}\n"]}
@@ -15,6 +15,8 @@ var _InteractionManager = _interopRequireDefault(require("../tools/InteractionMa
15
15
 
16
16
  var _PointerTracker = _interopRequireDefault(require("../tools/PointerTracker"));
17
17
 
18
+ var _gestureHandlerCommon = require("../../handlers/gestureHandlerCommon");
19
+
18
20
  var _PointerType = require("../../PointerType");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -28,7 +30,7 @@ class GestureHandler {
28
30
 
29
31
  _defineProperty(this, "currentState", _State.State.UNDETERMINED);
30
32
 
31
- _defineProperty(this, "shouldCancellWhenOutside", false);
33
+ _defineProperty(this, "shouldCancelWhenOutside", false);
32
34
 
33
35
  _defineProperty(this, "hasCustomActivationCriteria", false);
34
36
 
@@ -104,7 +106,7 @@ class GestureHandler {
104
106
  manager.setOnPointerOutOfBounds(this.onPointerOutOfBounds.bind(this));
105
107
  manager.setOnPointerMoveOver(this.onPointerMoveOver.bind(this));
106
108
  manager.setOnPointerMoveOut(this.onPointerMoveOut.bind(this));
107
- manager.setListeners();
109
+ manager.registerListeners();
108
110
  } //
109
111
  // Resetting handler
110
112
  //
@@ -188,8 +190,8 @@ class GestureHandler {
188
190
  }
189
191
  }
190
192
 
191
- activate(_force = false) {
192
- if (this.currentState === _State.State.UNDETERMINED || this.currentState === _State.State.BEGAN) {
193
+ activate(force = false) {
194
+ if ((this.config.manualActivation !== true || force) && (this.currentState === _State.State.UNDETERMINED || this.currentState === _State.State.BEGAN)) {
193
195
  this.delegate.onActivate();
194
196
  this.moveToState(_State.State.ACTIVE);
195
197
  }
@@ -318,7 +320,7 @@ class GestureHandler {
318
320
  }
319
321
 
320
322
  onPointerLeave(event) {
321
- if (this.shouldCancellWhenOutside) {
323
+ if (this.shouldCancelWhenOutside) {
322
324
  switch (this.currentState) {
323
325
  case _State.State.ACTIVE:
324
326
  this.cancel();
@@ -367,7 +369,7 @@ class GestureHandler {
367
369
  }
368
370
 
369
371
  tryToSendMoveEvent(out) {
370
- if (this.enabled && this.active && (!out || out && !this.shouldCancellWhenOutside)) {
372
+ if (this.enabled && this.active && (!out || out && !this.shouldCancelWhenOutside)) {
371
373
  this.sendEvent(this.currentState, this.currentState);
372
374
  }
373
375
  }
@@ -693,7 +695,7 @@ class GestureHandler {
693
695
  }
694
696
 
695
697
  isButtonInConfig(mouseButton) {
696
- return !mouseButton || !this.config.mouseButton && mouseButton === _interfaces.MouseButton.LEFT || this.config.mouseButton && mouseButton & this.config.mouseButton;
698
+ return !mouseButton || !this.config.mouseButton && mouseButton === _gestureHandlerCommon.MouseButton.LEFT || this.config.mouseButton && mouseButton & this.config.mouseButton;
697
699
  }
698
700
 
699
701
  resetConfig() {}
@@ -742,11 +744,11 @@ class GestureHandler {
742
744
  }
743
745
 
744
746
  setShouldCancelWhenOutside(shouldCancel) {
745
- this.shouldCancellWhenOutside = shouldCancel;
747
+ this.shouldCancelWhenOutside = shouldCancel;
746
748
  }
747
749
 
748
750
  getShouldCancelWhenOutside() {
749
- return this.shouldCancellWhenOutside;
751
+ return this.shouldCancelWhenOutside;
750
752
  }
751
753
 
752
754
  getPointerType() {