react-native-gesture-handler 2.22.1 → 2.23.1
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 +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
- package/android/src/main/jni/cpp-adapter.cpp +19 -12
- package/apple/RNGestureHandler.mm +15 -8
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/apple/RNGestureHandlerModule.mm +17 -5
- package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +6 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +11 -2
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +21 -5
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +49 -20
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +10 -4
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +2 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +2 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +2 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +3 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +9 -1
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +8 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +5 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +8 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +8 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +8 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +8 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +8 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +8 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +6 -2
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +7 -2
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +3 -3
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +22 -22
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +24 -24
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +6 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +112 -92
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +2 -2
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +6 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +13 -13
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +15 -15
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +15 -15
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +12 -12
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +4 -4
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -15
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +40 -40
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +32 -13
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +16 -18
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +2 -2
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +18 -18
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +2 -2
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +7 -0
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +10 -2
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +22 -6
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +49 -20
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Text.js +8 -3
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +2 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +2 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +5 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +4 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +8 -1
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +7 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +5 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +7 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +7 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +7 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +11 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +11 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +7 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +9 -4
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +6 -3
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +2 -2
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +22 -22
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +24 -24
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +6 -6
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +112 -92
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +2 -2
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +6 -6
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +13 -13
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +15 -15
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +15 -15
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +12 -12
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +4 -4
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +15 -15
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +40 -40
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +32 -13
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +16 -16
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +2 -2
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +18 -18
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +1 -1
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +27 -0
- package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
- package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
- package/lib/typescript/components/Pressable/index.d.ts +1 -1
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
- package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
- package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
- package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
- package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
- package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +29 -0
- package/src/components/GestureButtons.tsx +13 -2
- package/src/components/GestureButtonsProps.ts +31 -2
- package/src/components/Pressable/Pressable.tsx +22 -5
- package/src/components/Pressable/PressableProps.tsx +4 -11
- package/src/components/Pressable/index.ts +4 -1
- package/src/components/ReanimatedSwipeable.tsx +97 -66
- package/src/components/Text.tsx +13 -4
- package/src/components/touchables/TouchableHighlight.tsx +5 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +5 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
- package/src/findNodeHandle.web.ts +6 -0
- package/src/handlers/FlingGestureHandler.ts +10 -0
- package/src/handlers/ForceTouchGestureHandler.ts +9 -0
- package/src/handlers/LongPressGestureHandler.ts +10 -0
- package/src/handlers/NativeViewGestureHandler.ts +10 -0
- package/src/handlers/PanGestureHandler.ts +10 -0
- package/src/handlers/PinchGestureHandler.ts +10 -0
- package/src/handlers/RotationGestureHandler.ts +10 -0
- package/src/handlers/TapGestureHandler.ts +10 -0
- package/src/handlers/createHandler.tsx +11 -4
- package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
- package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
- package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
- package/src/handlers/handlersRegistry.ts +7 -3
- package/src/index.ts +4 -1
- package/src/utils.ts +2 -2
- package/src/web/detectors/RotationGestureDetector.ts +22 -22
- package/src/web/detectors/ScaleGestureDetector.ts +24 -24
- package/src/web/handlers/FlingGestureHandler.ts +6 -7
- package/src/web/handlers/GestureHandler.ts +115 -105
- package/src/web/handlers/HoverGestureHandler.ts +2 -2
- package/src/web/handlers/IGestureHandler.ts +12 -13
- package/src/web/handlers/LongPressGestureHandler.ts +7 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
- package/src/web/handlers/PanGestureHandler.ts +17 -17
- package/src/web/handlers/PinchGestureHandler.ts +17 -21
- package/src/web/handlers/RotationGestureHandler.ts +12 -12
- package/src/web/handlers/TapGestureHandler.ts +4 -6
- package/src/web/tools/CircularBuffer.ts +15 -15
- package/src/web/tools/GestureHandlerDelegate.ts +1 -1
- package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
- package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
- package/src/web/tools/InteractionManager.ts +16 -16
- package/src/web/tools/NodeManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +20 -20
- package/src/web/tools/Vector.ts +1 -1
- package/src/web/tools/VelocityTracker.ts +1 -1
@@ -18,12 +18,15 @@ import type {
|
|
18
18
|
BorderlessButtonWithRefProps,
|
19
19
|
BorderlessButtonProps,
|
20
20
|
} from './GestureButtonsProps';
|
21
|
+
import { isFabric } from '../utils';
|
21
22
|
|
22
23
|
export const RawButton = createNativeWrapper(GestureHandlerButton, {
|
23
24
|
shouldCancelWhenOutside: false,
|
24
25
|
shouldActivateOnStart: false,
|
25
26
|
});
|
26
27
|
|
28
|
+
let IS_FABRIC: null | boolean = null;
|
29
|
+
|
27
30
|
class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
|
28
31
|
static defaultProps = {
|
29
32
|
delayLongPress: 600,
|
@@ -120,12 +123,20 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
|
|
120
123
|
};
|
121
124
|
|
122
125
|
render() {
|
123
|
-
const { rippleColor, style, ...rest } = this.props;
|
126
|
+
const { rippleColor: unprocessedRippleColor, style, ...rest } = this.props;
|
127
|
+
|
128
|
+
if (IS_FABRIC === null) {
|
129
|
+
IS_FABRIC = isFabric();
|
130
|
+
}
|
131
|
+
|
132
|
+
const rippleColor = IS_FABRIC
|
133
|
+
? unprocessedRippleColor
|
134
|
+
: processColor(unprocessedRippleColor ?? undefined);
|
124
135
|
|
125
136
|
return (
|
126
137
|
<RawButton
|
127
138
|
ref={this.props.innerRef}
|
128
|
-
rippleColor={
|
139
|
+
rippleColor={rippleColor}
|
129
140
|
style={[style, Platform.OS === 'ios' && { cursor: undefined }]}
|
130
141
|
{...rest}
|
131
142
|
onGestureEvent={this.onGestureEvent}
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
AccessibilityProps,
|
4
|
+
ColorValue,
|
5
|
+
StyleProp,
|
6
|
+
ViewStyle,
|
7
|
+
} from 'react-native';
|
3
8
|
import type { NativeViewGestureHandlerProps } from '../handlers/NativeViewGestureHandler';
|
4
9
|
|
5
10
|
export interface RawButtonProps
|
@@ -16,7 +21,7 @@ export interface RawButtonProps
|
|
16
21
|
*
|
17
22
|
* Defines color of native ripple animation used since API level 21.
|
18
23
|
*/
|
19
|
-
rippleColor?:
|
24
|
+
rippleColor?: number | ColorValue | null;
|
20
25
|
|
21
26
|
/**
|
22
27
|
* Android only.
|
@@ -50,6 +55,30 @@ export interface RawButtonProps
|
|
50
55
|
* Style object, use it to set additional styles.
|
51
56
|
*/
|
52
57
|
style?: StyleProp<ViewStyle>;
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Used for testing-library compatibility, not passed to the native component.
|
61
|
+
*/
|
62
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
63
|
+
testOnly_onPress?: Function | null;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Used for testing-library compatibility, not passed to the native component.
|
67
|
+
*/
|
68
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
69
|
+
testOnly_onPressIn?: Function | null;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Used for testing-library compatibility, not passed to the native component.
|
73
|
+
*/
|
74
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
75
|
+
testOnly_onPressOut?: Function | null;
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Used for testing-library compatibility, not passed to the native component.
|
79
|
+
*/
|
80
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
81
|
+
testOnly_onLongPress?: Function | null;
|
53
82
|
}
|
54
83
|
interface ButtonWithRefProps {
|
55
84
|
innerRef?: React.ForwardedRef<React.ComponentType<any>>;
|
@@ -20,9 +20,12 @@ import {
|
|
20
20
|
} from './utils';
|
21
21
|
import { PressabilityDebugView } from '../../handlers/PressabilityDebugView';
|
22
22
|
import { GestureTouchEvent } from '../../handlers/gestureHandlerCommon';
|
23
|
-
import { INT32_MAX } from '../../utils';
|
23
|
+
import { INT32_MAX, isFabric, isTestEnv } from '../../utils';
|
24
24
|
|
25
25
|
const DEFAULT_LONG_PRESS_DURATION = 500;
|
26
|
+
const IS_TEST_ENV = isTestEnv();
|
27
|
+
|
28
|
+
let IS_FABRIC: null | boolean = null;
|
26
29
|
|
27
30
|
export default function Pressable(props: PressableProps) {
|
28
31
|
const {
|
@@ -366,8 +369,6 @@ export default function Pressable(props: PressableProps) {
|
|
366
369
|
|
367
370
|
const gesture = Gesture.Simultaneous(...gestures);
|
368
371
|
|
369
|
-
const defaultRippleColor = android_ripple ? undefined : 'transparent';
|
370
|
-
|
371
372
|
// `cursor: 'pointer'` on `RNButton` crashes iOS
|
372
373
|
const pointerStyle: StyleProp<ViewStyle> =
|
373
374
|
Platform.OS === 'web' ? { cursor: 'pointer' } : {};
|
@@ -380,6 +381,18 @@ export default function Pressable(props: PressableProps) {
|
|
380
381
|
? children({ pressed: pressedState })
|
381
382
|
: children;
|
382
383
|
|
384
|
+
const rippleColor = useMemo(() => {
|
385
|
+
if (IS_FABRIC === null) {
|
386
|
+
IS_FABRIC = isFabric();
|
387
|
+
}
|
388
|
+
|
389
|
+
const defaultRippleColor = android_ripple ? undefined : 'transparent';
|
390
|
+
const unprocessedRippleColor = android_ripple?.color ?? defaultRippleColor;
|
391
|
+
return IS_FABRIC
|
392
|
+
? unprocessedRippleColor
|
393
|
+
: processColor(unprocessedRippleColor);
|
394
|
+
}, [android_ripple]);
|
395
|
+
|
383
396
|
return (
|
384
397
|
<GestureDetector gesture={gesture}>
|
385
398
|
<NativeButton
|
@@ -388,9 +401,13 @@ export default function Pressable(props: PressableProps) {
|
|
388
401
|
hitSlop={appliedHitSlop}
|
389
402
|
enabled={isPressableEnabled}
|
390
403
|
touchSoundDisabled={android_disableSound ?? undefined}
|
391
|
-
rippleColor={
|
404
|
+
rippleColor={rippleColor}
|
392
405
|
rippleRadius={android_ripple?.radius ?? undefined}
|
393
|
-
style={[pointerStyle, styleProp]}
|
406
|
+
style={[pointerStyle, styleProp]}
|
407
|
+
testOnly_onPress={IS_TEST_ENV ? onPress : undefined}
|
408
|
+
testOnly_onPressIn={IS_TEST_ENV ? onPressIn : undefined}
|
409
|
+
testOnly_onPressOut={IS_TEST_ENV ? onPressOut : undefined}
|
410
|
+
testOnly_onLongPress={IS_TEST_ENV ? onLongPress : undefined}>
|
394
411
|
{childrenProp}
|
395
412
|
{__DEV__ ? (
|
396
413
|
<PressabilityDebugView color="red" hitSlop={normalizedHitSlop} />
|
@@ -1,22 +1,15 @@
|
|
1
1
|
import {
|
2
|
-
ColorValue,
|
3
2
|
AccessibilityProps,
|
4
3
|
ViewProps,
|
5
4
|
Insets,
|
6
5
|
StyleProp,
|
7
6
|
ViewStyle,
|
7
|
+
PressableStateCallbackType as RNPressableStateCallbackType,
|
8
|
+
PressableAndroidRippleConfig as RNPressableAndroidRippleConfig,
|
8
9
|
} from 'react-native';
|
9
10
|
|
10
|
-
export
|
11
|
-
|
12
|
-
}
|
13
|
-
|
14
|
-
export interface PressableAndroidRippleConfig {
|
15
|
-
color?: null | ColorValue | undefined;
|
16
|
-
borderless?: null | boolean | undefined;
|
17
|
-
radius?: null | number | undefined;
|
18
|
-
foreground?: null | boolean | undefined;
|
19
|
-
}
|
11
|
+
export type PressableStateCallbackType = RNPressableStateCallbackType;
|
12
|
+
export type PressableAndroidRippleConfig = RNPressableAndroidRippleConfig;
|
20
13
|
|
21
14
|
export type InnerPressableEvent = {
|
22
15
|
changedTouches: InnerPressableEvent[];
|
@@ -9,6 +9,7 @@ import React, {
|
|
9
9
|
useImperativeHandle,
|
10
10
|
useMemo,
|
11
11
|
} from 'react';
|
12
|
+
import { GestureRef } from '../handlers/gestures/gesture';
|
12
13
|
import { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';
|
13
14
|
import { GestureDetector } from '../handlers/gestures/GestureDetector';
|
14
15
|
import {
|
@@ -202,6 +203,14 @@ export interface SwipeableProps
|
|
202
203
|
* apply `flex: 1`
|
203
204
|
*/
|
204
205
|
childrenContainerStyle?: StyleProp<ViewStyle>;
|
206
|
+
|
207
|
+
/**
|
208
|
+
* A gesture object or an array of gesture objects containing the configuration and callbacks to be
|
209
|
+
* used with the swipeable's gesture handler.
|
210
|
+
*/
|
211
|
+
simultaneousWithExternalGesture?:
|
212
|
+
| Exclude<GestureRef, number>
|
213
|
+
| Exclude<GestureRef, number>[];
|
205
214
|
}
|
206
215
|
|
207
216
|
export interface SwipeableMethods {
|
@@ -247,6 +256,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableProps>(
|
|
247
256
|
onSwipeableClose,
|
248
257
|
renderLeftActions,
|
249
258
|
renderRightActions,
|
259
|
+
simultaneousWithExternalGesture,
|
250
260
|
...remainingProps
|
251
261
|
} = props;
|
252
262
|
|
@@ -456,7 +466,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableProps>(
|
|
456
466
|
rightLayoutRef,
|
457
467
|
leftWidth,
|
458
468
|
rightWidth,
|
459
|
-
rowWidth
|
469
|
+
rowWidth,
|
460
470
|
]);
|
461
471
|
|
462
472
|
const swipeableMethods = useMemo<SwipeableMethods>(
|
@@ -635,73 +645,94 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableProps>(
|
|
635
645
|
|
636
646
|
const dragStarted = useSharedValue<boolean>(false);
|
637
647
|
|
638
|
-
const tapGesture = useMemo(
|
639
|
-
()
|
640
|
-
|
641
|
-
|
642
|
-
.
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
()
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
648
|
+
const tapGesture = useMemo(() => {
|
649
|
+
const tap = Gesture.Tap()
|
650
|
+
.shouldCancelWhenOutside(true)
|
651
|
+
.onStart(() => {
|
652
|
+
if (rowState.value !== 0) {
|
653
|
+
close();
|
654
|
+
}
|
655
|
+
});
|
656
|
+
|
657
|
+
if (!simultaneousWithExternalGesture) {
|
658
|
+
return tap;
|
659
|
+
}
|
660
|
+
|
661
|
+
if (Array.isArray(simultaneousWithExternalGesture)) {
|
662
|
+
tap.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);
|
663
|
+
} else {
|
664
|
+
tap.simultaneousWithExternalGesture(simultaneousWithExternalGesture);
|
665
|
+
}
|
666
|
+
|
667
|
+
return tap;
|
668
|
+
}, [close, rowState, simultaneousWithExternalGesture]);
|
669
|
+
|
670
|
+
const panGesture = useMemo(() => {
|
671
|
+
const pan = Gesture.Pan()
|
672
|
+
.enabled(enabled !== false)
|
673
|
+
.enableTrackpadTwoFingerGesture(enableTrackpadTwoFingerGesture)
|
674
|
+
.activeOffsetX([-dragOffsetFromRightEdge, dragOffsetFromLeftEdge])
|
675
|
+
.onStart(updateElementWidths)
|
676
|
+
.onUpdate(
|
677
|
+
(event: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {
|
678
|
+
userDrag.value = event.translationX;
|
679
|
+
|
680
|
+
const direction =
|
681
|
+
rowState.value === -1
|
682
|
+
? SwipeDirection.RIGHT
|
683
|
+
: rowState.value === 1
|
684
|
+
? SwipeDirection.LEFT
|
685
|
+
: event.translationX > 0
|
686
|
+
? SwipeDirection.RIGHT
|
687
|
+
: SwipeDirection.LEFT;
|
688
|
+
|
689
|
+
if (!dragStarted.value) {
|
690
|
+
dragStarted.value = true;
|
691
|
+
if (rowState.value === 0 && onSwipeableOpenStartDrag) {
|
692
|
+
runOnJS(onSwipeableOpenStartDrag)(direction);
|
693
|
+
} else if (onSwipeableCloseStartDrag) {
|
694
|
+
runOnJS(onSwipeableCloseStartDrag)(direction);
|
677
695
|
}
|
678
|
-
|
679
|
-
updateAnimatedEvent();
|
680
|
-
}
|
681
|
-
)
|
682
|
-
.onEnd(
|
683
|
-
(event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {
|
684
|
-
handleRelease(event);
|
685
696
|
}
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
697
|
+
|
698
|
+
updateAnimatedEvent();
|
699
|
+
}
|
700
|
+
)
|
701
|
+
.onEnd(
|
702
|
+
(event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {
|
703
|
+
handleRelease(event);
|
704
|
+
}
|
705
|
+
)
|
706
|
+
.onFinalize(() => {
|
707
|
+
dragStarted.value = false;
|
708
|
+
});
|
709
|
+
|
710
|
+
if (!simultaneousWithExternalGesture) {
|
711
|
+
return pan;
|
712
|
+
}
|
713
|
+
|
714
|
+
if (Array.isArray(simultaneousWithExternalGesture)) {
|
715
|
+
pan.simultaneousWithExternalGesture(...simultaneousWithExternalGesture);
|
716
|
+
} else {
|
717
|
+
pan.simultaneousWithExternalGesture(simultaneousWithExternalGesture);
|
718
|
+
}
|
719
|
+
|
720
|
+
return pan;
|
721
|
+
}, [
|
722
|
+
dragOffsetFromLeftEdge,
|
723
|
+
dragOffsetFromRightEdge,
|
724
|
+
dragStarted,
|
725
|
+
enableTrackpadTwoFingerGesture,
|
726
|
+
enabled,
|
727
|
+
handleRelease,
|
728
|
+
onSwipeableCloseStartDrag,
|
729
|
+
onSwipeableOpenStartDrag,
|
730
|
+
rowState,
|
731
|
+
updateAnimatedEvent,
|
732
|
+
updateElementWidths,
|
733
|
+
userDrag,
|
734
|
+
simultaneousWithExternalGesture,
|
735
|
+
]);
|
705
736
|
|
706
737
|
useImperativeHandle(ref, () => swipeableMethods, [swipeableMethods]);
|
707
738
|
|
package/src/components/Text.tsx
CHANGED
@@ -11,11 +11,13 @@ import {
|
|
11
11
|
TextProps as RNTextProps,
|
12
12
|
} from 'react-native';
|
13
13
|
|
14
|
-
import { Gesture
|
14
|
+
import { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';
|
15
|
+
import { GestureDetector } from '../handlers/gestures/GestureDetector';
|
15
16
|
|
16
17
|
export const Text = forwardRef(
|
17
18
|
(props: RNTextProps, ref: ForwardedRef<RNText>) => {
|
18
|
-
const { onPress, ...rest } = props;
|
19
|
+
const { onPress, onLongPress, ...rest } = props;
|
20
|
+
|
19
21
|
const textRef = useRef<RNText | null>(null);
|
20
22
|
const native = Gesture.Native().runOnJS(true);
|
21
23
|
|
@@ -49,10 +51,17 @@ export const Text = forwardRef(
|
|
49
51
|
);
|
50
52
|
}, []);
|
51
53
|
|
52
|
-
return (
|
54
|
+
return onPress || onLongPress ? (
|
53
55
|
<GestureDetector gesture={native}>
|
54
|
-
<RNText
|
56
|
+
<RNText
|
57
|
+
onPress={onPress}
|
58
|
+
onLongPress={onLongPress}
|
59
|
+
ref={refHandler}
|
60
|
+
{...rest}
|
61
|
+
/>
|
55
62
|
</GestureDetector>
|
63
|
+
) : (
|
64
|
+
<RNText ref={ref} {...rest} />
|
56
65
|
);
|
57
66
|
}
|
58
67
|
);
|
@@ -19,10 +19,15 @@ interface State {
|
|
19
19
|
};
|
20
20
|
}
|
21
21
|
|
22
|
+
/**
|
23
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
24
|
+
*/
|
22
25
|
export type TouchableHighlightProps = RNTouchableHighlightProps &
|
23
26
|
GenericTouchableProps;
|
24
27
|
|
25
28
|
/**
|
29
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
30
|
+
*
|
26
31
|
* TouchableHighlight follows RN's implementation
|
27
32
|
*/
|
28
33
|
export default class TouchableHighlight extends Component<
|
@@ -8,6 +8,8 @@ import {
|
|
8
8
|
} from './TouchableNativeFeedbackProps';
|
9
9
|
|
10
10
|
/**
|
11
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
12
|
+
*
|
11
13
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
12
14
|
* There's small difference with handling long press ripple since RN's implementation calls
|
13
15
|
* ripple animation via bridge. This solution leaves all animations' handling for native components so
|
@@ -1,3 +1,8 @@
|
|
1
|
-
import { TouchableNativeFeedback } from 'react-native';
|
1
|
+
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
5
|
+
*/
|
6
|
+
const TouchableNativeFeedback = RNTouchableNativeFeedback;
|
2
7
|
|
3
8
|
export default TouchableNativeFeedback;
|
@@ -8,5 +8,8 @@ export type TouchableNativeFeedbackExtraProps = {
|
|
8
8
|
foreground?: boolean;
|
9
9
|
};
|
10
10
|
|
11
|
+
/**
|
12
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
13
|
+
*/
|
11
14
|
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &
|
12
15
|
GenericTouchableProps;
|
@@ -10,12 +10,17 @@ import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
10
10
|
import * as React from 'react';
|
11
11
|
import { Component } from 'react';
|
12
12
|
|
13
|
+
/**
|
14
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
15
|
+
*/
|
13
16
|
export type TouchableOpacityProps = RNTouchableOpacityProps &
|
14
17
|
GenericTouchableProps & {
|
15
18
|
useNativeAnimations?: boolean;
|
16
19
|
};
|
17
20
|
|
18
21
|
/**
|
22
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
23
|
+
*
|
19
24
|
* TouchableOpacity bases on timing animation which has been used in RN's core
|
20
25
|
*/
|
21
26
|
export default class TouchableOpacity extends Component<TouchableOpacityProps> {
|
@@ -3,8 +3,14 @@ import { PropsWithChildren } from 'react';
|
|
3
3
|
import GenericTouchable from './GenericTouchable';
|
4
4
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
5
5
|
|
6
|
+
/**
|
7
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
8
|
+
*/
|
6
9
|
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
7
10
|
|
11
|
+
/**
|
12
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
13
|
+
*/
|
8
14
|
const TouchableWithoutFeedback = React.forwardRef<
|
9
15
|
GenericTouchable,
|
10
16
|
PropsWithChildren<TouchableWithoutFeedbackProps>
|
@@ -1,9 +1,15 @@
|
|
1
|
+
import { FlatList } from 'react-native';
|
1
2
|
import type { GestureHandlerRef, SVGRef } from './web/interfaces';
|
2
3
|
import { isRNSVGElement } from './web/utils';
|
3
4
|
|
4
5
|
export default function findNodeHandle(
|
5
6
|
viewRef: GestureHandlerRef | SVGRef | HTMLElement | SVGElement
|
6
7
|
): HTMLElement | SVGElement | number {
|
8
|
+
// TODO: Remove this once we remove old API.
|
9
|
+
if (viewRef instanceof FlatList) {
|
10
|
+
// @ts-ignore This is the only way to get the scroll ref from FlatList.
|
11
|
+
return viewRef._listRef._scrollRef.firstChild;
|
12
|
+
}
|
7
13
|
// Old API assumes that child handler is HTMLElement.
|
8
14
|
// However, if we nest handlers, we will get ref to another handler.
|
9
15
|
// In that case, we want to recursively call findNodeHandle with new handler viewTag (which can also be ref to another handler).
|
@@ -33,13 +33,23 @@ export interface FlingGestureConfig {
|
|
33
33
|
numberOfPointers?: number;
|
34
34
|
}
|
35
35
|
|
36
|
+
/**
|
37
|
+
* @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.
|
38
|
+
*/
|
36
39
|
export interface FlingGestureHandlerProps
|
37
40
|
extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>,
|
38
41
|
FlingGestureConfig {}
|
39
42
|
|
40
43
|
export const flingHandlerName = 'FlingGestureHandler';
|
41
44
|
|
45
|
+
/**
|
46
|
+
* @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.
|
47
|
+
*/
|
42
48
|
export type FlingGestureHandler = typeof FlingGestureHandler;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.
|
52
|
+
*/
|
43
53
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
44
54
|
export const FlingGestureHandler = createHandler<
|
45
55
|
FlingGestureHandlerProps,
|
@@ -50,16 +50,25 @@ export interface ForceTouchGestureConfig {
|
|
50
50
|
feedbackOnActivation?: boolean;
|
51
51
|
}
|
52
52
|
|
53
|
+
/**
|
54
|
+
* @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.
|
55
|
+
*/
|
53
56
|
export interface ForceTouchGestureHandlerProps
|
54
57
|
extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>,
|
55
58
|
ForceTouchGestureConfig {}
|
56
59
|
|
60
|
+
/**
|
61
|
+
* @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.
|
62
|
+
*/
|
57
63
|
export type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {
|
58
64
|
forceTouchAvailable: boolean;
|
59
65
|
};
|
60
66
|
|
61
67
|
export const forceTouchHandlerName = 'ForceTouchGestureHandler';
|
62
68
|
|
69
|
+
/**
|
70
|
+
* @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.
|
71
|
+
*/
|
63
72
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
64
73
|
export const ForceTouchGestureHandler = PlatformConstants?.forceTouchAvailable
|
65
74
|
? createHandler<
|
@@ -32,13 +32,23 @@ export interface LongPressGestureConfig {
|
|
32
32
|
numberOfPointers?: number;
|
33
33
|
}
|
34
34
|
|
35
|
+
/**
|
36
|
+
* @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.
|
37
|
+
*/
|
35
38
|
export interface LongPressGestureHandlerProps
|
36
39
|
extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>,
|
37
40
|
LongPressGestureConfig {}
|
38
41
|
|
39
42
|
export const longPressHandlerName = 'LongPressGestureHandler';
|
40
43
|
|
44
|
+
/**
|
45
|
+
* @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.
|
46
|
+
*/
|
41
47
|
export type LongPressGestureHandler = typeof LongPressGestureHandler;
|
48
|
+
|
49
|
+
/**
|
50
|
+
* @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.
|
51
|
+
*/
|
42
52
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
43
53
|
export const LongPressGestureHandler = createHandler<
|
44
54
|
LongPressGestureHandlerProps,
|
@@ -26,6 +26,9 @@ export interface NativeViewGestureConfig {
|
|
26
26
|
disallowInterruption?: boolean;
|
27
27
|
}
|
28
28
|
|
29
|
+
/**
|
30
|
+
* @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.
|
31
|
+
*/
|
29
32
|
export interface NativeViewGestureHandlerProps
|
30
33
|
extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>,
|
31
34
|
NativeViewGestureConfig {}
|
@@ -37,7 +40,14 @@ export const nativeViewProps = [
|
|
37
40
|
|
38
41
|
export const nativeViewHandlerName = 'NativeViewGestureHandler';
|
39
42
|
|
43
|
+
/**
|
44
|
+
* @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.
|
45
|
+
*/
|
40
46
|
export type NativeViewGestureHandler = typeof NativeViewGestureHandler;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.
|
50
|
+
*/
|
41
51
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
42
52
|
export const NativeViewGestureHandler = createHandler<
|
43
53
|
NativeViewGestureHandlerProps,
|
@@ -82,6 +82,9 @@ export interface PanGestureConfig extends CommonPanProperties {
|
|
82
82
|
failOffsetXEnd?: number;
|
83
83
|
}
|
84
84
|
|
85
|
+
/**
|
86
|
+
* @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.
|
87
|
+
*/
|
85
88
|
export interface PanGestureHandlerProps
|
86
89
|
extends BaseGestureHandlerProps<PanGestureHandlerEventPayload>,
|
87
90
|
CommonPanProperties {
|
@@ -132,7 +135,14 @@ export interface PanGestureHandlerProps
|
|
132
135
|
|
133
136
|
export const panHandlerName = 'PanGestureHandler';
|
134
137
|
|
138
|
+
/**
|
139
|
+
* @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.
|
140
|
+
*/
|
135
141
|
export type PanGestureHandler = typeof PanGestureHandler;
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.
|
145
|
+
*/
|
136
146
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
137
147
|
export const PanGestureHandler = createHandler<
|
138
148
|
PanGestureHandlerProps,
|