react-native-gesture-handler 2.16.0-rc.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/README.md +1 -0
  2. package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -0
  3. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +9 -0
  4. package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +3 -0
  5. package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +2 -2
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/DiagonalDirections.kt +8 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +61 -24
  8. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +17 -22
  9. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +30 -11
  10. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +3 -0
  11. package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +66 -0
  12. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +119 -19
  13. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +2 -2
  14. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +1 -4
  15. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +4 -2
  16. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +1 -1
  17. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +1 -4
  18. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +4 -7
  19. package/apple/Handlers/RNLongPressHandler.m +5 -13
  20. package/apple/Handlers/RNPinchHandler.m +12 -1
  21. package/apple/RNGestureHandler.m +3 -1
  22. package/lib/commonjs/Directions.js +19 -6
  23. package/lib/commonjs/Directions.js.map +1 -1
  24. package/lib/commonjs/RNGestureHandlerModule.js +97 -4
  25. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  26. package/lib/commonjs/RNGestureHandlerModule.native.js +16 -0
  27. package/lib/commonjs/RNGestureHandlerModule.native.js.map +1 -0
  28. package/lib/commonjs/RNRenderer.js +5 -10
  29. package/lib/commonjs/RNRenderer.js.map +1 -1
  30. package/lib/commonjs/RNRenderer.native.js +16 -0
  31. package/lib/commonjs/RNRenderer.native.js.map +1 -0
  32. package/lib/commonjs/components/DrawerLayout.js.map +1 -1
  33. package/lib/commonjs/components/GestureComponents.js +19 -82
  34. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  35. package/lib/commonjs/components/GestureComponents.native.js +115 -0
  36. package/lib/commonjs/components/GestureComponents.native.js.map +1 -0
  37. package/lib/commonjs/components/GestureHandlerButton.js +13 -3
  38. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  39. package/lib/commonjs/components/GestureHandlerButton.native.js +14 -0
  40. package/lib/commonjs/components/GestureHandlerButton.native.js.map +1 -0
  41. package/lib/commonjs/components/GestureHandlerRootView.js +0 -6
  42. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  43. package/lib/commonjs/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +7 -1
  44. package/lib/commonjs/components/GestureHandlerRootView.native.js.map +1 -0
  45. package/lib/commonjs/components/Swipeable.js +3 -1
  46. package/lib/commonjs/components/Swipeable.js.map +1 -1
  47. package/lib/commonjs/components/touchables/GenericTouchable.js +1 -0
  48. package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
  49. package/lib/commonjs/getReactNativeVersion.js +1 -12
  50. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  51. package/lib/commonjs/getReactNativeVersion.native.js +22 -0
  52. package/lib/commonjs/getReactNativeVersion.native.js.map +1 -0
  53. package/lib/commonjs/getShadowNodeFromRef.js +5 -34
  54. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  55. package/lib/commonjs/getShadowNodeFromRef.native.js +44 -0
  56. package/lib/commonjs/getShadowNodeFromRef.native.js.map +1 -0
  57. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  58. package/lib/commonjs/handlers/PressabilityDebugView.js +5 -7
  59. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  60. package/lib/commonjs/handlers/PressabilityDebugView.native.js +14 -0
  61. package/lib/commonjs/handlers/PressabilityDebugView.native.js.map +1 -0
  62. package/lib/commonjs/handlers/createHandler.js +11 -5
  63. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  64. package/lib/commonjs/handlers/customDirectEventTypes.js +11 -0
  65. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -0
  66. package/lib/commonjs/handlers/customDirectEventTypes.native.js +14 -0
  67. package/lib/commonjs/handlers/customDirectEventTypes.native.js.map +1 -0
  68. package/lib/commonjs/handlers/gestureHandlerCommon.js +13 -2
  69. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  70. package/lib/commonjs/handlers/gestures/GestureDetector.js +25 -0
  71. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  72. package/lib/commonjs/handlers/gestures/flingGesture.js +13 -0
  73. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  74. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +17 -0
  75. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  76. package/lib/commonjs/handlers/gestures/gesture.js +135 -0
  77. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  78. package/lib/commonjs/handlers/gestures/gestureObjects.js +66 -0
  79. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  80. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +1 -1
  81. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  82. package/lib/commonjs/handlers/gestures/hoverGesture.js +1 -1
  83. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  84. package/lib/commonjs/handlers/gestures/longPressGesture.js +12 -0
  85. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  86. package/lib/commonjs/handlers/gestures/nativeGesture.js +10 -0
  87. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  88. package/lib/commonjs/handlers/gestures/panGesture.js +76 -0
  89. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  90. package/lib/commonjs/handlers/gestures/tapGesture.js +42 -0
  91. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  92. package/lib/commonjs/index.js +8 -8
  93. package/lib/commonjs/index.js.map +1 -1
  94. package/lib/commonjs/mocks.js +2 -0
  95. package/lib/commonjs/mocks.js.map +1 -1
  96. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  97. package/lib/commonjs/utils.js +5 -1
  98. package/lib/commonjs/utils.js.map +1 -1
  99. package/lib/commonjs/web/Gestures.js +66 -0
  100. package/lib/commonjs/web/Gestures.js.map +1 -0
  101. package/lib/commonjs/web/constants.js +3 -8
  102. package/lib/commonjs/web/constants.js.map +1 -1
  103. package/lib/commonjs/web/handlers/FlingGestureHandler.js +36 -12
  104. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  105. package/lib/commonjs/web/handlers/GestureHandler.js +11 -9
  106. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  107. package/lib/commonjs/web/handlers/IGestureHandler.js +2 -0
  108. package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -0
  109. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +5 -6
  110. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  111. package/lib/commonjs/web/handlers/PanGestureHandler.js +3 -1
  112. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  113. package/lib/commonjs/web/interfaces.js +1 -13
  114. package/lib/commonjs/web/interfaces.js.map +1 -1
  115. package/lib/commonjs/web/tools/EventManager.js.map +1 -1
  116. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +114 -115
  117. package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  118. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +10 -5
  119. package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  120. package/lib/commonjs/web/tools/InteractionManager.js +12 -3
  121. package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
  122. package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
  123. package/lib/commonjs/web/tools/PointerEventManager.js +55 -27
  124. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  125. package/lib/commonjs/web/tools/TouchEventManager.js +26 -5
  126. package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
  127. package/lib/commonjs/web/tools/Vector.js +58 -0
  128. package/lib/commonjs/web/tools/Vector.js.map +1 -0
  129. package/lib/commonjs/web/utils.js +9 -1
  130. package/lib/commonjs/web/utils.js.map +1 -1
  131. package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
  132. package/lib/module/Directions.js +16 -4
  133. package/lib/module/Directions.js.map +1 -1
  134. package/lib/module/RNGestureHandlerModule.js +84 -4
  135. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  136. package/lib/module/RNGestureHandlerModule.native.js +5 -0
  137. package/lib/module/RNGestureHandlerModule.native.js.map +1 -0
  138. package/lib/module/RNRenderer.js +3 -3
  139. package/lib/module/RNRenderer.js.map +1 -1
  140. package/lib/module/RNRenderer.native.js +4 -0
  141. package/lib/module/RNRenderer.native.js.map +1 -0
  142. package/lib/module/components/DrawerLayout.js.map +1 -1
  143. package/lib/module/components/GestureComponents.js +18 -80
  144. package/lib/module/components/GestureComponents.js.map +1 -1
  145. package/lib/module/components/GestureComponents.native.js +90 -0
  146. package/lib/module/components/GestureComponents.native.js.map +1 -0
  147. package/lib/module/components/GestureHandlerButton.js +8 -2
  148. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  149. package/lib/module/components/GestureHandlerButton.native.js +3 -0
  150. package/lib/module/components/GestureHandlerButton.native.js.map +1 -0
  151. package/lib/module/components/GestureHandlerRootView.js +0 -5
  152. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  153. package/lib/module/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +6 -1
  154. package/lib/module/components/GestureHandlerRootView.native.js.map +1 -0
  155. package/lib/module/components/Swipeable.js +3 -1
  156. package/lib/module/components/Swipeable.js.map +1 -1
  157. package/lib/module/components/touchables/GenericTouchable.js +1 -0
  158. package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
  159. package/lib/module/getReactNativeVersion.js +1 -7
  160. package/lib/module/getReactNativeVersion.js.map +1 -1
  161. package/lib/module/getReactNativeVersion.native.js +10 -0
  162. package/lib/module/getReactNativeVersion.native.js.map +1 -0
  163. package/lib/module/getShadowNodeFromRef.js +4 -33
  164. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  165. package/lib/module/getShadowNodeFromRef.native.js +37 -0
  166. package/lib/module/getShadowNodeFromRef.native.js.map +1 -0
  167. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  168. package/lib/module/handlers/PressabilityDebugView.js +4 -2
  169. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  170. package/lib/module/handlers/PressabilityDebugView.native.js +3 -0
  171. package/lib/module/handlers/PressabilityDebugView.native.js.map +1 -0
  172. package/lib/module/handlers/createHandler.js +11 -6
  173. package/lib/module/handlers/createHandler.js.map +1 -1
  174. package/lib/module/handlers/customDirectEventTypes.js +5 -0
  175. package/lib/module/handlers/customDirectEventTypes.js.map +1 -0
  176. package/lib/module/handlers/customDirectEventTypes.native.js +3 -0
  177. package/lib/module/handlers/customDirectEventTypes.native.js.map +1 -0
  178. package/lib/module/handlers/gestureHandlerCommon.js +11 -1
  179. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  180. package/lib/module/handlers/gestures/GestureDetector.js +25 -0
  181. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  182. package/lib/module/handlers/gestures/flingGesture.js +13 -0
  183. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  184. package/lib/module/handlers/gestures/forceTouchGesture.js +17 -0
  185. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  186. package/lib/module/handlers/gestures/gesture.js +135 -0
  187. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  188. package/lib/module/handlers/gestures/gestureObjects.js +67 -0
  189. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  190. package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -1
  191. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  192. package/lib/module/handlers/gestures/hoverGesture.js +1 -1
  193. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  194. package/lib/module/handlers/gestures/longPressGesture.js +12 -0
  195. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  196. package/lib/module/handlers/gestures/nativeGesture.js +10 -0
  197. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  198. package/lib/module/handlers/gestures/panGesture.js +76 -0
  199. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  200. package/lib/module/handlers/gestures/tapGesture.js +42 -0
  201. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  202. package/lib/module/index.js +1 -1
  203. package/lib/module/index.js.map +1 -1
  204. package/lib/module/mocks.js +2 -0
  205. package/lib/module/mocks.js.map +1 -1
  206. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  207. package/lib/module/utils.js +5 -1
  208. package/lib/module/utils.js.map +1 -1
  209. package/lib/module/web/Gestures.js +39 -0
  210. package/lib/module/web/Gestures.js.map +1 -0
  211. package/lib/module/web/constants.js +1 -6
  212. package/lib/module/web/constants.js.map +1 -1
  213. package/lib/module/web/handlers/FlingGestureHandler.js +34 -12
  214. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  215. package/lib/module/web/handlers/GestureHandler.js +10 -9
  216. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  217. package/lib/module/web/handlers/IGestureHandler.js +2 -0
  218. package/lib/module/web/handlers/IGestureHandler.js.map +1 -0
  219. package/lib/module/web/handlers/NativeViewGestureHandler.js +5 -6
  220. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  221. package/lib/module/web/handlers/PanGestureHandler.js +3 -1
  222. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  223. package/lib/module/web/interfaces.js +0 -11
  224. package/lib/module/web/interfaces.js.map +1 -1
  225. package/lib/module/web/tools/EventManager.js.map +1 -1
  226. package/lib/module/web/tools/GestureHandlerOrchestrator.js +114 -115
  227. package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
  228. package/lib/module/web/tools/GestureHandlerWebDelegate.js +9 -4
  229. package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
  230. package/lib/module/web/tools/InteractionManager.js +9 -3
  231. package/lib/module/web/tools/InteractionManager.js.map +1 -1
  232. package/lib/module/web/tools/NodeManager.js.map +1 -1
  233. package/lib/module/web/tools/PointerEventManager.js +53 -26
  234. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  235. package/lib/module/web/tools/TouchEventManager.js +26 -5
  236. package/lib/module/web/tools/TouchEventManager.js.map +1 -1
  237. package/lib/module/web/tools/Vector.js +47 -0
  238. package/lib/module/web/tools/Vector.js.map +1 -0
  239. package/lib/module/web/utils.js +2 -0
  240. package/lib/module/web/utils.js.map +1 -1
  241. package/lib/module/web_hammer/NodeManager.js.map +1 -1
  242. package/lib/typescript/Directions.d.ts +7 -0
  243. package/lib/typescript/RNGestureHandlerModule.d.ts +15 -2
  244. package/lib/typescript/RNGestureHandlerModule.native.d.ts +2 -0
  245. package/lib/typescript/RNRenderer.d.ts +3 -1
  246. package/lib/typescript/RNRenderer.native.d.ts +1 -0
  247. package/lib/typescript/components/DrawerLayout.d.ts +1 -2
  248. package/lib/typescript/components/GestureComponents.d.ts +7 -21
  249. package/lib/typescript/components/GestureComponents.native.d.ts +22 -0
  250. package/lib/typescript/components/GestureHandlerButton.d.ts +3 -3
  251. package/lib/typescript/components/GestureHandlerButton.native.d.ts +4 -0
  252. package/lib/typescript/components/touchables/GenericTouchable.d.ts +2 -1
  253. package/lib/typescript/getReactNativeVersion.d.ts +1 -4
  254. package/lib/typescript/getReactNativeVersion.native.d.ts +4 -0
  255. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -1
  256. package/lib/typescript/getShadowNodeFromRef.native.d.ts +1 -0
  257. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
  258. package/lib/typescript/handlers/PanGestureHandler.d.ts +4 -4
  259. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -1
  260. package/lib/typescript/handlers/PressabilityDebugView.native.d.ts +1 -0
  261. package/lib/typescript/handlers/customDirectEventTypes.d.ts +2 -0
  262. package/lib/typescript/handlers/customDirectEventTypes.native.d.ts +1 -0
  263. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +11 -2
  264. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +38 -1
  265. package/lib/typescript/handlers/gestures/flingGesture.d.ts +11 -0
  266. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +14 -0
  267. package/lib/typescript/handlers/gestures/gesture.d.ts +114 -2
  268. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +57 -0
  269. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +1 -1
  270. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +10 -0
  271. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +8 -0
  272. package/lib/typescript/handlers/gestures/panGesture.d.ts +67 -4
  273. package/lib/typescript/handlers/gestures/tapGesture.d.ts +35 -0
  274. package/lib/typescript/index.d.ts +1 -1
  275. package/lib/typescript/mocks.d.ts +1 -0
  276. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +4 -1
  277. package/lib/typescript/web/Gestures.d.ts +36 -0
  278. package/lib/typescript/web/constants.d.ts +1 -6
  279. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +3 -3
  280. package/lib/typescript/web/handlers/GestureHandler.d.ts +13 -11
  281. package/lib/typescript/web/handlers/IGestureHandler.d.ts +38 -0
  282. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -0
  283. package/lib/typescript/web/interfaces.d.ts +8 -10
  284. package/lib/typescript/web/tools/EventManager.d.ts +15 -12
  285. package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +3 -4
  286. package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +7 -5
  287. package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -3
  288. package/lib/typescript/web/tools/InteractionManager.d.ts +6 -6
  289. package/lib/typescript/web/tools/NodeManager.d.ts +4 -3
  290. package/lib/typescript/web/tools/PointerEventManager.d.ts +11 -2
  291. package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -1
  292. package/lib/typescript/web/tools/Vector.d.ts +15 -0
  293. package/lib/typescript/web/utils.d.ts +4 -4
  294. package/lib/typescript/web_hammer/NodeManager.d.ts +1 -1
  295. package/package.json +4 -2
  296. package/src/Directions.ts +21 -4
  297. package/src/RNGestureHandlerModule.native.ts +5 -0
  298. package/src/RNGestureHandlerModule.ts +104 -4
  299. package/src/RNRenderer.native.ts +3 -0
  300. package/src/RNRenderer.ts +3 -3
  301. package/src/components/DrawerLayout.tsx +1 -1
  302. package/src/components/GestureComponents.native.tsx +148 -0
  303. package/src/components/GestureComponents.tsx +24 -131
  304. package/src/components/GestureHandlerButton.native.tsx +5 -0
  305. package/src/components/GestureHandlerButton.tsx +5 -4
  306. package/src/components/{GestureHandlerRootView.web.tsx → GestureHandlerRootView.native.tsx} +6 -0
  307. package/src/components/GestureHandlerRootView.tsx +0 -6
  308. package/src/components/Swipeable.tsx +2 -0
  309. package/src/components/touchables/GenericTouchable.tsx +3 -0
  310. package/src/getReactNativeVersion.native.ts +11 -0
  311. package/src/getReactNativeVersion.ts +1 -9
  312. package/src/getShadowNodeFromRef.native.ts +44 -0
  313. package/src/getShadowNodeFromRef.ts +4 -41
  314. package/src/handlers/PanGestureHandler.ts +8 -4
  315. package/src/handlers/PressabilityDebugView.native.tsx +2 -0
  316. package/src/handlers/PressabilityDebugView.tsx +4 -2
  317. package/src/handlers/createHandler.tsx +24 -14
  318. package/src/handlers/customDirectEventTypes.native.ts +2 -0
  319. package/src/handlers/customDirectEventTypes.ts +5 -0
  320. package/src/handlers/gestureHandlerCommon.ts +28 -1
  321. package/src/handlers/gestures/GestureDetector.tsx +62 -4
  322. package/src/handlers/gestures/flingGesture.ts +11 -0
  323. package/src/handlers/gestures/forceTouchGesture.ts +14 -0
  324. package/src/handlers/gestures/gesture.ts +114 -1
  325. package/src/handlers/gestures/gestureObjects.ts +57 -0
  326. package/src/handlers/gestures/gestureStateManager.web.ts +1 -1
  327. package/src/handlers/gestures/hoverGesture.ts +1 -1
  328. package/src/handlers/gestures/longPressGesture.ts +10 -0
  329. package/src/handlers/gestures/nativeGesture.ts +8 -0
  330. package/src/handlers/gestures/panGesture.ts +75 -4
  331. package/src/handlers/gestures/tapGesture.ts +35 -0
  332. package/src/index.ts +1 -1
  333. package/src/mocks.ts +2 -0
  334. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +4 -0
  335. package/src/utils.ts +9 -2
  336. package/src/web/Gestures.ts +41 -0
  337. package/src/web/constants.ts +1 -7
  338. package/src/web/handlers/FlingGestureHandler.ts +54 -24
  339. package/src/web/handlers/GestureHandler.ts +23 -19
  340. package/src/web/handlers/IGestureHandler.ts +50 -0
  341. package/src/web/handlers/NativeViewGestureHandler.ts +5 -6
  342. package/src/web/handlers/PanGestureHandler.ts +4 -0
  343. package/src/web/interfaces.ts +14 -10
  344. package/src/web/tools/EventManager.ts +16 -14
  345. package/src/web/tools/GestureHandlerDelegate.ts +3 -4
  346. package/src/web/tools/GestureHandlerOrchestrator.ts +160 -145
  347. package/src/web/tools/GestureHandlerWebDelegate.ts +14 -9
  348. package/src/web/tools/InteractionManager.ts +18 -12
  349. package/src/web/tools/NodeManager.ts +4 -3
  350. package/src/web/tools/PointerEventManager.ts +181 -166
  351. package/src/web/tools/TouchEventManager.ts +126 -114
  352. package/src/web/tools/Vector.ts +60 -0
  353. package/src/web/utils.ts +7 -4
  354. package/src/web_hammer/NodeManager.ts +1 -1
  355. package/lib/commonjs/RNGestureHandlerModule.web.js +0 -163
  356. package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
  357. package/lib/commonjs/RNRenderer.web.js +0 -11
  358. package/lib/commonjs/RNRenderer.web.js.map +0 -1
  359. package/lib/commonjs/components/GestureComponents.web.js +0 -52
  360. package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
  361. package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
  362. package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
  363. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
  364. package/lib/commonjs/getReactNativeVersion.web.js +0 -11
  365. package/lib/commonjs/getReactNativeVersion.web.js.map +0 -1
  366. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
  367. package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
  368. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
  369. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
  370. package/lib/module/RNGestureHandlerModule.web.js +0 -122
  371. package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
  372. package/lib/module/RNRenderer.web.js +0 -4
  373. package/lib/module/RNRenderer.web.js.map +0 -1
  374. package/lib/module/components/GestureComponents.web.js +0 -28
  375. package/lib/module/components/GestureComponents.web.js.map +0 -1
  376. package/lib/module/components/GestureHandlerButton.web.js +0 -9
  377. package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
  378. package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
  379. package/lib/module/getReactNativeVersion.web.js +0 -4
  380. package/lib/module/getReactNativeVersion.web.js.map +0 -1
  381. package/lib/module/getShadowNodeFromRef.web.js +0 -8
  382. package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
  383. package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
  384. package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
  385. package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -50
  386. package/lib/typescript/RNRenderer.web.d.ts +0 -3
  387. package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
  388. package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
  389. package/lib/typescript/getReactNativeVersion.web.d.ts +0 -1
  390. package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
  391. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
  392. package/src/RNGestureHandlerModule.web.ts +0 -146
  393. package/src/RNRenderer.web.ts +0 -3
  394. package/src/components/GestureComponents.web.tsx +0 -41
  395. package/src/components/GestureHandlerButton.web.tsx +0 -6
  396. package/src/getReactNativeVersion.web.ts +0 -3
  397. package/src/getShadowNodeFromRef.web.ts +0 -7
  398. package/src/handlers/PressabilityDebugView.web.tsx +0 -4
  399. /package/lib/typescript/components/{GestureHandlerRootView.web.d.ts → GestureHandlerRootView.native.d.ts} +0 -0
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getReactNativeVersion = getReactNativeVersion;
7
-
8
- function getReactNativeVersion() {
9
- throw new Error('getReactNativeVersion is not supported on web');
10
- }
11
- //# sourceMappingURL=getReactNativeVersion.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["getReactNativeVersion.web.ts"],"names":["getReactNativeVersion","Error"],"mappings":";;;;;;;AAAO,SAASA,qBAAT,GAAiC;AACtC,QAAM,IAAIC,KAAJ,CAAU,+CAAV,CAAN;AACD","sourcesContent":["export function getReactNativeVersion() {\n throw new Error('getReactNativeVersion is not supported on web');\n}\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getShadowNodeFromRef = getShadowNodeFromRef;
7
-
8
- // Used by GestureDetector (unsupported on web at the moment) to check whether the
9
- // attached view may get flattened on Fabric. Original implementation causes errors
10
- // on web due to the static resolution of `require` statements by webpack breaking
11
- // the conditional importing.
12
- function getShadowNodeFromRef(_ref) {
13
- return null;
14
- }
15
- //# sourceMappingURL=getShadowNodeFromRef.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["getShadowNodeFromRef.web.ts"],"names":["getShadowNodeFromRef","_ref"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACO,SAASA,oBAAT,CAA8BC,IAA9B,EAAyC;AAC9C,SAAO,IAAP;AACD","sourcesContent":["// Used by GestureDetector (unsupported on web at the moment) to check whether the\n// attached view may get flattened on Fabric. Original implementation causes errors\n// on web due to the static resolution of `require` statements by webpack breaking\n// the conditional importing.\nexport function getShadowNodeFromRef(_ref: any) {\n return null;\n}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PressabilityDebugView = PressabilityDebugView;
7
-
8
- // PressabilityDebugView is not implemented in react-native-web
9
- function PressabilityDebugView() {
10
- return null;
11
- }
12
- //# sourceMappingURL=PressabilityDebugView.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["PressabilityDebugView.web.tsx"],"names":["PressabilityDebugView"],"mappings":";;;;;;;AAAA;AACO,SAASA,qBAAT,GAAiC;AACtC,SAAO,IAAP;AACD","sourcesContent":["// PressabilityDebugView is not implemented in react-native-web\nexport function PressabilityDebugView() {\n return null;\n}\n"]}
@@ -1,122 +0,0 @@
1
- import React from 'react';
2
- import { isNewWebImplementationEnabled } from './EnableNewWebImplementation'; //GestureHandlers
3
-
4
- import InteractionManager from './web/tools/InteractionManager';
5
- import NodeManager from './web/tools/NodeManager';
6
- import PanGestureHandler from './web/handlers/PanGestureHandler';
7
- import TapGestureHandler from './web/handlers/TapGestureHandler';
8
- import LongPressGestureHandler from './web/handlers/LongPressGestureHandler';
9
- import PinchGestureHandler from './web/handlers/PinchGestureHandler';
10
- import RotationGestureHandler from './web/handlers/RotationGestureHandler';
11
- import FlingGestureHandler from './web/handlers/FlingGestureHandler';
12
- import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';
13
- import ManualGestureHandler from './web/handlers/ManualGestureHandler';
14
- import HoverGestureHandler from './web/handlers/HoverGestureHandler'; //Hammer Handlers
15
-
16
- import * as HammerNodeManager from './web_hammer/NodeManager';
17
- import HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';
18
- import HammerPanGestureHandler from './web_hammer/PanGestureHandler';
19
- import HammerTapGestureHandler from './web_hammer/TapGestureHandler';
20
- import HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';
21
- import HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';
22
- import HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';
23
- import HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';
24
- import { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';
25
- export const Gestures = {
26
- NativeViewGestureHandler,
27
- PanGestureHandler,
28
- TapGestureHandler,
29
- LongPressGestureHandler,
30
- PinchGestureHandler,
31
- RotationGestureHandler,
32
- FlingGestureHandler,
33
- ManualGestureHandler,
34
- HoverGestureHandler
35
- };
36
- export const HammerGestures = {
37
- NativeViewGestureHandler: HammerNativeViewGestureHandler,
38
- PanGestureHandler: HammerPanGestureHandler,
39
- TapGestureHandler: HammerTapGestureHandler,
40
- LongPressGestureHandler: HammerLongPressGestureHandler,
41
- PinchGestureHandler: HammerPinchGestureHandler,
42
- RotationGestureHandler: HammerRotationGestureHandler,
43
- FlingGestureHandler: HammerFlingGestureHandler
44
- };
45
- export default {
46
- handleSetJSResponder(tag, blockNativeResponder) {
47
- console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
48
- },
49
-
50
- handleClearJSResponder() {
51
- console.warn('handleClearJSResponder: ');
52
- },
53
-
54
- createGestureHandler(handlerName, handlerTag, config) {
55
- if (isNewWebImplementationEnabled()) {
56
- if (!(handlerName in Gestures)) {
57
- throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
58
- }
59
-
60
- const GestureClass = Gestures[handlerName];
61
- NodeManager.createGestureHandler(handlerTag, new GestureClass(new GestureHandlerWebDelegate()));
62
- InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), config);
63
- } else {
64
- if (!(handlerName in HammerGestures)) {
65
- throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
66
- } // @ts-ignore If it doesn't exist, the error is thrown
67
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
68
-
69
-
70
- const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
71
-
72
- HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
73
- }
74
-
75
- this.updateGestureHandler(handlerTag, config);
76
- },
77
-
78
- attachGestureHandler(handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
- newView, _actionType, propsRef) {
80
- if (!(newView instanceof HTMLElement || newView instanceof React.Component)) {
81
- return;
82
- }
83
-
84
- if (isNewWebImplementationEnabled()) {
85
- //@ts-ignore Types should be HTMLElement or React.Component
86
- NodeManager.getHandler(handlerTag).init(newView, propsRef);
87
- } else {
88
- //@ts-ignore Types should be HTMLElement or React.Component
89
- HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
90
- }
91
- },
92
-
93
- updateGestureHandler(handlerTag, newConfig) {
94
- if (isNewWebImplementationEnabled()) {
95
- NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
96
- InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), newConfig);
97
- } else {
98
- HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
99
- }
100
- },
101
-
102
- getGestureHandlerNode(handlerTag) {
103
- if (isNewWebImplementationEnabled()) {
104
- return NodeManager.getHandler(handlerTag);
105
- } else {
106
- return HammerNodeManager.getHandler(handlerTag);
107
- }
108
- },
109
-
110
- dropGestureHandler(handlerTag) {
111
- if (isNewWebImplementationEnabled()) {
112
- NodeManager.dropGestureHandler(handlerTag);
113
- } else {
114
- HammerNodeManager.dropGestureHandler(handlerTag);
115
- }
116
- },
117
-
118
- // eslint-disable-next-line @typescript-eslint/no-empty-function
119
- flushOperations() {}
120
-
121
- };
122
- //# sourceMappingURL=RNGestureHandlerModule.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["React","isNewWebImplementationEnabled","InteractionManager","NodeManager","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","NativeViewGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerNodeManager","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","GestureHandlerWebDelegate","Gestures","HammerGestures","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","getInstance","configureInteractions","getHandler","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"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","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\nimport HoverGestureHandler from './web/handlers/HoverGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n HoverGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(tag: number, blockNativeResponder: boolean) {\n console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isNewWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(\n handlerTag,\n new GestureClass(new GestureHandlerWebDelegate())\n );\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n config as unknown as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config as unknown as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (\n !(newView instanceof HTMLElement || newView instanceof React.Component)\n ) {\n return;\n }\n\n if (isNewWebImplementationEnabled()) {\n //@ts-ignore Types should be HTMLElement or React.Component\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n //@ts-ignore Types should be HTMLElement or React.Component\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
@@ -1,4 +0,0 @@
1
- export const RNRenderer = {
2
- findHostInstance_DEPRECATED: _ref => null
3
- };
4
- //# sourceMappingURL=RNRenderer.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["RNRenderer.web.ts"],"names":["RNRenderer","findHostInstance_DEPRECATED","_ref"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;AACxBC,EAAAA,2BAA2B,EAAGC,IAAD,IAAe;AADpB,CAAnB","sourcesContent":["export const RNRenderer = {\n findHostInstance_DEPRECATED: (_ref: any) => null,\n};\n"]}
@@ -1,28 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import * as React from 'react';
4
- import { FlatList as RNFlatList, Switch as RNSwitch, TextInput as RNTextInput, ScrollView as RNScrollView, View } from 'react-native';
5
- import createNativeWrapper from '../handlers/createNativeWrapper';
6
- export const ScrollView = createNativeWrapper(RNScrollView, {
7
- disallowInterruption: false
8
- });
9
- export const Switch = createNativeWrapper(RNSwitch, {
10
- shouldCancelWhenOutside: false,
11
- shouldActivateOnStart: true,
12
- disallowInterruption: true
13
- });
14
- export const TextInput = createNativeWrapper(RNTextInput);
15
- export const DrawerLayoutAndroid = () => {
16
- console.warn('DrawerLayoutAndroid is not supported on web!');
17
- return /*#__PURE__*/React.createElement(View, null);
18
- }; // RefreshControl is implemented as a functional component, rendering a View
19
- // NativeViewGestureHandler needs to set a ref on its child, which cannot be done
20
- // on functional components
21
-
22
- export const RefreshControl = createNativeWrapper(View);
23
- export const FlatList = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(RNFlatList, _extends({
24
- ref: ref
25
- }, props, {
26
- renderScrollComponent: scrollProps => /*#__PURE__*/React.createElement(ScrollView, scrollProps)
27
- })));
28
- //# sourceMappingURL=GestureComponents.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureComponents.web.tsx"],"names":["React","FlatList","RNFlatList","Switch","RNSwitch","TextInput","RNTextInput","ScrollView","RNScrollView","View","createNativeWrapper","disallowInterruption","shouldCancelWhenOutside","shouldActivateOnStart","DrawerLayoutAndroid","console","warn","RefreshControl","forwardRef","props","ref","scrollProps"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,QAAQ,IAAIC,UADd,EAEEC,MAAM,IAAIC,QAFZ,EAGEC,SAAS,IAAIC,WAHf,EAIEC,UAAU,IAAIC,YAJhB,EAMEC,IANF,QAOO,cAPP;AASA,OAAOC,mBAAP,MAAgC,iCAAhC;AAEA,OAAO,MAAMH,UAAU,GAAGG,mBAAmB,CAACF,YAAD,EAAe;AAC1DG,EAAAA,oBAAoB,EAAE;AADoC,CAAf,CAAtC;AAIP,OAAO,MAAMR,MAAM,GAAGO,mBAAmB,CAACN,QAAD,EAAW;AAClDQ,EAAAA,uBAAuB,EAAE,KADyB;AAElDC,EAAAA,qBAAqB,EAAE,IAF2B;AAGlDF,EAAAA,oBAAoB,EAAE;AAH4B,CAAX,CAAlC;AAKP,OAAO,MAAMN,SAAS,GAAGK,mBAAmB,CAACJ,WAAD,CAArC;AACP,OAAO,MAAMQ,mBAAmB,GAAG,MAAM;AACvCC,EAAAA,OAAO,CAACC,IAAR,CAAa,8CAAb;AACA,sBAAO,oBAAC,IAAD,OAAP;AACD,CAHM,C,CAKP;AACA;AACA;;AACA,OAAO,MAAMC,cAAc,GAAGP,mBAAmB,CAACD,IAAD,CAA1C;AAEP,OAAO,MAAMR,QAAQ,gBAAGD,KAAK,CAACkB,UAAN,CACtB,CAAoBC,KAApB,EAAiDC,GAAjD,kBACE,oBAAC,UAAD;AACE,EAAA,GAAG,EAAEA;AADP,GAEMD,KAFN;AAGE,EAAA,qBAAqB,EAAGE,WAAD,iBAAiB,oBAAC,UAAD,EAAgBA,WAAhB;AAH1C,GAFoB,CAAjB","sourcesContent":["import * as React from 'react';\nimport {\n FlatList as RNFlatList,\n Switch as RNSwitch,\n TextInput as RNTextInput,\n ScrollView as RNScrollView,\n FlatListProps,\n View,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nexport const ScrollView = createNativeWrapper(RNScrollView, {\n disallowInterruption: false,\n});\n\nexport const Switch = createNativeWrapper(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\nexport const TextInput = createNativeWrapper(RNTextInput);\nexport const DrawerLayoutAndroid = () => {\n console.warn('DrawerLayoutAndroid is not supported on web!');\n return <View />;\n};\n\n// RefreshControl is implemented as a functional component, rendering a View\n// NativeViewGestureHandler needs to set a ref on its child, which cannot be done\n// on functional components\nexport const RefreshControl = createNativeWrapper(View);\n\nexport const FlatList = React.forwardRef(\n <ItemT extends any>(props: FlatListProps<ItemT>, ref: any) => (\n <RNFlatList\n ref={ref}\n {...props}\n renderScrollComponent={(scrollProps) => <ScrollView {...scrollProps} />}\n />\n )\n);\n"]}
@@ -1,9 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import * as React from 'react';
4
- import { View } from 'react-native';
5
- export default /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(View, _extends({
6
- ref: ref,
7
- accessibilityRole: "button"
8
- }, props)));
9
- //# sourceMappingURL=GestureHandlerButton.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerButton.web.tsx"],"names":["React","View","forwardRef","props","ref"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,4BAAeD,KAAK,CAACE,UAAN,CAAuB,CAACC,KAAD,EAAQC,GAAR,kBACpC,oBAAC,IAAD;AAAM,EAAA,GAAG,EAAEA,GAAX;AAAgB,EAAA,iBAAiB,EAAC;AAAlC,GAA+CD,KAA/C,EADa,CAAf","sourcesContent":["import * as React from 'react';\nimport { View } from 'react-native';\n\nexport default React.forwardRef<View>((props, ref) => (\n <View ref={ref} accessibilityRole=\"button\" {...props} />\n));\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.web.tsx"],"names":["React","View","StyleSheet","GestureHandlerRootViewContext","GestureHandlerRootView","style","rest","styles","container","create","flex"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,EAA0BC,UAA1B,QAA4C,cAA5C;AACA,OAAOC,6BAAP,MAA0C,kCAA1C;AAKA,eAAe,SAASC,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B,sBACE,oBAAC,6BAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAED,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AAA7B,KAA4CF,IAA5C,EADF,CADF;AAKD;AAED,MAAMC,MAAM,GAAGL,UAAU,CAACO,MAAX,CAAkB;AAC/BD,EAAAA,SAAS,EAAE;AAAEE,IAAAA,IAAI,EAAE;AAAR;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, ViewProps, StyleSheet } from 'react-native';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView({\n style,\n ...rest\n}: GestureHandlerRootViewProps) {\n return (\n <GestureHandlerRootViewContext.Provider value>\n <View style={style ?? styles.container} {...rest} />\n </GestureHandlerRootViewContext.Provider>\n );\n}\n\nconst styles = StyleSheet.create({\n container: { flex: 1 },\n});\n"]}
@@ -1,4 +0,0 @@
1
- export function getReactNativeVersion() {
2
- throw new Error('getReactNativeVersion is not supported on web');
3
- }
4
- //# sourceMappingURL=getReactNativeVersion.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["getReactNativeVersion.web.ts"],"names":["getReactNativeVersion","Error"],"mappings":"AAAA,OAAO,SAASA,qBAAT,GAAiC;AACtC,QAAM,IAAIC,KAAJ,CAAU,+CAAV,CAAN;AACD","sourcesContent":["export function getReactNativeVersion() {\n throw new Error('getReactNativeVersion is not supported on web');\n}\n"]}
@@ -1,8 +0,0 @@
1
- // Used by GestureDetector (unsupported on web at the moment) to check whether the
2
- // attached view may get flattened on Fabric. Original implementation causes errors
3
- // on web due to the static resolution of `require` statements by webpack breaking
4
- // the conditional importing.
5
- export function getShadowNodeFromRef(_ref) {
6
- return null;
7
- }
8
- //# sourceMappingURL=getShadowNodeFromRef.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["getShadowNodeFromRef.web.ts"],"names":["getShadowNodeFromRef","_ref"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,SAASA,oBAAT,CAA8BC,IAA9B,EAAyC;AAC9C,SAAO,IAAP;AACD","sourcesContent":["// Used by GestureDetector (unsupported on web at the moment) to check whether the\n// attached view may get flattened on Fabric. Original implementation causes errors\n// on web due to the static resolution of `require` statements by webpack breaking\n// the conditional importing.\nexport function getShadowNodeFromRef(_ref: any) {\n return null;\n}\n"]}
@@ -1,5 +0,0 @@
1
- // PressabilityDebugView is not implemented in react-native-web
2
- export function PressabilityDebugView() {
3
- return null;
4
- }
5
- //# sourceMappingURL=PressabilityDebugView.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["PressabilityDebugView.web.tsx"],"names":["PressabilityDebugView"],"mappings":"AAAA;AACA,OAAO,SAASA,qBAAT,GAAiC;AACtC,SAAO,IAAP;AACD","sourcesContent":["// PressabilityDebugView is not implemented in react-native-web\nexport function PressabilityDebugView() {\n return null;\n}\n"]}
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { ActionType } from './ActionType';
3
- import PanGestureHandler from './web/handlers/PanGestureHandler';
4
- import TapGestureHandler from './web/handlers/TapGestureHandler';
5
- import LongPressGestureHandler from './web/handlers/LongPressGestureHandler';
6
- import PinchGestureHandler from './web/handlers/PinchGestureHandler';
7
- import RotationGestureHandler from './web/handlers/RotationGestureHandler';
8
- import FlingGestureHandler from './web/handlers/FlingGestureHandler';
9
- import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';
10
- import ManualGestureHandler from './web/handlers/ManualGestureHandler';
11
- import HoverGestureHandler from './web/handlers/HoverGestureHandler';
12
- import HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';
13
- import HammerPanGestureHandler from './web_hammer/PanGestureHandler';
14
- import HammerTapGestureHandler from './web_hammer/TapGestureHandler';
15
- import HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';
16
- import HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';
17
- import HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';
18
- import HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';
19
- import { Config } from './web/interfaces';
20
- export declare const Gestures: {
21
- NativeViewGestureHandler: typeof NativeViewGestureHandler;
22
- PanGestureHandler: typeof PanGestureHandler;
23
- TapGestureHandler: typeof TapGestureHandler;
24
- LongPressGestureHandler: typeof LongPressGestureHandler;
25
- PinchGestureHandler: typeof PinchGestureHandler;
26
- RotationGestureHandler: typeof RotationGestureHandler;
27
- FlingGestureHandler: typeof FlingGestureHandler;
28
- ManualGestureHandler: typeof ManualGestureHandler;
29
- HoverGestureHandler: typeof HoverGestureHandler;
30
- };
31
- export declare const HammerGestures: {
32
- NativeViewGestureHandler: typeof HammerNativeViewGestureHandler;
33
- PanGestureHandler: typeof HammerPanGestureHandler;
34
- TapGestureHandler: typeof HammerTapGestureHandler;
35
- LongPressGestureHandler: typeof HammerLongPressGestureHandler;
36
- PinchGestureHandler: typeof HammerPinchGestureHandler;
37
- RotationGestureHandler: typeof HammerRotationGestureHandler;
38
- FlingGestureHandler: typeof HammerFlingGestureHandler;
39
- };
40
- declare const _default: {
41
- handleSetJSResponder(tag: number, blockNativeResponder: boolean): void;
42
- handleClearJSResponder(): void;
43
- createGestureHandler<T>(handlerName: keyof typeof Gestures, handlerTag: number, config: T): void;
44
- attachGestureHandler(handlerTag: number, newView: any, _actionType: ActionType, propsRef: React.RefObject<unknown>): void;
45
- updateGestureHandler(handlerTag: number, newConfig: Config): void;
46
- getGestureHandlerNode(handlerTag: number): NativeViewGestureHandler | PanGestureHandler | TapGestureHandler | LongPressGestureHandler | PinchGestureHandler | RotationGestureHandler | FlingGestureHandler | ManualGestureHandler | HoverGestureHandler | HammerNativeViewGestureHandler | HammerPanGestureHandler | HammerTapGestureHandler | HammerLongPressGestureHandler | HammerPinchGestureHandler | HammerRotationGestureHandler | HammerFlingGestureHandler;
47
- dropGestureHandler(handlerTag: number): void;
48
- flushOperations(): void;
49
- };
50
- export default _default;
@@ -1,3 +0,0 @@
1
- export declare const RNRenderer: {
2
- findHostInstance_DEPRECATED: (_ref: any) => null;
3
- };
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { FlatListProps } from 'react-native';
3
- export declare const ScrollView: React.ForwardRefExoticComponent<import("react-native").ScrollViewProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
4
- export declare const Switch: React.ForwardRefExoticComponent<import("react-native").SwitchProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
5
- export declare const TextInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
6
- export declare const DrawerLayoutAndroid: () => React.JSX.Element;
7
- export declare const RefreshControl: React.ForwardRefExoticComponent<import("react-native").ViewProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
8
- export declare const FlatList: React.ForwardRefExoticComponent<FlatListProps<unknown> & React.RefAttributes<unknown>>;
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- import { View } from 'react-native';
3
- declare const _default: React.ForwardRefExoticComponent<React.RefAttributes<View>>;
4
- export default _default;
@@ -1 +0,0 @@
1
- export declare function getReactNativeVersion(): void;
@@ -1 +0,0 @@
1
- export declare function getShadowNodeFromRef(_ref: any): null;
@@ -1 +0,0 @@
1
- export declare function PressabilityDebugView(): null;
@@ -1,146 +0,0 @@
1
- import React from 'react';
2
-
3
- import { ActionType } from './ActionType';
4
- import { isNewWebImplementationEnabled } from './EnableNewWebImplementation';
5
-
6
- //GestureHandlers
7
- import InteractionManager from './web/tools/InteractionManager';
8
- import NodeManager from './web/tools/NodeManager';
9
- import PanGestureHandler from './web/handlers/PanGestureHandler';
10
- import TapGestureHandler from './web/handlers/TapGestureHandler';
11
- import LongPressGestureHandler from './web/handlers/LongPressGestureHandler';
12
- import PinchGestureHandler from './web/handlers/PinchGestureHandler';
13
- import RotationGestureHandler from './web/handlers/RotationGestureHandler';
14
- import FlingGestureHandler from './web/handlers/FlingGestureHandler';
15
- import NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';
16
- import ManualGestureHandler from './web/handlers/ManualGestureHandler';
17
- import HoverGestureHandler from './web/handlers/HoverGestureHandler';
18
-
19
- //Hammer Handlers
20
- import * as HammerNodeManager from './web_hammer/NodeManager';
21
- import HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';
22
- import HammerPanGestureHandler from './web_hammer/PanGestureHandler';
23
- import HammerTapGestureHandler from './web_hammer/TapGestureHandler';
24
- import HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';
25
- import HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';
26
- import HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';
27
- import HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';
28
- import { Config } from './web/interfaces';
29
- import { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';
30
-
31
- export const Gestures = {
32
- NativeViewGestureHandler,
33
- PanGestureHandler,
34
- TapGestureHandler,
35
- LongPressGestureHandler,
36
- PinchGestureHandler,
37
- RotationGestureHandler,
38
- FlingGestureHandler,
39
- ManualGestureHandler,
40
- HoverGestureHandler,
41
- };
42
-
43
- export const HammerGestures = {
44
- NativeViewGestureHandler: HammerNativeViewGestureHandler,
45
- PanGestureHandler: HammerPanGestureHandler,
46
- TapGestureHandler: HammerTapGestureHandler,
47
- LongPressGestureHandler: HammerLongPressGestureHandler,
48
- PinchGestureHandler: HammerPinchGestureHandler,
49
- RotationGestureHandler: HammerRotationGestureHandler,
50
- FlingGestureHandler: HammerFlingGestureHandler,
51
- };
52
-
53
- export default {
54
- handleSetJSResponder(tag: number, blockNativeResponder: boolean) {
55
- console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
56
- },
57
- handleClearJSResponder() {
58
- console.warn('handleClearJSResponder: ');
59
- },
60
- createGestureHandler<T>(
61
- handlerName: keyof typeof Gestures,
62
- handlerTag: number,
63
- config: T
64
- ) {
65
- if (isNewWebImplementationEnabled()) {
66
- if (!(handlerName in Gestures)) {
67
- throw new Error(
68
- `react-native-gesture-handler: ${handlerName} is not supported on web.`
69
- );
70
- }
71
-
72
- const GestureClass = Gestures[handlerName];
73
- NodeManager.createGestureHandler(
74
- handlerTag,
75
- new GestureClass(new GestureHandlerWebDelegate())
76
- );
77
- InteractionManager.getInstance().configureInteractions(
78
- NodeManager.getHandler(handlerTag),
79
- config as unknown as Config
80
- );
81
- } else {
82
- if (!(handlerName in HammerGestures)) {
83
- throw new Error(
84
- `react-native-gesture-handler: ${handlerName} is not supported on web.`
85
- );
86
- }
87
-
88
- // @ts-ignore If it doesn't exist, the error is thrown
89
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
90
- const GestureClass = HammerGestures[handlerName];
91
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
92
- HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
93
- }
94
-
95
- this.updateGestureHandler(handlerTag, config as unknown as Config);
96
- },
97
- attachGestureHandler(
98
- handlerTag: number,
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
100
- newView: any,
101
- _actionType: ActionType,
102
- propsRef: React.RefObject<unknown>
103
- ) {
104
- if (
105
- !(newView instanceof HTMLElement || newView instanceof React.Component)
106
- ) {
107
- return;
108
- }
109
-
110
- if (isNewWebImplementationEnabled()) {
111
- //@ts-ignore Types should be HTMLElement or React.Component
112
- NodeManager.getHandler(handlerTag).init(newView, propsRef);
113
- } else {
114
- //@ts-ignore Types should be HTMLElement or React.Component
115
- HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
116
- }
117
- },
118
- updateGestureHandler(handlerTag: number, newConfig: Config) {
119
- if (isNewWebImplementationEnabled()) {
120
- NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
121
-
122
- InteractionManager.getInstance().configureInteractions(
123
- NodeManager.getHandler(handlerTag),
124
- newConfig
125
- );
126
- } else {
127
- HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
128
- }
129
- },
130
- getGestureHandlerNode(handlerTag: number) {
131
- if (isNewWebImplementationEnabled()) {
132
- return NodeManager.getHandler(handlerTag);
133
- } else {
134
- return HammerNodeManager.getHandler(handlerTag);
135
- }
136
- },
137
- dropGestureHandler(handlerTag: number) {
138
- if (isNewWebImplementationEnabled()) {
139
- NodeManager.dropGestureHandler(handlerTag);
140
- } else {
141
- HammerNodeManager.dropGestureHandler(handlerTag);
142
- }
143
- },
144
- // eslint-disable-next-line @typescript-eslint/no-empty-function
145
- flushOperations() {},
146
- };
@@ -1,3 +0,0 @@
1
- export const RNRenderer = {
2
- findHostInstance_DEPRECATED: (_ref: any) => null,
3
- };
@@ -1,41 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- FlatList as RNFlatList,
4
- Switch as RNSwitch,
5
- TextInput as RNTextInput,
6
- ScrollView as RNScrollView,
7
- FlatListProps,
8
- View,
9
- } from 'react-native';
10
-
11
- import createNativeWrapper from '../handlers/createNativeWrapper';
12
-
13
- export const ScrollView = createNativeWrapper(RNScrollView, {
14
- disallowInterruption: false,
15
- });
16
-
17
- export const Switch = createNativeWrapper(RNSwitch, {
18
- shouldCancelWhenOutside: false,
19
- shouldActivateOnStart: true,
20
- disallowInterruption: true,
21
- });
22
- export const TextInput = createNativeWrapper(RNTextInput);
23
- export const DrawerLayoutAndroid = () => {
24
- console.warn('DrawerLayoutAndroid is not supported on web!');
25
- return <View />;
26
- };
27
-
28
- // RefreshControl is implemented as a functional component, rendering a View
29
- // NativeViewGestureHandler needs to set a ref on its child, which cannot be done
30
- // on functional components
31
- export const RefreshControl = createNativeWrapper(View);
32
-
33
- export const FlatList = React.forwardRef(
34
- <ItemT extends any>(props: FlatListProps<ItemT>, ref: any) => (
35
- <RNFlatList
36
- ref={ref}
37
- {...props}
38
- renderScrollComponent={(scrollProps) => <ScrollView {...scrollProps} />}
39
- />
40
- )
41
- );
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { View } from 'react-native';
3
-
4
- export default React.forwardRef<View>((props, ref) => (
5
- <View ref={ref} accessibilityRole="button" {...props} />
6
- ));
@@ -1,3 +0,0 @@
1
- export function getReactNativeVersion() {
2
- throw new Error('getReactNativeVersion is not supported on web');
3
- }
@@ -1,7 +0,0 @@
1
- // Used by GestureDetector (unsupported on web at the moment) to check whether the
2
- // attached view may get flattened on Fabric. Original implementation causes errors
3
- // on web due to the static resolution of `require` statements by webpack breaking
4
- // the conditional importing.
5
- export function getShadowNodeFromRef(_ref: any) {
6
- return null;
7
- }
@@ -1,4 +0,0 @@
1
- // PressabilityDebugView is not implemented in react-native-web
2
- export function PressabilityDebugView() {
3
- return null;
4
- }