@react-navigation/native-stack 6.6.0 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,7 +66,10 @@ function HeaderConfig(_ref) {
66
66
  const headerStyleFlattened = _reactNative.StyleSheet.flatten(headerStyle) || {};
67
67
  const headerLargeStyleFlattened = _reactNative.StyleSheet.flatten(headerLargeStyle) || {};
68
68
  const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = (0, _FontProcessor.processFonts)([headerBackTitleStyleFlattened.fontFamily, headerLargeTitleStyleFlattened.fontFamily, headerTitleStyleFlattened.fontFamily]);
69
- const titleText = title !== undefined ? title : route.name;
69
+ const titleText = (0, _elements.getHeaderTitle)({
70
+ title,
71
+ headerTitle
72
+ }, route.name);
70
73
  const titleColor = (_ref2 = (_headerTitleStyleFlat = headerTitleStyleFlattened.color) !== null && _headerTitleStyleFlat !== void 0 ? _headerTitleStyleFlat : headerTintColor) !== null && _ref2 !== void 0 ? _ref2 : colors.text;
71
74
  const titleFontSize = headerTitleStyleFlattened.fontSize;
72
75
  const titleFontWeight = headerTitleStyleFlattened.fontWeight;
@@ -140,7 +143,7 @@ function HeaderConfig(_ref) {
140
143
  largeTitleFontSize: headerLargeTitleStyleFlattened.fontSize,
141
144
  largeTitleFontWeight: headerLargeTitleStyleFlattened.fontWeight,
142
145
  largeTitleHideShadow: headerLargeTitleShadowVisible === false,
143
- title: typeof headerTitle === 'string' ? headerTitle : titleText,
146
+ title: titleText,
144
147
  titleColor: titleColor,
145
148
  titleFontFamily: titleFontFamily,
146
149
  titleFontSize: titleFontSize,
@@ -1 +1 @@
1
- {"version":3,"sources":["HeaderConfig.tsx"],"names":["HeaderConfig","headerHeight","headerBackImageSource","headerBackButtonMenuEnabled","headerBackTitle","headerBackTitleStyle","headerBackTitleVisible","headerBackVisible","headerShadowVisible","headerLargeStyle","headerLargeTitle","headerLargeTitleShadowVisible","headerLargeTitleStyle","headerBackground","headerLeft","headerRight","headerShown","headerStyle","headerBlurEffect","headerTintColor","headerTitle","headerTitleAlign","headerTitleStyle","headerTransparent","headerSearchBarOptions","route","title","canGoBack","insets","colors","tintColor","Platform","OS","primary","text","headerBackTitleStyleFlattened","StyleSheet","flatten","headerLargeTitleStyleFlattened","headerTitleStyleFlattened","headerStyleFlattened","headerLargeStyleFlattened","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","fontFamily","titleText","undefined","name","titleColor","color","titleFontSize","fontSize","titleFontWeight","fontWeight","headerTitleStyleSupported","headerLeftElement","label","headerRightElement","headerTitleElement","children","supportsHeaderSearchBar","isSearchBarAvailableForCurrentPlatform","SearchBar","hasHeaderSearchBar","Error","backButtonInCustomView","translucent","styles","background","height","backgroundColor","card","I18nManager","isRTL","top","row","create","flexDirection","alignItems","position","left","right","zIndex","overflow"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AAYA;;;;;;AAQe,SAASA,YAAT,OA4BQ;AAAA;;AAAA,MA5Bc;AACnCC,IAAAA,YADmC;AAEnCC,IAAAA,qBAFmC;AAGnCC,IAAAA,2BAHmC;AAInCC,IAAAA,eAJmC;AAKnCC,IAAAA,oBALmC;AAMnCC,IAAAA,sBAAsB,GAAG,IANU;AAOnCC,IAAAA,iBAPmC;AAQnCC,IAAAA,mBARmC;AASnCC,IAAAA,gBATmC;AAUnCC,IAAAA,gBAVmC;AAWnCC,IAAAA,6BAXmC;AAYnCC,IAAAA,qBAZmC;AAanCC,IAAAA,gBAbmC;AAcnCC,IAAAA,UAdmC;AAenCC,IAAAA,WAfmC;AAgBnCC,IAAAA,WAhBmC;AAiBnCC,IAAAA,WAjBmC;AAkBnCC,IAAAA,gBAlBmC;AAmBnCC,IAAAA,eAnBmC;AAoBnCC,IAAAA,WApBmC;AAqBnCC,IAAAA,gBArBmC;AAsBnCC,IAAAA,gBAtBmC;AAuBnCC,IAAAA,iBAvBmC;AAwBnCC,IAAAA,sBAxBmC;AAyBnCC,IA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,qBAAD;AACE,IAAA,SAAS,EAAE7B,SADb;AAEE,IAAA,KAAK,EAAEyB;AAFT,KAIGT,SAJH,CAJJ,CADD,GAaG,IAjCN,CAtDJ,EA0FG5C,qBAAqB,KAAK6C,SAA1B,gBACC,oBAAC,oDAAD;AAAkC,IAAA,MAAM,EAAE7C;AAA1C,IADD,GAEG,IA5FN,EA6FGwD,kBAAkB,IAAI,IAAtB,gBACC,oBAAC,8CAAD,QACGA,kBADH,CADD,GAIG,IAjGN,EAkGGM,kBAAkB,gBACjB,oBAAC,kDAAD,qBACE,oBAAC,6BAAD,EAAexC,sBAAf,CADF,CADiB,GAIf,IAtGN,CAZF,CADF;AAuHD;;AAED,MAAM4C,MAAM,GAAGhC,wBAAWyC,MAAX,CAAkB;AAC/BD,EAAAA,GAAG,EAAE;AACHE,IAAAA,aAAa,EAAE,KADZ;AAEHC,IAAAA,UAAU,EAAE;AAFT,GAD0B;AAK/BZ,EAAAA,WAAW,EAAE;AACXa,IAAAA,QAAQ,EAAE,UADC;AAEXL,IAAAA,GAAG,EAAE,CAFM;AAGXM,IAAAA,IAAI,EAAE,CAHK;AAIXC,IAAAA,KAAK,EAAE,CAJI;AAKXC,IAAAA,MAAM,EAAE;AALG,GALkB;AAY/Bd,EAAAA,UAAU,EAAE;AACVe,IAAAA,QAAQ,EAAE;AADA;AAZmB,CAAlB,CAAf","sourcesContent":["import { HeaderTitle } from '@react-navigation/elements';\nimport { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n I18nManager,\n Platform,\n StyleSheet,\n TextStyle,\n View,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n isSearchBarAvailableForCurrentPlatform,\n ScreenStackHeaderBackButtonImage,\n ScreenStackHeaderCenterView,\n ScreenStackHeaderConfig,\n ScreenStackHeaderLeftView,\n ScreenStackHeaderRightView,\n ScreenStackHeaderSearchBarView,\n SearchBar,\n} from 'react-native-screens';\n\nimport type { NativeStackNavigationOptions } from '../types';\nimport { processFonts } from './FontProcessor';\n\ntype Props = NativeStackNavigationOptions & {\n headerHeight: number;\n route: Route<string>;\n canGoBack: boolean;\n};\n\nexport default function HeaderConfig({\n headerHeight,\n headerBackImageSource,\n headerBackButtonMenuEnabled,\n headerBackTitle,\n headerBackTitleStyle,\n headerBackTitleVisible = true,\n headerBackVisible,\n headerShadowVisible,\n headerLargeStyle,\n headerLargeTitle,\n headerLargeTitleShadowVisible,\n headerLargeTitleStyle,\n headerBackground,\n headerLeft,\n headerRight,\n headerShown,\n headerStyle,\n headerBlurEffect,\n headerTintColor,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerTransparent,\n headerSearchBarOptions,\n route,\n title,\n canGoBack,\n}: Props): JSX.Element {\n const insets = useSafeAreaInsets();\n\n const { colors } = useTheme();\n const tintColor =\n headerTintColor ?? (Platform.OS === 'ios' ? colors.primary : colors.text);\n\n const headerBackTitleStyleFlattened =\n StyleSheet.flatten(headerBackTitleStyle) || {};\n const headerLargeTitleStyleFlattened =\n StyleSheet.flatten(headerLargeTitleStyle) || {};\n const headerTitleStyleFlattened = StyleSheet.flatten(headerTitleStyle) || {};\n const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};\n const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};\n\n const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =\n processFonts([\n headerBackTitleStyleFlattened.fontFamily,\n headerLargeTitleStyleFlattened.fontFamily,\n headerTitleStyleFlattened.fontFamily,\n ]);\n\n const titleText = title !== undefined ? title : route.name;\n const titleColor =\n headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text;\n const titleFontSize = headerTitleStyleFlattened.fontSize;\n const titleFontWeight = headerTitleStyleFlattened.fontWeight;\n\n const headerTitleStyleSupported: TextStyle = { color: titleColor };\n\n if (headerTitleStyleFlattened.fontFamily != null) {\n headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;\n }\n\n if (titleFontSize != null) {\n headerTitleStyleSupported.fontSize = titleFontSize;\n }\n\n if (titleFontWeight != null) {\n headerTitleStyleSupported.fontWeight = titleFontWeight;\n }\n\n const headerLeftElement = headerLeft?.({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n });\n const headerRightElement = headerRight?.({\n tintColor,\n canGoBack,\n });\n const headerTitleElement =\n typeof headerTitle === 'function'\n ? headerTitle({ tintColor, children: titleText })\n : null;\n\n const supportsHeaderSearchBar =\n typeof isSearchBarAvailableForCurrentPlatform === 'boolean'\n ? isSearchBarAvailableForCurrentPlatform\n : // Fallback for older versions of react-native-screens\n Platform.OS === 'ios' && SearchBar != null;\n\n const hasHeaderSearchBar =\n supportsHeaderSearchBar && headerSearchBarOptions != null;\n\n if (headerSearchBarOptions != null && !supportsHeaderSearchBar) {\n throw new Error(\n `The current version of 'react-native-screens' doesn't support SearchBar in the header. Please update to the latest version to use this option.`\n );\n }\n\n /**\n * We need to set this in if:\n * - Back button should stay visible when `headerLeft` is specified\n * - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button\n */\n const backButtonInCustomView = headerBackVisible\n ? headerLeftElement != null\n : Platform.OS === 'android' && headerTitleElement != null;\n\n const translucent =\n headerBackground != null ||\n headerTransparent ||\n // When using a SearchBar or large title, the header needs to be translucent for it to work on iOS\n ((hasHeaderSearchBar || headerLargeTitle) &&\n Platform.OS === 'ios' &&\n headerTransparent !== false);\n\n return (\n <>\n {headerBackground != null ? (\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}\n >\n {headerBackground()}\n </View>\n ) : null}\n <ScreenStackHeaderConfig\n backButtonInCustomView={backButtonInCustomView}\n backgroundColor={\n headerStyleFlattened.backgroundColor ??\n (headerBackground != null || headerTransparent\n ? 'transparent'\n : colors.card)\n }\n backTitle={headerBackTitleVisible ? headerBackTitle : ' '}\n backTitleFontFamily={backTitleFontFamily}\n backTitleFontSize={headerBackTitleStyleFlattened.fontSize}\n blurEffect={headerBlurEffect}\n color={tintColor}\n direction={I18nManager.isRTL ? 'rtl' : 'ltr'}\n disableBackButtonMenu={headerBackButtonMenuEnabled === false}\n hidden={headerShown === false}\n hideBackButton={headerBackVisible === false}\n hideShadow={\n headerShadowVisible === false ||\n headerBackground != null ||\n headerTransparent\n }\n largeTitle={headerLargeTitle}\n largeTitleBackgroundColor={headerLargeStyleFlattened.backgroundColor}\n largeTitleColor={headerLargeTitleStyleFlattened.color}\n largeTitleFontFamily={largeTitleFontFamily}\n largeTitleFontSize={headerLargeTitleStyleFlattened.fontSize}\n largeTitleFontWeight={headerLargeTitleStyleFlattened.fontWeight}\n largeTitleHideShadow={headerLargeTitleShadowVisible === false}\n title={typeof headerTitle === 'string' ? headerTitle : titleText}\n titleColor={titleColor}\n titleFontFamily={titleFontFamily}\n titleFontSize={titleFontSize}\n titleFontWeight={titleFontWeight}\n topInsetEnabled={insets.top !== 0}\n translucent={\n // This defaults to `true`, so we can't pass `undefined`\n translucent === true\n }\n >\n {Platform.OS === 'ios' ? (\n <>\n {headerLeftElement != null ? (\n <ScreenStackHeaderLeftView>\n {headerLeftElement}\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleElement != null ? (\n <ScreenStackHeaderCenterView>\n {headerTitleElement}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n ) : (\n <>\n {headerLeftElement != null || typeof headerTitle === 'function' ? (\n <ScreenStackHeaderLeftView>\n <View style={styles.row}>\n {headerLeftElement}\n {headerTitleAlign !== 'center' ? (\n typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )\n ) : null}\n </View>\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleAlign === 'center' ? (\n <ScreenStackHeaderCenterView>\n {typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n )}\n {headerBackImageSource !== undefined ? (\n <ScreenStackHeaderBackButtonImage source={headerBackImageSource} />\n ) : null}\n {headerRightElement != null ? (\n <ScreenStackHeaderRightView>\n {headerRightElement}\n </ScreenStackHeaderRightView>\n ) : null}\n {hasHeaderSearchBar ? (\n <ScreenStackHeaderSearchBarView>\n <SearchBar {...headerSearchBarOptions} />\n </ScreenStackHeaderSearchBarView>\n ) : null}\n </ScreenStackHeaderConfig>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n translucent: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
1
+ {"version":3,"sources":["HeaderConfig.tsx"],"names":["HeaderConfig","headerHeight","headerBackImageSource","headerBackButtonMenuEnabled","headerBackTitle","headerBackTitleStyle","headerBackTitleVisible","headerBackVisible","headerShadowVisible","headerLargeStyle","headerLargeTitle","headerLargeTitleShadowVisible","headerLargeTitleStyle","headerBackground","headerLeft","headerRight","headerShown","headerStyle","headerBlurEffect","headerTintColor","headerTitle","headerTitleAlign","headerTitleStyle","headerTransparent","headerSearchBarOptions","route","title","canGoBack","insets","colors","tintColor","Platform","OS","primary","text","headerBackTitleStyleFlattened","StyleSheet","flatten","headerLargeTitleStyleFlattened","headerTitleStyleFlattened","headerStyleFlattened","headerLargeStyleFlattened","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","fontFamily","titleText","name","titleColor","color","titleFontSize","fontSize","titleFontWeight","fontWeight","headerTitleStyleSupported","headerLeftElement","label","headerRightElement","headerTitleElement","children","supportsHeaderSearchBar","isSearchBarAvailableForCurrentPlatform","SearchBar","hasHeaderSearchBar","Error","backButtonInCustomView","translucent","styles","background","height","backgroundColor","card","I18nManager","isRTL","top","row","undefined","create","flexDirection","alignItems","position","left","right","zIndex","overflow"],"mappings":";;;;;;;A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AD0B;AAK/Bb,EAAAA,WAAW,EAAE;AACXc,IAAAA,QAAQ,EAAE,UADC;AAEXN,IAAAA,GAAG,EAAE,CAFM;AAGXO,IAAAA,IAAI,EAAE,CAHK;AAIXC,IAAAA,KAAK,EAAE,CAJI;AAKXC,IAAAA,MAAM,EAAE;AALG,GALkB;AAY/Bf,EAAAA,UAAU,EAAE;AACVgB,IAAAA,QAAQ,EAAE;AADA;AAZmB,CAAlB,CAAf","sourcesContent":["import { getHeaderTitle, HeaderTitle } from '@react-navigation/elements';\nimport { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n I18nManager,\n Platform,\n StyleSheet,\n TextStyle,\n View,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n isSearchBarAvailableForCurrentPlatform,\n ScreenStackHeaderBackButtonImage,\n ScreenStackHeaderCenterView,\n ScreenStackHeaderConfig,\n ScreenStackHeaderLeftView,\n ScreenStackHeaderRightView,\n ScreenStackHeaderSearchBarView,\n SearchBar,\n} from 'react-native-screens';\n\nimport type { NativeStackNavigationOptions } from '../types';\nimport { processFonts } from './FontProcessor';\n\ntype Props = NativeStackNavigationOptions & {\n headerHeight: number;\n route: Route<string>;\n canGoBack: boolean;\n};\n\nexport default function HeaderConfig({\n headerHeight,\n headerBackImageSource,\n headerBackButtonMenuEnabled,\n headerBackTitle,\n headerBackTitleStyle,\n headerBackTitleVisible = true,\n headerBackVisible,\n headerShadowVisible,\n headerLargeStyle,\n headerLargeTitle,\n headerLargeTitleShadowVisible,\n headerLargeTitleStyle,\n headerBackground,\n headerLeft,\n headerRight,\n headerShown,\n headerStyle,\n headerBlurEffect,\n headerTintColor,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerTransparent,\n headerSearchBarOptions,\n route,\n title,\n canGoBack,\n}: Props): JSX.Element {\n const insets = useSafeAreaInsets();\n\n const { colors } = useTheme();\n const tintColor =\n headerTintColor ?? (Platform.OS === 'ios' ? colors.primary : colors.text);\n\n const headerBackTitleStyleFlattened =\n StyleSheet.flatten(headerBackTitleStyle) || {};\n const headerLargeTitleStyleFlattened =\n StyleSheet.flatten(headerLargeTitleStyle) || {};\n const headerTitleStyleFlattened = StyleSheet.flatten(headerTitleStyle) || {};\n const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};\n const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};\n\n const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =\n processFonts([\n headerBackTitleStyleFlattened.fontFamily,\n headerLargeTitleStyleFlattened.fontFamily,\n headerTitleStyleFlattened.fontFamily,\n ]);\n\n const titleText = getHeaderTitle({ title, headerTitle }, route.name);\n const titleColor =\n headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text;\n const titleFontSize = headerTitleStyleFlattened.fontSize;\n const titleFontWeight = headerTitleStyleFlattened.fontWeight;\n\n const headerTitleStyleSupported: TextStyle = { color: titleColor };\n\n if (headerTitleStyleFlattened.fontFamily != null) {\n headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;\n }\n\n if (titleFontSize != null) {\n headerTitleStyleSupported.fontSize = titleFontSize;\n }\n\n if (titleFontWeight != null) {\n headerTitleStyleSupported.fontWeight = titleFontWeight;\n }\n\n const headerLeftElement = headerLeft?.({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n });\n const headerRightElement = headerRight?.({\n tintColor,\n canGoBack,\n });\n const headerTitleElement =\n typeof headerTitle === 'function'\n ? headerTitle({\n tintColor,\n children: titleText,\n })\n : null;\n\n const supportsHeaderSearchBar =\n typeof isSearchBarAvailableForCurrentPlatform === 'boolean'\n ? isSearchBarAvailableForCurrentPlatform\n : // Fallback for older versions of react-native-screens\n Platform.OS === 'ios' && SearchBar != null;\n\n const hasHeaderSearchBar =\n supportsHeaderSearchBar && headerSearchBarOptions != null;\n\n if (headerSearchBarOptions != null && !supportsHeaderSearchBar) {\n throw new Error(\n `The current version of 'react-native-screens' doesn't support SearchBar in the header. Please update to the latest version to use this option.`\n );\n }\n\n /**\n * We need to set this in if:\n * - Back button should stay visible when `headerLeft` is specified\n * - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button\n */\n const backButtonInCustomView = headerBackVisible\n ? headerLeftElement != null\n : Platform.OS === 'android' && headerTitleElement != null;\n\n const translucent =\n headerBackground != null ||\n headerTransparent ||\n // When using a SearchBar or large title, the header needs to be translucent for it to work on iOS\n ((hasHeaderSearchBar || headerLargeTitle) &&\n Platform.OS === 'ios' &&\n headerTransparent !== false);\n\n return (\n <>\n {headerBackground != null ? (\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}\n >\n {headerBackground()}\n </View>\n ) : null}\n <ScreenStackHeaderConfig\n backButtonInCustomView={backButtonInCustomView}\n backgroundColor={\n headerStyleFlattened.backgroundColor ??\n (headerBackground != null || headerTransparent\n ? 'transparent'\n : colors.card)\n }\n backTitle={headerBackTitleVisible ? headerBackTitle : ' '}\n backTitleFontFamily={backTitleFontFamily}\n backTitleFontSize={headerBackTitleStyleFlattened.fontSize}\n blurEffect={headerBlurEffect}\n color={tintColor}\n direction={I18nManager.isRTL ? 'rtl' : 'ltr'}\n disableBackButtonMenu={headerBackButtonMenuEnabled === false}\n hidden={headerShown === false}\n hideBackButton={headerBackVisible === false}\n hideShadow={\n headerShadowVisible === false ||\n headerBackground != null ||\n headerTransparent\n }\n largeTitle={headerLargeTitle}\n largeTitleBackgroundColor={headerLargeStyleFlattened.backgroundColor}\n largeTitleColor={headerLargeTitleStyleFlattened.color}\n largeTitleFontFamily={largeTitleFontFamily}\n largeTitleFontSize={headerLargeTitleStyleFlattened.fontSize}\n largeTitleFontWeight={headerLargeTitleStyleFlattened.fontWeight}\n largeTitleHideShadow={headerLargeTitleShadowVisible === false}\n title={titleText}\n titleColor={titleColor}\n titleFontFamily={titleFontFamily}\n titleFontSize={titleFontSize}\n titleFontWeight={titleFontWeight}\n topInsetEnabled={insets.top !== 0}\n translucent={\n // This defaults to `true`, so we can't pass `undefined`\n translucent === true\n }\n >\n {Platform.OS === 'ios' ? (\n <>\n {headerLeftElement != null ? (\n <ScreenStackHeaderLeftView>\n {headerLeftElement}\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleElement != null ? (\n <ScreenStackHeaderCenterView>\n {headerTitleElement}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n ) : (\n <>\n {headerLeftElement != null || typeof headerTitle === 'function' ? (\n <ScreenStackHeaderLeftView>\n <View style={styles.row}>\n {headerLeftElement}\n {headerTitleAlign !== 'center' ? (\n typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )\n ) : null}\n </View>\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleAlign === 'center' ? (\n <ScreenStackHeaderCenterView>\n {typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n )}\n {headerBackImageSource !== undefined ? (\n <ScreenStackHeaderBackButtonImage source={headerBackImageSource} />\n ) : null}\n {headerRightElement != null ? (\n <ScreenStackHeaderRightView>\n {headerRightElement}\n </ScreenStackHeaderRightView>\n ) : null}\n {hasHeaderSearchBar ? (\n <ScreenStackHeaderSearchBarView>\n <SearchBar {...headerSearchBarOptions} />\n </ScreenStackHeaderSearchBarView>\n ) : null}\n </ScreenStackHeaderConfig>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n translucent: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
@@ -32,7 +32,7 @@ function NativeStackView(_ref) {
32
32
  const previousKey = (_state$routes = state.routes[i - 1]) === null || _state$routes === void 0 ? void 0 : _state$routes.key;
33
33
  const nextKey = (_state$routes2 = state.routes[i + 1]) === null || _state$routes2 === void 0 ? void 0 : _state$routes2.key;
34
34
  const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;
35
- const nexDescriptor = nextKey ? descriptors[nextKey] : undefined;
35
+ const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
36
36
  const {
37
37
  options,
38
38
  navigation,
@@ -51,11 +51,12 @@ function NativeStackView(_ref) {
51
51
  headerStyle,
52
52
  headerShadowVisible,
53
53
  headerTransparent,
54
+ headerBackground,
54
55
  headerBackTitle,
55
56
  presentation,
56
57
  contentStyle
57
58
  } = options;
58
- const nextPresentation = nexDescriptor === null || nexDescriptor === void 0 ? void 0 : nexDescriptor.options.presentation;
59
+ const nextPresentation = nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation;
59
60
  return /*#__PURE__*/React.createElement(_elements.Screen, {
60
61
  key: route.key,
61
62
  focused: isFocused,
@@ -119,13 +120,10 @@ function NativeStackView(_ref) {
119
120
  } : headerTitle,
120
121
  headerTitleAlign: headerTitleAlign,
121
122
  headerTitleStyle: headerTitleStyle,
122
- headerStyle: [headerTransparent ? {
123
- position: 'absolute',
124
- backgroundColor: 'transparent'
125
- } : null, headerStyle, headerShadowVisible === false ? {
126
- shadowOpacity: 0,
127
- borderBottomWidth: 0
128
- } : null]
123
+ headerTransparent: headerTransparent,
124
+ headerShadowVisible: headerShadowVisible,
125
+ headerBackground: headerBackground,
126
+ headerStyle: headerStyle
129
127
  }),
130
128
  style: [_reactNative.StyleSheet.absoluteFill, {
131
129
  display: isFocused || nextPresentation != null && TRANSPARENT_PRESENTATIONS.includes(nextPresentation) ? 'flex' : 'none'
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeStackView.tsx"],"names":["TRANSPARENT_PRESENTATIONS","NativeStackView","state","descriptors","styles","container","routes","map","route","i","isFocused","index","canGoBack","previousKey","key","nextKey","previousDescriptor","undefined","nexDescriptor","options","navigation","render","header","headerShown","headerTintColor","headerBackImageSource","headerLeft","headerRight","headerTitle","headerTitleAlign","headerTitleStyle","headerStyle","headerShadowVisible","headerTransparent","headerBackTitle","presentation","contentStyle","nextPresentation","back","title","name","tintColor","label","backImage","goBack","children","position","backgroundColor","shadowOpacity","borderBottomWidth","StyleSheet","absoluteFill","display","includes","contentContainer","create","flex","height","width","margin","resizeMode"],"mappings":";;;;;;;AAAA;;AAWA;;AACA;;;;;;AAeA,MAAMA,yBAAyB,GAAG,CAChC,kBADgC,EAEhC,2BAFgC,CAAlC;;AAKe,SAASC,eAAT,OAAwD;AAAA,MAA/B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA+B;AACrE,sBACE,oBAAC,gCAAD,qBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,KACGH,KAAK,CAACI,MAAN,CAAaC,GAAb,CAAiB,CAACC,KAAD,EAAQC,CAAR,KAAc;AAAA;;AAC9B,UAAMC,SAAS,GAAGR,KAAK,CAACS,KAAN,KAAgBF,CAAlC;AACA,UAAMG,SAAS,GAAGH,CAAC,KAAK,CAAxB;AACA,UAAMI,WAAW,oBAAGX,KAAK,CAACI,MAAN,CAAaG,CAAC,GAAG,CAAjB,CAAH,kDAAG,cAAqBK,GAAzC;AACA,UAAMC,OAAO,qBAAGb,KAAK,CAACI,MAAN,CAAaG,CAAC,GAAG,CAAjB,CAAH,mDAAG,eAAqBK,GAArC;AACA,UAAME,kBAAkB,GAAGH,WAAW,GAClCV,WAAW,CAACU,WAAD,CADuB,GAElCI,SAFJ;AAGA,UAAMC,aAAa,GAAGH,OAAO,GAAGZ,WAAW,CAACY,OAAD,CAAd,GAA0BE,SAAvD;AACA,UAAM;AAAEE,MAAAA,OAAF;AAAWC,MAAAA,UAAX;AAAuBC,MAAAA;AAAvB,QAAkClB,WAAW,CAACK,KAAK,CAACM,GAAP,CAAnD;AAEA,UAAM;AACJQ,MAAAA,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A,iBAAiB,EAAE;AAAvC,SADJ,GAEI,IAVO;AAhDf,QAvBN;AAsFE,MAAA,KAAK,EAAE,CACLC,wBAAWC,YADN,EAEL;AACEC,QAAAA,OAAO,EACL1C,SAAS,IACR2B,gBAAgB,IAAI,IAApB,IACCrC,yBAAyB,CAACqD,QAA1B,CAAmChB,gBAAnC,CAFF,GAGI,MAHJ,GAII;AANR,OAFK,EAULF,YAAY,IAAI,IAAhB,IACAnC,yBAAyB,CAACqD,QAA1B,CAAmClB,YAAnC,CADA,GAEI;AAAEY,QAAAA,eAAe,EAAE;AAAnB,OAFJ,GAGI,IAbC;AAtFT,oBAsGE,oBAAC,iBAAD;AAAM,MAAA,KAAK,EAAE,CAAC3C,MAAM,CAACkD,gBAAR,EAA0BlB,YAA1B;AAAb,OACGf,MAAM,EADT,CAtGF,CADF;AA4GD,GA3IA,CADH,CADF,CADF;AAkJD;;AAED,MAAMjB,MAAM,GAAG8C,wBAAWK,MAAX,CAAkB;AAC/BlD,EAAAA,SAAS,EAAE;AACTmD,IAAAA,IAAI,EAAE;AADG,GADoB;AAI/BF,EAAAA,gBAAgB,EAAE;AAChBE,IAAAA,IAAI,EAAE;AADU,GAJa;AAO/Bb,EAAAA,SAAS,EAAE;AACTc,IAAAA,MAAM,EAAE,EADC;AAETC,IAAAA,KAAK,EAAE,EAFE;AAGTC,IAAAA,MAAM,EAAE,CAHC;AAITC,IAAAA,UAAU,EAAE;AAJH;AAPoB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n Header,\n HeaderBackButton,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n StackNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Image, StyleSheet, View } from 'react-native';\n\nimport type {\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n} from '../types';\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n // This is used for the native implementation of the stack.\n // eslint-disable-next-line react/no-unused-prop-types\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nconst TRANSPARENT_PRESENTATIONS = [\n 'transparentModal',\n 'containedTransparentModal',\n];\n\nexport default function NativeStackView({ state, descriptors }: Props) {\n return (\n <SafeAreaProviderCompat>\n <View style={styles.container}>\n {state.routes.map((route, i) => {\n const isFocused = state.index === i;\n const canGoBack = i !== 0;\n const previousKey = state.routes[i - 1]?.key;\n const nextKey = state.routes[i + 1]?.key;\n const previousDescriptor = previousKey\n ? descriptors[previousKey]\n : undefined;\n const nexDescriptor = nextKey ? descriptors[nextKey] : undefined;\n const { options, navigation, render } = descriptors[route.key];\n\n const {\n header,\n headerShown,\n headerTintColor,\n headerBackImageSource,\n headerLeft,\n headerRight,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerStyle,\n headerShadowVisible,\n headerTransparent,\n headerBackTitle,\n presentation,\n contentStyle,\n } = options;\n\n const nextPresentation = nexDescriptor?.options.presentation;\n\n return (\n <Screen\n key={route.key}\n focused={isFocused}\n route={route}\n navigation={navigation}\n headerShown={headerShown}\n headerTransparent={headerTransparent}\n header={\n header !== undefined ? (\n header({\n back: previousDescriptor\n ? {\n title: getHeaderTitle(\n previousDescriptor.options,\n previousDescriptor.route.name\n ),\n }\n : undefined,\n options,\n route,\n navigation,\n })\n ) : (\n <Header\n title={getHeaderTitle(options, route.name)}\n headerTintColor={headerTintColor}\n headerLeft={\n typeof headerLeft === 'function'\n ? ({ tintColor }) =>\n headerLeft({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n })\n : headerLeft === undefined && canGoBack\n ? ({ tintColor }) => (\n <HeaderBackButton\n tintColor={tintColor}\n backImage={\n headerBackImageSource !== undefined\n ? () => (\n <Image\n source={headerBackImageSource}\n style={[\n styles.backImage,\n { tintColor },\n ]}\n />\n )\n : undefined\n }\n onPress={navigation.goBack}\n canGoBack={canGoBack}\n />\n )\n : headerLeft\n }\n headerRight={\n typeof headerRight === 'function'\n ? ({ tintColor }) =>\n headerRight({ tintColor, canGoBack })\n : headerRight\n }\n headerTitle={\n typeof headerTitle === 'function'\n ? ({ children, tintColor }) =>\n headerTitle({ children, tintColor })\n : headerTitle\n }\n headerTitleAlign={headerTitleAlign}\n headerTitleStyle={headerTitleStyle}\n headerStyle={[\n headerTransparent\n ? {\n position: 'absolute',\n backgroundColor: 'transparent',\n }\n : null,\n headerStyle,\n headerShadowVisible === false\n ? { shadowOpacity: 0, borderBottomWidth: 0 }\n : null,\n ]}\n />\n )\n }\n style={[\n StyleSheet.absoluteFill,\n {\n display:\n isFocused ||\n (nextPresentation != null &&\n TRANSPARENT_PRESENTATIONS.includes(nextPresentation))\n ? 'flex'\n : 'none',\n },\n presentation != null &&\n TRANSPARENT_PRESENTATIONS.includes(presentation)\n ? { backgroundColor: 'transparent' }\n : null,\n ]}\n >\n <View style={[styles.contentContainer, contentStyle]}>\n {render()}\n </View>\n </Screen>\n );\n })}\n </View>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n contentContainer: {\n flex: 1,\n },\n backImage: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n },\n});\n"]}
1
+ {"version":3,"sources":["NativeStackView.tsx"],"names":["TRANSPARENT_PRESENTATIONS","NativeStackView","state","descriptors","styles","container","routes","map","route","i","isFocused","index","canGoBack","previousKey","key","nextKey","previousDescriptor","undefined","nextDescriptor","options","navigation","render","header","headerShown","headerTintColor","headerBackImageSource","headerLeft","headerRight","headerTitle","headerTitleAlign","headerTitleStyle","headerStyle","headerShadowVisible","headerTransparent","headerBackground","headerBackTitle","presentation","contentStyle","nextPresentation","back","title","name","tintColor","label","backImage","goBack","children","StyleSheet","absoluteFill","display","includes","backgroundColor","contentContainer","create","flex","height","width","margin","resizeMode"],"mappings":";;;;;;;AAAA;;AAWA;;AACA;;;;;;AAeA,MAAMA,yBAAyB,GAAG,CAChC,kBADgC,EAEhC,2BAFgC,CAAlC;;AAKe,S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,EAA0Bf,YAA1B;AAAb,OACGhB,MAAM,EADT,CA9FF,CADF;AAoGD,GApIA,CADH,CADF,CADF;AA2ID;;AAED,MAAMjB,MAAM,GAAG2C,wBAAWM,MAAX,CAAkB;AAC/BhD,EAAAA,SAAS,EAAE;AACTiD,IAAAA,IAAI,EAAE;AADG,GADoB;AAI/BF,EAAAA,gBAAgB,EAAE;AAChBE,IAAAA,IAAI,EAAE;AADU,GAJa;AAO/BV,EAAAA,SAAS,EAAE;AACTW,IAAAA,MAAM,EAAE,EADC;AAETC,IAAAA,KAAK,EAAE,EAFE;AAGTC,IAAAA,MAAM,EAAE,CAHC;AAITC,IAAAA,UAAU,EAAE;AAJH;AAPoB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n Header,\n HeaderBackButton,\n SafeAreaProviderCompat,\n Screen,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n StackNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Image, StyleSheet, View } from 'react-native';\n\nimport type {\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n} from '../types';\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n // This is used for the native implementation of the stack.\n // eslint-disable-next-line react/no-unused-prop-types\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nconst TRANSPARENT_PRESENTATIONS = [\n 'transparentModal',\n 'containedTransparentModal',\n];\n\nexport default function NativeStackView({ state, descriptors }: Props) {\n return (\n <SafeAreaProviderCompat>\n <View style={styles.container}>\n {state.routes.map((route, i) => {\n const isFocused = state.index === i;\n const canGoBack = i !== 0;\n const previousKey = state.routes[i - 1]?.key;\n const nextKey = state.routes[i + 1]?.key;\n const previousDescriptor = previousKey\n ? descriptors[previousKey]\n : undefined;\n const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n const { options, navigation, render } = descriptors[route.key];\n\n const {\n header,\n headerShown,\n headerTintColor,\n headerBackImageSource,\n headerLeft,\n headerRight,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerStyle,\n headerShadowVisible,\n headerTransparent,\n headerBackground,\n headerBackTitle,\n presentation,\n contentStyle,\n } = options;\n\n const nextPresentation = nextDescriptor?.options.presentation;\n\n return (\n <Screen\n key={route.key}\n focused={isFocused}\n route={route}\n navigation={navigation}\n headerShown={headerShown}\n headerTransparent={headerTransparent}\n header={\n header !== undefined ? (\n header({\n back: previousDescriptor\n ? {\n title: getHeaderTitle(\n previousDescriptor.options,\n previousDescriptor.route.name\n ),\n }\n : undefined,\n options,\n route,\n navigation,\n })\n ) : (\n <Header\n title={getHeaderTitle(options, route.name)}\n headerTintColor={headerTintColor}\n headerLeft={\n typeof headerLeft === 'function'\n ? ({ tintColor }) =>\n headerLeft({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n })\n : headerLeft === undefined && canGoBack\n ? ({ tintColor }) => (\n <HeaderBackButton\n tintColor={tintColor}\n backImage={\n headerBackImageSource !== undefined\n ? () => (\n <Image\n source={headerBackImageSource}\n style={[\n styles.backImage,\n { tintColor },\n ]}\n />\n )\n : undefined\n }\n onPress={navigation.goBack}\n canGoBack={canGoBack}\n />\n )\n : headerLeft\n }\n headerRight={\n typeof headerRight === 'function'\n ? ({ tintColor }) =>\n headerRight({ tintColor, canGoBack })\n : headerRight\n }\n headerTitle={\n typeof headerTitle === 'function'\n ? ({ children, tintColor }) =>\n headerTitle({ children, tintColor })\n : headerTitle\n }\n headerTitleAlign={headerTitleAlign}\n headerTitleStyle={headerTitleStyle}\n headerTransparent={headerTransparent}\n headerShadowVisible={headerShadowVisible}\n headerBackground={headerBackground}\n headerStyle={headerStyle}\n />\n )\n }\n style={[\n StyleSheet.absoluteFill,\n {\n display:\n isFocused ||\n (nextPresentation != null &&\n TRANSPARENT_PRESENTATIONS.includes(nextPresentation))\n ? 'flex'\n : 'none',\n },\n presentation != null &&\n TRANSPARENT_PRESENTATIONS.includes(presentation)\n ? { backgroundColor: 'transparent' }\n : null,\n ]}\n >\n <View style={[styles.contentContainer, contentStyle]}>\n {render()}\n </View>\n </Screen>\n );\n })}\n </View>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n contentContainer: {\n flex: 1,\n },\n backImage: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n },\n});\n"]}
@@ -82,6 +82,7 @@ const SceneView = _ref2 => {
82
82
  let {
83
83
  descriptor,
84
84
  previousDescriptor,
85
+ nextDescriptor,
85
86
  index,
86
87
  onWillDisappear,
87
88
  onAppear,
@@ -95,22 +96,53 @@ const SceneView = _ref2 => {
95
96
  render
96
97
  } = descriptor;
97
98
  const {
98
- animation,
99
+ animationDuration,
99
100
  animationTypeForReplace = 'push',
100
- customAnimationOnGesture,
101
- fullScreenGestureEnabled,
102
101
  gestureEnabled,
103
102
  header,
104
103
  headerShown,
104
+ autoHideHomeIndicator,
105
+ navigationBarColor,
106
+ navigationBarHidden,
105
107
  orientation,
106
108
  statusBarAnimation,
107
109
  statusBarHidden,
108
- statusBarStyle
110
+ statusBarStyle,
111
+ statusBarTranslucent,
112
+ statusBarColor
109
113
  } = options;
110
114
  let {
111
- presentation = 'card'
115
+ animation,
116
+ customAnimationOnGesture,
117
+ fullScreenGestureEnabled,
118
+ presentation = 'card',
119
+ gestureDirection = presentation === 'card' ? 'horizontal' : 'vertical'
112
120
  } = options;
113
121
 
122
+ if (gestureDirection === 'vertical' && _reactNative.Platform.OS === 'ios') {
123
+ // for `vertical` direction to work, we need to set `fullScreenGestureEnabled` to `true`
124
+ // so the screen can be dismissed from any point on screen.
125
+ // `customAnimationOnGesture` needs to be set to `true` so the `animation` set by user can be used,
126
+ // otherwise `simple_push` will be used.
127
+ // Also, the default animation for this direction seems to be `slide_from_bottom`.
128
+ if (fullScreenGestureEnabled === undefined) {
129
+ fullScreenGestureEnabled = true;
130
+ }
131
+
132
+ if (customAnimationOnGesture === undefined) {
133
+ customAnimationOnGesture = true;
134
+ }
135
+
136
+ if (animation === undefined) {
137
+ animation = 'slide_from_bottom';
138
+ }
139
+ } // workaround for rn-screens where gestureDirection has to be set on both
140
+ // current and previous screen - software-mansion/react-native-screens/pull/1509
141
+
142
+
143
+ const nextGestureDirection = nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.gestureDirection;
144
+ const gestureDirectionOverride = nextGestureDirection != null ? nextGestureDirection : gestureDirection;
145
+
114
146
  if (index === 0) {
115
147
  // first screen should always be treated as `card`, it resolves problems with no header animation
116
148
  // for navigator with first screen as `modal` and the next as `card`
@@ -123,7 +155,7 @@ const SceneView = _ref2 => {
123
155
 
124
156
  const isModal = presentation === 'modal' || presentation === 'formSheet'; // Modals are fullscreen in landscape only on iPhone
125
157
 
126
- const isIPhone = _reactNative.Platform.OS === 'ios' && !(_reactNative.Platform.isPad && _reactNative.Platform.isTVOS);
158
+ const isIPhone = _reactNative.Platform.OS === 'ios' && !(_reactNative.Platform.isPad || _reactNative.Platform.isTVOS);
127
159
  const isLandscape = frame.width > frame.height;
128
160
  const topInset = isModal || isIPhone && isLandscape ? 0 : insets.top;
129
161
  const isParentHeaderShown = React.useContext(_elements.HeaderShownContext);
@@ -140,6 +172,9 @@ const SceneView = _ref2 => {
140
172
  gestureEnabled: isAndroid ? // This prop enables handling of system back gestures on Android
141
173
  // Since we handle them in JS side, we disable this
142
174
  false : gestureEnabled,
175
+ homeIndicatorHidden: autoHideHomeIndicator,
176
+ navigationBarColor: navigationBarColor,
177
+ navigationBarHidden: navigationBarHidden,
143
178
  replaceAnimation: animationTypeForReplace,
144
179
  stackPresentation: presentation === 'card' ? 'push' : presentation,
145
180
  stackAnimation: animation,
@@ -147,6 +182,10 @@ const SceneView = _ref2 => {
147
182
  statusBarAnimation: statusBarAnimation,
148
183
  statusBarHidden: statusBarHidden,
149
184
  statusBarStyle: statusBarStyle,
185
+ statusBarColor: statusBarColor,
186
+ statusBarTranslucent: statusBarTranslucent,
187
+ swipeDirection: gestureDirectionOverride,
188
+ transitionDuration: animationDuration,
150
189
  onWillDisappear: onWillDisappear,
151
190
  onAppear: onAppear,
152
191
  onDisappear: onDisappear,
@@ -203,16 +242,19 @@ function NativeStackViewInner(_ref3) {
203
242
  return /*#__PURE__*/React.createElement(_reactNativeScreens.ScreenStack, {
204
243
  style: styles.container
205
244
  }, state.routes.map((route, index) => {
206
- var _state$routes;
245
+ var _state$routes, _state$routes2;
207
246
 
208
247
  const descriptor = descriptors[route.key];
209
248
  const previousKey = (_state$routes = state.routes[index - 1]) === null || _state$routes === void 0 ? void 0 : _state$routes.key;
249
+ const nextKey = (_state$routes2 = state.routes[index + 1]) === null || _state$routes2 === void 0 ? void 0 : _state$routes2.key;
210
250
  const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;
251
+ const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
211
252
  return /*#__PURE__*/React.createElement(SceneView, {
212
253
  key: route.key,
213
254
  index: index,
214
255
  descriptor: descriptor,
215
256
  previousDescriptor: previousDescriptor,
257
+ nextDescriptor: nextDescriptor,
216
258
  onWillDisappear: () => {
217
259
  navigation.emit({
218
260
  type: 'transitionStart',
@@ -1 +1 @@
1
- {"version":3,"sources":["NativeStackView.native.tsx"],"names":["isAndroid","Platform","OS","MaybeNestedStack","options","route","presentation","headerHeight","children","colors","header","headerShown","contentStyle","isHeaderInModal","undefined","headerShownPreviousRef","React","useRef","useEffect","current","name","content","styles","container","backgroundColor","background","StyleSheet","absoluteFill","SceneView","descriptor","previousDescriptor","index","onWillDisappear","onAppear","onDisappear","onDismissed","navigation","render","animation","animationTypeForReplace","customAnimationOnGesture","fullScreenGestureEnabled","gestureEnabled","orientation","statusBarAnimation","statusBarHidden","statusBarStyle","isHeaderInPush","insets","frame","isModal","isIPhone","isPad","isTVOS","isLandscape","width","height","topInset","top","isParentHeaderShown","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","defaultHeaderHeight","customHeaderHeight","setCustomHeaderHeight","useState","key","e","nativeEvent","layout","back","title","NativeStackViewInner","state","descriptors","nextDismissedKey","setNextDismissedKey","dismissedRouteName","routes","find","message","console","error","map","previousKey","emit","type","data","closing","target","event","dispatch","StackActions","pop","dismissCount","source","NativeStackView","props","create","flex"],"mappings":";;;;;;;AAAA;;AAOA;;AASA;;AACA;;AACA;;AAKA;;AAKA;;AAQA;;AACA;;;;;;;;;;AAEA,MAAMA,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;;AAEA,MAAMC,gBAAgB,GAAG,QAYnB;AAAA,MAZoB;AACxBC,IAAAA,OADwB;AAExBC,IAAAA,KAFwB;AAGxBC,IAAAA,YAHwB;AAIxBC,IAAAA,YAJwB;AAKxBC,IAAAA;AALwB,GAYpB;AACJ,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAnB;AACA,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,WAAW,GAAG,IAAxB;AAA8BC,IAAAA;AAA9B,MAA+CR,OAArD;AAEA,QAAMS,eAAe,GAAGb,SAAS,GAC7B,KAD6B,GAE7BM,YAAY,KAAK,MAAjB,IAA2BK,WAAW,KAAK,IAA3C,IAAmDD,MAAM,KAAKI,SAFlE;AAIA,QAAMC,sBAAsB,GAAGC,KAAK,CAACC,MAAN,CAAaN,WAAb,CAA/B;AAEAK,EAAAA,KAAK,CAACE,SAAN,CAAgB,MAAM;AACpB,2BACE,CAAClB,SAAD,IACEM,YAAY,KAAK,MADnB,IAEES,sBAAsB,CAACI,OAAvB,KAAmCR,WAHvC,EAIG,6IAA4IN,KAAK,CAACe,IAAK,IAJ1J;AAOAL,IAAAA,sBAAsB,CAACI,OAAvB,GAAiCR,WAAjC;AACD,GATD,EASG,CAACA,WAAD,EAAcL,YAAd,EAA4BD,KAAK,CAACe,IAAlC,CATH;AAWA,QAAMC,OAAO,gBACX,oBAAC,uBAAD;AACE,IAAA,KAAK,EAAE,CACLC,MAAM,CAACC,SADF,EAELjB,YAAY,KAAK,kBAAjB,IACEA,YAAY,KAAK,2BADnB,I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,MAAA,WAAW,EAAGwB,KAAD,IAAW;AACtBxD,QAAAA,UAAU,CAACyD,QAAX,CAAoB,EAClB,GAAGC,qBAAaC,GAAb,CAAiBH,KAAK,CAACtB,WAAN,CAAkB0B,YAAnC,CADe;AAElBC,UAAAA,MAAM,EAAE5F,KAAK,CAAC+D,GAFI;AAGlBuB,UAAAA,MAAM,EAAEhB,KAAK,CAACP;AAHI,SAApB;AAMAU,QAAAA,mBAAmB,CAACzE,KAAK,CAAC+D,GAAP,CAAnB;AACD;AAlCH,MADF;AAsCD,GA7CA,CADH,CADF;AAkDD;;AAEc,SAAS8B,eAAT,CAAyBC,KAAzB,EAAuC;AACpD,sBACE,oBAAC,gCAAD,qBACE,oBAAC,oBAAD,EAA0BA,KAA1B,CADF,CADF;AAKD;;AAED,MAAM7E,MAAM,GAAGI,wBAAW0E,MAAX,CAAkB;AAC/B7E,EAAAA,SAAS,EAAE;AACT8E,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import {\n getDefaultHeaderHeight,\n getHeaderTitle,\n HeaderHeightContext,\n HeaderShownContext,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport {\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n Route,\n StackActions,\n StackNavigationState,\n useTheme,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\nimport type { ScreenProps } from 'react-native-screens';\nimport {\n Screen,\n ScreenStack,\n StackPresentationTypes,\n} from 'react-native-screens';\nimport warnOnce from 'warn-once';\n\nimport type {\n NativeStackDescriptor,\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n NativeStackNavigationOptions,\n} from '../types';\nimport DebugContainer from './DebugContainer';\nimport HeaderConfig from './HeaderConfig';\n\nconst isAndroid = Platform.OS === 'android';\n\nconst MaybeNestedStack = ({\n options,\n route,\n presentation,\n headerHeight,\n children,\n}: {\n options: NativeStackNavigationOptions;\n route: Route<string>;\n presentation: Exclude<StackPresentationTypes, 'push'> | 'card';\n headerHeight: number;\n children: React.ReactNode;\n}) => {\n const { colors } = useTheme();\n const { header, headerShown = true, contentStyle } = options;\n\n const isHeaderInModal = isAndroid\n ? false\n : presentation !== 'card' && headerShown === true && header === undefined;\n\n const headerShownPreviousRef = React.useRef(headerShown);\n\n React.useEffect(() => {\n warnOnce(\n !isAndroid &&\n presentation !== 'card' &&\n headerShownPreviousRef.current !== headerShown,\n `Dynamically changing 'headerShown' in modals will result in remounting the screen and losing all local state. See options for the screen '${route.name}'.`\n );\n\n headerShownPreviousRef.current = headerShown;\n }, [headerShown, presentation, route.name]);\n\n const content = (\n <DebugContainer\n style={[\n styles.container,\n presentation !== 'transparentModal' &&\n presentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n >\n {children}\n </DebugContainer>\n );\n\n if (isHeaderInModal) {\n return (\n <ScreenStack style={styles.container}>\n <Screen enabled style={StyleSheet.absoluteFill}>\n <HeaderConfig\n {...options}\n route={route}\n headerHeight={headerHeight}\n canGoBack\n />\n {content}\n </Screen>\n </ScreenStack>\n );\n }\n\n return content;\n};\n\ntype SceneViewProps = {\n index: number;\n descriptor: NativeStackDescriptor;\n previousDescriptor?: NativeStackDescriptor;\n onWillDisappear: () => void;\n onAppear: () => void;\n onDisappear: () => void;\n onDismissed: ScreenProps['onDismissed'];\n};\n\nconst SceneView = ({\n descriptor,\n previousDescriptor,\n index,\n onWillDisappear,\n onAppear,\n onDisappear,\n onDismissed,\n}: SceneViewProps) => {\n const { route, navigation, options, render } = descriptor;\n const {\n animation,\n animationTypeForReplace = 'push',\n customAnimationOnGesture,\n fullScreenGestureEnabled,\n gestureEnabled,\n header,\n headerShown,\n orientation,\n statusBarAnimation,\n statusBarHidden,\n statusBarStyle,\n } = options;\n\n let { presentation = 'card' } = options;\n\n if (index === 0) {\n // first screen should always be treated as `card`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `card`\n presentation = 'card';\n }\n\n const isHeaderInPush = isAndroid\n ? headerShown\n : presentation === 'card' && headerShown !== false;\n\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n // `modal` and `formSheet` presentations do not take whole screen, so should not take the inset.\n const isModal = presentation === 'modal' || presentation === 'formSheet';\n\n // Modals are fullscreen in landscape only on iPhone\n const isIPhone =\n Platform.OS === 'ios' && !(Platform.isPad && Platform.isTVOS);\n const isLandscape = frame.width > frame.height;\n\n const topInset = isModal || (isIPhone && isLandscape) ? 0 : insets.top;\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const defaultHeaderHeight = getDefaultHeaderHeight(frame, isModal, topInset);\n\n const [customHeaderHeight, setCustomHeaderHeight] =\n React.useState(defaultHeaderHeight);\n\n const headerHeight = header ? customHeaderHeight : defaultHeaderHeight;\n\n return (\n <Screen\n key={route.key}\n enabled\n style={StyleSheet.absoluteFill}\n customAnimationOnSwipe={customAnimationOnGesture}\n fullScreenSwipeEnabled={fullScreenGestureEnabled}\n gestureEnabled={\n isAndroid\n ? // This prop enables handling of system back gestures on Android\n // Since we handle them in JS side, we disable this\n false\n : gestureEnabled\n }\n replaceAnimation={animationTypeForReplace}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n stackAnimation={animation}\n screenOrientation={orientation}\n statusBarAnimation={statusBarAnimation}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n onWillDisappear={onWillDisappear}\n onAppear={onAppear}\n onDisappear={onDisappear}\n onDismissed={onDismissed}\n isNativeStack\n >\n <NavigationContext.Provider value={navigation}>\n <NavigationRouteContext.Provider value={route}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || isHeaderInPush !== false}\n >\n <HeaderHeightContext.Provider\n value={\n isHeaderInPush !== false\n ? headerHeight\n : parentHeaderHeight ?? 0\n }\n >\n {header !== undefined && headerShown !== false ? (\n <View\n onLayout={(e) => {\n setCustomHeaderHeight(e.nativeEvent.layout.height);\n }}\n >\n {header({\n back: previousDescriptor\n ? {\n title: getHeaderTitle(\n previousDescriptor.options,\n previousDescriptor.route.name\n ),\n }\n : undefined,\n options,\n route,\n navigation,\n })}\n </View>\n ) : (\n <HeaderConfig\n {...options}\n route={route}\n headerShown={isHeaderInPush}\n headerHeight={headerHeight}\n canGoBack={index !== 0}\n />\n )}\n <MaybeNestedStack\n options={options}\n route={route}\n presentation={presentation}\n headerHeight={headerHeight}\n >\n {render()}\n </MaybeNestedStack>\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n </Screen>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nfunction NativeStackViewInner({ state, navigation, descriptors }: Props) {\n const [nextDismissedKey, setNextDismissedKey] = React.useState<string | null>(\n null\n );\n\n const dismissedRouteName = nextDismissedKey\n ? state.routes.find((route) => route.key === nextDismissedKey)?.name\n : null;\n\n React.useEffect(() => {\n if (dismissedRouteName) {\n const message =\n `The screen '${dismissedRouteName}' was removed natively but didn't get removed from JS state. ` +\n `This can happen if the action was prevented in a 'beforeRemove' listener, which is not fully supported in native-stack.\\n\\n` +\n `Consider using 'gestureEnabled: false' to prevent back gesture and use a custom back button with 'headerLeft' option to override the native behavior.`;\n\n console.error(message);\n }\n }, [dismissedRouteName]);\n\n return (\n <ScreenStack style={styles.container}>\n {state.routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const previousKey = state.routes[index - 1]?.key;\n const previousDescriptor = previousKey\n ? descriptors[previousKey]\n : undefined;\n\n return (\n <SceneView\n key={route.key}\n index={index}\n descriptor={descriptor}\n previousDescriptor={previousDescriptor}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onAppear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: false },\n target: route.key,\n });\n }}\n onDisappear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: true },\n target: route.key,\n });\n }}\n onDismissed={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n\n setNextDismissedKey(route.key);\n }}\n />\n );\n })}\n </ScreenStack>\n );\n}\n\nexport default function NativeStackView(props: Props) {\n return (\n <SafeAreaProviderCompat>\n <NativeStackViewInner {...props} />\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["NativeStackView.native.tsx"],"names":["isAndroid","Platform","OS","MaybeNestedStack","options","route","presentation","headerHeight","children","colors","header","headerShown","contentStyle","isHeaderInModal","undefined","headerShownPreviousRef","React","useRef","useEffect","current","name","content","styles","container","backgroundColor","background","StyleSheet","absoluteFill","SceneView","descriptor","previousDescriptor","nextDescriptor","index","onWillDisappear","onAppear","onDisappear","onDismissed","navigation","render","animationDuration","animationTypeForReplace","gestureEnabled","autoHideHomeIndicator","navigationBarColor","navigationBarHidden","orientation","statusBarAnimation","statusBarHidden","statusBarStyle","statusBarTranslucent","statusBarColor","animation","customAnimationOnGesture","fullScreenGestureEnabled","gestureDirection","nextGestureDirection","gestureDirectionOverride","isHeaderInPush","insets","frame","isModal","isIPhone","isPad","isTVOS","isLandscape","width","height","topInset","top","isParentHeaderShown","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","defaultHeaderHeight","customHeaderHeight","setCustomHeaderHeight","useState","key","e","nativeEvent","layout","back","title","NativeStackViewInner","state","descriptors","nextDismissedKey","setNextDismissedKey","dismissedRouteName","routes","find","message","console","error","map","previousKey","nextKey","emit","type","data","closing","target","event","dispatch","StackActions","pop","dismissCount","source","NativeStackView","props","create","flex"],"mappings":";;;;;;;AA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CAAiBH,KAAK,CAACvB,WAAN,CAAkB2B,YAAnC,CADe;AAElBC,UAAAA,MAAM,EAAEvG,KAAK,CAACyE,GAFI;AAGlBwB,UAAAA,MAAM,EAAEjB,KAAK,CAACP;AAHI,SAApB;AAMAU,QAAAA,mBAAmB,CAACnF,KAAK,CAACyE,GAAP,CAAnB;AACD;AAnCH,MADF;AAuCD,GAhDA,CADH,CADF;AAqDD;;AAEc,SAAS+B,eAAT,CAAyBC,KAAzB,EAAuC;AACpD,sBACE,oBAAC,gCAAD,qBACE,oBAAC,oBAAD,EAA0BA,KAA1B,CADF,CADF;AAKD;;AAED,MAAMxF,MAAM,GAAGI,wBAAWqF,MAAX,CAAkB;AAC/BxF,EAAAA,SAAS,EAAE;AACTyF,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import {\n getDefaultHeaderHeight,\n getHeaderTitle,\n HeaderHeightContext,\n HeaderShownContext,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport {\n NavigationContext,\n NavigationRouteContext,\n ParamListBase,\n Route,\n StackActions,\n StackNavigationState,\n useTheme,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\nimport type { ScreenProps } from 'react-native-screens';\nimport {\n Screen,\n ScreenStack,\n StackPresentationTypes,\n} from 'react-native-screens';\nimport warnOnce from 'warn-once';\n\nimport type {\n NativeStackDescriptor,\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n NativeStackNavigationOptions,\n} from '../types';\nimport DebugContainer from './DebugContainer';\nimport HeaderConfig from './HeaderConfig';\n\nconst isAndroid = Platform.OS === 'android';\n\nconst MaybeNestedStack = ({\n options,\n route,\n presentation,\n headerHeight,\n children,\n}: {\n options: NativeStackNavigationOptions;\n route: Route<string>;\n presentation: Exclude<StackPresentationTypes, 'push'> | 'card';\n headerHeight: number;\n children: React.ReactNode;\n}) => {\n const { colors } = useTheme();\n const { header, headerShown = true, contentStyle } = options;\n\n const isHeaderInModal = isAndroid\n ? false\n : presentation !== 'card' && headerShown === true && header === undefined;\n\n const headerShownPreviousRef = React.useRef(headerShown);\n\n React.useEffect(() => {\n warnOnce(\n !isAndroid &&\n presentation !== 'card' &&\n headerShownPreviousRef.current !== headerShown,\n `Dynamically changing 'headerShown' in modals will result in remounting the screen and losing all local state. See options for the screen '${route.name}'.`\n );\n\n headerShownPreviousRef.current = headerShown;\n }, [headerShown, presentation, route.name]);\n\n const content = (\n <DebugContainer\n style={[\n styles.container,\n presentation !== 'transparentModal' &&\n presentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n >\n {children}\n </DebugContainer>\n );\n\n if (isHeaderInModal) {\n return (\n <ScreenStack style={styles.container}>\n <Screen enabled style={StyleSheet.absoluteFill}>\n <HeaderConfig\n {...options}\n route={route}\n headerHeight={headerHeight}\n canGoBack\n />\n {content}\n </Screen>\n </ScreenStack>\n );\n }\n\n return content;\n};\n\ntype SceneViewProps = {\n index: number;\n descriptor: NativeStackDescriptor;\n previousDescriptor?: NativeStackDescriptor;\n nextDescriptor?: NativeStackDescriptor;\n onWillDisappear: () => void;\n onAppear: () => void;\n onDisappear: () => void;\n onDismissed: ScreenProps['onDismissed'];\n};\n\nconst SceneView = ({\n descriptor,\n previousDescriptor,\n nextDescriptor,\n index,\n onWillDisappear,\n onAppear,\n onDisappear,\n onDismissed,\n}: SceneViewProps) => {\n const { route, navigation, options, render } = descriptor;\n const {\n animationDuration,\n animationTypeForReplace = 'push',\n gestureEnabled,\n header,\n headerShown,\n autoHideHomeIndicator,\n navigationBarColor,\n navigationBarHidden,\n orientation,\n statusBarAnimation,\n statusBarHidden,\n statusBarStyle,\n statusBarTranslucent,\n statusBarColor,\n } = options;\n\n let {\n animation,\n customAnimationOnGesture,\n fullScreenGestureEnabled,\n presentation = 'card',\n gestureDirection = presentation === 'card' ? 'horizontal' : 'vertical',\n } = options;\n\n if (gestureDirection === 'vertical' && Platform.OS === 'ios') {\n // for `vertical` direction to work, we need to set `fullScreenGestureEnabled` to `true`\n // so the screen can be dismissed from any point on screen.\n // `customAnimationOnGesture` needs to be set to `true` so the `animation` set by user can be used,\n // otherwise `simple_push` will be used.\n // Also, the default animation for this direction seems to be `slide_from_bottom`.\n if (fullScreenGestureEnabled === undefined) {\n fullScreenGestureEnabled = true;\n }\n if (customAnimationOnGesture === undefined) {\n customAnimationOnGesture = true;\n }\n if (animation === undefined) {\n animation = 'slide_from_bottom';\n }\n }\n\n // workaround for rn-screens where gestureDirection has to be set on both\n // current and previous screen - software-mansion/react-native-screens/pull/1509\n const nextGestureDirection = nextDescriptor?.options.gestureDirection;\n const gestureDirectionOverride =\n nextGestureDirection != null ? nextGestureDirection : gestureDirection;\n\n if (index === 0) {\n // first screen should always be treated as `card`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `card`\n presentation = 'card';\n }\n\n const isHeaderInPush = isAndroid\n ? headerShown\n : presentation === 'card' && headerShown !== false;\n\n const insets = useSafeAreaInsets();\n const frame = useSafeAreaFrame();\n\n // `modal` and `formSheet` presentations do not take whole screen, so should not take the inset.\n const isModal = presentation === 'modal' || presentation === 'formSheet';\n\n // Modals are fullscreen in landscape only on iPhone\n const isIPhone =\n Platform.OS === 'ios' && !(Platform.isPad || Platform.isTVOS);\n const isLandscape = frame.width > frame.height;\n\n const topInset = isModal || (isIPhone && isLandscape) ? 0 : insets.top;\n\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const defaultHeaderHeight = getDefaultHeaderHeight(frame, isModal, topInset);\n\n const [customHeaderHeight, setCustomHeaderHeight] =\n React.useState(defaultHeaderHeight);\n\n const headerHeight = header ? customHeaderHeight : defaultHeaderHeight;\n\n return (\n <Screen\n key={route.key}\n enabled\n style={StyleSheet.absoluteFill}\n customAnimationOnSwipe={customAnimationOnGesture}\n fullScreenSwipeEnabled={fullScreenGestureEnabled}\n gestureEnabled={\n isAndroid\n ? // This prop enables handling of system back gestures on Android\n // Since we handle them in JS side, we disable this\n false\n : gestureEnabled\n }\n homeIndicatorHidden={autoHideHomeIndicator}\n navigationBarColor={navigationBarColor}\n navigationBarHidden={navigationBarHidden}\n replaceAnimation={animationTypeForReplace}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n stackAnimation={animation}\n screenOrientation={orientation}\n statusBarAnimation={statusBarAnimation}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n statusBarColor={statusBarColor}\n statusBarTranslucent={statusBarTranslucent}\n swipeDirection={gestureDirectionOverride}\n transitionDuration={animationDuration}\n onWillDisappear={onWillDisappear}\n onAppear={onAppear}\n onDisappear={onDisappear}\n onDismissed={onDismissed}\n isNativeStack\n >\n <NavigationContext.Provider value={navigation}>\n <NavigationRouteContext.Provider value={route}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || isHeaderInPush !== false}\n >\n <HeaderHeightContext.Provider\n value={\n isHeaderInPush !== false\n ? headerHeight\n : parentHeaderHeight ?? 0\n }\n >\n {header !== undefined && headerShown !== false ? (\n <View\n onLayout={(e) => {\n setCustomHeaderHeight(e.nativeEvent.layout.height);\n }}\n >\n {header({\n back: previousDescriptor\n ? {\n title: getHeaderTitle(\n previousDescriptor.options,\n previousDescriptor.route.name\n ),\n }\n : undefined,\n options,\n route,\n navigation,\n })}\n </View>\n ) : (\n <HeaderConfig\n {...options}\n route={route}\n headerShown={isHeaderInPush}\n headerHeight={headerHeight}\n canGoBack={index !== 0}\n />\n )}\n <MaybeNestedStack\n options={options}\n route={route}\n presentation={presentation}\n headerHeight={headerHeight}\n >\n {render()}\n </MaybeNestedStack>\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </NavigationRouteContext.Provider>\n </NavigationContext.Provider>\n </Screen>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nfunction NativeStackViewInner({ state, navigation, descriptors }: Props) {\n const [nextDismissedKey, setNextDismissedKey] = React.useState<string | null>(\n null\n );\n\n const dismissedRouteName = nextDismissedKey\n ? state.routes.find((route) => route.key === nextDismissedKey)?.name\n : null;\n\n React.useEffect(() => {\n if (dismissedRouteName) {\n const message =\n `The screen '${dismissedRouteName}' was removed natively but didn't get removed from JS state. ` +\n `This can happen if the action was prevented in a 'beforeRemove' listener, which is not fully supported in native-stack.\\n\\n` +\n `Consider using 'gestureEnabled: false' to prevent back gesture and use a custom back button with 'headerLeft' option to override the native behavior.`;\n\n console.error(message);\n }\n }, [dismissedRouteName]);\n\n return (\n <ScreenStack style={styles.container}>\n {state.routes.map((route, index) => {\n const descriptor = descriptors[route.key];\n const previousKey = state.routes[index - 1]?.key;\n const nextKey = state.routes[index + 1]?.key;\n const previousDescriptor = previousKey\n ? descriptors[previousKey]\n : undefined;\n const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n\n return (\n <SceneView\n key={route.key}\n index={index}\n descriptor={descriptor}\n previousDescriptor={previousDescriptor}\n nextDescriptor={nextDescriptor}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onAppear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: false },\n target: route.key,\n });\n }}\n onDisappear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: true },\n target: route.key,\n });\n }}\n onDismissed={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n\n setNextDismissedKey(route.key);\n }}\n />\n );\n })}\n </ScreenStack>\n );\n}\n\nexport default function NativeStackView(props: Props) {\n return (\n <SafeAreaProviderCompat>\n <NativeStackViewInner {...props} />\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { HeaderTitle } from '@react-navigation/elements';
1
+ import { getHeaderTitle, HeaderTitle } from '@react-navigation/elements';
2
2
  import { useTheme } from '@react-navigation/native';
3
3
  import * as React from 'react';
4
4
  import { I18nManager, Platform, StyleSheet, View } from 'react-native';
@@ -48,7 +48,10 @@ export default function HeaderConfig(_ref) {
48
48
  const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};
49
49
  const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};
50
50
  const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = processFonts([headerBackTitleStyleFlattened.fontFamily, headerLargeTitleStyleFlattened.fontFamily, headerTitleStyleFlattened.fontFamily]);
51
- const titleText = title !== undefined ? title : route.name;
51
+ const titleText = getHeaderTitle({
52
+ title,
53
+ headerTitle
54
+ }, route.name);
52
55
  const titleColor = (_ref2 = (_headerTitleStyleFlat = headerTitleStyleFlattened.color) !== null && _headerTitleStyleFlat !== void 0 ? _headerTitleStyleFlat : headerTintColor) !== null && _ref2 !== void 0 ? _ref2 : colors.text;
53
56
  const titleFontSize = headerTitleStyleFlattened.fontSize;
54
57
  const titleFontWeight = headerTitleStyleFlattened.fontWeight;
@@ -122,7 +125,7 @@ export default function HeaderConfig(_ref) {
122
125
  largeTitleFontSize: headerLargeTitleStyleFlattened.fontSize,
123
126
  largeTitleFontWeight: headerLargeTitleStyleFlattened.fontWeight,
124
127
  largeTitleHideShadow: headerLargeTitleShadowVisible === false,
125
- title: typeof headerTitle === 'string' ? headerTitle : titleText,
128
+ title: titleText,
126
129
  titleColor: titleColor,
127
130
  titleFontFamily: titleFontFamily,
128
131
  titleFontSize: titleFontSize,
@@ -1 +1 @@
1
- {"version":3,"sources":["HeaderConfig.tsx"],"names":["HeaderTitle","useTheme","React","I18nManager","Platform","StyleSheet","View","useSafeAreaInsets","isSearchBarAvailableForCurrentPlatform","ScreenStackHeaderBackButtonImage","ScreenStackHeaderCenterView","ScreenStackHeaderConfig","ScreenStackHeaderLeftView","ScreenStackHeaderRightView","ScreenStackHeaderSearchBarView","SearchBar","processFonts","HeaderConfig","headerHeight","headerBackImageSource","headerBackButtonMenuEnabled","headerBackTitle","headerBackTitleStyle","headerBackTitleVisible","headerBackVisible","headerShadowVisible","headerLargeStyle","headerLargeTitle","headerLargeTitleShadowVisible","headerLargeTitleStyle","headerBackground","headerLeft","headerRight","headerShown","headerStyle","headerBlurEffect","headerTintColor","headerTitle","headerTitleAlign","headerTitleStyle","headerTransparent","headerSearchBarOptions","route","title","canGoBack","insets","colors","tintColor","OS","primary","text","headerBackTitleStyleFlattened","flatten","headerLargeTitleStyleFlattened","headerTitleStyleFlattened","headerStyleFlattened","headerLargeStyleFlattened","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","fontFamily","titleText","undefined","name","titleColor","color","titleFontSize","fontSize","titleFontWeight","fontWeight","headerTitleStyleSupported","headerLeftElement","label","headerRightElement","headerTitleElement","children","supportsHeaderSearchBar","hasHeaderSearchBar","Error","backButtonInCustomView","translucent","styles","background","height","backgroundColor","card","isRTL","top","row","create","flexDirection","alignItems","position","left","right","zIndex","overflow"],"mappings":"AAAA,SAASA,WAAT,QAA4B,4BAA5B;AACA,SAAgBC,QAAhB,QAAgC,0BAAhC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,WADF,EAEEC,QAFF,EAGEC,UAHF,EAKEC,IALF,QAMO,cANP;AAOA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SACEC,sCADF,EAEEC,gCAFF,EAGEC,2BAHF,EAIEC,uBAJF,EAKEC,yBALF,EAMEC,0BANF,EAOEC,8BAPF,EAQEC,SARF,QASO,sBATP;AAYA,SAASC,YAAT,QAA6B,iBAA7B;AAQA,eAAe,SAASC,YAAT,OA4BQ;AAAA;;AAAA,MA5Bc;AACnCC,IAAAA,YADmC;AAEnCC,IAAAA,qBAFmC;AAGnCC,IAAAA,2BAHmC;AAInCC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AA,WAAW,EAAE;AACXY,IAAAA,QAAQ,EAAE,UADC;AAEXL,IAAAA,GAAG,EAAE,CAFM;AAGXM,IAAAA,IAAI,EAAE,CAHK;AAIXC,IAAAA,KAAK,EAAE,CAJI;AAKXC,IAAAA,MAAM,EAAE;AALG,GALkB;AAY/Bb,EAAAA,UAAU,EAAE;AACVc,IAAAA,QAAQ,EAAE;AADA;AAZmB,CAAlB,CAAf","sourcesContent":["import { HeaderTitle } from '@react-navigation/elements';\nimport { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n I18nManager,\n Platform,\n StyleSheet,\n TextStyle,\n View,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n isSearchBarAvailableForCurrentPlatform,\n ScreenStackHeaderBackButtonImage,\n ScreenStackHeaderCenterView,\n ScreenStackHeaderConfig,\n ScreenStackHeaderLeftView,\n ScreenStackHeaderRightView,\n ScreenStackHeaderSearchBarView,\n SearchBar,\n} from 'react-native-screens';\n\nimport type { NativeStackNavigationOptions } from '../types';\nimport { processFonts } from './FontProcessor';\n\ntype Props = NativeStackNavigationOptions & {\n headerHeight: number;\n route: Route<string>;\n canGoBack: boolean;\n};\n\nexport default function HeaderConfig({\n headerHeight,\n headerBackImageSource,\n headerBackButtonMenuEnabled,\n headerBackTitle,\n headerBackTitleStyle,\n headerBackTitleVisible = true,\n headerBackVisible,\n headerShadowVisible,\n headerLargeStyle,\n headerLargeTitle,\n headerLargeTitleShadowVisible,\n headerLargeTitleStyle,\n headerBackground,\n headerLeft,\n headerRight,\n headerShown,\n headerStyle,\n headerBlurEffect,\n headerTintColor,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerTransparent,\n headerSearchBarOptions,\n route,\n title,\n canGoBack,\n}: Props): JSX.Element {\n const insets = useSafeAreaInsets();\n\n const { colors } = useTheme();\n const tintColor =\n headerTintColor ?? (Platform.OS === 'ios' ? colors.primary : colors.text);\n\n const headerBackTitleStyleFlattened =\n StyleSheet.flatten(headerBackTitleStyle) || {};\n const headerLargeTitleStyleFlattened =\n StyleSheet.flatten(headerLargeTitleStyle) || {};\n const headerTitleStyleFlattened = StyleSheet.flatten(headerTitleStyle) || {};\n const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};\n const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};\n\n const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =\n processFonts([\n headerBackTitleStyleFlattened.fontFamily,\n headerLargeTitleStyleFlattened.fontFamily,\n headerTitleStyleFlattened.fontFamily,\n ]);\n\n const titleText = title !== undefined ? title : route.name;\n const titleColor =\n headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text;\n const titleFontSize = headerTitleStyleFlattened.fontSize;\n const titleFontWeight = headerTitleStyleFlattened.fontWeight;\n\n const headerTitleStyleSupported: TextStyle = { color: titleColor };\n\n if (headerTitleStyleFlattened.fontFamily != null) {\n headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;\n }\n\n if (titleFontSize != null) {\n headerTitleStyleSupported.fontSize = titleFontSize;\n }\n\n if (titleFontWeight != null) {\n headerTitleStyleSupported.fontWeight = titleFontWeight;\n }\n\n const headerLeftElement = headerLeft?.({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n });\n const headerRightElement = headerRight?.({\n tintColor,\n canGoBack,\n });\n const headerTitleElement =\n typeof headerTitle === 'function'\n ? headerTitle({ tintColor, children: titleText })\n : null;\n\n const supportsHeaderSearchBar =\n typeof isSearchBarAvailableForCurrentPlatform === 'boolean'\n ? isSearchBarAvailableForCurrentPlatform\n : // Fallback for older versions of react-native-screens\n Platform.OS === 'ios' && SearchBar != null;\n\n const hasHeaderSearchBar =\n supportsHeaderSearchBar && headerSearchBarOptions != null;\n\n if (headerSearchBarOptions != null && !supportsHeaderSearchBar) {\n throw new Error(\n `The current version of 'react-native-screens' doesn't support SearchBar in the header. Please update to the latest version to use this option.`\n );\n }\n\n /**\n * We need to set this in if:\n * - Back button should stay visible when `headerLeft` is specified\n * - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button\n */\n const backButtonInCustomView = headerBackVisible\n ? headerLeftElement != null\n : Platform.OS === 'android' && headerTitleElement != null;\n\n const translucent =\n headerBackground != null ||\n headerTransparent ||\n // When using a SearchBar or large title, the header needs to be translucent for it to work on iOS\n ((hasHeaderSearchBar || headerLargeTitle) &&\n Platform.OS === 'ios' &&\n headerTransparent !== false);\n\n return (\n <>\n {headerBackground != null ? (\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}\n >\n {headerBackground()}\n </View>\n ) : null}\n <ScreenStackHeaderConfig\n backButtonInCustomView={backButtonInCustomView}\n backgroundColor={\n headerStyleFlattened.backgroundColor ??\n (headerBackground != null || headerTransparent\n ? 'transparent'\n : colors.card)\n }\n backTitle={headerBackTitleVisible ? headerBackTitle : ' '}\n backTitleFontFamily={backTitleFontFamily}\n backTitleFontSize={headerBackTitleStyleFlattened.fontSize}\n blurEffect={headerBlurEffect}\n color={tintColor}\n direction={I18nManager.isRTL ? 'rtl' : 'ltr'}\n disableBackButtonMenu={headerBackButtonMenuEnabled === false}\n hidden={headerShown === false}\n hideBackButton={headerBackVisible === false}\n hideShadow={\n headerShadowVisible === false ||\n headerBackground != null ||\n headerTransparent\n }\n largeTitle={headerLargeTitle}\n largeTitleBackgroundColor={headerLargeStyleFlattened.backgroundColor}\n largeTitleColor={headerLargeTitleStyleFlattened.color}\n largeTitleFontFamily={largeTitleFontFamily}\n largeTitleFontSize={headerLargeTitleStyleFlattened.fontSize}\n largeTitleFontWeight={headerLargeTitleStyleFlattened.fontWeight}\n largeTitleHideShadow={headerLargeTitleShadowVisible === false}\n title={typeof headerTitle === 'string' ? headerTitle : titleText}\n titleColor={titleColor}\n titleFontFamily={titleFontFamily}\n titleFontSize={titleFontSize}\n titleFontWeight={titleFontWeight}\n topInsetEnabled={insets.top !== 0}\n translucent={\n // This defaults to `true`, so we can't pass `undefined`\n translucent === true\n }\n >\n {Platform.OS === 'ios' ? (\n <>\n {headerLeftElement != null ? (\n <ScreenStackHeaderLeftView>\n {headerLeftElement}\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleElement != null ? (\n <ScreenStackHeaderCenterView>\n {headerTitleElement}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n ) : (\n <>\n {headerLeftElement != null || typeof headerTitle === 'function' ? (\n <ScreenStackHeaderLeftView>\n <View style={styles.row}>\n {headerLeftElement}\n {headerTitleAlign !== 'center' ? (\n typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )\n ) : null}\n </View>\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleAlign === 'center' ? (\n <ScreenStackHeaderCenterView>\n {typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n )}\n {headerBackImageSource !== undefined ? (\n <ScreenStackHeaderBackButtonImage source={headerBackImageSource} />\n ) : null}\n {headerRightElement != null ? (\n <ScreenStackHeaderRightView>\n {headerRightElement}\n </ScreenStackHeaderRightView>\n ) : null}\n {hasHeaderSearchBar ? (\n <ScreenStackHeaderSearchBarView>\n <SearchBar {...headerSearchBarOptions} />\n </ScreenStackHeaderSearchBarView>\n ) : null}\n </ScreenStackHeaderConfig>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n translucent: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
1
+ {"version":3,"sources":["HeaderConfig.tsx"],"names":["getHeaderTitle","HeaderTitle","useTheme","React","I18nManager","Platform","StyleSheet","View","useSafeAreaInsets","isSearchBarAvailableForCurrentPlatform","ScreenStackHeaderBackButtonImage","ScreenStackHeaderCenterView","ScreenStackHeaderConfig","ScreenStackHeaderLeftView","ScreenStackHeaderRightView","ScreenStackHeaderSearchBarView","SearchBar","processFonts","HeaderConfig","headerHeight","headerBackImageSource","headerBackButtonMenuEnabled","headerBackTitle","headerBackTitleStyle","headerBackTitleVisible","headerBackVisible","headerShadowVisible","headerLargeStyle","headerLargeTitle","headerLargeTitleShadowVisible","headerLargeTitleStyle","headerBackground","headerLeft","headerRight","headerShown","headerStyle","headerBlurEffect","headerTintColor","headerTitle","headerTitleAlign","headerTitleStyle","headerTransparent","headerSearchBarOptions","route","title","canGoBack","insets","colors","tintColor","OS","primary","text","headerBackTitleStyleFlattened","flatten","headerLargeTitleStyleFlattened","headerTitleStyleFlattened","headerStyleFlattened","headerLargeStyleFlattened","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","fontFamily","titleText","name","titleColor","color","titleFontSize","fontSize","titleFontWeight","fontWeight","headerTitleStyleSupported","headerLeftElement","label","headerRightElement","headerTitleElement","children","supportsHeaderSearchBar","hasHeaderSearchBar","Error","backButtonInCustomView","translucent","styles","background","height","backgroundColor","card","isRTL","top","row","undefined","create","flexDirection","alignItems","position","left","right","zIndex","overflow"],"mappings":"AAAA,SAASA,cAAT,EAAyBC,WAAzB,QAA4C,4BAA5C;AACA,SAAgBC,QAAhB,QAAgC,0BAAhC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,WADF,EAEEC,QAFF,EAGEC,UAHF,EAKEC,IALF,QAMO,cANP;AAOA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SACEC,sCADF,EAEEC,gCAFF,EAGEC,2BAHF,EAIEC,uBAJF,EAKEC,yBALF,EAMEC,0BANF,EAOEC,8BAPF,EAQEC,SARF,QASO,sBATP;AAYA,SAASC,YAAT,QAA6B,iBAA7B;AAQA,eAAe,SAASC,YAAT,OA4BQ;AAAA;;AAAA,MA5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,IAAAA,UAAU,EAAE;AAFT,GAD0B;AAK/BZ,EAAAA,WAAW,EAAE;AACXa,IAAAA,QAAQ,EAAE,UADC;AAEXN,IAAAA,GAAG,EAAE,CAFM;AAGXO,IAAAA,IAAI,EAAE,CAHK;AAIXC,IAAAA,KAAK,EAAE,CAJI;AAKXC,IAAAA,MAAM,EAAE;AALG,GALkB;AAY/Bd,EAAAA,UAAU,EAAE;AACVe,IAAAA,QAAQ,EAAE;AADA;AAZmB,CAAlB,CAAf","sourcesContent":["import { getHeaderTitle, HeaderTitle } from '@react-navigation/elements';\nimport { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n I18nManager,\n Platform,\n StyleSheet,\n TextStyle,\n View,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n isSearchBarAvailableForCurrentPlatform,\n ScreenStackHeaderBackButtonImage,\n ScreenStackHeaderCenterView,\n ScreenStackHeaderConfig,\n ScreenStackHeaderLeftView,\n ScreenStackHeaderRightView,\n ScreenStackHeaderSearchBarView,\n SearchBar,\n} from 'react-native-screens';\n\nimport type { NativeStackNavigationOptions } from '../types';\nimport { processFonts } from './FontProcessor';\n\ntype Props = NativeStackNavigationOptions & {\n headerHeight: number;\n route: Route<string>;\n canGoBack: boolean;\n};\n\nexport default function HeaderConfig({\n headerHeight,\n headerBackImageSource,\n headerBackButtonMenuEnabled,\n headerBackTitle,\n headerBackTitleStyle,\n headerBackTitleVisible = true,\n headerBackVisible,\n headerShadowVisible,\n headerLargeStyle,\n headerLargeTitle,\n headerLargeTitleShadowVisible,\n headerLargeTitleStyle,\n headerBackground,\n headerLeft,\n headerRight,\n headerShown,\n headerStyle,\n headerBlurEffect,\n headerTintColor,\n headerTitle,\n headerTitleAlign,\n headerTitleStyle,\n headerTransparent,\n headerSearchBarOptions,\n route,\n title,\n canGoBack,\n}: Props): JSX.Element {\n const insets = useSafeAreaInsets();\n\n const { colors } = useTheme();\n const tintColor =\n headerTintColor ?? (Platform.OS === 'ios' ? colors.primary : colors.text);\n\n const headerBackTitleStyleFlattened =\n StyleSheet.flatten(headerBackTitleStyle) || {};\n const headerLargeTitleStyleFlattened =\n StyleSheet.flatten(headerLargeTitleStyle) || {};\n const headerTitleStyleFlattened = StyleSheet.flatten(headerTitleStyle) || {};\n const headerStyleFlattened = StyleSheet.flatten(headerStyle) || {};\n const headerLargeStyleFlattened = StyleSheet.flatten(headerLargeStyle) || {};\n\n const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =\n processFonts([\n headerBackTitleStyleFlattened.fontFamily,\n headerLargeTitleStyleFlattened.fontFamily,\n headerTitleStyleFlattened.fontFamily,\n ]);\n\n const titleText = getHeaderTitle({ title, headerTitle }, route.name);\n const titleColor =\n headerTitleStyleFlattened.color ?? headerTintColor ?? colors.text;\n const titleFontSize = headerTitleStyleFlattened.fontSize;\n const titleFontWeight = headerTitleStyleFlattened.fontWeight;\n\n const headerTitleStyleSupported: TextStyle = { color: titleColor };\n\n if (headerTitleStyleFlattened.fontFamily != null) {\n headerTitleStyleSupported.fontFamily = headerTitleStyleFlattened.fontFamily;\n }\n\n if (titleFontSize != null) {\n headerTitleStyleSupported.fontSize = titleFontSize;\n }\n\n if (titleFontWeight != null) {\n headerTitleStyleSupported.fontWeight = titleFontWeight;\n }\n\n const headerLeftElement = headerLeft?.({\n tintColor,\n canGoBack,\n label: headerBackTitle,\n });\n const headerRightElement = headerRight?.({\n tintColor,\n canGoBack,\n });\n const headerTitleElement =\n typeof headerTitle === 'function'\n ? headerTitle({\n tintColor,\n children: titleText,\n })\n : null;\n\n const supportsHeaderSearchBar =\n typeof isSearchBarAvailableForCurrentPlatform === 'boolean'\n ? isSearchBarAvailableForCurrentPlatform\n : // Fallback for older versions of react-native-screens\n Platform.OS === 'ios' && SearchBar != null;\n\n const hasHeaderSearchBar =\n supportsHeaderSearchBar && headerSearchBarOptions != null;\n\n if (headerSearchBarOptions != null && !supportsHeaderSearchBar) {\n throw new Error(\n `The current version of 'react-native-screens' doesn't support SearchBar in the header. Please update to the latest version to use this option.`\n );\n }\n\n /**\n * We need to set this in if:\n * - Back button should stay visible when `headerLeft` is specified\n * - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button\n */\n const backButtonInCustomView = headerBackVisible\n ? headerLeftElement != null\n : Platform.OS === 'android' && headerTitleElement != null;\n\n const translucent =\n headerBackground != null ||\n headerTransparent ||\n // When using a SearchBar or large title, the header needs to be translucent for it to work on iOS\n ((hasHeaderSearchBar || headerLargeTitle) &&\n Platform.OS === 'ios' &&\n headerTransparent !== false);\n\n return (\n <>\n {headerBackground != null ? (\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}\n >\n {headerBackground()}\n </View>\n ) : null}\n <ScreenStackHeaderConfig\n backButtonInCustomView={backButtonInCustomView}\n backgroundColor={\n headerStyleFlattened.backgroundColor ??\n (headerBackground != null || headerTransparent\n ? 'transparent'\n : colors.card)\n }\n backTitle={headerBackTitleVisible ? headerBackTitle : ' '}\n backTitleFontFamily={backTitleFontFamily}\n backTitleFontSize={headerBackTitleStyleFlattened.fontSize}\n blurEffect={headerBlurEffect}\n color={tintColor}\n direction={I18nManager.isRTL ? 'rtl' : 'ltr'}\n disableBackButtonMenu={headerBackButtonMenuEnabled === false}\n hidden={headerShown === false}\n hideBackButton={headerBackVisible === false}\n hideShadow={\n headerShadowVisible === false ||\n headerBackground != null ||\n headerTransparent\n }\n largeTitle={headerLargeTitle}\n largeTitleBackgroundColor={headerLargeStyleFlattened.backgroundColor}\n largeTitleColor={headerLargeTitleStyleFlattened.color}\n largeTitleFontFamily={largeTitleFontFamily}\n largeTitleFontSize={headerLargeTitleStyleFlattened.fontSize}\n largeTitleFontWeight={headerLargeTitleStyleFlattened.fontWeight}\n largeTitleHideShadow={headerLargeTitleShadowVisible === false}\n title={titleText}\n titleColor={titleColor}\n titleFontFamily={titleFontFamily}\n titleFontSize={titleFontSize}\n titleFontWeight={titleFontWeight}\n topInsetEnabled={insets.top !== 0}\n translucent={\n // This defaults to `true`, so we can't pass `undefined`\n translucent === true\n }\n >\n {Platform.OS === 'ios' ? (\n <>\n {headerLeftElement != null ? (\n <ScreenStackHeaderLeftView>\n {headerLeftElement}\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleElement != null ? (\n <ScreenStackHeaderCenterView>\n {headerTitleElement}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n ) : (\n <>\n {headerLeftElement != null || typeof headerTitle === 'function' ? (\n <ScreenStackHeaderLeftView>\n <View style={styles.row}>\n {headerLeftElement}\n {headerTitleAlign !== 'center' ? (\n typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )\n ) : null}\n </View>\n </ScreenStackHeaderLeftView>\n ) : null}\n {headerTitleAlign === 'center' ? (\n <ScreenStackHeaderCenterView>\n {typeof headerTitle === 'function' ? (\n headerTitleElement\n ) : (\n <HeaderTitle\n tintColor={tintColor}\n style={headerTitleStyleSupported}\n >\n {titleText}\n </HeaderTitle>\n )}\n </ScreenStackHeaderCenterView>\n ) : null}\n </>\n )}\n {headerBackImageSource !== undefined ? (\n <ScreenStackHeaderBackButtonImage source={headerBackImageSource} />\n ) : null}\n {headerRightElement != null ? (\n <ScreenStackHeaderRightView>\n {headerRightElement}\n </ScreenStackHeaderRightView>\n ) : null}\n {hasHeaderSearchBar ? (\n <ScreenStackHeaderSearchBarView>\n <SearchBar {...headerSearchBarOptions} />\n </ScreenStackHeaderSearchBarView>\n ) : null}\n </ScreenStackHeaderConfig>\n </>\n );\n}\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n translucent: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
@@ -17,7 +17,7 @@ export default function NativeStackView(_ref) {
17
17
  const previousKey = (_state$routes = state.routes[i - 1]) === null || _state$routes === void 0 ? void 0 : _state$routes.key;
18
18
  const nextKey = (_state$routes2 = state.routes[i + 1]) === null || _state$routes2 === void 0 ? void 0 : _state$routes2.key;
19
19
  const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;
20
- const nexDescriptor = nextKey ? descriptors[nextKey] : undefined;
20
+ const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
21
21
  const {
22
22
  options,
23
23
  navigation,
@@ -36,11 +36,12 @@ export default function NativeStackView(_ref) {
36
36
  headerStyle,
37
37
  headerShadowVisible,
38
38
  headerTransparent,
39
+ headerBackground,
39
40
  headerBackTitle,
40
41
  presentation,
41
42
  contentStyle
42
43
  } = options;
43
- const nextPresentation = nexDescriptor === null || nexDescriptor === void 0 ? void 0 : nexDescriptor.options.presentation;
44
+ const nextPresentation = nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation;
44
45
  return /*#__PURE__*/React.createElement(Screen, {
45
46
  key: route.key,
46
47
  focused: isFocused,
@@ -104,13 +105,10 @@ export default function NativeStackView(_ref) {
104
105
  } : headerTitle,
105
106
  headerTitleAlign: headerTitleAlign,
106
107
  headerTitleStyle: headerTitleStyle,
107
- headerStyle: [headerTransparent ? {
108
- position: 'absolute',
109
- backgroundColor: 'transparent'
110
- } : null, headerStyle, headerShadowVisible === false ? {
111
- shadowOpacity: 0,
112
- borderBottomWidth: 0
113
- } : null]
108
+ headerTransparent: headerTransparent,
109
+ headerShadowVisible: headerShadowVisible,
110
+ headerBackground: headerBackground,
111
+ headerStyle: headerStyle
114
112
  }),
115
113
  style: [StyleSheet.absoluteFill, {
116
114
  display: isFocused || nextPresentation != null && TRANSPARENT_PRESENTATIONS.includes(nextPresentation) ? 'flex' : 'none'