react-native-gesture-handler 2.12.0 → 2.13.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.
- package/RNGestureHandler.podspec +0 -15
- package/android/build.gradle +5 -76
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +16 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +43 -18
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +7 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +43 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +21 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +9 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +10 -0
- package/ios/Handlers/RNHoverHandler.h +12 -0
- package/ios/Handlers/RNHoverHandler.m +152 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +2 -0
- package/ios/RNGestureHandlerEvents.h +1 -0
- package/ios/RNGestureHandlerEvents.m +10 -0
- package/ios/RNGestureHandlerManager.mm +2 -0
- package/ios/RNManualActivationRecognizer.m +2 -1
- package/ios/RNRootViewGestureRecognizer.m +7 -2
- package/lib/commonjs/RNGestureHandlerModule.macos.js +3 -1
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +7 -2
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +3 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +1 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +1 -2
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +4 -4
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +4 -2
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +5 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +5 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +74 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -10
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +61 -88
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +62 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +6 -7
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +12 -4
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +2 -7
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -10
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +1 -1
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +18 -4
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +5 -7
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +118 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +38 -5
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/TouchEventManager.js +2 -2
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.macos.js +2 -1
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +6 -3
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +2 -1
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +1 -0
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +1 -2
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/handlers/createHandler.js +4 -4
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +3 -2
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +5 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +4 -0
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +62 -0
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -10
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +61 -84
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +47 -0
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js +5 -7
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +11 -4
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +2 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -10
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +1 -1
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +18 -4
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +5 -6
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +102 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +39 -6
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/TouchEventManager.js +2 -2
- package/lib/module/web/tools/TouchEventManager.js.map +1 -1
- package/lib/typescript/RNGestureHandlerModule.macos.d.ts +1 -1
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +3 -1
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +7 -1
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +3 -2
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +4 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -2
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +4 -5
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +1 -0
- package/lib/typescript/components/touchables/index.d.ts +3 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +3 -1
- package/lib/typescript/handlers/gestures/gesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +2 -0
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -6
- package/lib/typescript/web/handlers/GestureHandler.d.ts +12 -17
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -4
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -1
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -4
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -6
- package/lib/typescript/web/interfaces.d.ts +4 -3
- package/lib/typescript/web/tools/EventManager.d.ts +9 -5
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
- package/lib/typescript/web/tools/NodeManager.d.ts +2 -2
- package/lib/typescript/web/tools/PointerEventManager.d.ts +1 -1
- package/lib/typescript/web/tools/TouchEventManager.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.macos.ts +5 -1
- package/src/RNGestureHandlerModule.web.ts +7 -1
- package/src/RNGestureHandlerModule.windows.ts +5 -1
- package/src/components/DrawerLayout.tsx +9 -0
- package/src/components/touchables/GenericTouchable.tsx +4 -4
- package/src/components/touchables/TouchableHighlight.tsx +6 -3
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +5 -4
- package/src/components/touchables/TouchableOpacity.tsx +6 -7
- package/src/components/touchables/TouchableWithoutFeedback.tsx +3 -1
- package/src/components/touchables/index.ts +3 -0
- package/src/handlers/createHandler.tsx +5 -3
- package/src/handlers/gestureHandlerCommon.ts +39 -0
- package/src/handlers/gestures/GestureDetector.tsx +3 -1
- package/src/handlers/gestures/gesture.ts +6 -0
- package/src/handlers/gestures/gestureObjects.ts +5 -0
- package/src/handlers/gestures/hoverGesture.ts +83 -0
- package/src/index.ts +8 -0
- package/src/web/handlers/FlingGestureHandler.ts +0 -11
- package/src/web/handlers/GestureHandler.ts +68 -88
- package/src/web/handlers/HoverGestureHandler.ts +43 -0
- package/src/web/handlers/LongPressGestureHandler.ts +5 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +11 -4
- package/src/web/handlers/PanGestureHandler.ts +1 -6
- package/src/web/handlers/TapGestureHandler.ts +0 -11
- package/src/web/interfaces.ts +4 -2
- package/src/web/tools/EventManager.ts +15 -7
- package/src/web/tools/GestureHandlerDelegate.ts +23 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +7 -6
- package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
- package/src/web/tools/PointerEventManager.ts +46 -16
- package/src/web/tools/TouchEventManager.ts +3 -3
package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt
CHANGED
|
@@ -3,6 +3,7 @@ package com.swmansion.gesturehandler.react
|
|
|
3
3
|
import android.os.SystemClock
|
|
4
4
|
import android.util.Log
|
|
5
5
|
import android.view.MotionEvent
|
|
6
|
+
import android.view.View
|
|
6
7
|
import android.view.ViewGroup
|
|
7
8
|
import android.view.ViewParent
|
|
8
9
|
import com.facebook.react.bridge.ReactContext
|
|
@@ -58,7 +59,9 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
|
|
|
58
59
|
private inner class RootViewGestureHandler : GestureHandler<RootViewGestureHandler>() {
|
|
59
60
|
override fun onHandle(event: MotionEvent, sourceEvent: MotionEvent) {
|
|
60
61
|
val currentState = state
|
|
61
|
-
|
|
62
|
+
// we shouldn't stop intercepting events when there is an active handler already, which could happen when
|
|
63
|
+
// adding a new pointer to the screen after a handler activates
|
|
64
|
+
if (currentState == STATE_UNDETERMINED && (!shouldIntercept || orchestrator?.isAnyHandlerActive() != true)) {
|
|
62
65
|
begin()
|
|
63
66
|
shouldIntercept = false
|
|
64
67
|
}
|
|
@@ -76,6 +79,7 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
|
|
|
76
79
|
if (rootView is RootView) {
|
|
77
80
|
rootView.onChildStartedNativeGesture(event)
|
|
78
81
|
}
|
|
82
|
+
event.recycle()
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
@@ -117,6 +121,10 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
|
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
fun activateNativeHandlers(view: View) {
|
|
125
|
+
orchestrator?.activateNativeHandlersForView(view)
|
|
126
|
+
}
|
|
127
|
+
|
|
120
128
|
companion object {
|
|
121
129
|
private const val MIN_ALPHA_FOR_TOUCH = 0.1f
|
|
122
130
|
private fun findRootViewTag(viewGroup: ViewGroup): ViewGroup {
|
package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt
CHANGED
|
@@ -3,6 +3,7 @@ package com.swmansion.gesturehandler.react
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.util.Log
|
|
5
5
|
import android.view.MotionEvent
|
|
6
|
+
import android.view.View
|
|
6
7
|
import android.view.ViewGroup
|
|
7
8
|
import com.facebook.react.bridge.ReactContext
|
|
8
9
|
import com.facebook.react.bridge.UiThreadUtil
|
|
@@ -36,6 +37,11 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) {
|
|
|
36
37
|
true
|
|
37
38
|
} else super.dispatchTouchEvent(ev)
|
|
38
39
|
|
|
40
|
+
override fun dispatchGenericMotionEvent(event: MotionEvent) =
|
|
41
|
+
if (_enabled && rootHelper!!.dispatchTouchEvent(event)) {
|
|
42
|
+
true
|
|
43
|
+
} else super.dispatchTouchEvent(event)
|
|
44
|
+
|
|
39
45
|
override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {
|
|
40
46
|
if (_enabled) {
|
|
41
47
|
rootHelper!!.requestDisallowInterceptTouchEvent(disallowIntercept)
|
|
@@ -43,6 +49,10 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) {
|
|
|
43
49
|
super.requestDisallowInterceptTouchEvent(disallowIntercept)
|
|
44
50
|
}
|
|
45
51
|
|
|
52
|
+
fun activateNativeHandlers(view: View) {
|
|
53
|
+
rootHelper?.activateNativeHandlers(view)
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
companion object {
|
|
47
57
|
private fun hasGestureHandlerEnabledRootView(viewGroup: ViewGroup): Boolean {
|
|
48
58
|
UiThreadUtil.assertOnUiThread()
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNHoverHandler.m
|
|
3
|
+
// RNGestureHandler
|
|
4
|
+
//
|
|
5
|
+
// Created by Jakub Piasecki on 31/03/2023.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "RNHoverHandler.h"
|
|
9
|
+
|
|
10
|
+
#import <React/RCTConvert.h>
|
|
11
|
+
#import <UIKit/UIGestureRecognizerSubclass.h>
|
|
12
|
+
|
|
13
|
+
typedef NS_ENUM(NSInteger, RNGestureHandlerHoverEffect) {
|
|
14
|
+
RNGestureHandlerHoverEffectNone = 0,
|
|
15
|
+
RNGestureHandlerHoverEffectLift,
|
|
16
|
+
RNGestureHandlerHoverEffectHightlight,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
20
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
21
|
+
|
|
22
|
+
API_AVAILABLE(ios(13.4))
|
|
23
|
+
@interface RNBetterHoverGestureRecognizer : UIHoverGestureRecognizer <UIPointerInteractionDelegate>
|
|
24
|
+
|
|
25
|
+
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler;
|
|
26
|
+
|
|
27
|
+
@property (nonatomic) RNGestureHandlerHoverEffect hoverEffect;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@implementation RNBetterHoverGestureRecognizer {
|
|
32
|
+
__weak RNGestureHandler *_gestureHandler;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler
|
|
36
|
+
{
|
|
37
|
+
if ((self = [super initWithTarget:gestureHandler action:@selector(handleGesture:)])) {
|
|
38
|
+
_gestureHandler = gestureHandler;
|
|
39
|
+
_hoverEffect = RNGestureHandlerHoverEffectNone;
|
|
40
|
+
}
|
|
41
|
+
return self;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (void)triggerAction
|
|
45
|
+
{
|
|
46
|
+
[_gestureHandler handleGesture:self];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (void)cancel
|
|
50
|
+
{
|
|
51
|
+
self.enabled = NO;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region
|
|
55
|
+
{
|
|
56
|
+
if (interaction.view != nil && _hoverEffect != RNGestureHandlerHoverEffectNone) {
|
|
57
|
+
UITargetedPreview *preview = [[UITargetedPreview alloc] initWithView:interaction.view];
|
|
58
|
+
UIPointerEffect *effect = nil;
|
|
59
|
+
|
|
60
|
+
if (_hoverEffect == RNGestureHandlerHoverEffectLift) {
|
|
61
|
+
effect = [UIPointerLiftEffect effectWithPreview:preview];
|
|
62
|
+
} else if (_hoverEffect == RNGestureHandlerHoverEffectHightlight) {
|
|
63
|
+
effect = [UIPointerHoverEffect effectWithPreview:preview];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return [UIPointerStyle styleWithEffect:effect shape:nil];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return nil;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@end
|
|
73
|
+
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
@implementation RNHoverGestureHandler {
|
|
77
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
78
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
79
|
+
UIPointerInteraction *_pointerInteraction;
|
|
80
|
+
#endif
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (instancetype)initWithTag:(NSNumber *)tag
|
|
84
|
+
{
|
|
85
|
+
if ((self = [super initWithTag:tag])) {
|
|
86
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
87
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
88
|
+
if (@available(iOS 13.4, *)) {
|
|
89
|
+
_recognizer = [[RNBetterHoverGestureRecognizer alloc] initWithGestureHandler:self];
|
|
90
|
+
_pointerInteraction =
|
|
91
|
+
[[UIPointerInteraction alloc] initWithDelegate:(id<UIPointerInteractionDelegate>)_recognizer];
|
|
92
|
+
}
|
|
93
|
+
#endif
|
|
94
|
+
}
|
|
95
|
+
return self;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
- (void)bindToView:(UIView *)view
|
|
99
|
+
{
|
|
100
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
101
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
102
|
+
if (@available(iOS 13.4, *)) {
|
|
103
|
+
[super bindToView:view];
|
|
104
|
+
[view addInteraction:_pointerInteraction];
|
|
105
|
+
}
|
|
106
|
+
#endif
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
- (void)unbindFromView
|
|
110
|
+
{
|
|
111
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
112
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
113
|
+
if (@available(iOS 13.4, *)) {
|
|
114
|
+
[super unbindFromView];
|
|
115
|
+
[self.recognizer.view removeInteraction:_pointerInteraction];
|
|
116
|
+
}
|
|
117
|
+
#endif
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
- (void)resetConfig
|
|
121
|
+
{
|
|
122
|
+
[super resetConfig];
|
|
123
|
+
|
|
124
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
125
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
126
|
+
if (@available(iOS 13.4, *)) {
|
|
127
|
+
RNBetterHoverGestureRecognizer *recognizer = (RNBetterHoverGestureRecognizer *)_recognizer;
|
|
128
|
+
recognizer.hoverEffect = RNGestureHandlerHoverEffectNone;
|
|
129
|
+
}
|
|
130
|
+
#endif
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
- (void)configure:(NSDictionary *)config
|
|
134
|
+
{
|
|
135
|
+
[super configure:config];
|
|
136
|
+
|
|
137
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_4) && \
|
|
138
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_4
|
|
139
|
+
if (@available(iOS 13.4, *)) {
|
|
140
|
+
RNBetterHoverGestureRecognizer *recognizer = (RNBetterHoverGestureRecognizer *)_recognizer;
|
|
141
|
+
APPLY_INT_PROP(hoverEffect);
|
|
142
|
+
}
|
|
143
|
+
#endif
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
- (RNGestureHandlerEventExtraData *)eventExtraData:(UIGestureRecognizer *)recognizer
|
|
147
|
+
{
|
|
148
|
+
return [RNGestureHandlerEventExtraData forPosition:[recognizer locationInView:recognizer.view]
|
|
149
|
+
withAbsolutePosition:[recognizer locationInView:recognizer.view.window]];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@end
|
|
@@ -47,6 +47,8 @@ using namespace facebook::react;
|
|
|
47
47
|
|
|
48
48
|
_buttonView.userEnabled = newProps.enabled;
|
|
49
49
|
_buttonView.exclusiveTouch = newProps.exclusive;
|
|
50
|
+
_buttonView.hitTestEdgeInsets = UIEdgeInsetsMake(
|
|
51
|
+
-newProps.hitSlop.top, -newProps.hitSlop.left, -newProps.hitSlop.bottom, -newProps.hitSlop.right);
|
|
50
52
|
|
|
51
53
|
[super updateProps:props oldProps:oldProps];
|
|
52
54
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
- (instancetype)initWithData:(NSDictionary *)data;
|
|
14
14
|
|
|
15
|
+
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position withAbsolutePosition:(CGPoint)absolutePosition;
|
|
15
16
|
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position
|
|
16
17
|
withAbsolutePosition:(CGPoint)absolutePosition
|
|
17
18
|
withNumberOfTouches:(NSUInteger)numberOfTouches;
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
return self;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position withAbsolutePosition:(CGPoint)absolutePosition
|
|
16
|
+
{
|
|
17
|
+
return [[RNGestureHandlerEventExtraData alloc] initWithData:@{
|
|
18
|
+
@"x" : @(position.x),
|
|
19
|
+
@"y" : @(position.y),
|
|
20
|
+
@"absoluteX" : @(absolutePosition.x),
|
|
21
|
+
@"absoluteY" : @(absolutePosition.y)
|
|
22
|
+
}];
|
|
23
|
+
}
|
|
24
|
+
|
|
15
25
|
+ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position
|
|
16
26
|
withAbsolutePosition:(CGPoint)absolutePosition
|
|
17
27
|
withNumberOfTouches:(NSUInteger)numberOfTouches
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
#import "Handlers/RNFlingHandler.h"
|
|
28
28
|
#import "Handlers/RNForceTouchHandler.h"
|
|
29
|
+
#import "Handlers/RNHoverHandler.h"
|
|
29
30
|
#import "Handlers/RNLongPressHandler.h"
|
|
30
31
|
#import "Handlers/RNManualHandler.h"
|
|
31
32
|
#import "Handlers/RNNativeViewHandler.h"
|
|
@@ -83,6 +84,7 @@ constexpr int NEW_ARCH_NUMBER_OF_ATTACH_RETRIES = 25;
|
|
|
83
84
|
@"RotationGestureHandler" : [RNRotationGestureHandler class],
|
|
84
85
|
@"ForceTouchGestureHandler" : [RNForceTouchHandler class],
|
|
85
86
|
@"ManualGestureHandler" : [RNManualGestureHandler class],
|
|
87
|
+
@"HoverGestureHandler" : [RNHoverGestureHandler class],
|
|
86
88
|
};
|
|
87
89
|
});
|
|
88
90
|
|
|
@@ -57,8 +57,13 @@
|
|
|
57
57
|
- (BOOL)canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer
|
|
58
58
|
{
|
|
59
59
|
// When this method is called it means that one of handlers has activated, in this case we want
|
|
60
|
-
// to send an info to JS so that it cancells all JS responders
|
|
61
|
-
|
|
60
|
+
// to send an info to JS so that it cancells all JS responders, as long as the preventing
|
|
61
|
+
// recognizer is from Gesture Handler, otherwise we might break some interactions
|
|
62
|
+
RNGestureHandler *handler = [RNGestureHandler findGestureHandlerByRecognizer:preventingGestureRecognizer];
|
|
63
|
+
if (handler != nil) {
|
|
64
|
+
[self.delegate gestureRecognizer:preventingGestureRecognizer didActivateInViewWithTouchHandler:self.view];
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
return [super canBePreventedByGestureRecognizer:preventingGestureRecognizer];
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -43,6 +43,8 @@ var _RotationGestureHandler2 = _interopRequireDefault(require("./web_hammer/Rota
|
|
|
43
43
|
|
|
44
44
|
var _FlingGestureHandler2 = _interopRequireDefault(require("./web_hammer/FlingGestureHandler"));
|
|
45
45
|
|
|
46
|
+
var _GestureHandlerWebDelegate = require("./web/tools/GestureHandlerWebDelegate");
|
|
47
|
+
|
|
46
48
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
47
49
|
|
|
48
50
|
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; }
|
|
@@ -87,7 +89,7 @@ var _default = {
|
|
|
87
89
|
|
|
88
90
|
const GestureClass = Gestures[handlerName];
|
|
89
91
|
|
|
90
|
-
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
|
92
|
+
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass(new _GestureHandlerWebDelegate.GestureHandlerWebDelegate()));
|
|
91
93
|
|
|
92
94
|
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
|
93
95
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.macos.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.macos.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","GestureHandlerWebDelegate","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"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","sourcesContent":["import { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(_tag: number, _blockNativeResponder: boolean) {\n // NO-OP\n },\n handleClearJSResponder() {\n // NO-OP\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isNewWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(\n handlerTag,\n new GestureClass(new GestureHandlerWebDelegate())\n );\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n config as unknown as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config as unknown as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n newView: number,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
|
|
@@ -29,6 +29,8 @@ var _NativeViewGestureHandler = _interopRequireDefault(require("./web/handlers/N
|
|
|
29
29
|
|
|
30
30
|
var _ManualGestureHandler = _interopRequireDefault(require("./web/handlers/ManualGestureHandler"));
|
|
31
31
|
|
|
32
|
+
var _HoverGestureHandler = _interopRequireDefault(require("./web/handlers/HoverGestureHandler"));
|
|
33
|
+
|
|
32
34
|
var HammerNodeManager = _interopRequireWildcard(require("./web_hammer/NodeManager"));
|
|
33
35
|
|
|
34
36
|
var _NativeViewGestureHandler2 = _interopRequireDefault(require("./web_hammer/NativeViewGestureHandler"));
|
|
@@ -45,6 +47,8 @@ var _RotationGestureHandler2 = _interopRequireDefault(require("./web_hammer/Rota
|
|
|
45
47
|
|
|
46
48
|
var _FlingGestureHandler2 = _interopRequireDefault(require("./web_hammer/FlingGestureHandler"));
|
|
47
49
|
|
|
50
|
+
var _GestureHandlerWebDelegate = require("./web/tools/GestureHandlerWebDelegate");
|
|
51
|
+
|
|
48
52
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
49
53
|
|
|
50
54
|
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; }
|
|
@@ -61,7 +65,8 @@ const Gestures = {
|
|
|
61
65
|
PinchGestureHandler: _PinchGestureHandler.default,
|
|
62
66
|
RotationGestureHandler: _RotationGestureHandler.default,
|
|
63
67
|
FlingGestureHandler: _FlingGestureHandler.default,
|
|
64
|
-
ManualGestureHandler: _ManualGestureHandler.default
|
|
68
|
+
ManualGestureHandler: _ManualGestureHandler.default,
|
|
69
|
+
HoverGestureHandler: _HoverGestureHandler.default
|
|
65
70
|
};
|
|
66
71
|
exports.Gestures = Gestures;
|
|
67
72
|
const HammerGestures = {
|
|
@@ -91,7 +96,7 @@ var _default = {
|
|
|
91
96
|
|
|
92
97
|
const GestureClass = Gestures[handlerName];
|
|
93
98
|
|
|
94
|
-
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
|
99
|
+
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass(new _GestureHandlerWebDelegate.GestureHandlerWebDelegate()));
|
|
95
100
|
|
|
96
101
|
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
|
97
102
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HoverGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","GestureHandlerWebDelegate","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"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","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\nimport HoverGestureHandler from './web/handlers/HoverGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n HoverGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(tag: number, blockNativeResponder: boolean) {\n console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isNewWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(\n handlerTag,\n new GestureClass(new GestureHandlerWebDelegate())\n );\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n config as unknown as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config as unknown as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (\n !(newView instanceof HTMLElement || newView instanceof React.Component)\n ) {\n return;\n }\n\n if (isNewWebImplementationEnabled()) {\n //@ts-ignore Types should be HTMLElement or React.Component\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n //@ts-ignore Types should be HTMLElement or React.Component\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
|
|
@@ -45,6 +45,8 @@ var _RotationGestureHandler2 = _interopRequireDefault(require("./web_hammer/Rota
|
|
|
45
45
|
|
|
46
46
|
var _FlingGestureHandler2 = _interopRequireDefault(require("./web_hammer/FlingGestureHandler"));
|
|
47
47
|
|
|
48
|
+
var _GestureHandlerWebDelegate = require("./web/tools/GestureHandlerWebDelegate");
|
|
49
|
+
|
|
48
50
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
49
51
|
|
|
50
52
|
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; }
|
|
@@ -89,7 +91,7 @@ var _default = {
|
|
|
89
91
|
|
|
90
92
|
const GestureClass = Gestures[handlerName];
|
|
91
93
|
|
|
92
|
-
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
|
94
|
+
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass(new _GestureHandlerWebDelegate.GestureHandlerWebDelegate()));
|
|
93
95
|
|
|
94
96
|
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
|
95
97
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.windows.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.windows.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","GestureHandlerWebDelegate","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":"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","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isNewWebImplementationEnabled } from './EnableNewWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\nimport { GestureHandlerWebDelegate } from './web/tools/GestureHandlerWebDelegate';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(_tag: number, _blockNativeResponder: boolean) {\n // NO-OP\n },\n handleClearJSResponder() {\n // NO-OP\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isNewWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(\n handlerTag,\n new GestureClass(new GestureHandlerWebDelegate())\n );\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n config as unknown as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, config as unknown as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (\n !(newView instanceof HTMLElement || newView instanceof React.Component)\n ) {\n return;\n }\n\n if (isNewWebImplementationEnabled()) {\n //@ts-ignore Types should be HTMLElement or React.Component\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n //@ts-ignore Types should be HTMLElement or React.Component\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isNewWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
|
|
@@ -511,6 +511,7 @@ class DrawerLayout extends React.Component {
|
|
|
511
511
|
return /*#__PURE__*/React.createElement(_PanGestureHandler.PanGestureHandler // @ts-ignore could be fixed in handler types
|
|
512
512
|
, {
|
|
513
513
|
userSelect: this.props.userSelect,
|
|
514
|
+
activeCursor: this.props.activeCursor,
|
|
514
515
|
ref: this.setPanGestureRef,
|
|
515
516
|
hitSlop: hitSlop,
|
|
516
517
|
activeOffsetX: gestureOrientation * minSwipeDistance,
|