react-native-gesture-handler 3.0.0-beta.3 → 3.0.0-beta.4

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 (310) hide show
  1. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +42 -38
  2. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +22 -4
  3. package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +3 -6
  4. package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +2 -0
  5. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +63 -6
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/OnJSResponderCancelListener.kt +6 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +2 -0
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +16 -6
  9. package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +17 -4
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +0 -1
  11. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +47 -6
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +1 -1
  13. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +18 -8
  14. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -4
  15. package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +0 -6
  16. package/apple/Handlers/RNForceTouchHandler.m +1 -1
  17. package/apple/Handlers/RNHoverHandler.m +11 -11
  18. package/apple/Handlers/RNLongPressHandler.m +2 -2
  19. package/apple/Handlers/RNManualHandler.m +5 -0
  20. package/apple/Handlers/RNNativeViewHandler.mm +114 -53
  21. package/apple/Handlers/RNPanHandler.m +7 -3
  22. package/apple/Handlers/RNPinchHandler.m +9 -3
  23. package/apple/Handlers/RNRotationHandler.m +7 -2
  24. package/apple/Handlers/RNTapHandler.m +1 -1
  25. package/apple/RNGestureHandler.h +18 -0
  26. package/apple/RNGestureHandler.mm +32 -6
  27. package/apple/RNGestureHandlerButton.h +8 -0
  28. package/apple/RNGestureHandlerButton.mm +102 -11
  29. package/apple/RNGestureHandlerButtonComponentView.mm +85 -4
  30. package/apple/RNGestureHandlerRegistry.h +0 -1
  31. package/apple/RNRootViewGestureRecognizer.m +4 -15
  32. package/lib/module/components/GestureButtons.js +8 -8
  33. package/lib/module/components/GestureButtons.js.map +1 -1
  34. package/lib/module/components/GestureHandlerButton.web.js +51 -9
  35. package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
  36. package/lib/module/components/Pressable/Pressable.js +1 -1
  37. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  38. package/lib/module/components/Pressable/stateDefinitions.js +2 -0
  39. package/lib/module/components/Pressable/stateDefinitions.js.map +1 -1
  40. package/lib/module/components/touchables/GenericTouchable.js +2 -6
  41. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  42. package/lib/module/handlers/gestures/GestureDetector/utils.js +11 -1
  43. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  44. package/lib/module/handlers/gestures/flingGesture.js +8 -0
  45. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  46. package/lib/module/handlers/gestures/forceTouchGesture.js +3 -3
  47. package/lib/module/handlers/gestures/gesture.js +8 -0
  48. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  49. package/lib/module/handlers/gestures/gestureComposition.js +28 -0
  50. package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
  51. package/lib/module/handlers/gestures/gestureObjects.js +27 -1
  52. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  53. package/lib/module/handlers/gestures/gestureStateManager.js +9 -0
  54. package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
  55. package/lib/module/handlers/gestures/hoverGesture.js +8 -0
  56. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  57. package/lib/module/handlers/gestures/longPressGesture.js +8 -0
  58. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  59. package/lib/module/handlers/gestures/manualGesture.js +8 -0
  60. package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
  61. package/lib/module/handlers/gestures/nativeGesture.js +8 -0
  62. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  63. package/lib/module/handlers/gestures/panGesture.js +13 -0
  64. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  65. package/lib/module/handlers/gestures/pinchGesture.js +13 -0
  66. package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
  67. package/lib/module/handlers/gestures/rotationGesture.js +8 -0
  68. package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
  69. package/lib/module/handlers/gestures/tapGesture.js +8 -0
  70. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  71. package/lib/module/v3/components/GestureButtons.js +4 -4
  72. package/lib/module/v3/components/GestureButtons.js.map +1 -1
  73. package/lib/module/v3/components/Pressable.js +3 -2
  74. package/lib/module/v3/components/Pressable.js.map +1 -1
  75. package/lib/module/v3/components/Touchable/Touchable.js +67 -29
  76. package/lib/module/v3/components/Touchable/Touchable.js.map +1 -1
  77. package/lib/module/v3/detectors/HostGestureDetector.web.js +2 -0
  78. package/lib/module/v3/detectors/HostGestureDetector.web.js.map +1 -1
  79. package/lib/module/v3/detectors/VirtualDetector/VirtualDetector.js +2 -0
  80. package/lib/module/v3/detectors/VirtualDetector/VirtualDetector.js.map +1 -1
  81. package/lib/module/v3/detectors/useNativeGestureRole.js +6 -0
  82. package/lib/module/v3/detectors/useNativeGestureRole.js.map +1 -0
  83. package/lib/module/v3/detectors/useNativeGestureRole.web.js +27 -0
  84. package/lib/module/v3/detectors/useNativeGestureRole.web.js.map +1 -0
  85. package/lib/module/v3/hooks/callbacks/useReanimatedEventHandler.js +17 -2
  86. package/lib/module/v3/hooks/callbacks/useReanimatedEventHandler.js.map +1 -1
  87. package/lib/module/v3/hooks/gestures/fling/useFlingGesture.js +2 -1
  88. package/lib/module/v3/hooks/gestures/fling/useFlingGesture.js.map +1 -1
  89. package/lib/module/v3/hooks/gestures/hover/useHoverGesture.js +2 -1
  90. package/lib/module/v3/hooks/gestures/hover/useHoverGesture.js.map +1 -1
  91. package/lib/module/v3/hooks/gestures/longPress/useLongPressGesture.js +2 -1
  92. package/lib/module/v3/hooks/gestures/longPress/useLongPressGesture.js.map +1 -1
  93. package/lib/module/v3/hooks/gestures/manual/useManualGesture.js +2 -1
  94. package/lib/module/v3/hooks/gestures/manual/useManualGesture.js.map +1 -1
  95. package/lib/module/v3/hooks/gestures/native/NativeTypes.js +1 -1
  96. package/lib/module/v3/hooks/gestures/native/NativeTypes.js.map +1 -1
  97. package/lib/module/v3/hooks/gestures/native/useNativeGesture.js +2 -1
  98. package/lib/module/v3/hooks/gestures/native/useNativeGesture.js.map +1 -1
  99. package/lib/module/v3/hooks/gestures/pan/usePanGesture.js +2 -1
  100. package/lib/module/v3/hooks/gestures/pan/usePanGesture.js.map +1 -1
  101. package/lib/module/v3/hooks/gestures/pinch/usePinchGesture.js +2 -1
  102. package/lib/module/v3/hooks/gestures/pinch/usePinchGesture.js.map +1 -1
  103. package/lib/module/v3/hooks/gestures/rotation/useRotationGesture.js +2 -1
  104. package/lib/module/v3/hooks/gestures/rotation/useRotationGesture.js.map +1 -1
  105. package/lib/module/v3/hooks/gestures/tap/useTapGesture.js +2 -1
  106. package/lib/module/v3/hooks/gestures/tap/useTapGesture.js.map +1 -1
  107. package/lib/module/v3/hooks/useGesture.js +1 -4
  108. package/lib/module/v3/hooks/useGesture.js.map +1 -1
  109. package/lib/module/v3/hooks/utils/configUtils.js +7 -3
  110. package/lib/module/v3/hooks/utils/configUtils.js.map +1 -1
  111. package/lib/module/v3/hooks/utils/index.js +1 -1
  112. package/lib/module/v3/hooks/utils/index.js.map +1 -1
  113. package/lib/module/v3/hooks/utils/propsWhiteList.js +1 -1
  114. package/lib/module/v3/hooks/utils/propsWhiteList.js.map +1 -1
  115. package/lib/module/web/constants.js +1 -0
  116. package/lib/module/web/constants.js.map +1 -1
  117. package/lib/module/web/detectors/RotationGestureDetector.js +18 -5
  118. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  119. package/lib/module/web/detectors/ScaleGestureDetector.js +9 -1
  120. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  121. package/lib/module/web/handlers/GestureHandler.js +25 -5
  122. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  123. package/lib/module/web/handlers/HoverGestureHandler.js +1 -4
  124. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  125. package/lib/module/web/handlers/ManualGestureHandler.js +1 -0
  126. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  127. package/lib/module/web/handlers/NativeViewGestureHandler.js +65 -17
  128. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  129. package/lib/module/web/handlers/PanGestureHandler.js +1 -0
  130. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  131. package/lib/module/web/handlers/PinchGestureHandler.js +4 -6
  132. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  133. package/lib/module/web/handlers/RotationGestureHandler.js +4 -3
  134. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  135. package/lib/module/web/interfaces.js +6 -0
  136. package/lib/module/web/interfaces.js.map +1 -1
  137. package/lib/module/web/tools/GestureHandlerOrchestrator.js +8 -2
  138. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  139. package/lib/module/web/tools/GestureLifecycleEvents.js +10 -0
  140. package/lib/module/web/tools/GestureLifecycleEvents.js.map +1 -0
  141. package/lib/module/web/tools/PointerEventManager.js +9 -0
  142. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  143. package/lib/typescript/components/GestureButtons.d.ts.map +1 -1
  144. package/lib/typescript/components/GestureHandlerButton.web.d.ts +5 -1
  145. package/lib/typescript/components/GestureHandlerButton.web.d.ts.map +1 -1
  146. package/lib/typescript/components/Pressable/Pressable.d.ts.map +1 -1
  147. package/lib/typescript/components/Pressable/stateDefinitions.d.ts.map +1 -1
  148. package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +1 -1
  149. package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts.map +1 -1
  150. package/lib/typescript/handlers/gestures/flingGesture.d.ts +6 -0
  151. package/lib/typescript/handlers/gestures/flingGesture.d.ts.map +1 -1
  152. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +3 -3
  153. package/lib/typescript/handlers/gestures/gesture.d.ts +6 -0
  154. package/lib/typescript/handlers/gestures/gesture.d.ts.map +1 -1
  155. package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
  156. package/lib/typescript/handlers/gestures/gestureComposition.d.ts.map +1 -1
  157. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +27 -1
  158. package/lib/typescript/handlers/gestures/gestureObjects.d.ts.map +1 -1
  159. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +6 -0
  160. package/lib/typescript/handlers/gestures/gestureStateManager.d.ts.map +1 -1
  161. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +6 -0
  162. package/lib/typescript/handlers/gestures/hoverGesture.d.ts.map +1 -1
  163. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +6 -0
  164. package/lib/typescript/handlers/gestures/longPressGesture.d.ts.map +1 -1
  165. package/lib/typescript/handlers/gestures/manualGesture.d.ts +6 -0
  166. package/lib/typescript/handlers/gestures/manualGesture.d.ts.map +1 -1
  167. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +6 -0
  168. package/lib/typescript/handlers/gestures/nativeGesture.d.ts.map +1 -1
  169. package/lib/typescript/handlers/gestures/panGesture.d.ts +9 -0
  170. package/lib/typescript/handlers/gestures/panGesture.d.ts.map +1 -1
  171. package/lib/typescript/handlers/gestures/pinchGesture.d.ts +9 -0
  172. package/lib/typescript/handlers/gestures/pinchGesture.d.ts.map +1 -1
  173. package/lib/typescript/handlers/gestures/rotationGesture.d.ts +6 -0
  174. package/lib/typescript/handlers/gestures/rotationGesture.d.ts.map +1 -1
  175. package/lib/typescript/handlers/gestures/tapGesture.d.ts +6 -0
  176. package/lib/typescript/handlers/gestures/tapGesture.d.ts.map +1 -1
  177. package/lib/typescript/v3/components/GestureButtons.d.ts +1 -0
  178. package/lib/typescript/v3/components/GestureButtons.d.ts.map +1 -1
  179. package/lib/typescript/v3/components/GestureComponents.d.ts +3 -0
  180. package/lib/typescript/v3/components/GestureComponents.d.ts.map +1 -1
  181. package/lib/typescript/v3/components/GestureComponents.web.d.ts +4 -0
  182. package/lib/typescript/v3/components/GestureComponents.web.d.ts.map +1 -1
  183. package/lib/typescript/v3/components/Pressable.d.ts.map +1 -1
  184. package/lib/typescript/v3/components/Touchable/Touchable.d.ts.map +1 -1
  185. package/lib/typescript/v3/components/Touchable/TouchableProps.d.ts +10 -1
  186. package/lib/typescript/v3/components/Touchable/TouchableProps.d.ts.map +1 -1
  187. package/lib/typescript/v3/detectors/HostGestureDetector.web.d.ts +1 -1
  188. package/lib/typescript/v3/detectors/HostGestureDetector.web.d.ts.map +1 -1
  189. package/lib/typescript/v3/detectors/VirtualDetector/VirtualDetector.d.ts.map +1 -1
  190. package/lib/typescript/v3/detectors/useNativeGestureRole.d.ts +3 -0
  191. package/lib/typescript/v3/detectors/useNativeGestureRole.d.ts.map +1 -0
  192. package/lib/typescript/v3/detectors/useNativeGestureRole.web.d.ts +3 -0
  193. package/lib/typescript/v3/detectors/useNativeGestureRole.web.d.ts.map +1 -0
  194. package/lib/typescript/v3/hooks/callbacks/useReanimatedEventHandler.d.ts.map +1 -1
  195. package/lib/typescript/v3/hooks/gestures/fling/useFlingGesture.d.ts +1 -1
  196. package/lib/typescript/v3/hooks/gestures/fling/useFlingGesture.d.ts.map +1 -1
  197. package/lib/typescript/v3/hooks/gestures/hover/useHoverGesture.d.ts +1 -1
  198. package/lib/typescript/v3/hooks/gestures/hover/useHoverGesture.d.ts.map +1 -1
  199. package/lib/typescript/v3/hooks/gestures/longPress/useLongPressGesture.d.ts +1 -1
  200. package/lib/typescript/v3/hooks/gestures/longPress/useLongPressGesture.d.ts.map +1 -1
  201. package/lib/typescript/v3/hooks/gestures/manual/useManualGesture.d.ts +1 -1
  202. package/lib/typescript/v3/hooks/gestures/manual/useManualGesture.d.ts.map +1 -1
  203. package/lib/typescript/v3/hooks/gestures/native/NativeTypes.d.ts +7 -0
  204. package/lib/typescript/v3/hooks/gestures/native/NativeTypes.d.ts.map +1 -1
  205. package/lib/typescript/v3/hooks/gestures/native/useNativeGesture.d.ts +1 -1
  206. package/lib/typescript/v3/hooks/gestures/native/useNativeGesture.d.ts.map +1 -1
  207. package/lib/typescript/v3/hooks/gestures/pan/usePanGesture.d.ts +1 -1
  208. package/lib/typescript/v3/hooks/gestures/pan/usePanGesture.d.ts.map +1 -1
  209. package/lib/typescript/v3/hooks/gestures/pinch/usePinchGesture.d.ts +1 -1
  210. package/lib/typescript/v3/hooks/gestures/pinch/usePinchGesture.d.ts.map +1 -1
  211. package/lib/typescript/v3/hooks/gestures/rotation/useRotationGesture.d.ts +1 -1
  212. package/lib/typescript/v3/hooks/gestures/rotation/useRotationGesture.d.ts.map +1 -1
  213. package/lib/typescript/v3/hooks/gestures/tap/useTapGesture.d.ts +1 -1
  214. package/lib/typescript/v3/hooks/gestures/tap/useTapGesture.d.ts.map +1 -1
  215. package/lib/typescript/v3/hooks/useGesture.d.ts.map +1 -1
  216. package/lib/typescript/v3/hooks/utils/configUtils.d.ts +2 -2
  217. package/lib/typescript/v3/hooks/utils/configUtils.d.ts.map +1 -1
  218. package/lib/typescript/v3/hooks/utils/index.d.ts +1 -1
  219. package/lib/typescript/v3/hooks/utils/index.d.ts.map +1 -1
  220. package/lib/typescript/v3/hooks/utils/propsWhiteList.d.ts +2 -2
  221. package/lib/typescript/v3/hooks/utils/propsWhiteList.d.ts.map +1 -1
  222. package/lib/typescript/v3/types/ConfigTypes.d.ts +1 -0
  223. package/lib/typescript/v3/types/ConfigTypes.d.ts.map +1 -1
  224. package/lib/typescript/web/constants.d.ts +1 -0
  225. package/lib/typescript/web/constants.d.ts.map +1 -1
  226. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts.map +1 -1
  227. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts.map +1 -1
  228. package/lib/typescript/web/handlers/GestureHandler.d.ts +8 -2
  229. package/lib/typescript/web/handlers/GestureHandler.d.ts.map +1 -1
  230. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +1 -1
  231. package/lib/typescript/web/handlers/HoverGestureHandler.d.ts.map +1 -1
  232. package/lib/typescript/web/handlers/IGestureHandler.d.ts +2 -0
  233. package/lib/typescript/web/handlers/IGestureHandler.d.ts.map +1 -1
  234. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +1 -0
  235. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts.map +1 -1
  236. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +13 -3
  237. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts.map +1 -1
  238. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +1 -0
  239. package/lib/typescript/web/handlers/PanGestureHandler.d.ts.map +1 -1
  240. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +1 -0
  241. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts.map +1 -1
  242. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +1 -0
  243. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts.map +1 -1
  244. package/lib/typescript/web/interfaces.d.ts +6 -0
  245. package/lib/typescript/web/interfaces.d.ts.map +1 -1
  246. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +1 -0
  247. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts.map +1 -1
  248. package/lib/typescript/web/tools/GestureLifecycleEvents.d.ts +7 -0
  249. package/lib/typescript/web/tools/GestureLifecycleEvents.d.ts.map +1 -0
  250. package/lib/typescript/web/tools/PointerEventManager.d.ts.map +1 -1
  251. package/package.json +1 -1
  252. package/src/components/GestureButtons.tsx +10 -9
  253. package/src/components/GestureHandlerButton.web.tsx +94 -26
  254. package/src/components/Pressable/Pressable.tsx +2 -1
  255. package/src/components/Pressable/stateDefinitions.ts +3 -0
  256. package/src/components/touchables/GenericTouchable.tsx +2 -5
  257. package/src/handlers/gestures/GestureDetector/utils.ts +11 -1
  258. package/src/handlers/gestures/flingGesture.ts +6 -0
  259. package/src/handlers/gestures/forceTouchGesture.ts +3 -3
  260. package/src/handlers/gestures/gesture.ts +6 -0
  261. package/src/handlers/gestures/gestureComposition.ts +21 -0
  262. package/src/handlers/gestures/gestureObjects.ts +27 -1
  263. package/src/handlers/gestures/gestureStateManager.ts +6 -0
  264. package/src/handlers/gestures/hoverGesture.ts +6 -0
  265. package/src/handlers/gestures/longPressGesture.ts +6 -0
  266. package/src/handlers/gestures/manualGesture.ts +6 -0
  267. package/src/handlers/gestures/nativeGesture.ts +6 -0
  268. package/src/handlers/gestures/panGesture.ts +9 -0
  269. package/src/handlers/gestures/pinchGesture.ts +9 -0
  270. package/src/handlers/gestures/rotationGesture.ts +6 -0
  271. package/src/handlers/gestures/tapGesture.ts +6 -0
  272. package/src/v3/components/GestureButtons.tsx +5 -5
  273. package/src/v3/components/Pressable.tsx +2 -1
  274. package/src/v3/components/Touchable/Touchable.tsx +80 -47
  275. package/src/v3/components/Touchable/TouchableProps.ts +15 -1
  276. package/src/v3/detectors/HostGestureDetector.web.tsx +4 -1
  277. package/src/v3/detectors/VirtualDetector/VirtualDetector.tsx +3 -0
  278. package/src/v3/detectors/useNativeGestureRole.ts +8 -0
  279. package/src/v3/detectors/useNativeGestureRole.web.ts +42 -0
  280. package/src/v3/hooks/callbacks/useReanimatedEventHandler.ts +23 -7
  281. package/src/v3/hooks/gestures/fling/useFlingGesture.ts +5 -1
  282. package/src/v3/hooks/gestures/hover/useHoverGesture.ts +5 -1
  283. package/src/v3/hooks/gestures/longPress/useLongPressGesture.ts +3 -1
  284. package/src/v3/hooks/gestures/manual/useManualGesture.ts +5 -1
  285. package/src/v3/hooks/gestures/native/NativeTypes.ts +13 -1
  286. package/src/v3/hooks/gestures/native/useNativeGesture.ts +5 -1
  287. package/src/v3/hooks/gestures/pan/usePanGesture.ts +5 -1
  288. package/src/v3/hooks/gestures/pinch/usePinchGesture.ts +5 -1
  289. package/src/v3/hooks/gestures/rotation/useRotationGesture.ts +3 -1
  290. package/src/v3/hooks/gestures/tap/useTapGesture.ts +5 -1
  291. package/src/v3/hooks/useGesture.ts +0 -4
  292. package/src/v3/hooks/utils/configUtils.ts +16 -5
  293. package/src/v3/hooks/utils/index.ts +0 -1
  294. package/src/v3/hooks/utils/propsWhiteList.ts +1 -0
  295. package/src/v3/types/ConfigTypes.ts +1 -0
  296. package/src/web/constants.ts +1 -0
  297. package/src/web/detectors/RotationGestureDetector.ts +19 -5
  298. package/src/web/detectors/ScaleGestureDetector.ts +9 -3
  299. package/src/web/handlers/GestureHandler.ts +36 -6
  300. package/src/web/handlers/HoverGestureHandler.ts +2 -5
  301. package/src/web/handlers/IGestureHandler.ts +2 -0
  302. package/src/web/handlers/ManualGestureHandler.ts +2 -0
  303. package/src/web/handlers/NativeViewGestureHandler.ts +122 -19
  304. package/src/web/handlers/PanGestureHandler.ts +2 -0
  305. package/src/web/handlers/PinchGestureHandler.ts +5 -7
  306. package/src/web/handlers/RotationGestureHandler.ts +5 -5
  307. package/src/web/interfaces.ts +7 -0
  308. package/src/web/tools/GestureHandlerOrchestrator.ts +11 -3
  309. package/src/web/tools/GestureLifecycleEvents.ts +14 -0
  310. package/src/web/tools/PointerEventManager.ts +12 -0
@@ -0,0 +1,42 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import { useEffect } from 'react';
3
+
4
+ import { NATIVE_GESTURE_ROLE_ATTRIBUTE } from '../../web/constants';
5
+ import { NativeGestureRole } from '../../web/interfaces';
6
+
7
+ export function useNativeGestureRole(
8
+ viewRef: RefObject<Element | null>,
9
+ children: ReactNode
10
+ ): void {
11
+ useEffect(() => {
12
+ const child = viewRef.current?.firstChild;
13
+
14
+ if (!(child instanceof HTMLElement)) {
15
+ return;
16
+ }
17
+
18
+ // @ts-ignore This exists on React.ReactNode
19
+ const displayName = children?.type?.displayName as string;
20
+
21
+ if (displayName === NativeGestureRole.ScrollView) {
22
+ child.setAttribute(
23
+ NATIVE_GESTURE_ROLE_ATTRIBUTE,
24
+ NativeGestureRole.ScrollView
25
+ );
26
+ } else if (displayName === NativeGestureRole.Switch) {
27
+ child.setAttribute(
28
+ NATIVE_GESTURE_ROLE_ATTRIBUTE,
29
+ NativeGestureRole.Switch
30
+ );
31
+ } else if (displayName === NativeGestureRole.Button) {
32
+ child.setAttribute(
33
+ NATIVE_GESTURE_ROLE_ATTRIBUTE,
34
+ NativeGestureRole.Button
35
+ );
36
+ }
37
+
38
+ return () => {
39
+ child.removeAttribute(NATIVE_GESTURE_ROLE_ATTRIBUTE);
40
+ };
41
+ }, [children, viewRef]);
42
+ }
@@ -1,4 +1,4 @@
1
- import { useMemo } from 'react';
1
+ import { useEffect, useMemo, useRef } from 'react';
2
2
 
3
3
  import type { ReanimatedHandler } from '../../../handlers/gestures/reanimatedWrapper';
4
4
  import { Reanimated } from '../../../handlers/gestures/reanimatedWrapper';
@@ -10,6 +10,12 @@ import type {
10
10
  } from '../../types';
11
11
  import { eventHandler } from './eventHandler';
12
12
 
13
+ const REANIMATED_EVENT_NAMES = [
14
+ 'onGestureHandlerReanimatedEvent',
15
+ 'onGestureHandlerReanimatedStateChange',
16
+ 'onGestureHandlerReanimatedTouchEvent',
17
+ ];
18
+
13
19
  const workletNOOP = () => {
14
20
  'worklet';
15
21
  // no-op
@@ -59,14 +65,24 @@ export function useReanimatedEventHandler<
59
65
  );
60
66
  };
61
67
 
68
+ // Fast Refresh invalidates `useMemo` caches but preserves `useRef`, so the
69
+ // `handlerTag` computed with `useMemo([])` in `useGesture` can regenerate
70
+ // on FR. Without forcing a rebuild, the registered worklet keeps the old
71
+ // `handlerTag` in its closure and `isEventForHandlerWithTag` rejects every
72
+ // event emitted by the freshly-created native handler.
73
+ const prevHandlerTagRef = useRef(handlerTag);
74
+ const handlerTagChanged = prevHandlerTagRef.current !== handlerTag;
75
+
76
+ // Write after commit so interrupted or re-invoked renders don't desync the
77
+ // ref from what was actually committed.
78
+ useEffect(() => {
79
+ prevHandlerTagRef.current = handlerTag;
80
+ }, [handlerTag]);
81
+
62
82
  const reanimatedEvent = Reanimated?.useEvent(
63
83
  callback,
64
- [
65
- 'onGestureHandlerReanimatedEvent',
66
- 'onGestureHandlerReanimatedStateChange',
67
- 'onGestureHandlerReanimatedTouchEvent',
68
- ],
69
- !!reanimatedHandler?.doDependenciesDiffer
84
+ REANIMATED_EVENT_NAMES,
85
+ handlerTagChanged || !!reanimatedHandler?.doDependenciesDiffer
70
86
  );
71
87
 
72
88
  return reanimatedEvent;
@@ -8,7 +8,11 @@ import type {
8
8
  FlingHandlerData,
9
9
  } from './FlingTypes';
10
10
 
11
- export function useFlingGesture(config: FlingGestureConfig): FlingGesture {
11
+ const EMPTY_FLING_CONFIG: FlingGestureConfig = {};
12
+
13
+ export function useFlingGesture(
14
+ config: FlingGestureConfig = EMPTY_FLING_CONFIG
15
+ ): FlingGesture {
12
16
  const flingConfig = useClonedAndRemappedConfig<
13
17
  FlingGestureProperties,
14
18
  FlingHandlerData
@@ -44,7 +44,11 @@ function transformHoverProps(
44
44
 
45
45
  const HoverPropsMapping = new Map<string, string>([['effect', 'hoverEffect']]);
46
46
 
47
- export function useHoverGesture(config: HoverGestureConfig): HoverGesture {
47
+ const EMPTY_HOVER_CONFIG: HoverGestureConfig = {};
48
+
49
+ export function useHoverGesture(
50
+ config: HoverGestureConfig = EMPTY_HOVER_CONFIG
51
+ ): HoverGesture {
48
52
  const hoverConfig = useClonedAndRemappedConfig<
49
53
  HoverGestureProperties,
50
54
  HoverHandlerData,
@@ -28,8 +28,10 @@ function transformLongPressProps(
28
28
  return config;
29
29
  }
30
30
 
31
+ const EMPTY_LONG_PRESS_CONFIG: LongPressGestureConfig = {};
32
+
31
33
  export function useLongPressGesture(
32
- config: LongPressGestureConfig
34
+ config: LongPressGestureConfig = EMPTY_LONG_PRESS_CONFIG
33
35
  ): LongPressGesture {
34
36
  const longPressConfig = useClonedAndRemappedConfig<
35
37
  LongPressGestureProperties,
@@ -8,7 +8,11 @@ import type {
8
8
  ManualHandlerData,
9
9
  } from './ManualTypes';
10
10
 
11
- export function useManualGesture(config: ManualGestureConfig): ManualGesture {
11
+ const EMPTY_MANUAL_CONFIG: ManualGestureConfig = {};
12
+
13
+ export function useManualGesture(
14
+ config: ManualGestureConfig = EMPTY_MANUAL_CONFIG
15
+ ): ManualGesture {
12
16
  const manualConfig = useClonedAndRemappedConfig<
13
17
  ManualGestureProperties,
14
18
  ManualHandlerData
@@ -20,11 +20,23 @@ export type NativeGestureNativeProperties = {
20
20
  * `NativeViewGestureHandler` receives an `ACTIVE` state event.
21
21
  */
22
22
  disallowInterruption?: boolean;
23
+
24
+ /**
25
+ * Composes with `disallowInterruption`. When both are `true`, the handler still
26
+ * resists discrete gestures but yields to continuous gestures, so a wrapping
27
+ * gesture can take over the touch stream. No-op when `disallowInterruption` is
28
+ * `false`.
29
+ */
30
+ yieldsToContinuousGestures?: boolean;
23
31
  };
24
32
 
25
33
  export const NativeHandlerNativeProperties = new Set<
26
34
  keyof NativeGestureNativeProperties
27
- >(['shouldActivateOnStart', 'disallowInterruption']);
35
+ >([
36
+ 'shouldActivateOnStart',
37
+ 'disallowInterruption',
38
+ 'yieldsToContinuousGestures',
39
+ ]);
28
40
 
29
41
  export type NativeHandlerData = {
30
42
  pointerInside: boolean;
@@ -8,7 +8,11 @@ import type {
8
8
  NativeHandlerData,
9
9
  } from './NativeTypes';
10
10
 
11
- export function useNativeGesture(config: NativeGestureConfig): NativeGesture {
11
+ const EMPTY_NATIVE_CONFIG: NativeGestureConfig = {};
12
+
13
+ export function useNativeGesture(
14
+ config: NativeGestureConfig = EMPTY_NATIVE_CONFIG
15
+ ): NativeGesture {
12
16
  const nativeConfig = useClonedAndRemappedConfig<
13
17
  NativeGestureProperties,
14
18
  NativeHandlerData
@@ -139,7 +139,11 @@ function transformPanProps(
139
139
  return config;
140
140
  }
141
141
 
142
- export function usePanGesture(config: PanGestureConfig): PanGesture {
142
+ const EMPTY_PAN_CONFIG: PanGestureConfig = {};
143
+
144
+ export function usePanGesture(
145
+ config: PanGestureConfig = EMPTY_PAN_CONFIG
146
+ ): PanGesture {
143
147
  if (__DEV__) {
144
148
  validatePanConfig(config);
145
149
  }
@@ -40,7 +40,11 @@ function transformPinchProps(
40
40
 
41
41
  const PinchPropsMapping = new Map<string, string>();
42
42
 
43
- export function usePinchGesture(config: PinchGestureConfig): PinchGesture {
43
+ const EMPTY_PINCH_CONFIG: PinchGestureConfig = {};
44
+
45
+ export function usePinchGesture(
46
+ config: PinchGestureConfig = EMPTY_PINCH_CONFIG
47
+ ): PinchGesture {
44
48
  const pinchConfig = useClonedAndRemappedConfig<
45
49
  PinchGestureProperties,
46
50
  PinchHandlerData,
@@ -42,8 +42,10 @@ function transformRotationProps(
42
42
 
43
43
  const RotationPropsMapping = new Map<string, string>();
44
44
 
45
+ const EMPTY_ROTATION_CONFIG: RotationGestureConfig = {};
46
+
45
47
  export function useRotationGesture(
46
- config: RotationGestureConfig
48
+ config: RotationGestureConfig = EMPTY_ROTATION_CONFIG
47
49
  ): RotationGesture {
48
50
  const rotationConfig = useClonedAndRemappedConfig<
49
51
  RotationGestureProperties,
@@ -18,7 +18,11 @@ const TapPropsMapping = new Map<
18
18
  ['maxDelay', 'maxDelayMs'],
19
19
  ]);
20
20
 
21
- export function useTapGesture(config: TapGestureConfig): TapGesture {
21
+ const EMPTY_TAP_CONFIG: TapGestureConfig = {};
22
+
23
+ export function useTapGesture(
24
+ config: TapGestureConfig = EMPTY_TAP_CONFIG
25
+ ): TapGesture {
22
26
  const tapConfig = useClonedAndRemappedConfig<
23
27
  TapGestureProperties,
24
28
  TapHandlerData,
@@ -16,7 +16,6 @@ import type {
16
16
  import { useGestureCallbacks } from './useGestureCallbacks';
17
17
  import {
18
18
  bindSharedValues,
19
- prepareConfig,
20
19
  prepareConfigForNativeSide,
21
20
  prepareRelations,
22
21
  unbindSharedValues,
@@ -41,9 +40,6 @@ export function useGesture<
41
40
  );
42
41
  }
43
42
 
44
- // This has to be done ASAP as other hooks depend `shouldUseReanimatedDetector`.
45
- prepareConfig(config);
46
-
47
43
  // TODO: Call only necessary hooks depending on which callbacks are defined (?)
48
44
  const { jsEventHandler, reanimatedEventHandler, animatedEventHandler } =
49
45
  useGestureCallbacks(handlerTag, config);
@@ -16,7 +16,7 @@ import {
16
16
  } from './propsWhiteList';
17
17
  import { hasWorkletEventHandlers, maybeUnpackValue } from './reanimatedUtils';
18
18
 
19
- export function prepareConfig<
19
+ export function resolveInternalConfigProps<
20
20
  TConfig extends object,
21
21
  THandlerData,
22
22
  TExtendedHandlerData extends THandlerData,
@@ -125,7 +125,7 @@ function remapProps<
125
125
  TInternalConfig extends Record<string, unknown>,
126
126
  >(
127
127
  config: TConfig & TInternalConfig,
128
- propsMapping: Map<string, string>
128
+ propsMapping: ReadonlyMap<string, string>
129
129
  ): TInternalConfig {
130
130
  type MergedConfig = TConfig & TInternalConfig;
131
131
 
@@ -142,6 +142,11 @@ function remapProps<
142
142
  return config;
143
143
  }
144
144
 
145
+ const DEFAULT_PROPS_MAPPING = new Map<string, string>();
146
+ const DEFAULT_PROPS_TRANSFORMER = <TConfig extends object>(
147
+ config: TConfig
148
+ ): TConfig => config;
149
+
145
150
  export function useClonedAndRemappedConfig<
146
151
  TConfig extends Record<string, unknown>,
147
152
  THandlerData,
@@ -151,8 +156,10 @@ export function useClonedAndRemappedConfig<
151
156
  config: ExcludeInternalConfigProps<
152
157
  BaseGestureConfig<TConfig, THandlerData, TExtendedHandlerData>
153
158
  >,
154
- propsMapping: Map<string, string> = new Map(),
155
- propsTransformer: (config: TInternalConfig) => TInternalConfig = (cfg) => cfg
159
+ propsMapping: ReadonlyMap<string, string> = DEFAULT_PROPS_MAPPING,
160
+ propsTransformer: (
161
+ config: TInternalConfig
162
+ ) => TInternalConfig = DEFAULT_PROPS_TRANSFORMER
156
163
  ): BaseGestureConfig<TInternalConfig, THandlerData, TExtendedHandlerData> {
157
164
  return useMemo(() => {
158
165
  const clonedConfig = cloneConfig<
@@ -161,11 +168,15 @@ export function useClonedAndRemappedConfig<
161
168
  TExtendedHandlerData
162
169
  >(config);
163
170
 
164
- return propsTransformer(
171
+ const transformedConfig = propsTransformer(
165
172
  remapProps<TConfig, TInternalConfig>(
166
173
  clonedConfig as TConfig & TInternalConfig,
167
174
  propsMapping
168
175
  )
169
176
  );
177
+
178
+ resolveInternalConfigProps(transformedConfig);
179
+
180
+ return transformedConfig;
170
181
  }, [config, propsMapping, propsTransformer]);
171
182
  }
@@ -1,5 +1,4 @@
1
1
  export {
2
- prepareConfig,
3
2
  prepareConfigForNativeSide,
4
3
  useClonedAndRemappedConfig,
5
4
  } from './configUtils';
@@ -23,6 +23,7 @@ const CommonConfig = new Set<keyof CommonGestureConfig>([
23
23
  'mouseButton',
24
24
  'testID',
25
25
  'cancelsTouchesInView',
26
+ 'cancelsJSResponder',
26
27
  'manualActivation',
27
28
  ]);
28
29
 
@@ -77,6 +77,7 @@ export type CommonGestureConfig = {
77
77
  activeCursor?: ActiveCursor | undefined;
78
78
  mouseButton?: MouseButton | undefined;
79
79
  cancelsTouchesInView?: boolean | undefined;
80
+ cancelsJSResponder?: boolean | undefined;
80
81
  manualActivation?: boolean | undefined;
81
82
  },
82
83
  ActiveCursor | MouseButton
@@ -1,2 +1,3 @@
1
1
  export const DEFAULT_TOUCH_SLOP = 15;
2
2
  export const MINIMAL_RECOGNIZABLE_MAGNITUDE = 0.1;
3
+ export const NATIVE_GESTURE_ROLE_ATTRIBUTE = 'rngh-role';
@@ -84,15 +84,23 @@ export default class RotationGestureDetector
84
84
  this.onRotationEnd(this);
85
85
  }
86
86
 
87
- private setKeyPointers(tracker: PointerTracker): void {
87
+ private setKeyPointers(tracker: PointerTracker, excludeId?: number): void {
88
88
  if (this.keyPointers[0] && this.keyPointers[1]) {
89
89
  return;
90
90
  }
91
91
 
92
- const pointerIDs: IterableIterator<number> = tracker.trackedPointers.keys();
92
+ let assigned = 0;
93
93
 
94
- this.keyPointers[0] = pointerIDs.next().value as number;
95
- this.keyPointers[1] = pointerIDs.next().value as number;
94
+ for (const id of tracker.trackedPointers.keys()) {
95
+ if (id === excludeId) {
96
+ continue;
97
+ }
98
+
99
+ this.keyPointers[assigned++] = id;
100
+ if (assigned === 2) {
101
+ break;
102
+ }
103
+ }
96
104
  }
97
105
 
98
106
  public onTouchEvent(event: AdaptedEvent, tracker: PointerTracker): boolean {
@@ -132,7 +140,13 @@ export default class RotationGestureDetector
132
140
  }
133
141
 
134
142
  if (this.keyPointers.indexOf(event.pointerId) >= 0) {
135
- this.finish();
143
+ if (tracker.trackedPointersCount <= 2) {
144
+ this.reset();
145
+ } else {
146
+ this.keyPointers = [NaN, NaN];
147
+ this.setKeyPointers(tracker, event.pointerId);
148
+ this.previousAngle = NaN;
149
+ }
136
150
  }
137
151
 
138
152
  break;
@@ -44,10 +44,16 @@ export default class ScaleGestureDetector implements ScaleGestureListener {
44
44
  const action: EventTypes = event.eventType;
45
45
  const numOfPointers = tracker.trackedPointersCount;
46
46
 
47
+ // When the last second pointer lifts (going down to 1), pause without
48
+ // touching span/time state so the gesture resumes cleanly on re-add.
49
+ // When 3+ → 2+ pointers, fall through so configChanged resets the span
50
+ // baseline to the remaining pointer set and avoids a scale jump.
51
+ if (action === EventTypes.ADDITIONAL_POINTER_UP && numOfPointers <= 2) {
52
+ return true;
53
+ }
54
+
47
55
  const streamComplete: boolean =
48
- action === EventTypes.UP ||
49
- action === EventTypes.ADDITIONAL_POINTER_UP ||
50
- action === EventTypes.CANCEL;
56
+ action === EventTypes.UP || action === EventTypes.CANCEL;
51
57
 
52
58
  if (action === EventTypes.DOWN || streamComplete) {
53
59
  if (this.inProgress) {
@@ -14,6 +14,7 @@ import { tagMessage } from '../../utils';
14
14
  import type {
15
15
  GestureStateChangeEventWithHandlerData,
16
16
  GestureUpdateEventWithHandlerData,
17
+ HandlerData,
17
18
  SingleGestureName,
18
19
  } from '../../v3/types';
19
20
  import type {
@@ -45,7 +46,7 @@ export default abstract class GestureHandler implements IGestureHandler {
45
46
 
46
47
  private viewRef: number | null = null;
47
48
  private propsRef: React.RefObject<PropsRef> | null = null;
48
- private actionType: ActionType | null = null;
49
+ protected actionType: ActionType | null = null;
49
50
  private forAnimated: boolean = false;
50
51
  private forReanimated: boolean = false;
51
52
  private _handlerTag!: number;
@@ -302,6 +303,12 @@ export default abstract class GestureHandler implements IGestureHandler {
302
303
  );
303
304
  }
304
305
 
306
+ public shouldBeginWithRecordedHandlers(
307
+ _recorded: IGestureHandler[]
308
+ ): boolean {
309
+ return true;
310
+ }
311
+
305
312
  public shouldAttachGestureToChildView(): boolean {
306
313
  return false;
307
314
  }
@@ -355,8 +362,9 @@ export default abstract class GestureHandler implements IGestureHandler {
355
362
  protected onPointerCancel(_event: AdaptedEvent): void {
356
363
  // No need to send a cancel touch event explicitly here. `cancel` will
357
364
  // handle cancelling all tracked touches if the handler expects pointer data.
358
- this.cancel();
359
- this.reset();
365
+ if (GestureHandlerOrchestrator.instance.isHandlerRecorded(this)) {
366
+ this.cancel();
367
+ }
360
368
  }
361
369
  protected onPointerOutOfBounds(event: AdaptedEvent): void {
362
370
  this.tryToSendMoveEvent(true, event);
@@ -430,11 +438,13 @@ export default abstract class GestureHandler implements IGestureHandler {
430
438
  onGestureHandlerReanimatedStateChange,
431
439
  }: PropsRef = this.propsRef!.current;
432
440
 
441
+ const isStateChange = this.lastSentState !== newState;
442
+
433
443
  const resultEvent: ResultEvent = !usesNativeOrVirtualDetector(
434
444
  this.actionType
435
445
  )
436
446
  ? this.transformEventData(newState, oldState)
437
- : this.lastSentState !== newState
447
+ : isStateChange
438
448
  ? this.transformStateChangeEvent(newState, oldState)
439
449
  : this.transformUpdateEvent(newState);
440
450
 
@@ -442,7 +452,7 @@ export default abstract class GestureHandler implements IGestureHandler {
442
452
  // Here the order is flipped to avoid workarounds such as making backup of the state and setting it to undefined first, then changing it back
443
453
  // Flipping order with setting oldState to undefined solves issue, when events were being sent twice instead of once
444
454
  // However, this may cause trouble in the future (but for now we don't know that)
445
- if (this.lastSentState !== newState) {
455
+ if (isStateChange) {
446
456
  this.lastSentState = newState;
447
457
 
448
458
  if (this.forReanimated) {
@@ -456,6 +466,16 @@ export default abstract class GestureHandler implements IGestureHandler {
456
466
  return;
457
467
  }
458
468
 
469
+ // Cover only V3 path due to different event shape
470
+ if (!isStateChange && usesNativeOrVirtualDetector(this.actionType)) {
471
+ const handlerData = (
472
+ resultEvent.nativeEvent as GestureUpdateEventWithHandlerData<unknown>
473
+ ).handlerData;
474
+ if (this.shouldSuppressActiveUpdate(handlerData)) {
475
+ return;
476
+ }
477
+ }
478
+
459
479
  (resultEvent.nativeEvent as GestureHandlerNativeEvent).oldState = undefined;
460
480
 
461
481
  if (this.forReanimated) {
@@ -467,6 +487,12 @@ export default abstract class GestureHandler implements IGestureHandler {
467
487
  }
468
488
  };
469
489
 
490
+ protected shouldSuppressActiveUpdate(
491
+ _handlerData: HandlerData<unknown>
492
+ ): boolean {
493
+ return false;
494
+ }
495
+
470
496
  private transformEventData(
471
497
  newState: State,
472
498
  oldState: State
@@ -744,7 +770,6 @@ export default abstract class GestureHandler implements IGestureHandler {
744
770
  const enabledChanged = this.maybeUpdateEnabled(config.enabled);
745
771
 
746
772
  if (config.hitSlop !== undefined) {
747
- this.hitSlop = config.hitSlop;
748
773
  this.hitSlop = config.hitSlop;
749
774
  this.validateHitSlops();
750
775
  }
@@ -1072,6 +1097,11 @@ export default abstract class GestureHandler implements IGestureHandler {
1072
1097
  this._name = value;
1073
1098
  }
1074
1099
 
1100
+ /**
1101
+ * Whether the handler represents a continuous gesture rather than a discrete one.
1102
+ */
1103
+ public readonly isContinuous: boolean = false;
1104
+
1075
1105
  public getTrackedPointersID(): number[] {
1076
1106
  return this.tracker.trackedPointersIDs;
1077
1107
  }
@@ -8,6 +8,8 @@ import GestureHandler from './GestureHandler';
8
8
  import type IGestureHandler from './IGestureHandler';
9
9
 
10
10
  export default class HoverGestureHandler extends GestureHandler {
11
+ public override readonly isContinuous = true;
12
+
11
13
  private stylusData: StylusData | undefined;
12
14
 
13
15
  public constructor(
@@ -52,9 +54,4 @@ export default class HoverGestureHandler extends GestureHandler {
52
54
 
53
55
  super.onPointerMove(event);
54
56
  }
55
-
56
- protected override onPointerCancel(event: AdaptedEvent): void {
57
- super.onPointerCancel(event);
58
- this.reset();
59
- }
60
57
  }
@@ -22,6 +22,7 @@ export default interface IGestureHandler {
22
22
  readonly delegate: GestureHandlerDelegate<unknown, this>;
23
23
  readonly tracker: PointerTracker;
24
24
  readonly name: SingleGestureName;
25
+ readonly isContinuous: boolean;
25
26
  state: State;
26
27
  shouldCancelWhenOutside: boolean;
27
28
  shouldResetProgress: boolean;
@@ -53,6 +54,7 @@ export default interface IGestureHandler {
53
54
  shouldRequireToWaitForFailure: (handler: IGestureHandler) => boolean;
54
55
  shouldRecognizeSimultaneously: (handler: IGestureHandler) => boolean;
55
56
  shouldBeCancelledByOther: (handler: IGestureHandler) => boolean;
57
+ shouldBeginWithRecordedHandlers: (recorded: IGestureHandler[]) => boolean;
56
58
  shouldAttachGestureToChildView: () => boolean;
57
59
 
58
60
  sendEvent: (newState: State, oldState: State) => void;
@@ -5,6 +5,8 @@ import GestureHandler from './GestureHandler';
5
5
  import type IGestureHandler from './IGestureHandler';
6
6
 
7
7
  export default class ManualGestureHandler extends GestureHandler {
8
+ public override readonly isContinuous = true;
9
+
8
10
  public constructor(
9
11
  delegate: GestureHandlerDelegate<unknown, IGestureHandler>
10
12
  ) {