@react-navigation/drawer 6.1.6 → 6.3.0

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 (90) hide show
  1. package/lib/commonjs/index.js +14 -14
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/navigators/createDrawerNavigator.js +22 -16
  4. package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
  5. package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
  6. package/lib/commonjs/utils/getDrawerStatusFromState.js +2 -2
  7. package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
  8. package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
  9. package/lib/commonjs/views/DrawerContent.js +6 -5
  10. package/lib/commonjs/views/DrawerContent.js.map +1 -1
  11. package/lib/commonjs/views/DrawerContentScrollView.js +7 -6
  12. package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
  13. package/lib/commonjs/views/DrawerItem.js +16 -12
  14. package/lib/commonjs/views/DrawerItem.js.map +1 -1
  15. package/lib/commonjs/views/DrawerItemList.js +28 -14
  16. package/lib/commonjs/views/DrawerItemList.js.map +1 -1
  17. package/lib/commonjs/views/DrawerToggleButton.js +5 -4
  18. package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
  19. package/lib/commonjs/views/DrawerView.js +44 -34
  20. package/lib/commonjs/views/DrawerView.js.map +1 -1
  21. package/lib/commonjs/views/GestureHandler.js +7 -4
  22. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  23. package/lib/commonjs/views/GestureHandlerNative.js +1 -1
  24. package/lib/commonjs/views/ScreenFallback.js +13 -9
  25. package/lib/commonjs/views/ScreenFallback.js.map +1 -1
  26. package/lib/commonjs/views/legacy/Drawer.js +20 -13
  27. package/lib/commonjs/views/legacy/Drawer.js.map +1 -1
  28. package/lib/commonjs/views/legacy/Overlay.js +8 -6
  29. package/lib/commonjs/views/legacy/Overlay.js.map +1 -1
  30. package/lib/commonjs/views/modern/Drawer.js +28 -30
  31. package/lib/commonjs/views/modern/Drawer.js.map +1 -1
  32. package/lib/commonjs/views/modern/Overlay.js +18 -9
  33. package/lib/commonjs/views/modern/Overlay.js.map +1 -1
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/navigators/createDrawerNavigator.js +22 -16
  36. package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
  37. package/lib/module/utils/DrawerStatusContext.js.map +1 -1
  38. package/lib/module/utils/getDrawerStatusFromState.js +2 -2
  39. package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
  40. package/lib/module/utils/useDrawerStatus.js.map +1 -1
  41. package/lib/module/views/DrawerContent.js +6 -5
  42. package/lib/module/views/DrawerContent.js.map +1 -1
  43. package/lib/module/views/DrawerContentScrollView.js +7 -6
  44. package/lib/module/views/DrawerContentScrollView.js.map +1 -1
  45. package/lib/module/views/DrawerItem.js +16 -12
  46. package/lib/module/views/DrawerItem.js.map +1 -1
  47. package/lib/module/views/DrawerItemList.js +28 -14
  48. package/lib/module/views/DrawerItemList.js.map +1 -1
  49. package/lib/module/views/DrawerToggleButton.js +5 -4
  50. package/lib/module/views/DrawerToggleButton.js.map +1 -1
  51. package/lib/module/views/DrawerView.js +43 -33
  52. package/lib/module/views/DrawerView.js.map +1 -1
  53. package/lib/module/views/GestureHandler.js +6 -3
  54. package/lib/module/views/GestureHandler.js.map +1 -1
  55. package/lib/module/views/ScreenFallback.js +13 -9
  56. package/lib/module/views/ScreenFallback.js.map +1 -1
  57. package/lib/module/views/legacy/Drawer.js +20 -13
  58. package/lib/module/views/legacy/Drawer.js.map +1 -1
  59. package/lib/module/views/legacy/Overlay.js +8 -6
  60. package/lib/module/views/legacy/Overlay.js.map +1 -1
  61. package/lib/module/views/modern/Drawer.js +28 -30
  62. package/lib/module/views/modern/Drawer.js.map +1 -1
  63. package/lib/module/views/modern/Overlay.js +19 -10
  64. package/lib/module/views/modern/Overlay.js.map +1 -1
  65. package/lib/typescript/src/index.d.ts +1 -1
  66. package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +1 -1
  67. package/lib/typescript/src/types.d.ts +13 -1
  68. package/lib/typescript/src/utils/DrawerStatusContext.d.ts +2 -1
  69. package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +2 -2
  70. package/lib/typescript/src/utils/useDrawerStatus.d.ts +2 -1
  71. package/lib/typescript/src/views/DrawerItem.d.ts +4 -0
  72. package/lib/typescript/src/views/DrawerView.d.ts +2 -1
  73. package/lib/typescript/src/views/ScreenFallback.d.ts +1 -0
  74. package/lib/typescript/src/views/legacy/Overlay.d.ts +4 -0
  75. package/lib/typescript/src/views/modern/Overlay.d.ts +4 -0
  76. package/package.json +10 -10
  77. package/src/index.tsx +1 -0
  78. package/src/navigators/createDrawerNavigator.tsx +22 -14
  79. package/src/types.tsx +11 -1
  80. package/src/utils/DrawerStatusContext.tsx +4 -2
  81. package/src/utils/getDrawerStatusFromState.tsx +4 -3
  82. package/src/utils/useDrawerStatus.tsx +2 -1
  83. package/src/views/DrawerItem.tsx +6 -0
  84. package/src/views/DrawerItemList.tsx +21 -8
  85. package/src/views/DrawerView.tsx +21 -6
  86. package/src/views/ScreenFallback.tsx +1 -0
  87. package/src/views/legacy/Drawer.tsx +21 -9
  88. package/src/views/legacy/Overlay.tsx +1 -0
  89. package/src/views/modern/Drawer.tsx +25 -23
  90. package/src/views/modern/Overlay.tsx +16 -3
@@ -3,12 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "createDrawerNavigator", {
7
- enumerable: true,
8
- get: function () {
9
- return _createDrawerNavigator.default;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "DrawerContent", {
13
7
  enumerable: true,
14
8
  get: function () {
@@ -21,6 +15,12 @@ Object.defineProperty(exports, "DrawerContentScrollView", {
21
15
  return _DrawerContentScrollView.default;
22
16
  }
23
17
  });
18
+ Object.defineProperty(exports, "DrawerGestureContext", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _DrawerGestureContext.default;
22
+ }
23
+ });
24
24
  Object.defineProperty(exports, "DrawerItem", {
25
25
  enumerable: true,
26
26
  get: function () {
@@ -33,28 +33,28 @@ Object.defineProperty(exports, "DrawerItemList", {
33
33
  return _DrawerItemList.default;
34
34
  }
35
35
  });
36
- Object.defineProperty(exports, "DrawerToggleButton", {
36
+ Object.defineProperty(exports, "DrawerProgressContext", {
37
37
  enumerable: true,
38
38
  get: function () {
39
- return _DrawerToggleButton.default;
39
+ return _DrawerProgressContext.default;
40
40
  }
41
41
  });
42
- Object.defineProperty(exports, "DrawerView", {
42
+ Object.defineProperty(exports, "DrawerToggleButton", {
43
43
  enumerable: true,
44
44
  get: function () {
45
- return _DrawerView.default;
45
+ return _DrawerToggleButton.default;
46
46
  }
47
47
  });
48
- Object.defineProperty(exports, "DrawerGestureContext", {
48
+ Object.defineProperty(exports, "DrawerView", {
49
49
  enumerable: true,
50
50
  get: function () {
51
- return _DrawerGestureContext.default;
51
+ return _DrawerView.default;
52
52
  }
53
53
  });
54
- Object.defineProperty(exports, "DrawerProgressContext", {
54
+ Object.defineProperty(exports, "createDrawerNavigator", {
55
55
  enumerable: true,
56
56
  get: function () {
57
- return _DrawerProgressContext.default;
57
+ return _createDrawerNavigator.default;
58
58
  }
59
59
  });
60
60
  Object.defineProperty(exports, "getDrawerStatusFromState", {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["/**\n * Navigators\n */\nexport { default as createDrawerNavigator } from './navigators/createDrawerNavigator';\n\n/**\n * Views\n */\nexport { default as DrawerContent } from './views/DrawerContent';\nexport { default as DrawerContentScrollView } from './views/DrawerContentScrollView';\nexport { default as DrawerItem } from './views/DrawerItem';\nexport { default as DrawerItemList } from './views/DrawerItemList';\nexport { default as DrawerToggleButton } from './views/DrawerToggleButton';\nexport { default as DrawerView } from './views/DrawerView';\n\n/**\n * Utilities\n */\nexport { default as DrawerGestureContext } from './utils/DrawerGestureContext';\nexport { default as DrawerProgressContext } from './utils/DrawerProgressContext';\nexport { default as getDrawerStatusFromState } from './utils/getDrawerStatusFromState';\nexport { default as useDrawerProgress } from './utils/useDrawerProgress';\nexport { default as useDrawerStatus } from './utils/useDrawerStatus';\n\n/**\n * Types\n */\nexport type {\n DrawerContentComponentProps,\n DrawerHeaderProps,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerScreenProps,\n} from './types';\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["/**\n * Navigators\n */\nexport { default as createDrawerNavigator } from './navigators/createDrawerNavigator';\n\n/**\n * Views\n */\nexport { default as DrawerContent } from './views/DrawerContent';\nexport { default as DrawerContentScrollView } from './views/DrawerContentScrollView';\nexport { default as DrawerItem } from './views/DrawerItem';\nexport { default as DrawerItemList } from './views/DrawerItemList';\nexport { default as DrawerToggleButton } from './views/DrawerToggleButton';\nexport { default as DrawerView } from './views/DrawerView';\n\n/**\n * Utilities\n */\nexport { default as DrawerGestureContext } from './utils/DrawerGestureContext';\nexport { default as DrawerProgressContext } from './utils/DrawerProgressContext';\nexport { default as getDrawerStatusFromState } from './utils/getDrawerStatusFromState';\nexport { default as useDrawerProgress } from './utils/useDrawerProgress';\nexport { default as useDrawerStatus } from './utils/useDrawerStatus';\n\n/**\n * Types\n */\nexport type {\n DrawerContentComponentProps,\n DrawerHeaderProps,\n DrawerNavigationEventMap,\n DrawerNavigationOptions,\n DrawerNavigationProp,\n DrawerScreenProps,\n} from './types';\n"]}
@@ -21,21 +21,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
- function DrawerNavigator({
25
- initialRouteName,
26
- defaultStatus,
27
- backBehavior,
28
- children,
29
- screenListeners,
30
- screenOptions,
31
- // @ts-expect-error: openByDefault is deprecated
32
- openByDefault,
33
- // @ts-expect-error: lazy is deprecated
34
- lazy,
35
- // @ts-expect-error: drawerContentOptions is deprecated
36
- drawerContentOptions,
37
- ...rest
38
- }) {
24
+ function DrawerNavigator(_ref) {
25
+ let {
26
+ initialRouteName,
27
+ defaultStatus: customDefaultStatus,
28
+ backBehavior,
29
+ children,
30
+ screenListeners,
31
+ screenOptions,
32
+ ...restWithDeprecated
33
+ } = _ref;
34
+ const {
35
+ // @ts-expect-error: openByDefault is deprecated
36
+ openByDefault,
37
+ // @ts-expect-error: lazy is deprecated
38
+ lazy,
39
+ // @ts-expect-error: drawerContentOptions is deprecated
40
+ drawerContentOptions,
41
+ ...rest
42
+ } = restWithDeprecated;
39
43
  let defaultScreenOptions = {};
40
44
 
41
45
  if (drawerContentOptions) {
@@ -68,6 +72,7 @@ function DrawerNavigator({
68
72
  (0, _warnOnce.default)(true, `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.`);
69
73
  }
70
74
 
75
+ const defaultStatus = customDefaultStatus !== undefined ? customDefaultStatus : openByDefault ? 'open' : 'closed';
71
76
  const {
72
77
  state,
73
78
  descriptors,
@@ -75,7 +80,7 @@ function DrawerNavigator({
75
80
  NavigationContent
76
81
  } = (0, _native.useNavigationBuilder)(_native.DrawerRouter, {
77
82
  initialRouteName,
78
- defaultStatus: defaultStatus !== undefined ? defaultStatus : openByDefault ? 'open' : 'closed',
83
+ defaultStatus,
79
84
  backBehavior,
80
85
  children,
81
86
  screenListeners,
@@ -83,6 +88,7 @@ function DrawerNavigator({
83
88
  defaultScreenOptions
84
89
  });
85
90
  return /*#__PURE__*/React.createElement(NavigationContent, null, /*#__PURE__*/React.createElement(_DrawerView.default, _extends({}, rest, {
91
+ defaultStatus: defaultStatus,
86
92
  state: state,
87
93
  descriptors: descriptors,
88
94
  navigation: navigation
@@ -1 +1 @@
1
- {"version":3,"sources":["createDrawerNavigator.tsx"],"names":["DrawerNavigator","initialRouteName","defaultStatus","backBehavior","children","screenListeners","screenOptions","openByDefault","lazy","drawerContentOptions","rest","defaultScreenOptions","Object","assign","drawerPosition","drawerType","swipeEdgeWidth","edgeWidth","drawerHideStatusBarOnOpen","hideStatusBar","keyboardDismissMode","swipeMinDistance","minSwipeDistance","overlayColor","drawerStatusBarAnimation","statusBarAnimation","gestureHandlerProps","keys","forEach","key","undefined","JSON","stringify","state","descriptors","navigation","NavigationContent","DrawerRouter"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,eAAT,CAAyB;AACvBC,EAAAA,gBADuB;AAEvBC,EAAAA,aAFuB;AAGvBC,EAAAA,YAHuB;AAIvBC,EAAAA,QAJuB;AAKvBC,EAAAA,eALuB;AAMvBC,EAAAA,aANuB;AAOvB;AACAC,EAAAA,aARuB;AASvB;AACAC,EAAAA,IAVuB;AAWvB;AACAC,EAAAA,oBAZuB;AAavB,KAAGC;AAboB,CAAzB,EAcU;AACR,MAAIC,oBAA6C,GAAG,EAApD;;AAEA,MAAIF,oBAAJ,EAA0B;AACxBG,IAAAA,MAAM,CAACC,MAAP,CAAcF,oBAAd,EAAoC;AAClCG,MAAAA,cAAc,EAAEL,oBAAoB,CAACK,cADH;AAElCC,MAAAA,UAAU,E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dC,IAAAA,eAVc;AAWdC,IAAAA,aAXc;AAYdK,IAAAA;AAZc,GANhB,CADF;AAsBA,sBACE,oBAAC,iBAAD,qBACE,oBAAC,mBAAD,eACMD,IADN;AAEE,IAAA,KAAK,EAAEuB,KAFT;AAGE,IAAA,WAAW,EAAEC,WAHf;AAIE,IAAA,UAAU,EAAEC;AAJd,KADF,CADF;AAUD;;eAEc,oCAKbnC,eALa,C","sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouter,\n DrawerRouterOptions,\n ParamListBase,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n DrawerNavigationConfig,\n DrawerNavigationEventMap,\n DrawerNavigationOptions,\n} from '../types';\nimport DrawerView from '../views/DrawerView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n> &\n DrawerRouterOptions &\n DrawerNavigationConfig;\n\nfunction DrawerNavigator({\n initialRouteName,\n defaultStatus,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n // @ts-expect-error: openByDefault is deprecated\n openByDefault,\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: drawerContentOptions is deprecated\n drawerContentOptions,\n ...rest\n}: Props) {\n let defaultScreenOptions: DrawerNavigationOptions = {};\n\n if (drawerContentOptions) {\n Object.assign(defaultScreenOptions, {\n drawerPosition: drawerContentOptions.drawerPosition,\n drawerType: drawerContentOptions.drawerType,\n swipeEdgeWidth: drawerContentOptions.edgeWidth,\n drawerHideStatusBarOnOpen: drawerContentOptions.hideStatusBar,\n keyboardDismissMode: drawerContentOptions.keyboardDismissMode,\n swipeMinDistance: drawerContentOptions.minSwipeDistance,\n overlayColor: drawerContentOptions.overlayColor,\n drawerStatusBarAnimation: drawerContentOptions.statusBarAnimation,\n gestureHandlerProps: drawerContentOptions.gestureHandlerProps,\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof DrawerNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n drawerContentOptions,\n `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(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/drawer-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Drawer Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/drawer-navigator/#lazy for more details.`\n );\n }\n\n if (typeof openByDefault === 'boolean') {\n warnOnce(\n true,\n `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.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n DrawerNavigationState<ParamListBase>,\n DrawerRouterOptions,\n DrawerActionHelpers<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n >(DrawerRouter, {\n initialRouteName,\n defaultStatus:\n defaultStatus !== undefined\n ? defaultStatus\n : openByDefault\n ? 'open'\n : 'closed',\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <DrawerView\n {...rest}\n state={state}\n descriptors={descriptors}\n navigation={navigation}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap,\n typeof DrawerNavigator\n>(DrawerNavigator);\n"]}
1
+ {"version":3,"sources":["createDrawerNavigator.tsx"],"names":["DrawerNavigator","initialRouteName","defaultStatus","customDefaultStatus","backBehavior","children","screenListeners","screenOptions","restWithDeprecated","openByDefault","lazy","drawerContentOptions","rest","defaultScreenOptions","Object","assign","drawerPosition","drawerType","swipeEdgeWidth","edgeWidth","drawerHideStatusBarOnOpen","hideStatusBar","keyboardDismissMode","swipeMinDistance","minSwipeDistance","overlayColor","drawerStatusBarAnimation","statusBarAnimation","gestureHandlerProps","keys","forEach","key","undefined","JSON","stringify","state","descriptors","navigation","NavigationContent","DrawerRouter"],"mappings":";;;;;;;AAAA;;AAWA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,eAAT,OAQU;AAAA,MARe;AACvBC,IAAAA,gBADuB;AAEvBC,IAAAA,aAAa,EAAEC,mBAFQ;AAGvBC,IAAAA,YAHuB;AAIvBC,IAAAA,QAJuB;AAKvBC,IAAAA,eALuB;AAMvBC,IAAAA,aANuB;AAOvB,OAAGC;AAPoB,GAQf;AACR,QAAM;AACJ;AACAC,IAAAA,aAFI;AAGJ;AACAC,IAAAA,IAJI;AAKJ;AACAC,IAAAA,oBANI;AAOJ,OAAGC;AAPC,MAQFJ,kBARJ;AAUA,MAAIK,oBAA6C,GAAG,EAApD;;AAEA,MAAIF,oBAAJ,EAA0B;AACxBG,IAAAA,MAAM,CAACC,MAAP,CAAcF,oBAAd,EAAoC;AAClCG,MAAAA,cAAc,EAAEL,oBAAoB,CAACK,cADH;AAElCC,MAAAA,UAAU,EAAEN,oBAAoB,CAACM,UAFC;AAGlCC,MAAAA,cAAc,EAAEP,oBAAoB,CAACQ,SAHH;AAIlCC,MAAAA,yBAAyB,EAAET,oBAAoB,CAACU,aAJd;AAKlCC,MAAAA,mBAAmB,EAAEX,oBAAoB,CAACW,mBALR;AAMlCC,MAAAA,gBAAgB,EAAEZ,oBAAoB,CAACa,gBANL;AAOlCC,MAAAA,YAAY,EAAEd,oBAAoB,CAACc,YAPD;AAQlCC,MAAAA,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Ec,oCAKbrC,eALa,C","sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n DrawerActionHelpers,\n DrawerNavigationState,\n DrawerRouter,\n DrawerRouterOptions,\n DrawerStatus,\n ParamListBase,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n DrawerNavigationConfig,\n DrawerNavigationEventMap,\n DrawerNavigationOptions,\n} from '../types';\nimport DrawerView from '../views/DrawerView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n> &\n DrawerRouterOptions &\n DrawerNavigationConfig;\n\nfunction DrawerNavigator({\n initialRouteName,\n defaultStatus: customDefaultStatus,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: openByDefault is deprecated\n openByDefault,\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: drawerContentOptions is deprecated\n drawerContentOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: DrawerNavigationOptions = {};\n\n if (drawerContentOptions) {\n Object.assign(defaultScreenOptions, {\n drawerPosition: drawerContentOptions.drawerPosition,\n drawerType: drawerContentOptions.drawerType,\n swipeEdgeWidth: drawerContentOptions.edgeWidth,\n drawerHideStatusBarOnOpen: drawerContentOptions.hideStatusBar,\n keyboardDismissMode: drawerContentOptions.keyboardDismissMode,\n swipeMinDistance: drawerContentOptions.minSwipeDistance,\n overlayColor: drawerContentOptions.overlayColor,\n drawerStatusBarAnimation: drawerContentOptions.statusBarAnimation,\n gestureHandlerProps: drawerContentOptions.gestureHandlerProps,\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof DrawerNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n drawerContentOptions,\n `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(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/drawer-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Drawer Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/drawer-navigator/#lazy for more details.`\n );\n }\n\n if (typeof openByDefault === 'boolean') {\n warnOnce(\n true,\n `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.`\n );\n }\n\n const defaultStatus: DrawerStatus =\n customDefaultStatus !== undefined\n ? customDefaultStatus\n : openByDefault\n ? 'open'\n : 'closed';\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n DrawerNavigationState<ParamListBase>,\n DrawerRouterOptions,\n DrawerActionHelpers<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap\n >(DrawerRouter, {\n initialRouteName,\n defaultStatus,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <DrawerView\n {...rest}\n defaultStatus={defaultStatus}\n state={state}\n descriptors={descriptors}\n navigation={navigation}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationOptions,\n DrawerNavigationEventMap,\n typeof DrawerNavigator\n>(DrawerNavigator);\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerStatusContext.tsx"],"names":["DrawerStatusContext","React","createContext","undefined"],"mappings":";;;;;;;AAAA;;;;;;AAEA,MAAMA,mBAAmB,gBACvBC,KAAK,CAACC,aAAN,CAAmDC,SAAnD,CADF;eAGeH,mB","sourcesContent":["import * as React from 'react';\n\nconst DrawerStatusContext =\n React.createContext<'open' | 'closed' | undefined>(undefined);\n\nexport default DrawerStatusContext;\n"]}
1
+ {"version":3,"sources":["DrawerStatusContext.tsx"],"names":["DrawerStatusContext","React","createContext","undefined"],"mappings":";;;;;;;AACA;;;;;;AAEA,MAAMA,mBAAmB,gBAAGC,KAAK,CAACC,aAAN,CAC1BC,SAD0B,CAA5B;eAIeH,mB","sourcesContent":["import type { DrawerStatus } from '@react-navigation/native';\nimport * as React from 'react';\n\nconst DrawerStatusContext = React.createContext<DrawerStatus | undefined>(\n undefined\n);\n\nexport default DrawerStatusContext;\n"]}
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = getDrawerStatusFromState;
7
7
 
8
8
  function getDrawerStatusFromState(state) {
9
- var _entry$status;
9
+ var _ref, _entry$status;
10
10
 
11
11
  if (state.history == null) {
12
12
  throw new Error("Couldn't find the drawer status in the state object. Is it a valid state object of drawer navigator?");
13
13
  }
14
14
 
15
15
  const entry = state.history.find(it => it.type === 'drawer');
16
- return (_entry$status = entry === null || entry === void 0 ? void 0 : entry.status) !== null && _entry$status !== void 0 ? _entry$status : 'closed';
16
+ return (_ref = (_entry$status = entry === null || entry === void 0 ? void 0 : entry.status) !== null && _entry$status !== void 0 ? _entry$status : state.default) !== null && _ref !== void 0 ? _ref : 'closed';
17
17
  }
18
18
  //# sourceMappingURL=getDrawerStatusFromState.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["getDrawerStatusFromState.tsx"],"names":["getDrawerStatusFromState","state","history","Error","entry","find","it","type","status"],"mappings":";;;;;;;AAKe,SAASA,wBAAT,CACbC,KADa,EAEb;AAAA;;AACA,MAAIA,KAAK,CAACC,OAAN,IAAiB,IAArB,EAA2B;AACzB,UAAM,IAAIC,KAAJ,CACJ,sGADI,CAAN;AAGD;;AAED,QAAMC,KAAK,GAAGH,KAAK,CAACC,OAAN,CAAcG,IAAd,CAAoBC,EAAD,IAAQA,EAAE,CAACC,IAAH,KAAY,QAAvC,CAAd;AAIA,0BAAOH,KAAP,aAAOA,KAAP,uBAAOA,KAAK,CAAEI,MAAd,yDAAwB,QAAxB;AACD","sourcesContent":["import type {\n DrawerNavigationState,\n ParamListBase,\n} from '@react-navigation/native';\n\nexport default function getDrawerStatusFromState(\n state: DrawerNavigationState<ParamListBase>\n) {\n if (state.history == null) {\n throw new Error(\n \"Couldn't find the drawer status in the state object. Is it a valid state object of drawer navigator?\"\n );\n }\n\n const entry = state.history.find((it) => it.type === 'drawer') as\n | { type: 'drawer'; status: 'open' }\n | undefined;\n\n return entry?.status ?? 'closed';\n}\n"]}
1
+ {"version":3,"sources":["getDrawerStatusFromState.tsx"],"names":["getDrawerStatusFromState","state","history","Error","entry","find","it","type","status","default"],"mappings":";;;;;;;AAMe,SAASA,wBAAT,CACbC,KADa,EAEC;AAAA;;AACd,MAAIA,KAAK,CAACC,OAAN,IAAiB,IAArB,EAA2B;AACzB,UAAM,IAAIC,KAAJ,CACJ,sGADI,CAAN;AAGD;;AAED,QAAMC,KAAK,GAAGH,KAAK,CAACC,OAAN,CAAcG,IAAd,CAAoBC,EAAD,IAAQA,EAAE,CAACC,IAAH,KAAY,QAAvC,CAAd;AAIA,kCAAOH,KAAP,aAAOA,KAAP,uBAAOA,KAAK,CAAEI,MAAd,yDAAwBP,KAAK,CAACQ,OAA9B,uCAAyC,QAAzC;AACD","sourcesContent":["import type {\n DrawerNavigationState,\n DrawerStatus,\n ParamListBase,\n} from '@react-navigation/native';\n\nexport default function getDrawerStatusFromState(\n state: DrawerNavigationState<ParamListBase>\n): DrawerStatus {\n if (state.history == null) {\n throw new Error(\n \"Couldn't find the drawer status in the state object. Is it a valid state object of drawer navigator?\"\n );\n }\n\n const entry = state.history.find((it) => it.type === 'drawer') as\n | { type: 'drawer'; status: DrawerStatus }\n | undefined;\n\n return entry?.status ?? state.default ?? 'closed';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawerStatus.tsx"],"names":["useDrawerStatus","drawerStatus","React","useContext","DrawerStatusContext","undefined","Error"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEA;AACA;AACA;AACA;AACe,SAASA,eAAT,GAA2B;AACxC,QAAMC,YAAY,GAAGC,KAAK,CAACC,UAAN,CAAiBC,4BAAjB,CAArB;;AAEA,MAAIH,YAAY,KAAKI,SAArB,EAAgC;AAC9B,UAAM,IAAIC,KAAJ,CACJ,sEADI,CAAN;AAGD;;AAED,SAAOL,YAAP;AACD","sourcesContent":["import * as React from 'react';\n\nimport DrawerStatusContext from './DrawerStatusContext';\n\n/**\n * Hook to detect if the drawer's status in a parent navigator.\n * Returns 'open' if the drawer is open, 'closed' if the drawer is closed.\n */\nexport default function useDrawerStatus() {\n const drawerStatus = React.useContext(DrawerStatusContext);\n\n if (drawerStatus === undefined) {\n throw new Error(\n \"Couldn't find a drawer. Is your component inside a drawer navigator?\"\n );\n }\n\n return drawerStatus;\n}\n"]}
1
+ {"version":3,"sources":["useDrawerStatus.tsx"],"names":["useDrawerStatus","drawerStatus","React","useContext","DrawerStatusContext","undefined","Error"],"mappings":";;;;;;;AACA;;AAEA;;;;;;;;AAEA;AACA;AACA;AACA;AACe,SAASA,eAAT,GAAyC;AACtD,QAAMC,YAAY,GAAGC,KAAK,CAACC,UAAN,CAAiBC,4BAAjB,CAArB;;AAEA,MAAIH,YAAY,KAAKI,SAArB,EAAgC;AAC9B,UAAM,IAAIC,KAAJ,CACJ,sEADI,CAAN;AAGD;;AAED,SAAOL,YAAP;AACD","sourcesContent":["import type { DrawerStatus } from '@react-navigation/native';\nimport * as React from 'react';\n\nimport DrawerStatusContext from './DrawerStatusContext';\n\n/**\n * Hook to detect if the drawer's status in a parent navigator.\n * Returns 'open' if the drawer is open, 'closed' if the drawer is closed.\n */\nexport default function useDrawerStatus(): DrawerStatus {\n const drawerStatus = React.useContext(DrawerStatusContext);\n\n if (drawerStatus === undefined) {\n throw new Error(\n \"Couldn't find a drawer. Is your component inside a drawer navigator?\"\n );\n }\n\n return drawerStatus;\n}\n"]}
@@ -19,11 +19,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
19
19
 
20
20
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
- function DrawerContent({
23
- descriptors,
24
- state,
25
- ...rest
26
- }) {
22
+ function DrawerContent(_ref) {
23
+ let {
24
+ descriptors,
25
+ state,
26
+ ...rest
27
+ } = _ref;
27
28
  const focusedRoute = state.routes[state.index];
28
29
  const focusedDescriptor = descriptors[focusedRoute.key];
29
30
  const focusedOptions = focusedDescriptor.options;
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerContent.tsx"],"names":["DrawerContent","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;;;;;;;;;AAEe,SAASA,aAAT,CAAuB;AACpCC,EAAAA,WADoC;AAEpCC,EAAAA,KAFoC;AAGpC,KAAGC;AAHiC,CAAvB,EAIiB;AAC9B,QAAMC,YAAY,GAAGF,KAAK,CAACG,MAAN,CAAaH,KAAK,CAACI,KAAnB,CAArB;AACA,QAAMC,iBAAiB,GAAGN,WAAW,CAACG,YAAY,CAACI,GAAd,CAArC;AACA,QAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAzC;AAEA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MAAsDH,cAA5D;AAEA,sBACE,oBAAC,gCAAD,eACMN,IADN;AAEE,IAAA,qBAAqB,EAAES,2BAFzB;AAGE,IAAA,KAAK,EAAED;AAHT,mBAKE,oBAAC,uBAAD;AAAgB,IAAA,WAAW,EAAEV,WAA7B;AAA0C,IAAA,KAAK,EAAEC;AAAjD,KAA4DC,IAA5D,EALF,CADF;AASD","sourcesContent":["import * as React from 'react';\n\nimport type { DrawerContentComponentProps } from '../types';\nimport DrawerContentScrollView from './DrawerContentScrollView';\nimport DrawerItemList from './DrawerItemList';\n\nexport default function DrawerContent({\n descriptors,\n state,\n ...rest\n}: DrawerContentComponentProps) {\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const { drawerContentStyle, drawerContentContainerStyle } = focusedOptions;\n\n return (\n <DrawerContentScrollView\n {...rest}\n contentContainerStyle={drawerContentContainerStyle}\n style={drawerContentStyle}\n >\n <DrawerItemList descriptors={descriptors} state={state} {...rest} />\n </DrawerContentScrollView>\n );\n}\n"]}
1
+ {"version":3,"sources":["DrawerContent.tsx"],"names":["DrawerContent","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;;;;;;;;;AAEe,SAASA,aAAT,OAIiB;AAAA,MAJM;AACpCC,IAAAA,WADoC;AAEpCC,IAAAA,KAFoC;AAGpC,OAAGC;AAHiC,GAIN;AAC9B,QAAMC,YAAY,GAAGF,KAAK,CAACG,MAAN,CAAaH,KAAK,CAACI,KAAnB,CAArB;AACA,QAAMC,iBAAiB,GAAGN,WAAW,CAACG,YAAY,CAACI,GAAd,CAArC;AACA,QAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAzC;AAEA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MAAsDH,cAA5D;AAEA,sBACE,oBAAC,gCAAD,eACMN,IADN;AAEE,IAAA,qBAAqB,EAAES,2BAFzB;AAGE,IAAA,KAAK,EAAED;AAHT,mBAKE,oBAAC,uBAAD;AAAgB,IAAA,WAAW,EAAEV,WAA7B;AAA0C,IAAA,KAAK,EAAEC;AAAjD,KAA4DC,IAA5D,EALF,CADF;AASD","sourcesContent":["import * as React from 'react';\n\nimport type { DrawerContentComponentProps } from '../types';\nimport DrawerContentScrollView from './DrawerContentScrollView';\nimport DrawerItemList from './DrawerItemList';\n\nexport default function DrawerContent({\n descriptors,\n state,\n ...rest\n}: DrawerContentComponentProps) {\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const { drawerContentStyle, drawerContentContainerStyle } = focusedOptions;\n\n return (\n <DrawerContentScrollView\n {...rest}\n contentContainerStyle={drawerContentContainerStyle}\n style={drawerContentStyle}\n >\n <DrawerItemList descriptors={descriptors} state={state} {...rest} />\n </DrawerContentScrollView>\n );\n}\n"]}
@@ -21,12 +21,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
- function DrawerContentScrollView({
25
- contentContainerStyle,
26
- style,
27
- children,
28
- ...rest
29
- }, ref) {
24
+ function DrawerContentScrollView(_ref, ref) {
25
+ let {
26
+ contentContainerStyle,
27
+ style,
28
+ children,
29
+ ...rest
30
+ } = _ref;
30
31
  const drawerPosition = React.useContext(_DrawerPositionContext.default);
31
32
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
32
33
  const isRight = _reactNative.I18nManager.isRTL ? drawerPosition === 'left' : drawerPosition === 'right';
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerContentScrollView.tsx"],"names":["DrawerContentScrollView","contentContainerStyle","style","children","rest","ref","drawerPosition","React","useContext","DrawerPositionContext","insets","isRight","I18nManager","isRTL","paddingTop","top","paddingStart","left","paddingEnd","right","styles","container","forwardRef","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;AAEA;;;;;;;;;;AAMA,SAASA,uBAAT,CACE;AAAEC,EAAAA,qBAAF;AAAyBC,EAAAA,KAAzB;AAAgCC,EAAAA,QAAhC;AAA0C,KAAGC;AAA7C,CADF,EAEEC,GAFF,EAGE;AACA,QAAMC,cAAc,GAAGC,KAAK,CAACC,UAAN,CAAiBC,8BAAjB,CAAvB;AACA,QAAMC,MAAM,GAAG,oDAAf;AAEA,QAAMC,OAAO,GAAGC,yBAAYC,KAAZ,GACZP,cAAc,KAAK,MADP,GAEZA,cAAc,KAAK,OAFvB;AAIA,sBACE,oBAAC,uBAAD,eACMF,IADN;AAEE,IAAA,GAAG,EAAEC,GAFP;AAGE,IAAA,qBAAqB,EAAE,CACrB;AACES,MAAAA,UAAU,EAAEJ,MAAM,CAACK,GAAP,GAAa,CAD3B;AAEEC,MAAAA,YAAY,EAAE,CAACL,OAAD,GAAWD,MAAM,CAACO,IAAlB,GAAyB,CAFzC;AAGEC,MAAAA,UAAU,EAAEP,OAAO,GAAGD,MAAM,CAACS,KAAV,GAAkB;AAHvC,KADqB,EAMrBlB,qBANqB,CAHzB;AAWE,IAAA,KAAK,EAAE,CAACmB,MAAM,CAACC,SAAR,EAAmBnB,KAAnB;AAXT,MAaGC,QAbH,CADF;AAiBD;;4BAEcI,KAAK,CAACe,UAAN,CAAiBtB,uBAAjB,C;;;;AAEf,MAAMoB,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AACTI,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n I18nManager,\n ScrollView,\n ScrollViewProps,\n StyleSheet,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport DrawerPositionContext from '../utils/DrawerPositionContext';\n\ntype Props = ScrollViewProps & {\n children: React.ReactNode;\n};\n\nfunction DrawerContentScrollView(\n { contentContainerStyle, style, children, ...rest }: Props,\n ref?: React.Ref<ScrollView>\n) {\n const drawerPosition = React.useContext(DrawerPositionContext);\n const insets = useSafeAreaInsets();\n\n const isRight = I18nManager.isRTL\n ? drawerPosition === 'left'\n : drawerPosition === 'right';\n\n return (\n <ScrollView\n {...rest}\n ref={ref}\n contentContainerStyle={[\n {\n paddingTop: insets.top + 4,\n paddingStart: !isRight ? insets.left : 0,\n paddingEnd: isRight ? insets.right : 0,\n },\n contentContainerStyle,\n ]}\n style={[styles.container, style]}\n >\n {children}\n </ScrollView>\n );\n}\n\nexport default React.forwardRef(DrawerContentScrollView);\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["DrawerContentScrollView.tsx"],"names":["DrawerContentScrollView","ref","contentContainerStyle","style","children","rest","drawerPosition","React","useContext","DrawerPositionContext","insets","isRight","I18nManager","isRTL","paddingTop","top","paddingStart","left","paddingEnd","right","styles","container","forwardRef","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;AAEA;;;;;;;;;;AAMA,SAASA,uBAAT,OAEEC,GAFF,EAGE;AAAA,MAFA;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA,KAAzB;AAAgCC,IAAAA,QAAhC;AAA0C,OAAGC;AAA7C,GAEA;AACA,QAAMC,cAAc,GAAGC,KAAK,CAACC,UAAN,CAAiBC,8BAAjB,CAAvB;AACA,QAAMC,MAAM,GAAG,oDAAf;AAEA,QAAMC,OAAO,GAAGC,yBAAYC,KAAZ,GACZP,cAAc,KAAK,MADP,GAEZA,cAAc,KAAK,OAFvB;AAIA,sBACE,oBAAC,uBAAD,eACMD,IADN;AAEE,IAAA,GAAG,EAAEJ,GAFP;AAGE,IAAA,qBAAqB,EAAE,CACrB;AACEa,MAAAA,UAAU,EAAEJ,MAAM,CAACK,GAAP,GAAa,CAD3B;AAEEC,MAAAA,YAAY,EAAE,CAACL,OAAD,GAAWD,MAAM,CAACO,IAAlB,GAAyB,CAFzC;AAGEC,MAAAA,UAAU,EAAEP,OAAO,GAAGD,MAAM,CAACS,KAAV,GAAkB;AAHvC,KADqB,EAMrBjB,qBANqB,CAHzB;AAWE,IAAA,KAAK,EAAE,CAACkB,MAAM,CAACC,SAAR,EAAmBlB,KAAnB;AAXT,MAaGC,QAbH,CADF;AAiBD;;4BAEcG,KAAK,CAACe,UAAN,CAAiBtB,uBAAjB,C;;;;AAEf,MAAMoB,MAAM,GAAGG,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AACTI,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport {\n I18nManager,\n ScrollView,\n ScrollViewProps,\n StyleSheet,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport DrawerPositionContext from '../utils/DrawerPositionContext';\n\ntype Props = ScrollViewProps & {\n children: React.ReactNode;\n};\n\nfunction DrawerContentScrollView(\n { contentContainerStyle, style, children, ...rest }: Props,\n ref?: React.Ref<ScrollView>\n) {\n const drawerPosition = React.useContext(DrawerPositionContext);\n const insets = useSafeAreaInsets();\n\n const isRight = I18nManager.isRTL\n ? drawerPosition === 'left'\n : drawerPosition === 'right';\n\n return (\n <ScrollView\n {...rest}\n ref={ref}\n contentContainerStyle={[\n {\n paddingTop: insets.top + 4,\n paddingStart: !isRight ? insets.left : 0,\n paddingEnd: isRight ? insets.right : 0,\n },\n contentContainerStyle,\n ]}\n style={[styles.container, style]}\n >\n {children}\n </ScrollView>\n );\n}\n\nexport default React.forwardRef(DrawerContentScrollView);\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
@@ -23,15 +23,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
23
23
 
24
24
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
25
 
26
- const LinkPressable = ({
27
- children,
28
- style,
29
- onPress,
30
- onLongPress,
31
- to,
32
- accessibilityRole,
33
- ...rest
34
- }) => {
26
+ const LinkPressable = _ref => {
27
+ let {
28
+ children,
29
+ style,
30
+ onPress,
31
+ onLongPress,
32
+ to,
33
+ accessibilityRole,
34
+ ...rest
35
+ } = _ref;
36
+
35
37
  if (_reactNative.Platform.OS === 'web' && to) {
36
38
  // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
37
39
  // We need to use `onClick` to be able to prevent default browser handling of links.
@@ -42,9 +44,9 @@ const LinkPressable = ({
42
44
  if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && ( // ignore clicks with modifier keys
43
45
  e.button == null || e.button === 0) // ignore everything but left clicks
44
46
  ) {
45
- e.preventDefault();
46
- onPress === null || onPress === void 0 ? void 0 : onPress(e);
47
- }
47
+ e.preventDefault();
48
+ onPress === null || onPress === void 0 ? void 0 : onPress(e);
49
+ }
48
50
  },
49
51
  onLongPress: onLongPress !== null && onLongPress !== void 0 ? onLongPress : undefined
50
52
  }), children);
@@ -72,6 +74,7 @@ function DrawerItem(props) {
72
74
  labelStyle,
73
75
  to,
74
76
  focused = false,
77
+ allowFontScaling,
75
78
  activeTintColor = colors.primary,
76
79
  inactiveTintColor = (0, _color.default)(colors.text).alpha(0.68).rgb().string(),
77
80
  activeBackgroundColor = (0, _color.default)(activeTintColor).alpha(0.12).rgb().string(),
@@ -120,6 +123,7 @@ function DrawerItem(props) {
120
123
  }]
121
124
  }, typeof label === 'string' ? /*#__PURE__*/React.createElement(_reactNative.Text, {
122
125
  numberOfLines: 1,
126
+ allowFontScaling: allowFontScaling,
123
127
  style: [{
124
128
  color,
125
129
  fontWeight: '500'
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerItem.tsx"],"names":["LinkPressable","children","style","onPress","onLongPress","to","accessibilityRole","rest","Platform","OS","styles","button","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","undefined","DrawerItem","props","colors","icon","label","labelStyle","focused","activeTintColor","primary","inactiveTintColor","text","alpha","rgb","string","activeBackgroundColor","inactiveBackgroundColor","pressColor","pressOpacity","borderRadius","StyleSheet","flatten","color","backgroundColor","iconNode","size","container","wrapper","selected","marginLeft","marginVertical","fontWeight","create","marginHorizontal","overflow","flexDirection","alignItems","padding","marginRight","flex","display"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AA6EA,MAAMA,aAAa,GAAG,CAAC;AACrBC,EAAAA,QADqB;AAErBC,EAAAA,KAFqB;AAGrBC,EAAAA,OAHqB;AAIrBC,EAAAA,WAJqB;AAKrBC,EAAAA,EALqB;AAMrBC,EAAAA,iBANqB;AAOrB,KAAGC;AAPkB,CAAD,KAchB;AACJ,MAAIC,sBAASC,EAAT,KAAgB,KAAhB,IAAyBJ,EAA7B,EAAiC;AAC/B;AACA;AACA,wBACE,oBAAC,YAAD,eACME,IADN;AAEE,MAAA,EAAE,EAAEF,EAFN;AAGE,MAAA,KAAK,EAAE,CAACK,MAAM,CAACC,MAAR,EAAgBT,KAAhB,CAHT;AAIE,MAAA,OAAO,EAAGU,CAAD,IAAY;AACnB,YACE,EAAEA,CAAC,CAACC,OAAF,IAAaD,CAAC,CAACE,MAAf,IAAyBF,CAAC,CAACG,OAA3B,IAAsCH,CAAC,CAACI,QAA1C,OAAuD;AACtDJ,QAAAA,CAAC,CAACD,MAAF,IAAY,IAAZ,IAAoBC,CAAC,CAACD,MAAF,KAAa,CADlC,CADF,CAEuC;AAFvC,UAGE;AACAC,YAAAA,CAAC,CAACK,cAAF;AACAd,YAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAGS,CAAH,CAAP;AACD;AACF,OAZH;AAaE,MAAA,WAAW,EAAER,WAAF,aAAEA,WAAF,cAAEA,WAAF,GAAiBc;AAb9B,QAeGjB,QAfH,CADF;AAmBD,GAtBD,MAsBO;AACL,wB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IAAAA,QAAQ,EAAE;AAHD,GADoB;AAM/BP,EAAAA,OAAO,EAAE;AACPQ,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,UAAU,EAAE,QAFL;AAGPC,IAAAA,OAAO,EAAE;AAHF,GANsB;AAW/BhC,EAAAA,KAAK,EAAE;AACLiC,IAAAA,WAAW,EAAE,EADR;AAELC,IAAAA,IAAI,EAAE;AAFD,GAXwB;AAe/B9C,EAAAA,MAAM,EAAE;AACN+C,IAAAA,OAAO,EAAE;AADH;AAfuB,CAAlB,CAAf","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements';\nimport { Link, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport * as React from 'react';\nimport {\n Platform,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native';\n\ntype Props = {\n /**\n * The label text of the item.\n */\n label:\n | string\n | ((props: { focused: boolean; color: string }) => React.ReactNode);\n /**\n * Icon to display for the `DrawerItem`.\n */\n icon?: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * Whether to highlight the drawer item as active.\n */\n focused?: boolean;\n /**\n * Function to execute on press.\n */\n onPress: () => void;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Color of the touchable effect on press.\n * Only supported on Android.\n *\n * @platform android\n */\n pressColor?: string;\n /**\n * Opacity of the touchable effect on press.\n * Only supported on iOS.\n *\n * @platform ios\n */\n pressOpacity?: number;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n};\n\nconst LinkPressable = ({\n children,\n style,\n onPress,\n onLongPress,\n to,\n accessibilityRole,\n ...rest\n}: Omit<React.ComponentProps<typeof PlatformPressable>, 'style'> & {\n style: StyleProp<ViewStyle>;\n} & {\n to?: string;\n children: React.ReactNode;\n onPress?: () => void;\n}) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n onLongPress={onLongPress ?? undefined}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <PlatformPressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n >\n <View style={style}>{children}</View>\n </PlatformPressable>\n );\n }\n};\n\n/**\n * A component used to show an action item with an icon and a label in a navigation drawer.\n */\nexport default function DrawerItem(props: Props) {\n const { colors } = useTheme();\n\n const {\n icon,\n label,\n labelStyle,\n to,\n focused = false,\n activeTintColor = colors.primary,\n inactiveTintColor = Color(colors.text).alpha(0.68).rgb().string(),\n activeBackgroundColor = Color(activeTintColor).alpha(0.12).rgb().string(),\n inactiveBackgroundColor = 'transparent',\n style,\n onPress,\n pressColor,\n pressOpacity,\n ...rest\n } = props;\n\n const { borderRadius = 4 } = StyleSheet.flatten(style || {});\n const color = focused ? activeTintColor : inactiveTintColor;\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n const iconNode = icon ? icon({ size: 24, focused, color }) : null;\n\n return (\n <View\n collapsable={false}\n {...rest}\n style={[styles.container, { borderRadius, backgroundColor }, style]}\n >\n <LinkPressable\n onPress={onPress}\n style={[styles.wrapper, { borderRadius }]}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: focused }}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n to={to}\n >\n <React.Fragment>\n {iconNode}\n <View\n style={[\n styles.label,\n { marginLeft: iconNode ? 32 : 0, marginVertical: 5 },\n ]}\n >\n {typeof label === 'string' ? (\n <Text\n numberOfLines={1}\n style={[\n {\n color,\n fontWeight: '500',\n },\n labelStyle,\n ]}\n >\n {label}\n </Text>\n ) : (\n label({ color, focused })\n )}\n </View>\n </React.Fragment>\n </LinkPressable>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n marginHorizontal: 10,\n marginVertical: 4,\n overflow: 'hidden',\n },\n wrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n padding: 8,\n },\n label: {\n marginRight: 32,\n flex: 1,\n },\n button: {\n display: 'flex',\n },\n});\n"]}
1
+ {"version":3,"sources":["DrawerItem.tsx"],"names":["LinkPressable","children","style","onPress","onLongPress","to","accessibilityRole","rest","Platform","OS","styles","button","e","metaKey","altKey","ctrlKey","shiftKey","preventDefault","undefined","DrawerItem","props","colors","icon","label","labelStyle","focused","allowFontScaling","activeTintColor","primary","inactiveTintColor","text","alpha","rgb","string","activeBackgroundColor","inactiveBackgroundColor","pressColor","pressOpacity","borderRadius","StyleSheet","flatten","color","backgroundColor","iconNode","size","container","wrapper","selected","marginLeft","marginVertical","fontWeight","create","marginHorizontal","overflow","flexDirection","alignItems","padding","marginRight","flex","display"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAiFA,MAAMA,aAAa,GAAG,QAchB;AAAA,MAdiB;AACrBC,IAAAA,QADqB;AAErBC,IAAAA,KAFqB;AAGrBC,IAAAA,OAHqB;AAIrBC,IAAAA,WAJqB;AAKrBC,IAAAA,EALqB;AAMrBC,IAAAA,iBANqB;AAOrB,OAAGC;AAPkB,GAcjB;;AACJ,MAAIC,sBAASC,EAAT,KAAgB,KAAhB,IAAyBJ,EAA7B,EAAiC;AAC/B;AACA;AACA,wBACE,oBAAC,YAAD,eACME,IADN;AAEE,MAAA,EAAE,EAAEF,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D;AACE,IAAA,KAAK,EAAE,CACLjC,MAAM,CAACa,KADF,EAEL;AAAEyB,MAAAA,UAAU,EAAEL,QAAQ,GAAG,EAAH,GAAQ,CAA9B;AAAiCM,MAAAA,cAAc,EAAE;AAAjD,KAFK;AADT,KAMG,OAAO1B,KAAP,KAAiB,QAAjB,gBACC,oBAAC,iBAAD;AACE,IAAA,aAAa,EAAE,CADjB;AAEE,IAAA,gBAAgB,EAAEG,gBAFpB;AAGE,IAAA,KAAK,EAAE,CACL;AACEe,MAAAA,KADF;AAEES,MAAAA,UAAU,EAAE;AAFd,KADK,EAKL1B,UALK;AAHT,KAWGD,KAXH,CADD,GAeCA,KAAK,CAAC;AAAEkB,IAAAA,KAAF;AAAShB,IAAAA;AAAT,GAAD,CArBT,CAFF,CATF,CALF,CADF;AA6CD;;AAED,MAAMf,MAAM,GAAG6B,wBAAWY,MAAX,CAAkB;AAC/BN,EAAAA,SAAS,EAAE;AACTO,IAAAA,gBAAgB,EAAE,EADT;AAETH,IAAAA,cAAc,EAAE,CAFP;AAGTI,IAAAA,QAAQ,EAAE;AAHD,GADoB;AAM/BP,EAAAA,OAAO,EAAE;AACPQ,IAAAA,aAAa,EAAE,KADR;AAEPC,IAAAA,UAAU,EAAE,QAFL;AAGPC,IAAAA,OAAO,EAAE;AAHF,GANsB;AAW/BjC,EAAAA,KAAK,EAAE;AACLkC,IAAAA,WAAW,EAAE,EADR;AAELC,IAAAA,IAAI,EAAE;AAFD,GAXwB;AAe/B/C,EAAAA,MAAM,EAAE;AACNgD,IAAAA,OAAO,EAAE;AADH;AAfuB,CAAlB,CAAf","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements';\nimport { Link, useTheme } from '@react-navigation/native';\nimport Color from 'color';\nimport * as React from 'react';\nimport {\n Platform,\n StyleProp,\n StyleSheet,\n Text,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native';\n\ntype Props = {\n /**\n * The label text of the item.\n */\n label:\n | string\n | ((props: { focused: boolean; color: string }) => React.ReactNode);\n /**\n * Icon to display for the `DrawerItem`.\n */\n icon?: (props: {\n focused: boolean;\n size: number;\n color: string;\n }) => React.ReactNode;\n /**\n * URL to use for the link to the tab.\n */\n to?: string;\n /**\n * Whether to highlight the drawer item as active.\n */\n focused?: boolean;\n /**\n * Function to execute on press.\n */\n onPress: () => void;\n /**\n * Color for the icon and label when the item is active.\n */\n activeTintColor?: string;\n /**\n * Color for the icon and label when the item is inactive.\n */\n inactiveTintColor?: string;\n /**\n * Background color for item when its active.\n */\n activeBackgroundColor?: string;\n /**\n * Background color for item when its inactive.\n */\n inactiveBackgroundColor?: string;\n /**\n * Color of the touchable effect on press.\n * Only supported on Android.\n *\n * @platform android\n */\n pressColor?: string;\n /**\n * Opacity of the touchable effect on press.\n * Only supported on iOS.\n *\n * @platform ios\n */\n pressOpacity?: number;\n /**\n * Style object for the label element.\n */\n labelStyle?: StyleProp<TextStyle>;\n /**\n * Style object for the wrapper element.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n};\n\nconst LinkPressable = ({\n children,\n style,\n onPress,\n onLongPress,\n to,\n accessibilityRole,\n ...rest\n}: Omit<React.ComponentProps<typeof PlatformPressable>, 'style'> & {\n style: StyleProp<ViewStyle>;\n} & {\n to?: string;\n children: React.ReactNode;\n onPress?: () => void;\n}) => {\n if (Platform.OS === 'web' && to) {\n // React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.\n // We need to use `onClick` to be able to prevent default browser handling of links.\n return (\n <Link\n {...rest}\n to={to}\n style={[styles.button, style]}\n onPress={(e: any) => {\n if (\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n (e.button == null || e.button === 0) // ignore everything but left clicks\n ) {\n e.preventDefault();\n onPress?.(e);\n }\n }}\n onLongPress={onLongPress ?? undefined}\n >\n {children}\n </Link>\n );\n } else {\n return (\n <PlatformPressable\n {...rest}\n accessibilityRole={accessibilityRole}\n onPress={onPress}\n >\n <View style={style}>{children}</View>\n </PlatformPressable>\n );\n }\n};\n\n/**\n * A component used to show an action item with an icon and a label in a navigation drawer.\n */\nexport default function DrawerItem(props: Props) {\n const { colors } = useTheme();\n\n const {\n icon,\n label,\n labelStyle,\n to,\n focused = false,\n allowFontScaling,\n activeTintColor = colors.primary,\n inactiveTintColor = Color(colors.text).alpha(0.68).rgb().string(),\n activeBackgroundColor = Color(activeTintColor).alpha(0.12).rgb().string(),\n inactiveBackgroundColor = 'transparent',\n style,\n onPress,\n pressColor,\n pressOpacity,\n ...rest\n } = props;\n\n const { borderRadius = 4 } = StyleSheet.flatten(style || {});\n const color = focused ? activeTintColor : inactiveTintColor;\n const backgroundColor = focused\n ? activeBackgroundColor\n : inactiveBackgroundColor;\n\n const iconNode = icon ? icon({ size: 24, focused, color }) : null;\n\n return (\n <View\n collapsable={false}\n {...rest}\n style={[styles.container, { borderRadius, backgroundColor }, style]}\n >\n <LinkPressable\n onPress={onPress}\n style={[styles.wrapper, { borderRadius }]}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: focused }}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n to={to}\n >\n <React.Fragment>\n {iconNode}\n <View\n style={[\n styles.label,\n { marginLeft: iconNode ? 32 : 0, marginVertical: 5 },\n ]}\n >\n {typeof label === 'string' ? (\n <Text\n numberOfLines={1}\n allowFontScaling={allowFontScaling}\n style={[\n {\n color,\n fontWeight: '500',\n },\n labelStyle,\n ]}\n >\n {label}\n </Text>\n ) : (\n label({ color, focused })\n )}\n </View>\n </React.Fragment>\n </LinkPressable>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n marginHorizontal: 10,\n marginVertical: 4,\n overflow: 'hidden',\n },\n wrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n padding: 8,\n },\n label: {\n marginRight: 32,\n flex: 1,\n },\n button: {\n display: 'flex',\n },\n});\n"]}
@@ -20,11 +20,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
20
20
  /**
21
21
  * Component that renders the navigation list in the drawer.
22
22
  */
23
- function DrawerItemList({
24
- state,
25
- navigation,
26
- descriptors
27
- }) {
23
+ function DrawerItemList(_ref) {
24
+ let {
25
+ state,
26
+ navigation,
27
+ descriptors
28
+ } = _ref;
28
29
  const buildLink = (0, _native.useLinkBuilder)();
29
30
  const focusedRoute = state.routes[state.index];
30
31
  const focusedDescriptor = descriptors[focusedRoute.key];
@@ -37,12 +38,31 @@ function DrawerItemList({
37
38
  } = focusedOptions;
38
39
  return state.routes.map((route, i) => {
39
40
  const focused = i === state.index;
41
+
42
+ const onPress = () => {
43
+ const event = navigation.emit({
44
+ type: 'drawerItemPress',
45
+ target: route.key,
46
+ canPreventDefault: true
47
+ });
48
+
49
+ if (!event.defaultPrevented) {
50
+ navigation.dispatch({ ...(focused ? _native.DrawerActions.closeDrawer() : _native.CommonActions.navigate({
51
+ name: route.name,
52
+ merge: true
53
+ })),
54
+ target: state.key
55
+ });
56
+ }
57
+ };
58
+
40
59
  const {
41
60
  title,
42
61
  drawerLabel,
43
62
  drawerIcon,
44
63
  drawerLabelStyle,
45
- drawerItemStyle
64
+ drawerItemStyle,
65
+ drawerAllowFontScaling
46
66
  } = descriptors[route.key].options;
47
67
  return /*#__PURE__*/React.createElement(_DrawerItem.default, {
48
68
  key: route.key,
@@ -53,17 +73,11 @@ function DrawerItemList({
53
73
  inactiveTintColor: drawerInactiveTintColor,
54
74
  activeBackgroundColor: drawerActiveBackgroundColor,
55
75
  inactiveBackgroundColor: drawerInactiveBackgroundColor,
76
+ allowFontScaling: drawerAllowFontScaling,
56
77
  labelStyle: drawerLabelStyle,
57
78
  style: drawerItemStyle,
58
79
  to: buildLink(route.name, route.params),
59
- onPress: () => {
60
- navigation.dispatch({ ...(focused ? _native.DrawerActions.closeDrawer() : _native.CommonActions.navigate({
61
- name: route.name,
62
- merge: true
63
- })),
64
- target: state.key
65
- });
66
- }
80
+ onPress: onPress
67
81
  });
68
82
  });
69
83
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerItemList.tsx"],"names":["DrawerItemList","state","navigation","descriptors","buildLink","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerActiveTintColor","drawerInactiveTintColor","drawerActiveBackgroundColor","drawerInactiveBackgroundColor","map","route","i","focused","title","drawerLabel","drawerIcon","drawerLabelStyle","drawerItemStyle","undefined","name","params","dispatch","DrawerActions","closeDrawer","CommonActions","navigate","merge","target"],"mappings":";;;;;;;AAAA;;AAOA;;AAGA;;;;;;;;AAQA;AACA;AACA;AACe,SAASA,cAAT,CAAwB;AACrCC,EAAAA,KADqC;AAErCC,EAAAA,UAFqC;AAGrCC,EAAAA;AAHqC,CAAxB,EAIL;AACR,QAAMC,SAAS,GAAG,6BAAlB;AAEA,QAAMC,YAAY,GAAGJ,KAAK,CAACK,MAAN,CAAaL,KAAK,CAACM,KAAnB,CAArB;AACA,QAAMC,iBAAiB,GAAGL,WAAW,CAACE,YAAY,CAACI,GAAd,CAArC;AACA,QAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAzC;AAEA,QAAM;AACJC,IAAAA,qBADI;AAEJC,IAAAA,uBAFI;AAGJC,IAAAA,2BAHI;AAIJC,IAAAA;AAJI,MAKFL,cALJ;AAOA,SAAOT,KAAK,CAACK,MAAN,CAAaU,GAAb,CAAiB,CAACC,KAAD,EAAQC,CAAR,KAAc;AACpC,UAAMC,OAAO,GAAGD,CAAC,KAAKjB,KAAK,CAACM,KAA5B;AACA,UAAM;AACJa,MAAAA,KADI;AAEJC,MAAAA,WAFI;AAGJC,MAAAA,UAHI;AAIJC,MAAAA,gBAJI;AAKJC,MAAAA;AALI,QAMFrB,WAAW,CAACc,KAAK,CAACR,GAAP,CAAX,CAAuBE,OAN3B;AAQA,wBACE,oBAAC,mBAAD;AACE,MAAA,GAAG,EAAEM,KAAK,CAACR,GADb;AAEE,MAAA,KAAK,EACHY,WAAW,KAAKI,SAAhB,GACIJ,WADJ,GAEID,KAAK,KAAKK,SAAV,GACAL,KADA,GAEAH,KAAK,CAACS,IAPd;AASE,MAAA,IAAI,EAAEJ,UATR;AAUE,MAAA,OAAO,EAAEH,OAVX;AAWE,MAAA,eAAe,EAAEP,qBAXnB;AAYE,MAAA,iBAAiB,EAAEC,uBAZrB;AAaE,MAAA,qBAAqB,EAAEC,2BAbzB;AAcE,MAAA,uBAAuB,EAAEC,6BAd3B;AAeE,MAAA,UAAU,EAAEQ,gBAfd;AAgBE,MAAA,KAAK,EAAEC,eAhBT;AAiBE,MAAA,EAAE,EAAEpB,SAAS,CAACa,KAAK,CAACS,IAAP,EAAaT,KAAK,CAACU,MAAnB,CAjBf;AAkBE,MAAA,OAAO,EAAE,MAAM;AACbzB,QAAAA,UAAU,CAAC0B,QAAX,CAAoB,EAClB,IAAIT,OAAO,GACPU,sBAAcC,WAAd,EADO,GAEPC,sBAAcC,QAAd,CAAuB;AAAEN,YAAAA,IAAI,EAAET,KAAK,CAACS,IAAd;AAAoBO,YAAAA,KAAK,EAAE;AAA3B,WAAvB,CAFJ,CADkB;AAIlBC,UAAAA,MAAM,EAAEjC,KAAK,CAACQ;AAJI,SAApB;AAMD;AAzBH,MADF;AA6BD,GAvCM,CAAP;AAwCD","sourcesContent":["import {\n CommonActions,\n DrawerActions,\n DrawerNavigationState,\n ParamListBase,\n useLinkBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\n\nimport type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';\nimport DrawerItem from './DrawerItem';\n\ntype Props = {\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\n/**\n * Component that renders the navigation list in the drawer.\n */\nexport default function DrawerItemList({\n state,\n navigation,\n descriptors,\n}: Props) {\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n drawerActiveTintColor,\n drawerInactiveTintColor,\n drawerActiveBackgroundColor,\n drawerInactiveBackgroundColor,\n } = focusedOptions;\n\n return state.routes.map((route, i) => {\n const focused = i === state.index;\n const {\n title,\n drawerLabel,\n drawerIcon,\n drawerLabelStyle,\n drawerItemStyle,\n } = descriptors[route.key].options;\n\n return (\n <DrawerItem\n key={route.key}\n label={\n drawerLabel !== undefined\n ? drawerLabel\n : title !== undefined\n ? title\n : route.name\n }\n icon={drawerIcon}\n focused={focused}\n activeTintColor={drawerActiveTintColor}\n inactiveTintColor={drawerInactiveTintColor}\n activeBackgroundColor={drawerActiveBackgroundColor}\n inactiveBackgroundColor={drawerInactiveBackgroundColor}\n labelStyle={drawerLabelStyle}\n style={drawerItemStyle}\n to={buildLink(route.name, route.params)}\n onPress={() => {\n navigation.dispatch({\n ...(focused\n ? DrawerActions.closeDrawer()\n : CommonActions.navigate({ name: route.name, merge: true })),\n target: state.key,\n });\n }}\n />\n );\n }) as React.ReactNode as React.ReactElement;\n}\n"]}
1
+ {"version":3,"sources":["DrawerItemList.tsx"],"names":["DrawerItemList","state","navigation","descriptors","buildLink","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerActiveTintColor","drawerInactiveTintColor","drawerActiveBackgroundColor","drawerInactiveBackgroundColor","map","route","i","focused","onPress","event","emit","type","target","canPreventDefault","defaultPrevented","dispatch","DrawerActions","closeDrawer","CommonActions","navigate","name","merge","title","drawerLabel","drawerIcon","drawerLabelStyle","drawerItemStyle","drawerAllowFontScaling","undefined","params"],"mappings":";;;;;;;AAAA;;AAOA;;AAGA;;;;;;;;AAQA;AACA;AACA;AACe,SAASA,cAAT,OAIL;AAAA,MAJ6B;AACrCC,IAAAA,KADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA;AAHqC,GAI7B;AACR,QAAMC,SAAS,GAAG,6BAAlB;AAEA,QAAMC,YAAY,GAAGJ,KAAK,CAACK,MAAN,CAAaL,KAAK,CAACM,KAAnB,C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IL,WADJ,GAEID,KAAK,KAAKM,SAAV,GACAN,KADA,GAEAjB,KAAK,CAACe,IAPd;AASE,MAAA,IAAI,EAAEI,UATR;AAUE,MAAA,OAAO,EAAEjB,OAVX;AAWE,MAAA,eAAe,EAAEP,qBAXnB;AAYE,MAAA,iBAAiB,EAAEC,uBAZrB;AAaE,MAAA,qBAAqB,EAAEC,2BAbzB;AAcE,MAAA,uBAAuB,EAAEC,6BAd3B;AAeE,MAAA,gBAAgB,EAAEwB,sBAfpB;AAgBE,MAAA,UAAU,EAAEF,gBAhBd;AAiBE,MAAA,KAAK,EAAEC,eAjBT;AAkBE,MAAA,EAAE,EAAElC,SAAS,CAACa,KAAK,CAACe,IAAP,EAAaf,KAAK,CAACwB,MAAnB,CAlBf;AAmBE,MAAA,OAAO,EAAErB;AAnBX,MADF;AAuBD,GApDM,CAAP;AAqDD","sourcesContent":["import {\n CommonActions,\n DrawerActions,\n DrawerNavigationState,\n ParamListBase,\n useLinkBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\n\nimport type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';\nimport DrawerItem from './DrawerItem';\n\ntype Props = {\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\n/**\n * Component that renders the navigation list in the drawer.\n */\nexport default function DrawerItemList({\n state,\n navigation,\n descriptors,\n}: Props) {\n const buildLink = useLinkBuilder();\n\n const focusedRoute = state.routes[state.index];\n const focusedDescriptor = descriptors[focusedRoute.key];\n const focusedOptions = focusedDescriptor.options;\n\n const {\n drawerActiveTintColor,\n drawerInactiveTintColor,\n drawerActiveBackgroundColor,\n drawerInactiveBackgroundColor,\n } = focusedOptions;\n\n return state.routes.map((route, i) => {\n const focused = i === state.index;\n\n const onPress = () => {\n const event = navigation.emit({\n type: 'drawerItemPress',\n target: route.key,\n canPreventDefault: true,\n });\n\n if (!event.defaultPrevented) {\n navigation.dispatch({\n ...(focused\n ? DrawerActions.closeDrawer()\n : CommonActions.navigate({ name: route.name, merge: true })),\n target: state.key,\n });\n }\n };\n\n const {\n title,\n drawerLabel,\n drawerIcon,\n drawerLabelStyle,\n drawerItemStyle,\n drawerAllowFontScaling,\n } = descriptors[route.key].options;\n\n return (\n <DrawerItem\n key={route.key}\n label={\n drawerLabel !== undefined\n ? drawerLabel\n : title !== undefined\n ? title\n : route.name\n }\n icon={drawerIcon}\n focused={focused}\n activeTintColor={drawerActiveTintColor}\n inactiveTintColor={drawerInactiveTintColor}\n activeBackgroundColor={drawerActiveBackgroundColor}\n inactiveBackgroundColor={drawerInactiveBackgroundColor}\n allowFontScaling={drawerAllowFontScaling}\n labelStyle={drawerLabelStyle}\n style={drawerItemStyle}\n to={buildLink(route.name, route.params)}\n onPress={onPress}\n />\n );\n }) as React.ReactNode as React.ReactElement;\n}\n"]}
@@ -19,10 +19,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
19
19
 
20
20
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
- function DrawerToggleButton({
23
- tintColor,
24
- ...rest
25
- }) {
22
+ function DrawerToggleButton(_ref) {
23
+ let {
24
+ tintColor,
25
+ ...rest
26
+ } = _ref;
26
27
  const navigation = (0, _native.useNavigation)();
27
28
  return /*#__PURE__*/React.createElement(_elements.PlatformPressable, _extends({}, rest, {
28
29
  accessible: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["DrawerToggleButton.tsx"],"names":["DrawerToggleButton","tintColor","rest","navigation","borderless","dispatch","DrawerActions","toggleDrawer","styles","touchable","Platform","select","ios","undefined","default","top","right","bottom","left","icon","require","StyleSheet","create","height","width","margin","resizeMode","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AAKA;;AACA;;;;;;;;AAWe,SAASA,kBAA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\n ParamListBase,\n useNavigation,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Image, Platform, StyleSheet } from 'react-native';\n\nimport type { DrawerNavigationProp } from '../types';\n\ntype Props = {\n accessibilityLabel?: string;\n pressColor?: string;\n pressOpacity?: number;\n tintColor?: string;\n};\n\nexport default function DrawerToggleButton({ tintColor, ...rest }: Props) {\n const navigation = useNavigation<DrawerNavigationProp<ParamListBase>>();\n\n return (\n <PlatformPressable\n {...rest}\n accessible\n accessibilityRole=\"button\"\n android_ripple={{ borderless: true }}\n onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())}\n style={styles.touchable}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <Image\n style={[styles.icon, tintColor ? { tintColor } : null]}\n source={require('./assets/toggle-drawer-icon.png')}\n fadeDuration={0}\n />\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n icon: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n },\n touchable: {\n marginHorizontal: 11,\n },\n});\n"]}
1
+ {"version":3,"sources":["DrawerToggleButton.tsx"],"names":["DrawerToggleButton","tintColor","rest","navigation","borderless","dispatch","DrawerActions","toggleDrawer","styles","touchable","Platform","select","ios","undefined","default","top","right","bottom","left","icon","require","StyleSheet","create","height","width","margin","resizeMode","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AAKA;;AACA;;;;;;;;AAWe,SAASA,kBAAT,OAA2D;AAAA,MAA/B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA+B;AACxE,QAAMC,UAAU,GAAG,4BAAnB;AAEA,sBACE,oBAAC,2BAAD,eACMD,IADN;AAEE,IAAA,UAAU,MAFZ;AAGE,IAAA,iBAAiB,EAAC,QAHpB;AAIE,IAAA,cAAc,EAAE;AAAEE,MAAAA,UAAU,EAAE;AAAd,KAJlB;AAKE,IAAA,OAAO,EAAE,MAAMD,UAAU,CAACE,QAAX,CAAoBC,sBAAcC,YAAd,EAApB,CALjB;AAME,IAAA,KAAK,EAAEC,MAAM,CAACC,SANhB;AAOE,IAAA,OAAO,EAAEC,sBAASC,MAAT,CAAgB;AACvBC,MAAAA,GAAG,EAAEC,SADkB;AAEvBC,MAAAA,OAAO,EAAE;AAAEC,QAAAA,GAAG,EAAE,EAAP;AAAWC,QAAAA,KAAK,EAAE,EAAlB;AAAsBC,QAAAA,MAAM,EAAE,EAA9B;AAAkCC,QAAAA,IAAI,EAAE;AAAxC;AAFc,KAAhB;AAPX,mBAYE,oBAAC,kBAAD;AACE,IAAA,KAAK,EAAE,CAACV,MAAM,CAACW,IAAR,EAAclB,SAAS,GAAG;AAAEA,MAAAA;AAAF,KAAH,GAAmB,IAA1C,CADT;AAEE,IAAA,MAAM,EAAEmB,OAAO,CAAC,iCAAD,CAFjB;AAGE,IAAA,YAAY,EAAE;AAHhB,IAZF,CADF;AAoBD;;AAED,MAAMZ,MAAM,GAAGa,wBAAWC,MAAX,CAAkB;AAC/BH,EAAAA,IAAI,EAAE;AACJI,IAAAA,MAAM,EAAE,EADJ;AAEJC,IAAAA,KAAK,EAAE,EAFH;AAGJC,IAAAA,MAAM,EAAE,CAHJ;AAIJC,IAAAA,UAAU,EAAE;AAJR,GADyB;AAO/BjB,EAAAA,SAAS,EAAE;AACTkB,IAAAA,gBAAgB,EAAE;AADT;AAPoB,CAAlB,CAAf","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements';\nimport {\n DrawerActions,\n ParamListBase,\n useNavigation,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Image, Platform, StyleSheet } from 'react-native';\n\nimport type { DrawerNavigationProp } from '../types';\n\ntype Props = {\n accessibilityLabel?: string;\n pressColor?: string;\n pressOpacity?: number;\n tintColor?: string;\n};\n\nexport default function DrawerToggleButton({ tintColor, ...rest }: Props) {\n const navigation = useNavigation<DrawerNavigationProp<ParamListBase>>();\n\n return (\n <PlatformPressable\n {...rest}\n accessible\n accessibilityRole=\"button\"\n android_ripple={{ borderless: true }}\n onPress={() => navigation.dispatch(DrawerActions.toggleDrawer())}\n style={styles.touchable}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <Image\n style={[styles.icon, tintColor ? { tintColor } : null]}\n source={require('./assets/toggle-drawer-icon.png')}\n fadeDuration={0}\n />\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n icon: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n },\n touchable: {\n marginHorizontal: 11,\n },\n});\n"]}