react-native-gesture-handler 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +1 -0
  2. package/RNGestureHandler.podspec +1 -1
  3. package/android/build.gradle +69 -29
  4. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +1 -1
  5. package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +2 -0
  6. package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +39 -0
  7. package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +8 -2
  8. package/ios/Handlers/RNNativeViewHandler.mm +4 -4
  9. package/ios/RNGestureHandlerButtonComponentView.h +2 -2
  10. package/ios/RNGestureHandlerButtonComponentView.mm +2 -2
  11. package/ios/RNGestureHandlerManager.mm +9 -9
  12. package/ios/RNGestureHandlerModule.mm +16 -16
  13. package/ios/RNGestureHandlerRootViewComponentView.mm +2 -2
  14. package/ios/RNRootViewGestureRecognizer.m +3 -3
  15. package/lib/commonjs/EnableNewWebImplementation.js +35 -0
  16. package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
  17. package/lib/commonjs/GestureHandlerRootViewContext.js +15 -0
  18. package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
  19. package/lib/commonjs/RNGestureHandlerModule.macos.js +6 -6
  20. package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
  21. package/lib/commonjs/RNGestureHandlerModule.web.js +6 -6
  22. package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
  23. package/lib/commonjs/RNGestureHandlerModule.windows.js +6 -6
  24. package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
  25. package/lib/commonjs/components/GestureComponents.web.js +6 -5
  26. package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
  27. package/lib/commonjs/components/GestureHandlerButton.js +3 -5
  28. package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
  29. package/lib/commonjs/{GestureHandlerRootView.android.js → components/GestureHandlerRootView.android.js} +8 -7
  30. package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
  31. package/lib/commonjs/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +8 -2
  32. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
  33. package/lib/commonjs/{GestureHandlerRootView.web.js → components/GestureHandlerRootView.web.js} +7 -1
  34. package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
  35. package/lib/commonjs/components/Swipeable.js +17 -3
  36. package/lib/commonjs/components/Swipeable.js.map +1 -1
  37. package/lib/commonjs/{gestureHandlerRootHOC.js.map → components/gestureHandlerRootHOC.js.map} +1 -1
  38. package/lib/commonjs/handlers/createHandler.js +21 -13
  39. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  40. package/lib/commonjs/handlers/gestureHandlerCommon.js +5 -4
  41. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
  42. package/lib/commonjs/handlers/gestures/GestureDetector.js +19 -9
  43. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
  44. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +22 -19
  45. package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
  46. package/lib/commonjs/index.js +16 -4
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/commonjs/utils.js +0 -6
  49. package/lib/commonjs/utils.js.map +1 -1
  50. package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -5
  51. package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
  52. package/lib/commonjs/web/handlers/GestureHandler.js +3 -0
  53. package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
  54. package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -5
  55. package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
  56. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -6
  57. package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
  58. package/lib/commonjs/web/handlers/PanGestureHandler.js +2 -12
  59. package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
  60. package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -5
  61. package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
  62. package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -6
  63. package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
  64. package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -6
  65. package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
  66. package/lib/commonjs/web/tools/CircularBuffer.js +59 -0
  67. package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
  68. package/lib/commonjs/web/tools/LeastSquareSolver.js +204 -0
  69. package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
  70. package/lib/commonjs/web/tools/PointerEventManager.js +27 -0
  71. package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
  72. package/lib/commonjs/web/tools/PointerTracker.js +11 -7
  73. package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
  74. package/lib/commonjs/web/tools/VelocityTracker.js +111 -0
  75. package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
  76. package/lib/commonjs/web_hammer/GestureHandler.js +1 -1
  77. package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
  78. package/lib/module/EnableNewWebImplementation.js +22 -0
  79. package/lib/module/EnableNewWebImplementation.js.map +1 -0
  80. package/lib/module/GestureHandlerRootViewContext.js +3 -0
  81. package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
  82. package/lib/module/RNGestureHandlerModule.macos.js +6 -6
  83. package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
  84. package/lib/module/RNGestureHandlerModule.web.js +6 -6
  85. package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
  86. package/lib/module/RNGestureHandlerModule.windows.js +6 -6
  87. package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
  88. package/lib/module/components/GestureComponents.web.js +5 -6
  89. package/lib/module/components/GestureComponents.web.js.map +1 -1
  90. package/lib/module/components/GestureHandlerButton.js +1 -4
  91. package/lib/module/components/GestureHandlerButton.js.map +1 -1
  92. package/lib/module/components/GestureHandlerRootView.android.js +14 -0
  93. package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
  94. package/lib/module/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +5 -2
  95. package/lib/module/components/GestureHandlerRootView.js.map +1 -0
  96. package/lib/module/components/GestureHandlerRootView.web.js +9 -0
  97. package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
  98. package/lib/module/components/Swipeable.js +17 -3
  99. package/lib/module/components/Swipeable.js.map +1 -1
  100. package/lib/module/{gestureHandlerRootHOC.js.map → components/gestureHandlerRootHOC.js.map} +1 -1
  101. package/lib/module/handlers/createHandler.js +20 -13
  102. package/lib/module/handlers/createHandler.js.map +1 -1
  103. package/lib/module/handlers/gestureHandlerCommon.js +5 -4
  104. package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
  105. package/lib/module/handlers/gestures/GestureDetector.js +18 -10
  106. package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
  107. package/lib/module/handlers/gestures/reanimatedWrapper.js +19 -16
  108. package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
  109. package/lib/module/index.js +4 -4
  110. package/lib/module/index.js.map +1 -1
  111. package/lib/module/utils.js +0 -4
  112. package/lib/module/utils.js.map +1 -1
  113. package/lib/module/web/handlers/FlingGestureHandler.js +0 -5
  114. package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
  115. package/lib/module/web/handlers/GestureHandler.js +3 -0
  116. package/lib/module/web/handlers/GestureHandler.js.map +1 -1
  117. package/lib/module/web/handlers/ManualGestureHandler.js +0 -5
  118. package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
  119. package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -6
  120. package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
  121. package/lib/module/web/handlers/PanGestureHandler.js +2 -9
  122. package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
  123. package/lib/module/web/handlers/PinchGestureHandler.js +0 -5
  124. package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
  125. package/lib/module/web/handlers/RotationGestureHandler.js +0 -6
  126. package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
  127. package/lib/module/web/handlers/TapGestureHandler.js +0 -6
  128. package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
  129. package/lib/module/web/tools/CircularBuffer.js +50 -0
  130. package/lib/module/web/tools/CircularBuffer.js.map +1 -0
  131. package/lib/module/web/tools/LeastSquareSolver.js +195 -0
  132. package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
  133. package/lib/module/web/tools/PointerEventManager.js +27 -0
  134. package/lib/module/web/tools/PointerEventManager.js.map +1 -1
  135. package/lib/module/web/tools/PointerTracker.js +8 -7
  136. package/lib/module/web/tools/PointerTracker.js.map +1 -1
  137. package/lib/module/web/tools/VelocityTracker.js +98 -0
  138. package/lib/module/web/tools/VelocityTracker.js.map +1 -0
  139. package/lib/module/web_hammer/GestureHandler.js +1 -1
  140. package/lib/module/web_hammer/GestureHandler.js.map +1 -1
  141. package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
  142. package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
  143. package/lib/typescript/components/GestureComponents.web.d.ts +1 -1
  144. package/lib/typescript/components/Swipeable.d.ts +12 -1
  145. package/lib/typescript/{gestureHandlerRootHOC.d.ts → components/gestureHandlerRootHOC.d.ts} +1 -1
  146. package/lib/typescript/index.d.ts +4 -4
  147. package/lib/typescript/utils.d.ts +0 -1
  148. package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -1
  149. package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -1
  150. package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -1
  151. package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -1
  152. package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -1
  153. package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -1
  154. package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -1
  155. package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
  156. package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
  157. package/lib/typescript/web/tools/PointerEventManager.d.ts +2 -0
  158. package/lib/typescript/web/tools/PointerTracker.d.ts +1 -0
  159. package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
  160. package/package.json +3 -3
  161. package/src/EnableNewWebImplementation.ts +35 -0
  162. package/src/GestureHandlerRootViewContext.ts +3 -0
  163. package/src/RNGestureHandlerModule.macos.ts +6 -6
  164. package/src/RNGestureHandlerModule.web.ts +6 -6
  165. package/src/RNGestureHandlerModule.windows.ts +6 -6
  166. package/src/components/GestureComponents.web.tsx +5 -6
  167. package/src/components/GestureHandlerButton.tsx +2 -7
  168. package/src/components/GestureHandlerRootView.android.tsx +24 -0
  169. package/src/{GestureHandlerRootView.tsx → components/GestureHandlerRootView.tsx} +7 -2
  170. package/src/{GestureHandlerRootView.web.tsx → components/GestureHandlerRootView.web.tsx} +6 -1
  171. package/src/components/Swipeable.tsx +30 -4
  172. package/src/{gestureHandlerRootHOC.tsx → components/gestureHandlerRootHOC.tsx} +1 -1
  173. package/src/handlers/createHandler.tsx +20 -9
  174. package/src/handlers/gestureHandlerCommon.ts +5 -6
  175. package/src/handlers/gestures/GestureDetector.tsx +19 -9
  176. package/src/handlers/gestures/reanimatedWrapper.ts +21 -20
  177. package/src/index.ts +7 -3
  178. package/src/utils.ts +0 -5
  179. package/src/web/handlers/FlingGestureHandler.ts +0 -5
  180. package/src/web/handlers/GestureHandler.ts +3 -0
  181. package/src/web/handlers/ManualGestureHandler.ts +0 -5
  182. package/src/web/handlers/NativeViewGestureHandler.ts +0 -6
  183. package/src/web/handlers/PanGestureHandler.ts +2 -9
  184. package/src/web/handlers/PinchGestureHandler.ts +0 -5
  185. package/src/web/handlers/RotationGestureHandler.ts +0 -7
  186. package/src/web/handlers/TapGestureHandler.ts +0 -6
  187. package/src/web/tools/CircularBuffer.ts +42 -0
  188. package/src/web/tools/LeastSquareSolver.ts +182 -0
  189. package/src/web/tools/PointerEventManager.ts +29 -0
  190. package/src/web/tools/PointerTracker.ts +7 -7
  191. package/src/web/tools/VelocityTracker.ts +98 -0
  192. package/src/web_hammer/GestureHandler.ts +1 -1
  193. package/lib/commonjs/EnableExperimentalWebImplementation.js +0 -31
  194. package/lib/commonjs/EnableExperimentalWebImplementation.js.map +0 -1
  195. package/lib/commonjs/GestureHandlerRootView.android.js.map +0 -1
  196. package/lib/commonjs/GestureHandlerRootView.js.map +0 -1
  197. package/lib/commonjs/GestureHandlerRootView.web.js.map +0 -1
  198. package/lib/module/EnableExperimentalWebImplementation.js +0 -20
  199. package/lib/module/EnableExperimentalWebImplementation.js.map +0 -1
  200. package/lib/module/GestureHandlerRootView.android.js +0 -14
  201. package/lib/module/GestureHandlerRootView.android.js.map +0 -1
  202. package/lib/module/GestureHandlerRootView.js.map +0 -1
  203. package/lib/module/GestureHandlerRootView.web.js +0 -6
  204. package/lib/module/GestureHandlerRootView.web.js.map +0 -1
  205. package/lib/typescript/EnableExperimentalWebImplementation.d.ts +0 -2
  206. package/src/EnableExperimentalWebImplementation.ts +0 -27
  207. package/src/GestureHandlerRootView.android.tsx +0 -24
  208. /package/lib/commonjs/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +0 -0
  209. /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
  210. /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
  211. /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
  212. /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
  213. /package/lib/module/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +0 -0
  214. /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
  215. /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
  216. /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
  217. /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
  218. /package/lib/typescript/{GestureHandlerRootView.android.d.ts → components/GestureHandlerRootView.android.d.ts} +0 -0
  219. /package/lib/typescript/{GestureHandlerRootView.d.ts → components/GestureHandlerRootView.d.ts} +0 -0
  220. /package/lib/typescript/{GestureHandlerRootView.web.d.ts → components/GestureHandlerRootView.web.d.ts} +0 -0
  221. /package/lib/typescript/{fabric → specs}/RNGestureHandlerButtonNativeComponent.d.ts +0 -0
  222. /package/lib/typescript/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.d.ts +0 -0
  223. /package/src/{fabric → specs}/RNGestureHandlerButtonNativeComponent.ts +0 -0
  224. /package/src/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.ts +0 -0
@@ -0,0 +1,98 @@
1
+ import { AdaptedEvent } from '../interfaces';
2
+ import CircularBuffer from './CircularBuffer';
3
+ import LeastSquareSolver from './LeastSquareSolver';
4
+
5
+ export default class VelocityTracker {
6
+ private assumePointerMoveStoppedMilliseconds = 40;
7
+ private historySize = 20;
8
+ private horizonMilliseconds = 300;
9
+ private minSampleSize = 3;
10
+
11
+ private samples: CircularBuffer<AdaptedEvent>;
12
+
13
+ constructor() {
14
+ this.samples = new CircularBuffer<AdaptedEvent>(this.historySize);
15
+ }
16
+
17
+ public add(event: AdaptedEvent): void {
18
+ this.samples.push(event);
19
+ }
20
+
21
+ /// Returns an estimate of the velocity of the object being tracked by the
22
+ /// tracker given the current information available to the tracker.
23
+ ///
24
+ /// Information is added using [addPosition].
25
+ ///
26
+ /// Returns null if there is no data on which to base an estimate.
27
+ private getVelocityEstimate(): [number, number] | null {
28
+ const x = [];
29
+ const y = [];
30
+ const w = [];
31
+ const time = [];
32
+
33
+ let sampleCount = 0;
34
+ let index = this.samples.size - 1;
35
+ const newestSample = this.samples.get(index);
36
+ if (!newestSample) {
37
+ return null;
38
+ }
39
+
40
+ let previousSample = newestSample;
41
+
42
+ // Starting with the most recent PointAtTime sample, iterate backwards while
43
+ // the samples represent continuous motion.
44
+ while (sampleCount < this.samples.size) {
45
+ const sample = this.samples.get(index);
46
+
47
+ const age = newestSample.time - sample.time;
48
+ const delta = Math.abs(sample.time - previousSample.time);
49
+ previousSample = sample;
50
+
51
+ if (
52
+ age > this.horizonMilliseconds ||
53
+ delta > this.assumePointerMoveStoppedMilliseconds
54
+ ) {
55
+ break;
56
+ }
57
+
58
+ x.push(sample.x);
59
+ y.push(sample.y);
60
+ w.push(1);
61
+ time.push(-age);
62
+
63
+ sampleCount++;
64
+ index--;
65
+ }
66
+
67
+ if (sampleCount >= this.minSampleSize) {
68
+ const xSolver = new LeastSquareSolver(time, x, w);
69
+ const xFit = xSolver.solve(2);
70
+
71
+ if (xFit !== null) {
72
+ const ySolver = new LeastSquareSolver(time, y, w);
73
+ const yFit = ySolver.solve(2);
74
+
75
+ if (yFit !== null) {
76
+ const xVelocity = xFit.coefficients[1] * 1000;
77
+ const yVelocity = yFit.coefficients[1] * 1000;
78
+
79
+ return [xVelocity, yVelocity];
80
+ }
81
+ }
82
+ }
83
+
84
+ return null;
85
+ }
86
+
87
+ public getVelocity(): [number, number] {
88
+ const estimate = this.getVelocityEstimate();
89
+ if (estimate !== null) {
90
+ return estimate;
91
+ }
92
+ return [0, 0];
93
+ }
94
+
95
+ public reset(): void {
96
+ this.samples.clear();
97
+ }
98
+ }
@@ -508,7 +508,7 @@ abstract class GestureHandler {
508
508
  .filter((v) => v);
509
509
 
510
510
  if (shouldUseTouchEvents !== this.shouldUseTouchEvents(props)) {
511
- requestAnimationFrame(() => {
511
+ queueMicrotask(() => {
512
512
  // if the undelying event API needs to be changed, we need to unmount and mount
513
513
  // the hammer instance again.
514
514
  this.destroy();
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.enableExperimentalWebImplementation = enableExperimentalWebImplementation;
7
- exports.isExperimentalWebImplementationEnabled = isExperimentalWebImplementationEnabled;
8
-
9
- var _reactNative = require("react-native");
10
-
11
- let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
12
- let getWasCalled = false;
13
-
14
- function enableExperimentalWebImplementation(shouldEnable = true) {
15
- if (_reactNative.Platform.OS !== 'web' || EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable) {
16
- return;
17
- }
18
-
19
- if (getWasCalled) {
20
- console.error('Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.');
21
- return;
22
- }
23
-
24
- EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;
25
- }
26
-
27
- function isExperimentalWebImplementationEnabled() {
28
- getWasCalled = true;
29
- return EXPERIMENTAL_WEB_IMPLEMENTATION;
30
- }
31
- //# sourceMappingURL=EnableExperimentalWebImplementation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","Platform","OS","console","error","isExperimentalWebImplementationEnabled"],"mappings":";;;;;;;;AAAA;;AAEA,IAAIA,+BAA+B,GAAG,KAAtC;AACA,IAAIC,YAAY,GAAG,KAAnB;;AAEO,SAASC,mCAAT,CAA6CC,YAAY,GAAG,IAA5D,EAAwE;AAC7E,MACEC,sBAASC,EAAT,KAAgB,KAAhB,IACAL,+BAA+B,KAAKG,YAFtC,EAGE;AACA;AACD;;AAED,MAAIF,YAAJ,EAAkB;AAChBK,IAAAA,OAAO,CAACC,KAAR,CACE,4KADF;AAGA;AACD;;AAEDP,EAAAA,+BAA+B,GAAGG,YAAlC;AACD;;AAEM,SAASK,sCAAT,GAA2D;AAChEP,EAAAA,YAAY,GAAG,IAAf;AACA,SAAOD,+BAAP;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nlet EXPERIMENTAL_WEB_IMPLEMENTATION = false;\nlet getWasCalled = false;\n\nexport function enableExperimentalWebImplementation(shouldEnable = true): void {\n if (\n Platform.OS !== 'web' ||\n EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable\n ) {\n return;\n }\n\n if (getWasCalled) {\n console.error(\n 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'\n );\n return;\n }\n\n EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;\n}\n\nexport function isExperimentalWebImplementationEnabled(): boolean {\n getWasCalled = true;\n return EXPERIMENTAL_WEB_IMPLEMENTATION;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.android.tsx"],"names":["GestureHandlerRootViewNativeComponent","require","default","GestureHandlerRootView","props"],"mappings":";;;;;;;AACA;;AAEA;;AACA;;AACA;;;;;;AALA;AAOA,MAAMA,qCAAqC,GAAG,gDAC1CC,OAAO,CAAC,kDAAD,CAAP,CAA4DC,OADlB,GAE1C,yCAAuB,0BAAvB,CAFJ;;AAOe,SAASC,sBAAT,CACbC,KADa,EAEb;AACA;AACA;AACA;AACA;AAEA,sBAAO,oBAAC,qCAAD,EAA2CA,KAA3C,CAAP;AACD","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { requireNativeComponent, ViewProps } from 'react-native';\nimport { maybeInitializeFabric } from './init';\nimport { shouldUseCodegenNativeComponent } from './utils';\n\nconst GestureHandlerRootViewNativeComponent = shouldUseCodegenNativeComponent()\n ? require('./fabric/RNGestureHandlerRootViewNativeComponent').default\n : requireNativeComponent('RNGestureHandlerRootView');\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\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 <GestureHandlerRootViewNativeComponent {...props} />;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.tsx"],"names":["GestureHandlerRootView","props"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;AAKe,SAASA,sBAAT,CACbC,KADa,EAEb;AACA;AACA;AACA;AACA;AAEA,sBAAO,oBAAC,iBAAD,EAAUA,KAAV,CAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { maybeInitializeFabric } from './init';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\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 <View {...props} />;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.web.tsx"],"names":["GestureHandlerRootView","props"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAKe,SAASA,sBAAT,CACbC,KADa,EAEb;AACA,sBAAO,oBAAC,iBAAD,EAAUA,KAAV,CAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, ViewProps } from 'react-native';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\n return <View {...props} />;\n}\n"]}
@@ -1,20 +0,0 @@
1
- import { Platform } from 'react-native';
2
- let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
3
- let getWasCalled = false;
4
- export function enableExperimentalWebImplementation(shouldEnable = true) {
5
- if (Platform.OS !== 'web' || EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable) {
6
- return;
7
- }
8
-
9
- if (getWasCalled) {
10
- console.error('Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.');
11
- return;
12
- }
13
-
14
- EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;
15
- }
16
- export function isExperimentalWebImplementationEnabled() {
17
- getWasCalled = true;
18
- return EXPERIMENTAL_WEB_IMPLEMENTATION;
19
- }
20
- //# sourceMappingURL=EnableExperimentalWebImplementation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["Platform","EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","OS","console","error","isExperimentalWebImplementationEnabled"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,IAAIC,+BAA+B,GAAG,KAAtC;AACA,IAAIC,YAAY,GAAG,KAAnB;AAEA,OAAO,SAASC,mCAAT,CAA6CC,YAAY,GAAG,IAA5D,EAAwE;AAC7E,MACEJ,QAAQ,CAACK,EAAT,KAAgB,KAAhB,IACAJ,+BAA+B,KAAKG,YAFtC,EAGE;AACA;AACD;;AAED,MAAIF,YAAJ,EAAkB;AAChBI,IAAAA,OAAO,CAACC,KAAR,CACE,4KADF;AAGA;AACD;;AAEDN,EAAAA,+BAA+B,GAAGG,YAAlC;AACD;AAED,OAAO,SAASI,sCAAT,GAA2D;AAChEN,EAAAA,YAAY,GAAG,IAAf;AACA,SAAOD,+BAAP;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nlet EXPERIMENTAL_WEB_IMPLEMENTATION = false;\nlet getWasCalled = false;\n\nexport function enableExperimentalWebImplementation(shouldEnable = true): void {\n if (\n Platform.OS !== 'web' ||\n EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable\n ) {\n return;\n }\n\n if (getWasCalled) {\n console.error(\n 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'\n );\n return;\n }\n\n EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;\n}\n\nexport function isExperimentalWebImplementationEnabled(): boolean {\n getWasCalled = true;\n return EXPERIMENTAL_WEB_IMPLEMENTATION;\n}\n"]}
@@ -1,14 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- import * as React from 'react';
3
- import { requireNativeComponent } from 'react-native';
4
- import { maybeInitializeFabric } from './init';
5
- import { shouldUseCodegenNativeComponent } from './utils';
6
- const GestureHandlerRootViewNativeComponent = shouldUseCodegenNativeComponent() ? require('./fabric/RNGestureHandlerRootViewNativeComponent').default : requireNativeComponent('RNGestureHandlerRootView');
7
- export default function GestureHandlerRootView(props) {
8
- // try initialize fabric on the first render, at this point we can
9
- // reliably check if fabric is enabled (the function contains a flag
10
- // to make sure it's called only once)
11
- maybeInitializeFabric();
12
- return /*#__PURE__*/React.createElement(GestureHandlerRootViewNativeComponent, props);
13
- }
14
- //# sourceMappingURL=GestureHandlerRootView.android.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.android.tsx"],"names":["React","requireNativeComponent","maybeInitializeFabric","shouldUseCodegenNativeComponent","GestureHandlerRootViewNativeComponent","require","default","GestureHandlerRootView","props"],"mappings":"AAAA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,sBAAT,QAAkD,cAAlD;AACA,SAASC,qBAAT,QAAsC,QAAtC;AACA,SAASC,+BAAT,QAAgD,SAAhD;AAEA,MAAMC,qCAAqC,GAAGD,+BAA+B,KACzEE,OAAO,CAAC,kDAAD,CAAP,CAA4DC,OADa,GAEzEL,sBAAsB,CAAC,0BAAD,CAF1B;AAOA,eAAe,SAASM,sBAAT,CACbC,KADa,EAEb;AACA;AACA;AACA;AACAN,EAAAA,qBAAqB;AAErB,sBAAO,oBAAC,qCAAD,EAA2CM,KAA3C,CAAP;AACD","sourcesContent":["/* eslint-disable @typescript-eslint/no-var-requires */\nimport * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { requireNativeComponent, ViewProps } from 'react-native';\nimport { maybeInitializeFabric } from './init';\nimport { shouldUseCodegenNativeComponent } from './utils';\n\nconst GestureHandlerRootViewNativeComponent = shouldUseCodegenNativeComponent()\n ? require('./fabric/RNGestureHandlerRootViewNativeComponent').default\n : requireNativeComponent('RNGestureHandlerRootView');\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\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 <GestureHandlerRootViewNativeComponent {...props} />;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.tsx"],"names":["React","View","maybeInitializeFabric","GestureHandlerRootView","props"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,QAAgC,cAAhC;AACA,SAASC,qBAAT,QAAsC,QAAtC;AAKA,eAAe,SAASC,sBAAT,CACbC,KADa,EAEb;AACA;AACA;AACA;AACAF,EAAAA,qBAAqB;AAErB,sBAAO,oBAAC,IAAD,EAAUE,KAAV,CAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, ViewProps } from 'react-native';\nimport { maybeInitializeFabric } from './init';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\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 <View {...props} />;\n}\n"]}
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { View } from 'react-native';
3
- export default function GestureHandlerRootView(props) {
4
- return /*#__PURE__*/React.createElement(View, props);
5
- }
6
- //# sourceMappingURL=GestureHandlerRootView.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["GestureHandlerRootView.web.tsx"],"names":["React","View","GestureHandlerRootView","props"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAASC,IAAT,QAAgC,cAAhC;AAKA,eAAe,SAASC,sBAAT,CACbC,KADa,EAEb;AACA,sBAAO,oBAAC,IAAD,EAAUA,KAAV,CAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { View, ViewProps } from 'react-native';\n\nexport interface GestureHandlerRootViewProps\n extends PropsWithChildren<ViewProps> {}\n\nexport default function GestureHandlerRootView(\n props: GestureHandlerRootViewProps\n) {\n return <View {...props} />;\n}\n"]}
@@ -1,2 +0,0 @@
1
- export declare function enableExperimentalWebImplementation(shouldEnable?: boolean): void;
2
- export declare function isExperimentalWebImplementationEnabled(): boolean;
@@ -1,27 +0,0 @@
1
- import { Platform } from 'react-native';
2
-
3
- let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
4
- let getWasCalled = false;
5
-
6
- export function enableExperimentalWebImplementation(shouldEnable = true): void {
7
- if (
8
- Platform.OS !== 'web' ||
9
- EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable
10
- ) {
11
- return;
12
- }
13
-
14
- if (getWasCalled) {
15
- console.error(
16
- 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'
17
- );
18
- return;
19
- }
20
-
21
- EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;
22
- }
23
-
24
- export function isExperimentalWebImplementationEnabled(): boolean {
25
- getWasCalled = true;
26
- return EXPERIMENTAL_WEB_IMPLEMENTATION;
27
- }
@@ -1,24 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- import * as React from 'react';
3
- import { PropsWithChildren } from 'react';
4
- import { requireNativeComponent, ViewProps } from 'react-native';
5
- import { maybeInitializeFabric } from './init';
6
- import { shouldUseCodegenNativeComponent } from './utils';
7
-
8
- const GestureHandlerRootViewNativeComponent = shouldUseCodegenNativeComponent()
9
- ? require('./fabric/RNGestureHandlerRootViewNativeComponent').default
10
- : requireNativeComponent('RNGestureHandlerRootView');
11
-
12
- export interface GestureHandlerRootViewProps
13
- extends PropsWithChildren<ViewProps> {}
14
-
15
- export default function GestureHandlerRootView(
16
- props: GestureHandlerRootViewProps
17
- ) {
18
- // try initialize fabric on the first render, at this point we can
19
- // reliably check if fabric is enabled (the function contains a flag
20
- // to make sure it's called only once)
21
- maybeInitializeFabric();
22
-
23
- return <GestureHandlerRootViewNativeComponent {...props} />;
24
- }