@react-navigation/drawer 7.0.0-alpha.0 → 7.0.0-alpha.10
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 +20 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +11 -9
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +4 -5
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +4 -6
- 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 +2 -2
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +5 -6
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +7 -8
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +12 -10
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +14 -64
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +6 -7
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +5 -7
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +69 -38
- 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 +10 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +7 -3
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/types.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/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 +2 -2
- 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 +9 -5
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +14 -64
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +4 -4
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +3 -5
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +65 -34
- 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 +10 -10
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +6 -6
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +34 -10
- 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/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/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 +2 -2
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +2 -3
- 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 +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 +3 -3
- 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 +24 -24
- package/src/index.tsx +10 -10
- package/src/navigators/createDrawerNavigator.tsx +11 -7
- package/src/types.tsx +22 -12
- package/src/utils/DrawerPositionContext.tsx +3 -1
- package/src/utils/DrawerStatusContext.tsx +3 -5
- package/src/utils/addCancelListener.native.tsx +12 -0
- package/src/utils/addCancelListener.tsx +13 -0
- 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 +12 -12
- package/src/views/DrawerItem.tsx +12 -85
- package/src/views/DrawerItemList.tsx +8 -12
- package/src/views/DrawerToggleButton.tsx +3 -5
- package/src/views/DrawerView.tsx +75 -40
- package/src/views/ScreenFallback.tsx +6 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const addCancelListener = callback => {
|
|
2
|
+
const handleEscape = e => {
|
|
3
|
+
if (e.key === 'Escape') {
|
|
4
|
+
callback();
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
document?.body?.addEventListener?.('keyup', handleEscape);
|
|
8
|
+
return () => {
|
|
9
|
+
document?.body?.removeEventListener?.('keyup', handleEscape);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=addCancelListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["addCancelListener","callback","handleEscape","e","key","document","body","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["utils/addCancelListener.tsx"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,GAAIC,QAAuB,IAAK;EAC5D,MAAMC,YAAY,GAAIC,CAAgB,IAAK;IACzC,IAAIA,CAAC,CAACC,GAAG,KAAK,QAAQ,EAAE;MACtBH,QAAQ,CAAC,CAAC;IACZ;EACF,CAAC;EAEDI,QAAQ,EAAEC,IAAI,EAAEC,gBAAgB,GAAG,OAAO,EAAEL,YAAY,CAAC;EAEzD,OAAO,MAAM;IACXG,QAAQ,EAAEC,IAAI,EAAEE,mBAAmB,GAAG,OAAO,EAAEN,YAAY,CAAC;EAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BackHandler } from 'react-native';
|
|
2
|
+
export const addCancelListener = callback => {
|
|
3
|
+
const subscription = BackHandler.addEventListener('hardwareBackPress', callback);
|
|
4
|
+
return () => {
|
|
5
|
+
subscription.remove();
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=addCancelListener.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BackHandler","addCancelListener","callback","subscription","addEventListener","remove"],"sourceRoot":"../../../src","sources":["utils/addCancelListener.native.tsx"],"mappings":"AAAA,SAASA,WAAW,QAAQ,cAAc;AAE1C,OAAO,MAAMC,iBAAiB,GAAIC,QAAuB,IAAK;EAC5D,MAAMC,YAAY,GAAGH,WAAW,CAACI,gBAAgB,CAC/C,mBAAmB,EACnBF,QACF,CAAC;EAED,OAAO,MAAM;IACXC,YAAY,CAACE,MAAM,CAAC,CAAC;EACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function getDrawerStatusFromState(state) {
|
|
2
2
|
if (state.history == null) {
|
|
3
3
|
throw new Error("Couldn't find the drawer status in the state object. Is it a valid state object of drawer navigator?");
|
|
4
4
|
}
|
|
5
5
|
const entry = state.history.find(it => it.type === 'drawer');
|
|
6
|
-
return
|
|
6
|
+
return entry?.status ?? state.default ?? 'closed';
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=getDrawerStatusFromState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDrawerStatusFromState","state","history","Error","entry","find","it","type","status","default"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["getDrawerStatusFromState","state","history","Error","entry","find","it","type","status","default"],"sourceRoot":"../../../src","sources":["utils/getDrawerStatusFromState.tsx"],"mappings":"AAMA,OAAO,SAASA,wBAAwBA,CACtCC,KAA2C,EAC7B;EACd,IAAIA,KAAK,CAACC,OAAO,IAAI,IAAI,EAAE;IACzB,MAAM,IAAIC,KAAK,CACb,sGACF,CAAC;EACH;EAEA,MAAMC,KAAK,GAAGH,KAAK,CAACC,OAAO,CAACG,IAAI,CAAEC,EAAE,IAAKA,EAAE,CAACC,IAAI,KAAK,QAAQ,CAEhD;EAEb,OAAOH,KAAK,EAAEI,MAAM,IAAIP,KAAK,CAACQ,OAAO,IAAI,QAAQ;AACnD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import DrawerStatusContext from './DrawerStatusContext';
|
|
2
|
+
import { DrawerStatusContext } from './DrawerStatusContext';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Hook to detect if the drawer's status in a parent navigator.
|
|
6
6
|
* Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function useDrawerStatus() {
|
|
9
9
|
const drawerStatus = React.useContext(DrawerStatusContext);
|
|
10
10
|
if (drawerStatus === undefined) {
|
|
11
11
|
throw new Error("Couldn't find a drawer. Is your component inside a drawer navigator?");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DrawerStatusContext","useDrawerStatus","drawerStatus","useContext","undefined","Error"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["React","DrawerStatusContext","useDrawerStatus","drawerStatus","useContext","undefined","Error"],"sourceRoot":"../../../src","sources":["utils/useDrawerStatus.tsx"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,uBAAuB;;AAE3D;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAA,EAAiB;EAC9C,MAAMC,YAAY,GAAGH,KAAK,CAACI,UAAU,CAACH,mBAAmB,CAAC;EAE1D,IAAIE,YAAY,KAAKE,SAAS,EAAE;IAC9B,MAAM,IAAIC,KAAK,CACb,sEACF,CAAC;EACH;EAEA,OAAOH,YAAY;AACrB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
2
|
import * as React from 'react';
|
|
3
|
-
import DrawerContentScrollView from './DrawerContentScrollView';
|
|
4
|
-
import DrawerItemList from './DrawerItemList';
|
|
5
|
-
export
|
|
3
|
+
import { DrawerContentScrollView } from './DrawerContentScrollView';
|
|
4
|
+
import { DrawerItemList } from './DrawerItemList';
|
|
5
|
+
export function DrawerContent(_ref) {
|
|
6
6
|
let {
|
|
7
7
|
descriptors,
|
|
8
8
|
state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DrawerContentScrollView","DrawerItemList","DrawerContent","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle"],"sourceRoot":"
|
|
1
|
+
{"version":3,"names":["React","DrawerContentScrollView","DrawerItemList","DrawerContent","_ref","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle","createElement","_extends","contentContainerStyle","style"],"sourceRoot":"../../../src","sources":["views/DrawerContent.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAIG;EAAA,IAJF;IAC5BC,WAAW;IACXC,KAAK;IACL,GAAGC;EACwB,CAAC,GAAAH,IAAA;EAC5B,MAAMI,YAAY,GAAGF,KAAK,CAACG,MAAM,CAACH,KAAK,CAACI,KAAK,CAAC;EAC9C,MAAMC,iBAAiB,GAAGN,WAAW,CAACG,YAAY,CAACI,GAAG,CAAC;EACvD,MAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAO;EAEhD,MAAM;IAAEC,kBAAkB;IAAEC;EAA4B,CAAC,GAAGH,cAAc;EAE1E,oBACEb,KAAA,CAAAiB,aAAA,CAAChB,uBAAuB,EAAAiB,QAAA,KAClBX,IAAI;IACRY,qBAAqB,EAAEH,2BAA4B;IACnDI,KAAK,EAAEL;EAAmB,iBAE1Bf,KAAA,CAAAiB,aAAA,CAACf,cAAc,EAAAgB,QAAA;IAACb,WAAW,EAAEA,WAAY;IAACC,KAAK,EAAEA;EAAM,GAAKC,IAAI,CAAG,CAC5C,CAAC;AAE9B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
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 { useLocale } from '@react-navigation/native';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
+
import { ScrollView, StyleSheet } from 'react-native';
|
|
4
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
-
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
6
|
-
function
|
|
6
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
7
|
+
function DrawerContentScrollViewInner(_ref, ref) {
|
|
7
8
|
let {
|
|
8
9
|
contentContainerStyle,
|
|
9
10
|
style,
|
|
@@ -12,7 +13,10 @@ function DrawerContentScrollView(_ref, ref) {
|
|
|
12
13
|
} = _ref;
|
|
13
14
|
const drawerPosition = React.useContext(DrawerPositionContext);
|
|
14
15
|
const insets = useSafeAreaInsets();
|
|
15
|
-
const
|
|
16
|
+
const {
|
|
17
|
+
direction
|
|
18
|
+
} = useLocale();
|
|
19
|
+
const isRight = direction === 'rtl' ? drawerPosition === 'left' : drawerPosition === 'right';
|
|
16
20
|
return /*#__PURE__*/React.createElement(ScrollView, _extends({}, rest, {
|
|
17
21
|
ref: ref,
|
|
18
22
|
contentContainerStyle: [{
|
|
@@ -23,7 +27,7 @@ function DrawerContentScrollView(_ref, ref) {
|
|
|
23
27
|
style: [styles.container, style]
|
|
24
28
|
}), children);
|
|
25
29
|
}
|
|
26
|
-
export
|
|
30
|
+
export const DrawerContentScrollView = /*#__PURE__*/React.forwardRef(DrawerContentScrollViewInner);
|
|
27
31
|
const styles = StyleSheet.create({
|
|
28
32
|
container: {
|
|
29
33
|
flex: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useLocale","React","ScrollView","StyleSheet","useSafeAreaInsets","DrawerPositionContext","DrawerContentScrollViewInner","_ref","ref","contentContainerStyle","style","children","rest","drawerPosition","useContext","insets","direction","isRight","createElement","_extends","paddingTop","top","paddingStart","left","paddingEnd","right","styles","container","DrawerContentScrollView","forwardRef","create","flex"],"sourceRoot":"../../../src","sources":["views/DrawerContentScrollView.tsx"],"mappings":";AAAA,SAASA,SAAS,QAAQ,0BAA0B;AACpD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAwBC,UAAU,QAAQ,cAAc;AAC3E,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,qBAAqB,QAAQ,gCAAgC;AAMtE,SAASC,4BAA4BA,CAAAC,IAAA,EAEnCC,GAA2B,EAC3B;EAAA,IAFA;IAAEC,qBAAqB;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;EAAY,CAAC,GAAAL,IAAA;EAG1D,MAAMM,cAAc,GAAGZ,KAAK,CAACa,UAAU,CAACT,qBAAqB,CAAC;EAC9D,MAAMU,MAAM,GAAGX,iBAAiB,CAAC,CAAC;EAClC,MAAM;IAAEY;EAAU,CAAC,GAAGhB,SAAS,CAAC,CAAC;EAEjC,MAAMiB,OAAO,GACXD,SAAS,KAAK,KAAK,GACfH,cAAc,KAAK,MAAM,GACzBA,cAAc,KAAK,OAAO;EAEhC,oBACEZ,KAAA,CAAAiB,aAAA,CAAChB,UAAU,EAAAiB,QAAA,KACLP,IAAI;IACRJ,GAAG,EAAEA,GAAI;IACTC,qBAAqB,EAAE,CACrB;MACEW,UAAU,EAAEL,MAAM,CAACM,GAAG,GAAG,CAAC;MAC1BC,YAAY,EAAE,CAACL,OAAO,GAAGF,MAAM,CAACQ,IAAI,GAAG,CAAC;MACxCC,UAAU,EAAEP,OAAO,GAAGF,MAAM,CAACU,KAAK,GAAG;IACvC,CAAC,EACDhB,qBAAqB,CACrB;IACFC,KAAK,EAAE,CAACgB,MAAM,CAACC,SAAS,EAAEjB,KAAK;EAAE,IAEhCC,QACS,CAAC;AAEjB;AAEA,OAAO,MAAMiB,uBAAuB,gBAAG3B,KAAK,CAAC4B,UAAU,CACrDvB,4BACF,CAAC;AAED,MAAMoB,MAAM,GAAGvB,UAAU,CAAC2B,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -1,64 +1,18 @@
|
|
|
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
|
*/
|
|
56
|
-
export
|
|
10
|
+
export function DrawerItem(props) {
|
|
57
11
|
const {
|
|
58
|
-
colors
|
|
12
|
+
colors,
|
|
13
|
+
fonts
|
|
59
14
|
} = useTheme();
|
|
60
15
|
const {
|
|
61
|
-
route,
|
|
62
16
|
href,
|
|
63
17
|
icon,
|
|
64
18
|
label,
|
|
@@ -94,12 +48,9 @@ export default function DrawerItem(props) {
|
|
|
94
48
|
borderRadius,
|
|
95
49
|
backgroundColor
|
|
96
50
|
}, style]
|
|
97
|
-
}), /*#__PURE__*/React.createElement(
|
|
51
|
+
}), /*#__PURE__*/React.createElement(PlatformPressable, {
|
|
98
52
|
testID: testID,
|
|
99
53
|
onPress: onPress,
|
|
100
|
-
style: [styles.wrapper, {
|
|
101
|
-
borderRadius
|
|
102
|
-
}],
|
|
103
54
|
accessibilityLabel: accessibilityLabel,
|
|
104
55
|
accessibilityRole: "button",
|
|
105
56
|
accessibilityState: {
|
|
@@ -107,9 +58,12 @@ export default function DrawerItem(props) {
|
|
|
107
58
|
},
|
|
108
59
|
pressColor: pressColor,
|
|
109
60
|
pressOpacity: pressOpacity,
|
|
110
|
-
route: route,
|
|
111
61
|
href: href
|
|
112
|
-
}, /*#__PURE__*/React.createElement(
|
|
62
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
style: [styles.wrapper, {
|
|
64
|
+
borderRadius
|
|
65
|
+
}]
|
|
66
|
+
}, iconNode, /*#__PURE__*/React.createElement(View, {
|
|
113
67
|
style: [styles.label, {
|
|
114
68
|
marginLeft: iconNode ? 32 : 0,
|
|
115
69
|
marginVertical: 5
|
|
@@ -118,9 +72,8 @@ export default function DrawerItem(props) {
|
|
|
118
72
|
numberOfLines: 1,
|
|
119
73
|
allowFontScaling: allowFontScaling,
|
|
120
74
|
style: [{
|
|
121
|
-
color
|
|
122
|
-
|
|
123
|
-
}, labelStyle]
|
|
75
|
+
color
|
|
76
|
+
}, fonts.medium, labelStyle]
|
|
124
77
|
}, label) : label({
|
|
125
78
|
color,
|
|
126
79
|
focused
|
|
@@ -140,9 +93,6 @@ const styles = StyleSheet.create({
|
|
|
140
93
|
label: {
|
|
141
94
|
marginRight: 32,
|
|
142
95
|
flex: 1
|
|
143
|
-
},
|
|
144
|
-
button: {
|
|
145
|
-
display: 'flex'
|
|
146
96
|
}
|
|
147
97
|
});
|
|
148
98
|
//# 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","marginLeft","marginVertical","numberOfLines","medium","create","marginHorizontal","overflow","flexDirection","alignItems","padding","marginRight","flex"],"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,GAA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AAI;IACHoB,KAAK,EAAE,CACLgB,MAAM,CAAC7B,KAAK,EACZ;MAAEmC,UAAU,EAAEX,QAAQ,GAAG,EAAE,GAAG,CAAC;MAAEY,cAAc,EAAE;IAAE,CAAC;EACpD,GAED,OAAOpC,KAAK,KAAK,QAAQ,gBACxBT,KAAA,CAAAmC,aAAA,CAACtC,IAAI;IACHiD,aAAa,EAAE,CAAE;IACjBlC,gBAAgB,EAAEA,gBAAiB;IACnCU,KAAK,EAAE,CAAC;MAAES;IAAM,CAAC,EAAEzB,KAAK,CAACyC,MAAM,EAAErC,UAAU;EAAE,GAE5CD,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;IACpBJ,cAAc,EAAE,CAAC;IACjBK,QAAQ,EAAE;EACZ,CAAC;EACDP,OAAO,EAAE;IACPQ,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE;EACX,CAAC;EACD5C,KAAK,EAAE;IACL6C,WAAW,EAAE,EAAE;IACfC,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CommonActions, DrawerActions,
|
|
1
|
+
import { CommonActions, DrawerActions, useLinkBuilder } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import DrawerItem from './DrawerItem';
|
|
3
|
+
import { DrawerItem } from './DrawerItem';
|
|
4
4
|
/**
|
|
5
5
|
* Component that renders the navigation list in the drawer.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export function DrawerItemList(_ref) {
|
|
8
8
|
let {
|
|
9
9
|
state,
|
|
10
10
|
navigation,
|
|
@@ -12,7 +12,7 @@ export default 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,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AAE/B,qBAAsB;MACvCgC,iBAAiB,EAAE/B,uBAAwB;MAC3CgC,qBAAqB,EAAE/B,2BAA4B;MACnDgC,uBAAuB,EAAE/B,6BAA8B;MACvDgC,gBAAgB,EAAEZ,sBAAuB;MACzCa,UAAU,EAAEf,gBAAiB;MAC7BgB,KAAK,EAAEf,eAAgB;MACvBd,OAAO,EAAEA;IAAQ,CAClB,CAAC;EAEN,CAAC,CAAC;AACJ"}
|
|
@@ -3,15 +3,13 @@ import { PlatformPressable } from '@react-navigation/elements';
|
|
|
3
3
|
import { DrawerActions, useNavigation } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { Image, Platform, StyleSheet } from 'react-native';
|
|
6
|
-
export
|
|
6
|
+
export function DrawerToggleButton(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
tintColor,
|
|
9
9
|
...rest
|
|
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 default 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,4BAA4B;AAC9D,SACEC,aAAa,EAEbC,aAAa,QACR,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAW1D,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAAgC;EAAA,IAA/B;IAAEC,SAAS;IAAE,GAAGC;EAAY,CAAC,GAAAF,IAAA;EAC9D,MAAMG,UAAU,GAAGT,aAAa,CAAsC,CAAC;EAEvE,oBACEC,KAAA,CAAAS,aAAA,CAACZ,iBAAiB,EAAAa,QAAA,KACZH,IAAI;IACRI,cAAc,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAE;IACrCC,OAAO,EAAEA,CAAA,KAAML,UAAU,CAACM,QAAQ,CAAChB,aAAa,CAACiB,YAAY,CAAC,CAAC,CAAE;IACjEC,KAAK,EAAEC,MAAM,CAACC,SAAU;IACxBC,OAAO,EAAEjB,QAAQ,CAACkB,MAAM,CAAC;MACvBC,GAAG,EAAEC,SAAS;MACdC,OAAO,EAAE;QAAEC,GAAG,EAAE,EAAE;QAAEC,KAAK,EAAE,EAAE;QAAEC,MAAM,EAAE,EAAE;QAAEC,IAAI,EAAE;MAAG;IACtD,CAAC;EAAE,iBAEH3B,KAAA,CAAAS,aAAA,CAACR,KAAK;IACJe,KAAK,EAAE,CAACC,MAAM,CAACW,IAAI,EAAEtB,SAAS,GAAG;MAAEA;IAAU,CAAC,GAAG,IAAI,CAAE;IACvDuB,UAAU,EAAC,SAAS;IACpBC,MAAM,EAAEC,OAAO,CAAC,iCAAiC,CAAE;IACnDC,YAAY,EAAE;EAAE,CACjB,CACgB,CAAC;AAExB;AAEA,MAAMf,MAAM,GAAGd,UAAU,CAAC8B,MAAM,CAAC;EAC/BL,IAAI,EAAE;IACJM,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDlB,SAAS,EAAE;IACTmB,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
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
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import useLatestCallback from 'use-latest-callback';
|
|
9
|
+
import { addCancelListener } from '../utils/addCancelListener';
|
|
10
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
11
|
+
import { DrawerStatusContext } from '../utils/DrawerStatusContext';
|
|
12
|
+
import { getDrawerStatusFromState } from '../utils/getDrawerStatusFromState';
|
|
13
|
+
import { DrawerContent } from './DrawerContent';
|
|
14
|
+
import { DrawerToggleButton } from './DrawerToggleButton';
|
|
13
15
|
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
|
14
16
|
function DrawerViewBase(_ref) {
|
|
15
17
|
let {
|
|
@@ -20,10 +22,13 @@ function DrawerViewBase(_ref) {
|
|
|
20
22
|
drawerContent = props => /*#__PURE__*/React.createElement(DrawerContent, props),
|
|
21
23
|
detachInactiveScreens = Platform.OS === 'web' || Platform.OS === 'android' || Platform.OS === 'ios'
|
|
22
24
|
} = _ref;
|
|
25
|
+
const {
|
|
26
|
+
direction
|
|
27
|
+
} = useLocale();
|
|
23
28
|
const focusedRouteKey = state.routes[state.index].key;
|
|
24
29
|
const {
|
|
25
30
|
drawerHideStatusBarOnOpen,
|
|
26
|
-
drawerPosition =
|
|
31
|
+
drawerPosition = direction === 'rtl' ? 'right' : 'left',
|
|
27
32
|
drawerStatusBarAnimation,
|
|
28
33
|
drawerStyle,
|
|
29
34
|
drawerType,
|
|
@@ -44,18 +49,54 @@ function DrawerViewBase(_ref) {
|
|
|
44
49
|
colors
|
|
45
50
|
} = useTheme();
|
|
46
51
|
const drawerStatus = getDrawerStatusFromState(state);
|
|
47
|
-
const handleDrawerOpen =
|
|
52
|
+
const handleDrawerOpen = useLatestCallback(() => {
|
|
48
53
|
navigation.dispatch({
|
|
49
54
|
...DrawerActions.openDrawer(),
|
|
50
55
|
target: state.key
|
|
51
56
|
});
|
|
52
|
-
}
|
|
53
|
-
const handleDrawerClose =
|
|
57
|
+
});
|
|
58
|
+
const handleDrawerClose = useLatestCallback(() => {
|
|
54
59
|
navigation.dispatch({
|
|
55
60
|
...DrawerActions.closeDrawer(),
|
|
56
61
|
target: state.key
|
|
57
62
|
});
|
|
58
|
-
}
|
|
63
|
+
});
|
|
64
|
+
const handleGestureStart = useLatestCallback(() => {
|
|
65
|
+
navigation.emit({
|
|
66
|
+
type: 'gestureStart',
|
|
67
|
+
target: state.key
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const handleGestureEnd = useLatestCallback(() => {
|
|
71
|
+
navigation.emit({
|
|
72
|
+
type: 'gestureEnd',
|
|
73
|
+
target: state.key
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const handleGestureCancel = useLatestCallback(() => {
|
|
77
|
+
navigation.emit({
|
|
78
|
+
type: 'gestureCancel',
|
|
79
|
+
target: state.key
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
const handleTransitionStart = useLatestCallback(closing => {
|
|
83
|
+
navigation.emit({
|
|
84
|
+
type: 'transitionStart',
|
|
85
|
+
data: {
|
|
86
|
+
closing
|
|
87
|
+
},
|
|
88
|
+
target: state.key
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
const handleTransitionEnd = useLatestCallback(closing => {
|
|
92
|
+
navigation.emit({
|
|
93
|
+
type: 'transitionEnd',
|
|
94
|
+
data: {
|
|
95
|
+
closing
|
|
96
|
+
},
|
|
97
|
+
target: state.key
|
|
98
|
+
});
|
|
99
|
+
});
|
|
59
100
|
React.useEffect(() => {
|
|
60
101
|
if (drawerStatus === defaultStatus || drawerType === 'permanent') {
|
|
61
102
|
return;
|
|
@@ -73,27 +114,11 @@ function DrawerViewBase(_ref) {
|
|
|
73
114
|
}
|
|
74
115
|
return true;
|
|
75
116
|
};
|
|
76
|
-
const handleEscape = e => {
|
|
77
|
-
if (e.key === 'Escape') {
|
|
78
|
-
handleHardwareBack();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
117
|
|
|
82
118
|
// We only add the listeners when drawer opens
|
|
83
119
|
// This way we can make sure that the listener is added as late as possible
|
|
84
120
|
// This will make sure that our handler will run first when back button is pressed
|
|
85
|
-
|
|
86
|
-
if (Platform.OS === 'web') {
|
|
87
|
-
var _document, _document$body, _document$body$addEve;
|
|
88
|
-
(_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);
|
|
89
|
-
}
|
|
90
|
-
return () => {
|
|
91
|
-
subscription.remove();
|
|
92
|
-
if (Platform.OS === 'web') {
|
|
93
|
-
var _document2, _document2$body, _document2$body$remov;
|
|
94
|
-
(_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);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
121
|
+
return addCancelListener(handleHardwareBack);
|
|
97
122
|
}, [defaultStatus, drawerStatus, drawerType, handleDrawerClose, handleDrawerOpen, navigation]);
|
|
98
123
|
const renderDrawerContent = () => {
|
|
99
124
|
return /*#__PURE__*/React.createElement(DrawerPositionContext.Provider, {
|
|
@@ -119,8 +144,8 @@ function DrawerViewBase(_ref) {
|
|
|
119
144
|
if (unmountOnBlur && !isFocused) {
|
|
120
145
|
return null;
|
|
121
146
|
}
|
|
122
|
-
if (lazy && !loaded.includes(route.key) && !isFocused) {
|
|
123
|
-
// Don't render a lazy screen if we've never navigated to it
|
|
147
|
+
if (lazy && !loaded.includes(route.key) && !isFocused && !state.preloadedRouteKeys.includes(route.key)) {
|
|
148
|
+
// Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
|
|
124
149
|
return null;
|
|
125
150
|
}
|
|
126
151
|
const {
|
|
@@ -172,6 +197,11 @@ function DrawerViewBase(_ref) {
|
|
|
172
197
|
open: drawerStatus !== 'closed',
|
|
173
198
|
onOpen: handleDrawerOpen,
|
|
174
199
|
onClose: handleDrawerClose,
|
|
200
|
+
onGestureStart: handleGestureStart,
|
|
201
|
+
onGestureEnd: handleGestureEnd,
|
|
202
|
+
onGestureCancel: handleGestureCancel,
|
|
203
|
+
onTransitionStart: handleTransitionStart,
|
|
204
|
+
onTransitionEnd: handleTransitionEnd,
|
|
175
205
|
layout: dimensions,
|
|
176
206
|
gestureHandlerProps: gestureHandlerProps,
|
|
177
207
|
swipeEnabled: swipeEnabled,
|
|
@@ -184,7 +214,8 @@ function DrawerViewBase(_ref) {
|
|
|
184
214
|
overlayAccessibilityLabel: overlayAccessibilityLabel,
|
|
185
215
|
drawerPosition: drawerPosition,
|
|
186
216
|
drawerStyle: [{
|
|
187
|
-
backgroundColor: colors.card
|
|
217
|
+
backgroundColor: colors.card,
|
|
218
|
+
width: getDefaultSidebarWidth(dimensions)
|
|
188
219
|
}, drawerType === 'permanent' && (drawerPosition === 'left' ? {
|
|
189
220
|
borderRightColor: colors.border,
|
|
190
221
|
borderRightWidth: StyleSheet.hairlineWidth
|
|
@@ -198,7 +229,7 @@ function DrawerViewBase(_ref) {
|
|
|
198
229
|
renderDrawerContent: renderDrawerContent
|
|
199
230
|
}, renderSceneContent()));
|
|
200
231
|
}
|
|
201
|
-
export
|
|
232
|
+
export function DrawerView(_ref3) {
|
|
202
233
|
let {
|
|
203
234
|
navigation,
|
|
204
235
|
...rest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","DrawerActions","useTheme","React","
|
|
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","DrawerViewBase","_ref","state","navigation","descriptors","defaultStatus","drawerContent","props","createElement","detachInactiveScreens","OS","direction","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","drawerStatusBarAnimation","drawerStyle","drawerType","gestureHandlerProps","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","borderRightColor","border","borderRightWidth","hairlineWidth","borderLeftColor","borderLeftWidth","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,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