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,19 +1,9 @@
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 { DiagonalDirections, Directions } from '../../Directions';
4
4
  import { MINIMAL_RECOGNIZABLE_MAGNITUDE } from '../constants';
5
5
  export default class Vector {
6
6
  constructor(x, y) {
7
- _defineProperty(this, "x", void 0);
8
-
9
- _defineProperty(this, "y", void 0);
10
-
11
- _defineProperty(this, "unitX", void 0);
12
-
13
- _defineProperty(this, "unitY", void 0);
14
-
15
- _defineProperty(this, "_magnitude", void 0);
16
-
17
7
  this.x = x;
18
8
  this.y = y;
19
9
  this._magnitude = Math.hypot(this.x, this.y);
@@ -21,30 +11,22 @@ export default class Vector {
21
11
  this.unitX = isMagnitudeSufficient ? this.x / this._magnitude : 0;
22
12
  this.unitY = isMagnitudeSufficient ? this.y / this._magnitude : 0;
23
13
  }
24
-
25
14
  static fromDirection(direction) {
26
- var _DirectionToVectorMap;
27
-
28
- return (_DirectionToVectorMap = DirectionToVectorMappings.get(direction)) !== null && _DirectionToVectorMap !== void 0 ? _DirectionToVectorMap : new Vector(0, 0);
15
+ return DirectionToVectorMappings.get(direction) ?? new Vector(0, 0);
29
16
  }
30
-
31
17
  static fromVelocity(tracker, pointerId) {
32
18
  const velocity = tracker.getVelocity(pointerId);
33
19
  return new Vector(velocity.x, velocity.y);
34
20
  }
35
-
36
21
  get magnitude() {
37
22
  return this._magnitude;
38
23
  }
39
-
40
24
  computeSimilarity(vector) {
41
25
  return this.unitX * vector.unitX + this.unitY * vector.unitY;
42
26
  }
43
-
44
27
  isSimilar(vector, threshold) {
45
28
  return this.computeSimilarity(vector) > threshold;
46
29
  }
47
-
48
30
  }
49
31
  const DirectionToVectorMappings = new Map([[Directions.LEFT, new Vector(-1, 0)], [Directions.RIGHT, new Vector(1, 0)], [Directions.UP, new Vector(0, -1)], [Directions.DOWN, new Vector(0, 1)], [DiagonalDirections.UP_RIGHT, new Vector(1, -1)], [DiagonalDirections.DOWN_RIGHT, new Vector(1, 1)], [DiagonalDirections.UP_LEFT, new Vector(-1, -1)], [DiagonalDirections.DOWN_LEFT, new Vector(-1, 1)]]);
50
32
  //# sourceMappingURL=Vector.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Vector.ts"],"names":["DiagonalDirections","Directions","MINIMAL_RECOGNIZABLE_MAGNITUDE","Vector","constructor","x","y","_magnitude","Math","hypot","isMagnitudeSufficient","unitX","unitY","fromDirection","direction","DirectionToVectorMappings","get","fromVelocity","tracker","pointerId","velocity","getVelocity","magnitude","computeSimilarity","vector","isSimilar","threshold","Map","LEFT","RIGHT","UP","DOWN","UP_RIGHT","DOWN_RIGHT","UP_LEFT","DOWN_LEFT"],"mappings":";;AAAA,SAASA,kBAAT,EAA6BC,UAA7B,QAA+C,kBAA/C;AACA,SAASC,8BAAT,QAA+C,cAA/C;AAGA,eAAe,MAAMC,MAAN,CAAa;AAO1BC,EAAAA,WAAW,CAACC,CAAD,EAAYC,CAAZ,E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AC2B,IAAZ,EAAkB,IAAIzB,MAAJ,CAAW,CAAC,CAAZ,EAAe,CAAf,CAAlB,CADA,EAEA,CAACF,UAAU,CAAC4B,KAAZ,EAAmB,IAAI1B,MAAJ,CAAW,CAAX,EAAc,CAAd,CAAnB,CAFA,EAGA,CAACF,UAAU,CAAC6B,EAAZ,EAAgB,IAAI3B,MAAJ,CAAW,CAAX,EAAc,CAAC,CAAf,CAAhB,CAHA,EAIA,CAACF,UAAU,CAAC8B,IAAZ,EAAkB,IAAI5B,MAAJ,CAAW,CAAX,EAAc,CAAd,CAAlB,CAJA,EAMA,CAACH,kBAAkB,CAACgC,QAApB,EAA8B,IAAI7B,MAAJ,CAAW,CAAX,EAAc,CAAC,CAAf,CAA9B,CANA,EAOA,CAACH,kBAAkB,CAACiC,UAApB,EAAgC,IAAI9B,MAAJ,CAAW,CAAX,EAAc,CAAd,CAAhC,CAPA,EAQA,CAACH,kBAAkB,CAACkC,OAApB,EAA6B,IAAI/B,MAAJ,CAAW,CAAC,CAAZ,EAAe,CAAC,CAAhB,CAA7B,CARA,EASA,CAACH,kBAAkB,CAACmC,SAApB,EAA+B,IAAIhC,MAAJ,CAAW,CAAC,CAAZ,EAAe,CAAf,CAA/B,CATA,CAHgC,CAAlC","sourcesContent":["import { DiagonalDirections, Directions } from '../../Directions';\nimport { MINIMAL_RECOGNIZABLE_MAGNITUDE } from '../constants';\nimport PointerTracker from './PointerTracker';\n\nexport default class Vector {\n private readonly x;\n private readonly y;\n private readonly unitX;\n private readonly unitY;\n private readonly _magnitude;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n\n this._magnitude = Math.hypot(this.x, this.y);\n const isMagnitudeSufficient =\n this._magnitude > MINIMAL_RECOGNIZABLE_MAGNITUDE;\n\n this.unitX = isMagnitudeSufficient ? this.x / this._magnitude : 0;\n this.unitY = isMagnitudeSufficient ? this.y / this._magnitude : 0;\n }\n\n static fromDirection(direction: Directions | DiagonalDirections): Vector {\n return DirectionToVectorMappings.get(direction) ?? new Vector(0, 0);\n }\n\n static fromVelocity(tracker: PointerTracker, pointerId: number) {\n const velocity = tracker.getVelocity(pointerId);\n return new Vector(velocity.x, velocity.y);\n }\n\n public get magnitude() {\n return this._magnitude;\n }\n\n computeSimilarity(vector: Vector) {\n return this.unitX * vector.unitX + this.unitY * vector.unitY;\n }\n\n isSimilar(vector: Vector, threshold: number) {\n return this.computeSimilarity(vector) > threshold;\n }\n}\n\nconst DirectionToVectorMappings = new Map<\n Directions | DiagonalDirections,\n Vector\n>([\n [Directions.LEFT, new Vector(-1, 0)],\n [Directions.RIGHT, new Vector(1, 0)],\n [Directions.UP, new Vector(0, -1)],\n [Directions.DOWN, new Vector(0, 1)],\n\n [DiagonalDirections.UP_RIGHT, new Vector(1, -1)],\n [DiagonalDirections.DOWN_RIGHT, new Vector(1, 1)],\n [DiagonalDirections.UP_LEFT, new Vector(-1, -1)],\n [DiagonalDirections.DOWN_LEFT, new Vector(-1, 1)],\n]);\n"]}
1
+ {"version":3,"names":["DiagonalDirections","Directions","MINIMAL_RECOGNIZABLE_MAGNITUDE","Vector","constructor","x","y","_magnitude","Math","hypot","isMagnitudeSufficient","unitX","unitY","fromDirection","direction","DirectionToVectorMappings","get","fromVelocity","tracker","pointerId","velocity","getVelocity","magnitude","computeSimilarity","vector","isSimilar","threshold","Map","LEFT","RIGHT","UP","DOWN","UP_RIGHT","DOWN_RIGHT","UP_LEFT","DOWN_LEFT"],"sourceRoot":"../../../../src","sources":["web/tools/Vector.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,UAAU,QAAQ,kBAAkB;AACjE,SAASC,8BAA8B,QAAQ,cAAc;AAG7D,eAAe,MAAMC,MAAM,CAAC;EAO1BC,WAAWA,CAACC,CAAS,EAAEC,CAAS,EAAE;IAChC,IAAI,CAACD,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,CAAC,GAAGA,CAAC;IAEV,IAAI,CAACC,UAAU,GAAGC,IAAI,CAACC,KAAK,CAA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AE,CAAC,CAAC,CAAC,EACpC,CAACF,UAAU,CAAC6B,EAAE,EAAE,IAAI3B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAClC,CAACF,UAAU,CAAC8B,IAAI,EAAE,IAAI5B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAEnC,CAACH,kBAAkB,CAACgC,QAAQ,EAAE,IAAI7B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAChD,CAACH,kBAAkB,CAACiC,UAAU,EAAE,IAAI9B,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EACjD,CAACH,kBAAkB,CAACkC,OAAO,EAAE,IAAI/B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAChD,CAACH,kBAAkB,CAACmC,SAAS,EAAE,IAAIhC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAClD,CAAC","ignoreList":[]}
@@ -1,32 +1,25 @@
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 CircularBuffer from './CircularBuffer';
4
4
  import LeastSquareSolver from './LeastSquareSolver';
5
5
  export default class VelocityTracker {
6
+ assumePointerMoveStoppedMilliseconds = 40;
7
+ historySize = 20;
8
+ horizonMilliseconds = 300;
9
+ minSampleSize = 3;
6
10
  constructor() {
7
- _defineProperty(this, "assumePointerMoveStoppedMilliseconds", 40);
8
-
9
- _defineProperty(this, "historySize", 20);
10
-
11
- _defineProperty(this, "horizonMilliseconds", 300);
12
-
13
- _defineProperty(this, "minSampleSize", 3);
14
-
15
- _defineProperty(this, "samples", void 0);
16
-
17
11
  this.samples = new CircularBuffer(this.historySize);
18
12
  }
19
-
20
13
  add(event) {
21
14
  this.samples.push(event);
22
- } // Returns an estimate of the velocity of the object being tracked by the
15
+ }
16
+
17
+ // Returns an estimate of the velocity of the object being tracked by the
23
18
  // tracker given the current information available to the tracker.
24
19
  //
25
20
  // Information is added using [addPosition].
26
21
  //
27
22
  // Returns null if there is no data on which to base an estimate.
28
-
29
-
30
23
  getVelocityEstimate() {
31
24
  const x = [];
32
25
  const y = [];
@@ -35,24 +28,21 @@ export default class VelocityTracker {
35
28
  let sampleCount = 0;
36
29
  let index = this.samples.size - 1;
37
30
  const newestSample = this.samples.get(index);
38
-
39
31
  if (!newestSample) {
40
32
  return null;
41
33
  }
34
+ let previousSample = newestSample;
42
35
 
43
- let previousSample = newestSample; // Starting with the most recent PointAtTime sample, iterate backwards while
36
+ // Starting with the most recent PointAtTime sample, iterate backwards while
44
37
  // the samples represent continuous motion.
45
-
46
38
  while (sampleCount < this.samples.size) {
47
39
  const sample = this.samples.get(index);
48
40
  const age = newestSample.time - sample.time;
49
41
  const delta = Math.abs(sample.time - previousSample.time);
50
42
  previousSample = sample;
51
-
52
43
  if (age > this.horizonMilliseconds || delta > this.assumePointerMoveStoppedMilliseconds) {
53
44
  break;
54
45
  }
55
-
56
46
  x.push(sample.x);
57
47
  y.push(sample.y);
58
48
  w.push(1);
@@ -60,15 +50,12 @@ export default class VelocityTracker {
60
50
  sampleCount++;
61
51
  index--;
62
52
  }
63
-
64
53
  if (sampleCount >= this.minSampleSize) {
65
54
  const xSolver = new LeastSquareSolver(time, x, w);
66
55
  const xFit = xSolver.solve(2);
67
-
68
56
  if (xFit !== null) {
69
57
  const ySolver = new LeastSquareSolver(time, y, w);
70
58
  const yFit = ySolver.solve(2);
71
-
72
59
  if (yFit !== null) {
73
60
  const xVelocity = xFit.coefficients[1] * 1000;
74
61
  const yVelocity = yFit.coefficients[1] * 1000;
@@ -76,23 +63,17 @@ export default class VelocityTracker {
76
63
  }
77
64
  }
78
65
  }
79
-
80
66
  return null;
81
67
  }
82
-
83
68
  get velocity() {
84
69
  const estimate = this.getVelocityEstimate();
85
-
86
70
  if (estimate !== null) {
87
71
  return estimate;
88
72
  }
89
-
90
73
  return [0, 0];
91
74
  }
92
-
93
75
  reset() {
94
76
  this.samples.clear();
95
77
  }
96
-
97
78
  }
98
79
  //# sourceMappingURL=VelocityTracker.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["VelocityTracker.ts"],"names":["CircularBuffer","LeastSquareSolver","VelocityTracker","constructor","samples","historySize","add","event","push","getVelocityEstimate","x","y","w","time","sampleCount","index","size","newestSample","get","previousSample","sample","age","delta","Math","abs","horizonMilliseconds","assumePointerMoveStoppedMilliseconds","minSampleSize","xSolver","xFit","solve","ySolver","yFit","xVelocity","coefficients","yVelocity","velocity","estimate","reset","clear"],"mappings":";;AACA,OAAOA,cAAP,MAA2B,kBAA3B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AAEA,eAAe,MAAMC,eAAN,CAAsB;AAQnCC,EAAAA,WAAW,GAAG;AAAA,kEAPiC,EAOjC;;AAAA,yCANQ,EAMR;;AAAA,iDALgB,GAKhB;;AAAA,2CAJU,CAIV;;AAAA;;AACZ,SAAKC,OAAL,GAAe,IAAIJ,cAAJ,CAAiC,KAAKK,WAAtC,CAAf;AACD;;AAEMC,EAAAA,GAAG,CAACC,KAAD,EAA4B;AACpC,SAAKH,OAAL,CAAaI,IAAb,CAAkBD,KAAlB;AACD,GAdkC,CAgBnC;AACA;AACA;AACA;AACA;AACA;;;AACQE,EAAAA,mBAAmB,GAA4B;AACrD,UAAMC,CAAC,GAAG,EAAV;AACA,UAAMC,CAAC,GAAG,EAAV;AACA,UAAMC,CAAC,GAAG,EAAV;AACA,UAAMC,IAAI,GAAG,EAAb;AAEA,QAAIC,WAAW,GAAG,CAAlB;AACA,QAAIC,KAAK,GAAG,KAAKX,OAAL,CAAaY,IAAb,GAAoB,CAAhC;AACA,UAAMC,YAAY,GAAG,KAAKb,OAAL,CAAac,GAAb,CAAiBH,KAAjB,CAArB;;AACA,QAAI,CAACE,YAAL,EAAmB;AACjB,aAAO,IAAP;AACD;;AAED,QAAIE,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IAAzC;AACA,gBAAMC,SAAS,GAAGH,IAAI,CAACE,YAAL,CAAkB,CAAlB,IAAuB,IAAzC;AAEA,iBAAO,CAACD,SAAD,EAAYE,SAAZ,CAAP;AACD;AACF;AACF;;AAED,WAAO,IAAP;AACD;;AAEkB,MAARC,QAAQ,GAAqB;AACtC,UAAMC,QAAQ,GAAG,KAAK5B,mBAAL,EAAjB;;AACA,QAAI4B,QAAQ,KAAK,IAAjB,EAAuB;AACrB,aAAOA,QAAP;AACD;;AACD,WAAO,CAAC,CAAD,EAAI,CAAJ,CAAP;AACD;;AAEMC,EAAAA,KAAK,GAAS;AACnB,SAAKlC,OAAL,CAAamC,KAAb;AACD;;AA5FkC","sourcesContent":["import { AdaptedEvent } from '../interfaces';\nimport CircularBuffer from './CircularBuffer';\nimport LeastSquareSolver from './LeastSquareSolver';\n\nexport default class VelocityTracker {\n private assumePointerMoveStoppedMilliseconds = 40;\n private historySize = 20;\n private horizonMilliseconds = 300;\n private minSampleSize = 3;\n\n private samples: CircularBuffer<AdaptedEvent>;\n\n constructor() {\n this.samples = new CircularBuffer<AdaptedEvent>(this.historySize);\n }\n\n public add(event: AdaptedEvent): void {\n this.samples.push(event);\n }\n\n // Returns an estimate of the velocity of the object being tracked by the\n // tracker given the current information available to the tracker.\n //\n // Information is added using [addPosition].\n //\n // Returns null if there is no data on which to base an estimate.\n private getVelocityEstimate(): [number, number] | null {\n const x = [];\n const y = [];\n const w = [];\n const time = [];\n\n let sampleCount = 0;\n let index = this.samples.size - 1;\n const newestSample = this.samples.get(index);\n if (!newestSample) {\n return null;\n }\n\n let previousSample = newestSample;\n\n // Starting with the most recent PointAtTime sample, iterate backwards while\n // the samples represent continuous motion.\n while (sampleCount < this.samples.size) {\n const sample = this.samples.get(index);\n\n const age = newestSample.time - sample.time;\n const delta = Math.abs(sample.time - previousSample.time);\n previousSample = sample;\n\n if (\n age > this.horizonMilliseconds ||\n delta > this.assumePointerMoveStoppedMilliseconds\n ) {\n break;\n }\n\n x.push(sample.x);\n y.push(sample.y);\n w.push(1);\n time.push(-age);\n\n sampleCount++;\n index--;\n }\n\n if (sampleCount >= this.minSampleSize) {\n const xSolver = new LeastSquareSolver(time, x, w);\n const xFit = xSolver.solve(2);\n\n if (xFit !== null) {\n const ySolver = new LeastSquareSolver(time, y, w);\n const yFit = ySolver.solve(2);\n\n if (yFit !== null) {\n const xVelocity = xFit.coefficients[1] * 1000;\n const yVelocity = yFit.coefficients[1] * 1000;\n\n return [xVelocity, yVelocity];\n }\n }\n }\n\n return null;\n }\n\n public get velocity(): [number, number] {\n const estimate = this.getVelocityEstimate();\n if (estimate !== null) {\n return estimate;\n }\n return [0, 0];\n }\n\n public reset(): void {\n this.samples.clear();\n }\n}\n"]}
1
+ {"version":3,"names":["CircularBuffer","LeastSquareSolver","VelocityTracker","assumePointerMoveStoppedMilliseconds","historySize","horizonMilliseconds","minSampleSize","constructor","samples","add","event","push","getVelocityEstimate","x","y","w","time","sampleCount","index","size","newestSample","get","previousSample","sample","age","delta","Math","abs","xSolver","xFit","solve","ySolver","yFit","xVelocity","coefficients","yVelocity","velocity","estimate","reset","clear"],"sourceRoot":"../../../../src","sources":["web/tools/VelocityTracker.ts"],"mappings":";;AACA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,eAAe,MAAMC,eAAe,CAAC;EAC3BC,oCAAoC,GAAG,EAAE;EACzCC,WAAW,GAAG,EAAE;EAChBC,mBAAmB,GAAG,GAAG;EACzBC,aAAa,GAAG,CAAC;EAIzBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIR,cAAc,CAAe,IAAI,CAACI,WAAW,CAAC;EACnE;EAEOK,GAAGA,CAACC,KAAmB,EAAQ;IACpC,IAAI,CAACF,OAAO,CAACG,IAAI,CAACD,KAAK,CAAC;EAC1B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACQE,mBAAmBA,CAAA,EAA4B;IACrD,MAA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AAGD,OAAO,CAACE,KAAK,CAAC,CAAC,CAAC;MAE7B,IAAID,IAAI,KAAK,IAAI,EAAE;QACjB,MAAME,OAAO,GAAG,IAAI9B,iBAAiB,CAACe,IAAI,EAAEF,CAAC,EAAEC,CAAC,CAAC;QACjD,MAAMiB,IAAI,GAAGD,OAAO,CAACD,KAAK,CAAC,CAAC,CAAC;QAE7B,IAAIE,IAAI,KAAK,IAAI,EAAE;UACjB,MAAMC,SAAS,GAAGJ,IAAI,CAACK,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;UAC7C,MAAMC,SAAS,GAAGH,IAAI,CAACE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;UAE7C,OAAO,CAACD,SAAS,EAAEE,SAAS,CAAC;QAC/B;MACF;IACF;IAEA,OAAO,IAAI;EACb;EAEA,IAAWC,QAAQA,CAAA,EAAqB;IACtC,MAAMC,QAAQ,GAAG,IAAI,CAACzB,mBAAmB,CAAC,CAAC;IAC3C,IAAIyB,QAAQ,KAAK,IAAI,EAAE;MACrB,OAAOA,QAAQ;IACjB;IACA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;EACf;EAEOC,KAAKA,CAAA,EAAS;IACnB,IAAI,CAAC9B,OAAO,CAAC+B,KAAK,CAAC,CAAC;EACtB;AACF","ignoreList":[]}
@@ -1,42 +1,33 @@
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 EventManager from './EventManager';
4
4
  import { EventTypes } from '../interfaces';
5
5
  import { PointerType } from '../../PointerType';
6
6
  export default class WheelEventManager extends EventManager {
7
- constructor(...args) {
8
- super(...args);
9
-
10
- _defineProperty(this, "wheelDelta", {
7
+ wheelDelta = {
8
+ x: 0,
9
+ y: 0
10
+ };
11
+ resetDelta = _event => {
12
+ this.wheelDelta = {
11
13
  x: 0,
12
14
  y: 0
13
- });
14
-
15
- _defineProperty(this, "resetDelta", _event => {
16
- this.wheelDelta = {
17
- x: 0,
18
- y: 0
19
- };
20
- });
21
-
22
- _defineProperty(this, "wheelCallback", event => {
23
- this.wheelDelta.x += event.deltaX;
24
- this.wheelDelta.y += event.deltaY;
25
- const adaptedEvent = this.mapEvent(event);
26
- this.onWheel(adaptedEvent);
27
- });
28
- }
29
-
15
+ };
16
+ };
17
+ wheelCallback = event => {
18
+ this.wheelDelta.x += event.deltaX;
19
+ this.wheelDelta.y += event.deltaY;
20
+ const adaptedEvent = this.mapEvent(event);
21
+ this.onWheel(adaptedEvent);
22
+ };
30
23
  registerListeners() {
31
24
  this.view.addEventListener('pointermove', this.resetDelta);
32
25
  this.view.addEventListener('wheel', this.wheelCallback);
33
26
  }
34
-
35
27
  unregisterListeners() {
36
28
  this.view.removeEventListener('pointermove', this.resetDelta);
37
29
  this.view.removeEventListener('wheel', this.wheelCallback);
38
30
  }
39
-
40
31
  mapEvent(event) {
41
32
  return {
42
33
  x: event.clientX + this.wheelDelta.x,
@@ -51,10 +42,8 @@ export default class WheelEventManager extends EventManager {
51
42
  wheelDeltaY: event.wheelDeltaY
52
43
  };
53
44
  }
54
-
55
45
  resetManager() {
56
46
  super.resetManager();
57
47
  }
58
-
59
48
  }
60
49
  //# sourceMappingURL=WheelEventManager.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["WheelEventManager.ts"],"names":["EventManager","EventTypes","PointerType","WheelEventManager","x","y","_event","wheelDelta","event","deltaX","deltaY","adaptedEvent","mapEvent","onWheel","registerListeners","view","addEventListener","resetDelta","wheelCallback","unregisterListeners","removeEventListener","clientX","clientY","offsetX","offsetY","pointerId","eventType","MOVE","pointerType","OTHER","time","timeStamp","wheelDeltaY","resetManager"],"mappings":";;AAAA,OAAOA,YAAP,MAAyB,gBAAzB;AACA,SAAuBC,UAAvB,QAAyC,eAAzC;AACA,SAASC,WAAT,QAA4B,mBAA5B;AAEA,eAAe,MAAMC,iBAAN,SAAgCH,YAAhC,CAA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AAA,SAAS,EAAE,CAAC,CALP;AAMLC,MAAAA,SAAS,EAAEzB,UAAU,CAAC0B,IANjB;AAOLC,MAAAA,WAAW,EAAE1B,WAAW,CAAC2B,KAPpB;AAQLC,MAAAA,IAAI,EAAEtB,KAAK,CAACuB,SARP;AASL;AACAC,MAAAA,WAAW,EAAExB,KAAK,CAACwB;AAVd,KAAP;AAYD;;AAEMC,EAAAA,YAAY,GAAS;AAC1B,UAAMA,YAAN;AACD;;AA1CsE","sourcesContent":["import EventManager from './EventManager';\nimport { AdaptedEvent, EventTypes } from '../interfaces';\nimport { PointerType } from '../../PointerType';\n\nexport default class WheelEventManager extends EventManager<HTMLElement> {\n private wheelDelta = { x: 0, y: 0 };\n\n private resetDelta = (_event: PointerEvent) => {\n this.wheelDelta = { x: 0, y: 0 };\n };\n\n private wheelCallback = (event: WheelEvent) => {\n this.wheelDelta.x += event.deltaX;\n this.wheelDelta.y += event.deltaY;\n\n const adaptedEvent = this.mapEvent(event);\n this.onWheel(adaptedEvent);\n };\n\n public registerListeners(): void {\n this.view.addEventListener('pointermove', this.resetDelta);\n this.view.addEventListener('wheel', this.wheelCallback);\n }\n\n public unregisterListeners(): void {\n this.view.removeEventListener('pointermove', this.resetDelta);\n this.view.removeEventListener('wheel', this.wheelCallback);\n }\n\n protected mapEvent(event: WheelEvent): AdaptedEvent {\n return {\n x: event.clientX + this.wheelDelta.x,\n y: event.clientY + this.wheelDelta.y,\n offsetX: event.offsetX - event.deltaX,\n offsetY: event.offsetY - event.deltaY,\n pointerId: -1,\n eventType: EventTypes.MOVE,\n pointerType: PointerType.OTHER,\n time: event.timeStamp,\n // @ts-ignore It does exist, but it's deprecated\n wheelDeltaY: event.wheelDeltaY,\n };\n }\n\n public resetManager(): void {\n super.resetManager();\n }\n}\n"]}
1
+ {"version":3,"names":["EventManager","EventTypes","PointerType","WheelEventManager","wheelDelta","x","y","resetDelta","_event","wheelCallback","event","deltaX","deltaY","adaptedEvent","mapEvent","onWheel","registerListeners","view","addEventListener","unregisterListeners","removeEventListener","clientX","clientY","offsetX","offsetY","pointerId","eventType","MOVE","pointerType","OTHER","time","timeStamp","wheelDeltaY","resetManager"],"sourceRoot":"../../../../src","sources":["web/tools/WheelEventManager.ts"],"mappings":";;AAAA,OAAOA,YAAY,MAAM,gBAAgB;AACzC,SAAuBC,UAAU,QAAQ,eAAe;AACxD,SAASC,WAAW,QAAQ,mBAAmB;AAE/C,eAAe,MAAMC,iBAAiB,SAASH,YAAY,CAAc;EAC/DI,UAAU,GAAG;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE;EAAE,CAAC;EAE3BC,UAAU,GAAIC,MAAoB,IAAK;IAC7C,IAAI,CAACJ,UAAU,GAAG;MAAEC,CAAC,EAAE,CAAC;MAAEC,CAAC,EAAE;IAAE,CAAC;EAClC,CAAC;EAEOG,aAAa,GAAIC,KAAiB,IAAK;IAC7C,IAAI,CAACN,UAAU,CAACC,CAAC,IAAIK,KAAK,CAACC,MAAM;IACjC,IAAI,CAACP,UAAU,CAACE,CAAC,IAAII,KAAK,CAACE,MAAM;IAEjC,MAAMC,YAAY,GAAG,IAAI,CAACC,QAAQ,CAACJ,KAAK,CAAC;IACzC,IAAI,CAACK,OAAO,CAACF,YAAY,CAAC;EAC5B,CAAC;EAEMG,iBAAiBA,CAAA,EAAS;IAC/B,IAAI,CAACC,IAAI,CAACC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAACX,UAAU,CAAC;IAC1D,IAAI,CAACU,IAAI,CAACC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAACT,aAAa,CAAC;EACzD;EAEOU,mBAAmBA,CAAA,EAAS;IACjC,IAAI,CAACF,IAAI,CAACG,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAACb,UAAU,CAAC;IAC7D,IAAI,CAACU,IAAI,CAACG,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAACX,aAAa,CAAC;EAC5D;EAEUK,QAAQA,CAACJ,KAAiB,EAAgB;IAClD,OAAO;MACLL,CAAC,EAAEK,KAAK,CAACW,OAAO,GAAG,IAAI,CAACjB,UAAU,CAACC,CAAC;MACpCC,CAAC,EAAEI,KAAK,CAACY,OAAO,GAAG,IAAI,CAAClB,UAAU,CAACE,CAAC;MACpCiB,OAAO,EAAEb,KAAK,CAACa,OAAO,GAAGb,KAAK,CAACC,MAAM;MACrCa,OAAO,EAAEd,KAAK,CAACc,OAAO,GAAGd,KAAK,CAACE,MAAM;MACrCa,SAAS,EAAE,CAAC,CAAC;MACbC,SAAS,EAAEzB,UAAU,CAAC0B,IAAI;MAC1BC,WAAW,EAAE1B,WAAW,CAAC2B,KAAK;MAC9BC,IAAI,EAAEpB,KAAK,CAACqB,SAAS;MACrB;MACAC,WAAW,EAAEtB,KAAK,CAACsB;IACrB,CAAC;EACH;EAEOC,YAAYA,CAAA,EAAS;IAC1B,KAAK,CAACA,YAAY,CAAC,CAAC;EACtB;AACF","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  import { PointerType } from '../PointerType';
2
4
  export function isPointerInBounds(view, {
3
5
  x,
@@ -10,50 +12,44 @@ export const PointerTypeMapping = new Map([['mouse', PointerType.MOUSE], ['touch
10
12
  export const degToRad = degrees => degrees * Math.PI / 180;
11
13
  export const coneToDeviation = degrees => Math.cos(degToRad(degrees / 2));
12
14
  export function calculateViewScale(view) {
13
- var _RegExp$exec;
14
-
15
15
  const styles = getComputedStyle(view);
16
16
  const resultScales = {
17
17
  scaleX: 1,
18
18
  scaleY: 1
19
- }; // Get scales from scale property
19
+ };
20
20
 
21
+ // Get scales from scale property
21
22
  if (styles.scale !== undefined && styles.scale !== 'none') {
22
23
  const scales = styles.scale.split(' ');
23
-
24
24
  if (scales[0]) {
25
25
  resultScales.scaleX = parseFloat(scales[0]);
26
26
  }
27
-
28
27
  resultScales.scaleY = scales[1] ? parseFloat(scales[1]) : parseFloat(scales[0]);
29
- } // Get scales from transform property
30
-
31
-
32
- const matrixElements = (_RegExp$exec = new RegExp(/matrix\((.+)\)/).exec(styles.transform)) === null || _RegExp$exec === void 0 ? void 0 : _RegExp$exec[1];
28
+ }
33
29
 
30
+ // Get scales from transform property
31
+ const matrixElements = new RegExp(/matrix\((.+)\)/).exec(styles.transform)?.[1];
34
32
  if (matrixElements) {
35
33
  const matrixElementsArray = matrixElements.split(', ');
36
34
  resultScales.scaleX *= parseFloat(matrixElementsArray[0]);
37
35
  resultScales.scaleY *= parseFloat(matrixElementsArray[3]);
38
36
  }
39
-
40
37
  return resultScales;
41
38
  }
42
39
  export function tryExtractStylusData(event) {
43
40
  const pointerType = PointerTypeMapping.get(event.pointerType);
44
-
45
41
  if (pointerType !== PointerType.STYLUS) {
46
42
  return;
47
- } // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)
48
-
49
-
50
- const eventAzimuthAngle = event.azimuthAngle; // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)
43
+ }
51
44
 
45
+ // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)
46
+ const eventAzimuthAngle = event.azimuthAngle;
47
+ // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)
52
48
  const eventAltitudeAngle = event.altitudeAngle;
53
-
54
49
  if (event.tiltX === 0 && event.tiltY === 0) {
55
50
  // If we are in this branch, it means that either tilt properties are not supported and we have to calculate them from altitude and azimuth angles,
56
51
  // or stylus is perpendicular to the screen and we can use altitude / azimuth instead of tilt
52
+
57
53
  // If azimuth and altitude are undefined in this branch, it means that we are either perpendicular to the screen,
58
54
  // or that none of the position sets is supported. In that case, we can treat stylus as perpendicular
59
55
  if (eventAzimuthAngle === undefined || eventAltitudeAngle === undefined) {
@@ -65,7 +61,6 @@ export function tryExtractStylusData(event) {
65
61
  pressure: event.pressure
66
62
  };
67
63
  }
68
-
69
64
  const {
70
65
  tiltX,
71
66
  tiltY
@@ -78,7 +73,6 @@ export function tryExtractStylusData(event) {
78
73
  pressure: event.pressure
79
74
  };
80
75
  }
81
-
82
76
  const {
83
77
  altitudeAngle,
84
78
  azimuthAngle
@@ -90,17 +84,18 @@ export function tryExtractStylusData(event) {
90
84
  altitudeAngle,
91
85
  pressure: event.pressure
92
86
  };
93
- } // `altitudeAngle` and `azimuthAngle` are experimental properties, which are not supported on Firefox and Safari.
87
+ }
88
+
89
+ // `altitudeAngle` and `azimuthAngle` are experimental properties, which are not supported on Firefox and Safari.
94
90
  // Given that, we use `tilt` properties and algorithm that converts one value to another.
95
91
  //
96
92
  // Source: https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle
97
-
98
93
  function tilt2spherical(tiltX, tiltY) {
99
94
  const tiltXrad = tiltX * Math.PI / 180;
100
- const tiltYrad = tiltY * Math.PI / 180; // calculate azimuth angle
95
+ const tiltYrad = tiltY * Math.PI / 180;
101
96
 
97
+ // calculate azimuth angle
102
98
  let azimuthAngle = 0;
103
-
104
99
  if (tiltX === 0) {
105
100
  if (tiltY > 0) {
106
101
  azimuthAngle = Math.PI / 2;
@@ -119,15 +114,13 @@ function tilt2spherical(tiltX, tiltY) {
119
114
  const tanX = Math.tan(tiltXrad);
120
115
  const tanY = Math.tan(tiltYrad);
121
116
  azimuthAngle = Math.atan2(tanY, tanX);
122
-
123
117
  if (azimuthAngle < 0) {
124
118
  azimuthAngle += 2 * Math.PI;
125
119
  }
126
- } // calculate altitude angle
127
-
120
+ }
128
121
 
122
+ // calculate altitude angle
129
123
  let altitudeAngle = 0;
130
-
131
124
  if (Math.abs(tiltX) === 90 || Math.abs(tiltY) === 90) {
132
125
  altitudeAngle = 0;
133
126
  } else if (tiltX === 0) {
@@ -138,70 +131,59 @@ function tilt2spherical(tiltX, tiltY) {
138
131
  // Non-boundary case: neither tiltX nor tiltY is equal to 0 or +-90
139
132
  altitudeAngle = Math.atan(1.0 / Math.sqrt(Math.pow(Math.tan(tiltXrad), 2) + Math.pow(Math.tan(tiltYrad), 2)));
140
133
  }
141
-
142
134
  return {
143
135
  altitudeAngle: altitudeAngle,
144
136
  azimuthAngle: azimuthAngle
145
137
  };
146
- } // If we are on a platform that doesn't support `tiltX` and `tiltY`, we have to calculate them from `altitude` and `azimuth` angles.
138
+ }
139
+
140
+ // If we are on a platform that doesn't support `tiltX` and `tiltY`, we have to calculate them from `altitude` and `azimuth` angles.
147
141
  //
148
142
  // Source: https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle
149
-
150
-
151
143
  function spherical2tilt(altitudeAngle, azimuthAngle) {
152
144
  const radToDeg = 180 / Math.PI;
153
145
  let tiltXrad = 0;
154
146
  let tiltYrad = 0;
155
-
156
147
  if (altitudeAngle === 0) {
157
148
  // the pen is in the X-Y plane
158
149
  if (azimuthAngle === 0 || azimuthAngle === 2 * Math.PI) {
159
150
  // pen is on positive X axis
160
151
  tiltXrad = Math.PI / 2;
161
152
  }
162
-
163
153
  if (azimuthAngle === Math.PI / 2) {
164
154
  // pen is on positive Y axis
165
155
  tiltYrad = Math.PI / 2;
166
156
  }
167
-
168
157
  if (azimuthAngle === Math.PI) {
169
158
  // pen is on negative X axis
170
159
  tiltXrad = -Math.PI / 2;
171
160
  }
172
-
173
161
  if (azimuthAngle === 3 * Math.PI / 2) {
174
162
  // pen is on negative Y axis
175
163
  tiltYrad = -Math.PI / 2;
176
164
  }
177
-
178
165
  if (azimuthAngle > 0 && azimuthAngle < Math.PI / 2) {
179
166
  tiltXrad = Math.PI / 2;
180
167
  tiltYrad = Math.PI / 2;
181
168
  }
182
-
183
169
  if (azimuthAngle > Math.PI / 2 && azimuthAngle < Math.PI) {
184
170
  tiltXrad = -Math.PI / 2;
185
171
  tiltYrad = Math.PI / 2;
186
172
  }
187
-
188
173
  if (azimuthAngle > Math.PI && azimuthAngle < 3 * Math.PI / 2) {
189
174
  tiltXrad = -Math.PI / 2;
190
175
  tiltYrad = -Math.PI / 2;
191
176
  }
192
-
193
177
  if (azimuthAngle > 3 * Math.PI / 2 && azimuthAngle < 2 * Math.PI) {
194
178
  tiltXrad = Math.PI / 2;
195
179
  tiltYrad = -Math.PI / 2;
196
180
  }
197
181
  }
198
-
199
182
  if (altitudeAngle !== 0) {
200
183
  const tanAlt = Math.tan(altitudeAngle);
201
184
  tiltXrad = Math.atan(Math.cos(azimuthAngle) / tanAlt);
202
185
  tiltYrad = Math.atan(Math.sin(azimuthAngle) / tanAlt);
203
186
  }
204
-
205
187
  const tiltX = Math.round(tiltXrad * radToDeg);
206
188
  const tiltY = Math.round(tiltYrad * radToDeg);
207
189
  return {
@@ -209,8 +191,9 @@ function spherical2tilt(altitudeAngle, azimuthAngle) {
209
191
  tiltY
210
192
  };
211
193
  }
194
+ export const RNSVGElements = new Set(['Circle', 'ClipPath', 'Ellipse', 'ForeignObject', 'G', 'Image', 'Line', 'Marker', 'Mask', 'Path', 'Pattern', 'Polygon', 'Polyline', 'Rect', 'Svg', 'Symbol', 'TSpan', 'Text', 'TextPath', 'Use']);
212
195
 
213
- export const RNSVGElements = new Set(['Circle', 'ClipPath', 'Ellipse', 'ForeignObject', 'G', 'Image', 'Line', 'Marker', 'Mask', 'Path', 'Pattern', 'Polygon', 'Polyline', 'Rect', 'Svg', 'Symbol', 'TSpan', 'Text', 'TextPath', 'Use']); // This function helps us determine whether given node is SVGElement or not. In our implementation of
196
+ // This function helps us determine whether given node is SVGElement or not. In our implementation of
214
197
  // findNodeHandle, we can encounter such element in 2 forms - SVG tag or ref to SVG Element. Since Gesture Handler
215
198
  // does not depend on SVG, we use our simplified SVGRef type that has `elementRef` field. This is something that is present
216
199
  // in actual SVG ref object.
@@ -219,25 +202,22 @@ export const RNSVGElements = new Set(['Circle', 'ClipPath', 'Ellipse', 'ForeignO
219
202
  // corresponds to one of the possible SVG elements. Then we also check if `elementRef` field exists.
220
203
  // By doing both steps we decrease probability of detecting situations where, for example, user makes custom `Circle` and
221
204
  // we treat it as SVG.
222
-
223
205
  export function isRNSVGElement(viewRef) {
224
206
  const componentClassName = Object.getPrototypeOf(viewRef).constructor.name;
225
207
  return RNSVGElements.has(componentClassName) && Object.hasOwn(viewRef, 'elementRef');
226
- } // This function checks if given node is SVGElement. Unlike the function above, this one
208
+ }
209
+
210
+ // This function checks if given node is SVGElement. Unlike the function above, this one
227
211
  // operates on React Nodes, not DOM nodes.
228
212
  //
229
213
  // Second condition was introduced to handle case where SVG element was wrapped with
230
214
  // `createAnimatedComponent` from Reanimated.
231
-
232
215
  export function isRNSVGNode(node) {
233
- var _node$ref, _Object$getPrototypeO, _node$type;
234
-
235
216
  // If `ref` has `rngh` field, it means that component comes from Gesture Handler. This is a special case for
236
217
  // `Text` component, which is present in `RNSVGElements` set, yet we don't want to treat it as SVG.
237
- if ((_node$ref = node.ref) !== null && _node$ref !== void 0 && _node$ref.rngh) {
218
+ if (node.ref?.rngh) {
238
219
  return false;
239
220
  }
240
-
241
- return ((_Object$getPrototypeO = Object.getPrototypeOf(node === null || node === void 0 ? void 0 : node.type)) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name) === 'WebShape' || RNSVGElements.has(node === null || node === void 0 ? void 0 : (_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.displayName);
221
+ return Object.getPrototypeOf(node?.type)?.name === 'WebShape' || RNSVGElements.has(node?.type?.displayName);
242
222
  }
243
223
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["utils.ts"],"names":["PointerType","isPointerInBounds","view","x","y","rect","getBoundingClientRect","left","right","top","bottom","PointerTypeMapping","Map","MOUSE","TOUCH","STYLUS","OTHER","degToRad","degrees","Math","PI","coneToDeviation","cos","calculateViewScale","styles","getComputedStyle","resultScales","scaleX","scaleY","scale","undefined","scales","split","parseFloat","matrixElements","RegExp","exec","transform","matrixElementsArray","tryExtractStylusData","event","pointerType","get","eventAzimuthAngle","azimuthAngle","eventAltitudeAngle","altitudeAngle","tiltX","tiltY","pressure","spherical2tilt","tilt2spherical","tiltXrad","tiltYrad","abs","tanX","tan","tanY","atan2","atan","sqrt","pow","radToDeg","tanAlt","sin","round","RNSVGElements","Set","isRNSVGElement","viewRef","componentClassName","Object","getPrototypeOf","constructor","name","has","hasOwn","isRNSVGNode","node","ref","rngh","type","displayName"],"mappings":"AAAA,SAASA,WAAT,QAA4B,gBAA5B;AAQA,OAAO,SAASC,iBAAT,CAA2BC,IAA3B,EAA8C;AAAEC,EAAAA,CAAF;AAAKC,EAAAA;AAAL,CAA9C,EAAwE;AAC7E,QAAMC,IAAa,GAAGH,IAAI,CAACI,qBAAL,EAAtB;AAEA,SAAOH,CAAC,IAAIE,IAAI,CAACE,IAAV,IAAkBJ,CAAC,IAAIE,IAAI,CAACG,KAA5B,IAAqCJ,CAAC,IAAIC,IAAI,CAACI,GAA/C,IAAsDL,CAAC,IAAIC,IAAI,CAACK,MAAvE;AACD;AAED,OAAO,MAAMC,kBAAkB,GAAG,IAAIC,GAAJ,CAA6B,CAC7D,CAAC,OAAD,EAAUZ,WAAW,CAACa,KAAtB,CAD6D,EAE7D,CAAC,OAAD,EAAUb,WAAW,CAACc,KAAtB,CAF6D,EAG7D,CAAC,KAAD,EAAQd,WAAW,CAACe,MAApB,CAH6D,EAI7D,CAAC,MAAD,EAASf,WAAW,CAACgB,KAArB,CAJ6D,CAA7B,CAA3B;AAOP,OAAO,MAAMC,QAAQ,GAAIC,OAAD,IAAsBA,OAAO,GAAGC,IAAI,CAACC,EAAhB,GAAsB,GAA5D;AAEP,OAAO,MAAMC,eAAe,GAAIH,OAAD,IAC7BC,IAAI,CAACG,GAAL,CAASL,QAAQ,CAACC,OAAO,GAAG,CAAX,CAAjB,CADK;AAGP,OAAO,SAASK,kBAAT,CAA4BrB,IAA5B,EAA+C;AAAA;;AACpD,QAAMsB,MAAM,GAAGC,gBAAgB,CAACvB,IAAD,CAA/B;AAEA,QAAMwB,YAAY,GAAG;AACnBC,IAAAA,MAAM,EAAE,CADW;AAEnBC,IAAA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AM,CAACK,MAAP,CAAcP,OAAd,EAAuB,YAAvB,CAFF;AAID,C,CAED;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASQ,WAAT,CAAqBC,IAArB,EAAgC;AAAA;;AACrC;AACA;AACA,mBAAIA,IAAI,CAACC,GAAT,sCAAI,UAAUC,IAAd,EAAoB;AAClB,WAAO,KAAP;AACD;;AAED,SACE,0BAAAT,MAAM,CAACC,cAAP,CAAsBM,IAAtB,aAAsBA,IAAtB,uBAAsBA,IAAI,CAAEG,IAA5B,iFAAmCP,IAAnC,MAA4C,UAA5C,IACAR,aAAa,CAACS,GAAd,CAAkBG,IAAlB,aAAkBA,IAAlB,qCAAkBA,IAAI,CAAEG,IAAxB,+CAAkB,WAAYC,WAA9B,CAFF;AAID","sourcesContent":["import { PointerType } from '../PointerType';\nimport type {\n GestureHandlerRef,\n Point,\n StylusData,\n SVGRef,\n} from './interfaces';\n\nexport function isPointerInBounds(view: HTMLElement, { x, y }: Point): boolean {\n const rect: DOMRect = view.getBoundingClientRect();\n\n return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;\n}\n\nexport const PointerTypeMapping = new Map<string, PointerType>([\n ['mouse', PointerType.MOUSE],\n ['touch', PointerType.TOUCH],\n ['pen', PointerType.STYLUS],\n ['none', PointerType.OTHER],\n]);\n\nexport const degToRad = (degrees: number) => (degrees * Math.PI) / 180;\n\nexport const coneToDeviation = (degrees: number) =>\n Math.cos(degToRad(degrees / 2));\n\nexport function calculateViewScale(view: HTMLElement) {\n const styles = getComputedStyle(view);\n\n const resultScales = {\n scaleX: 1,\n scaleY: 1,\n };\n\n // Get scales from scale property\n if (styles.scale !== undefined && styles.scale !== 'none') {\n const scales = styles.scale.split(' ');\n\n if (scales[0]) {\n resultScales.scaleX = parseFloat(scales[0]);\n }\n\n resultScales.scaleY = scales[1]\n ? parseFloat(scales[1])\n : parseFloat(scales[0]);\n }\n\n // Get scales from transform property\n const matrixElements = new RegExp(/matrix\\((.+)\\)/).exec(\n styles.transform\n )?.[1];\n\n if (matrixElements) {\n const matrixElementsArray = matrixElements.split(', ');\n\n resultScales.scaleX *= parseFloat(matrixElementsArray[0]);\n resultScales.scaleY *= parseFloat(matrixElementsArray[3]);\n }\n\n return resultScales;\n}\n\nexport function tryExtractStylusData(\n event: PointerEvent\n): StylusData | undefined {\n const pointerType = PointerTypeMapping.get(event.pointerType);\n\n if (pointerType !== PointerType.STYLUS) {\n return;\n }\n\n // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)\n const eventAzimuthAngle: number | undefined = event.azimuthAngle;\n // @ts-ignore This property exists (https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#instance_properties)\n const eventAltitudeAngle: number | undefined = event.altitudeAngle;\n\n if (event.tiltX === 0 && event.tiltY === 0) {\n // If we are in this branch, it means that either tilt properties are not supported and we have to calculate them from altitude and azimuth angles,\n // or stylus is perpendicular to the screen and we can use altitude / azimuth instead of tilt\n\n // If azimuth and altitude are undefined in this branch, it means that we are either perpendicular to the screen,\n // or that none of the position sets is supported. In that case, we can treat stylus as perpendicular\n if (eventAzimuthAngle === undefined || eventAltitudeAngle === undefined) {\n return {\n tiltX: 0,\n tiltY: 0,\n azimuthAngle: Math.PI / 2,\n altitudeAngle: Math.PI / 2,\n pressure: event.pressure,\n };\n }\n\n const { tiltX, tiltY } = spherical2tilt(\n eventAltitudeAngle,\n eventAzimuthAngle\n );\n\n return {\n tiltX,\n tiltY,\n azimuthAngle: eventAzimuthAngle,\n altitudeAngle: eventAltitudeAngle,\n pressure: event.pressure,\n };\n }\n\n const { altitudeAngle, azimuthAngle } = tilt2spherical(\n event.tiltX,\n event.tiltY\n );\n\n return {\n tiltX: event.tiltX,\n tiltY: event.tiltY,\n azimuthAngle,\n altitudeAngle,\n pressure: event.pressure,\n };\n}\n\n// `altitudeAngle` and `azimuthAngle` are experimental properties, which are not supported on Firefox and Safari.\n// Given that, we use `tilt` properties and algorithm that converts one value to another.\n//\n// Source: https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle\nfunction tilt2spherical(tiltX: number, tiltY: number) {\n const tiltXrad = (tiltX * Math.PI) / 180;\n const tiltYrad = (tiltY * Math.PI) / 180;\n\n // calculate azimuth angle\n let azimuthAngle = 0;\n\n if (tiltX === 0) {\n if (tiltY > 0) {\n azimuthAngle = Math.PI / 2;\n } else if (tiltY < 0) {\n azimuthAngle = (3 * Math.PI) / 2;\n }\n } else if (tiltY === 0) {\n if (tiltX < 0) {\n azimuthAngle = Math.PI;\n }\n } else if (Math.abs(tiltX) === 90 || Math.abs(tiltY) === 90) {\n // not enough information to calculate azimuth\n azimuthAngle = 0;\n } else {\n // Non-boundary case: neither tiltX nor tiltY is equal to 0 or +-90\n const tanX = Math.tan(tiltXrad);\n const tanY = Math.tan(tiltYrad);\n\n azimuthAngle = Math.atan2(tanY, tanX);\n if (azimuthAngle < 0) {\n azimuthAngle += 2 * Math.PI;\n }\n }\n\n // calculate altitude angle\n let altitudeAngle = 0;\n\n if (Math.abs(tiltX) === 90 || Math.abs(tiltY) === 90) {\n altitudeAngle = 0;\n } else if (tiltX === 0) {\n altitudeAngle = Math.PI / 2 - Math.abs(tiltYrad);\n } else if (tiltY === 0) {\n altitudeAngle = Math.PI / 2 - Math.abs(tiltXrad);\n } else {\n // Non-boundary case: neither tiltX nor tiltY is equal to 0 or +-90\n altitudeAngle = Math.atan(\n 1.0 /\n Math.sqrt(\n Math.pow(Math.tan(tiltXrad), 2) + Math.pow(Math.tan(tiltYrad), 2)\n )\n );\n }\n\n return { altitudeAngle: altitudeAngle, azimuthAngle: azimuthAngle };\n}\n\n// If we are on a platform that doesn't support `tiltX` and `tiltY`, we have to calculate them from `altitude` and `azimuth` angles.\n//\n// Source: https://w3c.github.io/pointerevents/#converting-between-tiltx-tilty-and-altitudeangle-azimuthangle\nfunction spherical2tilt(altitudeAngle: number, azimuthAngle: number) {\n const radToDeg = 180 / Math.PI;\n\n let tiltXrad = 0;\n let tiltYrad = 0;\n\n if (altitudeAngle === 0) {\n // the pen is in the X-Y plane\n if (azimuthAngle === 0 || azimuthAngle === 2 * Math.PI) {\n // pen is on positive X axis\n tiltXrad = Math.PI / 2;\n }\n if (azimuthAngle === Math.PI / 2) {\n // pen is on positive Y axis\n tiltYrad = Math.PI / 2;\n }\n if (azimuthAngle === Math.PI) {\n // pen is on negative X axis\n tiltXrad = -Math.PI / 2;\n }\n if (azimuthAngle === (3 * Math.PI) / 2) {\n // pen is on negative Y axis\n tiltYrad = -Math.PI / 2;\n }\n if (azimuthAngle > 0 && azimuthAngle < Math.PI / 2) {\n tiltXrad = Math.PI / 2;\n tiltYrad = Math.PI / 2;\n }\n if (azimuthAngle > Math.PI / 2 && azimuthAngle < Math.PI) {\n tiltXrad = -Math.PI / 2;\n tiltYrad = Math.PI / 2;\n }\n if (azimuthAngle > Math.PI && azimuthAngle < (3 * Math.PI) / 2) {\n tiltXrad = -Math.PI / 2;\n tiltYrad = -Math.PI / 2;\n }\n if (azimuthAngle > (3 * Math.PI) / 2 && azimuthAngle < 2 * Math.PI) {\n tiltXrad = Math.PI / 2;\n tiltYrad = -Math.PI / 2;\n }\n }\n\n if (altitudeAngle !== 0) {\n const tanAlt = Math.tan(altitudeAngle);\n\n tiltXrad = Math.atan(Math.cos(azimuthAngle) / tanAlt);\n tiltYrad = Math.atan(Math.sin(azimuthAngle) / tanAlt);\n }\n\n const tiltX = Math.round(tiltXrad * radToDeg);\n const tiltY = Math.round(tiltYrad * radToDeg);\n\n return { tiltX, tiltY };\n}\n\nexport const RNSVGElements = new Set([\n 'Circle',\n 'ClipPath',\n 'Ellipse',\n 'ForeignObject',\n 'G',\n 'Image',\n 'Line',\n 'Marker',\n 'Mask',\n 'Path',\n 'Pattern',\n 'Polygon',\n 'Polyline',\n 'Rect',\n 'Svg',\n 'Symbol',\n 'TSpan',\n 'Text',\n 'TextPath',\n 'Use',\n]);\n\n// This function helps us determine whether given node is SVGElement or not. In our implementation of\n// findNodeHandle, we can encounter such element in 2 forms - SVG tag or ref to SVG Element. Since Gesture Handler\n// does not depend on SVG, we use our simplified SVGRef type that has `elementRef` field. This is something that is present\n// in actual SVG ref object.\n//\n// In order to make sure that node passed into this function is in fact SVG element, first we check if its constructor name\n// corresponds to one of the possible SVG elements. Then we also check if `elementRef` field exists.\n// By doing both steps we decrease probability of detecting situations where, for example, user makes custom `Circle` and\n// we treat it as SVG.\nexport function isRNSVGElement(viewRef: SVGRef | GestureHandlerRef) {\n const componentClassName = Object.getPrototypeOf(viewRef).constructor.name;\n\n return (\n RNSVGElements.has(componentClassName) &&\n Object.hasOwn(viewRef, 'elementRef')\n );\n}\n\n// This function checks if given node is SVGElement. Unlike the function above, this one\n// operates on React Nodes, not DOM nodes.\n//\n// Second condition was introduced to handle case where SVG element was wrapped with\n// `createAnimatedComponent` from Reanimated.\nexport function isRNSVGNode(node: any) {\n // If `ref` has `rngh` field, it means that component comes from Gesture Handler. This is a special case for\n // `Text` component, which is present in `RNSVGElements` set, yet we don't want to treat it as SVG.\n if (node.ref?.rngh) {\n return false;\n }\n\n return (\n Object.getPrototypeOf(node?.type)?.name === 'WebShape' ||\n RNSVGElements.has(node?.type?.displayName)\n );\n}\n"]}
1
+ {"version":3,"names":["PointerType","isPointerInBounds","view","x","y","rect","getBoundingClientRect","left","right","top","bottom","PointerTypeMapping","Map","MOUSE","TOUCH","STYLUS","OTHER","degToRad","degrees","Math","PI","coneToDeviation","cos","calculateViewScale","styles","getComputedStyle","resultScales","scaleX","scaleY","scale","undefined","scales","split","parseFloat","matrixElements","RegExp","exec","transform","matrixElementsArray","tryExtractStylusData","event","pointerType","get","eventAzimuthAngle","azimuthAngle","eventAltitudeAngle","altitudeAngle","tiltX","tiltY","pressure","spherical2tilt","tilt2spherical","tiltXrad","tiltYrad","abs","tanX","tan","tanY","atan2","atan","sqrt","pow","radToDeg","tanAlt","sin","round","RNSVGElements","Set","isRNSVGElement","viewRef","componentClassName","Object","getPrototypeOf","constructor","name","has","hasOwn","isRNSVGNode","node","ref","rngh","type","displayName"],"sourceRoot":"../../../src","sources":["web/utils.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAQ5C,OAAO,SAASC,iBAAiBA,CAACC,IAAiB,EAAE;EAAEC,CAAC;EAAEC;AAAS,CAAC,EAAW;EAC7E,MAAMC,IAAa,GAAGH,IAAI,CAACI,qBAAqB,CAAC,CAAC;EAElD,OAAOH,CAAC,IAAIE,IAAI,CAACE,IAAI,IAAIJ,CAAC,IAAIE,IAAI,CAACG,KAAK,IAAIJ,CAAC,IAAIC,IAAI,CAACI,GAAG,IAAIL,CAAC,IAAIC,IAAI,CAACK,MAAM;AAC/E;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAIC,GAAG,CAAsB,CAC7D,CAAC,OAAO,EAAEZ,WAAW,CAACa,KAAK,CAAC,EAC5B,CAAC,OAAO,EAAEb,WAAW,CAACc,KAAK,CAAC,EAC5B,CAAC,KAAK,EAAEd,WAAW,CAACe,MAAM,CAAC,EAC3B,CAAC,MAAM,EAAEf,WAAW,CAACgB,KAAK,CAAC,CAC5B,CAAC;AAEF,OAAO,MAAMC,QAAQ,GAAIC,OAAe,IAAMA,OAAO,GAAGC,IAAI,CAACC,EAAE,GAAI,GAAG;AAEtE,OAAO,MAAMC,eAAe,GAAIH,OAAe,IAC7CC,IAAI,CAACG,GAAG,CAACL,QAAQ,CAACC,OAAO,GAAG,CAAC,CAAC,CAAC;AAEjC,OAAO,SAASK,kBAAkBA,CAACrB,IAAiB,EAAE;EACpD,MAAMsB,MAAM,GAAGC,gBAAgB,CAACvB,IAAI,CAAC;EAErC,MAAMwB,YAAY,GAAG;IACnBC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACV,CAAC;;EAED;EACA,IAAIJ,MAAM,CAACK,KAAK,KAAKC,SAAS,IAAIN,MAAM,CAACK,KAAK,KAAK,MAAM,EAAE;IACzD,MAAME,MAAM,GAAGP,MAAM,CAACK,KA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