react-native-swipeable-actions 0.1.12 → 1.0.0-rc.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/CHANGELOG.md +78 -0
- package/LICENSE +21 -0
- package/README.md +377 -207
- package/android/src/main/java/expo/modules/swipeable/SwipePhysics.kt +39 -0
- package/android/src/main/java/expo/modules/swipeable/SwipeableModule.kt +24 -10
- package/android/src/main/java/expo/modules/swipeable/SwipeableView.kt +804 -420
- package/build/Swipeable.d.ts +3 -8
- package/build/Swipeable.d.ts.map +1 -1
- package/build/Swipeable.js +87 -33
- package/build/Swipeable.js.map +1 -1
- package/build/Swipeable.types.d.ts +59 -9
- package/build/Swipeable.types.d.ts.map +1 -1
- package/build/SwipeableActions.d.ts +1 -1
- package/build/SwipeableActions.d.ts.map +1 -1
- package/build/SwipeableActions.js +4 -2
- package/build/SwipeableActions.js.map +1 -1
- package/build/SwipeableView.d.ts +11 -2
- package/build/SwipeableView.d.ts.map +1 -1
- package/build/SwipeableView.js.map +1 -1
- package/build/constants.d.ts +0 -1
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +0 -1
- package/build/constants.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/nativeModuleUtils.d.ts +3 -1
- package/build/nativeModuleUtils.d.ts.map +1 -1
- package/build/nativeModuleUtils.js +20 -9
- package/build/nativeModuleUtils.js.map +1 -1
- package/build/resolveSwipeableActions.d.ts +18 -0
- package/build/resolveSwipeableActions.d.ts.map +1 -0
- package/build/resolveSwipeableActions.js +26 -0
- package/build/resolveSwipeableActions.js.map +1 -0
- package/docs/migration-v1.md +191 -0
- package/docs/support.md +90 -0
- package/ios/SwipeAnimationConfig.swift +32 -0
- package/ios/SwipePhysics.swift +418 -0
- package/ios/SwipeableModule.swift +34 -12
- package/ios/SwipeableView.swift +1062 -613
- package/jestSetup.js +17 -5
- package/package.json +11 -5
- package/src/Swipeable.tsx +147 -54
- package/src/Swipeable.types.ts +50 -9
- package/src/SwipeableActions.tsx +6 -3
- package/src/SwipeableView.tsx +10 -3
- package/src/constants.ts +0 -1
- package/src/index.ts +7 -0
- package/src/nativeModuleUtils.ts +19 -8
- package/src/resolveSwipeableActions.ts +37 -0
package/build/Swipeable.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
type SwipeableWithStatic =
|
|
4
|
-
open: (recyclingKey: string) => void;
|
|
5
|
-
close: (recyclingKey: string, animated?: boolean) => void;
|
|
6
|
-
cancel: (recyclingKey: string) => void;
|
|
7
|
-
closeAll: (animated?: boolean) => void;
|
|
8
|
-
};
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes } from 'react';
|
|
2
|
+
import type { SwipeableComponentProps, SwipeableMethods, SwipeableStatic } from './Swipeable.types';
|
|
3
|
+
type SwipeableWithStatic = ForwardRefExoticComponent<SwipeableComponentProps & RefAttributes<SwipeableMethods>> & SwipeableStatic;
|
|
9
4
|
declare const SwipeableExport: SwipeableWithStatic;
|
|
10
5
|
export default SwipeableExport;
|
|
11
6
|
//# sourceMappingURL=Swipeable.d.ts.map
|
package/build/Swipeable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swipeable.d.ts","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Swipeable.d.ts","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAQnB,MAAM,OAAO,CAAA;AAYd,OAAO,KAAK,EAIV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EAIhB,MAAM,mBAAmB,CAAA;AAmQ1B,KAAK,mBAAmB,GAAG,yBAAyB,CAClD,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAC1D,GACC,eAAe,CAAA;AAEjB,QAAA,MAAM,eAAe,EAAgB,mBAAmB,CAAA;AA+BxD,eAAe,eAAe,CAAA"}
|
package/build/Swipeable.js
CHANGED
|
@@ -4,6 +4,7 @@ const react_1 = require("react");
|
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
const nativeModuleUtils_1 = require("./nativeModuleUtils");
|
|
7
|
+
const resolveSwipeableActions_1 = require("./resolveSwipeableActions");
|
|
7
8
|
const SwipeableActions_1 = require("./SwipeableActions");
|
|
8
9
|
const SwipeableView_1 = require("./SwipeableView");
|
|
9
10
|
function normalizeRecyclingKey(key) {
|
|
@@ -18,28 +19,37 @@ function normalizeRecyclingKey(key) {
|
|
|
18
19
|
}
|
|
19
20
|
return undefined;
|
|
20
21
|
}
|
|
21
|
-
const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children,
|
|
22
|
+
const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftActions, leftActionsWidth, rightActions, rightActionsWidth, onLeftSwipeEnd, onRightSwipeEnd, appearance = 'default', hapticFeedback, friction = constants_1.SWIPE_DEFAULTS.FRICTION, threshold = constants_1.SWIPE_DEFAULTS.THRESHOLD, gestureEnabled = constants_1.SWIPE_DEFAULTS.GESTURE_ENABLED, dragOffsetFromEdge = constants_1.SWIPE_DEFAULTS.DRAG_OFFSET_FROM_EDGE, style, testID, onSwipeStart, onSwipeStateChange, onSwipeEnd, onProgress, autoClose = false, autoCloseTimeout = 0, recyclingKey }, ref) {
|
|
22
23
|
const nativeRef = (0, react_1.useRef)(null);
|
|
24
|
+
const resolved = (0, react_1.useMemo)(() => (0, resolveSwipeableActions_1.resolveSwipeableActions)({
|
|
25
|
+
leftActions,
|
|
26
|
+
...(leftActionsWidth !== undefined ? { leftActionsWidth } : {}),
|
|
27
|
+
rightActions,
|
|
28
|
+
...(rightActionsWidth !== undefined ? { rightActionsWidth } : {})
|
|
29
|
+
}), [leftActions, leftActionsWidth, rightActions, rightActionsWidth]);
|
|
23
30
|
// Normalize recyclingKey before hooks that depend on it
|
|
24
31
|
const normalizedKey = normalizeRecyclingKey(recyclingKey);
|
|
25
32
|
const recyclingKeyRef = (0, react_1.useRef)(undefined);
|
|
26
33
|
recyclingKeyRef.current = normalizedKey;
|
|
27
|
-
//
|
|
28
|
-
// This handles FlatList remounting components during data reorder - React state is lost
|
|
29
|
-
// but native cache preserves the open state.
|
|
30
|
-
const [hasActionsRendered, setHasActionsRendered] = (0, react_1.useState)(() => {
|
|
31
|
-
return normalizedKey != null && (0, nativeModuleUtils_1.isOpenByKey)(normalizedKey);
|
|
32
|
-
});
|
|
34
|
+
// Hydrate the cached physical edge, including after a keyed list remount.
|
|
33
35
|
const swipeStartedRef = (0, react_1.useRef)(false);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const cachedSide = (0, react_1.useMemo)(() => (normalizedKey != null ? (0, nativeModuleUtils_1.getOpenSideByKey)(normalizedKey) : null), [normalizedKey]);
|
|
37
|
+
const initialSides = (0, react_1.useMemo)(() => ({
|
|
38
|
+
key: normalizedKey,
|
|
39
|
+
left: cachedSide === 'left',
|
|
40
|
+
right: cachedSide === 'right'
|
|
41
|
+
}), [normalizedKey, cachedSide]);
|
|
42
|
+
const [renderedSides, setRenderedSides] = (0, react_1.useState)(initialSides);
|
|
43
|
+
const sides = renderedSides.key === normalizedKey ? renderedSides : initialSides;
|
|
37
44
|
(0, react_1.useEffect)(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
setRenderedSides((previous) => (previous.key === normalizedKey ? previous : initialSides));
|
|
46
|
+
swipeStartedRef.current = false;
|
|
47
|
+
}, [initialSides, normalizedKey]);
|
|
48
|
+
const warningText = resolved.warnings.join('\n');
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
50
|
+
if (__DEV__ && warningText)
|
|
51
|
+
console.warn(`[Swipeable] ${warningText}`);
|
|
52
|
+
}, [warningText]);
|
|
43
53
|
// Development-time validation
|
|
44
54
|
if (__DEV__) {
|
|
45
55
|
if (autoClose && recyclingKey == null) {
|
|
@@ -57,10 +67,13 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, actions
|
|
|
57
67
|
console.warn('[Swipeable] close() called without recyclingKey - method has no effect');
|
|
58
68
|
}
|
|
59
69
|
},
|
|
60
|
-
open: () => {
|
|
70
|
+
open: (side) => {
|
|
61
71
|
const key = recyclingKeyRef.current;
|
|
62
72
|
if (key) {
|
|
63
|
-
(
|
|
73
|
+
if (side === undefined)
|
|
74
|
+
(0, nativeModuleUtils_1.openByKey)(key);
|
|
75
|
+
else
|
|
76
|
+
(0, nativeModuleUtils_1.openByKeyOnSide)(key, side);
|
|
64
77
|
}
|
|
65
78
|
else if (__DEV__) {
|
|
66
79
|
console.warn('[Swipeable] open() called without recyclingKey - method has no effect');
|
|
@@ -80,33 +93,71 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, actions
|
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
95
|
}), []);
|
|
83
|
-
const handleSwipeStart = (0, react_1.useCallback)(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
const handleSwipeStart = (0, react_1.useCallback)((event) => {
|
|
97
|
+
// Missing metadata identifies the unkeyed native binding. It must not
|
|
98
|
+
// bypass identity checks after recycling into a keyed row.
|
|
99
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
100
|
+
return;
|
|
87
101
|
if (!swipeStartedRef.current) {
|
|
88
102
|
swipeStartedRef.current = true;
|
|
89
103
|
onSwipeStart?.();
|
|
90
104
|
}
|
|
91
|
-
}, [
|
|
105
|
+
}, [normalizedKey, onSwipeStart]);
|
|
106
|
+
const handleGestureCancelled = (0, react_1.useCallback)((event) => {
|
|
107
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
108
|
+
return;
|
|
109
|
+
swipeStartedRef.current = false;
|
|
110
|
+
}, [normalizedKey]);
|
|
111
|
+
const handleActionsNeeded = (0, react_1.useCallback)((event) => {
|
|
112
|
+
const side = event.nativeEvent.side;
|
|
113
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
114
|
+
return;
|
|
115
|
+
if ((side !== 'left' && side !== 'right') || resolved[side].width <= 0)
|
|
116
|
+
return;
|
|
117
|
+
setRenderedSides((previous) => {
|
|
118
|
+
const current = previous.key === normalizedKey ? previous : initialSides;
|
|
119
|
+
return current[side] ? current : { ...current, [side]: true };
|
|
120
|
+
});
|
|
121
|
+
}, [initialSides, normalizedKey, resolved]);
|
|
92
122
|
const handleSwipeProgress = (0, react_1.useCallback)((event) => {
|
|
123
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
124
|
+
return;
|
|
93
125
|
const newProgress = event.nativeEvent.progress;
|
|
94
126
|
const clamped = Math.max(0, Math.min(1, newProgress));
|
|
95
127
|
onProgress?.(clamped);
|
|
96
|
-
}, [onProgress]);
|
|
128
|
+
}, [normalizedKey, onProgress]);
|
|
97
129
|
const handleSwipeStateChange = (0, react_1.useCallback)((event) => {
|
|
130
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
131
|
+
return;
|
|
98
132
|
onSwipeStateChange?.(event.nativeEvent.state);
|
|
99
|
-
}, [onSwipeStateChange]);
|
|
133
|
+
}, [normalizedKey, onSwipeStateChange]);
|
|
100
134
|
const handleSwipeEnd = (0, react_1.useCallback)((event) => {
|
|
135
|
+
if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined))
|
|
136
|
+
return;
|
|
101
137
|
swipeStartedRef.current = false;
|
|
102
138
|
onSwipeEnd?.(event.nativeEvent.state);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
const side = event.nativeEvent.side;
|
|
140
|
+
if (side === 'left')
|
|
141
|
+
onLeftSwipeEnd?.(event.nativeEvent.state);
|
|
142
|
+
if (side === 'right')
|
|
143
|
+
onRightSwipeEnd?.(event.nativeEvent.state);
|
|
144
|
+
}, [normalizedKey, onLeftSwipeEnd, onRightSwipeEnd, onSwipeEnd]);
|
|
145
|
+
return (<SwipeableView_1.SwipeableView ref={nativeRef} style={[styles.container, style]} leftActionsWidth={resolved.left.width} rightActionsWidth={resolved.right.width} onActionsNeeded={handleActionsNeeded} {...(react_native_1.Platform.OS === 'ios'
|
|
146
|
+
? { appearance, hapticFeedback: hapticFeedback ?? appearance === 'ios26' }
|
|
147
|
+
: {})} friction={friction} threshold={threshold} gestureEnabled={gestureEnabled} dragOffsetFromEdge={dragOffsetFromEdge} autoClose={autoClose} autoCloseTimeout={autoCloseTimeout} {...(normalizedKey ? { recyclingKey: normalizedKey } : {})} {...(testID ? { testID } : {})} onSwipeStart={handleSwipeStart} onGestureCancelled={handleGestureCancelled} onSwipeProgress={handleSwipeProgress} onSwipeStateChange={handleSwipeStateChange} onSwipeEnd={handleSwipeEnd}>
|
|
148
|
+
<SwipeableActions_1.SwipeableActions key='left-slot' actionsPosition='left' {...(testID ? { testID: `${testID}-left-actions` } : {})}>
|
|
149
|
+
<react_1.Fragment key={normalizedKey ?? ''}>
|
|
150
|
+
{sides.left && resolved.left.width > 0 ? resolved.left.node : null}
|
|
151
|
+
</react_1.Fragment>
|
|
152
|
+
</SwipeableActions_1.SwipeableActions>
|
|
153
|
+
<SwipeableActions_1.SwipeableActions key='right-slot' actionsPosition='right' {...(testID ? { testID: `${testID}-right-actions` } : {})}>
|
|
154
|
+
<react_1.Fragment key={normalizedKey ?? ''}>
|
|
155
|
+
{sides.right && resolved.right.width > 0 ? resolved.right.node : null}
|
|
156
|
+
</react_1.Fragment>
|
|
157
|
+
</SwipeableActions_1.SwipeableActions>
|
|
158
|
+
<react_native_1.View key='content' style={styles.content} collapsable={false}>
|
|
159
|
+
{children}
|
|
160
|
+
</react_native_1.View>
|
|
110
161
|
</SwipeableView_1.SwipeableView>);
|
|
111
162
|
});
|
|
112
163
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -121,12 +172,15 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
121
172
|
});
|
|
122
173
|
Swipeable.displayName = 'Swipeable';
|
|
123
174
|
const SwipeableExport = Swipeable;
|
|
124
|
-
SwipeableExport.open = (recyclingKey) => {
|
|
175
|
+
SwipeableExport.open = (recyclingKey, side) => {
|
|
125
176
|
if (__DEV__ && (!recyclingKey || typeof recyclingKey !== 'string')) {
|
|
126
177
|
console.warn('[Swipeable.open] recyclingKey must be a non-empty string');
|
|
127
178
|
return;
|
|
128
179
|
}
|
|
129
|
-
(
|
|
180
|
+
if (side === undefined)
|
|
181
|
+
(0, nativeModuleUtils_1.openByKey)(recyclingKey);
|
|
182
|
+
else
|
|
183
|
+
(0, nativeModuleUtils_1.openByKeyOnSide)(recyclingKey, side);
|
|
130
184
|
};
|
|
131
185
|
SwipeableExport.close = (recyclingKey, animated) => {
|
|
132
186
|
if (__DEV__ && (!recyclingKey || typeof recyclingKey !== 'string')) {
|
package/build/Swipeable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swipeable.js","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"Swipeable.js","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":";;AAAA,iCAWc;AACd,+CAAyD;AACzD,2CAA4C;AAC5C,2DAO4B;AAC5B,uEAAmE;AAYnE,yDAAqD;AACrD,mDAA+C;AAE/C,SAAS,qBAAqB,CAAC,GAAgC;IAC7D,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,SAAS,CAAA;IACjC,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IACvC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;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A2D,CAAC,CAAA;QACzE,OAAM;IACR,CAAC;IACD,IAAA,8BAAU,EAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,eAAe,CAAC,MAAM,GAAG,CAAC,YAAoB,EAAE,EAAE;IAChD,IAAI,OAAO,IAAI,CAAC,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,CAAC,EAAE,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAA;QAC1E,OAAM;IACR,CAAC;IACD,IAAA,+BAAW,EAAC,YAAY,CAAC,CAAA;AAC3B,CAAC,CAAA;AAED,eAAe,CAAC,QAAQ,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,IAAA,4BAAQ,EAAC,QAAQ,CAAC,CAAA;AACpB,CAAC,CAAA;AAED,kBAAe,eAAe,CAAA"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
export type SwipeSide = 'left' | 'right';
|
|
4
|
+
export type SwipeAppearance = 'default' | 'ios26';
|
|
5
|
+
/** Internal native identity; the consumer's onSwipeStart remains zero-argument. */
|
|
6
|
+
export interface SwipeStartEvent {
|
|
7
|
+
nativeEvent: {
|
|
8
|
+
recyclingKey?: string;
|
|
9
|
+
side?: SwipeSide;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface ActionsNeededEvent {
|
|
13
|
+
nativeEvent: {
|
|
14
|
+
side: SwipeSide;
|
|
15
|
+
recyclingKey?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
3
18
|
export interface SwipeProgressEvent {
|
|
4
19
|
nativeEvent: {
|
|
5
20
|
progress: number;
|
|
6
21
|
translationX: number;
|
|
22
|
+
side?: SwipeSide;
|
|
23
|
+
recyclingKey?: string;
|
|
7
24
|
};
|
|
8
25
|
}
|
|
9
26
|
export interface SwipeStateEvent {
|
|
10
27
|
nativeEvent: {
|
|
11
28
|
state: 'open' | 'closed';
|
|
29
|
+
side?: SwipeSide;
|
|
30
|
+
recyclingKey?: string;
|
|
12
31
|
};
|
|
13
32
|
}
|
|
14
33
|
export interface NativeSwipeableRef {
|
|
@@ -16,16 +35,20 @@ export interface NativeSwipeableRef {
|
|
|
16
35
|
open: () => Promise<void>;
|
|
17
36
|
cancel: () => Promise<void>;
|
|
18
37
|
}
|
|
38
|
+
/** Native child order is always left slot, right slot, then content. */
|
|
19
39
|
export interface SwipeableViewProps extends ViewProps {
|
|
20
|
-
|
|
21
|
-
|
|
40
|
+
leftActionsWidth?: number;
|
|
41
|
+
rightActionsWidth?: number;
|
|
42
|
+
onActionsNeeded?: (event: ActionsNeededEvent) => void;
|
|
43
|
+
appearance?: SwipeAppearance;
|
|
44
|
+
hapticFeedback?: boolean;
|
|
22
45
|
friction?: number;
|
|
23
46
|
threshold?: number;
|
|
24
47
|
gestureEnabled?: boolean;
|
|
25
48
|
dragOffsetFromEdge?: number;
|
|
26
49
|
recyclingKey?: string;
|
|
27
50
|
onSwipeProgress?: (event: SwipeProgressEvent) => void;
|
|
28
|
-
onSwipeStart?: () => void;
|
|
51
|
+
onSwipeStart?: (event: SwipeStartEvent) => void;
|
|
29
52
|
onSwipeStateChange?: (event: SwipeStateEvent) => void;
|
|
30
53
|
onSwipeEnd?: (event: SwipeStateEvent) => void;
|
|
31
54
|
autoClose?: boolean;
|
|
@@ -35,11 +58,13 @@ export interface SwipeableViewProps extends ViewProps {
|
|
|
35
58
|
nativeRef?: Ref<NativeSwipeableRef>;
|
|
36
59
|
testID?: string;
|
|
37
60
|
}
|
|
38
|
-
|
|
61
|
+
/** Props that every side configuration shares. Wrappers that emit declarations name it. */
|
|
62
|
+
export interface SwipeableCommonProps {
|
|
39
63
|
children: ReactNode;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
64
|
+
onLeftSwipeEnd?: (state: 'open' | 'closed') => void;
|
|
65
|
+
onRightSwipeEnd?: (state: 'open' | 'closed') => void;
|
|
66
|
+
appearance?: SwipeAppearance;
|
|
67
|
+
hapticFeedback?: boolean;
|
|
43
68
|
friction?: number;
|
|
44
69
|
threshold?: number;
|
|
45
70
|
gestureEnabled?: boolean;
|
|
@@ -57,13 +82,38 @@ export interface SwipeableProps {
|
|
|
57
82
|
}
|
|
58
83
|
export interface SwipeableMethods {
|
|
59
84
|
close: (animated?: boolean) => void;
|
|
60
|
-
|
|
85
|
+
/** Open the requested physical edge; without a side, prefer enabled right, then left. */
|
|
86
|
+
open: (side?: SwipeSide) => void;
|
|
61
87
|
cancel: () => void;
|
|
62
88
|
}
|
|
63
89
|
export interface SwipeableStatic {
|
|
64
|
-
open: (recyclingKey: string) => void;
|
|
90
|
+
open: (recyclingKey: string, side?: SwipeSide) => void;
|
|
65
91
|
close: (recyclingKey: string, animated?: boolean) => void;
|
|
66
92
|
cancel: (recyclingKey: string) => void;
|
|
67
93
|
closeAll: (animated?: boolean) => void;
|
|
68
94
|
}
|
|
95
|
+
type LeftActionsConfiguration = {
|
|
96
|
+
leftActions: ReactNode;
|
|
97
|
+
leftActionsWidth: number;
|
|
98
|
+
} | {
|
|
99
|
+
leftActions?: null | false | undefined;
|
|
100
|
+
leftActionsWidth?: never;
|
|
101
|
+
};
|
|
102
|
+
type RightActionsConfiguration = {
|
|
103
|
+
rightActions: ReactNode;
|
|
104
|
+
rightActionsWidth: number;
|
|
105
|
+
} | {
|
|
106
|
+
rightActions?: null | false | undefined;
|
|
107
|
+
rightActionsWidth?: never;
|
|
108
|
+
};
|
|
109
|
+
/** The sole action API: explicit physical-edge pairs, including single-sided rows. */
|
|
110
|
+
export type SwipeableProps = SwipeableCommonProps & LeftActionsConfiguration & RightActionsConfiguration & ({
|
|
111
|
+
leftActions: ReactNode;
|
|
112
|
+
} | {
|
|
113
|
+
rightActions: ReactNode;
|
|
114
|
+
});
|
|
115
|
+
/** Descriptive alias for the same explicit-side API, not a separate implementation. */
|
|
116
|
+
export type TwoSidedSwipeableProps = SwipeableProps;
|
|
117
|
+
export type SwipeableComponentProps = SwipeableProps;
|
|
118
|
+
export {};
|
|
69
119
|
//# sourceMappingURL=Swipeable.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swipeable.types.d.ts","sourceRoot":"","sources":["../src/Swipeable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"Swipeable.types.d.ts","sourceRoot":"","sources":["../src/Swipeable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;AACxC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAEjD,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,CAAA;CACzD;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACxD;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,CAA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AAA;AACnD,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAA"}
|
|
@@ -13,7 +13,7 @@ export interface SwipeableActionsProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* SwipeableActions - Internal layout component for swipeable actions
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* Provides a stable physical-edge slot while action content mounts lazily.
|
|
17
17
|
*/
|
|
18
18
|
export declare function SwipeableActions({ children, actionsPosition, testID }: SwipeableActionsProps): import("react").JSX.Element;
|
|
19
19
|
//# sourceMappingURL=SwipeableActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableActions.d.ts","sourceRoot":"","sources":["../src/SwipeableActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,6CAA6C;IAC7C,eAAe,EAAE,MAAM,GAAG,OAAO,CAAA;IACjC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,qBAAqB,+
|
|
1
|
+
{"version":3,"file":"SwipeableActions.d.ts","sourceRoot":"","sources":["../src/SwipeableActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,6CAA6C;IAC7C,eAAe,EAAE,MAAM,GAAG,OAAO,CAAA;IACjC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,qBAAqB,+BAa5F"}
|
|
@@ -5,10 +5,12 @@ const react_native_1 = require("react-native");
|
|
|
5
5
|
/**
|
|
6
6
|
* SwipeableActions - Internal layout component for swipeable actions
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Provides a stable physical-edge slot while action content mounts lazily.
|
|
9
9
|
*/
|
|
10
10
|
function SwipeableActions({ children, actionsPosition, testID }) {
|
|
11
|
-
|
|
11
|
+
// Side names are physical edges; flex row start/end reverse in RTL.
|
|
12
|
+
const leading = react_native_1.I18nManager.isRTL ? actionsPosition === 'right' : actionsPosition === 'left';
|
|
13
|
+
return (<react_native_1.View style={leading ? styles.actionsLeading : styles.actionsTrailing} pointerEvents={children ? 'auto' : 'none'} testID={testID} collapsable={false}>
|
|
12
14
|
{children}
|
|
13
15
|
</react_native_1.View>);
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableActions.js","sourceRoot":"","sources":["../src/SwipeableActions.tsx"],"names":[],"mappings":";;AAoBA,
|
|
1
|
+
{"version":3,"file":"SwipeableActions.js","sourceRoot":"","sources":["../src/SwipeableActions.tsx"],"names":[],"mappings":";;AAoBA,4CAaC;AAhCD,+CAA4D;AAc5D;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAyB;IAC3F,oEAAoE;IACpE,MAAM,OAAO,GAAG,0BAAW,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe,KAAK,MAAM,CAAA;IAC5F,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAChE,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAC1C,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,WAAW,CAAC,CAAC,KAAK,CAAC,CAEnB;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,GAAG,yBAAU,CAAC,YAAY;QAC1B,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,UAAU;KAC3B;IACD,cAAc,EAAE;QACd,GAAG,yBAAU,CAAC,YAAY;QAC1B,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,YAAY;KAC7B;CACF,CAAC,CAAA"}
|
package/build/SwipeableView.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import type { NativeSwipeableRef, SwipeableViewProps } from './Swipeable.types';
|
|
1
|
+
import type { NativeSwipeableRef, SwipeableViewProps, SwipeSide } from './Swipeable.types';
|
|
2
2
|
interface SwipeableNativeModule {
|
|
3
3
|
openByKey: (key: string) => void;
|
|
4
4
|
closeByKey: (key: string, animated?: boolean) => void;
|
|
5
5
|
cancelByKey: (key: string) => void;
|
|
6
6
|
closeAll: (animated?: boolean) => void;
|
|
7
7
|
isOpenByKey: (key: string) => boolean;
|
|
8
|
+
openByKeyOnSide: (key: string, side: SwipeSide) => void;
|
|
9
|
+
getOpenSideByKey: (key: string) => SwipeSide | null;
|
|
8
10
|
}
|
|
9
11
|
export declare const SwipeableModule: SwipeableNativeModule;
|
|
10
|
-
export declare const SwipeableView: import("react").ForwardRefExoticComponent<SwipeableViewProps &
|
|
12
|
+
export declare const SwipeableView: import("react").ForwardRefExoticComponent<SwipeableViewProps & {
|
|
13
|
+
/** Internal lifecycle notification; never forwarded as a consumer completion. */
|
|
14
|
+
onGestureCancelled?: (event: {
|
|
15
|
+
nativeEvent: {
|
|
16
|
+
recyclingKey?: string;
|
|
17
|
+
};
|
|
18
|
+
}) => void;
|
|
19
|
+
} & import("react").RefAttributes<NativeSwipeableRef>>;
|
|
11
20
|
export {};
|
|
12
21
|
//# sourceMappingURL=SwipeableView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableView.d.ts","sourceRoot":"","sources":["../src/SwipeableView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"SwipeableView.d.ts","sourceRoot":"","sources":["../src/SwipeableView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAU1F,UAAU,qBAAqB;IAC7B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IACrD,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IACrC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACvD,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,CAAA;CACpD;AAED,eAAO,MAAM,eAAe,uBAA0D,CAAA;AAEtF,eAAO,MAAM,aAAa;IAnBxB,iFAAiF;yBAC5D,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,YAAY,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI;sDAsBjF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableView.js","sourceRoot":"","sources":["../src/SwipeableView.tsx"],"names":[],"mappings":";;;AAAA,yDAAiF;AACjF,iCAAsE;
|
|
1
|
+
{"version":3,"file":"SwipeableView.js","sourceRoot":"","sources":["../src/SwipeableView.tsx"],"names":[],"mappings":";;;AAAA,yDAAiF;AACjF,iCAAsE;AAQtE,MAAM,UAAU,GAAG,IAAA,4CAAwB,EAAkB,WAAW,CAAC,CAAA;AAa5D,QAAA,eAAe,GAAG,IAAA,uCAAmB,EAAwB,WAAW,CAAC,CAAA;AAEzE,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,SAAS,aAAa,CAAC,KAAK,EAAE,GAAG;IAC/B,OAAO,IAAA,qBAAa,EAAC,UAAU,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAuC,CAAC,CAAA;AAC1F,CAAC,CACF,CAAA;AAED,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
package/build/constants.d.ts
CHANGED
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAGjB,CAAA;AAEV,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAGjB,CAAA;AAEV,eAAO,MAAM,cAAc;;;;;CAKjB,CAAA"}
|
package/build/constants.js
CHANGED
package/build/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;CACd,CAAA;AAEG,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,GAAG;IACd,qBAAqB,EAAE,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;CACd,CAAA;AAEG,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,GAAG;IACd,qBAAqB,EAAE,CAAC;IACxB,eAAe,EAAE,IAAI;CACb,CAAA"}
|
package/build/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { SWIPE_DEFAULTS, SWIPE_PROGRESS } from './constants';
|
|
|
2
2
|
export type { NativeModuleError, SwipeableErrorHandler } from './nativeModuleUtils';
|
|
3
3
|
export { setGlobalErrorHandler } from './nativeModuleUtils';
|
|
4
4
|
export { default as Swipeable } from './Swipeable';
|
|
5
|
-
export type { NativeSwipeableRef, SwipeableMethods, SwipeableProps, SwipeableStatic, SwipeableViewProps, SwipeProgressEvent, SwipeStateEvent } from './Swipeable.types';
|
|
5
|
+
export type { ActionsNeededEvent, NativeSwipeableRef, SwipeAppearance, SwipeSide, SwipeableCommonProps, SwipeableComponentProps, TwoSidedSwipeableProps, SwipeableMethods, SwipeableProps, SwipeableStatic, SwipeableViewProps, SwipeProgressEvent, SwipeStartEvent, SwipeStateEvent } from './Swipeable.types';
|
|
6
6
|
export { SwipeableView } from './SwipeableView';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5D,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4D;AAAnD,2GAAA,cAAc,OAAA;AAAE,2GAAA,cAAc,OAAA;AAEvC,2BAA2B;AAC3B,yDAA2D;AAAlD,0HAAA,qBAAqB,OAAA;AAC9B,yCAAkD;AAAzC,uHAAA,OAAO,OAAa;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4D;AAAnD,2GAAA,cAAc,OAAA;AAAE,2GAAA,cAAc,OAAA;AAEvC,2BAA2B;AAC3B,yDAA2D;AAAlD,0HAAA,qBAAqB,OAAA;AAC9B,yCAAkD;AAAzC,uHAAA,OAAO,OAAa;AAiB7B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SwipeSide } from './Swipeable.types';
|
|
1
2
|
export interface NativeModuleError {
|
|
2
3
|
code: string;
|
|
3
4
|
message: string;
|
|
@@ -6,8 +7,9 @@ export interface NativeModuleError {
|
|
|
6
7
|
export type SwipeableErrorHandler = (error: NativeModuleError, operation: string, key?: string) => void;
|
|
7
8
|
export declare function setGlobalErrorHandler(handler: SwipeableErrorHandler | undefined): void;
|
|
8
9
|
export declare function openByKey(key: string): void;
|
|
10
|
+
export declare function openByKeyOnSide(key: string, side: SwipeSide): void;
|
|
11
|
+
export declare function getOpenSideByKey(key: string): SwipeSide | null;
|
|
9
12
|
export declare function closeByKey(key: string, animated?: boolean): void;
|
|
10
13
|
export declare function cancelByKey(key: string): void;
|
|
11
14
|
export declare function closeAll(animated?: boolean): void;
|
|
12
|
-
export declare function isOpenByKey(key: string): boolean;
|
|
13
15
|
//# sourceMappingURL=nativeModuleUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeModuleUtils.d.ts","sourceRoot":"","sources":["../src/nativeModuleUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativeModuleUtils.d.ts","sourceRoot":"","sources":["../src/nativeModuleUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,MAAM,KACT,IAAI,CAAA;AAIT,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,SAAS,GAAG,IAAI,CAEtF;AAgBD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAM3C;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAMlE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAQ9D;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAMhE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAM7C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAMjD"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setGlobalErrorHandler = setGlobalErrorHandler;
|
|
4
4
|
exports.openByKey = openByKey;
|
|
5
|
+
exports.openByKeyOnSide = openByKeyOnSide;
|
|
6
|
+
exports.getOpenSideByKey = getOpenSideByKey;
|
|
5
7
|
exports.closeByKey = closeByKey;
|
|
6
8
|
exports.cancelByKey = cancelByKey;
|
|
7
9
|
exports.closeAll = closeAll;
|
|
8
|
-
exports.isOpenByKey = isOpenByKey;
|
|
9
10
|
const SwipeableView_1 = require("./SwipeableView");
|
|
10
11
|
let globalErrorHandler;
|
|
11
12
|
function setGlobalErrorHandler(handler) {
|
|
@@ -32,6 +33,24 @@ function openByKey(key) {
|
|
|
32
33
|
handleNativeError(error, 'openByKey', key);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
function openByKeyOnSide(key, side) {
|
|
37
|
+
try {
|
|
38
|
+
SwipeableView_1.SwipeableModule.openByKeyOnSide(key, side);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
handleNativeError(error, 'openByKeyOnSide', key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function getOpenSideByKey(key) {
|
|
45
|
+
try {
|
|
46
|
+
const side = SwipeableView_1.SwipeableModule.getOpenSideByKey(key);
|
|
47
|
+
return side === 'left' || side === 'right' ? side : null;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
handleNativeError(error, 'getOpenSideByKey', key);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
35
54
|
function closeByKey(key, animated) {
|
|
36
55
|
try {
|
|
37
56
|
SwipeableView_1.SwipeableModule.closeByKey(key, animated);
|
|
@@ -56,12 +75,4 @@ function closeAll(animated) {
|
|
|
56
75
|
handleNativeError(error, 'closeAll');
|
|
57
76
|
}
|
|
58
77
|
}
|
|
59
|
-
function isOpenByKey(key) {
|
|
60
|
-
try {
|
|
61
|
-
return SwipeableView_1.SwipeableModule.isOpenByKey(key);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
78
|
//# sourceMappingURL=nativeModuleUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeModuleUtils.js","sourceRoot":"","sources":["../src/nativeModuleUtils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"nativeModuleUtils.js","sourceRoot":"","sources":["../src/nativeModuleUtils.ts"],"names":[],"mappings":";;AAiBA,sDAEC;AAgBD,8BAMC;AAED,0CAMC;AAED,4CAQC;AAED,gCAMC;AAED,kCAMC;AAED,4BAMC;AAnFD,mDAAiD;AAejD,IAAI,kBAAqD,CAAA;AAEzD,SAAgB,qBAAqB,CAAC,OAA0C;IAC9E,kBAAkB,GAAG,OAAO,CAAA;AAC9B,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc,EAAE,S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KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;QACjD,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAgB,UAAU,CAAC,GAAW,EAAE,QAAkB;IACxD,IAAI,CAAC;QACH,+BAAe,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CAAA;IAC7C,CAAC;AACH,CAAC;AAED,SAAgB,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC;QACH,+BAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,CAAC,CAAA;IAC9C,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAC,QAAkB;IACzC,IAAI,CAAC;QACH,+BAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
interface ActionsInput {
|
|
3
|
+
leftActions?: ReactNode;
|
|
4
|
+
leftActionsWidth?: number;
|
|
5
|
+
rightActions?: ReactNode;
|
|
6
|
+
rightActionsWidth?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolvedActions {
|
|
9
|
+
node: ReactNode;
|
|
10
|
+
width: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveSwipeableActions(input: ActionsInput): {
|
|
13
|
+
left: ResolvedActions;
|
|
14
|
+
right: ResolvedActions;
|
|
15
|
+
warnings: string[];
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=resolveSwipeableActions.d.ts.map
|