@react-navigation/drawer 6.6.2 → 7.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/commonjs/index.js +24 -27
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/navigators/createDrawerNavigator.js +8 -49
  4. package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
  5. package/lib/commonjs/utils/DrawerPositionContext.js +3 -3
  6. package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
  7. package/lib/commonjs/utils/DrawerStatusContext.js +2 -3
  8. package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
  9. package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
  10. package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
  11. package/lib/commonjs/utils/useDrawerStatus.js +3 -4
  12. package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
  13. package/lib/commonjs/views/DrawerContent.js +5 -6
  14. package/lib/commonjs/views/DrawerContent.js.map +1 -1
  15. package/lib/commonjs/views/DrawerContentScrollView.js +6 -7
  16. package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
  17. package/lib/commonjs/views/DrawerItem.js +14 -10
  18. package/lib/commonjs/views/DrawerItem.js.map +1 -1
  19. package/lib/commonjs/views/DrawerItemList.js +9 -10
  20. package/lib/commonjs/views/DrawerItemList.js.map +1 -1
  21. package/lib/commonjs/views/DrawerToggleButton.js +1 -1
  22. package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
  23. package/lib/commonjs/views/DrawerView.js +78 -73
  24. package/lib/commonjs/views/DrawerView.js.map +1 -1
  25. package/lib/module/index.js +11 -13
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/navigators/createDrawerNavigator.js +5 -45
  28. package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
  29. package/lib/module/utils/DrawerPositionContext.js +1 -1
  30. package/lib/module/utils/DrawerPositionContext.js.map +1 -1
  31. package/lib/module/utils/DrawerStatusContext.js +1 -2
  32. package/lib/module/utils/DrawerStatusContext.js.map +1 -1
  33. package/lib/module/utils/getDrawerStatusFromState.js +1 -1
  34. package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
  35. package/lib/module/utils/useDrawerStatus.js +2 -2
  36. package/lib/module/utils/useDrawerStatus.js.map +1 -1
  37. package/lib/module/views/DrawerContent.js +3 -3
  38. package/lib/module/views/DrawerContent.js.map +1 -1
  39. package/lib/module/views/DrawerContentScrollView.js +3 -3
  40. package/lib/module/views/DrawerContentScrollView.js.map +1 -1
  41. package/lib/module/views/DrawerItem.js +15 -11
  42. package/lib/module/views/DrawerItem.js.map +1 -1
  43. package/lib/module/views/DrawerItemList.js +9 -9
  44. package/lib/module/views/DrawerItemList.js.map +1 -1
  45. package/lib/module/views/DrawerToggleButton.js +1 -1
  46. package/lib/module/views/DrawerToggleButton.js.map +1 -1
  47. package/lib/module/views/DrawerView.js +72 -67
  48. package/lib/module/views/DrawerView.js.map +1 -1
  49. package/lib/typescript/src/index.d.ts +11 -13
  50. package/lib/typescript/src/index.d.ts.map +1 -1
  51. package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +9 -4
  52. package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
  53. package/lib/typescript/src/types.d.ts +51 -16
  54. package/lib/typescript/src/types.d.ts.map +1 -1
  55. package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -2
  56. package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -1
  57. package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -2
  58. package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -1
  59. package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -1
  60. package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -1
  61. package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -1
  62. package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -1
  63. package/lib/typescript/src/views/DrawerContent.d.ts +1 -1
  64. package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
  65. package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -2
  66. package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
  67. package/lib/typescript/src/views/DrawerItem.d.ts +11 -6
  68. package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
  69. package/lib/typescript/src/views/DrawerItemList.d.ts +2 -2
  70. package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
  71. package/lib/typescript/src/views/DrawerToggleButton.d.ts +2 -2
  72. package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
  73. package/lib/typescript/src/views/DrawerView.d.ts +2 -2
  74. package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
  75. package/lib/typescript/src/views/ScreenFallback.d.ts +1 -1
  76. package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
  77. package/package.json +15 -14
  78. package/src/index.tsx +15 -13
  79. package/src/navigators/createDrawerNavigator.tsx +4 -74
  80. package/src/types.tsx +24 -3
  81. package/src/utils/DrawerPositionContext.tsx +3 -1
  82. package/src/utils/DrawerStatusContext.tsx +3 -5
  83. package/src/utils/getDrawerStatusFromState.tsx +1 -1
  84. package/src/utils/useDrawerStatus.tsx +2 -2
  85. package/src/views/DrawerContent.tsx +3 -3
  86. package/src/views/DrawerContentScrollView.tsx +5 -3
  87. package/src/views/DrawerItem.tsx +23 -20
  88. package/src/views/DrawerItemList.tsx +7 -10
  89. package/src/views/DrawerToggleButton.tsx +1 -1
  90. package/src/views/DrawerView.tsx +68 -78
  91. package/lib/commonjs/utils/DrawerGestureContext.js +0 -12
  92. package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
  93. package/lib/commonjs/utils/DrawerProgressContext.js +0 -12
  94. package/lib/commonjs/utils/DrawerProgressContext.js.map +0 -1
  95. package/lib/commonjs/utils/useDrawerProgress.js +0 -19
  96. package/lib/commonjs/utils/useDrawerProgress.js.map +0 -1
  97. package/lib/commonjs/views/GestureHandler.android.js +0 -17
  98. package/lib/commonjs/views/GestureHandler.android.js.map +0 -1
  99. package/lib/commonjs/views/GestureHandler.ios.js +0 -17
  100. package/lib/commonjs/views/GestureHandler.ios.js.map +0 -1
  101. package/lib/commonjs/views/GestureHandler.js +0 -32
  102. package/lib/commonjs/views/GestureHandler.js.map +0 -1
  103. package/lib/commonjs/views/GestureHandlerNative.js +0 -37
  104. package/lib/commonjs/views/GestureHandlerNative.js.map +0 -1
  105. package/lib/commonjs/views/legacy/Drawer.js +0 -438
  106. package/lib/commonjs/views/legacy/Drawer.js.map +0 -1
  107. package/lib/commonjs/views/legacy/Overlay.js +0 -74
  108. package/lib/commonjs/views/legacy/Overlay.js.map +0 -1
  109. package/lib/commonjs/views/modern/Drawer.js +0 -304
  110. package/lib/commonjs/views/modern/Drawer.js.map +0 -1
  111. package/lib/commonjs/views/modern/Overlay.js +0 -69
  112. package/lib/commonjs/views/modern/Overlay.js.map +0 -1
  113. package/lib/module/utils/DrawerGestureContext.js +0 -3
  114. package/lib/module/utils/DrawerGestureContext.js.map +0 -1
  115. package/lib/module/utils/DrawerProgressContext.js +0 -3
  116. package/lib/module/utils/DrawerProgressContext.js.map +0 -1
  117. package/lib/module/utils/useDrawerProgress.js +0 -10
  118. package/lib/module/utils/useDrawerProgress.js.map +0 -1
  119. package/lib/module/views/GestureHandler.android.js +0 -2
  120. package/lib/module/views/GestureHandler.android.js.map +0 -1
  121. package/lib/module/views/GestureHandler.ios.js +0 -2
  122. package/lib/module/views/GestureHandler.ios.js.map +0 -1
  123. package/lib/module/views/GestureHandler.js +0 -20
  124. package/lib/module/views/GestureHandler.js.map +0 -1
  125. package/lib/module/views/GestureHandlerNative.js +0 -11
  126. package/lib/module/views/GestureHandlerNative.js.map +0 -1
  127. package/lib/module/views/legacy/Drawer.js +0 -428
  128. package/lib/module/views/legacy/Drawer.js.map +0 -1
  129. package/lib/module/views/legacy/Overlay.js +0 -64
  130. package/lib/module/views/legacy/Overlay.js.map +0 -1
  131. package/lib/module/views/modern/Drawer.js +0 -295
  132. package/lib/module/views/modern/Drawer.js.map +0 -1
  133. package/lib/module/views/modern/Overlay.js +0 -60
  134. package/lib/module/views/modern/Overlay.js.map +0 -1
  135. package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -4
  136. package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
  137. package/lib/typescript/src/utils/DrawerProgressContext.d.ts +0 -5
  138. package/lib/typescript/src/utils/DrawerProgressContext.d.ts.map +0 -1
  139. package/lib/typescript/src/utils/useDrawerProgress.d.ts +0 -3
  140. package/lib/typescript/src/utils/useDrawerProgress.d.ts.map +0 -1
  141. package/lib/typescript/src/views/GestureHandler.android.d.ts +0 -2
  142. package/lib/typescript/src/views/GestureHandler.android.d.ts.map +0 -1
  143. package/lib/typescript/src/views/GestureHandler.d.ts +0 -15
  144. package/lib/typescript/src/views/GestureHandler.d.ts.map +0 -1
  145. package/lib/typescript/src/views/GestureHandler.ios.d.ts +0 -2
  146. package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +0 -1
  147. package/lib/typescript/src/views/GestureHandlerNative.d.ts +0 -6
  148. package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +0 -1
  149. package/lib/typescript/src/views/legacy/Drawer.d.ts +0 -45
  150. package/lib/typescript/src/views/legacy/Drawer.d.ts.map +0 -1
  151. package/lib/typescript/src/views/legacy/Overlay.d.ts +0 -75
  152. package/lib/typescript/src/views/legacy/Overlay.d.ts.map +0 -1
  153. package/lib/typescript/src/views/modern/Drawer.d.ts +0 -4
  154. package/lib/typescript/src/views/modern/Drawer.d.ts.map +0 -1
  155. package/lib/typescript/src/views/modern/Overlay.d.ts +0 -75
  156. package/lib/typescript/src/views/modern/Overlay.d.ts.map +0 -1
  157. package/src/utils/DrawerGestureContext.tsx +0 -3
  158. package/src/utils/DrawerProgressContext.tsx +0 -6
  159. package/src/utils/useDrawerProgress.tsx +0 -18
  160. package/src/views/GestureHandler.android.tsx +0 -1
  161. package/src/views/GestureHandler.ios.tsx +0 -1
  162. package/src/views/GestureHandler.tsx +0 -29
  163. package/src/views/GestureHandlerNative.tsx +0 -24
  164. package/src/views/legacy/Drawer.tsx +0 -672
  165. package/src/views/legacy/Overlay.tsx +0 -87
  166. package/src/views/modern/Drawer.tsx +0 -425
  167. package/src/views/modern/Overlay.tsx +0 -82
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerPositionContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerPositionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;;AAE/B,wBAA4E"}
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,QAAA,MAAM,mBAAmB,yCAExB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
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 default function getDrawerStatusFromState(state: DrawerNavigationState<ParamListBase>): DrawerStatus;
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,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,GAC1C,YAAY,CAYd"}
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 default function useDrawerStatus(): DrawerStatus;
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,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,YAAY,CAUtD"}
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,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { DrawerContentComponentProps } from '../types';
3
- export default function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): JSX.Element;
3
+ export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): JSX.Element;
4
4
  //# sourceMappingURL=DrawerContent.d.ts.map
@@ -1 +1 @@
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,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,eAgB7B"}
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 _default: React.ForwardRefExoticComponent<ScrollViewProps & {
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;;;;AAuCtB,wBAAyD"}
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"}
@@ -1,6 +1,15 @@
1
+ import { Route } from '@react-navigation/native';
1
2
  import * as React from 'react';
2
3
  import { StyleProp, TextStyle, ViewStyle } from 'react-native';
3
- declare type Props = {
4
+ type Props = {
5
+ /**
6
+ * The route object which should be specified by the drawer item.
7
+ */
8
+ route: Route<string>;
9
+ /**
10
+ * The `href` to use for the anchor tag on web
11
+ */
12
+ href?: string;
4
13
  /**
5
14
  * The label text of the item.
6
15
  */
@@ -16,10 +25,6 @@ declare type Props = {
16
25
  size: number;
17
26
  color: string;
18
27
  }) => React.ReactNode;
19
- /**
20
- * URL to use for the link to the tab.
21
- */
22
- to?: string;
23
28
  /**
24
29
  * Whether to highlight the drawer item as active.
25
30
  */
@@ -82,6 +87,6 @@ declare type Props = {
82
87
  /**
83
88
  * A component used to show an action item with an icon and a label in a navigation drawer.
84
89
  */
85
- export default function DrawerItem(props: Props): JSX.Element;
90
+ export declare function DrawerItem(props: Props): JSX.Element;
86
91
  export {};
87
92
  //# sourceMappingURL=DrawerItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,SAAS,EAGT,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,aAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,EACD,MAAM,GACN,CAAC,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACtE;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA0DF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,KAAK,eA8E9C"}
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,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACtE;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA6DF;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,eA0EtC"}
@@ -1,7 +1,7 @@
1
1
  import { DrawerNavigationState, ParamListBase } from '@react-navigation/native';
2
2
  import * as React from 'react';
3
3
  import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
4
- declare type Props = {
4
+ type Props = {
5
5
  state: DrawerNavigationState<ParamListBase>;
6
6
  navigation: DrawerNavigationHelpers;
7
7
  descriptors: DrawerDescriptorMap;
@@ -9,6 +9,6 @@ declare type Props = {
9
9
  /**
10
10
  * Component that renders the navigation list in the drawer.
11
11
  */
12
- export default function DrawerItemList({ state, navigation, descriptors, }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
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,aAAK,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,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,KAAK,EACL,UAAU,EACV,WAAW,GACZ,EAAE,KAAK,sEAmEP"}
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,10 @@
1
1
  /// <reference types="react" />
2
- declare type Props = {
2
+ type Props = {
3
3
  accessibilityLabel?: string;
4
4
  pressColor?: string;
5
5
  pressOpacity?: number;
6
6
  tintColor?: string;
7
7
  };
8
- export default function DrawerToggleButton({ tintColor, ...rest }: Props): JSX.Element;
8
+ export declare function DrawerToggleButton({ tintColor, ...rest }: Props): JSX.Element;
9
9
  export {};
10
10
  //# sourceMappingURL=DrawerToggleButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":";AAWA,aAAK,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,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAuBvE"}
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,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
3
3
  import type { DrawerDescriptorMap, DrawerNavigationConfig, DrawerNavigationHelpers } from '../types';
4
- declare type Props = DrawerNavigationConfig & {
4
+ type Props = DrawerNavigationConfig & {
5
5
  defaultStatus: DrawerStatus;
6
6
  state: DrawerNavigationState<ParamListBase>;
7
7
  navigation: DrawerNavigationHelpers;
8
8
  descriptors: DrawerDescriptorMap;
9
9
  };
10
- export default function DrawerView({ navigation, ...rest }: Props): JSX.Element;
10
+ export declare function DrawerView({ navigation, ...rest }: Props): JSX.Element;
11
11
  export {};
12
12
  //# sourceMappingURL=DrawerView.d.ts.map
@@ -1 +1 @@
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;AAYlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAGxB,MAAM,UAAU,CAAC;AASlB,aAAK,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;AAyRF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAQhE"}
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"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { StyleProp, ViewProps, ViewStyle } from 'react-native';
3
- declare type Props = {
3
+ type Props = {
4
4
  visible: boolean;
5
5
  children: React.ReactNode;
6
6
  enabled: boolean;
@@ -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,EAAE,SAAS,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,aAAK,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;iBAO1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAchE"}
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,EAAE,SAAS,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,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;iBAO1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAchE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/drawer",
3
3
  "description": "Drawer navigator component with animated transitions and gesturess",
4
- "version": "6.6.2",
4
+ "version": "7.0.0-alpha.1",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -41,24 +41,25 @@
41
41
  "clean": "del lib"
42
42
  },
43
43
  "dependencies": {
44
- "@react-navigation/elements": "^1.3.17",
44
+ "@react-navigation/elements": "^1.4.0-alpha.0",
45
45
  "color": "^4.2.3",
46
- "warn-once": "^0.1.0"
46
+ "react-native-drawer-layout": "^3.2.0",
47
+ "use-latest-callback": "^0.1.5"
47
48
  },
48
49
  "devDependencies": {
49
- "@react-navigation/native": "^6.1.6",
50
+ "@react-navigation/native": "^7.0.0-alpha.1",
50
51
  "@testing-library/react-native": "^11.5.0",
51
- "@types/react": "~18.0.0",
52
- "@types/react-native": "~0.69.1",
53
- "del-cli": "^3.0.1",
54
- "react": "18.0.0",
55
- "react-native": "0.69.5",
52
+ "@types/react": "~18.0.26",
53
+ "@types/react-native": "~0.70.8",
54
+ "del-cli": "^5.0.0",
55
+ "react": "18.1.0",
56
+ "react-native": "0.70.5",
56
57
  "react-native-builder-bob": "^0.20.4",
57
- "react-native-gesture-handler": "~2.5.0",
58
+ "react-native-gesture-handler": "~2.8.0",
58
59
  "react-native-reanimated": "~2.9.1",
59
- "react-native-safe-area-context": "4.3.1",
60
- "react-native-screens": "~3.15.0",
61
- "typescript": "^4.7.4"
60
+ "react-native-safe-area-context": "4.4.1",
61
+ "react-native-screens": "~3.18.0",
62
+ "typescript": "^4.9.4"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "@react-navigation/native": "^6.0.0",
@@ -83,5 +84,5 @@
83
84
  ]
84
85
  ]
85
86
  },
86
- "gitHead": "ba6380c93f945e4c586f5e17e618208ab603bf30"
87
+ "gitHead": "230c09deeeb886929a15cb4cdcb496372a9496e1"
87
88
  }
package/src/index.tsx CHANGED
@@ -1,27 +1,29 @@
1
1
  /**
2
2
  * Navigators
3
3
  */
4
- export { default as createDrawerNavigator } from './navigators/createDrawerNavigator';
4
+ export { createDrawerNavigator } from './navigators/createDrawerNavigator';
5
5
 
6
6
  /**
7
7
  * Views
8
8
  */
9
- export { default as DrawerContent } from './views/DrawerContent';
10
- export { default as DrawerContentScrollView } from './views/DrawerContentScrollView';
11
- export { default as DrawerItem } from './views/DrawerItem';
12
- export { default as DrawerItemList } from './views/DrawerItemList';
13
- export { default as DrawerToggleButton } from './views/DrawerToggleButton';
14
- export { default as DrawerView } from './views/DrawerView';
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 { default as DrawerGestureContext } from './utils/DrawerGestureContext';
20
- export { default as DrawerProgressContext } from './utils/DrawerProgressContext';
21
- export { default as DrawerStatusContext } from './utils/DrawerStatusContext';
22
- export { default as getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
23
- export { default as useDrawerProgress } from './utils/useDrawerProgress';
24
- export { default as useDrawerStatus } from './utils/useDrawerStatus';
19
+ export { DrawerStatusContext } from './utils/DrawerStatusContext';
20
+ export { getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
21
+ export { useDrawerStatus } from './utils/useDrawerStatus';
22
+ export {
23
+ DrawerGestureContext,
24
+ DrawerProgressContext,
25
+ useDrawerProgress,
26
+ } from 'react-native-drawer-layout';
25
27
 
26
28
  /**
27
29
  * Types
@@ -5,19 +5,17 @@ import {
5
5
  DrawerNavigationState,
6
6
  DrawerRouter,
7
7
  DrawerRouterOptions,
8
- DrawerStatus,
9
8
  ParamListBase,
10
9
  useNavigationBuilder,
11
10
  } from '@react-navigation/native';
12
11
  import * as React from 'react';
13
- import warnOnce from 'warn-once';
14
12
 
15
13
  import type {
16
14
  DrawerNavigationConfig,
17
15
  DrawerNavigationEventMap,
18
16
  DrawerNavigationOptions,
19
17
  } from '../types';
20
- import DrawerView from '../views/DrawerView';
18
+ import { DrawerView } from '../views/DrawerView';
21
19
 
22
20
  type Props = DefaultNavigatorOptions<
23
21
  ParamListBase,
@@ -31,80 +29,13 @@ type Props = DefaultNavigatorOptions<
31
29
  function DrawerNavigator({
32
30
  id,
33
31
  initialRouteName,
34
- defaultStatus: customDefaultStatus,
32
+ defaultStatus = 'closed',
35
33
  backBehavior,
36
34
  children,
37
35
  screenListeners,
38
36
  screenOptions,
39
- ...restWithDeprecated
37
+ ...rest
40
38
  }: Props) {
41
- const {
42
- // @ts-expect-error: openByDefault is deprecated
43
- openByDefault,
44
- // @ts-expect-error: lazy is deprecated
45
- lazy,
46
- // @ts-expect-error: drawerContentOptions is deprecated
47
- drawerContentOptions,
48
- ...rest
49
- } = restWithDeprecated;
50
-
51
- let defaultScreenOptions: DrawerNavigationOptions = {};
52
-
53
- if (drawerContentOptions) {
54
- Object.assign(defaultScreenOptions, {
55
- drawerPosition: drawerContentOptions.drawerPosition,
56
- drawerType: drawerContentOptions.drawerType,
57
- swipeEdgeWidth: drawerContentOptions.edgeWidth,
58
- drawerHideStatusBarOnOpen: drawerContentOptions.hideStatusBar,
59
- keyboardDismissMode: drawerContentOptions.keyboardDismissMode,
60
- swipeMinDistance: drawerContentOptions.minSwipeDistance,
61
- overlayColor: drawerContentOptions.overlayColor,
62
- drawerStatusBarAnimation: drawerContentOptions.statusBarAnimation,
63
- gestureHandlerProps: drawerContentOptions.gestureHandlerProps,
64
- });
65
-
66
- (
67
- Object.keys(defaultScreenOptions) as (keyof DrawerNavigationOptions)[]
68
- ).forEach((key) => {
69
- if (defaultScreenOptions[key] === undefined) {
70
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
71
- delete defaultScreenOptions[key];
72
- }
73
- });
74
-
75
- warnOnce(
76
- drawerContentOptions,
77
- `Drawer Navigator: 'drawerContentOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(
78
- defaultScreenOptions,
79
- null,
80
- 2
81
- )}\n\nSee https://reactnavigation.org/docs/drawer-navigator#options for more details.`
82
- );
83
- }
84
-
85
- if (typeof lazy === 'boolean') {
86
- defaultScreenOptions.lazy = lazy;
87
-
88
- warnOnce(
89
- true,
90
- `Drawer Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/drawer-navigator/#lazy for more details.`
91
- );
92
- }
93
-
94
- if (typeof openByDefault === 'boolean') {
95
- warnOnce(
96
- true,
97
- `Drawer Navigator: 'openByDefault' is deprecated. Use 'defaultStatus' and set it to 'open' or 'closed' instead.\n\nSee https://reactnavigation.org/docs/drawer-navigator/#defaultstatus for more details.`
98
- );
99
- }
100
-
101
- const defaultStatus: DrawerStatus =
102
- customDefaultStatus !== undefined
103
- ? customDefaultStatus
104
- : openByDefault
105
- ? 'open'
106
- : 'closed';
107
-
108
39
  const { state, descriptors, navigation, NavigationContent } =
109
40
  useNavigationBuilder<
110
41
  DrawerNavigationState<ParamListBase>,
@@ -120,7 +51,6 @@ function DrawerNavigator({
120
51
  children,
121
52
  screenListeners,
122
53
  screenOptions,
123
- defaultScreenOptions,
124
54
  });
125
55
 
126
56
  return (
@@ -136,7 +66,7 @@ function DrawerNavigator({
136
66
  );
137
67
  }
138
68
 
139
- export default createNavigatorFactory<
69
+ export const createDrawerNavigator = createNavigatorFactory<
140
70
  DrawerNavigationState<ParamListBase>,
141
71
  DrawerNavigationOptions,
142
72
  DrawerNavigationEventMap,
package/src/types.tsx CHANGED
@@ -38,7 +38,7 @@ export type DrawerNavigationConfig = {
38
38
  /**
39
39
  * Whether to use the legacy implementation based on Reanimated 1.
40
40
  * The new implementation based on Reanimated 2 will perform better,
41
- * but you need additional configuration and need to use Hermes with Flipper to debug.
41
+ * but it's not possible to use Chrome remote debugger.
42
42
  *
43
43
  * This defaults to `true` if Reanimated 2 is not configured.
44
44
  *
@@ -172,8 +172,9 @@ export type DrawerNavigationOptions = HeaderOptions & {
172
172
  overlayColor?: string;
173
173
 
174
174
  /**
175
- * Screen readers will read this string when the user presses on the overlay adjacent to an opened drawer. Defaults to "Close drawer".
176
- * **/
175
+ * Accessibility label for the overlay. This is read by the screen reader when the user taps the overlay.
176
+ * Defaults to "Close drawer".
177
+ */
177
178
  overlayAccessibilityLabel?: string;
178
179
 
179
180
  /**
@@ -257,6 +258,26 @@ export type DrawerNavigationEventMap = {
257
258
  * Event which fires on tapping on the item in the drawer menu.
258
259
  */
259
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 };
260
281
  };
261
282
 
262
283
  export type DrawerNavigationHelpers = NavigationHelpers<
@@ -1,3 +1,5 @@
1
1
  import * as React from 'react';
2
2
 
3
- export default React.createContext<'left' | 'right' | undefined>(undefined);
3
+ export const DrawerPositionContext = React.createContext<
4
+ 'left' | 'right' | undefined
5
+ >(undefined);
@@ -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<DrawerStatus | undefined>(
5
- undefined
6
- );
7
-
8
- export default DrawerStatusContext;
4
+ export const DrawerStatusContext = React.createContext<
5
+ DrawerStatus | undefined
6
+ >(undefined);
@@ -4,7 +4,7 @@ import type {
4
4
  ParamListBase,
5
5
  } from '@react-navigation/native';
6
6
 
7
- export default function getDrawerStatusFromState(
7
+ export function getDrawerStatusFromState(
8
8
  state: DrawerNavigationState<ParamListBase>
9
9
  ): DrawerStatus {
10
10
  if (state.history == null) {
@@ -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 default function useDrawerStatus(): DrawerStatus {
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 default function DrawerContent({
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 DrawerContentScrollView(
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 default React.forwardRef(DrawerContentScrollView);
46
+ export const DrawerContentScrollView = React.forwardRef(
47
+ DrawerContentScrollViewInner
48
+ );
47
49
 
48
50
  const styles = StyleSheet.create({
49
51
  container: {