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

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 (117) hide show
  1. package/android/CMakeLists.txt +28 -19
  2. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +53 -71
  3. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetBehaviorExt.kt +42 -0
  4. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetUtils.kt +8 -0
  5. package/android/src/main/jni/CMakeLists.txt +28 -19
  6. package/ios/RNSConvert.h +13 -4
  7. package/ios/RNSConvert.mm +50 -28
  8. package/ios/RNSEnums.h +46 -0
  9. package/ios/RNSScreenStackHeaderConfig.h +1 -1
  10. package/ios/RNSScreenStackHeaderConfig.mm +30 -25
  11. package/lib/commonjs/components/ScreenStack.js +2 -2
  12. package/lib/commonjs/components/ScreenStack.js.map +1 -1
  13. package/lib/commonjs/components/SearchBar.js +2 -2
  14. package/lib/commonjs/components/SearchBar.js.map +1 -1
  15. package/lib/commonjs/core.js +0 -3
  16. package/lib/commonjs/core.js.map +1 -1
  17. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  18. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +2 -2
  19. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -1
  20. package/lib/commonjs/index.js +7 -14
  21. package/lib/commonjs/index.js.map +1 -1
  22. package/lib/commonjs/native-stack/views/FooterComponent.js +2 -2
  23. package/lib/commonjs/native-stack/views/FooterComponent.js.map +1 -1
  24. package/lib/commonjs/native-stack/views/HeaderConfig.js +10 -8
  25. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
  26. package/lib/commonjs/native-stack/views/NativeStackView.js +12 -9
  27. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
  28. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +2 -2
  29. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  30. package/lib/commonjs/reanimated/ReanimatedScreen.js +2 -2
  31. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
  32. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +2 -2
  33. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
  34. package/lib/commonjs/utils.js +28 -6
  35. package/lib/commonjs/utils.js.map +1 -1
  36. package/lib/module/components/ScreenStack.js +1 -1
  37. package/lib/module/components/ScreenStack.js.map +1 -1
  38. package/lib/module/components/SearchBar.js +1 -1
  39. package/lib/module/components/SearchBar.js.map +1 -1
  40. package/lib/module/core.js +0 -3
  41. package/lib/module/core.js.map +1 -1
  42. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  43. package/lib/module/gesture-handler/GestureDetectorProvider.js +1 -1
  44. package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -1
  45. package/lib/module/index.js +2 -2
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/native-stack/views/FooterComponent.js +1 -1
  48. package/lib/module/native-stack/views/FooterComponent.js.map +1 -1
  49. package/lib/module/native-stack/views/HeaderConfig.js +3 -1
  50. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
  51. package/lib/module/native-stack/views/NativeStackView.js +4 -1
  52. package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
  53. package/lib/module/reanimated/ReanimatedNativeStackScreen.js +1 -2
  54. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  55. package/lib/module/reanimated/ReanimatedScreen.js +1 -2
  56. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
  57. package/lib/module/reanimated/ReanimatedScreenProvider.js +1 -1
  58. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
  59. package/lib/module/utils.js +26 -5
  60. package/lib/module/utils.js.map +1 -1
  61. package/lib/typescript/components/Screen.d.ts +1 -1
  62. package/lib/typescript/components/Screen.d.ts.map +1 -1
  63. package/lib/typescript/components/Screen.web.d.ts +1 -1
  64. package/lib/typescript/components/Screen.web.d.ts.map +1 -1
  65. package/lib/typescript/components/ScreenContainer.d.ts +1 -1
  66. package/lib/typescript/components/ScreenContainer.d.ts.map +1 -1
  67. package/lib/typescript/components/ScreenStack.d.ts +1 -1
  68. package/lib/typescript/components/ScreenStack.d.ts.map +1 -1
  69. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +1 -1
  70. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -1
  71. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +1 -1
  72. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -1
  73. package/lib/typescript/components/SearchBar.d.ts +1 -1
  74. package/lib/typescript/components/SearchBar.d.ts.map +1 -1
  75. package/lib/typescript/core.d.ts +0 -1
  76. package/lib/typescript/core.d.ts.map +1 -1
  77. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +2 -2
  78. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -1
  79. package/lib/typescript/index.d.ts +2 -2
  80. package/lib/typescript/index.d.ts.map +1 -1
  81. package/lib/typescript/native-stack/types.d.ts +1 -1
  82. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  83. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -1
  84. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -1
  85. package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -1
  86. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  87. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
  88. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -1
  89. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
  90. package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -1
  91. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -1
  92. package/lib/typescript/types.d.ts +1 -1
  93. package/lib/typescript/types.d.ts.map +1 -1
  94. package/lib/typescript/utils.d.ts +26 -1
  95. package/lib/typescript/utils.d.ts.map +1 -1
  96. package/package.json +1 -1
  97. package/src/components/Screen.tsx +1 -1
  98. package/src/components/Screen.web.tsx +1 -1
  99. package/src/components/ScreenContainer.tsx +1 -1
  100. package/src/components/ScreenStack.tsx +2 -1
  101. package/src/components/ScreenStackHeaderConfig.tsx +1 -1
  102. package/src/components/ScreenStackHeaderConfig.web.tsx +1 -1
  103. package/src/components/SearchBar.tsx +2 -5
  104. package/src/core.ts +0 -3
  105. package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +2 -1
  106. package/src/gesture-handler/GestureDetectorProvider.tsx +1 -1
  107. package/src/index.tsx +1 -2
  108. package/src/native-stack/types.tsx +1 -1
  109. package/src/native-stack/utils/getDefaultHeaderHeight.tsx +1 -1
  110. package/src/native-stack/views/FooterComponent.tsx +1 -1
  111. package/src/native-stack/views/HeaderConfig.tsx +7 -5
  112. package/src/native-stack/views/NativeStackView.tsx +5 -8
  113. package/src/reanimated/ReanimatedNativeStackScreen.tsx +2 -2
  114. package/src/reanimated/ReanimatedScreen.tsx +2 -1
  115. package/src/reanimated/ReanimatedScreenProvider.tsx +2 -1
  116. package/src/types.tsx +1 -0
  117. package/src/utils.ts +27 -5
@@ -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
+ };