@react-navigation/drawer 6.5.4 → 6.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +0 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +0 -15
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/DrawerGestureContext.js +0 -5
- package/lib/commonjs/utils/DrawerGestureContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +0 -5
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerProgressContext.js +0 -5
- package/lib/commonjs/utils/DrawerProgressContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +0 -4
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -5
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerProgress.js +0 -8
- package/lib/commonjs/utils/useDrawerProgress.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +0 -8
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +0 -8
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +0 -12
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +8 -21
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +2 -11
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +0 -9
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +9 -52
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.android.js +0 -2
- package/lib/commonjs/views/GestureHandler.android.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.ios.js +0 -2
- package/lib/commonjs/views/GestureHandler.ios.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.js +0 -6
- package/lib/commonjs/views/GestureHandler.js.map +1 -1
- package/lib/commonjs/views/GestureHandlerNative.js +0 -7
- package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +2 -18
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/commonjs/views/legacy/Drawer.js +62 -105
- package/lib/commonjs/views/legacy/Drawer.js.map +1 -1
- package/lib/commonjs/views/legacy/Overlay.js +3 -13
- package/lib/commonjs/views/legacy/Overlay.js.map +1 -1
- package/lib/commonjs/views/modern/Drawer.js +20 -41
- package/lib/commonjs/views/modern/Drawer.js.map +1 -1
- package/lib/commonjs/views/modern/Overlay.js +4 -12
- package/lib/commonjs/views/modern/Overlay.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +0 -7
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/DrawerGestureContext.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerProgressContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js +1 -4
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerProgress.js +0 -2
- package/lib/module/utils/useDrawerProgress.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js +1 -3
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +0 -1
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +0 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +8 -10
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +2 -5
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +0 -1
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +9 -35
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/module/views/GestureHandler.android.js.map +1 -1
- package/lib/module/views/GestureHandler.ios.js.map +1 -1
- package/lib/module/views/GestureHandler.js +0 -2
- package/lib/module/views/GestureHandler.js.map +1 -1
- package/lib/module/views/GestureHandlerNative.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +2 -10
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/module/views/legacy/Drawer.js +62 -90
- package/lib/module/views/legacy/Drawer.js.map +1 -1
- package/lib/module/views/legacy/Overlay.js +3 -3
- package/lib/module/views/legacy/Overlay.js.map +1 -1
- package/lib/module/views/modern/Drawer.js +20 -27
- package/lib/module/views/modern/Drawer.js.map +1 -1
- package/lib/module/views/modern/Overlay.js +4 -3
- package/lib/module/views/modern/Overlay.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +1 -0
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts +1 -0
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -0
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts +1 -0
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -0
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -0
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -0
- package/lib/typescript/src/utils/useDrawerProgress.d.ts +1 -0
- package/lib/typescript/src/utils/useDrawerProgress.d.ts.map +1 -0
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -0
- package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -0
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -0
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerItem.d.ts +1 -0
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerItemList.d.ts +1 -0
- package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +1 -0
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -0
- package/lib/typescript/src/views/DrawerView.d.ts +1 -0
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.android.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -0
- package/lib/typescript/src/views/ScreenFallback.d.ts +1 -0
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -0
- package/lib/typescript/src/views/legacy/Drawer.d.ts +1 -0
- package/lib/typescript/src/views/legacy/Drawer.d.ts.map +1 -0
- package/lib/typescript/src/views/legacy/Overlay.d.ts +1 -0
- package/lib/typescript/src/views/legacy/Overlay.d.ts.map +1 -0
- package/lib/typescript/src/views/modern/Drawer.d.ts +1 -0
- package/lib/typescript/src/views/modern/Drawer.d.ts.map +1 -0
- package/lib/typescript/src/views/modern/Overlay.d.ts +1 -0
- package/lib/typescript/src/views/modern/Overlay.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/views/modern/Overlay.tsx +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DrawerContentScrollView","DrawerItemList","DrawerContent","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle"],"
|
|
1
|
+
{"version":3,"names":["React","DrawerContentScrollView","DrawerItemList","DrawerContent","descriptors","state","rest","focusedRoute","routes","index","focusedDescriptor","key","focusedOptions","options","drawerContentStyle","drawerContentContainerStyle"],"sourceRoot":"../../src","sources":["DrawerContent.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAOC,uBAAuB,MAAM,2BAA2B;AAC/D,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,eAAe,SAASC,aAAa,OAIL;EAAA,IAJM;IACpCC,WAAW;IACXC,KAAK;IACL,GAAGC;EACwB,CAAC;EAC5B,MAAMC,YAAY,GAAGF,KAAK,CAACG,MAAM,CAACH,KAAK,CAACI,KAAK,CAAC;EAC9C,MAAMC,iBAAiB,GAAGN,WAAW,CAACG,YAAY,CAACI,GAAG,CAAC;EACvD,MAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAO;EAEhD,MAAM;IAAEC,kBAAkB;IAAEC;EAA4B,CAAC,GAAGH,cAAc;EAE1E,oBACE,oBAAC,uBAAuB,eAClBN,IAAI;IACR,qBAAqB,EAAES,2BAA4B;IACnD,KAAK,EAAED;EAAmB,iBAE1B,oBAAC,cAAc;IAAC,WAAW,EAAEV,WAAY;IAAC,KAAK,EAAEC;EAAM,GAAKC,IAAI,EAAI,CAC5C;AAE9B"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import { I18nManager, ScrollView, StyleSheet } from 'react-native';
|
|
5
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
5
|
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
7
|
-
|
|
8
6
|
function DrawerContentScrollView(_ref, ref) {
|
|
9
7
|
let {
|
|
10
8
|
contentContainerStyle,
|
|
@@ -25,7 +23,6 @@ function DrawerContentScrollView(_ref, ref) {
|
|
|
25
23
|
style: [styles.container, style]
|
|
26
24
|
}), children);
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
export default /*#__PURE__*/React.forwardRef(DrawerContentScrollView);
|
|
30
27
|
const styles = StyleSheet.create({
|
|
31
28
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","I18nManager","ScrollView","StyleSheet","useSafeAreaInsets","DrawerPositionContext","DrawerContentScrollView","ref","contentContainerStyle","style","children","rest","drawerPosition","useContext","insets","isRight","getConstants","isRTL","paddingTop","top","paddingStart","left","paddingEnd","right","styles","container","forwardRef","create","flex"],"
|
|
1
|
+
{"version":3,"names":["React","I18nManager","ScrollView","StyleSheet","useSafeAreaInsets","DrawerPositionContext","DrawerContentScrollView","ref","contentContainerStyle","style","children","rest","drawerPosition","useContext","insets","isRight","getConstants","isRTL","paddingTop","top","paddingStart","left","paddingEnd","right","styles","container","forwardRef","create","flex"],"sourceRoot":"../../src","sources":["DrawerContentScrollView.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,WAAW,EACXC,UAAU,EAEVC,UAAU,QACL,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,qBAAqB,MAAM,gCAAgC;AAMlE,SAASC,uBAAuB,OAE9BC,GAA2B,EAC3B;EAAA,IAFA;IAAEC,qBAAqB;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;EAAY,CAAC;EAG1D,MAAMC,cAAc,GAAGZ,KAAK,CAACa,UAAU,CAACR,qBAAqB,CAAC;EAC9D,MAAMS,MAAM,GAAGV,iBAAiB,EAAE;EAElC,MAAMW,OAAO,GAAGd,WAAW,CAACe,YAAY,EAAE,CAACC,KAAK,GAC5CL,cAAc,KAAK,MAAM,GACzBA,cAAc,KAAK,OAAO;EAE9B,oBACE,oBAAC,UAAU,eACLD,IAAI;IACR,GAAG,EAAEJ,GAAI;IACT,qBAAqB,EAAE,CACrB;MACEW,UAAU,EAAEJ,MAAM,CAACK,GAAG,GAAG,CAAC;MAC1BC,YAAY,EAAE,CAACL,OAAO,GAAGD,MAAM,CAACO,IAAI,GAAG,CAAC;MACxCC,UAAU,EAAEP,OAAO,GAAGD,MAAM,CAACS,KAAK,GAAG;IACvC,CAAC,EACDf,qBAAqB,CACrB;IACF,KAAK,EAAE,CAACgB,MAAM,CAACC,SAAS,EAAEhB,KAAK;EAAE,IAEhCC,QAAQ,CACE;AAEjB;AAEA,4BAAeV,KAAK,CAAC0B,UAAU,CAACpB,uBAAuB,CAAC;AAExD,MAAMkB,MAAM,GAAGrB,UAAU,CAACwB,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
2
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
4
3
|
import { Link, useTheme } from '@react-navigation/native';
|
|
5
4
|
import Color from 'color';
|
|
6
5
|
import * as React from 'react';
|
|
7
6
|
import { Platform, StyleSheet, Text, View } from 'react-native';
|
|
8
|
-
|
|
9
7
|
const LinkPressable = _ref => {
|
|
10
8
|
let {
|
|
11
9
|
children,
|
|
@@ -18,7 +16,6 @@ const LinkPressable = _ref => {
|
|
|
18
16
|
accessibilityRole,
|
|
19
17
|
...rest
|
|
20
18
|
} = _ref;
|
|
21
|
-
|
|
22
19
|
if (Platform.OS === 'web' && to) {
|
|
23
20
|
// React Native Web doesn't forward `onClick` if we use `TouchableWithoutFeedback`.
|
|
24
21
|
// We need to use `onClick` to be able to prevent default browser handling of links.
|
|
@@ -26,18 +23,20 @@ const LinkPressable = _ref => {
|
|
|
26
23
|
to: to,
|
|
27
24
|
style: [styles.button, style],
|
|
28
25
|
onPress: e => {
|
|
29
|
-
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
|
|
26
|
+
if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && (
|
|
27
|
+
// ignore clicks with modifier keys
|
|
30
28
|
e.button == null || e.button === 0) // ignore everything but left clicks
|
|
31
29
|
) {
|
|
32
30
|
e.preventDefault();
|
|
33
31
|
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
34
32
|
}
|
|
35
|
-
}
|
|
33
|
+
}
|
|
34
|
+
// types for PressableProps and TextProps are incompatible with each other by `null` so we
|
|
36
35
|
// can't use {...rest} for these 3 props
|
|
37
36
|
,
|
|
38
|
-
onLongPress: onLongPress
|
|
39
|
-
onPressIn: onPressIn
|
|
40
|
-
onPressOut: onPressOut
|
|
37
|
+
onLongPress: onLongPress ?? undefined,
|
|
38
|
+
onPressIn: onPressIn ?? undefined,
|
|
39
|
+
onPressOut: onPressOut ?? undefined
|
|
41
40
|
}), children);
|
|
42
41
|
} else {
|
|
43
42
|
return /*#__PURE__*/React.createElement(PlatformPressable, _extends({}, rest, {
|
|
@@ -48,11 +47,10 @@ const LinkPressable = _ref => {
|
|
|
48
47
|
}, children));
|
|
49
48
|
}
|
|
50
49
|
};
|
|
50
|
+
|
|
51
51
|
/**
|
|
52
52
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
53
53
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
54
|
export default function DrawerItem(props) {
|
|
57
55
|
const {
|
|
58
56
|
colors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PlatformPressable","Link","useTheme","Color","React","Platform","StyleSheet","Text","View","LinkPressable","children","style","onPress","onLongPress","onPressIn","onPressOut","to","accessibilityRole","rest","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","flatten","color","backgroundColor","iconNode","size","container","wrapper","selected","marginLeft","marginVertical","fontWeight","create","marginHorizontal","overflow","flexDirection","alignItems","padding","marginRight","flex","display"],"sources":["DrawerItem.tsx"],"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 onPressIn,\n onPressOut,\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 // types for PressableProps and TextProps are incompatible with each other by `null` so we\n // can't use {...rest} for these 3 props\n onLongPress={onLongPress ?? undefined}\n onPressIn={onPressIn ?? undefined}\n onPressOut={onPressOut ?? 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"],"mappings":";;AAAA,SAASA,iBAAT,QAAkC,4BAAlC;AACA,SAASC,IAAT,EAAeC,QAAf,QAA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lB,CAAf"}
|
|
1
|
+
{"version":3,"names":["PlatformPressable","Link","useTheme","Color","React","Platform","StyleSheet","Text","View","LinkPressable","children","style","onPress","onLongPress","onPressIn","onPressOut","to","accessibilityRole","rest","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","flatten","color","backgroundColor","iconNode","size","container","wrapper","selected","marginLeft","marginVertical","fontWeight","create","marginHorizontal","overflow","flexDirection","alignItems","padding","marginRight","flex","display"],"sourceRoot":"../../src","sources":["DrawerItem.tsx"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,IAAI,EAAEC,QAAQ,QAAQ,0BAA0B;AACzD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EAERC,UAAU,EACVC,IAAI,EAEJC,IAAI,QAEC,cAAc;AAyErB,MAAMC,aAAa,GAAG,QAgBhB;EAAA,IAhBiB;IACrBC,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,SAAS;IACTC,UAAU;IACVC,EAAE;IACFC,iBAAiB;IACjB,GAAGC;EAOL,CAAC;EACC,IAAIb,QAAQ,CAACc,EAAE,KAAK,KAAK,IAAIH,EAAE,EAAE;IAC/B;IACA;IACA,oBACE,oBAAC,IAAI,eACCE,IAAI;MACR,EAAE,EAAEF,EAAG;MACP,KAAK,EAAE,CAACI,MAAM,CAACC,MAAM,EAAEV,KAAK,CAAE;MAC9B,OAAO,EAAGW,CAAM,IAAK;QACnB,IACE,EAAEA,CAAC,CAACC,OAAO,IAAID,CAAC,CAACE,MAAM,IAAIF,CAAC,CAACG,OAAO,IAAIH,CAAC,CAACI,QAAQ,CAAC;QAAI;QACtDJ,CAAC,CAACD,M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AEX;AAEA,MAAMf,MAAM,GAAGd,UAAU,CAACsD,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,gBAAgB,EAAE,EAAE;IACpBH,cAAc,EAAE,CAAC;IACjBI,QAAQ,EAAE;EACZ,CAAC;EACDP,OAAO,EAAE;IACPQ,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE;EACX,CAAC;EACDhC,KAAK,EAAE;IACLiC,WAAW,EAAE,EAAE;IACfC,IAAI,EAAE;EACR,CAAC;EACD9C,MAAM,EAAE;IACN+C,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CommonActions, DrawerActions, useLinkBuilder } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import DrawerItem from './DrawerItem';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Component that renders the navigation list in the drawer.
|
|
7
6
|
*/
|
|
@@ -23,16 +22,15 @@ export default function DrawerItemList(_ref) {
|
|
|
23
22
|
} = focusedOptions;
|
|
24
23
|
return state.routes.map((route, i) => {
|
|
25
24
|
const focused = i === state.index;
|
|
26
|
-
|
|
27
25
|
const onPress = () => {
|
|
28
26
|
const event = navigation.emit({
|
|
29
27
|
type: 'drawerItemPress',
|
|
30
28
|
target: route.key,
|
|
31
29
|
canPreventDefault: true
|
|
32
30
|
});
|
|
33
|
-
|
|
34
31
|
if (!event.defaultPrevented) {
|
|
35
|
-
navigation.dispatch({
|
|
32
|
+
navigation.dispatch({
|
|
33
|
+
...(focused ? DrawerActions.closeDrawer() : CommonActions.navigate({
|
|
36
34
|
name: route.name,
|
|
37
35
|
merge: true
|
|
38
36
|
})),
|
|
@@ -40,7 +38,6 @@ export default function DrawerItemList(_ref) {
|
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
};
|
|
43
|
-
|
|
44
41
|
const {
|
|
45
42
|
title,
|
|
46
43
|
drawerLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommonActions","DrawerActions","useLinkBuilder","React","DrawerItem","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","closeDrawer","navigate","name","merge","title","drawerLabel","drawerIcon","drawerLabelStyle","drawerItemStyle","drawerAllowFontScaling","undefined","params"],"
|
|
1
|
+
{"version":3,"names":["CommonActions","DrawerActions","useLinkBuilder","React","DrawerItem","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","closeDrawer","navigate","name","merge","title","drawerLabel","drawerIcon","drawerLabelStyle","drawerItemStyle","drawerAllowFontScaling","undefined","params"],"sourceRoot":"../../src","sources":["DrawerItemList.tsx"],"mappings":"AAAA,SACEA,aAAa,EACbC,aAAa,EAGbC,cAAc,QACT,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAG9B,OAAOC,UAAU,MAAM,cAAc;AAQrC;AACA;AACA;AACA,eAAe,SAASC,cAAc,OAI5B;EAAA,IAJ6B;IACrCC,KAAK;IACLC,UAAU;IACVC;EACK,CAAC;EACN,MAAMC,SAAS,GAAGP,cAAc,EAAE;EAElC,MAAMQ,YAAY,GAAGJ,KAAK,CAACK,MAAM,CAACL,KAAK,CAACM,KAAK,CAAC;EAC9C,MAAMC,iBAAiB,GAAGL,WAAW,CAACE,YAAY,CAACI,GAAG,CAAC;EACvD,MAAMC,cAAc,GAAGF,iBAAiB,CAACG,OAAO;EAEhD,MAAM;IACJC,qBAAqB;IACrBC,uBAAuB;IACvBC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,EAAEF,gBAAiB;MAC7B,KAAK,EAAEC,eAAgB;MACvB,EAAE,EAAEhC,SAAS,CAACa,KAAK,CAACa,IAAI,EAAEb,KAAK,CAACsB,MAAM,CAAE;MACxC,OAAO,EAAEnB;IAAQ,EACjB;EAEN,CAAC,CAAC;AACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
2
|
import { PlatformPressable } from '@react-navigation/elements';
|
|
4
3
|
import { DrawerActions, useNavigation } from '@react-navigation/native';
|
|
5
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PlatformPressable","DrawerActions","useNavigation","React","Image","Platform","StyleSheet","DrawerToggleButton","tintColor","rest","navigation","borderless","dispatch","toggleDrawer","styles","touchable","select","ios","undefined","default","top","right","bottom","left","icon","require","create","height","width","margin","resizeMode","marginHorizontal"],"
|
|
1
|
+
{"version":3,"names":["PlatformPressable","DrawerActions","useNavigation","React","Image","Platform","StyleSheet","DrawerToggleButton","tintColor","rest","navigation","borderless","dispatch","toggleDrawer","styles","touchable","select","ios","undefined","default","top","right","bottom","left","icon","require","create","height","width","margin","resizeMode","marginHorizontal"],"sourceRoot":"../../src","sources":["DrawerToggleButton.tsx"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SACEC,aAAa,EAEbC,aAAa,QACR,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAW1D,eAAe,SAASC,kBAAkB,OAAgC;EAAA,IAA/B;IAAEC,SAAS;IAAE,GAAGC;EAAY,CAAC;EACtE,MAAMC,UAAU,GAAGR,aAAa,EAAuC;EAEvE,oBACE,oBAAC,iBAAiB,eACZO,IAAI;IACR,UAAU;IACV,iBAAiB,EAAC,QAAQ;IAC1B,cAAc,EAAE;MAAEE,UAAU,EAAE;IAAK,CAAE;IACrC,OAAO,EAAE,MAAMD,UAAU,CAACE,QAAQ,CAACX,aAAa,CAACY,YAAY,EAAE,CAAE;IACjE,KAAK,EAAEC,MAAM,CAACC,SAAU;IACxB,OAAO,EAAEV,QAAQ,CAACW,MAAM,CAAC;MACvBC,GAAG,EAAEC,SAAS;MACdC,OAAO,EAAE;QAAEC,GAAG,EAAE,EAAE;QAAEC,KAAK,EAAE,EAAE;QAAEC,MAAM,EAAE,EAAE;QAAEC,IAAI,EAAE;MAAG;IACtD,CAAC;EAAE,iBAEH,oBAAC,KAAK;IACJ,KAAK,EAAE,CAACT,MAAM,CAACU,IAAI,EAAEhB,SAAS,GAAG;MAAEA;IAAU,CAAC,GAAG,IAAI,CAAE;IACvD,MAAM,EAAEiB,OAAO,CAAC,iCAAiC,CAAE;IACnD,YAAY,EAAE;EAAE,EAChB,CACgB;AAExB;AAEA,MAAMX,MAAM,GAAGR,UAAU,CAACoB,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJG,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE;EACd,CAAC;EACDf,SAAS,EAAE;IACTgB,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
2
|
import { getHeaderTitle, Header, SafeAreaProviderCompat, Screen } from '@react-navigation/elements';
|
|
4
3
|
import { DrawerActions, useTheme } from '@react-navigation/native';
|
|
5
4
|
import * as React from 'react';
|
|
@@ -13,13 +12,11 @@ import DrawerContent from './DrawerContent';
|
|
|
13
12
|
import DrawerToggleButton from './DrawerToggleButton';
|
|
14
13
|
import { GestureHandlerRootView } from './GestureHandler';
|
|
15
14
|
import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
|
|
16
|
-
|
|
17
15
|
const getDefaultDrawerWidth = _ref => {
|
|
18
16
|
let {
|
|
19
17
|
height,
|
|
20
18
|
width
|
|
21
19
|
} = _ref;
|
|
22
|
-
|
|
23
20
|
/*
|
|
24
21
|
* Default drawer width is screen width - header height
|
|
25
22
|
* with a max width of 280 on mobile and 320 on tablet
|
|
@@ -32,12 +29,9 @@ const getDefaultDrawerWidth = _ref => {
|
|
|
32
29
|
const maxWidth = isTablet ? 320 : 280;
|
|
33
30
|
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
|
|
34
31
|
};
|
|
35
|
-
|
|
36
|
-
const GestureHandlerWrapper = GestureHandlerRootView !== null && GestureHandlerRootView !== void 0 ? GestureHandlerRootView : View;
|
|
37
|
-
|
|
32
|
+
const GestureHandlerWrapper = GestureHandlerRootView ?? View;
|
|
38
33
|
function DrawerViewBase(_ref2) {
|
|
39
34
|
var _Reanimated$isConfigu;
|
|
40
|
-
|
|
41
35
|
let {
|
|
42
36
|
state,
|
|
43
37
|
navigation,
|
|
@@ -51,11 +45,9 @@ function DrawerViewBase(_ref2) {
|
|
|
51
45
|
} = _ref2;
|
|
52
46
|
// Reanimated v3 dropped legacy v1 syntax
|
|
53
47
|
const legacyImplemenationNotAvailable = require('react-native-reanimated').abs === undefined;
|
|
54
|
-
|
|
55
48
|
if (useLegacyImplementation && legacyImplemenationNotAvailable) {
|
|
56
49
|
throw new Error('The `useLegacyImplementation` prop is not available with Reanimated 3 as it no longer includes support for Reanimated 1 legacy API. Remove the `useLegacyImplementation` prop from `Drawer.Navigator` to be able to use it.');
|
|
57
50
|
}
|
|
58
|
-
|
|
59
51
|
const Drawer = useLegacyImplementation ? require('./legacy/Drawer').default : require('./modern/Drawer').default;
|
|
60
52
|
const focusedRouteKey = state.routes[state.index].key;
|
|
61
53
|
const {
|
|
@@ -75,23 +67,23 @@ function DrawerViewBase(_ref2) {
|
|
|
75
67
|
swipeMinDistance = 60
|
|
76
68
|
} = descriptors[focusedRouteKey].options;
|
|
77
69
|
const [loaded, setLoaded] = React.useState([focusedRouteKey]);
|
|
78
|
-
|
|
79
70
|
if (!loaded.includes(focusedRouteKey)) {
|
|
80
71
|
setLoaded([...loaded, focusedRouteKey]);
|
|
81
72
|
}
|
|
82
|
-
|
|
83
73
|
const dimensions = useSafeAreaFrame();
|
|
84
74
|
const {
|
|
85
75
|
colors
|
|
86
76
|
} = useTheme();
|
|
87
77
|
const drawerStatus = getDrawerStatusFromState(state);
|
|
88
78
|
const handleDrawerOpen = React.useCallback(() => {
|
|
89
|
-
navigation.dispatch({
|
|
79
|
+
navigation.dispatch({
|
|
80
|
+
...DrawerActions.openDrawer(),
|
|
90
81
|
target: state.key
|
|
91
82
|
});
|
|
92
83
|
}, [navigation, state.key]);
|
|
93
84
|
const handleDrawerClose = React.useCallback(() => {
|
|
94
|
-
navigation.dispatch({
|
|
85
|
+
navigation.dispatch({
|
|
86
|
+
...DrawerActions.closeDrawer(),
|
|
95
87
|
target: state.key
|
|
96
88
|
});
|
|
97
89
|
}, [navigation, state.key]);
|
|
@@ -99,51 +91,41 @@ function DrawerViewBase(_ref2) {
|
|
|
99
91
|
if (drawerStatus === defaultStatus || drawerType === 'permanent') {
|
|
100
92
|
return;
|
|
101
93
|
}
|
|
102
|
-
|
|
103
94
|
const handleHardwareBack = () => {
|
|
104
95
|
// We shouldn't handle the back button if the parent screen isn't focused
|
|
105
96
|
// This will avoid the drawer overriding event listeners from a focused screen
|
|
106
97
|
if (!navigation.isFocused()) {
|
|
107
98
|
return false;
|
|
108
99
|
}
|
|
109
|
-
|
|
110
100
|
if (defaultStatus === 'open') {
|
|
111
101
|
handleDrawerOpen();
|
|
112
102
|
} else {
|
|
113
103
|
handleDrawerClose();
|
|
114
104
|
}
|
|
115
|
-
|
|
116
105
|
return true;
|
|
117
106
|
};
|
|
118
|
-
|
|
119
107
|
const handleEscape = e => {
|
|
120
108
|
if (e.key === 'Escape') {
|
|
121
109
|
handleHardwareBack();
|
|
122
110
|
}
|
|
123
|
-
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// We only add the listeners when drawer opens
|
|
124
114
|
// This way we can make sure that the listener is added as late as possible
|
|
125
115
|
// This will make sure that our handler will run first when back button is pressed
|
|
126
|
-
|
|
127
|
-
|
|
128
116
|
const subscription = BackHandler.addEventListener('hardwareBackPress', handleHardwareBack);
|
|
129
|
-
|
|
130
117
|
if (Platform.OS === 'web') {
|
|
131
118
|
var _document, _document$body, _document$body$addEve;
|
|
132
|
-
|
|
133
119
|
(_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : (_document$body$addEve = _document$body.addEventListener) === null || _document$body$addEve === void 0 ? void 0 : _document$body$addEve.call(_document$body, 'keyup', handleEscape);
|
|
134
120
|
}
|
|
135
|
-
|
|
136
121
|
return () => {
|
|
137
122
|
subscription.remove();
|
|
138
|
-
|
|
139
123
|
if (Platform.OS === 'web') {
|
|
140
124
|
var _document2, _document2$body, _document2$body$remov;
|
|
141
|
-
|
|
142
125
|
(_document2 = document) === null || _document2 === void 0 ? void 0 : (_document2$body = _document2.body) === null || _document2$body === void 0 ? void 0 : (_document2$body$remov = _document2$body.removeEventListener) === null || _document2$body$remov === void 0 ? void 0 : _document2$body$remov.call(_document2$body, 'keyup', handleEscape);
|
|
143
126
|
}
|
|
144
127
|
};
|
|
145
128
|
}, [defaultStatus, drawerStatus, drawerType, handleDrawerClose, handleDrawerOpen, navigation]);
|
|
146
|
-
|
|
147
129
|
const renderDrawerContent = () => {
|
|
148
130
|
return /*#__PURE__*/React.createElement(DrawerPositionContext.Provider, {
|
|
149
131
|
value: drawerPosition
|
|
@@ -153,7 +135,6 @@ function DrawerViewBase(_ref2) {
|
|
|
153
135
|
descriptors: descriptors
|
|
154
136
|
}));
|
|
155
137
|
};
|
|
156
|
-
|
|
157
138
|
const renderSceneContent = () => {
|
|
158
139
|
return /*#__PURE__*/React.createElement(MaybeScreenContainer, {
|
|
159
140
|
enabled: detachInactiveScreens,
|
|
@@ -166,21 +147,16 @@ function DrawerViewBase(_ref2) {
|
|
|
166
147
|
unmountOnBlur
|
|
167
148
|
} = descriptor.options;
|
|
168
149
|
const isFocused = state.index === index;
|
|
169
|
-
|
|
170
150
|
if (unmountOnBlur && !isFocused) {
|
|
171
151
|
return null;
|
|
172
152
|
}
|
|
173
|
-
|
|
174
153
|
if (lazy && !loaded.includes(route.key) && !isFocused) {
|
|
175
154
|
// Don't render a lazy screen if we've never navigated to it
|
|
176
155
|
return null;
|
|
177
156
|
}
|
|
178
|
-
|
|
179
157
|
const {
|
|
180
158
|
freezeOnBlur,
|
|
181
159
|
header = _ref3 => {
|
|
182
|
-
var _options$headerLeft;
|
|
183
|
-
|
|
184
160
|
let {
|
|
185
161
|
layout,
|
|
186
162
|
options
|
|
@@ -188,7 +164,7 @@ function DrawerViewBase(_ref2) {
|
|
|
188
164
|
return /*#__PURE__*/React.createElement(Header, _extends({}, options, {
|
|
189
165
|
layout: layout,
|
|
190
166
|
title: getHeaderTitle(options, route.name),
|
|
191
|
-
headerLeft:
|
|
167
|
+
headerLeft: options.headerLeft ?? (props => /*#__PURE__*/React.createElement(DrawerToggleButton, props))
|
|
192
168
|
}));
|
|
193
169
|
},
|
|
194
170
|
headerShown,
|
|
@@ -221,7 +197,6 @@ function DrawerViewBase(_ref2) {
|
|
|
221
197
|
}, descriptor.render()));
|
|
222
198
|
}));
|
|
223
199
|
};
|
|
224
|
-
|
|
225
200
|
return /*#__PURE__*/React.createElement(DrawerStatusContext.Provider, {
|
|
226
201
|
value: drawerStatus
|
|
227
202
|
}, /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -256,7 +231,6 @@ function DrawerViewBase(_ref2) {
|
|
|
256
231
|
dimensions: dimensions
|
|
257
232
|
}));
|
|
258
233
|
}
|
|
259
|
-
|
|
260
234
|
export default function DrawerView(_ref4) {
|
|
261
235
|
let {
|
|
262
236
|
navigation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","DrawerActions","useTheme","React","BackHandler","I18nManager","Platform","StyleSheet","View","Reanimated","useSafeAreaFrame","DrawerPositionContext","DrawerStatusContext","getDrawerStatusFromState","DrawerContent","DrawerToggleButton","GestureHandlerRootView","MaybeScreen","MaybeScreenContainer","getDefaultDrawerWidth","height","width","smallerAxisSize","Math","min","isLandscape","isTablet","appBarHeight","OS","maxWidth","GestureHandlerWrapper","DrawerViewBase","state","navigation","descriptors","defaultStatus","drawerContent","props","detachInactiveScreens","useLegacyImplementation","isConfigured","legacyImplemenationNotAvailable","require","abs","undefined","Error","Drawer","default","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","getConstants","isRTL","drawerStatusBarAnimation","drawerStyle","drawerType","select","ios","gestureHandlerProps","keyboardDismissMode","overlayColor","swipeEdgeWidth","swipeEnabled","swipeMinDistance","options","loaded","setLoaded","useState","includes","dimensions","colors","drawerStatus","handleDrawerOpen","useCallback","dispatch","openDrawer","target","handleDrawerClose","closeDrawer","useEffect","handleHardwareBack","isFocused","handleEscape","e","subscription","addEventListener","document","body","remove","removeEventListener","renderDrawerContent","renderSceneContent","styles","content","map","route","descriptor","lazy","unmountOnBlur","freezeOnBlur","header","layout","name","headerLeft","headerShown","headerStatusBarHeight","headerTransparent","sceneContainerStyle","absoluteFill","zIndex","render","backgroundColor","card","borderRightColor","border","borderRightWidth","hairlineWidth","borderLeftColor","borderLeftWidth","DrawerView","rest","create","flex"],"sources":["DrawerView.tsx"],"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 * as Reanimated 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 // Reanimated 2 is not configured\n // @ts-expect-error: the type definitions are incomplete\n useLegacyImplementation = !Reanimated.isConfigured?.(),\n}: Props) {\n // Reanimated v3 dropped legacy v1 syntax\n const legacyImplemenationNotAvailable =\n require('react-native-reanimated').abs === undefined;\n\n if (useLegacyImplementation && legacyImplemenationNotAvailable) {\n throw new Error(\n 'The `useLegacyImplementation` prop is not available with Reanimated 3 as it no longer includes support for Reanimated 1 legacy API. Remove the `useLegacyImplementation` prop from `Drawer.Navigator` to be able to use it.'\n );\n }\n\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.getConstants().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 hasTwoStates\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 freezeOnBlur,\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 headerShown,\n headerStatusBarHeight,\n headerTransparent,\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 freezeOnBlur={freezeOnBlur}\n >\n <Screen\n focused={isFocused}\n route={descriptor.route}\n navigation={descriptor.navigation}\n headerShown={headerShown}\n headerStatusBarHeight={headerStatusBarHeight}\n headerTransparent={headerTransparent}\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 </GestureHand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AU,KAAK,WAAf,KACGL,cAAc,KAAK,MAAnB,GACG;MACE+D,gBAAgB,EAAE3C,MAAM,CAAC4C,MAD3B;MAEEC,gBAAgB,EAAE/G,UAAU,CAACgH;IAF/B,CADH,GAKG;MACEC,eAAe,EAAE/C,MAAM,CAAC4C,MAD1B;MAEEI,eAAe,EAAElH,UAAU,CAACgH;IAF9B,CANN,CALW,EAeX9D,WAfW,CAdf;IA+BE,YAAY,EAAE;MAAEyD,eAAe,EAAEnD;IAAnB,CA/BhB;IAgCE,mBAAmB,EAAE8B,mBAhCvB;IAiCE,kBAAkB,EAAEC,kBAjCtB;IAkCE,UAAU,EAAEtB;EAlCd,EADF,CADF;AAwCD;;AAED,eAAe,SAASkD,UAAT,QAAoD;EAAA,IAAhC;IAAEzF,UAAF;IAAc,GAAG0F;EAAjB,CAAgC;EACjE,oBACE,oBAAC,sBAAD,qBACE,oBAAC,qBAAD;IAAuB,KAAK,EAAE5B,MAAM,CAACC;EAArC,gBACE,oBAAC,cAAD;IAAgB,UAAU,EAAE/D;EAA5B,GAA4C0F,IAA5C,EADF,CADF,CADF;AAOD;AAED,MAAM5B,MAAM,GAAGxF,UAAU,CAACqH,MAAX,CAAkB;EAC/B5B,OAAO,EAAE;IACP6B,IAAI,EAAE;EADC;AADsB,CAAlB,CAAf"}
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","Header","SafeAreaProviderCompat","Screen","DrawerActions","useTheme","React","BackHandler","I18nManager","Platform","StyleSheet","View","Reanimated","useSafeAreaFrame","DrawerPositionContext","DrawerStatusContext","getDrawerStatusFromState","DrawerContent","DrawerToggleButton","GestureHandlerRootView","MaybeScreen","MaybeScreenContainer","getDefaultDrawerWidth","height","width","smallerAxisSize","Math","min","isLandscape","isTablet","appBarHeight","OS","maxWidth","GestureHandlerWrapper","DrawerViewBase","state","navigation","descriptors","defaultStatus","drawerContent","props","detachInactiveScreens","useLegacyImplementation","isConfigured","legacyImplemenationNotAvailable","require","abs","undefined","Error","Drawer","default","focusedRouteKey","routes","index","key","drawerHideStatusBarOnOpen","drawerPosition","getConstants","isRTL","drawerStatusBarAnimation","drawerStyle","drawerType","select","ios","gestureHandlerProps","keyboardDismissMode","overlayColor","swipeEdgeWidth","swipeEnabled","swipeMinDistance","options","loaded","setLoaded","useState","includes","dimensions","colors","drawerStatus","handleDrawerOpen","useCallback","dispatch","openDrawer","target","handleDrawerClose","closeDrawer","useEffect","handleHardwareBack","isFocused","handleEscape","e","subscription","addEventListener","document","body","remove","removeEventListener","renderDrawerContent","renderSceneContent","styles","content","map","route","descriptor","lazy","unmountOnBlur","freezeOnBlur","header","layout","name","headerLeft","headerShown","headerStatusBarHeight","headerTransparent","sceneContainerStyle","absoluteFill","zIndex","render","backgroundColor","card","borderRightColor","border","borderRightWidth","hairlineWidth","borderLeftColor","borderLeftWidth","DrawerView","rest","create","flex"],"sourceRoot":"../../src","sources":["DrawerView.tsx"],"mappings":";AAAA,SACEA,cAAc,EACdC,MAAM,EACNC,sBAAsB,EACtBC,MAAM,QACD,4BAA4B;AACnC,SACEC,aAAa,EAIbC,QAAQ,QACH,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,WAAW,EACXC,WAAW,EACXC,QAAQ,EACRC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,SAASC,gBAAgB,QAAQ,gCAAgC;AAWjE,OAAOC,qBAAqB,MAAM,gCAAgC;AAClE,OAAOC,mBAAmB,MAAM,8BAA8B;AAC9D,OAAOC,wBAAwB,MAAM,mCAAmC;AACxE,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,kBAAkB;AASpE,MAAMC,qBAAqB,GAAG,QAMxB;EAAA,IANyB;IAC7BC,MAAM;IACNC;EAIF,CAAC;EACC;A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IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GestureHandler.android.tsx"],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["GestureHandler.android.tsx"],"mappings":"AAAA,cAAc,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GestureHandler.ios.tsx"],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["GestureHandler.ios.tsx"],"mappings":"AAAA,cAAc,wBAAwB"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
|
|
4
3
|
const Dummy = _ref => {
|
|
5
4
|
let {
|
|
6
5
|
children
|
|
7
6
|
} = _ref;
|
|
8
7
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
9
8
|
};
|
|
10
|
-
|
|
11
9
|
export const PanGestureHandler = Dummy;
|
|
12
10
|
export const TapGestureHandler = Dummy;
|
|
13
11
|
export const GestureHandlerRootView = View;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Dummy","children","PanGestureHandler","TapGestureHandler","GestureHandlerRootView","GestureState","UNDETERMINED","FAILED","BEGAN","CANCELLED","ACTIVE","END"],"
|
|
1
|
+
{"version":3,"names":["React","View","Dummy","children","PanGestureHandler","TapGestureHandler","GestureHandlerRootView","GestureState","UNDETERMINED","FAILED","BEGAN","CANCELLED","ACTIVE","END"],"sourceRoot":"../../src","sources":["GestureHandler.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;AAMnC,MAAMC,KAAU,GAAG;EAAA,IAAC;IAAEC;EAAwC,CAAC;EAAA,oBAC7D,0CAAGA,QAAQ,CAAI;AAAA,CAChB;AAED,OAAO,MAAMC,iBAAiB,GAC5BF,KAAyD;AAE3D,OAAO,MAAMG,iBAAiB,GAC5BH,KAAyD;AAE3D,OAAO,MAAMI,sBAAsB,GAAGL,IAAI;AAE1C,OAAO,MAAMM,YAAY,GAAG;EAC1BC,YAAY,EAAE,CAAC;EACfC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,MAAM,EAAE,CAAC;EACTC,GAAG,EAAE;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PanGestureHandler","PanGestureHandlerNative","DrawerGestureContext","props","gestureRef","useRef","GestureHandlerRootView","State","GestureState","TapGestureHandler"],"
|
|
1
|
+
{"version":3,"names":["React","PanGestureHandler","PanGestureHandlerNative","DrawerGestureContext","props","gestureRef","useRef","GestureHandlerRootView","State","GestureState","TapGestureHandler"],"sourceRoot":"../../src","sources":["GestureHandlerNative.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,iBAAiB,IAAIC,uBAAuB,QAEvC,8BAA8B;AAErC,OAAOC,oBAAoB,MAAM,+BAA+B;AAEhE,OAAO,SAASF,iBAAiB,CAACG,KAAkC,EAAE;EACpE,MAAMC,UAAU,GAAGL,KAAK,CAACM,MAAM,CAA0B,IAAI,CAAC;EAE9D,oBACE,oBAAC,oBAAoB,CAAC,QAAQ;IAAC,KAAK,EAAED;EAAW,gBAC/C,oBAAC,uBAAuB,EAAKD,KAAK,CAAI,CACR;AAEpC;AAGA,SACEG,sBAAsB,EACtBC,KAAK,IAAIC,YAAY,EACrBC,iBAAiB,QACZ,8BAA8B"}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
2
|
-
|
|
3
2
|
import { ResourceSavingView } from '@react-navigation/elements';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { View } from 'react-native';
|
|
6
5
|
let Screens;
|
|
7
|
-
|
|
8
6
|
try {
|
|
9
7
|
Screens = require('react-native-screens');
|
|
10
|
-
} catch (e) {
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// Ignore
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
export const MaybeScreenContainer = _ref => {
|
|
14
12
|
var _Screens, _Screens$screensEnabl;
|
|
15
|
-
|
|
16
13
|
let {
|
|
17
14
|
enabled,
|
|
18
15
|
...rest
|
|
19
16
|
} = _ref;
|
|
20
|
-
|
|
21
17
|
if ((_Screens = Screens) !== null && _Screens !== void 0 && (_Screens$screensEnabl = _Screens.screensEnabled) !== null && _Screens$screensEnabl !== void 0 && _Screens$screensEnabl.call(_Screens)) {
|
|
22
18
|
return /*#__PURE__*/React.createElement(Screens.ScreenContainer, _extends({
|
|
23
19
|
enabled: enabled
|
|
24
20
|
}, rest));
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
return /*#__PURE__*/React.createElement(View, rest);
|
|
28
23
|
};
|
|
29
24
|
export function MaybeScreen(_ref2) {
|
|
30
25
|
var _Screens2, _Screens2$screensEnab;
|
|
31
|
-
|
|
32
26
|
let {
|
|
33
27
|
visible,
|
|
34
28
|
children,
|
|
35
29
|
...rest
|
|
36
30
|
} = _ref2;
|
|
37
|
-
|
|
38
31
|
if ((_Screens2 = Screens) !== null && _Screens2 !== void 0 && (_Screens2$screensEnab = _Screens2.screensEnabled) !== null && _Screens2$screensEnab !== void 0 && _Screens2$screensEnab.call(_Screens2)) {
|
|
39
32
|
return /*#__PURE__*/React.createElement(Screens.Screen, _extends({
|
|
40
33
|
activityState: visible ? 2 : 0
|
|
41
34
|
}, rest), children);
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
return /*#__PURE__*/React.createElement(ResourceSavingView, _extends({
|
|
45
37
|
visible: visible
|
|
46
38
|
}, rest), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"
|
|
1
|
+
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","MaybeScreen","visible","children"],"sourceRoot":"../../src","sources":["ScreenFallback.tsx"],"mappings":";AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAoBC,IAAI,QAA8B,cAAc;AAUpE,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAG,QAO9B;EAAA;EAAA,IAP+B;IACnCC,OAAO;IACP,GAAGC;EAKL,CAAC;EACC,gBAAIL,OAAO,8DAAP,SAASM,cAAc,kDAAvB,oCAA2B,EAAE;IAC/B,oBAAO,oBAAC,OAAO,CAAC,eAAe;MAAC,OAAO,EAAEF;IAAQ,GAAKC,IAAI,EAAI;EAChE;EAEA,oBAAO,oBAAC,IAAI,EAAKA,IAAI,CAAI;AAC3B,CAAC;AAED,OAAO,SAASE,WAAW,QAAwC;EAAA;EAAA,IAAvC;IAAEC,OAAO;IAAEC,QAAQ;IAAE,GAAGJ;EAAY,CAAC;EAC/D,iBAAIL,OAAO,+DAAP,UAASM,cAAc,kDAAvB,qCAA2B,EAAE;IAC/B,oBACE,oBAAC,OAAO,CAAC,MAAM;MAAC,aAAa,EAAEE,OAAO,GAAG,CAAC,GAAG;IAAE,GAAKH,IAAI,GACrDI,QAAQ,CACM;EAErB;EAEA,oBACE,oBAAC,kBAAkB;IAAC,OAAO,EAAED;EAAQ,GAAKH,IAAI,GAC3CI,QAAQ,CACU;AAEzB"}
|