expo-router 56.2.0 → 56.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/build/ExpoRoot.d.ts.map +1 -1
- package/build/ExpoRoot.js +7 -1
- package/build/ExpoRoot.js.map +1 -1
- package/build/getRoutesCore.d.ts.map +1 -1
- package/build/getRoutesCore.js +27 -17
- package/build/getRoutesCore.js.map +1 -1
- package/build/global-state/store.d.ts.map +1 -1
- package/build/global-state/store.js +1 -2
- package/build/global-state/store.js.map +1 -1
- package/build/hooks/index.d.ts +14 -0
- package/build/hooks/index.d.ts.map +1 -0
- package/build/hooks/index.js +30 -0
- package/build/hooks/index.js.map +1 -0
- package/build/hooks/useCurrentRouteInfo.d.ts +7 -0
- package/build/hooks/useCurrentRouteInfo.d.ts.map +1 -0
- package/build/hooks/useCurrentRouteInfo.js +18 -0
- package/build/hooks/useCurrentRouteInfo.js.map +1 -0
- package/build/hooks/useGlobalSearchParams.d.ts +37 -0
- package/build/hooks/useGlobalSearchParams.d.ts.map +1 -0
- package/build/hooks/useGlobalSearchParams.js +9 -0
- package/build/hooks/useGlobalSearchParams.js.map +1 -0
- package/build/hooks/useLoaderData.d.ts +23 -0
- package/build/hooks/useLoaderData.d.ts.map +1 -0
- package/build/hooks/useLoaderData.js +70 -0
- package/build/hooks/useLoaderData.js.map +1 -0
- package/build/hooks/useLocalSearchParams.d.ts +34 -0
- package/build/hooks/useLocalSearchParams.d.ts.map +1 -0
- package/build/hooks/useLocalSearchParams.js +44 -0
- package/build/hooks/useLocalSearchParams.js.map +1 -0
- package/build/hooks/useNavigationContainerRef.d.ts +6 -0
- package/build/hooks/useNavigationContainerRef.d.ts.map +1 -0
- package/build/hooks/useNavigationContainerRef.js +13 -0
- package/build/hooks/useNavigationContainerRef.js.map +1 -0
- package/build/hooks/usePathname.d.ts +19 -0
- package/build/hooks/usePathname.d.ts.map +1 -0
- package/build/hooks/usePathname.js +26 -0
- package/build/hooks/usePathname.js.map +1 -0
- package/build/hooks/useRootNavigation.d.ts +6 -0
- package/build/hooks/useRootNavigation.d.ts.map +1 -0
- package/build/hooks/useRootNavigation.js +13 -0
- package/build/hooks/useRootNavigation.js.map +1 -0
- package/build/hooks/useRootNavigationState.d.ts +18 -0
- package/build/hooks/useRootNavigationState.d.ts.map +1 -0
- package/build/hooks/useRootNavigationState.js +32 -0
- package/build/hooks/useRootNavigationState.js.map +1 -0
- package/build/hooks/useRouter.d.ts +21 -0
- package/build/hooks/useRouter.d.ts.map +1 -0
- package/build/hooks/useRouter.js +58 -0
- package/build/hooks/useRouter.js.map +1 -0
- package/build/hooks/useSearchParams.d.ts +4 -0
- package/build/hooks/useSearchParams.d.ts.map +1 -0
- package/build/hooks/useSearchParams.js +43 -0
- package/build/hooks/useSearchParams.js.map +1 -0
- package/build/hooks/useSegments.d.ts +42 -0
- package/build/hooks/useSegments.d.ts.map +1 -0
- package/build/hooks/useSegments.js +9 -0
- package/build/hooks/useSegments.js.map +1 -0
- package/build/hooks/useUnstableGlobalHref.d.ts +7 -0
- package/build/hooks/useUnstableGlobalHref.d.ts.map +1 -0
- package/build/hooks/useUnstableGlobalHref.js +14 -0
- package/build/hooks/useUnstableGlobalHref.js.map +1 -0
- package/build/internal/routing.d.ts +1 -1
- package/build/internal/routing.d.ts.map +1 -1
- package/build/internal/routing.js +2 -1
- package/build/internal/routing.js.map +1 -1
- package/build/internal/rsc.d.ts +1 -1
- package/build/internal/rsc.d.ts.map +1 -1
- package/build/internal/rsc.js +2 -1
- package/build/internal/rsc.js.map +1 -1
- package/build/layouts/stack-utils/StackTitle.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackTitle.js +3 -1
- package/build/layouts/stack-utils/StackTitle.js.map +1 -1
- package/build/loaders/LoaderCache.d.ts +5 -0
- package/build/loaders/LoaderCache.d.ts.map +1 -1
- package/build/loaders/LoaderCache.js +32 -0
- package/build/loaders/LoaderCache.js.map +1 -1
- package/build/native-tabs/NativeTabsView.shared.d.ts +2 -2
- package/build/native-tabs/NativeTabsView.shared.d.ts.map +1 -1
- package/build/native-tabs/common/elements.d.ts +40 -2
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js +3 -0
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/utils/materialIconConverter.android.d.ts +2 -2
- package/build/native-tabs/utils/materialIconConverter.android.d.ts.map +1 -1
- package/build/native-tabs/utils/materialIconConverter.android.js.map +1 -1
- package/build/native-tabs/utils/materialIconConverter.d.ts +2 -2
- package/build/native-tabs/utils/materialIconConverter.d.ts.map +1 -1
- package/build/native-tabs/utils/materialIconConverter.js.map +1 -1
- package/build/native-tabs/utils/optionsIconConverter.android.d.ts.map +1 -1
- package/build/native-tabs/utils/optionsIconConverter.android.js +22 -3
- package/build/native-tabs/utils/optionsIconConverter.android.js.map +1 -1
- package/build/rsc/router/client.d.ts.map +1 -1
- package/build/rsc/router/client.js +11 -3
- package/build/rsc/router/client.js.map +1 -1
- package/build/rsc/router/common.d.ts +1 -1
- package/build/rsc/router/common.d.ts.map +1 -1
- package/build/rsc/router/common.js +4 -12
- package/build/rsc/router/common.js.map +1 -1
- package/build/rsc/router/host.d.ts.map +1 -1
- package/build/rsc/router/host.js +2 -3
- package/build/rsc/router/host.js.map +1 -1
- package/build/rsc/router/idMinting.d.ts +31 -0
- package/build/rsc/router/idMinting.d.ts.map +1 -0
- package/build/rsc/router/idMinting.js +32 -0
- package/build/rsc/router/idMinting.js.map +1 -0
- package/build/ts-declarations/expo-router-internal-globals.d.ts +11 -1
- package/build/ts-declarations/expo-router-internal-globals.d.ts.map +1 -1
- package/build/ts-declarations/expo-router-internal-globals.js.map +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +3 -2
- package/build/useScreens.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.module → 56.2.2/expo.modules.router-56.2.2.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.pom → 56.2.2/expo.modules.router-56.2.2.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.2/expo.modules.router-56.2.2.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 +15 -15
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/vendor/react-helmet-async/lib/index.esm.js +1 -1
- package/vendor/react-helmet-async/lib/index.js +1 -1
- package/build/hooks.d.ts +0 -212
- package/build/hooks.d.ts.map +0 -1
- package/build/hooks.js +0 -313
- package/build/hooks.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.0/expo.modules.router-56.2.0.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0-sources.jar → 56.2.2/expo.modules.router-56.2.2-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0-sources.jar.md5 → 56.2.2/expo.modules.router-56.2.2-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0-sources.jar.sha1 → 56.2.2/expo.modules.router-56.2.2-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0-sources.jar.sha256 → 56.2.2/expo.modules.router-56.2.2-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0-sources.jar.sha512 → 56.2.2/expo.modules.router-56.2.2-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.aar → 56.2.2/expo.modules.router-56.2.2.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.aar.md5 → 56.2.2/expo.modules.router-56.2.2.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.aar.sha1 → 56.2.2/expo.modules.router-56.2.2.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.aar.sha256 → 56.2.2/expo.modules.router-56.2.2.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.0/expo.modules.router-56.2.0.aar.sha512 → 56.2.2/expo.modules.router-56.2.2.aar.sha512} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.useSearchParams = useSearchParams;
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const useGlobalSearchParams_1 = require("./useGlobalSearchParams");
|
|
10
|
+
const useLocalSearchParams_1 = require("./useLocalSearchParams");
|
|
11
|
+
// TODO(@ubax): Add missing JSDoc
|
|
12
|
+
function useSearchParams({ global = false } = {}) {
|
|
13
|
+
const globalRef = react_1.default.useRef(global);
|
|
14
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
15
|
+
if (global !== globalRef.current) {
|
|
16
|
+
console.warn(`Detected change in 'global' option of useSearchParams. This value cannot change between renders`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
20
|
+
const params = global ? (0, useGlobalSearchParams_1.useGlobalSearchParams)() : (0, useLocalSearchParams_1.useLocalSearchParams)();
|
|
21
|
+
const entries = Object.entries(params).flatMap(([key, value]) => {
|
|
22
|
+
if (global) {
|
|
23
|
+
if (key === 'params')
|
|
24
|
+
return [];
|
|
25
|
+
if (key === 'screen')
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
return Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]];
|
|
29
|
+
});
|
|
30
|
+
return new ReadOnlyURLSearchParams(entries);
|
|
31
|
+
}
|
|
32
|
+
class ReadOnlyURLSearchParams extends URLSearchParams {
|
|
33
|
+
set() {
|
|
34
|
+
throw new Error('The URLSearchParams object return from useSearchParams is read-only');
|
|
35
|
+
}
|
|
36
|
+
append() {
|
|
37
|
+
throw new Error('The URLSearchParams object return from useSearchParams is read-only');
|
|
38
|
+
}
|
|
39
|
+
delete() {
|
|
40
|
+
throw new Error('The URLSearchParams object return from useSearchParams is read-only');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useSearchParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearchParams.js","sourceRoot":"","sources":["../../src/hooks/useSearchParams.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAQb,0CAsBC;AA5BD,kDAA0B;AAE1B,mEAAgE;AAChE,iEAA8D;AAE9D,iCAAiC;AACjC,SAAgB,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,EAAE;IACrD,MAAM,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,IAAI,MAAM,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CACV,iGAAiG,CAClG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,sDAAsD;IACtD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,6CAAqB,GAAE,CAAC,CAAC,CAAC,IAAA,2CAAoB,GAAE,CAAC;IACzE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9D,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;YAChC,IAAI,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;QAClC,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,uBAAwB,SAAQ,eAAe;IACnD,GAAG;QACD,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IACD,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IACD,MAAM;QACJ,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;CACF","sourcesContent":["'use client';\n\nimport React from 'react';\n\nimport { useGlobalSearchParams } from './useGlobalSearchParams';\nimport { useLocalSearchParams } from './useLocalSearchParams';\n\n// TODO(@ubax): Add missing JSDoc\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"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RoutePath, RouteSegments } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a list of selected file segments for the currently selected route. Segments are not normalized,
|
|
4
|
+
* so they will be the same as the file path. For example, `/[id]?id=normal` becomes `["[id]"]`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx app/profile/[user].tsx
|
|
8
|
+
* import { Text } from 'react-native';
|
|
9
|
+
* import { useSegments } from 'expo-router';
|
|
10
|
+
*
|
|
11
|
+
* export default function Route() {
|
|
12
|
+
* // segments = ["profile", "[user]"]
|
|
13
|
+
* const segments = useSegments();
|
|
14
|
+
*
|
|
15
|
+
* return <Text>Hello</Text>;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* `useSegments` can be typed using an abstract. Consider the following file structure:
|
|
21
|
+
*
|
|
22
|
+
* ```md
|
|
23
|
+
* - app
|
|
24
|
+
* - [user]
|
|
25
|
+
* - index.tsx
|
|
26
|
+
* - followers.tsx
|
|
27
|
+
* - settings.tsx
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
* This can be strictly typed using the following abstract with `useSegments` hook:
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function useSegments<TSegments extends RoutePath = RoutePath>(): RouteSegments<TSegments>;
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export declare function useSegments<TSegments extends RouteSegments<RoutePath>>(): TSegments;
|
|
42
|
+
//# sourceMappingURL=useSegments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSegments.d.ts","sourceRoot":"","sources":["../../src/hooks/useSegments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,WAAW,CAAC,SAAS,SAAS,SAAS,GAAG,SAAS,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC;AAEjG;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,SAAS,aAAa,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useSegments = useSegments;
|
|
5
|
+
const useRouteInfo_1 = require("../global-state/useRouteInfo");
|
|
6
|
+
function useSegments() {
|
|
7
|
+
return (0, useRouteInfo_1.useRouteInfo)().segments;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=useSegments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSegments.js","sourceRoot":"","sources":["../../src/hooks/useSegments.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA8Cb,kCAEC;AA9CD,+DAA4D;AA4C5D,SAAgB,WAAW;IACzB,OAAO,IAAA,2BAAY,GAAE,CAAC,QAAQ,CAAC;AACjC,CAAC","sourcesContent":["'use client';\n\nimport { useRouteInfo } from '../global-state/useRouteInfo';\nimport type { RoutePath, RouteSegments } from '../types';\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 RoutePath = RoutePath>(): RouteSegments<TSegments>;\n\n/**\n * @hidden\n */\nexport function useSegments<TSegments extends RouteSegments<RoutePath>>(): TSegments;\nexport function useSegments() {\n return useRouteInfo().segments;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @private
|
|
3
|
+
* @returns The current global pathname with query params attached. This may change in the future to include the hostname
|
|
4
|
+
* from a predefined universal link. For example, `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useUnstableGlobalHref(): string;
|
|
7
|
+
//# sourceMappingURL=useUnstableGlobalHref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnstableGlobalHref.d.ts","sourceRoot":"","sources":["../../src/hooks/useUnstableGlobalHref.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useUnstableGlobalHref = useUnstableGlobalHref;
|
|
5
|
+
const useRouteInfo_1 = require("../global-state/useRouteInfo");
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @returns The current global pathname with query params attached. This may change in the future to include the hostname
|
|
9
|
+
* from a predefined universal link. For example, `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`.
|
|
10
|
+
*/
|
|
11
|
+
function useUnstableGlobalHref() {
|
|
12
|
+
return (0, useRouteInfo_1.useRouteInfo)().unstable_globalHref;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=useUnstableGlobalHref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnstableGlobalHref.js","sourceRoot":"","sources":["../../src/hooks/useUnstableGlobalHref.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AASb,sDAEC;AATD,+DAA4D;AAE5D;;;;GAIG;AACH,SAAgB,qBAAqB;IACnC,OAAO,IAAA,2BAAY,GAAE,CAAC,mBAAmB,CAAC;AAC5C,CAAC","sourcesContent":["'use client';\n\nimport { useRouteInfo } from '../global-state/useRouteInfo';\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"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { getReactNavigationConfig } from '../getReactNavigationConfig';
|
|
2
2
|
export { getRoutes, getExactRoutes, type Options as GetRoutesOptions } from '../getRoutes';
|
|
3
3
|
export { extrapolateGroups, generateDynamic, getRoutes as getRoutesCore, type Options as GetRoutesCoreOptions, type RewriteConfig, } from '../getRoutesCore';
|
|
4
|
-
export { getContextKey, isTypedRoute, matchGroupName, removeSupportedExtensions, stripGroupSegmentsFromPath, } from '../matchers';
|
|
4
|
+
export { getContextKey, isTypedRoute, matchDynamicName, matchGroupName, removeSupportedExtensions, stripGroupSegmentsFromPath, } from '../matchers';
|
|
5
5
|
export type { DynamicConvention, RouteNode } from '../Route';
|
|
6
6
|
export { sortRoutes } from '../sortRoutes';
|
|
7
7
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,SAAS,IAAI,aAAa,EAC1B,KAAK,OAAO,IAAI,oBAAoB,EACpC,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,SAAS,IAAI,aAAa,EAC1B,KAAK,OAAO,IAAI,oBAAoB,EACpC,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortRoutes = exports.stripGroupSegmentsFromPath = exports.removeSupportedExtensions = exports.matchGroupName = exports.isTypedRoute = exports.getContextKey = exports.getRoutesCore = exports.generateDynamic = exports.extrapolateGroups = exports.getExactRoutes = exports.getRoutes = exports.getReactNavigationConfig = void 0;
|
|
3
|
+
exports.sortRoutes = exports.stripGroupSegmentsFromPath = exports.removeSupportedExtensions = exports.matchGroupName = exports.matchDynamicName = exports.isTypedRoute = exports.getContextKey = exports.getRoutesCore = exports.generateDynamic = exports.extrapolateGroups = exports.getExactRoutes = exports.getRoutes = exports.getReactNavigationConfig = void 0;
|
|
4
4
|
var getReactNavigationConfig_1 = require("../getReactNavigationConfig");
|
|
5
5
|
Object.defineProperty(exports, "getReactNavigationConfig", { enumerable: true, get: function () { return getReactNavigationConfig_1.getReactNavigationConfig; } });
|
|
6
6
|
var getRoutes_1 = require("../getRoutes");
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "getRoutesCore", { enumerable: true, get: functio
|
|
|
13
13
|
var matchers_1 = require("../matchers");
|
|
14
14
|
Object.defineProperty(exports, "getContextKey", { enumerable: true, get: function () { return matchers_1.getContextKey; } });
|
|
15
15
|
Object.defineProperty(exports, "isTypedRoute", { enumerable: true, get: function () { return matchers_1.isTypedRoute; } });
|
|
16
|
+
Object.defineProperty(exports, "matchDynamicName", { enumerable: true, get: function () { return matchers_1.matchDynamicName; } });
|
|
16
17
|
Object.defineProperty(exports, "matchGroupName", { enumerable: true, get: function () { return matchers_1.matchGroupName; } });
|
|
17
18
|
Object.defineProperty(exports, "removeSupportedExtensions", { enumerable: true, get: function () { return matchers_1.removeSupportedExtensions; } });
|
|
18
19
|
Object.defineProperty(exports, "stripGroupSegmentsFromPath", { enumerable: true, get: function () { return matchers_1.stripGroupSegmentsFromPath; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AAA9D,oIAAA,wBAAwB,OAAA;AACjC,0CAA2F;AAAlF,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA;AAClC,kDAM0B;AALxB,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AACf,8GAAA,SAAS,OAAiB;AAI5B,
|
|
1
|
+
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AAA9D,oIAAA,wBAAwB,OAAA;AACjC,0CAA2F;AAAlF,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA;AAClC,kDAM0B;AALxB,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AACf,8GAAA,SAAS,OAAiB;AAI5B,wCAOqB;AANnB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AACZ,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,qHAAA,yBAAyB,OAAA;AACzB,sHAAA,0BAA0B,OAAA;AAG5B,4CAA2C;AAAlC,wGAAA,UAAU,OAAA","sourcesContent":["export { getReactNavigationConfig } from '../getReactNavigationConfig';\nexport { getRoutes, getExactRoutes, type Options as GetRoutesOptions } from '../getRoutes';\nexport {\n extrapolateGroups,\n generateDynamic,\n getRoutes as getRoutesCore,\n type Options as GetRoutesCoreOptions,\n type RewriteConfig,\n} from '../getRoutesCore';\nexport {\n getContextKey,\n isTypedRoute,\n matchDynamicName,\n matchGroupName,\n removeSupportedExtensions,\n stripGroupSegmentsFromPath,\n} from '../matchers';\nexport type { DynamicConvention, RouteNode } from '../Route';\nexport { sortRoutes } from '../sortRoutes';\n"]}
|
package/build/internal/rsc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ServerRouter } from '../rsc/router/client';
|
|
2
|
-
export { getComponentIds, getInputString, parseInputString, PARAM_KEY_SKIP, SHOULD_SKIP_ID, LOCATION_ID, type RouteProps, type ShouldSkip, } from '../rsc/router/common';
|
|
2
|
+
export { getComponentIds, getInputString, parseInputString, mintComponentId, type ComponentIdKind, type ComponentIds, PARAM_KEY_SKIP, SHOULD_SKIP_ID, LOCATION_ID, type RouteProps, type ShouldSkip, } from '../rsc/router/common';
|
|
3
3
|
export { Children, Slot } from '../rsc/router/host';
|
|
4
4
|
export { decodeActionId } from '../rsc/router/utils';
|
|
5
5
|
//# sourceMappingURL=rsc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/build/internal/rsc.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeActionId = exports.Slot = exports.Children = exports.LOCATION_ID = exports.SHOULD_SKIP_ID = exports.PARAM_KEY_SKIP = exports.parseInputString = exports.getInputString = exports.getComponentIds = exports.ServerRouter = void 0;
|
|
3
|
+
exports.decodeActionId = exports.Slot = exports.Children = exports.LOCATION_ID = exports.SHOULD_SKIP_ID = exports.PARAM_KEY_SKIP = exports.mintComponentId = exports.parseInputString = exports.getInputString = exports.getComponentIds = exports.ServerRouter = void 0;
|
|
4
4
|
var client_1 = require("../rsc/router/client");
|
|
5
5
|
Object.defineProperty(exports, "ServerRouter", { enumerable: true, get: function () { return client_1.ServerRouter; } });
|
|
6
6
|
var common_1 = require("../rsc/router/common");
|
|
7
7
|
Object.defineProperty(exports, "getComponentIds", { enumerable: true, get: function () { return common_1.getComponentIds; } });
|
|
8
8
|
Object.defineProperty(exports, "getInputString", { enumerable: true, get: function () { return common_1.getInputString; } });
|
|
9
9
|
Object.defineProperty(exports, "parseInputString", { enumerable: true, get: function () { return common_1.parseInputString; } });
|
|
10
|
+
Object.defineProperty(exports, "mintComponentId", { enumerable: true, get: function () { return common_1.mintComponentId; } });
|
|
10
11
|
Object.defineProperty(exports, "PARAM_KEY_SKIP", { enumerable: true, get: function () { return common_1.PARAM_KEY_SKIP; } });
|
|
11
12
|
Object.defineProperty(exports, "SHOULD_SKIP_ID", { enumerable: true, get: function () { return common_1.SHOULD_SKIP_ID; } });
|
|
12
13
|
Object.defineProperty(exports, "LOCATION_ID", { enumerable: true, get: function () { return common_1.LOCATION_ID; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,+
|
|
1
|
+
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,+CAY8B;AAX5B,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AAGf,wGAAA,cAAc,OAAA;AACd,wGAAA,cAAc,OAAA;AACd,qGAAA,WAAW,OAAA;AAIb,2CAAoD;AAA3C,gGAAA,QAAQ,OAAA;AAAE,4FAAA,IAAI,OAAA;AACvB,6CAAqD;AAA5C,uGAAA,cAAc,OAAA","sourcesContent":["export { ServerRouter } from '../rsc/router/client';\nexport {\n getComponentIds,\n getInputString,\n parseInputString,\n mintComponentId,\n type ComponentIdKind,\n type ComponentIds,\n PARAM_KEY_SKIP,\n SHOULD_SKIP_ID,\n LOCATION_ID,\n type RouteProps,\n type ShouldSkip,\n} from '../rsc/router/common';\nexport { Children, Slot } from '../rsc/router/host';\nexport { decodeActionId } from '../rsc/router/utils';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackTitle.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,KAAK,UAAU,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI3F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGxF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;QAChB,UAAU,CAAC,EAAE,SA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-
|
|
97
|
+
...(flattenedStyle?.textAlign !== undefined
|
|
98
|
+
? { headerTitleAlign: flattenedStyle.textAlign }
|
|
99
|
+
: {}),
|
|
98
100
|
headerTitleStyle: {
|
|
99
101
|
...flattenedStyle,
|
|
100
102
|
...(flattenedStyle?.fontWeight
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackTitle.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackTitle.tsx"],"names":[],"mappings":";;AA4GA,gCAeC;AAED,
|
|
1
|
+
{"version":3,"file":"StackTitle.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackTitle.tsx"],"names":[],"mappings":";;AA4GA,gCAeC;AAED,wEAoDC;;AAjLD,iCAAgD;AAChD,+CAA2F;AAE3F,6CAA0F;AAC1F,qFAAmF;AAEnF,6CAAwE;AA6CxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,SAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAmB;IACzF,MAAM,OAAO,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE,CACH,8BAA8B,CAC5B,EAAE;IACF,8CAA8C;IAC9C,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAG5C,CACF,EACH,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAC9C,CAAC;IACF,IAAA,0CAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,8BAA8B,CAC5C,OAAqC,EACrC,KAAsB;IAEtB,MAAM,cAAc,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,mBAAmB,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,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EAAE,UAAU;gBACjC,CAAC,CAAC;oBACE,UAAU,EAAE,IAAA,2CAAmC,EAAC,mBAAmB,EAAE,UAAU,CAAC;iBACjF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, type ReactNode } from 'react';\nimport { type ColorValue, StyleSheet, type StyleProp, type TextStyle } from 'react-native';\n\nimport { areAllChildrenPrimitiveValues, convertChildrenToString } from './toolbar/shared';\nimport { useCompositionOption } from '../../fork/native-stack/composition-options';\nimport type { NativeStackNavigationOptions } from '../../react-navigation/native-stack';\nimport { convertFontWeightToStringFontWeight } from '../../utils/style';\n\nexport type StackTitleProps = {\n /**\n * The title content. Pass a string for a plain text title,\n * or a custom component when `asChild` is enabled.\n */\n children?: ReactNode;\n /**\n * Use this to render a custom component as the header title.\n *\n * @example\n * ```tsx\n * <Stack.Title asChild>\n * <MyCustomTitle />\n * </Stack.Title>\n * ```\n */\n asChild?: boolean;\n style?: StyleProp<{\n fontFamily?: TextStyle['fontFamily'];\n fontSize?: TextStyle['fontSize'];\n fontWeight?: Exclude<TextStyle['fontWeight'], number>;\n color?: ColorValue;\n textAlign?: 'left' | 'center';\n }>;\n /**\n * Style properties for the large title header.\n *\n * @platform ios\n */\n largeStyle?: StyleProp<{\n fontFamily?: TextStyle['fontFamily'];\n fontSize?: TextStyle['fontSize'];\n fontWeight?: Exclude<TextStyle['fontWeight'], number>;\n color?: ColorValue;\n }>;\n /**\n * Enables large title mode.\n *\n * @platform ios\n */\n large?: boolean;\n};\n\n/**\n * Component to set the screen title.\n *\n * Can be used inside `Stack.Screen` in a layout or directly inside a screen component.\n *\n * @example\n * String title in a layout:\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"index\">\n * <Stack.Title large>Home</Stack.Title>\n * </Stack.Screen>\n * </Stack>\n * );\n * }\n * ```\n *\n * @example\n * String title inside a screen:\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Title>My Page</Stack.Title>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @example\n * Custom component as the title using `asChild`:\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"index\">\n * <Stack.Title asChild>\n * <MyCustomTitle />\n * </Stack.Title>\n * </Stack.Screen>\n * </Stack>\n * );\n * }\n * ```\n *\n * > **Note:** If multiple instances of this component are rendered for the same screen,\n * the last one rendered in the component tree takes precedence.\n */\nexport function StackTitle({ children, asChild, style, largeStyle, large }: StackTitleProps) {\n const options = useMemo(\n () =>\n appendStackTitlePropsToOptions(\n {},\n // satisfies ensures every prop is listed here\n { children, asChild, style, largeStyle, large } satisfies Record<\n keyof StackTitleProps,\n unknown\n >\n ),\n [children, asChild, style, largeStyle, large]\n );\n useCompositionOption(options);\n return null;\n}\n\nexport function appendStackTitlePropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackTitleProps\n): NativeStackNavigationOptions {\n const flattenedStyle = StyleSheet.flatten(props.style);\n const flattenedLargeStyle = StyleSheet.flatten(props.largeStyle);\n\n let titleOptions: NativeStackNavigationOptions = props.asChild\n ? { headerTitle: () => <>{props.children}</> }\n : { title: convertChildrenToString(props.children) };\n\n if (props.asChild && typeof props.children === 'string') {\n if (__DEV__) {\n console.warn(\n \"Stack.Title (or the deprecated Stack.Screen.Title): 'asChild' expects a custom component as children, string received.\"\n );\n }\n titleOptions = {};\n }\n if (!props.asChild && props.children != null && !areAllChildrenPrimitiveValues(props.children)) {\n if (__DEV__) {\n console.warn(\n 'Stack.Title (or the deprecated Stack.Screen.Title): Component passed without `asChild` enabled. In order to render a custom component as the title, set `asChild` to true.'\n );\n }\n titleOptions = {};\n }\n\n return {\n ...options,\n ...titleOptions,\n headerLargeTitle: props.large,\n ...(flattenedStyle?.textAlign !== undefined\n ? { headerTitleAlign: flattenedStyle.textAlign }\n : {}),\n headerTitleStyle: {\n ...flattenedStyle,\n ...(flattenedStyle?.fontWeight\n ? {\n fontWeight: convertFontWeightToStringFontWeight(flattenedStyle?.fontWeight),\n }\n : {}),\n },\n headerLargeTitleStyle: {\n ...flattenedLargeStyle,\n ...(flattenedLargeStyle?.fontWeight\n ? {\n fontWeight: convertFontWeightToStringFontWeight(flattenedLargeStyle?.fontWeight),\n }\n : {}),\n },\n };\n}\n"]}
|
|
@@ -9,6 +9,11 @@ export declare class LoaderCache {
|
|
|
9
9
|
private data;
|
|
10
10
|
private errors;
|
|
11
11
|
private promises;
|
|
12
|
+
private version;
|
|
13
|
+
private listeners;
|
|
14
|
+
subscribe: (listener: () => void) => (() => void);
|
|
15
|
+
getSnapshot: () => number;
|
|
16
|
+
invalidateAll(): void;
|
|
12
17
|
getData<T = unknown>(path: string): T | undefined;
|
|
13
18
|
hasData(path: string): boolean;
|
|
14
19
|
getError(path: string): Error | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoaderCache.d.ts","sourceRoot":"","sources":["../../src/loaders/LoaderCache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAA8B;IAC1C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,QAAQ,CAAuC;
|
|
1
|
+
{"version":3,"file":"LoaderCache.d.ts","sourceRoot":"","sources":["../../src/loaders/LoaderCache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAA8B;IAC1C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,QAAQ,CAAuC;IACvD,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,SAAS,CAAyB;IAI1C,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAK9C;IAEF,WAAW,QAAO,MAAM,CAEtB;IAEF,aAAa;IAQb,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIjD,OAAO,CAAC,IAAI,EAAE,MAAM;IAIpB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;IAIzC,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS;IAI7D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAIpC,UAAU,CAAC,IAAI,EAAE,MAAM;IAIvB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IAInC,WAAW,CAAC,IAAI,EAAE,MAAM;IAIxB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IAIlD,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,KAAK;CAKN;AAED,eAAO,MAAM,kBAAkB,aAAoB,CAAC;AACpD,eAAO,MAAM,kBAAkB,sCAAiD,CAAC"}
|
|
@@ -13,6 +13,26 @@ class LoaderCache {
|
|
|
13
13
|
data = new Map();
|
|
14
14
|
errors = new Map();
|
|
15
15
|
promises = new Map();
|
|
16
|
+
version = 0;
|
|
17
|
+
listeners = new Set();
|
|
18
|
+
// Arrow-bound so `loaderCache.subscribe` returns a stable reference across renders,
|
|
19
|
+
// which keeps `useSyncExternalStore()` from tearing down and re-attaching every render.
|
|
20
|
+
subscribe = (listener) => {
|
|
21
|
+
this.listeners.add(listener);
|
|
22
|
+
return () => {
|
|
23
|
+
this.listeners.delete(listener);
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
getSnapshot = () => {
|
|
27
|
+
return this.version;
|
|
28
|
+
};
|
|
29
|
+
invalidateAll() {
|
|
30
|
+
this.clear();
|
|
31
|
+
this.version++;
|
|
32
|
+
for (const listener of this.listeners) {
|
|
33
|
+
listener();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
16
36
|
getData(path) {
|
|
17
37
|
return this.data.get(path);
|
|
18
38
|
}
|
|
@@ -52,4 +72,16 @@ class LoaderCache {
|
|
|
52
72
|
exports.LoaderCache = LoaderCache;
|
|
53
73
|
exports.defaultLoaderCache = new LoaderCache();
|
|
54
74
|
exports.LoaderCacheContext = (0, react_1.createContext)(exports.defaultLoaderCache);
|
|
75
|
+
// On `loader-invalidate`, drop the server-injected initial data so `useLoaderData()` falls through
|
|
76
|
+
// to a fresh fetch, then bump the cache version so subscribed hooks re-render.
|
|
77
|
+
if (__DEV__ && typeof window !== 'undefined') {
|
|
78
|
+
globalThis.__EXPO_LOADER_INVALIDATE_LISTENERS__ ??= [];
|
|
79
|
+
if (!globalThis.__EXPO_LOADER_INVALIDATE_LISTENER_REGISTERED__) {
|
|
80
|
+
globalThis.__EXPO_LOADER_INVALIDATE_LISTENER_REGISTERED__ = true;
|
|
81
|
+
globalThis.__EXPO_LOADER_INVALIDATE_LISTENERS__.push(() => {
|
|
82
|
+
delete globalThis.__EXPO_ROUTER_LOADER_DATA__;
|
|
83
|
+
exports.defaultLoaderCache.invalidateAll();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
55
87
|
//# sourceMappingURL=LoaderCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoaderCache.js","sourceRoot":"","sources":["../../src/loaders/LoaderCache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,iCAAsC;AAEtC,MAAa,WAAW;IACd,IAAI,GAAG,IAAI,GAAG,EAAmB,CAAC;IAClC,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IAClC,QAAQ,GAAG,IAAI,GAAG,EAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"LoaderCache.js","sourceRoot":"","sources":["../../src/loaders/LoaderCache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,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C9C,0BAAkB,CAAC,aAAa,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["/**\n * Copyright © 2026 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { createContext } from 'react';\n\nexport class LoaderCache {\n private data = new Map<string, unknown>();\n private errors = new Map<string, Error>();\n private promises = new Map<string, Promise<unknown>>();\n private version = 0;\n private listeners = new Set<() => void>();\n\n // Arrow-bound so `loaderCache.subscribe` returns a stable reference across renders,\n // which keeps `useSyncExternalStore()` from tearing down and re-attaching every render.\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n getSnapshot = (): number => {\n return this.version;\n };\n\n invalidateAll() {\n this.clear();\n this.version++;\n for (const listener of this.listeners) {\n listener();\n }\n }\n\n getData<T = unknown>(path: string): T | undefined {\n return this.data.get(path) as T | undefined;\n }\n\n hasData(path: string) {\n return this.data.has(path);\n }\n\n getError(path: string): Error | undefined {\n return this.errors.get(path);\n }\n\n getPromise<T = unknown>(path: string): Promise<T> | undefined {\n return this.promises.get(path) as Promise<T> | undefined;\n }\n\n setData(path: string, value: unknown) {\n this.data.set(path, value);\n }\n\n deleteData(path: string) {\n this.data.delete(path);\n }\n\n setError(path: string, error: Error) {\n this.errors.set(path, error);\n }\n\n deleteError(path: string) {\n this.errors.delete(path);\n }\n\n setPromise(path: string, promise: Promise<unknown>) {\n this.promises.set(path, promise);\n }\n\n deletePromise(path: string) {\n this.promises.delete(path);\n }\n\n clear() {\n this.data.clear();\n this.errors.clear();\n this.promises.clear();\n }\n}\n\nexport const defaultLoaderCache = new LoaderCache();\nexport const LoaderCacheContext = createContext<LoaderCache>(defaultLoaderCache);\n\n// On `loader-invalidate`, drop the server-injected initial data so `useLoaderData()` falls through\n// to a fresh fetch, then bump the cache version so subscribed hooks re-render.\nif (__DEV__ && typeof window !== 'undefined') {\n globalThis.__EXPO_LOADER_INVALIDATE_LISTENERS__ ??= [];\n\n if (!globalThis.__EXPO_LOADER_INVALIDATE_LISTENER_REGISTERED__) {\n globalThis.__EXPO_LOADER_INVALIDATE_LISTENER_REGISTERED__ = true;\n globalThis.__EXPO_LOADER_INVALIDATE_LISTENERS__.push(() => {\n delete globalThis.__EXPO_ROUTER_LOADER_DATA__;\n defaultLoaderCache.invalidateAll();\n });\n }\n}\n"]}
|
|
@@ -32,8 +32,6 @@ export declare function useSharedScreenProps(props: InternalTabScreenProps): {
|
|
|
32
32
|
onWillAppear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
33
33
|
onWillDisappear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
34
34
|
orientation?: import("react-native-screens").TabsScreenOrientation | undefined;
|
|
35
|
-
onDidAppear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
36
|
-
onDidDisappear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
37
35
|
preventNativeSelection?: boolean | undefined | undefined;
|
|
38
36
|
badgeValue?: string | undefined | undefined;
|
|
39
37
|
specialEffects?: {
|
|
@@ -44,6 +42,8 @@ export declare function useSharedScreenProps(props: InternalTabScreenProps): {
|
|
|
44
42
|
} | undefined | undefined;
|
|
45
43
|
tabBarItemTestID?: string | undefined | undefined;
|
|
46
44
|
tabBarItemAccessibilityLabel?: string | undefined | undefined;
|
|
45
|
+
onDidAppear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
46
|
+
onDidDisappear?: import("react-native-screens").TabsScreenEventHandler<import("react-native-screens/lib/typescript/components/tabs/screen").EmptyObject> | undefined;
|
|
47
47
|
};
|
|
48
48
|
screenKey: string;
|
|
49
49
|
icon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.shared.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAIrE,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,UAAU,EACV,IAAI,GACL,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,CAgBA;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,GAC9C,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAU7C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,eAAe,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB;;mBAgBV,UAAU,GAAG,MAAM
|
|
1
|
+
{"version":3,"file":"NativeTabsView.shared.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAIrE,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,UAAU,EACV,IAAI,GACL,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,CAgBA;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,GAC9C,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAU7C;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,eAAe,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACxC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB;;mBAgBV,UAAU,GAAG,MAAM;;;;;;;;;;;;;;;;gCAZhE,CAAC;yBAGN,CAAA;2BAGE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;EAeR;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,eAAe,GAChB,EAAE;IACD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,eAAe,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACxC,2CAcA"}
|
|
@@ -121,9 +121,27 @@ export interface XcassetIcon {
|
|
|
121
121
|
export interface DrawableIcon {
|
|
122
122
|
/**
|
|
123
123
|
* The name of the drawable resource to use as an icon.
|
|
124
|
+
*
|
|
125
|
+
* The value can be provided in two ways:
|
|
126
|
+
* - As a string with the drawable resource name
|
|
127
|
+
* - As an object specifying the default and selected states
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <Icon drawable="ic_home" />
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* <Icon drawable={{ default: 'ic_home_outline', selected: 'ic_home_filled' }} />
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
124
139
|
* @platform android
|
|
125
140
|
*/
|
|
126
|
-
drawable?: string
|
|
141
|
+
drawable?: string | {
|
|
142
|
+
default?: string;
|
|
143
|
+
selected: string;
|
|
144
|
+
};
|
|
127
145
|
}
|
|
128
146
|
/**
|
|
129
147
|
* Material icon name for Android native tabs.
|
|
@@ -133,8 +151,25 @@ export interface DrawableIcon {
|
|
|
133
151
|
export interface MaterialIcon {
|
|
134
152
|
/**
|
|
135
153
|
* Material icon glyph name. See the [Material icons for the complete catalog](https://fonts.google.com/icons).
|
|
154
|
+
*
|
|
155
|
+
* The value can be provided in two ways:
|
|
156
|
+
* - As a string with the Material icon name
|
|
157
|
+
* - As an object specifying the default and selected states
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <Icon md="home" />
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```tsx
|
|
166
|
+
* <Icon md={{ default: 'home', selected: 'home_filled' }} />
|
|
167
|
+
* ```
|
|
136
168
|
*/
|
|
137
|
-
md: AndroidSymbol
|
|
169
|
+
md: AndroidSymbol | {
|
|
170
|
+
default?: AndroidSymbol;
|
|
171
|
+
selected: AndroidSymbol;
|
|
172
|
+
};
|
|
138
173
|
}
|
|
139
174
|
export type NativeTabsTriggerIconProps = {
|
|
140
175
|
selectedColor?: ColorValue;
|
|
@@ -144,6 +179,9 @@ export type NativeTabsTriggerIconProps = {
|
|
|
144
179
|
*
|
|
145
180
|
* Accepts various icon sources such as SF Symbols, xcasset images, drawable resources, material icons, or image sources.
|
|
146
181
|
*
|
|
182
|
+
* Each icon prop (`sf`, `xcasset`, `drawable`, `md`, `src`) can be either a single value, or an object
|
|
183
|
+
* with `{ default, selected }` to use a distinct icon when the tab is selected.
|
|
184
|
+
*
|
|
147
185
|
* Acceptable props combinations:
|
|
148
186
|
* - `sf` and `drawable` - `sf` will be used for iOS icon, `drawable` for Android icon
|
|
149
187
|
* - `sf` and `src` - `sf` will be used for iOS icon, `src` for Android icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAsB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAChD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAAS,CAAC;AAEnF,MAAM,WAAW,OAAO;IACtB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,CAAC,EACA,mBAAmB,GACnB,KAAK,CAAC,YAAY,GAClB;QACE,OAAO,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAAC;QACnD,QAAQ,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAAC;KACpD,CAAC;IACN;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACzC;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,EAAE,CAA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;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAQ,CAAC;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,mBAAa,CAAC;AAEtD,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,SAGzC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB,CAAC,EAAE,UAAU,CAAC;CACtC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAAS,CAAC;AAEnF,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAE9E,CAAC"}
|
|
@@ -8,6 +8,9 @@ exports.NativeTabsTriggerLabel = primitives_1.Label;
|
|
|
8
8
|
*
|
|
9
9
|
* Accepts various icon sources such as SF Symbols, xcasset images, drawable resources, material icons, or image sources.
|
|
10
10
|
*
|
|
11
|
+
* Each icon prop (`sf`, `xcasset`, `drawable`, `md`, `src`) can be either a single value, or an object
|
|
12
|
+
* with `{ default, selected }` to use a distinct icon when the tab is selected.
|
|
13
|
+
*
|
|
11
14
|
* Acceptable props combinations:
|
|
12
15
|
* - `sf` and `drawable` - `sf` will be used for iOS icon, `drawable` for Android icon
|
|
13
16
|
* - `sf` and `src` - `sf` will be used for iOS icon, `src` for Android icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;;AAIA,iDAAkE;AAgBrD,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;;AAIA,iDAAkE;AAgBrD,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;AAqKnF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,qBAAqB,GAAyC,iBAAI,CAAC;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,2BAA2B,GAAG,uBAAU,CAAC;AAM/C,MAAM,4BAA4B,GAAG,SAAS,4BAA4B,CAC/E,KAAwC;IAExC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAJW,QAAA,4BAA4B,gCAIvC;AAiBW,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;AAMnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,yBAAyB,GAA6C,GAAG,EAAE;IACtF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","sourcesContent":["import type { AndroidSymbol } from 'expo-symbols';\nimport type { ColorValue, ImageSourcePropType, StyleProp } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { Label, Icon, Badge, VectorIcon } from '../../primitives';\nimport type { NativeTabsLabelStyle } from '../types';\n\nexport interface NativeTabsTriggerLabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n selectedStyle?: StyleProp<NativeTabsLabelStyle>;\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport const NativeTabsTriggerLabel: React.FC<NativeTabsTriggerLabelProps> = Label;\n\nexport interface SrcIcon {\n /**\n * The image source to use as an icon.\n *\n * When `sf` prop is used it will override this prop on iOS.\n *\n * When `drawable` or `material` prop is used it will override this prop on Android.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon src={require('./path/to/icon.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />\n * ```\n *\n * @platform Android\n * @platform iOS\n */\n src?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n /**\n * Controls how the image icon is rendered on iOS.\n *\n * - `'template'`: iOS applies tint color to the icon (selected/unselected states)\n * - `'original'`: Preserves original icon colors\n *\n * **Default behavior:**\n * - If tab bar icon color is configured, defaults to `'template'`\n * - If no icon color is set, defaults to `'original'`\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform ios\n */\n renderingMode?: 'template' | 'original';\n}\n\nexport interface SFSymbolIcon {\n /**\n * The name of the SF Symbol to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon sf={{ default: \"house\", selected: \"house.fill\" }} />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n}\n\nexport interface XcassetIcon {\n /**\n * The name of the iOS asset catalog image to use as an icon.\n *\n * Xcassets provide automatic multi-resolution (@1x/@2x/@3x), dark mode variants,\n * and device-specific images via `[UIImage imageNamed:]`.\n *\n * The rendering mode (template vs original) can be controlled via the `renderingMode` prop\n * on the `Icon` component. By default, icons are tinted when `iconColor` is set, and\n * rendered as original otherwise.\n *\n * The value can be provided in two ways:\n * - As a string with the asset catalog image name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon xcasset=\"custom-icon\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon xcasset={{ default: \"home-outline\", selected: \"home-filled\" }} />\n * ```\n *\n * @platform iOS\n */\n xcasset?: string | { default?: string; selected: string };\n}\n\nexport interface DrawableIcon {\n /**\n * The name of the drawable resource to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the drawable resource name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon drawable=\"ic_home\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon drawable={{ default: 'ic_home_outline', selected: 'ic_home_filled' }} />\n * ```\n *\n * @platform android\n */\n drawable?: string | { default?: string; selected: string };\n}\n\n/**\n * Material icon name for Android native tabs.\n *\n * @platform android\n */\nexport interface MaterialIcon {\n /**\n * Material icon glyph name. See the [Material icons for the complete catalog](https://fonts.google.com/icons).\n *\n * The value can be provided in two ways:\n * - As a string with the Material icon name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon md=\"home\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon md={{ default: 'home', selected: 'home_filled' }} />\n * ```\n */\n md: AndroidSymbol | { default?: AndroidSymbol; selected: AndroidSymbol };\n}\n\nexport type NativeTabsTriggerIconProps = { selectedColor?: ColorValue } & (\n | (SFSymbolIcon & DrawableIcon)\n | (SFSymbolIcon & MaterialIcon)\n | (SFSymbolIcon & SrcIcon)\n | (XcassetIcon & DrawableIcon)\n | (XcassetIcon & MaterialIcon)\n | (XcassetIcon & SrcIcon)\n | (MaterialIcon & SrcIcon)\n | (DrawableIcon & SrcIcon)\n | SrcIcon\n);\n\n/**\n * Renders an icon for the tab.\n *\n * Accepts various icon sources such as SF Symbols, xcasset images, drawable resources, material icons, or image sources.\n *\n * Each icon prop (`sf`, `xcasset`, `drawable`, `md`, `src`) can be either a single value, or an object\n * with `{ default, selected }` to use a distinct icon when the tab is selected.\n *\n * Acceptable props combinations:\n * - `sf` and `drawable` - `sf` will be used for iOS icon, `drawable` for Android icon\n * - `sf` and `src` - `sf` will be used for iOS icon, `src` for Android icon\n * - `xcasset` and `drawable` - `xcasset` will be used for iOS icon, `drawable` for Android icon\n * - `xcasset` and `md` - `xcasset` will be used for iOS icon, `md` for Android icon\n * - `xcasset` and `src` - `xcasset` will be used for iOS icon, `src` for Android icon\n * - `src` and `drawable` - `src` will be used for iOS icon, `drawable` for Android icon\n * - `src` only - `src` will be used for both iOS and Android icons\n *\n * Priority on iOS: `sf` > `xcasset` > `src`. Priority on Android: `drawable` > `md` > `src`.\n *\n * @platform ios\n * @platform android\n */\nexport const NativeTabsTriggerIcon: React.FC<NativeTabsTriggerIconProps> = Icon;\n\n/**\n * Helper component which can be used to load vector icons for `NativeTabs`.\n *\n * @example\n * ```tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"index\">\n * <NativeTabs.Trigger.Icon src={<NativeTabs.Trigger.VectorIcon family={MaterialCommunityIcons} name=\"home\" />} />\n * </NativeTabs.Trigger>\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport const NativeTabsTriggerVectorIcon = VectorIcon;\n\nexport interface NativeTabsTriggerPromiseIconProps {\n loader: () => Promise<ImageSourcePropType | null>;\n}\n\nexport const NativeTabsTriggerPromiseIcon = function NativeTabsTriggerPromiseIcon(\n props: NativeTabsTriggerPromiseIconProps\n) {\n return null;\n};\n\nexport interface NativeTabsTriggerBadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n selectedBackgroundColor?: ColorValue;\n}\n\nexport const NativeTabsTriggerBadge: React.FC<NativeTabsTriggerBadgeProps> = Badge;\n\nexport interface NativeTabsBottomAccessoryProps {\n children?: React.ReactNode;\n}\n\n/**\n * A [bottom accessory](https://developer.apple.com/documentation/uikit/uitabbarcontroller/bottomaccessory) for `NativeTabs` on iOS 26 and above.\n *\n * @example\n * ```tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.BottomAccessory>\n * <YourAccessoryComponent />\n * </NativeTabs.BottomAccessory>\n * <NativeTabs.Trigger name=\"index\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @platform iOS 26+\n */\nexport const NativeTabsBottomAccessory: React.FC<NativeTabsBottomAccessoryProps> = () => {\n return null;\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { type AndroidSymbol } from 'expo-symbols';
|
|
1
2
|
import { convertComponentSrcToImageSource } from './icon';
|
|
2
|
-
|
|
3
|
-
export declare function convertMaterialIconNameToImageSource(name: MaterialIcon['md']): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
3
|
+
export declare function convertMaterialIconNameToImageSource(name: AndroidSymbol): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
4
4
|
//# sourceMappingURL=materialIconConverter.android.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialIconConverter.android.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"materialIconConverter.android.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEzF,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAG1D,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,aAAa,GAClB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAMrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialIconConverter.android.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":";;AAKA,oFAQC;;AAbD,+
|
|
1
|
+
{"version":3,"file":"materialIconConverter.android.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.android.tsx"],"names":[],"mappings":";;AAKA,oFAQC;;AAbD,+CAAyF;AAEzF,iCAA0D;AAC1D,iDAAkE;AAElE,SAAgB,oCAAoC,CAClD,IAAmB;IAEnB,OAAO,IAAA,uCAAgC,EACrC,uBAAC,uCAA4B,IAC3B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAA,oDAAqC,EAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,GACtE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { unstable_getMaterialSymbolSourceAsync, type AndroidSymbol } from 'expo-symbols';\n\nimport { convertComponentSrcToImageSource } from './icon';\nimport { NativeTabsTriggerPromiseIcon } from '../common/elements';\n\nexport function convertMaterialIconNameToImageSource(\n name: AndroidSymbol\n): ReturnType<typeof convertComponentSrcToImageSource> {\n return convertComponentSrcToImageSource(\n <NativeTabsTriggerPromiseIcon\n loader={() => unstable_getMaterialSymbolSourceAsync(name, 24, 'white')}\n />\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import type { AndroidSymbol } from 'expo-symbols';
|
|
1
2
|
import type { convertComponentSrcToImageSource } from './icon';
|
|
2
|
-
|
|
3
|
-
export declare function convertMaterialIconNameToImageSource(name: MaterialIcon['md']): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
3
|
+
export declare function convertMaterialIconNameToImageSource(name: AndroidSymbol): ReturnType<typeof convertComponentSrcToImageSource>;
|
|
4
4
|
//# sourceMappingURL=materialIconConverter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialIconConverter.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"materialIconConverter.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAE/D,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,aAAa,GAClB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAKrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialIconConverter.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"materialIconConverter.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter.tsx"],"names":[],"mappings":";;AAIA,oFAOC;AAPD,SAAgB,oCAAoC,CAClD,IAAmB;IAEnB,OAAO,CAAC,IAAI,CACV,sHAAsH,CACvH,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { AndroidSymbol } from 'expo-symbols';\n\nimport type { convertComponentSrcToImageSource } from './icon';\n\nexport function convertMaterialIconNameToImageSource(\n name: AndroidSymbol\n): ReturnType<typeof convertComponentSrcToImageSource> {\n console.warn(\n 'Using convertMaterialIconNameToImageSource on unsupported platform. This is most likely an internal expo router bug.'\n );\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionsIconConverter.android.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/optionsIconConverter.android.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"optionsIconConverter.android.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/optionsIconConverter.android.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,QAuC7F;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,mBAAmB,GAAG,SAAS,CAWjC"}
|