Files
t3code/patches/[email protected]
T

116 lines
9.2 KiB
Diff

diff --git a/build/react-navigation/native-stack/types.d.ts b/build/react-navigation/native-stack/types.d.ts
index 6de73e0c33cedbaaaffdcb092ba21fc9ff71862e..78929fe237b7f9d7808f8de2b844e822976e0d69 100644
--- a/build/react-navigation/native-stack/types.d.ts
+++ b/build/react-navigation/native-stack/types.d.ts
@@ -306,6 +306,39 @@ export type NativeStackNavigationOptions = {
* @platform ios
*/
unstable_headerRightItems?: (props: NativeStackHeaderItemProps) => NativeStackHeaderItem[];
+ /**
+ * Function which returns an array of items to display as the centered item
+ * group in modern iOS headers.
+ *
+ * This is an unstable API and might change in the future.
+ *
+ * @platform ios
+ */
+ unstable_headerCenterItems?: (props: NativeStackHeaderItemProps) => NativeStackHeaderItem[];
+ /**
+ * Function which returns an array of toolbar items for the current screen.
+ *
+ * This is an unstable API and might change in the future.
+ *
+ * @platform ios
+ */
+ unstable_headerToolbarItems?: (props: NativeStackHeaderItemProps) => NonNullable<ScreenStackHeaderConfigProps['headerToolbarItems']>;
+ /**
+ * String displayed below the compact navigation title on iOS 26+.
+ *
+ * This is an unstable API and might change in the future.
+ *
+ * @platform ios
+ */
+ unstable_headerSubtitle?: ScreenStackHeaderConfigProps['subtitle'];
+ /**
+ * Native iOS navigation item style to apply to the header.
+ *
+ * This is an unstable API and might change in the future.
+ *
+ * @platform ios
+ */
+ unstable_navigationItemStyle?: ScreenStackHeaderConfigProps['navigationItemStyle'];
/**
* String or a function that returns a React Element to be used by the header.
* Defaults to screen `title` or route name.
@@ -1115,7 +1148,8 @@ export type NativeStackHeaderItemCustom = {
* if the items don't fit the available space, they will be collapsed into a menu automatically.
* Items with `type: 'custom'` will not be included in this automatic collapsing behavior.
*/
-export type NativeStackHeaderItem = NativeStackHeaderItemButton | NativeStackHeaderItemMenu | NativeStackHeaderItemSpacing | NativeStackHeaderItemCustom;
+export type NativeStackHeaderRawRNSItem = NonNullable<ScreenStackHeaderConfigProps['headerLeftBarButtonItems']>[number] | NonNullable<ScreenStackHeaderConfigProps['headerRightBarButtonItems']>[number] | NonNullable<ScreenStackHeaderConfigProps['headerCenterBarButtonItems']>[number];
+export type NativeStackHeaderItem = NativeStackHeaderItemButton | NativeStackHeaderItemMenu | NativeStackHeaderItemSpacing | NativeStackHeaderItemCustom | NativeStackHeaderRawRNSItem;
export type NativeStackNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, StackNavigationState<ParamListBase>, NativeStackNavigationOptions, NativeStackNavigationEventMap, NativeStackNavigationProp<ParamListBase>> & StackRouterOptions & NativeStackNavigationConfig;
export type NativeStackDescriptor = Descriptor<NativeStackNavigationOptions, NativeStackNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
export type NativeStackDescriptorMap = {
diff --git a/build/react-navigation/native-stack/views/useHeaderConfigProps.d.ts b/build/react-navigation/native-stack/views/useHeaderConfigProps.d.ts
index 218c4291fdb57600a45d32fbcefe3707a520fe79..5fdbb2754755a27589ad1555eae892b5fbee2c6a 100644
--- a/build/react-navigation/native-stack/views/useHeaderConfigProps.d.ts
+++ b/build/react-navigation/native-stack/views/useHeaderConfigProps.d.ts
@@ -10,6 +10,6 @@ type Props = NativeStackNavigationOptions & {
} | undefined;
route: Route<string>;
};
-export declare function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBackButtonDisplayMode, headerBackButtonMenuEnabled, headerBackTitle, headerBackTitleStyle, headerBackVisible, headerShadowVisible, headerLargeStyle, headerLargeTitle: headerLargeTitleDeprecated, headerLargeTitleEnabled, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle, headerTransparent, headerSearchBarOptions, headerTopInsetEnabled, headerBack, route, title, unstable_headerLeftItems: headerLeftItems, unstable_headerRightItems: headerRightItems, }: Props): ScreenStackHeaderConfigProps;
+export declare function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBackButtonDisplayMode, headerBackButtonMenuEnabled, headerBackTitle, headerBackTitleStyle, headerBackVisible, headerShadowVisible, headerLargeStyle, headerLargeTitle: headerLargeTitleDeprecated, headerLargeTitleEnabled, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle, headerTransparent, headerSearchBarOptions, headerTopInsetEnabled, headerBack, route, title, unstable_headerLeftItems: headerLeftItems, unstable_headerRightItems: headerRightItems, unstable_headerCenterItems: headerCenterItems, unstable_headerToolbarItems: headerToolbarItems, unstable_headerSubtitle: headerSubtitle, unstable_navigationItemStyle: navigationItemStyle, }: Props): ScreenStackHeaderConfigProps;
export {};
//# sourceMappingURL=useHeaderConfigProps.d.ts.map
diff --git a/build/react-navigation/native-stack/views/useHeaderConfigProps.js b/build/react-navigation/native-stack/views/useHeaderConfigProps.js
index 2de6d160cedffb4ffb124adf7cd10979ec6ee778..9d839442e00e136204630663f207a45c950dcd25 100644
--- a/build/react-navigation/native-stack/views/useHeaderConfigProps.js
+++ b/build/react-navigation/native-stack/views/useHeaderConfigProps.js
@@ -22,6 +22,9 @@ const processBarButtonItems = (items, colors, fonts) => {
}
return item;
}
+ if (item.type === 'searchField' || item.type === 'searchBarPlacement' || item.type === 'mailSearchToolbar') {
+ return item;
+ }
if (item.type === 'button' || item.type === 'menu') {
if (item.type === 'menu' && item.menu == null) {
throw new Error(`Menu item must have a 'menu' property defined: ${JSON.stringify(item)}`);
@@ -108,7 +111,7 @@ const getMenuItem = (item) => {
subtitle: description,
};
};
-function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBackButtonDisplayMode, headerBackButtonMenuEnabled, headerBackTitle, headerBackTitleStyle, headerBackVisible, headerShadowVisible, headerLargeStyle, headerLargeTitle: headerLargeTitleDeprecated, headerLargeTitleEnabled = headerLargeTitleDeprecated, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle, headerTransparent, headerSearchBarOptions, headerTopInsetEnabled, headerBack, route, title, unstable_headerLeftItems: headerLeftItems, unstable_headerRightItems: headerRightItems, }) {
+function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBackButtonDisplayMode, headerBackButtonMenuEnabled, headerBackTitle, headerBackTitleStyle, headerBackVisible, headerShadowVisible, headerLargeStyle, headerLargeTitle: headerLargeTitleDeprecated, headerLargeTitleEnabled = headerLargeTitleDeprecated, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle, headerTransparent, headerSearchBarOptions, headerTopInsetEnabled, headerBack, route, title, unstable_headerLeftItems: headerLeftItems, unstable_headerRightItems: headerRightItems, unstable_headerCenterItems: headerCenterItems, unstable_headerToolbarItems: headerToolbarItems, unstable_headerSubtitle: headerSubtitle, unstable_navigationItemStyle: navigationItemStyle, }) {
const { direction } = (0, native_1.useLocale)();
const { colors, fonts, dark } = (0, native_1.useTheme)();
const tintColor = headerTintColor ?? (react_native_1.Platform.OS === 'ios' ? colors.primary : colors.text);
@@ -216,6 +219,14 @@ function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBac
tintColor,
canGoBack,
});
+ const centerItems = headerCenterItems?.({
+ tintColor,
+ canGoBack,
+ });
+ const toolbarItems = headerToolbarItems?.({
+ tintColor,
+ canGoBack,
+ });
if (rightItems) {
// iOS renders right items in reverse order
// So we need to reverse them here to match the order
@@ -270,6 +281,10 @@ function useHeaderConfigProps({ headerBackIcon, headerBackImageSource, headerBac
children,
headerLeftBarButtonItems: processBarButtonItems(leftItems, colors, fonts),
headerRightBarButtonItems: processBarButtonItems(rightItems, colors, fonts),
+ subtitle: headerSubtitle,
+ headerCenterBarButtonItems: processBarButtonItems(centerItems, colors, fonts),
+ headerToolbarItems: toolbarItems,
+ navigationItemStyle,
experimental_userInterfaceStyle: dark ? 'dark' : 'light',
};
}