react-native-screens 4.0.0-beta.0 → 4.0.0-beta.2
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 +1 -1
- package/android/build.gradle +26 -6
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +4 -3
- package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +40 -1
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +18 -34
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +9 -3
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +2 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +1 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +3 -3
- package/android/src/main/res/base/anim/rns_ios_from_left_background_close.xml +5 -0
- package/android/src/main/res/base/anim/{rns_slide_out_to_left_ios.xml → rns_ios_from_left_background_open.xml} +1 -1
- package/android/src/main/res/base/anim/rns_ios_from_left_foreground_close.xml +6 -0
- package/android/src/main/res/base/anim/rns_ios_from_left_foreground_open.xml +6 -0
- package/android/src/main/res/base/anim/rns_ios_from_right_background_open.xml +5 -0
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +1 -1
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +5 -99
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +101 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +2 -0
- package/ios/RNSConvert.mm +4 -1
- package/ios/RNSFullWindowOverlay.mm +6 -0
- package/ios/RNSModalScreen.mm +7 -0
- package/ios/RNSScreen.mm +9 -0
- package/ios/RNSScreenContainer.mm +6 -0
- package/ios/RNSScreenContentWrapper.mm +6 -0
- package/ios/RNSScreenFooter.mm +6 -0
- package/ios/RNSScreenNavigationContainer.mm +7 -0
- package/ios/RNSScreenStack.mm +7 -7
- package/ios/RNSScreenStackHeaderConfig.mm +10 -0
- package/ios/RNSScreenStackHeaderSubview.mm +6 -3
- package/ios/RNSSearchBar.mm +7 -0
- package/lib/commonjs/TransitionProgressContext.js +1 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/components/Screen.js +58 -3
- package/lib/commonjs/components/Screen.js.map +1 -1
- package/lib/commonjs/components/Screen.web.js +2 -0
- package/lib/commonjs/components/Screen.web.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -0
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/ScreenContentWrapper.web.js +10 -0
- package/lib/commonjs/components/ScreenContentWrapper.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStack.js +1 -0
- package/lib/commonjs/components/ScreenStack.js.map +1 -1
- package/lib/commonjs/components/ScreenStackHeaderConfig.js +1 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -1
- package/lib/commonjs/components/SearchBar.js +1 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -1
- package/lib/commonjs/core.js +1 -0
- package/lib/commonjs/core.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/NativeScreensModule.js +2 -1
- package/lib/commonjs/fabric/NativeScreensModule.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +1 -0
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +2 -2
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/native-stack/contexts/GHContext.js +1 -0
- package/lib/commonjs/native-stack/contexts/GHContext.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +4 -4
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/TransitionProgressContext.js +2 -0
- package/lib/module/TransitionProgressContext.js.map +1 -1
- package/lib/module/components/Screen.js +59 -3
- package/lib/module/components/Screen.js.map +1 -1
- package/lib/module/components/Screen.web.js +3 -0
- package/lib/module/components/Screen.web.js.map +1 -1
- package/lib/module/components/ScreenContainer.js +2 -0
- package/lib/module/components/ScreenContainer.js.map +1 -1
- package/lib/module/components/ScreenContentWrapper.web.js +4 -0
- package/lib/module/components/ScreenContentWrapper.web.js.map +1 -0
- package/lib/module/components/ScreenStack.js +2 -0
- package/lib/module/components/ScreenStack.js.map +1 -1
- package/lib/module/components/ScreenStackHeaderConfig.js +2 -0
- package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -1
- package/lib/module/components/SearchBar.js +2 -0
- package/lib/module/components/SearchBar.js.map +1 -1
- package/lib/module/core.js +2 -0
- package/lib/module/core.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +2 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ModalScreenNativeComponent.js +2 -0
- package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/NativeScreensModule.js +2 -1
- package/lib/module/fabric/NativeScreensModule.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +2 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +6 -6
- package/lib/module/native-stack/contexts/GHContext.js +2 -0
- package/lib/module/native-stack/contexts/GHContext.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +4 -4
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/typescript/TransitionProgressContext.d.ts.map +1 -1
- package/lib/typescript/components/Screen.d.ts.map +1 -1
- package/lib/typescript/components/Screen.web.d.ts.map +1 -1
- package/lib/typescript/components/ScreenContainer.d.ts.map +1 -1
- package/lib/typescript/components/ScreenContentWrapper.web.d.ts +4 -0
- package/lib/typescript/components/ScreenContentWrapper.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStack.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -1
- package/lib/typescript/components/SearchBar.d.ts.map +1 -1
- package/lib/typescript/core.d.ts.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/NativeScreensModule.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -1
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +18 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/native-stack/contexts/GHContext.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +13 -3
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +34 -6
- package/lib/typescript/types.d.ts.map +1 -1
- package/native-stack/README.md +28 -4
- package/package.json +1 -1
- package/src/TransitionProgressContext.tsx +2 -0
- package/src/components/Screen.tsx +71 -3
- package/src/components/Screen.web.tsx +3 -0
- package/src/components/ScreenContainer.tsx +2 -0
- package/src/components/ScreenContentWrapper.web.tsx +4 -0
- package/src/components/ScreenStack.tsx +2 -0
- package/src/components/ScreenStackHeaderConfig.tsx +2 -0
- package/src/components/SearchBar.tsx +2 -0
- package/src/core.ts +2 -0
- package/src/fabric/FullWindowOverlayNativeComponent.ts +2 -0
- package/src/fabric/ModalScreenNativeComponent.ts +2 -0
- package/src/fabric/NativeScreensModule.ts +2 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +2 -0
- package/src/fabric/ScreenNativeComponent.ts +5 -1
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +2 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +2 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +2 -0
- package/src/fabric/ScreenStackNativeComponent.ts +2 -0
- package/src/fabric/SearchBarNativeComponent.ts +2 -0
- package/src/index.tsx +6 -6
- package/src/native-stack/contexts/GHContext.tsx +2 -0
- package/src/native-stack/types.tsx +13 -3
- package/src/native-stack/views/NativeStackView.tsx +8 -7
- package/src/types.tsx +42 -6
- package/windows/RNScreens/Screen.h +3 -1
- /package/android/src/main/res/base/anim/{rns_slide_in_from_left_ios.xml → rns_ios_from_right_background_close.xml} +0 -0
- /package/android/src/main/res/base/anim/{rns_slide_out_to_right_ios.xml → rns_ios_from_right_foreground_close.xml} +0 -0
- /package/android/src/main/res/base/anim/{rns_slide_in_from_right_ios.xml → rns_ios_from_right_foreground_open.xml} +0 -0
package/src/types.tsx
CHANGED
|
@@ -39,7 +39,9 @@ export type StackAnimationTypes =
|
|
|
39
39
|
| 'slide_from_bottom'
|
|
40
40
|
| 'slide_from_right'
|
|
41
41
|
| 'slide_from_left'
|
|
42
|
-
| 'ios'
|
|
42
|
+
| 'ios'
|
|
43
|
+
| 'ios_from_right'
|
|
44
|
+
| 'ios_from_left';
|
|
43
45
|
export type BlurEffectTypes =
|
|
44
46
|
| 'extraLight'
|
|
45
47
|
| 'light'
|
|
@@ -102,7 +104,6 @@ export interface ScreenProps extends ViewProps {
|
|
|
102
104
|
active?: 0 | 1 | Animated.AnimatedInterpolation<number>;
|
|
103
105
|
activityState?: 0 | 1 | 2 | Animated.AnimatedInterpolation<number>;
|
|
104
106
|
children?: React.ReactNode;
|
|
105
|
-
unstable_footer?: React.ReactNode;
|
|
106
107
|
/**
|
|
107
108
|
* Boolean indicating that swipe dismissal should trigger animation provided by `stackAnimation`. Defaults to `false`.
|
|
108
109
|
*
|
|
@@ -297,9 +298,15 @@ export interface ScreenProps extends ViewProps {
|
|
|
297
298
|
*
|
|
298
299
|
* Please note that the array **must** be sorted in ascending order.
|
|
299
300
|
*
|
|
301
|
+
* There are also legacy & **deprecated** options available:
|
|
302
|
+
*
|
|
303
|
+
* * 'medium' - corresponds to `[0.5]` detent value, around half of the screen height,
|
|
304
|
+
* * 'large' - corresponds to `[1.0]` detent value, maximum height,
|
|
305
|
+
* * 'all' - corresponds to `[0.5, 1.0]` value, the name is deceiving due to compatibility reasons.
|
|
306
|
+
*
|
|
300
307
|
* Defaults to `[1.0]` literal.
|
|
301
308
|
*/
|
|
302
|
-
sheetAllowedDetents?: number[];
|
|
309
|
+
sheetAllowedDetents?: number[] | 'fitToContents' | 'medium' | 'large' | 'all';
|
|
303
310
|
/**
|
|
304
311
|
* Integer value describing elevation of the sheet, impacting shadow on the top edge of the sheet.
|
|
305
312
|
*
|
|
@@ -344,9 +351,23 @@ export interface ScreenProps extends ViewProps {
|
|
|
344
351
|
* This prop can be set to an number, which indicates index of detent in `sheetAllowedDetents` array for which
|
|
345
352
|
* there won't be a dimming view beneath the sheet.
|
|
346
353
|
*
|
|
347
|
-
*
|
|
354
|
+
* Additionaly there are following options available:
|
|
355
|
+
*
|
|
356
|
+
* * `none` - there will be dimming view for all detents levels,
|
|
357
|
+
* * `largest` - there won't be a dimming view for any detent level.
|
|
358
|
+
*
|
|
359
|
+
* There also legacy & **deprecated** prop values available: `medium`, `large` (don't confuse with `largest`), `all`, which work in tandem with
|
|
360
|
+
* corresponding legacy prop values for `sheetAllowedDetents` prop.
|
|
361
|
+
*
|
|
362
|
+
* Defaults to `none`, indicating that the dimming view should be always present.
|
|
348
363
|
*/
|
|
349
|
-
sheetLargestUndimmedDetent?:
|
|
364
|
+
sheetLargestUndimmedDetent?:
|
|
365
|
+
| number
|
|
366
|
+
| 'none'
|
|
367
|
+
| 'largest'
|
|
368
|
+
| 'medium'
|
|
369
|
+
| 'large'
|
|
370
|
+
| 'all';
|
|
350
371
|
/**
|
|
351
372
|
* Index of the detent the sheet should expand to after being opened.
|
|
352
373
|
* Works only when `stackPresentation` is set to `formSheet`.
|
|
@@ -365,7 +386,9 @@ export interface ScreenProps extends ViewProps {
|
|
|
365
386
|
* - `slide_from_bottom` – performs a slide from bottom animation
|
|
366
387
|
* - "slide_from_right" - slide in the new screen from right to left (Android only, resolves to default transition on iOS)
|
|
367
388
|
* - "slide_from_left" - slide in the new screen from left to right
|
|
368
|
-
* - "ios" - iOS like slide in animation (Android only, resolves to default transition on iOS)
|
|
389
|
+
* - "ios" - @deprecated iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) (will be removed in v4.0.0 in favor of `ios_from_right`)
|
|
390
|
+
* - "ios_from_right" - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS)
|
|
391
|
+
* - "ios_from_left" - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS)
|
|
369
392
|
* - "none" – the screen appears/dissapears without an animation
|
|
370
393
|
*/
|
|
371
394
|
stackAnimation?: StackAnimationTypes;
|
|
@@ -422,6 +445,19 @@ export interface ScreenProps extends ViewProps {
|
|
|
422
445
|
* @platform ios
|
|
423
446
|
*/
|
|
424
447
|
transitionDuration?: number;
|
|
448
|
+
/**
|
|
449
|
+
* Footer component that can be used alongside formSheet stack presentation style.
|
|
450
|
+
*
|
|
451
|
+
* This option is provided, because due to implementation details it might be problematic
|
|
452
|
+
* to implement such layout with JS-only code.
|
|
453
|
+
*
|
|
454
|
+
* Please note that this prop is marked as unstable and might be subject of breaking changes,
|
|
455
|
+
* including removal, in particular when we find solution that will make implementing it with JS
|
|
456
|
+
* straightforward.
|
|
457
|
+
*
|
|
458
|
+
* @platform android
|
|
459
|
+
*/
|
|
460
|
+
unstable_sheetFooter?: () => React.ReactNode;
|
|
425
461
|
}
|
|
426
462
|
|
|
427
463
|
export interface ScreenContainerProps extends ViewProps {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|