react-native-screens 4.0.0-beta.12 → 4.0.0-beta.14

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 (197) hide show
  1. package/README.md +3 -1
  2. package/android/CMakeLists.txt +28 -19
  3. package/android/src/main/java/com/swmansion/rnscreens/NativeDismissalObserver.kt +12 -0
  4. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +59 -84
  5. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetBehaviorExt.kt +42 -0
  6. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/DimmingFragment.kt +24 -19
  7. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetUtils.kt +8 -0
  8. package/android/src/main/jni/CMakeLists.txt +28 -19
  9. package/ios/RNSConvert.h +13 -4
  10. package/ios/RNSConvert.mm +50 -28
  11. package/ios/RNSEnums.h +46 -0
  12. package/ios/RNSScreenStackHeaderConfig.h +1 -1
  13. package/ios/RNSScreenStackHeaderConfig.mm +30 -25
  14. package/lib/commonjs/components/FullWindowOverlay.js +8 -5
  15. package/lib/commonjs/components/FullWindowOverlay.js.map +1 -1
  16. package/lib/commonjs/components/Screen.js +28 -10
  17. package/lib/commonjs/components/Screen.js.map +1 -1
  18. package/lib/commonjs/components/ScreenContainer.js +3 -5
  19. package/lib/commonjs/components/ScreenContainer.js.map +1 -1
  20. package/lib/commonjs/components/ScreenContainer.web.js +3 -4
  21. package/lib/commonjs/components/ScreenContainer.web.js.map +1 -1
  22. package/lib/commonjs/components/ScreenContentWrapper.js +2 -4
  23. package/lib/commonjs/components/ScreenContentWrapper.js.map +1 -1
  24. package/lib/commonjs/components/ScreenContentWrapper.web.js +1 -2
  25. package/lib/commonjs/components/ScreenContentWrapper.web.js.map +1 -1
  26. package/lib/commonjs/components/ScreenFooter.js +2 -8
  27. package/lib/commonjs/components/ScreenFooter.js.map +1 -1
  28. package/lib/commonjs/components/ScreenFooter.web.js +1 -2
  29. package/lib/commonjs/components/ScreenFooter.web.js.map +1 -1
  30. package/lib/commonjs/components/ScreenStack.js +2 -2
  31. package/lib/commonjs/components/ScreenStack.js.map +1 -1
  32. package/lib/commonjs/components/ScreenStack.web.js +2 -1
  33. package/lib/commonjs/components/ScreenStack.web.js.map +1 -1
  34. package/lib/commonjs/components/SearchBar.js +5 -5
  35. package/lib/commonjs/components/SearchBar.js.map +1 -1
  36. package/lib/commonjs/components/SearchBar.web.js +3 -4
  37. package/lib/commonjs/components/SearchBar.web.js.map +1 -1
  38. package/lib/commonjs/core.js +0 -3
  39. package/lib/commonjs/core.js.map +1 -1
  40. package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -1
  41. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  42. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +2 -2
  43. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -1
  44. package/lib/commonjs/index.js +14 -78
  45. package/lib/commonjs/index.js.map +1 -1
  46. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +4 -0
  47. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  48. package/lib/commonjs/native-stack/views/FooterComponent.js +2 -2
  49. package/lib/commonjs/native-stack/views/FooterComponent.js.map +1 -1
  50. package/lib/commonjs/native-stack/views/HeaderConfig.js +10 -8
  51. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
  52. package/lib/commonjs/native-stack/views/NativeStackView.js +12 -9
  53. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
  54. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +2 -2
  55. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  56. package/lib/commonjs/reanimated/ReanimatedScreen.js +2 -2
  57. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
  58. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +2 -2
  59. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
  60. package/lib/commonjs/utils.js +28 -6
  61. package/lib/commonjs/utils.js.map +1 -1
  62. package/lib/module/components/FullWindowOverlay.js +9 -6
  63. package/lib/module/components/FullWindowOverlay.js.map +1 -1
  64. package/lib/module/components/Screen.js +27 -9
  65. package/lib/module/components/Screen.js.map +1 -1
  66. package/lib/module/components/ScreenContainer.js +2 -4
  67. package/lib/module/components/ScreenContainer.js.map +1 -1
  68. package/lib/module/components/ScreenContainer.web.js +2 -3
  69. package/lib/module/components/ScreenContainer.web.js.map +1 -1
  70. package/lib/module/components/ScreenContentWrapper.js +1 -3
  71. package/lib/module/components/ScreenContentWrapper.js.map +1 -1
  72. package/lib/module/components/ScreenContentWrapper.web.js +0 -1
  73. package/lib/module/components/ScreenContentWrapper.web.js.map +1 -1
  74. package/lib/module/components/ScreenFooter.js +1 -7
  75. package/lib/module/components/ScreenFooter.js.map +1 -1
  76. package/lib/module/components/ScreenFooter.web.js +0 -1
  77. package/lib/module/components/ScreenFooter.web.js.map +1 -1
  78. package/lib/module/components/ScreenStack.js +1 -1
  79. package/lib/module/components/ScreenStack.js.map +1 -1
  80. package/lib/module/components/ScreenStack.web.js +2 -1
  81. package/lib/module/components/ScreenStack.web.js.map +1 -1
  82. package/lib/module/components/SearchBar.js +3 -3
  83. package/lib/module/components/SearchBar.js.map +1 -1
  84. package/lib/module/components/SearchBar.web.js +2 -3
  85. package/lib/module/components/SearchBar.web.js.map +1 -1
  86. package/lib/module/core.js +0 -3
  87. package/lib/module/core.js.map +1 -1
  88. package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -1
  89. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  90. package/lib/module/gesture-handler/GestureDetectorProvider.js +1 -1
  91. package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -1
  92. package/lib/module/index.js +8 -13
  93. package/lib/module/index.js.map +1 -1
  94. package/lib/module/native-stack/navigators/createNativeStackNavigator.js +4 -0
  95. package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  96. package/lib/module/native-stack/views/FooterComponent.js +1 -1
  97. package/lib/module/native-stack/views/FooterComponent.js.map +1 -1
  98. package/lib/module/native-stack/views/HeaderConfig.js +3 -1
  99. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
  100. package/lib/module/native-stack/views/NativeStackView.js +4 -1
  101. package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
  102. package/lib/module/reanimated/ReanimatedNativeStackScreen.js +1 -2
  103. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  104. package/lib/module/reanimated/ReanimatedScreen.js +1 -2
  105. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
  106. package/lib/module/reanimated/ReanimatedScreenProvider.js +1 -1
  107. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
  108. package/lib/module/utils.js +26 -5
  109. package/lib/module/utils.js.map +1 -1
  110. package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -1
  111. package/lib/typescript/components/Screen.d.ts +2 -7
  112. package/lib/typescript/components/Screen.d.ts.map +1 -1
  113. package/lib/typescript/components/Screen.web.d.ts +1 -1
  114. package/lib/typescript/components/Screen.web.d.ts.map +1 -1
  115. package/lib/typescript/components/ScreenContainer.d.ts +1 -3
  116. package/lib/typescript/components/ScreenContainer.d.ts.map +1 -1
  117. package/lib/typescript/components/ScreenContainer.web.d.ts +2 -3
  118. package/lib/typescript/components/ScreenContainer.web.d.ts.map +1 -1
  119. package/lib/typescript/components/ScreenContentWrapper.d.ts +0 -1
  120. package/lib/typescript/components/ScreenContentWrapper.d.ts.map +1 -1
  121. package/lib/typescript/components/ScreenContentWrapper.web.d.ts +0 -1
  122. package/lib/typescript/components/ScreenContentWrapper.web.d.ts.map +1 -1
  123. package/lib/typescript/components/ScreenFooter.d.ts +0 -4
  124. package/lib/typescript/components/ScreenFooter.d.ts.map +1 -1
  125. package/lib/typescript/components/ScreenFooter.web.d.ts +0 -1
  126. package/lib/typescript/components/ScreenFooter.web.d.ts.map +1 -1
  127. package/lib/typescript/components/ScreenStack.d.ts +1 -1
  128. package/lib/typescript/components/ScreenStack.d.ts.map +1 -1
  129. package/lib/typescript/components/ScreenStack.web.d.ts +2 -1
  130. package/lib/typescript/components/ScreenStack.web.d.ts.map +1 -1
  131. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +1 -1
  132. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -1
  133. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +1 -1
  134. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -1
  135. package/lib/typescript/components/SearchBar.d.ts +1 -15
  136. package/lib/typescript/components/SearchBar.d.ts.map +1 -1
  137. package/lib/typescript/components/SearchBar.web.d.ts +2 -3
  138. package/lib/typescript/components/SearchBar.web.d.ts.map +1 -1
  139. package/lib/typescript/core.d.ts +0 -1
  140. package/lib/typescript/core.d.ts.map +1 -1
  141. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +7 -1
  142. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -1
  143. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +2 -2
  144. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -1
  145. package/lib/typescript/index.d.ts +8 -12
  146. package/lib/typescript/index.d.ts.map +1 -1
  147. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +3 -0
  148. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  149. package/lib/typescript/native-stack/types.d.ts +49 -1
  150. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  151. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -1
  152. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -1
  153. package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -1
  154. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  155. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
  156. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -1
  157. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
  158. package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -1
  159. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -1
  160. package/lib/typescript/types.d.ts +1 -1
  161. package/lib/typescript/types.d.ts.map +1 -1
  162. package/lib/typescript/utils.d.ts +26 -1
  163. package/lib/typescript/utils.d.ts.map +1 -1
  164. package/native-stack/README.md +2 -1
  165. package/native-stack/package.json +4 -4
  166. package/package.json +1 -1
  167. package/src/components/FullWindowOverlay.tsx +10 -2
  168. package/src/components/Screen.tsx +42 -25
  169. package/src/components/Screen.web.tsx +1 -1
  170. package/src/components/ScreenContainer.tsx +4 -11
  171. package/src/components/ScreenContainer.web.tsx +2 -3
  172. package/src/components/ScreenContentWrapper.tsx +2 -5
  173. package/src/components/ScreenContentWrapper.web.tsx +1 -2
  174. package/src/components/ScreenFooter.tsx +2 -8
  175. package/src/components/ScreenFooter.web.tsx +1 -2
  176. package/src/components/ScreenStack.tsx +2 -1
  177. package/src/components/ScreenStack.web.tsx +3 -1
  178. package/src/components/ScreenStackHeaderConfig.tsx +1 -1
  179. package/src/components/ScreenStackHeaderConfig.web.tsx +1 -1
  180. package/src/components/SearchBar.tsx +4 -7
  181. package/src/components/SearchBar.web.tsx +2 -3
  182. package/src/core.ts +0 -3
  183. package/src/fabric/ModalScreenNativeComponent.ts +9 -1
  184. package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +2 -1
  185. package/src/gesture-handler/GestureDetectorProvider.tsx +1 -1
  186. package/src/index.tsx +6 -32
  187. package/src/native-stack/navigators/createNativeStackNavigator.tsx +3 -0
  188. package/src/native-stack/types.tsx +50 -6
  189. package/src/native-stack/utils/getDefaultHeaderHeight.tsx +1 -1
  190. package/src/native-stack/views/FooterComponent.tsx +1 -1
  191. package/src/native-stack/views/HeaderConfig.tsx +7 -5
  192. package/src/native-stack/views/NativeStackView.tsx +5 -8
  193. package/src/reanimated/ReanimatedNativeStackScreen.tsx +2 -2
  194. package/src/reanimated/ReanimatedScreen.tsx +2 -1
  195. package/src/reanimated/ReanimatedScreenProvider.tsx +2 -1
  196. package/src/types.tsx +1 -0
  197. package/src/utils.ts +27 -5
@@ -22,8 +22,11 @@ import {
22
22
  ScreenProps,
23
23
  ScreenStackHeaderConfigProps,
24
24
  SearchBarProps,
25
- } from 'react-native-screens';
25
+ } from '../types';
26
26
 
27
+ /**
28
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
29
+ */
27
30
  export type NativeStackNavigationEventMap = {
28
31
  /**
29
32
  * Event which fires when the screen appears.
@@ -62,6 +65,9 @@ export type NativeStackNavigationEventMap = {
62
65
  sheetDetentChange: { data: { index: number; isStable: boolean } };
63
66
  };
64
67
 
68
+ /**
69
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
70
+ */
65
71
  export type NativeStackNavigationProp<
66
72
  ParamList extends ParamListBase,
67
73
  RouteName extends keyof ParamList = string,
@@ -74,6 +80,9 @@ export type NativeStackNavigationProp<
74
80
  > &
75
81
  StackActionHelpers<ParamList>;
76
82
 
83
+ /**
84
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
85
+ */
77
86
  export type NativeStackScreenProps<
78
87
  ParamList extends ParamListBase,
79
88
  RouteName extends keyof ParamList = string,
@@ -82,15 +91,23 @@ export type NativeStackScreenProps<
82
91
  route: RouteProp<ParamList, RouteName>;
83
92
  };
84
93
 
94
+ /**
95
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
96
+ */
85
97
  export type NativeStackNavigationHelpers = NavigationHelpers<
86
98
  ParamListBase,
87
99
  NativeStackNavigationEventMap
88
100
  >;
89
101
 
90
- // We want it to be an empty object beacuse navigator does not have any additional config
91
- // eslint-disable-next-line @typescript-eslint/ban-types
92
- export type NativeStackNavigationConfig = {};
102
+ /**
103
+ * We want it to be an empty object beacuse navigator does not have any additional config
104
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
105
+ */
106
+ export type NativeStackNavigationConfig = {}; // eslint-disable-line @typescript-eslint/ban-types
93
107
 
108
+ /**
109
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
110
+ */
94
111
  export type NativeStackNavigationOptions = {
95
112
  /**
96
113
  * Image to display in the header as the back button.
@@ -527,11 +544,17 @@ export type NativeStackNavigationOptions = {
527
544
  unstable_sheetFooter?: () => React.ReactNode;
528
545
  };
529
546
 
547
+ /**
548
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
549
+ */
530
550
  export type NativeStackNavigatorProps =
531
551
  DefaultNavigatorOptions<NativeStackNavigationOptions> &
532
552
  StackRouterOptions &
533
553
  NativeStackNavigationConfig;
534
554
 
555
+ /**
556
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
557
+ */
535
558
  export type NativeStackDescriptor = Descriptor<
536
559
  ParamListBase,
537
560
  string,
@@ -539,11 +562,17 @@ export type NativeStackDescriptor = Descriptor<
539
562
  NativeStackNavigationOptions
540
563
  >;
541
564
 
565
+ /**
566
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
567
+ */
542
568
  export type NativeStackDescriptorMap = {
543
569
  [key: string]: NativeStackDescriptor;
544
570
  };
545
571
 
546
- // copy from GestureHandler to avoid strong dependency
572
+ /**
573
+ * copy from GestureHandler to avoid strong dependency
574
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
575
+ */
547
576
  export type PanGestureHandlerEventPayload = {
548
577
  x: number;
549
578
  y: number;
@@ -555,7 +584,10 @@ export type PanGestureHandlerEventPayload = {
555
584
  velocityY: number;
556
585
  };
557
586
 
558
- // copy from Reanimated to avoid strong dependency
587
+ /**
588
+ * copy from Reanimated to avoid strong dependency
589
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
590
+ */
559
591
  export type GoBackGesture =
560
592
  | 'swipeRight'
561
593
  | 'swipeLeft'
@@ -565,6 +597,9 @@ export type GoBackGesture =
565
597
  | 'horizontalSwipe'
566
598
  | 'twoDimensionalSwipe';
567
599
 
600
+ /**
601
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
602
+ */
568
603
  export interface MeasuredDimensions {
569
604
  x: number;
570
605
  y: number;
@@ -574,6 +609,9 @@ export interface MeasuredDimensions {
574
609
  pageY: number;
575
610
  }
576
611
 
612
+ /**
613
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
614
+ */
577
615
  export type AnimatedScreenTransition = {
578
616
  topScreenStyle: (
579
617
  event: PanGestureHandlerEventPayload,
@@ -585,10 +623,16 @@ export type AnimatedScreenTransition = {
585
623
  ) => Record<string, unknown>;
586
624
  };
587
625
 
626
+ /**
627
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
628
+ */
588
629
  export type ScreensRefsHolder = React.MutableRefObject<
589
630
  Record<string, React.MutableRefObject<React.Ref<NativeStackNavigatorProps>>>
590
631
  >;
591
632
 
633
+ /**
634
+ * @deprecated NativeStack has been moved from react-native-screens/native-stack to @react-navigation/native since version v6. With react-native-screens v4 native stack v5 (react-native-screens/native-stack) is deprecated and marked for removal in the upcoming minor release, react-native-screens v4 will support only @react-navigation/native-stack v7.
635
+ */
592
636
  export type GestureProviderProps = PropsWithChildren<{
593
637
  gestureDetectorBridge: React.MutableRefObject<GestureDetectorBridge>;
594
638
  screensRefs: ScreensRefsHolder;
@@ -1,5 +1,5 @@
1
1
  import { Platform } from 'react-native';
2
- import { StackPresentationTypes } from 'react-native-screens';
2
+ import { StackPresentationTypes } from '../../types';
3
3
  type Layout = { width: number; height: number };
4
4
 
5
5
  const formSheetModalHeight = 56;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ScreenFooter } from 'react-native-screens';
2
+ import ScreenFooter from '../../components/ScreenFooter';
3
3
 
4
4
  type FooterProps = {
5
5
  children?: React.ReactNode;
@@ -1,6 +1,11 @@
1
1
  import { Route, useTheme } from '@react-navigation/native';
2
2
  import * as React from 'react';
3
3
  import { Platform } from 'react-native';
4
+ import { SearchBarProps } from '../../types';
5
+ import {
6
+ isSearchBarAvailableForCurrentPlatform,
7
+ executeNativeBackPress,
8
+ } from '../../utils';
4
9
  import {
5
10
  ScreenStackHeaderBackButtonImage,
6
11
  ScreenStackHeaderCenterView,
@@ -8,11 +13,8 @@ import {
8
13
  ScreenStackHeaderLeftView,
9
14
  ScreenStackHeaderRightView,
10
15
  ScreenStackHeaderSearchBarView,
11
- SearchBar,
12
- SearchBarProps,
13
- isSearchBarAvailableForCurrentPlatform,
14
- executeNativeBackPress,
15
- } from 'react-native-screens';
16
+ } from '../../components/ScreenStackHeaderConfig';
17
+ import SearchBar from '../../components/SearchBar';
16
18
  import { NativeStackNavigationOptions } from '../types';
17
19
  import { useBackPressSubscription } from '../utils/useBackPressSubscription';
18
20
  import { processFonts } from './FontProcessor';
@@ -5,14 +5,11 @@ import { Animated, Platform, StyleSheet, ViewProps } from 'react-native';
5
5
  // eslint-disable-next-line import/no-named-as-default, import/default, import/no-named-as-default-member, import/namespace
6
6
  import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
7
7
  import warnOnce from 'warn-once';
8
- import {
9
- ScreenStack,
10
- StackPresentationTypes,
11
- ScreenContext,
12
- GHContext,
13
- GestureDetectorBridge,
14
- ScreenContentWrapper,
15
- } from 'react-native-screens';
8
+ import { StackPresentationTypes, GestureDetectorBridge } from '../../types';
9
+ import ScreenStack from '../../components/ScreenStack';
10
+ import ScreenContentWrapper from '../../components/ScreenContentWrapper';
11
+ import { GHContext } from '../contexts/GHContext';
12
+ import { ScreenContext } from '../../components/Screen';
16
13
  import {
17
14
  ParamListBase,
18
15
  StackActions,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { Platform } from 'react-native';
3
+ import { InnerScreen } from '../components/Screen';
3
4
  import {
4
5
  HeaderHeightChangeEventType,
5
- InnerScreen,
6
6
  ScreenProps,
7
7
  TransitionProgressEventType,
8
- } from 'react-native-screens';
8
+ } from '../types';
9
9
 
10
10
  // @ts-ignore file to be used only if `react-native-reanimated` available in the project
11
11
  import Animated, { useEvent, useSharedValue } from 'react-native-reanimated';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { InnerScreen, ScreenProps } from 'react-native-screens';
2
+ import { InnerScreen } from '../components/Screen';
3
+ import { ScreenProps } from '../types';
3
4
 
4
5
  // @ts-ignore file to be used only if `react-native-reanimated` available in the project
5
6
  import Animated from 'react-native-reanimated';
@@ -1,6 +1,7 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { View } from 'react-native';
3
- import { ScreenProps, ScreenContext } from 'react-native-screens';
3
+ import { ScreenContext } from '../components/Screen';
4
+ import { ScreenProps } from '../types';
4
5
  import ReanimatedNativeStackScreen from './ReanimatedNativeStackScreen';
5
6
  import AnimatedScreen from './ReanimatedScreen';
6
7
 
package/src/types.tsx CHANGED
@@ -42,6 +42,7 @@ export type StackAnimationTypes =
42
42
  | 'ios_from_right'
43
43
  | 'ios_from_left';
44
44
  export type BlurEffectTypes =
45
+ | 'none'
45
46
  | 'extraLight'
46
47
  | 'light'
47
48
  | 'dark'
package/src/utils.ts CHANGED
@@ -11,8 +11,30 @@ export function executeNativeBackPress() {
11
11
  return true;
12
12
  }
13
13
 
14
- // Because of a bug introduced in https://github.com/software-mansion/react-native-screens/pull/1646
15
- // react-native-screens v3.21 changed how header's backTitle handles whitespace strings in https://github.com/software-mansion/react-native-screens/pull/1726
16
- // To allow for backwards compatibility in @react-navigation/native-stack we need a way to check if this version or newer is used.
17
- // See https://github.com/react-navigation/react-navigation/pull/11423 for more context.
18
- export const isNewBackTitleImplementation = true;
14
+ /**
15
+ * Exposes information useful for downstream navigation library implementers,
16
+ * so they can keep reasonable backward compatibility, if desired.
17
+ *
18
+ * We don't mean for this object to only grow in number of fields, however at the same time
19
+ * we won't be very hasty to reduce it. Expect gradual changes.
20
+ */
21
+ export const compatibilityFlags = {
22
+ /**
23
+ * Because of a bug introduced in https://github.com/software-mansion/react-native-screens/pull/1646
24
+ * react-native-screens v3.21 changed how header's backTitle handles whitespace strings in https://github.com/software-mansion/react-native-screens/pull/1726
25
+ * To allow for backwards compatibility in @react-navigation/native-stack we need a way to check if this version or newer is used.
26
+ * See https://github.com/react-navigation/react-navigation/pull/11423 for more context.
27
+ */
28
+ isNewBackTitleImplementation: true,
29
+
30
+ /**
31
+ * With version 4.0.0 the header implementation has been changed. To allow for backward compat
32
+ * with native-stack@v6 we want to expose a way to check whether the new implementation
33
+ * is in use or not.
34
+ *
35
+ * See:
36
+ * * https://github.com/software-mansion/react-native-screens/pull/2325
37
+ * * https://github.com/react-navigation/react-navigation/pull/12125
38
+ */
39
+ usesHeaderFlexboxImplementation: true,
40
+ };