expo-router 7.0.0-canary-20260120-bb71700 → 55.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/build/Route.d.ts +1 -1
- package/build/Route.d.ts.map +1 -1
- package/build/Route.js.map +1 -1
- package/build/hooks.d.ts +2 -1
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +11 -4
- package/build/hooks.js.map +1 -1
- package/build/layouts/TabsClient.d.ts +23 -17
- package/build/layouts/TabsClient.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts +3 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.d.ts +3 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js +4 -4
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts +0 -8
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js +2 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/types.d.ts +2 -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 +2 -1
- package/build/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/types.d.ts +0 -8
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +8 -4
- package/build/ui/TabTrigger.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Toolbar/RouterToolbarHostView.swift +0 -9
- package/ios/Toolbar/RouterToolbarItemView.swift +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.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 +16 -15
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/server.d.ts +1 -15
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.md5 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha1 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha256 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha512 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.md5 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha1 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha256 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha512 → 55.0.0-beta.0/expo.modules.router-55.0.0-beta.0.aar.sha512} +0 -0
|
@@ -14,14 +14,6 @@ export interface StackToolbarSpacerProps {
|
|
|
14
14
|
* and expand to fill available space.
|
|
15
15
|
*/
|
|
16
16
|
width?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Whether to hide the shared background.
|
|
19
|
-
*
|
|
20
|
-
* Only available in bottom placement.
|
|
21
|
-
*
|
|
22
|
-
* @platform iOS 26+
|
|
23
|
-
*/
|
|
24
|
-
hidesSharedBackground?: boolean;
|
|
25
17
|
/**
|
|
26
18
|
* Whether this spacer shares background with adjacent items.
|
|
27
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackToolbarSpacer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAKnF,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"StackToolbarSpacer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAKnF,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAQhE,CAAC;AAEF,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,uBAAuB,GAC7B,4BAA4B,GAAG,SAAS,CAqB1C"}
|
|
@@ -52,7 +52,7 @@ const context_1 = require("./context");
|
|
|
52
52
|
const StackToolbarSpacer = (props) => {
|
|
53
53
|
const placement = (0, context_1.useToolbarPlacement)();
|
|
54
54
|
if (placement === 'bottom') {
|
|
55
|
-
return <bottom_toolbar_native_elements_1.NativeToolbarSpacer {...props}/>;
|
|
55
|
+
return <bottom_toolbar_native_elements_1.NativeToolbarSpacer {...props} hidesSharedBackground={!props.sharesBackground}/>;
|
|
56
56
|
}
|
|
57
57
|
return null;
|
|
58
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackToolbarSpacer.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;
|
|
1
|
+
{"version":3,"file":"StackToolbarSpacer.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAuFb,oGAuBC;AA3GD,qFAAuE;AACvE,uCAAgD;AA6BhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACI,MAAM,kBAAkB,GAAsC,CAAC,KAAK,EAAE,EAAE;IAC7E,MAAM,SAAS,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAExC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,oDAAmB,CAAC,IAAI,KAAK,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAG,CAAC;IAC5F,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEF,SAAgB,4CAA4C,CAC1D,KAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEhC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,wDAAwD;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI,CACV,sIAAsI,CACvI,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK,IAAI,CAAC;KACpB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport type { NativeStackHeaderItemSpacing } from '@react-navigation/native-stack';\n\nimport { NativeToolbarSpacer } from './bottom-toolbar-native-elements';\nimport { useToolbarPlacement } from './context';\n\nexport interface StackToolbarSpacerProps {\n /**\n * Whether the spacer should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n // TODO(@ubax): implement fluid spacing in react-native-screens\n /**\n * The width of the spacing element.\n *\n * In Left/Right placements, width is required.\n * In Bottom placement, if width is not provided, the spacer will be flexible\n * and expand to fill available space.\n */\n width?: number;\n // TODO(@ubax): implement missing props in react-native-screens\n /**\n * Whether this spacer shares background with adjacent items.\n *\n * Only available in bottom placement.\n *\n * @platform iOS 26+\n */\n sharesBackground?: boolean;\n}\n\n/**\n * A spacing helper used inside `Stack.Toolbar` to create empty space between toolbar items.\n *\n * In left/right placements, width is required.\n * In bottom placement, if width is not provided, creates a flexible spacer that expands to fill space.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"arrow.left\" />\n * <Stack.Toolbar.Spacer width={8} />\n * <Stack.Toolbar.Button icon=\"arrow.right\" />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar>\n * <Stack.Toolbar.Spacer />\n * <Stack.Toolbar.Button icon=\"search\" />\n * <Stack.Toolbar.Spacer />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarSpacer: React.FC<StackToolbarSpacerProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement === 'bottom') {\n return <NativeToolbarSpacer {...props} hidesSharedBackground={!props.sharesBackground} />;\n }\n\n return null;\n};\n\nexport function convertStackToolbarSpacerPropsToRNHeaderItem(\n props: StackToolbarSpacerProps\n): NativeStackHeaderItemSpacing | undefined {\n const { hidden, width } = props;\n\n if (hidden) {\n return undefined;\n }\n\n // Warn if using flexible spacer in Left/Right placement\n if (width === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Stack.Toolbar.Spacer requires `width` when used in Left or Right placement. Flexible spacers are only supported in Bottom placement.'\n );\n }\n return undefined;\n }\n\n return {\n type: 'spacing',\n spacing: width ?? 0,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,KAAK,EACV,uBAAuB,EAEvB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,WAAW,EACX,GAAG,IAAI,EACR,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,KAAK,EACV,uBAAuB,EAEvB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,WAAW,EACX,GAAG,IAAI,EACR,EAAE,uBAAuB,qBAkHzB;AAWD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe,qBAiBhE"}
|
|
@@ -92,6 +92,7 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
|
|
|
92
92
|
contentRenderer: () => descriptors[route.key].render(),
|
|
93
93
|
})), [routes, descriptors]);
|
|
94
94
|
const visibleFocusedTabIndex = (0, react_1.useMemo)(() => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key), [visibleTabs, routes, state.index]);
|
|
95
|
+
const visibleTabsKeys = (0, react_1.useMemo)(() => visibleTabs.map((tab) => tab.routeKey).join(';'), [visibleTabs]);
|
|
95
96
|
if (visibleFocusedTabIndex < 0) {
|
|
96
97
|
if (process.env.NODE_ENV !== 'production') {
|
|
97
98
|
throw new Error(`The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: "${(0, linking_1.getPathFromState)(state)}"`);
|
|
@@ -118,7 +119,7 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
|
|
|
118
119
|
}, [descriptors, navigation, state.key]);
|
|
119
120
|
return (<NavigationContent>
|
|
120
121
|
<exports.NativeTabsContext value>
|
|
121
|
-
<NativeTabsView_1.NativeTabsView {...rest} focusedIndex={focusedIndex} tabs={visibleTabs} onTabChange={onTabChange}/>
|
|
122
|
+
<NativeTabsView_1.NativeTabsView {...rest} key={visibleTabsKeys} focusedIndex={focusedIndex} tabs={visibleTabs} onTabChange={onTabChange}/>
|
|
122
123
|
</exports.NativeTabsContext>
|
|
123
124
|
</NavigationContent>);
|
|
124
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bb,
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bb,kDA8HC;AAWD,gEAiBC;AAvLD,qDAQkC;AAClC,+CAAyD;AAEzD,qEAAkE;AAClE,yDAAsD;AACtD,qDAAkD;AAOlD,mCAAsF;AACtF,oEAAiE;AACjE,6CAAmD;AACnD,gDAAkF;AAElF,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAC9B,QAAA,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAAU,KAAK,CAAC,CAAC;AAErE,SAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,GAAG,mBAAmB,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,WAAW,EACX,GAAG,IAAI,EACiB;IACxB,IAAI,IAAA,WAAG,EAAC,yBAAiB,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,mGAAmG,CACpG,CAAC;IACJ,CAAC;IAED,MAAM,mBAAmB,GAAG,IAAA,qCAA6B,EAAC,UAAU,CAAC,CAAC;IACtE,MAAM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C;IAEF,OAAO,CACL,CAAC,8BAA8B,CAC7B,IAAI,KAAK,CAAC,CACV,QAAQ,CAAC,CAAC,eAAe,CAAC,CAC1B,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,EACvC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport {\n createNavigatorFactory,\n NavigationState,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n type EventMapBase,\n} from '@react-navigation/native';\nimport React, { use, useCallback, useMemo } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n InternalNativeTabsProps,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\nimport { getAllChildrenNotOfType, getAllChildrenOfType } from '../utils/children';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n ...rest\n}: InternalNativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key].options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key].options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key].render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key),\n [visibleTabs, routes, state.index]\n );\n const visibleTabsKeys = useMemo(\n () => visibleTabs.map((tab) => tab.routeKey).join(';'),\n [visibleTabs]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n\n const onTabChange = useCallback(\n (tabKey: string) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.emit({\n type: 'tabPress',\n target: tabKey,\n data: {\n __internalTabsType: 'native',\n },\n });\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n },\n [descriptors, navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <NativeTabsContext value>\n <NativeTabsView\n {...rest}\n key={visibleTabsKeys}\n focusedIndex={focusedIndex}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nconst NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n NavigationState,\n EventMapBase\n>(createNativeTabNavigator().Navigator, undefined, true);\n\nexport function NativeTabsNavigatorWrapper(props: NativeTabsProps) {\n const triggerChildren = useMemo(\n () => getAllChildrenOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n const nonTriggerChildren = useMemo(\n () => getAllChildrenNotOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n\n return (\n <NativeTabsNavigatorWithContext\n {...props}\n children={triggerChildren}\n nonTriggerChildren={nonTriggerChildren}\n />\n );\n}\n"]}
|
|
@@ -238,6 +238,8 @@ export interface NativeTabTriggerProps {
|
|
|
238
238
|
* If true, the tab will be hidden from the tab bar.
|
|
239
239
|
*
|
|
240
240
|
* > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.
|
|
241
|
+
*
|
|
242
|
+
* > **Note**: Dynamically hiding tabs will remount the navigator and the state will be reset.
|
|
241
243
|
*/
|
|
242
244
|
hidden?: boolean;
|
|
243
245
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,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sGa,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;AA2KE,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;AA8FX,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 { DefaultRouterOptions } from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: TabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\n disableAutomaticContentInsets?: boolean;\n contentStyle?: Pick<\n ViewStyle,\n | 'backgroundColor'\n | 'experimental_backgroundImage'\n | 'padding'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingBlock'\n | 'paddingBlockEnd'\n | 'paddingBlockStart'\n | 'paddingInline'\n | 'paddingInlineEnd'\n | 'paddingInlineStart'\n | 'paddingEnd'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingStart'\n | 'alignContent'\n | 'alignItems'\n | 'justifyContent'\n | 'flexDirection'\n | 'gap'\n >;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n /**\n * Controls how the icon is rendered on iOS.\n * @platform ios\n * @default 'template'\n */\n renderingMode?: 'template' | 'original';\n };\n\nexport type NativeTabsLabelStyle = Pick<\n TextStyle,\n 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'color'\n>;\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?:\n | StyleProp<NativeTabsLabelStyle>\n | {\n default?: StyleProp<NativeTabsLabelStyle>;\n selected?: StyleProp<NativeTabsLabelStyle>;\n };\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: ColorValue };\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * When set to `true`, hides the tab bar.\n *\n * @default false\n */\n hidden?: boolean;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface NativeTabsViewProps\n extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The default behavior differs between iOS and Android.\n *\n * On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,\n * and the **bottom** inset is applied. Other insets must be handled manually.\n *\n * On **iOS**, the first scroll view nested inside a native tabs screen has\n * [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled\n *\n * When this property is set to `true`, automatic content inset adjustment is disabled for the screen\n * and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`\n * to handle safe area insets.\n *\n * @platform android\n * @platform ios\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * The style applied to the content of the tab\n *\n * Note: Only certain style properties are supported.\n */\n contentStyle?: NativeTabOptions['contentStyle'];\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AAsGa,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;AA2KE,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;AAgGX,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 { DefaultRouterOptions } from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type {\n ColorValue,\n ImageSourcePropType,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native';\nimport type { TabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport type NativeScreenProps = Partial<Omit<TabsScreenProps, 'tabKey' | 'isFocused'>>;\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n icon?: SymbolOrImageSource;\n selectedIcon?: SymbolOrImageSource;\n title?: string;\n badgeValue?: string;\n selectedLabelStyle?: NativeTabsLabelStyle;\n labelStyle?: NativeTabsLabelStyle;\n role?: NativeTabsTabBarItemRole;\n selectedIconColor?: ColorValue;\n selectedBadgeBackgroundColor?: ColorValue;\n badgeBackgroundColor?: ColorValue;\n badgeTextColor?: ColorValue;\n backgroundColor?: ColorValue;\n blurEffect?: NativeTabsBlurEffect;\n shadowColor?: ColorValue;\n iconColor?: ColorValue;\n disableTransparentOnScrollEdge?: boolean;\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n indicatorColor?: ColorValue;\n hidden?: boolean;\n specialEffects?: TabsScreenProps['specialEffects'];\n nativeProps?: NativeScreenProps;\n disableAutomaticContentInsets?: boolean;\n contentStyle?: Pick<\n ViewStyle,\n | 'backgroundColor'\n | 'experimental_backgroundImage'\n | 'padding'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingBlock'\n | 'paddingBlockEnd'\n | 'paddingBlockStart'\n | 'paddingInline'\n | 'paddingInlineEnd'\n | 'paddingInlineStart'\n | 'paddingEnd'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingStart'\n | 'alignContent'\n | 'alignItems'\n | 'justifyContent'\n | 'flexDirection'\n | 'gap'\n >;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n /**\n * Controls how the icon is rendered on iOS.\n * @platform ios\n * @default 'template'\n */\n renderingMode?: 'template' | 'original';\n };\n\nexport type NativeTabsLabelStyle = Pick<\n TextStyle,\n 'fontFamily' | 'fontSize' | 'fontStyle' | 'fontWeight' | 'color'\n>;\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?:\n | StyleProp<NativeTabsLabelStyle>\n | {\n default?: StyleProp<NativeTabsLabelStyle>;\n selected?: StyleProp<NativeTabsLabelStyle>;\n };\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: ColorValue };\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * When set to `true`, hides the tab bar.\n *\n * @default false\n */\n hidden?: boolean;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * When set to `true`, enables the sidebarAdaptable tab bar style on iPadOS and macOS. This prop has no effect on iPhone.\n *\n * @platform iOS 18+\n */\n sidebarAdaptable?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\n\nexport interface InternalNativeTabsProps extends NativeTabsProps {\n nonTriggerChildren?: React.ReactNode;\n}\nexport interface NativeTabsViewProps\n extends Omit<\n InternalNativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: NativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n *\n * > **Note**: Dynamically hiding tabs will remount the navigator and the state will be reset.\n */\n hidden?: boolean;\n /**\n * Props passed to the underlying native tab screen implementation.\n * Use this to configure props not directly exposed by Expo Router, but available in `react-native-screens`.\n *\n * > **Note**: This will override any other props set by Expo Router and may lead to unexpected behavior.\n *\n * > **Note**: This is an unstable API and may change or be removed in minor versions.\n *\n * @platform android\n * @platform iOS\n */\n unstable_nativeProps?: NativeScreenProps;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see The supported values correspond to the official [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem).\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The default behavior differs between iOS and Android.\n *\n * On **Android**, the content of a native tabs screen is automatically wrapped in a `SafeAreaView`,\n * and the **bottom** inset is applied. Other insets must be handled manually.\n *\n * On **iOS**, the first scroll view nested inside a native tabs screen has\n * [automatic content inset adjustment](https://reactnative.dev/docs/scrollview#contentinsetadjustmentbehavior-ios) enabled\n *\n * When this property is set to `true`, automatic content inset adjustment is disabled for the screen\n * and must be managed manually. You can use `SafeAreaView` from `react-native-screens/experimental`\n * to handle safe area insets.\n *\n * @platform android\n * @platform ios\n */\n disableAutomaticContentInsets?: boolean;\n /**\n * The style applied to the content of the tab\n *\n * Note: Only certain style properties are supported.\n */\n contentStyle?: NativeTabOptions['contentStyle'];\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { LoaderFunction } from 'expo-server';
|
|
1
2
|
import requireContext from './require-context-ponyfill';
|
|
2
|
-
import {
|
|
3
|
+
import { NativeIntent } from '../types';
|
|
3
4
|
export type ReactComponent = () => React.ReactElement<any, any> | null;
|
|
4
5
|
export type NativeIntentStub = NativeIntent;
|
|
5
6
|
export type FileStub = (Record<string, unknown> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":"
|
|
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,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,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,SAI/D,MAAM;;mBAUH,MAAM;;EAI1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;AAwBA,0CAoBC;AAED,kEAkBC;AA/DD,gDAA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IAAA,kCAAc,EAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAEzE,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,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC;QAClE,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 { 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 requireContextWithOverrides(dir: string, overrides: MemoryContext) {\n const existingContext = requireContext(path.resolve(process.cwd(), dir));\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: () => [...Object.keys(overrides), ...existingContext.keys()],\n resolve: (key: string) => key,\n id: '0',\n }\n );\n}\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -57,13 +57,5 @@ export type NativeIntent = {
|
|
|
57
57
|
*/
|
|
58
58
|
legacy_subscribe?: (listener: (url: string) => void) => undefined | void | (() => void);
|
|
59
59
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Function type for route loaders. Loaders are executed on the server during
|
|
62
|
-
* SSR/SSG to fetch data required by a route.
|
|
63
|
-
*/
|
|
64
|
-
export type LoaderFunction<T = any> = (args: {
|
|
65
|
-
params: Record<string, string | string[]>;
|
|
66
|
-
request?: Request;
|
|
67
|
-
}) => Promise<T> | T;
|
|
68
60
|
export type * from './typed-routes/types';
|
|
69
61
|
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qE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CAAC,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;KAClB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KAAK,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;CACzF,CAAC;AAEF,mBAAmB,sBAAsB,CAAC"}
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// TODO: Use the global type\n/**\n * @hidden\n */\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/**\n * The list of input keys will become optional, everything else will remain the same.\n */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Created by using a special file called `+native-intent.tsx` at the top-level of your\n * project's **app** directory. It exports `redirectSystemPath` or `legacy_subscribe` functions,\n * both methods designed to handle URL/path processing.\n *\n * Useful for re-writing URLs to correctly target a route when unique/referred URLs\n * are incoming from third-party providers or stale URLs from previous versions.\n *\n * @see For more information on how to use `NativeIntent`, see [Customizing links](/router/advanced/native-intent/).\n */\nexport type NativeIntent = {\n /**\n * A special method used to process URLs in native apps. When invoked, it receives an\n * `options` object with the following properties:\n * - **path**: represents the URL or path undergoing processing.\n * - **initial**: a boolean indicating whether the path is the app's initial URL.\n *\n * Its return value should be a `string`, a `Promise<string | null>`, or `null`. When a falsy value\n * is returned (for example, `null`), no redirection occurs and the app stays on the current path.\n *\n * Note that throwing errors within this method may result in app crashes. It's recommended to\n * wrap your code inside a `try/catch` block and utilize `.catch()` when appropriate.\n *\n * @see For usage information, see [Redirecting system paths](/router/advanced/native-intent/#redirectsystempath).\n */\n redirectSystemPath?: (event: {\n path: string;\n initial: boolean;\n }) => Promise<string | null> | string | null;\n /**\n * > **warning** Experimentally available in SDK 52.\n *\n * Useful as an alternative API when a third-party provider doesn't support Expo Router\n * but has support for React Navigation via `Linking.subscribe()` for existing projects.\n *\n * Using this API is not recommended for newer projects or integrations since it is\n * incompatible with Server Side Routing and\n * [Static Rendering](/router/reference/static-rendering/), and can become challenging to manage while offline or in a low network environment.\n *\n */\n legacy_subscribe?: (listener: (url: string) => void) => undefined | void | (() => void);\n};\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// TODO: Use the global type\n/**\n * @hidden\n */\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/**\n * The list of input keys will become optional, everything else will remain the same.\n */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Created by using a special file called `+native-intent.tsx` at the top-level of your\n * project's **app** directory. It exports `redirectSystemPath` or `legacy_subscribe` functions,\n * both methods designed to handle URL/path processing.\n *\n * Useful for re-writing URLs to correctly target a route when unique/referred URLs\n * are incoming from third-party providers or stale URLs from previous versions.\n *\n * @see For more information on how to use `NativeIntent`, see [Customizing links](/router/advanced/native-intent/).\n */\nexport type NativeIntent = {\n /**\n * A special method used to process URLs in native apps. When invoked, it receives an\n * `options` object with the following properties:\n * - **path**: represents the URL or path undergoing processing.\n * - **initial**: a boolean indicating whether the path is the app's initial URL.\n *\n * Its return value should be a `string`, a `Promise<string | null>`, or `null`. When a falsy value\n * is returned (for example, `null`), no redirection occurs and the app stays on the current path.\n *\n * Note that throwing errors within this method may result in app crashes. It's recommended to\n * wrap your code inside a `try/catch` block and utilize `.catch()` when appropriate.\n *\n * @see For usage information, see [Redirecting system paths](/router/advanced/native-intent/#redirectsystempath).\n */\n redirectSystemPath?: (event: {\n path: string;\n initial: boolean;\n }) => Promise<string | null> | string | null;\n /**\n * > **warning** Experimentally available in SDK 52.\n *\n * Useful as an alternative API when a third-party provider doesn't support Expo Router\n * but has support for React Navigation via `Linking.subscribe()` for existing projects.\n *\n * Using this API is not recommended for newer projects or integrations since it is\n * incompatible with Server Side Routing and\n * [Static Rendering](/router/reference/static-rendering/), and can become challenging to manage while offline or in a low network environment.\n *\n */\n legacy_subscribe?: (listener: (url: string) => void) => undefined | void | (() => void);\n};\n\nexport type * from './typed-routes/types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTrigger.d.ts","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAO,YAAY,EAAE,cAAc,EAAe,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,IAAI,EAAyB,cAAc,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,qCAAqC,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IAC9E,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,qCAAqC,GAAG;IACpE;;;OAGG;IACH,I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;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CA6G3E"}
|
package/build/ui/TabTrigger.js
CHANGED
|
@@ -115,7 +115,9 @@ function useTabTrigger(options) {
|
|
|
115
115
|
});
|
|
116
116
|
if (!(0, useLinkToPathProps_1.shouldHandleMouseEvent)(event))
|
|
117
117
|
return;
|
|
118
|
-
|
|
118
|
+
if (!trigger.isFocused) {
|
|
119
|
+
switchTab(name, { resetOnFocus });
|
|
120
|
+
}
|
|
119
121
|
}, [onPress, name, resetOnFocus, trigger]);
|
|
120
122
|
const handleOnLongPress = (0, react_1.useCallback)((event) => {
|
|
121
123
|
onLongPress?.(event);
|
|
@@ -129,9 +131,11 @@ function useTabTrigger(options) {
|
|
|
129
131
|
});
|
|
130
132
|
if (!(0, useLinkToPathProps_1.shouldHandleMouseEvent)(event))
|
|
131
133
|
return;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
if (!trigger.isFocused) {
|
|
135
|
+
switchTab(name, {
|
|
136
|
+
resetOnFocus,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
135
139
|
}, [onLongPress, name, resetOnFocus, trigger]);
|
|
136
140
|
const triggerProps = {
|
|
137
141
|
isFocused: Boolean(trigger?.isFocused),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTrigger.js","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":";;AAoEA,gCA4BC;AAKD,oCAIC;AAkCD,sCAyGC;AApPD,qDAA4C;AAE5C,iCAAkF;AAClF,+CAA2E;AAE3E,6CAAoD;AAEpD,+DAAyD;AACzD,sDAA2C;AAC3C,mEAAoE;AACpE,0CAAyD;AAEzD,kDAAyD;AAqCzD,MAAM,cAAc,GAAG,iBAA4D,CAAC;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,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AAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAC3C,CAAC;IAEF,MAAM,YAAY,GAAG;QACnB,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;QACtC,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IAEF,OAAO;QACL,SAAS;QACT,UAAU;QACV,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { TabNavigationState } from '@react-navigation/native';\nimport { ReactNode, use, ReactElement, ComponentProps, useCallback } from 'react';\nimport { View, StyleSheet, Pressable, PressableProps } from 'react-native';\n\nimport { TabTriggerMapContext } from './TabContext';\nimport type { TriggerMap } from './common';\nimport { appendBaseUrl } from '../fork/getPathFromState';\nimport { router } from '../imperative-api';\nimport { shouldHandleMouseEvent } from '../link/useLinkToPathProps';\nimport { stripGroupSegmentsFromPath } from '../matchers';\nimport type { Href } from '../types';\nimport { useNavigatorContext } from '../views/Navigator';\n\ntype PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {\n children?: ReactNode | undefined;\n};\n\nexport type TabTriggerProps = PressablePropsWithoutFunctionChildren & {\n /**\n * Name of tab. When used within a `TabList` this sets the name of the tab.\n * Otherwise, this references the name.\n */\n name: string;\n /**\n * Name of tab. Required when used within a `TabList`.\n */\n href?: Href;\n /**\n * Forward props to child component. Useful for custom wrappers.\n */\n asChild?: boolean;\n /**\n * Resets the route when switching to a tab.\n */\n resetOnFocus?: boolean;\n};\n\nexport type TabTriggerOptions = {\n name: string;\n href: Href;\n};\n\nexport type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren &\n React.RefAttributes<View> & {\n isFocused?: boolean;\n href?: string;\n };\n\nconst TabTriggerSlot = Slot as React.ForwardRefExoticComponent<TabTriggerSlotProps>;\n\n/**\n * Creates a trigger to navigate to a tab. When used as child of `TabList`, its\n * functionality slightly changes since the `href` prop is required,\n * and the trigger also defines what routes are present in the `Tabs`.\n *\n * When used outside of `TabList`, this component no longer requires an `href`.\n *\n * @example\n * ```tsx\n * <Tabs>\n * <TabSlot />\n * <TabList>\n * <TabTrigger name=\"home\" href=\"/\" />\n * </TabList>\n * </Tabs>\n * ```\n */\nexport function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps) {\n const { trigger, triggerProps } = useTabTrigger({\n name,\n resetOnFocus,\n ...props,\n });\n\n // Pressable doesn't accept the extra props, so only pass them if we are using asChild\n if (asChild) {\n return (\n <TabTriggerSlot\n style={styles.tabTrigger}\n {...props}\n {...triggerProps}\n href={trigger?.resolvedHref}>\n {props.children}\n </TabTriggerSlot>\n );\n } else {\n // These props are not typed, but are allowed by React Native Web\n const reactNativeWebProps = { href: trigger?.resolvedHref };\n\n return (\n <Pressable style={styles.tabTrigger} {...reactNativeWebProps} {...props} {...triggerProps}>\n {props.children}\n </Pressable>\n );\n }\n}\n\n/**\n * @hidden\n */\nexport function isTabTrigger(\n child: ReactElement<any>\n): child is ReactElement<ComponentProps<typeof TabTrigger>> {\n return child.type === TabTrigger;\n}\n\n/**\n * Options for `switchTab` function.\n */\nexport type SwitchToOptions = {\n /**\n * Navigate and reset the history on route focus.\n */\n resetOnFocus?: boolean;\n};\n\nexport type Trigger = TriggerMap[string] & {\n isFocused: boolean;\n resolvedHref: string;\n route: TabNavigationState<any>['routes'][number];\n};\n\nexport type UseTabTriggerResult = {\n switchTab: (name: string, options: SwitchToOptions) => void;\n getTrigger: (name: string) => Trigger | undefined;\n trigger?: Trigger;\n triggerProps: TriggerProps;\n};\n\nexport type TriggerProps = {\n isFocused: boolean;\n onPress: PressableProps['onPress'];\n onLongPress: PressableProps['onLongPress'];\n};\n\n/**\n * Utility hook creating custom `TabTrigger`.\n */\nexport function useTabTrigger(options: TabTriggerProps): UseTabTriggerResult {\n const { state, navigation } = useNavigatorContext();\n const { name, resetOnFocus, onPress, onLongPress } = options;\n const triggerMap = use(TabTriggerMapContext);\n\n const getTrigger = useCallback(\n (name: string) => {\n const config = triggerMap[name];\n\n if (!config) {\n return;\n }\n\n return {\n isFocused: state.index === config.index,\n route: state.routes[config.index],\n resolvedHref: stripGroupSegmentsFromPath(appendBaseUrl(config.href)),\n ...config,\n };\n },\n [triggerMap]\n );\n\n const trigger = name !== undefined ? getTrigger(name) : undefined;\n\n const switchTab = useCallback(\n (name: string, options?: SwitchToOptions) => {\n const config = triggerMap[name];\n\n if (config) {\n if (config.type === 'external') {\n return router.navigate(config.href);\n } else {\n return navigation?.dispatch({\n ...config.action,\n type: 'JUMP_TO',\n payload: {\n ...config.action.payload,\n ...options,\n },\n });\n }\n } else {\n return navigation?.dispatch({\n type: 'JUMP_TO',\n payload: {\n name,\n },\n });\n }\n },\n [navigation, triggerMap]\n );\n\n const handleOnPress = useCallback<NonNullable<PressableProps['onPress']>>(\n (event) => {\n onPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n canPreventDefault: true,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n switchTab(name, { resetOnFocus });\n },\n [onPress, name, resetOnFocus, trigger]\n );\n\n const handleOnLongPress = useCallback<NonNullable<PressableProps['onLongPress']>>(\n (event) => {\n onLongPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabLongPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n switchTab(name, {\n resetOnFocus,\n });\n },\n [onLongPress, name, resetOnFocus, trigger]\n );\n\n const triggerProps = {\n isFocused: Boolean(trigger?.isFocused),\n onPress: handleOnPress,\n onLongPress: handleOnLongPress,\n };\n\n return {\n switchTab,\n getTrigger,\n trigger,\n triggerProps,\n };\n}\n\nconst styles = StyleSheet.create({\n tabTrigger: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"TabTrigger.js","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":";;AAoEA,gCA4BC;AAKD,oCAIC;AAkCD,sCA6GC;AAxPD,qDAA4C;AAE5C,iCAAkF;AAClF,+CAA2E;AAE3E,6CAAoD;AAEpD,+DAAyD;AACzD,sDAA2C;AAC3C,mEAAoE;AACpE,0CAAyD;AAEzD,kDAAyD;AAqCzD,MAAM,cAAc,GAAG,iBAA4D,CAAC;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,EAAmB;IACzF,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC;QAC9C,IAAI;QACJ,YAAY;QACZ,GAAG,KAAK;KACT,CAAC,CAAC;IAEH,sFAAsF;IACtF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,CAAC,cAAc,CACb,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CACzB,IAAI,KAAK,CAAC,CACV,IAAI,YAAY,CAAC,CACjB,IAAI,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,CAC5B;QAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;MAAA,EAAE,cAAc,CAAC,CAClB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,iEAAiE;QACjE,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;QAE5D,OAAO,CACL,CAAC,wBAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,IAAI,KAAK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AC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CACvC,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CAAC,KAAK,EAAE,EAAE;QACR,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,IAAI,KAAK,EAAE,kBAAkB,EAAE;YAAE,OAAO;QAExC,UAAU,EAAE,IAAI,CAAC;YACf,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACxE,CAAC,CAAC;QAEH,IAAI,CAAC,IAAA,2CAAsB,EAAC,KAAK,CAAC;YAAE,OAAO;QAE3C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACvB,SAAS,CAAC,IAAI,EAAE;gBACd,YAAY;aACb,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAC3C,CAAC;IAEF,MAAM,YAAY,GAAG;QACnB,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;QACtC,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IAEF,OAAO;QACL,SAAS;QACT,UAAU;QACV,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { TabNavigationState } from '@react-navigation/native';\nimport { ReactNode, use, ReactElement, ComponentProps, useCallback } from 'react';\nimport { View, StyleSheet, Pressable, PressableProps } from 'react-native';\n\nimport { TabTriggerMapContext } from './TabContext';\nimport type { TriggerMap } from './common';\nimport { appendBaseUrl } from '../fork/getPathFromState';\nimport { router } from '../imperative-api';\nimport { shouldHandleMouseEvent } from '../link/useLinkToPathProps';\nimport { stripGroupSegmentsFromPath } from '../matchers';\nimport type { Href } from '../types';\nimport { useNavigatorContext } from '../views/Navigator';\n\ntype PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {\n children?: ReactNode | undefined;\n};\n\nexport type TabTriggerProps = PressablePropsWithoutFunctionChildren & {\n /**\n * Name of tab. When used within a `TabList` this sets the name of the tab.\n * Otherwise, this references the name.\n */\n name: string;\n /**\n * Name of tab. Required when used within a `TabList`.\n */\n href?: Href;\n /**\n * Forward props to child component. Useful for custom wrappers.\n */\n asChild?: boolean;\n /**\n * Resets the route when switching to a tab.\n */\n resetOnFocus?: boolean;\n};\n\nexport type TabTriggerOptions = {\n name: string;\n href: Href;\n};\n\nexport type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren &\n React.RefAttributes<View> & {\n isFocused?: boolean;\n href?: string;\n };\n\nconst TabTriggerSlot = Slot as React.ForwardRefExoticComponent<TabTriggerSlotProps>;\n\n/**\n * Creates a trigger to navigate to a tab. When used as child of `TabList`, its\n * functionality slightly changes since the `href` prop is required,\n * and the trigger also defines what routes are present in the `Tabs`.\n *\n * When used outside of `TabList`, this component no longer requires an `href`.\n *\n * @example\n * ```tsx\n * <Tabs>\n * <TabSlot />\n * <TabList>\n * <TabTrigger name=\"home\" href=\"/\" />\n * </TabList>\n * </Tabs>\n * ```\n */\nexport function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps) {\n const { trigger, triggerProps } = useTabTrigger({\n name,\n resetOnFocus,\n ...props,\n });\n\n // Pressable doesn't accept the extra props, so only pass them if we are using asChild\n if (asChild) {\n return (\n <TabTriggerSlot\n style={styles.tabTrigger}\n {...props}\n {...triggerProps}\n href={trigger?.resolvedHref}>\n {props.children}\n </TabTriggerSlot>\n );\n } else {\n // These props are not typed, but are allowed by React Native Web\n const reactNativeWebProps = { href: trigger?.resolvedHref };\n\n return (\n <Pressable style={styles.tabTrigger} {...reactNativeWebProps} {...props} {...triggerProps}>\n {props.children}\n </Pressable>\n );\n }\n}\n\n/**\n * @hidden\n */\nexport function isTabTrigger(\n child: ReactElement<any>\n): child is ReactElement<ComponentProps<typeof TabTrigger>> {\n return child.type === TabTrigger;\n}\n\n/**\n * Options for `switchTab` function.\n */\nexport type SwitchToOptions = {\n /**\n * Navigate and reset the history on route focus.\n */\n resetOnFocus?: boolean;\n};\n\nexport type Trigger = TriggerMap[string] & {\n isFocused: boolean;\n resolvedHref: string;\n route: TabNavigationState<any>['routes'][number];\n};\n\nexport type UseTabTriggerResult = {\n switchTab: (name: string, options: SwitchToOptions) => void;\n getTrigger: (name: string) => Trigger | undefined;\n trigger?: Trigger;\n triggerProps: TriggerProps;\n};\n\nexport type TriggerProps = {\n isFocused: boolean;\n onPress: PressableProps['onPress'];\n onLongPress: PressableProps['onLongPress'];\n};\n\n/**\n * Utility hook creating custom `TabTrigger`.\n */\nexport function useTabTrigger(options: TabTriggerProps): UseTabTriggerResult {\n const { state, navigation } = useNavigatorContext();\n const { name, resetOnFocus, onPress, onLongPress } = options;\n const triggerMap = use(TabTriggerMapContext);\n\n const getTrigger = useCallback(\n (name: string) => {\n const config = triggerMap[name];\n\n if (!config) {\n return;\n }\n\n return {\n isFocused: state.index === config.index,\n route: state.routes[config.index],\n resolvedHref: stripGroupSegmentsFromPath(appendBaseUrl(config.href)),\n ...config,\n };\n },\n [triggerMap]\n );\n\n const trigger = name !== undefined ? getTrigger(name) : undefined;\n\n const switchTab = useCallback(\n (name: string, options?: SwitchToOptions) => {\n const config = triggerMap[name];\n\n if (config) {\n if (config.type === 'external') {\n return router.navigate(config.href);\n } else {\n return navigation?.dispatch({\n ...config.action,\n type: 'JUMP_TO',\n payload: {\n ...config.action.payload,\n ...options,\n },\n });\n }\n } else {\n return navigation?.dispatch({\n type: 'JUMP_TO',\n payload: {\n name,\n },\n });\n }\n },\n [navigation, triggerMap]\n );\n\n const handleOnPress = useCallback<NonNullable<PressableProps['onPress']>>(\n (event) => {\n onPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n canPreventDefault: true,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n if (!trigger.isFocused) {\n switchTab(name, { resetOnFocus });\n }\n },\n [onPress, name, resetOnFocus, trigger]\n );\n\n const handleOnLongPress = useCallback<NonNullable<PressableProps['onLongPress']>>(\n (event) => {\n onLongPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabLongPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n if (!trigger.isFocused) {\n switchTab(name, {\n resetOnFocus,\n });\n }\n },\n [onLongPress, name, resetOnFocus, trigger]\n );\n\n const triggerProps = {\n isFocused: Boolean(trigger?.isFocused),\n onPress: handleOnPress,\n onLongPress: handleOnLongPress,\n };\n\n return {\n switchTab,\n getTrigger,\n trigger,\n triggerProps,\n };\n}\n\nconst styles = StyleSheet.create({\n tabTrigger: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -38,15 +38,6 @@ class RouterToolbarHostView: RouterViewWithLogger, LinkPreviewMenuUpdatable {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
func updateToolbarItem(withId id: String) {
|
|
42
|
-
if let controller = self.findViewController() {
|
|
43
|
-
let index = toolbarItemsArray.firstIndex(of: id)
|
|
44
|
-
if let index = index, let item = toolbarItemsMap[id] {
|
|
45
|
-
controller.toolbarItems?[index] = item.barButtonItem
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
41
|
func updateToolbarItems() {
|
|
51
42
|
// If update already scheduled, skip - the pending async block will handle it
|
|
52
43
|
if hasPendingToolbarUpdate {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.router",
|
|
5
5
|
"module": "expo.modules.router",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "55.0.0-beta.0",
|
|
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-
|
|
28
|
-
"url": "expo.modules.router-
|
|
27
|
+
"name": "expo.modules.router-55.0.0-beta.0.aar",
|
|
28
|
+
"url": "expo.modules.router-55.0.0-beta.0.aar",
|
|
29
29
|
"size": 13665,
|
|
30
30
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
31
31
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
],
|
|
61
61
|
"files": [
|
|
62
62
|
{
|
|
63
|
-
"name": "expo.modules.router-
|
|
64
|
-
"url": "expo.modules.router-
|
|
63
|
+
"name": "expo.modules.router-55.0.0-beta.0.aar",
|
|
64
|
+
"url": "expo.modules.router-55.0.0-beta.0.aar",
|
|
65
65
|
"size": 13665,
|
|
66
66
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
67
67
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
},
|
|
81
81
|
"files": [
|
|
82
82
|
{
|
|
83
|
-
"name": "expo.modules.router-
|
|
84
|
-
"url": "expo.modules.router-
|
|
83
|
+
"name": "expo.modules.router-55.0.0-beta.0-sources.jar",
|
|
84
|
+
"url": "expo.modules.router-55.0.0-beta.0-sources.jar",
|
|
85
85
|
"size": 2318,
|
|
86
86
|
"sha512": "9864add8e93e3c0a9a9c930aaed67016b15054c3fafd59a0bd3a5402d7cdc5827be84c22c2c137f3e5acb4e39270d9bfb9ca3fe11234458d4f2e0d4c78747f48",
|
|
87
87
|
"sha256": "d5dff6259e86de721fc0f07fe740a5e18088e19b76738719b0a6f94caef06224",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
283d675d18eb486c2dc289f4507eaf17
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b3d43d6be88d079b3a3435c58864c8b6ba7da700
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
225a404b691bfd25f25b914bd3f377b20b62091f90f47bcf15677270f5d24831
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
638f5684f3432f660f28fdf0e6d774a57a7b613bde8344d9736fb87ee47f749a686fab4c7473607e1bdcf4d9e5363384cc847f3e2c674102fbcb5f7f84b64059
|
|
@@ -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>
|
|
12
|
+
<version>55.0.0-beta.0</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
|
+
5985edc1f98a578cb1350a1f75e1723f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bdc35eb573c02176537c8319feb25dc4b6e6ee96
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fdc038ffb9d5cbfea2729ce23b1b675d20a809bf5eea897d8109558ed10c5ae4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e9cc19d9d5e21eb56394741b95a11caf33c75505bcb37c4368ce320d19f8be143a1017d762350f1f4ec5355909aeaf7559215903220937d2d6ce9727b095c07a
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.router</groupId>
|
|
4
4
|
<artifactId>expo.modules.router</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>
|
|
7
|
-
<release>
|
|
6
|
+
<latest>55.0.0-beta.0</latest>
|
|
7
|
+
<release>55.0.0-beta.0</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>
|
|
9
|
+
<version>55.0.0-beta.0</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260121212118</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c284bbd135c616d80d59daa8cff19264
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4c22305fa4acdb274be56095fced071694fbdaa9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4c2098570e049e8d7d57defcb86174f067b539eafa05dc0759b9d2cc4ca9906d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
84fe9d28bc24f78f353b16b44d6474c0d32b927dffb7d3bd68b39839b91230681b288580833287d337571b781470985f353bd7bf6151a9593a9a8cee7230135f
|