@react-navigation/elements 1.3.6 → 1.3.7
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/Background.js +1 -1
- package/lib/commonjs/Background.js.map +1 -1
- package/lib/commonjs/Header/Header.js.map +1 -1
- package/lib/commonjs/Header/HeaderBackButton.js.map +1 -1
- package/lib/commonjs/Header/HeaderBackContext.js.map +1 -1
- package/lib/commonjs/Header/HeaderBackground.js +1 -1
- package/lib/commonjs/Header/HeaderBackground.js.map +1 -1
- package/lib/commonjs/Header/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/Header/HeaderShownContext.js.map +1 -1
- package/lib/commonjs/Header/HeaderTitle.js +1 -1
- package/lib/commonjs/Header/HeaderTitle.js.map +1 -1
- package/lib/commonjs/Header/getDefaultHeaderHeight.js +1 -1
- package/lib/commonjs/Header/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/Header/getHeaderTitle.js.map +1 -1
- package/lib/commonjs/Header/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/MaskedView.android.js.map +1 -1
- package/lib/commonjs/MaskedView.ios.js.map +1 -1
- package/lib/commonjs/MaskedView.js.map +1 -1
- package/lib/commonjs/MaskedViewNative.js.map +1 -1
- package/lib/commonjs/MissingIcon.js.map +1 -1
- package/lib/commonjs/PlatformPressable.js +1 -1
- package/lib/commonjs/PlatformPressable.js.map +1 -1
- package/lib/commonjs/ResourceSavingView.js +1 -1
- package/lib/commonjs/ResourceSavingView.js.map +1 -1
- package/lib/commonjs/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/Screen.js.map +1 -1
- package/lib/commonjs/getNamedContext.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/Background.js +1 -1
- package/lib/module/Background.js.map +1 -1
- package/lib/module/Header/Header.js.map +1 -1
- package/lib/module/Header/HeaderBackButton.js.map +1 -1
- package/lib/module/Header/HeaderBackContext.js.map +1 -1
- package/lib/module/Header/HeaderBackground.js +1 -1
- package/lib/module/Header/HeaderBackground.js.map +1 -1
- package/lib/module/Header/HeaderHeightContext.js.map +1 -1
- package/lib/module/Header/HeaderShownContext.js.map +1 -1
- package/lib/module/Header/HeaderTitle.js +1 -1
- package/lib/module/Header/HeaderTitle.js.map +1 -1
- package/lib/module/Header/getDefaultHeaderHeight.js +1 -1
- package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/Header/getHeaderTitle.js.map +1 -1
- package/lib/module/Header/useHeaderHeight.js.map +1 -1
- package/lib/module/MaskedView.android.js.map +1 -1
- package/lib/module/MaskedView.ios.js.map +1 -1
- package/lib/module/MaskedView.js.map +1 -1
- package/lib/module/MaskedViewNative.js.map +1 -1
- package/lib/module/MissingIcon.js.map +1 -1
- package/lib/module/PlatformPressable.js +1 -1
- package/lib/module/PlatformPressable.js.map +1 -1
- package/lib/module/ResourceSavingView.js +1 -1
- package/lib/module/ResourceSavingView.js.map +1 -1
- package/lib/module/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/Screen.js.map +1 -1
- package/lib/module/getNamedContext.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/package.json +4 -4
- package/src/Header/getDefaultHeaderHeight.tsx +1 -1
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function Background(_ref) {
|
|
21
21
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Background","style","rest","colors","useTheme","flex","backgroundColor","background"],"sources":["Background.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { View, ViewProps } from 'react-native';\n\ntype Props = ViewProps & {\n children: React.ReactNode;\n};\n\nexport default function Background({ style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <View\n {...rest}\n style={[{ flex: 1, backgroundColor: colors.background }, style]}\n />\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAMe,SAASA,UAAT,OAA+C;EAAA,IAA3B;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAA2B;EAC5D,MAAM;IAAEC;EAAF,IAAa,IAAAC,gBAAA,GAAnB;EAEA,oBACE,oBAAC,iBAAD,eACMF,IADN;IAEE,KAAK,EAAE,CAAC;MAAEG,IAAI,EAAE,CAAR;MAAWC,eAAe,EAAEH,MAAM,CAACI;IAAnC,CAAD,EAAkDN,KAAlD;EAFT,GADF;AAMD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Header.tsx"],"names":["warnIfHeaderStylesDefined","styles","Object","keys","forEach","styleProp","value","console","warn","undefined","Header","props","insets","frame","isParentHeaderShown","React","useContext","HeaderShownContext","layout","modal","title","headerTitle","customTitle","headerTitleAlign","Platform","select","ios","default","headerLeft","headerLeftLabelVisible","headerTransparent","headerTintColor","headerBackground","headerRight","headerTitleAllowFontScaling","titleAllowFontScaling","headerTitleStyle","titleStyle","headerLeftContainerStyle","leftContainerStyle","headerRightContainerStyle","rightContainerStyle","headerTitleContainerStyle","titleContainerStyle","headerBackgroundContainerStyle","backgroundContainerStyle","headerStyle","customHeaderStyle","headerShadowVisible","headerPressColor","headerPressOpacity","headerStatusBarHeight","top","defaultHeight","height","minHeight","maxHeight","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","boxShadow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","opacity","transform","unsafeStyles","StyleSheet","flatten","process","env","NODE_ENV","safeStyles","backgroundStyle","leftButton","tintColor","pressColor","pressOpacity","labelVisible","rightButton","absoluteFill","zIndex","style","content","left","expand","marginStart","maxWidth","width","Math","max","right","children","allowFontScaling","marginEnd","create","flex","flexDirection","alignItems","marginHorizontal","justifyContent","flexGrow","flexBasis"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;;;;;;;AAiBA,MAAMA,yBAAyB,GAAIC,MAAD,IAAiC;AACjEC,EAAAA,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,OAApB,CAA6BC,SAAD,IAAe;AACzC,UAAMC,KAAK,GAAGL,MAAM,CAACI,SAAD,CAApB;;AAEA,QAAIA,SAAS,KAAK,UAAd,IAA4BC,KAAK,KAAK,UAA1C,EAAsD;AACpDC,MAAAA,OAAO,CAACC,IAAR,CACE,iJADF;AAGD,KAJD,MAIO,IAAIF,KAAK,K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,MAAMtG,MAAM,GAAG0F,wBAAW4B,MAAX,CAAkB;AAC/BZ,EAAAA,OAAO,EAAE;AACPa,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE,KAFR;AAGPC,IAAAA,UAAU,EAAE;AAHL,GADsB;AAM/BtG,EAAAA,KAAK,EAAE;AACLuG,IAAAA,gBAAgB,EAAE,EADb;AAELC,IAAAA,cAAc,EAAE;AAFX,GANwB;AAU/BhB,EAAAA,IAAI,EAAE;AACJgB,IAAAA,cAAc,EAAE,QADZ;AAEJF,IAAAA,UAAU,EAAE;AAFR,GAVyB;AAc/BP,EAAAA,KAAK,EAAE;AACLS,IAAAA,cAAc,EAAE,QADX;AAELF,IAAAA,UAAU,EAAE;AAFP,GAdwB;AAkB/Bb,EAAAA,MAAM,EAAE;AACNgB,IAAAA,QAAQ,EAAE,CADJ;AAENC,IAAAA,SAAS,EAAE;AAFL;AAlBuB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { Animated, Platform, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport type { HeaderOptions, Layout } from '../types';\nimport getDefaultHeaderHeight from './getDefaultHeaderHeight';\nimport HeaderBackground from './HeaderBackground';\nimport HeaderShownContext from './HeaderShownContext';\nimport HeaderTitle from './HeaderTitle';\n\ntype Props = HeaderOptions & {\n /**\n * Whether the header is in a modal\n */\n modal?: boolean;\n /**\n * Layout of the screen.\n */\n layout?: Layout;\n /**\n * Title text for the header.\n */\n title: string;\n};\n\nconst warnIfHeaderStylesDefined = (styles: Record<string, any>) => {\n Object.keys(styles).forEach((styleProp) => {\n const value = styles[styleProp];\n\n if (styleProp === 'position' && value === 'absolute') {\n console.warn(\n \"position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.\"\n );\n } else if (value !== undefined) {\n console.warn(\n `${styleProp} was given a value of ${value}, this has no effect on headerStyle.`\n );\n }\n });\n};\n\nexport default function Header(props: Props) {\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n\n const {\n layout = frame,\n modal = false,\n title,\n headerTitle: customTitle,\n headerTitleAlign = Platform.select({\n ios: 'center',\n default: 'left',\n }),\n headerLeft,\n headerLeftLabelVisible,\n headerTransparent,\n headerTintColor,\n headerBackground,\n headerRight,\n headerTitleAllowFontScaling: titleAllowFontScaling,\n headerTitleStyle: titleStyle,\n headerLeftContainerStyle: leftContainerStyle,\n headerRightContainerStyle: rightContainerStyle,\n headerTitleContainerStyle: titleContainerStyle,\n headerBackgroundContainerStyle: backgroundContainerStyle,\n headerStyle: customHeaderStyle,\n headerShadowVisible,\n headerPressColor,\n headerPressOpacity,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n } = props;\n\n const defaultHeight = getDefaultHeaderHeight(\n layout,\n modal,\n headerStatusBarHeight\n );\n\n const {\n height = defaultHeight,\n minHeight,\n maxHeight,\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: web support for shadow\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n ...unsafeStyles\n } = StyleSheet.flatten(customHeaderStyle || {}) as ViewStyle;\n\n if (process.env.NODE_ENV !== 'production') {\n warnIfHeaderStylesDefined(unsafeStyles);\n }\n\n const safeStyles: ViewStyle = {\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: boxShadow is only for Web\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n };\n\n // Setting a property to undefined triggers default style\n // So we need to filter them out\n // Users can use `null` instead\n for (const styleProp in safeStyles) {\n // @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles\n if (safeStyles[styleProp] === undefined) {\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete safeStyles[styleProp];\n }\n }\n\n const backgroundStyle = [\n safeStyles,\n headerShadowVisible === false && {\n elevation: 0,\n shadowOpacity: 0,\n borderBottomWidth: 0,\n },\n ];\n\n const leftButton = headerLeft\n ? headerLeft({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n labelVisible: headerLeftLabelVisible,\n })\n : null;\n\n const rightButton = headerRight\n ? headerRight({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n })\n : null;\n\n const headerTitle =\n typeof customTitle !== 'function'\n ? (props: React.ComponentProps<typeof HeaderTitle>) => (\n <HeaderTitle {...props} />\n )\n : customTitle;\n\n return (\n <React.Fragment>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n StyleSheet.absoluteFill,\n { zIndex: 0 },\n backgroundContainerStyle,\n ]}\n >\n {headerBackground ? (\n headerBackground({ style: backgroundStyle })\n ) : headerTransparent ? null : (\n <HeaderBackground style={backgroundStyle} />\n )}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[{ height, minHeight, maxHeight, opacity, transform }]}\n >\n <View pointerEvents=\"none\" style={{ height: headerStatusBarHeight }} />\n <View pointerEvents=\"box-none\" style={styles.content}>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.left,\n headerTitleAlign === 'center' && styles.expand,\n { marginStart: insets.left },\n leftContainerStyle,\n ]}\n >\n {leftButton}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.title,\n {\n // Avoid the title from going offscreen or overlapping buttons\n maxWidth:\n headerTitleAlign === 'center'\n ? layout.width -\n ((leftButton\n ? headerLeftLabelVisible !== false\n ? 80\n : 32\n : 16) +\n Math.max(insets.left, insets.right)) *\n 2\n : layout.width -\n ((leftButton ? 72 : 16) +\n (rightButton ? 72 : 16) +\n insets.left -\n insets.right),\n },\n titleContainerStyle,\n ]}\n >\n {headerTitle({\n children: title,\n allowFontScaling: titleAllowFontScaling,\n tintColor: headerTintColor,\n style: titleStyle,\n })}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.right,\n styles.expand,\n { marginEnd: insets.right },\n rightContainerStyle,\n ]}\n >\n {rightButton}\n </Animated.View>\n </View>\n </Animated.View>\n </React.Fragment>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'stretch',\n },\n title: {\n marginHorizontal: 16,\n justifyContent: 'center',\n },\n left: {\n justifyContent: 'center',\n alignItems: 'flex-start',\n },\n right: {\n justifyContent: 'center',\n alignItems: 'flex-end',\n },\n expand: {\n flexGrow: 1,\n flexBasis: 0,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["warnIfHeaderStylesDefined","styles","Object","keys","forEach","styleProp","value","console","warn","undefined","Header","props","insets","useSafeAreaInsets","frame","useSafeAreaFrame","isParentHeaderShown","React","useContext","HeaderShownContext","layout","modal","title","headerTitle","customTitle","headerTitleAlign","Platform","select","ios","default","headerLeft","headerLeftLabelVisible","headerTransparent","headerTintColor","headerBackground","headerRight","headerTitleAllowFontScaling","titleAllowFontScaling","headerTitleStyle","titleStyle","headerLeftContainerStyle","leftContainerStyle","headerRightContainerStyle","rightContainerStyle","headerTitleContainerStyle","titleContainerStyle","headerBackgroundContainerStyle","backgroundContainerStyle","headerStyle","customHeaderStyle","headerShadowVisible","headerPressColor","headerPressOpacity","headerStatusBarHeight","top","defaultHeight","getDefaultHeaderHeight","height","minHeight","maxHeight","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","boxShadow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","opacity","transform","unsafeStyles","StyleSheet","flatten","process","env","NODE_ENV","safeStyles","backgroundStyle","leftButton","tintColor","pressColor","pressOpacity","labelVisible","rightButton","absoluteFill","zIndex","style","content","left","expand","marginStart","maxWidth","width","Math","max","right","children","allowFontScaling","marginEnd","create","flex","flexDirection","alignItems","marginHorizontal","justifyContent","flexGrow","flexBasis"],"sources":["Header.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Animated, Platform, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport type { HeaderOptions, Layout } from '../types';\nimport getDefaultHeaderHeight from './getDefaultHeaderHeight';\nimport HeaderBackground from './HeaderBackground';\nimport HeaderShownContext from './HeaderShownContext';\nimport HeaderTitle from './HeaderTitle';\n\ntype Props = HeaderOptions & {\n /**\n * Whether the header is in a modal\n */\n modal?: boolean;\n /**\n * Layout of the screen.\n */\n layout?: Layout;\n /**\n * Title text for the header.\n */\n title: string;\n};\n\nconst warnIfHeaderStylesDefined = (styles: Record<string, any>) => {\n Object.keys(styles).forEach((styleProp) => {\n const value = styles[styleProp];\n\n if (styleProp === 'position' && value === 'absolute') {\n console.warn(\n \"position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.\"\n );\n } else if (value !== undefined) {\n console.warn(\n `${styleProp} was given a value of ${value}, this has no effect on headerStyle.`\n );\n }\n });\n};\n\nexport default function Header(props: Props) {\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n\n const {\n layout = frame,\n modal = false,\n title,\n headerTitle: customTitle,\n headerTitleAlign = Platform.select({\n ios: 'center',\n default: 'left',\n }),\n headerLeft,\n headerLeftLabelVisible,\n headerTransparent,\n headerTintColor,\n headerBackground,\n headerRight,\n headerTitleAllowFontScaling: titleAllowFontScaling,\n headerTitleStyle: titleStyle,\n headerLeftContainerStyle: leftContainerStyle,\n headerRightContainerStyle: rightContainerStyle,\n headerTitleContainerStyle: titleContainerStyle,\n headerBackgroundContainerStyle: backgroundContainerStyle,\n headerStyle: customHeaderStyle,\n headerShadowVisible,\n headerPressColor,\n headerPressOpacity,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n } = props;\n\n const defaultHeight = getDefaultHeaderHeight(\n layout,\n modal,\n headerStatusBarHeight\n );\n\n const {\n height = defaultHeight,\n minHeight,\n maxHeight,\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: web support for shadow\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n ...unsafeStyles\n } = StyleSheet.flatten(customHeaderStyle || {}) as ViewStyle;\n\n if (process.env.NODE_ENV !== 'production') {\n warnIfHeaderStylesDefined(unsafeStyles);\n }\n\n const safeStyles: ViewStyle = {\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: boxShadow is only for Web\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n };\n\n // Setting a property to undefined triggers default style\n // So we need to filter them out\n // Users can use `null` instead\n for (const styleProp in safeStyles) {\n // @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles\n if (safeStyles[styleProp] === undefined) {\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete safeStyles[styleProp];\n }\n }\n\n const backgroundStyle = [\n safeStyles,\n headerShadowVisible === false && {\n elevation: 0,\n shadowOpacity: 0,\n borderBottomWidth: 0,\n },\n ];\n\n const leftButton = headerLeft\n ? headerLeft({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n labelVisible: headerLeftLabelVisible,\n })\n : null;\n\n const rightButton = headerRight\n ? headerRight({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n })\n : null;\n\n const headerTitle =\n typeof customTitle !== 'function'\n ? (props: React.ComponentProps<typeof HeaderTitle>) => (\n <HeaderTitle {...props} />\n )\n : customTitle;\n\n return (\n <React.Fragment>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n StyleSheet.absoluteFill,\n { zIndex: 0 },\n backgroundContainerStyle,\n ]}\n >\n {headerBackground ? (\n headerBackground({ style: backgroundStyle })\n ) : headerTransparent ? null : (\n <HeaderBackground style={backgroundStyle} />\n )}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[{ height, minHeight, maxHeight, opacity, transform }]}\n >\n <View pointerEvents=\"none\" style={{ height: headerStatusBarHeight }} />\n <View pointerEvents=\"box-none\" style={styles.content}>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.left,\n headerTitleAlign === 'center' && styles.expand,\n { marginStart: insets.left },\n leftContainerStyle,\n ]}\n >\n {leftButton}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.title,\n {\n // Avoid the title from going offscreen or overlapping buttons\n maxWidth:\n headerTitleAlign === 'center'\n ? layout.width -\n ((leftButton\n ? headerLeftLabelVisible !== false\n ? 80\n : 32\n : 16) +\n Math.max(insets.left, insets.right)) *\n 2\n : layout.width -\n ((leftButton ? 72 : 16) +\n (rightButton ? 72 : 16) +\n insets.left -\n insets.right),\n },\n titleContainerStyle,\n ]}\n >\n {headerTitle({\n children: title,\n allowFontScaling: titleAllowFontScaling,\n tintColor: headerTintColor,\n style: titleStyle,\n })}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.right,\n styles.expand,\n { marginEnd: insets.right },\n rightContainerStyle,\n ]}\n >\n {rightButton}\n </Animated.View>\n </View>\n </Animated.View>\n </React.Fragment>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'stretch',\n },\n title: {\n marginHorizontal: 16,\n justifyContent: 'center',\n },\n left: {\n justifyContent: 'center',\n alignItems: 'flex-start',\n },\n right: {\n justifyContent: 'center',\n alignItems: 'flex-end',\n },\n expand: {\n flexGrow: 1,\n flexBasis: 0,\n },\n});\n"],"mapp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,"sources":["HeaderBackButton.tsx"],"names":["HeaderBackButton","disabled","allowFontScaling","backImage","label","labelStyle","labelVisible","onLabelLayout","onPress","pressColor","pressOpacity","screenLayout","tintColor","customTintColor","titleLayout","truncatedLabel","accessibilityLabel","testID","style","colors","initialLabelWidth","setInitialLabelWidth","React","useState","undefined","Platform","select","ios","primary","default","text","handleLabelLayout","e","nativeEvent","layout","x","width","shouldTruncateLabel","renderBackImage","styles","icon","Boolean","iconWithLabel","require","renderLabel","leftLabelText","labelElement","labelWrapper","minWidth","color","OS","iconMaskContainer","iconMask","iconMaskFillerRect","handlePress","requestAnimationFrame","borderless","container","top","right","bottom","left","StyleSheet","create","alignItems","flexDirection","hairlineWidth","marginVertical","marginHorizontal","opacity","fontSize","letterSpacing","height","marginLeft","marginRight","resizeMode","transform","scaleX","I18nManager","getConstants","isRTL","margin","flex","justifyContent","backgroundColor","alignSelf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAUA;;AACA;;;;;;;;AAGe,SAASA,gBAAT,OAkBW;AAAA,MAlBe;AACvCC,IAAAA,QADuC;AAEvCC,IAAAA,gBAFuC;AAGvCC,IAAAA,SAHuC;AAIvCC,IAAAA,KAJuC;AAKvCC,IAAAA,UALuC;AAMvCC,IAAAA,YANuC;AAOvCC,IAAAA,aAPuC;AAQvCC,IAAAA,OARuC;AASvCC,IAAAA,UATuC;AAUvCC,IAAAA,YAVuC;AAWvCC,IAAAA,YAXuC;AAYvCC,IAAAA,SAAS,EAAEC,eAZ4B;AAavCC,IAAAA,WAbuC;AAcvCC,IAAAA,cAAc,GAAG,MAdsB;AAevCC,IAAAA,kBAAkB,GAAGZ,KAAK,IAAIA,KAAK,KAAK,MAAnB,GAA6B,GAAEA,KAAM,QAArC,GAA+C,SAf7B;AAgBvCa,IAAAA,MAhBuC;AAiBvCC,IAAAA;AAjBuC,GAkBf;AACxB,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAnB;AAEA,QAAM,CAACC,iBAAD,EAAoBC,o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;AAEjBjB,IAAAA,aAAa,EAAE,KAFE;AAGjBkB,IAAAA,cAAc,EAAE;AAHC,GApDY;AAyD/B9B,EAAAA,kBAAkB,EAAE;AAClB6B,IAAAA,IAAI,EAAE,CADY;AAElBE,IAAAA,eAAe,EAAE;AAFC,GAzDW;AA6D/BhC,EAAAA,QAAQ,EAAE;AACRoB,IAAAA,MAAM,EAAE,EADA;AAERpC,IAAAA,KAAK,EAAE,EAFC;AAGRqC,IAAAA,UAAU,EAAE,CAAC,IAHL;AAIRN,IAAAA,cAAc,EAAE,EAJR;AAKRkB,IAAAA,SAAS,EAAE,QALH;AAMRV,IAAAA,UAAU,EAAE,SANJ;AAORC,IAAAA,SAAS,EAAE,CAAC;AAAEC,MAAAA,MAAM,EAAEC,yBAAYC,YAAZ,GAA2BC,KAA3B,GAAmC,CAAC,CAApC,GAAwC;AAAlD,KAAD;AAPH;AA7DqB,CAAlB,CAAf","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n I18nManager,\n Image,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport MaskedView from '../MaskedView';\nimport PlatformPressable from '../PlatformPressable';\nimport type { HeaderBackButtonProps } from '../types';\n\nexport default function HeaderBackButton({\n disabled,\n allowFontScaling,\n backImage,\n label,\n labelStyle,\n labelVisible,\n onLabelLayout,\n onPress,\n pressColor,\n pressOpacity,\n screenLayout,\n tintColor: customTintColor,\n titleLayout,\n truncatedLabel = 'Back',\n accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',\n testID,\n style,\n}: HeaderBackButtonProps) {\n const { colors } = useTheme();\n\n const [initialLabelWidth, setInitialLabelWidth] = React.useState<\n undefined | number\n >(undefined);\n\n const tintColor =\n customTintColor !== undefined\n ? customTintColor\n : Platform.select({\n ios: colors.primary,\n default: colors.text,\n });\n\n const handleLabelLayout = (e: LayoutChangeEvent) => {\n onLabelLayout?.(e);\n\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n\n const shouldTruncateLabel = () => {\n return (\n !label ||\n (initialLabelWidth &&\n titleLayout &&\n screenLayout &&\n (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26)\n );\n };\n\n const renderBackImage = () => {\n if (backImage) {\n return backImage({ tintColor });\n } else {\n return (\n <Image\n style={[\n styles.icon,\n Boolean(labelVisible) && styles.iconWithLabel,\n Boolean(tintColor) && { tintColor },\n ]}\n source={require('../assets/back-icon.png')}\n fadeDuration={0}\n />\n );\n }\n };\n\n const renderLabel = () => {\n const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n\n const labelElement = (\n <View\n style={\n screenLayout\n ? // We make the button extend till the middle of the screen\n // Otherwise it appears to cut off when translating\n [styles.labelWrapper, { minWidth: screenLayout.width / 2 - 27 }]\n : null\n }\n >\n <Animated.Text\n accessible={false}\n onLayout={\n // This measurement is used to determine if we should truncate the label when it doesn't fit\n // Only measure it when label is not truncated because we want the measurement of full label\n leftLabelText === label ? handleLabelLayout : undefined\n }\n style={[\n styles.label,\n tintColor ? { color: tintColor } : null,\n labelStyle,\n ]}\n numberOfLines={1}\n allowFontScaling={!!allowFontScaling}\n >\n {leftLabelText}\n </Animated.Text>\n </View>\n );\n\n if (backImage || Platform.OS !== 'ios') {\n // When a custom backimage is specified, we can't mask the label\n // Otherwise there might be weird effect due to our mask not being the same as the image\n return labelElement;\n }\n\n return (\n <MaskedView\n maskElement={\n <View style={styles.iconMaskContainer}>\n <Image\n source={require('../assets/back-icon-mask.png')}\n style={styles.iconMask}\n />\n <View style={styles.iconMaskFillerRect} />\n </View>\n }\n >\n {labelElement}\n </MaskedView>\n );\n };\n\n const handlePress = () => onPress && requestAnimationFrame(onPress);\n\n return (\n <PlatformPressable\n disabled={disabled}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n testID={testID}\n onPress={disabled ? undefined : handlePress}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n android_ripple={{ borderless: true }}\n style={[styles.container, disabled && styles.disabled, style]}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <React.Fragment>\n {renderBackImage()}\n {renderLabel()}\n </React.Fragment>\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth, // Avoid collapsing when title is long\n ...Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11,\n },\n }),\n },\n disabled: {\n opacity: 0.5,\n },\n label: {\n fontSize: 17,\n // Title and back label are a bit different width due to title being bold\n // Adjusting the letterSpacing makes them coincide better\n letterSpacing: 0.35,\n },\n labelWrapper: {\n // These styles will make sure that the label doesn't fill the available space\n // Otherwise it messes with the measurement of the label\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n }),\n iconWithLabel:\n Platform.OS === 'ios'\n ? {\n marginRight: 6,\n }\n : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000',\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["HeaderBackButton","disabled","allowFontScaling","backImage","label","labelStyle","labelVisible","onLabelLayout","onPress","pressColor","pressOpacity","screenLayout","tintColor","customTintColor","titleLayout","truncatedLabel","accessibilityLabel","testID","style","colors","useTheme","initialLabelWidth","setInitialLabelWidth","React","useState","undefined","Platform","select","ios","primary","default","text","handleLabelLayout","e","nativeEvent","layout","x","width","shouldTruncateLabel","renderBackImage","styles","icon","Boolean","iconWithLabel","require","renderLabel","leftLabelText","labelElement","labelWrapper","minWidth","color","OS","iconMaskContainer","iconMask","iconMaskFillerRect","handlePress","requestAnimationFrame","borderless","container","top","right","bottom","left","StyleSheet","create","alignItems","flexDirection","hairlineWidth","marginVertical","marginHorizontal","opacity","fontSize","letterSpacing","height","marginLeft","marginRight","resizeMode","transform","scaleX","I18nManager","getConstants","isRTL","margin","flex","justifyContent","backgroundColor","alignSelf"],"sources":["HeaderBackButton.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n I18nManager,\n Image,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport MaskedView from '../MaskedView';\nimport PlatformPressable from '../PlatformPressable';\nimport type { HeaderBackButtonProps } from '../types';\n\nexport default function HeaderBackButton({\n disabled,\n allowFontScaling,\n backImage,\n label,\n labelStyle,\n labelVisible,\n onLabelLayout,\n onPress,\n pressColor,\n pressOpacity,\n screenLayout,\n tintColor: customTintColor,\n titleLayout,\n truncatedLabel = 'Back',\n accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',\n testID,\n style,\n}: HeaderBackButtonProps) {\n const { colors } = useTheme();\n\n const [initialLabelWidth, setInitialLabelWidth] = React.useState<\n undefined | number\n >(undefined);\n\n const tintColor =\n customTintColor !== undefined\n ? customTintColor\n : Platform.select({\n ios: colors.primary,\n default: colors.text,\n });\n\n const handleLabelLayout = (e: LayoutChangeEvent) => {\n onLabelLayout?.(e);\n\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n\n const shouldTruncateLabel = () => {\n return (\n !label ||\n (initialLabelWidth &&\n titleLayout &&\n screenLayout &&\n (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26)\n );\n };\n\n const renderBackImage = () => {\n if (backImage) {\n return backImage({ tintColor });\n } else {\n return (\n <Image\n style={[\n styles.icon,\n Boolean(labelVisible) && styles.iconWithLabel,\n Boolean(tintColor) && { tintColor },\n ]}\n source={require('../assets/back-icon.png')}\n fadeDuration={0}\n />\n );\n }\n };\n\n const renderLabel = () => {\n const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n\n const labelElement = (\n <View\n style={\n screenLayout\n ? // We make the button extend till the middle of the screen\n // Otherwise it appears to cut off when translating\n [styles.labelWrapper, { minWidth: screenLayout.width / 2 - 27 }]\n : null\n }\n >\n <Animated.Text\n accessible={false}\n onLayout={\n // This measurement is used to determine if we should truncate the label when it doesn't fit\n // Only measure it when label is not truncated because we want the measurement of full label\n leftLabelText === label ? handleLabelLayout : undefined\n }\n style={[\n styles.label,\n tintColor ? { color: tintColor } : null,\n labelStyle,\n ]}\n numberOfLines={1}\n allowFontScaling={!!allowFontScaling}\n >\n {leftLabelText}\n </Animated.Text>\n </View>\n );\n\n if (backImage || Platform.OS !== 'ios') {\n // When a custom backimage is specified, we can't mask the label\n // Otherwise there might be weird effect due to our mask not being the same as the image\n return labelElement;\n }\n\n return (\n <MaskedView\n maskElement={\n <View style={styles.iconMaskContainer}>\n <Image\n source={require('../assets/back-icon-mask.png')}\n style={styles.iconMask}\n />\n <View style={styles.iconMaskFillerRect} />\n </View>\n }\n >\n {labelElement}\n </MaskedView>\n );\n };\n\n const handlePress = () => onPress && requestAnimationFrame(onPress);\n\n return (\n <PlatformPressable\n disabled={disabled}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n testID={testID}\n onPress={disabled ? undefined : handlePress}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n android_ripple={{ borderless: true }}\n style={[styles.container, disabled && styles.disabled, style]}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <React.Fragment>\n {renderBackImage()}\n {renderLabel()}\n </React.Fragment>\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth, // Avoid collapsing when title is long\n ...Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11,\n },\n }),\n },\n disabled: {\n opacity: 0.5,\n },\n label: {\n fontSize: 17,\n // Title and back label are a bit different width due to title being bold\n // Adjusting the letterSpacing makes them coincide better\n letterSpacing: 0.35,\n },\n labelWrapper: {\n // These styles will make sure that the label doesn't fill the available space\n // Otherwise it messes with the measurement of the label\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n }),\n iconWithLabel:\n Platform.OS === 'ios'\n ? {\n marginRight: 6,\n }\n : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000',\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAUA;;AACA;;;;;;;;AAGe,SAASA,gBAAT,OAkBW;EAAA,IAlBe;IACvCC,QADuC;IAEvCC,gBAFuC;IAGvCC,SAHuC;IAIvCC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C,CApDY;EAyD/B9B,kBAAkB,EAAE;IAClB6B,IAAI,EAAE,CADY;IAElBE,eAAe,EAAE;EAFC,CAzDW;EA6D/BhC,QAAQ,EAAE;IACRoB,MAAM,EAAE,EADA;IAERpC,KAAK,EAAE,EAFC;IAGRqC,UAAU,EAAE,CAAC,IAHL;IAIRN,cAAc,EAAE,EAJR;IAKRkB,SAAS,EAAE,QALH;IAMRV,UAAU,EAAE,SANJ;IAORC,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAEC,wBAAA,CAAYC,YAAZ,GAA2BC,KAA3B,GAAmC,CAAC,CAApC,GAAwC;IAAlD,CAAD;EAPH;AA7DqB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderBackContext","getNamedContext","undefined"],"sources":["HeaderBackContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderBackContext = getNamedContext<{ title: string } | undefined>(\n 'HeaderBackContext',\n undefined\n);\n\nexport default HeaderBackContext;\n"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,iBAAiB,GAAG,IAAAC,wBAAA,EACxB,mBADwB,EAExBC,SAFwB,CAA1B;eAKeF,iB"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function HeaderBackground(_ref) {
|
|
21
21
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderBackground","style","rest","colors","useTheme","styles","container","backgroundColor","card","borderBottomColor","border","shadowColor","StyleSheet","create","flex","Platform","select","android","elevation","ios","shadowOpacity","shadowRadius","shadowOffset","width","height","hairlineWidth","default","borderBottomWidth"],"sources":["HeaderBackground.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Platform,\n StyleProp,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\n\ntype Props = Omit<ViewProps, 'style'> & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n children?: React.ReactNode;\n};\n\nexport default function HeaderBackground({ style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <Animated.View\n style={[\n styles.container,\n {\n backgroundColor: colors.card,\n borderBottomColor: colors.border,\n shadowColor: colors.border,\n },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n ...Platform.select({\n android: {\n elevation: 4,\n },\n ios: {\n shadowOpacity: 0.85,\n shadowRadius: 0,\n shadowOffset: {\n width: 0,\n height: StyleSheet.hairlineWidth,\n },\n },\n default: {\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n }),\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAce,SAASA,gBAAT,OAAqD;EAAA,IAA3B;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAA2B;EAClE,MAAM;IAAEC;EAAF,IAAa,IAAAC,gBAAA,GAAnB;EAEA,oBACE,oBAAC,qBAAD,CAAU,IAAV;IACE,KAAK,EAAE,CACLC,MAAM,CAACC,SADF,EAEL;MACEC,eAAe,EAAEJ,MAAM,CAACK,IAD1B;MAEEC,iBAAiB,EAAEN,MAAM,CAACO,MAF5B;MAGEC,WAAW,EAAER,MAAM,CAACO;IAHtB,CAFK,EAOLT,KAPK;EADT,GAUMC,IAVN,EADF;AAcD;;AAED,MAAMG,MAAM,GAAGO,uBAAA,CAAWC,MAAX,CAAkB;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CADG;IAET,GAAGC,qBAAA,CAASC,MAAT,CAAgB;MACjBC,OAAO,EAAE;QACPC,SAAS,EAAE;MADJ,CADQ;MAIjBC,GAAG,EAAE;QACHC,aAAa,EAAE,IADZ;QAEHC,YAAY,EAAE,CAFX;QAGHC,YAAY,EAAE;UACZC,KAAK,EAAE,CADK;UAEZC,MAAM,EAAEZ,uBAAA,CAAWa;QAFP;MAHX,CAJY;MAYjBC,OAAO,EAAE;QACPC,iBAAiB,EAAEf,uBAAA,CAAWa;MADvB;IAZQ,CAAhB;EAFM;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderHeightContext","getNamedContext","undefined"],"sources":["HeaderHeightContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderHeightContext = getNamedContext<number | undefined>(\n 'HeaderHeightContext',\n undefined\n);\n\nexport default HeaderHeightContext;\n"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,mBAAmB,GAAG,IAAAC,wBAAA,EAC1B,qBAD0B,EAE1BC,SAF0B,CAA5B;eAKeF,mB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderShownContext","getNamedContext"],"sources":["HeaderShownContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderShownContext = getNamedContext('HeaderShownContext', false);\n\nexport default HeaderShownContext;\n"],"mappings":";;;;;;;AAAA;;;;AAEA,MAAMA,kBAAkB,GAAG,IAAAC,wBAAA,EAAgB,oBAAhB,EAAsC,KAAtC,CAA3B;eAEeD,kB"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
function HeaderTitle(_ref) {
|
|
21
21
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderTitle","tintColor","style","rest","colors","useTheme","styles","title","color","undefined","text","StyleSheet","create","Platform","select","ios","fontSize","fontWeight","android","fontFamily","default"],"sources":["HeaderTitle.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Platform,\n StyleProp,\n StyleSheet,\n TextProps,\n TextStyle,\n} from 'react-native';\n\ntype Props = Omit<TextProps, 'style'> & {\n tintColor?: string;\n children?: string;\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport default function HeaderTitle({ tintColor, style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <Animated.Text\n accessibilityRole=\"header\"\n aria-level=\"1\"\n numberOfLines={1}\n {...rest}\n style={[\n styles.title,\n { color: tintColor === undefined ? colors.text : tintColor },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n title: Platform.select({\n ios: {\n fontSize: 17,\n fontWeight: '600',\n },\n android: {\n fontSize: 20,\n fontFamily: 'sans-serif-medium',\n fontWeight: 'normal',\n },\n default: {\n fontSize: 18,\n fontWeight: '500',\n },\n }),\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAee,SAASA,WAAT,OAA2D;EAAA,IAAtC;IAAEC,SAAF;IAAaC,KAAb;IAAoB,GAAGC;EAAvB,CAAsC;EACxE,MAAM;IAAEC;EAAF,IAAa,IAAAC,gBAAA,GAAnB;EAEA,oBACE,oBAAC,qBAAD,CAAU,IAAV;IACE,iBAAiB,EAAC,QADpB;IAEE,cAAW,GAFb;IAGE,aAAa,EAAE;EAHjB,GAIMF,IAJN;IAKE,KAAK,EAAE,CACLG,MAAM,CAACC,KADF,EAEL;MAAEC,KAAK,EAAEP,SAAS,KAAKQ,SAAd,GAA0BL,MAAM,CAACM,IAAjC,GAAwCT;IAAjD,CAFK,EAGLC,KAHK;EALT,GADF;AAaD;;AAED,MAAMI,MAAM,GAAGK,uBAAA,CAAWC,MAAX,CAAkB;EAC/BL,KAAK,EAAEM,qBAAA,CAASC,MAAT,CAAgB;IACrBC,GAAG,EAAE;MACHC,QAAQ,EAAE,EADP;MAEHC,UAAU,EAAE;IAFT,CADgB;IAKrBC,OAAO,EAAE;MACPF,QAAQ,EAAE,EADH;MAEPG,UAAU,EAAE,mBAFL;MAGPF,UAAU,EAAE;IAHL,CALY;IAUrBG,OAAO,EAAE;MACPJ,QAAQ,EAAE,EADH;MAEPC,UAAU,EAAE;IAFL;EAVY,CAAhB;AADwB,CAAlB,CAAf"}
|
|
@@ -12,7 +12,7 @@ function getDefaultHeaderHeight(layout, modalPresentation, statusBarHeight) {
|
|
|
12
12
|
const isLandscape = layout.width > layout.height;
|
|
13
13
|
|
|
14
14
|
if (_reactNative.Platform.OS === 'ios') {
|
|
15
|
-
if (_reactNative.Platform.isPad || _reactNative.Platform.
|
|
15
|
+
if (_reactNative.Platform.isPad || _reactNative.Platform.isTV) {
|
|
16
16
|
if (modalPresentation) {
|
|
17
17
|
headerHeight = 56;
|
|
18
18
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","Platform","OS","isPad","isTV"],"sources":["getDefaultHeaderHeight.tsx"],"sourcesContent":["import { Platform } from 'react-native';\n\nimport type { Layout } from '../types';\n\nexport default function getDefaultHeaderHeight(\n layout: Layout,\n modalPresentation: boolean,\n statusBarHeight: number\n): number {\n let headerHeight;\n\n const isLandscape = layout.width > layout.height;\n\n if (Platform.OS === 'ios') {\n if (Platform.isPad || Platform.isTV) {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 50;\n }\n } else {\n if (isLandscape) {\n headerHeight = 32;\n } else {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 44;\n }\n }\n }\n } else if (Platform.OS === 'android') {\n headerHeight = 56;\n } else {\n headerHeight = 64;\n }\n\n return headerHeight + statusBarHeight;\n}\n"],"mappings":";;;;;;;AAAA;;AAIe,SAASA,sBAAT,CACbC,MADa,EAEbC,iBAFa,EAGbC,eAHa,EAIL;EACR,IAAIC,YAAJ;EAEA,MAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAP,GAAeL,MAAM,CAACM,MAA1C;;EAEA,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;IACzB,IAAID,qBAAA,CAASE,KAAT,IAAkBF,qBAAA,CAASG,IAA/B,EAAqC;MACnC,IAAIT,iBAAJ,EAAuB;QACrBE,YAAY,GAAG,EAAf;MACD,CAFD,MAEO;QACLA,YAAY,GAAG,EAAf;MACD;IACF,CAND,MAMO;MACL,IAAIC,WAAJ,EAAiB;QACfD,YAAY,GAAG,EAAf;MACD,CAFD,MAEO;QACL,IAAIF,iBAAJ,EAAuB;UACrBE,YAAY,GAAG,EAAf;QACD,CAFD,MAEO;UACLA,YAAY,GAAG,EAAf;QACD;MACF;IACF;EACF,CAlBD,MAkBO,IAAII,qBAAA,CAASC,EAAT,KAAgB,SAApB,EAA+B;IACpCL,YAAY,GAAG,EAAf;EACD,CAFM,MAEA;IACLA,YAAY,GAAG,EAAf;EACD;;EAED,OAAOA,YAAY,GAAGD,eAAtB;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"sources":["getHeaderTitle.tsx"],"sourcesContent":["import type { HeaderOptions } from '../types';\n\nexport default function getHeaderTitle(\n options: { title?: string; headerTitle?: HeaderOptions['headerTitle'] },\n fallback: string\n): string {\n return typeof options.headerTitle === 'string'\n ? options.headerTitle\n : options.title !== undefined\n ? options.title\n : fallback;\n}\n"],"mappings":";;;;;;;AAEe,SAASA,cAAT,CACbC,OADa,EAEbC,QAFa,EAGL;EACR,OAAO,OAAOD,OAAO,CAACE,WAAf,KAA+B,QAA/B,GACHF,OAAO,CAACE,WADL,GAEHF,OAAO,CAACG,KAAR,KAAkBC,SAAlB,GACAJ,OAAO,CAACG,KADR,GAEAF,QAJJ;AAKD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useHeaderHeight","height","React","useContext","HeaderHeightContext","undefined","Error"],"sources":["useHeaderHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport HeaderHeightContext from './HeaderHeightContext';\n\nexport default function useHeaderHeight() {\n const height = React.useContext(HeaderHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the header height. Are you inside a screen in a navigator with a header?\"\n );\n }\n\n return height;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;AAEe,SAASA,eAAT,GAA2B;EACxC,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAN,CAAiBC,4BAAjB,CAAf;;EAEA,IAAIH,MAAM,KAAKI,SAAf,EAA0B;IACxB,MAAM,IAAIC,KAAJ,CACJ,wFADI,CAAN;EAGD;;EAED,OAAOL,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MaskedView.android.tsx"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["MaskedView.android.tsx"],"sourcesContent":["export { default } from './MaskedViewNative';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MaskedView.ios.tsx"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["MaskedView.ios.tsx"],"sourcesContent":["export { default } from './MaskedViewNative';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["MaskedView","children"],"sources":["MaskedView.tsx"],"sourcesContent":["/**\n * Use a stub for MaskedView on all Platforms that don't support it.\n */\nimport type * as React from 'react';\n\ntype Props = {\n maskElement: React.ReactElement;\n children: React.ReactElement;\n};\n\nexport default function MaskedView({ children }: Props) {\n return children;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAQe,SAASA,UAAT,OAAyC;EAAA,IAArB;IAAEC;EAAF,CAAqB;EACtD,OAAOA,QAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["RNCMaskedView","require","default","e","isMaskedViewAvailable","UIManager","getViewManagerConfig","MaskedView","children","rest"],"sources":["MaskedViewNative.tsx"],"sourcesContent":["/**\n * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.\n */\nimport * as React from 'react';\nimport { UIManager } from 'react-native';\n\ntype MaskedViewType =\n typeof import('@react-native-masked-view/masked-view').default;\n\ntype Props = React.ComponentProps<MaskedViewType> & {\n children: React.ReactElement;\n};\n\nlet RNCMaskedView: MaskedViewType | undefined;\n\ntry {\n // Add try/catch to support usage even if it's not installed, since it's optional.\n // Newer versions of Metro will handle it properly.\n RNCMaskedView = require('@react-native-masked-view/masked-view').default;\n} catch (e) {\n // Ignore\n}\n\nconst isMaskedViewAvailable =\n UIManager.getViewManagerConfig('RNCMaskedView') != null;\n\nexport default function MaskedView({ children, ...rest }: Props) {\n if (isMaskedViewAvailable && RNCMaskedView) {\n return <RNCMaskedView {...rest}>{children}</RNCMaskedView>;\n }\n\n return children;\n}\n"],"mappings":";;;;;;;AAGA;;AACA;;;;;;AAJA;AACA;AACA;AAWA,IAAIA,aAAJ;;AAEA,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAD,CAAP,CAAiDC,OAAjE;AACD,CAJD,CAIE,OAAOC,CAAP,EAAU,CACV;AACD;;AAED,MAAMC,qBAAqB,GACzBC,sBAAA,CAAUC,oBAAV,CAA+B,eAA/B,KAAmD,IADrD;;AAGe,SAASC,UAAT,OAAkD;EAAA,IAA9B;IAAEC,QAAF;IAAY,GAAGC;EAAf,CAA8B;;EAC/D,IAAIL,qBAAqB,IAAIJ,aAA7B,EAA4C;IAC1C,oBAAO,oBAAC,aAAD,EAAmBS,IAAnB,EAA0BD,QAA1B,CAAP;EACD;;EAED,OAAOA,QAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["MissingIcon","color","size","style","styles","icon","fontSize","StyleSheet","create","backgroundColor"],"sources":["MissingIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { StyleProp, StyleSheet, Text, TextStyle } from 'react-native';\n\ntype Props = {\n color?: string;\n size?: number;\n style?: StyleProp<TextStyle>;\n};\n\nexport default function MissingIcon({ color, size, style }: Props) {\n return <Text style={[styles.icon, { color, fontSize: size }, style]}>⏷</Text>;\n}\n\nconst styles = StyleSheet.create({\n icon: {\n backgroundColor: 'transparent',\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAQe,SAASA,WAAT,OAAoD;EAAA,IAA/B;IAAEC,KAAF;IAASC,IAAT;IAAeC;EAAf,CAA+B;EACjE,oBAAO,oBAAC,iBAAD;IAAM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAR,EAAc;MAAEJ,KAAF;MAASK,QAAQ,EAAEJ;IAAnB,CAAd,EAAyCC,KAAzC;EAAb,YAAP;AACD;;AAED,MAAMC,MAAM,GAAGG,uBAAA,CAAWC,MAAX,CAAkB;EAC/BH,IAAI,EAAE;IACJI,eAAe,EAAE;EADb;AADyB,CAAlB,CAAf"}
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
const AnimatedPressable = _reactNative.Animated.createAnimatedComponent(_reactNative.Pressable);
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["AnimatedPressable","Animated","createAnimatedComponent","Pressable","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","Platform","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","useTheme","opacity","React","useState","Value","animateTo","toValue","duration","timing","easing","Easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sources":["PlatformPressable.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Easing,\n GestureResponderEvent,\n Platform,\n Pressable,\n PressableProps,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nexport type Props = Omit<PressableProps, 'style'> & {\n pressColor?: string;\n pressOpacity?: number;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n children: React.ReactNode;\n};\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst ANDROID_VERSION_LOLLIPOP = 21;\nconst ANDROID_SUPPORTS_RIPPLE =\n Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;\n\n/**\n * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.\n */\nexport default function PlatformPressable({\n onPressIn,\n onPressOut,\n android_ripple,\n pressColor,\n pressOpacity = 0.3,\n style,\n ...rest\n}: Props) {\n const { dark } = useTheme();\n const [opacity] = React.useState(() => new Animated.Value(1));\n\n const animateTo = (toValue: number, duration: number) => {\n if (ANDROID_SUPPORTS_RIPPLE) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: true,\n }).start();\n };\n\n const handlePressIn = (e: GestureResponderEvent) => {\n animateTo(pressOpacity, 0);\n onPressIn?.(e);\n };\n\n const handlePressOut = (e: GestureResponderEvent) => {\n animateTo(1, 200);\n onPressOut?.(e);\n };\n\n return (\n <AnimatedPressable\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n android_ripple={\n ANDROID_SUPPORTS_RIPPLE\n ? {\n color:\n pressColor !== undefined\n ? pressColor\n : dark\n ? 'rgba(255, 255, 255, .32)'\n : 'rgba(0, 0, 0, .32)',\n ...android_ripple,\n }\n : undefined\n }\n style={[{ opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1 }, style]}\n {...rest}\n />\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAkBA,MAAMA,iBAAiB,GAAGC,qBAAA,CAASC,uBAAT,CAAiCC,sBAAjC,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAC3BC,qBAAA,CAASC,EAAT,KAAgB,SAAhB,IAA6BD,qBAAA,CAASE,OAAT,IAAoBJ,wBADnD;AAGA;AACA;AACA;;AACe,SAASK,iBAAT,OAQL;EAAA,IARgC;IACxCC,SADwC;IAExCC,UAFwC;IAGxCC,cAHwC;IAIxCC,UAJwC;IAKxCC,YAAY,GAAG,GALyB;IAMxCC,KANwC;IAOxC,GAAGC;EAPqC,CAQhC;EACR,MAAM;IAAEC;EAAF,IAAW,IAAAC,gBAAA,GAAjB;EACA,MAAM,CAACC,OAAD,IAAYC,KAAK,CAACC,QAAN,CAAe,MAAM,IAAIpB,qBAAA,CAASqB,KAAb,CAAmB,CAAnB,CAArB,CAAlB;;EAEA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAkBC,QAAlB,KAAuC;IACvD,IAAIpB,uBAAJ,EAA6B;MAC3B;IACD;;IAEDJ,qBAAA,CAASyB,MAAT,CAAgBP,OAAhB,EAAyB;MACvBK,OADuB;MAEvBC,QAFuB;MAGvBE,MAAM,EAAEC,mBAAA,CAAOC,KAAP,CAAaD,mBAAA,CAAOE,IAApB,CAHe;MAIvBC,eAAe,EAAE;IAJM,CAAzB,EAKGC,KALH;EAMD,CAXD;;EAaA,MAAMC,aAAa,GAAIC,CAAD,IAA8B;IAClDX,SAAS,CAACT,YAAD,EAAe,CAAf,CAAT;IACAJ,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAGwB,CAAH,CAAT;EACD,CAHD;;EAKA,MAAMC,cAAc,GAAID,CAAD,IAA8B;IACnDX,SAAS,CAAC,CAAD,EAAI,GAAJ,CAAT;IACAZ,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAGuB,CAAH,CAAV;EACD,CAHD;;EAKA,oBACE,oBAAC,iBAAD;IACE,SAAS,EAAED,aADb;IAEE,UAAU,EAAEE,cAFd;IAGE,cAAc,EACZ9B,uBAAuB,GACnB;MACE+B,KAAK,EACHvB,UAAU,KAAKwB,SAAf,GACIxB,UADJ,GAEII,IAAI,GACJ,0BADI,GAEJ,oBANR;MAOE,GAAGL;IAPL,CADmB,GAUnByB,SAdR;IAgBE,KAAK,EAAE,CAAC;MAAElB,OAAO,EAAE,CAACd,uBAAD,GAA2Bc,OAA3B,GAAqC;IAAhD,CAAD,EAAsDJ,KAAtD;EAhBT,GAiBMC,IAjBN,EADF;AAqBD"}
|
|
@@ -13,7 +13,7 @@ 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
|
-
function _extends() { _extends = Object.assign
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
|
|
19
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"sources":["ResourceSavingView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Platform, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\ntype Props = {\n visible: boolean;\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container\n\nexport default function ResourceSavingScene({\n visible,\n children,\n style,\n ...rest\n}: Props) {\n if (Platform.OS === 'web') {\n return (\n <View\n // @ts-expect-error: hidden exists on web, but not in React Native\n hidden={!visible}\n style={[\n { display: visible ? 'flex' : 'none' },\n styles.container,\n style,\n ]}\n pointerEvents={visible ? 'auto' : 'none'}\n {...rest}\n >\n {children}\n </View>\n );\n }\n\n return (\n <View\n style={[styles.container, style]}\n // box-none doesn't seem to work properly on Android\n pointerEvents={visible ? 'auto' : 'none'}\n >\n <View\n collapsable={false}\n removeClippedSubviews={\n // On iOS & macOS, set removeClippedSubviews to true only when not focused\n // This is an workaround for a bug where the clipped view never re-appears\n Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true\n }\n pointerEvents={visible ? 'auto' : 'none'}\n style={visible ? styles.attached : styles.detached}\n >\n {children}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n attached: {\n flex: 1,\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY,\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;AAQA,MAAMA,YAAY,GAAG,KAArB,C,CAA4B;;AAEb,SAASC,mBAAT,OAKL;EAAA,IALkC;IAC1CC,OAD0C;IAE1CC,QAF0C;IAG1CC,KAH0C;IAI1C,GAAGC;EAJuC,CAKlC;;EACR,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;IACzB,oBACE,oBAAC,iBAAD,CACE;IADF;MAEE,MAAM,EAAE,CAACL,OAFX;MAGE,KAAK,EAAE,CACL;QAAEM,OAAO,EAAEN,OAAO,GAAG,MAAH,GAAY;MAA9B,CADK,EAELO,MAAM,CAACC,SAFF,EAGLN,KAHK,CAHT;MAQE,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;IARpC,GASMG,IATN,GAWGF,QAXH,CADF;EAeD;;EAED,oBACE,oBAAC,iBAAD;IACE,KAAK,EAAE,CAACM,MAAM,CAACC,SAAR,EAAmBN,KAAnB,CADT,CAEE;IAFF;IAGE,aAAa,EAAEF,OAAO,GAAG,MAAH,GAAY;EAHpC,gBAKE,oBAAC,iBAAD;IACE,WAAW,EAAE,KADf;IAEE,qBAAqB,EACnB;IACA;IACAI,qBAAA,CAASC,EAAT,KAAgB,KAAhB,IAAyBD,qBAAA,CAASC,EAAT,KAAgB,OAAzC,GAAmD,CAACL,OAApD,GAA8D,IALlE;IAOE,aAAa,EAAEA,OAAO,GAAG,MAAH,GAAY,MAPpC;IAQE,KAAK,EAAEA,OAAO,GAAGO,MAAM,CAACE,QAAV,GAAqBF,MAAM,CAACG;EAR5C,GAUGT,QAVH,CALF,CADF;AAoBD;;AAED,MAAMM,MAAM,GAAGI,uBAAA,CAAWC,MAAX,CAAkB;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE,CADG;IAETC,QAAQ,EAAE;EAFD,CADoB;EAK/BL,QAAQ,EAAE;IACRI,IAAI,EAAE;EADE,CALqB;EAQ/BH,QAAQ,EAAE;IACRG,IAAI,EAAE,CADE;IAERE,GAAG,EAAEjB;EAFG;AARqB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","StyleSheet","create","flex"],"sources":["SafeAreaProviderCompat.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Dimensions,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport {\n initialWindowMetrics,\n SafeAreaInsetsContext,\n SafeAreaProvider,\n} from 'react-native-safe-area-context';\n\ntype Props = {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst { width = 0, height = 0 } = Dimensions.get('window');\n\n// To support SSR on web, we need to have empty insets for initial values\n// Otherwise there can be mismatch between SSR and client output\n// We also need to specify empty values to support tests environments\nconst initialMetrics =\n Platform.OS === 'web' || initialWindowMetrics == null\n ? {\n frame: { x: 0, y: 0, width, height },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : initialWindowMetrics;\n\nexport default function SafeAreaProviderCompat({ children, style }: Props) {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) => {\n if (insets) {\n // If we already have insets, don't wrap the stack in another safe area provider\n // This avoids an issue with updates at the cost of potentially incorrect values\n // https://github.com/react-navigation/react-navigation/issues/174\n return <View style={[styles.container, style]}>{children}</View>;\n }\n\n return (\n <SafeAreaProvider initialMetrics={initialMetrics} style={style}>\n {children}\n </SafeAreaProvider>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n}\n\nSafeAreaProviderCompat.initialMetrics = initialMetrics;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAQA;;;;;;AAWA,MAAM;EAAEA,KAAK,GAAG,CAAV;EAAaC,MAAM,GAAG;AAAtB,IAA4BC,uBAAA,CAAWC,GAAX,CAAe,QAAf,CAAlC,C,CAEA;AACA;AACA;;;AACA,MAAMC,cAAc,GAClBC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,IAAyBC,gDAAA,IAAwB,IAAjD,GACI;EACEC,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAL;IAAQC,CAAC,EAAE,CAAX;IAAcV,KAAd;IAAqBC;EAArB,CADT;EAEEU,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAP;IAAUC,IAAI,EAAE,CAAhB;IAAmBC,KAAK,EAAE,CAA1B;IAA6BC,MAAM,EAAE;EAArC;AAFV,CADJ,GAKIR,gDANN;;AAQe,SAASS,sBAAT,OAA4D;EAAA,IAA5B;IAAEC,QAAF;IAAYC;EAAZ,CAA4B;EACzE,oBACE,oBAAC,iDAAD,CAAuB,QAAvB,QACIP,MAAD,IAAY;IACX,IAAIA,MAAJ,EAAY;MACV;MACA;MACA;MACA,oBAAO,oBAAC,iBAAD;QAAM,KAAK,EAAE,CAACQ,MAAM,CAACC,SAAR,EAAmBF,KAAnB;MAAb,GAAyCD,QAAzC,CAAP;IACD;;IAED,oBACE,oBAAC,4CAAD;MAAkB,cAAc,EAAEb,cAAlC;MAAkD,KAAK,EAAEc;IAAzD,GACGD,QADH,CADF;EAKD,CAdH,CADF;AAkBD;;AAEDD,sBAAsB,CAACZ,cAAvB,GAAwCA,cAAxC;;AAEA,MAAMe,MAAM,GAAGE,uBAAA,CAAWC,MAAX,CAAkB;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EADG;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Screen","props","dimensions","useSafeAreaFrame","insets","useSafeAreaInsets","isParentHeaderShown","React","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","getDefaultHeaderHeight","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"sources":["Screen.tsx"],"sourcesContent":["import {\n NavigationContext,\n NavigationProp,\n NavigationRouteContext,\n ParamListBase,\n RouteProp,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport Background from './Background';\nimport getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';\nimport HeaderHeightContext from './Header/HeaderHeightContext';\nimport HeaderShownContext from './Header/HeaderShownContext';\n\ntype Props = {\n focused: boolean;\n modal?: boolean;\n navigation: NavigationProp<ParamListBase>;\n route: RouteProp<ParamListBase>;\n header: React.ReactNode;\n headerShown?: boolean;\n headerStatusBarHeight?: number;\n headerTransparent?: boolean;\n style?: StyleProp<ViewStyle>;\n children: React.ReactNode;\n};\n\nexport default function Screen(props: Props) {\n const dimensions = useSafeAreaFrame();\n const insets = useSafeAreaInsets();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const {\n focused,\n modal = false,\n header,\n headerShown = true,\n headerTransparent,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n navigation,\n route,\n children,\n style,\n } = props;\n\n const [headerHeight, setHeaderHeight] = React.useState(() =>\n getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight)\n );\n\n return (\n <Background\n accessibilityElementsHidden={!focused}\n importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}\n style={[styles.container, style]}\n >\n <View style={styles.content}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || headerShown !== false}\n >\n <HeaderHeightContext.Provider\n value={headerShown ? headerHeight : parentHeaderHeight ?? 0}\n >\n {children}\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </View>\n {headerShown ? (\n <NavigationContext.Provider value={navigation}>\n <NavigationRouteContext.Provider value={route}>\n <View\n onLayout={(e) => {\n const { height } = e.nativeEvent.layout;\n\n setHeaderHeight(height);\n }}\n style={headerTransparent ? styles.absolute : null}\n >\n {header}\n </View>\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n ) : null}\n </Background>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse',\n },\n // This is necessary to avoid applying 'column-reverse' to screen content\n content: {\n flex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n },\n});\n"],"mappings":";;;;;;;AAAA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;;;;;;;AAee,SAASA,MAAT,CAAgBC,KAAhB,EAA8B;EAC3C,MAAMC,UAAU,GAAG,IAAAC,4CAAA,GAAnB;EACA,MAAMC,MAAM,GAAG,IAAAC,6CAAA,GAAf;EAEA,MAAMC,mBAAmB,GAAGC,KAAK,CAACC,UAAN,CAAiBC,2BAAjB,CAA5B;EACA,MAAMC,kBAAkB,GAAGH,KAAK,CAACC,UAAN,CAAiBG,4BAAjB,CAA3B;EAEA,MAAM;IACJC,OADI;IAEJC,KAAK,GAAG,KAFJ;IAGJC,MAHI;IAIJC,WAAW,GAAG,IAJV;IAKJC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AA,CAAWC,MAAX,CAAkB;EAC/BR,SAAS,EAAE;IACTS,IAAI,EAAE,CADG;IAETC,aAAa,EAAE;EAFN,CADoB;EAK/B;EACAT,OAAO,EAAE;IACPQ,IAAI,EAAE;EADC,CANsB;EAS/BH,QAAQ,EAAE;IACRK,QAAQ,EAAE,UADF;IAERrB,GAAG,EAAE,CAFG;IAGRsB,IAAI,EAAE,CAHE;IAIRC,KAAK,EAAE;EAJC;AATqB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["contexts","global","Map","getNamedContext","name","initialValue","context","get","React","createContext","displayName","set"],"sources":["getNamedContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nconst contexts = '__react_navigation__elements_contexts';\n\ndeclare global {\n var __react_navigation__elements_contexts: Map<string, React.Context<any>>;\n}\n\n// We use a global variable to keep our contexts so that we can reuse same contexts across packages\nglobal[contexts] = global[contexts] ?? new Map<string, React.Context<any>>();\n\nexport default function getNamedContext<T>(\n name: string,\n initialValue: T\n): React.Context<T> {\n let context = global[contexts].get(name);\n\n if (context) {\n return context;\n }\n\n context = React.createContext<T>(initialValue);\n context.displayName = name;\n\n global[contexts].set(name, context);\n\n return context;\n}\n"],"mappings":";;;;;;;AAAA;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,uCAAjB;AAMA;AACAC,MAAM,CAACD,QAAD,CAAN,uBAAmBC,MAAM,CAACD,QAAD,CAAzB,+DAAuC,IAAIE,GAAJ,EAAvC;;AAEe,SAASC,eAAT,CACbC,IADa,EAEbC,YAFa,EAGK;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAD,CAAN,CAAiBO,GAAjB,CAAqBH,IAArB,CAAd;;EAEA,IAAIE,OAAJ,EAAa;IACX,OAAOA,OAAP;EACD;;EAEDA,OAAO,gBAAGE,KAAK,CAACC,aAAN,CAAuBJ,YAAvB,CAAV;EACAC,OAAO,CAACI,WAAR,GAAsBN,IAAtB;EAEAH,MAAM,CAACD,QAAD,CAAN,CAAiBW,GAAjB,CAAqBP,IAArB,EAA2BE,OAA3B;EAEA,OAAOA,OAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Assets","require"],"sources":["index.tsx"],"sourcesContent":["export { default as Background } from './Background';\nexport { default as getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight';\nexport { default as getHeaderTitle } from './Header/getHeaderTitle';\nexport { default as Header } from './Header/Header';\nexport { default as HeaderBackButton } from './Header/HeaderBackButton';\nexport { default as HeaderBackContext } from './Header/HeaderBackContext';\nexport { default as HeaderBackground } from './Header/HeaderBackground';\nexport { default as HeaderHeightContext } from './Header/HeaderHeightContext';\nexport { default as HeaderShownContext } from './Header/HeaderShownContext';\nexport { default as HeaderTitle } from './Header/HeaderTitle';\nexport { default as useHeaderHeight } from './Header/useHeaderHeight';\nexport { default as MissingIcon } from './MissingIcon';\nexport { default as PlatformPressable } from './PlatformPressable';\nexport { default as ResourceSavingView } from './ResourceSavingView';\nexport { default as SafeAreaProviderCompat } from './SafeAreaProviderCompat';\nexport { default as Screen } from './Screen';\n\nexport const Assets = [\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon.png'),\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon-mask.png'),\n];\n\nexport * from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AASA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AAPO,MAAMA,MAAM,GAAG,CACpB;AACAC,OAAO,CAAC,wBAAD,CAFa,EAGpB;AACAA,OAAO,CAAC,6BAAD,CAJa,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type {\n Animated,\n LayoutChangeEvent,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nexport type Layout = { width: number; height: number };\n\nexport type HeaderOptions = {\n /**\n * String or a function that returns a React Element to be used by the header.\n * Defaults to screen `title` or route name.\n *\n * It receives `allowFontScaling`, `tintColor`, `style` and `children` in the options object as an argument.\n * The title string is passed in `children`.\n */\n headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);\n /**\n * How to align the the header title.\n * Defaults to `center` on iOS and `left` on Android.\n */\n headerTitleAlign?: 'left' | 'center';\n /**\n * Style object for the title component.\n */\n headerTitleStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Style object for the container of the `headerTitle` element.\n */\n headerTitleContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether header title font should scale to respect Text Size accessibility settings. Defaults to `false`.\n */\n headerTitleAllowFontScaling?: boolean;\n /**\n * Function which returns a React Element to display on the left side of the header.\n */\n headerLeft?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n labelVisible?: boolean;\n }) => React.ReactNode;\n /**\n * Whether a label is visible in the left button. Used to add extra padding.\n */\n headerLeftLabelVisible?: boolean;\n /**\n * Style object for the container of the `headerLeft` element`.\n */\n headerLeftContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Function which returns a React Element to display on the right side of the header.\n */\n headerRight?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerRight` element.\n */\n headerRightContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressOpacity?: number;\n /**\n * Tint color for the header.\n */\n headerTintColor?: string;\n /**\n * Function which returns a React Element to render as the background of the header.\n * This is useful for using backgrounds such as an image, a gradient, blur effect etc.\n * You can use this with `headerTransparent` to render a blur view, for example, to create a translucent header.\n */\n headerBackground?: (props: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerBackground` element.\n */\n headerBackgroundContainerStyle?: Animated.WithAnimatedValue<\n StyleProp<ViewStyle>\n >;\n /**\n * Defaults to `false`. If `true`, the header will not have a background unless you explicitly provide it with `headerBackground`.\n * The header will also float over the screen so that it overlaps the content underneath.\n * This is useful if you want to render a semi-transparent header or a blurred background.\n */\n headerTransparent?: boolean;\n /**\n * Style object for the header. You can specify a custom background color here, for example.\n */\n headerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.\n *\n * This is a short-hand for the following styles:\n *\n * ```js\n * {\n * elevation: 0,\n * shadowOpacity: 0,\n * borderBottomWidth: 0,\n * }\n * ```\n *\n * If the above styles are specified in `headerStyle` along with `headerShadowVisible: false`,\n * then `headerShadowVisible: false` will take precedence.\n */\n headerShadowVisible?: boolean;\n /**\n * Extra padding to add at the top of header to account for translucent status bar.\n * By default, it uses the top value from the safe area insets of the device.\n * Pass 0 or a custom value to disable the default behaviour, and customize the height.\n */\n headerStatusBarHeight?: number;\n};\n\nexport type HeaderTitleProps = {\n /**\n * The title text of the header.\n */\n children: string;\n /**\n * Whether title font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Tint color for the header.\n */\n tintColor?: string;\n /**\n * Callback to trigger when the size of the title element changes.\n */\n onLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Style object for the title element.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport type HeaderButtonProps = {\n /**\n * Tint color for the header button.\n */\n tintColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n pressColor?: string;\n /**\n * Opacity when the button is pressed, used when ripple is not supported.\n */\n pressOpacity?: number;\n /**\n * Whether it's possible to navigate back in stack.\n */\n canGoBack?: boolean;\n};\n\nexport type HeaderBackButtonProps = HeaderButtonProps & {\n /**\n * Whether the button is disabled.\n */\n disabled?: boolean;\n /**\n * Callback to call when the button is pressed.\n */\n onPress?: () => void;\n /**\n * Function which returns a React Element to display custom image in header's back button.\n */\n backImage?: (props: { tintColor: string }) => React.ReactNode;\n /**\n * Label text for the button. Usually the title of the previous screen.\n * By default, this is only shown on iOS.\n */\n label?: string;\n /**\n * Label text to show when there isn't enough space for the full label.\n */\n truncatedLabel?: string;\n /**\n * Whether the label text is visible.\n * Defaults to `true` on iOS and `false` on Android.\n */\n labelVisible?: boolean;\n /**\n * Style object for the label.\n */\n labelStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Callback to trigger when the size of the label changes.\n */\n onLabelLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Layout of the screen.\n */\n screenLayout?: Layout;\n /**\n * Layout of the title element in the header.\n */\n titleLayout?: Layout;\n /**\n * Accessibility label for the button for screen readers.\n */\n accessibilityLabel?: string;\n /**\n * ID to locate this button in tests.\n */\n testID?: string;\n /**\n * Style object for the button.\n */\n style?: StyleProp<ViewStyle>;\n};\n"],"mappings":""}
|
package/lib/module/Background.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
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
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useTheme","React","View","Background","style","rest","colors","flex","backgroundColor","background"],"sources":["Background.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { View, ViewProps } from 'react-native';\n\ntype Props = ViewProps & {\n children: React.ReactNode;\n};\n\nexport default function Background({ style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <View\n {...rest}\n style={[{ flex: 1, backgroundColor: colors.background }, style]}\n />\n );\n}\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAgC,cAAhC;AAMA,eAAe,SAASC,UAAT,OAA+C;EAAA,IAA3B;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAA2B;EAC5D,MAAM;IAAEC;EAAF,IAAaN,QAAQ,EAA3B;EAEA,oBACE,oBAAC,IAAD,eACMK,IADN;IAEE,KAAK,EAAE,CAAC;MAAEE,IAAI,EAAE,CAAR;MAAWC,eAAe,EAAEF,MAAM,CAACG;IAAnC,CAAD,EAAkDL,KAAlD;EAFT,GADF;AAMD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Header.tsx"],"names":["React","Animated","Platform","StyleSheet","View","useSafeAreaFrame","useSafeAreaInsets","getDefaultHeaderHeight","HeaderBackground","HeaderShownContext","HeaderTitle","warnIfHeaderStylesDefined","styles","Object","keys","forEach","styleProp","value","console","warn","undefined","Header","props","insets","frame","isParentHeaderShown","useContext","layout","modal","title","headerTitle","customTitle","headerTitleAlign","select","ios","default","headerLeft","headerLeftLabelVisible","headerTransparent","headerTintColor","headerBackground","headerRight","headerTitleAllowFontScaling","titleAllowFontScaling","headerTitleStyle","titleStyle","headerLeftContainerStyle","leftContainerStyle","headerRightContainerStyle","rightContainerStyle","headerTitleContainerStyle","titleContainerStyle","headerBackgroundContainerStyle","backgroundContainerStyle","headerStyle","customHeaderStyle","headerShadowVisible","headerPressColor","headerPressOpacity","headerStatusBarHeight","top","defaultHeight","height","minHeight","maxHeight","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","boxShadow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","opacity","transform","unsafeStyles","flatten","process","env","NODE_ENV","safeStyles","backgroundStyle","leftButton","tintColor","pressColor","pressOpacity","labelVisible","rightButton","absoluteFill","zIndex","style","content","left","expand","marginStart","maxWidth","width","Math","max","right","children","allowFontScaling","marginEnd","create","flex","flexDirection","alignItems","marginHorizontal","justifyContent","flexGrow","flexBasis"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,UAA7B,EAAyCC,IAAzC,QAAgE,cAAhE;AACA,SACEC,gBADF,EAEEC,iBAFF,QAGO,gCAHP;AAMA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,kBAAP,MAA+B,sBAA/B;AACA,OAAOC,WAAP,MAAwB,eAAxB;;AAiBA,MAAMC,yBAAyB,GAAIC,MAAD,IAAiC;AACjEC,EAAAA,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,OAApB,CAA6BC,SAAD,IAAe;AACzC,UAAMC,KAAK,GAAGL,MAAM,CAACI,SAAD,CAApB;;AAEA,QAAIA,SAAS,KAAK,UAAd,IAA4BC,KAAK,KAAK,UAA1C,EAAsD;AACpDC,MA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AAES,MAAAA,SAAS,EAAEtG,MAAM,CAACmG;AAApB,KAHK,EAILzE,mBAJK;AAFT,KASG6D,WATH,CA5CF,CALF,CAfF,CADF;AAgFD;AAED,MAAMlG,MAAM,GAAGT,UAAU,CAAC2H,MAAX,CAAkB;AAC/BZ,EAAAA,OAAO,EAAE;AACPa,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,aAAa,EAAE,KAFR;AAGPC,IAAAA,UAAU,EAAE;AAHL,GADsB;AAM/BpG,EAAAA,KAAK,EAAE;AACLqG,IAAAA,gBAAgB,EAAE,EADb;AAELC,IAAAA,cAAc,EAAE;AAFX,GANwB;AAU/BhB,EAAAA,IAAI,EAAE;AACJgB,IAAAA,cAAc,EAAE,QADZ;AAEJF,IAAAA,UAAU,EAAE;AAFR,GAVyB;AAc/BP,EAAAA,KAAK,EAAE;AACLS,IAAAA,cAAc,EAAE,QADX;AAELF,IAAAA,UAAU,EAAE;AAFP,GAdwB;AAkB/Bb,EAAAA,MAAM,EAAE;AACNgB,IAAAA,QAAQ,EAAE,CADJ;AAENC,IAAAA,SAAS,EAAE;AAFL;AAlBuB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { Animated, Platform, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport type { HeaderOptions, Layout } from '../types';\nimport getDefaultHeaderHeight from './getDefaultHeaderHeight';\nimport HeaderBackground from './HeaderBackground';\nimport HeaderShownContext from './HeaderShownContext';\nimport HeaderTitle from './HeaderTitle';\n\ntype Props = HeaderOptions & {\n /**\n * Whether the header is in a modal\n */\n modal?: boolean;\n /**\n * Layout of the screen.\n */\n layout?: Layout;\n /**\n * Title text for the header.\n */\n title: string;\n};\n\nconst warnIfHeaderStylesDefined = (styles: Record<string, any>) => {\n Object.keys(styles).forEach((styleProp) => {\n const value = styles[styleProp];\n\n if (styleProp === 'position' && value === 'absolute') {\n console.warn(\n \"position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.\"\n );\n } else if (value !== undefined) {\n console.warn(\n `${styleProp} was given a value of ${value}, this has no effect on headerStyle.`\n );\n }\n });\n};\n\nexport default function Header(props: Props) {\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n\n const {\n layout = frame,\n modal = false,\n title,\n headerTitle: customTitle,\n headerTitleAlign = Platform.select({\n ios: 'center',\n default: 'left',\n }),\n headerLeft,\n headerLeftLabelVisible,\n headerTransparent,\n headerTintColor,\n headerBackground,\n headerRight,\n headerTitleAllowFontScaling: titleAllowFontScaling,\n headerTitleStyle: titleStyle,\n headerLeftContainerStyle: leftContainerStyle,\n headerRightContainerStyle: rightContainerStyle,\n headerTitleContainerStyle: titleContainerStyle,\n headerBackgroundContainerStyle: backgroundContainerStyle,\n headerStyle: customHeaderStyle,\n headerShadowVisible,\n headerPressColor,\n headerPressOpacity,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n } = props;\n\n const defaultHeight = getDefaultHeaderHeight(\n layout,\n modal,\n headerStatusBarHeight\n );\n\n const {\n height = defaultHeight,\n minHeight,\n maxHeight,\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: web support for shadow\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n ...unsafeStyles\n } = StyleSheet.flatten(customHeaderStyle || {}) as ViewStyle;\n\n if (process.env.NODE_ENV !== 'production') {\n warnIfHeaderStylesDefined(unsafeStyles);\n }\n\n const safeStyles: ViewStyle = {\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: boxShadow is only for Web\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n };\n\n // Setting a property to undefined triggers default style\n // So we need to filter them out\n // Users can use `null` instead\n for (const styleProp in safeStyles) {\n // @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles\n if (safeStyles[styleProp] === undefined) {\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete safeStyles[styleProp];\n }\n }\n\n const backgroundStyle = [\n safeStyles,\n headerShadowVisible === false && {\n elevation: 0,\n shadowOpacity: 0,\n borderBottomWidth: 0,\n },\n ];\n\n const leftButton = headerLeft\n ? headerLeft({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n labelVisible: headerLeftLabelVisible,\n })\n : null;\n\n const rightButton = headerRight\n ? headerRight({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n })\n : null;\n\n const headerTitle =\n typeof customTitle !== 'function'\n ? (props: React.ComponentProps<typeof HeaderTitle>) => (\n <HeaderTitle {...props} />\n )\n : customTitle;\n\n return (\n <React.Fragment>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n StyleSheet.absoluteFill,\n { zIndex: 0 },\n backgroundContainerStyle,\n ]}\n >\n {headerBackground ? (\n headerBackground({ style: backgroundStyle })\n ) : headerTransparent ? null : (\n <HeaderBackground style={backgroundStyle} />\n )}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[{ height, minHeight, maxHeight, opacity, transform }]}\n >\n <View pointerEvents=\"none\" style={{ height: headerStatusBarHeight }} />\n <View pointerEvents=\"box-none\" style={styles.content}>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.left,\n headerTitleAlign === 'center' && styles.expand,\n { marginStart: insets.left },\n leftContainerStyle,\n ]}\n >\n {leftButton}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.title,\n {\n // Avoid the title from going offscreen or overlapping buttons\n maxWidth:\n headerTitleAlign === 'center'\n ? layout.width -\n ((leftButton\n ? headerLeftLabelVisible !== false\n ? 80\n : 32\n : 16) +\n Math.max(insets.left, insets.right)) *\n 2\n : layout.width -\n ((leftButton ? 72 : 16) +\n (rightButton ? 72 : 16) +\n insets.left -\n insets.right),\n },\n titleContainerStyle,\n ]}\n >\n {headerTitle({\n children: title,\n allowFontScaling: titleAllowFontScaling,\n tintColor: headerTintColor,\n style: titleStyle,\n })}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.right,\n styles.expand,\n { marginEnd: insets.right },\n rightContainerStyle,\n ]}\n >\n {rightButton}\n </Animated.View>\n </View>\n </Animated.View>\n </React.Fragment>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'stretch',\n },\n title: {\n marginHorizontal: 16,\n justifyContent: 'center',\n },\n left: {\n justifyContent: 'center',\n alignItems: 'flex-start',\n },\n right: {\n justifyContent: 'center',\n alignItems: 'flex-end',\n },\n expand: {\n flexGrow: 1,\n flexBasis: 0,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["React","Animated","Platform","StyleSheet","View","useSafeAreaFrame","useSafeAreaInsets","getDefaultHeaderHeight","HeaderBackground","HeaderShownContext","HeaderTitle","warnIfHeaderStylesDefined","styles","Object","keys","forEach","styleProp","value","console","warn","undefined","Header","props","insets","frame","isParentHeaderShown","useContext","layout","modal","title","headerTitle","customTitle","headerTitleAlign","select","ios","default","headerLeft","headerLeftLabelVisible","headerTransparent","headerTintColor","headerBackground","headerRight","headerTitleAllowFontScaling","titleAllowFontScaling","headerTitleStyle","titleStyle","headerLeftContainerStyle","leftContainerStyle","headerRightContainerStyle","rightContainerStyle","headerTitleContainerStyle","titleContainerStyle","headerBackgroundContainerStyle","backgroundContainerStyle","headerStyle","customHeaderStyle","headerShadowVisible","headerPressColor","headerPressOpacity","headerStatusBarHeight","top","defaultHeight","height","minHeight","maxHeight","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","boxShadow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","opacity","transform","unsafeStyles","flatten","process","env","NODE_ENV","safeStyles","backgroundStyle","leftButton","tintColor","pressColor","pressOpacity","labelVisible","rightButton","absoluteFill","zIndex","style","content","left","expand","marginStart","maxWidth","width","Math","max","right","children","allowFontScaling","marginEnd","create","flex","flexDirection","alignItems","marginHorizontal","justifyContent","flexGrow","flexBasis"],"sources":["Header.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Animated, Platform, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport type { HeaderOptions, Layout } from '../types';\nimport getDefaultHeaderHeight from './getDefaultHeaderHeight';\nimport HeaderBackground from './HeaderBackground';\nimport HeaderShownContext from './HeaderShownContext';\nimport HeaderTitle from './HeaderTitle';\n\ntype Props = HeaderOptions & {\n /**\n * Whether the header is in a modal\n */\n modal?: boolean;\n /**\n * Layout of the screen.\n */\n layout?: Layout;\n /**\n * Title text for the header.\n */\n title: string;\n};\n\nconst warnIfHeaderStylesDefined = (styles: Record<string, any>) => {\n Object.keys(styles).forEach((styleProp) => {\n const value = styles[styleProp];\n\n if (styleProp === 'position' && value === 'absolute') {\n console.warn(\n \"position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.\"\n );\n } else if (value !== undefined) {\n console.warn(\n `${styleProp} was given a value of ${value}, this has no effect on headerStyle.`\n );\n }\n });\n};\n\nexport default function Header(props: Props) {\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n\n const {\n layout = frame,\n modal = false,\n title,\n headerTitle: customTitle,\n headerTitleAlign = Platform.select({\n ios: 'center',\n default: 'left',\n }),\n headerLeft,\n headerLeftLabelVisible,\n headerTransparent,\n headerTintColor,\n headerBackground,\n headerRight,\n headerTitleAllowFontScaling: titleAllowFontScaling,\n headerTitleStyle: titleStyle,\n headerLeftContainerStyle: leftContainerStyle,\n headerRightContainerStyle: rightContainerStyle,\n headerTitleContainerStyle: titleContainerStyle,\n headerBackgroundContainerStyle: backgroundContainerStyle,\n headerStyle: customHeaderStyle,\n headerShadowVisible,\n headerPressColor,\n headerPressOpacity,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n } = props;\n\n const defaultHeight = getDefaultHeaderHeight(\n layout,\n modal,\n headerStatusBarHeight\n );\n\n const {\n height = defaultHeight,\n minHeight,\n maxHeight,\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: web support for shadow\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n ...unsafeStyles\n } = StyleSheet.flatten(customHeaderStyle || {}) as ViewStyle;\n\n if (process.env.NODE_ENV !== 'production') {\n warnIfHeaderStylesDefined(unsafeStyles);\n }\n\n const safeStyles: ViewStyle = {\n backgroundColor,\n borderBottomColor,\n borderBottomEndRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderBottomStartRadius,\n borderBottomWidth,\n borderColor,\n borderEndColor,\n borderEndWidth,\n borderLeftColor,\n borderLeftWidth,\n borderRadius,\n borderRightColor,\n borderRightWidth,\n borderStartColor,\n borderStartWidth,\n borderStyle,\n borderTopColor,\n borderTopEndRadius,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderTopStartRadius,\n borderTopWidth,\n borderWidth,\n // @ts-expect-error: boxShadow is only for Web\n boxShadow,\n elevation,\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n opacity,\n transform,\n };\n\n // Setting a property to undefined triggers default style\n // So we need to filter them out\n // Users can use `null` instead\n for (const styleProp in safeStyles) {\n // @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles\n if (safeStyles[styleProp] === undefined) {\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete safeStyles[styleProp];\n }\n }\n\n const backgroundStyle = [\n safeStyles,\n headerShadowVisible === false && {\n elevation: 0,\n shadowOpacity: 0,\n borderBottomWidth: 0,\n },\n ];\n\n const leftButton = headerLeft\n ? headerLeft({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n labelVisible: headerLeftLabelVisible,\n })\n : null;\n\n const rightButton = headerRight\n ? headerRight({\n tintColor: headerTintColor,\n pressColor: headerPressColor,\n pressOpacity: headerPressOpacity,\n })\n : null;\n\n const headerTitle =\n typeof customTitle !== 'function'\n ? (props: React.ComponentProps<typeof HeaderTitle>) => (\n <HeaderTitle {...props} />\n )\n : customTitle;\n\n return (\n <React.Fragment>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n StyleSheet.absoluteFill,\n { zIndex: 0 },\n backgroundContainerStyle,\n ]}\n >\n {headerBackground ? (\n headerBackground({ style: backgroundStyle })\n ) : headerTransparent ? null : (\n <HeaderBackground style={backgroundStyle} />\n )}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[{ height, minHeight, maxHeight, opacity, transform }]}\n >\n <View pointerEvents=\"none\" style={{ height: headerStatusBarHeight }} />\n <View pointerEvents=\"box-none\" style={styles.content}>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.left,\n headerTitleAlign === 'center' && styles.expand,\n { marginStart: insets.left },\n leftContainerStyle,\n ]}\n >\n {leftButton}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.title,\n {\n // Avoid the title from going offscreen or overlapping buttons\n maxWidth:\n headerTitleAlign === 'center'\n ? layout.width -\n ((leftButton\n ? headerLeftLabelVisible !== false\n ? 80\n : 32\n : 16) +\n Math.max(insets.left, insets.right)) *\n 2\n : layout.width -\n ((leftButton ? 72 : 16) +\n (rightButton ? 72 : 16) +\n insets.left -\n insets.right),\n },\n titleContainerStyle,\n ]}\n >\n {headerTitle({\n children: title,\n allowFontScaling: titleAllowFontScaling,\n tintColor: headerTintColor,\n style: titleStyle,\n })}\n </Animated.View>\n <Animated.View\n pointerEvents=\"box-none\"\n style={[\n styles.right,\n styles.expand,\n { marginEnd: insets.right },\n rightContainerStyle,\n ]}\n >\n {rightButton}\n </Animated.View>\n </View>\n </Animated.View>\n </React.Fragment>\n );\n}\n\nconst styles = StyleSheet.create({\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'stretch',\n },\n title: {\n marginHorizontal: 16,\n justifyContent: 'center',\n },\n left: {\n justifyContent: 'center',\n alignItems: 'flex-start',\n },\n right: {\n justifyContent: 'center',\n alignItems: 'flex-end',\n },\n expand: {\n flexGrow: 1,\n flexBasis: 0,\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAA6BC,UAA7B,EAAyCC,IAAzC,QAAgE,cAAhE;AACA,SACEC,gBADF,EAEEC,iBAFF,QAGO,gCAHP;AAMA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,kBAAP,MAA+B,sBAA/B;AACA,OAAOC,WAAP,MAAwB,eAAxB;;AAiBA,MAAMC,yBAAyB,GAAIC,MAAD,IAAiC;EACjEC,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,OAApB,CAA6BC,SAAD,IAAe;IACzC,MAAMC,KAAK,GAAGL,MAAM,CAACI,SAAD,CAApB;;IAEA,IAAIA,SAAS,KAAK,UAAd,IAA4BC,KAAK,KAAK,UAA1C,EAAsD;MACpDC,OAAO,CAACC,IAAR,CACE,iJADF;IAGD,CAJD,MAIO,IAAIF,KAAK,KAAKG,SAAd,EAAyB;MAC9BF,OAAO,CAACC,IAAR,CACG,GAAEH,SAAU,yBAAwBC,KAAM,sCAD7C;IAGD;EACF,CAZD;AAaD,CAdD;;AAgBA,eAAe,SAASI,MAAT,CAAgBC,KAAhB,EAA8B;EAC3C,MAAMC,MAAM,GAAGjB,iBAAiB,EAAhC;EACA,MAAMkB,KAAK,GAAGnB,gBAAgB,EAA9B;EAEA,MAAMoB,mBAAmB,GAAGzB,KAAK,CAAC0B,UAAN,CAAiBjB,kBAAjB,CAA5B;EAEA,MAAM;IACJkB,MAAM,GAAGH,KADL;IAEJI,KAAK,GAAG,KAFJ;IAGJC,KAHI;IAIJC,WAAW,EAAEC,WAJT;IAKJC,gBAAgB,GAAG9B,QAAQ,CAAC+B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CADsB;EAM/BpG,KAAK,EAAE;IACLqG,gBAAgB,EAAE,EADb;IAELC,cAAc,EAAE;EAFX,CANwB;EAU/BhB,IAAI,EAAE;IACJgB,cAAc,EAAE,QADZ;IAEJF,UAAU,EAAE;EAFR,CAVyB;EAc/BP,KAAK,EAAE;IACLS,cAAc,EAAE,QADX;IAELF,UAAU,EAAE;EAFP,CAdwB;EAkB/Bb,MAAM,EAAE;IACNgB,QAAQ,EAAE,CADJ;IAENC,SAAS,EAAE;EAFL;AAlBuB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["HeaderBackButton.tsx"],"names":["useTheme","React","Animated","I18nManager","Image","Platform","StyleSheet","View","MaskedView","PlatformPressable","HeaderBackButton","disabled","allowFontScaling","backImage","label","labelStyle","labelVisible","onLabelLayout","onPress","pressColor","pressOpacity","screenLayout","tintColor","customTintColor","titleLayout","truncatedLabel","accessibilityLabel","testID","style","colors","initialLabelWidth","setInitialLabelWidth","useState","undefined","select","ios","primary","default","text","handleLabelLayout","e","nativeEvent","layout","x","width","shouldTruncateLabel","renderBackImage","styles","icon","Boolean","iconWithLabel","require","renderLabel","leftLabelText","labelElement","labelWrapper","minWidth","color","OS","iconMaskContainer","iconMask","iconMaskFillerRect","handlePress","requestAnimationFrame","borderless","container","top","right","bottom","left","create","alignItems","flexDirection","hairlineWidth","marginVertical","marginHorizontal","opacity","fontSize","letterSpacing","height","marginLeft","marginRight","resizeMode","transform","scaleX","getConstants","isRTL","margin","flex","justifyContent","backgroundColor","alignSelf"],"mappings":"AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,WAFF,EAGEC,KAHF,EAKEC,QALF,EAMEC,UANF,EAOEC,IAPF,QAQO,cARP;AAUA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;AAGA,eAAe,SAASC,gBAAT,OA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;AA7DqB,CAAlB,CAAf","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n I18nManager,\n Image,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport MaskedView from '../MaskedView';\nimport PlatformPressable from '../PlatformPressable';\nimport type { HeaderBackButtonProps } from '../types';\n\nexport default function HeaderBackButton({\n disabled,\n allowFontScaling,\n backImage,\n label,\n labelStyle,\n labelVisible,\n onLabelLayout,\n onPress,\n pressColor,\n pressOpacity,\n screenLayout,\n tintColor: customTintColor,\n titleLayout,\n truncatedLabel = 'Back',\n accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',\n testID,\n style,\n}: HeaderBackButtonProps) {\n const { colors } = useTheme();\n\n const [initialLabelWidth, setInitialLabelWidth] = React.useState<\n undefined | number\n >(undefined);\n\n const tintColor =\n customTintColor !== undefined\n ? customTintColor\n : Platform.select({\n ios: colors.primary,\n default: colors.text,\n });\n\n const handleLabelLayout = (e: LayoutChangeEvent) => {\n onLabelLayout?.(e);\n\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n\n const shouldTruncateLabel = () => {\n return (\n !label ||\n (initialLabelWidth &&\n titleLayout &&\n screenLayout &&\n (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26)\n );\n };\n\n const renderBackImage = () => {\n if (backImage) {\n return backImage({ tintColor });\n } else {\n return (\n <Image\n style={[\n styles.icon,\n Boolean(labelVisible) && styles.iconWithLabel,\n Boolean(tintColor) && { tintColor },\n ]}\n source={require('../assets/back-icon.png')}\n fadeDuration={0}\n />\n );\n }\n };\n\n const renderLabel = () => {\n const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n\n const labelElement = (\n <View\n style={\n screenLayout\n ? // We make the button extend till the middle of the screen\n // Otherwise it appears to cut off when translating\n [styles.labelWrapper, { minWidth: screenLayout.width / 2 - 27 }]\n : null\n }\n >\n <Animated.Text\n accessible={false}\n onLayout={\n // This measurement is used to determine if we should truncate the label when it doesn't fit\n // Only measure it when label is not truncated because we want the measurement of full label\n leftLabelText === label ? handleLabelLayout : undefined\n }\n style={[\n styles.label,\n tintColor ? { color: tintColor } : null,\n labelStyle,\n ]}\n numberOfLines={1}\n allowFontScaling={!!allowFontScaling}\n >\n {leftLabelText}\n </Animated.Text>\n </View>\n );\n\n if (backImage || Platform.OS !== 'ios') {\n // When a custom backimage is specified, we can't mask the label\n // Otherwise there might be weird effect due to our mask not being the same as the image\n return labelElement;\n }\n\n return (\n <MaskedView\n maskElement={\n <View style={styles.iconMaskContainer}>\n <Image\n source={require('../assets/back-icon-mask.png')}\n style={styles.iconMask}\n />\n <View style={styles.iconMaskFillerRect} />\n </View>\n }\n >\n {labelElement}\n </MaskedView>\n );\n };\n\n const handlePress = () => onPress && requestAnimationFrame(onPress);\n\n return (\n <PlatformPressable\n disabled={disabled}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n testID={testID}\n onPress={disabled ? undefined : handlePress}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n android_ripple={{ borderless: true }}\n style={[styles.container, disabled && styles.disabled, style]}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <React.Fragment>\n {renderBackImage()}\n {renderLabel()}\n </React.Fragment>\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth, // Avoid collapsing when title is long\n ...Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11,\n },\n }),\n },\n disabled: {\n opacity: 0.5,\n },\n label: {\n fontSize: 17,\n // Title and back label are a bit different width due to title being bold\n // Adjusting the letterSpacing makes them coincide better\n letterSpacing: 0.35,\n },\n labelWrapper: {\n // These styles will make sure that the label doesn't fill the available space\n // Otherwise it messes with the measurement of the label\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n }),\n iconWithLabel:\n Platform.OS === 'ios'\n ? {\n marginRight: 6,\n }\n : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000',\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["useTheme","React","Animated","I18nManager","Image","Platform","StyleSheet","View","MaskedView","PlatformPressable","HeaderBackButton","disabled","allowFontScaling","backImage","label","labelStyle","labelVisible","onLabelLayout","onPress","pressColor","pressOpacity","screenLayout","tintColor","customTintColor","titleLayout","truncatedLabel","accessibilityLabel","testID","style","colors","initialLabelWidth","setInitialLabelWidth","useState","undefined","select","ios","primary","default","text","handleLabelLayout","e","nativeEvent","layout","x","width","shouldTruncateLabel","renderBackImage","styles","icon","Boolean","iconWithLabel","require","renderLabel","leftLabelText","labelElement","labelWrapper","minWidth","color","OS","iconMaskContainer","iconMask","iconMaskFillerRect","handlePress","requestAnimationFrame","borderless","container","top","right","bottom","left","create","alignItems","flexDirection","hairlineWidth","marginVertical","marginHorizontal","opacity","fontSize","letterSpacing","height","marginLeft","marginRight","resizeMode","transform","scaleX","getConstants","isRTL","margin","flex","justifyContent","backgroundColor","alignSelf"],"sources":["HeaderBackButton.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n I18nManager,\n Image,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport MaskedView from '../MaskedView';\nimport PlatformPressable from '../PlatformPressable';\nimport type { HeaderBackButtonProps } from '../types';\n\nexport default function HeaderBackButton({\n disabled,\n allowFontScaling,\n backImage,\n label,\n labelStyle,\n labelVisible,\n onLabelLayout,\n onPress,\n pressColor,\n pressOpacity,\n screenLayout,\n tintColor: customTintColor,\n titleLayout,\n truncatedLabel = 'Back',\n accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',\n testID,\n style,\n}: HeaderBackButtonProps) {\n const { colors } = useTheme();\n\n const [initialLabelWidth, setInitialLabelWidth] = React.useState<\n undefined | number\n >(undefined);\n\n const tintColor =\n customTintColor !== undefined\n ? customTintColor\n : Platform.select({\n ios: colors.primary,\n default: colors.text,\n });\n\n const handleLabelLayout = (e: LayoutChangeEvent) => {\n onLabelLayout?.(e);\n\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n\n const shouldTruncateLabel = () => {\n return (\n !label ||\n (initialLabelWidth &&\n titleLayout &&\n screenLayout &&\n (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26)\n );\n };\n\n const renderBackImage = () => {\n if (backImage) {\n return backImage({ tintColor });\n } else {\n return (\n <Image\n style={[\n styles.icon,\n Boolean(labelVisible) && styles.iconWithLabel,\n Boolean(tintColor) && { tintColor },\n ]}\n source={require('../assets/back-icon.png')}\n fadeDuration={0}\n />\n );\n }\n };\n\n const renderLabel = () => {\n const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n\n const labelElement = (\n <View\n style={\n screenLayout\n ? // We make the button extend till the middle of the screen\n // Otherwise it appears to cut off when translating\n [styles.labelWrapper, { minWidth: screenLayout.width / 2 - 27 }]\n : null\n }\n >\n <Animated.Text\n accessible={false}\n onLayout={\n // This measurement is used to determine if we should truncate the label when it doesn't fit\n // Only measure it when label is not truncated because we want the measurement of full label\n leftLabelText === label ? handleLabelLayout : undefined\n }\n style={[\n styles.label,\n tintColor ? { color: tintColor } : null,\n labelStyle,\n ]}\n numberOfLines={1}\n allowFontScaling={!!allowFontScaling}\n >\n {leftLabelText}\n </Animated.Text>\n </View>\n );\n\n if (backImage || Platform.OS !== 'ios') {\n // When a custom backimage is specified, we can't mask the label\n // Otherwise there might be weird effect due to our mask not being the same as the image\n return labelElement;\n }\n\n return (\n <MaskedView\n maskElement={\n <View style={styles.iconMaskContainer}>\n <Image\n source={require('../assets/back-icon-mask.png')}\n style={styles.iconMask}\n />\n <View style={styles.iconMaskFillerRect} />\n </View>\n }\n >\n {labelElement}\n </MaskedView>\n );\n };\n\n const handlePress = () => onPress && requestAnimationFrame(onPress);\n\n return (\n <PlatformPressable\n disabled={disabled}\n accessible\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n testID={testID}\n onPress={disabled ? undefined : handlePress}\n pressColor={pressColor}\n pressOpacity={pressOpacity}\n android_ripple={{ borderless: true }}\n style={[styles.container, disabled && styles.disabled, style]}\n hitSlop={Platform.select({\n ios: undefined,\n default: { top: 16, right: 16, bottom: 16, left: 16 },\n })}\n >\n <React.Fragment>\n {renderBackImage()}\n {renderLabel()}\n </React.Fragment>\n </PlatformPressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth, // Avoid collapsing when title is long\n ...Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11,\n },\n }),\n },\n disabled: {\n opacity: 0.5,\n },\n label: {\n fontSize: 17,\n // Title and back label are a bit different width due to title being bold\n // Adjusting the letterSpacing makes them coincide better\n letterSpacing: 0.35,\n },\n labelWrapper: {\n // These styles will make sure that the label doesn't fill the available space\n // Otherwise it messes with the measurement of the label\n flexDirection: 'row',\n alignItems: 'flex-start',\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n }),\n iconWithLabel:\n Platform.OS === 'ios'\n ? {\n marginRight: 6,\n }\n : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000',\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{ scaleX: I18nManager.getConstants().isRTL ? -1 : 1 }],\n },\n});\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,WAFF,EAGEC,KAHF,EAKEC,QALF,EAMEC,UANF,EAOEC,IAPF,QAQO,cARP;AAUA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;AAGA,eAAe,SAASC,gBAAT,OAkBW;EAAA,IAlBe;IACvCC,QADuC;IAEvCC,gBAFuC;IAGvCC,SAHuC;IAIvCC,KAJuC;IAKvCC,UALuC;IAMvCC,YANuC;IAOvCC,aAPuC;IAQvCC,OARuC;IASvCC,UATuC;IAUvCC,YAVuC;IAWvCC,YAXuC;IAYvCC,SAAS,EAAEC,eAZ4B;IAavCC,WAbuC;IAcvCC,cAAc,GAAG,MAdsB;IAevCC,kBAAkB,GAAGZ,KAAK,IAAIA,KAAK,KAAK,MAAnB,GAA6B,GAAEA,KAAM,QAArC,GAA+C,SAf7B;IAgBvCa,MAhBuC;IAiBvCC;EAjBuC,CAkBf;EACxB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YAAZ,GAA2BC,KAA3B,GAAmC,CAAC,CAApC,GAAwC;IAAlD,CAAD;EAPH;AA7DqB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getNamedContext","HeaderBackContext","undefined"],"sources":["HeaderBackContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderBackContext = getNamedContext<{ title: string } | undefined>(\n 'HeaderBackContext',\n undefined\n);\n\nexport default HeaderBackContext;\n"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,oBAA5B;AAEA,MAAMC,iBAAiB,GAAGD,eAAe,CACvC,mBADuC,EAEvCE,SAFuC,CAAzC;AAKA,eAAeD,iBAAf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
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
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useTheme","React","Animated","Platform","StyleSheet","HeaderBackground","style","rest","colors","styles","container","backgroundColor","card","borderBottomColor","border","shadowColor","create","flex","select","android","elevation","ios","shadowOpacity","shadowRadius","shadowOffset","width","height","hairlineWidth","default","borderBottomWidth"],"sources":["HeaderBackground.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Platform,\n StyleProp,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\n\ntype Props = Omit<ViewProps, 'style'> & {\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n children?: React.ReactNode;\n};\n\nexport default function HeaderBackground({ style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <Animated.View\n style={[\n styles.container,\n {\n backgroundColor: colors.card,\n borderBottomColor: colors.border,\n shadowColor: colors.border,\n },\n style,\n ]}\n {...rest}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n ...Platform.select({\n android: {\n elevation: 4,\n },\n ios: {\n shadowOpacity: 0.85,\n shadowRadius: 0,\n shadowOffset: {\n width: 0,\n height: StyleSheet.hairlineWidth,\n },\n },\n default: {\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n }),\n },\n});\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,QAFF,EAIEC,UAJF,QAOO,cAPP;AAcA,eAAe,SAASC,gBAAT,OAAqD;EAAA,IAA3B;IAAEC,KAAF;IAAS,GAAGC;EAAZ,CAA2B;EAClE,MAAM;IAAEC;EAAF,IAAaR,QAAQ,EAA3B;EAEA,oBACE,oBAAC,QAAD,CAAU,IAAV;IACE,KAAK,EAAE,CACLS,MAAM,CAACC,SADF,EAEL;MACEC,eAAe,EAAEH,MAAM,CAACI,IAD1B;MAEEC,iBAAiB,EAAEL,MAAM,CAACM,MAF5B;MAGEC,WAAW,EAAEP,MAAM,CAACM;IAHtB,CAFK,EAOLR,KAPK;EADT,GAUMC,IAVN,EADF;AAcD;AAED,MAAME,MAAM,GAAGL,UAAU,CAACY,MAAX,CAAkB;EAC/BN,SAAS,EAAE;IACTO,IAAI,EAAE,CADG;IAET,GAAGd,QAAQ,CAACe,MAAT,CAAgB;MACjBC,OAAO,EAAE;QACPC,SAAS,EAAE;MADJ,CADQ;MAIjBC,GAAG,EAAE;QACHC,aAAa,EAAE,IADZ;QAEHC,YAAY,EAAE,CAFX;QAGHC,YAAY,EAAE;UACZC,KAAK,EAAE,CADK;UAEZC,MAAM,EAAEtB,UAAU,CAACuB;QAFP;MAHX,CAJY;MAYjBC,OAAO,EAAE;QACPC,iBAAiB,EAAEzB,UAAU,CAACuB;MADvB;IAZQ,CAAhB;EAFM;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getNamedContext","HeaderHeightContext","undefined"],"sources":["HeaderHeightContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderHeightContext = getNamedContext<number | undefined>(\n 'HeaderHeightContext',\n undefined\n);\n\nexport default HeaderHeightContext;\n"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,oBAA5B;AAEA,MAAMC,mBAAmB,GAAGD,eAAe,CACzC,qBADyC,EAEzCE,SAFyC,CAA3C;AAKA,eAAeD,mBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getNamedContext","HeaderShownContext"],"sources":["HeaderShownContext.tsx"],"sourcesContent":["import getNamedContext from '../getNamedContext';\n\nconst HeaderShownContext = getNamedContext('HeaderShownContext', false);\n\nexport default HeaderShownContext;\n"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,oBAA5B;AAEA,MAAMC,kBAAkB,GAAGD,eAAe,CAAC,oBAAD,EAAuB,KAAvB,CAA1C;AAEA,eAAeC,kBAAf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
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
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useTheme","React","Animated","Platform","StyleSheet","HeaderTitle","tintColor","style","rest","colors","styles","title","color","undefined","text","create","select","ios","fontSize","fontWeight","android","fontFamily","default"],"sources":["HeaderTitle.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Platform,\n StyleProp,\n StyleSheet,\n TextProps,\n TextStyle,\n} from 'react-native';\n\ntype Props = Omit<TextProps, 'style'> & {\n tintColor?: string;\n children?: string;\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport default function HeaderTitle({ tintColor, style, ...rest }: Props) {\n const { colors } = useTheme();\n\n return (\n <Animated.Text\n accessibilityRole=\"header\"\n aria-level=\"1\"\n numberOfLines={1}\n {...rest}\n style={[\n styles.title,\n { color: tintColor === undefined ? colors.text : tintColor },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n title: Platform.select({\n ios: {\n fontSize: 17,\n fontWeight: '600',\n },\n android: {\n fontSize: 20,\n fontFamily: 'sans-serif-medium',\n fontWeight: 'normal',\n },\n default: {\n fontSize: 18,\n fontWeight: '500',\n },\n }),\n});\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,QAFF,EAIEC,UAJF,QAOO,cAPP;AAeA,eAAe,SAASC,WAAT,OAA2D;EAAA,IAAtC;IAAEC,SAAF;IAAaC,KAAb;IAAoB,GAAGC;EAAvB,CAAsC;EACxE,MAAM;IAAEC;EAAF,IAAaT,QAAQ,EAA3B;EAEA,oBACE,oBAAC,QAAD,CAAU,IAAV;IACE,iBAAiB,EAAC,QADpB;IAEE,cAAW,GAFb;IAGE,aAAa,EAAE;EAHjB,GAIMQ,IAJN;IAKE,KAAK,EAAE,CACLE,MAAM,CAACC,KADF,EAEL;MAAEC,KAAK,EAAEN,SAAS,KAAKO,SAAd,GAA0BJ,MAAM,CAACK,IAAjC,GAAwCR;IAAjD,CAFK,EAGLC,KAHK;EALT,GADF;AAaD;AAED,MAAMG,MAAM,GAAGN,UAAU,CAACW,MAAX,CAAkB;EAC/BJ,KAAK,EAAER,QAAQ,CAACa,MAAT,CAAgB;IACrBC,GAAG,EAAE;MACHC,QAAQ,EAAE,EADP;MAEHC,UAAU,EAAE;IAFT,CADgB;IAKrBC,OAAO,EAAE;MACPF,QAAQ,EAAE,EADH;MAEPG,UAAU,EAAE,mBAFL;MAGPF,UAAU,EAAE;IAHL,CALY;IAUrBG,OAAO,EAAE;MACPJ,QAAQ,EAAE,EADH;MAEPC,UAAU,EAAE;IAFL;EAVY,CAAhB;AADwB,CAAlB,CAAf"}
|
|
@@ -4,7 +4,7 @@ export default function getDefaultHeaderHeight(layout, modalPresentation, status
|
|
|
4
4
|
const isLandscape = layout.width > layout.height;
|
|
5
5
|
|
|
6
6
|
if (Platform.OS === 'ios') {
|
|
7
|
-
if (Platform.isPad || Platform.
|
|
7
|
+
if (Platform.isPad || Platform.isTV) {
|
|
8
8
|
if (modalPresentation) {
|
|
9
9
|
headerHeight = 56;
|
|
10
10
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Platform","getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","OS","isPad","isTV"],"sources":["getDefaultHeaderHeight.tsx"],"sourcesContent":["import { Platform } from 'react-native';\n\nimport type { Layout } from '../types';\n\nexport default function getDefaultHeaderHeight(\n layout: Layout,\n modalPresentation: boolean,\n statusBarHeight: number\n): number {\n let headerHeight;\n\n const isLandscape = layout.width > layout.height;\n\n if (Platform.OS === 'ios') {\n if (Platform.isPad || Platform.isTV) {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 50;\n }\n } else {\n if (isLandscape) {\n headerHeight = 32;\n } else {\n if (modalPresentation) {\n headerHeight = 56;\n } else {\n headerHeight = 44;\n }\n }\n }\n } else if (Platform.OS === 'android') {\n headerHeight = 56;\n } else {\n headerHeight = 64;\n }\n\n return headerHeight + statusBarHeight;\n}\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAIA,eAAe,SAASC,sBAAT,CACbC,MADa,EAEbC,iBAFa,EAGbC,eAHa,EAIL;EACR,IAAIC,YAAJ;EAEA,MAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAP,GAAeL,MAAM,CAACM,MAA1C;;EAEA,IAAIR,QAAQ,CAACS,EAAT,KAAgB,KAApB,EAA2B;IACzB,IAAIT,QAAQ,CAACU,KAAT,IAAkBV,QAAQ,CAACW,IAA/B,EAAqC;MACnC,IAAIR,iBAAJ,EAAuB;QACrBE,YAAY,GAAG,EAAf;MACD,CAFD,MAEO;QACLA,YAAY,GAAG,EAAf;MACD;IACF,CAND,MAMO;MACL,IAAIC,WAAJ,EAAiB;QACfD,YAAY,GAAG,EAAf;MACD,CAFD,MAEO;QACL,IAAIF,iBAAJ,EAAuB;UACrBE,YAAY,GAAG,EAAf;QACD,CAFD,MAEO;UACLA,YAAY,GAAG,EAAf;QACD;MACF;IACF;EACF,CAlBD,MAkBO,IAAIL,QAAQ,CAACS,EAAT,KAAgB,SAApB,EAA+B;IACpCJ,YAAY,GAAG,EAAf;EACD,CAFM,MAEA;IACLA,YAAY,GAAG,EAAf;EACD;;EAED,OAAOA,YAAY,GAAGD,eAAtB;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"sources":["getHeaderTitle.tsx"],"sourcesContent":["import type { HeaderOptions } from '../types';\n\nexport default function getHeaderTitle(\n options: { title?: string; headerTitle?: HeaderOptions['headerTitle'] },\n fallback: string\n): string {\n return typeof options.headerTitle === 'string'\n ? options.headerTitle\n : options.title !== undefined\n ? options.title\n : fallback;\n}\n"],"mappings":"AAEA,eAAe,SAASA,cAAT,CACbC,OADa,EAEbC,QAFa,EAGL;EACR,OAAO,OAAOD,OAAO,CAACE,WAAf,KAA+B,QAA/B,GACHF,OAAO,CAACE,WADL,GAEHF,OAAO,CAACG,KAAR,KAAkBC,SAAlB,GACAJ,OAAO,CAACG,KADR,GAEAF,QAJJ;AAKD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","HeaderHeightContext","useHeaderHeight","height","useContext","undefined","Error"],"sources":["useHeaderHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport HeaderHeightContext from './HeaderHeightContext';\n\nexport default function useHeaderHeight() {\n const height = React.useContext(HeaderHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the header height. Are you inside a screen in a navigator with a header?\"\n );\n }\n\n return height;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,mBAAP,MAAgC,uBAAhC;AAEA,eAAe,SAASC,eAAT,GAA2B;EACxC,MAAMC,MAAM,GAAGH,KAAK,CAACI,UAAN,CAAiBH,mBAAjB,CAAf;;EAEA,IAAIE,MAAM,KAAKE,SAAf,EAA0B;IACxB,MAAM,IAAIC,KAAJ,CACJ,wFADI,CAAN;EAGD;;EAED,OAAOH,MAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["default"],"sources":["MaskedView.android.tsx"],"sourcesContent":["export { default } from './MaskedViewNative';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["default"],"sources":["MaskedView.ios.tsx"],"sourcesContent":["export { default } from './MaskedViewNative';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["MaskedView","children"],"sources":["MaskedView.tsx"],"sourcesContent":["/**\n * Use a stub for MaskedView on all Platforms that don't support it.\n */\nimport type * as React from 'react';\n\ntype Props = {\n maskElement: React.ReactElement;\n children: React.ReactElement;\n};\n\nexport default function MaskedView({ children }: Props) {\n return children;\n}\n"],"mappings":"AAAA;AACA;AACA;AAQA,eAAe,SAASA,UAAT,OAAyC;EAAA,IAArB;IAAEC;EAAF,CAAqB;EACtD,OAAOA,QAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","UIManager","RNCMaskedView","require","default","e","isMaskedViewAvailable","getViewManagerConfig","MaskedView","children","rest"],"sources":["MaskedViewNative.tsx"],"sourcesContent":["/**\n * The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.\n */\nimport * as React from 'react';\nimport { UIManager } from 'react-native';\n\ntype MaskedViewType =\n typeof import('@react-native-masked-view/masked-view').default;\n\ntype Props = React.ComponentProps<MaskedViewType> & {\n children: React.ReactElement;\n};\n\nlet RNCMaskedView: MaskedViewType | undefined;\n\ntry {\n // Add try/catch to support usage even if it's not installed, since it's optional.\n // Newer versions of Metro will handle it properly.\n RNCMaskedView = require('@react-native-masked-view/masked-view').default;\n} catch (e) {\n // Ignore\n}\n\nconst isMaskedViewAvailable =\n UIManager.getViewManagerConfig('RNCMaskedView') != null;\n\nexport default function MaskedView({ children, ...rest }: Props) {\n if (isMaskedViewAvailable && RNCMaskedView) {\n return <RNCMaskedView {...rest}>{children}</RNCMaskedView>;\n }\n\n return children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,cAA1B;AASA,IAAIC,aAAJ;;AAEA,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAD,CAAP,CAAiDC,OAAjE;AACD,CAJD,CAIE,OAAOC,CAAP,EAAU,CACV;AACD;;AAED,MAAMC,qBAAqB,GACzBL,SAAS,CAACM,oBAAV,CAA+B,eAA/B,KAAmD,IADrD;AAGA,eAAe,SAASC,UAAT,OAAkD;EAAA,IAA9B;IAAEC,QAAF;IAAY,GAAGC;EAAf,CAA8B;;EAC/D,IAAIJ,qBAAqB,IAAIJ,aAA7B,EAA4C;IAC1C,oBAAO,oBAAC,aAAD,EAAmBQ,IAAnB,EAA0BD,QAA1B,CAAP;EACD;;EAED,OAAOA,QAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","MissingIcon","color","size","style","styles","icon","fontSize","create","backgroundColor"],"sources":["MissingIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { StyleProp, StyleSheet, Text, TextStyle } from 'react-native';\n\ntype Props = {\n color?: string;\n size?: number;\n style?: StyleProp<TextStyle>;\n};\n\nexport default function MissingIcon({ color, size, style }: Props) {\n return <Text style={[styles.icon, { color, fontSize: size }, style]}>⏷</Text>;\n}\n\nconst styles = StyleSheet.create({\n icon: {\n backgroundColor: 'transparent',\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAoBC,UAApB,EAAgCC,IAAhC,QAAuD,cAAvD;AAQA,eAAe,SAASC,WAAT,OAAoD;EAAA,IAA/B;IAAEC,KAAF;IAASC,IAAT;IAAeC;EAAf,CAA+B;EACjE,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAE,CAACC,MAAM,CAACC,IAAR,EAAc;MAAEJ,KAAF;MAASK,QAAQ,EAAEJ;IAAnB,CAAd,EAAyCC,KAAzC;EAAb,YAAP;AACD;AAED,MAAMC,MAAM,GAAGN,UAAU,CAACS,MAAX,CAAkB;EAC/BF,IAAI,EAAE;IACJG,eAAe,EAAE;EADb;AADyB,CAAlB,CAAf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
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
2
|
|
|
3
3
|
import { useTheme } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useTheme","React","Animated","Easing","Platform","Pressable","AnimatedPressable","createAnimatedComponent","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","opacity","useState","Value","animateTo","toValue","duration","timing","easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sources":["PlatformPressable.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Easing,\n GestureResponderEvent,\n Platform,\n Pressable,\n PressableProps,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nexport type Props = Omit<PressableProps, 'style'> & {\n pressColor?: string;\n pressOpacity?: number;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n children: React.ReactNode;\n};\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst ANDROID_VERSION_LOLLIPOP = 21;\nconst ANDROID_SUPPORTS_RIPPLE =\n Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;\n\n/**\n * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.\n */\nexport default function PlatformPressable({\n onPressIn,\n onPressOut,\n android_ripple,\n pressColor,\n pressOpacity = 0.3,\n style,\n ...rest\n}: Props) {\n const { dark } = useTheme();\n const [opacity] = React.useState(() => new Animated.Value(1));\n\n const animateTo = (toValue: number, duration: number) => {\n if (ANDROID_SUPPORTS_RIPPLE) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: true,\n }).start();\n };\n\n const handlePressIn = (e: GestureResponderEvent) => {\n animateTo(pressOpacity, 0);\n onPressIn?.(e);\n };\n\n const handlePressOut = (e: GestureResponderEvent) => {\n animateTo(1, 200);\n onPressOut?.(e);\n };\n\n return (\n <AnimatedPressable\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n android_ripple={\n ANDROID_SUPPORTS_RIPPLE\n ? {\n color:\n pressColor !== undefined\n ? pressColor\n : dark\n ? 'rgba(255, 255, 255, .32)'\n : 'rgba(0, 0, 0, .32)',\n ...android_ripple,\n }\n : undefined\n }\n style={[{ opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1 }, style]}\n {...rest}\n />\n );\n}\n"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,0BAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,MAFF,EAIEC,QAJF,EAKEC,SALF,QASO,cATP;AAkBA,MAAMC,iBAAiB,GAAGJ,QAAQ,CAACK,uBAAT,CAAiCF,SAAjC,CAA1B;AAEA,MAAMG,wBAAwB,GAAG,EAAjC;AACA,MAAMC,uBAAuB,GAC3BL,QAAQ,CAACM,EAAT,KAAgB,SAAhB,IAA6BN,QAAQ,CAACO,OAAT,IAAoBH,wBADnD;AAGA;AACA;AACA;;AACA,eAAe,SAASI,iBAAT,OAQL;EAAA,IARgC;IACxCC,SADwC;IAExCC,UAFwC;IAGxCC,cAHwC;IAIxCC,UAJwC;IAKxCC,YAAY,GAAG,GALyB;IAMxCC,KANwC;IAOxC,GAAGC;EAPqC,CAQhC;EACR,MAAM;IAAEC;EAAF,IAAWpB,QAAQ,EAAzB;EACA,MAAM,CAACqB,OAAD,IAAYpB,KAAK,CAACqB,QAAN,CAAe,MAAM,IAAIpB,QAAQ,CAACqB,KAAb,CAAmB,CAAnB,CAArB,CAAlB;;EAEA,MAAMC,SAAS,GAAG,CAACC,OAAD,EAAkBC,QAAlB,KAAuC;IACvD,IAAIjB,uBAAJ,EAA6B;MAC3B;IACD;;IAEDP,QAAQ,CAACyB,MAAT,CAAgBN,OAAhB,EAAyB;MACvBI,OADuB;MAEvBC,QAFuB;MAGvBE,MAAM,EAAEzB,MAAM,CAAC0B,KAAP,CAAa1B,MAAM,CAAC2B,IAApB,CAHe;MAIvBC,eAAe,EAAE;IAJM,CAAzB,EAKGC,KALH;EAMD,CAXD;;EAaA,MAAMC,aAAa,GAAIC,CAAD,IAA8B;IAClDV,SAAS,CAACP,YAAD,EAAe,CAAf,CAAT;IACAJ,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAGqB,CAAH,CAAT;EACD,CAHD;;EAKA,MAAMC,cAAc,GAAID,CAAD,IAA8B;IACnDV,SAAS,CAAC,CAAD,EAAI,GAAJ,CAAT;IACAV,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAGoB,CAAH,CAAV;EACD,CAHD;;EAKA,oBACE,oBAAC,iBAAD;IACE,SAAS,EAAED,aADb;IAEE,UAAU,EAAEE,cAFd;IAGE,cAAc,EACZ1B,uBAAuB,GACnB;MACE2B,KAAK,EACHpB,UAAU,KAAKqB,SAAf,GACIrB,UADJ,GAEII,IAAI,GACJ,0BADI,GAEJ,oBANR;MAOE,GAAGL;IAPL,CADmB,GAUnBsB,SAdR;IAgBE,KAAK,EAAE,CAAC;MAAEhB,OAAO,EAAE,CAACZ,uBAAD,GAA2BY,OAA3B,GAAqC;IAAhD,CAAD,EAAsDH,KAAtD;EAhBT,GAiBMC,IAjBN,EADF;AAqBD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
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
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","View","FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","OS","display","styles","container","attached","detached","create","flex","overflow","top"],"sources":["ResourceSavingView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Platform, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\ntype Props = {\n visible: boolean;\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container\n\nexport default function ResourceSavingScene({\n visible,\n children,\n style,\n ...rest\n}: Props) {\n if (Platform.OS === 'web') {\n return (\n <View\n // @ts-expect-error: hidden exists on web, but not in React Native\n hidden={!visible}\n style={[\n { display: visible ? 'flex' : 'none' },\n styles.container,\n style,\n ]}\n pointerEvents={visible ? 'auto' : 'none'}\n {...rest}\n >\n {children}\n </View>\n );\n }\n\n return (\n <View\n style={[styles.container, style]}\n // box-none doesn't seem to work properly on Android\n pointerEvents={visible ? 'auto' : 'none'}\n >\n <View\n collapsable={false}\n removeClippedSubviews={\n // On iOS & macOS, set removeClippedSubviews to true only when not focused\n // This is an workaround for a bug where the clipped view never re-appears\n Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true\n }\n pointerEvents={visible ? 'auto' : 'none'}\n style={visible ? styles.attached : styles.detached}\n >\n {children}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n attached: {\n flex: 1,\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY,\n },\n});\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAA8BC,UAA9B,EAA0CC,IAA1C,QAAiE,cAAjE;AAQA,MAAMC,YAAY,GAAG,KAArB,C,CAA4B;;AAE5B,eAAe,SAASC,mBAAT,OAKL;EAAA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"names":["React","Dimensions","Platform","StyleSheet","View","initialWindowMetrics","SafeAreaInsetsContext","SafeAreaProvider","width","height","get","initialMetrics","OS","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","create","flex"],"sources":["SafeAreaProviderCompat.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Dimensions,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport {\n initialWindowMetrics,\n SafeAreaInsetsContext,\n SafeAreaProvider,\n} from 'react-native-safe-area-context';\n\ntype Props = {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst { width = 0, height = 0 } = Dimensions.get('window');\n\n// To support SSR on web, we need to have empty insets for initial values\n// Otherwise there can be mismatch between SSR and client output\n// We also need to specify empty values to support tests environments\nconst initialMetrics =\n Platform.OS === 'web' || initialWindowMetrics == null\n ? {\n frame: { x: 0, y: 0, width, height },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : initialWindowMetrics;\n\nexport default function SafeAreaProviderCompat({ children, style }: Props) {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) => {\n if (insets) {\n // If we already have insets, don't wrap the stack in another safe area provider\n // This avoids an issue with updates at the cost of potentially incorrect values\n // https://github.com/react-navigation/react-navigation/issues/174\n return <View style={[styles.container, style]}>{children}</View>;\n }\n\n return (\n <SafeAreaProvider initialMetrics={initialMetrics} style={style}>\n {children}\n </SafeAreaProvider>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n}\n\nSafeAreaProviderCompat.initialMetrics = initialMetrics;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,UADF,EAEEC,QAFF,EAIEC,UAJF,EAKEC,IALF,QAOO,cAPP;AAQA,SACEC,oBADF,EAEEC,qBAFF,EAGEC,gBAHF,QAIO,gCAJP;AAWA,MAAM;EAAEC,KAAK,GAAG,CAAV;EAAaC,MAAM,GAAG;AAAtB,IAA4BR,UAAU,CAACS,GAAX,CAAe,QAAf,CAAlC,C,CAEA;AACA;AACA;;AACA,MAAMC,cAAc,GAClBT,QAAQ,CAACU,EAAT,KAAgB,KAAhB,IAAyBP,oBAAoB,IAAI,IAAjD,GACI;EACEQ,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAL;IAAQC,CAAC,EAAE,CAAX;IAAcP,KAAd;IAAqBC;EAArB,CADT;EAEEO,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAP;IAAUC,IAAI,EAAE,CAAhB;IAAmBC,KAAK,EAAE,CAA1B;IAA6BC,MAAM,EAAE;EAArC;AAFV,CADJ,GAKIf,oBANN;AAQA,eAAe,SAASgB,sBAAT,OAA4D;EAAA,IAA5B;IAAEC,QAAF;IAAYC;EAAZ,CAA4B;EACzE,oBACE,oBAAC,qBAAD,CAAuB,QAAvB,QACIP,MAAD,IAAY;IACX,IAAIA,MAAJ,EAAY;MACV;MACA;MACA;MACA,oBAAO,oBAAC,IAAD;QAAM,KAAK,EAAE,CAACQ,MAAM,CAACC,SAAR,EAAmBF,KAAnB;MAAb,GAAyCD,QAAzC,CAAP;IACD;;IAED,oBACE,oBAAC,gBAAD;MAAkB,cAAc,EAAEX,cAAlC;MAAkD,KAAK,EAAEY;IAAzD,GACGD,QADH,CADF;EAKD,CAdH,CADF;AAkBD;AAEDD,sBAAsB,CAACV,cAAvB,GAAwCA,cAAxC;AAEA,MAAMa,MAAM,GAAGrB,UAAU,CAACuB,MAAX,CAAkB;EAC/BD,SAAS,EAAE;IACTE,IAAI,EAAE;EADG;AADoB,CAAlB,CAAf"}
|
package/lib/module/Screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["NavigationContext","NavigationRouteContext","React","StyleSheet","View","useSafeAreaFrame","useSafeAreaInsets","Background","getDefaultHeaderHeight","HeaderHeightContext","HeaderShownContext","Screen","props","dimensions","insets","isParentHeaderShown","useContext","parentHeaderHeight","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","styles","container","content","e","height","nativeEvent","layout","absolute","create","flex","flexDirection","position","left","right"],"sources":["Screen.tsx"],"sourcesContent":["import {\n NavigationContext,\n NavigationProp,\n NavigationRouteContext,\n ParamListBase,\n RouteProp,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport Background from './Background';\nimport getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';\nimport HeaderHeightContext from './Header/HeaderHeightContext';\nimport HeaderShownContext from './Header/HeaderShownContext';\n\ntype Props = {\n focused: boolean;\n modal?: boolean;\n navigation: NavigationProp<ParamListBase>;\n route: RouteProp<ParamListBase>;\n header: React.ReactNode;\n headerShown?: boolean;\n headerStatusBarHeight?: number;\n headerTransparent?: boolean;\n style?: StyleProp<ViewStyle>;\n children: React.ReactNode;\n};\n\nexport default function Screen(props: Props) {\n const dimensions = useSafeAreaFrame();\n const insets = useSafeAreaInsets();\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const {\n focused,\n modal = false,\n header,\n headerShown = true,\n headerTransparent,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n navigation,\n route,\n children,\n style,\n } = props;\n\n const [headerHeight, setHeaderHeight] = React.useState(() =>\n getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight)\n );\n\n return (\n <Background\n accessibilityElementsHidden={!focused}\n importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}\n style={[styles.container, style]}\n >\n <View style={styles.content}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || headerShown !== false}\n >\n <HeaderHeightContext.Provider\n value={headerShown ? headerHeight : parentHeaderHeight ?? 0}\n >\n {children}\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </View>\n {headerShown ? (\n <NavigationContext.Provider value={navigation}>\n <NavigationRouteContext.Provider value={route}>\n <View\n onLayout={(e) => {\n const { height } = e.nativeEvent.layout;\n\n setHeaderHeight(height);\n }}\n style={headerTransparent ? styles.absolute : null}\n >\n {header}\n </View>\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n ) : null}\n </Background>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse',\n },\n // This is necessary to avoid applying 'column-reverse' to screen content\n content: {\n flex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n },\n});\n"],"mappings":"AAAA,SACEA,iBADF,EAGEC,sBAHF,QAMO,0BANP;AAOA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAoBC,UAApB,EAAgCC,IAAhC,QAAuD,cAAvD;AACA,SACEC,gBADF,EAEEC,iBAFF,QAGO,gCAHP;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,OAAOC,mBAAP,MAAgC,8BAAhC;AACA,OAAOC,kBAAP,MAA+B,6BAA/B;AAeA,eAAe,SAASC,MAAT,CAAgBC,KAAhB,EAA8B;EAC3C,MAAMC,UAAU,GAAGR,gBAAgB,EAAnC;EACA,MAAMS,MAAM,GAAGR,iBAAiB,EAAhC;EAEA,MAAMS,mBAAmB,GAAGb,KAAK,CAACc,UAAN,CAAiBN,kBAAjB,CAA5B;EACA,MAAMO,kBAAkB,GAAGf,KAAK,CAACc,UAAN,CAAiBP,mBAAjB,CAA3B;EAEA,MAAM;IACJS,OADI;IAEJC,KAAK,GAAG,KAFJ;IAGJC,MAHI;IAIJC,WAAW,GAAG,IAJV;IAKJC,iBALI;IAMJC,qBAAqB,GAAGR,mBAAmB,GAAG,CAAH,GAAOD,MAAM,CAACU,GANrD;I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CADoB;EAK/B;EACAR,OAAO,EAAE;IACPO,IAAI,EAAE;EADC,CANsB;EAS/BF,QAAQ,EAAE;IACRI,QAAQ,EAAE,UADF;IAERnB,GAAG,EAAE,CAFG;IAGRoB,IAAI,EAAE,CAHE;IAIRC,KAAK,EAAE;EAJC;AATqB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","contexts","global","Map","getNamedContext","name","initialValue","context","get","createContext","displayName","set"],"sources":["getNamedContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nconst contexts = '__react_navigation__elements_contexts';\n\ndeclare global {\n var __react_navigation__elements_contexts: Map<string, React.Context<any>>;\n}\n\n// We use a global variable to keep our contexts so that we can reuse same contexts across packages\nglobal[contexts] = global[contexts] ?? new Map<string, React.Context<any>>();\n\nexport default function getNamedContext<T>(\n name: string,\n initialValue: T\n): React.Context<T> {\n let context = global[contexts].get(name);\n\n if (context) {\n return context;\n }\n\n context = React.createContext<T>(initialValue);\n context.displayName = name;\n\n global[contexts].set(name, context);\n\n return context;\n}\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,MAAMC,QAAQ,GAAG,uCAAjB;AAMA;AACAC,MAAM,CAACD,QAAD,CAAN,uBAAmBC,MAAM,CAACD,QAAD,CAAzB,+DAAuC,IAAIE,GAAJ,EAAvC;AAEA,eAAe,SAASC,eAAT,CACbC,IADa,EAEbC,YAFa,EAGK;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAD,CAAN,CAAiBO,GAAjB,CAAqBH,IAArB,CAAd;;EAEA,IAAIE,OAAJ,EAAa;IACX,OAAOA,OAAP;EACD;;EAEDA,OAAO,gBAAGP,KAAK,CAACS,aAAN,CAAuBH,YAAvB,CAAV;EACAC,OAAO,CAACG,WAAR,GAAsBL,IAAtB;EAEAH,MAAM,CAACD,QAAD,CAAN,CAAiBU,GAAjB,CAAqBN,IAArB,EAA2BE,OAA3B;EAEA,OAAOA,OAAP;AACD"}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["default","Background","getDefaultHeaderHeight","getHeaderTitle","Header","HeaderBackButton","HeaderBackContext","HeaderBackground","HeaderHeightContext","HeaderShownContext","HeaderTitle","useHeaderHeight","MissingIcon","PlatformPressable","ResourceSavingView","SafeAreaProviderCompat","Screen","Assets","require"],"sources":["index.tsx"],"sourcesContent":["export { default as Background } from './Background';\nexport { default as getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight';\nexport { default as getHeaderTitle } from './Header/getHeaderTitle';\nexport { default as Header } from './Header/Header';\nexport { default as HeaderBackButton } from './Header/HeaderBackButton';\nexport { default as HeaderBackContext } from './Header/HeaderBackContext';\nexport { default as HeaderBackground } from './Header/HeaderBackground';\nexport { default as HeaderHeightContext } from './Header/HeaderHeightContext';\nexport { default as HeaderShownContext } from './Header/HeaderShownContext';\nexport { default as HeaderTitle } from './Header/HeaderTitle';\nexport { default as useHeaderHeight } from './Header/useHeaderHeight';\nexport { default as MissingIcon } from './MissingIcon';\nexport { default as PlatformPressable } from './PlatformPressable';\nexport { default as ResourceSavingView } from './ResourceSavingView';\nexport { default as SafeAreaProviderCompat } from './SafeAreaProviderCompat';\nexport { default as Screen } from './Screen';\n\nexport const Assets = [\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon.png'),\n // eslint-disable-next-line import/no-commonjs\n require('./assets/back-icon-mask.png'),\n];\n\nexport * from './types';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAApB,QAAsC,cAAtC;AACA,SAASD,OAAO,IAAIE,sBAApB,QAAkD,iCAAlD;AACA,SAASF,OAAO,IAAIG,cAApB,QAA0C,yBAA1C;AACA,SAASH,OAAO,IAAII,MAApB,QAAkC,iBAAlC;AACA,SAASJ,OAAO,IAAIK,gBAApB,QAA4C,2BAA5C;AACA,SAASL,OAAO,IAAIM,iBAApB,QAA6C,4BAA7C;AACA,SAASN,OAAO,IAAIO,gBAApB,QAA4C,2BAA5C;AACA,SAASP,OAAO,IAAIQ,mBAApB,QAA+C,8BAA/C;AACA,SAASR,OAAO,IAAIS,kBAApB,QAA8C,6BAA9C;AACA,SAAST,OAAO,IAAIU,WAApB,QAAuC,sBAAvC;AACA,SAASV,OAAO,IAAIW,eAApB,QAA2C,0BAA3C;AACA,SAASX,OAAO,IAAIY,WAApB,QAAuC,eAAvC;AACA,SAASZ,OAAO,IAAIa,iBAApB,QAA6C,qBAA7C;AACA,SAASb,OAAO,IAAIc,kBAApB,QAA8C,sBAA9C;AACA,SAASd,OAAO,IAAIe,sBAApB,QAAkD,0BAAlD;AACA,SAASf,OAAO,IAAIgB,MAApB,QAAkC,UAAlC;AAEA,OAAO,MAAMC,MAAM,GAAG,CACpB;AACAC,OAAO,CAAC,wBAAD,CAFa,EAGpB;AACAA,OAAO,CAAC,6BAAD,CAJa,CAAf;AAOP,cAAc,SAAd"}
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type {\n Animated,\n LayoutChangeEvent,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\n\nexport type Layout = { width: number; height: number };\n\nexport type HeaderOptions = {\n /**\n * String or a function that returns a React Element to be used by the header.\n * Defaults to screen `title` or route name.\n *\n * It receives `allowFontScaling`, `tintColor`, `style` and `children` in the options object as an argument.\n * The title string is passed in `children`.\n */\n headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);\n /**\n * How to align the the header title.\n * Defaults to `center` on iOS and `left` on Android.\n */\n headerTitleAlign?: 'left' | 'center';\n /**\n * Style object for the title component.\n */\n headerTitleStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Style object for the container of the `headerTitle` element.\n */\n headerTitleContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether header title font should scale to respect Text Size accessibility settings. Defaults to `false`.\n */\n headerTitleAllowFontScaling?: boolean;\n /**\n * Function which returns a React Element to display on the left side of the header.\n */\n headerLeft?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n labelVisible?: boolean;\n }) => React.ReactNode;\n /**\n * Whether a label is visible in the left button. Used to add extra padding.\n */\n headerLeftLabelVisible?: boolean;\n /**\n * Style object for the container of the `headerLeft` element`.\n */\n headerLeftContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Function which returns a React Element to display on the right side of the header.\n */\n headerRight?: (props: {\n tintColor?: string;\n pressColor?: string;\n pressOpacity?: number;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerRight` element.\n */\n headerRightContainerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n headerPressOpacity?: number;\n /**\n * Tint color for the header.\n */\n headerTintColor?: string;\n /**\n * Function which returns a React Element to render as the background of the header.\n * This is useful for using backgrounds such as an image, a gradient, blur effect etc.\n * You can use this with `headerTransparent` to render a blur view, for example, to create a translucent header.\n */\n headerBackground?: (props: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) => React.ReactNode;\n /**\n * Style object for the container of the `headerBackground` element.\n */\n headerBackgroundContainerStyle?: Animated.WithAnimatedValue<\n StyleProp<ViewStyle>\n >;\n /**\n * Defaults to `false`. If `true`, the header will not have a background unless you explicitly provide it with `headerBackground`.\n * The header will also float over the screen so that it overlaps the content underneath.\n * This is useful if you want to render a semi-transparent header or a blurred background.\n */\n headerTransparent?: boolean;\n /**\n * Style object for the header. You can specify a custom background color here, for example.\n */\n headerStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n /**\n * Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.\n *\n * This is a short-hand for the following styles:\n *\n * ```js\n * {\n * elevation: 0,\n * shadowOpacity: 0,\n * borderBottomWidth: 0,\n * }\n * ```\n *\n * If the above styles are specified in `headerStyle` along with `headerShadowVisible: false`,\n * then `headerShadowVisible: false` will take precedence.\n */\n headerShadowVisible?: boolean;\n /**\n * Extra padding to add at the top of header to account for translucent status bar.\n * By default, it uses the top value from the safe area insets of the device.\n * Pass 0 or a custom value to disable the default behaviour, and customize the height.\n */\n headerStatusBarHeight?: number;\n};\n\nexport type HeaderTitleProps = {\n /**\n * The title text of the header.\n */\n children: string;\n /**\n * Whether title font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Tint color for the header.\n */\n tintColor?: string;\n /**\n * Callback to trigger when the size of the title element changes.\n */\n onLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Style object for the title element.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nexport type HeaderButtonProps = {\n /**\n * Tint color for the header button.\n */\n tintColor?: string;\n /**\n * Color for material ripple (Android >= 5.0 only).\n */\n pressColor?: string;\n /**\n * Opacity when the button is pressed, used when ripple is not supported.\n */\n pressOpacity?: number;\n /**\n * Whether it's possible to navigate back in stack.\n */\n canGoBack?: boolean;\n};\n\nexport type HeaderBackButtonProps = HeaderButtonProps & {\n /**\n * Whether the button is disabled.\n */\n disabled?: boolean;\n /**\n * Callback to call when the button is pressed.\n */\n onPress?: () => void;\n /**\n * Function which returns a React Element to display custom image in header's back button.\n */\n backImage?: (props: { tintColor: string }) => React.ReactNode;\n /**\n * Label text for the button. Usually the title of the previous screen.\n * By default, this is only shown on iOS.\n */\n label?: string;\n /**\n * Label text to show when there isn't enough space for the full label.\n */\n truncatedLabel?: string;\n /**\n * Whether the label text is visible.\n * Defaults to `true` on iOS and `false` on Android.\n */\n labelVisible?: boolean;\n /**\n * Style object for the label.\n */\n labelStyle?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n /**\n * Whether label font should scale to respect Text Size accessibility settings.\n */\n allowFontScaling?: boolean;\n /**\n * Callback to trigger when the size of the label changes.\n */\n onLabelLayout?: (e: LayoutChangeEvent) => void;\n /**\n * Layout of the screen.\n */\n screenLayout?: Layout;\n /**\n * Layout of the title element in the header.\n */\n titleLayout?: Layout;\n /**\n * Accessibility label for the button for screen readers.\n */\n accessibilityLabel?: string;\n /**\n * ID to locate this button in tests.\n */\n testID?: string;\n /**\n * Style object for the button.\n */\n style?: StyleProp<ViewStyle>;\n};\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/elements",
|
|
3
3
|
"description": "UI Components for React Navigation",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.7",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"react-navigation",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@react-native-masked-view/masked-view": "0.2.7",
|
|
41
|
-
"@react-navigation/native": "^6.0.
|
|
42
|
-
"@testing-library/react-native": "^
|
|
41
|
+
"@react-navigation/native": "^6.0.14",
|
|
42
|
+
"@testing-library/react-native": "^11.5.0",
|
|
43
43
|
"@types/react": "~18.0.0",
|
|
44
44
|
"@types/react-native": "~0.69.1",
|
|
45
45
|
"del-cli": "^3.0.1",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
]
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "92f9f265d2627a3ef5b3890042d59405ff38401e"
|
|
72
72
|
}
|
|
@@ -12,7 +12,7 @@ export default function getDefaultHeaderHeight(
|
|
|
12
12
|
const isLandscape = layout.width > layout.height;
|
|
13
13
|
|
|
14
14
|
if (Platform.OS === 'ios') {
|
|
15
|
-
if (Platform.isPad || Platform.
|
|
15
|
+
if (Platform.isPad || Platform.isTV) {
|
|
16
16
|
if (modalPresentation) {
|
|
17
17
|
headerHeight = 56;
|
|
18
18
|
} else {
|