expo-router 56.2.11 → 56.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/build/exports.d.ts +1 -1
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.android.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.android.js +3 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.android.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.d.ts +4 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.js +2 -2
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.android.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.android.js +6 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.android.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.d.ts +4 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.android.d.ts +21 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.android.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.android.js +41 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.android.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.d.ts +11 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.js +14 -0
- package/build/layouts/stack-utils/toolbar/ToolbarItemBadge.js.map +1 -0
- package/build/react-navigation/native-stack/views/NativeStackView.native.d.ts.map +1 -1
- package/build/react-navigation/native-stack/views/NativeStackView.native.js +2 -1
- package/build/react-navigation/native-stack/views/NativeStackView.native.js.map +1 -1
- package/build/standard-navigation/index.d.ts +3 -3
- package/build/standard-navigation/index.d.ts.map +1 -1
- package/build/standard-navigation/index.js.map +1 -1
- package/build/standard-navigation/types.d.ts +37 -1
- package/build/standard-navigation/types.d.ts.map +1 -1
- package/build/standard-navigation/types.js.map +1 -1
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/index.js +8 -0
- package/build/testing-library/index.js.map +1 -1
- package/build/utils/font.d.ts +2 -0
- package/build/utils/font.d.ts.map +1 -1
- package/build/utils/font.js +27 -0
- package/build/utils/font.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.module → 56.2.13/expo.modules.router-56.2.13.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.pom → 56.2.13/expo.modules.router-56.2.13.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.13/expo.modules.router-56.2.13.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +11 -11
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.11/expo.modules.router-56.2.11.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11-sources.jar → 56.2.13/expo.modules.router-56.2.13-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11-sources.jar.md5 → 56.2.13/expo.modules.router-56.2.13-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11-sources.jar.sha1 → 56.2.13/expo.modules.router-56.2.13-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11-sources.jar.sha256 → 56.2.13/expo.modules.router-56.2.13-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11-sources.jar.sha512 → 56.2.13/expo.modules.router-56.2.13-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.aar → 56.2.13/expo.modules.router-56.2.13.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.aar.md5 → 56.2.13/expo.modules.router-56.2.13.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.aar.sha1 → 56.2.13/expo.modules.router-56.2.13.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.aar.sha256 → 56.2.13/expo.modules.router-56.2.13.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.11/expo.modules.router-56.2.11.aar.sha512 → 56.2.13/expo.modules.router-56.2.13.aar.sha512} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NativeStackHeaderItemButton } from '../../../react-navigation/native-stack';
|
|
3
|
+
type ToolbarBadge = NativeStackHeaderItemButton['badge'];
|
|
4
|
+
export declare function getBadgeContentDescription(_accessibilityLabel: string | undefined, _badge: ToolbarBadge): string | undefined;
|
|
5
|
+
export declare function ToolbarItemBadge(_props: {
|
|
6
|
+
badge: ToolbarBadge;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ToolbarItemBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarItemBadge.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/ToolbarItemBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAE1F,KAAK,YAAY,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;AAMzD,wBAAgB,0BAA0B,CACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,MAAM,EAAE,YAAY,GACnB,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAEP"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBadgeContentDescription = getBadgeContentDescription;
|
|
4
|
+
exports.ToolbarItemBadge = ToolbarItemBadge;
|
|
5
|
+
// Toolbar badges are only rendered through Jetpack Compose on Android
|
|
6
|
+
// (see ToolbarItemBadge.android.tsx). On other platforms these are no-ops —
|
|
7
|
+
// iOS badge support flows through native header items instead.
|
|
8
|
+
function getBadgeContentDescription(_accessibilityLabel, _badge) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
function ToolbarItemBadge(_props) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ToolbarItemBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarItemBadge.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/ToolbarItemBadge.tsx"],"names":[],"mappings":";;AAUA,gEAKC;AAED,4CAMC;AAjBD,sEAAsE;AACtE,4EAA4E;AAC5E,+DAA+D;AAE/D,SAAgB,0BAA0B,CACxC,mBAAuC,EACvC,MAAoB;IAEpB,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAIhC;IACC,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { NativeStackHeaderItemButton } from '../../../react-navigation/native-stack';\n\ntype ToolbarBadge = NativeStackHeaderItemButton['badge'];\n\n// Toolbar badges are only rendered through Jetpack Compose on Android\n// (see ToolbarItemBadge.android.tsx). On other platforms these are no-ops —\n// iOS badge support flows through native header items instead.\n\nexport function getBadgeContentDescription(\n _accessibilityLabel: string | undefined,\n _badge: ToolbarBadge\n): string | undefined {\n return undefined;\n}\n\nexport function ToolbarItemBadge(_props: {\n badge: ToolbarBadge;\n disabled?: boolean;\n children: ReactNode;\n}): null {\n return null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeStackView.native.d.ts","sourceRoot":"","sources":["../../../../src/react-navigation/native-stack/views/NativeStackView.native.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,oBAAoB,EAG1B,MAAM,cAAc,CAAC;AAgatB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC3C,UAAU,EAAE,4BAA4B,CAAC;IACzC,WAAW,EAAE,wBAAwB,CAAC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,OAAO,KAAK,qBAAqB,CAAC;CAC5F,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"NativeStackView.native.d.ts","sourceRoot":"","sources":["../../../../src/react-navigation/native-stack/views/NativeStackView.native.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEd,KAAK,oBAAoB,EAG1B,MAAM,cAAc,CAAC;AAgatB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC3C,UAAU,EAAE,4BAA4B,CAAC;IACzC,WAAW,EAAE,wBAAwB,CAAC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,OAAO,KAAK,qBAAqB,CAAC;CAC5F,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,KAAK,2CA8HlF"}
|
|
@@ -240,6 +240,7 @@ const SceneView = ({ index, focused, shouldFreeze, descriptor, previousDescripto
|
|
|
240
240
|
}) })) : null, (0, jsx_runtime_1.jsx)(elements_1.HeaderShownContext.Provider, { value: isParentHeaderShown || headerShown !== false, children: (0, jsx_runtime_1.jsx)(elements_1.HeaderBackContext.Provider, { value: headerBack, children: render() }) })] }) }) }) }));
|
|
241
241
|
};
|
|
242
242
|
function NativeStackView({ state, navigation, descriptors, describe }) {
|
|
243
|
+
const { colors } = (0, native_1.useTheme)();
|
|
243
244
|
const { setNextDismissedKey } = (0, useDismissedRouteError_1.useDismissedRouteError)(state);
|
|
244
245
|
(0, useInvalidPreventRemoveError_1.useInvalidPreventRemoveError)(descriptors);
|
|
245
246
|
const modalRouteKeys = (0, getModalRoutesKeys_1.getModalRouteKeys)(state.routes, descriptors);
|
|
@@ -247,7 +248,7 @@ function NativeStackView({ state, navigation, descriptors, describe }) {
|
|
|
247
248
|
acc[route.key] = acc[route.key] || describe(route, true);
|
|
248
249
|
return acc;
|
|
249
250
|
}, {});
|
|
250
|
-
return ((0, jsx_runtime_1.jsx)(elements_1.SafeAreaProviderCompat, { children: (0, jsx_runtime_1.jsx)(react_native_screens_1.ScreenStack, { style: styles.container, children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
|
|
251
|
+
return ((0, jsx_runtime_1.jsx)(elements_1.SafeAreaProviderCompat, { children: (0, jsx_runtime_1.jsx)(react_native_screens_1.ScreenStack, { nativeContainerStyle: { backgroundColor: colors.background }, style: styles.container, children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
|
|
251
252
|
const descriptor = (descriptors[route.key] ?? preloadedDescriptors[route.key]);
|
|
252
253
|
const isFocused = state.index === index;
|
|
253
254
|
const isBelowFocused = state.index - 1 === index;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeStackView.native.js","sourceRoot":"","sources":["../../../../src/react-navigation/native-stack/views/NativeStackView.native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0cb,0CA2HC;;AApkBD,6CAA+B;AAC/B,iCAA4B;AAC5B,+CAAiG;AACjG,mFAAmE;AACnE,+DAK8B;AAE9B,6CAQwB;AAMxB,iEAA8D;AAC9D,yCAQsB;AACtB,gDAA6C;AAC7C,oEAAgE;AAChE,8EAA+E;AAC/E,4EAAyE;AACzE,wFAAqF;AAErF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEzC,SAAS,QAAQ;IACf,OAAO,uBAAuB,IAAI,MAAM,CAAC;AAC3C,CAAC;AAsBD,MAAM,eAAe,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC;AAE9C,MAAM,SAAS,GAAG,CAAC,EACj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QACR,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;KACb;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { use } from 'react';\nimport { Animated, Platform, StatusBar, StyleSheet, useAnimatedValue, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n compatibilityFlags,\n type ScreenProps,\n ScreenStack,\n ScreenStackItem,\n} from 'react-native-screens';\n\nimport {\n getDefaultHeaderHeight,\n getHeaderTitle,\n HeaderBackContext,\n HeaderHeightContext,\n HeaderShownContext,\n SafeAreaProviderCompat,\n useFrameSize,\n} from '../../elements';\nimport type {\n NativeStackDescriptor,\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n} from '../types';\nimport { useHeaderConfigProps } from './useHeaderConfigProps';\nimport {\n NavigationProvider,\n type ParamListBase,\n type RouteProp,\n StackActions,\n type StackNavigationState,\n usePreventRemoveContext,\n useTheme,\n} from '../../native';\nimport { debounce } from '../utils/debounce';\nimport { getModalRouteKeys } from '../utils/getModalRoutesKeys';\nimport { AnimatedHeaderHeightContext } from '../utils/useAnimatedHeaderHeight';\nimport { useDismissedRouteError } from '../utils/useDismissedRouteError';\nimport { useInvalidPreventRemoveError } from '../utils/useInvalidPreventRemoveError';\n\nconst ANDROID_DEFAULT_HEADER_HEIGHT = 56;\n\nfunction isFabric() {\n return 'nativeFabricUIManager' in global;\n}\n\ntype SceneViewProps = {\n index: number;\n focused: boolean;\n shouldFreeze: boolean;\n descriptor: NativeStackDescriptor;\n previousDescriptor?: NativeStackDescriptor;\n nextDescriptor?: NativeStackDescriptor;\n isPresentationModal?: boolean;\n isPreloaded?: boolean;\n onWillDisappear: () => void;\n onWillAppear: () => void;\n onAppear: () => void;\n onDisappear: () => void;\n onDismissed: ScreenProps['onDismissed'];\n onHeaderBackButtonClicked: ScreenProps['onHeaderBackButtonClicked'];\n onNativeDismissCancelled: ScreenProps['onDismissed'];\n onGestureCancel: ScreenProps['onGestureCancel'];\n onSheetDetentChanged: ScreenProps['onSheetDetentChanged'];\n};\n\nconst useNativeDriver = Platform.OS !== 'web';\n\nconst SceneView = ({\n index,\n focused,\n shouldFreeze,\n descriptor,\n previousDescriptor,\n nextDescriptor,\n isPresentationModal,\n isPreloaded,\n onWillDisappear,\n onWillAppear,\n onAppear,\n onDisappear,\n onDismissed,\n onHeaderBackButtonClicked,\n onNativeDismissCancelled,\n onGestureCancel,\n onSheetDetentChanged,\n}: SceneViewProps) => {\n const { route, navigation, options, render } = descriptor;\n\n let {\n animation,\n animationMatchesGesture,\n presentation = isPresentationModal ? 'modal' : 'card',\n fullScreenGestureEnabled,\n } = options;\n\n const {\n animationDuration,\n animationTypeForReplace = 'push',\n fullScreenGestureShadowEnabled = true,\n gestureEnabled,\n gestureDirection = presentation === 'card' ? 'horizontal' : 'vertical',\n gestureResponseDistance,\n header,\n headerBackButtonMenuEnabled,\n headerShown,\n headerBackground,\n headerTransparent,\n autoHideHomeIndicator,\n keyboardHandlingEnabled,\n navigationBarColor,\n navigationBarTranslucent,\n navigationBarHidden,\n orientation,\n sheetAllowedDetents = [1.0],\n sheetLargestUndimmedDetentIndex = -1,\n sheetGrabberVisible = false,\n sheetCornerRadius = -1.0,\n sheetElevation = 24,\n sheetExpandsWhenScrolledToEdge = true,\n sheetInitialDetentIndex = 0,\n sheetShouldOverflowTopInset = false,\n sheetResizeAnimationEnabled = true,\n statusBarAnimation,\n statusBarHidden,\n statusBarStyle,\n statusBarTranslucent,\n statusBarBackgroundColor,\n unstable_sheetFooter,\n scrollEdgeEffects,\n freezeOnBlur,\n contentStyle,\n } = options;\n\n if (gestureDirection === 'vertical' && Platform.OS === 'ios') {\n // for `vertical` direction to work, we need to set `fullScreenGestureEnabled` to `true`\n // so the screen can be dismissed from any point on screen.\n // `animationMatchesGesture` needs to be set to `true` so the `animation` 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 (fullScreenGestureEnabled === undefined) {\n fullScreenGestureEnabled = true;\n }\n\n if (animationMatchesGesture === undefined) {\n animationMatchesGesture = true;\n }\n\n if (animation === undefined) {\n animation = 'slide_from_bottom';\n }\n }\n\n // workaround for rn-screens where gestureDirection has to be set on both\n // current and previous screen - software-mansion/react-native-screens/pull/1509\n const nextGestureDirection = nextDescriptor?.options.gestureDirection;\n const gestureDirectionOverride =\n nextGestureDirection != null ? nextGestureDirection : gestureDirection;\n\n if (index === 0) {\n // first screen should always be treated as `card`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `card`\n presentation = 'card';\n }\n\n const { colors } = useTheme();\n const insets = useSafeAreaInsets();\n\n // `modal`, `formSheet` and `pageSheet` presentations do not take whole screen, so should not take the inset.\n const isModal =\n presentation === 'modal' || presentation === 'formSheet' || presentation === 'pageSheet';\n\n // Modals are fullscreen in landscape only on iPhone\n const isIPhone = Platform.OS === 'ios' && !(Platform.isPad || Platform.isTV);\n\n const isParentHeaderShown = use(HeaderShownContext);\n const parentHeaderHeight = use(HeaderHeightContext);\n const parentHeaderBack = use(HeaderBackContext);\n\n const isLandscape = useFrameSize((frame) => frame.width > frame.height);\n\n const topInset =\n isParentHeaderShown || (Platform.OS === 'ios' && isModal) || (isIPhone && isLandscape)\n ? 0\n : insets.top;\n\n const defaultHeaderHeight = useFrameSize((frame) =>\n Platform.select({\n // FIXME: Currently screens isn't using Material 3\n // So our `getDefaultHeaderHeight` doesn't return the correct value\n // So we hardcode the value here for now until screens is updated\n android: ANDROID_DEFAULT_HEADER_HEIGHT + topInset,\n default: getDefaultHeaderHeight(frame, isModal, topInset),\n })\n );\n\n const { preventedRoutes } = usePreventRemoveContext();\n\n const [headerHeight, setHeaderHeight] = React.useState(defaultHeaderHeight);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const setHeaderHeightDebounced = React.useCallback(\n // Debounce the header height updates to avoid excessive re-renders\n debounce(setHeaderHeight, 100),\n []\n );\n\n const hasCustomHeader = header != null;\n\n const usesNewAndroidHeaderHeightImplementation =\n 'usesNewAndroidHeaderHeightImplementation' in compatibilityFlags &&\n compatibilityFlags['usesNewAndroidHeaderHeightImplementation'] === true;\n\n let headerHeightCorrectionOffset = 0;\n\n if (Platform.OS === 'android' && !hasCustomHeader && !usesNewAndroidHeaderHeightImplementation) {\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n\n // On Android, the native header height is not correctly calculated\n // It includes status bar height even if statusbar is not translucent\n // And the statusbar value itself doesn't match the actual status bar height\n // So we subtract the bogus status bar height and add the actual top inset\n headerHeightCorrectionOffset = -statusBarHeight + topInset;\n }\n\n const rawAnimatedHeaderHeight = useAnimatedValue(defaultHeaderHeight);\n const animatedHeaderHeight = React.useMemo(\n () => Animated.add<number>(rawAnimatedHeaderHeight, headerHeightCorrectionOffset),\n [headerHeightCorrectionOffset, rawAnimatedHeaderHeight]\n );\n\n // During the very first render topInset is > 0 when running\n // in non edge-to-edge mode on Android, while on every consecutive render\n // topInset === 0, causing header content to jump, as we add padding on the first frame,\n // just to remove it in next one. To prevent this, when statusBarTranslucent is set,\n // we apply additional padding in header only if its true.\n // For more details see: https://github.com/react-navigation/react-navigation/pull/12014\n const headerTopInsetEnabled =\n typeof statusBarTranslucent === 'boolean' ? statusBarTranslucent : topInset !== 0;\n\n const canGoBack = previousDescriptor != null || parentHeaderBack != null;\n const backTitle = previousDescriptor\n ? getHeaderTitle(previousDescriptor.options, previousDescriptor.route.name)\n : parentHeaderBack?.title;\n\n const headerBack = React.useMemo(() => {\n if (canGoBack) {\n return {\n href: undefined, // No href needed for native\n title: backTitle,\n };\n }\n\n return undefined;\n }, [canGoBack, backTitle]);\n\n const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;\n\n const headerConfig = useHeaderConfigProps({\n ...options,\n route,\n headerBackButtonMenuEnabled:\n isRemovePrevented !== undefined ? !isRemovePrevented : headerBackButtonMenuEnabled,\n headerBackTitle: options.headerBackTitle !== undefined ? options.headerBackTitle : undefined,\n headerHeight,\n headerShown: header !== undefined ? false : headerShown,\n headerTopInsetEnabled,\n headerTransparent,\n headerBack,\n });\n\n const onHeaderHeightChange = hasCustomHeader\n ? // If we have a custom header, don't use native header height\n undefined\n : // On Fabric, there's a bug where native event drivers for Animated objects\n // are created after the first notifications about the header height\n // from the native side, `onHeaderHeightChange` event does not notify\n // `animatedHeaderHeight` about initial values on appearing screens at the moment.\n Animated.event(\n [\n {\n nativeEvent: {\n headerHeight: rawAnimatedHeaderHeight,\n },\n },\n ],\n {\n useNativeDriver,\n listener: (e) => {\n if (\n e.nativeEvent &&\n typeof e.nativeEvent === 'object' &&\n 'headerHeight' in e.nativeEvent &&\n typeof e.nativeEvent.headerHeight === 'number'\n ) {\n const headerHeight = e.nativeEvent.headerHeight;\n\n // Only debounce if header has large title or search bar\n // As it's the only case where the header height can change frequently\n const doesHeaderAnimate =\n Platform.OS === 'ios' &&\n (options.headerLargeTitleEnabled || options.headerSearchBarOptions);\n\n if (doesHeaderAnimate) {\n setHeaderHeightDebounced(headerHeight);\n } else {\n if (\n Platform.OS === 'android' &&\n headerHeight !== 0 &&\n // On some devices, height maybe slightly off (e.g. 56.17 instead of 56)\n Math.round(headerHeight) <= ANDROID_DEFAULT_HEADER_HEIGHT\n ) {\n // FIXME: On Android, events may get delivered out-of-order\n // https://github.com/facebook/react-native/issues/54636\n // We seem to get header height without status bar height first,\n // and then the correct height with status bar height included\n // But due to out-of-order delivery, we may get the correct height first\n // and then the one without status bar height\n // This is hack to include status bar height if it's not already included\n // It only works because header height doesn't change dynamically on Android\n setHeaderHeight(headerHeight + insets.top);\n } else {\n setHeaderHeight(headerHeight);\n }\n }\n }\n },\n }\n );\n\n return (\n <NavigationProvider route={route} navigation={navigation}>\n <ScreenStackItem\n screenId={route.key}\n activityState={isPreloaded ? 0 : 2}\n style={StyleSheet.absoluteFill}\n aria-hidden={!focused}\n customAnimationOnSwipe={animationMatchesGesture}\n fullScreenSwipeEnabled={fullScreenGestureEnabled}\n fullScreenSwipeShadowEnabled={fullScreenGestureShadowEnabled}\n freezeOnBlur={freezeOnBlur}\n gestureEnabled={\n Platform.OS === 'android'\n ? // This prop enables handling of system back gestures on Android\n // Since we handle them in JS side, we disable this\n false\n : gestureEnabled\n }\n homeIndicatorHidden={autoHideHomeIndicator}\n hideKeyboardOnSwipe={keyboardHandlingEnabled}\n navigationBarColor={navigationBarColor}\n navigationBarTranslucent={navigationBarTranslucent}\n navigationBarHidden={navigationBarHidden}\n replaceAnimation={animationTypeForReplace}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n stackAnimation={animation}\n screenOrientation={orientation}\n sheetAllowedDetents={sheetAllowedDetents}\n sheetLargestUndimmedDetentIndex={sheetLargestUndimmedDetentIndex}\n sheetGrabberVisible={sheetGrabberVisible}\n sheetInitialDetentIndex={sheetInitialDetentIndex}\n sheetCornerRadius={sheetCornerRadius}\n sheetElevation={sheetElevation}\n sheetExpandsWhenScrolledToEdge={sheetExpandsWhenScrolledToEdge}\n sheetShouldOverflowTopInset={sheetShouldOverflowTopInset}\n sheetDefaultResizeAnimationEnabled={sheetResizeAnimationEnabled}\n statusBarAnimation={statusBarAnimation}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n statusBarColor={statusBarBackgroundColor}\n statusBarTranslucent={statusBarTranslucent}\n swipeDirection={gestureDirectionOverride}\n transitionDuration={animationDuration}\n onWillAppear={onWillAppear}\n onWillDisappear={onWillDisappear}\n onAppear={onAppear}\n onDisappear={onDisappear}\n onDismissed={onDismissed}\n onGestureCancel={onGestureCancel}\n onSheetDetentChanged={onSheetDetentChanged}\n gestureResponseDistance={gestureResponseDistance}\n nativeBackButtonDismissalEnabled={false} // on Android\n onHeaderBackButtonClicked={onHeaderBackButtonClicked}\n preventNativeDismiss={isRemovePrevented} // on iOS\n scrollEdgeEffects={{\n bottom: scrollEdgeEffects?.bottom ?? 'automatic',\n top: scrollEdgeEffects?.top ?? 'automatic',\n left: scrollEdgeEffects?.left ?? 'automatic',\n right: scrollEdgeEffects?.right ?? 'automatic',\n }}\n onNativeDismissCancelled={onNativeDismissCancelled}\n onHeaderHeightChange={onHeaderHeightChange}\n contentStyle={[\n presentation !== 'transparentModal' &&\n presentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n headerConfig={headerConfig}\n unstable_sheetFooter={unstable_sheetFooter}\n // When ts-expect-error is added, it affects all the props below it\n // So we keep any props that need it at the end\n // Otherwise invalid props may not be caught by TypeScript\n shouldFreeze={shouldFreeze}>\n <AnimatedHeaderHeightContext.Provider value={animatedHeaderHeight}>\n <HeaderHeightContext.Provider\n value={headerShown !== false ? headerHeight : (parentHeaderHeight ?? 0)}>\n {headerBackground != null ? (\n /**\n * To show a custom header background, we render it at the top of the screen below the header\n * The header also needs to be positioned absolutely (with `translucent` style)\n */\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}>\n {headerBackground()}\n </View>\n ) : null}\n {header != null && headerShown !== false ? (\n <View\n onLayout={(e) => {\n const headerHeight = e.nativeEvent.layout.height;\n\n setHeaderHeight(headerHeight);\n rawAnimatedHeaderHeight.setValue(headerHeight);\n }}\n style={[styles.header, headerTransparent ? styles.absolute : null]}>\n {header({\n back: headerBack,\n options,\n route,\n navigation,\n })}\n </View>\n ) : null}\n <HeaderShownContext.Provider value={isParentHeaderShown || headerShown !== false}>\n <HeaderBackContext.Provider value={headerBack}>{render()}</HeaderBackContext.Provider>\n </HeaderShownContext.Provider>\n </HeaderHeightContext.Provider>\n </AnimatedHeaderHeightContext.Provider>\n </ScreenStackItem>\n </NavigationProvider>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n describe: (route: RouteProp<ParamListBase>, placeholder: boolean) => NativeStackDescriptor;\n};\n\nexport function NativeStackView({ state, navigation, descriptors, describe }: Props) {\n const { setNextDismissedKey } = useDismissedRouteError(state);\n\n useInvalidPreventRemoveError(descriptors);\n\n const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);\n\n const preloadedDescriptors = state.preloadedRoutes.reduce<NativeStackDescriptorMap>(\n (acc, route) => {\n acc[route.key] = acc[route.key] || describe(route, true);\n return acc;\n },\n {}\n );\n\n return (\n <SafeAreaProviderCompat>\n <ScreenStack style={styles.container}>\n {state.routes.concat(state.preloadedRoutes).map((route, index) => {\n const descriptor = (descriptors[route.key] ?? preloadedDescriptors[route.key])!;\n const isFocused = state.index === index;\n const isBelowFocused = state.index - 1 === index;\n const previousKey = state.routes[index - 1]?.key;\n const nextKey = state.routes[index + 1]?.key;\n const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;\n const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n\n const isModal = modalRouteKeys.includes(route.key);\n const isModalOnIos = isModal && Platform.OS === 'ios';\n\n const isPreloaded =\n preloadedDescriptors[route.key] !== undefined && descriptors[route.key] === undefined;\n\n // On Fabric, when screen is frozen, animated and reanimated values are not updated\n // due to component being unmounted. To avoid this, we don't freeze the previous screen there\n const shouldFreeze = isFabric()\n ? !isPreloaded && !isFocused && !isBelowFocused && !isModalOnIos\n : !isPreloaded && !isFocused && !isModalOnIos;\n\n return (\n <SceneView\n key={route.key}\n index={index}\n focused={isFocused}\n shouldFreeze={shouldFreeze}\n descriptor={descriptor}\n previousDescriptor={previousDescriptor}\n nextDescriptor={nextDescriptor}\n isPresentationModal={isModal}\n isPreloaded={isPreloaded}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onWillAppear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: false },\n target: route.key,\n });\n }}\n onAppear={() => {\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={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n\n setNextDismissedKey(route.key);\n }}\n onHeaderBackButtonClicked={() => {\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: state.key,\n });\n }}\n onNativeDismissCancelled={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n }}\n onGestureCancel={() => {\n navigation.emit({\n type: 'gestureCancel',\n target: route.key,\n });\n }}\n onSheetDetentChanged={(event) => {\n navigation.emit({\n type: 'sheetDetentChange',\n target: route.key,\n data: {\n index: event.nativeEvent.index,\n stable: event.nativeEvent.isStable,\n },\n });\n }}\n />\n );\n })}\n </ScreenStack>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n zIndex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n translucent: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n zIndex: 1,\n elevation: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"NativeStackView.native.js","sourceRoot":"","sources":["../../../../src/react-navigation/native-stack/views/NativeStackView.native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0cb,0CA8HC;;AAvkBD,6CAA+B;AAC/B,iCAA4B;AAC5B,+CAAiG;AACjG,mFAAmE;AACnE,+DAK8B;AAE9B,6CAQwB;AAMxB,iEAA8D;AAC9D,yCAQsB;AACtB,gDAA6C;AAC7C,oEAAgE;AAChE,8EAA+E;AAC/E,4EAAyE;AACzE,wFAAqF;AAErF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEzC,SAAS,QAAQ;IACf,OAAO,uBAAuB,IAAI,MAAM,CAAC;AAC3C,CA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,MAAM,EAAE,CAAC;KACV;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACP;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;KACb;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { use } from 'react';\nimport { Animated, Platform, StatusBar, StyleSheet, useAnimatedValue, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport {\n compatibilityFlags,\n type ScreenProps,\n ScreenStack,\n ScreenStackItem,\n} from 'react-native-screens';\n\nimport {\n getDefaultHeaderHeight,\n getHeaderTitle,\n HeaderBackContext,\n HeaderHeightContext,\n HeaderShownContext,\n SafeAreaProviderCompat,\n useFrameSize,\n} from '../../elements';\nimport type {\n NativeStackDescriptor,\n NativeStackDescriptorMap,\n NativeStackNavigationHelpers,\n} from '../types';\nimport { useHeaderConfigProps } from './useHeaderConfigProps';\nimport {\n NavigationProvider,\n type ParamListBase,\n type RouteProp,\n StackActions,\n type StackNavigationState,\n usePreventRemoveContext,\n useTheme,\n} from '../../native';\nimport { debounce } from '../utils/debounce';\nimport { getModalRouteKeys } from '../utils/getModalRoutesKeys';\nimport { AnimatedHeaderHeightContext } from '../utils/useAnimatedHeaderHeight';\nimport { useDismissedRouteError } from '../utils/useDismissedRouteError';\nimport { useInvalidPreventRemoveError } from '../utils/useInvalidPreventRemoveError';\n\nconst ANDROID_DEFAULT_HEADER_HEIGHT = 56;\n\nfunction isFabric() {\n return 'nativeFabricUIManager' in global;\n}\n\ntype SceneViewProps = {\n index: number;\n focused: boolean;\n shouldFreeze: boolean;\n descriptor: NativeStackDescriptor;\n previousDescriptor?: NativeStackDescriptor;\n nextDescriptor?: NativeStackDescriptor;\n isPresentationModal?: boolean;\n isPreloaded?: boolean;\n onWillDisappear: () => void;\n onWillAppear: () => void;\n onAppear: () => void;\n onDisappear: () => void;\n onDismissed: ScreenProps['onDismissed'];\n onHeaderBackButtonClicked: ScreenProps['onHeaderBackButtonClicked'];\n onNativeDismissCancelled: ScreenProps['onDismissed'];\n onGestureCancel: ScreenProps['onGestureCancel'];\n onSheetDetentChanged: ScreenProps['onSheetDetentChanged'];\n};\n\nconst useNativeDriver = Platform.OS !== 'web';\n\nconst SceneView = ({\n index,\n focused,\n shouldFreeze,\n descriptor,\n previousDescriptor,\n nextDescriptor,\n isPresentationModal,\n isPreloaded,\n onWillDisappear,\n onWillAppear,\n onAppear,\n onDisappear,\n onDismissed,\n onHeaderBackButtonClicked,\n onNativeDismissCancelled,\n onGestureCancel,\n onSheetDetentChanged,\n}: SceneViewProps) => {\n const { route, navigation, options, render } = descriptor;\n\n let {\n animation,\n animationMatchesGesture,\n presentation = isPresentationModal ? 'modal' : 'card',\n fullScreenGestureEnabled,\n } = options;\n\n const {\n animationDuration,\n animationTypeForReplace = 'push',\n fullScreenGestureShadowEnabled = true,\n gestureEnabled,\n gestureDirection = presentation === 'card' ? 'horizontal' : 'vertical',\n gestureResponseDistance,\n header,\n headerBackButtonMenuEnabled,\n headerShown,\n headerBackground,\n headerTransparent,\n autoHideHomeIndicator,\n keyboardHandlingEnabled,\n navigationBarColor,\n navigationBarTranslucent,\n navigationBarHidden,\n orientation,\n sheetAllowedDetents = [1.0],\n sheetLargestUndimmedDetentIndex = -1,\n sheetGrabberVisible = false,\n sheetCornerRadius = -1.0,\n sheetElevation = 24,\n sheetExpandsWhenScrolledToEdge = true,\n sheetInitialDetentIndex = 0,\n sheetShouldOverflowTopInset = false,\n sheetResizeAnimationEnabled = true,\n statusBarAnimation,\n statusBarHidden,\n statusBarStyle,\n statusBarTranslucent,\n statusBarBackgroundColor,\n unstable_sheetFooter,\n scrollEdgeEffects,\n freezeOnBlur,\n contentStyle,\n } = options;\n\n if (gestureDirection === 'vertical' && Platform.OS === 'ios') {\n // for `vertical` direction to work, we need to set `fullScreenGestureEnabled` to `true`\n // so the screen can be dismissed from any point on screen.\n // `animationMatchesGesture` needs to be set to `true` so the `animation` 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 (fullScreenGestureEnabled === undefined) {\n fullScreenGestureEnabled = true;\n }\n\n if (animationMatchesGesture === undefined) {\n animationMatchesGesture = true;\n }\n\n if (animation === undefined) {\n animation = 'slide_from_bottom';\n }\n }\n\n // workaround for rn-screens where gestureDirection has to be set on both\n // current and previous screen - software-mansion/react-native-screens/pull/1509\n const nextGestureDirection = nextDescriptor?.options.gestureDirection;\n const gestureDirectionOverride =\n nextGestureDirection != null ? nextGestureDirection : gestureDirection;\n\n if (index === 0) {\n // first screen should always be treated as `card`, it resolves problems with no header animation\n // for navigator with first screen as `modal` and the next as `card`\n presentation = 'card';\n }\n\n const { colors } = useTheme();\n const insets = useSafeAreaInsets();\n\n // `modal`, `formSheet` and `pageSheet` presentations do not take whole screen, so should not take the inset.\n const isModal =\n presentation === 'modal' || presentation === 'formSheet' || presentation === 'pageSheet';\n\n // Modals are fullscreen in landscape only on iPhone\n const isIPhone = Platform.OS === 'ios' && !(Platform.isPad || Platform.isTV);\n\n const isParentHeaderShown = use(HeaderShownContext);\n const parentHeaderHeight = use(HeaderHeightContext);\n const parentHeaderBack = use(HeaderBackContext);\n\n const isLandscape = useFrameSize((frame) => frame.width > frame.height);\n\n const topInset =\n isParentHeaderShown || (Platform.OS === 'ios' && isModal) || (isIPhone && isLandscape)\n ? 0\n : insets.top;\n\n const defaultHeaderHeight = useFrameSize((frame) =>\n Platform.select({\n // FIXME: Currently screens isn't using Material 3\n // So our `getDefaultHeaderHeight` doesn't return the correct value\n // So we hardcode the value here for now until screens is updated\n android: ANDROID_DEFAULT_HEADER_HEIGHT + topInset,\n default: getDefaultHeaderHeight(frame, isModal, topInset),\n })\n );\n\n const { preventedRoutes } = usePreventRemoveContext();\n\n const [headerHeight, setHeaderHeight] = React.useState(defaultHeaderHeight);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const setHeaderHeightDebounced = React.useCallback(\n // Debounce the header height updates to avoid excessive re-renders\n debounce(setHeaderHeight, 100),\n []\n );\n\n const hasCustomHeader = header != null;\n\n const usesNewAndroidHeaderHeightImplementation =\n 'usesNewAndroidHeaderHeightImplementation' in compatibilityFlags &&\n compatibilityFlags['usesNewAndroidHeaderHeightImplementation'] === true;\n\n let headerHeightCorrectionOffset = 0;\n\n if (Platform.OS === 'android' && !hasCustomHeader && !usesNewAndroidHeaderHeightImplementation) {\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n\n // On Android, the native header height is not correctly calculated\n // It includes status bar height even if statusbar is not translucent\n // And the statusbar value itself doesn't match the actual status bar height\n // So we subtract the bogus status bar height and add the actual top inset\n headerHeightCorrectionOffset = -statusBarHeight + topInset;\n }\n\n const rawAnimatedHeaderHeight = useAnimatedValue(defaultHeaderHeight);\n const animatedHeaderHeight = React.useMemo(\n () => Animated.add<number>(rawAnimatedHeaderHeight, headerHeightCorrectionOffset),\n [headerHeightCorrectionOffset, rawAnimatedHeaderHeight]\n );\n\n // During the very first render topInset is > 0 when running\n // in non edge-to-edge mode on Android, while on every consecutive render\n // topInset === 0, causing header content to jump, as we add padding on the first frame,\n // just to remove it in next one. To prevent this, when statusBarTranslucent is set,\n // we apply additional padding in header only if its true.\n // For more details see: https://github.com/react-navigation/react-navigation/pull/12014\n const headerTopInsetEnabled =\n typeof statusBarTranslucent === 'boolean' ? statusBarTranslucent : topInset !== 0;\n\n const canGoBack = previousDescriptor != null || parentHeaderBack != null;\n const backTitle = previousDescriptor\n ? getHeaderTitle(previousDescriptor.options, previousDescriptor.route.name)\n : parentHeaderBack?.title;\n\n const headerBack = React.useMemo(() => {\n if (canGoBack) {\n return {\n href: undefined, // No href needed for native\n title: backTitle,\n };\n }\n\n return undefined;\n }, [canGoBack, backTitle]);\n\n const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;\n\n const headerConfig = useHeaderConfigProps({\n ...options,\n route,\n headerBackButtonMenuEnabled:\n isRemovePrevented !== undefined ? !isRemovePrevented : headerBackButtonMenuEnabled,\n headerBackTitle: options.headerBackTitle !== undefined ? options.headerBackTitle : undefined,\n headerHeight,\n headerShown: header !== undefined ? false : headerShown,\n headerTopInsetEnabled,\n headerTransparent,\n headerBack,\n });\n\n const onHeaderHeightChange = hasCustomHeader\n ? // If we have a custom header, don't use native header height\n undefined\n : // On Fabric, there's a bug where native event drivers for Animated objects\n // are created after the first notifications about the header height\n // from the native side, `onHeaderHeightChange` event does not notify\n // `animatedHeaderHeight` about initial values on appearing screens at the moment.\n Animated.event(\n [\n {\n nativeEvent: {\n headerHeight: rawAnimatedHeaderHeight,\n },\n },\n ],\n {\n useNativeDriver,\n listener: (e) => {\n if (\n e.nativeEvent &&\n typeof e.nativeEvent === 'object' &&\n 'headerHeight' in e.nativeEvent &&\n typeof e.nativeEvent.headerHeight === 'number'\n ) {\n const headerHeight = e.nativeEvent.headerHeight;\n\n // Only debounce if header has large title or search bar\n // As it's the only case where the header height can change frequently\n const doesHeaderAnimate =\n Platform.OS === 'ios' &&\n (options.headerLargeTitleEnabled || options.headerSearchBarOptions);\n\n if (doesHeaderAnimate) {\n setHeaderHeightDebounced(headerHeight);\n } else {\n if (\n Platform.OS === 'android' &&\n headerHeight !== 0 &&\n // On some devices, height maybe slightly off (e.g. 56.17 instead of 56)\n Math.round(headerHeight) <= ANDROID_DEFAULT_HEADER_HEIGHT\n ) {\n // FIXME: On Android, events may get delivered out-of-order\n // https://github.com/facebook/react-native/issues/54636\n // We seem to get header height without status bar height first,\n // and then the correct height with status bar height included\n // But due to out-of-order delivery, we may get the correct height first\n // and then the one without status bar height\n // This is hack to include status bar height if it's not already included\n // It only works because header height doesn't change dynamically on Android\n setHeaderHeight(headerHeight + insets.top);\n } else {\n setHeaderHeight(headerHeight);\n }\n }\n }\n },\n }\n );\n\n return (\n <NavigationProvider route={route} navigation={navigation}>\n <ScreenStackItem\n screenId={route.key}\n activityState={isPreloaded ? 0 : 2}\n style={StyleSheet.absoluteFill}\n aria-hidden={!focused}\n customAnimationOnSwipe={animationMatchesGesture}\n fullScreenSwipeEnabled={fullScreenGestureEnabled}\n fullScreenSwipeShadowEnabled={fullScreenGestureShadowEnabled}\n freezeOnBlur={freezeOnBlur}\n gestureEnabled={\n Platform.OS === 'android'\n ? // This prop enables handling of system back gestures on Android\n // Since we handle them in JS side, we disable this\n false\n : gestureEnabled\n }\n homeIndicatorHidden={autoHideHomeIndicator}\n hideKeyboardOnSwipe={keyboardHandlingEnabled}\n navigationBarColor={navigationBarColor}\n navigationBarTranslucent={navigationBarTranslucent}\n navigationBarHidden={navigationBarHidden}\n replaceAnimation={animationTypeForReplace}\n stackPresentation={presentation === 'card' ? 'push' : presentation}\n stackAnimation={animation}\n screenOrientation={orientation}\n sheetAllowedDetents={sheetAllowedDetents}\n sheetLargestUndimmedDetentIndex={sheetLargestUndimmedDetentIndex}\n sheetGrabberVisible={sheetGrabberVisible}\n sheetInitialDetentIndex={sheetInitialDetentIndex}\n sheetCornerRadius={sheetCornerRadius}\n sheetElevation={sheetElevation}\n sheetExpandsWhenScrolledToEdge={sheetExpandsWhenScrolledToEdge}\n sheetShouldOverflowTopInset={sheetShouldOverflowTopInset}\n sheetDefaultResizeAnimationEnabled={sheetResizeAnimationEnabled}\n statusBarAnimation={statusBarAnimation}\n statusBarHidden={statusBarHidden}\n statusBarStyle={statusBarStyle}\n statusBarColor={statusBarBackgroundColor}\n statusBarTranslucent={statusBarTranslucent}\n swipeDirection={gestureDirectionOverride}\n transitionDuration={animationDuration}\n onWillAppear={onWillAppear}\n onWillDisappear={onWillDisappear}\n onAppear={onAppear}\n onDisappear={onDisappear}\n onDismissed={onDismissed}\n onGestureCancel={onGestureCancel}\n onSheetDetentChanged={onSheetDetentChanged}\n gestureResponseDistance={gestureResponseDistance}\n nativeBackButtonDismissalEnabled={false} // on Android\n onHeaderBackButtonClicked={onHeaderBackButtonClicked}\n preventNativeDismiss={isRemovePrevented} // on iOS\n scrollEdgeEffects={{\n bottom: scrollEdgeEffects?.bottom ?? 'automatic',\n top: scrollEdgeEffects?.top ?? 'automatic',\n left: scrollEdgeEffects?.left ?? 'automatic',\n right: scrollEdgeEffects?.right ?? 'automatic',\n }}\n onNativeDismissCancelled={onNativeDismissCancelled}\n onHeaderHeightChange={onHeaderHeightChange}\n contentStyle={[\n presentation !== 'transparentModal' &&\n presentation !== 'containedTransparentModal' && {\n backgroundColor: colors.background,\n },\n contentStyle,\n ]}\n headerConfig={headerConfig}\n unstable_sheetFooter={unstable_sheetFooter}\n // When ts-expect-error is added, it affects all the props below it\n // So we keep any props that need it at the end\n // Otherwise invalid props may not be caught by TypeScript\n shouldFreeze={shouldFreeze}>\n <AnimatedHeaderHeightContext.Provider value={animatedHeaderHeight}>\n <HeaderHeightContext.Provider\n value={headerShown !== false ? headerHeight : (parentHeaderHeight ?? 0)}>\n {headerBackground != null ? (\n /**\n * To show a custom header background, we render it at the top of the screen below the header\n * The header also needs to be positioned absolutely (with `translucent` style)\n */\n <View\n style={[\n styles.background,\n headerTransparent ? styles.translucent : null,\n { height: headerHeight },\n ]}>\n {headerBackground()}\n </View>\n ) : null}\n {header != null && headerShown !== false ? (\n <View\n onLayout={(e) => {\n const headerHeight = e.nativeEvent.layout.height;\n\n setHeaderHeight(headerHeight);\n rawAnimatedHeaderHeight.setValue(headerHeight);\n }}\n style={[styles.header, headerTransparent ? styles.absolute : null]}>\n {header({\n back: headerBack,\n options,\n route,\n navigation,\n })}\n </View>\n ) : null}\n <HeaderShownContext.Provider value={isParentHeaderShown || headerShown !== false}>\n <HeaderBackContext.Provider value={headerBack}>{render()}</HeaderBackContext.Provider>\n </HeaderShownContext.Provider>\n </HeaderHeightContext.Provider>\n </AnimatedHeaderHeightContext.Provider>\n </ScreenStackItem>\n </NavigationProvider>\n );\n};\n\ntype Props = {\n state: StackNavigationState<ParamListBase>;\n navigation: NativeStackNavigationHelpers;\n descriptors: NativeStackDescriptorMap;\n describe: (route: RouteProp<ParamListBase>, placeholder: boolean) => NativeStackDescriptor;\n};\n\nexport function NativeStackView({ state, navigation, descriptors, describe }: Props) {\n const { colors } = useTheme();\n const { setNextDismissedKey } = useDismissedRouteError(state);\n\n useInvalidPreventRemoveError(descriptors);\n\n const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);\n\n const preloadedDescriptors = state.preloadedRoutes.reduce<NativeStackDescriptorMap>(\n (acc, route) => {\n acc[route.key] = acc[route.key] || describe(route, true);\n return acc;\n },\n {}\n );\n\n return (\n <SafeAreaProviderCompat>\n <ScreenStack\n nativeContainerStyle={{ backgroundColor: colors.background }}\n style={styles.container}>\n {state.routes.concat(state.preloadedRoutes).map((route, index) => {\n const descriptor = (descriptors[route.key] ?? preloadedDescriptors[route.key])!;\n const isFocused = state.index === index;\n const isBelowFocused = state.index - 1 === index;\n const previousKey = state.routes[index - 1]?.key;\n const nextKey = state.routes[index + 1]?.key;\n const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;\n const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n\n const isModal = modalRouteKeys.includes(route.key);\n const isModalOnIos = isModal && Platform.OS === 'ios';\n\n const isPreloaded =\n preloadedDescriptors[route.key] !== undefined && descriptors[route.key] === undefined;\n\n // On Fabric, when screen is frozen, animated and reanimated values are not updated\n // due to component being unmounted. To avoid this, we don't freeze the previous screen there\n const shouldFreeze = isFabric()\n ? !isPreloaded && !isFocused && !isBelowFocused && !isModalOnIos\n : !isPreloaded && !isFocused && !isModalOnIos;\n\n return (\n <SceneView\n key={route.key}\n index={index}\n focused={isFocused}\n shouldFreeze={shouldFreeze}\n descriptor={descriptor}\n previousDescriptor={previousDescriptor}\n nextDescriptor={nextDescriptor}\n isPresentationModal={isModal}\n isPreloaded={isPreloaded}\n onWillDisappear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: true },\n target: route.key,\n });\n }}\n onWillAppear={() => {\n navigation.emit({\n type: 'transitionStart',\n data: { closing: false },\n target: route.key,\n });\n }}\n onAppear={() => {\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={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n\n setNextDismissedKey(route.key);\n }}\n onHeaderBackButtonClicked={() => {\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: state.key,\n });\n }}\n onNativeDismissCancelled={(event) => {\n navigation.dispatch({\n ...StackActions.pop(event.nativeEvent.dismissCount),\n source: route.key,\n target: state.key,\n });\n }}\n onGestureCancel={() => {\n navigation.emit({\n type: 'gestureCancel',\n target: route.key,\n });\n }}\n onSheetDetentChanged={(event) => {\n navigation.emit({\n type: 'sheetDetentChange',\n target: route.key,\n data: {\n index: event.nativeEvent.index,\n stable: event.nativeEvent.isStable,\n },\n });\n }}\n />\n );\n })}\n </ScreenStack>\n </SafeAreaProviderCompat>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n zIndex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n },\n translucent: {\n position: 'absolute',\n top: 0,\n start: 0,\n end: 0,\n zIndex: 1,\n elevation: 1,\n },\n background: {\n overflow: 'hidden',\n },\n});\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
import type { IntegrateWithRouterOptions,
|
|
2
|
+
import type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigator, StandardNavigatorEventMapBase, StandardRouterNavigatorProps } from './types';
|
|
3
3
|
import { type DefaultRouterOptions, type EventMapBase, type NavigationAction, type NavigationState, type RouterFactory } from '../react-navigation/native';
|
|
4
|
-
export type { IntegrateWithRouterOptions, StandardUseNavigationBuilderOptions } from './types';
|
|
4
|
+
export type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigatorEventMapBase, StandardUseNavigationBuilderOptions, } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* > **warning** This API is unstable and may change between minor releases.
|
|
7
7
|
*
|
|
@@ -21,7 +21,7 @@ export type { IntegrateWithRouterOptions, StandardUseNavigationBuilderOptions }
|
|
|
21
21
|
* export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(NavigatorContent: ComponentType<
|
|
24
|
+
export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(NavigatorContent: ComponentType<NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>>, router: RouterFactory<State, NavigationAction, RouterOptions>, options?: IntegrateWithRouterOptions<State, NavigatorProps>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("..").PickPartial<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
|
|
25
25
|
Screen: (props: import("..").ScreenProps<NavigatorOptions, State, EventMap & EventMapBase>) => null;
|
|
26
26
|
Protected: typeof import("../views/Protected").Protected;
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,OAAO,C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QACR,gBAAgB;QAChB,MAAM;QACN,YAAY;QACZ,eAAe;QACf,aAAa;QACb,iCAAiC;QACjC,eAAe;KAChB,CAAC;IACF,OAAO;QACL,UAAU;QACV,uFAAuF;QACvF,yFAAyF;QACzF,yBAAyB,EAAE;YACzB,GAAG,UAAU;YACb,GAAG,yBAAyB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAkB;IAGjD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n StandardNavigator,\n StandardNavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type { IntegrateWithRouterOptions, StandardUseNavigationBuilderOptions } from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n NavigatorContent: ComponentType<\n StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n const navigator = createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>(\n NavigatorContent\n );\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(navigator, router, options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<NavigatorProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n {...derivedProps}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAyDb,wFAuBC;AAsBD,oEA2EC;;AA/KD,iCAAoD;AACpD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EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigator,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n NavigatorContent: ComponentType<\n NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n const navigator = createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>(\n NavigatorContent\n );\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(navigator, router, options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<NavigatorProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n {...derivedProps}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
|
|
@@ -31,12 +31,48 @@ export interface IntegrateWithRouterOptions<State extends NavigationState = Navi
|
|
|
31
31
|
* ```tsx
|
|
32
32
|
* createProps: ({ state, dispatch }) => ({
|
|
33
33
|
* activeRouteKey: state.routes[state.index].key,
|
|
34
|
-
*
|
|
34
|
+
* preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),
|
|
35
35
|
* })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
createProps?: (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => Partial<NavigatorProps>;
|
|
39
39
|
}
|
|
40
40
|
export type StandardNavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = NavigatorArgs<NavigatorOptions, EventMap> & Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;
|
|
41
|
+
/**
|
|
42
|
+
* Lets TypeScript infer `EventMap` and `NavigatorProps` from a `NavigatorContent` component.
|
|
43
|
+
*
|
|
44
|
+
* On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,
|
|
45
|
+
* and `NavigatorProps` only inside `Omit<NavigatorProps, …>` — neither is a position TypeScript can
|
|
46
|
+
* read a type back out of. Without these two properties it gives up and falls back to the base
|
|
47
|
+
* shapes, rejecting components that declare specific events or extra props.
|
|
48
|
+
*
|
|
49
|
+
* The properties are phantom: they never exist at runtime and are never read. They exist only to
|
|
50
|
+
* put each type somewhere TypeScript will infer it from.
|
|
51
|
+
*/
|
|
52
|
+
type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = {
|
|
53
|
+
/** @internal */
|
|
54
|
+
readonly __eventMap__?: EventMap;
|
|
55
|
+
/** @internal */
|
|
56
|
+
readonly __navigatorProps__?: NavigatorProps;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Props for a standard navigator's `NavigatorContent` component. Annotate your content component
|
|
60
|
+
* with this type to declare the events it emits, so `unstable_createStandardRouterNavigator` can
|
|
61
|
+
* type `emitter.emit` for you.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* // No events:
|
|
66
|
+
* type TabsContentProps = NavigatorContentProps<{ title?: string }>;
|
|
67
|
+
*
|
|
68
|
+
* // Typed events:
|
|
69
|
+
* type TabsContentProps = NavigatorContentProps<
|
|
70
|
+
* { title?: string },
|
|
71
|
+
* { tabPress: { data: undefined; canPreventDefault: true } }
|
|
72
|
+
* >;
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export type NavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase = Record<string, never>, NavigatorProps extends object = object> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps> & NavigatorContentInferenceCarrier<EventMap, NavigatorProps>;
|
|
41
76
|
export type StandardRouterNavigatorProps<State extends NavigationState, NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> & NavigatorProps & RouterOptions;
|
|
77
|
+
export {};
|
|
42
78
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE9F,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD,MAAM,EACN;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,CACzD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE,MAAM,MAAM,iBAAiB,CAC3B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,EAC9C,cAAc,SAAS,MAAM,IAC3B,UAAU,CAAC,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AAE3F,MAAM,MAAM,mCAAmC,CAC7C,KAAK,SAAS,eAAe,EAC7B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,IAC5C,uBAAuB,CACzB,aAAa,EACb,MAAM,GAAG,SAAS,EACl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type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\nexport interface IntegrateWithRouterOptions<\n State extends NavigationState = NavigationState,\n NavigatorProps extends object = object,\n> {\n /**\n * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;\n * routes discovered from the filesystem that were not declared are ignored.\n */\n useOnlyUserDefinedScreens?: boolean;\n\n /**\n * Allows router-specific information to be exposed via navigator props alongside the standard\n * `state` and `actions`.\n *\n * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small\n * breaking changes between releases, so prefer the `state` and `actions` passed to\n * `NavigatorContent` when they suffice.\n *\n * @example\n * ```tsx\n * createProps: ({ state, dispatch }) => ({\n * activeRouteKey: state.routes[state.index].key,\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\nexport interface IntegrateWithRouterOptions<\n State extends NavigationState = NavigationState,\n NavigatorProps extends object = object,\n> {\n /**\n * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;\n * routes discovered from the filesystem that were not declared are ignored.\n */\n useOnlyUserDefinedScreens?: boolean;\n\n /**\n * Allows router-specific information to be exposed via navigator props alongside the standard\n * `state` and `actions`.\n *\n * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small\n * breaking changes between releases, so prefer the `state` and `actions` passed to\n * `NavigatorContent` when they suffice.\n *\n * @example\n * ```tsx\n * createProps: ({ state, dispatch }) => ({\n * activeRouteKey: state.routes[state.index].key,\n * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),\n * })\n * ```\n */\n createProps?: (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => Partial<NavigatorProps>;\n}\n\nexport type StandardNavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = NavigatorArgs<NavigatorOptions, EventMap> &\n Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;\n\n/**\n * Lets TypeScript infer `EventMap` and `NavigatorProps` from a `NavigatorContent` component.\n *\n * On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,\n * and `NavigatorProps` only inside `Omit<NavigatorProps, …>` — neither is a position TypeScript can\n * read a type back out of. Without these two properties it gives up and falls back to the base\n * shapes, rejecting components that declare specific events or extra props.\n *\n * The properties are phantom: they never exist at runtime and are never read. They exist only to\n * put each type somewhere TypeScript will infer it from.\n */\ntype NavigatorContentInferenceCarrier<\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = {\n /** @internal */\n readonly __eventMap__?: EventMap;\n /** @internal */\n readonly __navigatorProps__?: NavigatorProps;\n};\n\n/**\n * Props for a standard navigator's `NavigatorContent` component. Annotate your content component\n * with this type to declare the events it emits, so `unstable_createStandardRouterNavigator` can\n * type `emitter.emit` for you.\n *\n * @example\n * ```tsx\n * // No events:\n * type TabsContentProps = NavigatorContentProps<{ title?: string }>;\n *\n * // Typed events:\n * type TabsContentProps = NavigatorContentProps<\n * { title?: string },\n * { tabPress: { data: undefined; canPreventDefault: true } }\n * >;\n * ```\n */\nexport type NavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase = Record<string, never>,\n NavigatorProps extends object = object,\n> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps> &\n NavigatorContentInferenceCarrier<EventMap, NavigatorProps>;\n\nexport type StandardRouterNavigatorProps<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> &\n NavigatorProps &\n RouterOptions;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAClB,OAAO,SAAS,CAAC;AAIjB,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,eAAe,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtF,QAAA,MAAM,gBAAgB,gDAclB,CAAC;AAEL,mBAAmB,+BAA+B,CAAC;AAGnD,MAAM,CAAC,OAAO,CAAC,MACb,GAAG,8BACH,OAAO,0DACP,SAAS,4DACT,OAAO,0DACP,yBAAyB,4EACzB,MAAM,yDACN,SAAS,4DACT,eAAe,kEACf,yBAAyB,4EACzB,cAAc,4EACd,oBAAoB,uEACpB,UAAU,2DAEc,CAAC;AAE3B,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,EAAE,OAAO,gBAAgB,CAAC,MAAM,CAAC;AAS1D,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAChF,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvC,CAAC;AAEF,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,GAAG;IACzD,WAAW,IAAI,MAAM,CAAC;IACtB,qBAAqB,IAAI,MAAM,CAAC;IAChC,WAAW,IAAI,MAAM,EAAE,CAAC;IACx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,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,GAAG;IACzD,WAAW,IAAI,MAAM,CAAC;IACtB,qBAAqB,IAAI,MAAM,CAAC;IAChC,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACrD,cAAc,IAAI,oBAAoB,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF,wBAAgB,YAAY,CAC1B,OAAO,GAAE,iBAA2B,EACpC,EAAE,UAAgB,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAE,mBAAwB,GAClE,MAAM,CA0CR;AAED,eAAO,MAAM,UAAU;IACrB,yDAAyD;mBAC1C,MAAM;IAIrB,yDAAyD;eAC9C,MAAM;IAIjB,6DAA6D;kBAC/C,MAAM;IAIpB,oDAAoD;gBACxC,MAAM;IAOlB,qEAAqE;;IAIrE,wEAAwE;sBACtD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,MAAM;IAMvD,qEAAqE;;CAItE,CAAC"}
|
|
@@ -33,7 +33,15 @@ Object.defineProperty(exports, 'screen', {
|
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
function renderRouter(context = './app', { initialUrl = '/', linking, ...options } = {}) {
|
|
36
|
+
// See https://github.com/expo/expo/issues/46864 and https://github.com/expo/expo/pull/27648
|
|
37
|
+
const systemTime = Date.now();
|
|
36
38
|
jest.useFakeTimers();
|
|
39
|
+
try {
|
|
40
|
+
jest.setSystemTime(systemTime);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Legacy fake timers don't support `setSystemTime` (and don't mock the clock), so there's nothing to restore.
|
|
44
|
+
}
|
|
37
45
|
const mockContext = (0, mock_config_1.getMockContext)(context);
|
|
38
46
|
// Force the render to be synchronous
|
|
39
47
|
process.env.EXPO_ROUTER_IMPORT_MODE = 'sync';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":";;;AAuEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":";;;AAuEA,oCA6CC;;AApHD,oBAAkB;AAClB,mBAAiB;AAIjB,+CAAuE;AACvE,0CAAuC;AAGvC,+DAAqD;AACrD,sDAA2C;AAE3C,6CAAsF;AAArD,4GAAA,aAAa,OAAA;AAAE,6GAAA,cAAc,OAAA;AAE9D,MAAM,gBAAgB,GAAG,CAAC,GAAmD,EAAE;IAC7E,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACzD,MAAM,QAAQ,GAAG,IAAI,KAAK,CACxB,8IAA8I,CAC/I,CAAC;YACF,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC7B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;YACvB,MAAM,QAAQ,CAAC;QACjB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAuBL,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE;IACvC,GAAG;QACD,OAAO,gBAAgB,CAAC,MAAM,CAAC;IACjC,CAAC;CACF,CAAC,CAAC;AAeH,SAAgB,YAAY,CAC1B,UAA6B,OAAO,EACpC,EAAE,UAAU,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,KAA0B,EAAE;IAEnE,4FAA4F;IAC5F,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9B,IAAI,CAAC,aAAa,EA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-native';\n\nimport { type MockContextConfig, getMockContext } from './mock-config';\nimport { ExpoRoot } from '../ExpoRoot';\nimport type { ExpoLinkingOptions } from '../getLinkingConfig';\nimport type { ReactNavigationState } from '../global-state/router-store';\nimport { store } from '../global-state/router-store';\nimport { router } from '../imperative-api';\n\nexport { type MockContextConfig, getMockConfig, getMockContext } from './mock-config';\n\nconst rnTestingLibrary = ((): typeof import('@testing-library/react-native') => {\n try {\n return require('@testing-library/react-native');\n } catch (error: any) {\n if ('code' in error && error.code === 'MODULE_NOT_FOUND') {\n const newError = new Error(\n `[expo-router/testing-library] \"@testing-library/react-native\" failed to import. You need to install it to use expo-router's testing library.`\n );\n newError.stack = error.stack;\n newError.cause = error;\n throw newError;\n }\n throw error;\n }\n})();\n\nexport type * from '@testing-library/react-native';\n\n// TODO(@kitten): This is for backwards-compatibility. Consider removing this!\nexport declare const {\n act,\n cleanup,\n fireEvent,\n waitFor,\n waitForElementToBeRemoved,\n within,\n configure,\n resetToDefaults,\n isHiddenFromAccessibility,\n isInaccessible,\n getDefaultNormalizer,\n renderHook,\n // userEvent,\n}: typeof rnTestingLibrary;\n\nexport declare let screen: typeof rnTestingLibrary.screen;\n\nObject.assign(exports, rnTestingLibrary);\nObject.defineProperty(exports, 'screen', {\n get() {\n return rnTestingLibrary.screen;\n },\n});\n\nexport type RenderRouterOptions = Parameters<typeof rnTestingLibrary.render>[1] & {\n initialUrl?: any;\n linking?: Partial<ExpoLinkingOptions>;\n};\n\ntype Result = ReturnType<typeof rnTestingLibrary.render> & {\n getPathname(): string;\n getPathnameWithParams(): string;\n getSegments(): string[];\n getSearchParams(): Record<string, string | string[]>;\n getRouterState(): ReactNavigationState | undefined;\n};\n\nexport function renderRouter(\n context: MockContextConfig = './app',\n { initialUrl = '/', linking, ...options }: RenderRouterOptions = {}\n): Result {\n // See https://github.com/expo/expo/issues/46864 and https://github.com/expo/expo/pull/27648\n const systemTime = Date.now();\n jest.useFakeTimers();\n try {\n jest.setSystemTime(systemTime);\n } catch {\n // Legacy fake timers don't support `setSystemTime` (and don't mock the clock), so there's nothing to restore.\n }\n\n const mockContext = getMockContext(context);\n\n // Force the render to be synchronous\n process.env.EXPO_ROUTER_IMPORT_MODE = 'sync';\n\n const result = rnTestingLibrary.render(\n <ExpoRoot context={mockContext} location={initialUrl} linking={linking} />,\n options\n );\n\n /**\n * This is a hack to ensure that React Navigation's state updates are processed before we run assertions.\n * Some updates are async and we need to wait for them to complete, otherwise will we get a false positive.\n * (that the app will briefly be in the right state, but then update to an invalid state)\n */\n return Object.assign(result, {\n getPathname(this: RenderResult): string {\n return store.getRouteInfo().pathname;\n },\n getSegments(this: RenderResult): string[] {\n return store.getRouteInfo().segments;\n },\n getSearchParams(this: RenderResult): Record<string, string | string[]> {\n return store.getRouteInfo().params;\n },\n getPathnameWithParams(this: RenderResult): string {\n return store.getRouteInfo().pathnameWithParams;\n },\n getRouterState(this: RenderResult) {\n return store.state;\n },\n });\n}\n\nexport const testRouter = {\n /** Navigate to the provided pathname and the pathname */\n navigate(path: string) {\n rnTestingLibrary.act(() => router.navigate(path));\n expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);\n },\n /** Push the provided pathname and assert the pathname */\n push(path: string) {\n rnTestingLibrary.act(() => router.push(path));\n expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);\n },\n /** Replace with provided pathname and assert the pathname */\n replace(path: string) {\n rnTestingLibrary.act(() => router.replace(path));\n expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);\n },\n /** Go back in history and asset the new pathname */\n back(path?: string) {\n expect(router.canGoBack()).toBe(true);\n rnTestingLibrary.act(() => router.back());\n if (path) {\n expect(rnTestingLibrary.screen).toHavePathnameWithParams(path);\n }\n },\n /** If there's history that supports invoking the `back` function. */\n canGoBack() {\n return router.canGoBack();\n },\n /** Update the current route query params and assert the new pathname */\n setParams(params: Record<string, string>, path?: string) {\n router.setParams(params);\n if (path) {\n expect(screen).toHavePathnameWithParams(path);\n }\n },\n /** If there's history that supports invoking the `back` function. */\n dismissAll() {\n rnTestingLibrary.act(() => router.dismissAll());\n },\n};\n"]}
|
package/build/utils/font.d.ts
CHANGED
|
@@ -5,5 +5,7 @@ export declare function convertTextStyleToRNTextStyle<BaseStyleType extends Pick
|
|
|
5
5
|
fontWeight?: ConvertedFontWeightType;
|
|
6
6
|
}) | undefined;
|
|
7
7
|
export type BasicTextStyle = Pick<TextStyle, 'fontSize' | 'fontWeight' | 'fontFamily' | 'color'>;
|
|
8
|
+
export type ComposeFontWeight = 'normal' | 'bold' | `${NumericFontWeight}`;
|
|
9
|
+
export declare function convertFontWeightToComposeFontWeight(fontWeight: string | number | undefined): ComposeFontWeight | undefined;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=font.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,KAAK,iBAAiB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7E,KAAK,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,iBAAiB,EAAE,CAAC;AAEjG,wBAAgB,6BAA6B,CAAC,aAAa,SAAS,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAC/F,KAAK,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,GAEzC,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG;IACnC,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,CAAC,GACF,SAAS,CAeZ;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,KAAK,iBAAiB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7E,KAAK,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,iBAAiB,EAAE,CAAC;AAEjG,wBAAgB,6BAA6B,CAAC,aAAa,SAAS,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAC/F,KAAK,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,GAEzC,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG;IACnC,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,CAAC,GACF,SAAS,CAeZ;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC;AAEjG,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;AAgB3E,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACtC,iBAAiB,GAAG,SAAS,CAc/B"}
|
package/build/utils/font.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertTextStyleToRNTextStyle = convertTextStyleToRNTextStyle;
|
|
4
|
+
exports.convertFontWeightToComposeFontWeight = convertFontWeightToComposeFontWeight;
|
|
4
5
|
const react_native_1 = require("react-native");
|
|
5
6
|
function convertTextStyleToRNTextStyle(style) {
|
|
6
7
|
const flattenedStyle = react_native_1.StyleSheet.flatten(style);
|
|
@@ -17,4 +18,30 @@ function convertTextStyleToRNTextStyle(style) {
|
|
|
17
18
|
}
|
|
18
19
|
return flattenedStyle;
|
|
19
20
|
}
|
|
21
|
+
const SUPPORTED_FONT_WEIGHTS = new Set([
|
|
22
|
+
'100',
|
|
23
|
+
'200',
|
|
24
|
+
'300',
|
|
25
|
+
'400',
|
|
26
|
+
'500',
|
|
27
|
+
'600',
|
|
28
|
+
'700',
|
|
29
|
+
'800',
|
|
30
|
+
'900',
|
|
31
|
+
'normal',
|
|
32
|
+
'bold',
|
|
33
|
+
]);
|
|
34
|
+
function convertFontWeightToComposeFontWeight(fontWeight) {
|
|
35
|
+
if (fontWeight == null) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const value = String(fontWeight);
|
|
39
|
+
if (!SUPPORTED_FONT_WEIGHTS.has(value)) {
|
|
40
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
41
|
+
console.warn(`Unsupported fontWeight "${value}". Supported values are 100–900, "normal", and "bold".`);
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
20
47
|
//# sourceMappingURL=font.js.map
|
package/build/utils/font.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":";;AAMA,sEAqBC;
|
|
1
|
+
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":";;AAMA,sEAqBC;AAoBD,oFAgBC;AA/DD,+CAA0E;AAM1E,SAAgB,6BAA6B,CAC3C,KAA2C;IAM3C,MAAM,cAAc,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAA8B,CAAC;IAC9E,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO;YACL,GAAG,cAAc;YACjB,UAAU,EACR,OAAO,cAAc,CAAC,UAAU,KAAK,QAAQ;gBAC3C,CAAC,CAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAA4B;gBAC/D,CAAC,CAAC,cAAc,CAAC,UAAU;SAChC,CAAC;IACJ,CAAC;IACD,OAAO,cAAmD,CAAC;AAC7D,CAAC;AAMD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH,SAAgB,oCAAoC,CAClD,UAAuC;IAEvC,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI,CACV,2BAA2B,KAAK,wDAAwD,CACzF,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAA0B,CAAC;AACpC,CAAC","sourcesContent":["import { StyleSheet, type StyleProp, type TextStyle } from 'react-native';\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\ntype ConvertedFontWeightType = Exclude<TextStyle['fontWeight'], number> | `${NumericFontWeight}`;\n\nexport function convertTextStyleToRNTextStyle<BaseStyleType extends Pick<TextStyle, 'fontWeight'>>(\n style: StyleProp<BaseStyleType | undefined>\n):\n | (Omit<BaseStyleType, 'fontWeight'> & {\n fontWeight?: ConvertedFontWeightType;\n })\n | undefined {\n const flattenedStyle = StyleSheet.flatten(style) as BaseStyleType | undefined;\n if (!flattenedStyle) {\n return undefined;\n }\n if ('fontWeight' in flattenedStyle) {\n return {\n ...flattenedStyle,\n fontWeight:\n typeof flattenedStyle.fontWeight === 'number'\n ? (String(flattenedStyle.fontWeight) as `${NumericFontWeight}`)\n : flattenedStyle.fontWeight,\n };\n }\n return flattenedStyle as Omit<BaseStyleType, 'fontWeight'>;\n}\n\nexport type BasicTextStyle = Pick<TextStyle, 'fontSize' | 'fontWeight' | 'fontFamily' | 'color'>;\n\nexport type ComposeFontWeight = 'normal' | 'bold' | `${NumericFontWeight}`;\n\nconst SUPPORTED_FONT_WEIGHTS = new Set([\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n 'normal',\n 'bold',\n]);\n\nexport function convertFontWeightToComposeFontWeight(\n fontWeight: string | number | undefined\n): ComposeFontWeight | undefined {\n if (fontWeight == null) {\n return undefined;\n }\n const value = String(fontWeight);\n if (!SUPPORTED_FONT_WEIGHTS.has(value)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Unsupported fontWeight \"${value}\". Supported values are 100–900, \"normal\", and \"bold\".`\n );\n }\n return undefined;\n }\n return value as ComposeFontWeight;\n}\n"]}
|