@react-navigation/drawer 7.0.0-alpha.0 → 7.0.0-alpha.2
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 +5 -6
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +3 -3
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +2 -3
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +3 -4
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +5 -6
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +6 -7
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +5 -5
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +3 -4
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +57 -15
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- 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 +2 -2
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js +1 -2
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js +2 -2
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +3 -3
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +3 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +5 -5
- 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 +1 -1
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +52 -10
- package/lib/module/views/DrawerView.js.map +1 -1
- 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 +2 -3
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +34 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +1 -1
- 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 +1 -2
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/index.tsx +10 -10
- package/src/navigators/createDrawerNavigator.tsx +2 -2
- package/src/types.tsx +20 -0
- package/src/utils/DrawerPositionContext.tsx +3 -1
- package/src/utils/DrawerStatusContext.tsx +3 -5
- package/src/utils/getDrawerStatusFromState.tsx +1 -1
- package/src/utils/useDrawerStatus.tsx +2 -2
- package/src/views/DrawerContent.tsx +3 -3
- package/src/views/DrawerContentScrollView.tsx +5 -3
- package/src/views/DrawerItem.tsx +3 -9
- package/src/views/DrawerItemList.tsx +2 -6
- package/src/views/DrawerToggleButton.tsx +1 -1
- package/src/views/DrawerView.tsx +53 -10
|
@@ -218,6 +218,40 @@ export type DrawerNavigationEventMap = {
|
|
|
218
218
|
data: undefined;
|
|
219
219
|
canPreventDefault: true;
|
|
220
220
|
};
|
|
221
|
+
/**
|
|
222
|
+
* Event which fires when a transition animation starts.
|
|
223
|
+
*/
|
|
224
|
+
transitionStart: {
|
|
225
|
+
data: {
|
|
226
|
+
closing: boolean;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Event which fires when a transition animation ends.
|
|
231
|
+
*/
|
|
232
|
+
transitionEnd: {
|
|
233
|
+
data: {
|
|
234
|
+
closing: boolean;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Event which fires when navigation gesture starts.
|
|
239
|
+
*/
|
|
240
|
+
gestureStart: {
|
|
241
|
+
data: undefined;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Event which fires when navigation gesture is completed.
|
|
245
|
+
*/
|
|
246
|
+
gestureEnd: {
|
|
247
|
+
data: undefined;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Event which fires when navigation gesture is canceled.
|
|
251
|
+
*/
|
|
252
|
+
gestureCancel: {
|
|
253
|
+
data: undefined;
|
|
254
|
+
};
|
|
221
255
|
};
|
|
222
256
|
export type DrawerNavigationHelpers = NavigationHelpers<ParamListBase, DrawerNavigationEventMap> & DrawerActionHelpers<ParamListBase>;
|
|
223
257
|
export type DrawerNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, DrawerNavigationState<ParamList>, DrawerNavigationOptions, DrawerNavigationEventMap> & DrawerActionHelpers<ParamList>;
|
|
@@ -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,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;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BAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
export default _default;
|
|
2
|
+
export declare const DrawerPositionContext: React.Context<"left" | "right" | undefined>;
|
|
4
3
|
//# sourceMappingURL=DrawerPositionContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerPositionContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerPositionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"DrawerPositionContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerPositionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,qBAAqB,6CAEtB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
declare const DrawerStatusContext: React.Context<DrawerStatus | undefined>;
|
|
4
|
-
export default DrawerStatusContext;
|
|
3
|
+
export declare const DrawerStatusContext: React.Context<DrawerStatus | undefined>;
|
|
5
4
|
//# sourceMappingURL=DrawerStatusContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerStatusContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerStatusContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,
|
|
1
|
+
{"version":3,"file":"DrawerStatusContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerStatusContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,mBAAmB,yCAEpB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
|
|
2
|
-
export
|
|
2
|
+
export declare function getDrawerStatusFromState(state: DrawerNavigationState<ParamListBase>): DrawerStatus;
|
|
3
3
|
//# sourceMappingURL=getDrawerStatusFromState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDrawerStatusFromState.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDrawerStatusFromState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"getDrawerStatusFromState.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDrawerStatusFromState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,GAC1C,YAAY,CAYd"}
|
|
@@ -3,5 +3,5 @@ import type { DrawerStatus } from '@react-navigation/native';
|
|
|
3
3
|
* Hook to detect if the drawer's status in a parent navigator.
|
|
4
4
|
* Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function useDrawerStatus(): DrawerStatus;
|
|
7
7
|
//# sourceMappingURL=useDrawerStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawerStatus.d.ts","sourceRoot":"","sources":["../../../../src/utils/useDrawerStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"useDrawerStatus.d.ts","sourceRoot":"","sources":["../../../../src/utils/useDrawerStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAU9C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DrawerContentComponentProps } from '../types';
|
|
3
|
-
export
|
|
2
|
+
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): JSX.Element;
|
|
4
3
|
//# 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":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,eAgB7B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScrollView, ScrollViewProps } from 'react-native';
|
|
3
|
-
declare const
|
|
3
|
+
export declare const DrawerContentScrollView: React.ForwardRefExoticComponent<ScrollViewProps & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
} & React.RefAttributes<ScrollView>>;
|
|
6
|
-
export default _default;
|
|
7
6
|
//# sourceMappingURL=DrawerContentScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,eAAe,EAEhB,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,eAAe,EAEhB,MAAM,cAAc,CAAC;AAuCtB,eAAO,MAAM,uBAAuB;cAjCxB,MAAM,SAAS;oCAmC1B,CAAC"}
|
|
@@ -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
|
|
90
|
+
export declare function DrawerItem(props: Props): 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,EAAuB,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,SAAS,EAGT,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EACD,MAAM,GACN,CAAC,CAAC,K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B,UAAU,CAAC,KAAK,EAAE,KAAK,eA0EtC"}
|
|
@@ -9,6 +9,6 @@ type Props = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that renders the navigation list in the drawer.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export declare function DrawerItemList({ state, navigation, descriptors }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=DrawerItemList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEd,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,
|
|
1
|
+
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEd,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,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
type Props = {
|
|
3
2
|
accessibilityLabel?: string;
|
|
4
3
|
pressColor?: string;
|
|
5
4
|
pressOpacity?: number;
|
|
6
5
|
tintColor?: string;
|
|
7
6
|
};
|
|
8
|
-
export
|
|
7
|
+
export declare function DrawerToggleButton({ tintColor, ...rest }: Props): JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# 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":"AAWA,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,eAuB/D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
|
|
3
2
|
import type { DrawerDescriptorMap, DrawerNavigationConfig, DrawerNavigationHelpers } from '../types';
|
|
4
3
|
type Props = DrawerNavigationConfig & {
|
|
@@ -7,6 +6,6 @@ type Props = DrawerNavigationConfig & {
|
|
|
7
6
|
navigation: DrawerNavigationHelpers;
|
|
8
7
|
descriptors: DrawerDescriptorMap;
|
|
9
8
|
};
|
|
10
|
-
export
|
|
9
|
+
export declare function DrawerView({ navigation, ...rest }: Props): JSX.Element;
|
|
11
10
|
export {};
|
|
12
11
|
//# 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":"AAMA,OAAO,EAEL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AAQlB,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;AAwRF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAMxD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/drawer",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"description": "Integration for the drawer component from react-native-drawer-layout",
|
|
4
|
+
"version": "7.0.0-alpha.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -41,23 +41,24 @@
|
|
|
41
41
|
"clean": "del lib"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@react-navigation/elements": "^1.
|
|
44
|
+
"@react-navigation/elements": "^1.4.0-alpha.1",
|
|
45
45
|
"color": "^4.2.3",
|
|
46
|
-
"react-native-drawer-layout": "^3.1
|
|
46
|
+
"react-native-drawer-layout": "^3.2.1",
|
|
47
|
+
"use-latest-callback": "^0.1.5"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@react-navigation/native": "^7.0.0-alpha.
|
|
50
|
+
"@react-navigation/native": "^7.0.0-alpha.2",
|
|
50
51
|
"@testing-library/react-native": "^11.5.0",
|
|
51
|
-
"@types/react": "~18.0.
|
|
52
|
+
"@types/react": "~18.0.27",
|
|
52
53
|
"@types/react-native": "~0.70.8",
|
|
53
54
|
"del-cli": "^5.0.0",
|
|
54
|
-
"react": "18.
|
|
55
|
-
"react-native": "0.
|
|
56
|
-
"react-native-builder-bob": "^0.20.
|
|
57
|
-
"react-native-gesture-handler": "~2.
|
|
58
|
-
"react-native-reanimated": "~2.
|
|
59
|
-
"react-native-safe-area-context": "4.
|
|
60
|
-
"react-native-screens": "~3.
|
|
55
|
+
"react": "18.2.0",
|
|
56
|
+
"react-native": "0.71.8",
|
|
57
|
+
"react-native-builder-bob": "^0.20.4",
|
|
58
|
+
"react-native-gesture-handler": "~2.9.0",
|
|
59
|
+
"react-native-reanimated": "~2.14.4",
|
|
60
|
+
"react-native-safe-area-context": "4.5.0",
|
|
61
|
+
"react-native-screens": "~3.20.0",
|
|
61
62
|
"typescript": "^4.9.4"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
]
|
|
84
85
|
]
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "36c8f091556157dab74d3483651bbcbd340762ff"
|
|
87
88
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Navigators
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
4
|
+
export { createDrawerNavigator } from './navigators/createDrawerNavigator';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Views
|
|
8
8
|
*/
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
9
|
+
export { DrawerContent } from './views/DrawerContent';
|
|
10
|
+
export { DrawerContentScrollView } from './views/DrawerContentScrollView';
|
|
11
|
+
export { DrawerItem } from './views/DrawerItem';
|
|
12
|
+
export { DrawerItemList } from './views/DrawerItemList';
|
|
13
|
+
export { DrawerToggleButton } from './views/DrawerToggleButton';
|
|
14
|
+
export { DrawerView } from './views/DrawerView';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Utilities
|
|
18
18
|
*/
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
19
|
+
export { DrawerStatusContext } from './utils/DrawerStatusContext';
|
|
20
|
+
export { getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
|
|
21
|
+
export { useDrawerStatus } from './utils/useDrawerStatus';
|
|
22
22
|
export {
|
|
23
23
|
DrawerGestureContext,
|
|
24
24
|
DrawerProgressContext,
|
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
DrawerNavigationEventMap,
|
|
16
16
|
DrawerNavigationOptions,
|
|
17
17
|
} from '../types';
|
|
18
|
-
import DrawerView from '../views/DrawerView';
|
|
18
|
+
import { DrawerView } from '../views/DrawerView';
|
|
19
19
|
|
|
20
20
|
type Props = DefaultNavigatorOptions<
|
|
21
21
|
ParamListBase,
|
|
@@ -66,7 +66,7 @@ function DrawerNavigator({
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export
|
|
69
|
+
export const createDrawerNavigator = createNavigatorFactory<
|
|
70
70
|
DrawerNavigationState<ParamListBase>,
|
|
71
71
|
DrawerNavigationOptions,
|
|
72
72
|
DrawerNavigationEventMap,
|
package/src/types.tsx
CHANGED
|
@@ -258,6 +258,26 @@ export type DrawerNavigationEventMap = {
|
|
|
258
258
|
* Event which fires on tapping on the item in the drawer menu.
|
|
259
259
|
*/
|
|
260
260
|
drawerItemPress: { data: undefined; canPreventDefault: true };
|
|
261
|
+
/**
|
|
262
|
+
* Event which fires when a transition animation starts.
|
|
263
|
+
*/
|
|
264
|
+
transitionStart: { data: { closing: boolean } };
|
|
265
|
+
/**
|
|
266
|
+
* Event which fires when a transition animation ends.
|
|
267
|
+
*/
|
|
268
|
+
transitionEnd: { data: { closing: boolean } };
|
|
269
|
+
/**
|
|
270
|
+
* Event which fires when navigation gesture starts.
|
|
271
|
+
*/
|
|
272
|
+
gestureStart: { data: undefined };
|
|
273
|
+
/**
|
|
274
|
+
* Event which fires when navigation gesture is completed.
|
|
275
|
+
*/
|
|
276
|
+
gestureEnd: { data: undefined };
|
|
277
|
+
/**
|
|
278
|
+
* Event which fires when navigation gesture is canceled.
|
|
279
|
+
*/
|
|
280
|
+
gestureCancel: { data: undefined };
|
|
261
281
|
};
|
|
262
282
|
|
|
263
283
|
export type DrawerNavigationHelpers = NavigationHelpers<
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
const DrawerStatusContext = React.createContext<
|
|
5
|
-
undefined
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
export default DrawerStatusContext;
|
|
4
|
+
export const DrawerStatusContext = React.createContext<
|
|
5
|
+
DrawerStatus | undefined
|
|
6
|
+
>(undefined);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import DrawerStatusContext from './DrawerStatusContext';
|
|
4
|
+
import { DrawerStatusContext } from './DrawerStatusContext';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hook to detect if the drawer's status in a parent navigator.
|
|
8
8
|
* Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export function useDrawerStatus(): DrawerStatus {
|
|
11
11
|
const drawerStatus = React.useContext(DrawerStatusContext);
|
|
12
12
|
|
|
13
13
|
if (drawerStatus === undefined) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { DrawerContentComponentProps } from '../types';
|
|
4
|
-
import DrawerContentScrollView from './DrawerContentScrollView';
|
|
5
|
-
import DrawerItemList from './DrawerItemList';
|
|
4
|
+
import { DrawerContentScrollView } from './DrawerContentScrollView';
|
|
5
|
+
import { DrawerItemList } from './DrawerItemList';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function DrawerContent({
|
|
8
8
|
descriptors,
|
|
9
9
|
state,
|
|
10
10
|
...rest
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
9
|
|
|
10
|
-
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
10
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
11
11
|
|
|
12
12
|
type Props = ScrollViewProps & {
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function DrawerContentScrollViewInner(
|
|
17
17
|
{ contentContainerStyle, style, children, ...rest }: Props,
|
|
18
18
|
ref?: React.Ref<ScrollView>
|
|
19
19
|
) {
|
|
@@ -43,7 +43,9 @@ function DrawerContentScrollView(
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export
|
|
46
|
+
export const DrawerContentScrollView = React.forwardRef(
|
|
47
|
+
DrawerContentScrollViewInner
|
|
48
|
+
);
|
|
47
49
|
|
|
48
50
|
const styles = StyleSheet.create({
|
|
49
51
|
container: {
|
package/src/views/DrawerItem.tsx
CHANGED
|
@@ -158,8 +158,8 @@ const LinkPressable = ({
|
|
|
158
158
|
/**
|
|
159
159
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
160
160
|
*/
|
|
161
|
-
export
|
|
162
|
-
const { colors } = useTheme();
|
|
161
|
+
export function DrawerItem(props: Props) {
|
|
162
|
+
const { colors, fonts } = useTheme();
|
|
163
163
|
|
|
164
164
|
const {
|
|
165
165
|
route,
|
|
@@ -220,13 +220,7 @@ export default function DrawerItem(props: Props) {
|
|
|
220
220
|
<Text
|
|
221
221
|
numberOfLines={1}
|
|
222
222
|
allowFontScaling={allowFontScaling}
|
|
223
|
-
style={[
|
|
224
|
-
{
|
|
225
|
-
color,
|
|
226
|
-
fontWeight: '500',
|
|
227
|
-
},
|
|
228
|
-
labelStyle,
|
|
229
|
-
]}
|
|
223
|
+
style={[{ color }, fonts.medium, labelStyle]}
|
|
230
224
|
>
|
|
231
225
|
{label}
|
|
232
226
|
</Text>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
|
|
10
10
|
import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
|
|
11
|
-
import DrawerItem from './DrawerItem';
|
|
11
|
+
import { DrawerItem } from './DrawerItem';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
state: DrawerNavigationState<ParamListBase>;
|
|
@@ -19,11 +19,7 @@ type Props = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Component that renders the navigation list in the drawer.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
23
|
-
state,
|
|
24
|
-
navigation,
|
|
25
|
-
descriptors,
|
|
26
|
-
}: Props) {
|
|
22
|
+
export function DrawerItemList({ state, navigation, descriptors }: Props) {
|
|
27
23
|
const { buildHref } = useLinkTools();
|
|
28
24
|
|
|
29
25
|
const focusedRoute = state.routes[state.index];
|
|
@@ -16,7 +16,7 @@ type Props = {
|
|
|
16
16
|
tintColor?: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export function DrawerToggleButton({ tintColor, ...rest }: Props) {
|
|
20
20
|
const navigation = useNavigation<DrawerNavigationProp<ParamListBase>>();
|
|
21
21
|
|
|
22
22
|
return (
|
package/src/views/DrawerView.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import * as React from 'react';
|
|
|
15
15
|
import { BackHandler, I18nManager, Platform, StyleSheet } from 'react-native';
|
|
16
16
|
import { Drawer } from 'react-native-drawer-layout';
|
|
17
17
|
import { useSafeAreaFrame } from 'react-native-safe-area-context';
|
|
18
|
+
import useLatestCallback from 'use-latest-callback';
|
|
18
19
|
|
|
19
20
|
import type {
|
|
20
21
|
DrawerContentComponentProps,
|
|
@@ -24,11 +25,11 @@ import type {
|
|
|
24
25
|
DrawerNavigationHelpers,
|
|
25
26
|
DrawerNavigationProp,
|
|
26
27
|
} from '../types';
|
|
27
|
-
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
28
|
-
import DrawerStatusContext from '../utils/DrawerStatusContext';
|
|
29
|
-
import getDrawerStatusFromState from '../utils/getDrawerStatusFromState';
|
|
30
|
-
import DrawerContent from './DrawerContent';
|
|
31
|
-
import DrawerToggleButton from './DrawerToggleButton';
|
|
28
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
29
|
+
import { DrawerStatusContext } from '../utils/DrawerStatusContext';
|
|
30
|
+
import { getDrawerStatusFromState } from '../utils/getDrawerStatusFromState';
|
|
31
|
+
import { DrawerContent } from './DrawerContent';
|
|
32
|
+
import { DrawerToggleButton } from './DrawerToggleButton';
|
|
32
33
|
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
|
33
34
|
|
|
34
35
|
type Props = DrawerNavigationConfig & {
|
|
@@ -80,19 +81,56 @@ function DrawerViewBase({
|
|
|
80
81
|
|
|
81
82
|
const drawerStatus = getDrawerStatusFromState(state);
|
|
82
83
|
|
|
83
|
-
const handleDrawerOpen =
|
|
84
|
+
const handleDrawerOpen = useLatestCallback(() => {
|
|
84
85
|
navigation.dispatch({
|
|
85
86
|
...DrawerActions.openDrawer(),
|
|
86
87
|
target: state.key,
|
|
87
88
|
});
|
|
88
|
-
}
|
|
89
|
+
});
|
|
89
90
|
|
|
90
|
-
const handleDrawerClose =
|
|
91
|
+
const handleDrawerClose = useLatestCallback(() => {
|
|
91
92
|
navigation.dispatch({
|
|
92
93
|
...DrawerActions.closeDrawer(),
|
|
93
94
|
target: state.key,
|
|
94
95
|
});
|
|
95
|
-
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const handleGestureStart = useLatestCallback(() => {
|
|
99
|
+
navigation.emit({
|
|
100
|
+
type: 'gestureStart',
|
|
101
|
+
target: state.key,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const handleGestureEnd = useLatestCallback(() => {
|
|
106
|
+
navigation.emit({
|
|
107
|
+
type: 'gestureEnd',
|
|
108
|
+
target: state.key,
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const handleGestureCancel = useLatestCallback(() => {
|
|
113
|
+
navigation.emit({
|
|
114
|
+
type: 'gestureCancel',
|
|
115
|
+
target: state.key,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const handleTransitionStart = useLatestCallback((closing: boolean) => {
|
|
120
|
+
navigation.emit({
|
|
121
|
+
type: 'transitionStart',
|
|
122
|
+
data: { closing },
|
|
123
|
+
target: state.key,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const handleTransitionEnd = useLatestCallback((closing: boolean) => {
|
|
128
|
+
navigation.emit({
|
|
129
|
+
type: 'transitionEnd',
|
|
130
|
+
data: { closing },
|
|
131
|
+
target: state.key,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
96
134
|
|
|
97
135
|
React.useEffect(() => {
|
|
98
136
|
if (drawerStatus === defaultStatus || drawerType === 'permanent') {
|
|
@@ -240,6 +278,11 @@ function DrawerViewBase({
|
|
|
240
278
|
open={drawerStatus !== 'closed'}
|
|
241
279
|
onOpen={handleDrawerOpen}
|
|
242
280
|
onClose={handleDrawerClose}
|
|
281
|
+
onGestureStart={handleGestureStart}
|
|
282
|
+
onGestureEnd={handleGestureEnd}
|
|
283
|
+
onGestureCancel={handleGestureCancel}
|
|
284
|
+
onTransitionStart={handleTransitionStart}
|
|
285
|
+
onTransitionEnd={handleTransitionEnd}
|
|
243
286
|
layout={dimensions}
|
|
244
287
|
gestureHandlerProps={gestureHandlerProps}
|
|
245
288
|
swipeEnabled={swipeEnabled}
|
|
@@ -274,7 +317,7 @@ function DrawerViewBase({
|
|
|
274
317
|
);
|
|
275
318
|
}
|
|
276
319
|
|
|
277
|
-
export
|
|
320
|
+
export function DrawerView({ navigation, ...rest }: Props) {
|
|
278
321
|
return (
|
|
279
322
|
<SafeAreaProviderCompat>
|
|
280
323
|
<DrawerViewBase navigation={navigation} {...rest} />
|