@react-navigation/drawer 6.6.2 → 7.0.0-alpha.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/lib/commonjs/index.js +24 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +8 -49
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +3 -3
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +2 -3
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +3 -4
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +5 -6
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +6 -7
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +14 -10
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +9 -10
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +78 -73
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/module/index.js +11 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +5 -45
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js +1 -2
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js +2 -2
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +3 -3
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +3 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +15 -11
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +9 -9
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +1 -1
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +72 -67
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/typescript/src/index.d.ts +11 -13
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +9 -4
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +51 -16
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +11 -6
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItemList.d.ts +2 -2
- package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +2 -2
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +2 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/index.tsx +15 -13
- package/src/navigators/createDrawerNavigator.tsx +4 -74
- package/src/types.tsx +24 -3
- package/src/utils/DrawerPositionContext.tsx +3 -1
- package/src/utils/DrawerStatusContext.tsx +3 -5
- package/src/utils/getDrawerStatusFromState.tsx +1 -1
- package/src/utils/useDrawerStatus.tsx +2 -2
- package/src/views/DrawerContent.tsx +3 -3
- package/src/views/DrawerContentScrollView.tsx +5 -3
- package/src/views/DrawerItem.tsx +23 -20
- package/src/views/DrawerItemList.tsx +7 -10
- package/src/views/DrawerToggleButton.tsx +1 -1
- package/src/views/DrawerView.tsx +68 -78
- package/lib/commonjs/utils/DrawerGestureContext.js +0 -12
- package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
- package/lib/commonjs/utils/DrawerProgressContext.js +0 -12
- package/lib/commonjs/utils/DrawerProgressContext.js.map +0 -1
- package/lib/commonjs/utils/useDrawerProgress.js +0 -19
- package/lib/commonjs/utils/useDrawerProgress.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.android.js +0 -17
- package/lib/commonjs/views/GestureHandler.android.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.ios.js +0 -17
- package/lib/commonjs/views/GestureHandler.ios.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.js +0 -32
- package/lib/commonjs/views/GestureHandler.js.map +0 -1
- package/lib/commonjs/views/GestureHandlerNative.js +0 -37
- package/lib/commonjs/views/GestureHandlerNative.js.map +0 -1
- package/lib/commonjs/views/legacy/Drawer.js +0 -438
- package/lib/commonjs/views/legacy/Drawer.js.map +0 -1
- package/lib/commonjs/views/legacy/Overlay.js +0 -74
- package/lib/commonjs/views/legacy/Overlay.js.map +0 -1
- package/lib/commonjs/views/modern/Drawer.js +0 -304
- package/lib/commonjs/views/modern/Drawer.js.map +0 -1
- package/lib/commonjs/views/modern/Overlay.js +0 -69
- package/lib/commonjs/views/modern/Overlay.js.map +0 -1
- package/lib/module/utils/DrawerGestureContext.js +0 -3
- package/lib/module/utils/DrawerGestureContext.js.map +0 -1
- package/lib/module/utils/DrawerProgressContext.js +0 -3
- package/lib/module/utils/DrawerProgressContext.js.map +0 -1
- package/lib/module/utils/useDrawerProgress.js +0 -10
- package/lib/module/utils/useDrawerProgress.js.map +0 -1
- package/lib/module/views/GestureHandler.android.js +0 -2
- package/lib/module/views/GestureHandler.android.js.map +0 -1
- package/lib/module/views/GestureHandler.ios.js +0 -2
- package/lib/module/views/GestureHandler.ios.js.map +0 -1
- package/lib/module/views/GestureHandler.js +0 -20
- package/lib/module/views/GestureHandler.js.map +0 -1
- package/lib/module/views/GestureHandlerNative.js +0 -11
- package/lib/module/views/GestureHandlerNative.js.map +0 -1
- package/lib/module/views/legacy/Drawer.js +0 -428
- package/lib/module/views/legacy/Drawer.js.map +0 -1
- package/lib/module/views/legacy/Overlay.js +0 -64
- package/lib/module/views/legacy/Overlay.js.map +0 -1
- package/lib/module/views/modern/Drawer.js +0 -295
- package/lib/module/views/modern/Drawer.js.map +0 -1
- package/lib/module/views/modern/Overlay.js +0 -60
- package/lib/module/views/modern/Overlay.js.map +0 -1
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -4
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts +0 -5
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/useDrawerProgress.d.ts +0 -3
- package/lib/typescript/src/utils/useDrawerProgress.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.android.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.d.ts +0 -15
- package/lib/typescript/src/views/GestureHandler.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +0 -6
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Drawer.d.ts +0 -45
- package/lib/typescript/src/views/legacy/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/legacy/Overlay.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Drawer.d.ts +0 -4
- package/lib/typescript/src/views/modern/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/modern/Overlay.d.ts.map +0 -1
- package/src/utils/DrawerGestureContext.tsx +0 -3
- package/src/utils/DrawerProgressContext.tsx +0 -6
- package/src/utils/useDrawerProgress.tsx +0 -18
- package/src/views/GestureHandler.android.tsx +0 -1
- package/src/views/GestureHandler.ios.tsx +0 -1
- package/src/views/GestureHandler.tsx +0 -29
- package/src/views/GestureHandlerNative.tsx +0 -24
- package/src/views/legacy/Drawer.tsx +0 -672
- package/src/views/legacy/Overlay.tsx +0 -87
- package/src/views/modern/Drawer.tsx +0 -425
- package/src/views/modern/Overlay.tsx +0 -82
package/src/views/DrawerItem.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
2
|
-
import { Link, useTheme } from '@react-navigation/native';
|
|
2
|
+
import { CommonActions, Link, Route, useTheme } from '@react-navigation/native';
|
|
3
3
|
import Color from 'color';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import {
|
|
@@ -13,6 +13,14 @@ import {
|
|
|
13
13
|
} from 'react-native';
|
|
14
14
|
|
|
15
15
|
type Props = {
|
|
16
|
+
/**
|
|
17
|
+
* The route object which should be specified by the drawer item.
|
|
18
|
+
*/
|
|
19
|
+
route: Route<string>;
|
|
20
|
+
/**
|
|
21
|
+
* The `href` to use for the anchor tag on web
|
|
22
|
+
*/
|
|
23
|
+
href?: string;
|
|
16
24
|
/**
|
|
17
25
|
* The label text of the item.
|
|
18
26
|
*/
|
|
@@ -27,10 +35,6 @@ type Props = {
|
|
|
27
35
|
size: number;
|
|
28
36
|
color: string;
|
|
29
37
|
}) => React.ReactNode;
|
|
30
|
-
/**
|
|
31
|
-
* URL to use for the link to the tab.
|
|
32
|
-
*/
|
|
33
|
-
to?: string;
|
|
34
38
|
/**
|
|
35
39
|
* Whether to highlight the drawer item as active.
|
|
36
40
|
*/
|
|
@@ -93,29 +97,32 @@ type Props = {
|
|
|
93
97
|
};
|
|
94
98
|
|
|
95
99
|
const LinkPressable = ({
|
|
100
|
+
route,
|
|
101
|
+
href,
|
|
96
102
|
children,
|
|
97
103
|
style,
|
|
98
104
|
onPress,
|
|
99
105
|
onLongPress,
|
|
100
106
|
onPressIn,
|
|
101
107
|
onPressOut,
|
|
102
|
-
to,
|
|
103
108
|
accessibilityRole,
|
|
104
109
|
...rest
|
|
105
110
|
}: Omit<React.ComponentProps<typeof PlatformPressable>, 'style'> & {
|
|
106
111
|
style: StyleProp<ViewStyle>;
|
|
107
112
|
} & {
|
|
108
|
-
|
|
113
|
+
route: Route<string>;
|
|
114
|
+
href?: string;
|
|
109
115
|
children: React.ReactNode;
|
|
110
116
|
onPress?: () => void;
|
|
111
117
|
}) => {
|
|
112
|
-
if (Platform.OS === 'web'
|
|
118
|
+
if (Platform.OS === 'web') {
|
|
113
119
|
// React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
|
|
114
120
|
// We need to use `onClick` to be able to prevent default browser handling of links.
|
|
115
121
|
return (
|
|
116
122
|
<Link
|
|
117
123
|
{...rest}
|
|
118
|
-
|
|
124
|
+
href={href}
|
|
125
|
+
action={CommonActions.navigate(route.name, route.params)}
|
|
119
126
|
style={[styles.button, style]}
|
|
120
127
|
onPress={(e: any) => {
|
|
121
128
|
if (
|
|
@@ -151,14 +158,15 @@ const LinkPressable = ({
|
|
|
151
158
|
/**
|
|
152
159
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
153
160
|
*/
|
|
154
|
-
export
|
|
155
|
-
const { colors } = useTheme();
|
|
161
|
+
export function DrawerItem(props: Props) {
|
|
162
|
+
const { colors, fonts } = useTheme();
|
|
156
163
|
|
|
157
164
|
const {
|
|
165
|
+
route,
|
|
166
|
+
href,
|
|
158
167
|
icon,
|
|
159
168
|
label,
|
|
160
169
|
labelStyle,
|
|
161
|
-
to,
|
|
162
170
|
focused = false,
|
|
163
171
|
allowFontScaling,
|
|
164
172
|
activeTintColor = colors.primary,
|
|
@@ -197,7 +205,8 @@ export default function DrawerItem(props: Props) {
|
|
|
197
205
|
accessibilityState={{ selected: focused }}
|
|
198
206
|
pressColor={pressColor}
|
|
199
207
|
pressOpacity={pressOpacity}
|
|
200
|
-
|
|
208
|
+
route={route}
|
|
209
|
+
href={href}
|
|
201
210
|
>
|
|
202
211
|
<React.Fragment>
|
|
203
212
|
{iconNode}
|
|
@@ -211,13 +220,7 @@ export default function DrawerItem(props: Props) {
|
|
|
211
220
|
<Text
|
|
212
221
|
numberOfLines={1}
|
|
213
222
|
allowFontScaling={allowFontScaling}
|
|
214
|
-
style={[
|
|
215
|
-
{
|
|
216
|
-
color,
|
|
217
|
-
fontWeight: '500',
|
|
218
|
-
},
|
|
219
|
-
labelStyle,
|
|
220
|
-
]}
|
|
223
|
+
style={[{ color }, fonts.medium, labelStyle]}
|
|
221
224
|
>
|
|
222
225
|
{label}
|
|
223
226
|
</Text>
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
DrawerActions,
|
|
4
4
|
DrawerNavigationState,
|
|
5
5
|
ParamListBase,
|
|
6
|
-
|
|
6
|
+
useLinkTools,
|
|
7
7
|
} from '@react-navigation/native';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
|
|
10
10
|
import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
|
|
11
|
-
import DrawerItem from './DrawerItem';
|
|
11
|
+
import { DrawerItem } from './DrawerItem';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
state: DrawerNavigationState<ParamListBase>;
|
|
@@ -19,12 +19,8 @@ type Props = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Component that renders the navigation list in the drawer.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
navigation,
|
|
25
|
-
descriptors,
|
|
26
|
-
}: Props) {
|
|
27
|
-
const buildLink = useLinkBuilder();
|
|
22
|
+
export function DrawerItemList({ state, navigation, descriptors }: Props) {
|
|
23
|
+
const { buildHref } = useLinkTools();
|
|
28
24
|
|
|
29
25
|
const focusedRoute = state.routes[state.index];
|
|
30
26
|
const focusedDescriptor = descriptors[focusedRoute.key];
|
|
@@ -51,7 +47,7 @@ export default function DrawerItemList({
|
|
|
51
47
|
navigation.dispatch({
|
|
52
48
|
...(focused
|
|
53
49
|
? DrawerActions.closeDrawer()
|
|
54
|
-
: CommonActions.navigate(
|
|
50
|
+
: CommonActions.navigate(route)),
|
|
55
51
|
target: state.key,
|
|
56
52
|
});
|
|
57
53
|
}
|
|
@@ -69,6 +65,8 @@ export default function DrawerItemList({
|
|
|
69
65
|
return (
|
|
70
66
|
<DrawerItem
|
|
71
67
|
key={route.key}
|
|
68
|
+
route={route}
|
|
69
|
+
href={buildHref(route.name, route.params)}
|
|
72
70
|
label={
|
|
73
71
|
drawerLabel !== undefined
|
|
74
72
|
? drawerLabel
|
|
@@ -85,7 +83,6 @@ export default function DrawerItemList({
|
|
|
85
83
|
allowFontScaling={drawerAllowFontScaling}
|
|
86
84
|
labelStyle={drawerLabelStyle}
|
|
87
85
|
style={drawerItemStyle}
|
|
88
|
-
to={buildLink(route.name, route.params)}
|
|
89
86
|
onPress={onPress}
|
|
90
87
|
/>
|
|
91
88
|
);
|
|
@@ -16,7 +16,7 @@ type Props = {
|
|
|
16
16
|
tintColor?: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export function DrawerToggleButton({ tintColor, ...rest }: Props) {
|
|
20
20
|
const navigation = useNavigation<DrawerNavigationProp<ParamListBase>>();
|
|
21
21
|
|
|
22
22
|
return (
|
package/src/views/DrawerView.tsx
CHANGED
|
@@ -12,15 +12,10 @@ import {
|
|
|
12
12
|
useTheme,
|
|
13
13
|
} from '@react-navigation/native';
|
|
14
14
|
import * as React from 'react';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
I18nManager,
|
|
18
|
-
Platform,
|
|
19
|
-
StyleSheet,
|
|
20
|
-
View,
|
|
21
|
-
} from 'react-native';
|
|
22
|
-
import * as Reanimated from 'react-native-reanimated';
|
|
15
|
+
import { BackHandler, I18nManager, Platform, StyleSheet } from 'react-native';
|
|
16
|
+
import { Drawer } from 'react-native-drawer-layout';
|
|
23
17
|
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
|
18
|
+
import useLatestCallback from 'use-latest-callback';
|
|
24
19
|
|
|
25
20
|
import type {
|
|
26
21
|
DrawerContentComponentProps,
|
|
@@ -29,14 +24,12 @@ import type {
|
|
|
29
24
|
DrawerNavigationConfig,
|
|
30
25
|
DrawerNavigationHelpers,
|
|
31
26
|
DrawerNavigationProp,
|
|
32
|
-
DrawerProps,
|
|
33
27
|
} from '../types';
|
|
34
|
-
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
35
|
-
import DrawerStatusContext from '../utils/DrawerStatusContext';
|
|
36
|
-
import getDrawerStatusFromState from '../utils/getDrawerStatusFromState';
|
|
37
|
-
import DrawerContent from './DrawerContent';
|
|
38
|
-
import DrawerToggleButton from './DrawerToggleButton';
|
|
39
|
-
import { GestureHandlerRootView } from './GestureHandler';
|
|
28
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
29
|
+
import { DrawerStatusContext } from '../utils/DrawerStatusContext';
|
|
30
|
+
import { getDrawerStatusFromState } from '../utils/getDrawerStatusFromState';
|
|
31
|
+
import { DrawerContent } from './DrawerContent';
|
|
32
|
+
import { DrawerToggleButton } from './DrawerToggleButton';
|
|
40
33
|
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
|
41
34
|
|
|
42
35
|
type Props = DrawerNavigationConfig & {
|
|
@@ -46,29 +39,6 @@ type Props = DrawerNavigationConfig & {
|
|
|
46
39
|
descriptors: DrawerDescriptorMap;
|
|
47
40
|
};
|
|
48
41
|
|
|
49
|
-
const getDefaultDrawerWidth = ({
|
|
50
|
-
height,
|
|
51
|
-
width,
|
|
52
|
-
}: {
|
|
53
|
-
height: number;
|
|
54
|
-
width: number;
|
|
55
|
-
}) => {
|
|
56
|
-
/*
|
|
57
|
-
* Default drawer width is screen width - header height
|
|
58
|
-
* with a max width of 280 on mobile and 320 on tablet
|
|
59
|
-
* https://material.io/components/navigation-drawer
|
|
60
|
-
*/
|
|
61
|
-
const smallerAxisSize = Math.min(height, width);
|
|
62
|
-
const isLandscape = width > height;
|
|
63
|
-
const isTablet = smallerAxisSize >= 600;
|
|
64
|
-
const appBarHeight = Platform.OS === 'ios' ? (isLandscape ? 32 : 44) : 56;
|
|
65
|
-
const maxWidth = isTablet ? 320 : 280;
|
|
66
|
-
|
|
67
|
-
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const GestureHandlerWrapper = GestureHandlerRootView ?? View;
|
|
71
|
-
|
|
72
42
|
function DrawerViewBase({
|
|
73
43
|
state,
|
|
74
44
|
navigation,
|
|
@@ -80,39 +50,22 @@ function DrawerViewBase({
|
|
|
80
50
|
detachInactiveScreens = Platform.OS === 'web' ||
|
|
81
51
|
Platform.OS === 'android' ||
|
|
82
52
|
Platform.OS === 'ios',
|
|
83
|
-
// Reanimated 2 is not configured
|
|
84
|
-
// @ts-expect-error: the type definitions are incomplete
|
|
85
|
-
useLegacyImplementation = !Reanimated.isConfigured?.(),
|
|
86
53
|
}: Props) {
|
|
87
|
-
// Reanimated v3 dropped legacy v1 syntax
|
|
88
|
-
const legacyImplemenationNotAvailable =
|
|
89
|
-
require('react-native-reanimated').abs === undefined;
|
|
90
|
-
|
|
91
|
-
if (useLegacyImplementation && legacyImplemenationNotAvailable) {
|
|
92
|
-
throw new Error(
|
|
93
|
-
'The `useLegacyImplementation` prop is not available with Reanimated 3 as it no longer includes support for Reanimated 1 legacy API. Remove the `useLegacyImplementation` prop from `Drawer.Navigator` to be able to use it.'
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const Drawer: React.ComponentType<DrawerProps> = useLegacyImplementation
|
|
98
|
-
? require('./legacy/Drawer').default
|
|
99
|
-
: require('./modern/Drawer').default;
|
|
100
|
-
|
|
101
54
|
const focusedRouteKey = state.routes[state.index].key;
|
|
102
55
|
const {
|
|
103
|
-
drawerHideStatusBarOnOpen
|
|
56
|
+
drawerHideStatusBarOnOpen,
|
|
104
57
|
drawerPosition = I18nManager.getConstants().isRTL ? 'right' : 'left',
|
|
105
|
-
drawerStatusBarAnimation
|
|
58
|
+
drawerStatusBarAnimation,
|
|
106
59
|
drawerStyle,
|
|
107
|
-
drawerType
|
|
60
|
+
drawerType,
|
|
108
61
|
gestureHandlerProps,
|
|
109
|
-
keyboardDismissMode
|
|
62
|
+
keyboardDismissMode,
|
|
110
63
|
overlayColor = 'rgba(0, 0, 0, 0.5)',
|
|
111
|
-
swipeEdgeWidth
|
|
64
|
+
swipeEdgeWidth,
|
|
112
65
|
swipeEnabled = Platform.OS !== 'web' &&
|
|
113
66
|
Platform.OS !== 'windows' &&
|
|
114
67
|
Platform.OS !== 'macos',
|
|
115
|
-
swipeMinDistance
|
|
68
|
+
swipeMinDistance,
|
|
116
69
|
overlayAccessibilityLabel,
|
|
117
70
|
} = descriptors[focusedRouteKey].options;
|
|
118
71
|
|
|
@@ -128,19 +81,56 @@ function DrawerViewBase({
|
|
|
128
81
|
|
|
129
82
|
const drawerStatus = getDrawerStatusFromState(state);
|
|
130
83
|
|
|
131
|
-
const handleDrawerOpen =
|
|
84
|
+
const handleDrawerOpen = useLatestCallback(() => {
|
|
132
85
|
navigation.dispatch({
|
|
133
86
|
...DrawerActions.openDrawer(),
|
|
134
87
|
target: state.key,
|
|
135
88
|
});
|
|
136
|
-
}
|
|
89
|
+
});
|
|
137
90
|
|
|
138
|
-
const handleDrawerClose =
|
|
91
|
+
const handleDrawerClose = useLatestCallback(() => {
|
|
139
92
|
navigation.dispatch({
|
|
140
93
|
...DrawerActions.closeDrawer(),
|
|
141
94
|
target: state.key,
|
|
142
95
|
});
|
|
143
|
-
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const handleGestureStart = useLatestCallback(() => {
|
|
99
|
+
navigation.emit({
|
|
100
|
+
type: 'gestureStart',
|
|
101
|
+
target: state.key,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const handleGestureEnd = useLatestCallback(() => {
|
|
106
|
+
navigation.emit({
|
|
107
|
+
type: 'gestureEnd',
|
|
108
|
+
target: state.key,
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const handleGestureCancel = useLatestCallback(() => {
|
|
113
|
+
navigation.emit({
|
|
114
|
+
type: 'gestureCancel',
|
|
115
|
+
target: state.key,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const handleTransitionStart = useLatestCallback((closing: boolean) => {
|
|
120
|
+
navigation.emit({
|
|
121
|
+
type: 'transitionStart',
|
|
122
|
+
data: { closing },
|
|
123
|
+
target: state.key,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const handleTransitionEnd = useLatestCallback((closing: boolean) => {
|
|
128
|
+
navigation.emit({
|
|
129
|
+
type: 'transitionEnd',
|
|
130
|
+
data: { closing },
|
|
131
|
+
target: state.key,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
144
134
|
|
|
145
135
|
React.useEffect(() => {
|
|
146
136
|
if (drawerStatus === defaultStatus || drawerType === 'permanent') {
|
|
@@ -288,11 +278,16 @@ function DrawerViewBase({
|
|
|
288
278
|
open={drawerStatus !== 'closed'}
|
|
289
279
|
onOpen={handleDrawerOpen}
|
|
290
280
|
onClose={handleDrawerClose}
|
|
281
|
+
onGestureStart={handleGestureStart}
|
|
282
|
+
onGestureEnd={handleGestureEnd}
|
|
283
|
+
onGestureCancel={handleGestureCancel}
|
|
284
|
+
onTransitionStart={handleTransitionStart}
|
|
285
|
+
onTransitionEnd={handleTransitionEnd}
|
|
286
|
+
layout={dimensions}
|
|
291
287
|
gestureHandlerProps={gestureHandlerProps}
|
|
292
288
|
swipeEnabled={swipeEnabled}
|
|
293
289
|
swipeEdgeWidth={swipeEdgeWidth}
|
|
294
|
-
|
|
295
|
-
swipeDistanceThreshold={swipeMinDistance}
|
|
290
|
+
swipeMinDistance={swipeMinDistance}
|
|
296
291
|
hideStatusBarOnOpen={drawerHideStatusBarOnOpen}
|
|
297
292
|
statusBarAnimation={drawerStatusBarAnimation}
|
|
298
293
|
keyboardDismissMode={keyboardDismissMode}
|
|
@@ -300,10 +295,7 @@ function DrawerViewBase({
|
|
|
300
295
|
overlayAccessibilityLabel={overlayAccessibilityLabel}
|
|
301
296
|
drawerPosition={drawerPosition}
|
|
302
297
|
drawerStyle={[
|
|
303
|
-
{
|
|
304
|
-
width: getDefaultDrawerWidth(dimensions),
|
|
305
|
-
backgroundColor: colors.card,
|
|
306
|
-
},
|
|
298
|
+
{ backgroundColor: colors.card },
|
|
307
299
|
drawerType === 'permanent' &&
|
|
308
300
|
(drawerPosition === 'left'
|
|
309
301
|
? {
|
|
@@ -318,19 +310,17 @@ function DrawerViewBase({
|
|
|
318
310
|
]}
|
|
319
311
|
overlayStyle={{ backgroundColor: overlayColor }}
|
|
320
312
|
renderDrawerContent={renderDrawerContent}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
313
|
+
>
|
|
314
|
+
{renderSceneContent()}
|
|
315
|
+
</Drawer>
|
|
324
316
|
</DrawerStatusContext.Provider>
|
|
325
317
|
);
|
|
326
318
|
}
|
|
327
319
|
|
|
328
|
-
export
|
|
320
|
+
export function DrawerView({ navigation, ...rest }: Props) {
|
|
329
321
|
return (
|
|
330
322
|
<SafeAreaProviderCompat>
|
|
331
|
-
<
|
|
332
|
-
<DrawerViewBase navigation={navigation} {...rest} />
|
|
333
|
-
</GestureHandlerWrapper>
|
|
323
|
+
<DrawerViewBase navigation={navigation} {...rest} />
|
|
334
324
|
</SafeAreaProviderCompat>
|
|
335
325
|
);
|
|
336
326
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
-
var _default = /*#__PURE__*/React.createContext(null);
|
|
11
|
-
exports.default = _default;
|
|
12
|
-
//# sourceMappingURL=DrawerGestureContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext"],"sourceRoot":"../../../src","sources":["utils/DrawerGestureContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAA8B,IAAI,CAAC;AAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
-
var _default = /*#__PURE__*/React.createContext(undefined);
|
|
11
|
-
exports.default = _default;
|
|
12
|
-
//# sourceMappingURL=DrawerProgressContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../../src","sources":["utils/DrawerProgressContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAGhBA,KAAK,CAACC,aAAa,CAEhCC,SAAS,CAAC;AAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = useDrawerProgress;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _DrawerProgressContext = _interopRequireDefault(require("./DrawerProgressContext"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function useDrawerProgress() {
|
|
13
|
-
const progress = React.useContext(_DrawerProgressContext.default);
|
|
14
|
-
if (progress === undefined) {
|
|
15
|
-
throw new Error("Couldn't find a drawer. Is your component inside a drawer navigator?");
|
|
16
|
-
}
|
|
17
|
-
return progress;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=useDrawerProgress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDrawerProgress","progress","React","useContext","DrawerProgressContext","undefined","Error"],"sourceRoot":"../../../src","sources":["utils/useDrawerProgress.tsx"],"mappings":";;;;;;AAAA;AAGA;AAA4D;AAAA;AAAA;AAE7C,SAASA,iBAAiB,GAEf;EACxB,MAAMC,QAAQ,GAAGC,KAAK,CAACC,UAAU,CAACC,8BAAqB,CAAC;EAExD,IAAIH,QAAQ,KAAKI,SAAS,EAAE;IAC1B,MAAM,IAAIC,KAAK,CACb,sEAAsE,CACvE;EACH;EAEA,OAAOL,QAAQ;AACjB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _GestureHandlerNative = require("./GestureHandlerNative");
|
|
7
|
-
Object.keys(_GestureHandlerNative).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _GestureHandlerNative[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _GestureHandlerNative[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=GestureHandler.android.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["views/GestureHandler.android.tsx"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _GestureHandlerNative = require("./GestureHandlerNative");
|
|
7
|
-
Object.keys(_GestureHandlerNative).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _GestureHandlerNative[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _GestureHandlerNative[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=GestureHandler.ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["views/GestureHandler.ios.tsx"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TapGestureHandler = exports.PanGestureHandler = exports.GestureState = exports.GestureHandlerRootView = void 0;
|
|
7
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
const Dummy = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
children
|
|
14
|
-
} = _ref;
|
|
15
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
16
|
-
};
|
|
17
|
-
const PanGestureHandler = Dummy;
|
|
18
|
-
exports.PanGestureHandler = PanGestureHandler;
|
|
19
|
-
const TapGestureHandler = Dummy;
|
|
20
|
-
exports.TapGestureHandler = TapGestureHandler;
|
|
21
|
-
const GestureHandlerRootView = _reactNative.View;
|
|
22
|
-
exports.GestureHandlerRootView = GestureHandlerRootView;
|
|
23
|
-
const GestureState = {
|
|
24
|
-
UNDETERMINED: 0,
|
|
25
|
-
FAILED: 1,
|
|
26
|
-
BEGAN: 2,
|
|
27
|
-
CANCELLED: 3,
|
|
28
|
-
ACTIVE: 4,
|
|
29
|
-
END: 5
|
|
30
|
-
};
|
|
31
|
-
exports.GestureState = GestureState;
|
|
32
|
-
//# sourceMappingURL=GestureHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Dummy","children","PanGestureHandler","TapGestureHandler","GestureHandlerRootView","View","GestureState","UNDETERMINED","FAILED","BEGAN","CANCELLED","ACTIVE","END"],"sourceRoot":"../../../src","sources":["views/GestureHandler.tsx"],"mappings":";;;;;;AAAA;AACA;AAAoC;AAAA;AAMpC,MAAMA,KAAU,GAAG;EAAA,IAAC;IAAEC;EAAwC,CAAC;EAAA,oBAC7D,0CAAGA,QAAQ,CAAI;AAAA,CAChB;AAEM,MAAMC,iBAAiB,GAC5BF,KAAyD;AAAC;AAErD,MAAMG,iBAAiB,GAC5BH,KAAyD;AAAC;AAErD,MAAMI,sBAAsB,GAAGC,iBAAI;AAAC;AAEpC,MAAMC,YAAY,GAAG;EAC1BC,YAAY,EAAE,CAAC;EACfC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,MAAM,EAAE,CAAC;EACTC,GAAG,EAAE;AACP,CAAC;AAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "GestureHandlerRootView", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _reactNativeGestureHandler.GestureHandlerRootView;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "GestureState", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _reactNativeGestureHandler.State;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
exports.PanGestureHandler = PanGestureHandler;
|
|
19
|
-
Object.defineProperty(exports, "TapGestureHandler", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _reactNativeGestureHandler.TapGestureHandler;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var React = _interopRequireWildcard(require("react"));
|
|
26
|
-
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
27
|
-
var _DrawerGestureContext = _interopRequireDefault(require("../utils/DrawerGestureContext"));
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
function PanGestureHandler(props) {
|
|
32
|
-
const gestureRef = React.useRef(null);
|
|
33
|
-
return /*#__PURE__*/React.createElement(_DrawerGestureContext.default.Provider, {
|
|
34
|
-
value: gestureRef
|
|
35
|
-
}, /*#__PURE__*/React.createElement(_reactNativeGestureHandler.PanGestureHandler, props));
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=GestureHandlerNative.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PanGestureHandler","props","gestureRef","React","useRef"],"sourceRoot":"../../../src","sources":["views/GestureHandlerNative.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAKA;AAAiE;AAAA;AAAA;AAE1D,SAASA,iBAAiB,CAACC,KAAkC,EAAE;EACpE,MAAMC,UAAU,GAAGC,KAAK,CAACC,MAAM,CAA0B,IAAI,CAAC;EAE9D,oBACE,oBAAC,6BAAoB,CAAC,QAAQ;IAAC,KAAK,EAAEF;EAAW,gBAC/C,oBAAC,4CAAuB,EAAKD,KAAK,CAAI,CACR;AAEpC"}
|