react-native-gesture-handler 2.15.0 → 2.16.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/RNGestureHandler.podspec +2 -23
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +9 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +4 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +69 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +25 -19
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +5 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +5 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +7 -3
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +8 -5
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +3 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +3 -0
- package/android/src/main/jni/cpp-adapter.cpp +18 -22
- package/apple/Handlers/RNFlingHandler.m +5 -4
- package/apple/Handlers/RNForceTouchHandler.m +3 -1
- package/apple/Handlers/RNHoverHandler.m +2 -1
- package/apple/Handlers/RNLongPressHandler.m +3 -1
- package/apple/Handlers/RNManualHandler.m +1 -0
- package/apple/Handlers/RNNativeViewHandler.mm +9 -7
- package/apple/Handlers/RNPanHandler.m +7 -2
- package/apple/Handlers/RNPinchHandler.m +38 -25
- package/apple/Handlers/RNRotationHandler.m +43 -29
- package/apple/Handlers/RNTapHandler.m +6 -4
- package/apple/RNGestureHandler.h +9 -0
- package/apple/RNGestureHandler.m +38 -3
- package/apple/RNGestureHandlerEvents.h +18 -9
- package/apple/RNGestureHandlerEvents.m +29 -11
- package/apple/RNGestureHandlerManager.h +5 -0
- package/apple/RNGestureHandlerManager.mm +32 -6
- package/apple/RNGestureHandlerModule.h +5 -3
- package/apple/RNGestureHandlerModule.mm +33 -19
- package/apple/RNGestureHandlerPointerType.h +8 -0
- package/lib/commonjs/PointerType.js +16 -0
- package/lib/commonjs/PointerType.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js +17 -2
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +15 -2
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +15 -2
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +19 -2
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +5 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +6 -3
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +3 -13
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +3 -3
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +29 -7
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/TouchEventManager.js +3 -1
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +6 -0
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/module/PointerType.js +9 -0
- package/lib/module/PointerType.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.android.js +15 -2
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +15 -3
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +15 -3
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +19 -2
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/handlers/createHandler.js +6 -1
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +5 -3
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +2 -11
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +2 -2
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +30 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/TouchEventManager.js +2 -1
- package/lib/module/web/tools/TouchEventManager.js.map +1 -1
- package/lib/module/web/utils.js +2 -0
- package/lib/module/web/utils.js.map +1 -1
- package/lib/typescript/PointerType.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +1 -1
- package/lib/typescript/components/GestureHandlerRootView.d.ts +1 -1
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +1 -1
- package/lib/typescript/getShadowNodeFromRef.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +2 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +6 -6
- package/lib/typescript/web/handlers/GestureHandler.d.ts +2 -1
- package/lib/typescript/web/interfaces.d.ts +4 -8
- package/lib/typescript/web/utils.d.ts +2 -0
- package/package.json +1 -1
- package/src/PointerType.ts +6 -0
- package/src/components/GestureHandlerRootView.android.tsx +13 -5
- package/src/components/GestureHandlerRootView.tsx +10 -5
- package/src/components/GestureHandlerRootView.web.tsx +10 -5
- package/src/getShadowNodeFromRef.ts +28 -6
- package/src/handlers/createHandler.tsx +6 -0
- package/src/handlers/gestureHandlerCommon.ts +2 -0
- package/src/index.ts +1 -0
- package/src/specs/NativeRNGestureHandlerModule.ts +8 -8
- package/src/web/handlers/GestureHandler.ts +3 -2
- package/src/web/interfaces.ts +4 -9
- package/src/web/tools/GestureHandlerOrchestrator.ts +2 -2
- package/src/web/tools/PointerEventManager.ts +34 -14
- package/src/web/tools/TouchEventManager.ts +2 -6
- package/src/web/utils.ts +9 -0
@@ -12,26 +12,31 @@
|
|
12
12
|
return self;
|
13
13
|
}
|
14
14
|
|
15
|
-
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position
|
15
|
+
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position
|
16
|
+
withAbsolutePosition:(CGPoint)absolutePosition
|
17
|
+
withPointerType:(NSInteger)pointerType
|
16
18
|
{
|
17
19
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
18
20
|
@"x" : @(position.x),
|
19
21
|
@"y" : @(position.y),
|
20
22
|
@"absoluteX" : @(absolutePosition.x),
|
21
|
-
@"absoluteY" : @(absolutePosition.y)
|
23
|
+
@"absoluteY" : @(absolutePosition.y),
|
24
|
+
@"pointerType" : @(pointerType)
|
22
25
|
}];
|
23
26
|
}
|
24
27
|
|
25
28
|
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position
|
26
29
|
withAbsolutePosition:(CGPoint)absolutePosition
|
27
30
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
31
|
+
withPointerType:(NSInteger)pointerType
|
28
32
|
{
|
29
33
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
30
34
|
@"x" : @(position.x),
|
31
35
|
@"y" : @(position.y),
|
32
36
|
@"absoluteX" : @(absolutePosition.x),
|
33
37
|
@"absoluteY" : @(absolutePosition.y),
|
34
|
-
@"numberOfPointers" : @(numberOfTouches)
|
38
|
+
@"numberOfPointers" : @(numberOfTouches),
|
39
|
+
@"pointerType" : @(pointerType)
|
35
40
|
}];
|
36
41
|
}
|
37
42
|
|
@@ -39,6 +44,7 @@
|
|
39
44
|
withAbsolutePosition:(CGPoint)absolutePosition
|
40
45
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
41
46
|
withDuration:(NSUInteger)duration
|
47
|
+
withPointerType:(NSInteger)pointerType
|
42
48
|
{
|
43
49
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
44
50
|
@"x" : @(position.x),
|
@@ -46,7 +52,8 @@
|
|
46
52
|
@"absoluteX" : @(absolutePosition.x),
|
47
53
|
@"absoluteY" : @(absolutePosition.y),
|
48
54
|
@"numberOfPointers" : @(numberOfTouches),
|
49
|
-
@"duration" : @(duration)
|
55
|
+
@"duration" : @(duration),
|
56
|
+
@"pointerType" : @(pointerType)
|
50
57
|
}];
|
51
58
|
}
|
52
59
|
|
@@ -55,6 +62,7 @@
|
|
55
62
|
withTranslation:(CGPoint)translation
|
56
63
|
withVelocity:(CGPoint)velocity
|
57
64
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
65
|
+
withPointerType:(NSInteger)pointerType
|
58
66
|
{
|
59
67
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
60
68
|
@"x" : @(position.x),
|
@@ -65,7 +73,8 @@
|
|
65
73
|
@"translationY" : @(translation.y),
|
66
74
|
@"velocityX" : SAFE_VELOCITY(velocity.x),
|
67
75
|
@"velocityY" : SAFE_VELOCITY(velocity.y),
|
68
|
-
@"numberOfPointers" : @(numberOfTouches)
|
76
|
+
@"numberOfPointers" : @(numberOfTouches),
|
77
|
+
@"pointerType" : @(pointerType)
|
69
78
|
}];
|
70
79
|
}
|
71
80
|
|
@@ -73,6 +82,7 @@
|
|
73
82
|
forPosition:(CGPoint)position
|
74
83
|
withAbsolutePosition:(CGPoint)absolutePosition
|
75
84
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
85
|
+
withPointerType:(NSInteger)pointerType
|
76
86
|
{
|
77
87
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
78
88
|
@"x" : @(position.x),
|
@@ -80,7 +90,8 @@
|
|
80
90
|
@"absoluteX" : @(absolutePosition.x),
|
81
91
|
@"absoluteY" : @(absolutePosition.y),
|
82
92
|
@"force" : @(force),
|
83
|
-
@"numberOfPointers" : @(numberOfTouches)
|
93
|
+
@"numberOfPointers" : @(numberOfTouches),
|
94
|
+
@"pointerType" : @(pointerType)
|
84
95
|
}];
|
85
96
|
}
|
86
97
|
|
@@ -88,13 +99,15 @@
|
|
88
99
|
withFocalPoint:(CGPoint)focalPoint
|
89
100
|
withVelocity:(CGFloat)velocity
|
90
101
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
102
|
+
withPointerType:(NSInteger)pointerType
|
91
103
|
{
|
92
104
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
93
105
|
@"scale" : @(scale),
|
94
106
|
@"focalX" : @(focalPoint.x),
|
95
107
|
@"focalY" : @(focalPoint.y),
|
96
108
|
@"velocity" : SAFE_VELOCITY(velocity),
|
97
|
-
@"numberOfPointers" : @(numberOfTouches)
|
109
|
+
@"numberOfPointers" : @(numberOfTouches),
|
110
|
+
@"pointerType" : @(pointerType)
|
98
111
|
}];
|
99
112
|
}
|
100
113
|
|
@@ -102,13 +115,15 @@
|
|
102
115
|
withAnchorPoint:(CGPoint)anchorPoint
|
103
116
|
withVelocity:(CGFloat)velocity
|
104
117
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
118
|
+
withPointerType:(NSInteger)pointerType
|
105
119
|
{
|
106
120
|
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
107
121
|
@"rotation" : @(rotation),
|
108
122
|
@"anchorX" : @(anchorPoint.x),
|
109
123
|
@"anchorY" : @(anchorPoint.y),
|
110
124
|
@"velocity" : SAFE_VELOCITY(velocity),
|
111
|
-
@"numberOfPointers" : @(numberOfTouches)
|
125
|
+
@"numberOfPointers" : @(numberOfTouches),
|
126
|
+
@"pointerType" : @(pointerType)
|
112
127
|
}];
|
113
128
|
}
|
114
129
|
|
@@ -116,6 +131,7 @@
|
|
116
131
|
withChangedPointers:(NSArray<NSDictionary *> *)changedPointers
|
117
132
|
withAllPointers:(NSArray<NSDictionary *> *)allPointers
|
118
133
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
134
|
+
withPointerType:(NSInteger)pointerType
|
119
135
|
{
|
120
136
|
if (changedPointers == nil || allPointers == nil) {
|
121
137
|
changedPointers = @[];
|
@@ -127,13 +143,15 @@
|
|
127
143
|
@"eventType" : @(eventType),
|
128
144
|
@"changedTouches" : changedPointers,
|
129
145
|
@"allTouches" : allPointers,
|
130
|
-
@"numberOfTouches" : @(numberOfTouches)
|
146
|
+
@"numberOfTouches" : @(numberOfTouches),
|
147
|
+
@"pointerType" : @(pointerType)
|
131
148
|
}];
|
132
149
|
}
|
133
150
|
|
134
|
-
+ (RNGestureHandlerEventExtraData *)forPointerInside:(BOOL)pointerInside
|
151
|
+
+ (RNGestureHandlerEventExtraData *)forPointerInside:(BOOL)pointerInside withPointerType:(NSInteger)pointerType
|
135
152
|
{
|
136
|
-
return [[RNGestureHandlerEventExtraData alloc]
|
153
|
+
return [[RNGestureHandlerEventExtraData alloc]
|
154
|
+
initWithData:@{@"pointerInside" : @(pointerInside), @"pointerType" : @(pointerType)}];
|
137
155
|
}
|
138
156
|
|
139
157
|
@end
|
@@ -9,8 +9,13 @@
|
|
9
9
|
|
10
10
|
@interface RNGestureHandlerManager : NSObject
|
11
11
|
|
12
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
13
|
+
- (nonnull instancetype)initWithModuleRegistry:(nonnull RCTModuleRegistry *)moduleRegistry
|
14
|
+
viewRegistry:(nonnull RCTViewRegistry *)viewRegistry;
|
15
|
+
#else
|
12
16
|
- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager
|
13
17
|
eventDispatcher:(nonnull id<RCTEventDispatcherProtocol>)eventDispatcher;
|
18
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
14
19
|
|
15
20
|
- (void)createGestureHandler:(nonnull NSString *)handlerName
|
16
21
|
tag:(nonnull NSNumber *)handlerTag
|
@@ -49,26 +49,48 @@ constexpr int NEW_ARCH_NUMBER_OF_ATTACH_RETRIES = 25;
|
|
49
49
|
|
50
50
|
@implementation RNGestureHandlerManager {
|
51
51
|
RNGestureHandlerRegistry *_registry;
|
52
|
-
RCTUIManager *_uiManager;
|
53
52
|
NSHashTable<RNRootViewGestureRecognizer *> *_rootViewGestureRecognizers;
|
54
53
|
NSMutableDictionary<NSNumber *, NSNumber *> *_attachRetryCounter;
|
54
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
55
|
+
RCTModuleRegistry *_moduleRegistry;
|
56
|
+
RCTViewRegistry *_viewRegistry;
|
57
|
+
#else
|
58
|
+
RCTUIManager *_uiManager;
|
59
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
55
60
|
id<RCTEventDispatcherProtocol> _eventDispatcher;
|
56
61
|
id _reanimatedModule;
|
57
62
|
}
|
58
63
|
|
64
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
65
|
+
- (instancetype)initWithModuleRegistry:(RCTModuleRegistry *)moduleRegistry viewRegistry:(RCTViewRegistry *)viewRegistry
|
66
|
+
{
|
67
|
+
if ((self = [super init])) {
|
68
|
+
_moduleRegistry = moduleRegistry;
|
69
|
+
_viewRegistry = viewRegistry;
|
70
|
+
_eventDispatcher = [_moduleRegistry moduleForName:"EventDispatcher"];
|
71
|
+
[self initCommonProps];
|
72
|
+
}
|
73
|
+
return self;
|
74
|
+
}
|
75
|
+
#else
|
59
76
|
- (instancetype)initWithUIManager:(RCTUIManager *)uiManager
|
60
77
|
eventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
|
61
78
|
{
|
62
79
|
if ((self = [super init])) {
|
63
80
|
_uiManager = uiManager;
|
64
81
|
_eventDispatcher = eventDispatcher;
|
65
|
-
|
66
|
-
_rootViewGestureRecognizers = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];
|
67
|
-
_attachRetryCounter = [[NSMutableDictionary alloc] init];
|
68
|
-
_reanimatedModule = nil;
|
82
|
+
[self initCommonProps];
|
69
83
|
}
|
70
84
|
return self;
|
71
85
|
}
|
86
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
87
|
+
|
88
|
+
- (void)initCommonProps
|
89
|
+
{
|
90
|
+
_registry = [RNGestureHandlerRegistry new];
|
91
|
+
_rootViewGestureRecognizers = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory];
|
92
|
+
_attachRetryCounter = [[NSMutableDictionary alloc] init];
|
93
|
+
}
|
72
94
|
|
73
95
|
- (void)createGestureHandler:(NSString *)handlerName tag:(NSNumber *)handlerTag config:(NSDictionary *)config
|
74
96
|
{
|
@@ -115,7 +137,11 @@ constexpr int NEW_ARCH_NUMBER_OF_ATTACH_RETRIES = 25;
|
|
115
137
|
toViewWithTag:(nonnull NSNumber *)viewTag
|
116
138
|
withActionType:(RNGestureHandlerActionType)actionType
|
117
139
|
{
|
140
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
141
|
+
RNGHUIView *view = [_viewRegistry viewForReactTag:viewTag];
|
142
|
+
#else
|
118
143
|
RNGHUIView *view = [_uiManager viewForReactTag:viewTag];
|
144
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
119
145
|
|
120
146
|
#ifdef RCT_NEW_ARCH_ENABLED
|
121
147
|
if (view == nil || view.superview == nil) {
|
@@ -350,7 +376,7 @@ constexpr int NEW_ARCH_NUMBER_OF_ATTACH_RETRIES = 25;
|
|
350
376
|
#ifdef RCT_NEW_ARCH_ENABLED
|
351
377
|
// Send event directly to Reanimated
|
352
378
|
if (_reanimatedModule == nil) {
|
353
|
-
_reanimatedModule = [
|
379
|
+
_reanimatedModule = [_moduleRegistry moduleForName:"ReanimatedModule"];
|
354
380
|
}
|
355
381
|
|
356
382
|
[_reanimatedModule eventDispatcherWillDispatchEvent:event];
|
@@ -1,15 +1,17 @@
|
|
1
1
|
#import <React/RCTEventEmitter.h>
|
2
2
|
#import <React/RCTUIManager.h>
|
3
3
|
|
4
|
-
#ifdef
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
5
|
+
#import <React/RCTEventDispatcherProtocol.h>
|
6
|
+
#import <React/RCTInitializing.h>
|
5
7
|
#import <rngesturehandler_codegen/rngesturehandler_codegen.h>
|
6
8
|
#else
|
7
9
|
#import <React/RCTBridgeModule.h>
|
8
10
|
#endif
|
9
11
|
|
10
12
|
@interface RNGestureHandlerModule : RCTEventEmitter
|
11
|
-
#ifdef
|
12
|
-
<NativeRNGestureHandlerModuleSpec>
|
13
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
14
|
+
<NativeRNGestureHandlerModuleSpec, RCTJSDispatcherModule, RCTInitializing>
|
13
15
|
#else
|
14
16
|
<RCTBridgeModule>
|
15
17
|
#endif
|
@@ -33,7 +33,7 @@ using namespace react;
|
|
33
33
|
#endif // RCT_NEW_ARCH_ENABLED
|
34
34
|
|
35
35
|
#ifdef RCT_NEW_ARCH_ENABLED
|
36
|
-
@interface RNGestureHandlerModule () <RNGestureHandlerStateManager>
|
36
|
+
@interface RNGestureHandlerModule () <RNGestureHandlerStateManager, RCTTurboModule>
|
37
37
|
|
38
38
|
@end
|
39
39
|
#else
|
@@ -51,6 +51,12 @@ typedef void (^GestureHandlerOperation)(RNGestureHandlerManager *manager);
|
|
51
51
|
NSMutableArray<GestureHandlerOperation> *_operations;
|
52
52
|
}
|
53
53
|
|
54
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
55
|
+
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
|
56
|
+
@synthesize bridge = _bridge;
|
57
|
+
@synthesize dispatchToJSThread = _dispatchToJSThread;
|
58
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
59
|
+
|
54
60
|
RCT_EXPORT_MODULE()
|
55
61
|
|
56
62
|
+ (BOOL)requiresMainQueueSetup
|
@@ -94,8 +100,7 @@ void decorateRuntime(jsi::Runtime &runtime)
|
|
94
100
|
if (!arguments[0].isObject()) {
|
95
101
|
return jsi::Value::null();
|
96
102
|
}
|
97
|
-
|
98
|
-
auto shadowNode = arguments[0].asObject(runtime).getHostObject<ShadowNodeWrapper>(runtime)->shadowNode;
|
103
|
+
auto shadowNode = arguments[0].asObject(runtime).getNativeState<ShadowNode>(runtime);
|
99
104
|
bool isFormsStackingContext = shadowNode->getTraits().check(ShadowNodeTraits::FormsStackingContext);
|
100
105
|
|
101
106
|
return jsi::Value(isFormsStackingContext);
|
@@ -104,6 +109,14 @@ void decorateRuntime(jsi::Runtime &runtime)
|
|
104
109
|
}
|
105
110
|
#endif // RCT_NEW_ARCH_ENABLED
|
106
111
|
|
112
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
113
|
+
- (void)initialize
|
114
|
+
{
|
115
|
+
_manager = [[RNGestureHandlerManager alloc] initWithModuleRegistry:self.moduleRegistry
|
116
|
+
viewRegistry:_viewRegistry_DEPRECATED];
|
117
|
+
_operations = [NSMutableArray new];
|
118
|
+
}
|
119
|
+
#else
|
107
120
|
- (void)setBridge:(RCTBridge *)bridge
|
108
121
|
{
|
109
122
|
[super setBridge:bridge];
|
@@ -112,21 +125,23 @@ void decorateRuntime(jsi::Runtime &runtime)
|
|
112
125
|
eventDispatcher:bridge.eventDispatcher];
|
113
126
|
_operations = [NSMutableArray new];
|
114
127
|
|
115
|
-
#ifndef RCT_NEW_ARCH_ENABLED
|
116
128
|
[bridge.uiManager.observerCoordinator addObserver:self];
|
117
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
118
129
|
}
|
130
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
119
131
|
|
120
132
|
#ifdef RCT_NEW_ARCH_ENABLED
|
121
133
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
|
122
134
|
{
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
135
|
+
dispatch_block_t block = ^{
|
136
|
+
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)[RCTBridge currentBridge];
|
137
|
+
auto runtime = (jsi::Runtime *)cxxBridge.runtime;
|
138
|
+
decorateRuntime(*runtime);
|
139
|
+
};
|
140
|
+
if (_dispatchToJSThread) {
|
141
|
+
_dispatchToJSThread(block);
|
142
|
+
} else {
|
143
|
+
[[RCTBridge currentBridge] dispatchBlock:block queue:RCTJSThread];
|
144
|
+
}
|
130
145
|
|
131
146
|
return @true;
|
132
147
|
}
|
@@ -191,12 +206,11 @@ RCT_EXPORT_METHOD(flushOperations)
|
|
191
206
|
NSArray<GestureHandlerOperation> *operations = _operations;
|
192
207
|
_operations = [NSMutableArray new];
|
193
208
|
|
194
|
-
[self.
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
}];
|
209
|
+
[self.viewRegistry_DEPRECATED addUIBlock:^(RCTViewRegistry *viewRegistry) {
|
210
|
+
for (GestureHandlerOperation operation in operations) {
|
211
|
+
operation(self->_manager);
|
212
|
+
}
|
213
|
+
}];
|
200
214
|
#endif // RCT_NEW_ARCH_ENABLED
|
201
215
|
}
|
202
216
|
|
@@ -295,7 +309,7 @@ RCT_EXPORT_METHOD(flushOperations)
|
|
295
309
|
};
|
296
310
|
}
|
297
311
|
|
298
|
-
#if
|
312
|
+
#if RCT_NEW_ARCH_ENABLED
|
299
313
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
300
314
|
(const facebook::react::ObjCTurboModule::InitParams &)params
|
301
315
|
{
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.PointerType = void 0;
|
7
|
+
let PointerType;
|
8
|
+
exports.PointerType = PointerType;
|
9
|
+
|
10
|
+
(function (PointerType) {
|
11
|
+
PointerType[PointerType["TOUCH"] = 0] = "TOUCH";
|
12
|
+
PointerType[PointerType["STYLUS"] = 1] = "STYLUS";
|
13
|
+
PointerType[PointerType["MOUSE"] = 2] = "MOUSE";
|
14
|
+
PointerType[PointerType["OTHER"] = 3] = "OTHER";
|
15
|
+
})(PointerType || (exports.PointerType = PointerType = {}));
|
16
|
+
//# sourceMappingURL=PointerType.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["PointerType.ts"],"names":["PointerType"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum PointerType {\n TOUCH,\n STYLUS,\n MOUSE,\n OTHER,\n}\n"]}
|
@@ -7,6 +7,8 @@ exports.default = GestureHandlerRootView;
|
|
7
7
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
+
var _reactNative = require("react-native");
|
11
|
+
|
10
12
|
var _init = require("../init");
|
11
13
|
|
12
14
|
var _GestureHandlerRootViewContext = _interopRequireDefault(require("../GestureHandlerRootViewContext"));
|
@@ -19,13 +21,26 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
19
21
|
|
20
22
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
23
|
|
22
|
-
function
|
24
|
+
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); }
|
25
|
+
|
26
|
+
function GestureHandlerRootView({
|
27
|
+
style,
|
28
|
+
...rest
|
29
|
+
}) {
|
23
30
|
// try initialize fabric on the first render, at this point we can
|
24
31
|
// reliably check if fabric is enabled (the function contains a flag
|
25
32
|
// to make sure it's called only once)
|
26
33
|
(0, _init.maybeInitializeFabric)();
|
27
34
|
return /*#__PURE__*/React.createElement(_GestureHandlerRootViewContext.default.Provider, {
|
28
35
|
value: true
|
29
|
-
}, /*#__PURE__*/React.createElement(_RNGestureHandlerRootViewNativeComponent.default,
|
36
|
+
}, /*#__PURE__*/React.createElement(_RNGestureHandlerRootViewNativeComponent.default, _extends({
|
37
|
+
style: style !== null && style !== void 0 ? style : styles.container
|
38
|
+
}, rest)));
|
30
39
|
}
|
40
|
+
|
41
|
+
const styles = _reactNative.StyleSheet.create({
|
42
|
+
container: {
|
43
|
+
flex: 1
|
44
|
+
}
|
45
|
+
});
|
31
46
|
//# sourceMappingURL=GestureHandlerRootView.android.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GestureHandlerRootView.android.tsx"],"names":["GestureHandlerRootView","
|
1
|
+
{"version":3,"sources":["GestureHandlerRootView.android.tsx"],"names":["GestureHandlerRootView","style","rest","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAKe,SAASA,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B;AACA;AACA;AACA;AAEA,sBACE,oBAAC,sCAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,gDAAD;AACE,IAAA,KAAK,EAAED,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AADzB,KAEMF,IAFN,EADF,CADF;AAQD;;AAED,MAAMC,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AAAEG,IAAAA,IAAI,EAAE;AAAR;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport { ViewProps, StyleSheet } from 'react-native';\nimport { maybeInitializeFabric } from '../init';\nimport GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';\nimport GestureHandlerRootViewNativeComponent from '../specs/RNGestureHandlerRootViewNativeComponent';\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 <GestureHandlerRootViewNativeComponent\n style={style ?? styles.container}\n {...rest}\n />\n </GestureHandlerRootViewContext.Provider>\n );\n}\n\nconst styles = StyleSheet.create({\n container: { flex: 1 },\n});\n"]}
|
@@ -19,13 +19,26 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
19
19
|
|
20
20
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
21
|
|
22
|
-
function
|
22
|
+
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); }
|
23
|
+
|
24
|
+
function GestureHandlerRootView({
|
25
|
+
style,
|
26
|
+
...rest
|
27
|
+
}) {
|
23
28
|
// try initialize fabric on the first render, at this point we can
|
24
29
|
// reliably check if fabric is enabled (the function contains a flag
|
25
30
|
// to make sure it's called only once)
|
26
31
|
(0, _init.maybeInitializeFabric)();
|
27
32
|
return /*#__PURE__*/React.createElement(_GestureHandlerRootViewContext.default.Provider, {
|
28
33
|
value: true
|
29
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View,
|
34
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
35
|
+
style: style !== null && style !== void 0 ? style : styles.container
|
36
|
+
}, rest)));
|
30
37
|
}
|
38
|
+
|
39
|
+
const styles = _reactNative.StyleSheet.create({
|
40
|
+
container: {
|
41
|
+
flex: 1
|
42
|
+
}
|
43
|
+
});
|
31
44
|
//# sourceMappingURL=GestureHandlerRootView.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GestureHandlerRootView.tsx"],"names":["GestureHandlerRootView","
|
1
|
+
{"version":3,"sources":["GestureHandlerRootView.tsx"],"names":["GestureHandlerRootView","style","rest","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;;;AAKe,SAASA,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B;AACA;AACA;AACA;AAEA,sBACE,oBAAC,sCAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAED,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AAA7B,KAA4CF,IAA5C,EADF,CADF;AAKD;;AAED,MAAMC,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AAAEG,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"]}
|
@@ -17,9 +17,22 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
17
17
|
|
18
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
19
|
|
20
|
-
function
|
20
|
+
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); }
|
21
|
+
|
22
|
+
function GestureHandlerRootView({
|
23
|
+
style,
|
24
|
+
...rest
|
25
|
+
}) {
|
21
26
|
return /*#__PURE__*/React.createElement(_GestureHandlerRootViewContext.default.Provider, {
|
22
27
|
value: true
|
23
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View,
|
28
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
29
|
+
style: style !== null && style !== void 0 ? style : styles.container
|
30
|
+
}, rest)));
|
24
31
|
}
|
32
|
+
|
33
|
+
const styles = _reactNative.StyleSheet.create({
|
34
|
+
container: {
|
35
|
+
flex: 1
|
36
|
+
}
|
37
|
+
});
|
25
38
|
//# sourceMappingURL=GestureHandlerRootView.web.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GestureHandlerRootView.web.tsx"],"names":["GestureHandlerRootView","
|
1
|
+
{"version":3,"sources":["GestureHandlerRootView.web.tsx"],"names":["GestureHandlerRootView","style","rest","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;;;AAKe,SAASA,sBAAT,CAAgC;AAC7CC,EAAAA,KAD6C;AAE7C,KAAGC;AAF0C,CAAhC,EAGiB;AAC9B,sBACE,oBAAC,sCAAD,CAA+B,QAA/B;AAAwC,IAAA,KAAK;AAA7C,kBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAED,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAWE,MAAM,CAACC;AAA7B,KAA4CF,IAA5C,EADF,CADF;AAKD;;AAED,MAAMC,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AAAEG,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"]}
|
@@ -9,19 +9,36 @@ exports.getShadowNodeFromRef = getShadowNodeFromRef;
|
|
9
9
|
// on web due to the static resolution of `require` statements by webpack breaking
|
10
10
|
// the conditional importing. Solved by making .web file.
|
11
11
|
let findHostInstance_DEPRECATED;
|
12
|
+
let getInternalInstanceHandleFromPublicInstance;
|
12
13
|
|
13
14
|
function getShadowNodeFromRef(ref) {
|
14
15
|
// load findHostInstance_DEPRECATED lazily because it may not be available before render
|
15
16
|
if (findHostInstance_DEPRECATED === undefined) {
|
16
17
|
try {
|
17
|
-
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
19
|
+
findHostInstance_DEPRECATED = // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
|
18
20
|
require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
|
19
21
|
} catch (e) {
|
20
22
|
findHostInstance_DEPRECATED = _ref => null;
|
21
23
|
}
|
24
|
+
} // load findHostInstance_DEPRECATED lazily because it may not be available before render
|
25
|
+
|
26
|
+
|
27
|
+
if (getInternalInstanceHandleFromPublicInstance === undefined) {
|
28
|
+
try {
|
29
|
+
var _require$getInternalI;
|
30
|
+
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
32
|
+
getInternalInstanceHandleFromPublicInstance = // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
|
33
|
+
(_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
|
34
|
+
ref => ref._internalInstanceHandle;
|
35
|
+
} catch (e) {
|
36
|
+
getInternalInstanceHandleFromPublicInstance = ref => // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return
|
37
|
+
ref._internalInstanceHandle;
|
38
|
+
}
|
22
39
|
} // @ts-ignore Fabric
|
23
40
|
|
24
41
|
|
25
|
-
return findHostInstance_DEPRECATED(ref).
|
42
|
+
return getInternalInstanceHandleFromPublicInstance(findHostInstance_DEPRECATED(ref)).stateNode.node;
|
26
43
|
}
|
27
44
|
//# sourceMappingURL=getShadowNodeFromRef.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["getShadowNodeFromRef.ts"],"names":["findHostInstance_DEPRECATED","getShadowNodeFromRef","ref","undefined","require","e","_ref","_internalInstanceHandle","stateNode","node"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA,IAAIA,2BAAJ;;
|
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;;AAIO,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"]}
|
@@ -9,6 +9,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
10
10
|
var _reactNative = require("react-native");
|
11
11
|
|
12
|
+
var _ReactNativeViewConfigRegistry = require("react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry");
|
13
|
+
|
12
14
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
13
15
|
|
14
16
|
var _RNGestureHandlerModule = _interopRequireDefault(require("../RNGestureHandlerModule"));
|
@@ -40,6 +42,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
40
42
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
41
43
|
|
42
44
|
const UIManagerAny = _reactNative.UIManager;
|
45
|
+
_ReactNativeViewConfigRegistry.customDirectEventTypes.topGestureHandlerEvent = {
|
46
|
+
registrationName: 'onGestureHandlerEvent'
|
47
|
+
};
|
43
48
|
const customGHEventsConfigFabricAndroid = {
|
44
49
|
topOnGestureHandlerEvent: {
|
45
50
|
registrationName: 'onGestureHandlerEvent'
|