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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -10,11 +10,23 @@ export class LongPressGesture extends BaseGesture {
10
10
  this.handlerName = 'LongPressGestureHandler';
11
11
  this.shouldCancelWhenOutside(true);
12
12
  }
13
+ /**
14
+ * Minimum time, expressed in milliseconds, that a finger must remain pressed on the corresponding view.
15
+ * The default value is 500.
16
+ * @param duration
17
+ */
18
+
13
19
 
14
20
  minDuration(duration) {
15
21
  this.config.minDurationMs = duration;
16
22
  return this;
17
23
  }
24
+ /**
25
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a long press gesture.
26
+ * @param distance
27
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/long-press-gesture#maxdistancevalue-number
28
+ */
29
+
18
30
 
19
31
  maxDistance(distance) {
20
32
  this.config.maxDist = distance;
@@ -1 +1 @@
1
- {"version":3,"sources":["longPressGesture.ts"],"names":["BaseGesture","LongPressGesture","constructor","handlerName","shouldCancelWhenOutside","minDuration","duration","config","minDurationMs","maxDistance","distance","maxDist"],"mappings":";;AAAA,SAASA,WAAT,QAA+C,WAA/C;AAMA,OAAO,MAAMC,gBAAN,SAA+BD,WAA/B,CAAgF;AAGrFE,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF8C,EAE9C;;AAGZ,SAAKC,WAAL,GAAmB,yBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;;AAEDC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKC,MAAL,CAAYC,aAAZ,GAA4BF,QAA5B;AACA,WAAO,IAAP;AACD;;AAEDG,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKH,MAAL,CAAYI,OAAZ,GAAsBD,QAAtB;AACA,WAAO,IAAP;AACD;;AAlBoF","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\nimport {\n LongPressGestureConfig,\n LongPressGestureHandlerEventPayload,\n} from '../LongPressGestureHandler';\n\nexport class LongPressGesture extends BaseGesture<LongPressGestureHandlerEventPayload> {\n public config: BaseGestureConfig & LongPressGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'LongPressGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n minDuration(duration: number) {\n this.config.minDurationMs = duration;\n return this;\n }\n\n maxDistance(distance: number) {\n this.config.maxDist = distance;\n return this;\n }\n}\n\nexport type LongPressGestureType = InstanceType<typeof LongPressGesture>;\n"]}
1
+ {"version":3,"sources":["longPressGesture.ts"],"names":["BaseGesture","LongPressGesture","constructor","handlerName","shouldCancelWhenOutside","minDuration","duration","config","minDurationMs","maxDistance","distance","maxDist"],"mappings":";;AAAA,SAASA,WAAT,QAA+C,WAA/C;AAMA,OAAO,MAAMC,gBAAN,SAA+BD,WAA/B,CAAgF;AAGrFE,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF8C,EAE9C;;AAGZ,SAAKC,WAAL,GAAmB,yBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKC,MAAL,CAAYC,aAAZ,GAA4BF,QAA5B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEG,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKH,MAAL,CAAYI,OAAZ,GAAsBD,QAAtB;AACA,WAAO,IAAP;AACD;;AA5BoF","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\nimport {\n LongPressGestureConfig,\n LongPressGestureHandlerEventPayload,\n} from '../LongPressGestureHandler';\n\nexport class LongPressGesture extends BaseGesture<LongPressGestureHandlerEventPayload> {\n public config: BaseGestureConfig & LongPressGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'LongPressGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n /**\n * Minimum time, expressed in milliseconds, that a finger must remain pressed on the corresponding view.\n * The default value is 500.\n * @param duration\n */\n minDuration(duration: number) {\n this.config.minDurationMs = duration;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a long press gesture.\n * @param distance\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/long-press-gesture#maxdistancevalue-number\n */\n maxDistance(distance: number) {\n this.config.maxDist = distance;\n return this;\n }\n}\n\nexport type LongPressGestureType = InstanceType<typeof LongPressGesture>;\n"]}
@@ -9,11 +9,21 @@ export class NativeGesture extends BaseGesture {
9
9
 
10
10
  this.handlerName = 'NativeViewGestureHandler';
11
11
  }
12
+ /**
13
+ * When true, underlying handler will activate unconditionally when in `BEGAN` or `UNDETERMINED` state.
14
+ * @param value
15
+ */
16
+
12
17
 
13
18
  shouldActivateOnStart(value) {
14
19
  this.config.shouldActivateOnStart = value;
15
20
  return this;
16
21
  }
22
+ /**
23
+ * When true, cancels all other gesture handlers when this `NativeViewGestureHandler` receives an `ACTIVE` state event.
24
+ * @param value
25
+ */
26
+
17
27
 
18
28
  disallowInterruption(value) {
19
29
  this.config.disallowInterruption = value;
@@ -1 +1 @@
1
- {"version":3,"sources":["nativeGesture.ts"],"names":["BaseGesture","NativeGesture","constructor","handlerName","shouldActivateOnStart","value","config","disallowInterruption"],"mappings":";;AAAA,SAA4BA,WAA5B,QAA+C,WAA/C;AAMA,OAAO,MAAMC,aAAN,SAA4BD,WAA5B,CAAyE;AAG9EE,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF+C,EAE/C;;AAGZ,SAAKC,WAAL,GAAmB,0BAAnB;AACD;;AAEDC,EAAAA,qBAAqB,CAACC,KAAD,EAAiB;AACpC,SAAKC,MAAL,CAAYF,qBAAZ,GAAoCC,KAApC;AACA,WAAO,IAAP;AACD;;AAEDE,EAAAA,oBAAoB,CAACF,KAAD,EAAiB;AACnC,SAAKC,MAAL,CAAYC,oBAAZ,GAAmCF,KAAnC;AACA,WAAO,IAAP;AACD;;AAjB6E","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport {\n NativeViewGestureConfig,\n NativeViewGestureHandlerPayload,\n} from '../NativeViewGestureHandler';\n\nexport class NativeGesture extends BaseGesture<NativeViewGestureHandlerPayload> {\n public config: BaseGestureConfig & NativeViewGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'NativeViewGestureHandler';\n }\n\n shouldActivateOnStart(value: boolean) {\n this.config.shouldActivateOnStart = value;\n return this;\n }\n\n disallowInterruption(value: boolean) {\n this.config.disallowInterruption = value;\n return this;\n }\n}\n\nexport type NativeGestureType = InstanceType<typeof NativeGesture>;\n"]}
1
+ {"version":3,"sources":["nativeGesture.ts"],"names":["BaseGesture","NativeGesture","constructor","handlerName","shouldActivateOnStart","value","config","disallowInterruption"],"mappings":";;AAAA,SAA4BA,WAA5B,QAA+C,WAA/C;AAMA,OAAO,MAAMC,aAAN,SAA4BD,WAA5B,CAAyE;AAG9EE,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF+C,EAE/C;;AAGZ,SAAKC,WAAL,GAAmB,0BAAnB;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,qBAAqB,CAACC,KAAD,EAAiB;AACpC,SAAKC,MAAL,CAAYF,qBAAZ,GAAoCC,KAApC;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEE,EAAAA,oBAAoB,CAACF,KAAD,EAAiB;AACnC,SAAKC,MAAL,CAAYC,oBAAZ,GAAmCF,KAAnC;AACA,WAAO,IAAP;AACD;;AAzB6E","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport {\n NativeViewGestureConfig,\n NativeViewGestureHandlerPayload,\n} from '../NativeViewGestureHandler';\n\nexport class NativeGesture extends BaseGesture<NativeViewGestureHandlerPayload> {\n public config: BaseGestureConfig & NativeViewGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'NativeViewGestureHandler';\n }\n\n /**\n * When true, underlying handler will activate unconditionally when in `BEGAN` or `UNDETERMINED` state.\n * @param value\n */\n shouldActivateOnStart(value: boolean) {\n this.config.shouldActivateOnStart = value;\n return this;\n }\n\n /**\n * When true, cancels all other gesture handlers when this `NativeViewGestureHandler` receives an `ACTIVE` state event.\n * @param value\n */\n disallowInterruption(value: boolean) {\n this.config.disallowInterruption = value;\n return this;\n }\n}\n\nexport type NativeGestureType = InstanceType<typeof NativeGesture>;\n"]}
@@ -32,6 +32,12 @@ export class PanGesture extends ContinousBaseGesture {
32
32
 
33
33
  this.handlerName = 'PanGestureHandler';
34
34
  }
35
+ /**
36
+ * Range along Y axis (in points) where fingers travels without activation of gesture.
37
+ * @param offset
38
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number
39
+ */
40
+
35
41
 
36
42
  activeOffsetY(offset) {
37
43
  if (Array.isArray(offset)) {
@@ -45,6 +51,12 @@ export class PanGesture extends ContinousBaseGesture {
45
51
 
46
52
  return this;
47
53
  }
54
+ /**
55
+ * Range along X axis (in points) where fingers travels without activation of gesture.
56
+ * @param offset
57
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number
58
+ */
59
+
48
60
 
49
61
  activeOffsetX(offset) {
50
62
  if (Array.isArray(offset)) {
@@ -58,6 +70,12 @@ export class PanGesture extends ContinousBaseGesture {
58
70
 
59
71
  return this;
60
72
  }
73
+ /**
74
+ * When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.
75
+ * @param offset
76
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number
77
+ */
78
+
61
79
 
62
80
  failOffsetY(offset) {
63
81
  if (Array.isArray(offset)) {
@@ -71,6 +89,12 @@ export class PanGesture extends ContinousBaseGesture {
71
89
 
72
90
  return this;
73
91
  }
92
+ /**
93
+ * When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.
94
+ * @param offset
95
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number
96
+ */
97
+
74
98
 
75
99
  failOffsetX(offset) {
76
100
  if (Array.isArray(offset)) {
@@ -84,46 +108,98 @@ export class PanGesture extends ContinousBaseGesture {
84
108
 
85
109
  return this;
86
110
  }
111
+ /**
112
+ * A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.
113
+ * @param minPointers
114
+ */
115
+
87
116
 
88
117
  minPointers(minPointers) {
89
118
  this.config.minPointers = minPointers;
90
119
  return this;
91
120
  }
121
+ /**
122
+ * When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.
123
+ * Should be a higher or equal to 0 integer.
124
+ * @param maxPointers
125
+ */
126
+
92
127
 
93
128
  maxPointers(maxPointers) {
94
129
  this.config.maxPointers = maxPointers;
95
130
  return this;
96
131
  }
132
+ /**
133
+ * Minimum distance the finger (or multiple finger) need to travel before the gesture activates.
134
+ * Expressed in points.
135
+ * @param distance
136
+ */
137
+
97
138
 
98
139
  minDistance(distance) {
99
140
  this.config.minDist = distance;
100
141
  return this;
101
142
  }
143
+ /**
144
+ * Minimum velocity the finger has to reach in order to activate handler.
145
+ * @param velocity
146
+ */
147
+
102
148
 
103
149
  minVelocity(velocity) {
104
150
  this.config.minVelocity = velocity;
105
151
  return this;
106
152
  }
153
+ /**
154
+ * Minimum velocity along X axis the finger has to reach in order to activate handler.
155
+ * @param velocity
156
+ */
157
+
107
158
 
108
159
  minVelocityX(velocity) {
109
160
  this.config.minVelocityX = velocity;
110
161
  return this;
111
162
  }
163
+ /**
164
+ * Minimum velocity along Y axis the finger has to reach in order to activate handler.
165
+ * @param velocity
166
+ */
167
+
112
168
 
113
169
  minVelocityY(velocity) {
114
170
  this.config.minVelocityY = velocity;
115
171
  return this;
116
172
  }
173
+ /**
174
+ * #### Android only
175
+ * Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).
176
+ * This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.
177
+ * @param value
178
+ */
179
+
117
180
 
118
181
  averageTouches(value) {
119
182
  this.config.avgTouches = value;
120
183
  return this;
121
184
  }
185
+ /**
186
+ * #### iOS only
187
+ * Enables two-finger gestures on supported devices, for example iPads with trackpads.
188
+ * @param value
189
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only
190
+ */
191
+
122
192
 
123
193
  enableTrackpadTwoFingerGesture(value) {
124
194
  this.config.enableTrackpadTwoFingerGesture = value;
125
195
  return this;
126
196
  }
197
+ /**
198
+ * Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.
199
+ * @param duration
200
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number
201
+ */
202
+
127
203
 
128
204
  activateAfterLongPress(duration) {
129
205
  this.config.activateAfterLongPress = duration;
@@ -1 +1 @@
1
- {"version":3,"sources":["panGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","constructor","handlerName","activeOffsetY","offset","Array","isArray","config","activeOffsetYStart","activeOffsetYEnd","activeOffsetX","activeOffsetXStart","activeOffsetXEnd","failOffsetY","failOffsetYStart","failOffsetYEnd","failOffsetX","failOffsetXStart","failOffsetXEnd","minPointers","maxPointers","minDistance","distance","minDist","minVelocity","velocity","minVelocityX","minVelocityY","averageTouches","value","avgTouches","enableTrackpadTwoFingerGesture","activateAfterLongPress","duration","onChange","callback","handlers"],"mappings":"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","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\nimport {\n PanGestureConfig,\n PanGestureHandlerEventPayload,\n} from '../PanGestureHandler';\n\nexport type PanGestureChangeEventPayload = {\n changeX: number;\n changeY: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<PanGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<PanGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: PanGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n changeX: current.translationX,\n changeY: current.translationY,\n };\n } else {\n changePayload = {\n changeX: current.translationX - previous.translationX,\n changeY: current.translationY - previous.translationY,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class PanGesture extends ContinousBaseGesture<\n PanGestureHandlerEventPayload,\n PanGestureChangeEventPayload\n> {\n public config: BaseGestureConfig & PanGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'PanGestureHandler';\n }\n\n activeOffsetY(offset: number | number[]) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetYStart = offset[0];\n this.config.activeOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetYStart = offset;\n } else {\n this.config.activeOffsetYEnd = offset;\n }\n return this;\n }\n\n activeOffsetX(offset: number | number[]) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetXStart = offset[0];\n this.config.activeOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetXStart = offset;\n } else {\n this.config.activeOffsetXEnd = offset;\n }\n return this;\n }\n\n failOffsetY(offset: number | number[]) {\n if (Array.isArray(offset)) {\n this.config.failOffsetYStart = offset[0];\n this.config.failOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetYStart = offset;\n } else {\n this.config.failOffsetYEnd = offset;\n }\n return this;\n }\n\n failOffsetX(offset: number | number[]) {\n if (Array.isArray(offset)) {\n this.config.failOffsetXStart = offset[0];\n this.config.failOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetXStart = offset;\n } else {\n this.config.failOffsetXEnd = offset;\n }\n return this;\n }\n\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n maxPointers(maxPointers: number) {\n this.config.maxPointers = maxPointers;\n return this;\n }\n\n minDistance(distance: number) {\n this.config.minDist = distance;\n return this;\n }\n\n minVelocity(velocity: number) {\n this.config.minVelocity = velocity;\n return this;\n }\n\n minVelocityX(velocity: number) {\n this.config.minVelocityX = velocity;\n return this;\n }\n\n minVelocityY(velocity: number) {\n this.config.minVelocityY = velocity;\n return this;\n }\n\n averageTouches(value: boolean) {\n this.config.avgTouches = value;\n return this;\n }\n\n enableTrackpadTwoFingerGesture(value: boolean) {\n this.config.enableTrackpadTwoFingerGesture = value;\n return this;\n }\n\n activateAfterLongPress(duration: number) {\n this.config.activateAfterLongPress = duration;\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n PanGestureHandlerEventPayload & PanGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type PanGestureType = InstanceType<typeof PanGesture>;\n"]}
1
+ {"version":3,"sources":["panGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","constructor","handlerName","activeOffsetY","offset","Array","isArray","config","activeOffsetYStart","activeOffsetYEnd","activeOffsetX","activeOffsetXStart","activeOffsetXEnd","failOffsetY","failOffsetYStart","failOffsetYEnd","failOffsetX","failOffsetXStart","failOffsetXEnd","minPointers","maxPointers","minDistance","distance","minDist","minVelocity","velocity","minVelocityX","minVelocityY","averageTouches","value","avgTouches","enableTrackpadTwoFingerGesture","activateAfterLongPress","duration","onChange","callback","handlers"],"mappings":"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","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\nimport {\n PanGestureConfig,\n PanGestureHandlerEventPayload,\n} from '../PanGestureHandler';\n\nexport type PanGestureChangeEventPayload = {\n changeX: number;\n changeY: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<PanGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<PanGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: PanGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n changeX: current.translationX,\n changeY: current.translationY,\n };\n } else {\n changePayload = {\n changeX: current.translationX - previous.translationX,\n changeY: current.translationY - previous.translationY,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class PanGesture extends ContinousBaseGesture<\n PanGestureHandlerEventPayload,\n PanGestureChangeEventPayload\n> {\n public config: BaseGestureConfig & PanGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'PanGestureHandler';\n }\n\n /**\n * Range along Y axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number\n */\n activeOffsetY(\n offset: number | [activeOffsetYStart: number, activeOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetYStart = offset[0];\n this.config.activeOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetYStart = offset;\n } else {\n this.config.activeOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * Range along X axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number\n */\n activeOffsetX(\n offset: number | [activeOffsetXStart: number, activeOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetXStart = offset[0];\n this.config.activeOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetXStart = offset;\n } else {\n this.config.activeOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number\n */\n failOffsetY(\n offset: number | [failOffsetYStart: number, failOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetYStart = offset[0];\n this.config.failOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetYStart = offset;\n } else {\n this.config.failOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number\n */\n failOffsetX(\n offset: number | [failOffsetXStart: number, failOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetXStart = offset[0];\n this.config.failOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetXStart = offset;\n } else {\n this.config.failOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.\n * @param minPointers\n */\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n /**\n * When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.\n * Should be a higher or equal to 0 integer.\n * @param maxPointers\n */\n maxPointers(maxPointers: number) {\n this.config.maxPointers = maxPointers;\n return this;\n }\n\n /**\n * Minimum distance the finger (or multiple finger) need to travel before the gesture activates.\n * Expressed in points.\n * @param distance\n */\n minDistance(distance: number) {\n this.config.minDist = distance;\n return this;\n }\n\n /**\n * Minimum velocity the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocity(velocity: number) {\n this.config.minVelocity = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along X axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityX(velocity: number) {\n this.config.minVelocityX = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along Y axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityY(velocity: number) {\n this.config.minVelocityY = velocity;\n return this;\n }\n\n /**\n * #### Android only\n * Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).\n * This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.\n * @param value\n */\n averageTouches(value: boolean) {\n this.config.avgTouches = value;\n return this;\n }\n\n /**\n * #### iOS only\n * Enables two-finger gestures on supported devices, for example iPads with trackpads.\n * @param value\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only\n */\n enableTrackpadTwoFingerGesture(value: boolean) {\n this.config.enableTrackpadTwoFingerGesture = value;\n return this;\n }\n\n /**\n * Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.\n * @param duration\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number\n */\n activateAfterLongPress(duration: number) {\n this.config.activateAfterLongPress = duration;\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n PanGestureHandlerEventPayload & PanGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type PanGestureType = InstanceType<typeof PanGesture>;\n"]}
@@ -10,36 +10,78 @@ export class TapGesture extends BaseGesture {
10
10
  this.handlerName = 'TapGestureHandler';
11
11
  this.shouldCancelWhenOutside(true);
12
12
  }
13
+ /**
14
+ * Minimum number of pointers (fingers) required to be placed before the gesture activates.
15
+ * Should be a positive integer. The default value is 1.
16
+ * @param minPointers
17
+ */
18
+
13
19
 
14
20
  minPointers(minPointers) {
15
21
  this.config.minPointers = minPointers;
16
22
  return this;
17
23
  }
24
+ /**
25
+ * Number of tap gestures required to activate the gesture.
26
+ * The default value is 1.
27
+ * @param count
28
+ */
29
+
18
30
 
19
31
  numberOfTaps(count) {
20
32
  this.config.numberOfTaps = count;
21
33
  return this;
22
34
  }
35
+ /**
36
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.
37
+ * @param maxDist
38
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number
39
+ */
40
+
23
41
 
24
42
  maxDistance(maxDist) {
25
43
  this.config.maxDist = maxDist;
26
44
  return this;
27
45
  }
46
+ /**
47
+ * Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.
48
+ * The default value is 500.
49
+ * @param duration
50
+ */
51
+
28
52
 
29
53
  maxDuration(duration) {
30
54
  this.config.maxDurationMs = duration;
31
55
  return this;
32
56
  }
57
+ /**
58
+ * Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.
59
+ * The default value is 500.
60
+ * @param delay
61
+ */
62
+
33
63
 
34
64
  maxDelay(delay) {
35
65
  this.config.maxDelayMs = delay;
36
66
  return this;
37
67
  }
68
+ /**
69
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.
70
+ * @param delta
71
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number
72
+ */
73
+
38
74
 
39
75
  maxDeltaX(delta) {
40
76
  this.config.maxDeltaX = delta;
41
77
  return this;
42
78
  }
79
+ /**
80
+ * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.
81
+ * @param delta
82
+ * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number
83
+ */
84
+
43
85
 
44
86
  maxDeltaY(delta) {
45
87
  this.config.maxDeltaY = delta;
@@ -1 +1 @@
1
- {"version":3,"sources":["tapGesture.ts"],"names":["BaseGesture","TapGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;AAAA,SAA4BA,WAA5B,QAA+C,WAA/C;AAMA,OAAO,MAAMC,UAAN,SAAyBD,WAAzB,CAAoE;AAGzEE,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":["BaseGesture","TapGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;AAAA,SAA4BA,WAA5B,QAA+C,WAA/C;AAMA,OAAO,MAAMC,UAAN,SAAyBD,WAAzB,CAAoE;AAGzEE,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"]}
@@ -1,10 +1,10 @@
1
1
  import { initialize } from './init';
2
2
  export { Directions } from './Directions';
3
3
  export { State } from './State';
4
- export { MouseButton } from './web/interfaces';
5
4
  export { PointerType } from './PointerType';
6
5
  export { default as gestureHandlerRootHOC } from './components/gestureHandlerRootHOC';
7
6
  export { default as GestureHandlerRootView } from './components/GestureHandlerRootView';
7
+ export { MouseButton } from './handlers/gestureHandlerCommon';
8
8
  export { TapGestureHandler } from './handlers/TapGestureHandler';
9
9
  export { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';
10
10
  export { LongPressGestureHandler } from './handlers/LongPressGestureHandler';
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["initialize","Directions","State","MouseButton","PointerType","default","gestureHandlerRootHOC","GestureHandlerRootView","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PanGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","createNativeWrapper","GestureDetector","GestureObjects","Gesture","NativeViewGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton","PureNativeButton","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","Switch","TextInput","DrawerLayoutAndroid","FlatList","RefreshControl","HoverEffect","Swipeable","DrawerLayout","enableExperimentalWebImplementation","enableLegacyWebImplementation"],"mappings":"AAAA,SAASA,UAAT,QAA2B,QAA3B;AAEA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,OAAO,IAAIC,qBAApB,QAAiD,oCAAjD;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,qCAAlD;AA+CA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,wBAAT,QAAyC,qCAAzC;AACA,SAASC,uBAAT,QAAwC,oCAAxC;AACA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAASC,sBAAT,QAAuC,mCAAvC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAAST,OAAO,IAAIU,mBAApB,QAA+C,gCAA/C;AAKA,SAASC,eAAT,QAAgC,qCAAhC;AACA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,oCAA1C;AAkBA,SAASC,wBAAT,QAAyC,qCAAzC;AAOA,SACEC,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,gBAJF,EAKEC,gBALF,QAMO,6BANP;AAYA,SACEC,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,QAKO,yBALP;AAMA,SACEC,UADF,EAEEC,MAFF,EAGEC,SAHF,EAIEC,mBAJF,EAKEC,QALF,EAMEC,cANF,QAOO,gCAPP;AAQA,SAASC,WAAT,QAA4B,kCAA5B;AAyCA,SAAS9B,OAAO,IAAI+B,SAApB,QAAqC,wBAArC;AASA,SAAS/B,OAAO,IAAIgC,YAApB,QAAwC,2BAAxC;AAEA,SACEC,mCADF,EAEEC,6BAFF,QAGO,8BAHP;AAKAvC,UAAU","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":["initialize","Directions","State","PointerType","default","gestureHandlerRootHOC","GestureHandlerRootView","MouseButton","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PanGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","createNativeWrapper","GestureDetector","GestureObjects","Gesture","NativeViewGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton","PureNativeButton","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","Switch","TextInput","DrawerLayoutAndroid","FlatList","RefreshControl","HoverEffect","Swipeable","DrawerLayout","enableExperimentalWebImplementation","enableLegacyWebImplementation"],"mappings":"AAAA,SAASA,UAAT,QAA2B,QAA3B;AAEA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,OAAO,IAAIC,qBAApB,QAAiD,oCAAjD;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,qCAAlD;AAeA,SAASC,WAAT,QAA4B,iCAA5B;AAiCA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,wBAAT,QAAyC,qCAAzC;AACA,SAASC,uBAAT,QAAwC,oCAAxC;AACA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAASC,sBAAT,QAAuC,mCAAvC;AACA,SAASC,mBAAT,QAAoC,gCAApC;AACA,SAASV,OAAO,IAAIW,mBAApB,QAA+C,gCAA/C;AAKA,SAASC,eAAT,QAAgC,qCAAhC;AACA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,oCAA1C;AAkBA,SAASC,wBAAT,QAAyC,qCAAzC;AAOA,SACEC,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,gBAJF,EAKEC,gBALF,QAMO,6BANP;AAYA,SACEC,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,QAKO,yBALP;AAMA,SACEC,UADF,EAEEC,MAFF,EAGEC,SAHF,EAIEC,mBAJF,EAKEC,QALF,EAMEC,cANF,QAOO,gCAPP;AAQA,SAASC,WAAT,QAA4B,kCAA5B;AAyCA,SAAS/B,OAAO,IAAIgC,SAApB,QAAqC,wBAArC;AASA,SAAShC,OAAO,IAAIiC,YAApB,QAAwC,2BAAxC;AAEA,SACEC,mCADF,EAEEC,6BAFF,QAGO,8BAHP;AAKAvC,UAAU","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"]}
@@ -11,6 +11,7 @@ const createGestureHandler = NOOP;
11
11
  const dropGestureHandler = NOOP;
12
12
  const updateGestureHandler = NOOP;
13
13
  const flushOperations = NOOP;
14
+ const install = NOOP;
14
15
  const NativeViewGestureHandler = View;
15
16
  const TapGestureHandler = View;
16
17
  const ForceTouchGestureHandler = View;
@@ -49,6 +50,7 @@ export default {
49
50
  dropGestureHandler,
50
51
  updateGestureHandler,
51
52
  flushOperations,
53
+ install,
52
54
  // probably can be removed
53
55
  Directions,
54
56
  State
@@ -1 +1 @@
1
- {"version":3,"sources":["mocks.ts"],"names":["TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","View","State","Directions","NOOP","PanGestureHandler","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton"],"mappings":"AAAA,SACEA,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,EAKEC,UALF,EAMEC,QANF,EAOEC,MAPF,EAQEC,SARF,EASEC,mBATF,EAUEC,IAVF,QAWO,cAXP;AAYA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,UAAT,QAA2B,cAA3B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGJ,IAA1B;AACA,MAAMK,oBAAoB,GAAGF,IAA7B;AACA,MAAMG,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,kBAAkB,GAAGJ,IAA3B;AACA,MAAMK,oBAAoB,GAAGL,IAA7B;AACA,MAAMM,eAAe,GAAGN,IAAxB;AACA,MAAMO,wBAAwB,GAAGV,IAAjC;AACA,MAAMW,iBAAiB,GAAGX,IAA1B;AACA,MAAMY,wBAAwB,GAAGZ,IAAjC;AACA,MAAMa,uBAAuB,GAAGb,IAAhC;AACA,MAAMc,mBAAmB,GAAGd,IAA5B;AACA,MAAMe,sBAAsB,GAAGf,IAA/B;AACA,MAAMgB,mBAAmB,GAAGhB,IAA5B;AACA,MAAMiB,SAAS,GAAGzB,uBAAlB;AACA,MAAM0B,UAAU,GAAG1B,uBAAnB;AACA,MAAM2B,UAAU,GAAG3B,uBAAnB;AACA,MAAM4B,gBAAgB,GAAG5B,uBAAzB;AAEA,eAAe;AACbD,EAAAA,kBADa;AAEbC,EAAAA,uBAFa;AAGbC,EAAAA,gBAHa;AAIbC,EAAAA,wBAJa;AAKbC,EAAAA,UALa;AAMbC,EAAAA,QANa;AAObC,EAAAA,MAPa;AAQbC,EAAAA,SARa;AASbC,EAAAA,mBATa;AAUbW,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbC,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBbhB,EAAAA,iBArBa;AAsBbC,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0BbC,EAAAA,eA1Ba;AA2Bb;AACAP,EAAAA,UA5Ba;AA6BbD,EAAAA;AA7Ba,CAAf","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":["TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","View","State","Directions","NOOP","PanGestureHandler","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","flushOperations","install","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","BaseButton","RectButton","BorderlessButton"],"mappings":"AAAA,SACEA,kBADF,EAEEC,uBAFF,EAGEC,gBAHF,EAIEC,wBAJF,EAKEC,UALF,EAMEC,QANF,EAOEC,MAPF,EAQEC,SARF,EASEC,mBATF,EAUEC,IAVF,QAWO,cAXP;AAYA,SAASC,KAAT,QAAsB,SAAtB;AACA,SAASC,UAAT,QAA2B,cAA3B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGJ,IAA1B;AACA,MAAMK,oBAAoB,GAAGF,IAA7B;AACA,MAAMG,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,kBAAkB,GAAGJ,IAA3B;AACA,MAAMK,oBAAoB,GAAGL,IAA7B;AACA,MAAMM,eAAe,GAAGN,IAAxB;AACA,MAAMO,OAAO,GAAGP,IAAhB;AACA,MAAMQ,wBAAwB,GAAGX,IAAjC;AACA,MAAMY,iBAAiB,GAAGZ,IAA1B;AACA,MAAMa,wBAAwB,GAAGb,IAAjC;AACA,MAAMc,uBAAuB,GAAGd,IAAhC;AACA,MAAMe,mBAAmB,GAAGf,IAA5B;AACA,MAAMgB,sBAAsB,GAAGhB,IAA/B;AACA,MAAMiB,mBAAmB,GAAGjB,IAA5B;AACA,MAAMkB,SAAS,GAAG1B,uBAAlB;AACA,MAAM2B,UAAU,GAAG3B,uBAAnB;AACA,MAAM4B,UAAU,GAAG5B,uBAAnB;AACA,MAAM6B,gBAAgB,GAAG7B,uBAAzB;AAEA,eAAe;AACbD,EAAAA,kBADa;AAEbC,EAAAA,uBAFa;AAGbC,EAAAA,gBAHa;AAIbC,EAAAA,wBAJa;AAKbC,EAAAA,UALa;AAMbC,EAAAA,QANa;AAObC,EAAAA,MAPa;AAQbC,EAAAA,SARa;AASbC,EAAAA,mBATa;AAUbY,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbC,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBbjB,EAAAA,iBArBa;AAsBbC,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0BbC,EAAAA,eA1Ba;AA2BbC,EAAAA,OA3Ba;AA4Bb;AACAR,EAAAA,UA7Ba;AA8BbD,EAAAA;AA9Ba,CAAf","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":["codegenNativeComponent"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAiBA,eAAeA,sBAAsB,CAAc,wBAAd,CAArC","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":["codegenNativeComponent"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,yDAAnC;AAqBA,eAAeA,sBAAsB,CAAc,wBAAd,CAArC","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"]}
@@ -10,6 +10,9 @@ export function withPrevAndCurrent(array, mapFn) {
10
10
  const currentArr = [...array];
11
11
  const transformedArr = [];
12
12
  currentArr.forEach((current, i) => {
13
+ // 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).
14
+ // Unfortunately, linter on our CI does not allow this type of casting as it is unnecessary. To bypass that we use eslint-disable.
15
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
13
16
  const previous = previousArr[i];
14
17
  const transformed = mapFn(previous, current);
15
18
  previousArr.push(transformed);
@@ -39,6 +42,7 @@ export function isFabric() {
39
42
  export function isRemoteDebuggingEnabled() {
40
43
  // react-native-reanimated checks if in remote debugging in the same way
41
44
  // @ts-ignore global is available but node types are not included
42
- return !global.nativeCallSyncHook || global.__REMOTEDEV__;
45
+ const localGlobal = global;
46
+ return (!localGlobal.nativeCallSyncHook || !!localGlobal.__REMOTEDEV__) && !localGlobal.RN$Bridgeless;
43
47
  }
44
48
  //# 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":"AAAA,OAAO,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;AAMD,OAAO,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;;AACA,OAAO,SAASO,WAAT,CAAqBf,MAArB,EAAqCgB,GAArC,EAAkD;AACvD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCpB,MAArC,EAA6CgB,GAA7C,CAAP;AACD;AAED,OAAO,SAASK,SAAT,GAA8B;AACnC;AACA,SAAON,WAAW,CAACO,MAAD,EAAS,SAAT,CAAX,IAAkC,CAAC,CAACC,OAAO,CAACC,GAAR,CAAYC,cAAvD;AACD;AAED,OAAO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,SAAQ,kCAAiCA,GAAI,EAA7C;AACD,C,CAED;AACA;;AACA,OAAO,SAASC,QAAT,GAA6B;AAAA;;AAClC;AACA,SAAO,CAAC,aAACN,MAAD,oCAAC,QAAQO,qBAAT,CAAR;AACD;AAED,OAAO,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":"AAAA,OAAO,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;AAMD,OAAO,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;;AACA,OAAO,SAASO,WAAT,CAAqBf,MAArB,EAAqCgB,GAArC,EAAkD;AACvD,SAAOC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCpB,MAArC,EAA6CgB,GAA7C,CAAP;AACD;AAED,OAAO,SAASK,SAAT,GAA8B;AACnC;AACA,SAAON,WAAW,CAACO,MAAD,EAAS,SAAT,CAAX,IAAkC,CAAC,CAACC,OAAO,CAACC,GAAR,CAAYC,cAAvD;AACD;AAED,OAAO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,SAAQ,kCAAiCA,GAAI,EAA7C;AACD,C,CAED;AACA;;AACA,OAAO,SAASC,QAAT,GAA6B;AAAA;;AAClC;AACA,SAAO,CAAC,aAACN,MAAD,oCAAC,QAAQO,qBAAT,CAAR;AACD;AAED,OAAO,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,39 @@
1
+ // Gesture Handlers
2
+ import PanGestureHandler from './handlers/PanGestureHandler';
3
+ import TapGestureHandler from './handlers/TapGestureHandler';
4
+ import LongPressGestureHandler from './handlers/LongPressGestureHandler';
5
+ import PinchGestureHandler from './handlers/PinchGestureHandler';
6
+ import RotationGestureHandler from './handlers/RotationGestureHandler';
7
+ import FlingGestureHandler from './handlers/FlingGestureHandler';
8
+ import NativeViewGestureHandler from './handlers/NativeViewGestureHandler';
9
+ import ManualGestureHandler from './handlers/ManualGestureHandler';
10
+ import HoverGestureHandler from './handlers/HoverGestureHandler'; //Hammer Handlers
11
+
12
+ import HammerNativeViewGestureHandler from '../web_hammer/NativeViewGestureHandler';
13
+ import HammerPanGestureHandler from '../web_hammer/PanGestureHandler';
14
+ import HammerTapGestureHandler from '../web_hammer/TapGestureHandler';
15
+ import HammerLongPressGestureHandler from '../web_hammer/LongPressGestureHandler';
16
+ import HammerPinchGestureHandler from '../web_hammer/PinchGestureHandler';
17
+ import HammerRotationGestureHandler from '../web_hammer/RotationGestureHandler';
18
+ import HammerFlingGestureHandler from '../web_hammer/FlingGestureHandler';
19
+ export const Gestures = {
20
+ NativeViewGestureHandler,
21
+ PanGestureHandler,
22
+ TapGestureHandler,
23
+ LongPressGestureHandler,
24
+ PinchGestureHandler,
25
+ RotationGestureHandler,
26
+ FlingGestureHandler,
27
+ ManualGestureHandler,
28
+ HoverGestureHandler
29
+ };
30
+ export const HammerGestures = {
31
+ NativeViewGestureHandler: HammerNativeViewGestureHandler,
32
+ PanGestureHandler: HammerPanGestureHandler,
33
+ TapGestureHandler: HammerTapGestureHandler,
34
+ LongPressGestureHandler: HammerLongPressGestureHandler,
35
+ PinchGestureHandler: HammerPinchGestureHandler,
36
+ RotationGestureHandler: HammerRotationGestureHandler,
37
+ FlingGestureHandler: HammerFlingGestureHandler
38
+ };
39
+ //# sourceMappingURL=Gestures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Gestures.ts"],"names":["PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","Gestures","HammerGestures"],"mappings":"AAAA;AACA,OAAOA,iBAAP,MAA8B,8BAA9B;AACA,OAAOC,iBAAP,MAA8B,8BAA9B;AACA,OAAOC,uBAAP,MAAoC,oCAApC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC;AACA,OAAOC,sBAAP,MAAmC,mCAAnC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC;AACA,OAAOC,wBAAP,MAAqC,qCAArC;AACA,OAAOC,oBAAP,MAAiC,iCAAjC;AACA,OAAOC,mBAAP,MAAgC,gCAAhC,C,CAEA;;AACA,OAAOC,8BAAP,MAA2C,wCAA3C;AACA,OAAOC,uBAAP,MAAoC,iCAApC;AACA,OAAOC,uBAAP,MAAoC,iCAApC;AACA,OAAOC,6BAAP,MAA0C,uCAA1C;AACA,OAAOC,yBAAP,MAAsC,mCAAtC;AACA,OAAOC,4BAAP,MAAyC,sCAAzC;AACA,OAAOC,yBAAP,MAAsC,mCAAtC;AAEA,OAAO,MAAMC,QAAQ,GAAG;AACtBV,EAAAA,wBADsB;AAEtBN,EAAAA,iBAFsB;AAGtBC,EAAAA,iBAHsB;AAItBC,EAAAA,uBAJsB;AAKtBC,EAAAA,mBALsB;AAMtBC,EAAAA,sBANsB;AAOtBC,EAAAA,mBAPsB;AAQtBE,EAAAA,oBARsB;AAStBC,EAAAA;AATsB,CAAjB;AAYP,OAAO,MAAMS,cAAc,GAAG;AAC5BX,EAAAA,wBAAwB,EAAEG,8BADE;AAE5BT,EAAAA,iBAAiB,EAAEU,uBAFS;AAG5BT,EAAAA,iBAAiB,EAAEU,uBAHS;AAI5BT,EAAAA,uBAAuB,EAAEU,6BAJG;AAK5BT,EAAAA,mBAAmB,EAAEU,yBALO;AAM5BT,EAAAA,sBAAsB,EAAEU,4BANI;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"]}
@@ -1,8 +1,3 @@
1
1
  export const DEFAULT_TOUCH_SLOP = 15;
2
- export const Direction = {
3
- RIGHT: 1,
4
- LEFT: 2,
5
- UP: 4,
6
- DOWN: 8
7
- };
2
+ export const MINIMAL_FLING_VELOCITY = 0.1;
8
3
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.ts"],"names":["DEFAULT_TOUCH_SLOP","Direction","RIGHT","LEFT","UP","DOWN"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,EAA3B;AAEP,OAAO,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":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,EAA3B;AACP,OAAO,MAAMC,sBAAsB,GAAG,GAA/B","sourcesContent":["export const DEFAULT_TOUCH_SLOP = 15;\nexport const MINIMAL_FLING_VELOCITY = 0.1;\n"]}