expo-router 55.0.0-beta.2 → 55.0.0-beta.3
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/hooks.d.ts +2 -3
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +2 -3
- package/build/hooks.js.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js +2 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeTabTrigger.js +4 -7
- package/build/native-tabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/types.d.ts +60 -1
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.module → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.pom → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.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/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2-sources.jar → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2-sources.jar.md5 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2-sources.jar.sha1 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2-sources.jar.sha256 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2-sources.jar.sha512 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.aar → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.aar.md5 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.aar.sha1 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.aar.sha256 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.0-beta.2/expo.modules.router-55.0.0-beta.2.aar.sha512 → 55.0.0-beta.3/expo.modules.router-55.0.0-beta.3.aar.sha512} +0 -0
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'expo.modules.router'
|
|
7
|
-
version = '55.0.0-beta.
|
|
7
|
+
version = '55.0.0-beta.3'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "55.0.0-beta.
|
|
13
|
+
versionName "55.0.0-beta.3"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
package/build/hooks.d.ts
CHANGED
|
@@ -200,12 +200,11 @@ type LoaderFunctionResult<T extends LoaderFunction<any>> = T extends LoaderFunct
|
|
|
200
200
|
* import { useLoaderData } from 'expo-router';
|
|
201
201
|
*
|
|
202
202
|
* export function loader() {
|
|
203
|
-
* return Promise.resolve({ foo: 'bar' }}
|
|
203
|
+
* return Promise.resolve({ foo: 'bar' }};
|
|
204
204
|
* }
|
|
205
205
|
*
|
|
206
206
|
* export default function Route() {
|
|
207
|
-
* // { foo: 'bar' }
|
|
208
|
-
* const data = useLoaderData<typeof loader>();
|
|
207
|
+
* const data = useLoaderData<typeof loader>(); // { foo: 'bar' }
|
|
209
208
|
*
|
|
210
209
|
* return <Text>Data: {JSON.stringify(data)}</Text>;
|
|
211
210
|
* }
|
package/build/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAAS,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAU,MAAM,EA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,CAAC,CAAC,CAAC,CAyD5F"}
|
package/build/hooks.js
CHANGED
|
@@ -256,12 +256,11 @@ const loaderErrorCache = new Map();
|
|
|
256
256
|
* import { useLoaderData } from 'expo-router';
|
|
257
257
|
*
|
|
258
258
|
* export function loader() {
|
|
259
|
-
* return Promise.resolve({ foo: 'bar' }}
|
|
259
|
+
* return Promise.resolve({ foo: 'bar' }};
|
|
260
260
|
* }
|
|
261
261
|
*
|
|
262
262
|
* export default function Route() {
|
|
263
|
-
* // { foo: 'bar' }
|
|
264
|
-
* const data = useLoaderData<typeof loader>();
|
|
263
|
+
* const data = useLoaderData<typeof loader>(); // { foo: 'bar' }
|
|
265
264
|
*
|
|
266
265
|
* return <Text>Data: {JSON.stringify(data)}</Text>;
|
|
267
266
|
* }
|
package/build/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCb,wDAWC;AAMD,8CAEC;AAMD,8DAEC;AAmDD,8BAMC;AAOD,sDAEC;AA2CD,kCAEC;AAmBD,kCAEC;AA4CD,sDAEC;AAyCD,oDA+BC;AAED,0CAsBC;AAwCD,sCAyDC;AA7aD,qDAAyE;AAEzE,+CAAmC;AAEnC,mCAAgE;AAChE,2CAAiD;AACjD,8DAAkE;AAQzD,6FARO,2BAAY,OAQP;AAPrB,qDAAkD;AAClD,sCAA0C;AAC1C,4EAAoE;AACpE,+EAA4E;AAC5E,2CAAoD;AAKpD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,sBAAsB;IACpC,MAAM,MAAM;IACV,sDAAsD;IACtD,wFAAwF;IACxF,IAAA,sBAAa,GAAyC,CAAC,SAAS,CAAC,8BAAkB,CAAC,CAAC;IACvF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,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,CAAC;IAChD,CAAC;IAED,OAAO,IAAA,WAAG,EAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAE,CAAC,CAAC;AACpD,CAAC","sourcesContent":["'use client';\n\nimport { NavigationProp, useNavigation } from '@react-navigation/native';\nimport type { LoaderFunction } from 'expo-server';\nimport React, { use } from 'react';\n\nimport { LocalRouteParamsContext, useRouteNode } from './Route';\nimport { INTERNAL_SLOT_NAME } from './constants';\nimport { store, useRouteInfo } from './global-state/router-store';\nimport { router, Router } from './imperative-api';\nimport { resolveHref } from './link/href';\nimport { usePreviewInfo } from './link/preview/PreviewRouteContext';\nimport { ServerDataLoaderContext } from './loaders/ServerDataLoaderContext';\nimport { fetchLoaderModule } from './loaders/utils';\nimport { RouteParams, RouteSegments, UnknownOutputParams, Route } from './types';\n\nexport { useRouteInfo };\n\n/**\n * Returns the [navigation state](https://reactnavigation.org/docs/navigation-state/)\n * of the navigator which contains the current screen.\n *\n * @example\n * ```tsx\n * import { useRootNavigationState } from 'expo-router';\n *\n * export default function Route() {\n * const { routes } = useRootNavigationState();\n *\n * return <Text>{routes[0].name}</Text>;\n * }\n * ```\n */\nexport function useRootNavigationState() {\n const parent =\n // We assume that this is called from routes in __root\n // Users cannot customize the generated Sitemap or NotFound routes, so we should be safe\n useNavigation<NavigationProp<object, never, string>>().getParent(INTERNAL_SLOT_NAME);\n if (!parent) {\n throw new Error(\n 'useRootNavigationState was called from a generated route. This is likely a bug in Expo Router.'\n );\n }\n return parent.getState();\n}\n\n/**\n * @deprecated Use [`useNavigationContainerRef`](#usenavigationcontainerref) instead,\n * which returns a React `ref`.\n */\nexport function useRootNavigation() {\n return store.navigationRef.current;\n}\n\n/**\n * @return The root `<NavigationContainer />` ref for the app. The `ref.current` may be `null`\n * if the `<NavigationContainer />` hasn't mounted yet.\n */\nexport function useNavigationContainerRef() {\n return store.navigationRef;\n}\n\nconst displayWarningForProp = (prop: string) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `router.${prop} should not be used in a previewed screen. To fix this issue, wrap navigation calls with 'if (!isPreview) { ... }'.`\n );\n }\n};\n\nconst createNOOPWithWarning = (prop: string) => () => displayWarningForProp(prop);\n\nconst routerWithWarnings: Router = {\n back: createNOOPWithWarning('back'),\n canGoBack: () => {\n displayWarningForProp('canGoBack');\n return false;\n },\n push: createNOOPWithWarning('push'),\n navigate: createNOOPWithWarning('navigate'),\n replace: createNOOPWithWarning('replace'),\n dismiss: createNOOPWithWarning('dismiss'),\n dismissTo: createNOOPWithWarning('dismissTo'),\n dismissAll: createNOOPWithWarning('dismissAll'),\n canDismiss: () => {\n displayWarningForProp('canDismiss');\n return false;\n },\n setParams: createNOOPWithWarning('setParams'),\n reload: createNOOPWithWarning('reload'),\n prefetch: createNOOPWithWarning('prefetch'),\n};\n\n/**\n *\n * Returns the [Router](#router) object for imperative navigation.\n *\n * @example\n *```tsx\n * import { useRouter } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Route() {\n * const router = useRouter();\n *\n * return (\n * <Text onPress={() => router.push('/home')}>Go Home</Text>\n * );\n *}\n * ```\n */\nexport function useRouter(): Router {\n const { isPreview } = usePreviewInfo();\n if (isPreview) {\n return routerWithWarnings;\n }\n return router;\n}\n\n/**\n * @private\n * @returns The current global pathname with query params attached. This may change in the future to include the hostname\n * from a predefined universal link. For example, `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`.\n */\nexport function useUnstableGlobalHref(): string {\n return useRouteInfo().unstable_globalHref;\n}\n\n/**\n * Returns a list of selected file segments for the currently selected route. Segments are not normalized,\n * so they will be the same as the file path. For example, `/[id]?id=normal` becomes `[\"[id]\"]`.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useSegments } from 'expo-router';\n *\n * export default function Route() {\n * // segments = [\"profile\", \"[user]\"]\n * const segments = useSegments();\n *\n * return <Text>Hello</Text>;\n * }\n * ```\n *\n *\n * `useSegments` can be typed using an abstract. Consider the following file structure:\n *\n * ```md\n * - app\n * - [user]\n * - index.tsx\n * - followers.tsx\n * - settings.tsx\n * ```\n *\n *\n * This can be strictly typed using the following abstract with `useSegments` hook:\n *\n * ```tsx\n * const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()\n * ```\n */\nexport function useSegments<TSegments extends Route = Route>(): RouteSegments<TSegments>;\n\n/**\n * @hidden\n */\nexport function useSegments<TSegments extends RouteSegments<Route>>(): TSegments;\nexport function useSegments() {\n return useRouteInfo().segments;\n}\n\n/**\n * Returns the currently selected route location without search parameters. For example, `/acme?foo=bar` returns `/acme`.\n * Segments will be normalized. For example, `/[id]?id=normal` becomes `/normal`.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { usePathname } from 'expo-router';\n *\n * export default function Route() {\n * // pathname = \"/profile/baconbrix\"\n * const pathname = usePathname();\n *\n * return <Text>Pathname: {pathname}</Text>;\n * }\n * ```\n */\nexport function usePathname(): string {\n return useRouteInfo().pathname;\n}\n\n/**\n * @hidden\n */\nexport function useGlobalSearchParams<\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): TParams;\n\n/**\n * @hidden\n */\nexport function useGlobalSearchParams<TRoute extends Route>(): RouteParams<TRoute>;\n\n/**\n * Returns URL parameters for globally selected route, including dynamic path segments.\n * This function updates even when the route is not focused. Useful for analytics or\n * other background operations that don't draw to the screen.\n *\n * Route URL example: `acme://profile/baconbrix?extra=info`.\n *\n * When querying search params in a stack, opt-towards using\n * [`useLocalSearchParams`](#uselocalsearchparams) because it will only update when the route is focused.\n *\n * > **Note:** For usage information, see\n * [Local versus global search parameters](/router/reference/url-parameters/#local-versus-global-url-parameters).\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useGlobalSearchParams } from 'expo-router';\n *\n * export default function Route() {\n * // user=baconbrix & extra=info\n * const { user, extra } = useGlobalSearchParams();\n *\n * return <Text>User: {user}</Text>;\n * }\n * ```\n */\nexport function useGlobalSearchParams<\n TRoute extends Route,\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): RouteParams<TRoute> & TParams;\nexport function useGlobalSearchParams() {\n return useRouteInfo().params;\n}\n\n/**\n * @hidden\n */\nexport function useLocalSearchParams<\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): TParams;\n\n/**\n * @hidden\n */\nexport function useLocalSearchParams<TRoute extends Route>(): RouteParams<TRoute>;\n\n/**\n * Returns the URL parameters for the contextually focused route. Useful for stacks where you may push a new screen\n * that changes the query parameters. For dynamic routes, both the route parameters and the search parameters are returned.\n *\n * Route URL example: `acme://profile/baconbrix?extra=info`.\n *\n * To observe updates even when the invoking route is not focused, use [`useGlobalSearchParams`](#useglobalsearchparams).\n *\n * > **Note:** For usage information, see\n * [Local versus global search parameters](/router/reference/url-parameters/#local-versus-global-url-parameters).\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useLocalSearchParams } from 'expo-router';\n *\n * export default function Route() {\n * // user=baconbrix & extra=info\n * const { user, extra } = useLocalSearchParams();\n *\n * return <Text>User: {user}</Text>;\n * }\n */\nexport function useLocalSearchParams<\n TRoute extends Route,\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): RouteParams<TRoute> & TParams;\nexport function useLocalSearchParams() {\n const params = React.use(LocalRouteParamsContext) ?? {};\n const { params: previewParams } = usePreviewInfo();\n return Object.fromEntries(\n Object.entries(previewParams ?? params).map(([key, value]) => {\n // React Navigation doesn't remove \"undefined\" values from the params object, and you cannot remove them via\n // navigation.setParams as it shallow merges. Hence, we hide them here\n if (value === undefined) {\n return [key, undefined];\n }\n\n if (Array.isArray(value)) {\n return [\n key,\n value.map((v) => {\n try {\n return decodeURIComponent(v);\n } catch {\n return v;\n }\n }),\n ];\n } else {\n try {\n return [key, decodeURIComponent(value as string)];\n } catch {\n return [key, value];\n }\n }\n })\n ) as any;\n}\n\nexport function useSearchParams({ global = false } = {}): URLSearchParams {\n const globalRef = React.useRef(global);\n if (process.env.NODE_ENV !== 'production') {\n if (global !== globalRef.current) {\n console.warn(\n `Detected change in 'global' option of useSearchParams. This value cannot change between renders`\n );\n }\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const params = global ? useGlobalSearchParams() : useLocalSearchParams();\n const entries = Object.entries(params).flatMap(([key, value]) => {\n if (global) {\n if (key === 'params') return [];\n if (key === 'screen') return [];\n }\n\n return Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]];\n });\n\n return new ReadOnlyURLSearchParams(entries);\n}\n\nclass ReadOnlyURLSearchParams extends URLSearchParams {\n set() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n append() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n delete() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n}\n\nconst loaderDataCache = new Map<string, any>();\nconst loaderPromiseCache = new Map<string, Promise<any>>();\nconst loaderErrorCache = new Map<string, unknown>();\n\ntype LoaderFunctionResult<T extends LoaderFunction<any>> =\n T extends LoaderFunction<infer R> ? R : unknown;\n\n/**\n * Returns the result of the `loader` function for the calling route.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useLoaderData } from 'expo-router';\n *\n * export function loader() {\n * return Promise.resolve({ foo: 'bar' }}\n * }\n *\n * export default function Route() {\n * // { foo: 'bar' }\n * const data = useLoaderData<typeof loader>();\n *\n * return <Text>Data: {JSON.stringify(data)}</Text>;\n * }\n */\nexport function useLoaderData<T extends LoaderFunction<any> = any>(): LoaderFunctionResult<T> {\n const routeNode = useRouteNode();\n const params = useLocalSearchParams();\n const serverDataLoaderContext = use(ServerDataLoaderContext);\n\n if (!routeNode) {\n throw new Error('No route node found. This is likely a bug in expo-router.');\n }\n\n const resolvedPath = `/${resolveHref({ pathname: routeNode?.route, params })}`;\n\n // First invocation of this hook will happen server-side, so we look up the loaded data from context\n if (serverDataLoaderContext) {\n return serverDataLoaderContext[resolvedPath];\n }\n\n // The second invocation happens after the client has hydrated on initial load, so we look up the data injected\n // by `<PreloadedDataScript />` using `globalThis.__EXPO_ROUTER_LOADER_DATA__`\n if (typeof window !== 'undefined' && globalThis.__EXPO_ROUTER_LOADER_DATA__) {\n if (globalThis.__EXPO_ROUTER_LOADER_DATA__[resolvedPath]) {\n return globalThis.__EXPO_ROUTER_LOADER_DATA__[resolvedPath];\n }\n }\n\n // Check error cache first to prevent infinite retry loops when a loader fails.\n // We throw the cached error instead of starting a new fetch.\n if (loaderErrorCache.has(resolvedPath)) {\n throw loaderErrorCache.get(resolvedPath);\n }\n\n // Check cache for route data\n if (loaderDataCache.has(resolvedPath)) {\n return loaderDataCache.get(resolvedPath);\n }\n\n // Fetch data if not cached\n if (!loaderPromiseCache.has(resolvedPath)) {\n const promise = fetchLoaderModule(resolvedPath)\n .then((data) => {\n loaderDataCache.set(resolvedPath, data);\n loaderErrorCache.delete(resolvedPath);\n loaderPromiseCache.delete(resolvedPath);\n return data;\n })\n .catch((error) => {\n const wrappedError = new Error(`Failed to load loader data for route: ${resolvedPath}`, {\n cause: error,\n });\n loaderErrorCache.set(resolvedPath, wrappedError);\n loaderPromiseCache.delete(resolvedPath);\n throw wrappedError;\n });\n\n loaderPromiseCache.set(resolvedPath, promise);\n }\n\n return use(loaderPromiseCache.get(resolvedPath)!);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCb,wDAWC;AAMD,8CAEC;AAMD,8DAEC;AAmDD,8BAMC;AAOD,sDAEC;AA2CD,kCAEC;AAmBD,kCAEC;AA4CD,sDAEC;AAyCD,oDA+BC;AAED,0CAsBC;AAuCD,sCAyDC;AA5aD,qDAAyE;AAEzE,+CAAmC;AAEnC,mCAAgE;AAChE,2CAAiD;AACjD,8DAAkE;AAQzD,6FARO,2BAAY,OAQP;AAPrB,qDAAkD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AI,KAAK,CAAC,yCAAyC,YAAY,EAAE,EAAE;gBACtF,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;YACH,gBAAgB,CAAC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YACjD,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACxC,MAAM,YAAY,CAAC;QACrB,CAAC,CAAC,CAAC;QAEL,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,IAAA,WAAG,EAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAE,CAAC,CAAC;AACpD,CAAC","sourcesContent":["'use client';\n\nimport { NavigationProp, useNavigation } from '@react-navigation/native';\nimport type { LoaderFunction } from 'expo-server';\nimport React, { use } from 'react';\n\nimport { LocalRouteParamsContext, useRouteNode } from './Route';\nimport { INTERNAL_SLOT_NAME } from './constants';\nimport { store, useRouteInfo } from './global-state/router-store';\nimport { router, Router } from './imperative-api';\nimport { resolveHref } from './link/href';\nimport { usePreviewInfo } from './link/preview/PreviewRouteContext';\nimport { ServerDataLoaderContext } from './loaders/ServerDataLoaderContext';\nimport { fetchLoaderModule } from './loaders/utils';\nimport { RouteParams, RouteSegments, UnknownOutputParams, Route } from './types';\n\nexport { useRouteInfo };\n\n/**\n * Returns the [navigation state](https://reactnavigation.org/docs/navigation-state/)\n * of the navigator which contains the current screen.\n *\n * @example\n * ```tsx\n * import { useRootNavigationState } from 'expo-router';\n *\n * export default function Route() {\n * const { routes } = useRootNavigationState();\n *\n * return <Text>{routes[0].name}</Text>;\n * }\n * ```\n */\nexport function useRootNavigationState() {\n const parent =\n // We assume that this is called from routes in __root\n // Users cannot customize the generated Sitemap or NotFound routes, so we should be safe\n useNavigation<NavigationProp<object, never, string>>().getParent(INTERNAL_SLOT_NAME);\n if (!parent) {\n throw new Error(\n 'useRootNavigationState was called from a generated route. This is likely a bug in Expo Router.'\n );\n }\n return parent.getState();\n}\n\n/**\n * @deprecated Use [`useNavigationContainerRef`](#usenavigationcontainerref) instead,\n * which returns a React `ref`.\n */\nexport function useRootNavigation() {\n return store.navigationRef.current;\n}\n\n/**\n * @return The root `<NavigationContainer />` ref for the app. The `ref.current` may be `null`\n * if the `<NavigationContainer />` hasn't mounted yet.\n */\nexport function useNavigationContainerRef() {\n return store.navigationRef;\n}\n\nconst displayWarningForProp = (prop: string) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `router.${prop} should not be used in a previewed screen. To fix this issue, wrap navigation calls with 'if (!isPreview) { ... }'.`\n );\n }\n};\n\nconst createNOOPWithWarning = (prop: string) => () => displayWarningForProp(prop);\n\nconst routerWithWarnings: Router = {\n back: createNOOPWithWarning('back'),\n canGoBack: () => {\n displayWarningForProp('canGoBack');\n return false;\n },\n push: createNOOPWithWarning('push'),\n navigate: createNOOPWithWarning('navigate'),\n replace: createNOOPWithWarning('replace'),\n dismiss: createNOOPWithWarning('dismiss'),\n dismissTo: createNOOPWithWarning('dismissTo'),\n dismissAll: createNOOPWithWarning('dismissAll'),\n canDismiss: () => {\n displayWarningForProp('canDismiss');\n return false;\n },\n setParams: createNOOPWithWarning('setParams'),\n reload: createNOOPWithWarning('reload'),\n prefetch: createNOOPWithWarning('prefetch'),\n};\n\n/**\n *\n * Returns the [Router](#router) object for imperative navigation.\n *\n * @example\n *```tsx\n * import { useRouter } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Route() {\n * const router = useRouter();\n *\n * return (\n * <Text onPress={() => router.push('/home')}>Go Home</Text>\n * );\n *}\n * ```\n */\nexport function useRouter(): Router {\n const { isPreview } = usePreviewInfo();\n if (isPreview) {\n return routerWithWarnings;\n }\n return router;\n}\n\n/**\n * @private\n * @returns The current global pathname with query params attached. This may change in the future to include the hostname\n * from a predefined universal link. For example, `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`.\n */\nexport function useUnstableGlobalHref(): string {\n return useRouteInfo().unstable_globalHref;\n}\n\n/**\n * Returns a list of selected file segments for the currently selected route. Segments are not normalized,\n * so they will be the same as the file path. For example, `/[id]?id=normal` becomes `[\"[id]\"]`.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useSegments } from 'expo-router';\n *\n * export default function Route() {\n * // segments = [\"profile\", \"[user]\"]\n * const segments = useSegments();\n *\n * return <Text>Hello</Text>;\n * }\n * ```\n *\n *\n * `useSegments` can be typed using an abstract. Consider the following file structure:\n *\n * ```md\n * - app\n * - [user]\n * - index.tsx\n * - followers.tsx\n * - settings.tsx\n * ```\n *\n *\n * This can be strictly typed using the following abstract with `useSegments` hook:\n *\n * ```tsx\n * const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()\n * ```\n */\nexport function useSegments<TSegments extends Route = Route>(): RouteSegments<TSegments>;\n\n/**\n * @hidden\n */\nexport function useSegments<TSegments extends RouteSegments<Route>>(): TSegments;\nexport function useSegments() {\n return useRouteInfo().segments;\n}\n\n/**\n * Returns the currently selected route location without search parameters. For example, `/acme?foo=bar` returns `/acme`.\n * Segments will be normalized. For example, `/[id]?id=normal` becomes `/normal`.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { usePathname } from 'expo-router';\n *\n * export default function Route() {\n * // pathname = \"/profile/baconbrix\"\n * const pathname = usePathname();\n *\n * return <Text>Pathname: {pathname}</Text>;\n * }\n * ```\n */\nexport function usePathname(): string {\n return useRouteInfo().pathname;\n}\n\n/**\n * @hidden\n */\nexport function useGlobalSearchParams<\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): TParams;\n\n/**\n * @hidden\n */\nexport function useGlobalSearchParams<TRoute extends Route>(): RouteParams<TRoute>;\n\n/**\n * Returns URL parameters for globally selected route, including dynamic path segments.\n * This function updates even when the route is not focused. Useful for analytics or\n * other background operations that don't draw to the screen.\n *\n * Route URL example: `acme://profile/baconbrix?extra=info`.\n *\n * When querying search params in a stack, opt-towards using\n * [`useLocalSearchParams`](#uselocalsearchparams) because it will only update when the route is focused.\n *\n * > **Note:** For usage information, see\n * [Local versus global search parameters](/router/reference/url-parameters/#local-versus-global-url-parameters).\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useGlobalSearchParams } from 'expo-router';\n *\n * export default function Route() {\n * // user=baconbrix & extra=info\n * const { user, extra } = useGlobalSearchParams();\n *\n * return <Text>User: {user}</Text>;\n * }\n * ```\n */\nexport function useGlobalSearchParams<\n TRoute extends Route,\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): RouteParams<TRoute> & TParams;\nexport function useGlobalSearchParams() {\n return useRouteInfo().params;\n}\n\n/**\n * @hidden\n */\nexport function useLocalSearchParams<\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): TParams;\n\n/**\n * @hidden\n */\nexport function useLocalSearchParams<TRoute extends Route>(): RouteParams<TRoute>;\n\n/**\n * Returns the URL parameters for the contextually focused route. Useful for stacks where you may push a new screen\n * that changes the query parameters. For dynamic routes, both the route parameters and the search parameters are returned.\n *\n * Route URL example: `acme://profile/baconbrix?extra=info`.\n *\n * To observe updates even when the invoking route is not focused, use [`useGlobalSearchParams`](#useglobalsearchparams).\n *\n * > **Note:** For usage information, see\n * [Local versus global search parameters](/router/reference/url-parameters/#local-versus-global-url-parameters).\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useLocalSearchParams } from 'expo-router';\n *\n * export default function Route() {\n * // user=baconbrix & extra=info\n * const { user, extra } = useLocalSearchParams();\n *\n * return <Text>User: {user}</Text>;\n * }\n */\nexport function useLocalSearchParams<\n TRoute extends Route,\n TParams extends UnknownOutputParams = UnknownOutputParams,\n>(): RouteParams<TRoute> & TParams;\nexport function useLocalSearchParams() {\n const params = React.use(LocalRouteParamsContext) ?? {};\n const { params: previewParams } = usePreviewInfo();\n return Object.fromEntries(\n Object.entries(previewParams ?? params).map(([key, value]) => {\n // React Navigation doesn't remove \"undefined\" values from the params object, and you cannot remove them via\n // navigation.setParams as it shallow merges. Hence, we hide them here\n if (value === undefined) {\n return [key, undefined];\n }\n\n if (Array.isArray(value)) {\n return [\n key,\n value.map((v) => {\n try {\n return decodeURIComponent(v);\n } catch {\n return v;\n }\n }),\n ];\n } else {\n try {\n return [key, decodeURIComponent(value as string)];\n } catch {\n return [key, value];\n }\n }\n })\n ) as any;\n}\n\nexport function useSearchParams({ global = false } = {}): URLSearchParams {\n const globalRef = React.useRef(global);\n if (process.env.NODE_ENV !== 'production') {\n if (global !== globalRef.current) {\n console.warn(\n `Detected change in 'global' option of useSearchParams. This value cannot change between renders`\n );\n }\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const params = global ? useGlobalSearchParams() : useLocalSearchParams();\n const entries = Object.entries(params).flatMap(([key, value]) => {\n if (global) {\n if (key === 'params') return [];\n if (key === 'screen') return [];\n }\n\n return Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]];\n });\n\n return new ReadOnlyURLSearchParams(entries);\n}\n\nclass ReadOnlyURLSearchParams extends URLSearchParams {\n set() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n append() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n delete() {\n throw new Error('The URLSearchParams object return from useSearchParams is read-only');\n }\n}\n\nconst loaderDataCache = new Map<string, any>();\nconst loaderPromiseCache = new Map<string, Promise<any>>();\nconst loaderErrorCache = new Map<string, unknown>();\n\ntype LoaderFunctionResult<T extends LoaderFunction<any>> =\n T extends LoaderFunction<infer R> ? R : unknown;\n\n/**\n * Returns the result of the `loader` function for the calling route.\n *\n * @example\n * ```tsx app/profile/[user].tsx\n * import { Text } from 'react-native';\n * import { useLoaderData } from 'expo-router';\n *\n * export function loader() {\n * return Promise.resolve({ foo: 'bar' }};\n * }\n *\n * export default function Route() {\n * const data = useLoaderData<typeof loader>(); // { foo: 'bar' }\n *\n * return <Text>Data: {JSON.stringify(data)}</Text>;\n * }\n */\nexport function useLoaderData<T extends LoaderFunction<any> = any>(): LoaderFunctionResult<T> {\n const routeNode = useRouteNode();\n const params = useLocalSearchParams();\n const serverDataLoaderContext = use(ServerDataLoaderContext);\n\n if (!routeNode) {\n throw new Error('No route node found. This is likely a bug in expo-router.');\n }\n\n const resolvedPath = `/${resolveHref({ pathname: routeNode?.route, params })}`;\n\n // First invocation of this hook will happen server-side, so we look up the loaded data from context\n if (serverDataLoaderContext) {\n return serverDataLoaderContext[resolvedPath];\n }\n\n // The second invocation happens after the client has hydrated on initial load, so we look up the data injected\n // by `<PreloadedDataScript />` using `globalThis.__EXPO_ROUTER_LOADER_DATA__`\n if (typeof window !== 'undefined' && globalThis.__EXPO_ROUTER_LOADER_DATA__) {\n if (globalThis.__EXPO_ROUTER_LOADER_DATA__[resolvedPath]) {\n return globalThis.__EXPO_ROUTER_LOADER_DATA__[resolvedPath];\n }\n }\n\n // Check error cache first to prevent infinite retry loops when a loader fails.\n // We throw the cached error instead of starting a new fetch.\n if (loaderErrorCache.has(resolvedPath)) {\n throw loaderErrorCache.get(resolvedPath);\n }\n\n // Check cache for route data\n if (loaderDataCache.has(resolvedPath)) {\n return loaderDataCache.get(resolvedPath);\n }\n\n // Fetch data if not cached\n if (!loaderPromiseCache.has(resolvedPath)) {\n const promise = fetchLoaderModule(resolvedPath)\n .then((data) => {\n loaderDataCache.set(resolvedPath, data);\n loaderErrorCache.delete(resolvedPath);\n loaderPromiseCache.delete(resolvedPath);\n return data;\n })\n .catch((error) => {\n const wrappedError = new Error(`Failed to load loader data for route: ${resolvedPath}`, {\n cause: error,\n });\n loaderErrorCache.set(resolvedPath, wrappedError);\n loaderPromiseCache.delete(resolvedPath);\n throw wrappedError;\n });\n\n loaderPromiseCache.set(resolvedPath, promise);\n }\n\n return use(loaderPromiseCache.get(resolvedPath)!);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InternalNativeTabsProps, NativeTabsProps } from './types';
|
|
3
3
|
export declare const NativeTabsContext: React.Context<boolean>;
|
|
4
|
-
export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, ...rest }: InternalNativeTabsProps): React.JSX.Element;
|
|
4
|
+
export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, screenListeners, ...rest }: InternalNativeTabsProps): React.JSX.Element;
|
|
5
5
|
export declare function NativeTabsNavigatorWrapper(props: NativeTabsProps): React.JSX.Element;
|
|
6
6
|
//# sourceMappingURL=NativeBottomTabsNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AASA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,KAAK,EACV,uBAAuB,EAGvB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,WAAW,EACX,eAAe,EACf,GAAG,IAAI,EACR,EAAE,uBAAuB,qBAmHzB;AAWD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe,qBAiBhE"}
|
|
@@ -49,7 +49,7 @@ const children_1 = require("../utils/children");
|
|
|
49
49
|
// In Jetpack Compose, the default back behavior is to go back to the initial route.
|
|
50
50
|
const defaultBackBehavior = 'initialRoute';
|
|
51
51
|
exports.NativeTabsContext = react_1.default.createContext(false);
|
|
52
|
-
function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, ...rest }) {
|
|
52
|
+
function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, screenListeners, ...rest }) {
|
|
53
53
|
if ((0, react_1.use)(exports.NativeTabsContext)) {
|
|
54
54
|
throw new Error('Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.');
|
|
55
55
|
}
|
|
@@ -66,6 +66,7 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
|
|
|
66
66
|
const { state, descriptors, navigation, NavigationContent } = (0, native_1.useNavigationBuilder)(NativeBottomTabsRouter_1.NativeBottomTabsRouter, {
|
|
67
67
|
children,
|
|
68
68
|
backBehavior,
|
|
69
|
+
screenListeners,
|
|
69
70
|
screenOptions: {
|
|
70
71
|
disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,
|
|
71
72
|
labelStyle: processedLabelStyle.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Bb,kDAgIC;AAWD,gEAiBC;AAxLD,qDAMkC;AAClC,+CAAyD;AAEzD,qEAAkE;AAClE,yDAAsD;AACtD,qDAAkD;AAQlD,mCAAsF;AACtF,oEAAiE;AACjE,6C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,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,8BAA8B,GAAG,IAAA,qCAAiB,EAKtD,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAEzD,SAAgB,0BAA0B,CAAC,KAAsB;IAC/D,MAAM,eAAe,GAAG,IAAA,eAAO,EAC7B,GAAG,EAAE,CAAC,IAAA,+BAAoB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC5D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAA,eAAO,EAChC,GAAG,EAAE,CAAC,IAAA,kCAAuB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC/D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,CAAC,8BAA8B,CAC7B,IAAI,KAAK,CAAC,CACV,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,EACvC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport {\n createNavigatorFactory,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport React, { use, useCallback, useMemo } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n InternalNativeTabsProps,\n NativeTabNavigationEventMap,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\nimport { getAllChildrenNotOfType, getAllChildrenOfType } from '../utils/children';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n screenListeners,\n ...rest\n}: InternalNativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NativeTabOptions,\n NativeTabNavigationEventMap\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenListeners,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key].options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key].options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key].render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key),\n [visibleTabs, routes, state.index]\n );\n const visibleTabsKeys = useMemo(\n () => visibleTabs.map((tab) => tab.routeKey).join(';'),\n [visibleTabs]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n\n const onTabChange = useCallback(\n (tabKey: string) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.emit({\n type: 'tabPress',\n target: tabKey,\n data: {\n __internalTabsType: 'native',\n },\n });\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n },\n [descriptors, navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <NativeTabsContext value>\n <NativeTabsView\n {...rest}\n key={visibleTabsKeys}\n focusedIndex={focusedIndex}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nconst NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n TabNavigationState<ParamListBase>,\n NativeTabNavigationEventMap\n>(createNativeTabNavigator().Navigator, undefined, true);\n\nexport function NativeTabsNavigatorWrapper(props: NativeTabsProps) {\n const triggerChildren = useMemo(\n () => getAllChildrenOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n const nonTriggerChildren = useMemo(\n () => getAllChildrenNotOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n\n return (\n <NativeTabsNavigatorWithContext\n {...props}\n children={triggerChildren}\n nonTriggerChildren={nonTriggerChildren}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAEhC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,QAuBzD;AAED,eAAO,MAAM,gBAAgB;;;;;CAK3B,CAAC;AAEH,wBAAgB,wBAAwB,CACtC,EACE,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAC7B,YAAY,GACb,EAAE,qBAAqB,EACxB,SAAS,GAAE,OAAe,oBAqC3B;AAyBD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,QA8C7F;AAsCD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,IAAI,YAAY,CAAC,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAEhC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,QAuBzD;AAED,eAAO,MAAM,gBAAgB;;;;;CAK3B,CAAC;AAEH,wBAAgB,wBAAwB,CACtC,EACE,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAC7B,YAAY,GACb,EAAE,qBAAqB,EACxB,SAAS,GAAE,OAAe,oBAqC3B;AAyBD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,QA8C7F;AAsCD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,IAAI,YAAY,CAAC,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAoBjE"}
|
|
@@ -9,10 +9,10 @@ const native_1 = require("@react-navigation/native");
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_native_1 = require("react-native");
|
|
11
11
|
const elements_1 = require("./common/elements");
|
|
12
|
+
const icon_1 = require("./utils/icon");
|
|
12
13
|
const PreviewRouteContext_1 = require("../link/preview/PreviewRouteContext");
|
|
13
14
|
const useFocusEffect_1 = require("../useFocusEffect");
|
|
14
15
|
const children_1 = require("../utils/children");
|
|
15
|
-
const icon_1 = require("./utils/icon");
|
|
16
16
|
const materialIconConverter_1 = require("./utils/materialIconConverter");
|
|
17
17
|
/**
|
|
18
18
|
* The component used to customize the native tab options both in the _layout file and from the tab screen.
|
|
@@ -206,15 +206,12 @@ function convertSrcOrComponentToSrc(src, options) {
|
|
|
206
206
|
return undefined;
|
|
207
207
|
}
|
|
208
208
|
function isNativeTabTrigger(child, contextKey) {
|
|
209
|
-
if ((0,
|
|
210
|
-
if (
|
|
211
|
-
child.props &&
|
|
212
|
-
'name' in child.props &&
|
|
213
|
-
!child.props.name) {
|
|
209
|
+
if ((0, children_1.isChildOfType)(child, exports.NativeTabTrigger)) {
|
|
210
|
+
if ('name' in child.props && !child.props.name) {
|
|
214
211
|
throw new Error(`<Trigger /> component in \`default export\` at \`app${contextKey}/_layout\` must have a \`name\` prop when used as a child of a Layout Route.`);
|
|
215
212
|
}
|
|
216
213
|
if (process.env.NODE_ENV !== 'production') {
|
|
217
|
-
if (['component', 'getComponent'].some((key) =>
|
|
214
|
+
if (['component', 'getComponent'].some((key) => key in child.props)) {
|
|
218
215
|
throw new Error(`<Trigger /> component in \`default export\` at \`app${contextKey}/_layout\` must not have a \`component\` or \`getComponent\` prop when used as a child of a Layout Route`);
|
|
219
216
|
}
|
|
220
217
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA2Fb,4DAgDC;AAyBD,8CA8CC;AAsCD,gDAgCC;AAtRD,qDAAmE;AACnE,iCAAuF;AACvF,+CAAoE;AAEpE,gDAS2B;AAE3B,6EAAmE;AACnE,sDAAmD;AACnD,gDAAiF;AACjF,uCAAgE;AAChE,yEAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,SAAS,oBAAoB,CAAC,KAA4B;IACxD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAA,kCAAY,GAAE,CAAC;IAEnC,IAAA,+BAAc,EACZ,IAAA,mBAAW,EAAC,GAAG,EAAE;QACf,6DAA6D;QAC7D,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;g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IAAI,KAAK,CAAC,KAAK,CAC9E,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, useCallback, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet, type ImageSourcePropType } from 'react-native';\n\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useFocusEffect } from '../useFocusEffect';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\nimport { convertComponentSrcToImageSource } from './utils/icon';\nimport { convertMaterialIconNameToImageSource } from './utils/materialIconConverter';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx app/_layout.tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx app/home.tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isInPreview = useIsPreview();\n\n useFocusEffect(\n useCallback(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (!isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [props, isInPreview])\n );\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n disableAutomaticContentInsets,\n contentStyle,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n contentStyle,\n role,\n nativeProps: unstable_nativeProps,\n disableAutomaticContentInsets,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = StyleSheet.flatten(props.selectedStyle);\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n if ('md' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {\n if (process.env.NODE_ENV !== 'production') {\n if ('drawable' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n }\n options.icon = convertMaterialIconNameToImageSource(props.md);\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon, { renderingMode: icon.renderingMode });\n options.selectedIcon = convertSrcOrComponentToSrc(selected, {\n renderingMode: icon.renderingMode,\n });\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(\n src: ImageSourcePropType | ReactElement | undefined,\n options: {\n renderingMode: 'template' | 'original' | undefined;\n }\n) {\n if (src) {\n if (isValidElement(src)) {\n return convertComponentSrcToImageSource(src);\n } else {\n return { src, renderingMode: options.renderingMode };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeTabTrigger.js","sourceRoot":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C,aAAa,EAAE,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,kBAAkB,CAChC,KAAgB,EAChB,UAAmB;IAEnB,IAAI,IAAA,wBAAa,EAAC,KAAK,EAAE,wBAAgB,CAAC,EAAE,CAAC;QAC3C,IAAI,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,8EAA8E,CAChJ,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IAAK,CAAC,WAAW,EAAE,cAAc,CAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/E,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, useCallback, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet, type ImageSourcePropType } from 'react-native';\n\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { convertComponentSrcToImageSource } from './utils/icon';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useFocusEffect } from '../useFocusEffect';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\nimport { convertMaterialIconNameToImageSource } from './utils/materialIconConverter';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx app/_layout.tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx app/home.tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isInPreview = useIsPreview();\n\n useFocusEffect(\n useCallback(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (!isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [props, isInPreview])\n );\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n disableAutomaticContentInsets,\n contentStyle,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n contentStyle,\n role,\n nativeProps: unstable_nativeProps,\n disableAutomaticContentInsets,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = StyleSheet.flatten(props.selectedStyle);\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n if ('md' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {\n if (process.env.NODE_ENV !== 'production') {\n if ('drawable' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n }\n options.icon = convertMaterialIconNameToImageSource(props.md);\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon, { renderingMode: icon.renderingMode });\n options.selectedIcon = convertSrcOrComponentToSrc(selected, {\n renderingMode: icon.renderingMode,\n });\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(\n src: ImageSourcePropType | ReactElement | undefined,\n options: {\n renderingMode: 'template' | 'original' | undefined;\n }\n) {\n if (src) {\n if (isValidElement(src)) {\n return convertComponentSrcToImageSource(src);\n } else {\n return { src, renderingMode: options.renderingMode };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isChildOfType(child, NativeTabTrigger)) {\n if ('name' in child.props && !child.props.name) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ((['component', 'getComponent'] as const).some((key) => key in child.props)) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type { DefaultRouterOptions } from '@react-navigation/native';
|
|
1
|
+
import type { DefaultRouterOptions, EventMapBase, NavigationState, ParamListBase, RouteProp, ScreenListeners, TabNavigationState } from '@react-navigation/native';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
import type { ColorValue, ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
import type { TabsScreenProps } from 'react-native-screens';
|
|
5
5
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
6
|
+
/**
|
|
7
|
+
* Event map for `NativeTabs` navigation events.
|
|
8
|
+
* Only `tabPress` is currently supported.
|
|
9
|
+
*/
|
|
10
|
+
export type NativeTabNavigationEventMap = {
|
|
11
|
+
tabPress: {
|
|
12
|
+
data: {
|
|
13
|
+
__internalTabsType: 'native';
|
|
14
|
+
};
|
|
15
|
+
canPreventDefault: false;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
6
18
|
export type NativeScreenProps = Partial<Omit<TabsScreenProps, 'tabKey' | 'isFocused'>>;
|
|
7
19
|
export interface NativeTabOptions extends DefaultRouterOptions {
|
|
8
20
|
icon?: SymbolOrImageSource;
|
|
@@ -196,6 +208,30 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
196
208
|
* @platform web
|
|
197
209
|
*/
|
|
198
210
|
badgeTextColor?: ColorValue;
|
|
211
|
+
/**
|
|
212
|
+
* Listeners for navigation events on all tabs.
|
|
213
|
+
*
|
|
214
|
+
* Supported events:
|
|
215
|
+
* - `tabPress` - called when a tab is pressed
|
|
216
|
+
* - `focus` - called when the screen comes into focus
|
|
217
|
+
* - `blur` - called when the screen loses focus
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```tsx
|
|
221
|
+
* <NativeTabs
|
|
222
|
+
* screenListeners={{
|
|
223
|
+
* tabPress: (e) => {
|
|
224
|
+
* console.log('Any tab pressed');
|
|
225
|
+
* },
|
|
226
|
+
* }}
|
|
227
|
+
* >
|
|
228
|
+
* ...
|
|
229
|
+
* </NativeTabs>
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
screenListeners?: ScreenListeners<TabNavigationState<ParamListBase>, NativeTabNavigationEventMap> | ((prop: {
|
|
233
|
+
route: RouteProp<ParamListBase, string>;
|
|
234
|
+
}) => ScreenListeners<TabNavigationState<ParamListBase>, NativeTabNavigationEventMap>);
|
|
199
235
|
}
|
|
200
236
|
export interface InternalNativeTabsProps extends NativeTabsProps {
|
|
201
237
|
nonTriggerChildren?: React.ReactNode;
|
|
@@ -309,6 +345,29 @@ export interface NativeTabTriggerProps {
|
|
|
309
345
|
* Note: Only certain style properties are supported.
|
|
310
346
|
*/
|
|
311
347
|
contentStyle?: NativeTabOptions['contentStyle'];
|
|
348
|
+
/**
|
|
349
|
+
* Listeners for navigation events on this tab.
|
|
350
|
+
*
|
|
351
|
+
* Supported events:
|
|
352
|
+
* - `tabPress` - called when this tab is pressed
|
|
353
|
+
* - `focus` - called when this screen comes into focus
|
|
354
|
+
* - `blur` - called when this screen loses focus
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```tsx
|
|
358
|
+
* <NativeTabs.Trigger
|
|
359
|
+
* name="home"
|
|
360
|
+
* listeners={{
|
|
361
|
+
* tabPress: (e) => {
|
|
362
|
+
* console.log('Home tab pressed');
|
|
363
|
+
* },
|
|
364
|
+
* }}
|
|
365
|
+
* />
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
listeners?: ScreenListeners<NavigationState, EventMapBase> | ((prop: {
|
|
369
|
+
route: RouteProp<ParamListBase, string>;
|
|
370
|
+
}) => ScreenListeners<NavigationState, EventMapBase>);
|
|
312
371
|
}
|
|
313
372
|
declare const SUPPORTED_TAB_BAR_ITEM_ROLES: readonly ["bookmarks", "contacts", "downloads", "favorites", "featured", "history", "more", "mostRecent", "mostViewed", "recents", "search", "topRated"];
|
|
314
373
|
export type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,eAAe,EACf,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE;QAAE,IAAI,EAAE;YAAE,kBAAkB,EAAE,QAAQ,CAAA;SAAE,CAAC;QAAC,iBAAiB,EAAE,KAAK,CA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W;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC","sourcesContent":["import type { DefaultRouterOptions } from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: TabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\n disableAutomaticContentInsets?: boolean;\n contentStyle?: Pick<\n ViewStyle,\n | 'backgroundColor'\n | 'experimental_backgroundImage'\n | 'padding'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingBlock'\n | 'paddingBlockEnd'\n | 'paddingBlockStart'\n | 'paddingInline'\n | 'paddingInlineEnd'\n | 'paddingInlineStart'\n | 'paddingEnd'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingStart'\n | 'alignContent'\n | 'alignItems'\n | 'justifyContent'\n | 'flexDirection'\n | 'gap'\n >;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n /**\n * Controls how the icon is rendered on iOS.\n * @platform ios\n * @default 'template'\n */\n renderingMode?: 'template' | 'original';\n };\n\nexport type NativeTabsLabelStyle = Pick<\n TextStyle,\n 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'color'\n>;\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?:\n | StyleProp<NativeTabsLabelStyle>\n | {\n default?: StyleProp<NativeTabsLabelStyle>;\n selected?: StyleProp<NativeTabsLabelStyle>;\n };\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: ColorValue };\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * When set to `true`, hides the tab bar.\n *\n * @default false\n */\n hidden?: boolean;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface NativeTabsViewProps\n extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n *\n * > **Note**: Dynamically hiding tabs will remount the navigator and the state will be reset.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The default behavior differs between iOS and Android.\n *\n * On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,\n * and the **bottom** inset is applied. Other insets must be handled manually.\n *\n * On **iOS**, the first scroll view nested inside a native tabs screen has\n * [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled\n *\n * When this property is set to `true`, automatic content inset adjustment is disabled for the screen\n * and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`\n * to handle safe area insets.\n *\n * @platform android\n * @platform ios\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * The style applied to the content of the tab\n *\n * Note: Only certain style properties are supported.\n */\n contentStyle?: NativeTabOptions['contentStyle'];\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AAsHa,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AAqME,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC;AAyHX,MAAM,4BAA4B,GAAG;IACnC,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n EventMapBase,\n NavigationState,\n ParamListBase,\n RouteProp,\n ScreenListeners,\n TabNavigationState,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\n/**\n * Event map for `NativeTabs` navigation events.\n * Only `tabPress` is currently supported.\n */\nexport type NativeTabNavigationEventMap = {\n tabPress: { data: { __internalTabsType: 'native' }; canPreventDefault: false };\n};\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: TabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\n disableAutomaticContentInsets?: boolean;\n contentStyle?: Pick<\n ViewStyle,\n | 'backgroundColor'\n | 'experimental_backgroundImage'\n | 'padding'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingBlock'\n | 'paddingBlockEnd'\n | 'paddingBlockStart'\n | 'paddingInline'\n | 'paddingInlineEnd'\n | 'paddingInlineStart'\n | 'paddingEnd'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingStart'\n | 'alignContent'\n | 'alignItems'\n | 'justifyContent'\n | 'flexDirection'\n | 'gap'\n >;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n /**\n * Controls how the icon is rendered on iOS.\n * @platform ios\n * @default 'template'\n */\n renderingMode?: 'template' | 'original';\n };\n\nexport type NativeTabsLabelStyle = Pick<\n TextStyle,\n 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'color'\n>;\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?:\n | StyleProp<NativeTabsLabelStyle>\n | {\n default?: StyleProp<NativeTabsLabelStyle>;\n selected?: StyleProp<NativeTabsLabelStyle>;\n };\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: ColorValue };\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * When set to `true`, hides the tab bar.\n *\n * @default false\n */\n hidden?: boolean;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n /**\n * Listeners for navigation events on all tabs.\n *\n * Supported events:\n * - `tabPress` - called when a tab is pressed\n * - `focus` - called when the screen comes into focus\n * - `blur` - called when the screen loses focus\n *\n * @example\n * ```tsx\n * <NativeTabs\n * screenListeners={{\n * tabPress: (e) => {\n * console.log('Any tab pressed');\n * },\n * }}\n * >\n * ...\n * </NativeTabs>\n * ```\n */\n screenListeners?:\n | ScreenListeners<TabNavigationState<ParamListBase>, NativeTabNavigationEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n }) => ScreenListeners<TabNavigationState<ParamListBase>, NativeTabNavigationEventMap>);\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface NativeTabsViewProps\n extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n *\n * > **Note**: Dynamically hiding tabs will remount the navigator and the state will be reset.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The default behavior differs between iOS and Android.\n *\n * On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,\n * and the **bottom** inset is applied. Other insets must be handled manually.\n *\n * On **iOS**, the first scroll view nested inside a native tabs screen has\n * [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled\n *\n * When this property is set to `true`, automatic content inset adjustment is disabled for the screen\n * and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`\n * to handle safe area insets.\n *\n * @platform android\n * @platform ios\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * The style applied to the content of the tab\n *\n * Note: Only certain style properties are supported.\n */\n contentStyle?: NativeTabOptions['contentStyle'];\n /**\n * Listeners for navigation events on this tab.\n *\n * Supported events:\n * - `tabPress` - called when this tab is pressed\n * - `focus` - called when this screen comes into focus\n * - `blur` - called when this screen loses focus\n *\n * @example\n * ```tsx\n * <NativeTabs.Trigger\n * name=\"home\"\n * listeners={{\n * tabPress: (e) => {\n * console.log('Home tab pressed');\n * },\n * }}\n * />\n * ```\n */\n listeners?:\n | ScreenListeners<NavigationState, EventMapBase>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n }) => ScreenListeners<NavigationState, EventMapBase>);\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.router",
|
|
5
5
|
"module": "expo.modules.router",
|
|
6
|
-
"version": "55.0.0-beta.
|
|
6
|
+
"version": "55.0.0-beta.3",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.router-55.0.0-beta.
|
|
28
|
-
"url": "expo.modules.router-55.0.0-beta.
|
|
27
|
+
"name": "expo.modules.router-55.0.0-beta.3.aar",
|
|
28
|
+
"url": "expo.modules.router-55.0.0-beta.3.aar",
|
|
29
29
|
"size": 13665,
|
|
30
30
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
31
31
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
],
|
|
61
61
|
"files": [
|
|
62
62
|
{
|
|
63
|
-
"name": "expo.modules.router-55.0.0-beta.
|
|
64
|
-
"url": "expo.modules.router-55.0.0-beta.
|
|
63
|
+
"name": "expo.modules.router-55.0.0-beta.3.aar",
|
|
64
|
+
"url": "expo.modules.router-55.0.0-beta.3.aar",
|
|
65
65
|
"size": 13665,
|
|
66
66
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
67
67
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
},
|
|
81
81
|
"files": [
|
|
82
82
|
{
|
|
83
|
-
"name": "expo.modules.router-55.0.0-beta.
|
|
84
|
-
"url": "expo.modules.router-55.0.0-beta.
|
|
83
|
+
"name": "expo.modules.router-55.0.0-beta.3-sources.jar",
|
|
84
|
+
"url": "expo.modules.router-55.0.0-beta.3-sources.jar",
|
|
85
85
|
"size": 2318,
|
|
86
86
|
"sha512": "9864add8e93e3c0a9a9c930aaed67016b15054c3fafd59a0bd3a5402d7cdc5827be84c22c2c137f3e5acb4e39270d9bfb9ca3fe11234458d4f2e0d4c78747f48",
|
|
87
87
|
"sha256": "d5dff6259e86de721fc0f07fe740a5e18088e19b76738719b0a6f94caef06224",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f0060c5d2648215e2f783ce8f7dd03f0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6bcb5d92d9bd8e5ab2ec96874a3b8e7f4fa26b5d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4955c92a6f89f444258bfb559763183f3404e2e2623d045e1685b1f18b5fdc11
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a97ca4f7810030cfc0b0fa817f85e9f4a44e83f5f1a4c4fbb1db809581836c129d897d2e12d34c7c8620acfbb6bb08851f72d2911d379048715bb9698a5636c3
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.router</groupId>
|
|
11
11
|
<artifactId>expo.modules.router</artifactId>
|
|
12
|
-
<version>55.0.0-beta.
|
|
12
|
+
<version>55.0.0-beta.3</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.router</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4c1893431a69ff4b5a5a1da1597ae5bc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
81e5a672c86aa4bd82ef69691598570d830c2961
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d802ec63ed956e6cc50ac2f583529cfbfc14c5d986a3c4077f6ae056020aed23
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
831ddf0b8949fcd47f140f9eec4283459e62fc2e42aa63173f64b308566a0fb3888286e9398b0101df5d9751192da4ccce8c098356e08fc4d824566a5075e31f
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.router</groupId>
|
|
4
4
|
<artifactId>expo.modules.router</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>55.0.0-beta.
|
|
7
|
-
<release>55.0.0-beta.
|
|
6
|
+
<latest>55.0.0-beta.3</latest>
|
|
7
|
+
<release>55.0.0-beta.3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>55.0.0-beta.
|
|
9
|
+
<version>55.0.0-beta.3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260126041943</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f2dd6eef2fd83ef1cbc338dd52cef55b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
367c304848f56cca86f96e925a10fa79a5d0f52c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
82e779a273e8216818ef33a68825e7d65bbdded4fde536b2c6ba34fc6940fda0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
91c6f8d878c27b722d3237dd44a8d975e3cd3456b91fc8d92d28119d822919c8f76625b1d6226a6889c60a768ceea7754d340773b91677173767a2b2c7428c97
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "55.0.0-beta.
|
|
3
|
+
"version": "55.0.0-beta.3",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"expo"
|
|
82
82
|
],
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@expo/metro-runtime": "^55.0.
|
|
85
|
-
"@expo/log-box": "55.0.
|
|
84
|
+
"@expo/metro-runtime": "^55.0.2",
|
|
85
|
+
"@expo/log-box": "55.0.2",
|
|
86
86
|
"@react-navigation/drawer": "^7.7.2",
|
|
87
87
|
"@testing-library/react-native": ">= 12.0.0",
|
|
88
88
|
"expo": "*",
|
|
89
|
-
"expo-constants": "^55.0.
|
|
90
|
-
"expo-linking": "^55.0.
|
|
89
|
+
"expo-constants": "^55.0.2",
|
|
90
|
+
"expo-linking": "^55.0.3",
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-dom": "*",
|
|
93
93
|
"react-native": "*",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"react-server-dom-webpack": "~19.0.3"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@expo/metro-runtime": "^55.0.
|
|
136
|
-
"@expo/schema-utils": "^55.0.
|
|
135
|
+
"@expo/metro-runtime": "^55.0.2",
|
|
136
|
+
"@expo/schema-utils": "^55.0.2",
|
|
137
137
|
"@radix-ui/react-slot": "1.2.0",
|
|
138
138
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
139
139
|
"@react-navigation/bottom-tabs": "7.10.1",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"client-only": "^0.0.1",
|
|
143
143
|
"debug": "^4.3.4",
|
|
144
144
|
"escape-string-regexp": "^4.0.0",
|
|
145
|
-
"expo-image": "55.0.
|
|
146
|
-
"expo-server": "^55.0.
|
|
147
|
-
"expo-symbols": "^55.0.
|
|
145
|
+
"expo-image": "55.0.2",
|
|
146
|
+
"expo-server": "^55.0.2",
|
|
147
|
+
"expo-symbols": "^55.0.2",
|
|
148
148
|
"fast-deep-equal": "^3.1.3",
|
|
149
149
|
"invariant": "^2.2.4",
|
|
150
150
|
"nanoid": "^3.3.8",
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"use-latest-callback": "^0.2.1",
|
|
159
159
|
"vaul": "^1.1.2"
|
|
160
160
|
},
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "7d7f6762fc6907c27a329953c682134a84410dea"
|
|
162
162
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
992661bb38705c797bda63138df24424
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1e680ac7128b11762becab1ed5b2fe529d822a89
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
273bc768ca05a672aa3b6105ea84cc5963cf2992b8d2855bbb72f0521cb7cce4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2f0c215c0627c5d9b49799f576d0140a5304ab7ba781897dcbb1019f77afa0b8e99bc6d14b9ab43dd2edb3467746e32302172030fb87428b79a6e6a7af506523
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c3bd0a945b093757115ba2f7c24a252b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7f2d119d90ba6a5e92f234c11765b91a0054e9bd
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6bc1ddb4f7b26f010755d005b6950939e79ee6f7200398318aad52ad8476b30a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d1ba62a8d4efabb521d6717363a8bd97af31ebc2db01518686febc87c09658b8737a5b43644935e8dc1e2855eb72e5fdc2e7c954196a584ada6b739d8a45b45d
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|