react-native-screens 3.18.1 → 3.19.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 +30 -38
- package/android/build.gradle +1 -5
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +10 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +15 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +5 -0
- package/ios/RNSConvert.h +6 -0
- package/ios/RNSConvert.mm +26 -0
- package/ios/RNSEnums.h +6 -0
- package/ios/RNSFullWindowOverlay.mm +32 -0
- package/ios/RNSScreen.h +10 -2
- package/ios/RNSScreen.mm +133 -2
- package/ios/RNSScreenStackHeaderConfig.mm +17 -1
- package/lib/commonjs/TransitionProgressContext.js +2 -7
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/createNativeStackNavigator.js +29 -76
- package/lib/commonjs/createNativeStackNavigator.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 +2 -10
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +2 -10
- 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 +0 -7
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +21 -45
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +43 -103
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/index.js +6 -11
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -25
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js +4 -0
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +2 -6
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +11 -19
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +0 -7
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +7 -18
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +2 -10
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -6
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +46 -50
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +32 -58
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +11 -21
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js +3 -10
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +3 -19
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +2 -7
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js +0 -3
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +2 -10
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js +2 -10
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js +0 -4
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/TransitionProgressContext.js.map +1 -1
- package/lib/module/createNativeStackNavigator.js +29 -67
- package/lib/module/createNativeStackNavigator.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +0 -1
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +13 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +45 -93
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/index.js +3 -2
- package/lib/module/native-stack/index.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +16 -16
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +8 -7
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +0 -4
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js +7 -8
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js +0 -2
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +0 -3
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +44 -39
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +32 -42
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +12 -9
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js +5 -4
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +3 -14
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +2 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js +0 -2
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js +0 -2
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +1 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +1 -0
- package/package.json +9 -1
- package/react-native.config.js +12 -2
- package/src/createNativeStackNavigator.tsx +4 -2
- package/src/fabric/ScreenNativeComponent.js +7 -0
- package/src/index.native.tsx +32 -16
- package/src/index.tsx +13 -8
- package/src/native-stack/types.tsx +4 -5
- package/src/native-stack/views/HeaderConfig.tsx +8 -10
- package/src/native-stack/views/NativeStackView.tsx +8 -4
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +5 -3
- package/src/reanimated/ReanimatedScreen.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["NativeStackView.tsx"],"names":["React","Platform","StyleSheet","View","AppContainer","warnOnce","ScreenStack","ScreenContext","StackActions","useTheme","useSafeAreaFrame","useSafeAreaInsets","HeaderConfig","SafeAreaProviderCompat","getDefaultHeaderHeight","HeaderHeightContext","isAndroid","OS","Container","__DEV__","DebugContainer","props","stackPresentation","rest","MaybeNestedStack","options","route","children","colors","headerShown","contentStyle","Screen","useContext","isHeaderInModal","headerShownPreviousRef","useRef","useEffect","current","name","content","styles","container","backgroundColor","background","topInset","top","dimensions","headerHeight","absoluteFill","RouteView","descriptors","index","navigation","stateKey","render","renderScene","key","gestureEnabled","hideKeyboardOnSwipe","homeIndicatorHidden","nativeBackButtonDismissalEnabled","navigationBarColor","navigationBarHidden","replaceAnimation","screenOrientation","statusBarAnimation","statusBarColor","statusBarHidden","statusBarStyle","statusBarTranslucent","swipeDirection","transitionDuration","freezeOnBlur","customAnimationOnSwipe","fullScreenSwipeEnabled","gestureResponseDistance","stackAnimation","undefined","isHeaderInPush","parentHeaderHeight","dispatch","pop","source","target","emit","type","data","closing","e","dismissCount","nativeEvent","NativeStackViewInner","state","routes","map","NativeStackView","create","flex"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,QAAsD,cAAtD,C,CACA;;AACA,OAAOC,YAAP,MAAyB,iDAAzB;AACA,OAAOC,QAAP,MAAqB,WAArB;AACA,SACEC,WADF,EAGEC,aAHF,QAIO,sBAJP;AAKA,SAEEC,YAFF,EAIEC,QAJF,QAQO,0BARP;AASA,SACEC,gBADF,EAEEC,iBAFF,QAGO,gCAHP;AAUA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,OAAOC,mBAAP,MAAgC,8BAAhC;AAEA,MAAMC,SAAS,GAAGf,QAAQ,CAACgB,EAAT,KAAgB,SAAlC;AAEA,IAAIC,SAAS,GAAGf,IAAhB;;AAEA,IAAIgB,OAAJ,EAAa;AACX,QAAMC,cAAc,GAClBC,KADqB,IAElB;AACH,UAAM;AAAEC,MAAAA,iBAAF;AAAqB,SAAGC;AAAxB,QAAiCF,KAAvC;;AACA,QAAIpB,QAAQ,CAACgB,EAA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UALd;AAME,IAAA,QAAQ,EAAEI;AANZ,IADD,CADH,CADF;AAcD;;AAED,eAAe,SAASuC,eAAT,CAAyB1E,KAAzB,EAAuC;AACpD,sBACE,oBAAC,sBAAD,qBACE,oBAAC,oBAAD,EAA0BA,KAA1B,CADF,CADF;AAKD;AAED,MAAMmB,MAAM,GAAGtC,UAAU,CAAC8F,MAAX,CAAkB;AAC/BvD,EAAAA,SAAS,EAAE;AACTwD,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\n// @ts-ignore Getting private component\nimport AppContainer from 'react-native/Libraries/ReactNative/AppContainer';\nimport warnOnce from 'warn-once';\nimport {\n ScreenStack,\n StackPresentationTypes,\n ScreenContext,\n} from 'react-native-screens';\nimport {\n ParamListBase,\n StackActions,\n StackNavigationState,\n useTheme,\n Route,\n NavigationState,\n PartialState,\n} from '@react-navigation/native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport {\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n NativeStackNavigationOptions,\n} from '../types';\nimport HeaderConfig from './HeaderConfig';\nimport SafeAreaProviderCompat from '../utils/SafeAreaProviderCompat';\nimport getDefaultHeaderHeight from '../utils/getDefaultHeaderHeight';\nimport HeaderHeightContext from '../utils/HeaderHeightContext';\n\nconst isAndroid = Platform.OS === 'android';\n\nlet Container = View;\n\nif (__DEV__) {\n const DebugContainer = (\n props: ViewProps & { stackPresentation: StackPresentationTypes }\n ) => {\n const { stackPresentation, ...rest } = props;\n if (Platform.OS === 'ios' && stackPresentation !== 'push') {\n return (\n <AppContainer>\n <View {...rest} />\n </AppContainer>\n );\n }\n return <View {...rest} />;\n };\n // @ts-ignore Wrong props\n Container = DebugContainer;\n}\n\nconst MaybeNestedStack = ({\n options,\n route,\n stackPresentation,\n children,\n}: {\n options: NativeStackNavigationOptions;\n route: Route<string>;\n stackPresentation: StackPresentationTypes;\n children: React.ReactNode;\n}) => {\n const { colors } = useTheme();\n const { headerShown = true, contentStyle } = options;\n\n const Screen = React.useContext(ScreenContext);\n\n const isHeaderInModal = isAndroid\n ? false\n : stackPresentation !== 'push' && headerShown === true;\n\n const headerShownPreviousRef = React.useRef(headerShown);\n\n React.useEffect(() => {\n warnOnce(\n !isAndroid &&\n stackPresentation !== 'push' &&\n headerShownPreviousRef.current !== headerShown,\n `Dynamically changing 'headerShown' in modals will result in remounting the screen and losing all local state. See options for the screen '${route.name}'.`\n );\n\n headerShownPreviousRef.current = headerShown;\n }, [headerShown, stackPresentation, route.name]);\n\n const content = (\n <Container\n style={[\n styles.container,\n stackPresentation !== 'transparentModal' &&\n stackPresentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n // @ts-ignore Wrong props passed to View\n stackPresentation={stackPresentation}>\n {children}\n </Container>\n );\n\n const topInset = useSafeAreaInsets().top;\n const dimensions = useSafeAreaFrame();\n const headerHeight = getDefaultHeaderHeight(\n dimensions,\n topInset,\n stackPresentation\n );\n\n if (isHeaderInModal) {\n return (\n <ScreenStack style={styles.container}>\n <Screen enabled isNativeStack style={StyleSheet.absoluteFill}>\n <HeaderHeightContext.Provider value={headerHeight}>\n <HeaderConfig {...options} route={route} />\n {content}\n </HeaderHeightContext.Provider>\n </Screen>\n </ScreenStack>\n );\n }\n\n return content;\n};\n\ntype NavigationRoute<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList\n> = Route<Extract<RouteName, string>, ParamList[RouteName]> & {\n state?: NavigationState | PartialState<NavigationState>;\n};\n\nconst RouteView = ({\n descriptors,\n route,\n index,\n navigation,\n stateKey,\n}: {\n descriptors: NativeStackDescriptorMap;\n route: NavigationRoute<ParamListBase, string>;\n index: number;\n navigation: NativeStackNavigationHelpers;\n stateKey: string;\n}) => {\n const { options, render: renderScene } = descriptors[route.key];\n const {\n gestureEnabled,\n headerShown,\n hideKeyboardOnSwipe,\n homeIndicatorHidden,\n nativeBackButtonDismissalEnabled = false,\n navigationBarColor,\n navigationBarHidden,\n replaceAnimation = 'pop',\n screenOrientation,\n statusBarAnimation,\n statusBarColor,\n statusBarHidden,\n statusBarStyle,\n statusBarTranslucent,\n swipeDirection = 'horizontal',\n transitionDuration,\n freezeOnBlur,\n } = options;\n\n let {\n customAnimationOnSwipe,\n fullScreenSwipeEnabled,\n gestureResponseDistance,\n stackAnimation,\n stackPresentation = 'push',\n } = options;\n\n if (swipeDirection === 'vertical') {\n // for `vertical` direction to work, we need to set `fullScreenSwipeEnabled` to `true`\n // so the screen can be dismissed from any point on screen.\n // `customAnimationOnSwipe` needs to be set to `true` so the `stackAnimation` set by user can be used,\n // otherwise `simple_push` will be used.\n // Also, the default animation for this direction seems to be `slide_from_bottom`.\n if (fullScreenSwipeEnabled === undefined) {\n fullScreenSwipeEnabled = true;\n }\n if (customAnimationOnSwipe === undefined) {\n customAnimationOnSwipe = true;\n }\n if (stackAnimation === undefined) {\n stackAnimation = 'slide_from_bottom';\n }\n }\n\n if (index === 0) {\n // first screen should always be treated as `push`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `push`\n stackPresentation = 'push';\n }\n\n const isHeaderInPush = isAndroid\n ? headerShown\n : stackPresentation === 'push' && headerShown !== false;\n\n const dimensions = useSafeAreaFrame();\n const topInset = useSafeAreaInsets().top;\n const headerHeight = getDefaultHeaderHeight(\n dimensions,\n topInset,\n stackPresentation\n );\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n const Screen = React.useContext(ScreenContext);\n\n return (\n <Screen\n key={route.key}\n enabled\n isNativeStack\n style={StyleSheet.absoluteFill}\n customAnimationOnSwipe={customAnimationOnSwipe}\n freezeOnBlur={freezeOnBlur}\n fullScreenSwipeEnabled={fullScreenSwipeEnabled}\n hideKeyboardOnSwipe={hideKeyboardOnSwipe}\n homeIndicatorHidden={homeIndicatorHidden}\n gestureEnabled={isAndroid ? false : gestureEnabled}\n gestureResponseDistance={gestureResponseDistance}\n nativeBackButtonDismissalEnabled={nativeBackButtonDismissalEnabled}\n navigationBarColor={navigationBarColor}\n navigationBarHidden={navigationBarHidden}\n replaceAnimation={replaceAnimation}\n screenOrientation={screenOrientation}\n stackAnimation={stackAnimation}\n stackPresentation={stackPresentation}\n statusBarAnimation={statusBarAnimation}\n statusBarColor={statusBarColor}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n statusBarTranslucent={statusBarTranslucent}\n swipeDirection={swipeDirection}\n transitionDuration={transitionDuration}\n onHeaderBackButtonClicked={() => {\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: stateKey,\n });\n }}\n onWillAppear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: false },\n target: route.key,\n });\n }}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onAppear={() => {\n navigation.emit({\n type: 'appear',\n target: route.key,\n });\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: false },\n target: route.key,\n });\n }}\n onDisappear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: true },\n target: route.key,\n });\n }}\n onDismissed={(e) => {\n navigation.emit({\n type: 'dismiss',\n target: route.key,\n });\n\n const dismissCount =\n e.nativeEvent.dismissCount > 0 ? e.nativeEvent.dismissCount : 1;\n\n navigation.dispatch({\n ...StackActions.pop(dismissCount),\n source: route.key,\n target: stateKey,\n });\n }}>\n <HeaderHeightContext.Provider\n value={\n isHeaderInPush !== false ? headerHeight : parentHeaderHeight ?? 0\n }>\n <HeaderConfig {...options} route={route} headerShown={isHeaderInPush} />\n <MaybeNestedStack\n options={options}\n route={route}\n stackPresentation={stackPresentation}>\n {renderScene()}\n </MaybeNestedStack>\n </HeaderHeightContext.Provider>\n </Screen>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nfunction NativeStackViewInner({\n state,\n navigation,\n descriptors,\n}: Props): JSX.Element {\n const { key, routes } = state;\n\n return (\n <ScreenStack style={styles.container}>\n {routes.map((route, index) => (\n <RouteView\n key={route.key}\n descriptors={descriptors}\n route={route}\n index={index}\n navigation={navigation}\n stateKey={key}\n />\n ))}\n </ScreenStack>\n );\n}\n\nexport default function NativeStackView(props: Props) {\n return (\n <SafeAreaProviderCompat>\n <NativeStackViewInner {...props} />\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","View","AppContainer","warnOnce","ScreenStack","ScreenContext","StackActions","useTheme","useSafeAreaFrame","useSafeAreaInsets","HeaderConfig","SafeAreaProviderCompat","getDefaultHeaderHeight","HeaderHeightContext","isAndroid","OS","Container","__DEV__","DebugContainer","props","stackPresentation","rest","MaybeNestedStack","options","route","children","colors","headerShown","contentStyle","Screen","useContext","isHeaderInModal","headerShownPreviousRef","useRef","useEffect","current","name","content","styles","container","backgroundColor","background","topInset","top","dimensions","headerHeight","absoluteFill","RouteView","descriptors","index","navigation","stateKey","render","renderScene","key","gestureEnabled","hideKeyboardOnSwipe","homeIndicatorHidden","nativeBackButtonDismissalEnabled","navigationBarColor","navigationBarHidden","replaceAnimation","screenOrientation","statusBarAnimation","statusBarColor","statusBarHidden","statusBarStyle","statusBarTranslucent","swipeDirection","transitionDuration","freezeOnBlur","customAnimationOnSwipe","fullScreenSwipeEnabled","gestureResponseDistance","stackAnimation","undefined","isHeaderInPush","parentHeaderHeight","dispatch","pop","source","target","emit","type","data","closing","e","dismissCount","nativeEvent","NativeStackViewInner","state","routes","map","NativeStackView","create","flex"],"sources":["NativeStackView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\n// @ts-ignore Getting private component\nimport AppContainer from 'react-native/Libraries/ReactNative/AppContainer';\nimport warnOnce from 'warn-once';\nimport {\n ScreenStack,\n StackPresentationTypes,\n ScreenContext,\n} from 'react-native-screens';\nimport {\n ParamListBase,\n StackActions,\n StackNavigationState,\n useTheme,\n Route,\n NavigationState,\n PartialState,\n} from '@react-navigation/native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport {\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n NativeStackNavigationOptions,\n} from '../types';\nimport HeaderConfig from './HeaderConfig';\nimport SafeAreaProviderCompat from '../utils/SafeAreaProviderCompat';\nimport getDefaultHeaderHeight from '../utils/getDefaultHeaderHeight';\nimport HeaderHeightContext from '../utils/HeaderHeightContext';\n\nconst isAndroid = Platform.OS === 'android';\n\nlet Container = View;\n\nif (__DEV__) {\n const DebugContainer = (\n props: ViewProps & { stackPresentation: StackPresentationTypes }\n ) => {\n const { stackPresentation, ...rest } = props;\n if (Platform.OS === 'ios' && stackPresentation !== 'push') {\n return (\n <AppContainer>\n <View {...rest} />\n </AppContainer>\n );\n }\n return <View {...rest} />;\n };\n // @ts-ignore Wrong props\n Container = DebugContainer;\n}\n\nconst MaybeNestedStack = ({\n options,\n route,\n stackPresentation,\n children,\n}: {\n options: NativeStackNavigationOptions;\n route: Route<string>;\n stackPresentation: StackPresentationTypes;\n children: React.ReactNode;\n}) => {\n const { colors } = useTheme();\n const { headerShown = true, contentStyle } = options;\n\n const Screen = React.useContext(ScreenContext);\n\n const isHeaderInModal = isAndroid\n ? false\n : stackPresentation !== 'push' && headerShown === true;\n\n const headerShownPreviousRef = React.useRef(headerShown);\n\n React.useEffect(() => {\n warnOnce(\n !isAndroid &&\n stackPresentation !== 'push' &&\n headerShownPreviousRef.current !== headerShown,\n `Dynamically changing 'headerShown' in modals will result in remounting the screen and losing all local state. See options for the screen '${route.name}'.`\n );\n\n headerShownPreviousRef.current = headerShown;\n }, [headerShown, stackPresentation, route.name]);\n\n const content = (\n <Container\n style={[\n styles.container,\n stackPresentation !== 'transparentModal' &&\n stackPresentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n // @ts-ignore Wrong props passed to View\n stackPresentation={stackPresentation}\n >\n {children}\n </Container>\n );\n\n const topInset = useSafeAreaInsets().top;\n const dimensions = useSafeAreaFrame();\n const headerHeight = getDefaultHeaderHeight(\n dimensions,\n topInset,\n stackPresentation\n );\n\n if (isHeaderInModal) {\n return (\n <ScreenStack style={styles.container}>\n <Screen enabled isNativeStack style={StyleSheet.absoluteFill}>\n <HeaderHeightContext.Provider value={headerHeight}>\n <HeaderConfig {...options} route={route} />\n {content}\n </HeaderHeightContext.Provider>\n </Screen>\n </ScreenStack>\n );\n }\n\n return content;\n};\n\ntype NavigationRoute<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList\n> = Route<Extract<RouteName, string>, ParamList[RouteName]> & {\n state?: NavigationState | PartialState<NavigationState>;\n};\n\nconst RouteView = ({\n descriptors,\n route,\n index,\n navigation,\n stateKey,\n}: {\n descriptors: NativeStackDescriptorMap;\n route: NavigationRoute<ParamListBase, string>;\n index: number;\n navigation: NativeStackNavigationHelpers;\n stateKey: string;\n}) => {\n const { options, render: renderScene } = descriptors[route.key];\n const {\n gestureEnabled,\n headerShown,\n hideKeyboardOnSwipe,\n homeIndicatorHidden,\n nativeBackButtonDismissalEnabled = false,\n navigationBarColor,\n navigationBarHidden,\n replaceAnimation = 'pop',\n screenOrientation,\n statusBarAnimation,\n statusBarColor,\n statusBarHidden,\n statusBarStyle,\n statusBarTranslucent,\n swipeDirection = 'horizontal',\n transitionDuration,\n freezeOnBlur,\n } = options;\n\n let {\n customAnimationOnSwipe,\n fullScreenSwipeEnabled,\n gestureResponseDistance,\n stackAnimation,\n stackPresentation = 'push',\n } = options;\n\n if (swipeDirection === 'vertical') {\n // for `vertical` direction to work, we need to set `fullScreenSwipeEnabled` to `true`\n // so the screen can be dismissed from any point on screen.\n // `customAnimationOnSwipe` needs to be set to `true` so the `stackAnimation` set by user can be used,\n // otherwise `simple_push` will be used.\n // Also, the default animation for this direction seems to be `slide_from_bottom`.\n if (fullScreenSwipeEnabled === undefined) {\n fullScreenSwipeEnabled = true;\n }\n if (customAnimationOnSwipe === undefined) {\n customAnimationOnSwipe = true;\n }\n if (stackAnimation === undefined) {\n stackAnimation = 'slide_from_bottom';\n }\n }\n\n if (index === 0) {\n // first screen should always be treated as `push`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `push`\n stackPresentation = 'push';\n }\n\n const isHeaderInPush = isAndroid\n ? headerShown\n : stackPresentation === 'push' && headerShown !== false;\n\n const dimensions = useSafeAreaFrame();\n const topInset = useSafeAreaInsets().top;\n const headerHeight = getDefaultHeaderHeight(\n dimensions,\n topInset,\n stackPresentation\n );\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n const Screen = React.useContext(ScreenContext);\n\n return (\n <Screen\n key={route.key}\n enabled\n isNativeStack\n style={StyleSheet.absoluteFill}\n customAnimationOnSwipe={customAnimationOnSwipe}\n freezeOnBlur={freezeOnBlur}\n fullScreenSwipeEnabled={fullScreenSwipeEnabled}\n hideKeyboardOnSwipe={hideKeyboardOnSwipe}\n homeIndicatorHidden={homeIndicatorHidden}\n gestureEnabled={isAndroid ? false : gestureEnabled}\n gestureResponseDistance={gestureResponseDistance}\n nativeBackButtonDismissalEnabled={nativeBackButtonDismissalEnabled}\n navigationBarColor={navigationBarColor}\n navigationBarHidden={navigationBarHidden}\n replaceAnimation={replaceAnimation}\n screenOrientation={screenOrientation}\n stackAnimation={stackAnimation}\n stackPresentation={stackPresentation}\n statusBarAnimation={statusBarAnimation}\n statusBarColor={statusBarColor}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n statusBarTranslucent={statusBarTranslucent}\n swipeDirection={swipeDirection}\n transitionDuration={transitionDuration}\n onHeaderBackButtonClicked={() => {\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: stateKey,\n });\n }}\n onWillAppear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: false },\n target: route.key,\n });\n }}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onAppear={() => {\n navigation.emit({\n type: 'appear',\n target: route.key,\n });\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: false },\n target: route.key,\n });\n }}\n onDisappear={() => {\n navigation.emit({\n type: 'transitionEnd',\n data: { closing: true },\n target: route.key,\n });\n }}\n onDismissed={(e) => {\n navigation.emit({\n type: 'dismiss',\n target: route.key,\n });\n\n const dismissCount =\n e.nativeEvent.dismissCount > 0 ? e.nativeEvent.dismissCount : 1;\n\n navigation.dispatch({\n ...StackActions.pop(dismissCount),\n source: route.key,\n target: stateKey,\n });\n }}\n >\n <HeaderHeightContext.Provider\n value={\n isHeaderInPush !== false ? headerHeight : parentHeaderHeight ?? 0\n }\n >\n <HeaderConfig {...options} route={route} headerShown={isHeaderInPush} />\n <MaybeNestedStack\n options={options}\n route={route}\n stackPresentation={stackPresentation}\n >\n {renderScene()}\n </MaybeNestedStack>\n </HeaderHeightContext.Provider>\n </Screen>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n};\n\nfunction NativeStackViewInner({\n state,\n navigation,\n descriptors,\n}: Props): JSX.Element {\n const { key, routes } = state;\n\n return (\n <ScreenStack style={styles.container}>\n {routes.map((route, index) => (\n <RouteView\n key={route.key}\n descriptors={descriptors}\n route={route}\n index={index}\n navigation={navigation}\n stateKey={key}\n />\n ))}\n </ScreenStack>\n );\n}\n\nexport default function NativeStackView(props: Props) {\n return (\n <SafeAreaProviderCompat>\n <NativeStackViewInner {...props} />\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAmB,cAAc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
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
3
|
import React from 'react';
|
|
6
4
|
import { Platform } from 'react-native';
|
|
7
|
-
import { InnerScreen } from 'react-native-screens';
|
|
5
|
+
import { InnerScreen } from 'react-native-screens';
|
|
8
6
|
|
|
7
|
+
// @ts-ignore file to be used only if `react-native-reanimated` available in the project
|
|
9
8
|
import Animated, { useEvent, useSharedValue } from 'react-native-reanimated';
|
|
10
9
|
import ReanimatedTransitionProgressContext from './ReanimatedTransitionProgressContext';
|
|
11
|
-
const AnimatedScreen = Animated.createAnimatedComponent(InnerScreen);
|
|
10
|
+
const AnimatedScreen = Animated.createAnimatedComponent(InnerScreen);
|
|
11
|
+
|
|
12
|
+
// We use prop added to global by reanimated since it seems safer than the one from RN. See:
|
|
12
13
|
// https://github.com/software-mansion/react-native-reanimated/blob/3fe8b35b05e82b2f2aefda1fb97799cf81e4b7bb/src/reanimated2/UpdateProps.ts#L46
|
|
13
14
|
// @ts-expect-error nativeFabricUIManager is not yet included in the RN types
|
|
14
|
-
|
|
15
15
|
const ENABLE_FABRIC = !!((_global = global) !== null && _global !== void 0 && _global._IS_FABRIC);
|
|
16
16
|
const ReanimatedNativeStackScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
17
17
|
const {
|
|
@@ -21,7 +21,8 @@ const ReanimatedNativeStackScreen = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
21
21
|
const progress = useSharedValue(0);
|
|
22
22
|
const closing = useSharedValue(0);
|
|
23
23
|
const goingForward = useSharedValue(0);
|
|
24
|
-
return /*#__PURE__*/React.createElement(AnimatedScreen
|
|
24
|
+
return /*#__PURE__*/React.createElement(AnimatedScreen
|
|
25
|
+
// @ts-ignore some problems with ref and onTransitionProgressReanimated being "fake" prop for parsing of `useEvent` return value
|
|
25
26
|
, _extends({
|
|
26
27
|
ref: ref,
|
|
27
28
|
onTransitionProgressReanimated: useEvent(event => {
|
|
@@ -30,9 +31,11 @@ const ReanimatedNativeStackScreen = /*#__PURE__*/React.forwardRef((props, ref) =
|
|
|
30
31
|
progress.value = event.progress;
|
|
31
32
|
closing.value = event.closing;
|
|
32
33
|
goingForward.value = event.goingForward;
|
|
33
|
-
}, [
|
|
34
|
+
}, [
|
|
35
|
+
// This should not be necessary, but is not properly managed by `react-native-reanimated`
|
|
34
36
|
// @ts-ignore wrong type
|
|
35
|
-
Platform.OS === 'android' ? 'onTransitionProgress' :
|
|
37
|
+
Platform.OS === 'android' ? 'onTransitionProgress' :
|
|
38
|
+
// for some reason there is a difference in required event name between architectures
|
|
36
39
|
ENABLE_FABRIC ? 'onTransitionProgress' : 'topTransitionProgress'])
|
|
37
40
|
}, rest), /*#__PURE__*/React.createElement(ReanimatedTransitionProgressContext.Provider, {
|
|
38
41
|
value: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","Platform","InnerScreen","Animated","useEvent","useSharedValue","ReanimatedTransitionProgressContext","AnimatedScreen","createAnimatedComponent","ENABLE_FABRIC","global","_IS_FABRIC","ReanimatedNativeStackScreen","forwardRef","props","ref","children","rest","progress","closing","goingForward","event","value","OS","displayName"],"sources":["ReanimatedNativeStackScreen.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport {\n InnerScreen,\n ScreenProps,\n TransitionProgressEventType,\n} from 'react-native-screens';\n\n// @ts-ignore file to be used only if `react-native-reanimated` available in the project\nimport Animated, { useEvent, useSharedValue } from 'react-native-reanimated';\nimport ReanimatedTransitionProgressContext from './ReanimatedTransitionProgressContext';\n\nconst AnimatedScreen = Animated.createAnimatedComponent(\n InnerScreen as unknown as React.ComponentClass\n);\n\n// We use prop added to global by reanimated since it seems safer than the one from RN. See:\n// https://github.com/software-mansion/react-native-reanimated/blob/3fe8b35b05e82b2f2aefda1fb97799cf81e4b7bb/src/reanimated2/UpdateProps.ts#L46\n// @ts-expect-error nativeFabricUIManager is not yet included in the RN types\nconst ENABLE_FABRIC = !!global?._IS_FABRIC;\n\nconst ReanimatedNativeStackScreen = React.forwardRef<\n typeof AnimatedScreen,\n ScreenProps\n>((props, ref) => {\n const { children, ...rest } = props;\n\n const progress = useSharedValue(0);\n const closing = useSharedValue(0);\n const goingForward = useSharedValue(0);\n\n return (\n <AnimatedScreen\n // @ts-ignore some problems with ref and onTransitionProgressReanimated being \"fake\" prop for parsing of `useEvent` return value\n ref={ref}\n onTransitionProgressReanimated={useEvent(\n (event: TransitionProgressEventType) => {\n 'worklet';\n progress.value = event.progress;\n closing.value = event.closing;\n goingForward.value = event.goingForward;\n },\n [\n // This should not be necessary, but is not properly managed by `react-native-reanimated`\n // @ts-ignore wrong type\n Platform.OS === 'android'\n ? 'onTransitionProgress'\n : // for some reason there is a difference in required event name between architectures\n ENABLE_FABRIC\n ? 'onTransitionProgress'\n : 'topTransitionProgress',\n ]\n )}\n {...rest}\n >\n <ReanimatedTransitionProgressContext.Provider\n value={{\n progress: progress,\n closing: closing,\n goingForward: goingForward,\n }}\n >\n {children}\n </ReanimatedTransitionProgressContext.Provider>\n </AnimatedScreen>\n );\n});\n\nReanimatedNativeStackScreen.displayName = 'ReanimatedNativeStackScreen';\n\nexport default ReanimatedNativeStackScreen;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SACEC,WAAW,QAGN,sBAAsB;;AAE7B;AACA,OAAOC,QAAQ,IAAIC,QAAQ,EAAEC,cAAc,QAAQ,yBAAyB;AAC5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2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { InnerScreen } from 'react-native-screens';
|
|
3
|
+
import { InnerScreen } from 'react-native-screens';
|
|
5
4
|
|
|
5
|
+
// @ts-ignore file to be used only if `react-native-reanimated` available in the project
|
|
6
6
|
import Animated from 'react-native-reanimated';
|
|
7
7
|
const AnimatedScreen = Animated.createAnimatedComponent(InnerScreen);
|
|
8
8
|
const ReanimatedScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
|
-
return /*#__PURE__*/React.createElement(AnimatedScreen
|
|
9
|
+
return /*#__PURE__*/React.createElement(AnimatedScreen
|
|
10
|
+
// @ts-ignore some problems with ref and onTransitionProgressReanimated being "fake" prop for parsing of `useEvent` return value
|
|
10
11
|
, _extends({
|
|
11
12
|
ref: ref
|
|
12
13
|
}, props));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","InnerScreen","Animated","AnimatedScreen","createAnimatedComponent","ReanimatedScreen","forwardRef","props","ref","displayName"],"sources":["ReanimatedScreen.tsx"],"sourcesContent":["import React from 'react';\nimport { InnerScreen, ScreenProps } from 'react-native-screens';\n\n// @ts-ignore file to be used only if `react-native-reanimated` available in the project\nimport Animated from 'react-native-reanimated';\n\nconst AnimatedScreen = Animated.createAnimatedComponent(\n InnerScreen as unknown as React.ComponentClass\n);\n\nconst ReanimatedScreen = React.forwardRef<typeof AnimatedScreen, ScreenProps>(\n (props, ref) => {\n return (\n <AnimatedScreen\n // @ts-ignore some problems with ref and onTransitionProgressReanimated being \"fake\" prop for parsing of `useEvent` return value\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nReanimatedScreen.displayName = 'ReanimatedScreen';\n\nexport default ReanimatedScreen;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAqB,sBAAsB;;AAE/D;AACA,OAAOC,QAAQ,MAAM,yBAAyB;AAE9C,MAAMC,cAAc,GAAGD,QAAQ,CAACE,uBAAuB,CACrDH,WAAW,CACZ;AAED,MAAMI,gBAAgB,gBAAGL,KAAK,CAACM,UAAU,CACvC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACd,oBACE,oBAAC;EACC;EAAA;IACA,GAAG,EAAEA;EAAI,GACLD,KAAK,EACT;AAEN,CAAC,CACF;AAEDF,gBAAgB,CAACI,WAAW,GAAG,kBAAkB;AAEjD,eAAeJ,gBAAgB"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
|
|
5
3
|
import React from 'react';
|
|
6
4
|
import { ScreenContext } from 'react-native-screens';
|
|
7
5
|
import ReanimatedNativeStackScreen from './ReanimatedNativeStackScreen';
|
|
8
6
|
import AnimatedScreen from './ReanimatedScreen';
|
|
9
|
-
|
|
10
7
|
class ReanimatedScreenWrapper extends React.Component {
|
|
11
|
-
constructor(
|
|
12
|
-
super(...
|
|
13
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
14
10
|
_defineProperty(this, "ref", null);
|
|
15
|
-
|
|
16
11
|
_defineProperty(this, "setRef", ref => {
|
|
17
12
|
var _this$props$onCompone, _this$props;
|
|
18
|
-
|
|
19
13
|
this.ref = ref;
|
|
20
14
|
(_this$props$onCompone = (_this$props = this.props).onComponentRef) === null || _this$props$onCompone === void 0 ? void 0 : _this$props$onCompone.call(_this$props, ref);
|
|
21
15
|
});
|
|
22
16
|
}
|
|
23
|
-
|
|
24
17
|
setNativeProps(props) {
|
|
25
18
|
var _this$ref;
|
|
26
|
-
|
|
27
19
|
(_this$ref = this.ref) === null || _this$ref === void 0 ? void 0 : _this$ref.setNativeProps(props);
|
|
28
20
|
}
|
|
29
|
-
|
|
30
21
|
render() {
|
|
31
22
|
const ReanimatedScreen = this.props.isNativeStack ? ReanimatedNativeStackScreen : AnimatedScreen;
|
|
32
23
|
return /*#__PURE__*/React.createElement(ReanimatedScreen, _extends({}, this.props, {
|
|
@@ -34,9 +25,7 @@ class ReanimatedScreenWrapper extends React.Component {
|
|
|
34
25
|
ref: this.setRef
|
|
35
26
|
}));
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
export default function ReanimatedScreenProvider(props) {
|
|
41
30
|
return (
|
|
42
31
|
/*#__PURE__*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","ScreenContext","ReanimatedNativeStackScreen","AnimatedScreen","ReanimatedScreenWrapper","Component","ref","props","onComponentRef","setNativeProps","render","ReanimatedScreen","isNativeStack","setRef","ReanimatedScreenProvider","children"],"sources":["ReanimatedScreenProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren } from 'react';\nimport { View } from 'react-native';\nimport { ScreenProps, ScreenContext } from 'react-native-screens';\nimport ReanimatedNativeStackScreen from './ReanimatedNativeStackScreen';\nimport AnimatedScreen from './ReanimatedScreen';\n\nclass ReanimatedScreenWrapper extends React.Component<ScreenProps> {\n private ref: React.ElementRef<typeof View> | null = null;\n\n setNativeProps(props: ScreenProps): void {\n this.ref?.setNativeProps(props);\n }\n\n setRef = (ref: React.ElementRef<typeof View> | null): void => {\n this.ref = ref;\n this.props.onComponentRef?.(ref);\n };\n\n render() {\n const ReanimatedScreen = this.props.isNativeStack\n ? ReanimatedNativeStackScreen\n : AnimatedScreen;\n return (\n <ReanimatedScreen\n {...this.props}\n // @ts-ignore some problems with ref\n ref={this.setRef}\n />\n );\n }\n}\n\nexport default function ReanimatedScreenProvider(\n props: PropsWithChildren<unknown>\n) {\n return (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n <ScreenContext.Provider value={ReanimatedScreenWrapper as any}>\n {props.children}\n </ScreenContext.Provider>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAK,MAA6B,OAAO;AAEhD,SAAsBC,aAAa,QAAQ,sBAAsB;AACjE,OAAOC,2BAA2B,MAAM,+BAA+B;AACvE,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,MAAMC,uBAAuB,SAASJ,KAAK,CAACK,SAAS,CAAc;EAAA;IAAA;IAAA,6BACb,IAAI;IAAA,gCAM9CC,GAAyC,IAAW;MAAA;MAC5D,IAAI,CAACA,GAAG,GAAGA,GAAG;MACd,4CAAI,CAACC,KAAK,EAACC,cAAc,0DAAzB,wCAA4BF,GAAG,CAAC;IAClC,CAAC;EAAA;EAPDG,cAAc,CAACF,KAAkB,EAAQ;IAAA;IACvC,iBAAI,CAACD,GAAG,8CAAR,UAAUG,cAAc,CAACF,KAAK,CAAC;EACjC;EAOAG,MAAM,GAAG;IACP,MAAMC,gBAAgB,GAAG,IAAI,CAACJ,KAAK,CAACK,aAAa,GAC7CV,2BAA2B,GAC3BC,cAAc;IAClB,oBACE,oBAAC,gBAAgB,eACX,IAAI,CAACI,KAAK;MACd;MACA,GAAG,EAAE,IAAI,CAACM;IAAO,GACjB;EAEN;AACF;AAEA,eAAe,SAASC,wBAAwB,CAC9CP,KAAiC,EACjC;EACA;IAAA;IACE;IACA,oBAAC,aAAa,CAAC,QAAQ;MAAC,KAAK,EAAEH;IAA+B,GAC3DG,KAAK,CAACQ,QAAQ;EACQ;AAE7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// @ts-ignore file to be used only if `react-native-reanimated` available in the project
|
|
2
3
|
|
|
3
4
|
export default /*#__PURE__*/React.createContext(undefined);
|
|
4
5
|
//# sourceMappingURL=ReanimatedTransitionProgressContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sources":["ReanimatedTransitionProgressContext.tsx"],"sourcesContent":["import * as React from 'react';\n// @ts-ignore file to be used only if `react-native-reanimated` available in the project\nimport Animated from 'react-native-reanimated';\n\ntype ReanimatedTransitionProgressContextBody = {\n progress: Animated.SharedValue<number>;\n closing: Animated.SharedValue<number>;\n goingForward: Animated.SharedValue<number>;\n};\n\nexport default React.createContext<\n ReanimatedTransitionProgressContextBody | undefined\n>(undefined);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B;;AASA,4BAAeA,KAAK,CAACC,aAAa,CAEhCC,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["default","ReanimatedScreenProvider","useReanimatedTransitionProgress"],"sources":["index.tsx"],"sourcesContent":["export { default as ReanimatedScreenProvider } from './ReanimatedScreenProvider';\nexport { default as useReanimatedTransitionProgress } from './useReanimatedTransitionProgress';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,wBAAwB,QAAQ,4BAA4B;AAChF,SAASD,OAAO,IAAIE,+BAA+B,QAAQ,mCAAmC"}
|
|
@@ -2,11 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import ReanimatedTransitionProgressContext from './ReanimatedTransitionProgressContext';
|
|
3
3
|
export default function useReanimatedTransitionProgress() {
|
|
4
4
|
const progress = React.useContext(ReanimatedTransitionProgressContext);
|
|
5
|
-
|
|
6
5
|
if (progress === undefined) {
|
|
7
6
|
throw new Error("Couldn't find values for reanimated transition progress. Are you inside a screen in Native Stack?");
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
return progress;
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=useReanimatedTransitionProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","ReanimatedTransitionProgressContext","useReanimatedTransitionProgress","progress","useContext","undefined","Error"],"sources":["useReanimatedTransitionProgress.tsx"],"sourcesContent":["import * as React from 'react';\nimport ReanimatedTransitionProgressContext from './ReanimatedTransitionProgressContext';\n\nexport default function useReanimatedTransitionProgress() {\n const progress = React.useContext(ReanimatedTransitionProgressContext);\n\n if (progress === undefined) {\n throw new Error(\n \"Couldn't find values for reanimated transition progress. Are you inside a screen in Native Stack?\"\n );\n }\n\n return progress;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,mCAAmC,MAAM,uCAAuC;AAEvF,eAAe,SAASC,+BAA+B,GAAG;EACxD,MAAMC,QAAQ,GAAGH,KAAK,CAACI,UAAU,CAACH,mCAAmC,CAAC;EAEtE,IAAIE,QAAQ,KAAKE,SAAS,EAAE;IAC1B,MAAM,IAAIC,KAAK,CACb,mGAAmG,CACpG;EACH;EAEA,OAAOH,QAAQ;AACjB"}
|
package/lib/module/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import {\n Animated,\n NativeSyntheticEvent,\n ViewProps,\n View,\n TargetedEvent,\n TextInputFocusEventData,\n} from 'react-native';\n\nexport type StackPresentationTypes =\n | 'push'\n | 'modal'\n | 'transparentModal'\n | 'containedModal'\n | 'containedTransparentModal'\n | 'fullScreenModal'\n | 'formSheet';\nexport type StackAnimationTypes =\n | 'default'\n | 'fade'\n | 'fade_from_bottom'\n | 'flip'\n | 'none'\n | 'simple_push'\n | 'slide_from_bottom'\n | 'slide_from_right'\n | 'slide_from_left';\nexport type BlurEffectTypes =\n | 'extraLight'\n | 'light'\n | 'dark'\n | 'regular'\n | 'prominent'\n | 'systemUltraThinMaterial'\n | 'systemThinMaterial'\n | 'systemMaterial'\n | 'systemThickMaterial'\n | 'systemChromeMaterial'\n | 'systemUltraThinMaterialLight'\n | 'systemThinMaterialLight'\n | 'systemMaterialLight'\n | 'systemThickMaterialLight'\n | 'systemChromeMaterialLight'\n | 'systemUltraThinMaterialDark'\n | 'systemThinMaterialDark'\n | 'systemMaterialDark'\n | 'systemThickMaterialDark'\n | 'systemChromeMaterialDark';\nexport type ScreenReplaceTypes = 'push' | 'pop';\nexport type SwipeDirectionTypes = 'vertical' | 'horizontal';\nexport type ScreenOrientationTypes =\n | 'default'\n | 'all'\n | 'portrait'\n | 'portrait_up'\n | 'portrait_down'\n | 'landscape'\n | 'landscape_left'\n | 'landscape_right';\nexport type HeaderSubviewTypes =\n | 'back'\n | 'right'\n | 'left'\n | 'center'\n | 'searchBar';\n\nexport type TransitionProgressEventType = {\n progress: number;\n closing: number;\n goingForward: number;\n};\n\nexport type GestureResponseDistanceType = {\n start?: number;\n end?: number;\n top?: number;\n bottom?: number;\n};\n\nexport interface ScreenProps extends ViewProps {\n active?: 0 | 1 | Animated.AnimatedInterpolation;\n activityState?: 0 | 1 | 2 | Animated.AnimatedInterpolation;\n children?: React.ReactNode;\n /**\n * Boolean indicating that swipe dismissal should trigger animation provided by `stackAnimation`. Defaults to `false`.\n *\n * @platform ios\n */\n customAnimationOnSwipe?: boolean;\n /**\n * All children screens should have the same value of their \"enabled\" prop as their container.\n */\n enabled?: boolean;\n /**\n * Internal boolean used to not attach events used only by native-stack. It prevents non native-stack navigators from sending transition progress from their Screen components.\n */\n isNativeStack?: boolean;\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * When `enableFreeze()` is run at the top of the application defaults to `true`.\n */\n freezeOnBlur?: boolean;\n /**\n * Boolean indicating whether the swipe gesture should work on whole screen. Swiping with this option results in the same transition animation as `simple_push` by default.\n * It can be changed to other custom animations with `customAnimationOnSwipe` prop, but default iOS swipe animation is not achievable due to usage of custom recognizer.\n * Defaults to `false`.\n *\n * @platform ios\n */\n fullScreenSwipeEnabled?: boolean;\n /**\n * Whether you can use gestures to dismiss this screen. Defaults to `true`.\n *\n * @platform ios\n */\n gestureEnabled?: boolean;\n /**\n * Use it to restrict the distance from the edges of screen in which the gesture should be recognized. To be used alongside `fullScreenSwipeEnabled`.\n *\n * @platform ios\n */\n gestureResponseDistance?: GestureResponseDistanceType;\n /**\n * Whether the home indicator should be hidden on this screen. Defaults to `false`.\n *\n * @platform ios\n */\n homeIndicatorHidden?: boolean;\n /**\n * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.\n *\n * @platform ios\n */\n hideKeyboardOnSwipe?: boolean;\n /**\n * Boolean indicating whether, when the Android default back button is clicked, the `pop` action should be performed on the native side or on the JS side to be able to prevent it.\n * Unfortunately the same behavior is not available on iOS since the behavior of native back button cannot be changed there.\n * Defaults to `false`.\n *\n * @platform android\n */\n nativeBackButtonDismissalEnabled?: boolean;\n /**\n * Sets the navigation bar color. Defaults to initial status bar color.\n *\n * @platform android\n */\n navigationBarColor?: string;\n /**\n * Sets the visibility of the navigation bar. Defaults to `false`.\n *\n * @platform android\n */\n navigationBarHidden?: boolean;\n /**\n * A callback that gets called when the current screen appears.\n */\n onAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n onComponentRef?: (view: unknown) => void;\n /**\n * A callback that gets called when the current screen disappears.\n */\n onDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n /**\n * A callback that gets called when the current screen is dismissed by hardware back (on Android) or dismiss gesture (swipe back or down).\n * The callback takes the number of dismissed screens as an argument since iOS 14 native header back button can pop more than 1 screen at a time.\n */\n onDismissed?: (e: NativeSyntheticEvent<{ dismissCount: number }>) => void;\n /**\n * An internal callback that gets called when the native header back button is clicked on Android and `enableNativeBackButtonDismissal` is set to `false`. It dismises the screen using `navigation.pop()`.\n *\n * @platform android\n */\n onHeaderBackButtonClicked?: () => void;\n /**\n * An internal callback called when screen is dismissed by gesture or by native header back button and `preventNativeDismiss` is set to `true`.\n *\n * @platform ios\n */\n onNativeDismissCancelled?: (\n e: NativeSyntheticEvent<{ dismissCount: number }>\n ) => void;\n /**\n * An internal callback called every frame during the transition of screens of `native-stack`, used to feed transition context.\n */\n onTransitionProgress?: (\n e: NativeSyntheticEvent<TransitionProgressEventType>\n ) => void;\n /**\n * A callback that gets called when the current screen will appear. This is called as soon as the transition begins.\n */\n onWillAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n /**\n * A callback that gets called when the current screen will disappear. This is called as soon as the transition begins.\n */\n onWillDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n /**\n * Boolean indicating whether to prevent current screen from being dismissed.\n * Defaults to `false`.\n *\n * @platform ios\n */\n preventNativeDismiss?: boolean;\n ref?: React.Ref<View>;\n /**\n * How should the screen replacing another screen animate. Defaults to `pop`.\n * The following values are currently supported:\n * - \"push\" – the new screen will perform push animation.\n * - \"pop\" – the new screen will perform pop animation.\n */\n replaceAnimation?: ScreenReplaceTypes;\n /**\n * In which orientation should the screen appear.\n * The following values are currently supported:\n * - \"default\" - resolves to \"all\" without \"portrait_down\" on iOS. On Android, this lets the system decide the best orientation.\n * - \"all\" – all orientations are permitted\n * - \"portrait\" – portrait orientations are permitted\n * - \"portrait_up\" – right-side portrait orientation is permitted\n * - \"portrait_down\" – upside-down portrait orientation is permitted\n * - \"landscape\" – landscape orientations are permitted\n * - \"landscape_left\" – landscape-left orientation is permitted\n * - \"landscape_right\" – landscape-right orientation is permitted\n */\n screenOrientation?: ScreenOrientationTypes;\n /**\n * How the screen should appear/disappear when pushed or popped at the top of the stack.\n * The following values are currently supported:\n * - \"default\" – uses a platform default animation\n * - \"fade\" – fades screen in or out\n * - \"fade_from_bottom\" – performs a fade from bottom animation\n * - \"flip\" – flips the screen, requires stackPresentation: \"modal\" (iOS only)\n * - \"simple_push\" – performs a default animation, but without shadow and native header transition (iOS only)\n * - `slide_from_bottom` – performs a slide from bottom animation\n * - \"slide_from_right\" - slide in the new screen from right to left (Android only, resolves to default transition on iOS)\n * - \"slide_from_left\" - slide in the new screen from left to right (Android only, resolves to default transition on iOS)\n * - \"none\" – the screen appears/dissapears without an animation\n */\n stackAnimation?: StackAnimationTypes;\n /**\n * How should the screen be presented.\n * The following values are currently supported:\n * - \"push\" – the new screen will be pushed onto a stack which on iOS means that the default animation will be slide from the side, the animation on Android may vary depending on the OS version and theme.\n * - \"modal\" – the new screen will be presented modally. In addition this allow for a nested stack to be rendered inside such screens.\n * - \"transparentModal\" – the new screen will be presented modally but in addition the second to last screen will remain attached to the stack container such that if the top screen is non opaque the content below can still be seen. If \"modal\" is used instead the below screen will get unmounted as soon as the transition ends.\n * - \"containedModal\" – will use \"UIModalPresentationCurrentContext\" modal style on iOS and will fallback to \"modal\" on Android.\n * - \"containedTransparentModal\" – will use \"UIModalPresentationOverCurrentContext\" modal style on iOS and will fallback to \"transparentModal\" on Android.\n * - \"fullScreenModal\" – will use \"UIModalPresentationFullScreen\" modal style on iOS and will fallback to \"modal\" on Android.\n * - \"formSheet\" – will use \"UIModalPresentationFormSheet\" modal style on iOS and will fallback to \"modal\" on Android.\n */\n stackPresentation?: StackPresentationTypes;\n /**\n * Sets the status bar animation (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.\n */\n statusBarAnimation?: 'none' | 'fade' | 'slide';\n /**\n * Sets the status bar color (similar to the `StatusBar` component). Defaults to initial status bar color.\n *\n * @platform android\n */\n statusBarColor?: string;\n /**\n * Whether the status bar should be hidden on this screen. Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `false`.\n */\n statusBarHidden?: boolean;\n /**\n * Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `auto`.\n */\n statusBarStyle?: 'inverted' | 'auto' | 'light' | 'dark';\n /**\n * Sets the translucency of the status bar. Defaults to `false`.\n *\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Sets the direction in which you should swipe to dismiss the screen.\n * When using `vertical` option, options `fullScreenSwipeEnabled: true`, `customAnimationOnSwipe: true` and `stackAnimation: 'slide_from_bottom'` are set by default.\n * The following values are supported:\n * - `vertical` – dismiss screen vertically\n * - `horizontal` – dismiss screen horizontally (default)\n *\n * @platform ios\n */\n swipeDirection?: SwipeDirectionTypes;\n /**\n * Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `350`.\n * The duration of `default` and `flip` transitions isn't customizable.\n *\n * @platform ios\n */\n transitionDuration?: number;\n}\n\nexport interface ScreenContainerProps extends ViewProps {\n children?: React.ReactNode;\n /**\n * A prop that gives users an option to switch between using Screens for the navigator (container). All children screens should have the same value of their \"enabled\" prop as their container.\n */\n enabled?: boolean;\n /**\n * A prop to be used in navigators always showing only one screen (providing only `0` or `2` `activityState` values) for better implementation of `ScreenContainer` on iOS.\n */\n hasTwoStates?: boolean;\n}\n\nexport interface ScreenStackProps extends ViewProps {\n children?: React.ReactNode;\n /**\n * A callback that gets called when the current screen finishes its transition.\n */\n onFinishTransitioning?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n}\n\nexport interface ScreenStackHeaderConfigProps extends ViewProps {\n /**\n * Whether to show the back button with custom left side of the header.\n */\n backButtonInCustomView?: boolean;\n /**\n * Controls the color of the navigation header.\n */\n backgroundColor?: string;\n /**\n * Title to display in the back button.\n * @platform ios.\n */\n backTitle?: string;\n /**\n * Allows for customizing font family to be used for back button title on iOS.\n * @platform ios\n */\n backTitleFontFamily?: string;\n /**\n * Allows for customizing font size to be used for back button title on iOS.\n * @platform ios\n */\n backTitleFontSize?: number;\n /**\n * Blur effect to be applied to the header. Works with backgroundColor's alpha < 1.\n * @platform ios\n */\n blurEffect?: BlurEffectTypes;\n /**\n * Pass HeaderLeft, HeaderRight and HeaderTitle\n */\n children?: React.ReactNode;\n /**\n * Controls the color of items rendered on the header. This includes back icon, back text (iOS only) and title text. If you want the title to have different color use titleColor property.\n */\n color?: string;\n /**\n * Whether the stack should be in rtl or ltr form.\n */\n direction?: 'rtl' | 'ltr';\n /**\n * Boolean indicating whether to show the menu on longPress of iOS >= 14 back button.\n * @platform ios\n */\n disableBackButtonMenu?: boolean;\n /**\n * 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.\n */\n hidden?: boolean;\n /**\n * Boolean indicating whether to hide the back button in header.\n */\n hideBackButton?: boolean;\n /**\n * Boolean indicating whether to hide the elevation shadow or the bottom border on the header.\n */\n hideShadow?: boolean;\n /**\n * Boolean to set native property to prefer large title header (like in iOS setting).\n * For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`.\n * If the scrollable area doesn't fill the screen, the large title won't collapse on scroll.\n * Only supported on iOS.\n *\n * @platform ios\n */\n largeTitle?: boolean;\n /**\n * Controls the color of the navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar.\n */\n largeTitleBackgroundColor?: string;\n /**\n * Customize the color to be used for the large title. By default uses the titleColor property.\n * @platform ios\n */\n largeTitleColor?: string;\n /**\n * Customize font family to be used for the large title.\n * @platform ios\n */\n largeTitleFontFamily?: string;\n /**\n * Customize the size of the font to be used for the large title.\n * @platform ios\n */\n largeTitleFontSize?: number;\n /**\n * Customize the weight of the font to be used for the large title.\n * @platform ios\n */\n largeTitleFontWeight?: string;\n /**\n * Boolean that allows for disabling drop shadow under navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar.\n */\n largeTitleHideShadow?: boolean;\n /**\n * Callback which is executed when screen header is attached\n */\n onAttached?: () => void;\n /**\n * Callback which is executed when screen header is detached\n */\n onDetached?: () => void;\n /**\n * String that can be displayed in the header as a fallback for `headerTitle`.\n */\n title?: string;\n /**\n * Allows for setting text color of the title.\n */\n titleColor?: string;\n /**\n * Customize font family to be used for the title.\n */\n titleFontFamily?: string;\n /**\n * Customize the size of the font to be used for the title.\n */\n titleFontSize?: number;\n /**\n * Customize the weight of the font to be used for the title.\n */\n titleFontWeight?: string;\n /**\n * A flag to that lets you opt out of insetting the header. You may want to\n * set this to `false` if you use an opaque status bar. Defaults to `true`.\n * Only supported on Android. Insets are always applied on iOS because the\n * header cannot be opaque.\n *\n * @platform android\n */\n topInsetEnabled?: boolean;\n /**\n * Boolean indicating whether the navigation bar is translucent.\n */\n translucent?: boolean;\n}\n\nexport interface SearchBarProps {\n /**\n * The auto-capitalization behavior\n */\n autoCapitalize?: 'none' | 'words' | 'sentences' | 'characters';\n /**\n * Automatically focuses search bar on mount\n *\n * @platform android\n */\n autoFocus?: boolean;\n /**\n * The search field background color\n */\n barTintColor?: string;\n /**\n * The color for the cursor caret and cancel button text.\n *\n * @platform ios\n */\n tintColor?: string;\n /**\n * The text to be used instead of default `Cancel` button text\n *\n * @platform ios\n */\n cancelButtonText?: string;\n /**\n * Specifies whether the back button should close search bar's text input or not.\n *\n * @platform android\n */\n disableBackButtonOverride?: boolean;\n /**\n * Indicates whether to hide the navigation bar\n *\n * @platform ios\n */\n hideNavigationBar?: boolean;\n /**\n * Indicates whether to hide the search bar when scrolling\n *\n * @platform ios\n */\n hideWhenScrolling?: boolean;\n\n /**\n * Sets type of the input. Defaults to `text`.\n *\n * @platform android\n */\n inputType?: 'text' | 'phone' | 'number' | 'email';\n /**\n * Indicates whether to to obscure the underlying content\n */\n obscureBackground?: boolean;\n /**\n * A callback that gets called when search bar has lost focus\n */\n onBlur?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n /**\n * A callback that gets called when the cancel button is pressed\n *\n * @platform ios\n */\n onCancelButtonPress?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n\n /**\n * A callback that gets called when the text changes. It receives the current text value of the search bar.\n */\n onChangeText?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;\n\n /**\n * A callback that gets called when search bar is closed\n *\n * @platform android\n */\n onClose?: () => void;\n /**\n * A callback that gets called when search bar has received focus\n */\n onFocus?: (e: NativeSyntheticEvent<TargetedEvent>) => void;\n /**\n * A callback that gets called when search bar is opened\n *\n * @platform android\n */\n onOpen?: () => void;\n /**\n * A callback that gets called when the search button is pressed. It receives the current text value of the search bar.\n */\n onSearchButtonPress?: (\n e: NativeSyntheticEvent<TextInputFocusEventData>\n ) => void;\n /**\n * Text displayed when search field is empty\n */\n placeholder?: string;\n /**\n * The search field text color\n */\n textColor?: string;\n /**\n * The search hint text color\n *\n * @plaform android\n */\n hintTextColor?: string;\n /**\n * The search and close icon color shown in the header\n *\n * @plaform android\n */\n headerIconColor?: string;\n /**\n * Show the search hint icon when search bar is focused\n *\n * @plaform android\n * @default true\n */\n shouldShowHintSearchIcon?: boolean;\n}\n"],"mappings":""}
|
|
@@ -2,11 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import TransitionProgressContext from './TransitionProgressContext';
|
|
3
3
|
export default function useTransitionProgress() {
|
|
4
4
|
const progress = React.useContext(TransitionProgressContext);
|
|
5
|
-
|
|
6
5
|
if (progress === undefined) {
|
|
7
6
|
throw new Error("Couldn't find values for transition progress. Are you inside a screen in Native Stack?");
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
return progress;
|
|
11
9
|
}
|
|
12
10
|
//# sourceMappingURL=useTransitionProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","TransitionProgressContext","useTransitionProgress","progress","useContext","undefined","Error"],"sources":["useTransitionProgress.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport TransitionProgressContext from './TransitionProgressContext';\n\nexport default function useTransitionProgress() {\n const progress = React.useContext(TransitionProgressContext);\n\n if (progress === undefined) {\n throw new Error(\n \"Couldn't find values for transition progress. Are you inside a screen in Native Stack?\"\n );\n }\n\n return progress;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,yBAAyB,MAAM,6BAA6B;AAEnE,eAAe,SAASC,qBAAqB,GAAG;EAC9C,MAAMC,QAAQ,GAAGH,KAAK,CAACI,UAAU,CAACH,yBAAyB,CAAC;EAE5D,IAAIE,QAAQ,KAAKE,SAAS,EAAE;IAC1B,MAAM,IAAIC,KAAK,CACb,wFAAwF,CACzF;EACH;EAEA,OAAOH,QAAQ;AACjB"}
|
package/lib/module/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["BackHandler","Platform","isSearchBarAvailableForCurrentPlatform","includes","OS","executeNativeBackPress","exitApp"],"sources":["utils.ts"],"sourcesContent":["import { BackHandler, Platform } from 'react-native';\n\nexport const isSearchBarAvailableForCurrentPlatform = [\n 'ios',\n 'android',\n].includes(Platform.OS);\n\nexport function executeNativeBackPress() {\n // This function invokes the native back press event\n BackHandler.exitApp();\n return true;\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,cAAc;AAEpD,OAAO,MAAMC,sCAAsC,GAAG,CACpD,KAAK,EACL,SAAS,CACV,CAACC,QAAQ,CAACF,QAAQ,CAACG,EAAE,CAAC;AAEvB,OAAO,SAASC,sBAAsB,GAAG;EACvC;EACAL,WAAW,CAACM,OAAO,EAAE;EACrB,OAAO,IAAI;AACb"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { Animated, View, ViewProps, ImageProps } from 'react-native';
|
|
3
3
|
import { ScreenProps, ScreenContainerProps, ScreenStackProps, ScreenStackHeaderConfigProps, HeaderSubviewTypes, SearchBarProps } from './types';
|
|
4
4
|
export * from './types';
|
|
@@ -17,7 +17,9 @@ export declare const ScreenContainer: React.ComponentType<ScreenContainerProps>;
|
|
|
17
17
|
export declare const NativeScreenContainer: React.ComponentType<ScreenContainerProps>;
|
|
18
18
|
export declare const NativeScreenNavigationContainer: React.ComponentType<ScreenContainerProps>;
|
|
19
19
|
export declare const ScreenStack: React.ComponentType<ScreenStackProps>;
|
|
20
|
-
export declare const FullWindowOverlay:
|
|
20
|
+
export declare const FullWindowOverlay: React.ComponentType<{
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}>;
|
|
21
23
|
export declare const ScreenStackHeaderBackButtonImage: (props: ImageProps) => JSX.Element;
|
|
22
24
|
export declare const ScreenStackHeaderRightView: (props: React.PropsWithChildren<ViewProps>) => JSX.Element;
|
|
23
25
|
export declare const ScreenStackHeaderLeftView: (props: React.PropsWithChildren<ViewProps>) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { StackNavigationState } from '@react-navigation/native';
|
|
2
3
|
import { NativeStackNavigationEventMap, NativeStackNavigationOptions, NativeStackNavigatorProps } from '../types';
|
|
3
4
|
declare function NativeStackNavigator({ initialRouteName, children, screenOptions, ...rest }: NativeStackNavigatorProps): JSX.Element;
|
|
@@ -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<Pick<ScreenProps, "children" | "active" | "activityState" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "
|
|
4
|
+
declare const ReanimatedNativeStackScreen: React.ForwardRefExoticComponent<Pick<ScreenProps, "children" | "active" | "activityState" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors"> & 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<Pick<ScreenProps, "children" | "active" | "activityState" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "
|
|
4
|
+
declare const ReanimatedScreen: React.ForwardRefExoticComponent<Pick<ScreenProps, "children" | "active" | "activityState" | "customAnimationOnSwipe" | "enabled" | "isNativeStack" | "freezeOnBlur" | "fullScreenSwipeEnabled" | "gestureEnabled" | "gestureResponseDistance" | "homeIndicatorHidden" | "hideKeyboardOnSwipe" | "nativeBackButtonDismissalEnabled" | "navigationBarColor" | "navigationBarHidden" | "onAppear" | "onComponentRef" | "onDisappear" | "onDismissed" | "onHeaderBackButtonClicked" | "onNativeDismissCancelled" | "onTransitionProgress" | "onWillAppear" | "onWillDisappear" | "preventNativeDismiss" | "replaceAnimation" | "screenOrientation" | "stackAnimation" | "stackPresentation" | "statusBarAnimation" | "statusBarColor" | "statusBarHidden" | "statusBarStyle" | "statusBarTranslucent" | "swipeDirection" | "transitionDuration" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors"> & React.RefAttributes<React.ComponentClass<Animated.AnimateProps<{}>, any>>>;
|
|
5
5
|
export default ReanimatedScreen;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Animated, NativeSyntheticEvent, ViewProps, View, TargetedEvent, TextInputFocusEventData } from 'react-native';
|
|
2
3
|
export declare type StackPresentationTypes = 'push' | 'modal' | 'transparentModal' | 'containedModal' | 'containedTransparentModal' | 'fullScreenModal' | 'formSheet';
|
|
3
4
|
export declare type StackAnimationTypes = 'default' | 'fade' | 'fade_from_bottom' | 'flip' | 'none' | 'simple_push' | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screens",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"description": "Native navigation primitives for your React Native app.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"check-types": "tsc --noEmit",
|
|
@@ -76,6 +76,9 @@
|
|
|
76
76
|
"@types/react-test-renderer": "^16.9.2",
|
|
77
77
|
"@typescript-eslint/eslint-plugin": "^3.7.1",
|
|
78
78
|
"@typescript-eslint/parser": "^3.7.1",
|
|
79
|
+
"@react-native-community/cli": "^9.0.0",
|
|
80
|
+
"@react-native-community/cli-platform-android": "^9.0.0",
|
|
81
|
+
"@react-native-community/cli-platform-ios": "^9.0.0",
|
|
79
82
|
"babel-eslint": "^10.1.0",
|
|
80
83
|
"babel-jest": "^26.2.2",
|
|
81
84
|
"clang-format": "^1.5.0",
|
|
@@ -108,6 +111,11 @@
|
|
|
108
111
|
"release-it": "^13.5.2",
|
|
109
112
|
"typescript": "^3.9.7"
|
|
110
113
|
},
|
|
114
|
+
"resolutions": {
|
|
115
|
+
"@react-native-community/cli-platform-android": "^9.0.0",
|
|
116
|
+
"@react-native-community/cli": "^9.0.0",
|
|
117
|
+
"@react-native-community/cli-platform-ios": "^9.0.0"
|
|
118
|
+
},
|
|
111
119
|
"lint-staged": {
|
|
112
120
|
"{src,Example}/**/*.{js,ts,tsx}": "yarn format-js",
|
|
113
121
|
"src/**/*.{js,ts,tsx}": "yarn lint-js",
|
package/react-native.config.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
let supportsCodegenConfig = false;
|
|
2
|
+
try {
|
|
3
|
+
const rnCliAndroidVersion =
|
|
4
|
+
require('@react-native-community/cli-platform-android/package.json').version;
|
|
5
|
+
const [major] = rnCliAndroidVersion.split('.');
|
|
6
|
+
supportsCodegenConfig = major >= 9;
|
|
7
|
+
} catch (e) {
|
|
8
|
+
// ignore
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
module.exports = {
|
|
2
12
|
dependency: {
|
|
3
13
|
platforms: {
|
|
4
|
-
android: {
|
|
14
|
+
android: supportsCodegenConfig ? {
|
|
5
15
|
componentDescriptors: [
|
|
6
16
|
"RNSFullWindowOverlayComponentDescriptor",
|
|
7
17
|
"RNSScreenContainerComponentDescriptor",
|
|
@@ -13,7 +23,7 @@ module.exports = {
|
|
|
13
23
|
'RNSScreenComponentDescriptor'
|
|
14
24
|
],
|
|
15
25
|
cmakeListsPath: "../android/src/main/jni/CMakeLists.txt"
|
|
16
|
-
},
|
|
26
|
+
} : {},
|
|
17
27
|
},
|
|
18
28
|
},
|
|
19
29
|
}
|
|
@@ -400,7 +400,8 @@ function StackView({
|
|
|
400
400
|
return (
|
|
401
401
|
<ScreenStack
|
|
402
402
|
style={styles.scenes}
|
|
403
|
-
onFinishTransitioning={() => onFinishTransitioning(navigation)}
|
|
403
|
+
onFinishTransitioning={() => onFinishTransitioning(navigation)}
|
|
404
|
+
>
|
|
404
405
|
{routes.map((route, index) => {
|
|
405
406
|
const descriptor = descriptors[route.key];
|
|
406
407
|
const { getComponent, options } = descriptor;
|
|
@@ -501,7 +502,8 @@ function StackView({
|
|
|
501
502
|
e.nativeEvent.dismissCount,
|
|
502
503
|
routeNavigationProp
|
|
503
504
|
)
|
|
504
|
-
}
|
|
505
|
+
}
|
|
506
|
+
>
|
|
505
507
|
{isHeaderInPush &&
|
|
506
508
|
renderHeaderConfig(index, route, descriptor, navigationConfig)}
|
|
507
509
|
<MaybeNestedStack
|
|
@@ -56,6 +56,8 @@ type SwipeDirection = 'vertical' | 'horizontal';
|
|
|
56
56
|
|
|
57
57
|
type ReplaceAnimation = 'pop' | 'push';
|
|
58
58
|
|
|
59
|
+
type SheetDetentTypes = 'large' | 'medium' | 'all';
|
|
60
|
+
|
|
59
61
|
export type NativeProps = $ReadOnly<{|
|
|
60
62
|
...ViewProps,
|
|
61
63
|
onAppear?: ?BubblingEventHandler<ScreenEvent>,
|
|
@@ -65,6 +67,11 @@ export type NativeProps = $ReadOnly<{|
|
|
|
65
67
|
onWillAppear?: ?BubblingEventHandler<ScreenEvent>,
|
|
66
68
|
onWillDisappear?: ?BubblingEventHandler<ScreenEvent>,
|
|
67
69
|
onTransitionProgress?: ?BubblingEventHandler<TransitionProgressEvent>,
|
|
70
|
+
sheetAllowedDetents?: WithDefault<SheetDetentTypes, 'large'>,
|
|
71
|
+
sheetLargestUndimmedDetent?: WithDefault<SheetDetentTypes, 'all'>,
|
|
72
|
+
sheetGrabberVisible?: WithDefault<boolean, false>,
|
|
73
|
+
sheetCornerRadius?: WithDefault<Float, -1.0>,
|
|
74
|
+
sheetExpandsWhenScrolledToEdge?: WithDefault<boolean, false>,
|
|
68
75
|
customAnimationOnSwipe?: boolean,
|
|
69
76
|
fullScreenSwipeEnabled?: boolean,
|
|
70
77
|
homeIndicatorHidden?: boolean,
|