react-native-gesture-handler 2.9.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/RNGestureHandler.podspec +1 -1
- package/android/build.gradle +69 -29
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +2 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +39 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +8 -2
- package/ios/Handlers/RNNativeViewHandler.mm +4 -4
- package/ios/RNGestureHandlerButtonComponentView.h +2 -2
- package/ios/RNGestureHandlerButtonComponentView.mm +2 -2
- package/ios/RNGestureHandlerManager.mm +9 -9
- package/ios/RNGestureHandlerModule.mm +16 -16
- package/ios/RNGestureHandlerRootViewComponentView.mm +2 -2
- package/ios/RNRootViewGestureRecognizer.m +3 -3
- package/lib/commonjs/EnableNewWebImplementation.js +35 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +15 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +6 -5
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +3 -5
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/{GestureHandlerRootView.android.js → components/GestureHandlerRootView.android.js} +8 -7
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +8 -2
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/{GestureHandlerRootView.web.js → components/GestureHandlerRootView.web.js} +7 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +17 -3
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/{gestureHandlerRootHOC.js.map → components/gestureHandlerRootHOC.js.map} +1 -1
- package/lib/commonjs/handlers/createHandler.js +21 -13
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +5 -4
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +19 -9
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +22 -19
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/index.js +16 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +0 -6
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +3 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +2 -12
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -6
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +59 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +204 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +27 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +11 -7
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +111 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +22 -0
- package/lib/module/EnableNewWebImplementation.js.map +1 -0
- package/lib/module/GestureHandlerRootViewContext.js +3 -0
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +6 -6
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +6 -6
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +6 -6
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +5 -6
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js +1 -4
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +14 -0
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +5 -2
- package/lib/module/components/GestureHandlerRootView.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.web.js +9 -0
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +17 -3
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/{gestureHandlerRootHOC.js.map → components/gestureHandlerRootHOC.js.map} +1 -1
- package/lib/module/handlers/createHandler.js +20 -13
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +5 -4
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +18 -10
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +19 -16
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +0 -4
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +3 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -5
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +2 -9
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +0 -5
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +0 -6
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -6
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +50 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +195 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +27 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +8 -7
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +98 -0
- package/lib/module/web/tools/VelocityTracker.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +1 -1
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
- package/lib/typescript/components/GestureComponents.web.d.ts +1 -1
- package/lib/typescript/components/Swipeable.d.ts +12 -1
- package/lib/typescript/{gestureHandlerRootHOC.d.ts → components/gestureHandlerRootHOC.d.ts} +1 -1
- package/lib/typescript/index.d.ts +4 -4
- package/lib/typescript/utils.d.ts +0 -1
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -1
- package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
- package/lib/typescript/web/tools/PointerEventManager.d.ts +2 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +1 -0
- package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
- package/package.json +3 -3
- package/src/EnableNewWebImplementation.ts +35 -0
- package/src/GestureHandlerRootViewContext.ts +3 -0
- package/src/RNGestureHandlerModule.macos.ts +6 -6
- package/src/RNGestureHandlerModule.web.ts +6 -6
- package/src/RNGestureHandlerModule.windows.ts +6 -6
- package/src/components/GestureComponents.web.tsx +5 -6
- package/src/components/GestureHandlerButton.tsx +2 -7
- package/src/components/GestureHandlerRootView.android.tsx +24 -0
- package/src/{GestureHandlerRootView.tsx → components/GestureHandlerRootView.tsx} +7 -2
- package/src/{GestureHandlerRootView.web.tsx → components/GestureHandlerRootView.web.tsx} +6 -1
- package/src/components/Swipeable.tsx +30 -4
- package/src/{gestureHandlerRootHOC.tsx → components/gestureHandlerRootHOC.tsx} +1 -1
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/gestureHandlerCommon.ts +5 -6
- package/src/handlers/gestures/GestureDetector.tsx +19 -9
- package/src/handlers/gestures/reanimatedWrapper.ts +21 -20
- package/src/index.ts +7 -3
- package/src/utils.ts +0 -5
- package/src/web/handlers/FlingGestureHandler.ts +0 -5
- package/src/web/handlers/GestureHandler.ts +3 -0
- package/src/web/handlers/ManualGestureHandler.ts +0 -5
- package/src/web/handlers/NativeViewGestureHandler.ts +0 -6
- package/src/web/handlers/PanGestureHandler.ts +2 -9
- package/src/web/handlers/PinchGestureHandler.ts +0 -5
- package/src/web/handlers/RotationGestureHandler.ts +0 -7
- package/src/web/handlers/TapGestureHandler.ts +0 -6
- package/src/web/tools/CircularBuffer.ts +42 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/PointerEventManager.ts +29 -0
- package/src/web/tools/PointerTracker.ts +7 -7
- package/src/web/tools/VelocityTracker.ts +98 -0
- package/src/web_hammer/GestureHandler.ts +1 -1
- package/lib/commonjs/EnableExperimentalWebImplementation.js +0 -31
- package/lib/commonjs/EnableExperimentalWebImplementation.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.android.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.web.js.map +0 -1
- package/lib/module/EnableExperimentalWebImplementation.js +0 -20
- package/lib/module/EnableExperimentalWebImplementation.js.map +0 -1
- package/lib/module/GestureHandlerRootView.android.js +0 -14
- package/lib/module/GestureHandlerRootView.android.js.map +0 -1
- package/lib/module/GestureHandlerRootView.js.map +0 -1
- package/lib/module/GestureHandlerRootView.web.js +0 -6
- package/lib/module/GestureHandlerRootView.web.js.map +0 -1
- package/lib/typescript/EnableExperimentalWebImplementation.d.ts +0 -2
- package/src/EnableExperimentalWebImplementation.ts +0 -27
- package/src/GestureHandlerRootView.android.tsx +0 -24
- /package/lib/commonjs/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
- /package/lib/module/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
- /package/lib/typescript/{GestureHandlerRootView.android.d.ts → components/GestureHandlerRootView.android.d.ts} +0 -0
- /package/lib/typescript/{GestureHandlerRootView.d.ts → components/GestureHandlerRootView.d.ts} +0 -0
- /package/lib/typescript/{GestureHandlerRootView.web.d.ts → components/GestureHandlerRootView.web.d.ts} +0 -0
- /package/lib/typescript/{fabric → specs}/RNGestureHandlerButtonNativeComponent.d.ts +0 -0
- /package/lib/typescript/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.d.ts +0 -0
- /package/src/{fabric → specs}/RNGestureHandlerButtonNativeComponent.ts +0 -0
- /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
|
-
|
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 +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,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
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/lib/typescript/{GestureHandlerRootView.d.ts → components/GestureHandlerRootView.d.ts}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|