react-native-gesture-handler 2.25.0 → 2.26.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 (1028) hide show
  1. package/RNGestureHandler.podspec +1 -0
  2. package/android/build.gradle +41 -42
  3. package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +1 -1
  4. package/android/gradle.properties +1 -1
  5. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -2
  6. package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +4 -1
  7. package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +1 -1
  8. package/android/{package77/src → src}/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +14 -19
  9. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +29 -5
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +229 -114
  11. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +4 -4
  12. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +91 -49
  13. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +1 -1
  14. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +13 -4
  15. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +20 -6
  16. package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +52 -21
  17. package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +12 -1
  18. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +65 -35
  19. package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +3 -3
  20. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +187 -92
  21. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +12 -5
  22. package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +1 -1
  23. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +3 -1
  24. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +12 -5
  25. package/android/src/main/java/com/swmansion/gesturehandler/core/StylusData.kt +1 -1
  26. package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +55 -33
  27. package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +13 -18
  28. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +27 -21
  29. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +7 -2
  30. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +13 -12
  31. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt +189 -0
  32. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerFactoryUtil.kt +34 -0
  33. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +7 -11
  34. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +29 -590
  35. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +8 -14
  36. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +26 -16
  37. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -12
  38. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +2 -4
  39. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +17 -16
  40. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +6 -4
  41. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +7 -5
  42. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +2 -1
  43. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +1 -1
  44. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +2 -1
  45. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +2 -1
  46. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +2 -1
  47. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +2 -1
  48. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +2 -1
  49. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +2 -1
  50. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +2 -1
  51. package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +2 -1
  52. package/android/src/main/jni/CMakeLists.txt +10 -1
  53. package/android/svg/src/main/java/com/swmansion/gesturehandler/RNSVGHitTester.kt +1 -3
  54. package/apple/RNGestureHandlerButton.mm +6 -2
  55. package/lib/commonjs/ActionType.js +3 -3
  56. package/lib/commonjs/ActionType.js.map +1 -1
  57. package/lib/commonjs/Directions.js +11 -8
  58. package/lib/commonjs/Directions.js.map +1 -1
  59. package/lib/commonjs/EnableNewWebImplementation.js +2 -10
  60. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
  61. package/lib/commonjs/GestureHandlerRootViewContext.js +2 -7
  62. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
  63. package/lib/commonjs/PlatformConstants.js +1 -7
  64. package/lib/commonjs/PlatformConstants.js.map +1 -1
  65. package/lib/commonjs/PlatformConstants.web.js +1 -3
  66. package/lib/commonjs/PlatformConstants.web.js.map +1 -1
  67. package/lib/commonjs/PointerType.js +3 -5
  68. package/lib/commonjs/PointerType.js.map +1 -1
  69. package/lib/commonjs/RNGestureHandlerModule.js +2 -6
  70. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  71. package/lib/commonjs/RNGestureHandlerModule.web.js +10 -37
  72. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  73. package/lib/commonjs/RNGestureHandlerModule.windows.js +22 -32
  74. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  75. package/lib/commonjs/RNRenderer.js +1 -3
  76. package/lib/commonjs/RNRenderer.js.map +1 -1
  77. package/lib/commonjs/RNRenderer.web.js +1 -2
  78. package/lib/commonjs/RNRenderer.web.js.map +1 -1
  79. package/lib/commonjs/State.js +4 -3
  80. package/lib/commonjs/State.js.map +1 -1
  81. package/lib/commonjs/TouchEventType.js +3 -3
  82. package/lib/commonjs/TouchEventType.js.map +1 -1
  83. package/lib/commonjs/components/DrawerLayout.js +436 -462
  84. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  85. package/lib/commonjs/components/GestureButtons.js +123 -181
  86. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  87. package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
  88. package/lib/commonjs/components/GestureComponents.js +36 -45
  89. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  90. package/lib/commonjs/components/GestureComponents.web.js +19 -32
  91. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  92. package/lib/commonjs/components/GestureHandlerButton.js +2 -6
  93. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  94. package/lib/commonjs/components/GestureHandlerButton.web.js +6 -14
  95. package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
  96. package/lib/commonjs/components/GestureHandlerRootView.android.js +10 -20
  97. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
  98. package/lib/commonjs/components/GestureHandlerRootView.js +10 -19
  99. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  100. package/lib/commonjs/components/GestureHandlerRootView.web.js +10 -18
  101. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
  102. package/lib/commonjs/components/Pressable/Pressable.js +72 -118
  103. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
  104. package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
  105. package/lib/commonjs/components/Pressable/index.js +1 -3
  106. package/lib/commonjs/components/Pressable/index.js.map +1 -1
  107. package/lib/commonjs/components/Pressable/utils.js +16 -38
  108. package/lib/commonjs/components/Pressable/utils.js.map +1 -1
  109. package/lib/commonjs/components/ReanimatedDrawerLayout.js +72 -108
  110. package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
  111. package/lib/commonjs/components/ReanimatedSwipeable.js +81 -102
  112. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
  113. package/lib/commonjs/components/Swipeable.js +290 -335
  114. package/lib/commonjs/components/Swipeable.js.map +1 -1
  115. package/lib/commonjs/components/Text.js +23 -34
  116. package/lib/commonjs/components/Text.js.map +1 -1
  117. package/lib/commonjs/components/gestureHandlerRootHOC.js +11 -17
  118. package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
  119. package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -1
  120. package/lib/commonjs/components/touchables/GenericTouchable.js +95 -140
  121. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  122. package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
  123. package/lib/commonjs/components/touchables/TouchableHighlight.js +51 -69
  124. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  125. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +38 -56
  126. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  127. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +1 -4
  128. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
  129. package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  130. package/lib/commonjs/components/touchables/TouchableOpacity.js +39 -53
  131. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  132. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +11 -15
  133. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  134. package/lib/commonjs/components/touchables/index.js +7 -12
  135. package/lib/commonjs/components/touchables/index.js.map +1 -1
  136. package/lib/commonjs/components/utils.js +17 -0
  137. package/lib/commonjs/components/utils.js.map +1 -0
  138. package/lib/commonjs/findNodeHandle.js +1 -4
  139. package/lib/commonjs/findNodeHandle.js.map +1 -1
  140. package/lib/commonjs/findNodeHandle.web.js +7 -16
  141. package/lib/commonjs/findNodeHandle.web.js.map +1 -1
  142. package/lib/commonjs/getShadowNodeFromRef.js +19 -20
  143. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  144. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -1
  145. package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
  146. package/lib/commonjs/ghQueueMicrotask.js +1 -2
  147. package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
  148. package/lib/commonjs/handlers/FlingGestureHandler.js +9 -11
  149. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  150. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +16 -23
  151. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  152. package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
  153. package/lib/commonjs/handlers/LongPressGestureHandler.js +9 -11
  154. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  155. package/lib/commonjs/handlers/NativeViewGestureHandler.ts +59 -0
  156. package/lib/commonjs/handlers/PanGestureHandler.js +13 -32
  157. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  158. package/lib/commonjs/handlers/PinchGestureHandler.js +7 -9
  159. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  160. package/lib/commonjs/handlers/PressabilityDebugView.js +0 -1
  161. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  162. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -1
  163. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
  164. package/lib/commonjs/handlers/RotationGestureHandler.js +7 -9
  165. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  166. package/lib/commonjs/handlers/TapGestureHandler.js +9 -11
  167. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  168. package/lib/commonjs/handlers/createHandler.js +128 -229
  169. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  170. package/lib/commonjs/handlers/createNativeWrapper.js +26 -35
  171. package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
  172. package/lib/commonjs/handlers/customDirectEventTypes.js +0 -1
  173. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
  174. package/lib/commonjs/handlers/customDirectEventTypes.web.js +1 -2
  175. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
  176. package/lib/commonjs/handlers/gestureHandlerCommon.js +9 -10
  177. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  178. package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
  179. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +5 -15
  180. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  181. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +14 -22
  182. package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  183. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -29
  184. package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  185. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +1 -10
  186. package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  187. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +19 -42
  188. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  189. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -3
  190. package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  191. package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
  192. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +15 -26
  193. package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  194. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +13 -50
  195. package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  196. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +3 -13
  197. package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  198. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +2 -9
  199. package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  200. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +6 -14
  201. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  202. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +23 -52
  203. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  204. package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -55
  205. package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
  206. package/lib/commonjs/handlers/gestures/flingGesture.js +3 -13
  207. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  208. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +6 -20
  209. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  210. package/lib/commonjs/handlers/gestures/gesture.js +50 -93
  211. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  212. package/lib/commonjs/handlers/gestures/gestureComposition.js +17 -34
  213. package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
  214. package/lib/commonjs/handlers/gestures/gestureObjects.js +1 -27
  215. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  216. package/lib/commonjs/handlers/gestures/gestureStateManager.js +5 -11
  217. package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
  218. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +2 -7
  219. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  220. package/lib/commonjs/handlers/gestures/hoverGesture.js +9 -26
  221. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  222. package/lib/commonjs/handlers/gestures/longPressGesture.js +4 -15
  223. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  224. package/lib/commonjs/handlers/gestures/manualGesture.js +0 -6
  225. package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
  226. package/lib/{module/handlers/gestures/nativeGesture.js → commonjs/handlers/gestures/nativeGesture.ts} +12 -13
  227. package/lib/commonjs/handlers/gestures/panGesture.js +16 -44
  228. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  229. package/lib/commonjs/handlers/gestures/pinchGesture.js +2 -9
  230. package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
  231. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +2 -10
  232. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
  233. package/lib/commonjs/handlers/gestures/rotationGesture.js +2 -9
  234. package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
  235. package/lib/commonjs/handlers/gestures/tapGesture.js +8 -23
  236. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  237. package/lib/commonjs/handlers/getNextHandlerTag.js +0 -1
  238. package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
  239. package/lib/commonjs/handlers/handlersRegistry.js +7 -23
  240. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  241. package/lib/commonjs/handlers/utils.js +8 -31
  242. package/lib/commonjs/handlers/utils.js.map +1 -1
  243. package/lib/commonjs/index.js +75 -104
  244. package/lib/commonjs/index.js.map +1 -1
  245. package/lib/commonjs/init.js +4 -11
  246. package/lib/commonjs/init.js.map +1 -1
  247. package/lib/commonjs/jestUtils/index.js +4 -5
  248. package/lib/commonjs/jestUtils/index.js.map +1 -1
  249. package/lib/commonjs/jestUtils/jestUtils.js +24 -91
  250. package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
  251. package/lib/commonjs/mocks.js +10 -18
  252. package/lib/commonjs/mocks.js.map +1 -1
  253. package/lib/commonjs/mountRegistry.js +2 -14
  254. package/lib/commonjs/mountRegistry.js.map +1 -1
  255. package/lib/commonjs/package.json +1 -0
  256. package/lib/commonjs/specs/NativeRNGestureHandlerModule.ts +26 -0
  257. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.ts +22 -0
  258. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
  259. package/lib/commonjs/typeUtils.js.map +1 -1
  260. package/lib/commonjs/utils.js +14 -35
  261. package/lib/commonjs/utils.js.map +1 -1
  262. package/lib/commonjs/web/Gestures.js +5 -23
  263. package/lib/commonjs/web/Gestures.js.map +1 -1
  264. package/lib/commonjs/web/constants.js +2 -4
  265. package/lib/commonjs/web/constants.js.map +1 -1
  266. package/lib/commonjs/web/detectors/RotationGestureDetector.js +10 -52
  267. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  268. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +11 -55
  269. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  270. package/lib/commonjs/web/handlers/FlingGestureHandler.js +9 -59
  271. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  272. package/lib/commonjs/web/handlers/GestureHandler.js +91 -226
  273. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  274. package/lib/commonjs/web/handlers/HoverGestureHandler.js +3 -23
  275. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
  276. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
  277. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +11 -59
  278. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  279. package/lib/commonjs/web/handlers/ManualGestureHandler.js +1 -11
  280. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
  281. package/lib/{module/web/handlers/NativeViewGestureHandler.js → commonjs/web/handlers/NativeViewGestureHandler.ts} +49 -48
  282. package/lib/commonjs/web/handlers/PanGestureHandler.js +33 -155
  283. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  284. package/lib/commonjs/web/handlers/PinchGestureHandler.js +25 -68
  285. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  286. package/lib/commonjs/web/handlers/RotationGestureHandler.js +23 -67
  287. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  288. package/lib/commonjs/web/handlers/TapGestureHandler.js +18 -87
  289. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  290. package/lib/commonjs/web/interfaces.js +9 -17
  291. package/lib/commonjs/web/interfaces.js.map +1 -1
  292. package/lib/commonjs/web/tools/CircularBuffer.js +0 -19
  293. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
  294. package/lib/commonjs/web/tools/EventManager.js +5 -44
  295. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  296. package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
  297. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +13 -86
  298. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  299. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +14 -61
  300. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  301. package/lib/commonjs/web/tools/InteractionManager.js +12 -35
  302. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  303. package/lib/commonjs/web/tools/KeyboardEventManager.js +24 -52
  304. package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
  305. package/lib/commonjs/web/tools/LeastSquareSolver.js +24 -69
  306. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
  307. package/lib/commonjs/web/tools/NodeManager.js +5 -15
  308. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  309. package/lib/commonjs/web/tools/PointerEventManager.js +119 -159
  310. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  311. package/lib/commonjs/web/tools/PointerTracker.js +20 -63
  312. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  313. package/lib/commonjs/web/tools/Vector.js +1 -25
  314. package/lib/commonjs/web/tools/Vector.js.map +1 -1
  315. package/lib/commonjs/web/tools/VelocityTracker.js +10 -36
  316. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  317. package/lib/commonjs/web/tools/WheelEventManager.js +15 -34
  318. package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
  319. package/lib/commonjs/web/utils.js +32 -67
  320. package/lib/commonjs/web/utils.js.map +1 -1
  321. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +8 -20
  322. package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
  323. package/lib/commonjs/web_hammer/DraggingGestureHandler.js +4 -14
  324. package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
  325. package/lib/commonjs/web_hammer/Errors.js +0 -3
  326. package/lib/commonjs/web_hammer/Errors.js.map +1 -1
  327. package/lib/commonjs/web_hammer/FlingGestureHandler.js +14 -45
  328. package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
  329. package/lib/commonjs/web_hammer/GestureHandler.js +149 -244
  330. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
  331. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +2 -11
  332. package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  333. package/lib/commonjs/web_hammer/LongPressGestureHandler.js +6 -20
  334. package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
  335. package/lib/commonjs/web_hammer/NativeViewGestureHandler.ts +47 -0
  336. package/lib/commonjs/web_hammer/NodeManager.js +9 -16
  337. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  338. package/lib/commonjs/web_hammer/PanGestureHandler.js +8 -49
  339. package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
  340. package/lib/commonjs/web_hammer/PinchGestureHandler.js +2 -11
  341. package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
  342. package/lib/commonjs/web_hammer/PressGestureHandler.js +14 -49
  343. package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
  344. package/lib/commonjs/web_hammer/RotationGestureHandler.js +3 -15
  345. package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
  346. package/lib/commonjs/web_hammer/TapGestureHandler.js +43 -70
  347. package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
  348. package/lib/commonjs/web_hammer/constants.js +13 -26
  349. package/lib/commonjs/web_hammer/constants.js.map +1 -1
  350. package/lib/commonjs/web_hammer/utils.js +4 -14
  351. package/lib/commonjs/web_hammer/utils.js.map +1 -1
  352. package/lib/module/ActionType.js +5 -1
  353. package/lib/module/ActionType.js.map +1 -1
  354. package/lib/module/Directions.js +11 -3
  355. package/lib/module/Directions.js.map +1 -1
  356. package/lib/module/EnableNewWebImplementation.js +4 -5
  357. package/lib/module/EnableNewWebImplementation.js.map +1 -1
  358. package/lib/module/GestureHandlerRootViewContext.js +2 -0
  359. package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
  360. package/lib/module/PlatformConstants.js +2 -2
  361. package/lib/module/PlatformConstants.js.map +1 -1
  362. package/lib/module/PlatformConstants.web.js +2 -1
  363. package/lib/module/PlatformConstants.web.js.map +1 -1
  364. package/lib/module/PointerType.js +4 -3
  365. package/lib/module/PointerType.js.map +1 -1
  366. package/lib/module/RNGestureHandlerModule.js +3 -0
  367. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  368. package/lib/module/RNGestureHandlerModule.web.js +12 -20
  369. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  370. package/lib/module/RNGestureHandlerModule.windows.js +20 -17
  371. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  372. package/lib/module/RNRenderer.js +2 -0
  373. package/lib/module/RNRenderer.js.map +1 -1
  374. package/lib/module/RNRenderer.web.js +2 -0
  375. package/lib/module/RNRenderer.web.js.map +1 -1
  376. package/lib/module/State.js +6 -1
  377. package/lib/module/State.js.map +1 -1
  378. package/lib/module/TouchEventType.js +5 -1
  379. package/lib/module/TouchEventType.js.map +1 -1
  380. package/lib/module/components/DrawerLayout.js +427 -446
  381. package/lib/module/components/DrawerLayout.js.map +1 -1
  382. package/lib/module/components/GestureButtons.js +119 -157
  383. package/lib/module/components/GestureButtons.js.map +1 -1
  384. package/lib/module/components/GestureButtonsProps.js +2 -0
  385. package/lib/module/components/GestureButtonsProps.js.map +1 -1
  386. package/lib/module/components/GestureComponents.js +29 -19
  387. package/lib/module/components/GestureComponents.js.map +1 -1
  388. package/lib/module/components/GestureComponents.web.js +13 -9
  389. package/lib/module/components/GestureComponents.web.js.map +1 -1
  390. package/lib/module/components/GestureHandlerButton.js +2 -0
  391. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  392. package/lib/module/components/GestureHandlerButton.web.js +6 -4
  393. package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
  394. package/lib/module/components/GestureHandlerRootView.android.js +9 -6
  395. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
  396. package/lib/module/components/GestureHandlerRootView.js +9 -6
  397. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  398. package/lib/module/components/GestureHandlerRootView.web.js +9 -6
  399. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
  400. package/lib/module/components/Pressable/Pressable.js +70 -98
  401. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  402. package/lib/module/components/Pressable/PressableProps.js +2 -0
  403. package/lib/module/components/Pressable/PressableProps.js.map +1 -1
  404. package/lib/module/components/Pressable/index.js +2 -0
  405. package/lib/module/components/Pressable/index.js.map +1 -1
  406. package/lib/module/components/Pressable/utils.js +17 -32
  407. package/lib/module/components/Pressable/utils.js.map +1 -1
  408. package/lib/module/components/ReanimatedDrawerLayout.js +71 -88
  409. package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
  410. package/lib/module/components/ReanimatedSwipeable.js +78 -87
  411. package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
  412. package/lib/module/components/Swipeable.js +286 -320
  413. package/lib/module/components/Swipeable.js.map +1 -1
  414. package/lib/module/components/Text.js +22 -20
  415. package/lib/module/components/Text.js.map +1 -1
  416. package/lib/module/components/gestureHandlerRootHOC.js +11 -5
  417. package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
  418. package/lib/module/components/touchables/ExtraButtonProps.js +1 -1
  419. package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -1
  420. package/lib/module/components/touchables/GenericTouchable.js +92 -127
  421. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  422. package/lib/module/components/touchables/GenericTouchableProps.js +2 -0
  423. package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
  424. package/lib/module/components/touchables/TouchableHighlight.js +48 -58
  425. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  426. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +34 -43
  427. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  428. package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -1
  429. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
  430. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +2 -0
  431. package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
  432. package/lib/module/components/touchables/TouchableOpacity.js +34 -43
  433. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  434. package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -4
  435. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  436. package/lib/module/components/touchables/index.js +2 -0
  437. package/lib/module/components/touchables/index.js.map +1 -1
  438. package/lib/module/components/utils.js +13 -0
  439. package/lib/module/components/utils.js.map +1 -0
  440. package/lib/module/findNodeHandle.js +2 -0
  441. package/lib/module/findNodeHandle.js.map +1 -1
  442. package/lib/module/findNodeHandle.web.js +9 -13
  443. package/lib/module/findNodeHandle.web.js.map +1 -1
  444. package/lib/module/getShadowNodeFromRef.js +21 -19
  445. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  446. package/lib/module/getShadowNodeFromRef.web.js +2 -0
  447. package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
  448. package/lib/module/ghQueueMicrotask.js +2 -0
  449. package/lib/module/ghQueueMicrotask.js.map +1 -1
  450. package/lib/module/handlers/FlingGestureHandler.js +8 -0
  451. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  452. package/lib/module/handlers/ForceTouchGestureHandler.js +14 -8
  453. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  454. package/lib/module/handlers/GestureHandlerEventPayload.js +2 -0
  455. package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
  456. package/lib/module/handlers/LongPressGestureHandler.js +8 -0
  457. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  458. package/lib/module/handlers/NativeViewGestureHandler.ts +59 -0
  459. package/lib/module/handlers/PanGestureHandler.js +10 -19
  460. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  461. package/lib/module/handlers/PinchGestureHandler.js +4 -0
  462. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  463. package/lib/module/handlers/PressabilityDebugView.js +2 -0
  464. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  465. package/lib/module/handlers/PressabilityDebugView.web.js +2 -0
  466. package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
  467. package/lib/module/handlers/RotationGestureHandler.js +4 -0
  468. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  469. package/lib/module/handlers/TapGestureHandler.js +8 -0
  470. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  471. package/lib/module/handlers/createHandler.js +127 -200
  472. package/lib/module/handlers/createHandler.js.map +1 -1
  473. package/lib/module/handlers/createNativeWrapper.js +22 -22
  474. package/lib/module/handlers/createNativeWrapper.js.map +1 -1
  475. package/lib/module/handlers/customDirectEventTypes.js +2 -0
  476. package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
  477. package/lib/module/handlers/customDirectEventTypes.web.js +2 -0
  478. package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
  479. package/lib/module/handlers/gestureHandlerCommon.js +11 -4
  480. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  481. package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
  482. package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
  483. package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -4
  484. package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
  485. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +12 -8
  486. package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
  487. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +10 -16
  488. package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
  489. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +2 -1
  490. package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
  491. package/lib/module/handlers/gestures/GestureDetector/index.js +18 -19
  492. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  493. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -2
  494. package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
  495. package/lib/module/handlers/gestures/GestureDetector/types.js +2 -0
  496. package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
  497. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +16 -16
  498. package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
  499. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +15 -41
  500. package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
  501. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +7 -5
  502. package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
  503. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +4 -6
  504. package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
  505. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -7
  506. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  507. package/lib/module/handlers/gestures/GestureDetector/utils.js +21 -26
  508. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  509. package/lib/module/handlers/gestures/eventReceiver.js +16 -47
  510. package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
  511. package/lib/module/handlers/gestures/flingGesture.js +4 -9
  512. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  513. package/lib/module/handlers/gestures/forceTouchGesture.js +7 -17
  514. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  515. package/lib/module/handlers/gestures/gesture.js +51 -81
  516. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  517. package/lib/module/handlers/gestures/gestureComposition.js +17 -26
  518. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  519. package/lib/module/handlers/gestures/gestureObjects.js +3 -14
  520. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  521. package/lib/module/handlers/gestures/gestureStateManager.js +7 -6
  522. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  523. package/lib/module/handlers/gestures/gestureStateManager.web.js +2 -1
  524. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  525. package/lib/module/handlers/gestures/hoverGesture.js +8 -18
  526. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  527. package/lib/module/handlers/gestures/longPressGesture.js +5 -11
  528. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  529. package/lib/module/handlers/gestures/manualGesture.js +2 -4
  530. package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
  531. package/lib/module/handlers/gestures/nativeGesture.ts +33 -0
  532. package/lib/module/handlers/gestures/panGesture.js +17 -41
  533. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  534. package/lib/module/handlers/gestures/pinchGesture.js +4 -7
  535. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  536. package/lib/module/handlers/gestures/reanimatedWrapper.js +2 -6
  537. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
  538. package/lib/module/handlers/gestures/rotationGesture.js +4 -7
  539. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  540. package/lib/module/handlers/gestures/tapGesture.js +9 -19
  541. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  542. package/lib/module/handlers/getNextHandlerTag.js +2 -0
  543. package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
  544. package/lib/module/handlers/handlersRegistry.js +3 -7
  545. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  546. package/lib/module/handlers/utils.js +8 -18
  547. package/lib/module/handlers/utils.js.map +1 -1
  548. package/lib/module/index.js +2 -0
  549. package/lib/module/index.js.map +1 -1
  550. package/lib/module/init.js +5 -2
  551. package/lib/module/init.js.map +1 -1
  552. package/lib/module/jestUtils/index.js +2 -0
  553. package/lib/module/jestUtils/index.js.map +1 -1
  554. package/lib/module/jestUtils/jestUtils.js +27 -74
  555. package/lib/module/jestUtils/jestUtils.js.map +1 -1
  556. package/lib/module/mocks.js +9 -9
  557. package/lib/module/mocks.js.map +1 -1
  558. package/lib/module/mountRegistry.js +3 -11
  559. package/lib/module/mountRegistry.js.map +1 -1
  560. package/lib/module/specs/NativeRNGestureHandlerModule.ts +26 -0
  561. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.ts +22 -0
  562. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
  563. package/lib/module/typeUtils.js +1 -1
  564. package/lib/module/typeUtils.js.map +1 -1
  565. package/lib/module/utils.js +8 -14
  566. package/lib/module/utils.js.map +1 -1
  567. package/lib/module/web/Gestures.js +4 -1
  568. package/lib/module/web/Gestures.js.map +1 -1
  569. package/lib/module/web/constants.js +2 -0
  570. package/lib/module/web/constants.js.map +1 -1
  571. package/lib/module/web/detectors/RotationGestureDetector.js +11 -48
  572. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  573. package/lib/module/web/detectors/ScaleGestureDetector.js +12 -50
  574. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  575. package/lib/module/web/handlers/FlingGestureHandler.js +9 -48
  576. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  577. package/lib/module/web/handlers/GestureHandler.js +90 -212
  578. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  579. package/lib/module/web/handlers/HoverGestureHandler.js +3 -14
  580. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  581. package/lib/module/web/handlers/IGestureHandler.js +1 -1
  582. package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
  583. package/lib/module/web/handlers/LongPressGestureHandler.js +11 -51
  584. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  585. package/lib/module/web/handlers/ManualGestureHandler.js +2 -6
  586. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  587. package/lib/module/web/handlers/NativeViewGestureHandler.ts +175 -0
  588. package/lib/module/web/handlers/PanGestureHandler.js +33 -145
  589. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  590. package/lib/module/web/handlers/PinchGestureHandler.js +25 -59
  591. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  592. package/lib/module/web/handlers/RotationGestureHandler.js +23 -58
  593. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  594. package/lib/module/web/handlers/TapGestureHandler.js +18 -78
  595. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  596. package/lib/module/web/interfaces.js +10 -13
  597. package/lib/module/web/interfaces.js.map +1 -1
  598. package/lib/module/web/tools/CircularBuffer.js +1 -16
  599. package/lib/module/web/tools/CircularBuffer.js.map +1 -1
  600. package/lib/module/web/tools/EventManager.js +6 -41
  601. package/lib/module/web/tools/EventManager.js.map +1 -1
  602. package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
  603. package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
  604. package/lib/module/web/tools/GestureHandlerOrchestrator.js +13 -78
  605. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  606. package/lib/module/web/tools/GestureHandlerWebDelegate.js +14 -49
  607. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  608. package/lib/module/web/tools/InteractionManager.js +13 -32
  609. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  610. package/lib/module/web/tools/KeyboardEventManager.js +24 -44
  611. package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
  612. package/lib/module/web/tools/LeastSquareSolver.js +25 -66
  613. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
  614. package/lib/module/web/tools/NodeManager.js +6 -12
  615. package/lib/module/web/tools/NodeManager.js.map +1 -1
  616. package/lib/module/web/tools/PointerEventManager.js +119 -148
  617. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  618. package/lib/module/web/tools/PointerTracker.js +20 -56
  619. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  620. package/lib/module/web/tools/Vector.js +2 -20
  621. package/lib/module/web/tools/Vector.js.map +1 -1
  622. package/lib/module/web/tools/VelocityTracker.js +10 -29
  623. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  624. package/lib/module/web/tools/WheelEventManager.js +15 -26
  625. package/lib/module/web/tools/WheelEventManager.js.map +1 -1
  626. package/lib/module/web/utils.js +29 -49
  627. package/lib/module/web/utils.js.map +1 -1
  628. package/lib/module/web_hammer/DiscreteGestureHandler.js +6 -13
  629. package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
  630. package/lib/module/web_hammer/DraggingGestureHandler.js +2 -5
  631. package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
  632. package/lib/module/web_hammer/Errors.js +2 -1
  633. package/lib/module/web_hammer/Errors.js.map +1 -1
  634. package/lib/module/web_hammer/FlingGestureHandler.js +12 -35
  635. package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
  636. package/lib/module/web_hammer/GestureHandler.js +148 -233
  637. package/lib/module/web_hammer/GestureHandler.js.map +1 -1
  638. package/lib/module/web_hammer/IndiscreteGestureHandler.js +3 -6
  639. package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
  640. package/lib/module/web_hammer/LongPressGestureHandler.js +4 -11
  641. package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
  642. package/lib/module/web_hammer/NativeViewGestureHandler.ts +47 -0
  643. package/lib/module/web_hammer/NodeManager.js +8 -8
  644. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  645. package/lib/module/web_hammer/PanGestureHandler.js +8 -40
  646. package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
  647. package/lib/module/web_hammer/PinchGestureHandler.js +2 -5
  648. package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
  649. package/lib/module/web_hammer/PressGestureHandler.js +13 -39
  650. package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
  651. package/lib/module/web_hammer/RotationGestureHandler.js +3 -8
  652. package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
  653. package/lib/module/web_hammer/TapGestureHandler.js +42 -62
  654. package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
  655. package/lib/module/web_hammer/constants.js +4 -1
  656. package/lib/module/web_hammer/constants.js.map +1 -1
  657. package/lib/module/web_hammer/utils.js +4 -2
  658. package/lib/module/web_hammer/utils.js.map +1 -1
  659. package/lib/typescript/ActionType.d.ts +1 -0
  660. package/lib/typescript/ActionType.d.ts.map +1 -0
  661. package/lib/typescript/Directions.d.ts +1 -0
  662. package/lib/typescript/Directions.d.ts.map +1 -0
  663. package/lib/typescript/EnableNewWebImplementation.d.ts +1 -0
  664. package/lib/typescript/EnableNewWebImplementation.d.ts.map +1 -0
  665. package/lib/typescript/GestureHandlerRootViewContext.d.ts +1 -0
  666. package/lib/typescript/GestureHandlerRootViewContext.d.ts.map +1 -0
  667. package/lib/typescript/PlatformConstants.d.ts +1 -0
  668. package/lib/typescript/PlatformConstants.d.ts.map +1 -0
  669. package/lib/typescript/PlatformConstants.web.d.ts +1 -0
  670. package/lib/typescript/PlatformConstants.web.d.ts.map +1 -0
  671. package/lib/typescript/PointerType.d.ts +1 -0
  672. package/lib/typescript/PointerType.d.ts.map +1 -0
  673. package/lib/typescript/RNGestureHandlerModule.d.ts +1 -0
  674. package/lib/typescript/RNGestureHandlerModule.d.ts.map +1 -0
  675. package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -0
  676. package/lib/typescript/RNGestureHandlerModule.web.d.ts.map +1 -0
  677. package/lib/typescript/RNGestureHandlerModule.windows.d.ts +1 -0
  678. package/lib/typescript/RNGestureHandlerModule.windows.d.ts.map +1 -0
  679. package/lib/typescript/RNRenderer.d.ts +1 -0
  680. package/lib/typescript/RNRenderer.d.ts.map +1 -0
  681. package/lib/typescript/RNRenderer.web.d.ts +1 -0
  682. package/lib/typescript/RNRenderer.web.d.ts.map +1 -0
  683. package/lib/typescript/State.d.ts +1 -0
  684. package/lib/typescript/State.d.ts.map +1 -0
  685. package/lib/typescript/TouchEventType.d.ts +1 -0
  686. package/lib/typescript/TouchEventType.d.ts.map +1 -0
  687. package/lib/typescript/components/DrawerLayout.d.ts +1 -0
  688. package/lib/typescript/components/DrawerLayout.d.ts.map +1 -0
  689. package/lib/typescript/components/GestureButtons.d.ts +1 -0
  690. package/lib/typescript/components/GestureButtons.d.ts.map +1 -0
  691. package/lib/typescript/components/GestureButtonsProps.d.ts +1 -0
  692. package/lib/typescript/components/GestureButtonsProps.d.ts.map +1 -0
  693. package/lib/typescript/components/GestureComponents.d.ts +4 -3
  694. package/lib/typescript/components/GestureComponents.d.ts.map +1 -0
  695. package/lib/typescript/components/GestureComponents.web.d.ts +1 -0
  696. package/lib/typescript/components/GestureComponents.web.d.ts.map +1 -0
  697. package/lib/typescript/components/GestureHandlerButton.d.ts +1 -0
  698. package/lib/typescript/components/GestureHandlerButton.d.ts.map +1 -0
  699. package/lib/typescript/components/GestureHandlerButton.web.d.ts +1 -0
  700. package/lib/typescript/components/GestureHandlerButton.web.d.ts.map +1 -0
  701. package/lib/typescript/components/GestureHandlerRootView.android.d.ts +1 -0
  702. package/lib/typescript/components/GestureHandlerRootView.android.d.ts.map +1 -0
  703. package/lib/typescript/components/GestureHandlerRootView.d.ts +1 -0
  704. package/lib/typescript/components/GestureHandlerRootView.d.ts.map +1 -0
  705. package/lib/typescript/components/GestureHandlerRootView.web.d.ts +1 -0
  706. package/lib/typescript/components/GestureHandlerRootView.web.d.ts.map +1 -0
  707. package/lib/typescript/components/Pressable/Pressable.d.ts +1 -0
  708. package/lib/typescript/components/Pressable/Pressable.d.ts.map +1 -0
  709. package/lib/typescript/components/Pressable/PressableProps.d.ts +17 -1
  710. package/lib/typescript/components/Pressable/PressableProps.d.ts.map +1 -0
  711. package/lib/typescript/components/Pressable/index.d.ts +1 -0
  712. package/lib/typescript/components/Pressable/index.d.ts.map +1 -0
  713. package/lib/typescript/components/Pressable/utils.d.ts +1 -0
  714. package/lib/typescript/components/Pressable/utils.d.ts.map +1 -0
  715. package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +1 -0
  716. package/lib/typescript/components/ReanimatedDrawerLayout.d.ts.map +1 -0
  717. package/lib/typescript/components/ReanimatedSwipeable.d.ts +13 -2
  718. package/lib/typescript/components/ReanimatedSwipeable.d.ts.map +1 -0
  719. package/lib/typescript/components/Swipeable.d.ts +1 -0
  720. package/lib/typescript/components/Swipeable.d.ts.map +1 -0
  721. package/lib/typescript/components/Text.d.ts +1 -0
  722. package/lib/typescript/components/Text.d.ts.map +1 -0
  723. package/lib/typescript/components/gestureHandlerRootHOC.d.ts +1 -0
  724. package/lib/typescript/components/gestureHandlerRootHOC.d.ts.map +1 -0
  725. package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +1 -0
  726. package/lib/typescript/components/touchables/ExtraButtonProps.d.ts.map +1 -0
  727. package/lib/typescript/components/touchables/GenericTouchable.d.ts +1 -0
  728. package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +1 -0
  729. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +1 -0
  730. package/lib/typescript/components/touchables/GenericTouchableProps.d.ts.map +1 -0
  731. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -0
  732. package/lib/typescript/components/touchables/TouchableHighlight.d.ts.map +1 -0
  733. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +1 -0
  734. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts.map +1 -0
  735. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -0
  736. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts.map +1 -0
  737. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +1 -0
  738. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts.map +1 -0
  739. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +1 -0
  740. package/lib/typescript/components/touchables/TouchableOpacity.d.ts.map +1 -0
  741. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -1
  742. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts.map +1 -0
  743. package/lib/typescript/components/touchables/index.d.ts +1 -0
  744. package/lib/typescript/components/touchables/index.d.ts.map +1 -0
  745. package/lib/typescript/components/utils.d.ts +5 -0
  746. package/lib/typescript/components/utils.d.ts.map +1 -0
  747. package/lib/typescript/findNodeHandle.d.ts +1 -0
  748. package/lib/typescript/findNodeHandle.d.ts.map +1 -0
  749. package/lib/typescript/findNodeHandle.web.d.ts +1 -0
  750. package/lib/typescript/findNodeHandle.web.d.ts.map +1 -0
  751. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
  752. package/lib/typescript/getShadowNodeFromRef.d.ts.map +1 -0
  753. package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
  754. package/lib/typescript/getShadowNodeFromRef.web.d.ts.map +1 -0
  755. package/lib/typescript/ghQueueMicrotask.d.ts +1 -0
  756. package/lib/typescript/ghQueueMicrotask.d.ts.map +1 -0
  757. package/lib/typescript/handlers/FlingGestureHandler.d.ts +1 -1
  758. package/lib/typescript/handlers/FlingGestureHandler.d.ts.map +1 -0
  759. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +1 -0
  760. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts.map +1 -0
  761. package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +1 -0
  762. package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts.map +1 -0
  763. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +1 -1
  764. package/lib/typescript/handlers/LongPressGestureHandler.d.ts.map +1 -0
  765. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  766. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts.map +1 -0
  767. package/lib/typescript/handlers/PanGestureHandler.d.ts +1 -1
  768. package/lib/typescript/handlers/PanGestureHandler.d.ts.map +1 -0
  769. package/lib/typescript/handlers/PinchGestureHandler.d.ts +1 -1
  770. package/lib/typescript/handlers/PinchGestureHandler.d.ts.map +1 -0
  771. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
  772. package/lib/typescript/handlers/PressabilityDebugView.d.ts.map +1 -0
  773. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
  774. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts.map +1 -0
  775. package/lib/typescript/handlers/RotationGestureHandler.d.ts +1 -1
  776. package/lib/typescript/handlers/RotationGestureHandler.d.ts.map +1 -0
  777. package/lib/typescript/handlers/TapGestureHandler.d.ts +1 -1
  778. package/lib/typescript/handlers/TapGestureHandler.d.ts.map +1 -0
  779. package/lib/typescript/handlers/createHandler.d.ts +1 -0
  780. package/lib/typescript/handlers/createHandler.d.ts.map +1 -0
  781. package/lib/typescript/handlers/createNativeWrapper.d.ts +1 -0
  782. package/lib/typescript/handlers/createNativeWrapper.d.ts.map +1 -0
  783. package/lib/typescript/handlers/customDirectEventTypes.d.ts +1 -0
  784. package/lib/typescript/handlers/customDirectEventTypes.d.ts.map +1 -0
  785. package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +1 -0
  786. package/lib/typescript/handlers/customDirectEventTypes.web.d.ts.map +1 -0
  787. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +1 -0
  788. package/lib/typescript/handlers/gestureHandlerCommon.d.ts.map +1 -0
  789. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +1 -0
  790. package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts.map +1 -0
  791. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts +1 -0
  792. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts.map +1 -0
  793. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts +3 -2
  794. package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts.map +1 -0
  795. package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts +1 -0
  796. package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts.map +1 -0
  797. package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts +1 -0
  798. package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts.map +1 -0
  799. package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts +1 -0
  800. package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts.map +1 -0
  801. package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts +1 -0
  802. package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts.map +1 -0
  803. package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +1 -1
  804. package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts.map +1 -0
  805. package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts +1 -0
  806. package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts.map +1 -0
  807. package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts +1 -0
  808. package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts.map +1 -0
  809. package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts +1 -0
  810. package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts.map +1 -0
  811. package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts +1 -0
  812. package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts.map +1 -0
  813. package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts +1 -0
  814. package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts.map +1 -0
  815. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
  816. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts.map +1 -0
  817. package/lib/typescript/handlers/gestures/eventReceiver.d.ts +1 -0
  818. package/lib/typescript/handlers/gestures/eventReceiver.d.ts.map +1 -0
  819. package/lib/typescript/handlers/gestures/flingGesture.d.ts +1 -0
  820. package/lib/typescript/handlers/gestures/flingGesture.d.ts.map +1 -0
  821. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +1 -0
  822. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts.map +1 -0
  823. package/lib/typescript/handlers/gestures/gesture.d.ts +1 -1
  824. package/lib/typescript/handlers/gestures/gesture.d.ts.map +1 -0
  825. package/lib/typescript/handlers/gestures/gestureComposition.d.ts +1 -0
  826. package/lib/typescript/handlers/gestures/gestureComposition.d.ts.map +1 -0
  827. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +1 -0
  828. package/lib/typescript/handlers/gestures/gestureObjects.d.ts.map +1 -0
  829. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +1 -0
  830. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts.map +1 -0
  831. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +1 -0
  832. package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts.map +1 -0
  833. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +1 -0
  834. package/lib/typescript/handlers/gestures/hoverGesture.d.ts.map +1 -0
  835. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +1 -0
  836. package/lib/typescript/handlers/gestures/longPressGesture.d.ts.map +1 -0
  837. package/lib/typescript/handlers/gestures/manualGesture.d.ts +1 -0
  838. package/lib/typescript/handlers/gestures/manualGesture.d.ts.map +1 -0
  839. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +1 -0
  840. package/lib/typescript/handlers/gestures/nativeGesture.d.ts.map +1 -0
  841. package/lib/typescript/handlers/gestures/panGesture.d.ts +1 -0
  842. package/lib/typescript/handlers/gestures/panGesture.d.ts.map +1 -0
  843. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +1 -0
  844. package/lib/typescript/handlers/gestures/pinchGesture.d.ts.map +1 -0
  845. package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +1 -0
  846. package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts.map +1 -0
  847. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +1 -0
  848. package/lib/typescript/handlers/gestures/rotationGesture.d.ts.map +1 -0
  849. package/lib/typescript/handlers/gestures/tapGesture.d.ts +1 -0
  850. package/lib/typescript/handlers/gestures/tapGesture.d.ts.map +1 -0
  851. package/lib/typescript/handlers/getNextHandlerTag.d.ts +1 -0
  852. package/lib/typescript/handlers/getNextHandlerTag.d.ts.map +1 -0
  853. package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
  854. package/lib/typescript/handlers/handlersRegistry.d.ts.map +1 -0
  855. package/lib/typescript/handlers/utils.d.ts +1 -0
  856. package/lib/typescript/handlers/utils.d.ts.map +1 -0
  857. package/lib/typescript/index.d.ts +1 -0
  858. package/lib/typescript/index.d.ts.map +1 -0
  859. package/lib/typescript/init.d.ts +1 -0
  860. package/lib/typescript/init.d.ts.map +1 -0
  861. package/lib/typescript/jestUtils/index.d.ts +1 -0
  862. package/lib/typescript/jestUtils/index.d.ts.map +1 -0
  863. package/lib/typescript/jestUtils/jestUtils.d.ts +1 -1
  864. package/lib/typescript/jestUtils/jestUtils.d.ts.map +1 -0
  865. package/lib/typescript/mocks.d.ts +1 -0
  866. package/lib/typescript/mocks.d.ts.map +1 -0
  867. package/lib/typescript/mountRegistry.d.ts +1 -1
  868. package/lib/typescript/mountRegistry.d.ts.map +1 -0
  869. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +1 -0
  870. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts.map +1 -0
  871. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +1 -1
  872. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts.map +1 -0
  873. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +1 -1
  874. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts.map +1 -0
  875. package/lib/typescript/typeUtils.d.ts +1 -0
  876. package/lib/typescript/typeUtils.d.ts.map +1 -0
  877. package/lib/typescript/utils.d.ts +1 -0
  878. package/lib/typescript/utils.d.ts.map +1 -0
  879. package/lib/typescript/web/Gestures.d.ts +1 -0
  880. package/lib/typescript/web/Gestures.d.ts.map +1 -0
  881. package/lib/typescript/web/constants.d.ts +1 -0
  882. package/lib/typescript/web/constants.d.ts.map +1 -0
  883. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +1 -0
  884. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts.map +1 -0
  885. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +1 -0
  886. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts.map +1 -0
  887. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +1 -0
  888. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts.map +1 -0
  889. package/lib/typescript/web/handlers/GestureHandler.d.ts +1 -1
  890. package/lib/typescript/web/handlers/GestureHandler.d.ts.map +1 -0
  891. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +1 -0
  892. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts.map +1 -0
  893. package/lib/typescript/web/handlers/IGestureHandler.d.ts +1 -0
  894. package/lib/typescript/web/handlers/IGestureHandler.d.ts.map +1 -0
  895. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +1 -1
  896. package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts.map +1 -0
  897. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +1 -0
  898. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts.map +1 -0
  899. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -1
  900. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts.map +1 -0
  901. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +1 -0
  902. package/lib/typescript/web/handlers/PanGestureHandler.d.ts.map +1 -0
  903. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +1 -1
  904. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts.map +1 -0
  905. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +1 -1
  906. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts.map +1 -0
  907. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +1 -0
  908. package/lib/typescript/web/handlers/TapGestureHandler.d.ts.map +1 -0
  909. package/lib/typescript/web/interfaces.d.ts +1 -0
  910. package/lib/typescript/web/interfaces.d.ts.map +1 -0
  911. package/lib/typescript/web/tools/CircularBuffer.d.ts +1 -0
  912. package/lib/typescript/web/tools/CircularBuffer.d.ts.map +1 -0
  913. package/lib/typescript/web/tools/EventManager.d.ts +1 -0
  914. package/lib/typescript/web/tools/EventManager.d.ts.map +1 -0
  915. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -0
  916. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts.map +1 -0
  917. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +1 -0
  918. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts.map +1 -0
  919. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +1 -0
  920. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts.map +1 -0
  921. package/lib/typescript/web/tools/InteractionManager.d.ts +1 -0
  922. package/lib/typescript/web/tools/InteractionManager.d.ts.map +1 -0
  923. package/lib/typescript/web/tools/KeyboardEventManager.d.ts +1 -0
  924. package/lib/typescript/web/tools/KeyboardEventManager.d.ts.map +1 -0
  925. package/lib/typescript/web/tools/LeastSquareSolver.d.ts +1 -0
  926. package/lib/typescript/web/tools/LeastSquareSolver.d.ts.map +1 -0
  927. package/lib/typescript/web/tools/NodeManager.d.ts +1 -0
  928. package/lib/typescript/web/tools/NodeManager.d.ts.map +1 -0
  929. package/lib/typescript/web/tools/PointerEventManager.d.ts +1 -0
  930. package/lib/typescript/web/tools/PointerEventManager.d.ts.map +1 -0
  931. package/lib/typescript/web/tools/PointerTracker.d.ts +1 -0
  932. package/lib/typescript/web/tools/PointerTracker.d.ts.map +1 -0
  933. package/lib/typescript/web/tools/Vector.d.ts +1 -0
  934. package/lib/typescript/web/tools/Vector.d.ts.map +1 -0
  935. package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -0
  936. package/lib/typescript/web/tools/VelocityTracker.d.ts.map +1 -0
  937. package/lib/typescript/web/tools/WheelEventManager.d.ts +1 -0
  938. package/lib/typescript/web/tools/WheelEventManager.d.ts.map +1 -0
  939. package/lib/typescript/web/utils.d.ts +1 -0
  940. package/lib/typescript/web/utils.d.ts.map +1 -0
  941. package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +1 -0
  942. package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts.map +1 -0
  943. package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +1 -0
  944. package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts.map +1 -0
  945. package/lib/typescript/web_hammer/Errors.d.ts +1 -0
  946. package/lib/typescript/web_hammer/Errors.d.ts.map +1 -0
  947. package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +1 -0
  948. package/lib/typescript/web_hammer/FlingGestureHandler.d.ts.map +1 -0
  949. package/lib/typescript/web_hammer/GestureHandler.d.ts +1 -0
  950. package/lib/typescript/web_hammer/GestureHandler.d.ts.map +1 -0
  951. package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +1 -0
  952. package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts.map +1 -0
  953. package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +1 -0
  954. package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts.map +1 -0
  955. package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +1 -0
  956. package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts.map +1 -0
  957. package/lib/typescript/web_hammer/NodeManager.d.ts +1 -0
  958. package/lib/typescript/web_hammer/NodeManager.d.ts.map +1 -0
  959. package/lib/typescript/web_hammer/PanGestureHandler.d.ts +1 -0
  960. package/lib/typescript/web_hammer/PanGestureHandler.d.ts.map +1 -0
  961. package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +1 -0
  962. package/lib/typescript/web_hammer/PinchGestureHandler.d.ts.map +1 -0
  963. package/lib/typescript/web_hammer/PressGestureHandler.d.ts +1 -0
  964. package/lib/typescript/web_hammer/PressGestureHandler.d.ts.map +1 -0
  965. package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +1 -0
  966. package/lib/typescript/web_hammer/RotationGestureHandler.d.ts.map +1 -0
  967. package/lib/typescript/web_hammer/TapGestureHandler.d.ts +1 -0
  968. package/lib/typescript/web_hammer/TapGestureHandler.d.ts.map +1 -0
  969. package/lib/typescript/web_hammer/constants.d.ts +1 -0
  970. package/lib/typescript/web_hammer/constants.d.ts.map +1 -0
  971. package/lib/typescript/web_hammer/utils.d.ts +1 -0
  972. package/lib/typescript/web_hammer/utils.d.ts.map +1 -0
  973. package/package.json +27 -47
  974. package/src/components/DrawerLayout.tsx +5 -2
  975. package/src/components/GestureButtons.tsx +2 -2
  976. package/src/components/GestureComponents.web.tsx +1 -1
  977. package/src/components/GestureHandlerButton.web.tsx +3 -3
  978. package/src/components/Pressable/Pressable.tsx +34 -9
  979. package/src/components/Pressable/PressableProps.tsx +19 -0
  980. package/src/components/ReanimatedSwipeable.tsx +55 -33
  981. package/src/components/Swipeable.tsx +3 -0
  982. package/src/components/Text.tsx +5 -2
  983. package/src/components/utils.ts +26 -0
  984. package/src/getShadowNodeFromRef.ts +2 -2
  985. package/src/handlers/createHandler.tsx +1 -0
  986. package/src/handlers/gestures/reanimatedWrapper.ts +0 -1
  987. package/src/handlers/utils.ts +1 -1
  988. package/src/utils.ts +0 -1
  989. package/src/web_hammer/DiscreteGestureHandler.ts +1 -1
  990. package/src/web_hammer/DraggingGestureHandler.ts +1 -1
  991. package/src/web_hammer/FlingGestureHandler.ts +1 -1
  992. package/src/web_hammer/GestureHandler.ts +2 -1
  993. package/src/web_hammer/LongPressGestureHandler.ts +1 -1
  994. package/README.md +0 -71
  995. package/android/packageDeprecated/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +0 -85
  996. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -60
  997. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -26
  998. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -26
  999. package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -16
  1000. package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +0 -67
  1001. package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -13
  1002. package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -35
  1003. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
  1004. package/lib/commonjs/handlers/gestures/nativeGesture.js +0 -44
  1005. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +0 -1
  1006. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +0 -13
  1007. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +0 -1
  1008. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +0 -15
  1009. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
  1010. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +0 -15
  1011. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
  1012. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -189
  1013. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +0 -1
  1014. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +0 -66
  1015. package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +0 -1
  1016. package/lib/module/handlers/NativeViewGestureHandler.js +0 -19
  1017. package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
  1018. package/lib/module/handlers/gestures/nativeGesture.js.map +0 -1
  1019. package/lib/module/specs/NativeRNGestureHandlerModule.js +0 -3
  1020. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +0 -1
  1021. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +0 -3
  1022. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
  1023. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +0 -3
  1024. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
  1025. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +0 -1
  1026. package/lib/module/web_hammer/NativeViewGestureHandler.js +0 -49
  1027. package/lib/module/web_hammer/NativeViewGestureHandler.js.map +0 -1
  1028. /package/android/{common → noreanimated}/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +0 -0
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  import { isFabric, tagMessage } from '../../../utils';
2
4
  import { getShadowNodeFromRef } from '../../../getShadowNodeFromRef';
3
5
  import { useCallback } from 'react';
@@ -10,22 +12,20 @@ export function useViewRefHandler(state, updateAttachedGestures) {
10
12
  if (ref === null) {
11
13
  return;
12
14
  }
15
+ state.viewRef = ref;
13
16
 
14
- state.viewRef = ref; // if it's the first render, also set the previousViewTag to prevent reattaching gestures when not needed
15
-
17
+ // if it's the first render, also set the previousViewTag to prevent reattaching gestures when not needed
16
18
  if (state.previousViewTag === -1) {
17
19
  state.previousViewTag = findNodeHandle(state.viewRef);
18
- } // Pass true as `skipConfigUpdate`. Here we only want to trigger the eventual reattaching of handlers
19
- // in case the view has changed. If the view doesn't change, the update will be handled by detector.
20
-
20
+ }
21
21
 
22
+ // Pass true as `skipConfigUpdate`. Here we only want to trigger the eventual reattaching of handlers
23
+ // in case the view has changed. If the view doesn't change, the update will be handled by detector.
22
24
  if (!state.firstRender) {
23
25
  updateAttachedGestures(true);
24
26
  }
25
-
26
27
  if (__DEV__ && isFabric() && global.isViewFlatteningDisabled) {
27
28
  const node = getShadowNodeFromRef(ref);
28
-
29
29
  if (global.isViewFlatteningDisabled(node) === false) {
30
30
  console.error(tagMessage('GestureDetector has received a child that may get view-flattened. ' + '\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'));
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useViewRefHandler.ts"],"names":["isFabric","tagMessage","getShadowNodeFromRef","useCallback","findNodeHandle","useViewRefHandler","state","updateAttachedGestures","refHandler","ref","viewRef","previousViewTag","firstRender","__DEV__","global","isViewFlatteningDisabled","node","console","error"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,UAAnB,QAAqC,gBAArC;AACA,SAASC,oBAAT,QAAqC,+BAArC;AAGA,SAAgBC,WAAhB,QAAmC,OAAnC;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AAMA;AACA;AACA;AACA,OAAO,SAASC,iBAAT,CACLC,KADK,EAELC,sBAFK,EAGL;AACA,QAAMC,UAAU,GAAGL,WAAW,CAC3BM,GAAD,IAAiC;AAC/B,QAAIA,GAAG,KAAK,IAAZ,EAAkB;AAChB;AACD;;AAEDH,IAAAA,KAAK,CAACI,OAAN,GAAgBD,GAAhB,CAL+B,CAO/B;;AACA,QAAIH,KAAK,CAACK,eAAN,KAA0B,CAAC,CAA/B,EAAkC;AAChCL,MAAAA,KAAK,CAACK,eAAN,GAAwBP,cAAc,CAACE,KAAK,CAACI,OAAP,CAAtC;AACD,KAV8B,CAY/B;AACA;;;AACA,QAAI,CAACJ,KAAK,CAACM,WAAX,EAAwB;AACtBL,MAAAA,sBAAsB,CAAC,IAAD,CAAtB;AACD;;AAED,QAAIM,OAAO,IAAIb,QAAQ,EAAnB,IAAyBc,MAAM,CAACC,wBAApC,EAA8D;AAC5D,YAAMC,IAAI,GAAGd,oBAAoB,CAACO,GAAD,CAAjC;;AACA,UAAIK,MAAM,CAACC,wBAAP,CAAgCC,IAAhC,MAA0C,KAA9C,EAAqD;AACnDC,QAAAA,OAAO,CAACC,KAAR,CACEjB,UAAU,CACR,uEACE,kGAFM,CADZ;AAMD;AACF;AACF,GA9B2B,EA+B5B,CAACK,KAAD,EAAQC,sBAAR,CA/B4B,CAA9B;AAkCA,SAAOC,UAAP;AACD","sourcesContent":["import { isFabric, tagMessage } from '../../../utils';\nimport { getShadowNodeFromRef } from '../../../getShadowNodeFromRef';\n\nimport { GestureDetectorState } from './types';\nimport React, { useCallback } from 'react';\nimport findNodeHandle from '../../../findNodeHandle';\n\ndeclare const global: {\n isViewFlatteningDisabled: (node: unknown) => boolean | null; // JSI function\n};\n\n// Ref handler for the Wrap component attached under the GestureDetector.\n// It's responsible for setting the viewRef on the state and triggering the reattaching of handlers\n// if the view has changed.\nexport function useViewRefHandler(\n state: GestureDetectorState,\n updateAttachedGestures: (skipConfigUpdate?: boolean) => void\n) {\n const refHandler = useCallback(\n (ref: React.Component | null) => {\n if (ref === null) {\n return;\n }\n\n state.viewRef = ref;\n\n // if it's the first render, also set the previousViewTag to prevent reattaching gestures when not needed\n if (state.previousViewTag === -1) {\n state.previousViewTag = findNodeHandle(state.viewRef) as number;\n }\n\n // Pass true as `skipConfigUpdate`. Here we only want to trigger the eventual reattaching of handlers\n // in case the view has changed. If the view doesn't change, the update will be handled by detector.\n if (!state.firstRender) {\n updateAttachedGestures(true);\n }\n\n if (__DEV__ && isFabric() && global.isViewFlatteningDisabled) {\n const node = getShadowNodeFromRef(ref);\n if (global.isViewFlatteningDisabled(node) === false) {\n console.error(\n tagMessage(\n 'GestureDetector has received a child that may get view-flattened. ' +\n '\\nTo prevent it from misbehaving you need to wrap the child with a `<View collapsable={false}>`.'\n )\n );\n }\n }\n },\n [state, updateAttachedGestures]\n );\n\n return refHandler;\n}\n"]}
1
+ {"version":3,"names":["isFabric","tagMessage","getShadowNodeFromRef","useCallback","findNodeHandle","useViewRefHandler","state","updateAttachedGestures","refHandler","ref","viewRef","previousViewTag","firstRender","__DEV__","global","isViewFlatteningDisabled","node","console","error"],"sourceRoot":"../../../../../src","sources":["handlers/gestures/GestureDetector/useViewRefHandler.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,gBAAgB;AACrD,SAASC,oBAAoB,QAAQ,+BAA+B;AAGpE,SAAgBC,WAAW,QAAQ,OAAO;AAC1C,OAAOC,cAAc,MAAM,yBAAyB;AAMpD;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,KAA2B,EAC3BC,sBAA4D,EAC5D;EACA,MAAMC,UAAU,GAAGL,WAAW,CAC3BM,GAA2B,IAAK;IAC/B,IAAIA,GAAG,KAAK,IAAI,EAAE;MAChB;IACF;IAEAH,KAAK,CAACI,OAAO,GAAGD,GAAG;;IAEnB;IACA,IAAIH,KAAK,CAACK,eAAe,KAAK,CAAC,CAAC,EAAE;MAChCL,KAAK,CAACK,eAAe,GAAGP,cAAc,CAACE,KAAK,CAACI,OAAO,CAAW;IACjE;;IAEA;IACA;IACA,IAAI,CAACJ,KAAK,CAACM,WAAW,EAAE;MACtBL,sBAAsB,CAAC,IAAI,CAAC;IAC9B;IAEA,IAAIM,OAAO,IAAIb,QAAQ,CAAC,CAAC,IAAIc,MAAM,CAACC,wBAAwB,EAAE;MAC5D,MAAMC,IAAI,GAAGd,oBAAoB,CAACO,GAAG,CAAC;MACtC,IAAIK,MAAM,CAACC,wBAAwB,CAACC,IAAI,CAAC,KAAK,KAAK,EAAE;QACnDC,OAAO,CAACC,KAAK,CACXjB,UAAU,CACR,oEAAoE,GAClE,kGACJ,CACF,CAAC;MACH;IACF;EACF,CAAC,EACD,CAACK,KAAK,EAAEC,sBAAsB,CAChC,CAAC;EAED,OAAOC,UAAU;AACnB","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  import { Platform } from 'react-native';
2
4
  import { isTestEnv, tagMessage } from '../../../utils';
3
5
  import { BaseGesture } from '../gesture';
@@ -15,27 +17,20 @@ import { useCallback, useRef, useState } from 'react';
15
17
  import { Reanimated } from '../reanimatedWrapper';
16
18
  import { onGestureHandlerEvent } from '../eventReceiver';
17
19
  export const ALLOWED_PROPS = [...baseGestureHandlerWithDetectorProps, ...tapGestureHandlerProps, ...panGestureHandlerProps, ...panGestureHandlerCustomNativeProps, ...longPressGestureHandlerProps, ...forceTouchGestureHandlerProps, ...flingGestureHandlerProps, ...hoverGestureHandlerProps, ...nativeViewGestureHandlerProps];
18
-
19
20
  function convertToHandlerTag(ref) {
20
21
  if (typeof ref === 'number') {
21
22
  return ref;
22
23
  } else if (ref instanceof BaseGesture) {
23
24
  return ref.handlerTag;
24
25
  } else {
25
- var _ref$current$handlerT, _ref$current;
26
-
27
26
  // @ts-ignore in this case it should be a ref either to gesture object or
28
27
  // a gesture handler component, in both cases handlerTag property exists
29
- return (_ref$current$handlerT = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.handlerTag) !== null && _ref$current$handlerT !== void 0 ? _ref$current$handlerT : -1;
28
+ return ref.current?.handlerTag ?? -1;
30
29
  }
31
30
  }
32
-
33
31
  function extractValidHandlerTags(interactionGroup) {
34
- var _interactionGroup$map, _interactionGroup$map2;
35
-
36
- return (_interactionGroup$map = interactionGroup === null || interactionGroup === void 0 ? void 0 : (_interactionGroup$map2 = interactionGroup.map(convertToHandlerTag)) === null || _interactionGroup$map2 === void 0 ? void 0 : _interactionGroup$map2.filter(tag => tag > 0)) !== null && _interactionGroup$map !== void 0 ? _interactionGroup$map : [];
32
+ return interactionGroup?.map(convertToHandlerTag)?.filter(tag => tag > 0) ?? [];
37
33
  }
38
-
39
34
  export function extractGestureRelations(gesture) {
40
35
  const requireToFail = extractValidHandlerTags(gesture.config.requireToFail);
41
36
  const simultaneousWith = extractValidHandlerTags(gesture.config.simultaneousWith);
@@ -49,35 +44,33 @@ export function extractGestureRelations(gesture) {
49
44
  export function checkGestureCallbacksForWorklets(gesture) {
50
45
  if (!__DEV__) {
51
46
  return;
52
- } // If a gesture is explicitly marked to run on the JS thread there is no need to check
47
+ }
48
+ // If a gesture is explicitly marked to run on the JS thread there is no need to check
53
49
  // if callbacks are worklets as the user is aware they will be ran on the JS thread
54
-
55
-
56
50
  if (gesture.config.runOnJS) {
57
51
  return;
58
52
  }
59
-
60
53
  const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);
61
- const areSomeWorklets = gesture.handlers.isWorklet.includes(true); // If some of the callbacks are worklets and some are not, and the gesture is not
62
- // explicitly marked with `.runOnJS(true)` show an error
54
+ const areSomeWorklets = gesture.handlers.isWorklet.includes(true);
63
55
 
56
+ // If some of the callbacks are worklets and some are not, and the gesture is not
57
+ // explicitly marked with `.runOnJS(true)` show an error
64
58
  if (areSomeNotWorklets && areSomeWorklets) {
65
59
  console.error(tagMessage(`Some of the callbacks in the gesture are worklets and some are not. Either make sure that all calbacks are marked as 'worklet' if you wish to run them on the UI thread or use '.runOnJS(true)' modifier on the gesture explicitly to run all callbacks on the JS thread.`));
66
60
  }
67
-
68
61
  if (Reanimated === undefined) {
69
62
  // If Reanimated is not available, we can't run worklets, so we shouldn't show the warning
70
63
  return;
71
64
  }
72
-
73
- const areAllNotWorklets = !areSomeWorklets && areSomeNotWorklets; // If none of the callbacks are worklets and the gesture is not explicitly marked with
65
+ const areAllNotWorklets = !areSomeWorklets && areSomeNotWorklets;
66
+ // If none of the callbacks are worklets and the gesture is not explicitly marked with
74
67
  // `.runOnJS(true)` show a warning
75
-
76
68
  if (areAllNotWorklets && !isTestEnv()) {
77
69
  console.warn(tagMessage(`None of the callbacks in the gesture are worklets. If you wish to run them on the JS thread use '.runOnJS(true)' modifier on the gesture to make this explicit. Otherwise, mark the callbacks as 'worklet' to run them on the UI thread.`));
78
70
  }
79
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
+ }
80
72
 
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
74
  export function validateDetectorChildren(ref) {
82
75
  // Finds the first native view under the Wrap component and traverses the fiber tree upwards
83
76
  // to check whether there is more than one native view as a pseudo-direct child of GestureDetector
@@ -102,19 +95,21 @@ export function validateDetectorChildren(ref) {
102
95
  // NativeView NativeView
103
96
  if (__DEV__ && Platform.OS !== 'web') {
104
97
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
105
- const wrapType = // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
106
- ref._reactInternals.elementType; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
107
-
108
- let instance = RNRenderer.findHostInstance_DEPRECATED(ref)._internalFiberInstanceHandleDEV; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
98
+ const wrapType =
99
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
100
+ ref._reactInternals.elementType;
109
101
 
102
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
103
+ let instance = RNRenderer.findHostInstance_DEPRECATED(ref)._internalFiberInstanceHandleDEV;
110
104
 
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
111
106
  while (instance && instance.elementType !== wrapType) {
112
107
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
113
108
  if (instance.sibling) {
114
109
  throw new Error('GestureDetector has more than one native view as its children. This can happen if you are using a custom component that renders multiple views, like React.Fragment. You should wrap content of GestureDetector with a <View> or <Animated.View>.');
115
- } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
116
-
110
+ }
117
111
 
112
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
118
113
  instance = instance.return;
119
114
  }
120
115
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["Platform","isTestEnv","tagMessage","BaseGesture","flingGestureHandlerProps","forceTouchGestureHandlerProps","longPressGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","tapGestureHandlerProps","hoverGestureHandlerProps","nativeViewGestureHandlerProps","baseGestureHandlerWithDetectorProps","isNewWebImplementationEnabled","RNRenderer","useCallback","useRef","useState","Reanimated","onGestureHandlerEvent","ALLOWED_PROPS","convertToHandlerTag","ref","handlerTag","current","extractValidHandlerTags","interactionGroup","map","filter","tag","extractGestureRelations","gesture","requireToFail","config","simultaneousWith","blocksHandlers","waitFor","simultaneousHandlers","checkGestureCallbacksForWorklets","__DEV__","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","undefined","areAllNotWorklets","warn","validateDetectorChildren","OS","wrapType","_reactInternals","elementType","instance","findHostInstance_DEPRECATED","_internalFiberInstanceHandleDEV","sibling","Error","return","useForceRender","renderState","setRenderState","forceRender","useWebEventHandlers","e","nativeEvent","onGestureHandlerStateChange"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,SAASC,SAAT,EAAoBC,UAApB,QAAsC,gBAAtC;AACA,SAAqBC,WAArB,QAAqD,YAArD;AAEA,SAASC,wBAAT,QAAyC,2BAAzC;AACA,SAASC,6BAAT,QAA8C,gCAA9C;AACA,SAASC,4BAAT,QAA6C,+BAA7C;AACA,SACEC,sBADF,EAEEC,kCAFF,QAGO,yBAHP;AAIA,SAASC,sBAAT,QAAuC,yBAAvC;AACA,SAASC,wBAAT,QAAyC,iBAAzC;AACA,SAASC,6BAAT,QAA8C,gCAA9C;AACA,SAEEC,mCAFF,QAGO,4BAHP;AAIA,SAASC,6BAAT,QAA8C,qCAA9C;AACA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,WAAT,EAAsBC,MAAtB,EAA8BC,QAA9B,QAA8C,OAA9C;AACA,SAASC,UAAT,QAA2B,sBAA3B;AACA,SAASC,qBAAT,QAAsC,kBAAtC;AAGA,OAAO,MAAMC,aAAa,GAAG,CAC3B,GAAGR,mCADwB,EAE3B,GAAGH,sBAFwB,EAG3B,GAAGF,sBAHwB,EAI3B,GAAGC,kCAJwB,EAK3B,GAAGF,4BALwB,EAM3B,GAAGD,6BANwB,EAO3B,GAAGD,wBAPwB,EAQ3B,GAAGM,w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AAM,CAACC,WAAD,EAAcC,cAAd,IAAgC/C,QAAQ,CAAC,KAAD,CAA9C;AACA,QAAMgD,WAAW,GAAGlD,WAAW,CAAC,MAAM;AACpCiD,IAAAA,cAAc,CAAC,CAACD,WAAF,CAAd;AACD,GAF8B,EAE5B,CAACA,WAAD,EAAcC,cAAd,CAF4B,CAA/B;AAIA,SAAOC,WAAP;AACD;AAED,OAAO,SAASC,mBAAT,GAA+B;AACpC,SAAOlD,MAAM,CAAkB;AAC7BG,IAAAA,qBAAqB,EAAGgD,CAAD,IAAyC;AAC9DhD,MAAAA,qBAAqB,CAACgD,CAAC,CAACC,WAAH,CAArB;AACD,KAH4B;AAI7BC,IAAAA,2BAA2B,EAAExD,6BAA6B,KACrDsD,CAAD,IAAyC;AACvChD,MAAAA,qBAAqB,CAACgD,CAAC,CAACC,WAAH,CAArB;AACD,KAHqD,GAItDpB;AARyB,GAAlB,CAAb;AAUD","sourcesContent":["import { Platform } from 'react-native';\n\nimport { isTestEnv, tagMessage } from '../../../utils';\nimport { GestureRef, BaseGesture, GestureType } from '../gesture';\n\nimport { flingGestureHandlerProps } from '../../FlingGestureHandler';\nimport { forceTouchGestureHandlerProps } from '../../ForceTouchGestureHandler';\nimport { longPressGestureHandlerProps } from '../../LongPressGestureHandler';\nimport {\n panGestureHandlerProps,\n panGestureHandlerCustomNativeProps,\n} from '../../PanGestureHandler';\nimport { tapGestureHandlerProps } from '../../TapGestureHandler';\nimport { hoverGestureHandlerProps } from '../hoverGesture';\nimport { nativeViewGestureHandlerProps } from '../../NativeViewGestureHandler';\nimport {\n HandlerStateChangeEvent,\n baseGestureHandlerWithDetectorProps,\n} from '../../gestureHandlerCommon';\nimport { isNewWebImplementationEnabled } from '../../../EnableNewWebImplementation';\nimport { RNRenderer } from '../../../RNRenderer';\nimport { useCallback, useRef, useState } from 'react';\nimport { Reanimated } from '../reanimatedWrapper';\nimport { onGestureHandlerEvent } from '../eventReceiver';\nimport { WebEventHandler } from './types';\n\nexport const ALLOWED_PROPS = [\n ...baseGestureHandlerWithDetectorProps,\n ...tapGestureHandlerProps,\n ...panGestureHandlerProps,\n ...panGestureHandlerCustomNativeProps,\n ...longPressGestureHandlerProps,\n ...forceTouchGestureHandlerProps,\n ...flingGestureHandlerProps,\n ...hoverGestureHandlerProps,\n ...nativeViewGestureHandlerProps,\n];\n\nfunction convertToHandlerTag(ref: GestureRef): number {\n if (typeof ref === 'number') {\n return ref;\n } else if (ref instanceof BaseGesture) {\n return ref.handlerTag;\n } else {\n // @ts-ignore in this case it should be a ref either to gesture object or\n // a gesture handler component, in both cases handlerTag property exists\n return ref.current?.handlerTag ?? -1;\n }\n}\n\nfunction extractValidHandlerTags(interactionGroup: GestureRef[] | undefined) {\n return (\n interactionGroup?.map(convertToHandlerTag)?.filter((tag) => tag > 0) ?? []\n );\n}\n\nexport function extractGestureRelations(gesture: GestureType) {\n const requireToFail = extractValidHandlerTags(gesture.config.requireToFail);\n const simultaneousWith = extractValidHandlerTags(\n gesture.config.simultaneousWith\n );\n const blocksHandlers = extractValidHandlerTags(gesture.config.blocksHandlers);\n\n return {\n waitFor: requireToFail,\n simultaneousHandlers: simultaneousWith,\n blocksHandlers: blocksHandlers,\n };\n}\n\nexport function checkGestureCallbacksForWorklets(gesture: GestureType) {\n if (!__DEV__) {\n return;\n }\n // If a gesture is explicitly marked to run on the JS thread there is no need to check\n // if callbacks are worklets as the user is aware they will be ran on the JS thread\n if (gesture.config.runOnJS) {\n return;\n }\n\n const areSomeNotWorklets = gesture.handlers.isWorklet.includes(false);\n const areSomeWorklets = gesture.handlers.isWorklet.includes(true);\n\n // If some of the callbacks are worklets and some are not, and the gesture is not\n // explicitly marked with `.runOnJS(true)` show an error\n if (areSomeNotWorklets && areSomeWorklets) {\n console.error(\n tagMessage(\n `Some of the callbacks in the gesture are worklets and some are not. Either make sure that all calbacks are marked as 'worklet' if you wish to run them on the UI thread or use '.runOnJS(true)' modifier on the gesture explicitly to run all callbacks on the JS thread.`\n )\n );\n }\n\n if (Reanimated === undefined) {\n // If Reanimated is not available, we can't run worklets, so we shouldn't show the warning\n return;\n }\n\n const areAllNotWorklets = !areSomeWorklets && areSomeNotWorklets;\n // If none of the callbacks are worklets and the gesture is not explicitly marked with\n // `.runOnJS(true)` show a warning\n if (areAllNotWorklets && !isTestEnv()) {\n console.warn(\n tagMessage(\n `None of the callbacks in the gesture are worklets. If you wish to run them on the JS thread use '.runOnJS(true)' modifier on the gesture to make this explicit. Otherwise, mark the callbacks as 'worklet' to run them on the UI thread.`\n )\n );\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function validateDetectorChildren(ref: any) {\n // Finds the first native view under the Wrap component and traverses the fiber tree upwards\n // to check whether there is more than one native view as a pseudo-direct child of GestureDetector\n // i.e. this is not ok:\n // Wrap\n // |\n // / \\\n // / \\\n // / \\\n // / \\\n // NativeView NativeView\n //\n // but this is fine:\n // Wrap\n // |\n // NativeView\n // |\n // / \\\n // / \\\n // / \\\n // / \\\n // NativeView NativeView\n if (__DEV__ && Platform.OS !== 'web') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const wrapType =\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n ref._reactInternals.elementType;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let instance =\n RNRenderer.findHostInstance_DEPRECATED(\n ref\n )._internalFiberInstanceHandleDEV;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n while (instance && instance.elementType !== wrapType) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (instance.sibling) {\n throw new Error(\n 'GestureDetector has more than one native view as its children. This can happen if you are using a custom component that renders multiple views, like React.Fragment. You should wrap content of GestureDetector with a <View> or <Animated.View>.'\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n instance = instance.return;\n }\n }\n}\n\nexport function useForceRender() {\n const [renderState, setRenderState] = useState(false);\n const forceRender = useCallback(() => {\n setRenderState(!renderState);\n }, [renderState, setRenderState]);\n\n return forceRender;\n}\n\nexport function useWebEventHandlers() {\n return useRef<WebEventHandler>({\n onGestureHandlerEvent: (e: HandlerStateChangeEvent<unknown>) => {\n onGestureHandlerEvent(e.nativeEvent);\n },\n onGestureHandlerStateChange: isNewWebImplementationEnabled()\n ? (e: HandlerStateChangeEvent<unknown>) => {\n onGestureHandlerEvent(e.nativeEvent);\n }\n : undefined,\n });\n}\n"]}
1
+ {"version":3,"names":["Platform","isTestEnv","tagMessage","BaseGesture","flingGestureHandlerProps","forceTouchGestureHandlerProps","longPressGestureHandlerProps","panGestureHandlerProps","panGestureHandlerCustomNativeProps","tapGestureHandlerProps","hoverGestureHandlerProps","nativeViewGestureHandlerProps","baseGestureHandlerWithDetectorProps","isNewWebImplementationEnabled","RNRenderer","useCallback","useRef","useState","Reanimated","onGestureHandlerEvent","ALLOWED_PROPS","convertToHandlerTag","ref","handlerTag","current","extractValidHandlerTags","interactionGroup","map","filter","tag","extractGestureRelations","gesture","requireToFail","config","simultaneousWith","blocksHandlers","waitFor","simultaneousHandlers","checkGestureCallbacksForWorklets","__DEV__","runOnJS","areSomeNotWorklets","handlers","isWorklet","includes","areSomeWorklets","console","error","undefined","areAllNotWorklets","warn","validateDetectorChildren","OS","wrapType","_reactInternals","elementType","instance","findHostInstance_DEPRECATED","_internalFiberInstanceHandleDEV","sibling","Error","return","useForceRender","renderState","setRenderState","forceRender","useWebEventHandlers","e","nativeEvent","onGestureHandlerStateChange"],"sourceRoot":"../../../../../src","sources":["handlers/gestures/GestureDetector/utils.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACtD,SAAqBC,WAAW,QAAqB,YAAY;AAEjE,SAASC,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,6BAA6B,QAAQ,gCAAgC;AAC9E,SAASC,4BAA4B,QAAQ,+BAA+B;AAC5E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G,CAACgC,eAAe,CAACC,WAAW;;IAEjC;IACA,IAAIC,QAAQ,GACV1C,UAAU,CAAC2C,2BAA2B,CACpCnC,GACF,CAAC,CAACoC,+BAA+B;;IAEnC;IACA,OAAOF,QAAQ,IAAIA,QAAQ,CAACD,WAAW,KAAKF,QAAQ,EAAE;MACpD;MACA,IAAIG,QAAQ,CAACG,OAAO,EAAE;QACpB,MAAM,IAAIC,KAAK,CACb,mPACF,CAAC;MACH;;MAEA;MACAJ,QAAQ,GAAGA,QAAQ,CAACK,MAAM;IAC5B;EACF;AACF;AAEA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG/C,QAAQ,CAAC,KAAK,CAAC;EACrD,MAAMgD,WAAW,GAAGlD,WAAW,CAAC,MAAM;IACpCiD,cAAc,CAAC,CAACD,WAAW,CAAC;EAC9B,CAAC,EAAE,CAACA,WAAW,EAAEC,cAAc,CAAC,CAAC;EAEjC,OAAOC,WAAW;AACpB;AAEA,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EACpC,OAAOlD,MAAM,CAAkB;IAC7BG,qBAAqB,EAAGgD,CAAmC,IAAK;MAC9DhD,qBAAqB,CAACgD,CAAC,CAACC,WAAW,CAAC;IACtC,CAAC;IACDC,2BAA2B,EAAExD,6BAA6B,CAAC,CAAC,GACvDsD,CAAmC,IAAK;MACvChD,qBAAqB,CAACgD,CAAC,CAACC,WAAW,CAAC;IACtC,CAAC,GACDpB;EACN,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  import { DeviceEventEmitter } from 'react-native';
2
4
  import { State } from '../../State';
3
5
  import { TouchEventType } from '../../TouchEventType';
@@ -7,107 +9,75 @@ let gestureHandlerEventSubscription = null;
7
9
  let gestureHandlerStateChangeEventSubscription = null;
8
10
  const gestureStateManagers = new Map();
9
11
  const lastUpdateEvent = [];
10
-
11
12
  function isStateChangeEvent(event) {
12
13
  // @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point
13
14
  return event.oldState != null;
14
15
  }
15
-
16
16
  function isTouchEvent(event) {
17
17
  return event.eventType != null;
18
18
  }
19
-
20
19
  export function onGestureHandlerEvent(event) {
21
- var _handler$handlers7, _handler$handlers7$on, _handler$handlers8, _handler$handlers8$on, _handler$handlers9, _handler$handlers9$on, _handler$handlers10, _handler$handlers10$o;
22
-
23
20
  const handler = findHandler(event.handlerTag);
24
-
25
21
  if (handler) {
26
22
  if (isStateChangeEvent(event)) {
27
23
  if (event.oldState === State.UNDETERMINED && event.state === State.BEGAN) {
28
- var _handler$handlers$onB, _handler$handlers;
29
-
30
- (_handler$handlers$onB = (_handler$handlers = handler.handlers).onBegin) === null || _handler$handlers$onB === void 0 ? void 0 : _handler$handlers$onB.call(_handler$handlers, event);
24
+ handler.handlers.onBegin?.(event);
31
25
  } else if ((event.oldState === State.BEGAN || event.oldState === State.UNDETERMINED) && event.state === State.ACTIVE) {
32
- var _handler$handlers$onS, _handler$handlers2;
33
-
34
- (_handler$handlers$onS = (_handler$handlers2 = handler.handlers).onStart) === null || _handler$handlers$onS === void 0 ? void 0 : _handler$handlers$onS.call(_handler$handlers2, event);
26
+ handler.handlers.onStart?.(event);
35
27
  lastUpdateEvent[handler.handlers.handlerTag] = event;
36
28
  } else if (event.oldState !== event.state && event.state === State.END) {
37
- var _handler$handlers$onF, _handler$handlers4;
38
-
39
29
  if (event.oldState === State.ACTIVE) {
40
- var _handler$handlers$onE, _handler$handlers3;
41
-
42
- (_handler$handlers$onE = (_handler$handlers3 = handler.handlers).onEnd) === null || _handler$handlers$onE === void 0 ? void 0 : _handler$handlers$onE.call(_handler$handlers3, event, true);
30
+ handler.handlers.onEnd?.(event, true);
43
31
  }
44
-
45
- (_handler$handlers$onF = (_handler$handlers4 = handler.handlers).onFinalize) === null || _handler$handlers$onF === void 0 ? void 0 : _handler$handlers$onF.call(_handler$handlers4, event, true);
32
+ handler.handlers.onFinalize?.(event, true);
46
33
  lastUpdateEvent[handler.handlers.handlerTag] = undefined;
47
34
  } else if ((event.state === State.FAILED || event.state === State.CANCELLED) && event.oldState !== event.state) {
48
- var _handler$handlers$onF2, _handler$handlers6;
49
-
50
35
  if (event.oldState === State.ACTIVE) {
51
- var _handler$handlers$onE2, _handler$handlers5;
52
-
53
- (_handler$handlers$onE2 = (_handler$handlers5 = handler.handlers).onEnd) === null || _handler$handlers$onE2 === void 0 ? void 0 : _handler$handlers$onE2.call(_handler$handlers5, event, false);
36
+ handler.handlers.onEnd?.(event, false);
54
37
  }
55
-
56
- (_handler$handlers$onF2 = (_handler$handlers6 = handler.handlers).onFinalize) === null || _handler$handlers$onF2 === void 0 ? void 0 : _handler$handlers$onF2.call(_handler$handlers6, event, false);
38
+ handler.handlers.onFinalize?.(event, false);
57
39
  gestureStateManagers.delete(event.handlerTag);
58
40
  lastUpdateEvent[handler.handlers.handlerTag] = undefined;
59
41
  }
60
42
  } else if (isTouchEvent(event)) {
61
43
  if (!gestureStateManagers.has(event.handlerTag)) {
62
44
  gestureStateManagers.set(event.handlerTag, GestureStateManager.create(event.handlerTag));
63
- } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
64
-
45
+ }
65
46
 
47
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
66
48
  const manager = gestureStateManagers.get(event.handlerTag);
67
-
68
49
  switch (event.eventType) {
69
50
  case TouchEventType.TOUCHES_DOWN:
70
- (_handler$handlers7 = handler.handlers) === null || _handler$handlers7 === void 0 ? void 0 : (_handler$handlers7$on = _handler$handlers7.onTouchesDown) === null || _handler$handlers7$on === void 0 ? void 0 : _handler$handlers7$on.call(_handler$handlers7, event, manager);
51
+ handler.handlers?.onTouchesDown?.(event, manager);
71
52
  break;
72
-
73
53
  case TouchEventType.TOUCHES_MOVE:
74
- (_handler$handlers8 = handler.handlers) === null || _handler$handlers8 === void 0 ? void 0 : (_handler$handlers8$on = _handler$handlers8.onTouchesMove) === null || _handler$handlers8$on === void 0 ? void 0 : _handler$handlers8$on.call(_handler$handlers8, event, manager);
54
+ handler.handlers?.onTouchesMove?.(event, manager);
75
55
  break;
76
-
77
56
  case TouchEventType.TOUCHES_UP:
78
- (_handler$handlers9 = handler.handlers) === null || _handler$handlers9 === void 0 ? void 0 : (_handler$handlers9$on = _handler$handlers9.onTouchesUp) === null || _handler$handlers9$on === void 0 ? void 0 : _handler$handlers9$on.call(_handler$handlers9, event, manager);
57
+ handler.handlers?.onTouchesUp?.(event, manager);
79
58
  break;
80
-
81
59
  case TouchEventType.TOUCHES_CANCELLED:
82
- (_handler$handlers10 = handler.handlers) === null || _handler$handlers10 === void 0 ? void 0 : (_handler$handlers10$o = _handler$handlers10.onTouchesCancelled) === null || _handler$handlers10$o === void 0 ? void 0 : _handler$handlers10$o.call(_handler$handlers10, event, manager);
60
+ handler.handlers?.onTouchesCancelled?.(event, manager);
83
61
  break;
84
62
  }
85
63
  } else {
86
- var _handler$handlers$onU, _handler$handlers11;
87
-
88
- (_handler$handlers$onU = (_handler$handlers11 = handler.handlers).onUpdate) === null || _handler$handlers$onU === void 0 ? void 0 : _handler$handlers$onU.call(_handler$handlers11, event);
89
-
64
+ handler.handlers.onUpdate?.(event);
90
65
  if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {
91
- var _handler$handlers$onC, _handler$handlers12, _handler$handlers$cha, _handler$handlers13;
92
-
93
- (_handler$handlers$onC = (_handler$handlers12 = handler.handlers).onChange) === null || _handler$handlers$onC === void 0 ? void 0 : _handler$handlers$onC.call(_handler$handlers12, (_handler$handlers$cha = (_handler$handlers13 = handler.handlers).changeEventCalculator) === null || _handler$handlers$cha === void 0 ? void 0 : _handler$handlers$cha.call(_handler$handlers13, event, lastUpdateEvent[handler.handlers.handlerTag]));
66
+ handler.handlers.onChange?.(handler.handlers.changeEventCalculator?.(event, lastUpdateEvent[handler.handlers.handlerTag]));
94
67
  lastUpdateEvent[handler.handlers.handlerTag] = event;
95
68
  }
96
69
  }
97
70
  } else {
98
71
  const oldHandler = findOldGestureHandler(event.handlerTag);
99
-
100
72
  if (oldHandler) {
101
73
  const nativeEvent = {
102
74
  nativeEvent: event
103
75
  };
104
-
105
76
  if (isStateChangeEvent(event)) {
106
77
  oldHandler.onGestureStateChange(nativeEvent);
107
78
  } else {
108
79
  oldHandler.onGestureEvent(nativeEvent);
109
80
  }
110
-
111
81
  return;
112
82
  }
113
83
  }
@@ -122,7 +92,6 @@ export function stopListening() {
122
92
  gestureHandlerEventSubscription.remove();
123
93
  gestureHandlerEventSubscription = null;
124
94
  }
125
-
126
95
  if (gestureHandlerStateChangeEventSubscription) {
127
96
  gestureHandlerStateChangeEventSubscription.remove();
128
97
  gestureHandlerStateChangeEventSubscription = null;
@@ -1 +1 @@
1
- {"version":3,"sources":["eventReceiver.ts"],"names":["DeviceEventEmitter","State","TouchEventType","findHandler","findOldGestureHandler","GestureStateManager","gestureHandlerEventSubscription","gestureHandlerStateChangeEventSubscription","gestureStateManagers","Map","lastUpdateEvent","isStateChangeEvent","event","oldState","isTouchEvent","eventType","onGestureHandlerEvent","handler","handlerTag","UNDETERMINED","state","BEGAN","handlers","onBegin","ACTIVE","onStart","END","onEnd","onFinalize","undefined","FAILED","CANCELLED","delete","has","set","create","manager","get","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","onUpdate","onChange","changeEventCalculator","oldHandler","nativeEvent","onGestureStateChange","onGestureEvent","startListening","stopListening","addListener","remove"],"mappings":"AAAA,SAASA,kBAAT,QAAwD,cAAxD;AACA,SAASC,KAAT,QAAsB,aAAtB;AACA,SAASC,cAAT,QAA+B,sBAA/B;AAMA,SAASC,WAAT,EAAsBC,qBAAtB,QAAmD,qBAAnD;AAEA,SACEC,mBADF,QAGO,uBAHP;AAKA,IAAIC,+BAA2D,GAAG,IAAlE;AACA,IAAIC,0CAAsE,GACxE,IADF;AAGA,MAAMC,oBAA0D,GAAG,IA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ACD,OAFD,MAEO;AACLD,QAAAA,UAAU,CAACG,cAAX,CAA0BF,WAA1B;AACD;;AACD;AACD;AACF;AACF;AAED,OAAO,SAASG,cAAT,GAA0B;AAC/BC,EAAAA,aAAa;AAEbhD,EAAAA,+BAA+B,GAAGN,kBAAkB,CAACuD,WAAnB,CAChC,uBADgC,EAEhCvC,qBAFgC,CAAlC;AAKAT,EAAAA,0CAA0C,GAAGP,kBAAkB,CAACuD,WAAnB,CAC3C,6BAD2C,EAE3CvC,qBAF2C,CAA7C;AAID;AAED,OAAO,SAASsC,aAAT,GAAyB;AAC9B,MAAIhD,+BAAJ,EAAqC;AACnCA,IAAAA,+BAA+B,CAACkD,MAAhC;AACAlD,IAAAA,+BAA+B,GAAG,IAAlC;AACD;;AAED,MAAIC,0CAAJ,EAAgD;AAC9CA,IAAAA,0CAA0C,CAACiD,MAA3C;AACAjD,IAAAA,0CAA0C,GAAG,IAA7C;AACD;AACF","sourcesContent":["import { DeviceEventEmitter, EmitterSubscription } from 'react-native';\nimport { State } from '../../State';\nimport { TouchEventType } from '../../TouchEventType';\nimport {\n GestureTouchEvent,\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from '../gestureHandlerCommon';\nimport { findHandler, findOldGestureHandler } from '../handlersRegistry';\nimport { BaseGesture } from './gesture';\nimport {\n GestureStateManager,\n GestureStateManagerType,\n} from './gestureStateManager';\n\nlet gestureHandlerEventSubscription: EmitterSubscription | null = null;\nlet gestureHandlerStateChangeEventSubscription: EmitterSubscription | null =\n null;\n\nconst gestureStateManagers: Map<number, GestureStateManagerType> = new Map<\n number,\n GestureStateManagerType\n>();\n\nconst lastUpdateEvent: (GestureUpdateEvent | undefined)[] = [];\n\nfunction isStateChangeEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureStateChangeEvent {\n // @ts-ignore oldState doesn't exist on GestureTouchEvent and that's the point\n return event.oldState != null;\n}\n\nfunction isTouchEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n): event is GestureTouchEvent {\n return event.eventType != null;\n}\n\nexport function onGestureHandlerEvent(\n event: GestureUpdateEvent | GestureStateChangeEvent | GestureTouchEvent\n) {\n const handler = findHandler(event.handlerTag) as BaseGesture<\n Record<string, unknown>\n >;\n\n if (handler) {\n if (isStateChangeEvent(event)) {\n if (\n event.oldState === State.UNDETERMINED &&\n event.state === State.BEGAN\n ) {\n handler.handlers.onBegin?.(event);\n } else if (\n (event.oldState === State.BEGAN ||\n event.oldState === State.UNDETERMINED) &&\n event.state === State.ACTIVE\n ) {\n handler.handlers.onStart?.(event);\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n } else if (event.oldState !== event.state && event.state === State.END) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, true);\n }\n handler.handlers.onFinalize?.(event, true);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n } else if (\n (event.state === State.FAILED || event.state === State.CANCELLED) &&\n event.oldState !== event.state\n ) {\n if (event.oldState === State.ACTIVE) {\n handler.handlers.onEnd?.(event, false);\n }\n handler.handlers.onFinalize?.(event, false);\n gestureStateManagers.delete(event.handlerTag);\n lastUpdateEvent[handler.handlers.handlerTag] = undefined;\n }\n } else if (isTouchEvent(event)) {\n if (!gestureStateManagers.has(event.handlerTag)) {\n gestureStateManagers.set(\n event.handlerTag,\n GestureStateManager.create(event.handlerTag)\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const manager = gestureStateManagers.get(event.handlerTag)!;\n\n switch (event.eventType) {\n case TouchEventType.TOUCHES_DOWN:\n handler.handlers?.onTouchesDown?.(event, manager);\n break;\n case TouchEventType.TOUCHES_MOVE:\n handler.handlers?.onTouchesMove?.(event, manager);\n break;\n case TouchEventType.TOUCHES_UP:\n handler.handlers?.onTouchesUp?.(event, manager);\n break;\n case TouchEventType.TOUCHES_CANCELLED:\n handler.handlers?.onTouchesCancelled?.(event, manager);\n break;\n }\n } else {\n handler.handlers.onUpdate?.(event);\n\n if (handler.handlers.onChange && handler.handlers.changeEventCalculator) {\n handler.handlers.onChange?.(\n handler.handlers.changeEventCalculator?.(\n event,\n lastUpdateEvent[handler.handlers.handlerTag]\n )\n );\n\n lastUpdateEvent[handler.handlers.handlerTag] = event;\n }\n }\n } else {\n const oldHandler = findOldGestureHandler(event.handlerTag);\n if (oldHandler) {\n const nativeEvent = { nativeEvent: event };\n if (isStateChangeEvent(event)) {\n oldHandler.onGestureStateChange(nativeEvent);\n } else {\n oldHandler.onGestureEvent(nativeEvent);\n }\n return;\n }\n }\n}\n\nexport function startListening() {\n stopListening();\n\n gestureHandlerEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerEvent',\n onGestureHandlerEvent\n );\n\n gestureHandlerStateChangeEventSubscription = DeviceEventEmitter.addListener(\n 'onGestureHandlerStateChange',\n onGestureHandlerEvent\n );\n}\n\nexport function stopListening() {\n if (gestureHandlerEventSubscription) {\n gestureHandlerEventSubscription.remove();\n gestureHandlerEventSubscription = null;\n }\n\n if (gestureHandlerStateChangeEventSubscription) {\n gestureHandlerStateChangeEventSubscription.remove();\n gestureHandlerStateChangeEventSubscription = null;\n }\n}\n"]}
1
+ {"version":3,"names":["DeviceEventEmitter","State","TouchEventType","findHandler","findOldGestureHandler","GestureStateManager","gestureHandlerEventSubscription","gestureHandlerStateChangeEventSubscription","gestureStateManagers","Map","lastUpdateEvent","isStateChangeEvent","event","oldState","isTouchEvent","eventType","onGestureHandlerEvent","handler","handlerTag","UNDETERMINED","state","BEGAN","handlers","onBegin","ACTIVE","onStart","END","onEnd","onFinalize","undefined","FAILED","CANCELLED","delete","has","set","create","manager","get","TOUCHES_DOWN","onTouchesDown","TOUCHES_MOVE","onTouchesMove","TOUCHES_UP","onTouchesUp","TOUCHES_CANCELLED","onTouchesCancelled","onUpdate","onChange","changeEventCalculator","oldHandler","nativeEvent","onGestureStateChange","onGestureEvent","startListening","stopListening","addListener","remove"],"sourceRoot":"../../../../src","sources":["handl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,CAAC,EAAE;QAC7BqC,UAAU,CAACE,oBAAoB,CAACD,WAAW,CAAC;MAC9C,CAAC,MAAM;QACLD,UAAU,CAACG,cAAc,CAACF,WAAW,CAAC;MACxC;MACA;IACF;EACF;AACF;AAEA,OAAO,SAASG,cAAcA,CAAA,EAAG;EAC/BC,aAAa,CAAC,CAAC;EAEfhD,+BAA+B,GAAGN,kBAAkB,CAACuD,WAAW,CAC9D,uBAAuB,EACvBvC,qBACF,CAAC;EAEDT,0CAA0C,GAAGP,kBAAkB,CAACuD,WAAW,CACzE,6BAA6B,EAC7BvC,qBACF,CAAC;AACH;AAEA,OAAO,SAASsC,aAAaA,CAAA,EAAG;EAC9B,IAAIhD,+BAA+B,EAAE;IACnCA,+BAA+B,CAACkD,MAAM,CAAC,CAAC;IACxClD,+BAA+B,GAAG,IAAI;EACxC;EAEA,IAAIC,0CAA0C,EAAE;IAC9CA,0CAA0C,CAACiD,MAAM,CAAC,CAAC;IACnDjD,0CAA0C,GAAG,IAAI;EACnD;AACF","ignoreList":[]}
@@ -1,24 +1,22 @@
1
- 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; }
1
+ "use strict";
2
2
 
3
3
  import { BaseGesture } from './gesture';
4
4
  export class FlingGesture extends BaseGesture {
5
+ config = {};
5
6
  constructor() {
6
7
  super();
7
-
8
- _defineProperty(this, "config", {});
9
-
10
8
  this.handlerName = 'FlingGestureHandler';
11
9
  }
10
+
12
11
  /**
13
12
  * Determine exact number of points required to handle the fling gesture.
14
13
  * @param pointers
15
14
  */
16
-
17
-
18
15
  numberOfPointers(pointers) {
19
16
  this.config.numberOfPointers = pointers;
20
17
  return this;
21
18
  }
19
+
22
20
  /**
23
21
  * Expressed allowed direction of movement.
24
22
  * Expected values are exported as constants in the Directions object.
@@ -26,12 +24,9 @@ export class FlingGesture extends BaseGesture {
26
24
  * @param direction
27
25
  * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/fling-gesture/#directionvalue-directions
28
26
  */
29
-
30
-
31
27
  direction(direction) {
32
28
  this.config.direction = direction;
33
29
  return this;
34
30
  }
35
-
36
31
  }
37
32
  //# sourceMappingURL=flingGesture.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["flingGesture.ts"],"names":["BaseGesture","FlingGesture","constructor","handlerName","numberOfPointers","pointers","config","direction"],"mappings":";;AAAA,SAASA,WAAT,QAA+C,WAA/C;AAIA,OAAO,MAAMC,YAAN,SAA2BD,WAA3B,CAAwE;AAG7EE,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF0C,EAE1C;;AAGZ,SAAKC,WAAL,GAAmB,qBAAnB;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,gBAAgB,CAACC,QAAD,EAAmB;AACjC,SAAKC,MAAL,CAAYF,gBAAZ,GAA+BC,QAA/B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACEE,EAAAA,SAAS,CAACA,SAAD,EAAoB;AAC3B,SAAKD,MAAL,CAAYC,SAAZ,GAAwBA,SAAxB;AACA,WAAO,IAAP;AACD;;AA5B4E","sourcesContent":["import { BaseGesture, BaseGestureConfig } from './gesture';\nimport { FlingGestureConfig } from '../FlingGestureHandler';\nimport type { FlingGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\n\nexport class FlingGesture extends BaseGesture<FlingGestureHandlerEventPayload> {\n public config: BaseGestureConfig & FlingGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'FlingGestureHandler';\n }\n\n /**\n * Determine exact number of points required to handle the fling gesture.\n * @param pointers\n */\n numberOfPointers(pointers: number) {\n this.config.numberOfPointers = pointers;\n return this;\n }\n\n /**\n * Expressed allowed direction of movement.\n * Expected values are exported as constants in the Directions object.\n * Arguments can be combined using `|` operator. Default value is set to `MouseButton.LEFT`.\n * @param direction\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/fling-gesture/#directionvalue-directions\n */\n direction(direction: number) {\n this.config.direction = direction;\n return this;\n }\n}\n\nexport type FlingGestureType = InstanceType<typeof FlingGesture>;\n"]}
1
+ {"version":3,"names":["BaseGesture","FlingGesture","config","constructor","handlerName","numberOfPointers","pointers","direction"],"sourceRoot":"../../../../src","sources":["handlers/gestures/flingGesture.ts"],"mappings":";;AAAA,SAASA,WAAW,QAA2B,WAAW;AAI1D,OAAO,MAAMC,YAAY,SAASD,WAAW,CAAkC;EACtEE,MAAM,GAA2C,CAAC,CAAC;EAE1DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,WAAW,GAAG,qBAAqB;EAC1C;;EAEA;AACF;AACA;AACA;EACEC,gBAAgBA,CAACC,QAAgB,EAAE;IACjC,IAAI,CAACJ,MAAM,CAACG,gBAAgB,GAAGC,QAAQ;IACvC,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,SAASA,CAACA,SAAiB,EAAE;IAC3B,IAAI,CAACL,MAAM,CAACK,SAAS,GAAGA,SAAS;IACjC,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -1,12 +1,10 @@
1
- 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; }
1
+ "use strict";
2
2
 
3
3
  import { ContinousBaseGesture } from './gesture';
4
-
5
4
  function changeEventCalculator(current, previous) {
6
5
  'worklet';
7
6
 
8
7
  let changePayload;
9
-
10
8
  if (previous === undefined) {
11
9
  changePayload = {
12
10
  forceChange: current.force
@@ -16,58 +14,50 @@ function changeEventCalculator(current, previous) {
16
14
  forceChange: current.force - previous.force
17
15
  };
18
16
  }
19
-
20
- return { ...current,
17
+ return {
18
+ ...current,
21
19
  ...changePayload
22
20
  };
23
21
  }
24
-
25
22
  export class ForceTouchGesture extends ContinousBaseGesture {
23
+ config = {};
26
24
  constructor() {
27
25
  super();
28
-
29
- _defineProperty(this, "config", {});
30
-
31
26
  this.handlerName = 'ForceTouchGestureHandler';
32
27
  }
28
+
33
29
  /**
34
30
  * A minimal pressure that is required before gesture can activate.
35
31
  * Should be a value from range [0.0, 1.0]. Default is 0.2.
36
32
  * @param force
37
33
  */
38
-
39
-
40
34
  minForce(force) {
41
35
  this.config.minForce = force;
42
36
  return this;
43
37
  }
38
+
44
39
  /**
45
40
  * A maximal pressure that could be applied for gesture.
46
41
  * If the pressure is greater, gesture fails. Should be a value from range [0.0, 1.0].
47
42
  * @param force
48
43
  */
49
-
50
-
51
44
  maxForce(force) {
52
45
  this.config.maxForce = force;
53
46
  return this;
54
47
  }
48
+
55
49
  /**
56
50
  * Value defining if haptic feedback has to be performed on activation.
57
51
  * @param value
58
52
  */
59
-
60
-
61
53
  feedbackOnActivation(value) {
62
54
  this.config.feedbackOnActivation = value;
63
55
  return this;
64
56
  }
65
-
66
57
  onChange(callback) {
67
58
  // @ts-ignore TS being overprotective, ForceTouchGestureHandlerEventPayload is Record
68
59
  this.handlers.changeEventCalculator = changeEventCalculator;
69
60
  return super.onChange(callback);
70
61
  }
71
-
72
62
  }
73
63
  //# sourceMappingURL=forceTouchGesture.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["forceTouchGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","forceChange","force","ForceTouchGesture","constructor","handlerName","minForce","config","maxForce","feedbackOnActivation","value","onChange","callback","handlers"],"mappings":";;AAAA,SAA4BA,oBAA5B,QAAwD,WAAxD;;AASA,SAASC,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK;AADP,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK,KAAR,GAAgBJ,QAAQ,CAACI;AADxB,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAED,OAAO,MAAMI,iBAAN,SAAgCR,oBAAhC,CAGL;AAGAS,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAF+C,EAE/C;;AAGZ,SAAKC,WAAL,GAAmB,0BAAnB;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,QAAQ,CAACJ,KAAD,EAAgB;AACtB,SAAKK,MAAL,CAAYD,QAAZ,GAAuBJ,KAAvB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEM,EAAAA,QAAQ,CAACN,KAAD,EAAgB;AACtB,SAAKK,MAAL,CAAYC,QAAZ,GAAuBN,KAAvB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEO,EAAAA,oBAAoB,CAACC,KAAD,EAAiB;AACnC,SAAKH,MAAL,CAAYE,oBAAZ,GAAmCC,KAAnC;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EASN;AACA;AACA,SAAKC,QAAL,CAAcjB,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMe,QAAN,CAAeC,QAAf,CAAP;AACD;;AAnDD","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\nimport { ForceTouchGestureConfig } from '../ForceTouchGestureHandler';\nimport type { ForceTouchGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\nexport type ForceTouchGestureChangeEventPayload = {\n forceChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<ForceTouchGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<ForceTouchGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: ForceTouchGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n forceChange: current.force,\n };\n } else {\n changePayload = {\n forceChange: current.force - previous.force,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class ForceTouchGesture extends ContinousBaseGesture<\n ForceTouchGestureHandlerEventPayload,\n ForceTouchGestureChangeEventPayload\n> {\n public config: BaseGestureConfig & ForceTouchGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'ForceTouchGestureHandler';\n }\n\n /**\n * A minimal pressure that is required before gesture can activate.\n * Should be a value from range [0.0, 1.0]. Default is 0.2.\n * @param force\n */\n minForce(force: number) {\n this.config.minForce = force;\n return this;\n }\n\n /**\n * A maximal pressure that could be applied for gesture.\n * If the pressure is greater, gesture fails. Should be a value from range [0.0, 1.0].\n * @param force\n */\n maxForce(force: number) {\n this.config.maxForce = force;\n return this;\n }\n\n /**\n * Value defining if haptic feedback has to be performed on activation.\n * @param value\n */\n feedbackOnActivation(value: boolean) {\n this.config.feedbackOnActivation = value;\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n GestureUpdateEvent<\n ForceTouchGestureHandlerEventPayload &\n ForceTouchGestureChangeEventPayload\n >\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, ForceTouchGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type ForceTouchGestureType = InstanceType<typeof ForceTouchGesture>;\n"]}
1
+ {"version":3,"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","forceChange","force","ForceTouchGesture","config","constructor","handlerName","minForce","maxForce","feedbackOnActivation","value","onChange","callback","handlers"],"sourceRoot":"../../../../src","sources":["handlers/gestures/forceTouchGesture.ts"],"mappings":";;AAAA,SAA4BA,oBAAoB,QAAQ,WAAW;AASnE,SAASC,qBAAqBA,CAC5BC,OAAiE,EACjEC,QAAmE,EACnE;EACA,SAAS;;EACT,IAAIC,aAAkD;EACtD,IAAID,QAAQ,KAAKE,SAAS,EAAE;IAC1BD,aAAa,GAAG;MACdE,WAAW,EAAEJ,OAAO,CAACK;IACvB,CAAC;EACH,CAAC,MAAM;IACLH,aAAa,GAAG;MACdE,WAAW,EAAEJ,OAAO,CAACK,KAAK,GAAGJ,QAAQ,CAACI;IACxC,CAAC;EACH;EAEA,OAAO;IAAE,GAAGL,OAAO;IAAE,GAAGE;EAAc,CAAC;AACzC;AAEA,OAAO,MAAMI,iBAAiB,SAASR,oBAAoB,CAGzD;EACOS,MAAM,GAAgD,CAAC,CAAC;EAE/DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAACC,WAAW,GAAG,0BAA0B;EAC/C;;EAEA;AACF;AACA;AACA;AACA;EACEC,QAAQA,CAACL,KAAa,EAAE;IACtB,IAAI,CAACE,MAAM,CAACG,QAAQ,GAAGL,KAAK;IAC5B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEM,QAAQA,CAACN,KAAa,EAAE;IACtB,IAAI,CAACE,MAAM,CAACI,QAAQ,GAAGN,KAAK;IAC5B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEO,oBAAoBA,CAACC,KAAc,EAAE;IACnC,IAAI,CAACN,MAAM,CAACK,oBAAoB,GAAGC,KAAK;IACxC,OAAO,IAAI;EACb;EAEAC,QAAQA,CACNC,QAOS,EACT;IACA;IACA,IAAI,CAACC,QAAQ,CAACjB,qBAAqB,GAAGA,qBAAqB;IAC3D,OAAO,KAAK,CAACe,QAAQ,CAACC,QAAQ,CAAC;EACjC;AACF","ignoreList":[]}