@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":";AAAA,O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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addCancelListener.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/addCancelListener.native.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,aAAc,MAAM,OAAO,eASxD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { DrawerContentComponentProps } from '../types';
|
|
2
|
-
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): JSX.Element;
|
|
3
|
+
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): React.JSX.Element;
|
|
3
4
|
//# sourceMappingURL=DrawerContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,qBAgB7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScrollView, ScrollViewProps } from 'react-native';
|
|
2
|
+
import { ScrollView, type ScrollViewProps } from 'react-native';
|
|
3
3
|
export declare const DrawerContentScrollView: React.ForwardRefExoticComponent<ScrollViewProps & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
} & React.RefAttributes<ScrollView>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAc,MAAM,cAAc,CAAC;AA0C5E,eAAO,MAAM,uBAAuB;cApCxB,MAAM,SAAS;oCAsC1B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Route } from '@react-navigation/native';
|
|
1
|
+
import { type Route } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
4
4
|
type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* The route object which should be specified by the drawer item.
|
|
@@ -87,6 +87,6 @@ type Props = {
|
|
|
87
87
|
/**
|
|
88
88
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
89
89
|
*/
|
|
90
|
-
export declare function DrawerItem(props: Props): JSX.Element;
|
|
90
|
+
export declare function DrawerItem(props: Props): React.JSX.Element;
|
|
91
91
|
export {};
|
|
92
92
|
//# sourceMappingURL=DrawerItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,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1,4 +1,4 @@
|
|
|
1
|
-
import { DrawerNavigationState, ParamListBase } from '@react-navigation/native';
|
|
1
|
+
import { type DrawerNavigationState, type ParamListBase } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
|
|
4
4
|
type Props = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG7E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,sEAoEvE"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
type Props = {
|
|
2
3
|
accessibilityLabel?: string;
|
|
3
4
|
pressColor?: string;
|
|
4
5
|
pressOpacity?: number;
|
|
5
6
|
tintColor?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare function DrawerToggleButton({ tintColor, ...rest }: Props): JSX.Element;
|
|
8
|
+
export declare function DrawerToggleButton({ tintColor, ...rest }: Props): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=DrawerToggleButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,KAAK,KAAK,GAAG;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,qBAsB/D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
|
|
1
|
+
import { type DrawerNavigationState, type DrawerStatus, type ParamListBase } from '@react-navigation/native';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import type { DrawerDescriptorMap, DrawerNavigationConfig, DrawerNavigationHelpers } from '../types';
|
|
3
4
|
type Props = DrawerNavigationConfig & {
|
|
4
5
|
defaultStatus: DrawerStatus;
|
|
@@ -6,6 +7,6 @@ type Props = DrawerNavigationConfig & {
|
|
|
6
7
|
navigation: DrawerNavigationHelpers;
|
|
7
8
|
descriptors: DrawerDescriptorMap;
|
|
8
9
|
};
|
|
9
|
-
export declare function DrawerView({ navigation, ...rest }: Props): JSX.Element;
|
|
10
|
+
export declare function DrawerView({ navigation, ...rest }: Props): React.JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=DrawerView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AASlB,KAAK,KAAK,GAAG,sBAAsB,GAAG;IACpC,aAAa,EAAE,YAAY,CAAC;IAC5B,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AA0RF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,qBAMxD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleProp, ViewProps, ViewStyle } from 'react-native';
|
|
2
|
+
import { type StyleProp, type ViewProps, type ViewStyle } from 'react-native';
|
|
3
3
|
type Props = {
|
|
4
4
|
visible: boolean;
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -11,7 +11,7 @@ export declare const MaybeScreenContainer: ({ enabled, ...rest }: ViewProps & {
|
|
|
11
11
|
enabled: boolean;
|
|
12
12
|
hasTwoStates: boolean;
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
}) => JSX.Element;
|
|
15
|
-
export declare function MaybeScreen({ visible, children, ...rest }: Props): JSX.Element;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export declare function MaybeScreen({ visible, children, ...rest }: Props): React.JSX.Element;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=ScreenFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAUF,eAAO,MAAM,oBAAoB;aAItB,OAAO;kBACF,OAAO;cACX,MAAM,SAAS;uBAO1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,qBAchE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/drawer",
|
|
3
3
|
"description": "Integration for the drawer component from react-native-drawer-layout",
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.21",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -41,33 +41,32 @@
|
|
|
41
41
|
"clean": "del lib"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@react-navigation/elements": "^
|
|
44
|
+
"@react-navigation/elements": "^2.0.0-alpha.17",
|
|
45
45
|
"color": "^4.2.3",
|
|
46
|
-
"react-native-drawer-layout": "^
|
|
47
|
-
"use-latest-callback": "^0.1.
|
|
46
|
+
"react-native-drawer-layout": "^4.0.0-alpha.9",
|
|
47
|
+
"use-latest-callback": "^0.1.9"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@react-navigation/native": "^7.0.0-alpha.
|
|
51
|
-
"@testing-library/react-native": "^
|
|
52
|
-
"@types/react": "~18.
|
|
53
|
-
"
|
|
54
|
-
"del-cli": "^5.0.0",
|
|
50
|
+
"@react-navigation/native": "^7.0.0-alpha.18",
|
|
51
|
+
"@testing-library/react-native": "^12.4.3",
|
|
52
|
+
"@types/react": "~18.2.45",
|
|
53
|
+
"del-cli": "^5.1.0",
|
|
55
54
|
"react": "18.2.0",
|
|
56
|
-
"react-native": "0.
|
|
57
|
-
"react-native-builder-bob": "^0.
|
|
58
|
-
"react-native-gesture-handler": "~2.
|
|
59
|
-
"react-native-reanimated": "~
|
|
60
|
-
"react-native-safe-area-context": "4.
|
|
61
|
-
"react-native-screens": "~3.
|
|
62
|
-
"typescript": "^
|
|
55
|
+
"react-native": "0.73.2",
|
|
56
|
+
"react-native-builder-bob": "^0.23.2",
|
|
57
|
+
"react-native-gesture-handler": "~2.14.0",
|
|
58
|
+
"react-native-reanimated": "~3.6.0",
|
|
59
|
+
"react-native-safe-area-context": "4.8.2",
|
|
60
|
+
"react-native-screens": "~3.29.0",
|
|
61
|
+
"typescript": "^5.3.3"
|
|
63
62
|
},
|
|
64
63
|
"peerDependencies": {
|
|
65
|
-
"@react-navigation/native": "^
|
|
66
|
-
"react": "
|
|
67
|
-
"react-native": "
|
|
68
|
-
"react-native-gesture-handler": ">=
|
|
69
|
-
"react-native-reanimated": ">=
|
|
70
|
-
"react-native-safe-area-context": ">=
|
|
64
|
+
"@react-navigation/native": "^7.0.0-alpha.18",
|
|
65
|
+
"react": ">= 18.2.0",
|
|
66
|
+
"react-native": ">= 0.72.0",
|
|
67
|
+
"react-native-gesture-handler": ">= 2.0.0",
|
|
68
|
+
"react-native-reanimated": ">= 2.0.0",
|
|
69
|
+
"react-native-safe-area-context": ">= 4.0.0",
|
|
71
70
|
"react-native-screens": ">= 3.0.0"
|
|
72
71
|
},
|
|
73
72
|
"react-native-builder-bob": {
|
|
@@ -84,5 +83,5 @@
|
|
|
84
83
|
]
|
|
85
84
|
]
|
|
86
85
|
},
|
|
87
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "a41d932198d1b48d84f410be1633fc5ddcb2df3f"
|
|
88
87
|
}
|
package/src/index.tsx
CHANGED
|
@@ -20,7 +20,6 @@ export { DrawerStatusContext } from './utils/DrawerStatusContext';
|
|
|
20
20
|
export { getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
|
|
21
21
|
export { useDrawerStatus } from './utils/useDrawerStatus';
|
|
22
22
|
export {
|
|
23
|
-
DrawerGestureContext,
|
|
24
23
|
DrawerProgressContext,
|
|
25
24
|
useDrawerProgress,
|
|
26
25
|
} from 'react-native-drawer-layout';
|
|
@@ -34,5 +33,6 @@ export type {
|
|
|
34
33
|
DrawerNavigationEventMap,
|
|
35
34
|
DrawerNavigationOptions,
|
|
36
35
|
DrawerNavigationProp,
|
|
36
|
+
DrawerOptionsArgs,
|
|
37
37
|
DrawerScreenProps,
|
|
38
38
|
} from './types';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNavigatorFactory,
|
|
3
|
-
DefaultNavigatorOptions,
|
|
4
|
-
DrawerActionHelpers,
|
|
5
|
-
DrawerNavigationState,
|
|
3
|
+
type DefaultNavigatorOptions,
|
|
4
|
+
type DrawerActionHelpers,
|
|
5
|
+
type DrawerNavigationState,
|
|
6
6
|
DrawerRouter,
|
|
7
|
-
DrawerRouterOptions,
|
|
8
|
-
|
|
7
|
+
type DrawerRouterOptions,
|
|
8
|
+
type NavigatorTypeBagBase,
|
|
9
|
+
type ParamListBase,
|
|
10
|
+
type StaticConfig,
|
|
11
|
+
type TypedNavigator,
|
|
9
12
|
useNavigationBuilder,
|
|
10
13
|
} from '@react-navigation/native';
|
|
11
14
|
import * as React from 'react';
|
|
@@ -14,14 +17,17 @@ import type {
|
|
|
14
17
|
DrawerNavigationConfig,
|
|
15
18
|
DrawerNavigationEventMap,
|
|
16
19
|
DrawerNavigationOptions,
|
|
20
|
+
DrawerNavigationProp,
|
|
17
21
|
} from '../types';
|
|
18
22
|
import { DrawerView } from '../views/DrawerView';
|
|
19
23
|
|
|
20
24
|
type Props = DefaultNavigatorOptions<
|
|
21
25
|
ParamListBase,
|
|
26
|
+
string | undefined,
|
|
22
27
|
DrawerNavigationState<ParamListBase>,
|
|
23
28
|
DrawerNavigationOptions,
|
|
24
|
-
DrawerNavigationEventMap
|
|
29
|
+
DrawerNavigationEventMap,
|
|
30
|
+
DrawerNavigationProp<ParamListBase>
|
|
25
31
|
> &
|
|
26
32
|
DrawerRouterOptions &
|
|
27
33
|
DrawerNavigationConfig;
|
|
@@ -32,8 +38,11 @@ function DrawerNavigator({
|
|
|
32
38
|
defaultStatus = 'closed',
|
|
33
39
|
backBehavior,
|
|
34
40
|
children,
|
|
41
|
+
layout,
|
|
35
42
|
screenListeners,
|
|
36
43
|
screenOptions,
|
|
44
|
+
screenLayout,
|
|
45
|
+
UNSTABLE_getStateForRouteNamesChange,
|
|
37
46
|
...rest
|
|
38
47
|
}: Props) {
|
|
39
48
|
const { state, descriptors, navigation, NavigationContent } =
|
|
@@ -49,8 +58,11 @@ function DrawerNavigator({
|
|
|
49
58
|
defaultStatus,
|
|
50
59
|
backBehavior,
|
|
51
60
|
children,
|
|
61
|
+
layout,
|
|
52
62
|
screenListeners,
|
|
53
63
|
screenOptions,
|
|
64
|
+
screenLayout,
|
|
65
|
+
UNSTABLE_getStateForRouteNamesChange,
|
|
54
66
|
});
|
|
55
67
|
|
|
56
68
|
return (
|
|
@@ -66,9 +78,27 @@ function DrawerNavigator({
|
|
|
66
78
|
);
|
|
67
79
|
}
|
|
68
80
|
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
export function createDrawerNavigator<
|
|
82
|
+
ParamList extends ParamListBase,
|
|
83
|
+
NavigatorID extends string | undefined = undefined,
|
|
84
|
+
TypeBag extends NavigatorTypeBagBase = {
|
|
85
|
+
ParamList: ParamList;
|
|
86
|
+
NavigatorID: NavigatorID;
|
|
87
|
+
State: DrawerNavigationState<ParamList>;
|
|
88
|
+
ScreenOptions: DrawerNavigationOptions;
|
|
89
|
+
EventMap: DrawerNavigationEventMap;
|
|
90
|
+
NavigationList: {
|
|
91
|
+
[RouteName in keyof ParamList]: DrawerNavigationProp<
|
|
92
|
+
ParamList,
|
|
93
|
+
RouteName,
|
|
94
|
+
NavigatorID
|
|
95
|
+
>;
|
|
96
|
+
};
|
|
97
|
+
Navigator: typeof DrawerNavigator;
|
|
98
|
+
},
|
|
99
|
+
Config extends StaticConfig<TypeBag> | undefined =
|
|
100
|
+
| StaticConfig<TypeBag>
|
|
101
|
+
| undefined,
|
|
102
|
+
>(config?: Config): TypedNavigator<TypeBag, Config> {
|
|
103
|
+
return createNavigatorFactory(DrawerNavigator)(config);
|
|
104
|
+
}
|
package/src/types.tsx
CHANGED
|
@@ -8,12 +8,10 @@ import type {
|
|
|
8
8
|
ParamListBase,
|
|
9
9
|
Route,
|
|
10
10
|
RouteProp,
|
|
11
|
+
Theme,
|
|
11
12
|
} from '@react-navigation/native';
|
|
12
13
|
import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
13
|
-
import type {
|
|
14
|
-
PanGestureHandler,
|
|
15
|
-
PanGestureHandlerProperties,
|
|
16
|
-
} from 'react-native-gesture-handler';
|
|
14
|
+
import type { PanGesture } from 'react-native-gesture-handler';
|
|
17
15
|
|
|
18
16
|
export type Scene = {
|
|
19
17
|
route: Route<string>;
|
|
@@ -35,16 +33,6 @@ export type DrawerNavigationConfig = {
|
|
|
35
33
|
* Defaults to `true`.
|
|
36
34
|
*/
|
|
37
35
|
detachInactiveScreens?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Whether to use the legacy implementation based on Reanimated 1.
|
|
40
|
-
* The new implementation based on Reanimated 2 will perform better,
|
|
41
|
-
* but it's not possible to use Chrome remote debugger.
|
|
42
|
-
*
|
|
43
|
-
* This defaults to `true` if Reanimated 2 is not configured.
|
|
44
|
-
*
|
|
45
|
-
* Otherwise, it defaults to `false`
|
|
46
|
-
*/
|
|
47
|
-
useLegacyImplementation?: boolean;
|
|
48
36
|
};
|
|
49
37
|
|
|
50
38
|
export type DrawerNavigationOptions = HeaderOptions & {
|
|
@@ -183,10 +171,9 @@ export type DrawerNavigationOptions = HeaderOptions & {
|
|
|
183
171
|
sceneContainerStyle?: StyleProp<ViewStyle>;
|
|
184
172
|
|
|
185
173
|
/**
|
|
186
|
-
*
|
|
187
|
-
* Not supported on Web.
|
|
174
|
+
* Function to modify the pan gesture handler via RNGH properties API.
|
|
188
175
|
*/
|
|
189
|
-
|
|
176
|
+
configureGestureHandler?: (gesture: PanGesture) => PanGesture;
|
|
190
177
|
|
|
191
178
|
/**
|
|
192
179
|
* Whether you can use swipe gestures to open or close the drawer.
|
|
@@ -289,7 +276,7 @@ export type DrawerNavigationHelpers = NavigationHelpers<
|
|
|
289
276
|
export type DrawerNavigationProp<
|
|
290
277
|
ParamList extends ParamListBase,
|
|
291
278
|
RouteName extends keyof ParamList = keyof ParamList,
|
|
292
|
-
NavigatorID extends string | undefined = undefined
|
|
279
|
+
NavigatorID extends string | undefined = undefined,
|
|
293
280
|
> = NavigationProp<
|
|
294
281
|
ParamList,
|
|
295
282
|
RouteName,
|
|
@@ -303,12 +290,20 @@ export type DrawerNavigationProp<
|
|
|
303
290
|
export type DrawerScreenProps<
|
|
304
291
|
ParamList extends ParamListBase,
|
|
305
292
|
RouteName extends keyof ParamList = keyof ParamList,
|
|
306
|
-
NavigatorID extends string | undefined = undefined
|
|
293
|
+
NavigatorID extends string | undefined = undefined,
|
|
307
294
|
> = {
|
|
308
295
|
navigation: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
309
296
|
route: RouteProp<ParamList, RouteName>;
|
|
310
297
|
};
|
|
311
298
|
|
|
299
|
+
export type DrawerOptionsArgs<
|
|
300
|
+
ParamList extends ParamListBase,
|
|
301
|
+
RouteName extends keyof ParamList = keyof ParamList,
|
|
302
|
+
NavigatorID extends string | undefined = undefined,
|
|
303
|
+
> = DrawerScreenProps<ParamList, RouteName, NavigatorID> & {
|
|
304
|
+
theme: Theme;
|
|
305
|
+
};
|
|
306
|
+
|
|
312
307
|
export type DrawerDescriptor = Descriptor<
|
|
313
308
|
DrawerNavigationOptions,
|
|
314
309
|
DrawerNavigationProp<ParamListBase>,
|
|
@@ -322,7 +317,7 @@ export type DrawerProps = {
|
|
|
322
317
|
drawerPosition: 'left' | 'right';
|
|
323
318
|
drawerStyle?: StyleProp<ViewStyle>;
|
|
324
319
|
drawerType: 'front' | 'back' | 'slide' | 'permanent';
|
|
325
|
-
|
|
320
|
+
configureGestureHandler?: (gesture: PanGesture) => PanGesture;
|
|
326
321
|
hideStatusBarOnOpen: boolean;
|
|
327
322
|
keyboardDismissMode: 'none' | 'on-drag';
|
|
328
323
|
onClose: () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BackHandler } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const addCancelListener = (callback: () => boolean) => {
|
|
4
|
+
const subscription = BackHandler.addEventListener(
|
|
5
|
+
'hardwareBackPress',
|
|
6
|
+
callback
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
return () => {
|
|
10
|
+
subscription.remove();
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const addCancelListener = (callback: () => boolean) => {
|
|
2
|
+
const handleEscape = (e: KeyboardEvent) => {
|
|
3
|
+
if (e.key === 'Escape') {
|
|
4
|
+
callback();
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
document?.body?.addEventListener?.('keyup', handleEscape);
|
|
9
|
+
|
|
10
|
+
return () => {
|
|
11
|
+
document?.body?.removeEventListener?.('keyup', handleEscape);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
import { useLocale } from '@react-navigation/native';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
I18nManager,
|
|
4
|
-
ScrollView,
|
|
5
|
-
ScrollViewProps,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
} from 'react-native';
|
|
3
|
+
import { ScrollView, type ScrollViewProps, StyleSheet } from 'react-native';
|
|
8
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
5
|
|
|
10
6
|
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
@@ -19,10 +15,12 @@ function DrawerContentScrollViewInner(
|
|
|
19
15
|
) {
|
|
20
16
|
const drawerPosition = React.useContext(DrawerPositionContext);
|
|
21
17
|
const insets = useSafeAreaInsets();
|
|
18
|
+
const { direction } = useLocale();
|
|
22
19
|
|
|
23
|
-
const isRight =
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const isRight =
|
|
21
|
+
direction === 'rtl'
|
|
22
|
+
? drawerPosition === 'left'
|
|
23
|
+
: drawerPosition === 'right';
|
|
26
24
|
|
|
27
25
|
return (
|
|
28
26
|
<ScrollView
|
|
@@ -30,7 +28,8 @@ function DrawerContentScrollViewInner(
|
|
|
30
28
|
ref={ref}
|
|
31
29
|
contentContainerStyle={[
|
|
32
30
|
{
|
|
33
|
-
paddingTop: insets.top +
|
|
31
|
+
paddingTop: insets.top + 10,
|
|
32
|
+
paddingBottom: insets.bottom + 10,
|
|
34
33
|
paddingStart: !isRight ? insets.left : 0,
|
|
35
34
|
paddingEnd: isRight ? insets.right : 0,
|
|
36
35
|
},
|