react-native-gesture-handler 3.2.0-nightly-20260811-cc704f09a → 3.2.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/android/build.gradle +21 -6
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +30 -66
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +4 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerDetectorView.kt +1 -2
- package/apple/RNGestureHandler.mm +31 -23
- package/apple/RNGestureHandlerButtonComponentView.mm +10 -6
- package/lib/module/components/GestureHandlerButton.web.js +3 -2
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +3 -0
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/handlers/hitSlop.js +101 -0
- package/lib/module/handlers/hitSlop.js.map +1 -0
- package/lib/module/handlers/utils.js +3 -7
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerDetectorNativeComponent.ts +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.ts +1 -1
- package/lib/module/v3/components/Pressable.js +23 -312
- package/lib/module/v3/components/Pressable.js.map +1 -1
- package/lib/module/v3/components/PressableWithTouchable.js +259 -0
- package/lib/module/v3/components/PressableWithTouchable.js.map +1 -0
- package/lib/module/v3/components/StatefulPressable.js +338 -0
- package/lib/module/v3/components/StatefulPressable.js.map +1 -0
- package/lib/module/v3/components/pointerStyle.js +6 -0
- package/lib/module/v3/components/pointerStyle.js.map +1 -0
- package/lib/module/v3/components/pointerStyle.web.js +9 -0
- package/lib/module/v3/components/pointerStyle.web.js.map +1 -0
- package/lib/module/v3/hooks/utils/configUtils.js +3 -1
- package/lib/module/v3/hooks/utils/configUtils.js.map +1 -1
- package/lib/module/v3/hooks/utils/reanimatedUtils.js +14 -3
- package/lib/module/v3/hooks/utils/reanimatedUtils.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +21 -44
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/typescript/components/GestureComponents.web.d.ts +12 -4
- package/lib/typescript/components/GestureComponents.web.d.ts.map +1 -1
- package/lib/typescript/components/GestureHandlerButton.web.d.ts.map +1 -1
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts.map +1 -1
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts.map +1 -1
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts.map +1 -1
- package/lib/typescript/handlers/hitSlop.d.ts +51 -0
- package/lib/typescript/handlers/hitSlop.d.ts.map +1 -0
- package/lib/typescript/handlers/utils.d.ts.map +1 -1
- package/lib/typescript/mocks/hostDetector.d.ts +5 -2
- package/lib/typescript/mocks/hostDetector.d.ts.map +1 -1
- package/lib/typescript/specs/RNGestureHandlerDetectorNativeComponent.d.ts +1 -1
- package/lib/typescript/specs/RNGestureHandlerDetectorNativeComponent.d.ts.map +1 -1
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +1 -1
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/v3/components/GestureComponents.web.d.ts +16 -8
- package/lib/typescript/v3/components/GestureComponents.web.d.ts.map +1 -1
- package/lib/typescript/v3/components/Pressable.d.ts +13 -0
- package/lib/typescript/v3/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/v3/components/PressableWithTouchable.d.ts +5 -0
- package/lib/typescript/v3/components/PressableWithTouchable.d.ts.map +1 -0
- package/lib/typescript/v3/components/StatefulPressable.d.ts +5 -0
- package/lib/typescript/v3/components/StatefulPressable.d.ts.map +1 -0
- package/lib/typescript/v3/components/pointerStyle.d.ts +3 -0
- package/lib/typescript/v3/components/pointerStyle.d.ts.map +1 -0
- package/lib/typescript/v3/components/pointerStyle.web.d.ts +3 -0
- package/lib/typescript/v3/components/pointerStyle.web.d.ts.map +1 -0
- package/lib/typescript/v3/detectors/ReanimatedNativeDetector.d.ts +3 -1
- package/lib/typescript/v3/detectors/ReanimatedNativeDetector.d.ts.map +1 -1
- package/lib/typescript/v3/detectors/ReanimatedNativeDetector.web.d.ts +3 -1
- package/lib/typescript/v3/detectors/ReanimatedNativeDetector.web.d.ts.map +1 -1
- package/lib/typescript/v3/detectors/common.d.ts +2 -2
- package/lib/typescript/v3/detectors/common.d.ts.map +1 -1
- package/lib/typescript/v3/hooks/utils/configUtils.d.ts.map +1 -1
- package/lib/typescript/v3/hooks/utils/reanimatedUtils.d.ts.map +1 -1
- package/lib/typescript/v3/types/ConfigTypes.d.ts +2 -1
- package/lib/typescript/v3/types/ConfigTypes.d.ts.map +1 -1
- package/lib/typescript/v3/types/EventTypes.d.ts +3 -2
- package/lib/typescript/v3/types/EventTypes.d.ts.map +1 -1
- package/lib/typescript/web/handlers/GestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/GestureHandler.d.ts.map +1 -1
- package/lib/typescript/web/interfaces.d.ts +3 -12
- package/lib/typescript/web/interfaces.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/GestureHandlerButton.web.tsx +3 -2
- package/src/components/ReanimatedDrawerLayout.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +1 -0
- package/src/handlers/hitSlop.ts +146 -0
- package/src/handlers/utils.ts +4 -2
- package/src/specs/RNGestureHandlerDetectorNativeComponent.ts +1 -1
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +1 -1
- package/src/v3/components/Pressable.tsx +28 -448
- package/src/v3/components/PressableWithTouchable.tsx +326 -0
- package/src/v3/components/StatefulPressable.tsx +476 -0
- package/src/v3/components/pointerStyle.ts +5 -0
- package/src/v3/components/pointerStyle.web.ts +6 -0
- package/src/v3/hooks/utils/configUtils.ts +7 -1
- package/src/v3/hooks/utils/reanimatedUtils.ts +17 -8
- package/src/v3/types/ConfigTypes.ts +2 -1
- package/src/v3/types/EventTypes.ts +7 -3
- package/src/web/handlers/GestureHandler.ts +26 -77
- package/src/web/interfaces.ts +3 -13
|
@@ -5,6 +5,7 @@ import { ghQueueMicrotask } from '../ghQueueMicrotask';
|
|
|
5
5
|
import RNGestureHandlerModule from '../RNGestureHandlerModule';
|
|
6
6
|
import { toArray } from '../utils';
|
|
7
7
|
import { handlerIDToTag } from './handlersRegistry';
|
|
8
|
+
import { normalizeHitSlop } from './hitSlop';
|
|
8
9
|
function isConfigParam(param, name) {
|
|
9
10
|
// param !== Object(param) returns false if `param` is a function
|
|
10
11
|
// or an object and returns true if `param` is null
|
|
@@ -20,13 +21,8 @@ export function filterConfig(props, validProps, defaults = {}) {
|
|
|
20
21
|
if (isConfigParam(value, key)) {
|
|
21
22
|
if (key === 'simultaneousHandlers' || key === 'waitFor') {
|
|
22
23
|
value = transformIntoHandlerTags(props[key]);
|
|
23
|
-
} else if (key === 'hitSlop'
|
|
24
|
-
value =
|
|
25
|
-
top: value,
|
|
26
|
-
left: value,
|
|
27
|
-
bottom: value,
|
|
28
|
-
right: value
|
|
29
|
-
};
|
|
24
|
+
} else if (key === 'hitSlop') {
|
|
25
|
+
value = normalizeHitSlop(value);
|
|
30
26
|
}
|
|
31
27
|
filteredConfig[key] = value;
|
|
32
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["findNodeHandle","findNodeHandleRN","Platform","ghQueueMicrotask","RNGestureHandlerModule","toArray","handlerIDToTag","isConfigParam","param","name","undefined","Object","selectProperties","obj","keys","fromEntries","filter","k","map","filterConfig","props","validProps","defaults","filteredConfig","key","value","transformIntoHandlerTags","
|
|
1
|
+
{"version":3,"names":["findNodeHandle","findNodeHandleRN","Platform","ghQueueMicrotask","RNGestureHandlerModule","toArray","handlerIDToTag","normalizeHitSlop","isConfigParam","param","name","undefined","Object","selectProperties","obj","keys","fromEntries","filter","k","map","filterConfig","props","validProps","defaults","filteredConfig","key","value","transformIntoHandlerTags","handlerIDs","OS","current","handle","handlerID","handlerTag","node","scheduledOperations","flushOperationsScheduled","scheduleFlushOperations","operation","flushOperations","scheduleOperationToBeFlushed","push"],"sourceRoot":"../../../src","sources":["handlers/utils.ts"],"mappings":";;AACA,SAASA,cAAc,IAAIC,gBAAgB,EAAEC,QAAQ,QAAQ,cAAc;AAE3E,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,OAAOC,sBAAsB,MAAM,2BAA2B;AAC9D,SAASC,OAAO,QAAQ,UAAU;AAElC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,SAASC,aAAaA,CAACC,KAAc,EAAEC,IAAY,EAAE;EACnD;EACA;EACA,OACED,KAAK,KAAKE,SAAS,KAClBF,KAAK,KAAKG,MAAM,CAACH,KAAK,CAAC,IACtB,EAAE,YAAY,IAAKA,KAAiC,CAAC,CAAC,IACxDC,IAAI,KAAK,sBAAsB,IAC/BA,IAAI,KAAK,gBAAgB;AAE7B;AAEA,OAAO,MAAMG,gBAAgB,GAAGA,CAC9BC,GAA4B,EAC5BC,IAAc,KACXH,MAAM,CAACI,WAAW,CAACD,IAAI,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,IAAIJ,GAAG,CAAC,CAACK,GAAG,CAAED,CAAC,IAAK,CAACA,CAAC,EAAEJ,GAAG,CAACI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,OAAO,SAASE,YAAYA,CAC1BC,KAA8B,EAC9BC,UAAoB,EACpBC,QAAiC,GAAG,CAAC,CAAC,EACtC;EACA,MAAMC,cAAc,GAAG;IAAE,GAAGD;EAAS,CAAC;EACtC,KAAK,MAAME,GAAG,IAAIH,UAAU,EAAE;IAC5B,IAAII,KAAK,GAAGL,KAAK,CAACI,GAAG,CAAC;IACtB,IAAIjB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B,CAAC,MAAM;MACrB,KAAK,MAAMmC,SAAS,IAAIH,mBAAmB,EAAE;QAC3CG,SAAS,CAAC,CAAC;MACb;MACAH,mBAAmB,GAAG,EAAE;MACxB/B,sBAAsB,CAACmC,eAAe,CAAC,CAAC;MAExCH,wBAAwB,GAAG,KAAK;IAClC,CAAC,CAAC;EACJ;AACF;AAEA,OAAO,SAASI,4BAA4BA,CAACF,SAAqB,EAAE;EAClEH,mBAAmB,CAACM,IAAI,CAACH,SAAS,CAAC;EACnCD,uBAAuB,CAAC,CAAC;AAC3B","ignoreList":[]}
|
|
@@ -67,7 +67,7 @@ export interface NativeProps extends ViewProps {
|
|
|
67
67
|
| undefined;
|
|
68
68
|
|
|
69
69
|
handlerTags: CodegenTypes.Int32[];
|
|
70
|
-
moduleId
|
|
70
|
+
moduleId?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
71
71
|
virtualChildren: VirtualChildrenProps[];
|
|
72
72
|
|
|
73
73
|
pointerEvents?: CodegenTypes.WithDefault<
|
|
@@ -1,318 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { PressableStateMachine } from '../../components/Pressable/StateMachine';
|
|
7
|
-
import { addInsets, gestureToPressableEvent, gestureTouchToPressableEvent, isTouchWithinInset, numberAsInset, viewCenterToPressableEvent } from '../../components/Pressable/utils';
|
|
8
|
-
import { getTVProps } from '../../components/utils';
|
|
9
|
-
import { PressabilityDebugView } from '../../handlers/PressabilityDebugView';
|
|
10
|
-
import { useIsScreenReaderEnabled } from '../../useIsScreenReaderEnabled';
|
|
11
|
-
import { INT32_MAX, isTestEnv } from '../../utils';
|
|
12
|
-
import { GestureDetector } from '../detectors';
|
|
13
|
-
import { useHoverGesture, useLongPressGesture, useNativeGesture, useSimultaneousGestures } from '../hooks';
|
|
14
|
-
import { isKeyboardDismissingTap, JSResponderContext } from '../scrollViewInterop';
|
|
15
|
-
import { PureNativeButton } from './GestureButtons';
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
const DEFAULT_LONG_PRESS_DURATION = 500;
|
|
18
|
-
const IS_TEST_ENV = isTestEnv();
|
|
19
|
-
const Pressable = props => {
|
|
20
|
-
const {
|
|
21
|
-
testOnly_pressed,
|
|
22
|
-
hitSlop,
|
|
23
|
-
pressRetentionOffset,
|
|
24
|
-
delayHoverIn,
|
|
25
|
-
delayHoverOut,
|
|
26
|
-
delayLongPress,
|
|
27
|
-
unstable_pressDelay,
|
|
28
|
-
onHoverIn,
|
|
29
|
-
onHoverOut,
|
|
30
|
-
onPress,
|
|
31
|
-
onPressIn,
|
|
32
|
-
onPressOut,
|
|
33
|
-
onLongPress,
|
|
34
|
-
onLayout,
|
|
35
|
-
style,
|
|
36
|
-
children,
|
|
37
|
-
android_disableSound,
|
|
38
|
-
android_ripple,
|
|
39
|
-
disabled,
|
|
40
|
-
accessible,
|
|
41
|
-
simultaneousWith,
|
|
42
|
-
requireToFail,
|
|
43
|
-
block,
|
|
44
|
-
ref,
|
|
45
|
-
...remainingProps
|
|
46
|
-
} = props;
|
|
47
|
-
const [pressedState, setPressedState] = useState(testOnly_pressed ?? false);
|
|
48
|
-
const longPressTimeoutRef = useRef(null);
|
|
49
|
-
const pressDelayTimeoutRef = useRef(null);
|
|
50
|
-
const isOnPressAllowed = useRef(true);
|
|
51
|
-
const jsResponderContext = use(JSResponderContext);
|
|
52
|
-
const isCurrentlyPressed = useRef(false);
|
|
53
|
-
const dimensions = useRef({
|
|
54
|
-
width: 0,
|
|
55
|
-
height: 0
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// When the touch that begins a press is the one dismissing the keyboard
|
|
59
|
-
// (keyboardShouldPersistTaps="never"), the press is swallowed to match RN's
|
|
60
|
-
// touchables.
|
|
61
|
-
const dropKeyboardTapRef = useRef(null);
|
|
62
|
-
const normalizedHitSlop = useMemo(() => typeof hitSlop === 'number' ? numberAsInset(hitSlop) : hitSlop ?? numberAsInset(0), [hitSlop]);
|
|
63
|
-
const normalizedPressRetentionOffset = useMemo(() => typeof pressRetentionOffset === 'number' ? numberAsInset(pressRetentionOffset) : pressRetentionOffset ?? {}, [pressRetentionOffset]);
|
|
64
|
-
const appliedHitSlop = addInsets(normalizedHitSlop, normalizedPressRetentionOffset);
|
|
65
|
-
const cancelLongPress = useCallback(() => {
|
|
66
|
-
if (longPressTimeoutRef.current) {
|
|
67
|
-
clearTimeout(longPressTimeoutRef.current);
|
|
68
|
-
longPressTimeoutRef.current = null;
|
|
69
|
-
isOnPressAllowed.current = true;
|
|
70
|
-
}
|
|
71
|
-
}, []);
|
|
72
|
-
const cancelDelayedPress = useCallback(() => {
|
|
73
|
-
if (pressDelayTimeoutRef.current) {
|
|
74
|
-
clearTimeout(pressDelayTimeoutRef.current);
|
|
75
|
-
pressDelayTimeoutRef.current = null;
|
|
76
|
-
}
|
|
77
|
-
}, []);
|
|
78
|
-
const startLongPress = useCallback(event => {
|
|
79
|
-
if (onLongPress) {
|
|
80
|
-
cancelLongPress();
|
|
81
|
-
longPressTimeoutRef.current = setTimeout(() => {
|
|
82
|
-
isOnPressAllowed.current = false;
|
|
83
|
-
onLongPress(event);
|
|
84
|
-
}, delayLongPress ?? DEFAULT_LONG_PRESS_DURATION);
|
|
85
|
-
}
|
|
86
|
-
}, [onLongPress, cancelLongPress, delayLongPress]);
|
|
87
|
-
const innerHandlePressIn = useCallback(event => {
|
|
88
|
-
onPressIn?.(event);
|
|
89
|
-
startLongPress(event);
|
|
90
|
-
setPressedState(true);
|
|
91
|
-
if (pressDelayTimeoutRef.current) {
|
|
92
|
-
clearTimeout(pressDelayTimeoutRef.current);
|
|
93
|
-
pressDelayTimeoutRef.current = null;
|
|
94
|
-
}
|
|
95
|
-
}, [onPressIn, startLongPress]);
|
|
96
|
-
const handleFinalize = useCallback(() => {
|
|
97
|
-
isCurrentlyPressed.current = false;
|
|
98
|
-
dropKeyboardTapRef.current = null;
|
|
99
|
-
cancelLongPress();
|
|
100
|
-
cancelDelayedPress();
|
|
101
|
-
setPressedState(false);
|
|
102
|
-
}, [cancelDelayedPress, cancelLongPress]);
|
|
103
|
-
const captureKeyboardDismiss = useCallback(() => {
|
|
104
|
-
dropKeyboardTapRef.current ??= isKeyboardDismissingTap(jsResponderContext);
|
|
105
|
-
}, [jsResponderContext]);
|
|
106
|
-
const handlePressIn = useCallback((event, skipBoundsCheck = false) => {
|
|
107
|
-
if (!skipBoundsCheck && !isTouchWithinInset(dimensions.current, normalizedHitSlop, event.nativeEvent.changedTouches.at(-1))) {
|
|
108
|
-
// Ignoring pressIn within pressRetentionOffset
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
isCurrentlyPressed.current = true;
|
|
112
|
-
if (unstable_pressDelay) {
|
|
113
|
-
pressDelayTimeoutRef.current = setTimeout(() => {
|
|
114
|
-
innerHandlePressIn(event);
|
|
115
|
-
}, unstable_pressDelay);
|
|
116
|
-
} else {
|
|
117
|
-
innerHandlePressIn(event);
|
|
118
|
-
}
|
|
119
|
-
}, [innerHandlePressIn, normalizedHitSlop, unstable_pressDelay]);
|
|
120
|
-
const handlePressOut = useCallback((event, success = true) => {
|
|
121
|
-
if (!isCurrentlyPressed.current) {
|
|
122
|
-
// Some prop configurations may lead to handlePressOut being called mutliple times.
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
isCurrentlyPressed.current = false;
|
|
126
|
-
if (pressDelayTimeoutRef.current) {
|
|
127
|
-
innerHandlePressIn(event);
|
|
128
|
-
}
|
|
129
|
-
onPressOut?.(event);
|
|
130
|
-
if (isOnPressAllowed.current && success) {
|
|
131
|
-
onPress?.(event);
|
|
132
|
-
}
|
|
133
|
-
handleFinalize();
|
|
134
|
-
}, [handleFinalize, innerHandlePressIn, onPress, onPressOut]);
|
|
135
|
-
const stateMachine = useMemo(() => new PressableStateMachine(), []);
|
|
136
|
-
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
const configuration = getStatesConfig(handlePressIn, handlePressOut, isScreenReaderEnabled);
|
|
139
|
-
stateMachine.setStates(configuration);
|
|
140
|
-
}, [handlePressIn, handlePressOut, stateMachine, isScreenReaderEnabled]);
|
|
141
|
-
const hoverInTimeout = useRef(null);
|
|
142
|
-
const hoverOutTimeout = useRef(null);
|
|
143
|
-
const hoverGesture = useHoverGesture({
|
|
144
|
-
manualActivation: true,
|
|
145
|
-
// Prevents Hover blocking Native gesture on web
|
|
146
|
-
cancelsTouchesInView: false,
|
|
147
|
-
onBegin: event => {
|
|
148
|
-
if (hoverOutTimeout.current) {
|
|
149
|
-
clearTimeout(hoverOutTimeout.current);
|
|
150
|
-
}
|
|
151
|
-
if (delayHoverIn) {
|
|
152
|
-
hoverInTimeout.current = setTimeout(() => onHoverIn?.(gestureToPressableEvent(event)), delayHoverIn);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
onHoverIn?.(gestureToPressableEvent(event));
|
|
156
|
-
},
|
|
157
|
-
onFinalize: event => {
|
|
158
|
-
if (hoverInTimeout.current) {
|
|
159
|
-
clearTimeout(hoverInTimeout.current);
|
|
160
|
-
}
|
|
161
|
-
if (delayHoverOut) {
|
|
162
|
-
hoverOutTimeout.current = setTimeout(() => onHoverOut?.(gestureToPressableEvent(event)), delayHoverOut);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
onHoverOut?.(gestureToPressableEvent(event));
|
|
166
|
-
},
|
|
167
|
-
enabled: disabled !== true,
|
|
168
|
-
disableReanimated: true,
|
|
169
|
-
simultaneousWith,
|
|
170
|
-
block,
|
|
171
|
-
requireToFail,
|
|
172
|
-
hitSlop: appliedHitSlop
|
|
173
|
-
});
|
|
174
|
-
const pressAndTouchGesture = useLongPressGesture({
|
|
175
|
-
minDuration: Platform.OS === 'web' ? 0 : INT32_MAX,
|
|
176
|
-
// Long press handles finalize on web, thus it must activate right away
|
|
177
|
-
maxDistance: INT32_MAX,
|
|
178
|
-
// Stops long press from cancelling on touch move
|
|
179
|
-
cancelsTouchesInView: false,
|
|
180
|
-
onTouchesDown: event => {
|
|
181
|
-
captureKeyboardDismiss();
|
|
182
|
-
if (dropKeyboardTapRef.current) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const pressableEvent = gestureTouchToPressableEvent(event);
|
|
186
|
-
stateMachine.handleEvent(StateMachineEvent.LONG_PRESS_TOUCHES_DOWN, pressableEvent);
|
|
187
|
-
},
|
|
188
|
-
onTouchesUp: () => {
|
|
189
|
-
if (Platform.OS === 'android' && !isScreenReaderEnabled) {
|
|
190
|
-
// Prevents potential soft-locks
|
|
191
|
-
stateMachine.reset();
|
|
192
|
-
handleFinalize();
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
onTouchesCancel: event => {
|
|
196
|
-
const pressableEvent = gestureTouchToPressableEvent(event);
|
|
197
|
-
stateMachine.reset();
|
|
198
|
-
handlePressOut(pressableEvent, false);
|
|
199
|
-
},
|
|
200
|
-
onFinalize: event => {
|
|
201
|
-
if (Platform.OS !== 'web') {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
stateMachine.handleEvent(event.canceled ? StateMachineEvent.CANCEL : StateMachineEvent.FINALIZE);
|
|
205
|
-
handleFinalize();
|
|
206
|
-
},
|
|
207
|
-
enabled: disabled !== true,
|
|
208
|
-
disableReanimated: true,
|
|
209
|
-
simultaneousWith: simultaneousWith,
|
|
210
|
-
block: block,
|
|
211
|
-
requireToFail: requireToFail,
|
|
212
|
-
hitSlop: appliedHitSlop
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// RNButton is placed inside ButtonGesture to enable Android's ripple and to capture non-propagating events
|
|
216
|
-
const buttonGesture = useNativeGesture({
|
|
217
|
-
onTouchesCancel: event => {
|
|
218
|
-
if (Platform.OS !== 'macos' && Platform.OS !== 'web') {
|
|
219
|
-
// On MacOS cancel occurs in middle of gesture
|
|
220
|
-
// On Web cancel occurs on mouse move, which is unwanted
|
|
221
|
-
const pressableEvent = gestureTouchToPressableEvent(event);
|
|
222
|
-
stateMachine.reset();
|
|
223
|
-
handlePressOut(pressableEvent, false);
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
onBegin: () => {
|
|
227
|
-
captureKeyboardDismiss();
|
|
228
|
-
if (dropKeyboardTapRef.current) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
if (Platform.isTV) {
|
|
232
|
-
// tvOS drives this native gesture from the focus-engine Select press.
|
|
233
|
-
// The press state machine is touch-based and never
|
|
234
|
-
// receives LONG_PRESS_TOUCHES_DOWN here, so bypass it and drive the press handlers directly.
|
|
235
|
-
// A focus-driven press has no coordinates, so skip the hit-slop bounds check entirely.
|
|
236
|
-
handlePressIn(viewCenterToPressableEvent(dimensions.current), true);
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
if (Platform.OS === 'android' && isScreenReaderEnabled) {
|
|
240
|
-
stateMachine.handleEvent(StateMachineEvent.NATIVE_BEGIN, viewCenterToPressableEvent(dimensions.current));
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
stateMachine.handleEvent(StateMachineEvent.NATIVE_BEGIN);
|
|
244
|
-
},
|
|
245
|
-
onActivate: () => {
|
|
246
|
-
if (!Platform.isTV && Platform.OS !== 'android') {
|
|
247
|
-
stateMachine.handleEvent(StateMachineEvent.NATIVE_START);
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
onFinalize: event => {
|
|
251
|
-
// On Web we use LongPress.onFinalize instead of Native.onFinalize,
|
|
252
|
-
// as Native cancels on mouse move, and LongPress does not.
|
|
253
|
-
if (Platform.OS === 'web') {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
if (Platform.isTV) {
|
|
257
|
-
handlePressOut(viewCenterToPressableEvent(dimensions.current), !event.canceled);
|
|
258
|
-
handleFinalize();
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
stateMachine.handleEvent(event.canceled ? StateMachineEvent.CANCEL : StateMachineEvent.FINALIZE);
|
|
262
|
-
handleFinalize();
|
|
263
|
-
},
|
|
264
|
-
enabled: disabled !== true,
|
|
265
|
-
disableReanimated: true,
|
|
266
|
-
simultaneousWith,
|
|
267
|
-
block,
|
|
268
|
-
requireToFail,
|
|
269
|
-
hitSlop: appliedHitSlop,
|
|
270
|
-
shouldActivateOnStart: Platform.OS === 'web'
|
|
271
|
-
});
|
|
272
|
-
const gesture = useSimultaneousGestures(buttonGesture, pressAndTouchGesture, hoverGesture);
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import PressableWithTouchable from './PressableWithTouchable';
|
|
5
|
+
import StatefulPressable from './StatefulPressable';
|
|
273
6
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
gesture: gesture,
|
|
295
|
-
children: /*#__PURE__*/_jsxs(PureNativeButton, {
|
|
296
|
-
...remainingProps,
|
|
297
|
-
ref: ref,
|
|
298
|
-
...tvProps,
|
|
299
|
-
onLayout: setDimensions,
|
|
300
|
-
accessible: accessible !== false,
|
|
301
|
-
hitSlop: appliedHitSlop,
|
|
302
|
-
enabled: disabled !== true,
|
|
303
|
-
touchSoundDisabled: android_disableSound ?? undefined,
|
|
304
|
-
rippleColor: rippleColor,
|
|
305
|
-
rippleRadius: android_ripple?.radius ?? undefined,
|
|
306
|
-
style: [pointerStyle, styleProp],
|
|
307
|
-
testOnly_onPress: IS_TEST_ENV ? onPress : undefined,
|
|
308
|
-
testOnly_onPressIn: IS_TEST_ENV ? onPressIn : undefined,
|
|
309
|
-
testOnly_onPressOut: IS_TEST_ENV ? onPressOut : undefined,
|
|
310
|
-
testOnly_onLongPress: IS_TEST_ENV ? onLongPress : undefined,
|
|
311
|
-
children: [childrenProp, __DEV__ ? /*#__PURE__*/_jsx(PressabilityDebugView, {
|
|
312
|
-
color: "red",
|
|
313
|
-
hitSlop: normalizedHitSlop
|
|
314
|
-
}) : null]
|
|
315
|
-
})
|
|
7
|
+
/**
|
|
8
|
+
* `Pressable` dispatches between two implementations:
|
|
9
|
+
*
|
|
10
|
+
* - {@link StatefulPressable} — the state-machine engine, used whenever any of
|
|
11
|
+
* the `simultaneousWith` / `requireToFail` / `block` relation props is passed,
|
|
12
|
+
* since coordinating the press with an external gesture needs the composed
|
|
13
|
+
* gesture recognizers.
|
|
14
|
+
* - {@link PressableWithTouchable} — the simpler engine built on the native
|
|
15
|
+
* button `Touchable`, used for everything else (the common case).
|
|
16
|
+
*
|
|
17
|
+
* The choice is re-evaluated each render: toggling a relation prop at runtime
|
|
18
|
+
* swaps engines, which remounts and drops any in-progress press.
|
|
19
|
+
*/
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
const Pressable = props => {
|
|
22
|
+
const usesRelations = props.simultaneousWith != null || props.requireToFail != null || props.block != null;
|
|
23
|
+
return usesRelations ? /*#__PURE__*/_jsx(StatefulPressable, {
|
|
24
|
+
...props
|
|
25
|
+
}) : /*#__PURE__*/_jsx(PressableWithTouchable, {
|
|
26
|
+
...props
|
|
316
27
|
});
|
|
317
28
|
};
|
|
318
29
|
export default Pressable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","use","useCallback","useEffect","useMemo","useRef","useState","Platform","getStatesConfig","StateMachineEvent","PressableStateMachine","addInsets","gestureToPressableEvent","gestureTouchToPressableEvent","isTouchWithinInset","numberAsInset","viewCenterToPressableEvent","getTVProps","PressabilityDebugView","useIsScreenReaderEnabled","INT32_MAX","isTestEnv","GestureDetector","useHoverGesture","useLongPressGesture","useNativeGesture","useSimultaneousGestures","isKeyboardDismissingTap","JSResponderContext","PureNativeButton","jsx","_jsx","jsxs","_jsxs","DEFAULT_LONG_PRESS_DURATION","IS_TEST_ENV","Pressable","props","testOnly_pressed","hitSlop","pressRetentionOffset","delayHoverIn","delayHoverOut","delayLongPress","unstable_pressDelay","onHoverIn","onHoverOut","onPress","onPressIn","onPressOut","onLongPress","onLayout","style","children","android_disableSound","android_ripple","disabled","accessible","simultaneousWith","requireToFail","block","ref","remainingProps","pressedState","setPressedState","longPressTimeoutRef","pressDelayTimeoutRef","isOnPressAllowed","jsResponderContext","isCurrentlyPressed","dimensions","width","height","dropKeyboardTapRef","normalizedHitSlop","normalizedPressRetentionOffset","appliedHitSlop","cancelLongPress","current","clearTimeout","cancelDelayedPress","startLongPress","event","setTimeout","innerHandlePressIn","handleFinalize","captureKeyboardDismiss","handlePressIn","skipBoundsCheck","nativeEvent","changedTouches","at","handlePressOut","success","stateMachine","isScreenReaderEnabled","configuration","setStates","hoverInTimeout","hoverOutTimeout","hoverGesture","manualActivation","cancelsTouchesInView","onBegin","onFinalize","enabled","disableReanimated","pressAndTouchGesture","minDuration","OS","maxDistance","onTouchesDown","pressableEvent","handleEvent","LONG_PRESS_TOUCHES_DOWN","onTouchesUp","reset","onTouchesCancel","canceled","CANCEL","FINALIZE","buttonGesture","isTV","NATIVE_BEGIN","onActivate","NATIVE_START","shouldActivateOnStart","gesture","pointerStyle","cursor","styleProp","pressed","childrenProp","rippleColor","defaultRippleColor","undefined","color","setDimensions","layout","tvProps","touchSoundDisabled","rippleRadius","radius","testOnly_onPress","testOnly_onPressIn","testOnly_onPressOut","testOnly_onLongPress","__DEV__"],"sourceRoot":"../../../../src","sources":["v3/components/Pressable.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,GAAG,EACHC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAOd,SAASC,QAAQ,QAAQ,cAAc;AAOvC,SACEC,eAAe,EACfC,iBAAiB,QACZ,6CA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
|
|
1
|
+
{"version":3,"names":["React","PressableWithTouchable","StatefulPressable","jsx","_jsx","Pressable","props","usesRelations","simultaneousWith","requireToFail","block"],"sourceRoot":"../../../../src","sources":["v3/components/Pressable.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,iBAAiB,MAAM,qBAAqB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,SAAAC,GAAA,IAAAC,IAAA;AAaA,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAC3C,MAAMC,aAAa,GACjBD,KAAK,CAACE,gBAAgB,IAAI,IAAI,IAC9BF,KAAK,CAACG,aAAa,IAAI,IAAI,IAC3BH,KAAK,CAACI,KAAK,IAAI,IAAI;EAErB,OAAOH,aAAa,gBAClBH,IAAA,CAACF,iBAAiB;IAAA,GAAKI;EAAK,CAAG,CAAC,gBAEhCF,IAAA,CAACH,sBAAsB;IAAA,GAAKK;EAAK,CAAG,CACrC;AACH,CAAC;AAED,eAAeD,SAAS","ignoreList":[]}
|