react-native-gesture-handler 2.22.1 → 2.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/RNGestureHandler.podspec +8 -0
  2. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
  3. package/android/src/main/jni/cpp-adapter.cpp +19 -12
  4. package/apple/RNGestureHandler.mm +15 -8
  5. package/apple/RNGestureHandlerButton.mm +12 -2
  6. package/apple/RNGestureHandlerModule.mm +17 -5
  7. package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
  8. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  9. package/lib/commonjs/components/DrawerLayout.js +6 -0
  10. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  11. package/lib/commonjs/components/GestureButtons.js +11 -2
  12. package/lib/commonjs/components/GestureButtons.js.map +1 -1
  13. package/lib/commonjs/components/Pressable/Pressable.js +21 -5
  14. package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
  15. package/lib/commonjs/components/Pressable/index.js.map +1 -1
  16. package/lib/commonjs/components/ReanimatedSwipeable.js +49 -20
  17. package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
  18. package/lib/commonjs/components/Text.js +10 -4
  19. package/lib/commonjs/components/Text.js.map +1 -1
  20. package/lib/commonjs/components/touchables/TouchableHighlight.js +2 -0
  21. package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
  22. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +2 -0
  23. package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  24. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -1
  25. package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
  26. package/lib/commonjs/components/touchables/TouchableOpacity.js +2 -0
  27. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
  28. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +3 -0
  29. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  30. package/lib/commonjs/findNodeHandle.web.js +9 -1
  31. package/lib/commonjs/findNodeHandle.web.js.map +1 -1
  32. package/lib/commonjs/handlers/FlingGestureHandler.js +8 -0
  33. package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
  34. package/lib/commonjs/handlers/ForceTouchGestureHandler.js +5 -1
  35. package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
  36. package/lib/commonjs/handlers/LongPressGestureHandler.js +8 -0
  37. package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
  38. package/lib/commonjs/handlers/NativeViewGestureHandler.js +8 -0
  39. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
  40. package/lib/commonjs/handlers/PanGestureHandler.js +8 -0
  41. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  42. package/lib/commonjs/handlers/PinchGestureHandler.js +8 -0
  43. package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
  44. package/lib/commonjs/handlers/RotationGestureHandler.js +8 -0
  45. package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
  46. package/lib/commonjs/handlers/TapGestureHandler.js +8 -0
  47. package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
  48. package/lib/commonjs/handlers/createHandler.js +6 -2
  49. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  50. package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
  51. package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
  52. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
  53. package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  54. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +1 -1
  55. package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
  56. package/lib/commonjs/handlers/handlersRegistry.js +7 -2
  57. package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/utils.js +3 -3
  60. package/lib/commonjs/utils.js.map +1 -1
  61. package/lib/commonjs/web/detectors/RotationGestureDetector.js +22 -22
  62. package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
  63. package/lib/commonjs/web/detectors/ScaleGestureDetector.js +24 -24
  64. package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
  65. package/lib/commonjs/web/handlers/FlingGestureHandler.js +6 -6
  66. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  67. package/lib/commonjs/web/handlers/GestureHandler.js +112 -92
  68. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  69. package/lib/commonjs/web/handlers/HoverGestureHandler.js +2 -2
  70. package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
  71. package/lib/commonjs/web/handlers/LongPressGestureHandler.js +6 -6
  72. package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
  73. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +13 -13
  74. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  75. package/lib/commonjs/web/handlers/PanGestureHandler.js +15 -15
  76. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  77. package/lib/commonjs/web/handlers/PinchGestureHandler.js +15 -15
  78. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  79. package/lib/commonjs/web/handlers/RotationGestureHandler.js +12 -12
  80. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  81. package/lib/commonjs/web/handlers/TapGestureHandler.js +4 -4
  82. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  83. package/lib/commonjs/web/tools/CircularBuffer.js +15 -15
  84. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
  85. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +40 -40
  86. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  87. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +32 -13
  88. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  89. package/lib/commonjs/web/tools/InteractionManager.js +16 -18
  90. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  91. package/lib/commonjs/web/tools/NodeManager.js +2 -2
  92. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  93. package/lib/commonjs/web/tools/PointerTracker.js +18 -18
  94. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  95. package/lib/commonjs/web/tools/Vector.js.map +1 -1
  96. package/lib/commonjs/web/tools/VelocityTracker.js +1 -1
  97. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
  98. package/lib/module/RNGestureHandlerModule.web.js +2 -2
  99. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  100. package/lib/module/components/DrawerLayout.js +7 -0
  101. package/lib/module/components/DrawerLayout.js.map +1 -1
  102. package/lib/module/components/GestureButtons.js +10 -2
  103. package/lib/module/components/GestureButtons.js.map +1 -1
  104. package/lib/module/components/Pressable/Pressable.js +22 -6
  105. package/lib/module/components/Pressable/Pressable.js.map +1 -1
  106. package/lib/module/components/Pressable/index.js.map +1 -1
  107. package/lib/module/components/ReanimatedSwipeable.js +49 -20
  108. package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
  109. package/lib/module/components/Text.js +8 -3
  110. package/lib/module/components/Text.js.map +1 -1
  111. package/lib/module/components/touchables/TouchableHighlight.js +2 -0
  112. package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
  113. package/lib/module/components/touchables/TouchableNativeFeedback.android.js +2 -0
  114. package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
  115. package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
  116. package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
  117. package/lib/module/components/touchables/TouchableOpacity.js +5 -0
  118. package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
  119. package/lib/module/components/touchables/TouchableWithoutFeedback.js +4 -0
  120. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
  121. package/lib/module/findNodeHandle.web.js +8 -1
  122. package/lib/module/findNodeHandle.web.js.map +1 -1
  123. package/lib/module/handlers/FlingGestureHandler.js +7 -0
  124. package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
  125. package/lib/module/handlers/ForceTouchGestureHandler.js +5 -1
  126. package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
  127. package/lib/module/handlers/LongPressGestureHandler.js +7 -0
  128. package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
  129. package/lib/module/handlers/NativeViewGestureHandler.js +7 -0
  130. package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
  131. package/lib/module/handlers/PanGestureHandler.js +7 -0
  132. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  133. package/lib/module/handlers/PinchGestureHandler.js +11 -0
  134. package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
  135. package/lib/module/handlers/RotationGestureHandler.js +11 -0
  136. package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
  137. package/lib/module/handlers/TapGestureHandler.js +7 -0
  138. package/lib/module/handlers/TapGestureHandler.js.map +1 -1
  139. package/lib/module/handlers/createHandler.js +9 -4
  140. package/lib/module/handlers/createHandler.js.map +1 -1
  141. package/lib/module/handlers/gestures/GestureDetector/index.js +2 -2
  142. package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
  143. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
  144. package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
  145. package/lib/module/handlers/gestures/GestureDetector/utils.js +2 -2
  146. package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
  147. package/lib/module/handlers/handlersRegistry.js +6 -3
  148. package/lib/module/handlers/handlersRegistry.js.map +1 -1
  149. package/lib/module/index.js.map +1 -1
  150. package/lib/module/utils.js +2 -2
  151. package/lib/module/utils.js.map +1 -1
  152. package/lib/module/web/detectors/RotationGestureDetector.js +22 -22
  153. package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
  154. package/lib/module/web/detectors/ScaleGestureDetector.js +24 -24
  155. package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
  156. package/lib/module/web/handlers/FlingGestureHandler.js +6 -6
  157. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  158. package/lib/module/web/handlers/GestureHandler.js +112 -92
  159. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  160. package/lib/module/web/handlers/HoverGestureHandler.js +2 -2
  161. package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
  162. package/lib/module/web/handlers/LongPressGestureHandler.js +6 -6
  163. package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
  164. package/lib/module/web/handlers/NativeViewGestureHandler.js +13 -13
  165. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  166. package/lib/module/web/handlers/PanGestureHandler.js +15 -15
  167. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  168. package/lib/module/web/handlers/PinchGestureHandler.js +15 -15
  169. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  170. package/lib/module/web/handlers/RotationGestureHandler.js +12 -12
  171. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  172. package/lib/module/web/handlers/TapGestureHandler.js +4 -4
  173. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  174. package/lib/module/web/tools/CircularBuffer.js +15 -15
  175. package/lib/module/web/tools/CircularBuffer.js.map +1 -1
  176. package/lib/module/web/tools/GestureHandlerOrchestrator.js +40 -40
  177. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  178. package/lib/module/web/tools/GestureHandlerWebDelegate.js +32 -13
  179. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  180. package/lib/module/web/tools/InteractionManager.js +16 -16
  181. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  182. package/lib/module/web/tools/NodeManager.js +2 -2
  183. package/lib/module/web/tools/NodeManager.js.map +1 -1
  184. package/lib/module/web/tools/PointerTracker.js +18 -18
  185. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  186. package/lib/module/web/tools/Vector.js.map +1 -1
  187. package/lib/module/web/tools/VelocityTracker.js +1 -1
  188. package/lib/module/web/tools/VelocityTracker.js.map +1 -1
  189. package/lib/typescript/components/DrawerLayout.d.ts +27 -0
  190. package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
  191. package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
  192. package/lib/typescript/components/Pressable/index.d.ts +1 -1
  193. package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
  194. package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
  195. package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
  196. package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
  197. package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
  198. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
  199. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
  200. package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
  201. package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
  202. package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
  203. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
  204. package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
  205. package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
  206. package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
  207. package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
  208. package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
  209. package/lib/typescript/index.d.ts +1 -1
  210. package/lib/typescript/utils.d.ts +1 -1
  211. package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
  212. package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
  213. package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
  214. package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
  215. package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
  216. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
  217. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
  218. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
  219. package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
  220. package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
  221. package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
  222. package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
  223. package/package.json +2 -2
  224. package/src/RNGestureHandlerModule.web.ts +2 -2
  225. package/src/components/DrawerLayout.tsx +29 -0
  226. package/src/components/GestureButtons.tsx +13 -2
  227. package/src/components/GestureButtonsProps.ts +31 -2
  228. package/src/components/Pressable/Pressable.tsx +22 -5
  229. package/src/components/Pressable/PressableProps.tsx +4 -11
  230. package/src/components/Pressable/index.ts +4 -1
  231. package/src/components/ReanimatedSwipeable.tsx +97 -66
  232. package/src/components/Text.tsx +13 -4
  233. package/src/components/touchables/TouchableHighlight.tsx +5 -0
  234. package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
  235. package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
  236. package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
  237. package/src/components/touchables/TouchableOpacity.tsx +5 -0
  238. package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
  239. package/src/findNodeHandle.web.ts +6 -0
  240. package/src/handlers/FlingGestureHandler.ts +10 -0
  241. package/src/handlers/ForceTouchGestureHandler.ts +9 -0
  242. package/src/handlers/LongPressGestureHandler.ts +10 -0
  243. package/src/handlers/NativeViewGestureHandler.ts +10 -0
  244. package/src/handlers/PanGestureHandler.ts +10 -0
  245. package/src/handlers/PinchGestureHandler.ts +10 -0
  246. package/src/handlers/RotationGestureHandler.ts +10 -0
  247. package/src/handlers/TapGestureHandler.ts +10 -0
  248. package/src/handlers/createHandler.tsx +11 -4
  249. package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
  250. package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
  251. package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
  252. package/src/handlers/handlersRegistry.ts +7 -3
  253. package/src/index.ts +4 -1
  254. package/src/utils.ts +2 -2
  255. package/src/web/detectors/RotationGestureDetector.ts +22 -22
  256. package/src/web/detectors/ScaleGestureDetector.ts +24 -24
  257. package/src/web/handlers/FlingGestureHandler.ts +6 -7
  258. package/src/web/handlers/GestureHandler.ts +115 -105
  259. package/src/web/handlers/HoverGestureHandler.ts +2 -2
  260. package/src/web/handlers/IGestureHandler.ts +12 -13
  261. package/src/web/handlers/LongPressGestureHandler.ts +7 -7
  262. package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
  263. package/src/web/handlers/PanGestureHandler.ts +17 -17
  264. package/src/web/handlers/PinchGestureHandler.ts +17 -21
  265. package/src/web/handlers/RotationGestureHandler.ts +12 -12
  266. package/src/web/handlers/TapGestureHandler.ts +4 -6
  267. package/src/web/tools/CircularBuffer.ts +15 -15
  268. package/src/web/tools/GestureHandlerDelegate.ts +1 -1
  269. package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
  270. package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
  271. package/src/web/tools/InteractionManager.ts +16 -16
  272. package/src/web/tools/NodeManager.ts +2 -2
  273. package/src/web/tools/PointerTracker.ts +20 -20
  274. package/src/web/tools/Vector.ts +1 -1
  275. package/src/web/tools/VelocityTracker.ts +1 -1
@@ -21,30 +21,35 @@ import { GestureHandlerDelegate } from '../tools/GestureHandlerDelegate';
21
21
 
22
22
  export default abstract class GestureHandler implements IGestureHandler {
23
23
  private lastSentState: State | null = null;
24
- protected currentState: State = State.UNDETERMINED;
25
24
 
26
- protected shouldCancelWhenOutside = false;
25
+ private _state: State = State.UNDETERMINED;
26
+
27
+ private _shouldCancelWhenOutside = false;
27
28
  protected hasCustomActivationCriteria = false;
28
- protected enabled = false;
29
+ private _enabled = false;
29
30
 
30
31
  private viewRef!: number;
31
32
  private propsRef!: React.RefObject<unknown>;
32
- private handlerTag!: number;
33
- protected config: Config = { enabled: false };
33
+ private _handlerTag!: number;
34
+ private _config: Config = { enabled: false };
34
35
 
35
- protected tracker: PointerTracker = new PointerTracker();
36
+ private _tracker: PointerTracker = new PointerTracker();
36
37
 
37
38
  // Orchestrator properties
38
- protected activationIndex = 0;
39
- protected awaiting = false;
40
- protected active = false;
41
- protected shouldResetProgress = false;
42
- protected pointerType: PointerType = PointerType.MOUSE;
39
+ private _activationIndex = 0;
40
+
41
+ private _awaiting = false;
42
+ private _active = false;
43
+
44
+ private _shouldResetProgress = false;
45
+ private _pointerType: PointerType = PointerType.MOUSE;
43
46
 
44
- protected delegate: GestureHandlerDelegate<unknown, IGestureHandler>;
47
+ private _delegate: GestureHandlerDelegate<unknown, IGestureHandler>;
45
48
 
46
- constructor(delegate: GestureHandlerDelegate<unknown, IGestureHandler>) {
47
- this.delegate = delegate;
49
+ public constructor(
50
+ delegate: GestureHandlerDelegate<unknown, IGestureHandler>
51
+ ) {
52
+ this._delegate = delegate;
48
53
  }
49
54
 
50
55
  //
@@ -55,7 +60,7 @@ export default abstract class GestureHandler implements IGestureHandler {
55
60
  this.propsRef = propsRef;
56
61
  this.viewRef = viewRef;
57
62
 
58
- this.currentState = State.UNDETERMINED;
63
+ this.state = State.UNDETERMINED;
59
64
 
60
65
  this.delegate.init(viewRef, this);
61
66
  }
@@ -90,7 +95,7 @@ export default abstract class GestureHandler implements IGestureHandler {
90
95
  this.onReset();
91
96
  this.resetProgress();
92
97
  this.delegate.reset();
93
- this.currentState = State.UNDETERMINED;
98
+ this.state = State.UNDETERMINED;
94
99
  }
95
100
 
96
101
  //
@@ -98,22 +103,22 @@ export default abstract class GestureHandler implements IGestureHandler {
98
103
  //
99
104
 
100
105
  public moveToState(newState: State, sendIfDisabled?: boolean) {
101
- if (this.currentState === newState) {
106
+ if (this.state === newState) {
102
107
  return;
103
108
  }
104
109
 
105
- const oldState = this.currentState;
106
- this.currentState = newState;
110
+ const oldState = this.state;
111
+ this.state = newState;
107
112
 
108
113
  if (
109
- this.tracker.getTrackedPointersCount() > 0 &&
114
+ this.tracker.trackedPointersCount > 0 &&
110
115
  this.config.needsPointerData &&
111
116
  this.isFinished()
112
117
  ) {
113
118
  this.cancelTouches();
114
119
  }
115
120
 
116
- GestureHandlerOrchestrator.getInstance().onHandlerStateChange(
121
+ GestureHandlerOrchestrator.instance.onHandlerStateChange(
117
122
  this,
118
123
  newState,
119
124
  oldState,
@@ -123,7 +128,7 @@ export default abstract class GestureHandler implements IGestureHandler {
123
128
  this.onStateChange(newState, oldState);
124
129
 
125
130
  if (!this.enabled && this.isFinished()) {
126
- this.currentState = State.UNDETERMINED;
131
+ this.state = State.UNDETERMINED;
127
132
  }
128
133
  }
129
134
 
@@ -134,7 +139,7 @@ export default abstract class GestureHandler implements IGestureHandler {
134
139
  return;
135
140
  }
136
141
 
137
- if (this.currentState === State.UNDETERMINED) {
142
+ if (this.state === State.UNDETERMINED) {
138
143
  this.moveToState(State.BEGAN);
139
144
  }
140
145
  }
@@ -143,10 +148,7 @@ export default abstract class GestureHandler implements IGestureHandler {
143
148
  * @param {boolean} sendIfDisabled - Used when handler becomes disabled. With this flag orchestrator will be forced to send fail event
144
149
  */
145
150
  public fail(sendIfDisabled?: boolean): void {
146
- if (
147
- this.currentState === State.ACTIVE ||
148
- this.currentState === State.BEGAN
149
- ) {
151
+ if (this.state === State.ACTIVE || this.state === State.BEGAN) {
150
152
  // Here the order of calling the delegate and moveToState is important.
151
153
  // At this point we can use currentState as previuos state, because immediately after changing cursor we call moveToState method.
152
154
  this.delegate.onFail();
@@ -162,9 +164,9 @@ export default abstract class GestureHandler implements IGestureHandler {
162
164
  */
163
165
  public cancel(sendIfDisabled?: boolean): void {
164
166
  if (
165
- this.currentState === State.ACTIVE ||
166
- this.currentState === State.UNDETERMINED ||
167
- this.currentState === State.BEGAN
167
+ this.state === State.ACTIVE ||
168
+ this.state === State.UNDETERMINED ||
169
+ this.state === State.BEGAN
168
170
  ) {
169
171
  this.onCancel();
170
172
 
@@ -178,8 +180,7 @@ export default abstract class GestureHandler implements IGestureHandler {
178
180
  public activate(force = false) {
179
181
  if (
180
182
  (this.config.manualActivation !== true || force) &&
181
- (this.currentState === State.UNDETERMINED ||
182
- this.currentState === State.BEGAN)
183
+ (this.state === State.UNDETERMINED || this.state === State.BEGAN)
183
184
  ) {
184
185
  this.delegate.onActivate();
185
186
  this.moveToState(State.ACTIVE);
@@ -187,10 +188,7 @@ export default abstract class GestureHandler implements IGestureHandler {
187
188
  }
188
189
 
189
190
  public end() {
190
- if (
191
- this.currentState === State.BEGAN ||
192
- this.currentState === State.ACTIVE
193
- ) {
191
+ if (this.state === State.BEGAN || this.state === State.ACTIVE) {
194
192
  // Same as above - order matters
195
193
  this.delegate.onEnd();
196
194
 
@@ -204,20 +202,6 @@ export default abstract class GestureHandler implements IGestureHandler {
204
202
  // Methods for orchestrator
205
203
  //
206
204
 
207
- public isAwaiting(): boolean {
208
- return this.awaiting;
209
- }
210
- public setAwaiting(value: boolean): void {
211
- this.awaiting = value;
212
- }
213
-
214
- public isActive(): boolean {
215
- return this.active;
216
- }
217
- public setActive(value: boolean): void {
218
- this.active = value;
219
- }
220
-
221
205
  public getShouldResetProgress(): boolean {
222
206
  return this.shouldResetProgress;
223
207
  }
@@ -225,19 +209,12 @@ export default abstract class GestureHandler implements IGestureHandler {
225
209
  this.shouldResetProgress = value;
226
210
  }
227
211
 
228
- public getActivationIndex(): number {
229
- return this.activationIndex;
230
- }
231
- public setActivationIndex(value: number): void {
232
- this.activationIndex = value;
233
- }
234
-
235
212
  public shouldWaitForHandlerFailure(handler: IGestureHandler): boolean {
236
213
  if (handler === this) {
237
214
  return false;
238
215
  }
239
216
 
240
- return InteractionManager.getInstance().shouldWaitForHandlerFailure(
217
+ return InteractionManager.instance.shouldWaitForHandlerFailure(
241
218
  this,
242
219
  handler
243
220
  );
@@ -248,7 +225,7 @@ export default abstract class GestureHandler implements IGestureHandler {
248
225
  return false;
249
226
  }
250
227
 
251
- return InteractionManager.getInstance().shouldRequireHandlerToWaitForFailure(
228
+ return InteractionManager.instance.shouldRequireHandlerToWaitForFailure(
252
229
  this,
253
230
  handler
254
231
  );
@@ -259,7 +236,7 @@ export default abstract class GestureHandler implements IGestureHandler {
259
236
  return true;
260
237
  }
261
238
 
262
- return InteractionManager.getInstance().shouldRecognizeSimultaneously(
239
+ return InteractionManager.instance.shouldRecognizeSimultaneously(
263
240
  this,
264
241
  handler
265
242
  );
@@ -270,7 +247,7 @@ export default abstract class GestureHandler implements IGestureHandler {
270
247
  return false;
271
248
  }
272
249
 
273
- return InteractionManager.getInstance().shouldHandlerBeCancelledBy(
250
+ return InteractionManager.instance.shouldHandlerBeCancelledBy(
274
251
  this,
275
252
  handler
276
253
  );
@@ -281,11 +258,11 @@ export default abstract class GestureHandler implements IGestureHandler {
281
258
  //
282
259
 
283
260
  protected onPointerDown(event: AdaptedEvent): void {
284
- GestureHandlerOrchestrator.getInstance().recordHandlerIfNotPresent(this);
261
+ GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(this);
285
262
  this.pointerType = event.pointerType;
286
263
 
287
264
  if (this.pointerType === PointerType.TOUCH) {
288
- GestureHandlerOrchestrator.getInstance().cancelMouseAndPenGestures(this);
265
+ GestureHandlerOrchestrator.instance.cancelMouseAndPenGestures(this);
289
266
  }
290
267
 
291
268
  // TODO: Bring back touch events along with introducing `handleDown` method that will handle handler specific stuff
@@ -306,7 +283,7 @@ export default abstract class GestureHandler implements IGestureHandler {
306
283
  }
307
284
  protected onPointerLeave(event: AdaptedEvent): void {
308
285
  if (this.shouldCancelWhenOutside) {
309
- switch (this.currentState) {
286
+ switch (this.state) {
310
287
  case State.ACTIVE:
311
288
  this.cancel();
312
289
  break;
@@ -346,7 +323,7 @@ export default abstract class GestureHandler implements IGestureHandler {
346
323
  }
347
324
 
348
325
  if (this.active) {
349
- this.sendEvent(this.currentState, this.currentState);
326
+ this.sendEvent(this.state, this.state);
350
327
  }
351
328
 
352
329
  this.tryToSendTouchEvent(event);
@@ -396,7 +373,7 @@ export default abstract class GestureHandler implements IGestureHandler {
396
373
  this.lastSentState = newState;
397
374
  invokeNullableMethod(onGestureHandlerStateChange, resultEvent);
398
375
  }
399
- if (this.currentState === State.ACTIVE) {
376
+ if (this.state === State.ACTIVE) {
400
377
  resultEvent.nativeEvent.oldState = undefined;
401
378
  invokeNullableMethod(onGestureHandlerEvent, resultEvent);
402
379
  }
@@ -405,7 +382,7 @@ export default abstract class GestureHandler implements IGestureHandler {
405
382
  private transformEventData(newState: State, oldState: State): ResultEvent {
406
383
  return {
407
384
  nativeEvent: {
408
- numberOfPointers: this.tracker.getTrackedPointersCount(),
385
+ numberOfPointers: this.tracker.trackedPointersCount,
409
386
  state: newState,
410
387
  pointerInside: this.delegate.isPointerInBounds(
411
388
  this.tracker.getAbsoluteCoordsAverage()
@@ -428,7 +405,7 @@ export default abstract class GestureHandler implements IGestureHandler {
428
405
  const all: PointerData[] = [];
429
406
  const changed: PointerData[] = [];
430
407
 
431
- const trackerData = this.tracker.getData();
408
+ const trackerData = this.tracker.trackedPointers;
432
409
 
433
410
  // This if handles edge case where all pointers have been cancelled
434
411
  // When pointercancel is triggered, reset method is called. This means that tracker will be reset after first pointer being cancelled
@@ -508,7 +485,7 @@ export default abstract class GestureHandler implements IGestureHandler {
508
485
  return {
509
486
  nativeEvent: {
510
487
  handlerTag: this.handlerTag,
511
- state: this.currentState,
488
+ state: this.state,
512
489
  eventType: eventType,
513
490
  changedTouches: changed,
514
491
  allTouches: all,
@@ -525,7 +502,7 @@ export default abstract class GestureHandler implements IGestureHandler {
525
502
  const all: PointerData[] = [];
526
503
  const changed: PointerData[] = [];
527
504
 
528
- const trackerData = this.tracker.getData();
505
+ const trackerData = this.tracker.trackedPointers;
529
506
 
530
507
  if (trackerData.size === 0) {
531
508
  return;
@@ -554,7 +531,7 @@ export default abstract class GestureHandler implements IGestureHandler {
554
531
  const cancelEvent: ResultTouchEvent = {
555
532
  nativeEvent: {
556
533
  handlerTag: this.handlerTag,
557
- state: this.currentState,
534
+ state: this.state,
558
535
  eventType: TouchEventType.CANCELLED,
559
536
  changedTouches: changed,
560
537
  allTouches: all,
@@ -588,13 +565,13 @@ export default abstract class GestureHandler implements IGestureHandler {
588
565
  //
589
566
 
590
567
  public updateGestureConfig({ enabled = true, ...props }: Config): void {
591
- this.config = { enabled: enabled, ...props };
568
+ this._config = { enabled: enabled, ...props };
592
569
  this.enabled = enabled;
593
570
 
594
571
  this.delegate.onEnabledChange(enabled);
595
572
 
596
573
  if (this.config.shouldCancelWhenOutside !== undefined) {
597
- this.setShouldCancelWhenOutside(this.config.shouldCancelWhenOutside);
574
+ this.shouldCancelWhenOutside = this.config.shouldCancelWhenOutside;
598
575
  }
599
576
 
600
577
  this.validateHitSlops();
@@ -603,14 +580,12 @@ export default abstract class GestureHandler implements IGestureHandler {
603
580
  return;
604
581
  }
605
582
 
606
- switch (this.currentState) {
583
+ switch (this.state) {
607
584
  case State.ACTIVE:
608
585
  this.fail(true);
609
586
  break;
610
587
  case State.UNDETERMINED:
611
- GestureHandlerOrchestrator.getInstance().removeHandlerFromOrchestrator(
612
- this
613
- );
588
+ GestureHandlerOrchestrator.instance.removeHandlerFromOrchestrator(this);
614
589
  break;
615
590
  default:
616
591
  this.cancel(true);
@@ -753,56 +728,91 @@ export default abstract class GestureHandler implements IGestureHandler {
753
728
  // Getters and setters
754
729
  //
755
730
 
756
- public getTag(): number {
757
- return this.handlerTag;
731
+ public get handlerTag() {
732
+ return this._handlerTag;
733
+ }
734
+ public set handlerTag(value: number) {
735
+ this._handlerTag = value;
758
736
  }
759
737
 
760
- public setTag(tag: number): void {
761
- this.handlerTag = tag;
738
+ public get config(): Config {
739
+ return this._config;
762
740
  }
763
741
 
764
- public getConfig() {
765
- return this.config;
742
+ public get delegate() {
743
+ return this._delegate;
766
744
  }
767
745
 
768
- public getDelegate(): GestureHandlerDelegate<unknown, IGestureHandler> {
769
- return this.delegate;
746
+ public get tracker() {
747
+ return this._tracker;
770
748
  }
771
749
 
772
- public getTracker(): PointerTracker {
773
- return this.tracker;
750
+ public get state(): State {
751
+ return this._state;
752
+ }
753
+ protected set state(value: State) {
754
+ this._state = value;
774
755
  }
775
756
 
776
- public getTrackedPointersID(): number[] {
777
- return this.tracker.getTrackedPointersID();
757
+ public get shouldCancelWhenOutside() {
758
+ return this._shouldCancelWhenOutside;
759
+ }
760
+ protected set shouldCancelWhenOutside(value) {
761
+ this._shouldCancelWhenOutside = value;
778
762
  }
779
763
 
780
- public getState(): State {
781
- return this.currentState;
764
+ public get enabled() {
765
+ return this._enabled;
766
+ }
767
+ protected set enabled(value) {
768
+ this._enabled = value;
782
769
  }
783
770
 
784
- public isEnabled(): boolean {
785
- return this.enabled;
771
+ public get pointerType(): PointerType {
772
+ return this._pointerType;
773
+ }
774
+ protected set pointerType(value: PointerType) {
775
+ this._pointerType = value;
786
776
  }
787
777
 
788
- private isFinished(): boolean {
789
- return (
790
- this.currentState === State.END ||
791
- this.currentState === State.FAILED ||
792
- this.currentState === State.CANCELLED
793
- );
778
+ public get active() {
779
+ return this._active;
780
+ }
781
+ protected set active(value) {
782
+ this._active = value;
783
+ }
784
+
785
+ public get awaiting() {
786
+ return this._awaiting;
787
+ }
788
+ protected set awaiting(value) {
789
+ this._awaiting = value;
794
790
  }
795
791
 
796
- protected setShouldCancelWhenOutside(shouldCancel: boolean) {
797
- this.shouldCancelWhenOutside = shouldCancel;
792
+ public get activationIndex() {
793
+ return this._activationIndex;
794
+ }
795
+ protected set activationIndex(value) {
796
+ this._activationIndex = value;
798
797
  }
799
798
 
800
- protected getShouldCancelWhenOutside(): boolean {
801
- return this.shouldCancelWhenOutside;
799
+ public get shouldResetProgress() {
800
+ return this._shouldResetProgress;
801
+ }
802
+ protected set shouldResetProgress(value) {
803
+ this._shouldResetProgress = value;
802
804
  }
803
805
 
804
- public getPointerType(): PointerType {
805
- return this.pointerType;
806
+ public getTrackedPointersID(): number[] {
807
+ return this.tracker.trackedPointersIDs;
808
+ }
809
+
810
+ private isFinished(): boolean {
811
+ return (
812
+ this.state === State.END ||
813
+ this.state === State.FAILED ||
814
+ this.state === State.CANCELLED
815
+ );
806
816
  }
807
817
  }
808
818
 
@@ -14,13 +14,13 @@ export default class HoverGestureHandler extends GestureHandler {
14
14
  }
15
15
 
16
16
  protected onPointerMoveOver(event: AdaptedEvent): void {
17
- GestureHandlerOrchestrator.getInstance().recordHandlerIfNotPresent(this);
17
+ GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(this);
18
18
 
19
19
  this.tracker.addToTracker(event);
20
20
  this.stylusData = event.stylusData;
21
21
  super.onPointerMoveOver(event);
22
22
 
23
- if (this.getState() === State.UNDETERMINED) {
23
+ if (this.state === State.UNDETERMINED) {
24
24
  this.begin();
25
25
  this.activate();
26
26
  }
@@ -7,19 +7,25 @@ import type { GestureHandlerDelegate } from '../tools/GestureHandlerDelegate';
7
7
  import type PointerTracker from '../tools/PointerTracker';
8
8
 
9
9
  export default interface IGestureHandler {
10
- getTag: () => number;
11
- getState: () => State;
12
- getConfig: () => Config;
13
- getDelegate: () => GestureHandlerDelegate<unknown, this>;
10
+ active: boolean;
11
+ activationIndex: number;
12
+ awaiting: boolean;
13
+ handlerTag: number;
14
+ readonly config: Config;
15
+ readonly delegate: GestureHandlerDelegate<unknown, this>;
16
+ readonly tracker: PointerTracker;
17
+ state: State;
18
+ shouldCancelWhenOutside: boolean;
19
+ shouldResetProgress: boolean;
20
+ enabled: boolean;
21
+ pointerType: PointerType;
14
22
 
15
23
  attachEventManager: (manager: EventManager<unknown>) => void;
16
24
 
17
25
  isButtonInConfig: (
18
26
  mouseButton: MouseButton | undefined
19
27
  ) => boolean | number | undefined;
20
- getPointerType: () => PointerType;
21
28
 
22
- getTracker: () => PointerTracker;
23
29
  getTrackedPointersID: () => number[];
24
30
 
25
31
  begin: () => void;
@@ -29,13 +35,6 @@ export default interface IGestureHandler {
29
35
  cancel: () => void;
30
36
 
31
37
  reset: () => void;
32
- isEnabled: () => boolean;
33
- isActive: () => boolean;
34
- setActive: (value: boolean) => void;
35
- isAwaiting: () => boolean;
36
- setAwaiting: (value: boolean) => void;
37
- setActivationIndex: (value: number) => void;
38
- setShouldResetProgress: (value: boolean) => void;
39
38
 
40
39
  shouldWaitForHandlerFailure: (handler: IGestureHandler) => boolean;
41
40
  shouldRequireToWaitForFailure: (handler: IGestureHandler) => boolean;
@@ -82,7 +82,7 @@ export default class LongPressGestureHandler extends GestureHandler {
82
82
  super.onPointerAdd(event);
83
83
  this.tracker.addToTracker(event);
84
84
 
85
- if (this.tracker.getTrackedPointersCount() > this.numberOfPointers) {
85
+ if (this.tracker.trackedPointersCount > this.numberOfPointers) {
86
86
  this.fail();
87
87
  return;
88
88
  }
@@ -111,7 +111,7 @@ export default class LongPressGestureHandler extends GestureHandler {
111
111
  super.onPointerUp(event);
112
112
  this.tracker.removeFromTracker(event.pointerId);
113
113
 
114
- if (this.currentState === State.ACTIVE) {
114
+ if (this.state === State.ACTIVE) {
115
115
  this.end();
116
116
  } else {
117
117
  this.fail();
@@ -123,15 +123,15 @@ export default class LongPressGestureHandler extends GestureHandler {
123
123
  this.tracker.removeFromTracker(event.pointerId);
124
124
 
125
125
  if (
126
- this.tracker.getTrackedPointersCount() < this.numberOfPointers &&
127
- this.getState() !== State.ACTIVE
126
+ this.tracker.trackedPointersCount < this.numberOfPointers &&
127
+ this.state !== State.ACTIVE
128
128
  ) {
129
129
  this.fail();
130
130
  }
131
131
  }
132
132
 
133
133
  private tryBegin(): void {
134
- if (this.currentState !== State.UNDETERMINED) {
134
+ if (this.state !== State.UNDETERMINED) {
135
135
  return;
136
136
  }
137
137
 
@@ -142,7 +142,7 @@ export default class LongPressGestureHandler extends GestureHandler {
142
142
  }
143
143
 
144
144
  private tryActivate(): void {
145
- if (this.tracker.getTrackedPointersCount() !== this.numberOfPointers) {
145
+ if (this.tracker.trackedPointersCount !== this.numberOfPointers) {
146
146
  return;
147
147
  }
148
148
 
@@ -166,7 +166,7 @@ export default class LongPressGestureHandler extends GestureHandler {
166
166
  return;
167
167
  }
168
168
 
169
- if (this.currentState === State.ACTIVE) {
169
+ if (this.state === State.ACTIVE) {
170
170
  this.cancel();
171
171
  } else {
172
172
  this.fail();
@@ -19,13 +19,13 @@ export default class NativeViewGestureHandler extends GestureHandler {
19
19
  public init(ref: number, propsRef: React.RefObject<unknown>): void {
20
20
  super.init(ref, propsRef);
21
21
 
22
- this.setShouldCancelWhenOutside(true);
22
+ this.shouldCancelWhenOutside = true;
23
23
 
24
24
  if (Platform.OS !== 'web') {
25
25
  return;
26
26
  }
27
27
 
28
- const view = this.delegate.getView() as HTMLElement;
28
+ const view = this.delegate.view as HTMLElement;
29
29
 
30
30
  this.restoreViewStyles(view);
31
31
  this.buttonRole = view.getAttribute('role') === 'button';
@@ -41,7 +41,7 @@ export default class NativeViewGestureHandler extends GestureHandler {
41
41
  this.disallowInterruption = this.config.disallowInterruption;
42
42
  }
43
43
 
44
- const view = this.delegate.getView() as HTMLElement;
44
+ const view = this.delegate.view as HTMLElement;
45
45
  this.restoreViewStyles(view);
46
46
  }
47
47
 
@@ -74,13 +74,13 @@ export default class NativeViewGestureHandler extends GestureHandler {
74
74
  this.startX = lastCoords.x;
75
75
  this.startY = lastCoords.y;
76
76
 
77
- if (this.currentState !== State.UNDETERMINED) {
77
+ if (this.state !== State.UNDETERMINED) {
78
78
  return;
79
79
  }
80
80
 
81
81
  this.begin();
82
82
 
83
- const view = this.delegate.getView() as HTMLElement;
83
+ const view = this.delegate.view as HTMLElement;
84
84
  const isRNGHText = view.hasAttribute('rnghtext');
85
85
 
86
86
  if (this.buttonRole || isRNGHText) {
@@ -97,19 +97,16 @@ export default class NativeViewGestureHandler extends GestureHandler {
97
97
  const distSq = dx * dx + dy * dy;
98
98
 
99
99
  if (distSq >= this.minDistSq) {
100
- if (this.buttonRole && this.currentState === State.ACTIVE) {
100
+ if (this.buttonRole && this.state === State.ACTIVE) {
101
101
  this.cancel();
102
- } else if (!this.buttonRole && this.currentState === State.BEGAN) {
102
+ } else if (!this.buttonRole && this.state === State.BEGAN) {
103
103
  this.activate();
104
104
  }
105
105
  }
106
106
  }
107
107
 
108
108
  protected onPointerLeave(): void {
109
- if (
110
- this.currentState === State.BEGAN ||
111
- this.currentState === State.ACTIVE
112
- ) {
109
+ if (this.state === State.BEGAN || this.state === State.ACTIVE) {
113
110
  this.cancel();
114
111
  }
115
112
  }
@@ -127,8 +124,8 @@ export default class NativeViewGestureHandler extends GestureHandler {
127
124
  private onUp(event: AdaptedEvent): void {
128
125
  this.tracker.removeFromTracker(event.pointerId);
129
126
 
130
- if (this.tracker.getTrackedPointersCount() === 0) {
131
- if (this.currentState === State.ACTIVE) {
127
+ if (this.tracker.trackedPointersCount === 0) {
128
+ if (this.state === State.ACTIVE) {
132
129
  this.end();
133
130
  } else {
134
131
  this.fail();
@@ -143,7 +140,7 @@ export default class NativeViewGestureHandler extends GestureHandler {
143
140
 
144
141
  if (
145
142
  handler instanceof NativeViewGestureHandler &&
146
- handler.getState() === State.ACTIVE &&
143
+ handler.state === State.ACTIVE &&
147
144
  handler.disallowsInterruption()
148
145
  ) {
149
146
  return false;
@@ -152,17 +149,15 @@ export default class NativeViewGestureHandler extends GestureHandler {
152
149
  const canBeInterrupted = !this.disallowInterruption;
153
150
 
154
151
  if (
155
- this.currentState === State.ACTIVE &&
156
- handler.getState() === State.ACTIVE &&
152
+ this.state === State.ACTIVE &&
153
+ handler.state === State.ACTIVE &&
157
154
  canBeInterrupted
158
155
  ) {
159
156
  return false;
160
157
  }
161
158
 
162
159
  return (
163
- this.currentState === State.ACTIVE &&
164
- canBeInterrupted &&
165
- handler.getTag() > 0
160
+ this.state === State.ACTIVE && canBeInterrupted && handler.handlerTag > 0
166
161
  );
167
162
  }
168
163