@react-navigation/native-stack 7.8.6 → 8.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createNativeStackNavigator.js +7 -6
- package/lib/module/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/views/NativeStackView.js +4 -4
- package/lib/module/views/NativeStackView.js.map +1 -1
- package/lib/module/views/NativeStackView.native.js +159 -200
- package/lib/module/views/NativeStackView.native.js.map +1 -1
- package/lib/module/views/useHeaderConfigProps.js +44 -24
- package/lib/module/views/useHeaderConfigProps.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createNativeStackNavigator.d.ts +10 -6
- package/lib/typescript/src/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +72 -67
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/src/views/NativeStackView.native.d.ts.map +1 -1
- package/lib/typescript/src/views/useHeaderConfigProps.d.ts +1 -1
- package/lib/typescript/src/views/useHeaderConfigProps.d.ts.map +1 -1
- package/package.json +15 -17
- package/src/index.tsx +4 -1
- package/src/navigators/createNativeStackNavigator.tsx +48 -25
- package/src/types.tsx +72 -72
- package/src/views/NativeStackView.native.tsx +191 -253
- package/src/views/NativeStackView.tsx +6 -9
- package/src/views/useHeaderConfigProps.tsx +32 -30
- package/lib/module/views/FontProcessor.js +0 -6
- package/lib/module/views/FontProcessor.js.map +0 -1
- package/lib/module/views/FontProcessor.native.js +0 -12
- package/lib/module/views/FontProcessor.native.js.map +0 -1
- package/lib/typescript/src/views/FontProcessor.d.ts +0 -2
- package/lib/typescript/src/views/FontProcessor.d.ts.map +0 -1
- package/lib/typescript/src/views/FontProcessor.native.d.ts +0 -2
- package/lib/typescript/src/views/FontProcessor.native.d.ts.map +0 -1
- package/src/views/FontProcessor.native.tsx +0 -12
- package/src/views/FontProcessor.tsx +0 -5
package/src/types.tsx
CHANGED
|
@@ -53,31 +53,27 @@ export type NativeStackNavigationEventMap = {
|
|
|
53
53
|
export type NativeStackNavigationProp<
|
|
54
54
|
ParamList extends ParamListBase,
|
|
55
55
|
RouteName extends keyof ParamList = string,
|
|
56
|
-
NavigatorID extends string | undefined = undefined,
|
|
57
56
|
> = NavigationProp<
|
|
58
57
|
ParamList,
|
|
59
58
|
RouteName,
|
|
60
|
-
NavigatorID,
|
|
61
59
|
StackNavigationState<ParamList>,
|
|
62
60
|
NativeStackNavigationOptions,
|
|
63
|
-
NativeStackNavigationEventMap
|
|
64
|
-
>
|
|
65
|
-
|
|
61
|
+
NativeStackNavigationEventMap,
|
|
62
|
+
StackActionHelpers<ParamList>
|
|
63
|
+
>;
|
|
66
64
|
|
|
67
65
|
export type NativeStackScreenProps<
|
|
68
66
|
ParamList extends ParamListBase,
|
|
69
67
|
RouteName extends keyof ParamList = string,
|
|
70
|
-
NavigatorID extends string | undefined = undefined,
|
|
71
68
|
> = {
|
|
72
|
-
navigation: NativeStackNavigationProp<ParamList, RouteName
|
|
69
|
+
navigation: NativeStackNavigationProp<ParamList, RouteName>;
|
|
73
70
|
route: RouteProp<ParamList, RouteName>;
|
|
74
71
|
};
|
|
75
72
|
|
|
76
73
|
export type NativeStackOptionsArgs<
|
|
77
74
|
ParamList extends ParamListBase,
|
|
78
75
|
RouteName extends keyof ParamList = keyof ParamList,
|
|
79
|
-
|
|
80
|
-
> = NativeStackScreenProps<ParamList, RouteName, NavigatorID> & {
|
|
76
|
+
> = NativeStackScreenProps<ParamList, RouteName> & {
|
|
81
77
|
theme: Theme;
|
|
82
78
|
};
|
|
83
79
|
|
|
@@ -121,7 +117,7 @@ export type NativeStackHeaderItemProps = {
|
|
|
121
117
|
/**
|
|
122
118
|
* Tint color for the header.
|
|
123
119
|
*/
|
|
124
|
-
tintColor?:
|
|
120
|
+
tintColor?: ColorValue;
|
|
125
121
|
/**
|
|
126
122
|
* Whether it's possible to navigate back in stack.
|
|
127
123
|
*/
|
|
@@ -193,7 +189,6 @@ export type NativeStackNavigationOptions = {
|
|
|
193
189
|
}>;
|
|
194
190
|
/**
|
|
195
191
|
* Icon to display in the header as the icon in the back button.
|
|
196
|
-
*
|
|
197
192
|
* Defaults to back icon image for the platform
|
|
198
193
|
* - A chevron on iOS
|
|
199
194
|
* - An arrow on Android
|
|
@@ -210,15 +205,9 @@ export type NativeStackNavigationOptions = {
|
|
|
210
205
|
type: 'image';
|
|
211
206
|
source: ImageSourcePropType;
|
|
212
207
|
};
|
|
213
|
-
/**
|
|
214
|
-
* Image to display in the header as the icon in the back button.
|
|
215
|
-
*
|
|
216
|
-
* @deprecated Use `headerBackIcon` instead.
|
|
217
|
-
*/
|
|
218
|
-
headerBackImageSource?: ImageSourcePropType;
|
|
219
208
|
/**
|
|
220
209
|
* Style of the header when a large title is shown.
|
|
221
|
-
* The large title is shown if `
|
|
210
|
+
* The large title is shown if `headerLargeTitleEnabled` is `true` and
|
|
222
211
|
* the edge of any scrollable content reaches the matching edge of the header.
|
|
223
212
|
*
|
|
224
213
|
* Supported properties:
|
|
@@ -229,7 +218,7 @@ export type NativeStackNavigationOptions = {
|
|
|
229
218
|
* @platform ios
|
|
230
219
|
*/
|
|
231
220
|
headerLargeStyle?: StyleProp<{
|
|
232
|
-
backgroundColor?:
|
|
221
|
+
backgroundColor?: ColorValue;
|
|
233
222
|
}>;
|
|
234
223
|
/**
|
|
235
224
|
* Whether to enable header with large title which collapses to regular header on scroll.
|
|
@@ -243,12 +232,6 @@ export type NativeStackNavigationOptions = {
|
|
|
243
232
|
* @platform ios
|
|
244
233
|
*/
|
|
245
234
|
headerLargeTitleEnabled?: boolean;
|
|
246
|
-
/**
|
|
247
|
-
* Whether to enable header with large title which collapses to regular header on scroll.
|
|
248
|
-
*
|
|
249
|
-
* @deprecated Use `headerLargeTitleEnabled` instead.
|
|
250
|
-
*/
|
|
251
|
-
headerLargeTitle?: boolean;
|
|
252
235
|
/**
|
|
253
236
|
* Whether drop shadow of header is visible when a large title is shown.
|
|
254
237
|
*
|
|
@@ -272,7 +255,7 @@ export type NativeStackNavigationOptions = {
|
|
|
272
255
|
fontFamily?: string;
|
|
273
256
|
fontSize?: number;
|
|
274
257
|
fontWeight?: string;
|
|
275
|
-
color?:
|
|
258
|
+
color?: ColorValue;
|
|
276
259
|
}>;
|
|
277
260
|
/**
|
|
278
261
|
* Whether to show the header. The header is shown by default.
|
|
@@ -284,7 +267,7 @@ export type NativeStackNavigationOptions = {
|
|
|
284
267
|
* - backgroundColor
|
|
285
268
|
*/
|
|
286
269
|
headerStyle?: StyleProp<{
|
|
287
|
-
backgroundColor?:
|
|
270
|
+
backgroundColor?: ColorValue;
|
|
288
271
|
}>;
|
|
289
272
|
/**
|
|
290
273
|
* Whether to hide the elevation shadow (Android) or the bottom border (iOS) on the header.
|
|
@@ -310,7 +293,7 @@ export type NativeStackNavigationOptions = {
|
|
|
310
293
|
/**
|
|
311
294
|
* Tint color for the header. Changes the color of back button and title.
|
|
312
295
|
*/
|
|
313
|
-
headerTintColor?:
|
|
296
|
+
headerTintColor?: ColorValue;
|
|
314
297
|
/**
|
|
315
298
|
* Function which returns a React Element to render as the background of the header.
|
|
316
299
|
* This is useful for using backgrounds such as an image, a gradient, blur effect etc.
|
|
@@ -369,7 +352,7 @@ export type NativeStackNavigationOptions = {
|
|
|
369
352
|
/**
|
|
370
353
|
* Tint color for the header.
|
|
371
354
|
*/
|
|
372
|
-
tintColor?:
|
|
355
|
+
tintColor?: ColorValue;
|
|
373
356
|
}) => React.ReactNode);
|
|
374
357
|
/**
|
|
375
358
|
* How to align the the header title.
|
|
@@ -387,7 +370,7 @@ export type NativeStackNavigationOptions = {
|
|
|
387
370
|
*/
|
|
388
371
|
headerTitleStyle?: StyleProp<
|
|
389
372
|
Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontWeight'> & {
|
|
390
|
-
color?:
|
|
373
|
+
color?: ColorValue;
|
|
391
374
|
}
|
|
392
375
|
>;
|
|
393
376
|
/**
|
|
@@ -395,7 +378,9 @@ export type NativeStackNavigationOptions = {
|
|
|
395
378
|
* You also need to specify `contentInsetAdjustmentBehavior="automatic"` in your `ScrollView`, `FlatList` etc.
|
|
396
379
|
* If you don't have a `ScrollView`, specify `headerTransparent: false`.
|
|
397
380
|
*/
|
|
398
|
-
headerSearchBarOptions?: SearchBarProps
|
|
381
|
+
headerSearchBarOptions?: Omit<SearchBarProps, 'onChangeText'> & {
|
|
382
|
+
onChange?: SearchBarProps['onChangeText'];
|
|
383
|
+
};
|
|
399
384
|
/**
|
|
400
385
|
* Boolean indicating whether to show the menu on longPress of iOS >= 14 back button. Defaults to `true`.
|
|
401
386
|
* Requires `react-native-screens` version >=3.3.0.
|
|
@@ -439,26 +424,6 @@ export type NativeStackNavigationOptions = {
|
|
|
439
424
|
* @platform ios
|
|
440
425
|
*/
|
|
441
426
|
keyboardHandlingEnabled?: boolean;
|
|
442
|
-
/**
|
|
443
|
-
* Sets the navigation bar color. Defaults to initial navigation bar color.
|
|
444
|
-
*
|
|
445
|
-
* @deprecated For all apps targeting Android SDK 35 or above edge-to-edge is enabled by default.
|
|
446
|
-
* This prop is subject to removal in the future.
|
|
447
|
-
* See: https://developer.android.com/about/versions/15/behavior-changes-15#ux.
|
|
448
|
-
*
|
|
449
|
-
* @platform android
|
|
450
|
-
*/
|
|
451
|
-
navigationBarColor?: string;
|
|
452
|
-
/**
|
|
453
|
-
* Boolean indicating whether the content should be visible behind the navigation bar. Defaults to `false`.
|
|
454
|
-
*
|
|
455
|
-
* @deprecated For all apps targeting Android SDK 35 or above edge-to-edge is enabled by default.
|
|
456
|
-
* This prop is subject to removal in the future.
|
|
457
|
-
* See: https://developer.android.com/about/versions/15/behavior-changes-15#ux.
|
|
458
|
-
*
|
|
459
|
-
* @platform android
|
|
460
|
-
*/
|
|
461
|
-
navigationBarTranslucent?: boolean;
|
|
462
427
|
/**
|
|
463
428
|
* Sets the visibility of the navigation bar. Defaults to `false`.
|
|
464
429
|
*
|
|
@@ -477,16 +442,6 @@ export type NativeStackNavigationOptions = {
|
|
|
477
442
|
* @platform android, ios
|
|
478
443
|
*/
|
|
479
444
|
statusBarAnimation?: ScreenProps['statusBarAnimation'];
|
|
480
|
-
/**
|
|
481
|
-
* Sets the status bar color (similar to the `StatusBar` component). Defaults to initial status bar color.
|
|
482
|
-
*
|
|
483
|
-
* @deprecated For all apps targeting Android SDK 35 or above edge-to-edge is enabled by default.
|
|
484
|
-
* This prop is subject to removal in the future.
|
|
485
|
-
* See: https://developer.android.com/about/versions/15/behavior-changes-15#ux.
|
|
486
|
-
*
|
|
487
|
-
* @platform android
|
|
488
|
-
*/
|
|
489
|
-
statusBarBackgroundColor?: string;
|
|
490
445
|
/**
|
|
491
446
|
* Whether the status bar should be hidden on this screen.
|
|
492
447
|
* Requires setting `View controller-based status bar appearance -> YES` in your Info.plist file.
|
|
@@ -508,16 +463,6 @@ export type NativeStackNavigationOptions = {
|
|
|
508
463
|
* @platform android, ios
|
|
509
464
|
*/
|
|
510
465
|
statusBarStyle?: ScreenProps['statusBarStyle'];
|
|
511
|
-
/**
|
|
512
|
-
* Sets the translucency of the status bar. Defaults to `false`.
|
|
513
|
-
*
|
|
514
|
-
* @deprecated For all apps targeting Android SDK 35 or above edge-to-edge is enabled by default.
|
|
515
|
-
* This prop is subject to removal in the future.
|
|
516
|
-
* See: https://developer.android.com/about/versions/15/behavior-changes-15#ux.
|
|
517
|
-
*
|
|
518
|
-
* @platform android
|
|
519
|
-
*/
|
|
520
|
-
statusBarTranslucent?: boolean;
|
|
521
466
|
/**
|
|
522
467
|
* Sets the direction in which you should swipe to dismiss the screen.
|
|
523
468
|
* When using `vertical` option, options `fullScreenGestureEnabled: true`, `animationMatchesGesture: true` and `animation: 'slide_from_bottom'` are set by default.
|
|
@@ -934,6 +879,10 @@ export type NativeStackHeaderItemMenuAction = {
|
|
|
934
879
|
* Label for the menu item.
|
|
935
880
|
*/
|
|
936
881
|
label: string;
|
|
882
|
+
/**
|
|
883
|
+
* The secondary text displayed alongside the label of the menu item.
|
|
884
|
+
*/
|
|
885
|
+
description?: string;
|
|
937
886
|
/**
|
|
938
887
|
* Icon for the menu item.
|
|
939
888
|
*/
|
|
@@ -996,6 +945,40 @@ export type NativeStackHeaderItemMenuSubmenu = {
|
|
|
996
945
|
* Icon for the submenu item.
|
|
997
946
|
*/
|
|
998
947
|
icon?: PlatformIconIOSSfSymbol;
|
|
948
|
+
/**
|
|
949
|
+
* Whether the menu is displayed inline with the parent menu.
|
|
950
|
+
* By default, submenus are displayed after expanding the parent menu item.
|
|
951
|
+
* Inline menus are displayed as part of the parent menu as a section.
|
|
952
|
+
*
|
|
953
|
+
* Defaults to `false`.
|
|
954
|
+
*
|
|
955
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline
|
|
956
|
+
*/
|
|
957
|
+
inline?: boolean;
|
|
958
|
+
/**
|
|
959
|
+
* How the submenu items are displayed.
|
|
960
|
+
* - `default`: menu items are displayed normally.
|
|
961
|
+
* - `palette`: menu items are displayed in a horizontal row.
|
|
962
|
+
*
|
|
963
|
+
* Defaults to `default`.
|
|
964
|
+
*
|
|
965
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette
|
|
966
|
+
*/
|
|
967
|
+
layout?: 'default' | 'palette';
|
|
968
|
+
/**
|
|
969
|
+
* Whether to apply destructive style to the menu item.
|
|
970
|
+
*
|
|
971
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive
|
|
972
|
+
*/
|
|
973
|
+
destructive?: boolean;
|
|
974
|
+
/**
|
|
975
|
+
* Whether multiple items in the submenu can be selected, i.e. in "on" state.
|
|
976
|
+
*
|
|
977
|
+
* Defaults to `false`.
|
|
978
|
+
*
|
|
979
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/singleselection
|
|
980
|
+
*/
|
|
981
|
+
multiselectable?: boolean;
|
|
999
982
|
/**
|
|
1000
983
|
* Array of menu items (actions or submenus).
|
|
1001
984
|
*/
|
|
@@ -1022,6 +1005,24 @@ export type NativeStackHeaderItemMenu = SharedHeaderItem & {
|
|
|
1022
1005
|
* Optional title to show on top of the menu.
|
|
1023
1006
|
*/
|
|
1024
1007
|
title?: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* Whether multiple items in the submenu can be selected, i.e. in "on" state.
|
|
1010
|
+
*
|
|
1011
|
+
* Defaults to `false`.
|
|
1012
|
+
*
|
|
1013
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/singleselection
|
|
1014
|
+
*/
|
|
1015
|
+
multiselectable?: boolean;
|
|
1016
|
+
/**
|
|
1017
|
+
* How the submenu items are displayed.
|
|
1018
|
+
* - `default`: menu items are displayed normally.
|
|
1019
|
+
* - `palette`: menu items are displayed in a horizontal row.
|
|
1020
|
+
*
|
|
1021
|
+
* Defaults to `default`.
|
|
1022
|
+
*
|
|
1023
|
+
* Read more: https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette
|
|
1024
|
+
*/
|
|
1025
|
+
layout?: 'default' | 'palette';
|
|
1025
1026
|
/**
|
|
1026
1027
|
* Array of menu items (actions or submenus).
|
|
1027
1028
|
*/
|
|
@@ -1077,7 +1078,6 @@ export type NativeStackHeaderItem =
|
|
|
1077
1078
|
|
|
1078
1079
|
export type NativeStackNavigatorProps = DefaultNavigatorOptions<
|
|
1079
1080
|
ParamListBase,
|
|
1080
|
-
string | undefined,
|
|
1081
1081
|
StackNavigationState<ParamListBase>,
|
|
1082
1082
|
NativeStackNavigationOptions,
|
|
1083
1083
|
NativeStackNavigationEventMap,
|