react-native-gesture-handler 2.17.1 → 2.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. package/ReanimatedSwipeable/package.json +6 -0
  2. package/android/build.gradle +0 -103
  3. package/android/gradle.properties +0 -7
  4. package/android/paper/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +22 -10
  5. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +1 -1
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +16 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +7 -8
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +14 -4
  9. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +3 -1
  10. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +3 -1
  11. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +2 -1
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +8 -7
  13. package/android/src/main/jni/cpp-adapter.cpp +2 -2
  14. package/apple/Handlers/RNFlingHandler.m +1 -0
  15. package/apple/Handlers/RNForceTouchHandler.m +2 -0
  16. package/apple/Handlers/RNLongPressHandler.m +2 -1
  17. package/apple/Handlers/RNManualHandler.m +1 -0
  18. package/apple/Handlers/RNNativeViewHandler.mm +31 -27
  19. package/apple/Handlers/RNPanHandler.m +1 -0
  20. package/apple/Handlers/RNPinchHandler.m +1 -0
  21. package/apple/Handlers/RNRotationHandler.m +1 -0
  22. package/apple/Handlers/RNTapHandler.m +1 -0
  23. package/apple/RNGestureHandlerModule.mm +1 -2
  24. package/apple/RNRootViewGestureRecognizer.m +5 -0
  25. package/lib/commonjs/Directions.js +2 -2
  26. package/lib/commonjs/Directions.js.map +1 -1
  27. package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
  28. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  29. package/lib/commonjs/components/DrawerLayout.js +2 -2
  30. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  31. package/lib/commonjs/components/GestureButtons.js +3 -3
  32. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  33. package/lib/commonjs/components/GestureButtonsProps.js +6 -0
  34. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -0
  35. package/lib/commonjs/components/GestureComponents.js +1 -1
  36. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  37. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  38. package/lib/commonjs/components/GestureHandlerRootView.android.js +1 -1
  39. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  40. package/lib/commonjs/components/GestureHandlerRootView.js +1 -1
  41. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  42. package/lib/commonjs/components/Pressable/Pressable.js +334 -0
  43. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -0
  44. package/lib/commonjs/components/Pressable/PressableProps.js +6 -0
  45. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -0
  46. package/lib/commonjs/components/Pressable/index.js +24 -0
  47. package/lib/commonjs/components/Pressable/index.js.map +1 -0
  48. package/lib/commonjs/components/Pressable/utils.js +136 -0
  49. package/lib/commonjs/components/Pressable/utils.js.map +1 -0
  50. package/lib/commonjs/components/ReanimatedSwipeable.js +317 -0
  51. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -0
  52. package/lib/commonjs/components/Swipeable.js +8 -3
  53. package/lib/commonjs/components/Swipeable.js.map +1 -1
  54. package/lib/commonjs/components/touchables/GenericTouchable.js +4 -4
  55. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  56. package/lib/commonjs/components/touchables/GenericTouchableProps.js +6 -0
  57. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -0
  58. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  59. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +1 -1
  60. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  61. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +6 -0
  62. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
  63. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  64. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  65. package/lib/commonjs/getShadowNodeFromRef.js +2 -2
  66. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  67. package/lib/commonjs/ghQueueMicrotask.js +3 -4
  68. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  69. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  70. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  71. package/lib/commonjs/handlers/GestureHandlerEventPayload.js +2 -0
  72. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -0
  73. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  74. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  75. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  76. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  77. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  78. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  79. package/lib/commonjs/handlers/createHandler.js +21 -19
  80. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  81. package/lib/commonjs/handlers/createNativeWrapper.js +3 -3
  82. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  83. package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -86
  84. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  85. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  86. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -9
  87. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  88. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +2 -2
  89. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  90. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
  91. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  92. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +21 -31
  93. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  94. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
  95. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  96. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +5 -5
  97. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  98. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  99. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  100. package/lib/commonjs/handlers/gestures/gesture.js +7 -7
  101. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  102. package/lib/commonjs/handlers/gestures/gestureComposition.js +5 -5
  103. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  104. package/lib/commonjs/handlers/gestures/gestureStateManager.js +1 -1
  105. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  106. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  107. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  108. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  109. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  110. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  111. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  112. package/lib/commonjs/handlers/getNextHandlerTag.js +12 -0
  113. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -0
  114. package/lib/commonjs/handlers/handlersRegistry.js +0 -6
  115. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  116. package/lib/commonjs/handlers/utils.js +91 -0
  117. package/lib/commonjs/handlers/utils.js.map +1 -0
  118. package/lib/commonjs/index.js +8 -0
  119. package/lib/commonjs/index.js.map +1 -1
  120. package/lib/commonjs/init.js +1 -1
  121. package/lib/commonjs/init.js.map +1 -1
  122. package/lib/commonjs/jestUtils/jestUtils.js +2 -2
  123. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  124. package/lib/commonjs/mocks.js +2 -2
  125. package/lib/commonjs/mocks.js.map +1 -1
  126. package/lib/commonjs/utils.js +1 -1
  127. package/lib/commonjs/utils.js.map +1 -1
  128. package/lib/commonjs/web/Gestures.js +1 -1
  129. package/lib/commonjs/web/Gestures.js.map +1 -1
  130. package/lib/commonjs/web/detectors/RotationGestureDetector.js +1 -1
  131. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  132. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +4 -4
  133. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  134. package/lib/commonjs/web/handlers/FlingGestureHandler.js +1 -1
  135. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  136. package/lib/commonjs/web/handlers/GestureHandler.js +6 -11
  137. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  138. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +1 -1
  139. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  140. package/lib/commonjs/web/handlers/PanGestureHandler.js +1 -1
  141. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  142. package/lib/commonjs/web/handlers/TapGestureHandler.js +1 -1
  143. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  144. package/lib/commonjs/web/tools/EventManager.js +2 -2
  145. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  146. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +4 -11
  147. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  148. package/lib/commonjs/web/tools/LeastSquareSolver.js +18 -18
  149. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  150. package/lib/commonjs/web/tools/PointerEventManager.js +2 -2
  151. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  152. package/lib/commonjs/web/tools/PointerTracker.js +1 -1
  153. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  154. package/lib/commonjs/web/tools/TouchEventManager.js +4 -4
  155. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  156. package/lib/commonjs/web/tools/VelocityTracker.js +6 -6
  157. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  158. package/lib/commonjs/web_hammer/NodeManager.js +2 -0
  159. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  160. package/lib/module/Directions.js +2 -2
  161. package/lib/module/Directions.js.map +1 -1
  162. package/lib/module/RNGestureHandlerModule.web.js +2 -2
  163. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  164. package/lib/module/components/DrawerLayout.js +2 -2
  165. package/lib/module/components/DrawerLayout.js.map +1 -1
  166. package/lib/module/components/GestureButtons.js +3 -3
  167. package/lib/module/components/GestureButtons.js.map +1 -1
  168. package/lib/module/components/GestureButtonsProps.js +2 -0
  169. package/lib/module/components/GestureButtonsProps.js.map +1 -0
  170. package/lib/module/components/GestureComponents.js +1 -1
  171. package/lib/module/components/GestureComponents.js.map +1 -1
  172. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  173. package/lib/module/components/GestureHandlerRootView.android.js +1 -1
  174. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  175. package/lib/module/components/GestureHandlerRootView.js +1 -1
  176. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  177. package/lib/module/components/Pressable/Pressable.js +309 -0
  178. package/lib/module/components/Pressable/Pressable.js.map +1 -0
  179. package/lib/module/components/Pressable/PressableProps.js +2 -0
  180. package/lib/module/components/Pressable/PressableProps.js.map +1 -0
  181. package/lib/module/components/Pressable/index.js +3 -0
  182. package/lib/module/components/Pressable/index.js.map +1 -0
  183. package/lib/module/components/Pressable/utils.js +120 -0
  184. package/lib/module/components/Pressable/utils.js.map +1 -0
  185. package/lib/module/components/ReanimatedSwipeable.js +293 -0
  186. package/lib/module/components/ReanimatedSwipeable.js.map +1 -0
  187. package/lib/module/components/Swipeable.js +9 -3
  188. package/lib/module/components/Swipeable.js.map +1 -1
  189. package/lib/module/components/touchables/GenericTouchable.js +4 -4
  190. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  191. package/lib/module/components/touchables/GenericTouchableProps.js +2 -0
  192. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -0
  193. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  194. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +1 -1
  195. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  196. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +2 -0
  197. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
  198. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  199. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  200. package/lib/module/getShadowNodeFromRef.js +2 -2
  201. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  202. package/lib/module/ghQueueMicrotask.js +3 -4
  203. package/lib/module/ghQueueMicrotask.js.map +1 -1
  204. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  205. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  206. package/lib/module/handlers/GestureHandlerEventPayload.js +2 -0
  207. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -0
  208. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  209. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  210. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  211. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  212. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  213. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  214. package/lib/module/handlers/createHandler.js +6 -5
  215. package/lib/module/handlers/createHandler.js.map +1 -1
  216. package/lib/module/handlers/createNativeWrapper.js +3 -3
  217. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  218. package/lib/module/handlers/gestureHandlerCommon.js +0 -72
  219. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  220. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  221. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +4 -4
  222. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  223. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -1
  224. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  225. package/lib/module/handlers/gestures/GestureDetector/index.js +1 -1
  226. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  227. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +18 -28
  228. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  229. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
  230. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  231. package/lib/module/handlers/gestures/GestureDetector/utils.js +5 -5
  232. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  233. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  234. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  235. package/lib/module/handlers/gestures/gesture.js +6 -6
  236. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  237. package/lib/module/handlers/gestures/gestureComposition.js +5 -5
  238. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  239. package/lib/module/handlers/gestures/gestureStateManager.js +1 -1
  240. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  241. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  242. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  243. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  244. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  245. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  246. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  247. package/lib/module/handlers/getNextHandlerTag.js +5 -0
  248. package/lib/module/handlers/getNextHandlerTag.js.map +1 -0
  249. package/lib/module/handlers/handlersRegistry.js +0 -4
  250. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  251. package/lib/module/handlers/utils.js +73 -0
  252. package/lib/module/handlers/utils.js.map +1 -0
  253. package/lib/module/index.js +1 -0
  254. package/lib/module/index.js.map +1 -1
  255. package/lib/module/init.js +1 -1
  256. package/lib/module/init.js.map +1 -1
  257. package/lib/module/jestUtils/jestUtils.js +2 -2
  258. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  259. package/lib/module/mocks.js +2 -2
  260. package/lib/module/mocks.js.map +1 -1
  261. package/lib/module/utils.js +1 -1
  262. package/lib/module/utils.js.map +1 -1
  263. package/lib/module/web/Gestures.js +1 -1
  264. package/lib/module/web/Gestures.js.map +1 -1
  265. package/lib/module/web/detectors/RotationGestureDetector.js +1 -1
  266. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  267. package/lib/module/web/detectors/ScaleGestureDetector.js +4 -4
  268. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  269. package/lib/module/web/handlers/FlingGestureHandler.js +1 -1
  270. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  271. package/lib/module/web/handlers/GestureHandler.js +6 -11
  272. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  273. package/lib/module/web/handlers/NativeViewGestureHandler.js +1 -1
  274. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  275. package/lib/module/web/handlers/PanGestureHandler.js +1 -1
  276. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  277. package/lib/module/web/handlers/TapGestureHandler.js +1 -1
  278. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  279. package/lib/module/web/tools/EventManager.js +2 -2
  280. package/lib/module/web/tools/EventManager.js.map +1 -1
  281. package/lib/module/web/tools/GestureHandlerWebDelegate.js +4 -11
  282. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  283. package/lib/module/web/tools/LeastSquareSolver.js +18 -18
  284. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  285. package/lib/module/web/tools/PointerEventManager.js +2 -2
  286. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  287. package/lib/module/web/tools/PointerTracker.js +1 -1
  288. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  289. package/lib/module/web/tools/TouchEventManager.js +4 -4
  290. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  291. package/lib/module/web/tools/VelocityTracker.js +6 -6
  292. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  293. package/lib/module/web_hammer/NodeManager.js +1 -1
  294. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  295. package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -1
  296. package/lib/typescript/components/GestureButtons.d.ts +2 -85
  297. package/lib/typescript/components/GestureButtonsProps.d.ts +99 -0
  298. package/lib/typescript/components/GestureHandlerButton.d.ts +1 -1
  299. package/lib/typescript/components/Pressable/Pressable.d.ts +3 -0
  300. package/lib/typescript/components/Pressable/PressableProps.d.ts +116 -0
  301. package/lib/typescript/components/Pressable/index.d.ts +2 -0
  302. package/lib/typescript/components/Pressable/utils.d.ts +15 -0
  303. package/lib/typescript/components/ReanimatedSwipeable.d.ts +125 -0
  304. package/lib/typescript/components/Swipeable.d.ts +5 -0
  305. package/lib/typescript/components/touchables/GenericTouchable.d.ts +4 -16
  306. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +14 -0
  307. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -1
  308. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -9
  309. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +9 -0
  310. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +1 -1
  311. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -1
  312. package/lib/typescript/handlers/FlingGestureHandler.d.ts +2 -6
  313. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +1 -10
  314. package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +159 -0
  315. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -35
  316. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +2 -6
  317. package/lib/typescript/handlers/PanGestureHandler.d.ts +3 -51
  318. package/lib/typescript/handlers/PinchGestureHandler.d.ts +2 -23
  319. package/lib/typescript/handlers/RotationGestureHandler.d.ts +2 -23
  320. package/lib/typescript/handlers/TapGestureHandler.d.ts +2 -6
  321. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -5
  322. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +10 -9
  323. package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +1 -0
  324. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -0
  325. package/lib/typescript/handlers/gestures/flingGesture.d.ts +2 -1
  326. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +2 -1
  327. package/lib/typescript/handlers/gestures/gesture.d.ts +2 -8
  328. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +2 -1
  329. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +2 -1
  330. package/lib/typescript/handlers/gestures/panGesture.d.ts +2 -1
  331. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +1 -1
  332. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +1 -1
  333. package/lib/typescript/handlers/gestures/tapGesture.d.ts +2 -1
  334. package/lib/typescript/handlers/getNextHandlerTag.d.ts +1 -0
  335. package/lib/typescript/handlers/handlersRegistry.d.ts +1 -2
  336. package/lib/typescript/handlers/utils.d.ts +6 -0
  337. package/lib/typescript/index.d.ts +12 -9
  338. package/lib/typescript/jestUtils/jestUtils.d.ts +9 -7
  339. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +1 -0
  340. package/lib/typescript/web/handlers/GestureHandler.d.ts +1 -0
  341. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +1 -0
  342. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +1 -0
  343. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +1 -0
  344. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -0
  345. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +1 -0
  346. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +1 -0
  347. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +1 -0
  348. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +1 -0
  349. package/lib/typescript/web_hammer/NodeManager.d.ts +4 -5
  350. package/package.json +14 -16
  351. package/src/Directions.ts +2 -2
  352. package/src/RNGestureHandlerModule.web.ts +2 -2
  353. package/src/components/DrawerLayout.tsx +7 -9
  354. package/src/components/GestureButtons.tsx +13 -123
  355. package/src/components/GestureButtonsProps.ts +115 -0
  356. package/src/components/GestureComponents.tsx +1 -1
  357. package/src/components/GestureHandlerButton.tsx +1 -1
  358. package/src/components/GestureHandlerRootView.android.tsx +1 -1
  359. package/src/components/GestureHandlerRootView.tsx +1 -1
  360. package/src/components/Pressable/Pressable.tsx +398 -0
  361. package/src/components/Pressable/PressableProps.tsx +149 -0
  362. package/src/components/Pressable/index.ts +2 -0
  363. package/src/components/Pressable/utils.ts +180 -0
  364. package/src/components/ReanimatedSwipeable.tsx +629 -0
  365. package/src/components/Swipeable.tsx +12 -6
  366. package/src/components/touchables/GenericTouchable.tsx +9 -36
  367. package/src/components/touchables/GenericTouchableProps.ts +26 -0
  368. package/src/components/touchables/TouchableHighlight.tsx +2 -4
  369. package/src/components/touchables/TouchableNativeFeedback.android.tsx +7 -17
  370. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +12 -0
  371. package/src/components/touchables/TouchableOpacity.tsx +3 -5
  372. package/src/components/touchables/TouchableWithoutFeedback.tsx +2 -1
  373. package/src/getShadowNodeFromRef.ts +2 -2
  374. package/src/ghQueueMicrotask.ts +7 -4
  375. package/src/handlers/FlingGestureHandler.ts +1 -6
  376. package/src/handlers/ForceTouchGestureHandler.ts +1 -12
  377. package/src/handlers/GestureHandlerEventPayload.ts +184 -0
  378. package/src/handlers/LongPressGestureHandler.ts +1 -40
  379. package/src/handlers/NativeViewGestureHandler.ts +1 -7
  380. package/src/handlers/PanGestureHandler.ts +1 -58
  381. package/src/handlers/PinchGestureHandler.ts +1 -27
  382. package/src/handlers/RotationGestureHandler.ts +1 -27
  383. package/src/handlers/TapGestureHandler.ts +1 -6
  384. package/src/handlers/createHandler.tsx +6 -11
  385. package/src/handlers/createNativeWrapper.tsx +3 -3
  386. package/src/handlers/gestureHandlerCommon.ts +3 -79
  387. package/src/handlers/gestureHandlerTypesCompat.ts +16 -30
  388. package/src/handlers/gestures/GestureDetector/Wrap.tsx +1 -1
  389. package/src/handlers/gestures/GestureDetector/attachHandlers.ts +4 -7
  390. package/src/handlers/gestures/GestureDetector/dropHandlers.ts +1 -1
  391. package/src/handlers/gestures/GestureDetector/index.tsx +1 -1
  392. package/src/handlers/gestures/GestureDetector/updateHandlers.ts +20 -30
  393. package/src/handlers/gestures/GestureDetector/useDetectorUpdater.ts +1 -1
  394. package/src/handlers/gestures/GestureDetector/utils.ts +5 -5
  395. package/src/handlers/gestures/flingGesture.ts +2 -4
  396. package/src/handlers/gestures/forceTouchGesture.ts +2 -4
  397. package/src/handlers/gestures/gesture.ts +17 -15
  398. package/src/handlers/gestures/gestureComposition.ts +5 -5
  399. package/src/handlers/gestures/gestureStateManager.ts +1 -1
  400. package/src/handlers/gestures/longPressGesture.ts +2 -4
  401. package/src/handlers/gestures/nativeGesture.ts +2 -4
  402. package/src/handlers/gestures/panGesture.ts +2 -4
  403. package/src/handlers/gestures/pinchGesture.ts +1 -1
  404. package/src/handlers/gestures/rotationGesture.ts +1 -1
  405. package/src/handlers/gestures/tapGesture.ts +2 -4
  406. package/src/handlers/getNextHandlerTag.ts +5 -0
  407. package/src/handlers/handlersRegistry.ts +0 -6
  408. package/src/handlers/utils.ts +75 -0
  409. package/src/index.ts +25 -36
  410. package/src/init.ts +1 -1
  411. package/src/jestUtils/jestUtils.ts +12 -10
  412. package/src/mocks.ts +2 -2
  413. package/src/utils.ts +1 -1
  414. package/src/web/Gestures.ts +1 -1
  415. package/src/web/detectors/RotationGestureDetector.ts +1 -1
  416. package/src/web/detectors/ScaleGestureDetector.ts +4 -4
  417. package/src/web/handlers/FlingGestureHandler.ts +1 -1
  418. package/src/web/handlers/GestureHandler.ts +8 -14
  419. package/src/web/handlers/NativeViewGestureHandler.ts +3 -3
  420. package/src/web/handlers/PanGestureHandler.ts +1 -1
  421. package/src/web/handlers/TapGestureHandler.ts +1 -1
  422. package/src/web/tools/EventManager.ts +2 -2
  423. package/src/web/tools/GestureHandlerWebDelegate.ts +3 -8
  424. package/src/web/tools/LeastSquareSolver.ts +18 -18
  425. package/src/web/tools/PointerEventManager.ts +2 -2
  426. package/src/web/tools/PointerTracker.ts +2 -1
  427. package/src/web/tools/TouchEventManager.ts +4 -4
  428. package/src/web/tools/VelocityTracker.ts +6 -6
  429. package/src/web_hammer/NodeManager.ts +2 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["rotationGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,WAArC;;AAQA,SAASC,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK;AADV,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK,QAAR,GAAmBJ,QAAQ,CAACI;AAD9B,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAED,OAAO,MAAMI,eAAN,SAA8BR,oBAA9B,CAGL;AACAS,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,wBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcZ,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMU,QAAN,CAAeC,QAAf,CAAP;AACD;;AAjBD","sourcesContent":["import { ContinousBaseGesture } from './gesture';\nimport { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\ntype RotationGestureChangeEventPayload = {\n rotationChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<RotationGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<RotationGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: RotationGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n rotationChange: current.rotation,\n };\n } else {\n changePayload = {\n rotationChange: current.rotation - previous.rotation,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class RotationGesture extends ContinousBaseGesture<\n RotationGestureHandlerEventPayload,\n RotationGestureChangeEventPayload\n> {\n constructor() {\n super();\n\n this.handlerName = 'RotationGestureHandler';\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n RotationGestureHandlerEventPayload & RotationGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type RotationGestureType = InstanceType<typeof RotationGesture>;\n"]}
1
+ {"version":3,"sources":["rotationGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,WAArC;;AAQA,SAASC,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK;AADV,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK,QAAR,GAAmBJ,QAAQ,CAACI;AAD9B,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAED,OAAO,MAAMI,eAAN,SAA8BR,oBAA9B,CAGL;AACAS,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,wBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcZ,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMU,QAAN,CAAeC,QAAf,CAAP;AACD;;AAjBD","sourcesContent":["import { ContinousBaseGesture } from './gesture';\nimport type { RotationGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\ntype RotationGestureChangeEventPayload = {\n rotationChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<RotationGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<RotationGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: RotationGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n rotationChange: current.rotation,\n };\n } else {\n changePayload = {\n rotationChange: current.rotation - previous.rotation,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class RotationGesture extends ContinousBaseGesture<\n RotationGestureHandlerEventPayload,\n RotationGestureChangeEventPayload\n> {\n constructor() {\n super();\n\n this.handlerName = 'RotationGestureHandler';\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n RotationGestureHandlerEventPayload & RotationGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type RotationGestureType = InstanceType<typeof RotationGesture>;\n"]}
@@ -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;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
+ {"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;AAIA,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 { TapGestureConfig } from '../TapGestureHandler';\nimport type { TapGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\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"]}
@@ -0,0 +1,5 @@
1
+ let handlerTag = 1;
2
+ export function getNextHandlerTag() {
3
+ return handlerTag++;
4
+ }
5
+ //# sourceMappingURL=getNextHandlerTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["getNextHandlerTag.ts"],"names":["handlerTag","getNextHandlerTag"],"mappings":"AAAA,IAAIA,UAAU,GAAG,CAAjB;AAEA,OAAO,SAASC,iBAAT,GAAqC;AAC1C,SAAOD,UAAU,EAAjB;AACD","sourcesContent":["let handlerTag = 1;\n\nexport function getNextHandlerTag(): number {\n return handlerTag++;\n}\n"]}
@@ -3,10 +3,6 @@ export const handlerIDToTag = {};
3
3
  const gestures = new Map();
4
4
  const oldHandlers = new Map();
5
5
  const testIDs = new Map();
6
- let handlerTag = 1;
7
- export function getNextHandlerTag() {
8
- return handlerTag++;
9
- }
10
6
  export function registerHandler(handlerTag, handler, testID) {
11
7
  gestures.set(handlerTag, handler);
12
8
 
@@ -1 +1 @@
1
- {"version":3,"sources":["handlersRegistry.ts"],"names":["isJestEnv","handlerIDToTag","gestures","Map","oldHandlers","testIDs","handlerTag","getNextHandlerTag","registerHandler","handler","testID","set","registerOldGestureHandler","unregisterHandler","delete","findHandler","get","findOldGestureHandler","findHandlerByTestID","undefined"],"mappings":"AAAA,SAASA,SAAT,QAA0B,UAA1B;AAIA,OAAO,MAAMC,cAAsC,GAAG,EAA/C;AACP,MAAMC,QAAQ,GAAG,IAAIC,GAAJ,EAAjB;AACA,MAAMC,WAAW,GAAG,IAAID,GAAJ,EAApB;AACA,MAAME,OAAO,GAAG,IAAIF,GAAJ,EAAhB;AAEA,IAAIG,UAAU,GAAG,CAAjB;AAEA,OAAO,SAASC,iBAAT,GAAqC;AAC1C,SAAOD,UAAU,EAAjB;AACD;AAED,OAAO,SAASE,eAAT,CACLF,UADK,EAELG,OAFK,EAGLC,MAHK,EAIL;AACAR,EAAAA,QAAQ,CAACS,GAAT,CAAaL,UAAb,EAAyBG,OAAzB;;AACA,MAAIT,SAAS,MAAMU,MAAnB,EAA2B;AACzBL,IAAAA,OAAO,CAACM,GAAR,CAAYD,MAAZ,EAAoBJ,UAApB;AACD;AACF;AAED,OAAO,SAASM,yBAAT,CACLN,UADK,EAELG,OAFK,EAGL;AACAL,EAAAA,WAAW,CAACO,GAAZ,CAAgBL,UAAhB,EAA4BG,OAA5B;AACD;AAED,OAAO,SAASI,iBAAT,CAA2BP,UAA3B,EAA+CI,MAA/C,EAAgE;AACrER,EAAAA,QAAQ,CAACY,MAAT,CAAgBR,UAAhB;;AACA,MAAIN,SAAS,MAAMU,MAAnB,EAA2B;AACzBL,IAAAA,OAAO,CAACS,MAAR,CAAeJ,MAAf;AACD;AACF;AAED,OAAO,SAASK,WAAT,CAAqBT,UAArB,EAAyC;AAC9C,SAAOJ,QAAQ,CAACc,GAAT,CAAaV,UAAb,CAAP;AACD;AAED,OAAO,SAASW,qBAAT,CAA+BX,UAA/B,EAAmD;AACxD,SAAOF,WAAW,CAACY,GAAZ,CAAgBV,UAAhB,CAAP;AACD;AAED,OAAO,SAASY,mBAAT,CAA6BR,MAA7B,EAA6C;AAClD,QAAMJ,UAAU,GAAGD,OAAO,CAACW,GAAR,CAAYN,MAAZ,CAAnB;;AACA,MAAIJ,UAAU,KAAKa,SAAnB,EAA8B;AAAA;;AAC5B,2BAAOJ,WAAW,CAACT,UAAD,CAAlB,uDAAkC,IAAlC;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import { isJestEnv } from '../utils';\nimport { GestureType } from './gestures/gesture';\nimport { GestureEvent, HandlerStateChangeEvent } from './gestureHandlerCommon';\n\nexport const handlerIDToTag: Record<string, number> = {};\nconst gestures = new Map<number, GestureType>();\nconst oldHandlers = new Map<number, GestureHandlerCallbacks>();\nconst testIDs = new Map<string, number>();\n\nlet handlerTag = 1;\n\nexport function getNextHandlerTag(): number {\n return handlerTag++;\n}\n\nexport function registerHandler(\n handlerTag: number,\n handler: GestureType,\n testID?: string\n) {\n gestures.set(handlerTag, handler);\n if (isJestEnv() && testID) {\n testIDs.set(testID, handlerTag);\n }\n}\n\nexport function registerOldGestureHandler(\n handlerTag: number,\n handler: GestureHandlerCallbacks\n) {\n oldHandlers.set(handlerTag, handler);\n}\n\nexport function unregisterHandler(handlerTag: number, testID?: string) {\n gestures.delete(handlerTag);\n if (isJestEnv() && testID) {\n testIDs.delete(testID);\n }\n}\n\nexport function findHandler(handlerTag: number) {\n return gestures.get(handlerTag);\n}\n\nexport function findOldGestureHandler(handlerTag: number) {\n return oldHandlers.get(handlerTag);\n}\n\nexport function findHandlerByTestID(testID: string) {\n const handlerTag = testIDs.get(testID);\n if (handlerTag !== undefined) {\n return findHandler(handlerTag) ?? null;\n }\n return null;\n}\n\nexport interface GestureHandlerCallbacks {\n onGestureEvent: (event: GestureEvent<any>) => void;\n onGestureStateChange: (event: HandlerStateChangeEvent<any>) => void;\n}\n"]}
1
+ {"version":3,"sources":["handlersRegistry.ts"],"names":["isJestEnv","handlerIDToTag","gestures","Map","oldHandlers","testIDs","registerHandler","handlerTag","handler","testID","set","registerOldGestureHandler","unregisterHandler","delete","findHandler","get","findOldGestureHandler","findHandlerByTestID","undefined"],"mappings":"AAAA,SAASA,SAAT,QAA0B,UAA1B;AAIA,OAAO,MAAMC,cAAsC,GAAG,EAA/C;AACP,MAAMC,QAAQ,GAAG,IAAIC,GAAJ,EAAjB;AACA,MAAMC,WAAW,GAAG,IAAID,GAAJ,EAApB;AACA,MAAME,OAAO,GAAG,IAAIF,GAAJ,EAAhB;AAEA,OAAO,SAASG,eAAT,CACLC,UADK,EAELC,OAFK,EAGLC,MAHK,EAIL;AACAP,EAAAA,QAAQ,CAACQ,GAAT,CAAaH,UAAb,EAAyBC,OAAzB;;AACA,MAAIR,SAAS,MAAMS,MAAnB,EAA2B;AACzBJ,IAAAA,OAAO,CAACK,GAAR,CAAYD,MAAZ,EAAoBF,UAApB;AACD;AACF;AAED,OAAO,SAASI,yBAAT,CACLJ,UADK,EAELC,OAFK,EAGL;AACAJ,EAAAA,WAAW,CAACM,GAAZ,CAAgBH,UAAhB,EAA4BC,OAA5B;AACD;AAED,OAAO,SAASI,iBAAT,CAA2BL,UAA3B,EAA+CE,MAA/C,EAAgE;AACrEP,EAAAA,QAAQ,CAACW,MAAT,CAAgBN,UAAhB;;AACA,MAAIP,SAAS,MAAMS,MAAnB,EAA2B;AACzBJ,IAAAA,OAAO,CAACQ,MAAR,CAAeJ,MAAf;AACD;AACF;AAED,OAAO,SAASK,WAAT,CAAqBP,UAArB,EAAyC;AAC9C,SAAOL,QAAQ,CAACa,GAAT,CAAaR,UAAb,CAAP;AACD;AAED,OAAO,SAASS,qBAAT,CAA+BT,UAA/B,EAAmD;AACxD,SAAOH,WAAW,CAACW,GAAZ,CAAgBR,UAAhB,CAAP;AACD;AAED,OAAO,SAASU,mBAAT,CAA6BR,MAA7B,EAA6C;AAClD,QAAMF,UAAU,GAAGF,OAAO,CAACU,GAAR,CAAYN,MAAZ,CAAnB;;AACA,MAAIF,UAAU,KAAKW,SAAnB,EAA8B;AAAA;;AAC5B,2BAAOJ,WAAW,CAACP,UAAD,CAAlB,uDAAkC,IAAlC;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import { isJestEnv } from '../utils';\nimport { GestureType } from './gestures/gesture';\nimport { GestureEvent, HandlerStateChangeEvent } from './gestureHandlerCommon';\n\nexport const handlerIDToTag: Record<string, number> = {};\nconst gestures = new Map<number, GestureType>();\nconst oldHandlers = new Map<number, GestureHandlerCallbacks>();\nconst testIDs = new Map<string, number>();\n\nexport function registerHandler(\n handlerTag: number,\n handler: GestureType,\n testID?: string\n) {\n gestures.set(handlerTag, handler);\n if (isJestEnv() && testID) {\n testIDs.set(testID, handlerTag);\n }\n}\n\nexport function registerOldGestureHandler(\n handlerTag: number,\n handler: GestureHandlerCallbacks\n) {\n oldHandlers.set(handlerTag, handler);\n}\n\nexport function unregisterHandler(handlerTag: number, testID?: string) {\n gestures.delete(handlerTag);\n if (isJestEnv() && testID) {\n testIDs.delete(testID);\n }\n}\n\nexport function findHandler(handlerTag: number) {\n return gestures.get(handlerTag);\n}\n\nexport function findOldGestureHandler(handlerTag: number) {\n return oldHandlers.get(handlerTag);\n}\n\nexport function findHandlerByTestID(testID: string) {\n const handlerTag = testIDs.get(testID);\n if (handlerTag !== undefined) {\n return findHandler(handlerTag) ?? null;\n }\n return null;\n}\n\nexport interface GestureHandlerCallbacks {\n onGestureEvent: (event: GestureEvent<any>) => void;\n onGestureStateChange: (event: HandlerStateChangeEvent<any>) => void;\n}\n"]}
@@ -0,0 +1,73 @@
1
+ import { Platform, findNodeHandle as findNodeHandleRN } from 'react-native';
2
+ import { handlerIDToTag } from './handlersRegistry';
3
+ import { toArray } from '../utils';
4
+ import RNGestureHandlerModule from '../RNGestureHandlerModule';
5
+ import { ghQueueMicrotask } from '../ghQueueMicrotask';
6
+
7
+ function isConfigParam(param, name) {
8
+ // param !== Object(param) returns false if `param` is a function
9
+ // or an object and returns true if `param` is null
10
+ return param !== undefined && (param !== Object(param) || !('__isNative' in param)) && name !== 'onHandlerStateChange' && name !== 'onGestureEvent';
11
+ }
12
+
13
+ export function filterConfig(props, validProps, defaults = {}) {
14
+ const filteredConfig = { ...defaults
15
+ };
16
+
17
+ for (const key of validProps) {
18
+ let value = props[key];
19
+
20
+ if (isConfigParam(value, key)) {
21
+ if (key === 'simultaneousHandlers' || key === 'waitFor') {
22
+ value = transformIntoHandlerTags(props[key]);
23
+ } else if (key === 'hitSlop' && typeof value !== 'object') {
24
+ value = {
25
+ top: value,
26
+ left: value,
27
+ bottom: value,
28
+ right: value
29
+ };
30
+ }
31
+
32
+ filteredConfig[key] = value;
33
+ }
34
+ }
35
+
36
+ return filteredConfig;
37
+ }
38
+
39
+ function transformIntoHandlerTags(handlerIDs) {
40
+ handlerIDs = toArray(handlerIDs);
41
+
42
+ if (Platform.OS === 'web') {
43
+ return handlerIDs.map(({
44
+ current
45
+ }) => current).filter(handle => handle);
46
+ } // converts handler string IDs into their numeric tags
47
+
48
+
49
+ return handlerIDs.map(handlerID => {
50
+ var _handlerID$current;
51
+
52
+ return handlerIDToTag[handlerID] || ((_handlerID$current = handlerID.current) === null || _handlerID$current === void 0 ? void 0 : _handlerID$current.handlerTag) || -1;
53
+ }).filter(handlerTag => handlerTag > 0);
54
+ }
55
+
56
+ export function findNodeHandle(node) {
57
+ if (Platform.OS === 'web') {
58
+ return node;
59
+ }
60
+
61
+ return findNodeHandleRN(node);
62
+ }
63
+ let flushOperationsScheduled = false;
64
+ export function scheduleFlushOperations() {
65
+ if (!flushOperationsScheduled) {
66
+ flushOperationsScheduled = true;
67
+ ghQueueMicrotask(() => {
68
+ RNGestureHandlerModule.flushOperations();
69
+ flushOperationsScheduled = false;
70
+ });
71
+ }
72
+ }
73
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils.ts"],"names":["Platform","findNodeHandle","findNodeHandleRN","handlerIDToTag","toArray","RNGestureHandlerModule","ghQueueMicrotask","isConfigParam","param","name","undefined","Object","filterConfig","props","validProps","defaults","filteredConfig","key","value","transformIntoHandlerTags","top","left","bottom","right","handlerIDs","OS","map","current","filter","handle","handlerID","handlerTag","node","flushOperationsScheduled","scheduleFlushOperations","flushOperations"],"mappings":"AACA,SAASA,QAAT,EAAmBC,cAAc,IAAIC,gBAArC,QAA6D,cAA7D;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,OAAT,QAAwB,UAAxB;AACA,OAAOC,sBAAP,MAAmC,2BAAnC;AACA,SAASC,gBAAT,QAAiC,qBAAjC;;AAEA,SAASC,aAAT,CAAuBC,KAAvB,EAAuCC,IAAvC,EAAqD;AACnD;AACA;AACA,SACED,KAAK,KAAKE,SAAV,KACCF,KAAK,KAAKG,MAAM,CAACH,KAAD,CAAhB,IACC,EAAE,gBAAiBA,KAAnB,CAFF,KAGAC,IAAI,KAAK,sBAHT,IAIAA,IAAI,KAAK,gBALX;AAOD;;AAED,OAAO,SAASG,YAAT,CACLC,KADK,EAELC,UAFK,EAGLC,QAAiC,GAAG,EAH/B,EAIL;AACA,QAAMC,cAAc,GAAG,EAAE,GAAGD;AAAL,GAAvB;;AACA,OAAK,MAAME,GAAX,IAAkBH,UAAlB,EAA8B;AAC5B,QAAII,KAAK,GAAGL,KAAK,CAACI,GAAD,CAAjB;;AACA,QAAIV,aAAa,CAACW,KAAD,EAAQD,GAAR,CAAjB,EAA+B;A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AG,KAA/B;AAEA,OAAO,SAASC,uBAAT,GAAmC;AACxC,MAAI,CAACD,wBAAL,EAA+B;AAC7BA,IAAAA,wBAAwB,GAAG,IAA3B;AACA3B,IAAAA,gBAAgB,CAAC,MAAM;AACrBD,MAAAA,sBAAsB,CAAC8B,eAAvB;AAEAF,MAAAA,wBAAwB,GAAG,KAA3B;AACD,KAJe,CAAhB;AAKD;AACF","sourcesContent":["import * as React from 'react';\nimport { Platform, findNodeHandle as findNodeHandleRN } from 'react-native';\nimport { handlerIDToTag } from './handlersRegistry';\nimport { toArray } from '../utils';\nimport RNGestureHandlerModule from '../RNGestureHandlerModule';\nimport { ghQueueMicrotask } from '../ghQueueMicrotask';\n\nfunction isConfigParam(param: unknown, name: string) {\n // param !== Object(param) returns false if `param` is a function\n // or an object and returns true if `param` is null\n return (\n param !== undefined &&\n (param !== Object(param) ||\n !('__isNative' in (param as Record<string, unknown>))) &&\n name !== 'onHandlerStateChange' &&\n name !== 'onGestureEvent'\n );\n}\n\nexport function filterConfig(\n props: Record<string, unknown>,\n validProps: string[],\n defaults: Record<string, unknown> = {}\n) {\n const filteredConfig = { ...defaults };\n for (const key of validProps) {\n let value = props[key];\n if (isConfigParam(value, key)) {\n if (key === 'simultaneousHandlers' || key === 'waitFor') {\n value = transformIntoHandlerTags(props[key]);\n } else if (key === 'hitSlop' && typeof value !== 'object') {\n value = { top: value, left: value, bottom: value, right: value };\n }\n filteredConfig[key] = value;\n }\n }\n return filteredConfig;\n}\nfunction transformIntoHandlerTags(handlerIDs: any) {\n handlerIDs = toArray(handlerIDs);\n\n if (Platform.OS === 'web') {\n return handlerIDs\n .map(({ current }: { current: any }) => current)\n .filter((handle: any) => handle);\n }\n // converts handler string IDs into their numeric tags\n return handlerIDs\n .map(\n (handlerID: any) =>\n handlerIDToTag[handlerID] || handlerID.current?.handlerTag || -1\n )\n .filter((handlerTag: number) => handlerTag > 0);\n}\n\nexport function findNodeHandle(\n node: null | number | React.Component<any, any> | React.ComponentClass<any>\n): null | number | React.Component<any, any> | React.ComponentClass<any> {\n if (Platform.OS === 'web') {\n return node;\n }\n return findNodeHandleRN(node);\n}\nlet flushOperationsScheduled = false;\n\nexport function scheduleFlushOperations() {\n if (!flushOperationsScheduled) {\n flushOperationsScheduled = true;\n ghQueueMicrotask(() => {\n RNGestureHandlerModule.flushOperations();\n\n flushOperationsScheduled = false;\n });\n }\n}\n"]}
@@ -21,6 +21,7 @@ export { TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, Touchabl
21
21
  export { ScrollView, Switch, TextInput, DrawerLayoutAndroid, FlatList, RefreshControl } from './components/GestureComponents';
22
22
  export { HoverEffect } from './handlers/gestures/hoverGesture';
23
23
  export { default as Swipeable } from './components/Swipeable';
24
+ export { default as Pressable } from './components/Pressable';
24
25
  export { default as DrawerLayout } from './components/DrawerLayout';
25
26
  export { enableExperimentalWebImplementation, enableLegacyWebImplementation } from './EnableNewWebImplementation';
26
27
  initialize();
@@ -1 +1 @@
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"]}
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","Pressable","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;AAsBA,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;AAEA,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;AAEA,SAAShC,OAAO,IAAIiC,SAApB,QAAqC,wBAArC;AAUA,SAASjC,OAAO,IAAIkC,YAApB,QAAwC,2BAAxC;AAEA,SACEC,mCADF,EAEEC,6BAFF,QAGO,8BAHP;AAKAxC,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 ForceTouchGestureHandlerEventPayload,\n LongPressGestureHandlerEventPayload,\n PanGestureHandlerEventPayload,\n PinchGestureHandlerEventPayload,\n RotationGestureHandlerEventPayload,\n NativeViewGestureHandlerPayload,\n FlingGestureHandlerEventPayload,\n} from './handlers/GestureHandlerEventPayload';\nexport type { TapGestureHandlerProps } from './handlers/TapGestureHandler';\nexport type { ForceTouchGestureHandlerProps } from './handlers/ForceTouchGestureHandler';\nexport type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';\nexport type { LongPressGestureHandlerProps } from './handlers/LongPressGestureHandler';\nexport type { PanGestureHandlerProps } from './handlers/PanGestureHandler';\nexport type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';\nexport type { PinchGestureHandlerProps } from './handlers/PinchGestureHandler';\nexport type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';\nexport type { RotationGestureHandlerProps } from './handlers/RotationGestureHandler';\nexport type { FlingGestureHandlerProps } 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 { NativeViewGestureHandlerProps } 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/GestureButtonsProps';\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 { PressableProps } from './components/Pressable';\nexport { default as Pressable } from './components/Pressable';\n\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"]}
@@ -4,7 +4,7 @@ import { isFabric } from './utils';
4
4
  let fabricInitialized = false;
5
5
  export function initialize() {
6
6
  startListening();
7
- } // since isFabric() may give wrong results before the first render, we call this
7
+ } // Since isFabric() may give wrong results before the first render, we call this
8
8
  // method during render of GestureHandlerRootView
9
9
 
10
10
  export function maybeInitializeFabric() {
@@ -1 +1 @@
1
- {"version":3,"sources":["init.ts"],"names":["startListening","RNGestureHandlerModule","isFabric","fabricInitialized","initialize","maybeInitializeFabric","install"],"mappings":"AAAA,SAASA,cAAT,QAA+B,mCAA/B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,SAASC,QAAT,QAAyB,SAAzB;AAEA,IAAIC,iBAAiB,GAAG,KAAxB;AAEA,OAAO,SAASC,UAAT,GAAsB;AAC3BJ,EAAAA,cAAc;AACf,C,CAED;AACA;;AACA,OAAO,SAASK,qBAAT,GAAiC;AACtC,MAAIH,QAAQ,MAAM,CAACC,iBAAnB,EAAsC;AACpCF,IAAAA,sBAAsB,CAACK,OAAvB;AACAH,IAAAA,iBAAiB,GAAG,IAApB;AACD;AACF","sourcesContent":["import { startListening } from './handlers/gestures/eventReceiver';\nimport RNGestureHandlerModule from './RNGestureHandlerModule';\nimport { isFabric } from './utils';\n\nlet fabricInitialized = false;\n\nexport function initialize() {\n startListening();\n}\n\n// since isFabric() may give wrong results before the first render, we call this\n// method during render of GestureHandlerRootView\nexport function maybeInitializeFabric() {\n if (isFabric() && !fabricInitialized) {\n RNGestureHandlerModule.install();\n fabricInitialized = true;\n }\n}\n"]}
1
+ {"version":3,"sources":["init.ts"],"names":["startListening","RNGestureHandlerModule","isFabric","fabricInitialized","initialize","maybeInitializeFabric","install"],"mappings":"AAAA,SAASA,cAAT,QAA+B,mCAA/B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,SAASC,QAAT,QAAyB,SAAzB;AAEA,IAAIC,iBAAiB,GAAG,KAAxB;AAEA,OAAO,SAASC,UAAT,GAAsB;AAC3BJ,EAAAA,cAAc;AACf,C,CAED;AACA;;AACA,OAAO,SAASK,qBAAT,GAAiC;AACtC,MAAIH,QAAQ,MAAM,CAACC,iBAAnB,EAAsC;AACpCF,IAAAA,sBAAsB,CAACK,OAAvB;AACAH,IAAAA,iBAAiB,GAAG,IAApB;AACD;AACF","sourcesContent":["import { startListening } from './handlers/gestures/eventReceiver';\nimport RNGestureHandlerModule from './RNGestureHandlerModule';\nimport { isFabric } from './utils';\n\nlet fabricInitialized = false;\n\nexport function initialize() {\n startListening();\n}\n\n// Since isFabric() may give wrong results before the first render, we call this\n// method during render of GestureHandlerRootView\nexport function maybeInitializeFabric() {\n if (isFabric() && !fabricInitialized) {\n RNGestureHandlerModule.install();\n fabricInitialized = true;\n }\n}\n"]}
@@ -11,7 +11,7 @@ import { pinchHandlerName } from '../handlers/PinchGestureHandler';
11
11
  import { rotationHandlerName } from '../handlers/RotationGestureHandler';
12
12
  import { tapHandlerName } from '../handlers/TapGestureHandler';
13
13
  import { State } from '../State';
14
- import { hasProperty, withPrevAndCurrent } from '../utils'; // load fireEvent conditionally, so RNGH may be used in setups without testing-library
14
+ import { hasProperty, withPrevAndCurrent } from '../utils'; // Load fireEvent conditionally, so RNGH may be used in setups without testing-library
15
15
 
16
16
  let fireEvent = (_element, _name, ..._data) => {// NOOP
17
17
  };
@@ -19,7 +19,7 @@ let fireEvent = (_element, _name, ..._data) => {// NOOP
19
19
  try {
20
20
  // eslint-disable-next-line @typescript-eslint/no-var-requires
21
21
  fireEvent = require('@testing-library/react-native').fireEvent;
22
- } catch (_e) {// do nothing if not available
22
+ } catch (_e) {// Do nothing if not available
23
23
  }
24
24
 
25
25
  const handlersDefaultEvents = {
@@ -1 +1 @@
1
- {"version":3,"sources":["jestUtils.ts"],"names":["invariant","DeviceEventEmitter","flingHandlerName","forceTouchHandlerName","BaseGesture","findHandlerByTestID","longPressHandlerName","nativeViewHandlerName","panHandlerName","pinchHandlerName","rotationHandlerName","tapHandlerName","State","hasProperty","withPrevAndCurrent","fireEvent","_element","_name","_data","require","_e","handlersDefaultEvents","x","y","absoluteX","absoluteY","numberOfPointers","force","duration","pointerInside","translationX","translationY","velocityX","velocityY","focalX","focalY","scale","velocity","anchorX","anchorY","rotation","isGesture","componentOrGesture","wrapWithNativeEvent","event","nativeEvent","fillOldStateChanges","previousEvent","currentEvent","isFirstEvent","oldState","UNDETERMINED","isGestureStateEvent","state","validateStateTransitions","stringify","JSON","errorMsgWithBothEvents","description","errorMsgWithCurrentEvent","BEGAN","fillMissingDefaultsFor","handlerType","handlerTag","isDiscreteHandler","fillMissingStatesTransitions","events","_events","lastEvent","length","firstEvent","shouldDuplicateFirstEvent","hasState","duplicated","unshift","shouldDuplicateLastEvent","END","FAILED","CANCELLED","push","isWithoutState","noEventsLeft","trueFn","fillEventsForCurrentState","shouldConsumeEvent","shouldTransitionToNextState","peekCurrentEvent","peekNextEvent","consumeCurrentEvent","shift","nextEvent","currentRequiredState","REQUIRED_EVENTS","currentStateIdx","eventData","shouldUseEvent","transformedEvents","ACTIVE","hasAllStates","iterations","nextRequiredState","e","getHandlerData","gesture","emitEvent","eventName","args","emit","handlerName","gestureHandlerComponent","props","fireGestureHandler","eventList","_","map","lastSentEvent","hasChangedState","getByGestureTestId","testID","handler","Error"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,WAAtB;AACA,SAASC,kBAAT,QAAmC,cAAnC;AAEA,SAGEC,gBAHF,QAIO,iCAJP;AAKA,SAGEC,qBAHF,QAIO,sCAJP;AAYA,SAASC,WAAT,QAAyC,8BAAzC;AAOA,SAASC,mBAAT,QAAoC,8BAApC;AACA,SAGEC,oBAHF,QAIO,qCAJP;AAKA,SAGEC,qBAHF,QAIO,sCAJP;AAKA,SAGEC,cAHF,QAIO,+BAJP;AAKA,SAGEC,gBAHF,QAIO,iCAJP;AAKA,SAGEC,mBAHF,QAIO,oCAJP;AAKA,SAGEC,cAHF,QAIO,+BAJP;AAKA,SAASC,KAAT,QAAsB,UAAtB;AACA,SAASC,WAAT,EAAsBC,kBAAtB,QAAgD,UAAhD,C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BC,MAA5B,EAA4C;AACjD,QAAMC,OAAO,GAAGlH,mBAAmB,CAACiH,MAAD,CAAnC;;AACA,MAAIC,OAAO,KAAK,IAAhB,EAAsB;AACpB,UAAM,IAAIC,KAAJ,CAAW,qBAAoBF,MAAO,mBAAtC,CAAN;AACD;;AACD,SAAOC,OAAP;AACD","sourcesContent":["import invariant from 'invariant';\nimport { DeviceEventEmitter } from 'react-native';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport {\n FlingGestureHandler,\n FlingGestureHandlerEventPayload,\n flingHandlerName,\n} from '../handlers/FlingGestureHandler';\nimport {\n ForceTouchGestureHandler,\n ForceTouchGestureHandlerEventPayload,\n forceTouchHandlerName,\n} from '../handlers/ForceTouchGestureHandler';\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport { FlingGesture } from '../handlers/gestures/flingGesture';\nimport { ForceTouchGesture } from '../handlers/gestures/forceTouchGesture';\nimport { BaseGesture, GestureType } from '../handlers/gestures/gesture';\nimport { LongPressGesture } from '../handlers/gestures/longPressGesture';\nimport { NativeGesture } from '../handlers/gestures/nativeGesture';\nimport { PanGesture } from '../handlers/gestures/panGesture';\nimport { PinchGesture } from '../handlers/gestures/pinchGesture';\nimport { RotationGesture } from '../handlers/gestures/rotationGesture';\nimport { TapGesture } from '../handlers/gestures/tapGesture';\nimport { findHandlerByTestID } from '../handlers/handlersRegistry';\nimport {\n LongPressGestureHandler,\n LongPressGestureHandlerEventPayload,\n longPressHandlerName,\n} from '../handlers/LongPressGestureHandler';\nimport {\n NativeViewGestureHandler,\n NativeViewGestureHandlerPayload,\n nativeViewHandlerName,\n} from '../handlers/NativeViewGestureHandler';\nimport {\n PanGestureHandler,\n PanGestureHandlerEventPayload,\n panHandlerName,\n} from '../handlers/PanGestureHandler';\nimport {\n PinchGestureHandler,\n PinchGestureHandlerEventPayload,\n pinchHandlerName,\n} from '../handlers/PinchGestureHandler';\nimport {\n RotationGestureHandler,\n RotationGestureHandlerEventPayload,\n rotationHandlerName,\n} from '../handlers/RotationGestureHandler';\nimport {\n TapGestureHandler,\n TapGestureHandlerEventPayload,\n tapHandlerName,\n} from '../handlers/TapGestureHandler';\nimport { State } from '../State';\nimport { hasProperty, withPrevAndCurrent } from '../utils';\n\n// load fireEvent conditionally, so RNGH may be used in setups without testing-library\nlet fireEvent = (\n _element: ReactTestInstance,\n _name: string,\n ..._data: any[]\n) => {\n // NOOP\n};\n\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n fireEvent = require('@testing-library/react-native').fireEvent;\n} catch (_e) {\n // do nothing if not available\n}\n\ntype GestureHandlerTestEvent<\n TEventPayload extends Record<string, unknown> = Record<string, unknown>\n> = (\n | GestureEvent<TEventPayload>\n | HandlerStateChangeEvent<TEventPayload>\n)['nativeEvent'];\n\ntype HandlerNames = keyof DefaultEventsMapping;\n\ntype WithNumberOfPointers<T> = {\n [P in keyof T]: T[P] & { numberOfPointers: number };\n};\ntype DefaultEventsMapping = WithNumberOfPointers<{\n [flingHandlerName]: FlingGestureHandlerEventPayload;\n [forceTouchHandlerName]: ForceTouchGestureHandlerEventPayload;\n [longPressHandlerName]: LongPressGestureHandlerEventPayload;\n [nativeViewHandlerName]: NativeViewGestureHandlerPayload;\n [panHandlerName]: PanGestureHandlerEventPayload;\n [pinchHandlerName]: PinchGestureHandlerEventPayload;\n [rotationHandlerName]: RotationGestureHandlerEventPayload;\n [tapHandlerName]: TapGestureHandlerEventPayload;\n}>;\n\nconst handlersDefaultEvents: DefaultEventsMapping = {\n [flingHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n [forceTouchHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n force: 1,\n numberOfPointers: 1,\n },\n [longPressHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n duration: 100,\n numberOfPointers: 1,\n },\n [nativeViewHandlerName]: {\n pointerInside: true,\n numberOfPointers: 1,\n },\n [panHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n translationX: 100,\n translationY: 0,\n velocityX: 3,\n velocityY: 0,\n numberOfPointers: 1,\n },\n [pinchHandlerName]: {\n focalX: 0,\n focalY: 0,\n scale: 2,\n velocity: 1,\n numberOfPointers: 2,\n },\n [rotationHandlerName]: {\n anchorX: 0,\n anchorY: 0,\n rotation: 3.14,\n velocity: 2,\n numberOfPointers: 2,\n },\n [tapHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n};\n\nfunction isGesture(\n componentOrGesture: ReactTestInstance | GestureType\n): componentOrGesture is GestureType {\n return componentOrGesture instanceof BaseGesture;\n}\n\ninterface WrappedGestureHandlerTestEvent {\n nativeEvent: GestureHandlerTestEvent;\n}\nfunction wrapWithNativeEvent(\n event: GestureHandlerTestEvent\n): WrappedGestureHandlerTestEvent {\n return { nativeEvent: event };\n}\n\nfunction fillOldStateChanges(\n previousEvent: GestureHandlerTestEvent | null,\n currentEvent: Omit<GestureHandlerTestEvent, 'oldState'>\n): GestureHandlerTestEvent {\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n return {\n oldState: State.UNDETERMINED,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n }\n\n const isGestureStateEvent = previousEvent.state !== currentEvent.state;\n if (isGestureStateEvent) {\n return {\n oldState: previousEvent?.state,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n } else {\n return currentEvent as GestureHandlerTestEvent;\n }\n}\n\ntype EventWithStates = Partial<\n Pick<GestureHandlerTestEvent, 'oldState' | 'state'>\n>;\nfunction validateStateTransitions(\n previousEvent: EventWithStates | null,\n currentEvent: EventWithStates\n) {\n function stringify(event: Record<string, unknown> | null) {\n return JSON.stringify(event, null, 2);\n }\n function errorMsgWithBothEvents(description: string) {\n return `${description}, invalid event: ${stringify(\n currentEvent\n )}, previous event: ${stringify(previousEvent)}`;\n }\n\n function errorMsgWithCurrentEvent(description: string) {\n return `${description}, invalid event: ${stringify(currentEvent)}`;\n }\n\n invariant(\n hasProperty(currentEvent, 'state'),\n errorMsgWithCurrentEvent('every event must have state')\n );\n\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n invariant(\n currentEvent.state === State.BEGAN,\n errorMsgWithCurrentEvent('first event must have BEGAN state')\n );\n }\n\n if (previousEvent !== null) {\n if (previousEvent.state !== currentEvent.state) {\n invariant(\n hasProperty(currentEvent, 'oldState'),\n errorMsgWithCurrentEvent(\n 'when state changes, oldState field should be present'\n )\n );\n invariant(\n currentEvent.oldState === previousEvent.state,\n errorMsgWithBothEvents(\n \"when state changes, oldState should be the same as previous event' state\"\n )\n );\n }\n }\n\n return currentEvent;\n}\n\ntype EventWithoutStates = Omit<GestureHandlerTestEvent, 'oldState' | 'state'>;\ninterface HandlerInfo {\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction fillMissingDefaultsFor({\n handlerType,\n handlerTag,\n}: HandlerInfo): (\n event: Partial<GestureHandlerTestEvent>\n) => EventWithoutStates {\n return (event) => {\n return {\n ...handlersDefaultEvents[handlerType],\n ...event,\n handlerTag,\n };\n };\n}\n\nfunction isDiscreteHandler(handlerType: HandlerNames) {\n return (\n handlerType === 'TapGestureHandler' ||\n handlerType === 'LongPressGestureHandler'\n );\n}\n\nfunction fillMissingStatesTransitions(\n events: EventWithoutStates[],\n isDiscreteHandler: boolean\n): EventWithoutStates[] {\n type Event = EventWithoutStates | null;\n const _events = [...events];\n const lastEvent = _events[_events.length - 1] ?? null;\n const firstEvent = _events[0] ?? null;\n\n const shouldDuplicateFirstEvent =\n !isDiscreteHandler && !hasState(State.BEGAN)(firstEvent);\n if (shouldDuplicateFirstEvent) {\n const duplicated = { ...firstEvent, state: State.BEGAN };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.unshift(duplicated);\n }\n\n const shouldDuplicateLastEvent =\n !hasState(State.END)(lastEvent) ||\n !hasState(State.FAILED)(lastEvent) ||\n !hasState(State.CANCELLED)(lastEvent);\n\n if (shouldDuplicateLastEvent) {\n const duplicated = { ...lastEvent, state: State.END };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.push(duplicated);\n }\n\n function isWithoutState(event: Event) {\n return event !== null && !hasProperty(event, 'state');\n }\n function hasState(state: State) {\n return (event: Event) => event !== null && event.state === state;\n }\n function noEventsLeft(event: Event) {\n return event === null;\n }\n\n function trueFn() {\n return true;\n }\n interface Args {\n shouldConsumeEvent?: (event: Event) => boolean;\n shouldTransitionToNextState?: (nextEvent: Event) => boolean;\n }\n function fillEventsForCurrentState({\n shouldConsumeEvent = trueFn,\n shouldTransitionToNextState = trueFn,\n }: Args) {\n function peekCurrentEvent(): Event {\n return _events[0] ?? null;\n }\n function peekNextEvent(): Event {\n return _events[1] ?? null;\n }\n function consumeCurrentEvent() {\n _events.shift();\n }\n const currentEvent = peekCurrentEvent();\n const nextEvent = peekNextEvent();\n const currentRequiredState = REQUIRED_EVENTS[currentStateIdx];\n\n let eventData = {};\n const shouldUseEvent = shouldConsumeEvent(currentEvent);\n if (shouldUseEvent) {\n eventData = currentEvent!;\n consumeCurrentEvent();\n }\n transformedEvents.push({ state: currentRequiredState, ...eventData });\n if (shouldTransitionToNextState(nextEvent)) {\n currentStateIdx++;\n }\n }\n\n const REQUIRED_EVENTS = [State.BEGAN, State.ACTIVE, State.END];\n\n let currentStateIdx = 0;\n const transformedEvents: EventWithoutStates[] = [];\n let hasAllStates;\n let iterations = 0;\n do {\n const nextRequiredState = REQUIRED_EVENTS[currentStateIdx];\n if (nextRequiredState === State.BEGAN) {\n fillEventsForCurrentState({\n shouldConsumeEvent: (e: Event) =>\n isWithoutState(e) || hasState(State.BEGAN)(e),\n });\n } else if (nextRequiredState === State.ACTIVE) {\n const shouldConsumeEvent = (e: Event) =>\n isWithoutState(e) || hasState(State.ACTIVE)(e);\n const shouldTransitionToNextState = (nextEvent: Event) =>\n noEventsLeft(nextEvent) ||\n hasState(State.END)(nextEvent) ||\n hasState(State.FAILED)(nextEvent) ||\n hasState(State.CANCELLED)(nextEvent);\n\n fillEventsForCurrentState({\n shouldConsumeEvent,\n shouldTransitionToNextState,\n });\n } else if (nextRequiredState === State.END) {\n fillEventsForCurrentState({});\n }\n hasAllStates = currentStateIdx === REQUIRED_EVENTS.length;\n\n invariant(\n iterations++ <= 500,\n 'exceeded max number of iterations, please report a bug in RNGH repository with your test case'\n );\n } while (!hasAllStates);\n\n return transformedEvents;\n}\n\ntype EventEmitter = (\n eventName: string,\n args: { nativeEvent: GestureHandlerTestEvent }\n) => void;\ninterface HandlerData {\n emitEvent: EventEmitter;\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction getHandlerData(\n componentOrGesture: ReactTestInstance | GestureType\n): HandlerData {\n if (isGesture(componentOrGesture)) {\n const gesture = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n DeviceEventEmitter.emit(eventName, args.nativeEvent);\n },\n handlerType: gesture.handlerName as HandlerNames,\n handlerTag: gesture.handlerTag,\n };\n }\n const gestureHandlerComponent = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n fireEvent(gestureHandlerComponent, eventName, args);\n },\n handlerType: gestureHandlerComponent.props.handlerType as HandlerNames,\n handlerTag: gestureHandlerComponent.props.handlerTag as number,\n };\n}\ntype AllGestures =\n | TapGesture\n | PanGesture\n | LongPressGesture\n | RotationGesture\n | PinchGesture\n | FlingGesture\n | ForceTouchGesture\n | NativeGesture;\n\ntype AllHandlers =\n | TapGestureHandler\n | PanGestureHandler\n | LongPressGestureHandler\n | RotationGestureHandler\n | PinchGestureHandler\n | FlingGestureHandler\n | ForceTouchGestureHandler\n | NativeViewGestureHandler;\n\n// prettier-ignore\ntype ClassComponentConstructor<P> = new (props: P) => React.Component<P, any, any>;\n\ntype ExtractPayloadFromProps<T> = T extends BaseGestureHandlerProps<\n infer TPayload\n>\n ? TPayload\n : never;\n\ntype ExtractConfig<T> = T extends BaseGesture<infer TGesturePayload>\n ? TGesturePayload\n : T extends ClassComponentConstructor<infer THandlerProps>\n ? ExtractPayloadFromProps<THandlerProps>\n : Record<string, unknown>;\n\nexport function fireGestureHandler<THandler extends AllGestures | AllHandlers>(\n componentOrGesture: ReactTestInstance | GestureType,\n eventList: Partial<GestureHandlerTestEvent<ExtractConfig<THandler>>>[] = []\n): void {\n const { emitEvent, handlerType, handlerTag } =\n getHandlerData(componentOrGesture);\n\n let _ = fillMissingStatesTransitions(\n eventList,\n isDiscreteHandler(handlerType)\n );\n _ = _.map(fillMissingDefaultsFor({ handlerTag, handlerType }));\n _ = withPrevAndCurrent(_, fillOldStateChanges);\n _ = withPrevAndCurrent(_, validateStateTransitions);\n // @ts-ignore TODO\n _ = _.map(wrapWithNativeEvent);\n\n const events = _ as unknown as WrappedGestureHandlerTestEvent[];\n\n const firstEvent = events.shift()!;\n\n emitEvent('onGestureHandlerStateChange', firstEvent);\n let lastSentEvent = firstEvent;\n for (const event of events) {\n const hasChangedState =\n lastSentEvent.nativeEvent.state !== event.nativeEvent.state;\n\n if (hasChangedState) {\n emitEvent('onGestureHandlerStateChange', event);\n } else {\n emitEvent('onGestureHandlerEvent', event);\n }\n lastSentEvent = event;\n }\n}\n\nexport function getByGestureTestId(testID: string) {\n const handler = findHandlerByTestID(testID);\n if (handler === null) {\n throw new Error(`Handler with id: '${testID}' cannot be found`);\n }\n return handler;\n}\n"]}
1
+ {"version":3,"sources":["jestUtils.ts"],"names":["invariant","DeviceEventEmitter","flingHandlerName","forceTouchHandlerName","BaseGesture","findHandlerByTestID","longPressHandlerName","nativeViewHandlerName","panHandlerName","pinchHandlerName","rotationHandlerName","tapHandlerName","State","hasProperty","withPrevAndCurrent","fireEvent","_element","_name","_data","require","_e","handlersDefaultEvents","x","y","absoluteX","absoluteY","numberOfPointers","force","duration","pointerInside","translationX","translationY","velocityX","velocityY","focalX","focalY","scale","velocity","anchorX","anchorY","rotation","isGesture","componentOrGesture","wrapWithNativeEvent","event","nativeEvent","fillOldStateChanges","previousEvent","currentEvent","isFirstEvent","oldState","UNDETERMINED","isGestureStateEvent","state","validateStateTransitions","stringify","JSON","errorMsgWithBothEvents","description","errorMsgWithCurrentEvent","BEGAN","fillMissingDefaultsFor","handlerType","handlerTag","isDiscreteHandler","fillMissingStatesTransitions","events","_events","lastEvent","length","firstEvent","shouldDuplicateFirstEvent","hasState","duplicated","unshift","shouldDuplicateLastEvent","END","FAILED","CANCELLED","push","isWithoutState","noEventsLeft","trueFn","fillEventsForCurrentState","shouldConsumeEvent","shouldTransitionToNextState","peekCurrentEvent","peekNextEvent","consumeCurrentEvent","shift","nextEvent","currentRequiredState","REQUIRED_EVENTS","currentStateIdx","eventData","shouldUseEvent","transformedEvents","ACTIVE","hasAllStates","iterations","nextRequiredState","e","getHandlerData","gesture","emitEvent","eventName","args","emit","handlerName","gestureHandlerComponent","props","fireGestureHandler","eventList","_","map","lastSentEvent","hasChangedState","getByGestureTestId","testID","handler","Error"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,WAAtB;AACA,SAASC,kBAAT,QAAmC,cAAnC;AAEA,SAEEC,gBAFF,QAGO,iCAHP;AAIA,SAEEC,qBAFF,QAGO,sCAHP;AAWA,SAASC,WAAT,QAAyC,8BAAzC;AAOA,SAASC,mBAAT,QAAoC,8BAApC;AACA,SAEEC,oBAFF,QAGO,qCAHP;AAcA,SAEEC,qBAFF,QAGO,sCAHP;AAIA,SAEEC,cAFF,QAGO,+BAHP;AAIA,SAEEC,gBAFF,QAGO,iCAHP;AAIA,SAEEC,mBAFF,QAGO,oCAHP;AAIA,SAEEC,cAFF,QAGO,+BAHP;AAIA,SAASC,KAAT,QAAsB,UAAtB;AACA,SAASC,WAAT,EAAsBC,kBAAtB,QAAgD,UAAhD,C,CAEA;;AACA,IAAIC,SAAS,GAAG,CACdC,QADc,EAEdC,KAFc,EAGd,GAAGC,KAHW,KAI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,MAAIC,OAAO,KAAK,IAAhB,EAAsB;AACpB,UAAM,IAAIC,KAAJ,CAAW,qBAAoBF,MAAO,mBAAtC,CAAN;AACD;;AACD,SAAOC,OAAP;AACD","sourcesContent":["import invariant from 'invariant';\nimport { DeviceEventEmitter } from 'react-native';\nimport { ReactTestInstance } from 'react-test-renderer';\nimport {\n FlingGestureHandler,\n flingHandlerName,\n} from '../handlers/FlingGestureHandler';\nimport {\n ForceTouchGestureHandler,\n forceTouchHandlerName,\n} from '../handlers/ForceTouchGestureHandler';\nimport {\n BaseGestureHandlerProps,\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport { FlingGesture } from '../handlers/gestures/flingGesture';\nimport { ForceTouchGesture } from '../handlers/gestures/forceTouchGesture';\nimport { BaseGesture, GestureType } from '../handlers/gestures/gesture';\nimport { LongPressGesture } from '../handlers/gestures/longPressGesture';\nimport { NativeGesture } from '../handlers/gestures/nativeGesture';\nimport { PanGesture } from '../handlers/gestures/panGesture';\nimport { PinchGesture } from '../handlers/gestures/pinchGesture';\nimport { RotationGesture } from '../handlers/gestures/rotationGesture';\nimport { TapGesture } from '../handlers/gestures/tapGesture';\nimport { findHandlerByTestID } from '../handlers/handlersRegistry';\nimport {\n LongPressGestureHandler,\n longPressHandlerName,\n} from '../handlers/LongPressGestureHandler';\nimport type {\n FlingGestureHandlerEventPayload,\n ForceTouchGestureHandlerEventPayload,\n LongPressGestureHandlerEventPayload,\n NativeViewGestureHandlerPayload,\n PanGestureHandlerEventPayload,\n PinchGestureHandlerEventPayload,\n RotationGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n} from '../handlers/GestureHandlerEventPayload';\nimport {\n NativeViewGestureHandler,\n nativeViewHandlerName,\n} from '../handlers/NativeViewGestureHandler';\nimport {\n PanGestureHandler,\n panHandlerName,\n} from '../handlers/PanGestureHandler';\nimport {\n PinchGestureHandler,\n pinchHandlerName,\n} from '../handlers/PinchGestureHandler';\nimport {\n RotationGestureHandler,\n rotationHandlerName,\n} from '../handlers/RotationGestureHandler';\nimport {\n TapGestureHandler,\n tapHandlerName,\n} from '../handlers/TapGestureHandler';\nimport { State } from '../State';\nimport { hasProperty, withPrevAndCurrent } from '../utils';\n\n// Load fireEvent conditionally, so RNGH may be used in setups without testing-library\nlet fireEvent = (\n _element: ReactTestInstance,\n _name: string,\n ..._data: any[]\n) => {\n // NOOP\n};\n\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n fireEvent = require('@testing-library/react-native').fireEvent;\n} catch (_e) {\n // Do nothing if not available\n}\n\ntype GestureHandlerTestEvent<\n TEventPayload extends Record<string, unknown> = Record<string, unknown>\n> = (\n | GestureEvent<TEventPayload>\n | HandlerStateChangeEvent<TEventPayload>\n)['nativeEvent'];\n\ntype HandlerNames = keyof DefaultEventsMapping;\n\ntype WithNumberOfPointers<T> = {\n [P in keyof T]: T[P] & { numberOfPointers: number };\n};\ntype DefaultEventsMapping = WithNumberOfPointers<{\n [flingHandlerName]: FlingGestureHandlerEventPayload;\n [forceTouchHandlerName]: ForceTouchGestureHandlerEventPayload;\n [longPressHandlerName]: LongPressGestureHandlerEventPayload;\n [nativeViewHandlerName]: NativeViewGestureHandlerPayload;\n [panHandlerName]: PanGestureHandlerEventPayload;\n [pinchHandlerName]: PinchGestureHandlerEventPayload;\n [rotationHandlerName]: RotationGestureHandlerEventPayload;\n [tapHandlerName]: TapGestureHandlerEventPayload;\n}>;\n\nconst handlersDefaultEvents: DefaultEventsMapping = {\n [flingHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n [forceTouchHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n force: 1,\n numberOfPointers: 1,\n },\n [longPressHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n duration: 100,\n numberOfPointers: 1,\n },\n [nativeViewHandlerName]: {\n pointerInside: true,\n numberOfPointers: 1,\n },\n [panHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n translationX: 100,\n translationY: 0,\n velocityX: 3,\n velocityY: 0,\n numberOfPointers: 1,\n },\n [pinchHandlerName]: {\n focalX: 0,\n focalY: 0,\n scale: 2,\n velocity: 1,\n numberOfPointers: 2,\n },\n [rotationHandlerName]: {\n anchorX: 0,\n anchorY: 0,\n rotation: 3.14,\n velocity: 2,\n numberOfPointers: 2,\n },\n [tapHandlerName]: {\n x: 0,\n y: 0,\n absoluteX: 0,\n absoluteY: 0,\n numberOfPointers: 1,\n },\n};\n\nfunction isGesture(\n componentOrGesture: ReactTestInstance | GestureType\n): componentOrGesture is GestureType {\n return componentOrGesture instanceof BaseGesture;\n}\n\ninterface WrappedGestureHandlerTestEvent {\n nativeEvent: GestureHandlerTestEvent;\n}\nfunction wrapWithNativeEvent(\n event: GestureHandlerTestEvent\n): WrappedGestureHandlerTestEvent {\n return { nativeEvent: event };\n}\n\nfunction fillOldStateChanges(\n previousEvent: GestureHandlerTestEvent | null,\n currentEvent: Omit<GestureHandlerTestEvent, 'oldState'>\n): GestureHandlerTestEvent {\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n return {\n oldState: State.UNDETERMINED,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n }\n\n const isGestureStateEvent = previousEvent.state !== currentEvent.state;\n if (isGestureStateEvent) {\n return {\n oldState: previousEvent?.state,\n ...currentEvent,\n } as GestureHandlerTestEvent;\n } else {\n return currentEvent as GestureHandlerTestEvent;\n }\n}\n\ntype EventWithStates = Partial<\n Pick<GestureHandlerTestEvent, 'oldState' | 'state'>\n>;\nfunction validateStateTransitions(\n previousEvent: EventWithStates | null,\n currentEvent: EventWithStates\n) {\n function stringify(event: Record<string, unknown> | null) {\n return JSON.stringify(event, null, 2);\n }\n function errorMsgWithBothEvents(description: string) {\n return `${description}, invalid event: ${stringify(\n currentEvent\n )}, previous event: ${stringify(previousEvent)}`;\n }\n\n function errorMsgWithCurrentEvent(description: string) {\n return `${description}, invalid event: ${stringify(currentEvent)}`;\n }\n\n invariant(\n hasProperty(currentEvent, 'state'),\n errorMsgWithCurrentEvent('every event must have state')\n );\n\n const isFirstEvent = previousEvent === null;\n if (isFirstEvent) {\n invariant(\n currentEvent.state === State.BEGAN,\n errorMsgWithCurrentEvent('first event must have BEGAN state')\n );\n }\n\n if (previousEvent !== null) {\n if (previousEvent.state !== currentEvent.state) {\n invariant(\n hasProperty(currentEvent, 'oldState'),\n errorMsgWithCurrentEvent(\n 'when state changes, oldState field should be present'\n )\n );\n invariant(\n currentEvent.oldState === previousEvent.state,\n errorMsgWithBothEvents(\n \"when state changes, oldState should be the same as previous event' state\"\n )\n );\n }\n }\n\n return currentEvent;\n}\n\ntype EventWithoutStates = Omit<GestureHandlerTestEvent, 'oldState' | 'state'>;\ninterface HandlerInfo {\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction fillMissingDefaultsFor({\n handlerType,\n handlerTag,\n}: HandlerInfo): (\n event: Partial<GestureHandlerTestEvent>\n) => EventWithoutStates {\n return (event) => {\n return {\n ...handlersDefaultEvents[handlerType],\n ...event,\n handlerTag,\n };\n };\n}\n\nfunction isDiscreteHandler(handlerType: HandlerNames) {\n return (\n handlerType === 'TapGestureHandler' ||\n handlerType === 'LongPressGestureHandler'\n );\n}\n\nfunction fillMissingStatesTransitions(\n events: EventWithoutStates[],\n isDiscreteHandler: boolean\n): EventWithoutStates[] {\n type Event = EventWithoutStates | null;\n const _events = [...events];\n const lastEvent = _events[_events.length - 1] ?? null;\n const firstEvent = _events[0] ?? null;\n\n const shouldDuplicateFirstEvent =\n !isDiscreteHandler && !hasState(State.BEGAN)(firstEvent);\n if (shouldDuplicateFirstEvent) {\n const duplicated = { ...firstEvent, state: State.BEGAN };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.unshift(duplicated);\n }\n\n const shouldDuplicateLastEvent =\n !hasState(State.END)(lastEvent) ||\n !hasState(State.FAILED)(lastEvent) ||\n !hasState(State.CANCELLED)(lastEvent);\n\n if (shouldDuplicateLastEvent) {\n const duplicated = { ...lastEvent, state: State.END };\n // @ts-ignore badly typed, property may exist and we don't want to copy it\n delete duplicated.oldState;\n _events.push(duplicated);\n }\n\n function isWithoutState(event: Event) {\n return event !== null && !hasProperty(event, 'state');\n }\n function hasState(state: State) {\n return (event: Event) => event !== null && event.state === state;\n }\n function noEventsLeft(event: Event) {\n return event === null;\n }\n\n function trueFn() {\n return true;\n }\n interface Args {\n shouldConsumeEvent?: (event: Event) => boolean;\n shouldTransitionToNextState?: (nextEvent: Event) => boolean;\n }\n function fillEventsForCurrentState({\n shouldConsumeEvent = trueFn,\n shouldTransitionToNextState = trueFn,\n }: Args) {\n function peekCurrentEvent(): Event {\n return _events[0] ?? null;\n }\n function peekNextEvent(): Event {\n return _events[1] ?? null;\n }\n function consumeCurrentEvent() {\n _events.shift();\n }\n const currentEvent = peekCurrentEvent();\n const nextEvent = peekNextEvent();\n const currentRequiredState = REQUIRED_EVENTS[currentStateIdx];\n\n let eventData = {};\n const shouldUseEvent = shouldConsumeEvent(currentEvent);\n if (shouldUseEvent) {\n eventData = currentEvent!;\n consumeCurrentEvent();\n }\n transformedEvents.push({ state: currentRequiredState, ...eventData });\n if (shouldTransitionToNextState(nextEvent)) {\n currentStateIdx++;\n }\n }\n\n const REQUIRED_EVENTS = [State.BEGAN, State.ACTIVE, State.END];\n\n let currentStateIdx = 0;\n const transformedEvents: EventWithoutStates[] = [];\n let hasAllStates;\n let iterations = 0;\n do {\n const nextRequiredState = REQUIRED_EVENTS[currentStateIdx];\n if (nextRequiredState === State.BEGAN) {\n fillEventsForCurrentState({\n shouldConsumeEvent: (e: Event) =>\n isWithoutState(e) || hasState(State.BEGAN)(e),\n });\n } else if (nextRequiredState === State.ACTIVE) {\n const shouldConsumeEvent = (e: Event) =>\n isWithoutState(e) || hasState(State.ACTIVE)(e);\n const shouldTransitionToNextState = (nextEvent: Event) =>\n noEventsLeft(nextEvent) ||\n hasState(State.END)(nextEvent) ||\n hasState(State.FAILED)(nextEvent) ||\n hasState(State.CANCELLED)(nextEvent);\n\n fillEventsForCurrentState({\n shouldConsumeEvent,\n shouldTransitionToNextState,\n });\n } else if (nextRequiredState === State.END) {\n fillEventsForCurrentState({});\n }\n hasAllStates = currentStateIdx === REQUIRED_EVENTS.length;\n\n invariant(\n iterations++ <= 500,\n 'exceeded max number of iterations, please report a bug in RNGH repository with your test case'\n );\n } while (!hasAllStates);\n\n return transformedEvents;\n}\n\ntype EventEmitter = (\n eventName: string,\n args: { nativeEvent: GestureHandlerTestEvent }\n) => void;\ninterface HandlerData {\n emitEvent: EventEmitter;\n handlerType: HandlerNames;\n handlerTag: number;\n}\nfunction getHandlerData(\n componentOrGesture: ReactTestInstance | GestureType\n): HandlerData {\n if (isGesture(componentOrGesture)) {\n const gesture = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n DeviceEventEmitter.emit(eventName, args.nativeEvent);\n },\n handlerType: gesture.handlerName as HandlerNames,\n handlerTag: gesture.handlerTag,\n };\n }\n const gestureHandlerComponent = componentOrGesture;\n return {\n emitEvent: (eventName, args) => {\n fireEvent(gestureHandlerComponent, eventName, args);\n },\n handlerType: gestureHandlerComponent.props.handlerType as HandlerNames,\n handlerTag: gestureHandlerComponent.props.handlerTag as number,\n };\n}\ntype AllGestures =\n | TapGesture\n | PanGesture\n | LongPressGesture\n | RotationGesture\n | PinchGesture\n | FlingGesture\n | ForceTouchGesture\n | NativeGesture;\n\ntype AllHandlers =\n | TapGestureHandler\n | PanGestureHandler\n | LongPressGestureHandler\n | RotationGestureHandler\n | PinchGestureHandler\n | FlingGestureHandler\n | ForceTouchGestureHandler\n | NativeViewGestureHandler;\n\n// prettier-ignore\ntype ClassComponentConstructor<P> = new (props: P) => React.Component<P, any, any>;\n\ntype ExtractPayloadFromProps<T> = T extends BaseGestureHandlerProps<\n infer TPayload\n>\n ? TPayload\n : never;\n\ntype ExtractConfig<T> = T extends BaseGesture<infer TGesturePayload>\n ? TGesturePayload\n : T extends ClassComponentConstructor<infer THandlerProps>\n ? ExtractPayloadFromProps<THandlerProps>\n : Record<string, unknown>;\n\nexport function fireGestureHandler<THandler extends AllGestures | AllHandlers>(\n componentOrGesture: ReactTestInstance | GestureType,\n eventList: Partial<GestureHandlerTestEvent<ExtractConfig<THandler>>>[] = []\n): void {\n const { emitEvent, handlerType, handlerTag } =\n getHandlerData(componentOrGesture);\n\n let _ = fillMissingStatesTransitions(\n eventList,\n isDiscreteHandler(handlerType)\n );\n _ = _.map(fillMissingDefaultsFor({ handlerTag, handlerType }));\n _ = withPrevAndCurrent(_, fillOldStateChanges);\n _ = withPrevAndCurrent(_, validateStateTransitions);\n // @ts-ignore TODO\n _ = _.map(wrapWithNativeEvent);\n\n const events = _ as unknown as WrappedGestureHandlerTestEvent[];\n\n const firstEvent = events.shift()!;\n\n emitEvent('onGestureHandlerStateChange', firstEvent);\n let lastSentEvent = firstEvent;\n for (const event of events) {\n const hasChangedState =\n lastSentEvent.nativeEvent.state !== event.nativeEvent.state;\n\n if (hasChangedState) {\n emitEvent('onGestureHandlerStateChange', event);\n } else {\n emitEvent('onGestureHandlerEvent', event);\n }\n lastSentEvent = event;\n }\n}\n\nexport function getByGestureTestId(testID: string) {\n const handler = findHandlerByTestID(testID);\n if (handler === null) {\n throw new Error(`Handler with id: '${testID}' cannot be found`);\n }\n return handler;\n}\n"]}
@@ -2,7 +2,7 @@ import { TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, Touchabl
2
2
  import { State } from './State';
3
3
  import { Directions } from './Directions';
4
4
 
5
- const NOOP = () => {// do nothing
5
+ const NOOP = () => {// Do nothing
6
6
  };
7
7
 
8
8
  const PanGestureHandler = View;
@@ -51,7 +51,7 @@ export default {
51
51
  updateGestureHandler,
52
52
  flushOperations,
53
53
  install,
54
- // probably can be removed
54
+ // Probably can be removed
55
55
  Directions,
56
56
  State
57
57
  };
@@ -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","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
+ {"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"]}
@@ -30,7 +30,7 @@ export function isJestEnv() {
30
30
  }
31
31
  export function tagMessage(msg) {
32
32
  return `[react-native-gesture-handler] ${msg}`;
33
- } // helper method to check whether Fabric is enabled, however global.nativeFabricUIManager
33
+ } // Helper method to check whether Fabric is enabled, however global.nativeFabricUIManager
34
34
  // may not be initialized before the first render
35
35
 
36
36
  export function isFabric() {
@@ -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","localGlobal","nativeCallSyncHook","__REMOTEDEV__","RN$Bridgeless","deepEqual","obj1","obj2","keys1","keys","keys2","length","includes"],"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;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,SAAT,CAAmBC,IAAnB,EAA8BC,IAA9B,EAAyC;AAC9C,MAAID,IAAI,KAAKC,IAAb,EAAmB;AACjB,WAAO,IAAP;AACD;;AAED,MACE,OAAOD,IAAP,KAAgB,QAAhB,IACA,OAAOC,IAAP,KAAgB,QADhB,IAEAD,IAAI,KAAK,IAFT,IAGAC,IAAI,KAAK,IAJX,EAKE;AACA,WAAO,KAAP;AACD;;AAED,QAAMC,KAAK,GAAGrB,MAAM,CAACsB,IAAP,CAAYH,IAAZ,CAAd;AACA,QAAMI,KAAK,GAAGvB,MAAM,CAACsB,IAAP,CAAYF,IAAZ,CAAd;;AAEA,MAAIC,KAAK,CAACG,MAAN,KAAiBD,KAAK,CAACC,MAA3B,EAAmC;AACjC,WAAO,KAAP;AACD;;AAED,OAAK,MAAMzB,GAAX,IAAkBsB,KAAlB,EAAyB;AACvB,QAAI,CAACE,KAAK,CAACE,QAAN,CAAe1B,GAAf,CAAD,IAAwB,CAACmB,SAAS,CAACC,IAAI,CAACpB,GAAD,CAAL,EAAYqB,IAAI,CAACrB,GAAD,CAAhB,CAAtC,EAA8D;AAC5D,aAAO,KAAP;AACD;AACF;;AAED,SAAO,IAAP;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 // 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\n/**\n * Recursively compares two objects for deep equality.\n *\n * **Note:** This function does not support cyclic references.\n *\n * @param obj1 - The first object to compare.\n * @param obj2 - The second object to compare.\n * @returns `true` if the objects are deeply equal, `false` otherwise.\n */\nexport function deepEqual(obj1: any, obj2: any) {\n if (obj1 === obj2) {\n return true;\n }\n\n if (\n typeof obj1 !== 'object' ||\n typeof obj2 !== 'object' ||\n obj1 === null ||\n obj2 === null\n ) {\n return false;\n }\n\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {\n return false;\n }\n }\n\n return true;\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","deepEqual","obj1","obj2","keys1","keys","keys2","length","includes"],"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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KAAP;AACD;;AAED,OAAK,MAAMzB,GAAX,IAAkBsB,KAAlB,EAAyB;AACvB,QAAI,CAACE,KAAK,CAACE,QAAN,CAAe1B,GAAf,CAAD,IAAwB,CAACmB,SAAS,CAACC,IAAI,CAACpB,GAAD,CAAL,EAAYqB,IAAI,CAACrB,GAAD,CAAhB,CAAtC,EAA8D;AAC5D,aAAO,KAAP;AACD;AACF;;AAED,SAAO,IAAP;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 // 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\n/**\n * Recursively compares two objects for deep equality.\n *\n * **Note:** This function does not support cyclic references.\n *\n * @param obj1 - The first object to compare.\n * @param obj2 - The second object to compare.\n * @returns `true` if the objects are deeply equal, `false` otherwise.\n */\nexport function deepEqual(obj1: any, obj2: any) {\n if (obj1 === obj2) {\n return true;\n }\n\n if (\n typeof obj1 !== 'object' ||\n typeof obj2 !== 'object' ||\n obj1 === null ||\n obj2 === null\n ) {\n return false;\n }\n\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {\n return false;\n }\n }\n\n return true;\n}\n"]}
@@ -7,7 +7,7 @@ import RotationGestureHandler from './handlers/RotationGestureHandler';
7
7
  import FlingGestureHandler from './handlers/FlingGestureHandler';
8
8
  import NativeViewGestureHandler from './handlers/NativeViewGestureHandler';
9
9
  import ManualGestureHandler from './handlers/ManualGestureHandler';
10
- import HoverGestureHandler from './handlers/HoverGestureHandler'; //Hammer Handlers
10
+ import HoverGestureHandler from './handlers/HoverGestureHandler'; // Hammer Handlers
11
11
 
12
12
  import HammerNativeViewGestureHandler from '../web_hammer/NativeViewGestureHandler';
13
13
  import HammerPanGestureHandler from '../web_hammer/PanGestureHandler';
@@ -1 +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
+ {"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"]}
@@ -39,7 +39,7 @@ export default class RotationGestureDetector {
39
39
  const vectorX = secondPointerCoords.x - firstPointerCoords.x;
40
40
  const vectorY = secondPointerCoords.y - firstPointerCoords.y;
41
41
  this.anchorX = (firstPointerCoords.x + secondPointerCoords.x) / 2;
42
- this.anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2; //Angle diff should be positive when rotating in clockwise direction
42
+ this.anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2; // Angle diff should be positive when rotating in clockwise direction
43
43
 
44
44
  const angle = -Math.atan2(vectorY, vectorX);
45
45
  this.rotation = Number.isNaN(this.previousAngle) ? 0 : this.previousAngle - angle;
@@ -1 +1 @@
1
- {"version":3,"sources":["RotationGestureDetector.ts"],"names":["EventTypes","RotationGestureDetector","constructor","callbacks","NaN","onRotationBegin","onRotation","onRotationEnd","updateCurrent","event","tracker","previousTime","currentTime","time","firstPointerID","secondPointerID","keyPointers","firstPointerCoords","getLastAbsoluteCoords","secondPointerCoords","vectorX","x","vectorY","y","anchorX","anchorY","angle","Math","atan2","rotation","Number","isNaN","previousAngle","PI","finish","isInProgress","setKeyPointers","pointerIDs","getData","keys","next","value","onTouchEvent","eventType","DOWN","ADDITIONAL_POINTER_DOWN","MOVE","ADDITIONAL_POINTER_UP","indexOf","pointerId","UP","getTimeDelta","getAnchorX","getAnchorY","getRotation","reset"],"mappings":";;AAAA,SAAuBA,UAAvB,QAAyC,eAAzC;AASA,eAAe,MAAMC,uBAAN,CAEf;AAkBEC,EAAAA,WAAW,CAACC,SAAD,EAAqC;AAAA;;AAAA;;AAAA;;AAAA,yCAb1B,CAa0B;;AAAA,0CAZzB,CAYyB;;AAAA,2CAVxB,CAUwB;;AAAA,sCAT7B,CAS6B;;AAAA,qCAP9B,CAO8B;;AAAA,qCAN9B,CAM8B;;AAAA,0CAJzB,KAIyB;;AAAA,yCAFhB,CAACC,GAAD,EAAMA,GAAN,CAEgB;;AAC9C,SAAKC,eAAL,GAAuBF,SAAS,CAACE,eAAjC;AACA,SAAKC,UAAL,GAAkBH,SAAS,CAACG,UAA5B;AACA,SAAKC,aAAL,GAAqBJ,SAAS,CAACI,aAA/B;AACD;;AAEOC,EAAAA,aAAa,CAACC,KAAD,EAAsBC,OAAtB,EAAqD;AACxE,SAAKC,YAAL,GAAoB,KAAKC,WAAzB;AACA,SAAKA,WAAL,GAAmBH,KA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;AACtB;AACD;;AAED,aAAK3B,aAAL,CAAmBC,KAAnB,EAA0BC,OAA1B;AACA,aAAKJ,UAAL,CAAgB,IAAhB;AAEA;;AAEF,WAAKN,UAAU,CAAC+C,qBAAhB;AACE,YAAI,CAAC,KAAKZ,YAAV,EAAwB;AACtB;AACD;;AAED,YAAI,KAAKnB,WAAL,CAAiBgC,OAAjB,CAAyBvC,KAAK,CAACwC,SAA/B,KAA6C,CAAjD,EAAoD;AAClD,eAAKf,MAAL;AACD;;AAED;;AAEF,WAAKlC,UAAU,CAACkD,EAAhB;AACE,YAAI,KAAKf,YAAT,EAAuB;AACrB,eAAKD,MAAL;AACD;;AACD;AA7CJ;;AAgDA,WAAO,IAAP;AACD;;AAEMiB,EAAAA,YAAY,GAAW;AAC5B,WAAO,KAAKvC,WAAL,GAAmB,KAAKD,YAA/B;AACD;;AAEMyC,EAAAA,UAAU,GAAW;AAC1B,WAAO,KAAK5B,OAAZ;AACD;;AAEM6B,EAAAA,UAAU,GAAW;AAC1B,WAAO,KAAK5B,OAAZ;AACD;;AAEM6B,EAAAA,WAAW,GAAW;AAC3B,WAAO,KAAKzB,QAAZ;AACD;;AAEM0B,EAAAA,KAAK,GAAS;AACnB,SAAKvC,WAAL,GAAmB,CAACZ,GAAD,EAAMA,GAAN,CAAnB;AACA,SAAK+B,YAAL,GAAoB,KAApB;AACD;;AAzJH","sourcesContent":["import { AdaptedEvent, EventTypes } from '../interfaces';\nimport PointerTracker from '../tools/PointerTracker';\n\nexport interface RotationGestureListener {\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n}\n\nexport default class RotationGestureDetector\n implements RotationGestureListener\n{\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n\n private currentTime = 0;\n private previousTime = 0;\n\n private previousAngle = 0;\n private rotation = 0;\n\n private anchorX = 0;\n private anchorY = 0;\n\n private isInProgress = false;\n\n private keyPointers: number[] = [NaN, NaN];\n\n constructor(callbacks: RotationGestureListener) {\n this.onRotationBegin = callbacks.onRotationBegin;\n this.onRotation = callbacks.onRotation;\n this.onRotationEnd = callbacks.onRotationEnd;\n }\n\n private updateCurrent(event: AdaptedEvent, tracker: PointerTracker): void {\n this.previousTime = this.currentTime;\n this.currentTime = event.time;\n\n const [firstPointerID, secondPointerID] = this.keyPointers;\n\n const firstPointerCoords = tracker.getLastAbsoluteCoords(firstPointerID);\n const secondPointerCoords = tracker.getLastAbsoluteCoords(secondPointerID);\n\n const vectorX: number = secondPointerCoords.x - firstPointerCoords.x;\n const vectorY: number = secondPointerCoords.y - firstPointerCoords.y;\n\n this.anchorX = (firstPointerCoords.x + secondPointerCoords.x) / 2;\n this.anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2;\n\n //Angle diff should be positive when rotating in clockwise direction\n const angle: number = -Math.atan2(vectorY, vectorX);\n\n this.rotation = Number.isNaN(this.previousAngle)\n ? 0\n : this.previousAngle - angle;\n\n this.previousAngle = angle;\n\n if (this.rotation > Math.PI) {\n this.rotation -= Math.PI;\n } else if (this.rotation < -Math.PI) {\n this.rotation += Math.PI;\n }\n\n if (this.rotation > Math.PI / 2) {\n this.rotation -= Math.PI;\n } else if (this.rotation < -Math.PI / 2) {\n this.rotation += Math.PI;\n }\n }\n\n private finish(): void {\n if (!this.isInProgress) {\n return;\n }\n\n this.isInProgress = false;\n this.keyPointers = [NaN, NaN];\n this.onRotationEnd(this);\n }\n\n private setKeyPointers(tracker: PointerTracker): void {\n if (this.keyPointers[0] && this.keyPointers[1]) {\n return;\n }\n\n const pointerIDs: IterableIterator<number> = tracker.getData().keys();\n\n this.keyPointers[0] = pointerIDs.next().value as number;\n this.keyPointers[1] = pointerIDs.next().value as number;\n }\n\n public onTouchEvent(event: AdaptedEvent, tracker: PointerTracker): boolean {\n switch (event.eventType) {\n case EventTypes.DOWN:\n this.isInProgress = false;\n break;\n\n case EventTypes.ADDITIONAL_POINTER_DOWN:\n if (this.isInProgress) {\n break;\n }\n this.isInProgress = true;\n\n this.previousTime = event.time;\n this.previousAngle = NaN;\n\n this.setKeyPointers(tracker);\n\n this.updateCurrent(event, tracker);\n this.onRotationBegin(this);\n break;\n\n case EventTypes.MOVE:\n if (!this.isInProgress) {\n break;\n }\n\n this.updateCurrent(event, tracker);\n this.onRotation(this);\n\n break;\n\n case EventTypes.ADDITIONAL_POINTER_UP:\n if (!this.isInProgress) {\n break;\n }\n\n if (this.keyPointers.indexOf(event.pointerId) >= 0) {\n this.finish();\n }\n\n break;\n\n case EventTypes.UP:\n if (this.isInProgress) {\n this.finish();\n }\n break;\n }\n\n return true;\n }\n\n public getTimeDelta(): number {\n return this.currentTime + this.previousTime;\n }\n\n public getAnchorX(): number {\n return this.anchorX;\n }\n\n public getAnchorY(): number {\n return this.anchorY;\n }\n\n public getRotation(): number {\n return this.rotation;\n }\n\n public reset(): void {\n this.keyPointers = [NaN, NaN];\n this.isInProgress = false;\n }\n}\n"]}
1
+ {"version":3,"sources":["RotationGestureDetector.ts"],"names":["EventTypes","RotationGestureDetector","constructor","callbacks","NaN","onRotationBegin","onRotation","onRotationEnd","updateCurrent","event","tracker","previousTime","currentTime","time","firstPointerID","secondPointerID","keyPointers","firstPointerCoords","getLastAbsoluteCoords","secondPointerCoords","vectorX","x","vectorY","y","anchorX","anchorY","angle","Math","atan2","rotation","Number","isNaN","previousAngle","PI","finish","isInProgress","setKeyPointers","pointerIDs","getData","keys","next","value","onTouchEvent","eventType","DOWN","ADDITIONAL_POINTER_DOWN","MOVE","ADDITIONAL_POINTER_UP","indexOf","pointerId","UP","getTimeDelta","getAnchorX","getAnchorY","getRotation","reset"],"mappings":";;AAAA,SAAuBA,UAAvB,QAAyC,eAAzC;AASA,eAAe,MAAMC,uBAAN,CAEf;AAkBEC,EAAAA,WAAW,CAACC,SAAD,EAAqC;AAAA;;AAAA;;AAAA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B,SAAKvC,WAAL,GAAmB,CAACZ,GAAD,EAAMA,GAAN,CAAnB;AACA,SAAK+B,YAAL,GAAoB,KAApB;AACD;;AAzJH","sourcesContent":["import { AdaptedEvent, EventTypes } from '../interfaces';\nimport PointerTracker from '../tools/PointerTracker';\n\nexport interface RotationGestureListener {\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n}\n\nexport default class RotationGestureDetector\n implements RotationGestureListener\n{\n onRotationBegin: (detector: RotationGestureDetector) => boolean;\n onRotation: (detector: RotationGestureDetector) => boolean;\n onRotationEnd: (detector: RotationGestureDetector) => void;\n\n private currentTime = 0;\n private previousTime = 0;\n\n private previousAngle = 0;\n private rotation = 0;\n\n private anchorX = 0;\n private anchorY = 0;\n\n private isInProgress = false;\n\n private keyPointers: number[] = [NaN, NaN];\n\n constructor(callbacks: RotationGestureListener) {\n this.onRotationBegin = callbacks.onRotationBegin;\n this.onRotation = callbacks.onRotation;\n this.onRotationEnd = callbacks.onRotationEnd;\n }\n\n private updateCurrent(event: AdaptedEvent, tracker: PointerTracker): void {\n this.previousTime = this.currentTime;\n this.currentTime = event.time;\n\n const [firstPointerID, secondPointerID] = this.keyPointers;\n\n const firstPointerCoords = tracker.getLastAbsoluteCoords(firstPointerID);\n const secondPointerCoords = tracker.getLastAbsoluteCoords(secondPointerID);\n\n const vectorX: number = secondPointerCoords.x - firstPointerCoords.x;\n const vectorY: number = secondPointerCoords.y - firstPointerCoords.y;\n\n this.anchorX = (firstPointerCoords.x + secondPointerCoords.x) / 2;\n this.anchorY = (firstPointerCoords.y + secondPointerCoords.y) / 2;\n\n // Angle diff should be positive when rotating in clockwise direction\n const angle: number = -Math.atan2(vectorY, vectorX);\n\n this.rotation = Number.isNaN(this.previousAngle)\n ? 0\n : this.previousAngle - angle;\n\n this.previousAngle = angle;\n\n if (this.rotation > Math.PI) {\n this.rotation -= Math.PI;\n } else if (this.rotation < -Math.PI) {\n this.rotation += Math.PI;\n }\n\n if (this.rotation > Math.PI / 2) {\n this.rotation -= Math.PI;\n } else if (this.rotation < -Math.PI / 2) {\n this.rotation += Math.PI;\n }\n }\n\n private finish(): void {\n if (!this.isInProgress) {\n return;\n }\n\n this.isInProgress = false;\n this.keyPointers = [NaN, NaN];\n this.onRotationEnd(this);\n }\n\n private setKeyPointers(tracker: PointerTracker): void {\n if (this.keyPointers[0] && this.keyPointers[1]) {\n return;\n }\n\n const pointerIDs: IterableIterator<number> = tracker.getData().keys();\n\n this.keyPointers[0] = pointerIDs.next().value as number;\n this.keyPointers[1] = pointerIDs.next().value as number;\n }\n\n public onTouchEvent(event: AdaptedEvent, tracker: PointerTracker): boolean {\n switch (event.eventType) {\n case EventTypes.DOWN:\n this.isInProgress = false;\n break;\n\n case EventTypes.ADDITIONAL_POINTER_DOWN:\n if (this.isInProgress) {\n break;\n }\n this.isInProgress = true;\n\n this.previousTime = event.time;\n this.previousAngle = NaN;\n\n this.setKeyPointers(tracker);\n\n this.updateCurrent(event, tracker);\n this.onRotationBegin(this);\n break;\n\n case EventTypes.MOVE:\n if (!this.isInProgress) {\n break;\n }\n\n this.updateCurrent(event, tracker);\n this.onRotation(this);\n\n break;\n\n case EventTypes.ADDITIONAL_POINTER_UP:\n if (!this.isInProgress) {\n break;\n }\n\n if (this.keyPointers.indexOf(event.pointerId) >= 0) {\n this.finish();\n }\n\n break;\n\n case EventTypes.UP:\n if (this.isInProgress) {\n this.finish();\n }\n break;\n }\n\n return true;\n }\n\n public getTimeDelta(): number {\n return this.currentTime + this.previousTime;\n }\n\n public getAnchorX(): number {\n return this.anchorX;\n }\n\n public getAnchorY(): number {\n return this.anchorY;\n }\n\n public getRotation(): number {\n return this.rotation;\n }\n\n public reset(): void {\n this.keyPointers = [NaN, NaN];\n this.isInProgress = false;\n }\n}\n"]}