react-native-screens 3.19.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.
- package/README.md +2 -1
- package/RNScreens.podspec +1 -1
- package/android/build.gradle +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +4 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +7 -9
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +12 -4
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +32 -8
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +36 -15
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +26 -0
- package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -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/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +1 -2
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
- package/ios/RNSConvert.h +2 -2
- package/ios/RNSConvert.mm +2 -2
- package/ios/RNSFullWindowOverlay.h +5 -5
- package/ios/RNSFullWindowOverlay.mm +13 -13
- package/ios/RNSScreen.h +7 -6
- package/ios/RNSScreen.mm +35 -33
- package/ios/RNSScreenContainer.h +2 -2
- package/ios/RNSScreenContainer.mm +5 -5
- package/ios/RNSScreenNavigationContainer.mm +3 -3
- package/ios/RNSScreenStack.h +4 -4
- package/ios/RNSScreenStack.mm +62 -23
- package/ios/RNSScreenStackHeaderConfig.h +10 -3
- package/ios/RNSScreenStackHeaderConfig.mm +138 -81
- package/ios/RNSScreenStackHeaderSubview.h +5 -6
- package/ios/RNSScreenStackHeaderSubview.mm +20 -11
- package/ios/RNSScreenWindowTraits.mm +21 -2
- package/ios/RNSSearchBar.h +5 -4
- package/ios/RNSSearchBar.mm +87 -12
- package/ios/RNScreens.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcuserdata/wojciechlewicki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNScreens.xcodeproj/xcuserdata/wojciechlewicki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +7 -7
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +53 -11
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -16
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +3 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +14 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +4 -6
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +54 -11
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +18 -16
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +1 -0
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +3 -1
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +15 -1
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +62 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +34 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +46 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +2 -2
- package/lib/typescript/native-stack/types.d.ts +55 -1
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +81 -2
- package/lib/typescript/useTransitionProgress.d.ts +3 -3
- package/native-stack/README.md +59 -1
- package/package.json +11 -14
- package/src/fabric/FullWindowOverlayNativeComponent.ts +6 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +6 -0
- package/src/fabric/ScreenNativeComponent.ts +97 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +9 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +43 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +20 -0
- package/src/fabric/ScreenStackNativeComponent.ts +12 -0
- package/src/fabric/SearchBarNativeComponent.ts +73 -0
- package/src/index.native.tsx +107 -14
- package/src/index.tsx +4 -3
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +23 -19
- package/src/native-stack/types.tsx +55 -0
- package/src/native-stack/views/FontProcessor.tsx +1 -0
- package/src/native-stack/views/HeaderConfig.tsx +3 -1
- package/src/native-stack/views/NativeStackView.tsx +14 -2
- package/src/types.tsx +84 -2
- package/android/src/main/java/com/swmansion/rnscreens/LifecycleHelper.kt +0 -60
- package/createNativeStackNavigator/README.md +0 -522
- package/createNativeStackNavigator/package.json +0 -6
- package/lib/commonjs/createNativeStackNavigator.js +0 -374
- package/lib/commonjs/createNativeStackNavigator.js.map +0 -1
- package/lib/module/createNativeStackNavigator.js +0 -366
- package/lib/module/createNativeStackNavigator.js.map +0 -1
- package/lib/typescript/createNativeStackNavigator.d.ts +0 -51
- package/src/createNativeStackNavigator.tsx +0 -594
- package/src/fabric/FullWindowOverlayNativeComponent.js +0 -19
- package/src/fabric/ScreenContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenNativeComponent.js +0 -104
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -54
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -31
- package/src/fabric/ScreenStackNativeComponent.js +0 -23
- package/src/fabric/SearchBarNativeComponent.js +0 -62
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_20.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_250.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_350.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_medium.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_right.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_right.xml +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react-native/types/modules/codegen" />
|
|
2
|
+
import type { ViewProps, ColorValue } from 'react-native';
|
|
3
|
+
import type { Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
declare type DirectionType = 'rtl' | 'ltr';
|
|
5
|
+
export interface NativeProps extends ViewProps {
|
|
6
|
+
backgroundColor?: ColorValue;
|
|
7
|
+
backTitle?: string;
|
|
8
|
+
backTitleFontFamily?: string;
|
|
9
|
+
backTitleFontSize?: Int32;
|
|
10
|
+
backTitleVisible?: WithDefault<boolean, 'true'>;
|
|
11
|
+
color?: ColorValue;
|
|
12
|
+
direction?: WithDefault<DirectionType, 'ltr'>;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
hideShadow?: boolean;
|
|
15
|
+
largeTitle?: boolean;
|
|
16
|
+
largeTitleFontFamily?: string;
|
|
17
|
+
largeTitleFontSize?: Int32;
|
|
18
|
+
largeTitleFontWeight?: string;
|
|
19
|
+
largeTitleBackgroundColor?: ColorValue;
|
|
20
|
+
largeTitleHideShadow?: boolean;
|
|
21
|
+
largeTitleColor?: ColorValue;
|
|
22
|
+
translucent?: boolean;
|
|
23
|
+
title?: string;
|
|
24
|
+
titleFontFamily?: string;
|
|
25
|
+
titleFontSize?: Int32;
|
|
26
|
+
titleFontWeight?: string;
|
|
27
|
+
titleColor?: ColorValue;
|
|
28
|
+
disableBackButtonMenu?: boolean;
|
|
29
|
+
hideBackButton?: boolean;
|
|
30
|
+
backButtonInCustomView?: boolean;
|
|
31
|
+
topInsetEnabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react-native/types/modules/codegen" />
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export declare type HeaderSubviewTypes = 'back' | 'right' | 'left' | 'title' | 'center' | 'searchBar';
|
|
5
|
+
export interface NativeProps extends ViewProps {
|
|
6
|
+
type?: WithDefault<HeaderSubviewTypes, 'left'>;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react-native/types/modules/codegen" />
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
declare type FinishTransitioningEvent = Readonly<{}>;
|
|
5
|
+
interface NativeProps extends ViewProps {
|
|
6
|
+
onFinishTransitioning?: DirectEventHandler<FinishTransitioningEvent>;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-native/types/modules/codegen" />
|
|
3
|
+
import type { ViewProps, ColorValue, HostComponent } from 'react-native';
|
|
4
|
+
import type { WithDefault, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
declare type SearchBarEvent = Readonly<{}>;
|
|
6
|
+
declare type SearchButtonPressedEvent = Readonly<{
|
|
7
|
+
text?: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare type ChangeTextEvent = Readonly<{
|
|
10
|
+
text?: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare type AutoCapitalizeType = 'none' | 'words' | 'sentences' | 'characters';
|
|
13
|
+
interface NativeProps extends ViewProps {
|
|
14
|
+
onFocus?: BubblingEventHandler<SearchBarEvent> | null;
|
|
15
|
+
onBlur?: BubblingEventHandler<SearchBarEvent> | null;
|
|
16
|
+
onSearchButtonPress?: BubblingEventHandler<SearchButtonPressedEvent> | null;
|
|
17
|
+
onCancelButtonPress?: BubblingEventHandler<SearchBarEvent> | null;
|
|
18
|
+
onChangeText?: BubblingEventHandler<ChangeTextEvent> | null;
|
|
19
|
+
hideWhenScrolling?: boolean;
|
|
20
|
+
autoCapitalize?: WithDefault<AutoCapitalizeType, 'none'>;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
obscureBackground?: boolean;
|
|
23
|
+
hideNavigationBar?: boolean;
|
|
24
|
+
cancelButtonText?: string;
|
|
25
|
+
barTintColor?: ColorValue;
|
|
26
|
+
tintColor?: ColorValue;
|
|
27
|
+
textColor?: ColorValue;
|
|
28
|
+
disableBackButtonOverride?: boolean;
|
|
29
|
+
inputType?: string;
|
|
30
|
+
onClose?: BubblingEventHandler<SearchBarEvent> | null;
|
|
31
|
+
onOpen?: BubblingEventHandler<SearchBarEvent> | null;
|
|
32
|
+
hintTextColor?: ColorValue;
|
|
33
|
+
headerIconColor?: ColorValue;
|
|
34
|
+
shouldShowHintSearchIcon?: WithDefault<boolean, true>;
|
|
35
|
+
}
|
|
36
|
+
declare type ComponentType = HostComponent<NativeProps>;
|
|
37
|
+
interface NativeCommands {
|
|
38
|
+
blur: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
39
|
+
focus: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
40
|
+
clearText: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
41
|
+
toggleCancelButton: (viewRef: React.ElementRef<ComponentType>, flag: boolean) => void;
|
|
42
|
+
setText: (viewRef: React.ElementRef<ComponentType>, text: string) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const Commands: NativeCommands;
|
|
45
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
46
|
+
export default _default;
|
|
@@ -24,8 +24,8 @@ export declare const ScreenStackHeaderBackButtonImage: (props: ImageProps) => JS
|
|
|
24
24
|
export declare const ScreenStackHeaderRightView: (props: React.PropsWithChildren<ViewProps>) => JSX.Element;
|
|
25
25
|
export declare const ScreenStackHeaderLeftView: (props: React.PropsWithChildren<ViewProps>) => JSX.Element;
|
|
26
26
|
export declare const ScreenStackHeaderCenterView: (props: React.PropsWithChildren<ViewProps>) => JSX.Element;
|
|
27
|
-
export declare const ScreenStackHeaderSearchBarView: (props: React.PropsWithChildren<SearchBarProps
|
|
28
|
-
export declare const ScreenStackHeaderConfig: React.
|
|
27
|
+
export declare const ScreenStackHeaderSearchBarView: (props: React.PropsWithChildren<Omit<SearchBarProps, 'ref'>>) => JSX.Element;
|
|
28
|
+
export declare const ScreenStackHeaderConfig: (props: React.PropsWithChildren<ScreenStackHeaderConfigProps>) => JSX.Element;
|
|
29
29
|
export declare const SearchBar: React.ComponentType<SearchBarProps>;
|
|
30
30
|
export declare const ScreenStackHeaderSubview: React.ComponentType<React.PropsWithChildren<ViewProps & {
|
|
31
31
|
type?: HeaderSubviewTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { StackNavigationState } from '@react-navigation/native';
|
|
2
|
+
import { StackNavigationState, ParamListBase } from '@react-navigation/native';
|
|
3
3
|
import { NativeStackNavigationEventMap, NativeStackNavigationOptions, NativeStackNavigatorProps } from '../types';
|
|
4
4
|
declare function NativeStackNavigator({ initialRouteName, children, screenOptions, ...rest }: NativeStackNavigatorProps): JSX.Element;
|
|
5
|
-
declare const _default: <ParamList extends Record<string, object | undefined>>() => import("@react-navigation/native").TypedNavigator<ParamList, StackNavigationState<
|
|
5
|
+
declare const _default: <ParamList extends Record<string, object | undefined>>() => import("@react-navigation/native").TypedNavigator<ParamList, StackNavigationState<ParamListBase>, NativeStackNavigationOptions, NativeStackNavigationEventMap, typeof NativeStackNavigator>;
|
|
6
6
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
4
|
+
import { ScreenProps, ScreenStackHeaderConfigProps, SearchBarProps, SheetDetentTypes } from 'react-native-screens';
|
|
5
5
|
export declare type NativeStackNavigationEventMap = {
|
|
6
6
|
/**
|
|
7
7
|
* Event which fires when the screen appears.
|
|
@@ -290,6 +290,60 @@ export declare 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:
|
|
@@ -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<
|
|
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<
|
|
4
|
+
declare const ReanimatedScreen: React.ForwardRefExoticComponent<Omit<ScreenProps, "ref"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
|
|
5
5
|
export default ReanimatedScreen;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Animated, NativeSyntheticEvent, ViewProps, View, TargetedEvent, TextInputFocusEventData } from 'react-native';
|
|
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
|
+
};
|
|
3
10
|
export declare type StackPresentationTypes = 'push' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal' | 'fullScreenModal' | 'formSheet';
|
|
4
11
|
export declare type StackAnimationTypes = 'default' | 'fade' | 'fade_from_bottom' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
|
|
5
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';
|
|
@@ -18,9 +25,10 @@ export declare type GestureResponseDistanceType = {
|
|
|
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
|
};
|
package/native-stack/README.md
CHANGED
|
@@ -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.
|
|
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": "^
|
|
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": "^
|
|
78
|
-
"@typescript-eslint/parser": "^
|
|
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": "
|
|
100
|
+
"react": "18.2.0",
|
|
103
101
|
"react-dom": "^16.13.1",
|
|
104
|
-
"react-native": "
|
|
102
|
+
"react-native": "0.71.0",
|
|
105
103
|
"react-native-reanimated": "^2.2.0",
|
|
106
|
-
"react-native-safe-area-context": "^4.
|
|
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": "^
|
|
112
|
-
"typescript": "
|
|
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
|
+
);
|