react-native-screens 3.31.1 → 3.32.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/README.md +6 -0
- package/RNScreens.podspec +1 -0
- package/android/build.gradle +83 -4
- package/android/src/main/cpp/jni-adapter.cpp +86 -93
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +2 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +2 -0
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +17 -3
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +14 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +3 -2
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +6 -2
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +4 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +5 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +19 -2
- package/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +1 -1
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +82 -27
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +0 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +1 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +1 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerInterface.java +16 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +3 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +1 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.java +99 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.java +37 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenComponentDescriptor.h +8 -9
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.h +8 -7
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +7 -9
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +6 -6
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +2 -1
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +8 -10
- package/cpp/RNScreensTurboModule.cpp +31 -23
- package/cpp/RNScreensTurboModule.h +17 -20
- package/ios/RNSConvert.h +6 -0
- package/ios/RNSConvert.mm +24 -0
- package/ios/RNSModule.mm +1 -2
- package/ios/RNSScreen.mm +8 -0
- package/ios/RNSScreenContainer.mm +1 -1
- package/ios/RNSScreenStack.mm +71 -13
- package/ios/RNSScreenStackHeaderConfig.h +2 -0
- package/ios/RNSScreenStackHeaderConfig.mm +44 -17
- package/ios/RNSSearchBar.h +5 -5
- package/ios/RNSSearchBar.mm +11 -11
- package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.h +15 -0
- package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.mm +14 -0
- package/ios/utils/RCTTouchHandler+RNSUtility.h +15 -0
- package/ios/utils/RCTTouchHandler+RNSUtility.mm +15 -0
- package/lib/commonjs/components/Screen.js +119 -127
- package/lib/commonjs/components/Screen.js.map +1 -1
- package/lib/commonjs/components/SearchBar.js +39 -36
- package/lib/commonjs/components/SearchBar.js.map +1 -1
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +2 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +2 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/components/Screen.js +118 -126
- package/lib/module/components/Screen.js.map +1 -1
- package/lib/module/components/SearchBar.js +39 -36
- package/lib/module/components/SearchBar.js.map +1 -1
- package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +2 -0
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +2 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/typescript/TransitionProgressContext.d.ts +1 -1
- package/lib/typescript/TransitionProgressContext.d.ts.map +1 -1
- package/lib/typescript/components/Screen.d.ts +3 -14
- package/lib/typescript/components/Screen.d.ts.map +1 -1
- package/lib/typescript/components/SearchBar.d.ts +14 -21
- package/lib/typescript/components/SearchBar.d.ts.map +1 -1
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +11 -10
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +11 -10
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +5 -3
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +9 -9
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts +1 -1
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +29 -14
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +1 -1
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts.map +1 -1
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -1
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -1
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -1
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +2 -2
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +29 -13
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/useTransitionProgress.d.ts +3 -3
- package/native-stack/README.md +7 -0
- package/package.json +11 -5
- package/src/components/Screen.tsx +27 -33
- package/src/components/SearchBar.tsx +77 -65
- package/src/fabric/ModalScreenNativeComponent.ts +1 -0
- package/src/fabric/ScreenNativeComponent.ts +1 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +3 -0
- package/src/fabric/SearchBarNativeComponent.ts +6 -6
- package/src/native-stack/types.tsx +15 -0
- package/src/native-stack/views/HeaderConfig.tsx +2 -0
- package/src/native-stack/views/NativeStackView.tsx +2 -0
- package/src/types.tsx +16 -0
|
@@ -112,6 +112,15 @@ export type NativeStackNavigationOptions = {
|
|
|
112
112
|
* @platform ios
|
|
113
113
|
*/
|
|
114
114
|
disableBackButtonMenu?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* How the back button behaves by default (when not customized). Available on iOS>=14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set.
|
|
117
|
+
* The following values are currently supported (they correspond to https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc):
|
|
118
|
+
* - "default" – show given back button previous controller title, system generic or just icon based on available space
|
|
119
|
+
* - "generic" – show given system generic or just icon based on available space
|
|
120
|
+
* - "minimal" – show just an icon
|
|
121
|
+
* @platform ios
|
|
122
|
+
*/
|
|
123
|
+
backButtonDisplayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];
|
|
115
124
|
/**
|
|
116
125
|
* Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
|
|
117
126
|
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
|
|
@@ -296,6 +305,12 @@ export type NativeStackNavigationOptions = {
|
|
|
296
305
|
* @platform android
|
|
297
306
|
*/
|
|
298
307
|
navigationBarColor?: ColorValue;
|
|
308
|
+
/**
|
|
309
|
+
* Boolean indicating whether the content should be visible behind the navigation bar. Defaults to `false`.
|
|
310
|
+
*
|
|
311
|
+
* @platform android
|
|
312
|
+
*/
|
|
313
|
+
navigationBarTranslucent?: boolean;
|
|
299
314
|
/**
|
|
300
315
|
* Sets the visibility of the navigation bar. Defaults to `false`.
|
|
301
316
|
*
|
|
@@ -27,6 +27,7 @@ export default function HeaderConfig({
|
|
|
27
27
|
backButtonInCustomView,
|
|
28
28
|
direction,
|
|
29
29
|
disableBackButtonMenu,
|
|
30
|
+
backButtonDisplayMode = 'default',
|
|
30
31
|
headerBackTitle,
|
|
31
32
|
headerBackTitleStyle = {},
|
|
32
33
|
headerBackTitleVisible = true,
|
|
@@ -120,6 +121,7 @@ export default function HeaderConfig({
|
|
|
120
121
|
color={tintColor}
|
|
121
122
|
direction={direction}
|
|
122
123
|
disableBackButtonMenu={disableBackButtonMenu}
|
|
124
|
+
backButtonDisplayMode={backButtonDisplayMode}
|
|
123
125
|
hidden={headerShown === false}
|
|
124
126
|
hideBackButton={headerHideBackButton}
|
|
125
127
|
hideShadow={headerHideShadow}
|
|
@@ -185,6 +185,7 @@ const RouteView = ({
|
|
|
185
185
|
sheetExpandsWhenScrolledToEdge = true,
|
|
186
186
|
nativeBackButtonDismissalEnabled = false,
|
|
187
187
|
navigationBarColor,
|
|
188
|
+
navigationBarTranslucent,
|
|
188
189
|
navigationBarHidden,
|
|
189
190
|
replaceAnimation = 'pop',
|
|
190
191
|
screenOrientation,
|
|
@@ -299,6 +300,7 @@ const RouteView = ({
|
|
|
299
300
|
gestureResponseDistance={gestureResponseDistance}
|
|
300
301
|
nativeBackButtonDismissalEnabled={nativeBackButtonDismissalEnabled}
|
|
301
302
|
navigationBarColor={navigationBarColor}
|
|
303
|
+
navigationBarTranslucent={navigationBarTranslucent}
|
|
302
304
|
navigationBarHidden={navigationBarHidden}
|
|
303
305
|
replaceAnimation={replaceAnimation}
|
|
304
306
|
screenOrientation={screenOrientation}
|
package/src/types.tsx
CHANGED
|
@@ -19,6 +19,7 @@ export type SearchBarCommands = {
|
|
|
19
19
|
cancelSearch: () => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
export type BackButtonDisplayMode = 'default' | 'generic' | 'minimal';
|
|
22
23
|
export type StackPresentationTypes =
|
|
23
24
|
| 'push'
|
|
24
25
|
| 'modal'
|
|
@@ -170,6 +171,12 @@ export interface ScreenProps extends ViewProps {
|
|
|
170
171
|
* @platform android
|
|
171
172
|
*/
|
|
172
173
|
navigationBarColor?: ColorValue;
|
|
174
|
+
/**
|
|
175
|
+
* Boolean indicating whether the content should be visible behind the navigation bar. Defaults to `false`.
|
|
176
|
+
*
|
|
177
|
+
* @platform android
|
|
178
|
+
*/
|
|
179
|
+
navigationBarTranslucent?: boolean;
|
|
173
180
|
/**
|
|
174
181
|
* Sets the visibility of the navigation bar. Defaults to `false`.
|
|
175
182
|
*
|
|
@@ -461,6 +468,15 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
|
|
|
461
468
|
* @platform ios
|
|
462
469
|
*/
|
|
463
470
|
disableBackButtonMenu?: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* How the back button behaves by default (when not customized). Available on iOS>=14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set.
|
|
473
|
+
* The following values are currently supported (they correspond to https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc):
|
|
474
|
+
* - "default" – show given back button previous controller title, system generic or just icon based on available space
|
|
475
|
+
* - "generic" – show given system generic or just icon based on available space
|
|
476
|
+
* - "minimal" – show just an icon
|
|
477
|
+
* @platform ios
|
|
478
|
+
*/
|
|
479
|
+
backButtonDisplayMode?: BackButtonDisplayMode;
|
|
464
480
|
/**
|
|
465
481
|
* When set to true the header will be hidden while the parent Screen is on the top of the stack. The default value is false.
|
|
466
482
|
*/
|