react-native-screens 3.20.0 → 3.21.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.
Files changed (209) hide show
  1. package/README.md +2 -1
  2. package/RNScreens.podspec +1 -1
  3. package/android/build.gradle +24 -6
  4. package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +4 -0
  5. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +7 -9
  6. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +12 -4
  7. package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +10 -0
  8. package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +32 -8
  9. package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +36 -15
  10. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +24 -0
  11. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +24 -0
  12. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +24 -0
  13. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +29 -0
  14. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +24 -0
  15. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +24 -0
  16. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +24 -0
  17. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +26 -0
  18. package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
  19. package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
  20. package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
  21. package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
  22. package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -0
  23. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +15 -0
  24. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +5 -0
  25. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -0
  26. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -0
  27. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +1 -2
  28. package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
  29. package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
  30. package/ios/RNSConvert.h +8 -2
  31. package/ios/RNSConvert.mm +28 -2
  32. package/ios/RNSEnums.h +6 -0
  33. package/ios/RNSFullWindowOverlay.h +5 -5
  34. package/ios/RNSFullWindowOverlay.mm +13 -13
  35. package/ios/RNSScreen.h +14 -6
  36. package/ios/RNSScreen.mm +129 -28
  37. package/ios/RNSScreenContainer.h +2 -2
  38. package/ios/RNSScreenContainer.mm +5 -5
  39. package/ios/RNSScreenNavigationContainer.mm +3 -3
  40. package/ios/RNSScreenStack.h +4 -4
  41. package/ios/RNSScreenStack.mm +62 -23
  42. package/ios/RNSScreenStackHeaderConfig.h +10 -3
  43. package/ios/RNSScreenStackHeaderConfig.mm +138 -81
  44. package/ios/RNSScreenStackHeaderSubview.h +5 -6
  45. package/ios/RNSScreenStackHeaderSubview.mm +20 -11
  46. package/ios/RNSScreenWindowTraits.mm +21 -2
  47. package/ios/RNSSearchBar.h +5 -4
  48. package/ios/RNSSearchBar.mm +87 -12
  49. package/ios/RNScreens.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  50. package/ios/RNScreens.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  51. package/ios/RNScreens.xcodeproj/project.xcworkspace/xcuserdata/wojciechlewicki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  52. package/ios/RNScreens.xcodeproj/xcuserdata/wojciechlewicki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
  53. package/lib/commonjs/TransitionProgressContext.js.map +1 -1
  54. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -5
  55. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  56. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -5
  57. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
  58. package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -5
  59. package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
  60. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
  61. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  62. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -8
  63. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  64. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -8
  65. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  66. package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -5
  67. package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
  68. package/lib/commonjs/fabric/SearchBarNativeComponent.js +7 -7
  69. package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
  70. package/lib/commonjs/index.js +1 -1
  71. package/lib/commonjs/index.js.map +1 -1
  72. package/lib/commonjs/index.native.js +50 -10
  73. package/lib/commonjs/index.native.js.map +1 -1
  74. package/lib/commonjs/native-stack/index.js.map +1 -1
  75. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -16
  76. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  77. package/lib/commonjs/native-stack/types.js.map +1 -1
  78. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
  79. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  80. package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  81. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
  82. package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
  83. package/lib/commonjs/native-stack/views/FontProcessor.js +1 -0
  84. package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
  85. package/lib/commonjs/native-stack/views/HeaderConfig.js +3 -1
  86. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
  87. package/lib/commonjs/native-stack/views/NativeStackView.js +14 -1
  88. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
  89. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  90. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
  91. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
  92. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
  93. package/lib/commonjs/reanimated/index.js.map +1 -1
  94. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  95. package/lib/commonjs/types.js.map +1 -1
  96. package/lib/commonjs/useTransitionProgress.js.map +1 -1
  97. package/lib/commonjs/utils.js.map +1 -1
  98. package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -5
  99. package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  100. package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -5
  101. package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
  102. package/lib/module/fabric/ScreenNativeComponent.js +0 -5
  103. package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
  104. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
  105. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  106. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -6
  107. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  108. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -6
  109. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  110. package/lib/module/fabric/ScreenStackNativeComponent.js +0 -5
  111. package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
  112. package/lib/module/fabric/SearchBarNativeComponent.js +4 -6
  113. package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
  114. package/lib/module/index.js +1 -1
  115. package/lib/module/index.js.map +1 -1
  116. package/lib/module/index.native.js +51 -10
  117. package/lib/module/index.native.js.map +1 -1
  118. package/lib/module/native-stack/navigators/createNativeStackNavigator.js +18 -16
  119. package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  120. package/lib/module/native-stack/types.js.map +1 -1
  121. package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  122. package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  123. package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
  124. package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
  125. package/lib/module/native-stack/views/FontProcessor.js +1 -0
  126. package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
  127. package/lib/module/native-stack/views/HeaderConfig.js +3 -1
  128. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
  129. package/lib/module/native-stack/views/NativeStackView.js +15 -1
  130. package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
  131. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  132. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
  133. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
  134. package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  135. package/lib/module/types.js.map +1 -1
  136. package/lib/module/useTransitionProgress.js.map +1 -1
  137. package/lib/module/utils.js.map +1 -1
  138. package/lib/typescript/TransitionProgressContext.d.ts +1 -1
  139. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +6 -0
  140. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +6 -0
  141. package/lib/typescript/fabric/ScreenNativeComponent.d.ts +62 -0
  142. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +6 -0
  143. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +34 -0
  144. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +9 -0
  145. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +9 -0
  146. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +46 -0
  147. package/lib/typescript/index.d.ts +2 -2
  148. package/lib/typescript/native-stack/types.d.ts +64 -10
  149. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +1 -1
  150. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -1
  151. package/lib/typescript/native-stack/views/HeaderConfig.d.ts +1 -1
  152. package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -1
  153. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
  154. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
  155. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +1 -1
  156. package/lib/typescript/types.d.ts +90 -11
  157. package/lib/typescript/useTransitionProgress.d.ts +3 -3
  158. package/native-stack/README.md +59 -1
  159. package/package.json +11 -14
  160. package/src/fabric/FullWindowOverlayNativeComponent.ts +6 -0
  161. package/src/fabric/ScreenContainerNativeComponent.ts +6 -0
  162. package/src/fabric/ScreenNativeComponent.ts +97 -0
  163. package/src/fabric/ScreenNavigationContainerNativeComponent.ts +9 -0
  164. package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +43 -0
  165. package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +20 -0
  166. package/src/fabric/ScreenStackNativeComponent.ts +12 -0
  167. package/src/fabric/SearchBarNativeComponent.ts +73 -0
  168. package/src/index.native.tsx +107 -14
  169. package/src/index.tsx +4 -3
  170. package/src/native-stack/navigators/createNativeStackNavigator.tsx +23 -19
  171. package/src/native-stack/types.tsx +55 -0
  172. package/src/native-stack/views/FontProcessor.tsx +1 -0
  173. package/src/native-stack/views/HeaderConfig.tsx +3 -1
  174. package/src/native-stack/views/NativeStackView.tsx +14 -2
  175. package/src/types.tsx +84 -2
  176. package/createNativeStackNavigator/README.md +0 -522
  177. package/createNativeStackNavigator/package.json +0 -6
  178. package/lib/commonjs/createNativeStackNavigator.js +0 -374
  179. package/lib/commonjs/createNativeStackNavigator.js.map +0 -1
  180. package/lib/module/createNativeStackNavigator.js +0 -366
  181. package/lib/module/createNativeStackNavigator.js.map +0 -1
  182. package/lib/typescript/createNativeStackNavigator.d.ts +0 -51
  183. package/src/createNativeStackNavigator.tsx +0 -594
  184. package/src/fabric/FullWindowOverlayNativeComponent.js +0 -19
  185. package/src/fabric/ScreenContainerNativeComponent.js +0 -19
  186. package/src/fabric/ScreenNativeComponent.js +0 -97
  187. package/src/fabric/ScreenNavigationContainerNativeComponent.js +0 -19
  188. package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -54
  189. package/src/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -31
  190. package/src/fabric/ScreenStackNativeComponent.js +0 -23
  191. package/src/fabric/SearchBarNativeComponent.js +0 -62
  192. /package/android/src/main/res/{anim → base/anim}/rns_default_enter_in.xml +0 -0
  193. /package/android/src/main/res/{anim → base/anim}/rns_default_enter_out.xml +0 -0
  194. /package/android/src/main/res/{anim → base/anim}/rns_default_exit_in.xml +0 -0
  195. /package/android/src/main/res/{anim → base/anim}/rns_default_exit_out.xml +0 -0
  196. /package/android/src/main/res/{anim → base/anim}/rns_fade_from_bottom.xml +0 -0
  197. /package/android/src/main/res/{anim → base/anim}/rns_fade_in.xml +0 -0
  198. /package/android/src/main/res/{anim → base/anim}/rns_fade_out.xml +0 -0
  199. /package/android/src/main/res/{anim → base/anim}/rns_fade_to_bottom.xml +0 -0
  200. /package/android/src/main/res/{anim → base/anim}/rns_no_animation_20.xml +0 -0
  201. /package/android/src/main/res/{anim → base/anim}/rns_no_animation_250.xml +0 -0
  202. /package/android/src/main/res/{anim → base/anim}/rns_no_animation_350.xml +0 -0
  203. /package/android/src/main/res/{anim → base/anim}/rns_no_animation_medium.xml +0 -0
  204. /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_bottom.xml +0 -0
  205. /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_left.xml +0 -0
  206. /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_right.xml +0 -0
  207. /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_bottom.xml +0 -0
  208. /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_left.xml +0 -0
  209. /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_right.xml +0 -0
@@ -1,8 +1,8 @@
1
1
  import { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, ParamListBase, StackNavigationState, StackRouterOptions, StackActionHelpers, RouteProp } from '@react-navigation/native';
2
2
  import * as React from 'react';
3
3
  import { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
4
- import { ScreenProps, ScreenStackHeaderConfigProps, SearchBarProps } from 'react-native-screens';
5
- export type NativeStackNavigationEventMap = {
4
+ import { ScreenProps, ScreenStackHeaderConfigProps, SearchBarProps, SheetDetentTypes } from 'react-native-screens';
5
+ export declare type NativeStackNavigationEventMap = {
6
6
  /**
7
7
  * Event which fires when the screen appears.
8
8
  *
@@ -34,14 +34,14 @@ export type NativeStackNavigationEventMap = {
34
34
  };
35
35
  };
36
36
  };
37
- export type NativeStackNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string> = NavigationProp<ParamList, RouteName, StackNavigationState<ParamList>, NativeStackNavigationOptions, NativeStackNavigationEventMap> & StackActionHelpers<ParamList>;
38
- export type NativeStackScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string> = {
37
+ export declare type NativeStackNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string> = NavigationProp<ParamList, RouteName, StackNavigationState<ParamList>, NativeStackNavigationOptions, NativeStackNavigationEventMap> & StackActionHelpers<ParamList>;
38
+ export declare type NativeStackScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = string> = {
39
39
  navigation: NativeStackNavigationProp<ParamList, RouteName>;
40
40
  route: RouteProp<ParamList, RouteName>;
41
41
  };
42
- export type NativeStackNavigationHelpers = NavigationHelpers<ParamListBase, NativeStackNavigationEventMap>;
43
- export type NativeStackNavigationConfig = {};
44
- export type NativeStackNavigationOptions = {
42
+ export declare type NativeStackNavigationHelpers = NavigationHelpers<ParamListBase, NativeStackNavigationEventMap>;
43
+ export declare type NativeStackNavigationConfig = {};
44
+ export declare type NativeStackNavigationOptions = {
45
45
  /**
46
46
  * Image to display in the header as the back button.
47
47
  * Defaults to back icon image for the platform (a chevron on iOS and an arrow on Android).
@@ -290,6 +290,60 @@ export type NativeStackNavigationOptions = {
290
290
  * Object in which you should pass props in order to render native iOS searchBar.
291
291
  */
292
292
  searchBar?: SearchBarProps;
293
+ /**
294
+ * Describes heights where a sheet can rest.
295
+ * Works only when `stackPresentation` is set to `formSheet`.
296
+ * Defaults to `large`.
297
+ *
298
+ * Available values:
299
+ *
300
+ * - `large` - only large detent level will be allowed
301
+ * - `medium` - only medium detent level will be allowed
302
+ * - `all` - all detent levels will be allowed
303
+ *
304
+ * @platform ios
305
+ */
306
+ sheetAllowedDetents?: SheetDetentTypes;
307
+ /**
308
+ * Whether the sheet should expand to larger detent when scrolling.
309
+ * Works only when `stackPresentation` is set to `formSheet`.
310
+ * Defaults to `true`.
311
+ */
312
+ sheetExpandsWhenScrolledToEdge?: boolean;
313
+ /**
314
+ * The corner radius that the sheet will try to render with.
315
+ * Works only when `stackPresentation` is set to `formSheet`.
316
+ *
317
+ * If set to non-negative value it will try to render sheet with provided radius, else ti will apply system default.
318
+ *
319
+ * If left unset system default is used.
320
+ *
321
+ * @platform ios
322
+ */
323
+ sheetCornerRadius?: number;
324
+ /**
325
+ * Boolean indicating whether the sheet shows a grabber at the top.
326
+ * Works only when `stackPresentation` is set to `formSheet`.
327
+ * Defaults to `false`.
328
+ *
329
+ * @platform ios
330
+ */
331
+ sheetGrabberVisible?: boolean;
332
+ /**
333
+ * The largest sheet detent for which a view underneath won't be dimmed.
334
+ * Works only when `stackPresentation` is se tto `formSheet`.
335
+ *
336
+ * If this prop is set to:
337
+ *
338
+ * - `large` - the view underneath won't be dimmed at any detent level
339
+ * - `medium` - the view underneath will be dimmed only when detent level is `large`
340
+ * - `all` - the view underneath will be dimmed for any detent level
341
+ *
342
+ * Defaults to `all`.
343
+ *
344
+ * @platform ios
345
+ */
346
+ sheetLargestUndimmedDetent?: SheetDetentTypes;
293
347
  /**
294
348
  * How the screen should appear/disappear when pushed or popped at the top of the stack.
295
349
  * The following values are currently supported:
@@ -361,8 +415,8 @@ export type NativeStackNavigationOptions = {
361
415
  */
362
416
  transitionDuration?: number;
363
417
  };
364
- export type NativeStackNavigatorProps = DefaultNavigatorOptions<NativeStackNavigationOptions> & StackRouterOptions & NativeStackNavigationConfig;
365
- export type NativeStackDescriptor = Descriptor<ParamListBase, string, StackNavigationState<ParamListBase>, NativeStackNavigationOptions>;
366
- export type NativeStackDescriptorMap = {
418
+ export declare type NativeStackNavigatorProps = DefaultNavigatorOptions<NativeStackNavigationOptions> & StackRouterOptions & NativeStackNavigationConfig;
419
+ export declare type NativeStackDescriptor = Descriptor<ParamListBase, string, StackNavigationState<ParamListBase>, NativeStackNavigationOptions>;
420
+ export declare type NativeStackDescriptorMap = {
367
421
  [key: string]: NativeStackDescriptor;
368
422
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
- type Props = {
3
+ declare type Props = {
4
4
  children: React.ReactNode;
5
5
  style?: StyleProp<ViewStyle>;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { StackPresentationTypes } from 'react-native-screens';
2
- type Layout = {
2
+ declare type Layout = {
3
3
  width: number;
4
4
  height: number;
5
5
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Route } from '@react-navigation/native';
3
3
  import { NativeStackNavigationOptions } from '../types';
4
- type Props = NativeStackNavigationOptions & {
4
+ declare type Props = NativeStackNavigationOptions & {
5
5
  route: Route<string>;
6
6
  };
7
7
  export default function HeaderConfig({ backButtonImage, backButtonInCustomView, direction, disableBackButtonMenu, headerBackTitle, headerBackTitleStyle, headerBackTitleVisible, headerCenter, headerHideBackButton, headerHideShadow, headerLargeStyle, headerLargeTitle, headerLargeTitleHideShadow, headerLargeTitleStyle, headerLeft, headerRight, headerShown, headerStyle, headerTintColor, headerTitle, headerTitleStyle, headerTopInsetEnabled, headerTranslucent, route, searchBar, title, }: Props): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ParamListBase, StackNavigationState } from '@react-navigation/native';
3
3
  import { NativeStackDescriptorMap, NativeStackNavigationHelpers } from '../types';
4
- type Props = {
4
+ declare type Props = {
5
5
  state: StackNavigationState<ParamListBase>;
6
6
  navigation: NativeStackNavigationHelpers;
7
7
  descriptors: NativeStackDescriptorMap;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ScreenProps } from 'react-native-screens';
3
3
  import Animated from 'react-native-reanimated';
4
- declare const ReanimatedNativeStackScreen: React.ForwardRefExoticComponent<Pick<ScreenProps, "active" | "activityState" | "children" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
4
+ declare const ReanimatedNativeStackScreen: React.ForwardRefExoticComponent<Omit<ScreenProps, "ref"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
5
5
  export default ReanimatedNativeStackScreen;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ScreenProps } from 'react-native-screens';
3
3
  import Animated from 'react-native-reanimated';
4
- declare const ReanimatedScreen: React.ForwardRefExoticComponent<Pick<ScreenProps, "active" | "activityState" | "children" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
4
+ declare const ReanimatedScreen: React.ForwardRefExoticComponent<Omit<ScreenProps, "ref"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
5
5
  export default ReanimatedScreen;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import Animated from 'react-native-reanimated';
3
- type ReanimatedTransitionProgressContextBody = {
3
+ declare type ReanimatedTransitionProgressContextBody = {
4
4
  progress: Animated.SharedValue<number>;
5
5
  closing: Animated.SharedValue<number>;
6
6
  goingForward: Animated.SharedValue<number>;
@@ -1,26 +1,34 @@
1
1
  /// <reference types="react" />
2
2
  import { Animated, NativeSyntheticEvent, ViewProps, View, TargetedEvent, TextInputFocusEventData } from 'react-native';
3
- export type StackPresentationTypes = 'push' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal' | 'fullScreenModal' | 'formSheet';
4
- export type StackAnimationTypes = 'default' | 'fade' | 'fade_from_bottom' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
5
- export type BlurEffectTypes = 'extraLight' | 'light' | 'dark' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
6
- export type ScreenReplaceTypes = 'push' | 'pop';
7
- export type SwipeDirectionTypes = 'vertical' | 'horizontal';
8
- export type ScreenOrientationTypes = 'default' | 'all' | 'portrait' | 'portrait_up' | 'portrait_down' | 'landscape' | 'landscape_left' | 'landscape_right';
9
- export type HeaderSubviewTypes = 'back' | 'right' | 'left' | 'center' | 'searchBar';
10
- export type TransitionProgressEventType = {
3
+ export declare type SearchBarCommands = {
4
+ focus: () => void;
5
+ blur: () => void;
6
+ clearText: () => void;
7
+ toggleCancelButton: (show: boolean) => void;
8
+ setText: (text: string) => void;
9
+ };
10
+ export declare type StackPresentationTypes = 'push' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal' | 'fullScreenModal' | 'formSheet';
11
+ export declare type StackAnimationTypes = 'default' | 'fade' | 'fade_from_bottom' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
12
+ export declare type BlurEffectTypes = 'extraLight' | 'light' | 'dark' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
13
+ export declare type ScreenReplaceTypes = 'push' | 'pop';
14
+ export declare type SwipeDirectionTypes = 'vertical' | 'horizontal';
15
+ export declare type ScreenOrientationTypes = 'default' | 'all' | 'portrait' | 'portrait_up' | 'portrait_down' | 'landscape' | 'landscape_left' | 'landscape_right';
16
+ export declare type HeaderSubviewTypes = 'back' | 'right' | 'left' | 'center' | 'searchBar';
17
+ export declare type TransitionProgressEventType = {
11
18
  progress: number;
12
19
  closing: number;
13
20
  goingForward: number;
14
21
  };
15
- export type GestureResponseDistanceType = {
22
+ export declare type GestureResponseDistanceType = {
16
23
  start?: number;
17
24
  end?: number;
18
25
  top?: number;
19
26
  bottom?: number;
20
27
  };
28
+ export declare type SheetDetentTypes = 'medium' | 'large' | 'all';
21
29
  export interface ScreenProps extends ViewProps {
22
- active?: 0 | 1 | Animated.AnimatedInterpolation;
23
- activityState?: 0 | 1 | 2 | Animated.AnimatedInterpolation;
30
+ active?: 0 | 1 | Animated.AnimatedInterpolation<number>;
31
+ activityState?: 0 | 1 | 2 | Animated.AnimatedInterpolation<number>;
24
32
  children?: React.ReactNode;
25
33
  /**
26
34
  * Boolean indicating that swipe dismissal should trigger animation provided by `stackAnimation`. Defaults to `false`.
@@ -163,6 +171,60 @@ export interface ScreenProps extends ViewProps {
163
171
  * - "landscape_right" – landscape-right orientation is permitted
164
172
  */
165
173
  screenOrientation?: ScreenOrientationTypes;
174
+ /**
175
+ * Describes heights where a sheet can rest.
176
+ * Works only when `stackPresentation` is set to `formSheet`.
177
+ * Defaults to `large`.
178
+ *
179
+ * Available values:
180
+ *
181
+ * - `large` - only large detent level will be allowed
182
+ * - `medium` - only medium detent level will be allowed
183
+ * - `all` - all detent levels will be allowed
184
+ *
185
+ * @platform ios
186
+ */
187
+ sheetAllowedDetents?: SheetDetentTypes;
188
+ /**
189
+ * Whether the sheet should expand to larger detent when scrolling.
190
+ * Works only when `stackPresentation` is set to `formSheet`.
191
+ * Defaults to `true`.
192
+ */
193
+ sheetExpandsWhenScrolledToEdge?: boolean;
194
+ /**
195
+ * The corner radius that the sheet will try to render with.
196
+ * Works only when `stackPresentation` is set to `formSheet`.
197
+ *
198
+ * If set to non-negative value it will try to render sheet with provided radius, else ti will apply system default.
199
+ *
200
+ * If left unset system default is used.
201
+ *
202
+ * @platform ios
203
+ */
204
+ sheetCornerRadius?: number;
205
+ /**
206
+ * Boolean indicating whether the sheet shows a grabber at the top.
207
+ * Works only when `stackPresentation` is set to `formSheet`.
208
+ * Defaults to `false`.
209
+ *
210
+ * @platform ios
211
+ */
212
+ sheetGrabberVisible?: boolean;
213
+ /**
214
+ * The largest sheet detent for which a view underneath won't be dimmed.
215
+ * Works only when `stackPresentation` is set to `formSheet`.
216
+ *
217
+ * If this prop is set to:
218
+ *
219
+ * - `large` - the view underneath won't be dimmed at any detent level
220
+ * - `medium` - the view underneath will be dimmed only when detent level is `large`
221
+ * - `all` - the view underneath will be dimmed for any detent level
222
+ *
223
+ * Defaults to `all`.
224
+ *
225
+ * @platform ios
226
+ */
227
+ sheetLargestUndimmedDetent?: SheetDetentTypes;
166
228
  /**
167
229
  * How the screen should appear/disappear when pushed or popped at the top of the stack.
168
230
  * The following values are currently supported:
@@ -273,6 +335,11 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
273
335
  * @platform ios
274
336
  */
275
337
  backTitleFontSize?: number;
338
+ /**
339
+ * Whether the back button title should be visible or not. Defaults to `true`.
340
+ * @platform ios
341
+ */
342
+ backTitleVisible?: boolean;
276
343
  /**
277
344
  * Blur effect to be applied to the header. Works with backgroundColor's alpha < 1.
278
345
  * @platform ios
@@ -387,6 +454,18 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
387
454
  translucent?: boolean;
388
455
  }
389
456
  export interface SearchBarProps {
457
+ /**
458
+ * Reference to imperatively modify search bar.
459
+ *
460
+ * Currently supported operations are:
461
+ *
462
+ * * `focus` - focuses the search bar
463
+ * * `blur` - removes focus from the search bar
464
+ * * `clearText` - removes any text present in the search bar input field
465
+ * * `setText` - sets the search bar's content to given value
466
+ * * `toggleCancelButton` - depending on passed boolean value, hides or shows cancel button (iOS only)
467
+ */
468
+ ref?: React.RefObject<SearchBarCommands>;
390
469
  /**
391
470
  * The auto-capitalization behavior
392
471
  */
@@ -1,5 +1,5 @@
1
1
  export default function useTransitionProgress(): {
2
- progress: import("react-native").Animated.Value;
3
- closing: import("react-native").Animated.Value;
4
- goingForward: import("react-native").Animated.Value;
2
+ progress: import("react-native/types").Animated.Value;
3
+ closing: import("react-native/types").Animated.Value;
4
+ goingForward: import("react-native/types").Animated.Value;
5
5
  };
@@ -102,7 +102,7 @@ gestureResponseDistance: {
102
102
 
103
103
  #### `headerBackTitle`
104
104
 
105
- Title string used by the back button on iOS. Defaults to the previous scene's `headerTitle`.
105
+ Title string used by the back button on iOS. Defaults to the previous scene's `headerTitle` when not set or set to whitespace only value.
106
106
 
107
107
  #### `headerBackTitleStyle`
108
108
 
@@ -227,6 +227,54 @@ The following values are currently supported:
227
227
 
228
228
  Defaults to `pop`.
229
229
 
230
+ #### `sheetAllowedDetents` (iOS only)
231
+
232
+ Describes heights where a sheet can rest.
233
+ Works only when `stackPresentation` is set to `formSheet`.
234
+
235
+ Available values:
236
+
237
+ - `large` - only large detent level will be allowed
238
+ - `medium` - only medium detent level will be allowed
239
+ - `all` - all detent levels will be allowed
240
+
241
+ Defaults to `large`.
242
+
243
+ #### `sheetExpandsWhenScrolledToEdge` (iOS only)
244
+
245
+ Whether the sheet should expand to larger detent when scrolling.
246
+ Works only when `stackPresentation` is set to `formSheet`.
247
+
248
+ Defaults to `true`.
249
+
250
+ #### `sheetCornerRadius (iOS only)
251
+
252
+ The corner radius that the sheet will try to render with.
253
+ Works only when `stackPresentation` is set to `formSheet`.
254
+
255
+ If set to non-negative value it will try to render sheet with provided radius, else it will apply system default.
256
+
257
+ Defaults to system default.
258
+
259
+ #### `sheetGrabberVisible` (iOS only)
260
+
261
+ Boolean indicating whether the sheet shows a grabber at the top.
262
+ Works only when `stackPresentation` is set to `formSheet`.
263
+ Defaults to `false`.
264
+
265
+ #### `sheetLargestUndimmedDetent` (iOS only)
266
+
267
+ The largest sheet detent for which a view underneath won't be dimmed.
268
+ Works only when `stackPresentation` is set to `formSheet`.
269
+
270
+ If this prop is set to:
271
+
272
+ - `large` - the view underneath won't be dimmed at any detent level
273
+ - `medium` - the view underneath will be dimmed only when detent level is `large`
274
+ - `all` - the view underneath will be dimmed for any detent level
275
+
276
+ Defaults to `all`.
277
+
230
278
  #### `stackAnimation`
231
279
 
232
280
  How the given screen should appear/disappear when pushed or popped at the top of the stack. Possible values:
@@ -548,6 +596,16 @@ The search and close icon color shown in the header. (Android only)
548
596
 
549
597
  Show the search hint icon when search bar is focused. (Android only)
550
598
 
599
+ #### `ref`
600
+
601
+ A React ref to imperatively modify search bar. Supported actions:
602
+
603
+ * `focus` - focus on search bar
604
+ * `blur` - remove focus from search bar
605
+ * `clearText` - clear text in search bar
606
+ * `setText` - set search bar's content to given string
607
+ * `toggleCancelButton` (iOS only) - toggle cancel button display near search bar.
608
+
551
609
  ### Events
552
610
 
553
611
  The navigator can [emit events](https://reactnavigation.org/docs/navigation-events) on certain actions. Supported events are:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screens",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Native navigation primitives for your React Native app.",
5
5
  "scripts": {
6
6
  "check-types": "tsc --noEmit",
@@ -26,7 +26,6 @@
26
26
  "common/",
27
27
  "lib/",
28
28
  "native-stack/",
29
- "createNativeStackNavigator/",
30
29
  "reanimated/",
31
30
  "android/src/main/AndroidManifest.xml",
32
31
  "android/src/main/java/",
@@ -71,11 +70,10 @@
71
70
  "@react-navigation/native": "^5.8.0",
72
71
  "@react-navigation/stack": "^5.10.0",
73
72
  "@types/jest": "^26.0.8",
74
- "@types/react": "^16.9.44",
75
- "@types/react-native": "^0.63.2",
73
+ "@types/react": "^18.0.24",
76
74
  "@types/react-test-renderer": "^16.9.2",
77
- "@typescript-eslint/eslint-plugin": "^3.7.1",
78
- "@typescript-eslint/parser": "^3.7.1",
75
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
76
+ "@typescript-eslint/parser": "^5.48.2",
79
77
  "@react-native-community/cli": "^9.0.0",
80
78
  "@react-native-community/cli-platform-android": "^9.0.0",
81
79
  "@react-native-community/cli-platform-ios": "^9.0.0",
@@ -99,22 +97,21 @@
99
97
  "lint-staged": "^11.1.2",
100
98
  "metro-react-native-babel-preset": "^0.61.0",
101
99
  "prettier": "^2.0.4",
102
- "react": "^16.13.1",
100
+ "react": "18.2.0",
103
101
  "react-dom": "^16.13.1",
104
- "react-native": "^0.63.2",
102
+ "react-native": "0.71.0",
105
103
  "react-native-reanimated": "^2.2.0",
106
- "react-native-safe-area-context": "^4.0.1-rc.5",
104
+ "react-native-safe-area-context": "^4.4.1",
107
105
  "react-native-windows": "^0.64.8",
108
- "react-navigation": "^4.4.3",
109
- "react-navigation-stack": "^2.9.0",
110
106
  "react-test-renderer": "^16.13.1",
111
- "release-it": "^13.5.2",
112
- "typescript": "^4.8.4"
107
+ "release-it": "^15.6.0",
108
+ "typescript": "4.8.4"
113
109
  },
114
110
  "resolutions": {
115
111
  "@react-native-community/cli-platform-android": "^9.0.0",
116
112
  "@react-native-community/cli": "^9.0.0",
117
- "@react-native-community/cli-platform-ios": "^9.0.0"
113
+ "@react-native-community/cli-platform-ios": "^9.0.0",
114
+ "@types/react": "^18.0.24"
118
115
  },
119
116
  "lint-staged": {
120
117
  "{src,Example}/**/*.{js,ts,tsx}": "yarn format-js",
@@ -0,0 +1,6 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ interface NativeProps extends ViewProps {}
5
+
6
+ export default codegenNativeComponent<NativeProps>('RNSFullWindowOverlay', {});
@@ -0,0 +1,6 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ interface NativeProps extends ViewProps {}
5
+
6
+ export default codegenNativeComponent<NativeProps>('RNSScreenContainer', {});
@@ -0,0 +1,97 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps, ColorValue } from 'react-native';
3
+ import type {
4
+ BubblingEventHandler,
5
+ WithDefault,
6
+ Int32,
7
+ Float,
8
+ Double,
9
+ } from 'react-native/Libraries/Types/CodegenTypes';
10
+
11
+ // eslint-disable-next-line @typescript-eslint/ban-types
12
+ type ScreenEvent = Readonly<{}>;
13
+
14
+ type ScreenDismissedEvent = Readonly<{
15
+ dismissCount: Int32;
16
+ }>;
17
+
18
+ type TransitionProgressEvent = Readonly<{
19
+ progress: Double;
20
+ closing: Int32;
21
+ goingForward: Int32;
22
+ }>;
23
+
24
+ type GestureResponseDistanceType = Readonly<{
25
+ start: Float;
26
+ end: Float;
27
+ top: Float;
28
+ bottom: Float;
29
+ }>;
30
+
31
+ type StackPresentation =
32
+ | 'push'
33
+ | 'modal'
34
+ | 'transparentModal'
35
+ | 'fullScreenModal'
36
+ | 'formSheet'
37
+ | 'containedModal'
38
+ | 'containedTransparentModal';
39
+
40
+ type StackAnimation =
41
+ | 'default'
42
+ | 'flip'
43
+ | 'simple_push'
44
+ | 'none'
45
+ | 'fade'
46
+ | 'slide_from_right'
47
+ | 'slide_from_left'
48
+ | 'slide_from_bottom'
49
+ | 'fade_from_bottom';
50
+
51
+ type SwipeDirection = 'vertical' | 'horizontal';
52
+
53
+ type ReplaceAnimation = 'pop' | 'push';
54
+
55
+ type SheetDetentTypes = 'large' | 'medium' | 'all';
56
+
57
+ export interface NativeProps extends ViewProps {
58
+ onAppear?: BubblingEventHandler<ScreenEvent>;
59
+ onDisappear?: BubblingEventHandler<ScreenEvent>;
60
+ onDismissed?: BubblingEventHandler<ScreenDismissedEvent>;
61
+ onNativeDismissCancelled?: BubblingEventHandler<ScreenDismissedEvent>;
62
+ onWillAppear?: BubblingEventHandler<ScreenEvent>;
63
+ onWillDisappear?: BubblingEventHandler<ScreenEvent>;
64
+ onTransitionProgress?: BubblingEventHandler<TransitionProgressEvent>;
65
+ sheetAllowedDetents?: WithDefault<SheetDetentTypes, 'large'>;
66
+ sheetLargestUndimmedDetent?: WithDefault<SheetDetentTypes, 'all'>;
67
+ sheetGrabberVisible?: WithDefault<boolean, false>;
68
+ sheetCornerRadius?: WithDefault<Float, -1.0>;
69
+ sheetExpandsWhenScrolledToEdge?: WithDefault<boolean, false>;
70
+ customAnimationOnSwipe?: boolean;
71
+ fullScreenSwipeEnabled?: boolean;
72
+ homeIndicatorHidden?: boolean;
73
+ preventNativeDismiss?: boolean;
74
+ gestureEnabled?: WithDefault<boolean, true>;
75
+ statusBarColor?: ColorValue;
76
+ statusBarHidden?: boolean;
77
+ screenOrientation?: string;
78
+ statusBarAnimation?: string;
79
+ statusBarStyle?: string;
80
+ statusBarTranslucent?: boolean;
81
+ gestureResponseDistance?: GestureResponseDistanceType;
82
+ stackPresentation?: WithDefault<StackPresentation, 'push'>;
83
+ stackAnimation?: WithDefault<StackAnimation, 'default'>;
84
+ transitionDuration?: WithDefault<Int32, 350>;
85
+ replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
86
+ swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
87
+ hideKeyboardOnSwipe?: boolean;
88
+ activityState?: WithDefault<Float, -1.0>;
89
+ navigationBarColor?: ColorValue;
90
+ navigationBarHidden?: boolean;
91
+ nativeBackButtonDismissalEnabled?: boolean;
92
+ onHeaderBackButtonClicked?: BubblingEventHandler<ScreenEvent>;
93
+ }
94
+
95
+ export default codegenNativeComponent<NativeProps>('RNSScreen', {
96
+ interfaceOnly: true,
97
+ });
@@ -0,0 +1,9 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ interface NativeProps extends ViewProps {}
5
+
6
+ export default codegenNativeComponent<NativeProps>(
7
+ 'RNSScreenNavigationContainer',
8
+ {}
9
+ );
@@ -0,0 +1,43 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps, ColorValue } from 'react-native';
3
+ import type {
4
+ Int32,
5
+ WithDefault,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
7
+
8
+ type DirectionType = 'rtl' | 'ltr';
9
+
10
+ export interface NativeProps extends ViewProps {
11
+ backgroundColor?: ColorValue;
12
+ backTitle?: string;
13
+ backTitleFontFamily?: string;
14
+ backTitleFontSize?: Int32;
15
+ backTitleVisible?: WithDefault<boolean, 'true'>;
16
+ color?: ColorValue;
17
+ direction?: WithDefault<DirectionType, 'ltr'>;
18
+ hidden?: boolean;
19
+ hideShadow?: boolean;
20
+ largeTitle?: boolean;
21
+ largeTitleFontFamily?: string;
22
+ largeTitleFontSize?: Int32;
23
+ largeTitleFontWeight?: string;
24
+ largeTitleBackgroundColor?: ColorValue;
25
+ largeTitleHideShadow?: boolean;
26
+ largeTitleColor?: ColorValue;
27
+ translucent?: boolean;
28
+ title?: string;
29
+ titleFontFamily?: string;
30
+ titleFontSize?: Int32;
31
+ titleFontWeight?: string;
32
+ titleColor?: ColorValue;
33
+ disableBackButtonMenu?: boolean;
34
+ hideBackButton?: boolean;
35
+ backButtonInCustomView?: boolean;
36
+ // TODO: implement this props on iOS
37
+ topInsetEnabled?: boolean;
38
+ }
39
+
40
+ export default codegenNativeComponent<NativeProps>(
41
+ 'RNSScreenStackHeaderConfig',
42
+ {}
43
+ );
@@ -0,0 +1,20 @@
1
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
+ import type { ViewProps } from 'react-native';
3
+ import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
4
+
5
+ export type HeaderSubviewTypes =
6
+ | 'back'
7
+ | 'right'
8
+ | 'left'
9
+ | 'title'
10
+ | 'center'
11
+ | 'searchBar';
12
+
13
+ export interface NativeProps extends ViewProps {
14
+ type?: WithDefault<HeaderSubviewTypes, 'left'>;
15
+ }
16
+
17
+ export default codegenNativeComponent<NativeProps>(
18
+ 'RNSScreenStackHeaderSubview',
19
+ {}
20
+ );