@react-navigation/drawer 6.1.8 → 6.2.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.
- package/lib/commonjs/index.js +14 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +10 -9
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +6 -5
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +7 -6
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +13 -10
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +6 -5
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +5 -4
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +32 -29
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.js +7 -4
- package/lib/commonjs/views/GestureHandler.js.map +1 -1
- package/lib/commonjs/views/GestureHandlerNative.js +1 -1
- package/lib/commonjs/views/ScreenFallback.js +13 -9
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/commonjs/views/legacy/Drawer.js +17 -12
- package/lib/commonjs/views/legacy/Drawer.js.map +1 -1
- package/lib/commonjs/views/legacy/Overlay.js +8 -6
- package/lib/commonjs/views/legacy/Overlay.js.map +1 -1
- package/lib/commonjs/views/modern/Drawer.js +28 -30
- package/lib/commonjs/views/modern/Drawer.js.map +1 -1
- package/lib/commonjs/views/modern/Overlay.js +7 -6
- package/lib/commonjs/views/modern/Overlay.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +10 -9
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +6 -5
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +7 -6
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +13 -10
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +6 -5
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +5 -4
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +31 -28
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/module/views/GestureHandler.js +6 -3
- package/lib/module/views/GestureHandler.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +13 -9
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/module/views/legacy/Drawer.js +17 -12
- package/lib/module/views/legacy/Drawer.js.map +1 -1
- package/lib/module/views/legacy/Overlay.js +8 -6
- package/lib/module/views/legacy/Overlay.js.map +1 -1
- package/lib/module/views/modern/Drawer.js +28 -30
- package/lib/module/views/modern/Drawer.js.map +1 -1
- package/lib/module/views/modern/Overlay.js +7 -6
- package/lib/module/views/modern/Overlay.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +2 -1
- package/lib/typescript/src/views/legacy/Overlay.d.ts +4 -0
- package/lib/typescript/src/views/modern/Overlay.d.ts +4 -0
- package/package.json +10 -10
- package/src/index.tsx +1 -0
- package/src/utils/DrawerStatusContext.tsx +3 -2
- package/src/utils/useDrawerStatus.tsx +2 -1
- package/src/views/legacy/Drawer.tsx +17 -9
- package/src/views/legacy/Overlay.tsx +1 -0
- package/src/views/modern/Drawer.tsx +25 -23
package/lib/commonjs/index.js
CHANGED
|
@@ -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, "
|
|
36
|
+
Object.defineProperty(exports, "DrawerProgressContext", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return
|
|
39
|
+
return _DrawerProgressContext.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "DrawerToggleButton", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function () {
|
|
45
|
-
return
|
|
45
|
+
return _DrawerToggleButton.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "DrawerView", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function () {
|
|
51
|
-
return
|
|
51
|
+
return _DrawerView.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
54
|
+
Object.defineProperty(exports, "createDrawerNavigator", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function () {
|
|
57
|
-
return
|
|
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,15 +21,16 @@ 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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
function DrawerNavigator(_ref) {
|
|
25
|
+
let {
|
|
26
|
+
initialRouteName,
|
|
27
|
+
defaultStatus: customDefaultStatus,
|
|
28
|
+
backBehavior,
|
|
29
|
+
children,
|
|
30
|
+
screenListeners,
|
|
31
|
+
screenOptions,
|
|
32
|
+
...restWithDeprecated
|
|
33
|
+
} = _ref;
|
|
33
34
|
const {
|
|
34
35
|
// @ts-expect-error: openByDefault is deprecated
|
|
35
36
|
openByDefault,
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,QAJ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EAEG,uKAFH;AAID;;AAED,MAAI,OAAOD,aAAP,KAAyB,SAA7B,EAAwC;AACtC,2BACE,IADF,EAEG,0MAFH;AAID;;AAED,QAAMP,aAA2B,GAC/BC,mBAAmB,KAAK6B,SAAxB,GACI7B,mBADJ,GAEIM,aAAa,GACb,MADa,GAEb,QALN;AAOA,QAAM;AAAE0B,IAAAA,KAAF;AAASC,IAAAA,WAAT;AAAsBC,IAAAA,UAAtB;AAAkCC,IAAAA;AAAlC,MACJ,kCAMEC,oBANF,EAMgB;AACdtC,IAAAA,gBADc;AAEdC,IAAAA,aAFc;AAGdE,IAAAA,YAHc;AAIdC,IAAAA,QAJc;AAKdC,IAAAA,eALc;AAMdC,IAAAA,aANc;AAOdM,IAAAA;AAPc,GANhB,CADF;AAiBA,sBACE,oBAAC,iBAAD,qBACE,oBAAC,mBAAD,eACMD,IADN;AAEE,IAAA,aAAa,EAAEV,aAFjB;AAGE,IAAA,KAAK,EAAEiC,KAHT;AAIE,IAAA,WAAW,EAAEC,WAJf;AAKE,IAAA,UAAU,EAAEC;AALd,KADF,CADF;AAWD;;eAEc,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":";;;;;;;AACA;;;;;;AAEA,MAAMA,mBAAmB,
|
|
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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDrawerStatus.tsx"],"names":["useDrawerStatus","drawerStatus","React","useContext","DrawerStatusContext","undefined","Error"],"mappings":";;;;;;;
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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","
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
@@ -39,7 +41,8 @@ const LinkPressable = ({
|
|
|
39
41
|
to: to,
|
|
40
42
|
style: [styles.button, style],
|
|
41
43
|
onPress: e => {
|
|
42
|
-
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
|
|
44
|
+
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && ( // ignore clicks with modifier keys
|
|
45
|
+
e.button == null || e.button === 0) // ignore everything but left clicks
|
|
43
46
|
) {
|
|
44
47
|
e.preventDefault();
|
|
45
48
|
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
@@ -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,
|
|
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,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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,kBASE,oBAAC,KAAD,CAAO,QAAP,QACGqC,QADH,eAEE,oBAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CACLhC,MAAM,CAACa,KADF,EAEL;AAAEwB,MAAAA,UAAU,EAAEL,QAAQ,GAAG,EAAH,GAAQ,CAA9B;AAAiCM,MAAAA,cAAc,EAAE;AAAjD,KAFK;AADT,KAMG,OAAOzB,KAAP,KAAiB,QAAjB,gBACC,oBAAC,iBAAD;AACE,IAAA,aAAa,EAAE,CADjB;AAEE,IAAA,KAAK,EAAE,CACL;AACEiB,MAAAA,KADF;AAEES,MAAAA,UAAU,EAAE;AAFd,KADK,EAKLzB,UALK;AAFT,KAUGD,KAVH,CADD,GAcCA,KAAK,CAAC;AAAEiB,IAAAA,KAAF;AAASf,IAAAA;AAAT,GAAD,CApBT,CAFF,CATF,CALF,CADF;AA4CD;;AAED,MAAMf,MAAM,GAAG4B,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/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"]}
|
|
@@ -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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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];
|
|
@@ -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,
|
|
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,OAIL;AAAA,MAJ6B;AACrCC,IAAAA,KADqC;AAErCC,IAAAA,UAFqC;AAGrCC,IAAAA;AAHqC,GAI7B;AACR,QAAMC,SAAS,GAAG,6BAAlB;AAEA,QAAMC,YAAY,GA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ACPU,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"]}
|
|
@@ -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
|
-
|
|
24
|
-
|
|
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,kBAAT,
|
|
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"]}
|
|
@@ -39,10 +39,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
39
39
|
|
|
40
40
|
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); }
|
|
41
41
|
|
|
42
|
-
const getDefaultDrawerWidth =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const getDefaultDrawerWidth = _ref => {
|
|
43
|
+
let {
|
|
44
|
+
height,
|
|
45
|
+
width
|
|
46
|
+
} = _ref;
|
|
47
|
+
|
|
46
48
|
/*
|
|
47
49
|
* Default drawer width is screen width - header height
|
|
48
50
|
* with a max width of 280 on mobile and 320 on tablet
|
|
@@ -58,23 +60,22 @@ const getDefaultDrawerWidth = ({
|
|
|
58
60
|
|
|
59
61
|
const GestureHandlerWrapper = _GestureHandler.GestureHandlerRootView !== null && _GestureHandler.GestureHandlerRootView !== void 0 ? _GestureHandler.GestureHandlerRootView : _reactNative.View;
|
|
60
62
|
|
|
61
|
-
function DrawerViewBase({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}) {
|
|
63
|
+
function DrawerViewBase(_ref2) {
|
|
64
|
+
var _Animated$isConfigure;
|
|
65
|
+
|
|
66
|
+
let {
|
|
67
|
+
state,
|
|
68
|
+
navigation,
|
|
69
|
+
descriptors,
|
|
70
|
+
defaultStatus,
|
|
71
|
+
drawerContent = props => /*#__PURE__*/React.createElement(_DrawerContent.default, props),
|
|
72
|
+
detachInactiveScreens = _reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'android' || _reactNative.Platform.OS === 'ios',
|
|
73
|
+
// Running in chrome debugger
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
useLegacyImplementation = !global.nativeCallSyncHook || // Reanimated 2 is not configured
|
|
76
|
+
// @ts-expect-error: the type definitions are incomplete
|
|
77
|
+
!((_Animated$isConfigure = _reactNativeReanimated.default.isConfigured) !== null && _Animated$isConfigure !== void 0 && _Animated$isConfigure.call(_reactNativeReanimated.default))
|
|
78
|
+
} = _ref2;
|
|
78
79
|
const Drawer = useLegacyImplementation ? require('./legacy/Drawer').default : require('./modern/Drawer').default;
|
|
79
80
|
const focusedRouteKey = state.routes[state.index].key;
|
|
80
81
|
const {
|
|
@@ -195,12 +196,13 @@ function DrawerViewBase({
|
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
const {
|
|
198
|
-
header =
|
|
199
|
-
layout,
|
|
200
|
-
options
|
|
201
|
-
}) => {
|
|
199
|
+
header = _ref3 => {
|
|
202
200
|
var _options$headerLeft;
|
|
203
201
|
|
|
202
|
+
let {
|
|
203
|
+
layout,
|
|
204
|
+
options
|
|
205
|
+
} = _ref3;
|
|
204
206
|
return /*#__PURE__*/React.createElement(_elements.Header, _extends({}, options, {
|
|
205
207
|
layout: layout,
|
|
206
208
|
title: (0, _elements.getHeaderTitle)(options, route.name),
|
|
@@ -269,10 +271,11 @@ function DrawerViewBase({
|
|
|
269
271
|
}));
|
|
270
272
|
}
|
|
271
273
|
|
|
272
|
-
function DrawerView({
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
function DrawerView(_ref4) {
|
|
275
|
+
let {
|
|
276
|
+
navigation,
|
|
277
|
+
...rest
|
|
278
|
+
} = _ref4;
|
|
276
279
|
return /*#__PURE__*/React.createElement(_elements.SafeAreaProviderCompat, null, /*#__PURE__*/React.createElement(GestureHandlerWrapper, {
|
|
277
280
|
style: styles.content
|
|
278
281
|
}, /*#__PURE__*/React.createElement(DrawerViewBase, _extends({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DrawerView.tsx"],"names":["getDefaultDrawerWidth","height","width","smallerAxisSize","Math","min","isLandscape","isTablet","appBarHeight","Platform","OS","maxWidth","GestureHandlerWrapper","GestureHandlerRootView","View","DrawerViewBase","state","navigation","descriptors","defaultStatus","drawerContent","props","detachInactiveScreens","useLegacyImplementation","global","nativeCallSyncHook","Animated","isConfigured","Drawer","require","default","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","I18nManager","isRTL","drawerStatusBarAnimation","drawerStyle","drawerType","select","ios","gestureHandlerProps","keyboardDismissMode","overlayColor","swipeEdgeWidth","swipeEnabled","swipeMinDistance","options","loaded","setLoaded","React","useState","includes","dimensions","colors","drawerStatus","handleDrawerOpen","useCallback","dispatch","DrawerActions","openDrawer","target","handleDrawerClose","closeDrawer","useEffect","handleHardwareBack","isFocused","handleEscape","e","subscription","BackHandler","addEventListener","document","body","remove","removeEventListener","renderDrawerContent","renderSceneContent","styles","content","map","route","descriptor","lazy","unmountOnBlur","header","layout","name","headerLeft","sceneContainerStyle","StyleSheet","absoluteFill","zIndex","headerShown","headerTransparent","headerStatusBarHeight","render","backgroundColor","card","borderRightColor","border","borderRightWidth","hairlineWidth","borderLeftColor","borderLeftWidth","DrawerView","rest","create","flex"],"mappings":";;;;;;;AAAA;;AAMA;;AAOA;;AACA;;AAOA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AASA,MAAMA,qBAAqB,GAAG,CAAC;AAC7BC,EAAAA,MAD6B;AAE7BC,EAAAA;AAF6B,CAAD,KAMxB;AACJ;AACF;AACA;AACA;AACA;AACE,QAAMC,eAAe,GAAGC,IAAI,CAACC,GAAL,CAASJ,MAAT,EAAiBC,KAAjB,CAAxB;AACA,QAAMI,WAAW,GAAGJ,KAAK,GAAGD,MAA5B;AACA,QAAMM,QAAQ,GAAGJ,eAAe,IAAI,GAApC;AACA,QAAMK,YAAY,GAAGC,sBAASC,EAAT,KAAgB,KAAhB,GAAyBJ,WAAW,GAAG,EAAH,GAAQ,EAA5C,GAAkD,EAAvE;AACA,QAAMK,QAAQ,GAAGJ,QAAQ,GAAG,GAAH,GAAS,GAAlC;AAEA,SAAOH,IAAI,CAACC,GAAL,CAASF,eAAe,GAAGK,YAA3B,EAAyCG,QAAzC,CAAP;AACD,CAnBD;;AAqBA,MAAMC,qBAAqB,GAAGC,sCAAH,aAAGA,sCAAH,cAAGA,sCAAH,GAA6BC,iBAAxD;;AAEA,SAASC,cAAT,CAAwB;AACtBC,EAAAA,KADsB;AAEtBC,EAAAA,UAFsB;AAGtBC,EAAAA,WAHsB;AAItBC,EAAAA,aAJsB;AAKtBC,EAAAA,aAAa,GAAIC,KAAD,iBACd,oBAAC,sBAAD,EAAmBA,KAAnB,CANoB;AAQtBC,EAAAA,qBAAqB,GAAGb,sBAASC,EAAT,KAAgB,KAAhB,IACtBD,sBAASC,EAAT,KAAgB,SADM,IAEtBD,sBAASC,EAAT,KAAgB,KAVI;A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AEjD,MAAM,CAAC8C,MAD1B;AAEEI,MAAAA,eAAe,EAAEd,wBAAWY;AAF9B,KANN,CALW,EAeXjE,WAfW,CAdf;AA+BE,IAAA,YAAY,EAAE;AAAE4D,MAAAA,eAAe,EAAEtD;AAAnB,KA/BhB;AAgCE,IAAA,mBAAmB,EAAEiC,mBAhCvB;AAiCE,IAAA,kBAAkB,EAAEC,kBAjCtB;AAkCE,IAAA,UAAU,EAAExB;AAlCd,IADF,CADF;AAwCD;;AAEc,SAASoD,UAAT,CAAoB;AAAE3F,EAAAA,UAAF;AAAc,KAAG4F;AAAjB,CAApB,EAAoD;AACjE,sBACE,oBAAC,gCAAD,qBACE,oBAAC,qBAAD;AAAuB,IAAA,KAAK,EAAE5B,MAAM,CAACC;AAArC,kBACE,oBAAC,cAAD;AAAgB,IAAA,UAAU,EAAEjE;AAA5B,KAA4C4F,IAA5C,EADF,CADF,CADF;AAOD;;AAED,MAAM5B,MAAM,GAAGY,wBAAWiB,MAAX,CAAkB;AAC/B5B,EAAAA,OAAO,EAAE;AACP6B,IAAAA,IAAI,EAAE;AADC;AADsB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n Header,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport {\n DrawerActions,\n DrawerNavigationState,\n DrawerStatus,\n ParamListBase,\n useTheme,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n BackHandler,\n I18nManager,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport { useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type {\n DrawerContentComponentProps,\n DrawerDescriptorMap,\n DrawerHeaderProps,\n DrawerNavigationConfig,\n DrawerNavigationHelpers,\n DrawerNavigationProp,\n DrawerProps,\n} from '../types';\nimport DrawerPositionContext from '../utils/DrawerPositionContext';\nimport DrawerStatusContext from '../utils/DrawerStatusContext';\nimport getDrawerStatusFromState from '../utils/getDrawerStatusFromState';\nimport DrawerContent from './DrawerContent';\nimport DrawerToggleButton from './DrawerToggleButton';\nimport { GestureHandlerRootView } from './GestureHandler';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = DrawerNavigationConfig & {\n defaultStatus: DrawerStatus;\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\nconst getDefaultDrawerWidth = ({\n height,\n width,\n}: {\n height: number;\n width: number;\n}) => {\n /*\n * Default drawer width is screen width - header height\n * with a max width of 280 on mobile and 320 on tablet\n * https://material.io/components/navigation-drawer\n */\n const smallerAxisSize = Math.min(height, width);\n const isLandscape = width > height;\n const isTablet = smallerAxisSize >= 600;\n const appBarHeight = Platform.OS === 'ios' ? (isLandscape ? 32 : 44) : 56;\n const maxWidth = isTablet ? 320 : 280;\n\n return Math.min(smallerAxisSize - appBarHeight, maxWidth);\n};\n\nconst GestureHandlerWrapper = GestureHandlerRootView ?? View;\n\nfunction DrawerViewBase({\n state,\n navigation,\n descriptors,\n defaultStatus,\n drawerContent = (props: DrawerContentComponentProps) => (\n <DrawerContent {...props} />\n ),\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n // Running in chrome debugger\n // @ts-expect-error\n useLegacyImplementation = !global.nativeCallSyncHook ||\n // Reanimated 2 is not configured\n // @ts-expect-error: the type definitions are incomplete\n !Animated.isConfigured?.(),\n}: Props) {\n const Drawer: React.ComponentType<DrawerProps> = useLegacyImplementation\n ? require('./legacy/Drawer').default\n : require('./modern/Drawer').default;\n\n const focusedRouteKey = state.routes[state.index].key;\n const {\n drawerHideStatusBarOnOpen = false,\n drawerPosition = I18nManager.isRTL ? 'right' : 'left',\n drawerStatusBarAnimation = 'slide',\n drawerStyle,\n drawerType = Platform.select({ ios: 'slide', default: 'front' }),\n gestureHandlerProps,\n keyboardDismissMode = 'on-drag',\n overlayColor = 'rgba(0, 0, 0, 0.5)',\n swipeEdgeWidth = 32,\n swipeEnabled = Platform.OS !== 'web' &&\n Platform.OS !== 'windows' &&\n Platform.OS !== 'macos',\n swipeMinDistance = 60,\n } = descriptors[focusedRouteKey].options;\n\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = useSafeAreaFrame();\n\n const { colors } = useTheme();\n\n const drawerStatus = getDrawerStatusFromState(state);\n\n const handleDrawerOpen = React.useCallback(() => {\n navigation.dispatch({\n ...DrawerActions.openDrawer(),\n target: state.key,\n });\n }, [navigation, state.key]);\n\n const handleDrawerClose = React.useCallback(() => {\n navigation.dispatch({\n ...DrawerActions.closeDrawer(),\n target: state.key,\n });\n }, [navigation, state.key]);\n\n React.useEffect(() => {\n if (drawerStatus === defaultStatus || drawerType === 'permanent') {\n return;\n }\n\n const handleHardwareBack = () => {\n // We shouldn't handle the back button if the parent screen isn't focused\n // This will avoid the drawer overriding event listeners from a focused screen\n if (!navigation.isFocused()) {\n return false;\n }\n\n if (defaultStatus === 'open') {\n handleDrawerOpen();\n } else {\n handleDrawerClose();\n }\n\n return true;\n };\n\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n handleHardwareBack();\n }\n };\n\n // We only add the listeners when drawer opens\n // This way we can make sure that the listener is added as late as possible\n // This will make sure that our handler will run first when back button is pressed\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n handleHardwareBack\n );\n\n if (Platform.OS === 'web') {\n document?.body?.addEventListener?.('keyup', handleEscape);\n }\n\n return () => {\n subscription.remove();\n\n if (Platform.OS === 'web') {\n document?.body?.removeEventListener?.('keyup', handleEscape);\n }\n };\n }, [\n defaultStatus,\n drawerStatus,\n drawerType,\n handleDrawerClose,\n handleDrawerOpen,\n navigation,\n ]);\n\n const renderDrawerContent = () => {\n return (\n <DrawerPositionContext.Provider value={drawerPosition}>\n {drawerContent({\n state: state,\n navigation: navigation,\n descriptors: descriptors,\n })}\n </DrawerPositionContext.Provider>\n );\n };\n\n const renderSceneContent = () => {\n return (\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n style={styles.content}\n >\n {state.routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n header = ({ layout, options }: DrawerHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n headerLeft={\n options.headerLeft ??\n ((props) => <DrawerToggleButton {...props} />)\n }\n />\n ),\n sceneContainerStyle,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n >\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={descriptor.options.headerShown}\n headerTransparent={descriptor.options.headerTransparent}\n headerStatusBarHeight={descriptor.options.headerStatusBarHeight}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as DrawerNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n );\n };\n\n return (\n <DrawerStatusContext.Provider value={drawerStatus}>\n <Drawer\n open={drawerStatus !== 'closed'}\n onOpen={handleDrawerOpen}\n onClose={handleDrawerClose}\n gestureHandlerProps={gestureHandlerProps}\n swipeEnabled={swipeEnabled}\n swipeEdgeWidth={swipeEdgeWidth}\n swipeVelocityThreshold={500}\n swipeDistanceThreshold={swipeMinDistance}\n hideStatusBarOnOpen={drawerHideStatusBarOnOpen}\n statusBarAnimation={drawerStatusBarAnimation}\n keyboardDismissMode={keyboardDismissMode}\n drawerType={drawerType}\n drawerPosition={drawerPosition}\n drawerStyle={[\n {\n width: getDefaultDrawerWidth(dimensions),\n backgroundColor: colors.card,\n },\n drawerType === 'permanent' &&\n (drawerPosition === 'left'\n ? {\n borderRightColor: colors.border,\n borderRightWidth: StyleSheet.hairlineWidth,\n }\n : {\n borderLeftColor: colors.border,\n borderLeftWidth: StyleSheet.hairlineWidth,\n }),\n drawerStyle,\n ]}\n overlayStyle={{ backgroundColor: overlayColor }}\n renderDrawerContent={renderDrawerContent}\n renderSceneContent={renderSceneContent}\n dimensions={dimensions}\n />\n </DrawerStatusContext.Provider>\n );\n}\n\nexport default function DrawerView({ navigation, ...rest }: Props) {\n return (\n <SafeAreaProviderCompat>\n <GestureHandlerWrapper style={styles.content}>\n <DrawerViewBase navigation={navigation} {...rest} />\n </GestureHandlerWrapper>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["DrawerView.tsx"],"names":["getDefaultDrawerWidth","height","width","smallerAxisSize","Math","min","isLandscape","isTablet","appBarHeight","Platform","OS","maxWidth","GestureHandlerWrapper","GestureHandlerRootView","View","DrawerViewBase","state","navigation","descriptors","defaultStatus","drawerContent","props","detachInactiveScreens","useLegacyImplementation","global","nativeCallSyncHook","Animated","isConfigured","Drawer","require","default","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","I18nManager","isRTL","drawerStatusBarAnimation","drawerStyle","drawerType","select","ios","gestureHandlerProps","keyboardDismissMode","overlayColor","swipeEdgeWidth","swipeEnabled","swipeMinDistance","options","loaded","setLoaded","React","useState","includes","dimensions","colors","drawerStatus","handleDrawerOpen","useCallback","dispatch","DrawerActions","openDrawer","target","handleDrawerClose","closeDrawer","useEffect","handleHardwareBack","isFocused","handleEscape","e","subscription","BackHandler","addEventListener","document","body","remove","removeEventListener","renderDrawerContent","renderSceneContent","styles","content","map","route","descriptor","lazy","unmountOnBlur","header","layout","name","headerLeft","sceneContainerStyle","StyleSheet","absoluteFill","zIndex","headerShown","headerTransparent","headerStatusBarHeight","render","backgroundColor","card","borderRightColor","border","borderRightWidth","hairlineWidth","borderLeftColor","borderLeftWidth","DrawerView","rest","create","flex"],"mappings":";;;;;;;AAAA;;AAMA;;AAOA;;AACA;;AAOA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AASA,MAAMA,qBAAqB,GAAG,QAMxB;AAAA,MANyB;AAC7BC,IAAAA,MAD6B;AAE7BC,IAAAA;AAF6B,GAMzB;;AACJ;AACF;AACA;AACA;AACA;AACE,QAAMC,eAAe,GAAGC,IAAI,CAACC,GAAL,CAASJ,MAAT,EAAiBC,KAAjB,CAAxB;AACA,QAAMI,WAAW,GAAGJ,KAAK,GAAGD,MAA5B;AACA,QAAMM,QAAQ,GAAGJ,eAAe,IAAI,GAApC;AACA,QAAMK,YAAY,GAAGC,sBAASC,EAAT,KAAgB,KAAhB,GAAyBJ,WAAW,GAAG,EAAH,GAAQ,EAA5C,GAAkD,EAAvE;AACA,QAAMK,QAAQ,GAAGJ,QAAQ,GAAG,GAAH,GAAS,GAAlC;AAEA,SAAOH,IAAI,CAACC,GAAL,CAASF,eAAe,GAAGK,YAA3B,EAAyCG,QAAzC,CAAP;AACD,CAnBD;;AAqBA,MAAMC,qBAAqB,GAAGC,sCAAH,aAAGA,sCAAH,cAAGA,sCAAH,GAA6BC,iBAAxD;;AAEA,SAASC,cAAT,QAiBU;AAAA;;AAAA,MAjBc;AACtBC,IAAAA,KADsB;AAEtBC,IAAAA,UAFsB;AAGtBC,IAAAA,WAHsB;AAItBC,IAAAA,aAJsB;AAKtBC,IAAAA,aAAa,GAAIC,KAAD,iBACd,oBAAC,sBAAD,EAAmBA,KAAnB,CANoB;AAQtBC,IAAAA,qBAAqB,GAAGb,sBAASC,EAAT,KAAgB,KAAhB,IACtBD,sBAASC,EAAT,KAAgB,SADM,IAEt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A,eAAe,EAAEjD,MAAM,CAAC8C,MAD1B;AAEEI,MAAAA,eAAe,EAAEd,wBAAWY;AAF9B,KANN,CALW,EAeXjE,WAfW,CAdf;AA+BE,IAAA,YAAY,EAAE;AAAE4D,MAAAA,eAAe,EAAEtD;AAAnB,KA/BhB;AAgCE,IAAA,mBAAmB,EAAEiC,mBAhCvB;AAiCE,IAAA,kBAAkB,EAAEC,kBAjCtB;AAkCE,IAAA,UAAU,EAAExB;AAlCd,IADF,CADF;AAwCD;;AAEc,SAASoD,UAAT,QAAoD;AAAA,MAAhC;AAAE3F,IAAAA,UAAF;AAAc,OAAG4F;AAAjB,GAAgC;AACjE,sBACE,oBAAC,gCAAD,qBACE,oBAAC,qBAAD;AAAuB,IAAA,KAAK,EAAE5B,MAAM,CAACC;AAArC,kBACE,oBAAC,cAAD;AAAgB,IAAA,UAAU,EAAEjE;AAA5B,KAA4C4F,IAA5C,EADF,CADF,CADF;AAOD;;AAED,MAAM5B,MAAM,GAAGY,wBAAWiB,MAAX,CAAkB;AAC/B5B,EAAAA,OAAO,EAAE;AACP6B,IAAAA,IAAI,EAAE;AADC;AADsB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n Header,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport {\n DrawerActions,\n DrawerNavigationState,\n DrawerStatus,\n ParamListBase,\n useTheme,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n BackHandler,\n I18nManager,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\nimport Animated from 'react-native-reanimated';\nimport { useSafeAreaFrame } from 'react-native-safe-area-context';\n\nimport type {\n DrawerContentComponentProps,\n DrawerDescriptorMap,\n DrawerHeaderProps,\n DrawerNavigationConfig,\n DrawerNavigationHelpers,\n DrawerNavigationProp,\n DrawerProps,\n} from '../types';\nimport DrawerPositionContext from '../utils/DrawerPositionContext';\nimport DrawerStatusContext from '../utils/DrawerStatusContext';\nimport getDrawerStatusFromState from '../utils/getDrawerStatusFromState';\nimport DrawerContent from './DrawerContent';\nimport DrawerToggleButton from './DrawerToggleButton';\nimport { GestureHandlerRootView } from './GestureHandler';\nimport { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';\n\ntype Props = DrawerNavigationConfig & {\n defaultStatus: DrawerStatus;\n state: DrawerNavigationState<ParamListBase>;\n navigation: DrawerNavigationHelpers;\n descriptors: DrawerDescriptorMap;\n};\n\nconst getDefaultDrawerWidth = ({\n height,\n width,\n}: {\n height: number;\n width: number;\n}) => {\n /*\n * Default drawer width is screen width - header height\n * with a max width of 280 on mobile and 320 on tablet\n * https://material.io/components/navigation-drawer\n */\n const smallerAxisSize = Math.min(height, width);\n const isLandscape = width > height;\n const isTablet = smallerAxisSize >= 600;\n const appBarHeight = Platform.OS === 'ios' ? (isLandscape ? 32 : 44) : 56;\n const maxWidth = isTablet ? 320 : 280;\n\n return Math.min(smallerAxisSize - appBarHeight, maxWidth);\n};\n\nconst GestureHandlerWrapper = GestureHandlerRootView ?? View;\n\nfunction DrawerViewBase({\n state,\n navigation,\n descriptors,\n defaultStatus,\n drawerContent = (props: DrawerContentComponentProps) => (\n <DrawerContent {...props} />\n ),\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n // Running in chrome debugger\n // @ts-expect-error\n useLegacyImplementation = !global.nativeCallSyncHook ||\n // Reanimated 2 is not configured\n // @ts-expect-error: the type definitions are incomplete\n !Animated.isConfigured?.(),\n}: Props) {\n const Drawer: React.ComponentType<DrawerProps> = useLegacyImplementation\n ? require('./legacy/Drawer').default\n : require('./modern/Drawer').default;\n\n const focusedRouteKey = state.routes[state.index].key;\n const {\n drawerHideStatusBarOnOpen = false,\n drawerPosition = I18nManager.isRTL ? 'right' : 'left',\n drawerStatusBarAnimation = 'slide',\n drawerStyle,\n drawerType = Platform.select({ ios: 'slide', default: 'front' }),\n gestureHandlerProps,\n keyboardDismissMode = 'on-drag',\n overlayColor = 'rgba(0, 0, 0, 0.5)',\n swipeEdgeWidth = 32,\n swipeEnabled = Platform.OS !== 'web' &&\n Platform.OS !== 'windows' &&\n Platform.OS !== 'macos',\n swipeMinDistance = 60,\n } = descriptors[focusedRouteKey].options;\n\n const [loaded, setLoaded] = React.useState([focusedRouteKey]);\n\n if (!loaded.includes(focusedRouteKey)) {\n setLoaded([...loaded, focusedRouteKey]);\n }\n\n const dimensions = useSafeAreaFrame();\n\n const { colors } = useTheme();\n\n const drawerStatus = getDrawerStatusFromState(state);\n\n const handleDrawerOpen = React.useCallback(() => {\n navigation.dispatch({\n ...DrawerActions.openDrawer(),\n target: state.key,\n });\n }, [navigation, state.key]);\n\n const handleDrawerClose = React.useCallback(() => {\n navigation.dispatch({\n ...DrawerActions.closeDrawer(),\n target: state.key,\n });\n }, [navigation, state.key]);\n\n React.useEffect(() => {\n if (drawerStatus === defaultStatus || drawerType === 'permanent') {\n return;\n }\n\n const handleHardwareBack = () => {\n // We shouldn't handle the back button if the parent screen isn't focused\n // This will avoid the drawer overriding event listeners from a focused screen\n if (!navigation.isFocused()) {\n return false;\n }\n\n if (defaultStatus === 'open') {\n handleDrawerOpen();\n } else {\n handleDrawerClose();\n }\n\n return true;\n };\n\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n handleHardwareBack();\n }\n };\n\n // We only add the listeners when drawer opens\n // This way we can make sure that the listener is added as late as possible\n // This will make sure that our handler will run first when back button is pressed\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n handleHardwareBack\n );\n\n if (Platform.OS === 'web') {\n document?.body?.addEventListener?.('keyup', handleEscape);\n }\n\n return () => {\n subscription.remove();\n\n if (Platform.OS === 'web') {\n document?.body?.removeEventListener?.('keyup', handleEscape);\n }\n };\n }, [\n defaultStatus,\n drawerStatus,\n drawerType,\n handleDrawerClose,\n handleDrawerOpen,\n navigation,\n ]);\n\n const renderDrawerContent = () => {\n return (\n <DrawerPositionContext.Provider value={drawerPosition}>\n {drawerContent({\n state: state,\n navigation: navigation,\n descriptors: descriptors,\n })}\n </DrawerPositionContext.Provider>\n );\n };\n\n const renderSceneContent = () => {\n return (\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n style={styles.content}\n >\n {state.routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const { lazy = true, unmountOnBlur } = descriptor.options;\n const isFocused = state.index === index;\n\n if (unmountOnBlur && !isFocused) {\n return null;\n }\n\n if (lazy && !loaded.includes(route.key) && !isFocused) {\n // Don't render a lazy screen if we've never navigated to it\n return null;\n }\n\n const {\n header = ({ layout, options }: DrawerHeaderProps) => (\n <Header\n {...options}\n layout={layout}\n title={getHeaderTitle(options, route.name)}\n headerLeft={\n options.headerLeft ??\n ((props) => <DrawerToggleButton {...props} />)\n }\n />\n ),\n sceneContainerStyle,\n } = descriptor.options;\n\n return (\n <MaybeScreen\n key={route.key}\n style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}\n visible={isFocused}\n enabled={detachInactiveScreens}\n >\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={descriptor.options.headerShown}\n headerTransparent={descriptor.options.headerTransparent}\n headerStatusBarHeight={descriptor.options.headerStatusBarHeight}\n header={header({\n layout: dimensions,\n route: descriptor.route,\n navigation:\n descriptor.navigation as DrawerNavigationProp<ParamListBase>,\n options: descriptor.options,\n })}\n style={sceneContainerStyle}\n >\n {descriptor.render()}\n </Screen>\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n );\n };\n\n return (\n <DrawerStatusContext.Provider value={drawerStatus}>\n <Drawer\n open={drawerStatus !== 'closed'}\n onOpen={handleDrawerOpen}\n onClose={handleDrawerClose}\n gestureHandlerProps={gestureHandlerProps}\n swipeEnabled={swipeEnabled}\n swipeEdgeWidth={swipeEdgeWidth}\n swipeVelocityThreshold={500}\n swipeDistanceThreshold={swipeMinDistance}\n hideStatusBarOnOpen={drawerHideStatusBarOnOpen}\n statusBarAnimation={drawerStatusBarAnimation}\n keyboardDismissMode={keyboardDismissMode}\n drawerType={drawerType}\n drawerPosition={drawerPosition}\n drawerStyle={[\n {\n width: getDefaultDrawerWidth(dimensions),\n backgroundColor: colors.card,\n },\n drawerType === 'permanent' &&\n (drawerPosition === 'left'\n ? {\n borderRightColor: colors.border,\n borderRightWidth: StyleSheet.hairlineWidth,\n }\n : {\n borderLeftColor: colors.border,\n borderLeftWidth: StyleSheet.hairlineWidth,\n }),\n drawerStyle,\n ]}\n overlayStyle={{ backgroundColor: overlayColor }}\n renderDrawerContent={renderDrawerContent}\n renderSceneContent={renderSceneContent}\n dimensions={dimensions}\n />\n </DrawerStatusContext.Provider>\n );\n}\n\nexport default function DrawerView({ navigation, ...rest }: Props) {\n return (\n <SafeAreaProviderCompat>\n <GestureHandlerWrapper style={styles.content}>\n <DrawerViewBase navigation={navigation} {...rest} />\n </GestureHandlerWrapper>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n },\n});\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.TapGestureHandler = exports.PanGestureHandler = exports.GestureState = exports.GestureHandlerRootView = void 0;
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -13,9 +13,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
|
|
16
|
-
const Dummy =
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const Dummy = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
const PanGestureHandler = Dummy;
|
|
21
24
|
exports.PanGestureHandler = PanGestureHandler;
|