react-native-gesture-handler 2.25.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (880) hide show
  1. package/README.md +2 -4
  2. package/RNGestureHandler.podspec +1 -0
  3. package/android/build.gradle +41 -42
  4. package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +1 -1
  5. package/android/gradle.properties +1 -1
  6. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -2
  7. package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +4 -1
  8. package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +1 -1
  9. package/android/{package77/src → src}/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +14 -19
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +29 -5
  11. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +229 -114
  12. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +4 -4
  13. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +91 -49
  14. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +1 -1
  15. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +13 -4
  16. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +20 -6
  17. package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +52 -21
  18. package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +12 -1
  19. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +65 -35
  20. package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +3 -3
  21. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +187 -92
  22. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +12 -5
  23. package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +1 -1
  24. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +3 -1
  25. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +12 -5
  26. package/android/src/main/java/com/swmansion/gesturehandler/core/StylusData.kt +1 -1
  27. package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +55 -33
  28. package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +13 -18
  29. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +27 -21
  30. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +7 -2
  31. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +13 -12
  32. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt +189 -0
  33. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerFactoryUtil.kt +34 -0
  34. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +7 -11
  35. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +29 -590
  36. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +8 -14
  37. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +26 -16
  38. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -12
  39. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +2 -4
  40. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +17 -16
  41. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +6 -4
  42. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +7 -5
  43. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +2 -1
  44. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +1 -1
  45. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +2 -1
  46. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +2 -1
  47. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +2 -1
  48. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +2 -1
  49. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +2 -1
  50. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +2 -1
  51. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +2 -1
  52. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +2 -1
  53. package/android/src/main/jni/CMakeLists.txt +8 -18
  54. package/android/svg/src/main/java/com/swmansion/gesturehandler/RNSVGHitTester.kt +1 -3
  55. package/apple/RNGestureHandlerButton.mm +6 -2
  56. package/package.json +29 -47
  57. package/src/components/DrawerLayout.tsx +5 -2
  58. package/src/components/GestureButtons.tsx +2 -2
  59. package/src/components/GestureComponents.web.tsx +1 -1
  60. package/src/components/GestureHandlerButton.web.tsx +3 -3
  61. package/src/components/Pressable/Pressable.tsx +362 -425
  62. package/src/components/Pressable/PressableProps.tsx +34 -0
  63. package/src/components/Pressable/StateMachine.tsx +49 -0
  64. package/src/components/Pressable/stateDefinitions.ts +125 -0
  65. package/src/components/Pressable/utils.ts +11 -7
  66. package/src/components/ReanimatedSwipeable.tsx +55 -33
  67. package/src/components/Swipeable.tsx +3 -0
  68. package/src/components/Text.tsx +5 -2
  69. package/src/components/utils.ts +26 -0
  70. package/src/getShadowNodeFromRef.ts +2 -2
  71. package/src/handlers/GestureHandlerEventPayload.ts +3 -0
  72. package/src/handlers/createHandler.tsx +1 -0
  73. package/src/handlers/gestureHandlerTypesCompat.ts +9 -0
  74. package/src/handlers/gestures/forceTouchGesture.ts +9 -0
  75. package/src/handlers/gestures/gestureObjects.ts +3 -1
  76. package/src/handlers/gestures/reanimatedWrapper.ts +0 -1
  77. package/src/handlers/utils.ts +1 -1
  78. package/src/utils.ts +0 -1
  79. package/src/web/detectors/RotationGestureDetector.ts +4 -0
  80. package/src/web/handlers/FlingGestureHandler.ts +4 -0
  81. package/src/web/handlers/GestureHandler.ts +9 -3
  82. package/src/web/handlers/PanGestureHandler.ts +25 -36
  83. package/src/web/handlers/TapGestureHandler.ts +14 -19
  84. package/src/web/tools/GestureHandlerOrchestrator.ts +1 -0
  85. package/src/web/tools/PointerEventManager.ts +1 -1
  86. package/src/web/tools/PointerTracker.ts +17 -15
  87. package/src/web/tools/Vector.ts +1 -1
  88. package/src/web_hammer/DiscreteGestureHandler.ts +1 -1
  89. package/src/web_hammer/DraggingGestureHandler.ts +1 -1
  90. package/src/web_hammer/FlingGestureHandler.ts +1 -1
  91. package/src/web_hammer/GestureHandler.ts +2 -1
  92. package/src/web_hammer/LongPressGestureHandler.ts +1 -1
  93. package/android/packageDeprecated/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +0 -85
  94. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -60
  95. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -26
  96. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -26
  97. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -16
  98. package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +0 -67
  99. package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -13
  100. package/lib/commonjs/ActionType.js +0 -15
  101. package/lib/commonjs/ActionType.js.map +0 -1
  102. package/lib/commonjs/Directions.js +0 -28
  103. package/lib/commonjs/Directions.js.map +0 -1
  104. package/lib/commonjs/EnableNewWebImplementation.js +0 -48
  105. package/lib/commonjs/EnableNewWebImplementation.js.map +0 -1
  106. package/lib/commonjs/GestureHandlerRootViewContext.js +0 -15
  107. package/lib/commonjs/GestureHandlerRootViewContext.js.map +0 -1
  108. package/lib/commonjs/PlatformConstants.js +0 -15
  109. package/lib/commonjs/PlatformConstants.js.map +0 -1
  110. package/lib/commonjs/PlatformConstants.web.js +0 -14
  111. package/lib/commonjs/PlatformConstants.web.js.map +0 -1
  112. package/lib/commonjs/PointerType.js +0 -17
  113. package/lib/commonjs/PointerType.js.map +0 -1
  114. package/lib/commonjs/RNGestureHandlerModule.js +0 -16
  115. package/lib/commonjs/RNGestureHandlerModule.js.map +0 -1
  116. package/lib/commonjs/RNGestureHandlerModule.web.js +0 -122
  117. package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
  118. package/lib/commonjs/RNGestureHandlerModule.windows.js +0 -66
  119. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +0 -1
  120. package/lib/commonjs/RNRenderer.js +0 -16
  121. package/lib/commonjs/RNRenderer.js.map +0 -1
  122. package/lib/commonjs/RNRenderer.web.js +0 -11
  123. package/lib/commonjs/RNRenderer.web.js.map +0 -1
  124. package/lib/commonjs/State.js +0 -18
  125. package/lib/commonjs/State.js.map +0 -1
  126. package/lib/commonjs/TouchEventType.js +0 -16
  127. package/lib/commonjs/TouchEventType.js.map +0 -1
  128. package/lib/commonjs/components/DrawerLayout.js +0 -574
  129. package/lib/commonjs/components/DrawerLayout.js.map +0 -1
  130. package/lib/commonjs/components/GestureButtons.js +0 -269
  131. package/lib/commonjs/components/GestureButtons.js.map +0 -1
  132. package/lib/commonjs/components/GestureButtonsProps.js +0 -6
  133. package/lib/commonjs/components/GestureButtonsProps.js.map +0 -1
  134. package/lib/commonjs/components/GestureComponents.js +0 -115
  135. package/lib/commonjs/components/GestureComponents.js.map +0 -1
  136. package/lib/commonjs/components/GestureComponents.web.js +0 -52
  137. package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
  138. package/lib/commonjs/components/GestureHandlerButton.js +0 -14
  139. package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
  140. package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
  141. package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
  142. package/lib/commonjs/components/GestureHandlerRootView.android.js +0 -46
  143. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +0 -1
  144. package/lib/commonjs/components/GestureHandlerRootView.js +0 -44
  145. package/lib/commonjs/components/GestureHandlerRootView.js.map +0 -1
  146. package/lib/commonjs/components/GestureHandlerRootView.web.js +0 -38
  147. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
  148. package/lib/commonjs/components/Pressable/Pressable.js +0 -370
  149. package/lib/commonjs/components/Pressable/Pressable.js.map +0 -1
  150. package/lib/commonjs/components/Pressable/PressableProps.js +0 -6
  151. package/lib/commonjs/components/Pressable/PressableProps.js.map +0 -1
  152. package/lib/commonjs/components/Pressable/index.js +0 -16
  153. package/lib/commonjs/components/Pressable/index.js.map +0 -1
  154. package/lib/commonjs/components/Pressable/utils.js +0 -114
  155. package/lib/commonjs/components/Pressable/utils.js.map +0 -1
  156. package/lib/commonjs/components/ReanimatedDrawerLayout.js +0 -393
  157. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +0 -1
  158. package/lib/commonjs/components/ReanimatedSwipeable.js +0 -367
  159. package/lib/commonjs/components/ReanimatedSwipeable.js.map +0 -1
  160. package/lib/commonjs/components/Swipeable.js +0 -415
  161. package/lib/commonjs/components/Swipeable.js.map +0 -1
  162. package/lib/commonjs/components/Text.js +0 -71
  163. package/lib/commonjs/components/Text.js.map +0 -1
  164. package/lib/commonjs/components/gestureHandlerRootHOC.js +0 -40
  165. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +0 -1
  166. package/lib/commonjs/components/touchables/ExtraButtonProps.js +0 -2
  167. package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +0 -1
  168. package/lib/commonjs/components/touchables/GenericTouchable.js +0 -290
  169. package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
  170. package/lib/commonjs/components/touchables/GenericTouchableProps.js +0 -6
  171. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +0 -1
  172. package/lib/commonjs/components/touchables/TouchableHighlight.js +0 -111
  173. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +0 -1
  174. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +0 -102
  175. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
  176. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +0 -16
  177. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +0 -1
  178. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +0 -6
  179. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
  180. package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -79
  181. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
  182. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -37
  183. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
  184. package/lib/commonjs/components/touchables/index.js +0 -40
  185. package/lib/commonjs/components/touchables/index.js.map +0 -1
  186. package/lib/commonjs/findNodeHandle.js +0 -12
  187. package/lib/commonjs/findNodeHandle.js.map +0 -1
  188. package/lib/commonjs/findNodeHandle.web.js +0 -48
  189. package/lib/commonjs/findNodeHandle.web.js.map +0 -1
  190. package/lib/commonjs/getShadowNodeFromRef.js +0 -52
  191. package/lib/commonjs/getShadowNodeFromRef.js.map +0 -1
  192. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
  193. package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
  194. package/lib/commonjs/ghQueueMicrotask.js +0 -11
  195. package/lib/commonjs/ghQueueMicrotask.js.map +0 -1
  196. package/lib/commonjs/handlers/FlingGestureHandler.js +0 -33
  197. package/lib/commonjs/handlers/FlingGestureHandler.js.map +0 -1
  198. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +0 -53
  199. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +0 -1
  200. package/lib/commonjs/handlers/GestureHandlerEventPayload.js +0 -6
  201. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +0 -1
  202. package/lib/commonjs/handlers/LongPressGestureHandler.js +0 -35
  203. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +0 -1
  204. package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -35
  205. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
  206. package/lib/commonjs/handlers/PanGestureHandler.js +0 -131
  207. package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
  208. package/lib/commonjs/handlers/PinchGestureHandler.js +0 -31
  209. package/lib/commonjs/handlers/PinchGestureHandler.js.map +0 -1
  210. package/lib/commonjs/handlers/PressabilityDebugView.js +0 -14
  211. package/lib/commonjs/handlers/PressabilityDebugView.js.map +0 -1
  212. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
  213. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
  214. package/lib/commonjs/handlers/RotationGestureHandler.js +0 -31
  215. package/lib/commonjs/handlers/RotationGestureHandler.js.map +0 -1
  216. package/lib/commonjs/handlers/TapGestureHandler.js +0 -35
  217. package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
  218. package/lib/commonjs/handlers/createHandler.js +0 -494
  219. package/lib/commonjs/handlers/createHandler.js.map +0 -1
  220. package/lib/commonjs/handlers/createNativeWrapper.js +0 -87
  221. package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
  222. package/lib/commonjs/handlers/customDirectEventTypes.js +0 -14
  223. package/lib/commonjs/handlers/customDirectEventTypes.js.map +0 -1
  224. package/lib/commonjs/handlers/customDirectEventTypes.web.js +0 -11
  225. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +0 -1
  226. package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -28
  227. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
  228. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +0 -6
  229. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +0 -1
  230. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +0 -42
  231. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
  232. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +0 -49
  233. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
  234. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +0 -87
  235. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
  236. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +0 -29
  237. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
  238. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +0 -148
  239. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +0 -1
  240. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -25
  241. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
  242. package/lib/commonjs/handlers/gestures/GestureDetector/types.js +0 -6
  243. package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +0 -1
  244. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +0 -77
  245. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
  246. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -180
  247. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
  248. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -57
  249. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
  250. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +0 -48
  251. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
  252. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -49
  253. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
  254. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +0 -172
  255. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +0 -1
  256. package/lib/commonjs/handlers/gestures/eventReceiver.js +0 -147
  257. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +0 -1
  258. package/lib/commonjs/handlers/gestures/flingGesture.js +0 -47
  259. package/lib/commonjs/handlers/gestures/flingGesture.js.map +0 -1
  260. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +0 -82
  261. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +0 -1
  262. package/lib/commonjs/handlers/gestures/gesture.js +0 -381
  263. package/lib/commonjs/handlers/gestures/gesture.js.map +0 -1
  264. package/lib/commonjs/handlers/gestures/gestureComposition.js +0 -107
  265. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +0 -1
  266. package/lib/commonjs/handlers/gestures/gestureObjects.js +0 -156
  267. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +0 -1
  268. package/lib/commonjs/handlers/gestures/gestureStateManager.js +0 -75
  269. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +0 -1
  270. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +0 -32
  271. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +0 -1
  272. package/lib/commonjs/handlers/gestures/hoverGesture.js +0 -74
  273. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +0 -1
  274. package/lib/commonjs/handlers/gestures/longPressGesture.js +0 -57
  275. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +0 -1
  276. package/lib/commonjs/handlers/gestures/manualGesture.js +0 -31
  277. package/lib/commonjs/handlers/gestures/manualGesture.js.map +0 -1
  278. package/lib/commonjs/handlers/gestures/nativeGesture.js +0 -44
  279. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +0 -1
  280. package/lib/commonjs/handlers/gestures/panGesture.js +0 -225
  281. package/lib/commonjs/handlers/gestures/panGesture.js.map +0 -1
  282. package/lib/commonjs/handlers/gestures/pinchGesture.js +0 -45
  283. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +0 -1
  284. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +0 -37
  285. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +0 -1
  286. package/lib/commonjs/handlers/gestures/rotationGesture.js +0 -45
  287. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +0 -1
  288. package/lib/commonjs/handlers/gestures/tapGesture.js +0 -102
  289. package/lib/commonjs/handlers/gestures/tapGesture.js.map +0 -1
  290. package/lib/commonjs/handlers/getNextHandlerTag.js +0 -12
  291. package/lib/commonjs/handlers/getNextHandlerTag.js.map +0 -1
  292. package/lib/commonjs/handlers/handlersRegistry.js +0 -66
  293. package/lib/commonjs/handlers/handlersRegistry.js.map +0 -1
  294. package/lib/commonjs/handlers/utils.js +0 -92
  295. package/lib/commonjs/handlers/utils.js.map +0 -1
  296. package/lib/commonjs/index.js +0 -298
  297. package/lib/commonjs/index.js.map +0 -1
  298. package/lib/commonjs/init.js +0 -32
  299. package/lib/commonjs/init.js.map +0 -1
  300. package/lib/commonjs/jestUtils/index.js +0 -20
  301. package/lib/commonjs/jestUtils/index.js.map +0 -1
  302. package/lib/commonjs/jestUtils/jestUtils.js +0 -383
  303. package/lib/commonjs/jestUtils/jestUtils.js.map +0 -1
  304. package/lib/commonjs/mocks.js +0 -81
  305. package/lib/commonjs/mocks.js.map +0 -1
  306. package/lib/commonjs/mountRegistry.js +0 -49
  307. package/lib/commonjs/mountRegistry.js.map +0 -1
  308. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +0 -13
  309. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +0 -1
  310. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +0 -15
  311. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
  312. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +0 -15
  313. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
  314. package/lib/commonjs/typeUtils.js +0 -2
  315. package/lib/commonjs/typeUtils.js.map +0 -1
  316. package/lib/commonjs/utils.js +0 -116
  317. package/lib/commonjs/utils.js.map +0 -1
  318. package/lib/commonjs/web/Gestures.js +0 -66
  319. package/lib/commonjs/web/Gestures.js.map +0 -1
  320. package/lib/commonjs/web/constants.js +0 -11
  321. package/lib/commonjs/web/constants.js.map +0 -1
  322. package/lib/commonjs/web/detectors/RotationGestureDetector.js +0 -163
  323. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +0 -1
  324. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +0 -155
  325. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +0 -1
  326. package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -190
  327. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +0 -1
  328. package/lib/commonjs/web/handlers/GestureHandler.js +0 -821
  329. package/lib/commonjs/web/handlers/GestureHandler.js.map +0 -1
  330. package/lib/commonjs/web/handlers/HoverGestureHandler.js +0 -65
  331. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +0 -1
  332. package/lib/commonjs/web/handlers/IGestureHandler.js +0 -2
  333. package/lib/commonjs/web/handlers/IGestureHandler.js.map +0 -1
  334. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +0 -194
  335. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +0 -1
  336. package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -48
  337. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +0 -1
  338. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -189
  339. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +0 -1
  340. package/lib/commonjs/web/handlers/PanGestureHandler.js +0 -530
  341. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +0 -1
  342. package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -165
  343. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +0 -1
  344. package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -173
  345. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +0 -1
  346. package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -286
  347. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +0 -1
  348. package/lib/commonjs/web/interfaces.js +0 -40
  349. package/lib/commonjs/web/interfaces.js.map +0 -1
  350. package/lib/commonjs/web/tools/CircularBuffer.js +0 -59
  351. package/lib/commonjs/web/tools/CircularBuffer.js.map +0 -1
  352. package/lib/commonjs/web/tools/EventManager.js +0 -133
  353. package/lib/commonjs/web/tools/EventManager.js.map +0 -1
  354. package/lib/commonjs/web/tools/GestureHandlerDelegate.js +0 -6
  355. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +0 -1
  356. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +0 -340
  357. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +0 -1
  358. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +0 -217
  359. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +0 -1
  360. package/lib/commonjs/web/tools/InteractionManager.js +0 -119
  361. package/lib/commonjs/web/tools/InteractionManager.js.map +0 -1
  362. package/lib/commonjs/web/tools/KeyboardEventManager.js +0 -110
  363. package/lib/commonjs/web/tools/KeyboardEventManager.js.map +0 -1
  364. package/lib/commonjs/web/tools/LeastSquareSolver.js +0 -204
  365. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +0 -1
  366. package/lib/commonjs/web/tools/NodeManager.js +0 -49
  367. package/lib/commonjs/web/tools/NodeManager.js.map +0 -1
  368. package/lib/commonjs/web/tools/PointerEventManager.js +0 -229
  369. package/lib/commonjs/web/tools/PointerEventManager.js.map +0 -1
  370. package/lib/commonjs/web/tools/PointerTracker.js +0 -234
  371. package/lib/commonjs/web/tools/PointerTracker.js.map +0 -1
  372. package/lib/commonjs/web/tools/Vector.js +0 -61
  373. package/lib/commonjs/web/tools/Vector.js.map +0 -1
  374. package/lib/commonjs/web/tools/VelocityTracker.js +0 -111
  375. package/lib/commonjs/web/tools/VelocityTracker.js.map +0 -1
  376. package/lib/commonjs/web/tools/WheelEventManager.js +0 -74
  377. package/lib/commonjs/web/tools/WheelEventManager.js.map +0 -1
  378. package/lib/commonjs/web/utils.js +0 -270
  379. package/lib/commonjs/web/utils.js.map +0 -1
  380. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +0 -105
  381. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +0 -1
  382. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +0 -53
  383. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +0 -1
  384. package/lib/commonjs/web_hammer/Errors.js +0 -16
  385. package/lib/commonjs/web_hammer/Errors.js.map +0 -1
  386. package/lib/commonjs/web_hammer/FlingGestureHandler.js +0 -170
  387. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +0 -1
  388. package/lib/commonjs/web_hammer/GestureHandler.js +0 -579
  389. package/lib/commonjs/web_hammer/GestureHandler.js.map +0 -1
  390. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +0 -54
  391. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +0 -1
  392. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +0 -71
  393. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +0 -1
  394. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +0 -66
  395. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +0 -1
  396. package/lib/commonjs/web_hammer/NodeManager.js +0 -48
  397. package/lib/commonjs/web_hammer/NodeManager.js.map +0 -1
  398. package/lib/commonjs/web_hammer/PanGestureHandler.js +0 -208
  399. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +0 -1
  400. package/lib/commonjs/web_hammer/PinchGestureHandler.js +0 -40
  401. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +0 -1
  402. package/lib/commonjs/web_hammer/PressGestureHandler.js +0 -188
  403. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +0 -1
  404. package/lib/commonjs/web_hammer/RotationGestureHandler.js +0 -44
  405. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +0 -1
  406. package/lib/commonjs/web_hammer/TapGestureHandler.js +0 -192
  407. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +0 -1
  408. package/lib/commonjs/web_hammer/constants.js +0 -64
  409. package/lib/commonjs/web_hammer/constants.js.map +0 -1
  410. package/lib/commonjs/web_hammer/utils.js +0 -42
  411. package/lib/commonjs/web_hammer/utils.js.map +0 -1
  412. package/lib/module/ActionType.js +0 -7
  413. package/lib/module/ActionType.js.map +0 -1
  414. package/lib/module/Directions.js +0 -19
  415. package/lib/module/Directions.js.map +0 -1
  416. package/lib/module/EnableNewWebImplementation.js +0 -35
  417. package/lib/module/EnableNewWebImplementation.js.map +0 -1
  418. package/lib/module/GestureHandlerRootViewContext.js +0 -3
  419. package/lib/module/GestureHandlerRootViewContext.js.map +0 -1
  420. package/lib/module/PlatformConstants.js +0 -5
  421. package/lib/module/PlatformConstants.js.map +0 -1
  422. package/lib/module/PlatformConstants.web.js +0 -7
  423. package/lib/module/PlatformConstants.web.js.map +0 -1
  424. package/lib/module/PointerType.js +0 -10
  425. package/lib/module/PointerType.js.map +0 -1
  426. package/lib/module/RNGestureHandlerModule.js +0 -5
  427. package/lib/module/RNGestureHandlerModule.js.map +0 -1
  428. package/lib/module/RNGestureHandlerModule.web.js +0 -98
  429. package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
  430. package/lib/module/RNGestureHandlerModule.windows.js +0 -47
  431. package/lib/module/RNGestureHandlerModule.windows.js.map +0 -1
  432. package/lib/module/RNRenderer.js +0 -4
  433. package/lib/module/RNRenderer.js.map +0 -1
  434. package/lib/module/RNRenderer.web.js +0 -4
  435. package/lib/module/RNRenderer.web.js.map +0 -1
  436. package/lib/module/State.js +0 -10
  437. package/lib/module/State.js.map +0 -1
  438. package/lib/module/TouchEventType.js +0 -8
  439. package/lib/module/TouchEventType.js.map +0 -1
  440. package/lib/module/components/DrawerLayout.js +0 -560
  441. package/lib/module/components/DrawerLayout.js.map +0 -1
  442. package/lib/module/components/GestureButtons.js +0 -237
  443. package/lib/module/components/GestureButtons.js.map +0 -1
  444. package/lib/module/components/GestureButtonsProps.js +0 -2
  445. package/lib/module/components/GestureButtonsProps.js.map +0 -1
  446. package/lib/module/components/GestureComponents.js +0 -90
  447. package/lib/module/components/GestureComponents.js.map +0 -1
  448. package/lib/module/components/GestureComponents.web.js +0 -28
  449. package/lib/module/components/GestureComponents.web.js.map +0 -1
  450. package/lib/module/components/GestureHandlerButton.js +0 -3
  451. package/lib/module/components/GestureHandlerButton.js.map +0 -1
  452. package/lib/module/components/GestureHandlerButton.web.js +0 -9
  453. package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
  454. package/lib/module/components/GestureHandlerRootView.android.js +0 -27
  455. package/lib/module/components/GestureHandlerRootView.android.js.map +0 -1
  456. package/lib/module/components/GestureHandlerRootView.js +0 -26
  457. package/lib/module/components/GestureHandlerRootView.js.map +0 -1
  458. package/lib/module/components/GestureHandlerRootView.web.js +0 -21
  459. package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
  460. package/lib/module/components/Pressable/Pressable.js +0 -346
  461. package/lib/module/components/Pressable/Pressable.js.map +0 -1
  462. package/lib/module/components/Pressable/PressableProps.js +0 -2
  463. package/lib/module/components/Pressable/PressableProps.js.map +0 -1
  464. package/lib/module/components/Pressable/index.js +0 -2
  465. package/lib/module/components/Pressable/index.js.map +0 -1
  466. package/lib/module/components/Pressable/utils.js +0 -99
  467. package/lib/module/components/Pressable/utils.js.map +0 -1
  468. package/lib/module/components/ReanimatedDrawerLayout.js +0 -369
  469. package/lib/module/components/ReanimatedDrawerLayout.js.map +0 -1
  470. package/lib/module/components/ReanimatedSwipeable.js +0 -350
  471. package/lib/module/components/ReanimatedSwipeable.js.map +0 -1
  472. package/lib/module/components/Swipeable.js +0 -398
  473. package/lib/module/components/Swipeable.js.map +0 -1
  474. package/lib/module/components/Text.js +0 -53
  475. package/lib/module/components/Text.js.map +0 -1
  476. package/lib/module/components/gestureHandlerRootHOC.js +0 -22
  477. package/lib/module/components/gestureHandlerRootHOC.js.map +0 -1
  478. package/lib/module/components/touchables/ExtraButtonProps.js +0 -2
  479. package/lib/module/components/touchables/ExtraButtonProps.js.map +0 -1
  480. package/lib/module/components/touchables/GenericTouchable.js +0 -274
  481. package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
  482. package/lib/module/components/touchables/GenericTouchableProps.js +0 -2
  483. package/lib/module/components/touchables/GenericTouchableProps.js.map +0 -1
  484. package/lib/module/components/touchables/TouchableHighlight.js +0 -97
  485. package/lib/module/components/touchables/TouchableHighlight.js.map +0 -1
  486. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +0 -86
  487. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
  488. package/lib/module/components/touchables/TouchableNativeFeedback.js +0 -8
  489. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +0 -1
  490. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +0 -2
  491. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
  492. package/lib/module/components/touchables/TouchableOpacity.js +0 -68
  493. package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
  494. package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -22
  495. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
  496. package/lib/module/components/touchables/index.js +0 -5
  497. package/lib/module/components/touchables/index.js.map +0 -1
  498. package/lib/module/findNodeHandle.js +0 -3
  499. package/lib/module/findNodeHandle.js.map +0 -1
  500. package/lib/module/findNodeHandle.web.js +0 -39
  501. package/lib/module/findNodeHandle.web.js.map +0 -1
  502. package/lib/module/getShadowNodeFromRef.js +0 -45
  503. package/lib/module/getShadowNodeFromRef.js.map +0 -1
  504. package/lib/module/getShadowNodeFromRef.web.js +0 -8
  505. package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
  506. package/lib/module/ghQueueMicrotask.js +0 -4
  507. package/lib/module/ghQueueMicrotask.js.map +0 -1
  508. package/lib/module/handlers/FlingGestureHandler.js +0 -18
  509. package/lib/module/handlers/FlingGestureHandler.js.map +0 -1
  510. package/lib/module/handlers/ForceTouchGestureHandler.js +0 -35
  511. package/lib/module/handlers/ForceTouchGestureHandler.js.map +0 -1
  512. package/lib/module/handlers/GestureHandlerEventPayload.js +0 -2
  513. package/lib/module/handlers/GestureHandlerEventPayload.js.map +0 -1
  514. package/lib/module/handlers/LongPressGestureHandler.js +0 -20
  515. package/lib/module/handlers/LongPressGestureHandler.js.map +0 -1
  516. package/lib/module/handlers/NativeViewGestureHandler.js +0 -19
  517. package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
  518. package/lib/module/handlers/PanGestureHandler.js +0 -114
  519. package/lib/module/handlers/PanGestureHandler.js.map +0 -1
  520. package/lib/module/handlers/PinchGestureHandler.js +0 -21
  521. package/lib/module/handlers/PinchGestureHandler.js.map +0 -1
  522. package/lib/module/handlers/PressabilityDebugView.js +0 -3
  523. package/lib/module/handlers/PressabilityDebugView.js.map +0 -1
  524. package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
  525. package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
  526. package/lib/module/handlers/RotationGestureHandler.js +0 -21
  527. package/lib/module/handlers/RotationGestureHandler.js.map +0 -1
  528. package/lib/module/handlers/TapGestureHandler.js +0 -20
  529. package/lib/module/handlers/TapGestureHandler.js.map +0 -1
  530. package/lib/module/handlers/createHandler.js +0 -460
  531. package/lib/module/handlers/createHandler.js.map +0 -1
  532. package/lib/module/handlers/createNativeWrapper.js +0 -75
  533. package/lib/module/handlers/createNativeWrapper.js.map +0 -1
  534. package/lib/module/handlers/customDirectEventTypes.js +0 -3
  535. package/lib/module/handlers/customDirectEventTypes.js.map +0 -1
  536. package/lib/module/handlers/customDirectEventTypes.web.js +0 -5
  537. package/lib/module/handlers/customDirectEventTypes.web.js.map +0 -1
  538. package/lib/module/handlers/gestureHandlerCommon.js +0 -19
  539. package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
  540. package/lib/module/handlers/gestureHandlerTypesCompat.js +0 -2
  541. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +0 -1
  542. package/lib/module/handlers/gestures/GestureDetector/Wrap.js +0 -26
  543. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
  544. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +0 -32
  545. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
  546. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +0 -68
  547. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
  548. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -14
  549. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
  550. package/lib/module/handlers/gestures/GestureDetector/index.js +0 -118
  551. package/lib/module/handlers/gestures/GestureDetector/index.js.map +0 -1
  552. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -18
  553. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
  554. package/lib/module/handlers/gestures/GestureDetector/types.js +0 -2
  555. package/lib/module/handlers/gestures/GestureDetector/types.js.map +0 -1
  556. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +0 -61
  557. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
  558. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -165
  559. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
  560. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -41
  561. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
  562. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +0 -39
  563. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
  564. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -36
  565. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
  566. package/lib/module/handlers/gestures/GestureDetector/utils.js +0 -139
  567. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +0 -1
  568. package/lib/module/handlers/gestures/eventReceiver.js +0 -131
  569. package/lib/module/handlers/gestures/eventReceiver.js.map +0 -1
  570. package/lib/module/handlers/gestures/flingGesture.js +0 -37
  571. package/lib/module/handlers/gestures/flingGesture.js.map +0 -1
  572. package/lib/module/handlers/gestures/forceTouchGesture.js +0 -73
  573. package/lib/module/handlers/gestures/forceTouchGesture.js.map +0 -1
  574. package/lib/module/handlers/gestures/gesture.js +0 -362
  575. package/lib/module/handlers/gestures/gesture.js.map +0 -1
  576. package/lib/module/handlers/gestures/gestureComposition.js +0 -92
  577. package/lib/module/handlers/gestures/gestureComposition.js.map +0 -1
  578. package/lib/module/handlers/gestures/gestureObjects.js +0 -138
  579. package/lib/module/handlers/gestures/gestureObjects.js.map +0 -1
  580. package/lib/module/handlers/gestures/gestureStateManager.js +0 -64
  581. package/lib/module/handlers/gestures/gestureStateManager.js.map +0 -1
  582. package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -21
  583. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +0 -1
  584. package/lib/module/handlers/gestures/hoverGesture.js +0 -62
  585. package/lib/module/handlers/gestures/hoverGesture.js.map +0 -1
  586. package/lib/module/handlers/gestures/longPressGesture.js +0 -47
  587. package/lib/module/handlers/gestures/longPressGesture.js.map +0 -1
  588. package/lib/module/handlers/gestures/manualGesture.js +0 -22
  589. package/lib/module/handlers/gestures/manualGesture.js.map +0 -1
  590. package/lib/module/handlers/gestures/nativeGesture.js +0 -34
  591. package/lib/module/handlers/gestures/nativeGesture.js.map +0 -1
  592. package/lib/module/handlers/gestures/panGesture.js +0 -216
  593. package/lib/module/handlers/gestures/panGesture.js.map +0 -1
  594. package/lib/module/handlers/gestures/pinchGesture.js +0 -36
  595. package/lib/module/handlers/gestures/pinchGesture.js.map +0 -1
  596. package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -30
  597. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +0 -1
  598. package/lib/module/handlers/gestures/rotationGesture.js +0 -36
  599. package/lib/module/handlers/gestures/rotationGesture.js.map +0 -1
  600. package/lib/module/handlers/gestures/tapGesture.js +0 -92
  601. package/lib/module/handlers/gestures/tapGesture.js.map +0 -1
  602. package/lib/module/handlers/getNextHandlerTag.js +0 -5
  603. package/lib/module/handlers/getNextHandlerTag.js.map +0 -1
  604. package/lib/module/handlers/handlersRegistry.js +0 -43
  605. package/lib/module/handlers/handlersRegistry.js.map +0 -1
  606. package/lib/module/handlers/utils.js +0 -71
  607. package/lib/module/handlers/utils.js.map +0 -1
  608. package/lib/module/index.js +0 -29
  609. package/lib/module/index.js.map +0 -1
  610. package/lib/module/init.js +0 -16
  611. package/lib/module/init.js.map +0 -1
  612. package/lib/module/jestUtils/index.js +0 -2
  613. package/lib/module/jestUtils/index.js.map +0 -1
  614. package/lib/module/jestUtils/jestUtils.js +0 -358
  615. package/lib/module/jestUtils/jestUtils.js.map +0 -1
  616. package/lib/module/mocks.js +0 -68
  617. package/lib/module/mocks.js.map +0 -1
  618. package/lib/module/mountRegistry.js +0 -40
  619. package/lib/module/mountRegistry.js.map +0 -1
  620. package/lib/module/specs/NativeRNGestureHandlerModule.js +0 -3
  621. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +0 -1
  622. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +0 -3
  623. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
  624. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +0 -3
  625. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
  626. package/lib/module/typeUtils.js +0 -2
  627. package/lib/module/typeUtils.js.map +0 -1
  628. package/lib/module/utils.js +0 -87
  629. package/lib/module/utils.js.map +0 -1
  630. package/lib/module/web/Gestures.js +0 -39
  631. package/lib/module/web/Gestures.js.map +0 -1
  632. package/lib/module/web/constants.js +0 -3
  633. package/lib/module/web/constants.js.map +0 -1
  634. package/lib/module/web/detectors/RotationGestureDetector.js +0 -153
  635. package/lib/module/web/detectors/RotationGestureDetector.js.map +0 -1
  636. package/lib/module/web/detectors/ScaleGestureDetector.js +0 -144
  637. package/lib/module/web/detectors/ScaleGestureDetector.js.map +0 -1
  638. package/lib/module/web/handlers/FlingGestureHandler.js +0 -173
  639. package/lib/module/web/handlers/FlingGestureHandler.js.map +0 -1
  640. package/lib/module/web/handlers/GestureHandler.js +0 -801
  641. package/lib/module/web/handlers/GestureHandler.js.map +0 -1
  642. package/lib/module/web/handlers/HoverGestureHandler.js +0 -50
  643. package/lib/module/web/handlers/HoverGestureHandler.js.map +0 -1
  644. package/lib/module/web/handlers/IGestureHandler.js +0 -2
  645. package/lib/module/web/handlers/IGestureHandler.js.map +0 -1
  646. package/lib/module/web/handlers/LongPressGestureHandler.js +0 -180
  647. package/lib/module/web/handlers/LongPressGestureHandler.js.map +0 -1
  648. package/lib/module/web/handlers/ManualGestureHandler.js +0 -36
  649. package/lib/module/web/handlers/ManualGestureHandler.js.map +0 -1
  650. package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -174
  651. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +0 -1
  652. package/lib/module/web/handlers/PanGestureHandler.js +0 -514
  653. package/lib/module/web/handlers/PanGestureHandler.js.map +0 -1
  654. package/lib/module/web/handlers/PinchGestureHandler.js +0 -150
  655. package/lib/module/web/handlers/PinchGestureHandler.js.map +0 -1
  656. package/lib/module/web/handlers/RotationGestureHandler.js +0 -158
  657. package/lib/module/web/handlers/RotationGestureHandler.js.map +0 -1
  658. package/lib/module/web/handlers/TapGestureHandler.js +0 -271
  659. package/lib/module/web/handlers/TapGestureHandler.js.map +0 -1
  660. package/lib/module/web/interfaces.js +0 -31
  661. package/lib/module/web/interfaces.js.map +0 -1
  662. package/lib/module/web/tools/CircularBuffer.js +0 -50
  663. package/lib/module/web/tools/CircularBuffer.js.map +0 -1
  664. package/lib/module/web/tools/EventManager.js +0 -124
  665. package/lib/module/web/tools/EventManager.js.map +0 -1
  666. package/lib/module/web/tools/GestureHandlerDelegate.js +0 -2
  667. package/lib/module/web/tools/GestureHandlerDelegate.js.map +0 -1
  668. package/lib/module/web/tools/GestureHandlerOrchestrator.js +0 -326
  669. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +0 -1
  670. package/lib/module/web/tools/GestureHandlerWebDelegate.js +0 -199
  671. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +0 -1
  672. package/lib/module/web/tools/InteractionManager.js +0 -110
  673. package/lib/module/web/tools/InteractionManager.js.map +0 -1
  674. package/lib/module/web/tools/KeyboardEventManager.js +0 -96
  675. package/lib/module/web/tools/KeyboardEventManager.js.map +0 -1
  676. package/lib/module/web/tools/LeastSquareSolver.js +0 -195
  677. package/lib/module/web/tools/LeastSquareSolver.js.map +0 -1
  678. package/lib/module/web/tools/NodeManager.js +0 -40
  679. package/lib/module/web/tools/NodeManager.js.map +0 -1
  680. package/lib/module/web/tools/PointerEventManager.js +0 -212
  681. package/lib/module/web/tools/PointerEventManager.js.map +0 -1
  682. package/lib/module/web/tools/PointerTracker.js +0 -221
  683. package/lib/module/web/tools/PointerTracker.js.map +0 -1
  684. package/lib/module/web/tools/Vector.js +0 -50
  685. package/lib/module/web/tools/Vector.js.map +0 -1
  686. package/lib/module/web/tools/VelocityTracker.js +0 -98
  687. package/lib/module/web/tools/VelocityTracker.js.map +0 -1
  688. package/lib/module/web/tools/WheelEventManager.js +0 -60
  689. package/lib/module/web/tools/WheelEventManager.js.map +0 -1
  690. package/lib/module/web/utils.js +0 -243
  691. package/lib/module/web/utils.js.map +0 -1
  692. package/lib/module/web_hammer/DiscreteGestureHandler.js +0 -94
  693. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +0 -1
  694. package/lib/module/web_hammer/DraggingGestureHandler.js +0 -40
  695. package/lib/module/web_hammer/DraggingGestureHandler.js.map +0 -1
  696. package/lib/module/web_hammer/Errors.js +0 -7
  697. package/lib/module/web_hammer/Errors.js.map +0 -1
  698. package/lib/module/web_hammer/FlingGestureHandler.js +0 -156
  699. package/lib/module/web_hammer/FlingGestureHandler.js.map +0 -1
  700. package/lib/module/web_hammer/GestureHandler.js +0 -563
  701. package/lib/module/web_hammer/GestureHandler.js.map +0 -1
  702. package/lib/module/web_hammer/IndiscreteGestureHandler.js +0 -44
  703. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +0 -1
  704. package/lib/module/web_hammer/LongPressGestureHandler.js +0 -58
  705. package/lib/module/web_hammer/LongPressGestureHandler.js.map +0 -1
  706. package/lib/module/web_hammer/NativeViewGestureHandler.js +0 -49
  707. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +0 -1
  708. package/lib/module/web_hammer/NodeManager.js +0 -33
  709. package/lib/module/web_hammer/NodeManager.js.map +0 -1
  710. package/lib/module/web_hammer/PanGestureHandler.js +0 -194
  711. package/lib/module/web_hammer/PanGestureHandler.js.map +0 -1
  712. package/lib/module/web_hammer/PinchGestureHandler.js +0 -29
  713. package/lib/module/web_hammer/PinchGestureHandler.js.map +0 -1
  714. package/lib/module/web_hammer/PressGestureHandler.js +0 -174
  715. package/lib/module/web_hammer/PressGestureHandler.js.map +0 -1
  716. package/lib/module/web_hammer/RotationGestureHandler.js +0 -32
  717. package/lib/module/web_hammer/RotationGestureHandler.js.map +0 -1
  718. package/lib/module/web_hammer/TapGestureHandler.js +0 -180
  719. package/lib/module/web_hammer/TapGestureHandler.js.map +0 -1
  720. package/lib/module/web_hammer/constants.js +0 -43
  721. package/lib/module/web_hammer/constants.js.map +0 -1
  722. package/lib/module/web_hammer/utils.js +0 -19
  723. package/lib/module/web_hammer/utils.js.map +0 -1
  724. package/lib/typescript/ActionType.d.ts +0 -7
  725. package/lib/typescript/Directions.d.ts +0 -14
  726. package/lib/typescript/EnableNewWebImplementation.d.ts +0 -9
  727. package/lib/typescript/GestureHandlerRootViewContext.d.ts +0 -3
  728. package/lib/typescript/PlatformConstants.d.ts +0 -5
  729. package/lib/typescript/PlatformConstants.web.d.ts +0 -4
  730. package/lib/typescript/PointerType.d.ts +0 -7
  731. package/lib/typescript/RNGestureHandlerModule.d.ts +0 -2
  732. package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -15
  733. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +0 -32
  734. package/lib/typescript/RNRenderer.d.ts +0 -1
  735. package/lib/typescript/RNRenderer.web.d.ts +0 -3
  736. package/lib/typescript/State.d.ts +0 -9
  737. package/lib/typescript/TouchEventType.d.ts +0 -8
  738. package/lib/typescript/components/DrawerLayout.d.ts +0 -185
  739. package/lib/typescript/components/GestureButtons.d.ts +0 -7
  740. package/lib/typescript/components/GestureButtonsProps.d.ts +0 -115
  741. package/lib/typescript/components/GestureComponents.d.ts +0 -22
  742. package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
  743. package/lib/typescript/components/GestureHandlerButton.d.ts +0 -4
  744. package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
  745. package/lib/typescript/components/GestureHandlerRootView.android.d.ts +0 -6
  746. package/lib/typescript/components/GestureHandlerRootView.d.ts +0 -6
  747. package/lib/typescript/components/GestureHandlerRootView.web.d.ts +0 -6
  748. package/lib/typescript/components/Pressable/Pressable.d.ts +0 -5
  749. package/lib/typescript/components/Pressable/PressableProps.d.ts +0 -109
  750. package/lib/typescript/components/Pressable/index.d.ts +0 -2
  751. package/lib/typescript/components/Pressable/utils.d.ts +0 -13
  752. package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +0 -167
  753. package/lib/typescript/components/ReanimatedSwipeable.d.ts +0 -137
  754. package/lib/typescript/components/Swipeable.d.ts +0 -183
  755. package/lib/typescript/components/Text.d.ts +0 -4
  756. package/lib/typescript/components/gestureHandlerRootHOC.d.ts +0 -3
  757. package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +0 -7
  758. package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -55
  759. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +0 -16
  760. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +0 -41
  761. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +0 -40
  762. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +0 -6
  763. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +0 -8
  764. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -30
  765. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -14
  766. package/lib/typescript/components/touchables/index.d.ts +0 -7
  767. package/lib/typescript/findNodeHandle.d.ts +0 -2
  768. package/lib/typescript/findNodeHandle.web.d.ts +0 -2
  769. package/lib/typescript/getShadowNodeFromRef.d.ts +0 -1
  770. package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
  771. package/lib/typescript/ghQueueMicrotask.d.ts +0 -1
  772. package/lib/typescript/handlers/FlingGestureHandler.d.ts +0 -39
  773. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +0 -44
  774. package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +0 -194
  775. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +0 -36
  776. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -33
  777. package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -100
  778. package/lib/typescript/handlers/PinchGestureHandler.d.ts +0 -17
  779. package/lib/typescript/handlers/PressabilityDebugView.d.ts +0 -1
  780. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
  781. package/lib/typescript/handlers/RotationGestureHandler.d.ts +0 -17
  782. package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -62
  783. package/lib/typescript/handlers/createHandler.d.ts +0 -11
  784. package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -3
  785. package/lib/typescript/handlers/customDirectEventTypes.d.ts +0 -1
  786. package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +0 -2
  787. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -78
  788. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +0 -43
  789. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts +0 -13
  790. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts +0 -7
  791. package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts +0 -13
  792. package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts +0 -2
  793. package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts +0 -49
  794. package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts +0 -3
  795. package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +0 -21
  796. package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts +0 -4
  797. package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts +0 -2
  798. package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts +0 -5
  799. package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts +0 -2
  800. package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts +0 -3
  801. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +0 -13
  802. package/lib/typescript/handlers/gestures/eventReceiver.d.ts +0 -4
  803. package/lib/typescript/handlers/gestures/flingGesture.d.ts +0 -21
  804. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +0 -30
  805. package/lib/typescript/handlers/gestures/gesture.d.ts +0 -218
  806. package/lib/typescript/handlers/gestures/gestureComposition.d.ts +0 -21
  807. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +0 -98
  808. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +0 -11
  809. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +0 -4
  810. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +0 -27
  811. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +0 -25
  812. package/lib/typescript/handlers/gestures/manualGesture.d.ts +0 -7
  813. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +0 -18
  814. package/lib/typescript/handlers/gestures/panGesture.d.ts +0 -90
  815. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +0 -11
  816. package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +0 -14
  817. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +0 -12
  818. package/lib/typescript/handlers/gestures/tapGesture.d.ts +0 -50
  819. package/lib/typescript/handlers/getNextHandlerTag.d.ts +0 -1
  820. package/lib/typescript/handlers/handlersRegistry.d.ts +0 -14
  821. package/lib/typescript/handlers/utils.d.ts +0 -7
  822. package/lib/typescript/index.d.ts +0 -58
  823. package/lib/typescript/init.d.ts +0 -2
  824. package/lib/typescript/jestUtils/index.d.ts +0 -1
  825. package/lib/typescript/jestUtils/jestUtils.d.ts +0 -30
  826. package/lib/typescript/mocks.d.ts +0 -46
  827. package/lib/typescript/mountRegistry.d.ts +0 -17
  828. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +0 -14
  829. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +0 -17
  830. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +0 -6
  831. package/lib/typescript/typeUtils.d.ts +0 -1
  832. package/lib/typescript/utils.d.ts +0 -20
  833. package/lib/typescript/web/Gestures.d.ts +0 -36
  834. package/lib/typescript/web/constants.d.ts +0 -2
  835. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +0 -30
  836. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +0 -29
  837. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -26
  838. package/lib/typescript/web/handlers/GestureHandler.d.ts +0 -103
  839. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +0 -10
  840. package/lib/typescript/web/handlers/IGestureHandler.d.ts +0 -37
  841. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -31
  842. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -10
  843. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -26
  844. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -61
  845. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -28
  846. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -28
  847. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -38
  848. package/lib/typescript/web/interfaces.d.ts +0 -157
  849. package/lib/typescript/web/tools/CircularBuffer.d.ts +0 -11
  850. package/lib/typescript/web/tools/EventManager.d.ts +0 -39
  851. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +0 -24
  852. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -31
  853. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +0 -35
  854. package/lib/typescript/web/tools/InteractionManager.d.ts +0 -17
  855. package/lib/typescript/web/tools/KeyboardEventManager.d.ts +0 -13
  856. package/lib/typescript/web/tools/LeastSquareSolver.d.ts +0 -12
  857. package/lib/typescript/web/tools/NodeManager.d.ts +0 -12
  858. package/lib/typescript/web/tools/PointerEventManager.d.ts +0 -19
  859. package/lib/typescript/web/tools/PointerTracker.d.ts +0 -50
  860. package/lib/typescript/web/tools/Vector.d.ts +0 -15
  861. package/lib/typescript/web/tools/VelocityTracker.d.ts +0 -13
  862. package/lib/typescript/web/tools/WheelEventManager.d.ts +0 -11
  863. package/lib/typescript/web/utils.d.ts +0 -14
  864. package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +0 -20
  865. package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +0 -15
  866. package/lib/typescript/web_hammer/Errors.d.ts +0 -3
  867. package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +0 -43
  868. package/lib/typescript/web_hammer/GestureHandler.d.ts +0 -145
  869. package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +0 -40
  870. package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +0 -38
  871. package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +0 -7
  872. package/lib/typescript/web_hammer/NodeManager.d.ts +0 -7
  873. package/lib/typescript/web_hammer/PanGestureHandler.d.ts +0 -56
  874. package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +0 -13
  875. package/lib/typescript/web_hammer/PressGestureHandler.d.ts +0 -83
  876. package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +0 -13
  877. package/lib/typescript/web_hammer/TapGestureHandler.d.ts +0 -57
  878. package/lib/typescript/web_hammer/constants.d.ts +0 -39
  879. package/lib/typescript/web_hammer/utils.d.ts +0 -9
  880. /package/android/{common → noreanimated}/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["FlingGestureHandler.ts"],"names":["FlingGestureHandler","DraggingGestureHandler","name","NativeGestureClass","Hammer","Swipe","onGestureActivated","event","sendEvent","eventType","INPUT_MOVE","isFinal","isFirst","isGestureRunning","hasGestureFailed","INPUT_END","onRawEvent","ev","setTimeout","cancelEvent","gesture","hammer","get","options","enable","onStart","getHammerConfig","pointers","config","numberOfPointers","direction","getDirection","getTargetDirections","directions","Direction","RIGHT","push","DIRECTION_RIGHT","LEFT","DIRECTION_LEFT","UP","DIRECTION_UP","DOWN","DIRECTION_DOWN","getConfig","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","Set","length","DIRECTION_NONE","DIRECTION_ALL","isGestureEnabledForEvent","_recognizer","maxPointers","pointerLength","validPointerCount","failed","success","updateGestureConfig","props","GesturePropError"],"mappings":";;;;;;;AAEA;;AAEA;;AACA;;AACA;;AACA;;;;AAPA;;AACA;AASA,MAAMA,mBAAN,SAAkCC,+BAAlC,CAAyD;AAC/C,MAAJC,IAAI,GAAG;AACT,WAAO,OAAP;AACD;;AAEqB,MAAlBC,kBAAkB,GAAG;AACvB,WAAOC,kBAAOC,KAAd;AACD;;AAEDC,EAAAA,kBAAkB,CAACC,KAAD,EAAwB;AACxC,SAAKC,SAAL,CAAe,EACb,GAAGD,KADU;AAEbE,MAAAA,SAAS,EAAEL,kBAAOM,UAFL;AAGbC,MAAAA,OAAO,EAAE,KAHI;AAIbC,MAAAA,OAAO,EAAE;AAJI,KAAf;AAMA,SAAKC,gBAAL,GAAwB,KAAxB;AACA,SAAKC,gBAAL,GAAwB,KAAxB;AACA,SAAKN,SAAL,CAAe,EACb,GAAGD,KADU;AAEbE,MAAAA,SAAS,EAAEL,kBAAOW,SAFL;AAGbJ,MAAAA,OAAO,EAAE;AAHI,KAAf;AAKD;;AAEDK,EAAAA,UAAU,CAACC,EAAD,EAAqB;AAC7B,UAAMD,UAAN,CAAiBC,EAAjB;;AACA,QAAI,KAAKH,gBAAT,EAA2B;AACzB;AACD,KAJ4B,CAK7B;AACA;;;AACA,QAAIG,EAAE,CAACN,OAAP,EAAgB;AACdO,MAAAA,UAAU,CAAC,MAAM;AACf,YAAI,KAAKL,gBAAT,EAA2B;AACzB,eAAKM,WAAL,CAAiBF,EAAjB;AAC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AAM7B,SAAN,KAAoB,OAAOA,SAAP,KAAqB,QAA7C,EAAuD;AACrD,YAAM,IAAI8B,wBAAJ,CAAqB,WAArB,EAAkC9B,SAAlC,EAA6C,QAA7C,CAAN;AACD;;AACD,WAAO,MAAM4B,mBAAN,CAA0B;AAC/B7B,MAAAA,gBAD+B;AAE/BC,MAAAA,SAF+B;AAG/B,SAAG6B;AAH4B,KAA1B,CAAP;AAKD;;AAxHsD;;eA2H1C3D,mB","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\n\nimport { Direction } from './constants';\nimport { GesturePropError } from './Errors';\nimport DraggingGestureHandler from './DraggingGestureHandler';\nimport { isnan } from './utils';\nimport { HammerInputExt } from './GestureHandler';\n\nclass FlingGestureHandler extends DraggingGestureHandler {\n get name() {\n return 'swipe';\n }\n\n get NativeGestureClass() {\n return Hammer.Swipe;\n }\n\n onGestureActivated(event: HammerInputExt) {\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_MOVE,\n isFinal: false,\n isFirst: true,\n });\n this.isGestureRunning = false;\n this.hasGestureFailed = false;\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_END,\n isFinal: true,\n });\n }\n\n onRawEvent(ev: HammerInputExt) {\n super.onRawEvent(ev);\n if (this.hasGestureFailed) {\n return;\n }\n // Hammer doesn't send a `cancel` event for taps.\n // Manually fail the event.\n if (ev.isFinal) {\n setTimeout(() => {\n if (this.isGestureRunning) {\n this.cancelEvent(ev);\n }\n });\n } else if (!this.hasGestureFailed && !this.isGestureRunning) {\n // Tap Gesture start event\n const gesture = this.hammer!.get(this.name);\n // @ts-ignore FIXME(TS)\n if (gesture.options.enable(gesture, ev)) {\n this.onStart(ev);\n this.sendEvent(ev);\n }\n }\n }\n\n getHammerConfig() {\n return {\n // @ts-ignore FIXME(TS)\n pointers: this.config.numberOfPointers,\n direction: this.getDirection(),\n };\n }\n\n getTargetDirections(direction: number) {\n const directions = [];\n if (direction & Direction.RIGHT) {\n directions.push(Hammer.DIRECTION_RIGHT);\n }\n if (direction & Direction.LEFT) {\n directions.push(Hammer.DIRECTION_LEFT);\n }\n if (direction & Direction.UP) {\n directions.push(Hammer.DIRECTION_UP);\n }\n if (direction & Direction.DOWN) {\n directions.push(Hammer.DIRECTION_DOWN);\n }\n // const hammerDirection = directions.reduce((a, b) => a | b, 0);\n return directions;\n }\n\n getDirection() {\n // @ts-ignore FIXME(TS)\n const { direction } = this.getConfig();\n\n let directions = [];\n if (direction & Direction.RIGHT) {\n directions.push(Hammer.DIRECTION_HORIZONTAL);\n }\n if (direction & Direction.LEFT) {\n directions.push(Hammer.DIRECTION_HORIZONTAL);\n }\n if (direction & Direction.UP) {\n directions.push(Hammer.DIRECTION_VERTICAL);\n }\n if (direction & Direction.DOWN) {\n directions.push(Hammer.DIRECTION_VERTICAL);\n }\n directions = [...new Set(directions)];\n\n if (directions.length === 0) return Hammer.DIRECTION_NONE;\n if (directions.length === 1) return directions[0];\n return Hammer.DIRECTION_ALL;\n }\n\n isGestureEnabledForEvent(\n { numberOfPointers }: any,\n _recognizer: any,\n { maxPointers: pointerLength }: any\n ) {\n const validPointerCount = pointerLength === numberOfPointers;\n if (!validPointerCount && this.isGestureRunning) {\n return { failed: true };\n }\n return { success: validPointerCount };\n }\n\n updateGestureConfig({ numberOfPointers = 1, direction, ...props }: any) {\n if (isnan(direction) || typeof direction !== 'number') {\n throw new GesturePropError('direction', direction, 'number');\n }\n return super.updateGestureConfig({\n numberOfPointers,\n direction,\n ...props,\n });\n }\n}\n\nexport default FlingGestureHandler;\n"]}
@@ -1,579 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
9
-
10
- var _reactNative = require("react-native");
11
-
12
- var _State = require("../State");
13
-
14
- var _constants = require("./constants");
15
-
16
- var NodeManager = _interopRequireWildcard(require("./NodeManager"));
17
-
18
- var _ghQueueMicrotask = require("../ghQueueMicrotask");
19
-
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
-
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
-
28
- let gestureInstances = 0;
29
-
30
- class GestureHandler {
31
- get id() {
32
- return `${this.name}${this.gestureInstance}`;
33
- } // a simple way to check if GestureHandler is NativeViewGestureHandler, since importing it
34
- // here to use instanceof would cause import cycle
35
-
36
-
37
- get isNative() {
38
- return false;
39
- }
40
-
41
- get isDiscrete() {
42
- return false;
43
- }
44
-
45
- get shouldEnableGestureOnSetup() {
46
- throw new Error('Must override GestureHandler.shouldEnableGestureOnSetup');
47
- }
48
-
49
- constructor() {
50
- _defineProperty(this, "handlerTag", void 0);
51
-
52
- _defineProperty(this, "isGestureRunning", false);
53
-
54
- _defineProperty(this, "view", null);
55
-
56
- _defineProperty(this, "hasCustomActivationCriteria", void 0);
57
-
58
- _defineProperty(this, "hasGestureFailed", false);
59
-
60
- _defineProperty(this, "hammer", null);
61
-
62
- _defineProperty(this, "initialRotation", null);
63
-
64
- _defineProperty(this, "__initialX", void 0);
65
-
66
- _defineProperty(this, "__initialY", void 0);
67
-
68
- _defineProperty(this, "config", {});
69
-
70
- _defineProperty(this, "previousState", _State.State.UNDETERMINED);
71
-
72
- _defineProperty(this, "pendingGestures", {});
73
-
74
- _defineProperty(this, "oldState", _State.State.UNDETERMINED);
75
-
76
- _defineProperty(this, "lastSentState", null);
77
-
78
- _defineProperty(this, "gestureInstance", void 0);
79
-
80
- _defineProperty(this, "_stillWaiting", void 0);
81
-
82
- _defineProperty(this, "propsRef", void 0);
83
-
84
- _defineProperty(this, "ref", void 0);
85
-
86
- _defineProperty(this, "clearSelfAsPending", () => {
87
- if (Array.isArray(this.config.waitFor)) {
88
- for (const gesture of this.config.waitFor) {
89
- gesture.removePendingGesture(this.id);
90
- }
91
- }
92
- });
93
-
94
- _defineProperty(this, "destroy", () => {
95
- this.clearSelfAsPending();
96
-
97
- if (this.hammer) {
98
- this.hammer.stop(false);
99
- this.hammer.destroy();
100
- }
101
-
102
- this.hammer = null;
103
- });
104
-
105
- _defineProperty(this, "isPointInView", ({
106
- x,
107
- y
108
- }) => {
109
- // @ts-ignore FIXME(TS)
110
- const rect = this.view.getBoundingClientRect();
111
- const pointerInside = x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
112
- return pointerInside;
113
- });
114
-
115
- _defineProperty(this, "sendEvent", nativeEvent => {
116
- const {
117
- onGestureHandlerEvent,
118
- onGestureHandlerStateChange
119
- } = this.propsRef.current;
120
- const event = this.transformEventData(nativeEvent);
121
- invokeNullableMethod(onGestureHandlerEvent, event);
122
-
123
- if (this.lastSentState !== event.nativeEvent.state) {
124
- this.lastSentState = event.nativeEvent.state;
125
- invokeNullableMethod(onGestureHandlerStateChange, event);
126
- }
127
- });
128
-
129
- _defineProperty(this, "sync", () => {
130
- const gesture = this.hammer.get(this.name);
131
- if (!gesture) return;
132
-
133
- const enable = (recognizer, inputData) => {
134
- if (!this.config.enabled) {
135
- this.isGestureRunning = false;
136
- this.hasGestureFailed = false;
137
- return false;
138
- } // Prevent events before the system is ready.
139
-
140
-
141
- if (!inputData || !recognizer.options || typeof inputData.maxPointers === 'undefined') {
142
- return this.shouldEnableGestureOnSetup;
143
- }
144
-
145
- if (this.hasGestureFailed) {
146
- return false;
147
- }
148
-
149
- if (!this.isDiscrete) {
150
- if (this.isGestureRunning) {
151
- return true;
152
- } // The built-in hammer.js "waitFor" doesn't work across multiple views.
153
- // Only process if there are views to wait for.
154
-
155
-
156
- this._stillWaiting = this._getPendingGestures(); // This gesture should continue waiting.
157
-
158
- if (this._stillWaiting.length) {
159
- // Check to see if one of the gestures you're waiting for has started.
160
- // If it has then the gesture should fail.
161
- for (const gesture of this._stillWaiting) {
162
- // When the target gesture has started, this gesture must force fail.
163
- if (!gesture.isDiscrete && gesture.isGestureRunning) {
164
- this.hasGestureFailed = true;
165
- this.isGestureRunning = false;
166
- return false;
167
- }
168
- } // This gesture shouldn't start until the others have finished.
169
-
170
-
171
- return false;
172
- }
173
- } // Use default behaviour
174
-
175
-
176
- if (!this.hasCustomActivationCriteria) {
177
- return true;
178
- }
179
-
180
- const deltaRotation = this.initialRotation == null ? 0 : inputData.rotation - this.initialRotation; // @ts-ignore FIXME(TS)
181
-
182
- const {
183
- success,
184
- failed
185
- } = this.isGestureEnabledForEvent(this.getConfig(), recognizer, { ...inputData,
186
- deltaRotation
187
- });
188
-
189
- if (failed) {
190
- this.simulateCancelEvent(inputData);
191
- this.hasGestureFailed = true;
192
- }
193
-
194
- return success;
195
- };
196
-
197
- const params = this.getHammerConfig(); // @ts-ignore FIXME(TS)
198
-
199
- gesture.set({ ...params,
200
- enable
201
- });
202
- });
203
-
204
- this.gestureInstance = gestureInstances++;
205
- this.hasCustomActivationCriteria = false;
206
- }
207
-
208
- getConfig() {
209
- return this.config;
210
- }
211
-
212
- onWaitingEnded(_gesture) {}
213
-
214
- removePendingGesture(id) {
215
- delete this.pendingGestures[id];
216
- }
217
-
218
- addPendingGesture(gesture) {
219
- this.pendingGestures[gesture.id] = gesture;
220
- }
221
-
222
- isGestureEnabledForEvent(_config, _recognizer, _event) {
223
- return {
224
- success: true
225
- };
226
- }
227
-
228
- get NativeGestureClass() {
229
- throw new Error('Must override GestureHandler.NativeGestureClass');
230
- }
231
-
232
- updateHasCustomActivationCriteria(_config) {
233
- return true;
234
- }
235
-
236
- updateGestureConfig({
237
- enabled = true,
238
- ...props
239
- }) {
240
- this.clearSelfAsPending();
241
- this.config = this.ensureConfig({
242
- enabled,
243
- ...props
244
- });
245
- this.hasCustomActivationCriteria = this.updateHasCustomActivationCriteria(this.config);
246
-
247
- if (Array.isArray(this.config.waitFor)) {
248
- for (const gesture of this.config.waitFor) {
249
- gesture.addPendingGesture(this);
250
- }
251
- }
252
-
253
- if (this.hammer) {
254
- this.sync();
255
- }
256
-
257
- return this.config;
258
- }
259
-
260
- getState(type) {
261
- // @ts-ignore TODO(TS) check if this is needed
262
- if (type == 0) {
263
- return 0;
264
- }
265
-
266
- return _constants.EventMap[type];
267
- }
268
-
269
- transformEventData(event) {
270
- const {
271
- eventType,
272
- maxPointers: numberOfPointers
273
- } = event; // const direction = DirectionMap[ev.direction];
274
-
275
- const changedTouch = event.changedPointers[0];
276
- const pointerInside = this.isPointInView({
277
- x: changedTouch.clientX,
278
- y: changedTouch.clientY
279
- }); // TODO(TS) Remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50966 is merged.
280
-
281
- const state = this.getState(eventType);
282
-
283
- if (state !== this.previousState) {
284
- this.oldState = this.previousState;
285
- this.previousState = state;
286
- }
287
-
288
- return {
289
- nativeEvent: {
290
- numberOfPointers,
291
- state,
292
- pointerInside,
293
- ...this.transformNativeEvent(event),
294
- // onHandlerStateChange only
295
- handlerTag: this.handlerTag,
296
- target: this.ref,
297
- // send oldState only when the state was changed, or is different than ACTIVE
298
- // GestureDetector relies on the presence of `oldState` to differentiate between
299
- // update events and state change events
300
- oldState: state !== this.previousState || state != 4 ? this.oldState : undefined
301
- },
302
- timeStamp: Date.now()
303
- };
304
- }
305
-
306
- transformNativeEvent(_event) {
307
- return {};
308
- }
309
-
310
- cancelPendingGestures(event) {
311
- for (const gesture of Object.values(this.pendingGestures)) {
312
- if (gesture && gesture.isGestureRunning) {
313
- gesture.hasGestureFailed = true;
314
- gesture.cancelEvent(event);
315
- }
316
- }
317
- }
318
-
319
- notifyPendingGestures() {
320
- for (const gesture of Object.values(this.pendingGestures)) {
321
- if (gesture) {
322
- gesture.onWaitingEnded(this);
323
- }
324
- }
325
- } // FIXME event is undefined in runtime when firstly invoked (see Draggable example), check other functions taking event as input
326
-
327
-
328
- onGestureEnded(event) {
329
- this.isGestureRunning = false;
330
- this.cancelPendingGestures(event);
331
- }
332
-
333
- forceInvalidate(event) {
334
- if (this.isGestureRunning) {
335
- this.hasGestureFailed = true;
336
- this.cancelEvent(event);
337
- }
338
- }
339
-
340
- cancelEvent(event) {
341
- this.notifyPendingGestures();
342
- this.sendEvent({ ...event,
343
- eventType: _hammerjs.default.INPUT_CANCEL,
344
- isFinal: true
345
- });
346
- this.onGestureEnded(event);
347
- }
348
-
349
- onRawEvent({
350
- isFirst
351
- }) {
352
- if (isFirst) {
353
- this.hasGestureFailed = false;
354
- }
355
- }
356
-
357
- shouldUseTouchEvents(config) {
358
- var _config$simultaneousH, _config$simultaneousH2;
359
-
360
- return (_config$simultaneousH = (_config$simultaneousH2 = config.simultaneousHandlers) === null || _config$simultaneousH2 === void 0 ? void 0 : _config$simultaneousH2.some(handler => handler.isNative)) !== null && _config$simultaneousH !== void 0 ? _config$simultaneousH : false;
361
- }
362
-
363
- setView(ref, propsRef) {
364
- if (ref == null) {
365
- this.destroy();
366
- this.view = null;
367
- return;
368
- } // @ts-ignore window doesn't exist on global type as we don't want to use Node types
369
-
370
-
371
- const SUPPORTS_TOUCH = ('ontouchstart' in window);
372
- this.propsRef = propsRef;
373
- this.ref = ref;
374
- this.view = (0, _reactNative.findNodeHandle)(ref); // When the browser starts handling the gesture (e.g. scrolling), it sends a pointercancel event and stops
375
- // sending additional pointer events. This is not the case with touch events, so if the gesture is simultaneous
376
- // with a NativeGestureHandler, we need to check if touch events are supported and use them if possible.
377
-
378
- this.hammer = SUPPORTS_TOUCH && this.shouldUseTouchEvents(this.config) ? new _hammerjs.default.Manager(this.view, {
379
- inputClass: _hammerjs.default.TouchInput
380
- }) : new _hammerjs.default.Manager(this.view);
381
- this.oldState = _State.State.UNDETERMINED;
382
- this.previousState = _State.State.UNDETERMINED;
383
- this.lastSentState = null;
384
- const {
385
- NativeGestureClass
386
- } = this; // @ts-ignore TODO(TS)
387
-
388
- const gesture = new NativeGestureClass(this.getHammerConfig());
389
- this.hammer.add(gesture);
390
- this.hammer.on('hammer.input', ev => {
391
- if (!this.config.enabled) {
392
- this.hasGestureFailed = false;
393
- this.isGestureRunning = false;
394
- return;
395
- }
396
-
397
- this.onRawEvent(ev); // TODO: Bacon: Check against something other than null
398
- // The isFirst value is not called when the first rotation is calculated.
399
-
400
- if (this.initialRotation === null && ev.rotation !== 0) {
401
- this.initialRotation = ev.rotation;
402
- }
403
-
404
- if (ev.isFinal) {
405
- // in favor of a willFail otherwise the last frame of the gesture will be captured.
406
- setTimeout(() => {
407
- this.initialRotation = null;
408
- this.hasGestureFailed = false;
409
- });
410
- }
411
- });
412
- this.setupEvents();
413
- this.sync();
414
- }
415
-
416
- setupEvents() {
417
- // TODO(TS) Hammer types aren't exactly that what we get in runtime
418
- if (!this.isDiscrete) {
419
- this.hammer.on(`${this.name}start`, event => this.onStart(event));
420
- this.hammer.on(`${this.name}end ${this.name}cancel`, event => {
421
- this.onGestureEnded(event);
422
- });
423
- }
424
-
425
- this.hammer.on(this.name, ev => this.onGestureActivated(ev)); // TODO(TS) remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438 is merged
426
- }
427
-
428
- onStart({
429
- deltaX,
430
- deltaY,
431
- rotation
432
- }) {
433
- // Reset the state for the next gesture
434
- this.oldState = _State.State.UNDETERMINED;
435
- this.previousState = _State.State.UNDETERMINED;
436
- this.lastSentState = null;
437
- this.isGestureRunning = true;
438
- this.__initialX = deltaX;
439
- this.__initialY = deltaY;
440
- this.initialRotation = rotation;
441
- }
442
-
443
- onGestureActivated(ev) {
444
- this.sendEvent(ev);
445
- }
446
-
447
- onSuccess() {}
448
-
449
- _getPendingGestures() {
450
- if (Array.isArray(this.config.waitFor) && this.config.waitFor.length) {
451
- // Get the list of gestures that this gesture is still waiting for.
452
- // Use `=== false` in case a ref that isn't a gesture handler is used.
453
- const stillWaiting = this.config.waitFor.filter(({
454
- hasGestureFailed
455
- }) => hasGestureFailed === false);
456
- return stillWaiting;
457
- }
458
-
459
- return [];
460
- }
461
-
462
- getHammerConfig() {
463
- const pointers = this.config.minPointers === this.config.maxPointers ? this.config.minPointers : 0;
464
- return {
465
- pointers
466
- };
467
- }
468
-
469
- simulateCancelEvent(_inputData) {} // Validate the props
470
-
471
-
472
- ensureConfig(config) {
473
- const props = { ...config
474
- }; // TODO(TS) We use ! to assert that if property is present then value is not empty (null, undefined)
475
-
476
- if ('minDist' in config) {
477
- props.minDist = config.minDist;
478
- props.minDistSq = props.minDist * props.minDist;
479
- }
480
-
481
- if ('minVelocity' in config) {
482
- props.minVelocity = config.minVelocity;
483
- props.minVelocitySq = props.minVelocity * props.minVelocity;
484
- }
485
-
486
- if ('maxDist' in config) {
487
- props.maxDist = config.maxDist;
488
- props.maxDistSq = config.maxDist * config.maxDist;
489
- }
490
-
491
- if ('waitFor' in config) {
492
- props.waitFor = asArray(config.waitFor).map(({
493
- handlerTag
494
- }) => NodeManager.getHandler(handlerTag)).filter(v => v);
495
- } else {
496
- props.waitFor = null;
497
- }
498
-
499
- if ('simultaneousHandlers' in config) {
500
- const shouldUseTouchEvents = this.shouldUseTouchEvents(this.config);
501
- props.simultaneousHandlers = asArray(config.simultaneousHandlers).map(handler => {
502
- if (typeof handler === 'number') {
503
- return NodeManager.getHandler(handler);
504
- } else {
505
- return NodeManager.getHandler(handler.handlerTag);
506
- }
507
- }).filter(v => v);
508
-
509
- if (shouldUseTouchEvents !== this.shouldUseTouchEvents(props)) {
510
- (0, _ghQueueMicrotask.ghQueueMicrotask)(() => {
511
- // if the undelying event API needs to be changed, we need to unmount and mount
512
- // the hammer instance again.
513
- this.destroy();
514
- this.setView(this.ref, this.propsRef);
515
- });
516
- }
517
- } else {
518
- props.simultaneousHandlers = null;
519
- }
520
-
521
- const configProps = ['minPointers', 'maxPointers', 'minDist', 'maxDist', 'maxDistSq', 'minVelocitySq', 'minDistSq', 'minVelocity', 'failOffsetXStart', 'failOffsetYStart', 'failOffsetXEnd', 'failOffsetYEnd', 'activeOffsetXStart', 'activeOffsetXEnd', 'activeOffsetYStart', 'activeOffsetYEnd'];
522
- configProps.forEach(prop => {
523
- if (typeof props[prop] === 'undefined') {
524
- props[prop] = Number.NaN;
525
- }
526
- });
527
- return props; // TODO(TS) how to convince TS that props are filled?
528
- }
529
-
530
- } // TODO(TS) investigate this method
531
- // Used for sending data to a callback or AnimatedEvent
532
-
533
-
534
- function invokeNullableMethod(method, event) {
535
- if (method) {
536
- if (typeof method === 'function') {
537
- method(event);
538
- } else {
539
- // For use with reanimated's AnimatedEvent
540
- if ('__getHandler' in method && typeof method.__getHandler === 'function') {
541
- const handler = method.__getHandler();
542
-
543
- invokeNullableMethod(handler, event);
544
- } else {
545
- if ('__nodeConfig' in method) {
546
- const {
547
- argMapping
548
- } = method.__nodeConfig;
549
-
550
- if (Array.isArray(argMapping)) {
551
- for (const [index, [key, value]] of argMapping.entries()) {
552
- if (key in event.nativeEvent) {
553
- // @ts-ignore fix method type
554
- const nativeValue = event.nativeEvent[key];
555
-
556
- if (value && value.setValue) {
557
- // Reanimated API
558
- value.setValue(nativeValue);
559
- } else {
560
- // RN Animated API
561
- method.__nodeConfig.argMapping[index] = [key, nativeValue];
562
- }
563
- }
564
- }
565
- }
566
- }
567
- }
568
- }
569
- }
570
- }
571
-
572
- function asArray(value) {
573
- // TODO(TS) use config.waitFor type
574
- return value == null ? [] : Array.isArray(value) ? value : [value];
575
- }
576
-
577
- var _default = GestureHandler;
578
- exports.default = _default;
579
- //# sourceMappingURL=GestureHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandler.ts"],"names":["gestureInstances","GestureHandler","id","name","gestureInstance","isNative","isDiscrete","shouldEnableGestureOnSetup","Error","constructor","State","UNDETERMINED","Array","isArray","config","waitFor","gesture","removePendingGesture","clearSelfAsPending","hammer","stop","destroy","x","y","rect","view","getBoundingClientRect","pointerInside","left","right","top","bottom","nativeEvent","onGestureHandlerEvent","onGestureHandlerStateChange","propsRef","current","event","transformEventData","invokeNullableMethod","lastSentState","state","get","enable","recognizer","inputData","enabled","isGestureRunning","hasGestureFailed","options","maxPointers","_stillWaiting","_getPendingGestures","length","hasCustomActivationCriteria","deltaRotation","initialRotation","rotation","success","failed","isGestureEnabledForEvent","getConfig","simulateCancelEvent","params","getHammerConfig","set","onWaitingEnded","_gesture","pendingGestures","addPendingGesture","_config","_recognizer","_event","NativeGestureClass","updateHasCustomActivationCriteria","updateGestureConfig","props","ensureConfig","sync","getState","type","EventMap","eventType","numberOfPointers","changedTouch","changedPointers","isPointInView","clientX","clientY","previousState","oldState","transformNativeEvent","handlerTag","target","ref","undefined","timeStamp","Date","now","cancelPendingGestures","Object","values","cancelEvent","notifyPendingGestures","onGestureEnded","forceInvalidate","sendEvent","Hammer","INPUT_CANCEL","isFinal","onRawEvent","isFirst","shouldUseTouchEvents","simultaneousHandlers","some","handler","setView","SUPPORTS_TOUCH","window","Manager","inputClass","TouchInput","add","on","ev","setTimeout","setupEvents","onStart","onGestureActivated","deltaX","deltaY","__initialX","__initialY","onSuccess","stillWaiting","filter","pointers","minPointers","_inputData","minDist","minDistSq","minVelocity","minVelocitySq","maxDist","maxDistSq","asArray","map","NodeManager","getHandler","v","configProps","forEach","prop","Number","NaN","method","__getHandler","argMapping","__nodeConfig","index","key","value","entries","nativeValue","setValue"],"mappings":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AAkBsH,MAAtB,EAA8B;AAC5B,gBAAM;AAAEE,YAAAA;AAAF,cAAiBF,MAAM,CAACG,YAA9B;;AACA,cAAIlJ,KAAK,CAACC,OAAN,CAAcgJ,UAAd,CAAJ,EAA+B;AAC7B,iBAAK,MAAM,CAACE,KAAD,EAAQ,CAACC,GAAD,EAAMC,KAAN,CAAR,CAAX,IAAoCJ,UAAU,CAACK,OAAX,EAApC,EAA0D;AACxD,kBAAIF,GAAG,IAAI3H,KAAK,CAACL,WAAjB,EAA8B;AAC5B;AACA,sBAAMmI,WAAW,GAAG9H,KAAK,CAACL,WAAN,CAAkBgI,GAAlB,CAApB;;AACA,oBAAIC,KAAK,IAAIA,KAAK,CAACG,QAAnB,EAA6B;AAC3B;AACAH,kBAAAA,KAAK,CAACG,QAAN,CAAeD,WAAf;AACD,iBAHD,MAGO;AACL;AACAR,kBAAAA,MAAM,CAACG,YAAP,CAAoBD,UAApB,CAA+BE,KAA/B,IAAwC,CAACC,GAAD,EAAMG,WAAN,CAAxC;AACD;AACF;AACF;AACF;AACF;AACF;AACF;AACF;AACF;;AAED,SAASlB,OAAT,CAAoBgB,KAApB,EAAoC;AAClC;AACA,SAAOA,KAAK,IAAI,IAAT,GAAgB,EAAhB,GAAqBrJ,KAAK,CAACC,OAAN,CAAcoJ,KAAd,IAAuBA,KAAvB,GAA+B,CAACA,KAAD,CAA3D;AACD;;eAEchK,c","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\nimport { findNodeHandle } from 'react-native';\n\nimport { State } from '../State';\nimport { EventMap } from './constants';\nimport * as NodeManager from './NodeManager';\nimport { ghQueueMicrotask } from '../ghQueueMicrotask';\n\n// TODO(TS) Replace with HammerInput if https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438/files is merged\nexport type HammerInputExt = Omit<HammerInput, 'destroy' | 'handler' | 'init'>;\n\nexport type Config = Partial<{\n enabled: boolean;\n minPointers: number;\n maxPointers: number;\n minDist: number;\n minDistSq: number;\n minVelocity: number;\n minVelocitySq: number;\n maxDist: number;\n maxDistSq: number;\n failOffsetXStart: number;\n failOffsetYStart: number;\n failOffsetXEnd: number;\n failOffsetYEnd: number;\n activeOffsetXStart: number;\n activeOffsetXEnd: number;\n activeOffsetYStart: number;\n activeOffsetYEnd: number;\n waitFor: any[] | null;\n simultaneousHandlers: any[] | null;\n}>;\n\ntype NativeEvent = ReturnType<GestureHandler['transformEventData']>;\n\nlet gestureInstances = 0;\n\nabstract class GestureHandler {\n public handlerTag: any;\n public isGestureRunning = false;\n public view: number | null = null;\n protected hasCustomActivationCriteria: boolean;\n protected hasGestureFailed = false;\n protected hammer: HammerManager | null = null;\n protected initialRotation: number | null = null;\n protected __initialX: any;\n protected __initialY: any;\n protected config: Config = {};\n protected previousState: State = State.UNDETERMINED;\n private pendingGestures: Record<string, this> = {};\n private oldState: State = State.UNDETERMINED;\n private lastSentState: State | null = null;\n private gestureInstance: number;\n private _stillWaiting: any;\n private propsRef: any;\n private ref: any;\n\n abstract get name(): string;\n\n get id() {\n return `${this.name}${this.gestureInstance}`;\n }\n\n // a simple way to check if GestureHandler is NativeViewGestureHandler, since importing it\n // here to use instanceof would cause import cycle\n get isNative() {\n return false;\n }\n\n get isDiscrete() {\n return false;\n }\n\n get shouldEnableGestureOnSetup(): boolean {\n throw new Error('Must override GestureHandler.shouldEnableGestureOnSetup');\n }\n\n constructor() {\n this.gestureInstance = gestureInstances++;\n this.hasCustomActivationCriteria = false;\n }\n\n getConfig() {\n return this.config;\n }\n\n onWaitingEnded(_gesture: this) {}\n\n removePendingGesture(id: string) {\n delete this.pendingGestures[id];\n }\n\n addPendingGesture(gesture: this) {\n this.pendingGestures[gesture.id] = gesture;\n }\n\n isGestureEnabledForEvent(\n _config: any,\n _recognizer: any,\n _event: any\n ): { failed?: boolean; success?: boolean } {\n return { success: true };\n }\n\n get NativeGestureClass(): RecognizerStatic {\n throw new Error('Must override GestureHandler.NativeGestureClass');\n }\n\n updateHasCustomActivationCriteria(_config: Config) {\n return true;\n }\n\n clearSelfAsPending = () => {\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.removePendingGesture(this.id);\n }\n }\n };\n\n updateGestureConfig({ enabled = true, ...props }) {\n this.clearSelfAsPending();\n\n this.config = this.ensureConfig({ enabled, ...props });\n this.hasCustomActivationCriteria = this.updateHasCustomActivationCriteria(\n this.config\n );\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.addPendingGesture(this);\n }\n }\n\n if (this.hammer) {\n this.sync();\n }\n return this.config;\n }\n\n destroy = () => {\n this.clearSelfAsPending();\n\n if (this.hammer) {\n this.hammer.stop(false);\n this.hammer.destroy();\n }\n this.hammer = null;\n };\n\n isPointInView = ({ x, y }: { x: number; y: number }) => {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n const pointerInside =\n x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;\n return pointerInside;\n };\n\n getState(type: keyof typeof EventMap): State {\n // @ts-ignore TODO(TS) check if this is needed\n if (type == 0) {\n return 0;\n }\n return EventMap[type];\n }\n\n transformEventData(event: HammerInputExt) {\n const { eventType, maxPointers: numberOfPointers } = event;\n // const direction = DirectionMap[ev.direction];\n const changedTouch = event.changedPointers[0];\n const pointerInside = this.isPointInView({\n x: changedTouch.clientX,\n y: changedTouch.clientY,\n });\n\n // TODO(TS) Remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50966 is merged.\n const state = this.getState(eventType as 1 | 2 | 4 | 8);\n if (state !== this.previousState) {\n this.oldState = this.previousState;\n this.previousState = state;\n }\n\n return {\n nativeEvent: {\n numberOfPointers,\n state,\n pointerInside,\n ...this.transformNativeEvent(event),\n // onHandlerStateChange only\n handlerTag: this.handlerTag,\n target: this.ref,\n // send oldState only when the state was changed, or is different than ACTIVE\n // GestureDetector relies on the presence of `oldState` to differentiate between\n // update events and state change events\n oldState:\n state !== this.previousState || state != 4\n ? this.oldState\n : undefined,\n },\n timeStamp: Date.now(),\n };\n }\n\n transformNativeEvent(_event: HammerInputExt) {\n return {};\n }\n\n sendEvent = (nativeEvent: HammerInputExt) => {\n const { onGestureHandlerEvent, onGestureHandlerStateChange } =\n this.propsRef.current;\n\n const event = this.transformEventData(nativeEvent);\n\n invokeNullableMethod(onGestureHandlerEvent, event);\n if (this.lastSentState !== event.nativeEvent.state) {\n this.lastSentState = event.nativeEvent.state as State;\n invokeNullableMethod(onGestureHandlerStateChange, event);\n }\n };\n\n cancelPendingGestures(event: HammerInputExt) {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture && gesture.isGestureRunning) {\n gesture.hasGestureFailed = true;\n gesture.cancelEvent(event);\n }\n }\n }\n\n notifyPendingGestures() {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture) {\n gesture.onWaitingEnded(this);\n }\n }\n }\n\n // FIXME event is undefined in runtime when firstly invoked (see Draggable example), check other functions taking event as input\n onGestureEnded(event: HammerInputExt) {\n this.isGestureRunning = false;\n this.cancelPendingGestures(event);\n }\n\n forceInvalidate(event: HammerInputExt) {\n if (this.isGestureRunning) {\n this.hasGestureFailed = true;\n this.cancelEvent(event);\n }\n }\n\n cancelEvent(event: HammerInputExt) {\n this.notifyPendingGestures();\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_CANCEL,\n isFinal: true,\n });\n this.onGestureEnded(event);\n }\n\n onRawEvent({ isFirst }: HammerInputExt) {\n if (isFirst) {\n this.hasGestureFailed = false;\n }\n }\n\n shouldUseTouchEvents(config: Config) {\n return (\n config.simultaneousHandlers?.some((handler) => handler.isNative) ?? false\n );\n }\n\n setView(ref: Parameters<typeof findNodeHandle>['0'], propsRef: any) {\n if (ref == null) {\n this.destroy();\n this.view = null;\n return;\n }\n\n // @ts-ignore window doesn't exist on global type as we don't want to use Node types\n const SUPPORTS_TOUCH = 'ontouchstart' in window;\n this.propsRef = propsRef;\n this.ref = ref;\n\n this.view = findNodeHandle(ref);\n\n // When the browser starts handling the gesture (e.g. scrolling), it sends a pointercancel event and stops\n // sending additional pointer events. This is not the case with touch events, so if the gesture is simultaneous\n // with a NativeGestureHandler, we need to check if touch events are supported and use them if possible.\n this.hammer =\n SUPPORTS_TOUCH && this.shouldUseTouchEvents(this.config)\n ? new Hammer.Manager(this.view as any, {\n inputClass: Hammer.TouchInput,\n })\n : new Hammer.Manager(this.view as any);\n\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n const { NativeGestureClass } = this;\n // @ts-ignore TODO(TS)\n const gesture = new NativeGestureClass(this.getHammerConfig());\n this.hammer.add(gesture);\n\n this.hammer.on('hammer.input', (ev: HammerInput) => {\n if (!this.config.enabled) {\n this.hasGestureFailed = false;\n this.isGestureRunning = false;\n return;\n }\n\n this.onRawEvent(ev as unknown as HammerInputExt);\n\n // TODO: Bacon: Check against something other than null\n // The isFirst value is not called when the first rotation is calculated.\n if (this.initialRotation === null && ev.rotation !== 0) {\n this.initialRotation = ev.rotation;\n }\n if (ev.isFinal) {\n // in favor of a willFail otherwise the last frame of the gesture will be captured.\n setTimeout(() => {\n this.initialRotation = null;\n this.hasGestureFailed = false;\n });\n }\n });\n\n this.setupEvents();\n this.sync();\n }\n\n setupEvents() {\n // TODO(TS) Hammer types aren't exactly that what we get in runtime\n if (!this.isDiscrete) {\n this.hammer!.on(`${this.name}start`, (event: HammerInput) =>\n this.onStart(event as unknown as HammerInputExt)\n );\n this.hammer!.on(\n `${this.name}end ${this.name}cancel`,\n (event: HammerInput) => {\n this.onGestureEnded(event as unknown as HammerInputExt);\n }\n );\n }\n this.hammer!.on(this.name, (ev: HammerInput) =>\n this.onGestureActivated(ev as unknown as HammerInputExt)\n ); // TODO(TS) remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438 is merged\n }\n\n onStart({ deltaX, deltaY, rotation }: HammerInputExt) {\n // Reset the state for the next gesture\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n this.isGestureRunning = true;\n this.__initialX = deltaX;\n this.__initialY = deltaY;\n this.initialRotation = rotation;\n }\n\n onGestureActivated(ev: HammerInputExt) {\n this.sendEvent(ev);\n }\n\n onSuccess() {}\n\n _getPendingGestures() {\n if (Array.isArray(this.config.waitFor) && this.config.waitFor.length) {\n // Get the list of gestures that this gesture is still waiting for.\n // Use `=== false` in case a ref that isn't a gesture handler is used.\n const stillWaiting = this.config.waitFor.filter(\n ({ hasGestureFailed }) => hasGestureFailed === false\n );\n return stillWaiting;\n }\n return [];\n }\n\n getHammerConfig() {\n const pointers =\n this.config.minPointers === this.config.maxPointers\n ? this.config.minPointers\n : 0;\n return {\n pointers,\n };\n }\n\n sync = () => {\n const gesture = this.hammer!.get(this.name);\n if (!gesture) return;\n\n const enable = (recognizer: any, inputData: any) => {\n if (!this.config.enabled) {\n this.isGestureRunning = false;\n this.hasGestureFailed = false;\n return false;\n }\n\n // Prevent events before the system is ready.\n if (\n !inputData ||\n !recognizer.options ||\n typeof inputData.maxPointers === 'undefined'\n ) {\n return this.shouldEnableGestureOnSetup;\n }\n\n if (this.hasGestureFailed) {\n return false;\n }\n\n if (!this.isDiscrete) {\n if (this.isGestureRunning) {\n return true;\n }\n // The built-in hammer.js \"waitFor\" doesn't work across multiple views.\n // Only process if there are views to wait for.\n this._stillWaiting = this._getPendingGestures();\n // This gesture should continue waiting.\n if (this._stillWaiting.length) {\n // Check to see if one of the gestures you're waiting for has started.\n // If it has then the gesture should fail.\n for (const gesture of this._stillWaiting) {\n // When the target gesture has started, this gesture must force fail.\n if (!gesture.isDiscrete && gesture.isGestureRunning) {\n this.hasGestureFailed = true;\n this.isGestureRunning = false;\n return false;\n }\n }\n // This gesture shouldn't start until the others have finished.\n return false;\n }\n }\n\n // Use default behaviour\n if (!this.hasCustomActivationCriteria) {\n return true;\n }\n\n const deltaRotation =\n this.initialRotation == null\n ? 0\n : inputData.rotation - this.initialRotation;\n // @ts-ignore FIXME(TS)\n const { success, failed } = this.isGestureEnabledForEvent(\n this.getConfig(),\n recognizer,\n {\n ...inputData,\n deltaRotation,\n }\n );\n\n if (failed) {\n this.simulateCancelEvent(inputData);\n this.hasGestureFailed = true;\n }\n return success;\n };\n\n const params = this.getHammerConfig();\n // @ts-ignore FIXME(TS)\n gesture.set({ ...params, enable });\n };\n\n simulateCancelEvent(_inputData: any) {}\n\n // Validate the props\n ensureConfig(config: Config): Required<Config> {\n const props = { ...config };\n\n // TODO(TS) We use ! to assert that if property is present then value is not empty (null, undefined)\n if ('minDist' in config) {\n props.minDist = config.minDist;\n props.minDistSq = props.minDist! * props.minDist!;\n }\n if ('minVelocity' in config) {\n props.minVelocity = config.minVelocity;\n props.minVelocitySq = props.minVelocity! * props.minVelocity!;\n }\n if ('maxDist' in config) {\n props.maxDist = config.maxDist;\n props.maxDistSq = config.maxDist! * config.maxDist!;\n }\n if ('waitFor' in config) {\n props.waitFor = asArray(config.waitFor)\n .map(({ handlerTag }: { handlerTag: number }) =>\n NodeManager.getHandler(handlerTag)\n )\n .filter((v) => v);\n } else {\n props.waitFor = null;\n }\n if ('simultaneousHandlers' in config) {\n const shouldUseTouchEvents = this.shouldUseTouchEvents(this.config);\n props.simultaneousHandlers = asArray(config.simultaneousHandlers)\n .map((handler: number | GestureHandler) => {\n if (typeof handler === 'number') {\n return NodeManager.getHandler(handler);\n } else {\n return NodeManager.getHandler(handler.handlerTag);\n }\n })\n .filter((v) => v);\n\n if (shouldUseTouchEvents !== this.shouldUseTouchEvents(props)) {\n ghQueueMicrotask(() => {\n // if the undelying event API needs to be changed, we need to unmount and mount\n // the hammer instance again.\n this.destroy();\n this.setView(this.ref, this.propsRef);\n });\n }\n } else {\n props.simultaneousHandlers = null;\n }\n\n const configProps = [\n 'minPointers',\n 'maxPointers',\n 'minDist',\n 'maxDist',\n 'maxDistSq',\n 'minVelocitySq',\n 'minDistSq',\n 'minVelocity',\n 'failOffsetXStart',\n 'failOffsetYStart',\n 'failOffsetXEnd',\n 'failOffsetYEnd',\n 'activeOffsetXStart',\n 'activeOffsetXEnd',\n 'activeOffsetYStart',\n 'activeOffsetYEnd',\n ] as const;\n configProps.forEach((prop: (typeof configProps)[number]) => {\n if (typeof props[prop] === 'undefined') {\n props[prop] = Number.NaN;\n }\n });\n return props as Required<Config>; // TODO(TS) how to convince TS that props are filled?\n }\n}\n\n// TODO(TS) investigate this method\n// Used for sending data to a callback or AnimatedEvent\nfunction invokeNullableMethod(\n method:\n | ((event: NativeEvent) => void)\n | { __getHandler: () => (event: NativeEvent) => void }\n | { __nodeConfig: { argMapping: any } },\n event: NativeEvent\n) {\n if (method) {\n if (typeof method === 'function') {\n method(event);\n } else {\n // For use with reanimated's AnimatedEvent\n if (\n '__getHandler' in method &&\n typeof method.__getHandler === 'function'\n ) {\n const handler = method.__getHandler();\n invokeNullableMethod(handler, event);\n } else {\n if ('__nodeConfig' in method) {\n const { argMapping } = method.__nodeConfig;\n if (Array.isArray(argMapping)) {\n for (const [index, [key, value]] of argMapping.entries()) {\n if (key in event.nativeEvent) {\n // @ts-ignore fix method type\n const nativeValue = event.nativeEvent[key];\n if (value && value.setValue) {\n // Reanimated API\n value.setValue(nativeValue);\n } else {\n // RN Animated API\n method.__nodeConfig.argMapping[index] = [key, nativeValue];\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nfunction asArray<T>(value: T | T[]) {\n // TODO(TS) use config.waitFor type\n return value == null ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport default GestureHandler;\n"]}