react-native-gesture-handler 2.16.0 → 2.16.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. package/README.md +1 -0
  2. package/lib/commonjs/RNGestureHandlerModule.js +97 -4
  3. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  4. package/lib/commonjs/RNGestureHandlerModule.native.js +16 -0
  5. package/lib/commonjs/RNGestureHandlerModule.native.js.map +1 -0
  6. package/lib/commonjs/RNRenderer.js +5 -10
  7. package/lib/commonjs/RNRenderer.js.map +1 -1
  8. package/lib/commonjs/RNRenderer.native.js +16 -0
  9. package/lib/commonjs/RNRenderer.native.js.map +1 -0
  10. package/lib/commonjs/components/GestureComponents.js +19 -82
  11. package/lib/commonjs/components/GestureComponents.js.map +1 -1
  12. package/lib/commonjs/components/GestureComponents.native.js +115 -0
  13. package/lib/commonjs/components/GestureComponents.native.js.map +1 -0
  14. package/lib/commonjs/components/GestureHandlerButton.js +13 -3
  15. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  16. package/lib/commonjs/components/GestureHandlerButton.native.js +14 -0
  17. package/lib/commonjs/components/GestureHandlerButton.native.js.map +1 -0
  18. package/lib/commonjs/components/GestureHandlerRootView.js +0 -6
  19. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  20. package/lib/commonjs/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +7 -1
  21. package/lib/commonjs/components/GestureHandlerRootView.native.js.map +1 -0
  22. package/lib/commonjs/getReactNativeVersion.js +1 -12
  23. package/lib/commonjs/getReactNativeVersion.js.map +1 -1
  24. package/lib/commonjs/getReactNativeVersion.native.js +22 -0
  25. package/lib/commonjs/getReactNativeVersion.native.js.map +1 -0
  26. package/lib/commonjs/getShadowNodeFromRef.js +5 -34
  27. package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
  28. package/lib/commonjs/getShadowNodeFromRef.native.js +44 -0
  29. package/lib/commonjs/getShadowNodeFromRef.native.js.map +1 -0
  30. package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
  31. package/lib/commonjs/handlers/PressabilityDebugView.js +5 -7
  32. package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
  33. package/lib/commonjs/handlers/PressabilityDebugView.native.js +14 -0
  34. package/lib/commonjs/handlers/PressabilityDebugView.native.js.map +1 -0
  35. package/lib/commonjs/handlers/createHandler.js +9 -3
  36. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  37. package/lib/commonjs/handlers/customDirectEventTypes.js +5 -8
  38. package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
  39. package/lib/commonjs/handlers/customDirectEventTypes.native.js +14 -0
  40. package/lib/commonjs/handlers/customDirectEventTypes.native.js.map +1 -0
  41. package/lib/commonjs/handlers/gestures/GestureDetector.js +15 -0
  42. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  43. package/lib/commonjs/handlers/gestures/flingGesture.js +13 -0
  44. package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
  45. package/lib/commonjs/handlers/gestures/forceTouchGesture.js +17 -0
  46. package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
  47. package/lib/commonjs/handlers/gestures/gesture.js +135 -0
  48. package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
  49. package/lib/commonjs/handlers/gestures/gestureObjects.js +66 -0
  50. package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
  51. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +1 -1
  52. package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
  53. package/lib/commonjs/handlers/gestures/hoverGesture.js +1 -1
  54. package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
  55. package/lib/commonjs/handlers/gestures/longPressGesture.js +12 -0
  56. package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
  57. package/lib/commonjs/handlers/gestures/nativeGesture.js +10 -0
  58. package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
  59. package/lib/commonjs/handlers/gestures/panGesture.js +76 -0
  60. package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
  61. package/lib/commonjs/handlers/gestures/tapGesture.js +42 -0
  62. package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
  63. package/lib/commonjs/utils.js +5 -1
  64. package/lib/commonjs/utils.js.map +1 -1
  65. package/lib/commonjs/web/handlers/GestureHandler.js +7 -7
  66. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  67. package/lib/commonjs/web/handlers/PanGestureHandler.js +3 -1
  68. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  69. package/lib/commonjs/web/interfaces.js.map +1 -1
  70. package/lib/module/RNGestureHandlerModule.js +84 -4
  71. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  72. package/lib/module/RNGestureHandlerModule.native.js +5 -0
  73. package/lib/module/RNGestureHandlerModule.native.js.map +1 -0
  74. package/lib/module/RNRenderer.js +3 -3
  75. package/lib/module/RNRenderer.js.map +1 -1
  76. package/lib/module/RNRenderer.native.js +4 -0
  77. package/lib/module/RNRenderer.native.js.map +1 -0
  78. package/lib/module/components/GestureComponents.js +18 -80
  79. package/lib/module/components/GestureComponents.js.map +1 -1
  80. package/lib/module/components/GestureComponents.native.js +90 -0
  81. package/lib/module/components/GestureComponents.native.js.map +1 -0
  82. package/lib/module/components/GestureHandlerButton.js +8 -2
  83. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  84. package/lib/module/components/GestureHandlerButton.native.js +3 -0
  85. package/lib/module/components/GestureHandlerButton.native.js.map +1 -0
  86. package/lib/module/components/GestureHandlerRootView.js +0 -5
  87. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  88. package/lib/module/components/{GestureHandlerRootView.web.js → GestureHandlerRootView.native.js} +6 -1
  89. package/lib/module/components/GestureHandlerRootView.native.js.map +1 -0
  90. package/lib/module/getReactNativeVersion.js +1 -7
  91. package/lib/module/getReactNativeVersion.js.map +1 -1
  92. package/lib/module/getReactNativeVersion.native.js +10 -0
  93. package/lib/module/getReactNativeVersion.native.js.map +1 -0
  94. package/lib/module/getShadowNodeFromRef.js +4 -33
  95. package/lib/module/getShadowNodeFromRef.js.map +1 -1
  96. package/lib/module/getShadowNodeFromRef.native.js +37 -0
  97. package/lib/module/getShadowNodeFromRef.native.js.map +1 -0
  98. package/lib/module/handlers/PanGestureHandler.js.map +1 -1
  99. package/lib/module/handlers/PressabilityDebugView.js +4 -2
  100. package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
  101. package/lib/module/handlers/PressabilityDebugView.native.js +3 -0
  102. package/lib/module/handlers/PressabilityDebugView.native.js.map +1 -0
  103. package/lib/module/handlers/createHandler.js +9 -3
  104. package/lib/module/handlers/createHandler.js.map +1 -1
  105. package/lib/module/handlers/customDirectEventTypes.js +4 -2
  106. package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
  107. package/lib/module/handlers/customDirectEventTypes.native.js +3 -0
  108. package/lib/module/handlers/customDirectEventTypes.native.js.map +1 -0
  109. package/lib/module/handlers/gestures/GestureDetector.js +15 -0
  110. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  111. package/lib/module/handlers/gestures/flingGesture.js +13 -0
  112. package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
  113. package/lib/module/handlers/gestures/forceTouchGesture.js +17 -0
  114. package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
  115. package/lib/module/handlers/gestures/gesture.js +135 -0
  116. package/lib/module/handlers/gestures/gesture.js.map +1 -1
  117. package/lib/module/handlers/gestures/gestureObjects.js +67 -0
  118. package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
  119. package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -1
  120. package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
  121. package/lib/module/handlers/gestures/hoverGesture.js +1 -1
  122. package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
  123. package/lib/module/handlers/gestures/longPressGesture.js +12 -0
  124. package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
  125. package/lib/module/handlers/gestures/nativeGesture.js +10 -0
  126. package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
  127. package/lib/module/handlers/gestures/panGesture.js +76 -0
  128. package/lib/module/handlers/gestures/panGesture.js.map +1 -1
  129. package/lib/module/handlers/gestures/tapGesture.js +42 -0
  130. package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
  131. package/lib/module/utils.js +5 -1
  132. package/lib/module/utils.js.map +1 -1
  133. package/lib/module/web/handlers/GestureHandler.js +7 -7
  134. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  135. package/lib/module/web/handlers/PanGestureHandler.js +3 -1
  136. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  137. package/lib/module/web/interfaces.js.map +1 -1
  138. package/lib/typescript/RNGestureHandlerModule.d.ts +15 -2
  139. package/lib/typescript/RNGestureHandlerModule.native.d.ts +2 -0
  140. package/lib/typescript/RNRenderer.d.ts +3 -1
  141. package/lib/typescript/RNRenderer.native.d.ts +1 -0
  142. package/lib/typescript/components/GestureComponents.d.ts +7 -21
  143. package/lib/typescript/components/GestureComponents.native.d.ts +22 -0
  144. package/lib/typescript/components/GestureHandlerButton.d.ts +3 -3
  145. package/lib/typescript/components/GestureHandlerButton.native.d.ts +4 -0
  146. package/lib/typescript/getReactNativeVersion.d.ts +1 -4
  147. package/lib/typescript/getReactNativeVersion.native.d.ts +4 -0
  148. package/lib/typescript/getShadowNodeFromRef.d.ts +1 -1
  149. package/lib/typescript/getShadowNodeFromRef.native.d.ts +1 -0
  150. package/lib/typescript/handlers/PanGestureHandler.d.ts +4 -4
  151. package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -1
  152. package/lib/typescript/handlers/PressabilityDebugView.native.d.ts +1 -0
  153. package/lib/typescript/handlers/customDirectEventTypes.d.ts +2 -1
  154. package/lib/typescript/handlers/customDirectEventTypes.native.d.ts +1 -0
  155. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +36 -0
  156. package/lib/typescript/handlers/gestures/flingGesture.d.ts +11 -0
  157. package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +14 -0
  158. package/lib/typescript/handlers/gestures/gesture.d.ts +113 -0
  159. package/lib/typescript/handlers/gestures/gestureObjects.d.ts +57 -0
  160. package/lib/typescript/handlers/gestures/hoverGesture.d.ts +1 -1
  161. package/lib/typescript/handlers/gestures/longPressGesture.d.ts +10 -0
  162. package/lib/typescript/handlers/gestures/nativeGesture.d.ts +8 -0
  163. package/lib/typescript/handlers/gestures/panGesture.d.ts +67 -4
  164. package/lib/typescript/handlers/gestures/tapGesture.d.ts +35 -0
  165. package/lib/typescript/web/handlers/GestureHandler.d.ts +2 -2
  166. package/lib/typescript/web/handlers/IGestureHandler.d.ts +1 -1
  167. package/lib/typescript/web/interfaces.d.ts +1 -0
  168. package/package.json +3 -2
  169. package/src/RNGestureHandlerModule.native.ts +5 -0
  170. package/src/RNGestureHandlerModule.ts +104 -4
  171. package/src/RNRenderer.native.ts +3 -0
  172. package/src/RNRenderer.ts +3 -3
  173. package/src/components/GestureComponents.native.tsx +148 -0
  174. package/src/components/GestureComponents.tsx +24 -131
  175. package/src/components/GestureHandlerButton.native.tsx +5 -0
  176. package/src/components/GestureHandlerButton.tsx +5 -4
  177. package/src/components/{GestureHandlerRootView.web.tsx → GestureHandlerRootView.native.tsx} +6 -0
  178. package/src/components/GestureHandlerRootView.tsx +0 -6
  179. package/src/getReactNativeVersion.native.ts +11 -0
  180. package/src/getReactNativeVersion.ts +1 -9
  181. package/src/getShadowNodeFromRef.native.ts +44 -0
  182. package/src/getShadowNodeFromRef.ts +4 -41
  183. package/src/handlers/PanGestureHandler.ts +8 -4
  184. package/src/handlers/PressabilityDebugView.native.tsx +2 -0
  185. package/src/handlers/PressabilityDebugView.tsx +4 -2
  186. package/src/handlers/createHandler.tsx +14 -10
  187. package/src/handlers/customDirectEventTypes.native.ts +2 -0
  188. package/src/handlers/customDirectEventTypes.ts +5 -2
  189. package/src/handlers/gestures/GestureDetector.tsx +47 -4
  190. package/src/handlers/gestures/flingGesture.ts +11 -0
  191. package/src/handlers/gestures/forceTouchGesture.ts +14 -0
  192. package/src/handlers/gestures/gesture.ts +113 -0
  193. package/src/handlers/gestures/gestureObjects.ts +57 -0
  194. package/src/handlers/gestures/gestureStateManager.web.ts +1 -1
  195. package/src/handlers/gestures/hoverGesture.ts +1 -1
  196. package/src/handlers/gestures/longPressGesture.ts +10 -0
  197. package/src/handlers/gestures/nativeGesture.ts +8 -0
  198. package/src/handlers/gestures/panGesture.ts +75 -4
  199. package/src/handlers/gestures/tapGesture.ts +35 -0
  200. package/src/utils.ts +9 -2
  201. package/src/web/handlers/GestureHandler.ts +9 -9
  202. package/src/web/handlers/IGestureHandler.ts +1 -1
  203. package/src/web/handlers/PanGestureHandler.ts +4 -0
  204. package/src/web/interfaces.ts +1 -0
  205. package/lib/commonjs/RNGestureHandlerModule.web.js +0 -109
  206. package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
  207. package/lib/commonjs/RNRenderer.web.js +0 -11
  208. package/lib/commonjs/RNRenderer.web.js.map +0 -1
  209. package/lib/commonjs/components/GestureComponents.web.js +0 -52
  210. package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
  211. package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
  212. package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
  213. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
  214. package/lib/commonjs/getReactNativeVersion.web.js +0 -11
  215. package/lib/commonjs/getReactNativeVersion.web.js.map +0 -1
  216. package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
  217. package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
  218. package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
  219. package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
  220. package/lib/commonjs/handlers/customDirectEventTypes.web.js +0 -11
  221. package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +0 -1
  222. package/lib/module/RNGestureHandlerModule.web.js +0 -85
  223. package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
  224. package/lib/module/RNRenderer.web.js +0 -4
  225. package/lib/module/RNRenderer.web.js.map +0 -1
  226. package/lib/module/components/GestureComponents.web.js +0 -28
  227. package/lib/module/components/GestureComponents.web.js.map +0 -1
  228. package/lib/module/components/GestureHandlerButton.web.js +0 -9
  229. package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
  230. package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
  231. package/lib/module/getReactNativeVersion.web.js +0 -4
  232. package/lib/module/getReactNativeVersion.web.js.map +0 -1
  233. package/lib/module/getShadowNodeFromRef.web.js +0 -8
  234. package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
  235. package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
  236. package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
  237. package/lib/module/handlers/customDirectEventTypes.web.js +0 -5
  238. package/lib/module/handlers/customDirectEventTypes.web.js.map +0 -1
  239. package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -15
  240. package/lib/typescript/RNRenderer.web.d.ts +0 -3
  241. package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
  242. package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
  243. package/lib/typescript/getReactNativeVersion.web.d.ts +0 -1
  244. package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
  245. package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
  246. package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +0 -2
  247. package/src/RNGestureHandlerModule.web.ts +0 -105
  248. package/src/RNRenderer.web.ts +0 -3
  249. package/src/components/GestureComponents.web.tsx +0 -41
  250. package/src/components/GestureHandlerButton.web.tsx +0 -6
  251. package/src/getReactNativeVersion.web.ts +0 -3
  252. package/src/getShadowNodeFromRef.web.ts +0 -7
  253. package/src/handlers/PressabilityDebugView.web.tsx +0 -4
  254. package/src/handlers/customDirectEventTypes.web.ts +0 -5
  255. /package/lib/typescript/components/{GestureHandlerRootView.web.d.ts → GestureHandlerRootView.native.d.ts} +0 -0
@@ -1,5 +1,85 @@
1
- // Reexport the native module spec used by codegen. The relevant files are inluded on Android
2
- // to ensure the compatibility with the old arch, while iOS doesn't require those at all.
3
- import Module from './specs/NativeRNGestureHandlerModule';
4
- export default Module;
1
+ import React from 'react';
2
+ import { isNewWebImplementationEnabled } from './EnableNewWebImplementation';
3
+ import { Gestures, HammerGestures } from './web/Gestures';
4
+ import InteractionManager from './web/tools/InteractionManager';
5
+ import NodeManager from './web/tools/NodeManager';
6
+ import * as HammerNodeManager from './web_hammer/NodeManager';
7
+ import { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';
8
+ export default {
9
+ handleSetJSResponder(tag, blockNativeResponder) {
10
+ console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
11
+ },
12
+
13
+ handleClearJSResponder() {
14
+ console.warn('handleClearJSResponder: ');
15
+ },
16
+
17
+ createGestureHandler(handlerName, handlerTag, config) {
18
+ if (isNewWebImplementationEnabled()) {
19
+ if (!(handlerName in Gestures)) {
20
+ throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
21
+ }
22
+
23
+ const GestureClass = Gestures[handlerName];
24
+ NodeManager.createGestureHandler(handlerTag, new GestureClass(new GestureHandlerWebDelegate()));
25
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), config);
26
+ } else {
27
+ if (!(handlerName in HammerGestures)) {
28
+ throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
29
+ } // @ts-ignore If it doesn't exist, the error is thrown
30
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
31
+
32
+
33
+ const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
34
+
35
+ HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
36
+ }
37
+
38
+ this.updateGestureHandler(handlerTag, config);
39
+ },
40
+
41
+ attachGestureHandler(handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ newView, _actionType, propsRef) {
43
+ if (!(newView instanceof HTMLElement || newView instanceof React.Component)) {
44
+ return;
45
+ }
46
+
47
+ if (isNewWebImplementationEnabled()) {
48
+ //@ts-ignore Types should be HTMLElement or React.Component
49
+ NodeManager.getHandler(handlerTag).init(newView, propsRef);
50
+ } else {
51
+ //@ts-ignore Types should be HTMLElement or React.Component
52
+ HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
53
+ }
54
+ },
55
+
56
+ updateGestureHandler(handlerTag, newConfig) {
57
+ if (isNewWebImplementationEnabled()) {
58
+ NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
59
+ InteractionManager.getInstance().configureInteractions(NodeManager.getHandler(handlerTag), newConfig);
60
+ } else {
61
+ HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
62
+ }
63
+ },
64
+
65
+ getGestureHandlerNode(handlerTag) {
66
+ if (isNewWebImplementationEnabled()) {
67
+ return NodeManager.getHandler(handlerTag);
68
+ } else {
69
+ return HammerNodeManager.getHandler(handlerTag);
70
+ }
71
+ },
72
+
73
+ dropGestureHandler(handlerTag) {
74
+ if (isNewWebImplementationEnabled()) {
75
+ NodeManager.dropGestureHandler(handlerTag);
76
+ } else {
77
+ HammerNodeManager.dropGestureHandler(handlerTag);
78
+ }
79
+ },
80
+
81
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
82
+ flushOperations() {}
83
+
84
+ };
5
85
  //# sourceMappingURL=RNGestureHandlerModule.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["Module"],"mappings":"AAAA;AACA;AAEA,OAAOA,MAAP,MAAmB,sCAAnB;AACA,eAAeA,MAAf","sourcesContent":["// Reexport the native module spec used by codegen. The relevant files are inluded on Android\n// to ensure the compatibility with the old arch, while iOS doesn't require those at all.\n\nimport Module from './specs/NativeRNGestureHandlerModule';\nexport default Module;\n"]}
1
+ {"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["React","isNewWebImplementationEnabled","Gestures","HammerGestures","InteractionManager","NodeManager","HammerNodeManager","GestureHandlerWebDelegate","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":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,SAASC,QAAT,EAAmBC,cAAnB,QAAyC,gBAAzC;AAEA,OAAOC,kBAAP,MAA+B,gCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAO,KAAKC,iBAAZ,MAAmC,0BAAnC;AACA,SAASC,yBAAT,QAA0C,uCAA1C;AAEA,eAAe;AACbC,EAAAA,oBAAoB,CAACC,GAAD,EAAcC,oBAAd,EAA6C;AAC/DC,IAAAA,OAAO,CAACC,IAAR,CAAa,wBAAb,EAAuCH,GAAvC,EAA4CC,oBAA5C;AACD,GAHY;;AAIbG,EAAAA,sBAAsB,GAAG;AACvBF,IAAAA,OAAO,CAACC,IAAR,CAAa,0BAAb;AACD,GANY;;AAObE,EAAAA,oBAAoB,CAClBC,WADkB,EAElBC,UAFkB,EAGlBC,MAHkB,EAIlB;AACA,QAAIhB,6BAA6B,EAAjC,EAAqC;AACnC,UAAI,EAAEc,WAAW,IAAIb,QAAjB,CAAJ,EAAgC;AAC9B,cAAM,IAAIgB,KAAJ,CACH,iCAAgCH,WAAY,2BADzC,CAAN;AAGD;;AAED,YAAMI,YAAY,GAAGjB,QAAQ,CAACa,WAAD,CAA7B;AACAV,MAAAA,WAAW,CAACS,oBAAZ,CACEE,UADF,EAEE,IAAIG,YAAJ,CAAiB,IAAIZ,yBAAJ,EAAjB,CAFF;AAIAH,MAAAA,kBAAkB,CAACgB,WAAnB,GAAiCC,qBAAjC,CACEhB,WAAW,CAACiB,UAAZ,CAAuBN,UAAvB,CADF,EAEEC,MAFF;AAID,KAhBD,MAgBO;AACL,UAAI,EAAEF,WAAW,IAAIZ,cAAjB,CAAJ,EAAsC;AACpC,cAAM,IAAIe,KAAJ,CACH,iCAAgCH,WAAY,2BADzC,CAAN;AAGD,OALI,CAOL;AACA;;;AACA,YAAMI,YAAY,GAAGhB,cAAc,CAACY,WAAD,CAAnC,CATK,CAUL;;AACAT,MAAAA,iBAAiB,CAACQ,oBAAlB,CAAuCE,UAAvC,EAAmD,IAAIG,YAAJ,EAAnD;AACD;;AAED,SAAKI,oBAAL,CAA0BP,UAA1B,EAAsCC,MAAtC;AACD,GA3CY;;AA4CbO,EAAAA,oBAAoB,CAClBR,UADkB,EAElB;AACAS,EAAAA,OAHkB,EAIlBC,WAJkB,EAKlBC,QALkB,EAMlB;AACA,QACE,EAAEF,OAAO,YAAYG,WAAnB,IAAkCH,OAAO,YAAYzB,KAAK,CAAC6B,SAA7D,CADF,EAEE;AACA;AACD;;AAED,QAAI5B,6BAA6B,EAAjC,EAAqC;AACnC;AACAI,MAAAA,WAAW,CAACiB,UAAZ,CAAuBN,UAAvB,EAAmCc,IAAnC,CAAwCL,OAAxC,EAAiDE,QAAjD;AACD,KAHD,MAGO;AACL;AACArB,MAAAA,iBAAiB,CAACgB,UAAlB,CAA6BN,UAA7B,EAAyCe,OAAzC,CAAiDN,OAAjD,EAA0DE,QAA1D;AACD;AACF,GAhEY;;AAiEbJ,EAAAA,oBAAoB,CAACP,UAAD,EAAqBgB,SAArB,EAAwC;AAC1D,QAAI/B,6BAA6B,EAAjC,EAAqC;AACnCI,MAAAA,WAAW,CAACiB,UAAZ,CAAuBN,UAAvB,EAAmCiB,mBAAnC,CAAuDD,SAAvD;AAEA5B,MAAAA,kBAAkB,CAACgB,WAAnB,GAAiCC,qBAAjC,CACEhB,WAAW,CAACiB,UAAZ,CAAuBN,UAAvB,CADF,EAEEgB,SAFF;AAID,KAPD,MAOO;AACL1B,MAAAA,iBAAiB,CAACgB,UAAlB,CAA6BN,UAA7B,EAAyCiB,mBAAzC,CAA6DD,SAA7D;AACD;AACF,GA5EY;;AA6EbE,EAAAA,qBAAqB,CAAClB,UAAD,EAAqB;AACxC,QAAIf,6BAA6B,EAAjC,EAAqC;AACnC,aAAOI,WAAW,CAACiB,UAAZ,CAAuBN,UAAvB,CAAP;AACD,KAFD,MAEO;AACL,aAAOV,iBAAiB,CAACgB,UAAlB,CAA6BN,UAA7B,CAAP;AACD;AACF,GAnFY;;AAoFbmB,EAAAA,kBAAkB,CAACnB,UAAD,EAAqB;AACrC,QAAIf,6BAA6B,EAAjC,EAAqC;AACnCI,MAAAA,WAAW,CAAC8B,kBAAZ,CAA+BnB,UAA/B;AACD,KAFD,MAEO;AACLV,MAAAA,iBAAiB,CAAC6B,kBAAlB,CAAqCnB,UAArC;AACD;AACF,GA1FY;;AA2Fb;AACAoB,EAAAA,eAAe,GAAG,CAAE;;AA5FP,CAAf","sourcesContent":["import React from 'react';\n\nimport type { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\nimport { Gestures, HammerGestures } from './web/Gestures';\nimport type { Config } from './web/interfaces';\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\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"]}
@@ -0,0 +1,5 @@
1
+ // Reexport the native module spec used by codegen. The relevant files are inluded on Android
2
+ // to ensure the compatibility with the old arch, while iOS doesn't require those at all.
3
+ import Module from './specs/NativeRNGestureHandlerModule';
4
+ export default Module;
5
+ //# sourceMappingURL=RNGestureHandlerModule.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNGestureHandlerModule.native.ts"],"names":["Module"],"mappings":"AAAA;AACA;AAEA,OAAOA,MAAP,MAAmB,sCAAnB;AACA,eAAeA,MAAf","sourcesContent":["// Reexport the native module spec used by codegen. The relevant files are inluded on Android\n// to ensure the compatibility with the old arch, while iOS doesn't require those at all.\n\nimport Module from './specs/NativeRNGestureHandlerModule';\nexport default Module;\n"]}
@@ -1,4 +1,4 @@
1
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
- // @ts-nocheck
3
- export { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';
1
+ export const RNRenderer = {
2
+ findHostInstance_DEPRECATED: _ref => null
3
+ };
4
4
  //# sourceMappingURL=RNRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["RNRenderer.ts"],"names":["default","RNRenderer"],"mappings":"AAAA;AACA;AACA,SAASA,OAAO,IAAIC,UAApB,QAAsC,mDAAtC","sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"]}
1
+ {"version":3,"sources":["RNRenderer.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"]}
@@ -0,0 +1,4 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
3
+ export { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';
4
+ //# sourceMappingURL=RNRenderer.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RNRenderer.native.ts"],"names":["default","RNRenderer"],"mappings":"AAAA;AACA;AACA,SAASA,OAAO,IAAIC,UAApB,QAAsC,mDAAtC","sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nexport { default as RNRenderer } from 'react-native/Libraries/Renderer/shims/ReactNative';\n"]}
@@ -1,90 +1,28 @@
1
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
2
 
3
3
  import * as React from 'react';
4
- import { ScrollView as RNScrollView, Switch as RNSwitch, TextInput as RNTextInput, DrawerLayoutAndroid as RNDrawerLayoutAndroid, FlatList as RNFlatList, RefreshControl as RNRefreshControl } from 'react-native';
4
+ import { FlatList as RNFlatList, Switch as RNSwitch, TextInput as RNTextInput, ScrollView as RNScrollView, View } from 'react-native';
5
5
  import createNativeWrapper from '../handlers/createNativeWrapper';
6
- import { nativeViewProps } from '../handlers/NativeViewGestureHandler';
7
- import { toArray } from '../utils';
8
- export const RefreshControl = createNativeWrapper(RNRefreshControl, {
9
- disallowInterruption: true,
10
- shouldCancelWhenOutside: false
11
- }); // eslint-disable-next-line @typescript-eslint/no-redeclare
12
-
13
- const GHScrollView = createNativeWrapper(RNScrollView, {
14
- disallowInterruption: true,
15
- shouldCancelWhenOutside: false
6
+ export const ScrollView = createNativeWrapper(RNScrollView, {
7
+ disallowInterruption: false
16
8
  });
17
- export const ScrollView = /*#__PURE__*/React.forwardRef((props, ref) => {
18
- const refreshControlGestureRef = React.useRef(null);
19
- const {
20
- refreshControl,
21
- waitFor,
22
- ...rest
23
- } = props;
24
- return /*#__PURE__*/React.createElement(GHScrollView, _extends({}, rest, {
25
- // @ts-ignore `ref` exists on `GHScrollView`
26
- ref: ref,
27
- waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef] // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
28
- ,
29
- refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
30
- // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
31
- ref: refreshControlGestureRef
32
- }) : undefined
33
- }));
34
- }); // backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457
35
- // include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.
36
- // eslint-disable-next-line @typescript-eslint/no-redeclare
37
-
38
9
  export const Switch = createNativeWrapper(RNSwitch, {
39
10
  shouldCancelWhenOutside: false,
40
11
  shouldActivateOnStart: true,
41
12
  disallowInterruption: true
42
- }); // eslint-disable-next-line @typescript-eslint/no-redeclare
43
-
44
- export const TextInput = createNativeWrapper(RNTextInput); // eslint-disable-next-line @typescript-eslint/no-redeclare
45
-
46
- export const DrawerLayoutAndroid = createNativeWrapper(RNDrawerLayoutAndroid, {
47
- disallowInterruption: true
48
- }); // eslint-disable-next-line @typescript-eslint/no-redeclare
49
-
50
- export const FlatList = /*#__PURE__*/React.forwardRef((props, ref) => {
51
- const refreshControlGestureRef = React.useRef(null);
52
- const {
53
- waitFor,
54
- refreshControl,
55
- ...rest
56
- } = props;
57
- const flatListProps = {};
58
- const scrollViewProps = {};
59
-
60
- for (const [propName, value] of Object.entries(rest)) {
61
- // https://github.com/microsoft/TypeScript/issues/26255
62
- if (nativeViewProps.includes(propName)) {
63
- // @ts-ignore - this function cannot have generic type so we have to ignore this error
64
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
65
- scrollViewProps[propName] = value;
66
- } else {
67
- // @ts-ignore - this function cannot have generic type so we have to ignore this error
68
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
69
- flatListProps[propName] = value;
70
- }
71
- }
72
-
73
- return (
74
- /*#__PURE__*/
75
- // @ts-ignore - this function cannot have generic type so we have to ignore this error
76
- React.createElement(RNFlatList, _extends({
77
- ref: ref
78
- }, flatListProps, {
79
- renderScrollComponent: scrollProps => /*#__PURE__*/React.createElement(ScrollView, _extends({}, scrollProps, scrollViewProps, {
80
- waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef]
81
- })) // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
82
- ,
83
- refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
84
- // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
85
- ref: refreshControlGestureRef
86
- }) : undefined
87
- }))
88
- );
89
- }); // eslint-disable-next-line @typescript-eslint/no-redeclare
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
+ })));
90
28
  //# sourceMappingURL=GestureComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureComponents.tsx"],"names":["React","ScrollView","RNScrollView","Switch","RNSwitch","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","RefreshControl","RNRefreshControl","createNativeWrapper","nativeViewProps","toArray","disallowInterruption","shouldCancelWhenOutside","GHScrollView","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","cloneElement","undefined","shouldActivateOnStart","flatListProps","scrollViewProps","propName","value","Object","entries","includes","scrollProps"],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport {\n PropsWithChildren,\n ForwardedRef,\n RefAttributes,\n ReactElement,\n} from 'react';\nimport {\n ScrollView as RNScrollView,\n ScrollViewProps as RNScrollViewProps,\n Switch as RNSwitch,\n SwitchProps as RNSwitchProps,\n TextInput as RNTextInput,\n TextInputProps as RNTextInputProps,\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n RefreshControl as RNRefreshControl,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nimport {\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from '../handlers/NativeViewGestureHandler';\n\nimport { toArray } from '../utils';\n\nexport const RefreshControl = createNativeWrapper(RNRefreshControl, {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type RefreshControl = typeof RefreshControl & RNRefreshControl;\n\nconst GHScrollView = createNativeWrapper<PropsWithChildren<RNScrollViewProps>>(\n RNScrollView,\n {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n }\n);\nexport const ScrollView = React.forwardRef<\n RNScrollView,\n RNScrollViewProps & NativeViewGestureHandlerProps\n>((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n const { refreshControl, waitFor, ...rest } = props;\n\n return (\n <GHScrollView\n {...rest}\n // @ts-ignore `ref` exists on `GHScrollView`\n ref={ref}\n waitFor={[...toArray(waitFor ?? []), refreshControlGestureRef]}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n});\n// backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457\n// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ScrollView = typeof GHScrollView & RNScrollView;\n\nexport const Switch = createNativeWrapper<RNSwitchProps>(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Switch = typeof Switch & RNSwitch;\n\nexport const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TextInput = typeof TextInput & RNTextInput;\n\nexport const DrawerLayoutAndroid = createNativeWrapper<\n PropsWithChildren<RNDrawerLayoutAndroidProps>\n>(RNDrawerLayoutAndroid, { disallowInterruption: true });\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DrawerLayoutAndroid = typeof DrawerLayoutAndroid &\n RNDrawerLayoutAndroid;\n\nexport const FlatList = React.forwardRef((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n\n const { waitFor, refreshControl, ...rest } = props;\n\n const flatListProps = {};\n const scrollViewProps = {};\n for (const [propName, value] of Object.entries(rest)) {\n // https://github.com/microsoft/TypeScript/issues/26255\n if ((nativeViewProps as readonly string[]).includes(propName)) {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n scrollViewProps[propName] = value;\n } else {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n flatListProps[propName] = value;\n }\n }\n\n return (\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n <RNFlatList\n ref={ref}\n {...flatListProps}\n renderScrollComponent={(scrollProps) => (\n <ScrollView\n {...{\n ...scrollProps,\n ...scrollViewProps,\n waitFor: [...toArray(waitFor ?? []), refreshControlGestureRef],\n }}\n />\n )}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n}) as <ItemT = any>(\n props: PropsWithChildren<\n RNFlatListProps<ItemT> &\n RefAttributes<FlatList<ItemT>> &\n NativeViewGestureHandlerProps\n >,\n ref: ForwardedRef<FlatList<ItemT>>\n) => ReactElement | null;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;\n"]}
1
+ {"version":3,"sources":["GestureComponents.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"]}
@@ -0,0 +1,90 @@
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 { ScrollView as RNScrollView, Switch as RNSwitch, TextInput as RNTextInput, DrawerLayoutAndroid as RNDrawerLayoutAndroid, FlatList as RNFlatList, RefreshControl as RNRefreshControl } from 'react-native';
5
+ import createNativeWrapper from '../handlers/createNativeWrapper';
6
+ import { nativeViewProps } from '../handlers/NativeViewGestureHandler';
7
+ import { toArray } from '../utils';
8
+ export const RefreshControl = createNativeWrapper(RNRefreshControl, {
9
+ disallowInterruption: true,
10
+ shouldCancelWhenOutside: false
11
+ }); // eslint-disable-next-line @typescript-eslint/no-redeclare
12
+
13
+ const GHScrollView = createNativeWrapper(RNScrollView, {
14
+ disallowInterruption: true,
15
+ shouldCancelWhenOutside: false
16
+ });
17
+ export const ScrollView = /*#__PURE__*/React.forwardRef((props, ref) => {
18
+ const refreshControlGestureRef = React.useRef(null);
19
+ const {
20
+ refreshControl,
21
+ waitFor,
22
+ ...rest
23
+ } = props;
24
+ return /*#__PURE__*/React.createElement(GHScrollView, _extends({}, rest, {
25
+ // @ts-ignore `ref` exists on `GHScrollView`
26
+ ref: ref,
27
+ waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef] // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
28
+ ,
29
+ refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
30
+ // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
31
+ ref: refreshControlGestureRef
32
+ }) : undefined
33
+ }));
34
+ }); // backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457
35
+ // include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.
36
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
37
+
38
+ export const Switch = createNativeWrapper(RNSwitch, {
39
+ shouldCancelWhenOutside: false,
40
+ shouldActivateOnStart: true,
41
+ disallowInterruption: true
42
+ }); // eslint-disable-next-line @typescript-eslint/no-redeclare
43
+
44
+ export const TextInput = createNativeWrapper(RNTextInput); // eslint-disable-next-line @typescript-eslint/no-redeclare
45
+
46
+ export const DrawerLayoutAndroid = createNativeWrapper(RNDrawerLayoutAndroid, {
47
+ disallowInterruption: true
48
+ }); // eslint-disable-next-line @typescript-eslint/no-redeclare
49
+
50
+ export const FlatList = /*#__PURE__*/React.forwardRef((props, ref) => {
51
+ const refreshControlGestureRef = React.useRef(null);
52
+ const {
53
+ waitFor,
54
+ refreshControl,
55
+ ...rest
56
+ } = props;
57
+ const flatListProps = {};
58
+ const scrollViewProps = {};
59
+
60
+ for (const [propName, value] of Object.entries(rest)) {
61
+ // https://github.com/microsoft/TypeScript/issues/26255
62
+ if (nativeViewProps.includes(propName)) {
63
+ // @ts-ignore - this function cannot have generic type so we have to ignore this error
64
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
65
+ scrollViewProps[propName] = value;
66
+ } else {
67
+ // @ts-ignore - this function cannot have generic type so we have to ignore this error
68
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
69
+ flatListProps[propName] = value;
70
+ }
71
+ }
72
+
73
+ return (
74
+ /*#__PURE__*/
75
+ // @ts-ignore - this function cannot have generic type so we have to ignore this error
76
+ React.createElement(RNFlatList, _extends({
77
+ ref: ref
78
+ }, flatListProps, {
79
+ renderScrollComponent: scrollProps => /*#__PURE__*/React.createElement(ScrollView, _extends({}, scrollProps, scrollViewProps, {
80
+ waitFor: [...toArray(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef]
81
+ })) // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
82
+ ,
83
+ refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
84
+ // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
85
+ ref: refreshControlGestureRef
86
+ }) : undefined
87
+ }))
88
+ );
89
+ }); // eslint-disable-next-line @typescript-eslint/no-redeclare
90
+ //# sourceMappingURL=GestureComponents.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GestureComponents.native.tsx"],"names":["React","ScrollView","RNScrollView","Switch","RNSwitch","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","RNFlatList","RefreshControl","RNRefreshControl","createNativeWrapper","nativeViewProps","toArray","disallowInterruption","shouldCancelWhenOutside","GHScrollView","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","cloneElement","undefined","shouldActivateOnStart","flatListProps","scrollViewProps","propName","value","Object","entries","includes","scrollProps"],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport {\n PropsWithChildren,\n ForwardedRef,\n RefAttributes,\n ReactElement,\n} from 'react';\nimport {\n ScrollView as RNScrollView,\n ScrollViewProps as RNScrollViewProps,\n Switch as RNSwitch,\n SwitchProps as RNSwitchProps,\n TextInput as RNTextInput,\n TextInputProps as RNTextInputProps,\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n RefreshControl as RNRefreshControl,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nimport {\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from '../handlers/NativeViewGestureHandler';\n\nimport { toArray } from '../utils';\n\nexport const RefreshControl = createNativeWrapper(RNRefreshControl, {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type RefreshControl = typeof RefreshControl & RNRefreshControl;\n\nconst GHScrollView = createNativeWrapper<PropsWithChildren<RNScrollViewProps>>(\n RNScrollView,\n {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n }\n);\nexport const ScrollView = React.forwardRef<\n RNScrollView,\n RNScrollViewProps & NativeViewGestureHandlerProps\n>((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n const { refreshControl, waitFor, ...rest } = props;\n\n return (\n <GHScrollView\n {...rest}\n // @ts-ignore `ref` exists on `GHScrollView`\n ref={ref}\n waitFor={[...toArray(waitFor ?? []), refreshControlGestureRef]}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n});\n// backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457\n// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ScrollView = typeof GHScrollView & RNScrollView;\n\nexport const Switch = createNativeWrapper<RNSwitchProps>(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Switch = typeof Switch & RNSwitch;\n\nexport const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TextInput = typeof TextInput & RNTextInput;\n\nexport const DrawerLayoutAndroid = createNativeWrapper<\n PropsWithChildren<RNDrawerLayoutAndroidProps>\n>(RNDrawerLayoutAndroid, { disallowInterruption: true });\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DrawerLayoutAndroid = typeof DrawerLayoutAndroid &\n RNDrawerLayoutAndroid;\n\nexport const FlatList = React.forwardRef((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n\n const { waitFor, refreshControl, ...rest } = props;\n\n const flatListProps = {};\n const scrollViewProps = {};\n for (const [propName, value] of Object.entries(rest)) {\n // https://github.com/microsoft/TypeScript/issues/26255\n if ((nativeViewProps as readonly string[]).includes(propName)) {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n scrollViewProps[propName] = value;\n } else {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n flatListProps[propName] = value;\n }\n }\n\n return (\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n <RNFlatList\n ref={ref}\n {...flatListProps}\n renderScrollComponent={(scrollProps) => (\n <ScrollView\n {...{\n ...scrollProps,\n ...scrollViewProps,\n waitFor: [...toArray(waitFor ?? []), refreshControlGestureRef],\n }}\n />\n )}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n}) as <ItemT = any>(\n props: PropsWithChildren<\n RNFlatListProps<ItemT> &\n RefAttributes<FlatList<ItemT>> &\n NativeViewGestureHandlerProps\n >,\n ref: ForwardedRef<FlatList<ItemT>>\n) => ReactElement | null;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;\n"]}
@@ -1,3 +1,9 @@
1
- import RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent';
2
- export default RNGestureHandlerButtonNativeComponent;
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)));
3
9
  //# sourceMappingURL=GestureHandlerButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureHandlerButton.tsx"],"names":["RNGestureHandlerButtonNativeComponent"],"mappings":"AAEA,OAAOA,qCAAP,MAAkD,gDAAlD;AAEA,eAAeA,qCAAf","sourcesContent":["import { HostComponent } from 'react-native';\nimport { RawButtonProps } from './GestureButtons';\nimport RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent';\n\nexport default RNGestureHandlerButtonNativeComponent as HostComponent<RawButtonProps>;\n"]}
1
+ {"version":3,"sources":["GestureHandlerButton.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"]}
@@ -0,0 +1,3 @@
1
+ import RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent';
2
+ export default RNGestureHandlerButtonNativeComponent;
3
+ //# sourceMappingURL=GestureHandlerButton.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GestureHandlerButton.native.tsx"],"names":["RNGestureHandlerButtonNativeComponent"],"mappings":"AAEA,OAAOA,qCAAP,MAAkD,gDAAlD;AAEA,eAAeA,qCAAf","sourcesContent":["import { HostComponent } from 'react-native';\nimport { RawButtonProps } from './GestureButtons';\nimport RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent';\n\nexport default RNGestureHandlerButtonNativeComponent as HostComponent<RawButtonProps>;\n"]}
@@ -2,16 +2,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import * as React from 'react';
4
4
  import { View, StyleSheet } from 'react-native';
5
- import { maybeInitializeFabric } from '../init';
6
5
  import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
7
6
  export default function GestureHandlerRootView({
8
7
  style,
9
8
  ...rest
10
9
  }) {
11
- // try initialize fabric on the first render, at this point we can
12
- // reliably check if fabric is enabled (the function contains a flag
13
- // to make sure it's called only once)
14
- maybeInitializeFabric();
15
10
  return /*#__PURE__*/React.createElement(GestureHandlerRootViewContext.Provider, {
16
11
  value: true
17
12
  }, /*#__PURE__*/React.createElement(View, _extends({
@@ -1 +1 @@
1
- {"version":3,"sources":["GestureHandlerRootView.tsx"],"names":["React","View","StyleSheet","maybeInitializeFabric","GestureHandlerRootViewContext","GestureHandlerRootView","style","rest","styles","container","create","flex"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,EAA0BC,UAA1B,QAA4C,cAA5C;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,OAAOC,6BAAP,MAA0C,kCAA1C;AAKA,eAAe,SAASC,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B;AACA;AACA;AACAJ,EAAAA,qBAAqB;AAErB,sBACE,oBAAC,6BAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEG,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AAA7B,KAA4CF,IAA5C,EADF,CADF;AAKD;AAED,MAAMC,MAAM,GAAGN,UAAU,CAACQ,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 { maybeInitializeFabric } from '../init';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView({\n style,\n ...rest\n}: GestureHandlerRootViewProps) {\n // try initialize fabric on the first render, at this point we can\n // reliably check if fabric is enabled (the function contains a flag\n // to make sure it's called only once)\n maybeInitializeFabric();\n\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
+ {"version":3,"sources":["GestureHandlerRootView.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"]}
@@ -2,11 +2,16 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import * as React from 'react';
4
4
  import { View, StyleSheet } from 'react-native';
5
+ import { maybeInitializeFabric } from '../init';
5
6
  import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
6
7
  export default function GestureHandlerRootView({
7
8
  style,
8
9
  ...rest
9
10
  }) {
11
+ // try initialize fabric on the first render, at this point we can
12
+ // reliably check if fabric is enabled (the function contains a flag
13
+ // to make sure it's called only once)
14
+ maybeInitializeFabric();
10
15
  return /*#__PURE__*/React.createElement(GestureHandlerRootViewContext.Provider, {
11
16
  value: true
12
17
  }, /*#__PURE__*/React.createElement(View, _extends({
@@ -18,4 +23,4 @@ const styles = StyleSheet.create({
18
23
  flex: 1
19
24
  }
20
25
  });
21
- //# sourceMappingURL=GestureHandlerRootView.web.js.map
26
+ //# sourceMappingURL=GestureHandlerRootView.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GestureHandlerRootView.native.tsx"],"names":["React","View","StyleSheet","maybeInitializeFabric","GestureHandlerRootViewContext","GestureHandlerRootView","style","rest","styles","container","create","flex"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,EAA0BC,UAA1B,QAA4C,cAA5C;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,OAAOC,6BAAP,MAA0C,kCAA1C;AAKA,eAAe,SAASC,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B;AACA;AACA;AACAJ,EAAAA,qBAAqB;AAErB,sBACE,oBAAC,6BAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEG,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AAA7B,KAA4CF,IAA5C,EADF,CADF;AAKD;AAED,MAAMC,MAAM,GAAGN,UAAU,CAACQ,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 { maybeInitializeFabric } from '../init';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView({\n style,\n ...rest\n}: GestureHandlerRootViewProps) {\n // try initialize fabric on the first render, at this point we can\n // reliably check if fabric is enabled (the function contains a flag\n // to make sure it's called only once)\n maybeInitializeFabric();\n\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,10 +1,4 @@
1
- import pack from 'react-native/package.json';
2
- const [majorStr, minorStr] = pack.version.split('.');
3
- const REACT_NATIVE_VERSION = {
4
- major: parseInt(majorStr, 10),
5
- minor: parseInt(minorStr, 10)
6
- };
7
1
  export function getReactNativeVersion() {
8
- return REACT_NATIVE_VERSION;
2
+ throw new Error('getReactNativeVersion is not supported on web');
9
3
  }
10
4
  //# sourceMappingURL=getReactNativeVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["getReactNativeVersion.ts"],"names":["pack","majorStr","minorStr","version","split","REACT_NATIVE_VERSION","major","parseInt","minor","getReactNativeVersion"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,2BAAjB;AAEA,MAAM,CAACC,QAAD,EAAWC,QAAX,IAAuBF,IAAI,CAACG,OAAL,CAAaC,KAAb,CAAmB,GAAnB,CAA7B;AACA,MAAMC,oBAAoB,GAAG;AAC3BC,EAAAA,KAAK,EAAEC,QAAQ,CAACN,QAAD,EAAW,EAAX,CADY;AAE3BO,EAAAA,KAAK,EAAED,QAAQ,CAACL,QAAD,EAAW,EAAX;AAFY,CAA7B;AAKA,OAAO,SAASO,qBAAT,GAAiC;AACtC,SAAOJ,oBAAP;AACD","sourcesContent":["import pack from 'react-native/package.json';\n\nconst [majorStr, minorStr] = pack.version.split('.');\nconst REACT_NATIVE_VERSION = {\n major: parseInt(majorStr, 10),\n minor: parseInt(minorStr, 10),\n};\n\nexport function getReactNativeVersion() {\n return REACT_NATIVE_VERSION;\n}\n"]}
1
+ {"version":3,"sources":["getReactNativeVersion.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"]}
@@ -0,0 +1,10 @@
1
+ import pack from 'react-native/package.json';
2
+ const [majorStr, minorStr] = pack.version.split('.');
3
+ const REACT_NATIVE_VERSION = {
4
+ major: parseInt(majorStr, 10),
5
+ minor: parseInt(minorStr, 10)
6
+ };
7
+ export function getReactNativeVersion() {
8
+ return REACT_NATIVE_VERSION;
9
+ }
10
+ //# sourceMappingURL=getReactNativeVersion.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["getReactNativeVersion.native.ts"],"names":["pack","majorStr","minorStr","version","split","REACT_NATIVE_VERSION","major","parseInt","minor","getReactNativeVersion"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,2BAAjB;AAEA,MAAM,CAACC,QAAD,EAAWC,QAAX,IAAuBF,IAAI,CAACG,OAAL,CAAaC,KAAb,CAAmB,GAAnB,CAA7B;AACA,MAAMC,oBAAoB,GAAG;AAC3BC,EAAAA,KAAK,EAAEC,QAAQ,CAACN,QAAD,EAAW,EAAX,CADY;AAE3BO,EAAAA,KAAK,EAAED,QAAQ,CAACL,QAAD,EAAW,EAAX;AAFY,CAA7B;AAKA,OAAO,SAASO,qBAAT,GAAiC;AACtC,SAAOJ,oBAAP;AACD","sourcesContent":["import pack from 'react-native/package.json';\n\nconst [majorStr, minorStr] = pack.version.split('.');\nconst REACT_NATIVE_VERSION = {\n major: parseInt(majorStr, 10),\n minor: parseInt(minorStr, 10),\n};\n\nexport function getReactNativeVersion() {\n return REACT_NATIVE_VERSION;\n}\n"]}
@@ -1,37 +1,8 @@
1
1
  // Used by GestureDetector (unsupported on web at the moment) to check whether the
2
- // attached view may get flattened on Fabric. This implementation causes errors
2
+ // attached view may get flattened on Fabric. Original implementation causes errors
3
3
  // on web due to the static resolution of `require` statements by webpack breaking
4
- // the conditional importing. Solved by making .web file.
5
- let findHostInstance_DEPRECATED;
6
- let getInternalInstanceHandleFromPublicInstance;
7
- export function getShadowNodeFromRef(ref) {
8
- // load findHostInstance_DEPRECATED lazily because it may not be available before render
9
- if (findHostInstance_DEPRECATED === undefined) {
10
- try {
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12
- findHostInstance_DEPRECATED = // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
13
- require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
14
- } catch (e) {
15
- findHostInstance_DEPRECATED = _ref => null;
16
- }
17
- } // load findHostInstance_DEPRECATED lazily because it may not be available before render
18
-
19
-
20
- if (getInternalInstanceHandleFromPublicInstance === undefined) {
21
- try {
22
- var _require$getInternalI;
23
-
24
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
25
- getInternalInstanceHandleFromPublicInstance = // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
26
- (_require$getInternalI = require('react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance').getInternalInstanceHandleFromPublicInstance) !== null && _require$getInternalI !== void 0 ? _require$getInternalI : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return
27
- ref => ref._internalInstanceHandle;
28
- } catch (e) {
29
- getInternalInstanceHandleFromPublicInstance = ref => // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return
30
- ref._internalInstanceHandle;
31
- }
32
- } // @ts-ignore Fabric
33
-
34
-
35
- return getInternalInstanceHandleFromPublicInstance(findHostInstance_DEPRECATED(ref)).stateNode.node;
4
+ // the conditional importing.
5
+ export function getShadowNodeFromRef(_ref) {
6
+ return null;
36
7
  }
37
8
  //# sourceMappingURL=getShadowNodeFromRef.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["getShadowNodeFromRef.ts"],"names":["findHostInstance_DEPRECATED","getInternalInstanceHandleFromPublicInstance","getShadowNodeFromRef","ref","undefined","require","e","_ref","_internalInstanceHandle","stateNode","node"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAIA,2BAAJ;AACA,IAAIC,2CAAJ;AAIA,OAAO,SAASC,oBAAT,CAA8BC,GAA9B,EAA4C;AACjD;AACA,MAAIH,2BAA2B,KAAKI,SAApC,EAA+C;AAC7C,QAAI;AACF;AACAJ,MAAAA,2BAA2B,GACzB;AACAK,MAAAA,OAAO,CAAC,mDAAD,CAAP,CAA6DL,2BAF/D;AAGD,KALD,CAKE,OAAOM,CAAP,EAAU;AACVN,MAAAA,2BAA2B,GAAIO,IAAD,IAAmB,IAAjD;AACD;AACF,GAXgD,CAajD;;;AACA,MAAIN,2CAA2C,KAAKG,SAApD,EAA+D;AAC7D,QAAI;AAAA;;AACF;AACAH,MAAAA,2CAA2C,GACzC;AADyC,+BAEzCI,OAAO,CAAC,wFAAD,CAAP,CACGJ,2CAHsC,yEAIzC;AACEE,MAAAA,GAAD,IAAcA,GAAG,CAACK,uBALrB;AAMD,KARD,CAQE,OAAOF,CAAP,EAAU;AACVL,MAAAA,2CAA2C,GAAIE,GAAD,IAC5C;AACAA,MAAAA,GAAG,CAACK,uBAFN;AAGD;AACF,GA5BgD,CA8BjD;;;AACA,SAAOP,2CAA2C,CAChDD,2BAA2B,CAACG,GAAD,CADqB,CAA3C,CAELM,SAFK,CAEKC,IAFZ;AAGD","sourcesContent":["// Used by GestureDetector (unsupported on web at the moment) to check whether the\n// attached view may get flattened on Fabric. This implementation causes errors\n// on web due to the static resolution of `require` statements by webpack breaking\n// the conditional importing. Solved by making .web file.\nlet findHostInstance_DEPRECATED: (ref: unknown) => void;\nlet getInternalInstanceHandleFromPublicInstance: (ref: unknown) => {\n stateNode: { node: unknown };\n};\n\nexport function getShadowNodeFromRef(ref: unknown) {\n // load findHostInstance_DEPRECATED lazily because it may not be available before render\n if (findHostInstance_DEPRECATED === undefined) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n findHostInstance_DEPRECATED =\n // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access\n require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;\n } catch (e) {\n findHostInstance_DEPRECATED = (_ref: unknown) => null;\n }\n }\n\n // load findHostInstance_DEPRECATED lazily because it may not be available before render\n if (getInternalInstanceHandleFromPublicInstance === undefined) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n getInternalInstanceHandleFromPublicInstance =\n // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access\n require('react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance')\n .getInternalInstanceHandleFromPublicInstance ??\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return\n ((ref: any) => ref._internalInstanceHandle);\n } catch (e) {\n getInternalInstanceHandleFromPublicInstance = (ref: any) =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return\n ref._internalInstanceHandle;\n }\n }\n\n // @ts-ignore Fabric\n return getInternalInstanceHandleFromPublicInstance(\n findHostInstance_DEPRECATED(ref)\n ).stateNode.node;\n}\n"]}
1
+ {"version":3,"sources":["getShadowNodeFromRef.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"]}