@react-navigation/drawer 7.0.0-alpha.2 → 7.0.0-alpha.21
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 +0 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +13 -6
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +3 -4
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +3 -4
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/addCancelListener.js +19 -0
- package/lib/commonjs/utils/addCancelListener.js.map +1 -0
- package/lib/commonjs/utils/addCancelListener.native.js +15 -0
- package/lib/commonjs/utils/addCancelListener.native.js.map +1 -0
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +2 -2
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +2 -2
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +10 -6
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +22 -66
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +3 -3
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +4 -6
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +29 -30
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +4 -6
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +10 -2
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/addCancelListener.js +12 -0
- package/lib/module/utils/addCancelListener.js.map +1 -0
- package/lib/module/utils/addCancelListener.native.js +8 -0
- package/lib/module/utils/addCancelListener.native.js.map +1 -0
- package/lib/module/utils/getDrawerStatusFromState.js +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +8 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +22 -66
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +2 -2
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +2 -4
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +30 -31
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +2 -4
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +15 -9
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -16
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/addCancelListener.d.ts +2 -0
- package/lib/typescript/src/utils/addCancelListener.d.ts.map +1 -0
- package/lib/typescript/src/utils/addCancelListener.native.d.ts +2 -0
- package/lib/typescript/src/utils/addCancelListener.native.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerContent.d.ts +2 -1
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +3 -3
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItemList.d.ts +1 -1
- package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +2 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +3 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +3 -3
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/package.json +22 -23
- package/src/index.tsx +1 -1
- package/src/navigators/createDrawerNavigator.tsx +42 -12
- package/src/types.tsx +15 -20
- package/src/utils/addCancelListener.native.tsx +12 -0
- package/src/utils/addCancelListener.tsx +13 -0
- package/src/views/DrawerContentScrollView.tsx +9 -10
- package/src/views/DrawerItem.tsx +22 -87
- package/src/views/DrawerItemList.tsx +6 -6
- package/src/views/DrawerToggleButton.tsx +2 -4
- package/src/views/DrawerView.tsx +42 -37
- package/src/views/ScreenFallback.tsx +6 -1
|
@@ -1,55 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { PlatformPressable } from '@react-navigation/elements';
|
|
3
|
-
import {
|
|
2
|
+
import { PlatformPressable, Text } from '@react-navigation/elements';
|
|
3
|
+
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import Color from 'color';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
const LinkPressable = _ref => {
|
|
8
|
-
let {
|
|
9
|
-
route,
|
|
10
|
-
href,
|
|
11
|
-
children,
|
|
12
|
-
style,
|
|
13
|
-
onPress,
|
|
14
|
-
onLongPress,
|
|
15
|
-
onPressIn,
|
|
16
|
-
onPressOut,
|
|
17
|
-
accessibilityRole,
|
|
18
|
-
...rest
|
|
19
|
-
} = _ref;
|
|
20
|
-
if (Platform.OS === 'web') {
|
|
21
|
-
// React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
|
|
22
|
-
// We need to use `onClick` to be able to prevent default browser handling of links.
|
|
23
|
-
return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
|
|
24
|
-
href: href,
|
|
25
|
-
action: CommonActions.navigate(route.name, route.params),
|
|
26
|
-
style: [styles.button, style],
|
|
27
|
-
onPress: e => {
|
|
28
|
-
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
|
|
29
|
-
// ignore clicks with modifier keys
|
|
30
|
-
e.button == null || e.button === 0) // ignore everything but left clicks
|
|
31
|
-
) {
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// types for PressableProps and TextProps are incompatible with each other by `null` so we
|
|
37
|
-
// can't use {...rest} for these 3 props
|
|
38
|
-
,
|
|
39
|
-
onLongPress: onLongPress ?? undefined,
|
|
40
|
-
onPressIn: onPressIn ?? undefined,
|
|
41
|
-
onPressOut: onPressOut ?? undefined
|
|
42
|
-
}), children);
|
|
43
|
-
} else {
|
|
44
|
-
return /*#__PURE__*/React.createElement(PlatformPressable, _extends({}, rest, {
|
|
45
|
-
accessibilityRole: accessibilityRole,
|
|
46
|
-
onPress: onPress
|
|
47
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
48
|
-
style: style
|
|
49
|
-
}, children));
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
6
|
+
import { StyleSheet, View } from 'react-native';
|
|
53
7
|
/**
|
|
54
8
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
55
9
|
*/
|
|
@@ -59,7 +13,6 @@ export function DrawerItem(props) {
|
|
|
59
13
|
fonts
|
|
60
14
|
} = useTheme();
|
|
61
15
|
const {
|
|
62
|
-
route,
|
|
63
16
|
href,
|
|
64
17
|
icon,
|
|
65
18
|
label,
|
|
@@ -79,7 +32,7 @@ export function DrawerItem(props) {
|
|
|
79
32
|
...rest
|
|
80
33
|
} = props;
|
|
81
34
|
const {
|
|
82
|
-
borderRadius =
|
|
35
|
+
borderRadius = 56
|
|
83
36
|
} = StyleSheet.flatten(style || {});
|
|
84
37
|
const color = focused ? activeTintColor : inactiveTintColor;
|
|
85
38
|
const backgroundColor = focused ? activeBackgroundColor : inactiveBackgroundColor;
|
|
@@ -95,12 +48,9 @@ export function DrawerItem(props) {
|
|
|
95
48
|
borderRadius,
|
|
96
49
|
backgroundColor
|
|
97
50
|
}, style]
|
|
98
|
-
}), /*#__PURE__*/React.createElement(
|
|
51
|
+
}), /*#__PURE__*/React.createElement(PlatformPressable, {
|
|
99
52
|
testID: testID,
|
|
100
53
|
onPress: onPress,
|
|
101
|
-
style: [styles.wrapper, {
|
|
102
|
-
borderRadius
|
|
103
|
-
}],
|
|
104
54
|
accessibilityLabel: accessibilityLabel,
|
|
105
55
|
accessibilityRole: "button",
|
|
106
56
|
accessibilityState: {
|
|
@@ -108,17 +58,19 @@ export function DrawerItem(props) {
|
|
|
108
58
|
},
|
|
109
59
|
pressColor: pressColor,
|
|
110
60
|
pressOpacity: pressOpacity,
|
|
111
|
-
route: route,
|
|
112
61
|
href: href
|
|
113
|
-
}, /*#__PURE__*/React.createElement(
|
|
62
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
style: [styles.wrapper, {
|
|
64
|
+
borderRadius
|
|
65
|
+
}]
|
|
66
|
+
}, iconNode, /*#__PURE__*/React.createElement(View, {
|
|
114
67
|
style: [styles.label, {
|
|
115
|
-
|
|
116
|
-
marginVertical: 5
|
|
68
|
+
marginStart: iconNode ? 16 : 0
|
|
117
69
|
}]
|
|
118
70
|
}, typeof label === 'string' ? /*#__PURE__*/React.createElement(Text, {
|
|
119
71
|
numberOfLines: 1,
|
|
120
72
|
allowFontScaling: allowFontScaling,
|
|
121
|
-
style: [{
|
|
73
|
+
style: [styles.labelText, {
|
|
122
74
|
color
|
|
123
75
|
}, fonts.medium, labelStyle]
|
|
124
76
|
}, label) : label({
|
|
@@ -128,21 +80,25 @@ export function DrawerItem(props) {
|
|
|
128
80
|
}
|
|
129
81
|
const styles = StyleSheet.create({
|
|
130
82
|
container: {
|
|
131
|
-
marginHorizontal:
|
|
132
|
-
marginVertical:
|
|
83
|
+
marginHorizontal: 12,
|
|
84
|
+
marginVertical: 2,
|
|
133
85
|
overflow: 'hidden'
|
|
134
86
|
},
|
|
135
87
|
wrapper: {
|
|
136
88
|
flexDirection: 'row',
|
|
137
89
|
alignItems: 'center',
|
|
138
|
-
|
|
90
|
+
paddingVertical: 12,
|
|
91
|
+
paddingStart: 16,
|
|
92
|
+
paddingEnd: 24
|
|
139
93
|
},
|
|
140
94
|
label: {
|
|
141
|
-
|
|
95
|
+
marginEnd: 12,
|
|
96
|
+
marginVertical: 4,
|
|
142
97
|
flex: 1
|
|
143
98
|
},
|
|
144
|
-
|
|
145
|
-
|
|
99
|
+
labelText: {
|
|
100
|
+
lineHeight: 24,
|
|
101
|
+
textAlignVertical: 'center'
|
|
146
102
|
}
|
|
147
103
|
});
|
|
148
104
|
//# sourceMappingURL=DrawerItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PlatformPressable","
|
|
1
|
+
{"version":3,"names":["PlatformPressable","Text","useTheme","Color","React","StyleSheet","View","DrawerItem","props","colors","fonts","href","icon","label","labelStyle","focused","allowFontScaling","activeTintColor","primary","inactiveTintColor","text","alpha","rgb","string","activeBackgroundColor","inactiveBackgroundColor","style","onPress","pressColor","pressOpacity","testID","accessibilityLabel","rest","borderRadius","flatten","color","backgroundColor","iconNode","size","createElement","_extends","collapsable","styles","container","accessibilityRole","accessibilityState","selected","wrapper","marginStart","numberOfLines","labelText","medium","create","marginHorizontal","marginVertical","overflow","flexDirection","alignItems","paddingVertical","paddingStart","paddingEnd","marginEnd","flex","lineHeight","textAlignVertical"],"sourceRoot":"../../../src","sources":["views/DrawerItem.tsx"],"mappings":";AAAA,SAASA,iBAAiB,EAAEC,IAAI,QAAQ,4BAA4B;AACpE,SAAqBC,QAAQ,QAAQ,0BAA0B;AAC/D,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAEEC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAsFrB;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAY,EAAE;EACvC,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAEpC,MAAM;IACJS,IAAI;IACJC,IAAI;IACJC,KAAK;IACLC,UAAU;IACVC,OAAO,GAAG,KAAK;IACfC,gBAAgB;IAChBC,eAAe,GAAGR,MAAM,CAACS,OAAO;IAChCC,iBAAiB,GAAGhB,KAAK,CAACM,MAAM,CAACW,IAAI,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;IACjEC,qBAAqB,GAAGrB,KAAK,CAACc,eAAe,CAAC,CAACI,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;IACzEE,uBAAuB,GAAG,aAAa;IACvCC,KAAK;IACLC,OAAO;IACPC,UAAU;IACVC,YAAY;IACZC,MAAM;IACNC,kBAAkB;IAClB,GAAGC;EACL,CAAC,GAAGxB,KAAK;EAET,MAAM;IAAEyB,YAAY,GAAG;EAAG,CAA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AE;IACjBjC,gBAAgB,EAAEA,gBAAiB;IACnCU,KAAK,EAAE,CAACgB,MAAM,CAACQ,SAAS,EAAE;MAAEf;IAAM,CAAC,EAAEzB,KAAK,CAACyC,MAAM,EAAErC,UAAU;EAAE,GAE9DD,KACG,CAAC,GAEPA,KAAK,CAAC;IAAEsB,KAAK;IAAEpB;EAAQ,CAAC,CAEtB,CACF,CACW,CACf,CAAC;AAEX;AAEA,MAAM2B,MAAM,GAAGrC,UAAU,CAAC+C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,gBAAgB,EAAE,EAAE;IACpBC,cAAc,EAAE,CAAC;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDR,OAAO,EAAE;IACPS,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,EAAE;IACnBC,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE;EACd,CAAC;EACD/C,KAAK,EAAE;IACLgD,SAAS,EAAE,EAAE;IACbP,cAAc,EAAE,CAAC;IACjBQ,IAAI,EAAE;EACR,CAAC;EACDZ,SAAS,EAAE;IACTa,UAAU,EAAE,EAAE;IACdC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonActions, DrawerActions,
|
|
1
|
+
import { CommonActions, DrawerActions, useLinkBuilder } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { DrawerItem } from './DrawerItem';
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ export function DrawerItemList(_ref) {
|
|
|
12
12
|
} = _ref;
|
|
13
13
|
const {
|
|
14
14
|
buildHref
|
|
15
|
-
} =
|
|
15
|
+
} = useLinkBuilder();
|
|
16
16
|
const focusedRoute = state.routes[state.index];
|
|
17
17
|
const focusedDescriptor = descriptors[focusedRoute.key];
|
|
18
18
|
const focusedOptions = focusedDescriptor.options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommonActions","DrawerActions","
|
|
1
|
+
{"version":3,"names":["CommonActions","DrawerActions","useLinkBuilder","React","DrawerItem","DrawerItemList","_ref","state","navigation","descriptors","buildHref","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerActiveTintColor","drawerInactiveTintColor","drawerActiveBackgroundColor","drawerInactiveBackgroundColor","map","route","i","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","closeDrawer","navigate","title","drawerLabel","drawerIcon","drawerLabelStyle","drawerItemStyle","drawerAllowFontScaling","createElement","href","name","params","label","undefined","icon","activeTintColor","inactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","allowFontScaling","labelStyle","style"],"sourceRoot":"../../../src","sources":["views/DrawerItemList.tsx"],"mappings":"AAAA,SACEA,aAAa,EACbC,aAAa,EAGbC,cAAc,QACT,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAG9B,SAASC,UAAU,QAAQ,cAAc;AAQzC;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAA4C;EAAA,IAA3C;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAmB,CAAC,GAAAH,IAAA;EACtE,MAAM;IAAEI;EAAU,CAAC,GAAGR,cAAc,CAAC,CAAC;EAEtC,MAAMS,YAAY,GAAGJ,KAAK,CAACK,MAAM,CAACL,KAAK,CAACM,KAAK,CAAC;EAC9C,MAAMC,iBAAiB,GAAGL,WAAW,CAACE,YAAY,CAACI,GAAG,CAAC;EACvD,MAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAO;EAEhD,MAAM;IACJC,qBAAqB;IACrBC,uBAAuB;IACvBC,2BAA2B;IAC3BC;EACF,CAAC,GAAGL,cAAc;EAElB,OAAOT,KAAK,CAACK,MAAM,CAACU,GAAG,CAAC,CAACC,KAAK,EAAEC,CAAC,KAAK;IACpC,MAAMC,OAAO,GAAGD,CAAC,KAAKjB,KAAK,CAACM,KAAK;IAEjC,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CAAC;EAEN,CAAC,CAAC;AACJ"}
|
|
@@ -10,8 +10,6 @@ export function DrawerToggleButton(_ref) {
|
|
|
10
10
|
} = _ref;
|
|
11
11
|
const navigation = useNavigation();
|
|
12
12
|
return /*#__PURE__*/React.createElement(PlatformPressable, _extends({}, rest, {
|
|
13
|
-
accessible: true,
|
|
14
|
-
accessibilityRole: "button",
|
|
15
13
|
android_ripple: {
|
|
16
14
|
borderless: true
|
|
17
15
|
},
|
|
@@ -30,6 +28,7 @@ export function DrawerToggleButton(_ref) {
|
|
|
30
28
|
style: [styles.icon, tintColor ? {
|
|
31
29
|
tintColor
|
|
32
30
|
} : null],
|
|
31
|
+
resizeMode: "contain",
|
|
33
32
|
source: require('./assets/toggle-drawer-icon.png'),
|
|
34
33
|
fadeDuration: 0
|
|
35
34
|
}));
|
|
@@ -38,8 +37,7 @@ const styles = StyleSheet.create({
|
|
|
38
37
|
icon: {
|
|
39
38
|
height: 24,
|
|
40
39
|
width: 24,
|
|
41
|
-
margin: 3
|
|
42
|
-
resizeMode: 'contain'
|
|
40
|
+
margin: 3
|
|
43
41
|
},
|
|
44
42
|
touchable: {
|
|
45
43
|
marginHorizontal: 11
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PlatformPressable","DrawerActions","useNavigation","React","Image","Platform","StyleSheet","DrawerToggleButton","tintColor","rest","navigation","borderless","dispatch","toggleDrawer","styles","touchable","select","ios","undefined","default","top","right","bottom","left","icon","require","create","height","width","margin","
|
|
1
|
+
{"version":3,"names":["PlatformPressable","DrawerActions","useNavigation","React","Image","Platform","StyleSheet","DrawerToggleButton","_ref","tintColor","rest","navigation","createElement","_extends","android_ripple","borderless","onPress","dispatch","toggleDrawer","style","styles","touchable","hitSlop","select","ios","undefined","default","top","right","bottom","left","icon","resizeMode","source","require","fadeDuration","create","height","width","margin","marginHorizontal"],"sourceRoot":"../../../src","sources":["views/DrawerToggleButton.tsx"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,4BAA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;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
|
|
3
|
-
import { DrawerActions, useTheme } from '@react-navigation/native';
|
|
2
|
+
import { getDefaultSidebarWidth, getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
|
|
3
|
+
import { DrawerActions, useLocale, useTheme } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
6
6
|
import { Drawer } from 'react-native-drawer-layout';
|
|
7
7
|
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
|
8
8
|
import useLatestCallback from 'use-latest-callback';
|
|
9
|
+
import { addCancelListener } from '../utils/addCancelListener';
|
|
9
10
|
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
10
11
|
import { DrawerStatusContext } from '../utils/DrawerStatusContext';
|
|
11
12
|
import { getDrawerStatusFromState } from '../utils/getDrawerStatusFromState';
|
|
12
13
|
import { DrawerContent } from './DrawerContent';
|
|
13
14
|
import { DrawerToggleButton } from './DrawerToggleButton';
|
|
14
15
|
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
|
16
|
+
const DRAWER_BORDER_RADIUS = 16;
|
|
15
17
|
function DrawerViewBase(_ref) {
|
|
16
18
|
let {
|
|
17
19
|
state,
|
|
@@ -21,14 +23,20 @@ function DrawerViewBase(_ref) {
|
|
|
21
23
|
drawerContent = props => /*#__PURE__*/React.createElement(DrawerContent, props),
|
|
22
24
|
detachInactiveScreens = Platform.OS === 'web' || Platform.OS === 'android' || Platform.OS === 'ios'
|
|
23
25
|
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
direction
|
|
28
|
+
} = useLocale();
|
|
24
29
|
const focusedRouteKey = state.routes[state.index].key;
|
|
25
30
|
const {
|
|
26
31
|
drawerHideStatusBarOnOpen,
|
|
27
|
-
drawerPosition =
|
|
32
|
+
drawerPosition = direction === 'rtl' ? 'right' : 'left',
|
|
28
33
|
drawerStatusBarAnimation,
|
|
29
34
|
drawerStyle,
|
|
30
|
-
drawerType
|
|
31
|
-
|
|
35
|
+
drawerType = Platform.select({
|
|
36
|
+
ios: 'slide',
|
|
37
|
+
default: 'front'
|
|
38
|
+
}),
|
|
39
|
+
configureGestureHandler,
|
|
32
40
|
keyboardDismissMode,
|
|
33
41
|
overlayColor = 'rgba(0, 0, 0, 0.5)',
|
|
34
42
|
swipeEdgeWidth,
|
|
@@ -110,27 +118,11 @@ function DrawerViewBase(_ref) {
|
|
|
110
118
|
}
|
|
111
119
|
return true;
|
|
112
120
|
};
|
|
113
|
-
const handleEscape = e => {
|
|
114
|
-
if (e.key === 'Escape') {
|
|
115
|
-
handleHardwareBack();
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
121
|
|
|
119
122
|
// We only add the listeners when drawer opens
|
|
120
123
|
// This way we can make sure that the listener is added as late as possible
|
|
121
124
|
// This will make sure that our handler will run first when back button is pressed
|
|
122
|
-
|
|
123
|
-
if (Platform.OS === 'web') {
|
|
124
|
-
var _document, _document$body, _document$body$addEve;
|
|
125
|
-
(_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : (_document$body$addEve = _document$body.addEventListener) === null || _document$body$addEve === void 0 ? void 0 : _document$body$addEve.call(_document$body, 'keyup', handleEscape);
|
|
126
|
-
}
|
|
127
|
-
return () => {
|
|
128
|
-
subscription.remove();
|
|
129
|
-
if (Platform.OS === 'web') {
|
|
130
|
-
var _document2, _document2$body, _document2$body$remov;
|
|
131
|
-
(_document2 = document) === null || _document2 === void 0 ? void 0 : (_document2$body = _document2.body) === null || _document2$body === void 0 ? void 0 : (_document2$body$remov = _document2$body.removeEventListener) === null || _document2$body$remov === void 0 ? void 0 : _document2$body$remov.call(_document2$body, 'keyup', handleEscape);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
125
|
+
return addCancelListener(handleHardwareBack);
|
|
134
126
|
}, [defaultStatus, drawerStatus, drawerType, handleDrawerClose, handleDrawerOpen, navigation]);
|
|
135
127
|
const renderDrawerContent = () => {
|
|
136
128
|
return /*#__PURE__*/React.createElement(DrawerPositionContext.Provider, {
|
|
@@ -156,8 +148,8 @@ function DrawerViewBase(_ref) {
|
|
|
156
148
|
if (unmountOnBlur && !isFocused) {
|
|
157
149
|
return null;
|
|
158
150
|
}
|
|
159
|
-
if (lazy && !loaded.includes(route.key) && !isFocused) {
|
|
160
|
-
// Don't render a lazy screen if we've never navigated to it
|
|
151
|
+
if (lazy && !loaded.includes(route.key) && !isFocused && !state.preloadedRouteKeys.includes(route.key)) {
|
|
152
|
+
// Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
|
|
161
153
|
return null;
|
|
162
154
|
}
|
|
163
155
|
const {
|
|
@@ -215,7 +207,7 @@ function DrawerViewBase(_ref) {
|
|
|
215
207
|
onTransitionStart: handleTransitionStart,
|
|
216
208
|
onTransitionEnd: handleTransitionEnd,
|
|
217
209
|
layout: dimensions,
|
|
218
|
-
|
|
210
|
+
configureGestureHandler: configureGestureHandler,
|
|
219
211
|
swipeEnabled: swipeEnabled,
|
|
220
212
|
swipeEdgeWidth: swipeEdgeWidth,
|
|
221
213
|
swipeMinDistance: swipeMinDistance,
|
|
@@ -226,13 +218,20 @@ function DrawerViewBase(_ref) {
|
|
|
226
218
|
overlayAccessibilityLabel: overlayAccessibilityLabel,
|
|
227
219
|
drawerPosition: drawerPosition,
|
|
228
220
|
drawerStyle: [{
|
|
229
|
-
backgroundColor: colors.card
|
|
221
|
+
backgroundColor: colors.card,
|
|
222
|
+
width: getDefaultSidebarWidth(dimensions)
|
|
230
223
|
}, drawerType === 'permanent' && (drawerPosition === 'left' ? {
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
borderEndColor: colors.border,
|
|
225
|
+
borderEndWidth: StyleSheet.hairlineWidth
|
|
226
|
+
} : {
|
|
227
|
+
borderStartColor: colors.border,
|
|
228
|
+
borderStartWidth: StyleSheet.hairlineWidth
|
|
229
|
+
}), drawerType === 'front' && (drawerPosition === 'left' ? {
|
|
230
|
+
borderTopRightRadius: DRAWER_BORDER_RADIUS,
|
|
231
|
+
borderBottomRightRadius: DRAWER_BORDER_RADIUS
|
|
233
232
|
} : {
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
borderTopLeftRadius: DRAWER_BORDER_RADIUS,
|
|
234
|
+
borderBottomLeftRadius: DRAWER_BORDER_RADIUS
|
|
236
235
|
}), drawerStyle],
|
|
237
236
|
overlayStyle: {
|
|
238
237
|
backgroundColor: overlayColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","DrawerActions","
|
|
1
|
+
{"version":3,"names":["getDefaultSidebarWidth","getHeaderTitle","Header","SafeAreaProviderCompat","Screen","DrawerActions","useLocale","useTheme","React","Platform","StyleSheet","Drawer","useSafeAreaFrame","useLatestCallback","addCancelListener","DrawerPositionContext","DrawerStatusContext","getDrawerStatusFromState","DrawerContent","DrawerToggleButton","MaybeScreen","MaybeScreenContainer","DRAWER_BORDER_RADIUS","DrawerViewBase","_ref","state","navigation","descriptors","defaultStatus","drawerContent","props","createElement","detachInactiveScreens","OS","direction","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","drawerStatusBarAnimation","drawerStyle","drawerType","select","ios","default","configureGestureHandler","keyboardDismissMode","overlayColor","swipeEdgeWidth","swipeEnabled","swipeMinDistance","overlayAccessibilityLabel","options","loaded","setLoaded","useState","includes","dimensions","colors","drawerStatus","handleDrawerOpen","dispatch","openDrawer","target","handleDrawerClose","closeDrawer","handleGestureStart","emit","type","handleGestureEnd","handleGestureCancel","handleTransitionStart","closing","data","handleTransitionEnd","useEffect","handleHardwareBack","isFocused","renderDrawerContent","Provider","value","renderSceneContent","enabled","hasTwoStates","style","styles","content","map","route","descriptor","lazy","unmountOnBlur","preloadedRouteKeys","freezeOnBlur","header","_ref2","layout","_extends","title","name","headerLeft","headerShown","headerStatusBarHeight","headerTransparent","sceneContainerStyle","absoluteFill","zIndex","visible","focused","render","open","onOpen","onClose","onGestureStart","onGestureEnd","onGestureCancel","onTransitionStart","onTransitionEnd","hideStatusBarOnOpen","statusBarAnimation","backgroundColor","card","width","borderEndColor","border","borderEndWidth","hairlineWidth","borderStartColor","borderStartWidth","borderTopRightRadius","borderBottomRightRadius","borderTopLeftRadius","borderBottomLeftRadius","overlayStyle","DrawerView","_ref3","rest","create","flex"],"sourceRoot":"../../../src","sources":["views/DrawerView.tsx"],"mappings":";AAAA,SACEA,sBAAsB,EACtBC,cAAc,EACdC,MAAM,EACNC,sBAAsB,EACtBC,MAAM,QACD,4BAA4B;AACnC,SACEC,aAAa,EAIbC,SAAS,EACTC,QAAQ,QACH,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,OAAOC,iBAAiB,MAAM,qBAAqB;AAUnD,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,mBAAmB,QAAQ,8BAA8B;AAClE,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,kBAAkB;AASpE,MAAMC,oBAAoB,GAAG,EAAE;AAE/B,SAASC,cAAcA,CAA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sB,qBACrBK,KAAA,CAAAuB,aAAA,CAACR,cAAc,EAAA4E,QAAA;IAACzE,UAAU,EAAEA;EAAW,GAAKgH,IAAI,CAAG,CAC7B,CAAC;AAE7B;AAEA,MAAMnD,MAAM,GAAG7E,UAAU,CAACiI,MAAM,CAAC;EAC/BnD,OAAO,EAAE;IACPoD,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -9,12 +9,11 @@ try {
|
|
|
9
9
|
// Ignore
|
|
10
10
|
}
|
|
11
11
|
export const MaybeScreenContainer = _ref => {
|
|
12
|
-
var _Screens, _Screens$screensEnabl;
|
|
13
12
|
let {
|
|
14
13
|
enabled,
|
|
15
14
|
...rest
|
|
16
15
|
} = _ref;
|
|
17
|
-
if (
|
|
16
|
+
if (Screens?.screensEnabled?.()) {
|
|
18
17
|
return /*#__PURE__*/React.createElement(Screens.ScreenContainer, _extends({
|
|
19
18
|
enabled: enabled
|
|
20
19
|
}, rest));
|
|
@@ -22,13 +21,12 @@ export const MaybeScreenContainer = _ref => {
|
|
|
22
21
|
return /*#__PURE__*/React.createElement(View, rest);
|
|
23
22
|
};
|
|
24
23
|
export function MaybeScreen(_ref2) {
|
|
25
|
-
var _Screens2, _Screens2$screensEnab;
|
|
26
24
|
let {
|
|
27
25
|
visible,
|
|
28
26
|
children,
|
|
29
27
|
...rest
|
|
30
28
|
} = _ref2;
|
|
31
|
-
if (
|
|
29
|
+
if (Screens?.screensEnabled?.()) {
|
|
32
30
|
return /*#__PURE__*/React.createElement(Screens.Screen, _extends({
|
|
33
31
|
activityState: visible ? 2 : 0
|
|
34
32
|
}, rest), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,
|
|
1
|
+
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","_ref","enabled","rest","screensEnabled","createElement","ScreenContainer","_extends","MaybeScreen","_ref2","visible","children","Screen","activityState"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAEEC,IAAI,QAGC,cAAc;AAUrB,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAGC,IAAA,IAO9B;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC,GAAAF,IAAA;EACC,IAAIJ,OAAO,EAAEO,cAAc,GAAG,CAAC,EAAE;IAC/B,oBAAOT,KAAA,CAAAU,aAAA,CAACR,OAAO,CAACS,eAAe,EAAAC,QAAA;MAACL,OAAO,EAAEA;IAAQ,GAAKC,IAAI,CAAG,CAAC;EAChE;EAEA,oBAAOR,KAAA,CAAAU,aAAA,CAACT,IAAI,EAAKO,IAAO,CAAC;AAC3B,CAAC;AAED,OAAO,SAASK,WAAWA,CAAAC,KAAA,EAAwC;EAAA,IAAvC;IAAEC,OAAO;IAAEC,QAAQ;IAAE,GAAGR;EAAY,CAAC,GAAAM,KAAA;EAC/D,IAAIZ,OAAO,EAAEO,cAAc,GAAG,CAAC,EAAE;IAC/B,oBACET,KAAA,CAAAU,aAAA,CAACR,OAAO,CAACe,MAAM,EAAAL,QAAA;MAACM,aAAa,EAAEH,OAAO,GAAG,CAAC,GAAG;IAAE,GAAKP,IAAI,GACrDQ,QACa,CAAC;EAErB;EAEA,oBACEhB,KAAA,CAAAU,aAAA,CAACX,kBAAkB,EAAAa,QAAA;IAACG,OAAO,EAAEA;EAAQ,GAAKP,IAAI,GAC3CQ,QACiB,CAAC;AAEzB"}
|
|
@@ -17,9 +17,9 @@ export { DrawerView } from './views/DrawerView';
|
|
|
17
17
|
export { DrawerStatusContext } from './utils/DrawerStatusContext';
|
|
18
18
|
export { getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
|
|
19
19
|
export { useDrawerStatus } from './utils/useDrawerStatus';
|
|
20
|
-
export {
|
|
20
|
+
export { DrawerProgressContext, useDrawerProgress, } from 'react-native-drawer-layout';
|
|
21
21
|
/**
|
|
22
22
|
* Types
|
|
23
23
|
*/
|
|
24
|
-
export type { DrawerContentComponentProps, DrawerHeaderProps, DrawerNavigationEventMap, DrawerNavigationOptions, DrawerNavigationProp, DrawerScreenProps, } from './types';
|
|
24
|
+
export type { DrawerContentComponentProps, DrawerHeaderProps, DrawerNavigationEventMap, DrawerNavigationOptions, DrawerNavigationProp, DrawerOptionsArgs, DrawerScreenProps, } from './types';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;GAEG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,YAAY,EACV,2BAA2B,EAC3B,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { DefaultNavigatorOptions, DrawerNavigationState, DrawerRouterOptions, ParamListBase } from '@react-navigation/native';
|
|
2
|
-
import
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { type DefaultNavigatorOptions, type DrawerNavigationState, type DrawerRouterOptions, type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TypedNavigator } from '@react-navigation/native';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { DrawerNavigationConfig, DrawerNavigationEventMap, DrawerNavigationOptions, DrawerNavigationProp } from '../types';
|
|
4
|
+
type Props = DefaultNavigatorOptions<ParamListBase, string | undefined, DrawerNavigationState<ParamListBase>, DrawerNavigationOptions, DrawerNavigationEventMap, DrawerNavigationProp<ParamListBase>> & DrawerRouterOptions & DrawerNavigationConfig;
|
|
5
|
+
declare function DrawerNavigator({ id, initialRouteName, defaultStatus, backBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_getStateForRouteNamesChange, ...rest }: Props): React.JSX.Element;
|
|
6
|
+
export declare function createDrawerNavigator<ParamList extends ParamListBase, NavigatorID extends string | undefined = undefined, TypeBag extends NavigatorTypeBagBase = {
|
|
7
|
+
ParamList: ParamList;
|
|
8
|
+
NavigatorID: NavigatorID;
|
|
9
|
+
State: DrawerNavigationState<ParamList>;
|
|
10
|
+
ScreenOptions: DrawerNavigationOptions;
|
|
11
|
+
EventMap: DrawerNavigationEventMap;
|
|
12
|
+
NavigationList: {
|
|
13
|
+
[RouteName in keyof ParamList]: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
9
14
|
};
|
|
10
|
-
|
|
15
|
+
Navigator: typeof DrawerNavigator;
|
|
16
|
+
}, Config extends StaticConfig<TypeBag> | undefined = StaticConfig<TypeBag> | undefined>(config?: Config): TypedNavigator<TypeBag, Config>;
|
|
11
17
|
export {};
|
|
12
18
|
//# sourceMappingURL=createDrawerNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDrawerNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createDrawerNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"createDrawerNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createDrawerNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAE5B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,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HeaderOptions } from '@react-navigation/elements';
|
|
3
|
-
import type { Descriptor, DrawerActionHelpers, DrawerNavigationState, NavigationHelpers, NavigationProp, ParamListBase, Route, RouteProp } from '@react-navigation/native';
|
|
3
|
+
import type { Descriptor, DrawerActionHelpers, DrawerNavigationState, NavigationHelpers, NavigationProp, ParamListBase, Route, RouteProp, Theme } from '@react-navigation/native';
|
|
4
4
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
5
|
-
import type {
|
|
5
|
+
import type { PanGesture } from 'react-native-gesture-handler';
|
|
6
6
|
export type Scene = {
|
|
7
7
|
route: Route<string>;
|
|
8
8
|
focused: boolean;
|
|
@@ -24,16 +24,6 @@ export type DrawerNavigationConfig = {
|
|
|
24
24
|
* Defaults to `true`.
|
|
25
25
|
*/
|
|
26
26
|
detachInactiveScreens?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Whether to use the legacy implementation based on Reanimated 1.
|
|
29
|
-
* The new implementation based on Reanimated 2 will perform better,
|
|
30
|
-
* but it's not possible to use Chrome remote debugger.
|
|
31
|
-
*
|
|
32
|
-
* This defaults to `true` if Reanimated 2 is not configured.
|
|
33
|
-
*
|
|
34
|
-
* Otherwise, it defaults to `false`
|
|
35
|
-
*/
|
|
36
|
-
useLegacyImplementation?: boolean;
|
|
37
27
|
};
|
|
38
28
|
export type DrawerNavigationOptions = HeaderOptions & {
|
|
39
29
|
/**
|
|
@@ -149,10 +139,9 @@ export type DrawerNavigationOptions = HeaderOptions & {
|
|
|
149
139
|
*/
|
|
150
140
|
sceneContainerStyle?: StyleProp<ViewStyle>;
|
|
151
141
|
/**
|
|
152
|
-
*
|
|
153
|
-
* Not supported on Web.
|
|
142
|
+
* Function to modify the pan gesture handler via RNGH properties API.
|
|
154
143
|
*/
|
|
155
|
-
|
|
144
|
+
configureGestureHandler?: (gesture: PanGesture) => PanGesture;
|
|
156
145
|
/**
|
|
157
146
|
* Whether you can use swipe gestures to open or close the drawer.
|
|
158
147
|
* Defaults to `true`.
|
|
@@ -259,6 +248,9 @@ export type DrawerScreenProps<ParamList extends ParamListBase, RouteName extends
|
|
|
259
248
|
navigation: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
260
249
|
route: RouteProp<ParamList, RouteName>;
|
|
261
250
|
};
|
|
251
|
+
export type DrawerOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = DrawerScreenProps<ParamList, RouteName, NavigatorID> & {
|
|
252
|
+
theme: Theme;
|
|
253
|
+
};
|
|
262
254
|
export type DrawerDescriptor = Descriptor<DrawerNavigationOptions, DrawerNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
|
|
263
255
|
export type DrawerDescriptorMap = Record<string, DrawerDescriptor>;
|
|
264
256
|
export type DrawerProps = {
|
|
@@ -269,7 +261,7 @@ export type DrawerProps = {
|
|
|
269
261
|
drawerPosition: 'left' | 'right';
|
|
270
262
|
drawerStyle?: StyleProp<ViewStyle>;
|
|
271
263
|
drawerType: 'front' | 'back' | 'slide' | 'permanent';
|
|
272
|
-
|
|
264
|
+
configureGestureHandler?: (gesture: PanGesture) => PanGesture;
|
|
273
265
|
hideStatusBarOnOpen: boolean;
|
|
274
266
|
keyboardDismissMode: 'none' | 'on-drag';
|
|
275
267
|
onClose: () => void;
|