expo-router 57.0.4 → 57.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/build/exports.d.ts +1 -0
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js.map +1 -1
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.js +5 -2
- package/build/fork/extractPathFromURL.js.map +1 -1
- package/build/global-state/getRouteInfoFromState.d.ts.map +1 -1
- package/build/global-state/getRouteInfoFromState.js +3 -11
- package/build/global-state/getRouteInfoFromState.js.map +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeTabTrigger.js +9 -1
- package/build/native-tabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/types.d.ts +31 -0
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/build/testing-library/context-stubs.d.ts +13 -0
- package/build/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js +38 -2
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/toolbar/native.android.d.ts.map +1 -1
- package/build/toolbar/native.android.js +6 -2
- package/build/toolbar/native.android.js.map +1 -1
- package/build/utils/url.d.ts +2 -0
- package/build/utils/url.d.ts.map +1 -1
- package/build/utils/url.js +21 -0
- package/build/utils/url.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.module → 57.0.5/expo.modules.router-57.0.5.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.pom → 57.0.5/expo.modules.router-57.0.5.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.5/expo.modules.router-57.0.5.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 +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/57.0.4/expo.modules.router-57.0.4.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4-sources.jar → 57.0.5/expo.modules.router-57.0.5-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4-sources.jar.md5 → 57.0.5/expo.modules.router-57.0.5-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4-sources.jar.sha1 → 57.0.5/expo.modules.router-57.0.5-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4-sources.jar.sha256 → 57.0.5/expo.modules.router-57.0.5-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4-sources.jar.sha512 → 57.0.5/expo.modules.router-57.0.5-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.aar → 57.0.5/expo.modules.router-57.0.5.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.aar.md5 → 57.0.5/expo.modules.router-57.0.5.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.aar.sha1 → 57.0.5/expo.modules.router-57.0.5.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.aar.sha256 → 57.0.5/expo.modules.router-57.0.5.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{57.0.4/expo.modules.router-57.0.4.aar.sha512 → 57.0.5/expo.modules.router-57.0.5.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 = '57.0.
|
|
7
|
+
version = '57.0.5'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "57.0.
|
|
13
|
+
versionName "57.0.5"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
package/build/exports.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { DarkTheme } from './react-navigation/native/theming/DarkTheme';
|
|
|
23
23
|
export { DefaultTheme } from './react-navigation/native/theming/DefaultTheme';
|
|
24
24
|
export { ThemeProvider } from './react-navigation/core/theming/ThemeProvider';
|
|
25
25
|
export { useTheme } from './react-navigation/core/theming/useTheme';
|
|
26
|
+
export type { Theme } from './react-navigation/native/types';
|
|
26
27
|
export { useRoutePath } from './react-navigation/native/useRoutePath';
|
|
27
28
|
export { useScrollToTop } from './react-navigation/native/useScrollToTop';
|
|
28
29
|
export { useRoute } from './react-navigation/core/useRoute';
|
package/build/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAA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AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EACV,kCAAkC,EAClC,mCAAmC,EACnC,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AAItC,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAC/B,gCAAgC,EAChC,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,iCAAiC,CAAC"}
|
package/build/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,iDAAoD;AAmB3C,0FAnBA,qBAAS,OAmBA;AAAE,qFAnBA,gBAAI,OAmBA;AAjBxB,iCAYiB;AAXf,kGAAA,SAAS,OAAA;AACT,8GAAA,qBAAqB,OAAA;AACrB,oGAAA,WAAW,OAAA;AACX,kHAAA,yBAAyB,OAAA;AACzB,8GAAA,qBAAqB,OAAA;AACrB,6GAAA,oBAAoB,OAAA;AACpB,oGAAA,WAAW,OAAA;AACX,0GAAA,iBAAiB,OAAA;AACjB,+GAAA,sBAAsB,OAAA;AACtB,sGAAA,aAAa,OAAA;AACb,4GAAA,mBAAmB,OAAA;AAGrB,mDAAiE;AAAxD,wGAAA,MAAM,OAAA;AAEf,iEAAgE;AAAvD,sHAAA,iBAAiB,OAAA;AAG1B,oBAAoB;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,sGAAA,S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kGAAA,OAAO,OAAA;AAChB,iDAAkE;AAAzD,wGAAA,UAAU,OAAA;AAEnB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,6DAAwF;AAA/E,oHAAA,gBAAgB,OAAA;AAGzB,WAAW;AACX;;GAEG;AACH,+DAA+C;AAE/C,mBAAmB;AACnB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,mDAAuE;AAA9D,gHAAA,cAAc,OAAA;AACvB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAGrB,yEAAwE;AAA/D,sGAAA,SAAS,OAAA;AAClB,+EAA8E;AAArE,4GAAA,YAAY,OAAA;AACrB,+EAA8E;AAArE,8GAAA,aAAa,OAAA;AACtB,qEAAoE;AAA3D,oGAAA,QAAQ,OAAA;AAEjB,uEAAsE;AAA7D,4GAAA,YAAY,OAAA;AACrB,2EAA0E;AAAjE,gHAAA,cAAc,OAAA;AACvB,6DAA4D;AAAnD,oGAAA,QAAQ,OAAA;AAOjB,2CASsB;AARpB,mGAAA,KAAK,OAAA;AAEL,kGAAA,IAAI,OAAA;AAEJ,mGAAA,KAAK,OAAA;AAEL,wGAAA,UAAU,OAAA;AAIZ,6DAG+B;AAF7B,6IAAA,sCAAsC,OAAA;AACtC,mIAAA,4BAA4B,OAAA;AAS9B,2GAA2G;AAC3G,sDAAoE;AAA3D,sGAAA,WAAW,OAAA;AAAE,oGAAA,SAAS,OAAA;AAQ/B,uDAA+D;AAAtD,6HAAA,yBAAyB,OAAA;AAUlC;;GAEG;AACH,uCAAsC;AAA7B,4FAAA,IAAI,OAAA;AAEb,mEAAiE;AAAxD,uHAAA,iBAAiB,OAAA","sourcesContent":["// Expo Router API\nimport { Navigator, Slot } from './views/Navigator';\n\nexport {\n useRouter,\n useUnstableGlobalHref,\n usePathname,\n useNavigationContainerRef,\n useGlobalSearchParams,\n useLocalSearchParams,\n useSegments,\n useRootNavigation,\n useRootNavigationState,\n useLoaderData,\n useCurrentRouteInfo,\n} from './hooks';\n\nexport { router, type ImperativeRouter } from './imperative-api';\n\nexport { withLayoutContext } from './layouts/withLayoutContext';\nexport { Navigator, Slot };\n\n// Expo Router Views\nexport { ExpoRoot } from './ExpoRoot';\nexport { Unmatched } from './views/Unmatched';\nexport { Sitemap } from './views/Sitemap';\nexport { useSitemap, type SitemapType } from './views/useSitemap';\nexport type { ErrorBoundaryProps } from './views/Try';\nexport { ErrorBoundary } from './views/ErrorBoundary';\nexport { SuspenseFallback, type SuspenseFallbackProps } from './views/SuspenseFallback';\nexport type { ScreenProps } from './useScreens';\n\n// Platform\n/**\n * @hidden\n */\nexport * as SplashScreen from './views/Splash';\n\n// React Navigation\nexport { useNavigation } from './useNavigation';\nexport { useFocusEffect, type EffectCallback } from './useFocusEffect';\nexport { useIsFocused } from './useIsFocused';\nexport type { ResultState } from './fork/getStateFromPath';\n\nexport { DarkTheme } from './react-navigation/native/theming/DarkTheme';\nexport { DefaultTheme } from './react-navigation/native/theming/DefaultTheme';\nexport { ThemeProvider } from './react-navigation/core/theming/ThemeProvider';\nexport { useTheme } from './react-navigation/core/theming/useTheme';\nexport type { Theme } from './react-navigation/native/types';\nexport { useRoutePath } from './react-navigation/native/useRoutePath';\nexport { useScrollToTop } from './react-navigation/native/useScrollToTop';\nexport { useRoute } from './react-navigation/core/useRoute';\n\nexport type { RedirectConfig } from './getRoutesCore';\nexport type { SingularOptions } from './useScreens';\n\nexport type * from './types';\n\nexport {\n Badge,\n type BadgeProps,\n Icon,\n type IconProps,\n Label,\n type LabelProps,\n VectorIcon,\n type VectorIconProps,\n} from './primitives';\n\nexport {\n unstable_createStandardRouterNavigator,\n unstable_integrateWithRouter,\n} from './standard-navigation';\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './standard-navigation';\n\n// Router factories for use with `unstable_createStandardRouterNavigator` / `unstable_integrateWithRouter`.\nexport { StackRouter, TabRouter } from './react-navigation/routers';\nexport type {\n StackNavigationState,\n StackRouterOptions,\n TabNavigationState,\n TabRouterOptions,\n} from './react-navigation/routers';\n\nexport { unstable_navigationEvents } from './navigationEvents';\nexport type {\n PagePreloadedEvent,\n PageFocusedEvent,\n PageBlurredEvent,\n PageRemoved,\n ActionDispatchedEvent,\n AnalyticsEvent,\n} from './navigationEvents';\n\n/**\n * @deprecated Use `import { Tabs } from 'expo-router/js-tabs'` instead.\n */\nexport { Tabs } from './layouts/Tabs';\n\nexport { ExperimentalStack } from './layouts/experimental-stack';\nexport type {\n ExperimentalStackNavigationOptions,\n ExperimentalStackNavigationEventMap,\n ExperimentalStackNavigationProp,\n ExperimentalStackScreenProps,\n} from './layouts/experimental-stack';\n\n// Copied from packages/expo-router/src/react-navigation/native-stack/index.tsx\n// Keep in sync\nexport type {\n NativeStackHeaderBackProps,\n NativeStackHeaderItem,\n NativeStackHeaderItemButton,\n NativeStackHeaderItemCustom,\n NativeStackHeaderItemMenu,\n NativeStackHeaderItemMenuAction,\n NativeStackHeaderItemMenuSubmenu,\n NativeStackHeaderItemProps,\n NativeStackHeaderItemSpacing,\n NativeStackHeaderLeftProps,\n NativeStackHeaderProps,\n NativeStackHeaderRightProps,\n NativeStackHeaderNativeProps,\n NativeStackNativeProps,\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackNavigationProp,\n NativeStackNavigatorProps,\n NativeStackOptionsArgs,\n NativeStackScreenNativeProps,\n NativeStackScreenProps,\n} from './react-navigation/native-stack';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractPathFromURL.d.ts","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":"AAEA,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAUA;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI3D;AA6GD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAW,UAM3E"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.parsePathAndParamsFromExpoGoLink = parsePathAndParamsFromExpoGoLink;
|
|
4
4
|
exports.parsePathFromExpoGoLink = parsePathFromExpoGoLink;
|
|
5
5
|
exports.extractExpoPathFromURL = extractExpoPathFromURL;
|
|
6
|
+
const url_1 = require("../utils/url");
|
|
6
7
|
function parsePathAndParamsFromExpoGoLink(url) {
|
|
7
8
|
// If the URL is defined (default in Expo Go dev apps) and the URL has no path:
|
|
8
9
|
// `exp://192.168.87.39:19000/` then use the default `exp://192.168.87.39:19000/--/`
|
|
@@ -84,7 +85,7 @@ function fromDeepLink(url) {
|
|
|
84
85
|
return '';
|
|
85
86
|
}
|
|
86
87
|
const incomingUrl = res.searchParams.get('url');
|
|
87
|
-
return extractExactPathFromURL(
|
|
88
|
+
return extractExactPathFromURL((0, url_1.safeDecodeURI)(incomingUrl));
|
|
88
89
|
}
|
|
89
90
|
let results = '';
|
|
90
91
|
if (res.host) {
|
|
@@ -96,7 +97,9 @@ function fromDeepLink(url) {
|
|
|
96
97
|
const qs = !res.search
|
|
97
98
|
? ''
|
|
98
99
|
: // @ts-ignore: `entries` is not on `URLSearchParams` in some typechecks.
|
|
99
|
-
[...res.searchParams.entries()]
|
|
100
|
+
[...res.searchParams.entries()]
|
|
101
|
+
.map(([k, v]) => `${k}=${(0, url_1.safeDecodeURIComponent)(v)}`)
|
|
102
|
+
.join('&');
|
|
100
103
|
if (qs) {
|
|
101
104
|
results += '?' + qs;
|
|
102
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractPathFromURL.js","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extractPathFromURL.js","sourceRoot":"","sources":["../../src/fork/extractPathFromURL.ts"],"names":[],"mappings":";;AAEA,4EAaC;AAED,0DAIC;AA6GD,wDAMC;AAxID,sCAAqE;AAErE,SAAgB,gCAAgC,CAAC,GAAW;IAI1D,+EAA+E;IAC/E,oFAAoF;IAEpF,MAAM,IAAI,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO;QACL,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QAC5B,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;KAChC,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,GAAW;IACjD,+EAA+E;IAC/E,oFAAoF;IACpF,OAAO,GAAG,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACzD,CAAC;AAED,8BAA8B;AAC9B,SAAS,uBAAuB,CAAC,GAAW;IAC1C;IACE,2EAA2E;IAC3E,4CAA4C;IAC5C,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,EACzB,CAAC;QACD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAEhD,IAAI,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;YACzD,wEAAwE;YACxE,kGAAkG;YAClG,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,E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AAC;YACjC,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;QACjD,OAAO,uBAAuB,CAAC,IAAA,mBAAa,EAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjB,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM;QACpB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,wEAAwE;YACxE,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;iBAC5B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,IAAA,4BAAsB,EAAC,CAAC,CAAC,EAAE,CAAC;iBACpD,IAAI,CAAC,GAAG,CAAC,CAAC;IAEjB,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,IAAI,GAAG,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,sBAAsB,CAAC,SAAmB,EAAE,MAAc,EAAE;IAC1E,OAAO,CACL,uBAAuB,CAAC,GAAG,CAAC;QAC1B,sEAAsE;SACrE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,CAAC;AACJ,CAAC","sourcesContent":["import { safeDecodeURI, safeDecodeURIComponent } from '../utils/url';\n\nexport function parsePathAndParamsFromExpoGoLink(url: string): {\n pathname: string;\n queryString: string;\n} {\n // If the URL is defined (default in Expo Go dev apps) and the URL has no path:\n // `exp://192.168.87.39:19000/` then use the default `exp://192.168.87.39:19000/--/`\n\n const href = parsePathFromExpoGoLink(url);\n const results = href.match(/([^?]*)(\\?.*)?/);\n return {\n pathname: results?.[1] ?? '',\n queryString: results?.[2] ?? '',\n };\n}\n\nexport function parsePathFromExpoGoLink(url: string): string {\n // If the URL is defined (default in Expo Go dev apps) and the URL has no path:\n // `exp://192.168.87.39:19000/` then use the default `exp://192.168.87.39:19000/--/`\n return url.match(/exps?:\\/\\/.*?\\/--\\/(.*)/)?.[1] ?? '';\n}\n\n// This is only run on native.\nfunction extractExactPathFromURL(url: string): string {\n if (\n // If a universal link / app link / web URL is used, we should use the path\n // from the URL, while stripping the origin.\n url.match(/^https?:\\/\\//)\n ) {\n const { origin, href, hostname } = new URL(url);\n\n if (hostname === 'exp.host' || hostname === 'u.expo.dev') {\n // These are QR code generate deep-link that always like to the '/' path\n // TODO: In the future, QR code may link to a specific path and this logic will need to be udpated\n return '';\n }\n\n return href.replace(origin, '');\n }\n\n const isExpoGo = typeof expo !== 'undefined' && globalThis.expo?.modules?.ExpoGo;\n\n // Handle special URLs used in Expo Go: `/--/pathname` -> `pathname`\n if (\n isExpoGo &&\n // while not exhaustive, `exp` and `exps` are the only two schemes which\n // are passed through to other apps in Expo Go.\n url.match(/^exp(s)?:\\/\\//)\n ) {\n const pathname = parsePathFromExpoGoLink(url);\n if (pathname) {\n return fromDeepLink('a://' + pathname);\n }\n // Match the `?.*` segment of the URL.\n const queryParams = url.match(/exps?:\\/\\/.*\\?(.*)/)?.[1];\n if (queryParams) {\n return fromDeepLink('a://?' + queryParams);\n }\n\n return '';\n }\n\n // TODO: Support dev client URLs\n\n return fromDeepLink(url);\n}\n\n/** Major hack to support the makeshift expo-development-client system. */\nfunction isExpoDevelopmentClient(url: URL): boolean {\n return url.hostname === 'expo-development-client';\n}\n\nfunction fromDeepLink(url: string): string {\n let res: URL | null;\n try {\n // This is for all standard deep links, e.g. `foobar://` where everything\n // after the `://` is the path.\n res = new URL(url);\n } catch {\n /**\n * We failed to parse the URL. This can occur for a variety of reasons, including:\n * - Its a partial URL (e.g. `/route?query=param`).\n * - It has a valid App scheme, but the scheme isn't a valid URL scheme (e.g. `my_app://`)\n */\n\n // If `url` is already a path (starts with `/`), return it as-is\n if (url.startsWith('/')) {\n return url;\n }\n\n /**\n * App schemes are not valid URL schemes, so they will fail to parse.\n * We need to strip the scheme from these URLs\n */\n return url.replace(/^[^:]+:\\/\\//, '');\n }\n\n if (isExpoDevelopmentClient(res)) {\n if (!res.searchParams.get('url')) {\n return '';\n }\n const incomingUrl = res.searchParams.get('url')!;\n return extractExactPathFromURL(safeDecodeURI(incomingUrl));\n }\n\n let results = '';\n\n if (res.host) {\n results += res.host;\n }\n\n if (res.pathname) {\n results += res.pathname;\n }\n\n const qs = !res.search\n ? ''\n : // @ts-ignore: `entries` is not on `URLSearchParams` in some typechecks.\n [...res.searchParams.entries()]\n .map(([k, v]) => `${k}=${safeDecodeURIComponent(v)}`)\n .join('&');\n\n if (qs) {\n results += '?' + qs;\n }\n\n return results;\n}\n\nexport function extractExpoPathFromURL(_prefixes: string[], url: string = '') {\n return (\n extractExactPathFromURL(url)\n // TODO: We should get rid of this, dropping specificities is not good\n .replace(/^\\//, '')\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRouteInfoFromState.d.ts","sourceRoot":"","sources":["../../src/global-state/getRouteInfoFromState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"getRouteInfoFromState.d.ts","sourceRoot":"","sources":["../../src/global-state/getRouteInfoFromState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGhF,MAAM,MAAM,SAAS,GAAG;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACnD,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAS9B,CAAC;AAEF;;GAEG;AACH,KAAK,WAAW,GAAG,CAAC,iBAAiB,GAAG,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC,GAAG;IACzF,MAAM,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,wBAAwB,CAAC;QAClC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,EAAE,CAAC;CACL,CAAC;AAEF,KAAK,wBAAwB,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GACjC;IACE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC,CAAC;AAEN,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAwKpE"}
|
|
@@ -4,6 +4,7 @@ exports.defaultRouteInfo = void 0;
|
|
|
4
4
|
exports.getRouteInfoFromState = getRouteInfoFromState;
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const getPathFromState_forks_1 = require("../fork/getPathFromState-forks");
|
|
7
|
+
const url_1 = require("../utils/url");
|
|
7
8
|
exports.defaultRouteInfo = {
|
|
8
9
|
unstable_globalHref: '',
|
|
9
10
|
searchParams: new URLSearchParams(),
|
|
@@ -48,10 +49,10 @@ function getRouteInfoFromState(state) {
|
|
|
48
49
|
}
|
|
49
50
|
params = Object.fromEntries(Object.entries(params).map(([key, value]) => {
|
|
50
51
|
if (typeof value === 'string') {
|
|
51
|
-
return [key, safeDecodeURIComponent(value)];
|
|
52
|
+
return [key, (0, url_1.safeDecodeURIComponent)(value)];
|
|
52
53
|
}
|
|
53
54
|
else if (Array.isArray(value)) {
|
|
54
|
-
return [key, value.map((v) => safeDecodeURIComponent(v))];
|
|
55
|
+
return [key, value.map((v) => (0, url_1.safeDecodeURIComponent)(v))];
|
|
55
56
|
}
|
|
56
57
|
else {
|
|
57
58
|
return [key, value];
|
|
@@ -161,13 +162,4 @@ function getRouteInfoFromState(state) {
|
|
|
161
162
|
isIndex: false,
|
|
162
163
|
};
|
|
163
164
|
}
|
|
164
|
-
function safeDecodeURIComponent(value) {
|
|
165
|
-
try {
|
|
166
|
-
return typeof value === 'string' ? decodeURIComponent(value) : value;
|
|
167
|
-
}
|
|
168
|
-
catch {
|
|
169
|
-
// If the value is not a valid URI component, return it as is
|
|
170
|
-
return value;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
165
|
//# sourceMappingURL=getRouteInfoFromState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRouteInfoFromState.js","sourceRoot":"","sources":["../../src/global-state/getRouteInfoFromState.ts"],"names":[],"mappings":";;;AA8CA,sDAwKC;AArND,4CAA4F;AAC5F,2EAA+D;AAalD,QAAA,gBAAgB,GAAc;IACzC,mBAAmB,EAAE,EAAE;IACvB,YAAY,EAAE,IAAI,eAAe,EAAE;IACnC,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,GAAG;IACvB,6CAA6C;IAC7C,OAAO,EAAE,KAAK;CACf,CAAC;AAsBF,SAAgB,qBAAqB,CAAC,KAAmB;IACvD,IAAI,CAAC,KAAK;QAAE,OA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AClD,IAAI,kBAAkB,GAAG,iBAAiB,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,GAAG,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3F,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAEjF,OAAO;QACL,QAAQ;QACR,QAAQ;QACR,MAAM;QACN,mBAAmB,EAAE,IAAA,sCAAa,EAAC,kBAAkB,CAAC;QACtD,YAAY;QACZ,kBAAkB;QAClB,6CAA6C;QAC7C,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAU;IACxC,IAAI,CAAC;QACH,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["import type { FocusedRouteState } from './types';\nimport { INTERNAL_SLOT_NAME, NOT_FOUND_ROUTE_NAME, SITEMAP_ROUTE_NAME } from '../constants';\nimport { appendBaseUrl } from '../fork/getPathFromState-forks';\nimport type { NavigationState, PartialState } from '../react-navigation/native';\n\nexport type UrlObject = {\n unstable_globalHref: string;\n pathname: string;\n readonly params: Record<string, string | string[]>;\n searchParams: URLSearchParams;\n segments: string[];\n pathnameWithParams: string;\n isIndex: boolean;\n};\n\nexport const defaultRouteInfo: UrlObject = {\n unstable_globalHref: '',\n searchParams: new URLSearchParams(),\n pathname: '/',\n params: {},\n segments: [],\n pathnameWithParams: '/',\n // TODO: Remove this, it is not used anywhere\n isIndex: false,\n};\n\n/**\n * A better typed version of `FocusedRouteState` that is easier to parse\n */\ntype StrictState = (FocusedRouteState | NavigationState | PartialState<NavigationState>) & {\n routes: {\n key?: string;\n name: string;\n params?: StrictFocusedRouteParams;\n path?: string;\n state?: StrictState;\n }[];\n};\n\ntype StrictFocusedRouteParams =\n | Record<string, string | string[]>\n | {\n screen?: string;\n params?: StrictFocusedRouteParams;\n };\n\nexport function getRouteInfoFromState(state?: StrictState): UrlObject {\n if (!state) return defaultRouteInfo;\n\n // TODO(@kitten): Review edge-case type safety\n const index = 'index' in state ? (state.index ?? 0) : 0;\n let route = state.routes[index]!;\n\n if (route.name === NOT_FOUND_ROUTE_NAME || route.name === SITEMAP_ROUTE_NAME) {\n const path = route.path || (route.name === NOT_FOUND_ROUTE_NAME ? '/' : `/${route.name}`);\n return {\n ...defaultRouteInfo,\n unstable_globalHref: appendBaseUrl(path),\n pathname: path,\n pathnameWithParams: path,\n segments: [route.name],\n };\n }\n\n if (route.name !== INTERNAL_SLOT_NAME) {\n throw new Error(`Expected the first route to be ${INTERNAL_SLOT_NAME}, but got ${route.name}`);\n }\n\n state = route.state;\n\n const segments: string[] = [];\n let params: UrlObject['params'] = Object.create(null);\n\n while (state) {\n route = state.routes['index' in state && state.index ? state.index : 0]!;\n\n Object.assign(params, route.params);\n\n let routeName = route.name;\n if (routeName.startsWith('/')) {\n routeName = routeName.slice(1);\n }\n\n segments.push(...routeName.split('/'));\n state = route.state;\n }\n\n params = Object.fromEntries(\n Object.entries(params).map(([key, value]) => {\n if (typeof value === 'string') {\n return [key, safeDecodeURIComponent(value)];\n } else if (Array.isArray(value)) {\n return [key, value.map((v) => safeDecodeURIComponent(v))];\n } else {\n return [key, value];\n }\n })\n );\n\n /**\n * If React Navigation didn't render the entire tree (e.g it was interrupted in a layout)\n * then the state maybe incomplete. The reset of the path is in the params, instead of being a route\n */\n let routeParams: StrictFocusedRouteParams | undefined = route.params;\n while (routeParams && 'screen' in routeParams) {\n if (typeof routeParams.screen === 'string') {\n const screen = routeParams.screen.startsWith('/')\n ? routeParams.screen.slice(1)\n : routeParams.screen;\n segments.push(...screen.split('/'));\n }\n\n if (typeof routeParams.params === 'object' && !Array.isArray(routeParams.params)) {\n routeParams = routeParams.params;\n } else {\n routeParams = undefined;\n }\n }\n\n if (route.params && 'screen' in route.params && route.params.screen === 'string') {\n const screen = route.params.screen.startsWith('/')\n ? route.params.screen.slice(1)\n : route.params.screen;\n segments.push(...screen.split('/'));\n }\n\n if (segments[segments.length - 1] === 'index') {\n segments.pop();\n }\n\n delete params['screen'];\n delete params['params'];\n\n const pathParams = new Set<string>();\n\n const pathname =\n '/' +\n segments\n .filter((segment) => {\n return !(segment.startsWith('(') && segment.endsWith(')'));\n })\n .flatMap((segment) => {\n if (segment === '+not-found') {\n const notFoundPath = params['not-found'];\n\n pathParams.add('not-found');\n\n if (typeof notFoundPath === 'undefined') {\n // Not founds are optional, do nothing if its not present\n return [];\n } else if (Array.isArray(notFoundPath)) {\n return notFoundPath;\n } else {\n return [notFoundPath];\n }\n } else if (segment.startsWith('[...') && segment.endsWith(']')) {\n let paramName = segment.slice(4, -1);\n\n // Legacy for React Navigation optional params\n if (paramName.endsWith('?')) {\n paramName = paramName.slice(0, -1);\n }\n\n const values = params[paramName];\n pathParams.add(paramName);\n\n // Catchall params are optional\n return values || [];\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n const paramName = segment.slice(1, -1);\n const value = params[paramName];\n pathParams.add(paramName);\n\n // Optional params are optional\n return value ? [value] : [];\n } else {\n return [segment];\n }\n })\n .join('/');\n\n const searchParams = new URLSearchParams(\n Object.entries(params).flatMap(([key, value]) => {\n // Search params should not include path params\n if (pathParams.has(key)) {\n return [];\n } else if (Array.isArray(value)) {\n return value.map((v) => [key, v]);\n }\n return [[key, value]];\n })\n );\n\n let hash: string | undefined;\n if (searchParams.has('#')) {\n hash = searchParams.get('#') || undefined;\n searchParams.delete('#');\n }\n\n // We cannot use searchParams.size because it is not included in the React Native polyfill\n const searchParamString = searchParams.toString();\n let pathnameWithParams = searchParamString ? pathname + '?' + searchParamString : pathname;\n pathnameWithParams = hash ? pathnameWithParams + '#' + hash : pathnameWithParams;\n\n return {\n segments,\n pathname,\n params,\n unstable_globalHref: appendBaseUrl(pathnameWithParams),\n searchParams,\n pathnameWithParams,\n // TODO: Remove this, it is not used anywhere\n isIndex: false,\n };\n}\n\nfunction safeDecodeURIComponent(value: any) {\n try {\n return typeof value === 'string' ? decodeURIComponent(value) : value;\n } catch {\n // If the value is not a valid URI component, return it as is\n return value;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getRouteInfoFromState.js","sourceRoot":"","sources":["../../src/global-state/getRouteInfoFromState.ts"],"names":[],"mappings":";;;AA+CA,sDAwKC;AAtND,4CAA4F;AAC5F,2EAA+D;AAE/D,sCAAsD;AAYzC,QAAA,gBAAgB,GAAc;IACzC,mBAAmB,EAAE,EAAE;IACvB,YAAY,EAAE,IAAI,eAAe,EAAE;IACnC,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,GAAG;IACvB,6CAA6C;IAC7C,OAAO,EAAE,KAAK;CACf,CAAC;AAsBF,SAAgB,qBAAqB,CAAC,KAAmB;IACvD,IAAI,CAAC,KAAK;QAAE,OAAO,wBAAgB,CAAC;IAEpC,8CAA8C;IAC9C,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,IAAI,KAAK,gCAAoB,IAAI,KAAK,CAAC,IAAI,KAAK,8BAAkB,EAAE,CAAC;QAC7E,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,gCAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1F,OAAO;YACL,GAAG,wBAAgB;Y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nimport { appendBaseUrl } from '../fork/getPathFromState-forks';\nimport type { NavigationState, PartialState } from '../react-navigation/native';\nimport { safeDecodeURIComponent } from '../utils/url';\n\nexport type UrlObject = {\n unstable_globalHref: string;\n pathname: string;\n readonly params: Record<string, string | string[]>;\n searchParams: URLSearchParams;\n segments: string[];\n pathnameWithParams: string;\n isIndex: boolean;\n};\n\nexport const defaultRouteInfo: UrlObject = {\n unstable_globalHref: '',\n searchParams: new URLSearchParams(),\n pathname: '/',\n params: {},\n segments: [],\n pathnameWithParams: '/',\n // TODO: Remove this, it is not used anywhere\n isIndex: false,\n};\n\n/**\n * A better typed version of `FocusedRouteState` that is easier to parse\n */\ntype StrictState = (FocusedRouteState | NavigationState | PartialState<NavigationState>) & {\n routes: {\n key?: string;\n name: string;\n params?: StrictFocusedRouteParams;\n path?: string;\n state?: StrictState;\n }[];\n};\n\ntype StrictFocusedRouteParams =\n | Record<string, string | string[]>\n | {\n screen?: string;\n params?: StrictFocusedRouteParams;\n };\n\nexport function getRouteInfoFromState(state?: StrictState): UrlObject {\n if (!state) return defaultRouteInfo;\n\n // TODO(@kitten): Review edge-case type safety\n const index = 'index' in state ? (state.index ?? 0) : 0;\n let route = state.routes[index]!;\n\n if (route.name === NOT_FOUND_ROUTE_NAME || route.name === SITEMAP_ROUTE_NAME) {\n const path = route.path || (route.name === NOT_FOUND_ROUTE_NAME ? '/' : `/${route.name}`);\n return {\n ...defaultRouteInfo,\n unstable_globalHref: appendBaseUrl(path),\n pathname: path,\n pathnameWithParams: path,\n segments: [route.name],\n };\n }\n\n if (route.name !== INTERNAL_SLOT_NAME) {\n throw new Error(`Expected the first route to be ${INTERNAL_SLOT_NAME}, but got ${route.name}`);\n }\n\n state = route.state;\n\n const segments: string[] = [];\n let params: UrlObject['params'] = Object.create(null);\n\n while (state) {\n route = state.routes['index' in state && state.index ? state.index : 0]!;\n\n Object.assign(params, route.params);\n\n let routeName = route.name;\n if (routeName.startsWith('/')) {\n routeName = routeName.slice(1);\n }\n\n segments.push(...routeName.split('/'));\n state = route.state;\n }\n\n params = Object.fromEntries(\n Object.entries(params).map(([key, value]) => {\n if (typeof value === 'string') {\n return [key, safeDecodeURIComponent(value)];\n } else if (Array.isArray(value)) {\n return [key, value.map((v) => safeDecodeURIComponent(v))];\n } else {\n return [key, value];\n }\n })\n );\n\n /**\n * If React Navigation didn't render the entire tree (e.g it was interrupted in a layout)\n * then the state maybe incomplete. The reset of the path is in the params, instead of being a route\n */\n let routeParams: StrictFocusedRouteParams | undefined = route.params;\n while (routeParams && 'screen' in routeParams) {\n if (typeof routeParams.screen === 'string') {\n const screen = routeParams.screen.startsWith('/')\n ? routeParams.screen.slice(1)\n : routeParams.screen;\n segments.push(...screen.split('/'));\n }\n\n if (typeof routeParams.params === 'object' && !Array.isArray(routeParams.params)) {\n routeParams = routeParams.params;\n } else {\n routeParams = undefined;\n }\n }\n\n if (route.params && 'screen' in route.params && route.params.screen === 'string') {\n const screen = route.params.screen.startsWith('/')\n ? route.params.screen.slice(1)\n : route.params.screen;\n segments.push(...screen.split('/'));\n }\n\n if (segments[segments.length - 1] === 'index') {\n segments.pop();\n }\n\n delete params['screen'];\n delete params['params'];\n\n const pathParams = new Set<string>();\n\n const pathname =\n '/' +\n segments\n .filter((segment) => {\n return !(segment.startsWith('(') && segment.endsWith(')'));\n })\n .flatMap((segment) => {\n if (segment === '+not-found') {\n const notFoundPath = params['not-found'];\n\n pathParams.add('not-found');\n\n if (typeof notFoundPath === 'undefined') {\n // Not founds are optional, do nothing if its not present\n return [];\n } else if (Array.isArray(notFoundPath)) {\n return notFoundPath;\n } else {\n return [notFoundPath];\n }\n } else if (segment.startsWith('[...') && segment.endsWith(']')) {\n let paramName = segment.slice(4, -1);\n\n // Legacy for React Navigation optional params\n if (paramName.endsWith('?')) {\n paramName = paramName.slice(0, -1);\n }\n\n const values = params[paramName];\n pathParams.add(paramName);\n\n // Catchall params are optional\n return values || [];\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n const paramName = segment.slice(1, -1);\n const value = params[paramName];\n pathParams.add(paramName);\n\n // Optional params are optional\n return value ? [value] : [];\n } else {\n return [segment];\n }\n })\n .join('/');\n\n const searchParams = new URLSearchParams(\n Object.entries(params).flatMap(([key, value]) => {\n // Search params should not include path params\n if (pathParams.has(key)) {\n return [];\n } else if (Array.isArray(value)) {\n return value.map((v) => [key, v]);\n }\n return [[key, value]];\n })\n );\n\n let hash: string | undefined;\n if (searchParams.has('#')) {\n hash = searchParams.get('#') || undefined;\n searchParams.delete('#');\n }\n\n // We cannot use searchParams.size because it is not included in the React Native polyfill\n const searchParamString = searchParams.toString();\n let pathnameWithParams = searchParamString ? pathname + '?' + searchParamString : pathname;\n pathnameWithParams = hash ? pathnameWithParams + '#' + hash : pathnameWithParams;\n\n return {\n segments,\n pathname,\n params,\n unstable_globalHref: appendBaseUrl(pathnameWithParams),\n searchParams,\n pathnameWithParams,\n // TODO: Remove this, it is not used anywhere\n isIndex: false,\n };\n}\n"]}
|
|
@@ -44,7 +44,7 @@ export declare const NativeTabTrigger: typeof NativeTabTriggerImpl & {
|
|
|
44
44
|
Badge: import("react").FC<NativeTabsTriggerBadgeProps>;
|
|
45
45
|
VectorIcon: typeof import("..").VectorIcon;
|
|
46
46
|
};
|
|
47
|
-
export declare function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, }: NativeTabTriggerProps, isDynamic?: boolean): NativeTabOptions;
|
|
47
|
+
export declare function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, testID, accessibilityLabel, }: NativeTabTriggerProps, isDynamic?: boolean): NativeTabOptions;
|
|
48
48
|
export declare function isNativeTabTrigger(child: ReactNode, contextKey?: string): child is ReactElement<NativeTabTriggerProps & {
|
|
49
49
|
name: string;
|
|
50
50
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvE,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EACZ,8BAA8B,EAC9B,QAAQ,EACR,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvE,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EACZ,8BAA8B,EAC9B,QAAQ,EACR,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,EACN,kBAAkB,GACnB,EAAE,qBAAqB,EACxB,SAAS,GAAE,OAAe,oBAyD3B;AAyBD,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"}
|
|
@@ -72,7 +72,7 @@ exports.NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {
|
|
|
72
72
|
Badge: elements_1.NativeTabsTriggerBadge,
|
|
73
73
|
VectorIcon: elements_1.NativeTabsTriggerVectorIcon,
|
|
74
74
|
});
|
|
75
|
-
function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, }, isDynamic = false) {
|
|
75
|
+
function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, testID, accessibilityLabel, }, isDynamic = false) {
|
|
76
76
|
const initialOptions = isDynamic
|
|
77
77
|
? {
|
|
78
78
|
...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),
|
|
@@ -82,6 +82,10 @@ function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, dis
|
|
|
82
82
|
...(indicatorColor !== undefined ? { indicatorColor } : {}),
|
|
83
83
|
...(disableIndicator !== undefined ? { disableIndicator } : {}),
|
|
84
84
|
...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),
|
|
85
|
+
...(testID !== undefined ? { tabBarItemTestID: testID } : {}),
|
|
86
|
+
...(accessibilityLabel !== undefined
|
|
87
|
+
? { tabBarItemAccessibilityLabel: accessibilityLabel }
|
|
88
|
+
: {}),
|
|
85
89
|
}
|
|
86
90
|
: {
|
|
87
91
|
hidden: !!hidden,
|
|
@@ -101,6 +105,10 @@ function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, dis
|
|
|
101
105
|
...(indicatorColor !== undefined ? { indicatorColor } : {}),
|
|
102
106
|
...(disableIndicator !== undefined ? { disableIndicator } : {}),
|
|
103
107
|
...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),
|
|
108
|
+
...(testID !== undefined ? { tabBarItemTestID: testID } : {}),
|
|
109
|
+
...(accessibilityLabel !== undefined
|
|
110
|
+
? { tabBarItemAccessibilityLabel: accessibilityLabel }
|
|
111
|
+
: {}),
|
|
104
112
|
};
|
|
105
113
|
const allowedChildren = (0, children_1.filterAllowedChildrenElements)(children, [
|
|
106
114
|
elements_1.NativeTabsTriggerBadge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAwFb,4DAkEC;AAyBD,gDAuBC;AAxMD,iCAAuE;AACvE,+CAA0C;AAE1C,uDAAqE;AACrE,gDAO2B;AAE3B,uEAAiE;AACjE,6EAAmE;AACnE,sDAAmD;AACnD,gDAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,G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AkK;QAClK,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAyB,EAAE,KAAkC;IACvF,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,CAAC,kBAAkB,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;AACH,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 { useCallback, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { useNavigation, useRoute } from '../react-navigation/native';\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n} from './common/elements';\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { appendIconOptions } from './utils/optionsIconConverter';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useFocusEffect } from '../useFocusEffect';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\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 disableTransparentOnScrollEdge,\n disabled,\n rippleColor,\n indicatorColor,\n disableIndicator,\n labelVisibilityMode,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n ...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(rippleColor !== undefined ? { rippleColor } : {}),\n ...(indicatorColor !== undefined ? { indicatorColor } : {}),\n ...(disableIndicator !== undefined ? { disableIndicator } : {}),\n ...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),\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 ...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(rippleColor !== undefined ? { rippleColor } : {}),\n ...(indicatorColor !== undefined ? { indicatorColor } : {}),\n ...(disableIndicator !== undefined ? { disableIndicator } : {}),\n ...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),\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 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
|
+
{"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAwFb,4DA4EC;AAyBD,gDAuBC;AAlND,iCAAuE;A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CAAC;IACH,CAAC;AACH,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 { useCallback, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { useNavigation, useRoute } from '../react-navigation/native';\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n} from './common/elements';\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { appendIconOptions } from './utils/optionsIconConverter';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useFocusEffect } from '../useFocusEffect';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\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 disableTransparentOnScrollEdge,\n disabled,\n rippleColor,\n indicatorColor,\n disableIndicator,\n labelVisibilityMode,\n testID,\n accessibilityLabel,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n ...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(rippleColor !== undefined ? { rippleColor } : {}),\n ...(indicatorColor !== undefined ? { indicatorColor } : {}),\n ...(disableIndicator !== undefined ? { disableIndicator } : {}),\n ...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),\n ...(testID !== undefined ? { tabBarItemTestID: testID } : {}),\n ...(accessibilityLabel !== undefined\n ? { tabBarItemAccessibilityLabel: accessibilityLabel }\n : {}),\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 ...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),\n ...(disabled !== undefined ? { disabled } : {}),\n ...(rippleColor !== undefined ? { rippleColor } : {}),\n ...(indicatorColor !== undefined ? { indicatorColor } : {}),\n ...(disableIndicator !== undefined ? { disableIndicator } : {}),\n ...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),\n ...(testID !== undefined ? { tabBarItemTestID: testID } : {}),\n ...(accessibilityLabel !== undefined\n ? { tabBarItemAccessibilityLabel: accessibilityLabel }\n : {}),\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 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"]}
|
|
@@ -155,6 +155,16 @@ export interface NativeTabOptions extends DefaultRouterOptions {
|
|
|
155
155
|
* @platform iOS
|
|
156
156
|
*/
|
|
157
157
|
disabled?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* @platform android
|
|
160
|
+
* @platform iOS
|
|
161
|
+
*/
|
|
162
|
+
tabBarItemTestID?: string;
|
|
163
|
+
/**
|
|
164
|
+
* @platform android
|
|
165
|
+
* @platform iOS
|
|
166
|
+
*/
|
|
167
|
+
tabBarItemAccessibilityLabel?: string;
|
|
158
168
|
/**
|
|
159
169
|
* @platform iOS
|
|
160
170
|
*/
|
|
@@ -499,6 +509,27 @@ export interface NativeTabTriggerProps {
|
|
|
499
509
|
* @platform ios
|
|
500
510
|
*/
|
|
501
511
|
disabled?: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* A test identifier for the tab bar item.
|
|
514
|
+
*
|
|
515
|
+
* On iOS it maps to the item's accessibility identifier, which XCUITest and Maestro match.
|
|
516
|
+
* On Android it maps to the item's view tag, which Espresso-based drivers like Detox read
|
|
517
|
+
* but Maestro and Appium do not. Use `accessibilityLabel` to match the tab by id there.
|
|
518
|
+
*
|
|
519
|
+
* @platform android
|
|
520
|
+
* @platform iOS
|
|
521
|
+
*/
|
|
522
|
+
testID?: string;
|
|
523
|
+
/**
|
|
524
|
+
* The accessibility label of the tab bar item, announced by screen readers.
|
|
525
|
+
* Defaults to the visible tab label.
|
|
526
|
+
*
|
|
527
|
+
* On Android, maps to the item's `contentDescription` and requires API 26 or above.
|
|
528
|
+
*
|
|
529
|
+
* @platform android
|
|
530
|
+
* @platform iOS
|
|
531
|
+
*/
|
|
532
|
+
accessibilityLabel?: string;
|
|
502
533
|
/**
|
|
503
534
|
* The children of the trigger.
|
|
504
535
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,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,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,eAAe,EACf,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;A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;OAmBG;IACH,SAAS,CAAC,EAAE,WAAW,CACrB,GAAG,EACH,kBAAkB,CAAC,aAAa,CAAC,EACjC,2BAA2B,CAC5B,CAAC,WAAW,CAAC,CAAC;CAChB;AAED,QAAA,MAAM,4BAA4B,0JAaxB,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AAiQa,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;AAuPE,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;AAsLX,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 { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsHostProps, TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type {\n DefaultRouterOptions,\n ParamListBase,\n RouteProp,\n ScreenListeners,\n TabNavigationState,\n} from '../react-navigation/native';\nimport type { ScreenProps } from '../useScreens';\n\n/**\n * Event map for `NativeTabs` navigation events.\n * Only `tabPress` is currently supported.\n */\nexport type NativeTabNavigationEventMap = {\n tabPress: {\n data: {\n __internalTabsType: 'native';\n /**\n * `true` when the native side prevented the selection because the target\n * tab is `disabled`. The event is still emitted so listeners are notified,\n * but no navigation occurs.\n */\n isPrevented: boolean;\n };\n canPreventDefault: false;\n };\n};\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'screenKey'>>;\n\n/**\n * Props passed to the underlying tab host implementation in `react-native-screens`.\n */\nexport type NativeTabsHostNativeProps = Partial<\n Omit<TabsHostProps, 'navStateRequest' | 'onTabSelected' | 'children'>\n>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * @platform android\n * @platform iOS\n */\n icon?: SymbolOrImageSource;\n /**\n * @platform android\n * @platform iOS\n */\n selectedIcon?: SymbolOrImageSource;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n title?: string;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n badgeValue?: string;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n selectedLabelStyle?: NativeTabsLabelStyle;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * @platform iOS\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * @platform android\n * @platform iOS\n */\n selectedIconColor?: ColorValue;\n /**\n * @platform iOS\n */\n selectedBadgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n backgroundColor?: ColorValue;\n /**\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n */\n tintColor?: ColorValue;\n /**\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @platform iOS\n */\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n hidden?: boolean;\n /**\n * @platform android\n * @platform iOS\n */\n disabled?: boolean;\n /**\n * @platform iOS\n */\n specialEffects?: TabsScreenProps['specialEffects'];\n /**\n * @platform android\n * @platform iOS\n */\n nativeProps?: NativeScreenProps;\n /**\n * @platform android\n * @platform iOS\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * @platform android\n * @platform iOS\n */\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 iOS asset catalog image to use as an icon.\n * @platform iOS\n */\n xcasset?: string;\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 /**\n * When `true`, the tab bar lifts above the keyboard (input method editor, or IME) instead of being overlaid by it. By default, the keyboard overlays the tab bar.\n *\n * Requires `windowSoftInputMode=\"adjustResize\"`. Has no effect on Android API levels earlier than 30 (Android 11).\n *\n * @default false\n * @platform android\n */\n tabBarRespectsIMEInsets?: boolean;\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 * Props passed to the underlying native tab host implementation in `react-native-screens`.\n * Use this to configure props that are not directly exposed by Expo Router.\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?: NativeTabsHostNativeProps;\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface OnTabChangeEventPayload {\n /**\n * The route key of the tab the native side has just selected.\n */\n selectedKey: string;\n /**\n * The provenance value reported by the native side for this selection.\n *\n * The navigator echoes this back via `navStateRequest.baseProvenance` on\n * subsequent JS-driven updates so the native side can distinguish stale\n * updates from fresh ones. See `TabsHostNavStateRequest` in\n * `react-native-screens` for the full contract.\n */\n provenance: number;\n // TODO(@ubax): consider renaming this field\n isNativeAction: boolean;\n /**\n * Whether the native side prevented this selection because the target tab is\n * `disabled`. When `true`, the navigator emits `tabPress` but skips navigation.\n *\n * @default false\n */\n isPrevented?: boolean;\n}\n\nexport interface NativeTabsViewProps extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n | 'rippleColor'\n | 'disableIndicator'\n | 'labelVisibilityMode'\n> {\n focusedIndex: number;\n /**\n * Provenance counter associated with the currently rendered `focusedIndex`.\n */\n provenance: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (event: OnTabChangeEventPayload) => 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 * If `true`, the tab is shown but cannot be selected by tapping it in the\n * tab bar.\n *\n * > **Note:** This only suppresses the native tap interaction. JavaScript\n * > navigation such as `router.push()` or `<Link />` still navigates to\n * > the tab. Use this for tabs that should appear visible but be temporarily inert,\n * > and gate navigation in your own code if you need to fully prevent access.\n *\n * Unlike `hidden`, the tab remains visible in the tab bar.\n *\n * @default false\n *\n * @platform android\n * @platform ios\n */\n disabled?: 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 * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The color of the ripple effect when this tab is selected - will be visible when other tabs are pressed.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the active indicator for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform android\n */\n indicatorColor?: ColorValue;\n /**\n * When set to `true`, disables the active indicator for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @default false\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The visibility mode of the tab item label for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\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 * 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?: ScreenProps<\n any,\n TabNavigationState<ParamListBase>,\n NativeTabNavigationEventMap\n >['listeners'];\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":";;;AA2Qa,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;AAuPE,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;AA2MX,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 { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsHostProps, TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type {\n DefaultRouterOptions,\n ParamListBase,\n RouteProp,\n ScreenListeners,\n TabNavigationState,\n} from '../react-navigation/native';\nimport type { ScreenProps } from '../useScreens';\n\n/**\n * Event map for `NativeTabs` navigation events.\n * Only `tabPress` is currently supported.\n */\nexport type NativeTabNavigationEventMap = {\n tabPress: {\n data: {\n __internalTabsType: 'native';\n /**\n * `true` when the native side prevented the selection because the target\n * tab is `disabled`. The event is still emitted so listeners are notified,\n * but no navigation occurs.\n */\n isPrevented: boolean;\n };\n canPreventDefault: false;\n };\n};\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'screenKey'>>;\n\n/**\n * Props passed to the underlying tab host implementation in `react-native-screens`.\n */\nexport type NativeTabsHostNativeProps = Partial<\n Omit<TabsHostProps, 'navStateRequest' | 'onTabSelected' | 'children'>\n>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * @platform android\n * @platform iOS\n */\n icon?: SymbolOrImageSource;\n /**\n * @platform android\n * @platform iOS\n */\n selectedIcon?: SymbolOrImageSource;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n title?: string;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n badgeValue?: string;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n selectedLabelStyle?: NativeTabsLabelStyle;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * @platform iOS\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * @platform android\n * @platform iOS\n */\n selectedIconColor?: ColorValue;\n /**\n * @platform iOS\n */\n selectedBadgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n backgroundColor?: ColorValue;\n /**\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @platform android\n * @platform iOS\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n */\n tintColor?: ColorValue;\n /**\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @platform iOS\n */\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * @platform android\n * @platform iOS\n * @platform web\n */\n hidden?: boolean;\n /**\n * @platform android\n * @platform iOS\n */\n disabled?: boolean;\n /**\n * @platform android\n * @platform iOS\n */\n tabBarItemTestID?: string;\n /**\n * @platform android\n * @platform iOS\n */\n tabBarItemAccessibilityLabel?: string;\n /**\n * @platform iOS\n */\n specialEffects?: TabsScreenProps['specialEffects'];\n /**\n * @platform android\n * @platform iOS\n */\n nativeProps?: NativeScreenProps;\n /**\n * @platform android\n * @platform iOS\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * @platform android\n * @platform iOS\n */\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 iOS asset catalog image to use as an icon.\n * @platform iOS\n */\n xcasset?: string;\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 /**\n * When `true`, the tab bar lifts above the keyboard (input method editor, or IME) instead of being overlaid by it. By default, the keyboard overlays the tab bar.\n *\n * Requires `windowSoftInputMode=\"adjustResize\"`. Has no effect on Android API levels earlier than 30 (Android 11).\n *\n * @default false\n * @platform android\n */\n tabBarRespectsIMEInsets?: boolean;\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 * Props passed to the underlying native tab host implementation in `react-native-screens`.\n * Use this to configure props that are not directly exposed by Expo Router.\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?: NativeTabsHostNativeProps;\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface OnTabChangeEventPayload {\n /**\n * The route key of the tab the native side has just selected.\n */\n selectedKey: string;\n /**\n * The provenance value reported by the native side for this selection.\n *\n * The navigator echoes this back via `navStateRequest.baseProvenance` on\n * subsequent JS-driven updates so the native side can distinguish stale\n * updates from fresh ones. See `TabsHostNavStateRequest` in\n * `react-native-screens` for the full contract.\n */\n provenance: number;\n // TODO(@ubax): consider renaming this field\n isNativeAction: boolean;\n /**\n * Whether the native side prevented this selection because the target tab is\n * `disabled`. When `true`, the navigator emits `tabPress` but skips navigation.\n *\n * @default false\n */\n isPrevented?: boolean;\n}\n\nexport interface NativeTabsViewProps extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n | 'rippleColor'\n | 'disableIndicator'\n | 'labelVisibilityMode'\n> {\n focusedIndex: number;\n /**\n * Provenance counter associated with the currently rendered `focusedIndex`.\n */\n provenance: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (event: OnTabChangeEventPayload) => 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 * If `true`, the tab is shown but cannot be selected by tapping it in the\n * tab bar.\n *\n * > **Note:** This only suppresses the native tap interaction. JavaScript\n * > navigation such as `router.push()` or `<Link />` still navigates to\n * > the tab. Use this for tabs that should appear visible but be temporarily inert,\n * > and gate navigation in your own code if you need to fully prevent access.\n *\n * Unlike `hidden`, the tab remains visible in the tab bar.\n *\n * @default false\n *\n * @platform android\n * @platform ios\n */\n disabled?: boolean;\n /**\n * A test identifier for the tab bar item.\n *\n * On iOS it maps to the item's accessibility identifier, which XCUITest and Maestro match.\n * On Android it maps to the item's view tag, which Espresso-based drivers like Detox read\n * but Maestro and Appium do not. Use `accessibilityLabel` to match the tab by id there.\n *\n * @platform android\n * @platform iOS\n */\n testID?: string;\n /**\n * The accessibility label of the tab bar item, announced by screen readers.\n * Defaults to the visible tab label.\n *\n * On Android, maps to the item's `contentDescription` and requires API 26 or above.\n *\n * @platform android\n * @platform iOS\n */\n accessibilityLabel?: string;\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 * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The color of the ripple effect when this tab is selected - will be visible when other tabs are pressed.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the active indicator for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @platform android\n */\n indicatorColor?: ColorValue;\n /**\n * When set to `true`, disables the active indicator for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\n *\n * @default false\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The visibility mode of the tab item label for this tab.\n *\n * When set on a trigger, it takes precedence over the value set on `NativeTabs`.\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 * 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?: ScreenProps<\n any,\n TabNavigationState<ParamListBase>,\n NativeTabNavigationEventMap\n >['listeners'];\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"]}
|
|
@@ -23,6 +23,19 @@ export declare function inMemoryContext(context: MemoryContext): ((id: string) =
|
|
|
23
23
|
id: string;
|
|
24
24
|
keys: () => string[];
|
|
25
25
|
};
|
|
26
|
+
export declare function normalizeKey(key: string): string;
|
|
27
|
+
export declare function findDuplicateKeys(normalizedKeys: readonly string[]): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Maps `requireContext` keys (`./name.ext`) to the extension-free, prefix-free
|
|
30
|
+
* form used by `inMemoryContext` override keys (e.g. `_layout`, `nested/route`).
|
|
31
|
+
*
|
|
32
|
+
* The returned record is keyed by the normalized key and holds the original
|
|
33
|
+
* require-context key, so a normalized key can be resolved back to the file it
|
|
34
|
+
* came from. When two files normalize to the same key (e.g. both `index.jsx`
|
|
35
|
+
* and `index.tsx`), it throws, matching the ambiguity `requireContext` cannot
|
|
36
|
+
* represent.
|
|
37
|
+
*/
|
|
38
|
+
export declare function normalizeKeys(keys: string[]): Record<string, string>;
|
|
26
39
|
export declare function requireContextWithOverrides(dir: string, overrides: MemoryContext): ((id: string) => any) & {
|
|
27
40
|
keys: () => string[];
|
|
28
41
|
resolve: (key: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAChB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC,GACF,cAAc,CAAC;AAEnB,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,gBAAgB,CAAC,GAAG;IACxE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC;AAI1B,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,SAEpC,MAAM;aAhBT,cAAc;wBACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;aAC9B,cAAc;;;;mBAmBR,MAAM;;;EAa1B;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,E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9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.requireContext = void 0;
|
|
7
7
|
exports.inMemoryContext = inMemoryContext;
|
|
8
|
+
exports.normalizeKey = normalizeKey;
|
|
9
|
+
exports.findDuplicateKeys = findDuplicateKeys;
|
|
10
|
+
exports.normalizeKeys = normalizeKeys;
|
|
8
11
|
exports.requireContextWithOverrides = requireContextWithOverrides;
|
|
9
12
|
const path_1 = __importDefault(require("path"));
|
|
10
13
|
const require_context_ponyfill_1 = __importDefault(require("./require-context-ponyfill"));
|
|
@@ -26,8 +29,41 @@ function inMemoryContext(context) {
|
|
|
26
29
|
}),
|
|
27
30
|
});
|
|
28
31
|
}
|
|
32
|
+
function normalizeKey(key) {
|
|
33
|
+
const withoutPrefix = key.replace(/^\.\//, '');
|
|
34
|
+
const ext = path_1.default.extname(withoutPrefix);
|
|
35
|
+
return validExtensions.includes(ext) ? withoutPrefix.slice(0, -ext.length) : withoutPrefix;
|
|
36
|
+
}
|
|
37
|
+
function findDuplicateKeys(normalizedKeys) {
|
|
38
|
+
return normalizedKeys.filter((normalizedKey, index) => normalizedKeys.indexOf(normalizedKey) !== index);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Maps `requireContext` keys (`./name.ext`) to the extension-free, prefix-free
|
|
42
|
+
* form used by `inMemoryContext` override keys (e.g. `_layout`, `nested/route`).
|
|
43
|
+
*
|
|
44
|
+
* The returned record is keyed by the normalized key and holds the original
|
|
45
|
+
* require-context key, so a normalized key can be resolved back to the file it
|
|
46
|
+
* came from. When two files normalize to the same key (e.g. both `index.jsx`
|
|
47
|
+
* and `index.tsx`), it throws, matching the ambiguity `requireContext` cannot
|
|
48
|
+
* represent.
|
|
49
|
+
*/
|
|
50
|
+
function normalizeKeys(keys) {
|
|
51
|
+
const normalizedKeys = keys.map(normalizeKey);
|
|
52
|
+
const duplicateKeys = findDuplicateKeys(normalizedKeys);
|
|
53
|
+
if (duplicateKeys.length > 0) {
|
|
54
|
+
throw new Error(`Multiple routes resolved to the same route: ${duplicateKeys.join(', ')}`);
|
|
55
|
+
}
|
|
56
|
+
return Object.fromEntries(keys.map((key) => [normalizeKey(key), key]));
|
|
57
|
+
}
|
|
29
58
|
function requireContextWithOverrides(dir, overrides) {
|
|
30
|
-
const
|
|
59
|
+
const rawContext = (0, require_context_ponyfill_1.default)(path_1.default.resolve(process.cwd(), dir));
|
|
60
|
+
// Normalize the require-context keys (`./name.ext`) to the extension-free form
|
|
61
|
+
// used by override keys, so `overrides` can be matched directly.
|
|
62
|
+
const normalizedKeys = normalizeKeys(rawContext.keys());
|
|
63
|
+
const existingContext = Object.assign((id) => rawContext(normalizedKeys[id] ?? id), {
|
|
64
|
+
keys: () => Object.keys(normalizedKeys),
|
|
65
|
+
});
|
|
66
|
+
const uniqueKeys = Array.from(new Set([...Object.keys(overrides), ...existingContext.keys()]));
|
|
31
67
|
return Object.assign(function (id) {
|
|
32
68
|
if (id in overrides) {
|
|
33
69
|
const route = overrides[id];
|
|
@@ -37,7 +73,7 @@ function requireContextWithOverrides(dir, overrides) {
|
|
|
37
73
|
return existingContext(id);
|
|
38
74
|
}
|
|
39
75
|
}, {
|
|
40
|
-
keys: () => [...
|
|
76
|
+
keys: () => [...uniqueKeys],
|
|
41
77
|
resolve: (key) => key,
|
|
42
78
|
id: '0',
|
|
43
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;AAwBA,0CAoBC;AAED,
|
|
1
|
+
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;AAwBA,0CAoBC;AAED,oCAIC;AAED,8CAIC;AAYD,sCAOC;AAED,kEA2BC;AAvGD,gDAAwB;AAExB,0FAAwD;AAiB/C,yBAjBF,kCAAc,CA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C,MAAM,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE;QAC1F,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;KACxC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/F,OAAO,MAAM,CAAC,MAAM,CAClB,UAAU,EAAU;QAClB,IAAI,EAAE,IAAI,SAAS,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;YAC5B,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,OAAO,eAAe,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,EACD;QACE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC;QAC3B,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG;QAC7B,EAAE,EAAE,GAAG;KACR,CACF,CAAC;AACJ,CAAC","sourcesContent":["import type { LoaderFunction } from 'expo-server';\nimport path from 'path';\n\nimport requireContext from './require-context-ponyfill';\nimport type { NativeIntent } from '../types';\n\nexport type ReactComponent = () => React.ReactElement<any, any> | null;\nexport type NativeIntentStub = NativeIntent;\nexport type FileStub =\n | (Record<string, unknown> & {\n default: ReactComponent;\n unstable_settings?: Record<string, any>;\n loader?: LoaderFunction;\n })\n | ReactComponent;\n\nexport type MemoryContext = Record<string, FileStub | NativeIntentStub> & {\n '+native-intent'?: NativeIntentStub;\n};\n\nexport { requireContext };\n\nconst validExtensions = ['.js', '.jsx', '.ts', '.tsx'];\n\nexport function inMemoryContext(context: MemoryContext) {\n return Object.assign(\n function (id: string) {\n id = id.replace(/^\\.\\//, '').replace(/\\.\\w*$/, '');\n return typeof context[id] === 'function' ? { default: context[id] } : context[id];\n },\n {\n resolve: (key: string) => key,\n id: '0',\n keys: () =>\n Object.keys(context).map((key) => {\n const ext = path.extname(key);\n key = key.replace(/^\\.\\//, '');\n key = key.startsWith('/') ? key : `./${key}`;\n key = validExtensions.includes(ext) ? key : `${key}.js`;\n\n return key;\n }),\n }\n );\n}\n\nexport function normalizeKey(key: string): string {\n const withoutPrefix = key.replace(/^\\.\\//, '');\n const ext = path.extname(withoutPrefix);\n return validExtensions.includes(ext) ? withoutPrefix.slice(0, -ext.length) : withoutPrefix;\n}\n\nexport function findDuplicateKeys(normalizedKeys: readonly string[]): string[] {\n return normalizedKeys.filter(\n (normalizedKey, index) => normalizedKeys.indexOf(normalizedKey) !== index\n );\n}\n\n/**\n * Maps `requireContext` keys (`./name.ext`) to the extension-free, prefix-free\n * form used by `inMemoryContext` override keys (e.g. `_layout`, `nested/route`).\n *\n * The returned record is keyed by the normalized key and holds the original\n * require-context key, so a normalized key can be resolved back to the file it\n * came from. When two files normalize to the same key (e.g. both `index.jsx`\n * and `index.tsx`), it throws, matching the ambiguity `requireContext` cannot\n * represent.\n */\nexport function normalizeKeys(keys: string[]): Record<string, string> {\n const normalizedKeys = keys.map(normalizeKey);\n const duplicateKeys = findDuplicateKeys(normalizedKeys);\n if (duplicateKeys.length > 0) {\n throw new Error(`Multiple routes resolved to the same route: ${duplicateKeys.join(', ')}`);\n }\n return Object.fromEntries(keys.map((key) => [normalizeKey(key), key]));\n}\n\nexport function requireContextWithOverrides(dir: string, overrides: MemoryContext) {\n const rawContext = requireContext(path.resolve(process.cwd(), dir));\n\n // Normalize the require-context keys (`./name.ext`) to the extension-free form\n // used by override keys, so `overrides` can be matched directly.\n const normalizedKeys = normalizeKeys(rawContext.keys());\n const existingContext = Object.assign((id: string) => rawContext(normalizedKeys[id] ?? id), {\n keys: () => Object.keys(normalizedKeys),\n });\n\n const uniqueKeys = Array.from(new Set([...Object.keys(overrides), ...existingContext.keys()]));\n\n return Object.assign(\n function (id: string) {\n if (id in overrides) {\n const route = overrides[id];\n return typeof route === 'function' ? { default: route } : route;\n } else {\n return existingContext(id);\n }\n },\n {\n keys: () => [...uniqueKeys],\n resolve: (key: string) => key,\n id: '0',\n }\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.android.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.android.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"native.android.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.android.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA6B9D"}
|
|
@@ -16,11 +16,15 @@ function RouterToolbarHost(props) {
|
|
|
16
16
|
}
|
|
17
17
|
return baseModifiers;
|
|
18
18
|
}, [insets.bottom, props.withImePadding]);
|
|
19
|
-
|
|
19
|
+
// The wrapper fills the screen so it can pin the toolbar to the bottom, but `box-none` keeps it
|
|
20
|
+
// from being a touch target. The Compose `Host` then wraps just the toolbar (matchContents), so
|
|
21
|
+
// only that area swallows touches — taps elsewhere reach the screen content below (ENG-22124).
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "RouterToolbarWrapper", style: styles.container, pointerEvents: "box-none", children: (0, jsx_runtime_1.jsx)(jetpack_compose_1.Host, { matchContents: { vertical: true }, style: styles.host, children: (0, jsx_runtime_1.jsx)(jetpack_compose_1.Box, { modifiers: modifiers, contentAlignment: "center", children: (0, jsx_runtime_1.jsx)(jetpack_compose_1.HorizontalFloatingToolbar, { colors: {
|
|
20
23
|
...(props.backgroundColor ? { toolbarContainerColor: props.backgroundColor } : {}),
|
|
21
24
|
}, modifiers: [(0, modifiers_1.height)(64)], children: props.children }) }) }) }));
|
|
22
25
|
}
|
|
23
26
|
const styles = react_native_1.StyleSheet.create({
|
|
24
|
-
|
|
27
|
+
container: { ...react_native_1.StyleSheet.absoluteFill, justifyContent: 'flex-end' },
|
|
28
|
+
host: { width: '100%', paddingHorizontal: 24 },
|
|
25
29
|
});
|
|
26
30
|
//# sourceMappingURL=native.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.android.js","sourceRoot":"","sources":["../../src/toolbar/native.android.tsx"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"native.android.js","sourceRoot":"","sources":["../../src/toolbar/native.android.tsx"],"names":[],"mappings":";;AAQA,8CA6BC;;AArCD,8DAAgF;AAChF,kEAA+F;AAC/F,iCAAgC;AAChC,+CAAgD;AAChD,mFAAmE;AAInE,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,MAAM,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAEnC,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC7B,MAAM,aAAa,GAAG,CAAC,IAAA,wBAAY,GAAE,EAAE,IAAA,mBAAO,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;IAE1C,gGAAgG;IAChG,gGAAgG;IAChG,+FAA+F;IAC/F,OAAO,CACL,uBAAC,mBAAI,IAAC,MAAM,EAAC,sBAAsB,EAAC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,EAAC,UAAU,YACnF,uBAAC,sBAAI,IAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,YACzD,uBAAC,qBAAG,IAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAC,QAAQ,YAClD,uBAAC,2CAAyB,IACxB,MAAM,EAAE;wBACN,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACnF,EACD,SAAS,EAAE,CAAC,IAAA,kBAAM,EAAC,EAAE,CAAC,CAAC,YACtB,KAAK,CAAC,QAAQ,GACW,GACxB,GACD,GACF,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE,EAAE,GAAG,yBAAU,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE;IACrE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,EAAE;CAC/C,CAAC,CAAC","sourcesContent":["import { Host, HorizontalFloatingToolbar, Box } from '@expo/ui/jetpack-compose';\nimport { fillMaxWidth, height, padding, imePadding } from '@expo/ui/jetpack-compose/modifiers';\nimport { useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport type { RouterToolbarHostProps } from './native.types';\n\nexport function RouterToolbarHost(props: RouterToolbarHostProps) {\n const insets = useSafeAreaInsets();\n\n const modifiers = useMemo(() => {\n const baseModifiers = [fillMaxWidth(), padding(0, 0, 0, insets.bottom)];\n if (props.withImePadding) {\n baseModifiers.push(imePadding());\n }\n return baseModifiers;\n }, [insets.bottom, props.withImePadding]);\n\n // The wrapper fills the screen so it can pin the toolbar to the bottom, but `box-none` keeps it\n // from being a touch target. The Compose `Host` then wraps just the toolbar (matchContents), so\n // only that area swallows touches — taps elsewhere reach the screen content below (ENG-22124).\n return (\n <View testID=\"RouterToolbarWrapper\" style={styles.container} pointerEvents=\"box-none\">\n <Host matchContents={{ vertical: true }} style={styles.host}>\n <Box modifiers={modifiers} contentAlignment=\"center\">\n <HorizontalFloatingToolbar\n colors={{\n ...(props.backgroundColor ? { toolbarContainerColor: props.backgroundColor } : {}),\n }}\n modifiers={[height(64)]}>\n {props.children}\n </HorizontalFloatingToolbar>\n </Box>\n </Host>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: { ...StyleSheet.absoluteFill, justifyContent: 'flex-end' },\n host: { width: '100%', paddingHorizontal: 24 },\n});\n"]}
|
package/build/utils/url.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export declare function hasUrlProtocolPrefix(href: string): boolean;
|
|
|
6
6
|
export declare function isWellKnownUri(href: string): boolean;
|
|
7
7
|
export declare function shouldLinkExternally(href: string): boolean;
|
|
8
8
|
export declare function parseUrlUsingCustomBase(href: string): URL;
|
|
9
|
+
export declare function safeDecodeURI(value: any): any;
|
|
10
|
+
export declare function safeDecodeURIComponent(value: any): any;
|
|
9
11
|
//# sourceMappingURL=url.d.ts.map
|
package/build/utils/url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKpD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAOzD"}
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKpD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAOzD;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,OAOvC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,GAAG,OAOhD"}
|
package/build/utils/url.js
CHANGED
|
@@ -4,6 +4,8 @@ exports.hasUrlProtocolPrefix = hasUrlProtocolPrefix;
|
|
|
4
4
|
exports.isWellKnownUri = isWellKnownUri;
|
|
5
5
|
exports.shouldLinkExternally = shouldLinkExternally;
|
|
6
6
|
exports.parseUrlUsingCustomBase = parseUrlUsingCustomBase;
|
|
7
|
+
exports.safeDecodeURI = safeDecodeURI;
|
|
8
|
+
exports.safeDecodeURIComponent = safeDecodeURIComponent;
|
|
7
9
|
/**
|
|
8
10
|
* Does the input string start with a valid URL scheme.
|
|
9
11
|
* NOTE: Additional strictness added to ensure URLs sent in query parameters for in-app navigation are not matched.
|
|
@@ -29,4 +31,23 @@ function parseUrlUsingCustomBase(href) {
|
|
|
29
31
|
// dummy URL in the output bytecode
|
|
30
32
|
return new URL(href, 'file:');
|
|
31
33
|
}
|
|
34
|
+
// Malformed percent-encoding (e.g. `%GG`) would otherwise throw and drop the value.
|
|
35
|
+
function safeDecodeURI(value) {
|
|
36
|
+
try {
|
|
37
|
+
return typeof value === 'string' ? decodeURI(value) : value;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// If the value is not a valid URI, return it as is
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function safeDecodeURIComponent(value) {
|
|
45
|
+
try {
|
|
46
|
+
return typeof value === 'string' ? decodeURIComponent(value) : value;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// If the value is not a valid URI component, return it as is
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
32
53
|
//# sourceMappingURL=url.js.map
|
package/build/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAIA,oDAEC;AAED,wCAKC;AAED,oDAGC;AAED,0DAOC;
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAIA,oDAEC;AAED,wCAKC;AAED,oDAGC;AAED,0DAOC;AAGD,sCAOC;AAED,wDAOC;AA9CD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY;IACzC,mHAAmH;IACnH,8HAA8H;IAC9H,mGAAmG;IACnG,OAAO,yEAAyE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9F,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,uEAAuE;IACvE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;AACvF,CAAC;AAED,SAAgB,uBAAuB,CAAC,IAAY;IAClD,mFAAmF;IACnF,yGAAyG;IACzG,mHAAmH;IACnH,gHAAgH;IAChH,mCAAmC;IACnC,OAAO,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,oFAAoF;AACpF,SAAgB,aAAa,CAAC,KAAU;IACtC,IAAI,CAAC;QACH,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,mDAAmD;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAgB,sBAAsB,CAAC,KAAU;IAC/C,IAAI,CAAC;QACH,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/**\n * Does the input string start with a valid URL scheme.\n * NOTE: Additional strictness added to ensure URLs sent in query parameters for in-app navigation are not matched.\n */\nexport function hasUrlProtocolPrefix(href: string): boolean {\n return /^([\\w\\d_+.-]+:)?\\/\\//.test(href);\n}\n\nexport function isWellKnownUri(href: string): boolean {\n // This is a hack and we should change this to work like the web in the future where we have full confidence in the\n // ability to match URLs and send anything unmatched to the OS. The main difference between this and `hasUrlProtocolPrefix` is\n // that we don't require `//`, e.g. `mailto:` is valid and common, and `mailto://bacon` is invalid.\n return /^(https?|mailto|tel|sms|geo|maps|market|itmss?|itms-apps|content|file):/.test(href);\n}\n\nexport function shouldLinkExternally(href: string): boolean {\n // Cheap check first to avoid regex if the href is not a path fragment.\n return !href.startsWith('.') && (hasUrlProtocolPrefix(href) || isWellKnownUri(href));\n}\n\nexport function parseUrlUsingCustomBase(href: string): URL {\n // NOTE(@kitten): This used to use a dummy base URL for parsing (phony [.] example)\n // However, this seems to get flagged since it's preserved 1:1 in the output bytecode by certain scanners\n // Instead, we use an empty `file:` URL. This will still perform `pathname` normalization, search parameter parsing\n // encoding, and all other logic, except the logic that applies to hostnames and protocols, and also not leave a\n // dummy URL in the output bytecode\n return new URL(href, 'file:');\n}\n\n// Malformed percent-encoding (e.g. `%GG`) would otherwise throw and drop the value.\nexport function safeDecodeURI(value: any) {\n try {\n return typeof value === 'string' ? decodeURI(value) : value;\n } catch {\n // If the value is not a valid URI, return it as is\n return value;\n }\n}\n\nexport function safeDecodeURIComponent(value: any) {\n try {\n return typeof value === 'string' ? decodeURIComponent(value) : value;\n } catch {\n // If the value is not a valid URI component, return it as is\n return value;\n }\n}\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": "57.0.
|
|
6
|
+
"version": "57.0.5",
|
|
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-57.0.
|
|
28
|
-
"url": "expo.modules.router-57.0.
|
|
27
|
+
"name": "expo.modules.router-57.0.5.aar",
|
|
28
|
+
"url": "expo.modules.router-57.0.5.aar",
|
|
29
29
|
"size": 15835,
|
|
30
30
|
"sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
|
|
31
31
|
"sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
],
|
|
75
75
|
"files": [
|
|
76
76
|
{
|
|
77
|
-
"name": "expo.modules.router-57.0.
|
|
78
|
-
"url": "expo.modules.router-57.0.
|
|
77
|
+
"name": "expo.modules.router-57.0.5.aar",
|
|
78
|
+
"url": "expo.modules.router-57.0.5.aar",
|
|
79
79
|
"size": 15835,
|
|
80
80
|
"sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
|
|
81
81
|
"sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
},
|
|
95
95
|
"files": [
|
|
96
96
|
{
|
|
97
|
-
"name": "expo.modules.router-57.0.
|
|
98
|
-
"url": "expo.modules.router-57.0.
|
|
97
|
+
"name": "expo.modules.router-57.0.5-sources.jar",
|
|
98
|
+
"url": "expo.modules.router-57.0.5-sources.jar",
|
|
99
99
|
"size": 2326,
|
|
100
100
|
"sha512": "a1a1537b57bc0d66efbf2bdfd5f514684400b9598e549eaf53c528d1bf32ff42b7826e74fb6e115f8ec0490b9e06ffbb3c3efe9f2f703652c13291ef82b0fa03",
|
|
101
101
|
"sha256": "2add0f802e663eb9b5f90e086dca0e0e337a1442e15fb372a05945e01ee0d289",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e8d1bbedba5de10c46d5e46476f62326
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a3f63ee6818b53997268ea14a6eb8c99959a5eef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3e1054e647687d11d48619f260ff19651e36f03be6b07f2b663ba45a3cece14c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9e80d081fea169f137a510b9af0cc6f160a023be5dd8764dfffbc363e77b4f379710cc9c241c2b1e8cf5d5dc05ea34e43ec3935f51fa887047d3814e9fefe7db
|
|
@@ -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>57.0.
|
|
12
|
+
<version>57.0.5</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
|
+
6de91c05cd4e129192cfed180b8ecea5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f60a999f72d4b2d45efe72bf604de454bb72432e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9b25a6a83c0a7c28f5cc411fb3d5b1f06f290d11365c99e4313f0691e3b2207e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b6c409018e032436d1e550e75975f22ccdc62363cf2cfab3060df93359ed94367e4f21a084c7762e62f1121b606ac995e8f59d7cb08b3be4986ae080b9783e30
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.router</groupId>
|
|
4
4
|
<artifactId>expo.modules.router</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>57.0.
|
|
7
|
-
<release>57.0.
|
|
6
|
+
<latest>57.0.5</latest>
|
|
7
|
+
<release>57.0.5</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>57.0.
|
|
9
|
+
<version>57.0.5</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260715091322</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9b031ff4b15ecadf89be345f951f35b4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e1acfde3354601e5478f387488596003d90082e9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f733b279f1b603c79efc9926632c3eaf4c3dcbae9dd44f68048112f5b12a674f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f7164c0e2f0cebfc3cc376578f1e46a81350701965280b9a921542277b3482878d0ec8bc705d8af7d9889c52cec5acc28376768004947eed4c607a29e02884f6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.5",
|
|
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",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@expo/log-box": "^57.0.0",
|
|
82
|
-
"@expo/metro-runtime": "^57.0.
|
|
82
|
+
"@expo/metro-runtime": "^57.0.4",
|
|
83
83
|
"@testing-library/react-native": ">= 13.2.0",
|
|
84
84
|
"expo": "*",
|
|
85
|
-
"expo-constants": "^57.0.
|
|
85
|
+
"expo-constants": "^57.0.4",
|
|
86
86
|
"expo-linking": "^57.0.2",
|
|
87
87
|
"react": "*",
|
|
88
88
|
"react-dom": "*",
|
|
@@ -136,13 +136,13 @@
|
|
|
136
136
|
"react-native-web": "~0.21.0",
|
|
137
137
|
"react-server-dom-webpack": "~19.0.6",
|
|
138
138
|
"tsd": "^0.33.0",
|
|
139
|
-
"expo": "57.0.
|
|
139
|
+
"expo": "57.0.5"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"@expo/log-box": "^57.0.0",
|
|
143
|
-
"@expo/metro-runtime": "^57.0.
|
|
143
|
+
"@expo/metro-runtime": "^57.0.4",
|
|
144
144
|
"@expo/schema-utils": "^57.0.1",
|
|
145
|
-
"@expo/ui": "^57.0.
|
|
145
|
+
"@expo/ui": "^57.0.5",
|
|
146
146
|
"@radix-ui/react-slot": "^1.2.0",
|
|
147
147
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
148
148
|
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"standard-navigation": "^0.0.5",
|
|
170
170
|
"vaul": "^1.1.2"
|
|
171
171
|
},
|
|
172
|
-
"gitHead": "
|
|
172
|
+
"gitHead": "70af1caf83d8a324b46e02e18cd5c8c4e310da20",
|
|
173
173
|
"scripts": {
|
|
174
174
|
"build": "node ./scripts/build.js",
|
|
175
175
|
"clean": "expo-module clean",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5b2d8dd677956cbb6476cb1fef235b1c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
27131aa4b59b8c3867b7f72d9007bb3c637a8052
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9bc973d1dfa359d953b6e38fe5a81fee7f8e8555a557173f083e216eeb54b5fe
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
21e0619862828cac8476c12abc80eb4a50990c5c2121b2b21fcb56f9f902529c1e95d81eea48789c7b5b6946d651e8c4b92859f9002116d661383cbdf8ab02a1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
db4018086480051e95f5557f54994f75
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cee4bf2b8203773ac884fbbae428f977aeaecde8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b2d51e814f68bf4c172f40c3748953f454bedbf683095a0a3866a50874dcf67c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9508ad78401fa6ce32855ea92c4f8fa23c72b982e949a2839483a768c4c9f7e4551fb16afb27d68b88dfea1ffe7298404eb201873374033356091b92f8ec1a87
|
|
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
|