expo-router 56.2.5 → 56.2.6
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/layouts/Tabs.d.ts +1 -0
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/layouts/Tabs.js +15 -0
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/TabsClient.d.ts +12 -12
- package/build/layouts/TopTabs.d.ts +1 -0
- package/build/layouts/TopTabs.d.ts.map +1 -1
- package/build/layouts/TopTabs.js +15 -0
- package/build/layouts/TopTabs.js.map +1 -1
- package/build/layouts/TopTabsClient.d.ts +4 -4
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.js +4 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.js.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js +5 -1
- package/build/native-tabs/NativeBottomTabsNavigator.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/NativeTabsView.android.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.android.js +11 -15
- package/build/native-tabs/NativeTabsView.android.js.map +1 -1
- package/build/native-tabs/NativeTabsView.ios.js +1 -1
- package/build/native-tabs/NativeTabsView.ios.js.map +1 -1
- package/build/native-tabs/appearance.android.d.ts +2 -2
- package/build/native-tabs/appearance.android.d.ts.map +1 -1
- package/build/native-tabs/appearance.android.js +5 -4
- package/build/native-tabs/appearance.android.js.map +1 -1
- package/build/native-tabs/appearance.d.ts +1 -2
- package/build/native-tabs/appearance.d.ts.map +1 -1
- package/build/native-tabs/appearance.js +1 -1
- package/build/native-tabs/appearance.js.map +1 -1
- package/build/native-tabs/types.d.ts +152 -1
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.module → 56.2.6/expo.modules.router-56.2.6.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.pom → 56.2.6/expo.modules.router-56.2.6.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.6/expo.modules.router-56.2.6.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 +10 -10
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/build/native-tabs/appearance.types.d.ts +0 -27
- package/build/native-tabs/appearance.types.d.ts.map +0 -1
- package/build/native-tabs/appearance.types.js +0 -3
- package/build/native-tabs/appearance.types.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.5/expo.modules.router-56.2.5.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5-sources.jar → 56.2.6/expo.modules.router-56.2.6-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5-sources.jar.md5 → 56.2.6/expo.modules.router-56.2.6-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5-sources.jar.sha1 → 56.2.6/expo.modules.router-56.2.6-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5-sources.jar.sha256 → 56.2.6/expo.modules.router-56.2.6-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5-sources.jar.sha512 → 56.2.6/expo.modules.router-56.2.6-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.aar → 56.2.6/expo.modules.router-56.2.6.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.aar.md5 → 56.2.6/expo.modules.router-56.2.6.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.aar.sha1 → 56.2.6/expo.modules.router-56.2.6.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.aar.sha256 → 56.2.6/expo.modules.router-56.2.6.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.5/expo.modules.router-56.2.5.aar.sha512 → 56.2.6/expo.modules.router-56.2.6.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 = '56.2.
|
|
7
|
+
version = '56.2.6'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "56.2.
|
|
13
|
+
versionName "56.2.6"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
package/build/layouts/Tabs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAGhC,cAAc,iCAAiC,CAAC;AAIhD,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,eAAe,IAAI,CAAC"}
|
package/build/layouts/Tabs.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -7,6 +21,7 @@ exports.Tabs = void 0;
|
|
|
7
21
|
const TabsClient_1 = __importDefault(require("./TabsClient"));
|
|
8
22
|
exports.Tabs = TabsClient_1.default;
|
|
9
23
|
const Screen_1 = require("../views/Screen");
|
|
24
|
+
__exportStar(require("../react-navigation/bottom-tabs"), exports);
|
|
10
25
|
TabsClient_1.default.Screen = Screen_1.Screen;
|
|
11
26
|
exports.default = TabsClient_1.default;
|
|
12
27
|
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAgC;AAOvB,eAPF,oBAAI,CAOE;AANb,4CAAyC;AAEzC,kEAAgD;AAEhD,oBAAI,CAAC,MAAM,GAAG,eAAM,CAAC;AAIrB,kBAAe,oBAAI,CAAC","sourcesContent":["import Tabs from './TabsClient';\nimport { Screen } from '../views/Screen';\n\nexport * from '../react-navigation/bottom-tabs';\n\nTabs.Screen = Screen;\n\nexport { Tabs };\n\nexport default Tabs;\n"]}
|
|
@@ -3,7 +3,7 @@ import type { BottomTabNavigationEventMap, BottomTabNavigationOptions } from '..
|
|
|
3
3
|
import type { ParamListBase, TabNavigationState } from '../react-navigation/native';
|
|
4
4
|
import type { Href } from '../types';
|
|
5
5
|
import { Protected } from '../views/Protected';
|
|
6
|
-
declare const BottomTabNavigator: import("react").ComponentType<Omit<import("
|
|
6
|
+
declare const BottomTabNavigator: import("react").ComponentType<Omit<import("./Tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior" | "id"> & import("../react-navigation").DefaultRouterOptions<string> & ({
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
layout?: ((props: {
|
|
9
9
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -22,7 +22,7 @@ declare const BottomTabNavigator: import("react").ComponentType<Omit<import("../
|
|
|
22
22
|
beforeRemove: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
23
23
|
}> | ((props: {
|
|
24
24
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
25
|
-
navigation: import("
|
|
25
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
26
26
|
}) => Partial<{
|
|
27
27
|
tabPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
28
28
|
tabLongPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
@@ -35,10 +35,10 @@ declare const BottomTabNavigator: import("react").ComponentType<Omit<import("../
|
|
|
35
35
|
}>) | undefined;
|
|
36
36
|
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
37
37
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
38
|
-
navigation: import("
|
|
38
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
39
39
|
theme: ReactNavigation.Theme;
|
|
40
40
|
}) => BottomTabNavigationOptions) | undefined;
|
|
41
|
-
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("
|
|
41
|
+
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
|
|
42
42
|
UNSTABLE_router?: (<Action extends Readonly<{
|
|
43
43
|
type: string;
|
|
44
44
|
payload?: object;
|
|
@@ -55,7 +55,7 @@ export type BottomTabNavigator = typeof BottomTabNavigator;
|
|
|
55
55
|
type TabsProps = BottomTabNavigationOptions & {
|
|
56
56
|
href?: Href | null;
|
|
57
57
|
};
|
|
58
|
-
declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<import("
|
|
58
|
+
declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<import("./Tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior" | "id"> & import("../react-navigation").DefaultRouterOptions<string> & ({
|
|
59
59
|
children: React.ReactNode;
|
|
60
60
|
layout?: ((props: {
|
|
61
61
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -74,7 +74,7 @@ declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
74
74
|
beforeRemove: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
75
75
|
}> | ((props: {
|
|
76
76
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
77
|
-
navigation: import("
|
|
77
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
78
78
|
}) => Partial<{
|
|
79
79
|
tabPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
80
80
|
tabLongPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
@@ -87,10 +87,10 @@ declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
87
87
|
}>) | undefined;
|
|
88
88
|
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
89
89
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
90
|
-
navigation: import("
|
|
90
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
91
91
|
theme: ReactNavigation.Theme;
|
|
92
92
|
}) => BottomTabNavigationOptions) | undefined;
|
|
93
|
-
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("
|
|
93
|
+
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
|
|
94
94
|
UNSTABLE_router?: (<Action extends Readonly<{
|
|
95
95
|
type: string;
|
|
96
96
|
payload?: object;
|
|
@@ -102,7 +102,7 @@ declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
102
102
|
id?: undefined;
|
|
103
103
|
} | {
|
|
104
104
|
id: string;
|
|
105
|
-
})), "children"> & Partial<Pick<Omit<import("
|
|
105
|
+
})), "children"> & Partial<Pick<Omit<import("./Tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior" | "id"> & import("../react-navigation").DefaultRouterOptions<string> & ({
|
|
106
106
|
children: React.ReactNode;
|
|
107
107
|
layout?: ((props: {
|
|
108
108
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -121,7 +121,7 @@ declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
121
121
|
beforeRemove: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
122
122
|
}> | ((props: {
|
|
123
123
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
124
|
-
navigation: import("
|
|
124
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
125
125
|
}) => Partial<{
|
|
126
126
|
tabPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
127
127
|
tabLongPress: import("../react-navigation").EventListenerCallback<BottomTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
@@ -134,10 +134,10 @@ declare const ExpoTabs: import("react").ForwardRefExoticComponent<Omit<Omit<impo
|
|
|
134
134
|
}>) | undefined;
|
|
135
135
|
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
136
136
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
137
|
-
navigation: import("
|
|
137
|
+
navigation: import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
138
138
|
theme: ReactNavigation.Theme;
|
|
139
139
|
}) => BottomTabNavigationOptions) | undefined;
|
|
140
|
-
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("
|
|
140
|
+
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("./Tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
|
|
141
141
|
UNSTABLE_router?: (<Action extends Readonly<{
|
|
142
142
|
type: string;
|
|
143
143
|
payload?: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopTabs.d.ts","sourceRoot":"","sources":["../../src/layouts/TopTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAKtC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,eAAe,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"TopTabs.d.ts","sourceRoot":"","sources":["../../src/layouts/TopTabs.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAKtC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,cAAc,uCAAuC,CAAC;AAEtD,eAAe,OAAO,CAAC"}
|
package/build/layouts/TopTabs.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -8,5 +22,6 @@ const TopTabsClient_1 = __importDefault(require("./TopTabsClient"));
|
|
|
8
22
|
exports.TopTabs = TopTabsClient_1.default;
|
|
9
23
|
const Screen_1 = require("../views/Screen");
|
|
10
24
|
TopTabsClient_1.default.Screen = Screen_1.Screen;
|
|
25
|
+
__exportStar(require("../react-navigation/material-top-tabs"), exports);
|
|
11
26
|
exports.default = TopTabsClient_1.default;
|
|
12
27
|
//# sourceMappingURL=TopTabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopTabs.js","sourceRoot":"","sources":["../../src/layouts/TopTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopTabs.js","sourceRoot":"","sources":["../../src/layouts/TopTabs.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oEAAsC;AAK7B,kBALF,uBAAO,CAKE;AAJhB,4CAAyC;AAEzC,uBAAO,CAAC,MAAM,GAAG,eAAM,CAAC;AAIxB,wEAAsD;AAEtD,kBAAe,uBAAO,CAAC","sourcesContent":["import TopTabs from './TopTabsClient';\nimport { Screen } from '../views/Screen';\n\nTopTabs.Screen = Screen;\n\nexport { TopTabs };\n\nexport * from '../react-navigation/material-top-tabs';\n\nexport default TopTabs;\n"]}
|
|
@@ -3,7 +3,7 @@ import type { MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions
|
|
|
3
3
|
import type { ParamListBase, TabNavigationState } from '../react-navigation/native';
|
|
4
4
|
import { Protected } from '../views/Protected';
|
|
5
5
|
import { Screen } from '../views/Screen';
|
|
6
|
-
declare const MaterialTopTabs: import("react").ForwardRefExoticComponent<Omit<import("..").PickPartial<Omit<import("
|
|
6
|
+
declare const MaterialTopTabs: import("react").ForwardRefExoticComponent<Omit<import("..").PickPartial<Omit<import("./TopTabs").MaterialTopTabNavigatorProps, "children" | "initialRouteName" | "layout" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior" | "id"> & import("../react-navigation").DefaultRouterOptions<string> & ({
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
layout?: ((props: {
|
|
9
9
|
state: TabNavigationState<ParamListBase>;
|
|
@@ -22,7 +22,7 @@ declare const MaterialTopTabs: import("react").ForwardRefExoticComponent<Omit<im
|
|
|
22
22
|
beforeRemove: import("../react-navigation").EventListenerCallback<MaterialTopTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
23
23
|
}> | ((props: {
|
|
24
24
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
25
|
-
navigation: import("
|
|
25
|
+
navigation: import("./TopTabs").MaterialTopTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
26
26
|
}) => Partial<{
|
|
27
27
|
tabPress: import("../react-navigation").EventListenerCallback<MaterialTopTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
28
28
|
tabLongPress: import("../react-navigation").EventListenerCallback<MaterialTopTabNavigationEventMap & import("../react-navigation").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
@@ -35,10 +35,10 @@ declare const MaterialTopTabs: import("react").ForwardRefExoticComponent<Omit<im
|
|
|
35
35
|
}>) | undefined;
|
|
36
36
|
screenOptions?: MaterialTopTabNavigationOptions | ((props: {
|
|
37
37
|
route: import("../react-navigation").RouteProp<ParamListBase, string>;
|
|
38
|
-
navigation: import("
|
|
38
|
+
navigation: import("./TopTabs").MaterialTopTabNavigationProp<ParamListBase, string, string | undefined>;
|
|
39
39
|
theme: ReactNavigation.Theme;
|
|
40
40
|
}) => MaterialTopTabNavigationOptions) | undefined;
|
|
41
|
-
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, MaterialTopTabNavigationOptions, import("
|
|
41
|
+
screenLayout?: ((props: import("../react-navigation").ScreenLayoutArgs<ParamListBase, string, MaterialTopTabNavigationOptions, import("./TopTabs").MaterialTopTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
|
|
42
42
|
UNSTABLE_router?: (<Action extends Readonly<{
|
|
43
43
|
type: string;
|
|
44
44
|
payload?: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA+BlE,CAAC"}
|
|
@@ -13,6 +13,9 @@ const native_1 = require("../../../../toolbar/native");
|
|
|
13
13
|
const NativeToolbarButton = (props) => {
|
|
14
14
|
const id = (0, react_1.useId)();
|
|
15
15
|
const renderingMode = props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');
|
|
16
|
+
if (process.env.NODE_ENV !== 'production' && props.source) {
|
|
17
|
+
console.warn('Stack.Toolbar.Button in placement="bottom" on iOS does not support image icons via the `icon` prop or <Stack.Toolbar.Icon src={...} />; the image will not render. Use the `icon` prop with a string SF Symbol name (e.g. "star.fill"), the `image` prop for a custom image, or <Stack.Toolbar.Icon xcasset="..." /> for an Xcode asset catalog image.');
|
|
18
|
+
}
|
|
16
19
|
return ((0, jsx_runtime_1.jsx)(native_1.RouterToolbarItem, { accessibilityHint: props.accessibilityHint, accessibilityLabel: props.accessibilityLabel, barButtonItemStyle: props.variant === 'done' ? 'prominent' : props.variant, disabled: props.disabled, hidden: props.hidden, hidesSharedBackground: props.hidesSharedBackground, identifier: id, image: props.image, imageRenderingMode: renderingMode, onSelected: props.onPress, possibleTitles: props.possibleTitles, selected: props.selected, sharesBackground: !props.separateBackground, systemImageName: props.icon, xcassetName: props.xcassetName, title: props.label, tintColor: props.tintColor, titleStyle: react_native_1.StyleSheet.flatten(props.style) }));
|
|
17
20
|
};
|
|
18
21
|
exports.NativeToolbarButton = NativeToolbarButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,uDAA+D;AAE/D;;;GAGG;AACI,MAAM,mBAAmB,GAAuC,CAAC,KAAK,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,IAAA,aAAK,GAAE,CAAC;IACnB,MAAM,aAAa,GACjB,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACxF,OAAO,CACL,uBAAC,0BAAiB,IAChB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,kBAAkB,EAAE,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAC1E,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,UAAU,EAAE,EAAE,EACd,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,kBAAkB,EAAE,aAAa,EACjC,UAAU,EAAE,KAAK,CAAC,OAAO,EACzB,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,gBAAgB,EAAE,CAAC,KAAK,CAAC,kBAAkB,EAC3C,eAAe,EAAE,KAAK,CAAC,IAAI,EAC3B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,UAAU,EAAE,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAC3C,CACH,CAAC;AACJ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,uDAA+D;AAE/D;;;GAGG;AACI,MAAM,mBAAmB,GAAuC,CAAC,KAAK,EAAE,EAAE;IA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\nimport { useId } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { NativeToolbarButtonProps } from './types';\nimport { RouterToolbarItem } from '../../../../toolbar/native';\n\n/**\n * Native toolbar button component for bottom toolbar.\n * Renders as RouterToolbarItem.\n */\nexport const NativeToolbarButton: React.FC<NativeToolbarButtonProps> = (props) => {\n const id = useId();\n const renderingMode =\n props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');\n if (process.env.NODE_ENV !== 'production' && props.source) {\n console.warn(\n 'Stack.Toolbar.Button in placement=\"bottom\" on iOS does not support image icons via the `icon` prop or <Stack.Toolbar.Icon src={...} />; the image will not render. Use the `icon` prop with a string SF Symbol name (e.g. \"star.fill\"), the `image` prop for a custom image, or <Stack.Toolbar.Icon xcasset=\"...\" /> for an Xcode asset catalog image.'\n );\n }\n return (\n <RouterToolbarItem\n accessibilityHint={props.accessibilityHint}\n accessibilityLabel={props.accessibilityLabel}\n barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant}\n disabled={props.disabled}\n hidden={props.hidden}\n hidesSharedBackground={props.hidesSharedBackground}\n identifier={id}\n image={props.image}\n imageRenderingMode={renderingMode}\n onSelected={props.onPress}\n possibleTitles={props.possibleTitles}\n selected={props.selected}\n sharesBackground={!props.separateBackground}\n systemImageName={props.icon}\n xcassetName={props.xcassetName}\n title={props.label}\n tintColor={props.tintColor}\n titleStyle={StyleSheet.flatten(props.style)}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA2D9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,uBAAiB,CAAC"}
|
|
@@ -11,10 +11,13 @@ const native_1 = require("../../../../link/preview/native");
|
|
|
11
11
|
* Native toolbar menu component for bottom toolbar.
|
|
12
12
|
* Renders as NativeLinkPreviewAction.
|
|
13
13
|
*/
|
|
14
|
-
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, label, destructive, children, icon, xcassetName, image, imageRenderingMode, tintColor, variant, style, elementSize, }) => {
|
|
14
|
+
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, label, destructive, children, icon, source, xcassetName, image, imageRenderingMode, tintColor, variant, style, elementSize, }) => {
|
|
15
15
|
const identifier = (0, react_1.useId)();
|
|
16
16
|
const titleStyle = react_native_1.StyleSheet.flatten(style);
|
|
17
17
|
const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');
|
|
18
|
+
if (process.env.NODE_ENV !== 'production' && source) {
|
|
19
|
+
console.warn('Stack.Toolbar.Menu in placement="bottom" on iOS does not support image icons via the `icon` prop or <Stack.Toolbar.Icon src={...} />; the image will not render. Use the `icon` prop with a string SF Symbol name (e.g. "star.fill"), the `image` prop for a custom image, or <Stack.Toolbar.Icon xcasset="..." /> for an Xcode asset catalog image.');
|
|
20
|
+
}
|
|
18
21
|
return ((0, jsx_runtime_1.jsx)(native_1.NativeLinkPreviewAction, { sharesBackground: !separateBackground, hidesSharedBackground: hidesSharedBackground, hidden: hidden, icon: icon, xcassetName: xcassetName,
|
|
19
22
|
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
20
23
|
image: image, imageRenderingMode: renderingMode, destructive: destructive, subtitle: subtitle, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, displayAsPalette: palette, displayInline: inline, preferredElementSize: elementSize, tintColor: tintColor, titleStyle: titleStyle, barButtonItemStyle: variant === 'done' ? 'prominent' : variant, title: title ?? '', label: label, onSelected: () => { }, children: children, identifier: identifier }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,wDAA2D;AAC3D,4DAA0E;AAE1E;;;GAGG;AACI,MAAM,iBAAiB,GAAqC,CAAC,EAClE,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,KAAK,EACL,kBAAkB,EAClB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAE3B,MAAM,UAAU,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,kBAAkB,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAChG,OAAO,CACL,uBAAC,gCAAuB,IACtB,gBAAgB,EAAE,CAAC,kBAAkB,EACrC,qBAAqB,EAAE,qBAAqB,EAC5C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW;QACxB,sEAAsE;QACtE,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,aAAa,EACjC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,OAAO,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,WAAW,EACjC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAC9D,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,wDAA2D;AAC3D,4DAA0E;AAE1E;;;GAGG;AACI,MAAM,iBAAiB,GAAqC,CAAC,EAClE,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,WAAW,EACX,KAAK,EACL,kBAAkB,EAClB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAE3B,MAAM,UAAU,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,kBAAkB,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAChG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,MAAM,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CACV,sVAAsV,CACvV,CAAC;IACJ,CAAC;IACD,OAAO,CACL,uBAAC,gCAAuB,IACtB,gBAAgB,EAAE,CAAC,kBAAkB,EACrC,qBAAqB,EAAE,qBAAqB,EAC5C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW;QACxB,sEAAsE;QACtE,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,aAAa,EACjC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,OAAO,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,WAAW,EACjC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAC9D,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,iBAAiB,qBA2D5B;AAEF;;GAEG;AACU,QAAA,uBAAuB,GAAG,yBAAc,CAAC","sourcesContent":["'use client';\nimport { useId } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { NativeToolbarMenuProps } from './types';\nimport { LinkMenuAction } from '../../../../link/elements';\nimport { NativeLinkPreviewAction } from '../../../../link/preview/native';\n\n/**\n * Native toolbar menu component for bottom toolbar.\n * Renders as NativeLinkPreviewAction.\n */\nexport const NativeToolbarMenu: React.FC<NativeToolbarMenuProps> = ({\n accessibilityHint,\n accessibilityLabel,\n separateBackground,\n hidesSharedBackground,\n palette,\n inline,\n hidden,\n subtitle,\n title,\n label,\n destructive,\n children,\n icon,\n source,\n xcassetName,\n image,\n imageRenderingMode,\n tintColor,\n variant,\n style,\n elementSize,\n}) => {\n const identifier = useId();\n\n const titleStyle = StyleSheet.flatten(style);\n const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');\n if (process.env.NODE_ENV !== 'production' && source) {\n console.warn(\n 'Stack.Toolbar.Menu in placement=\"bottom\" on iOS does not support image icons via the `icon` prop or <Stack.Toolbar.Icon src={...} />; the image will not render. Use the `icon` prop with a string SF Symbol name (e.g. \"star.fill\"), the `image` prop for a custom image, or <Stack.Toolbar.Icon xcasset=\"...\" /> for an Xcode asset catalog image.'\n );\n }\n return (\n <NativeLinkPreviewAction\n sharesBackground={!separateBackground}\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n icon={icon}\n xcassetName={xcassetName}\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n image={image}\n imageRenderingMode={renderingMode}\n destructive={destructive}\n subtitle={subtitle}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n displayAsPalette={palette}\n displayInline={inline}\n preferredElementSize={elementSize}\n tintColor={tintColor}\n titleStyle={titleStyle}\n barButtonItemStyle={variant === 'done' ? 'prominent' : variant}\n title={title ?? ''}\n label={label}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\n/**\n * Native toolbar menu action - reuses LinkMenuAction.\n */\nexport const NativeToolbarMenuAction = LinkMenuAction;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InternalNativeTabsProps, NativeTabsProps } from './types';
|
|
3
3
|
export declare const NativeTabsContext: React.Context<boolean>;
|
|
4
|
-
export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, screenListeners, ...rest }: InternalNativeTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, rippleColor, disableIndicator, labelVisibilityMode, screenListeners, ...rest }: InternalNativeTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function NativeTabsNavigatorWrapper(props: NativeTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=NativeBottomTabsNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAKjE,OAAO,KAAK,EACV,uBAAuB,EAGvB,eAAe,EAGhB,MAAM,SAAS,CAAC;AAcjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,WAAW,EACX,eAAe,EACf,GAAG,IAAI,EACR,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAKjE,OAAO,KAAK,EACV,uBAAuB,EAGvB,eAAe,EAGhB,MAAM,SAAS,CAAC;AAcjB,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,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,GAAG,IAAI,EACR,EAAE,uBAAuB,2CAgIzB;AAWD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe,2CAiBhE"}
|
|
@@ -51,7 +51,7 @@ const children_1 = require("../utils/children");
|
|
|
51
51
|
// In Jetpack Compose, the default back behavior is to go back to the initial route.
|
|
52
52
|
const defaultBackBehavior = 'initialRoute';
|
|
53
53
|
exports.NativeTabsContext = react_2.default.createContext(false);
|
|
54
|
-
function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, screenListeners, ...rest }) {
|
|
54
|
+
function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, shadowColor, rippleColor, disableIndicator, labelVisibilityMode, screenListeners, ...rest }) {
|
|
55
55
|
if ((0, react_2.use)(exports.NativeTabsContext)) {
|
|
56
56
|
throw new Error('Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.');
|
|
57
57
|
}
|
|
@@ -81,6 +81,10 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
|
|
|
81
81
|
indicatorColor,
|
|
82
82
|
badgeTextColor,
|
|
83
83
|
shadowColor,
|
|
84
|
+
rippleColor,
|
|
85
|
+
disableIndicator,
|
|
86
|
+
labelVisibilityMode,
|
|
87
|
+
tintColor: rest.tintColor,
|
|
84
88
|
},
|
|
85
89
|
});
|
|
86
90
|
const { routes } = state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Bb,kDAyIC;AAWD,gEAiBC;;;AAjMD,+CAAiE;AAEjE,qEAAkE;AAClE,yDAAsD;AACtD,qDAAkD;AASlD,mCAAsF;AACtF,oEAAiE;AACjE,6CAAmD;AAMnD,uDAA0F;AAC1F,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,eAAe,EACf,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,kBAAkB,GAAG,IAAA,oCAA4B,EAAC,SAAS,CAAC,CAAC;IAEnE,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,QAAQ;QACrD,CAAC,CAAC;YACE,GAAG,mBAAmB,CAAC,QAAQ;YAC/B,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS;SAC5D;QACH,CAAC,CAAC,IAAI,CAAC,SAAS;YACd,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE;YAC3B,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,EAAE,KAAK,EAAE,W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BACjB;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CACrC,CAAC;IAEF,OAAO,CACL,uBAAC,iBAAiB,cAChB,uBAAC,yBAAiB,IAAC,KAAK,kBACtB,2BAAC,+BAAc,OACT,IAAI,EACR,GAAG,EAAE,eAAe,EACpB,YAAY,EAAE,YAAY;gBAC1B,2DAA2D;gBAC3D,4DAA4D;gBAC5D,cAAc;gBACd,UAAU,EAAE,aAAa,CAAC,OAAO,EACjC,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,WAAW,GACxB,GACgB,GACF,CACrB,CAAC;AACJ,CAAC;AAED,MAAM,wBAAwB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AAE7E,MAAM,8BAA8B,GAAG,IAAA,qCAAiB,EAKtD,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAEzD,SAAgB,0BAA0B,CAAC,KAAsB;IAC/D,MAAM,eAAe,GAAG,IAAA,eAAO,EAC7B,GAAG,EAAE,CAAC,IAAA,+BAAoB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC5D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAA,eAAO,EAChC,GAAG,EAAE,CAAC,IAAA,kCAAuB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC/D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,uBAAC,8BAA8B,OACzB,KAAK,EACT,QAAQ,EAAE,eAAe,EACzB,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { use, useCallback, useMemo, useRef } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n InternalNativeTabsProps,\n NativeTabNavigationEventMap,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n OnTabChangeEventPayload,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\nimport type {\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n} from '../react-navigation/native';\nimport { createNavigatorFactory, useNavigationBuilder } from '../react-navigation/native';\nimport { getAllChildrenNotOfType, getAllChildrenOfType } from '../utils/children';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n screenListeners,\n ...rest\n}: InternalNativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NativeTabOptions,\n NativeTabNavigationEventMap\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenListeners,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key]!.options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key]!.options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key]!.render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index]!.key),\n [visibleTabs, routes, state.index]\n );\n const visibleTabsKeys = useMemo(\n () => visibleTabs.map((tab) => tab.routeKey).join(';'),\n [visibleTabs]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n const provenanceRef = useRef(0);\n\n const onTabChange = useCallback(\n ({ selectedKey, provenance, isNativeAction }: OnTabChangeEventPayload) => {\n // We should always send the last provenance we got from native side\n provenanceRef.current = provenance;\n\n if (isNativeAction) {\n const { route } = descriptors[selectedKey]!;\n navigation.emit({\n type: 'tabPress',\n target: selectedKey,\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 },\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 // Provenance should only be sent with updates, and updates\n // on JS side are only triggered by rerender, so passing ref\n // here is ok.\n provenance={provenanceRef.current}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nconst NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n TabNavigationState<ParamListBase>,\n NativeTabNavigationEventMap\n>(createNativeTabNavigator().Navigator, undefined, true);\n\nexport function NativeTabsNavigatorWrapper(props: NativeTabsProps) {\n const triggerChildren = useMemo(\n () => getAllChildrenOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n const nonTriggerChildren = useMemo(\n () => getAllChildrenNotOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n\n return (\n <NativeTabsNavigatorWithContext\n {...props}\n children={triggerChildren}\n nonTriggerChildren={nonTriggerChildren}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Bb,kDAgJC;AAWD,gEAiBC;;;AAxMD,+CAAiE;AAEjE,qEAAkE;AAClE,yDAAsD;AACtD,qDAAkD;AASlD,mCAAsF;AACtF,oEAAiE;AACjE,6CAAmD;AAMnD,uDAA0F;AAC1F,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,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,eAA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,EAKtD,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAEzD,SAAgB,0BAA0B,CAAC,KAAsB;IAC/D,MAAM,eAAe,GAAG,IAAA,eAAO,EAC7B,GAAG,EAAE,CAAC,IAAA,+BAAoB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC5D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAA,eAAO,EAChC,GAAG,EAAE,CAAC,IAAA,kCAAuB,EAAC,KAAK,CAAC,QAAQ,EAAE,mCAAgB,CAAC,EAC/D,CAAC,KAAK,CAAC,QAAQ,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,uBAAC,8BAA8B,OACzB,KAAK,EACT,QAAQ,EAAE,eAAe,EACzB,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { use, useCallback, useMemo, useRef } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n InternalNativeTabsProps,\n NativeTabNavigationEventMap,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n OnTabChangeEventPayload,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\nimport type {\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n} from '../react-navigation/native';\nimport { createNavigatorFactory, useNavigationBuilder } from '../react-navigation/native';\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 rippleColor,\n disableIndicator,\n labelVisibilityMode,\n screenListeners,\n ...rest\n}: InternalNativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NativeTabOptions,\n NativeTabNavigationEventMap\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenListeners,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n shadowColor,\n rippleColor,\n disableIndicator,\n labelVisibilityMode,\n tintColor: rest.tintColor,\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 const provenanceRef = useRef(0);\n\n const onTabChange = useCallback(\n ({ selectedKey, provenance, isNativeAction }: OnTabChangeEventPayload) => {\n // We should always send the last provenance we got from native side\n provenanceRef.current = provenance;\n\n if (isNativeAction) {\n const { route } = descriptors[selectedKey]!;\n navigation.emit({\n type: 'tabPress',\n target: selectedKey,\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 },\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 // Provenance should only be sent with updates, and updates\n // on JS side are only triggered by rerender, so passing ref\n // here is ok.\n provenance={provenanceRef.current}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nconst NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n TabNavigationState<ParamListBase>,\n NativeTabNavigationEventMap\n>(createNativeTabNavigator().Navigator, undefined, true);\n\nexport function NativeTabsNavigatorWrapper(props: NativeTabsProps) {\n const triggerChildren = useMemo(\n () => getAllChildrenOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n const nonTriggerChildren = useMemo(\n () => getAllChildrenNotOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n\n return (\n <NativeTabsNavigatorWithContext\n {...props}\n children={triggerChildren}\n nonTriggerChildren={nonTriggerChildren}\n />\n );\n}\n"]}
|
|
@@ -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, }: NativeTabTriggerProps, isDynamic?: boolean): NativeTabOptions;
|
|
47
|
+
export declare function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, }: 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,
|
|
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,GACpB,EAAE,qBAAqB,EACxB,SAAS,GAAE,OAAe,oBAiD3B;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,12 +72,16 @@ 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, }, isDynamic = false) {
|
|
75
|
+
function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, disableTransparentOnScrollEdge, disabled, rippleColor, indicatorColor, disableIndicator, labelVisibilityMode, }, isDynamic = false) {
|
|
76
76
|
const initialOptions = isDynamic
|
|
77
77
|
? {
|
|
78
78
|
...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),
|
|
79
79
|
...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),
|
|
80
80
|
...(disabled !== undefined ? { disabled } : {}),
|
|
81
|
+
...(rippleColor !== undefined ? { rippleColor } : {}),
|
|
82
|
+
...(indicatorColor !== undefined ? { indicatorColor } : {}),
|
|
83
|
+
...(disableIndicator !== undefined ? { disableIndicator } : {}),
|
|
84
|
+
...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),
|
|
81
85
|
}
|
|
82
86
|
: {
|
|
83
87
|
hidden: !!hidden,
|
|
@@ -93,6 +97,10 @@ function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, dis
|
|
|
93
97
|
disableAutomaticContentInsets,
|
|
94
98
|
...(disableTransparentOnScrollEdge !== undefined ? { disableTransparentOnScrollEdge } : {}),
|
|
95
99
|
...(disabled !== undefined ? { disabled } : {}),
|
|
100
|
+
...(rippleColor !== undefined ? { rippleColor } : {}),
|
|
101
|
+
...(indicatorColor !== undefined ? { indicatorColor } : {}),
|
|
102
|
+
...(disableIndicator !== undefined ? { disableIndicator } : {}),
|
|
103
|
+
...(labelVisibilityMode !== undefined ? { labelVisibilityMode } : {}),
|
|
96
104
|
};
|
|
97
105
|
const allowedChildren = (0, children_1.filterAllowedChildrenElements)(children, [
|
|
98
106
|
elements_1.NativeTabsTriggerBadge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAwFb,4DAsDC;AAyBD,gDAuBC;AA5LD,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,GAAG,IAAA,kCAAY,GAAE,CAAC;IAEnC,IAAA,+BAAc,EACZ,IAAA,mBAAW,EAAC,GAAG,EAAE;QACf,6DAA6D;QAC7D,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CACb,wEAAwE,KAAK,CAAC,IAAI,EAAE,CACrF,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACtD,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CACzB,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAEY,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE;IAClE,KAAK,EAAE,iCAAsB;IAC7B,IAAI,EAAE,gCAAqB;IAC3B,KAAK,EAAE,iCA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U,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 }: 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 }\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 };\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,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,GAAG,IAAA,kCAAY,GAAE,CAAC;IAEnC,IAAA,+BAAc,EACZ,IAAA,mBAAW,EAAC,GAAG,EAAE;QACf,6DAA6D;QAC7D,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;gBAC1C,MAAM,IAAI,KAAK,CACb,wEAAwE,KAAK,CAAC,IAAI,EAAE,CACrF,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAA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AAa,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.android.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.android.tsx"],"names":[],"mappings":"AAYA,OAAO,
|
|
1
|
+
{"version":3,"file":"NativeTabsView.android.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.android.tsx"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAGjB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kDA6CxD"}
|
|
@@ -10,23 +10,11 @@ const appearance_1 = require("./appearance");
|
|
|
10
10
|
const types_1 = require("./types");
|
|
11
11
|
const optionsIconConverter_1 = require("./utils/optionsIconConverter");
|
|
12
12
|
function NativeTabsView(props) {
|
|
13
|
-
const {
|
|
13
|
+
const { tabBarRespectsIMEInsets, tabs, unstable_nativeProps } = props;
|
|
14
14
|
const { android: rawAndroidProps, ios: _ignoredRawIosProps, ...rawHostRestProps } = unstable_nativeProps ?? {};
|
|
15
15
|
const { selectedScreenKey, provenance } = (0, NativeTabsView_shared_1.useSelectedScreenKey)(props);
|
|
16
16
|
const onTabSelected = (0, NativeTabsView_shared_1.useOnTabSelectedHandler)(props.onTabChange);
|
|
17
|
-
|
|
18
|
-
let labelVisibilityMode = props.labelVisibilityMode;
|
|
19
|
-
if (labelVisibilityMode && !supportedTabBarItemLabelVisibilityModesSet.has(labelVisibilityMode)) {
|
|
20
|
-
console.warn(`Unsupported labelVisibilityMode: ${labelVisibilityMode}. Supported values are: ${types_1.SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `"${mode}"`).join(', ')}`);
|
|
21
|
-
labelVisibilityMode = undefined;
|
|
22
|
-
}
|
|
23
|
-
const androidAppearances = tabs.map((tab) => (0, appearance_1.createAndroidScreenAppearance)({
|
|
24
|
-
options: tab.options,
|
|
25
|
-
tintColor: props.tintColor,
|
|
26
|
-
rippleColor: props.rippleColor,
|
|
27
|
-
disableIndicator,
|
|
28
|
-
labelVisibilityMode,
|
|
29
|
-
}));
|
|
17
|
+
const androidAppearances = (0, react_1.useMemo)(() => tabs.map((tab) => (0, appearance_1.createAndroidScreenAppearance)(sanitizeAndroidOptions(tab.options))), [tabs]);
|
|
30
18
|
const children = tabs.map((tab, index) => ((0, jsx_runtime_1.jsx)(Screen, { routeKey: tab.routeKey, name: tab.name, options: tab.options, isFocused: selectedScreenKey === tab.routeKey, androidAppearance: androidAppearances[index], contentRenderer: tab.contentRenderer }, tab.routeKey)));
|
|
31
19
|
if (children.length === 0) {
|
|
32
20
|
return null;
|
|
@@ -40,7 +28,7 @@ function Screen(props) {
|
|
|
40
28
|
const { options, androidAppearance, contentRenderer } = props;
|
|
41
29
|
const shared = (0, NativeTabsView_shared_1.useSharedScreenProps)(props);
|
|
42
30
|
const androidIcon = (0, optionsIconConverter_1.convertOptionsIconToScreensPropsIcon)(shared.icon);
|
|
43
|
-
const androidSelectedIcon = (0, optionsIconConverter_1.convertOptionsIconToScreensPropsIcon)(shared.selectedIcon);
|
|
31
|
+
const androidSelectedIcon = (0, optionsIconConverter_1.convertOptionsIconToScreensPropsIcon)(shared.selectedIcon ?? shared.icon);
|
|
44
32
|
const content = (0, jsx_runtime_1.jsx)(NativeTabsView_shared_1.ScreenContent, { options: options, contentRenderer: contentRenderer });
|
|
45
33
|
const wrappedContent = (0, react_1.useMemo)(() => {
|
|
46
34
|
if (!options.disableAutomaticContentInsets) {
|
|
@@ -60,4 +48,12 @@ function Screen(props) {
|
|
|
60
48
|
}, title: shared.title, preventNativeSelection: options.disabled, ...shared.nativeRestOverrides, screenKey: shared.screenKey, children: wrappedContent }));
|
|
61
49
|
}
|
|
62
50
|
const supportedTabBarItemLabelVisibilityModesSet = new Set(types_1.SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES);
|
|
51
|
+
function sanitizeAndroidOptions(options) {
|
|
52
|
+
if (options.labelVisibilityMode &&
|
|
53
|
+
!supportedTabBarItemLabelVisibilityModesSet.has(options.labelVisibilityMode)) {
|
|
54
|
+
console.warn(`Unsupported labelVisibilityMode: ${options.labelVisibilityMode}. Supported values are: ${types_1.SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `"${mode}"`).join(', ')}`);
|
|
55
|
+
return { ...options, labelVisibilityMode: undefined };
|
|
56
|
+
}
|
|
57
|
+
return options;
|
|
58
|
+
}
|
|
63
59
|
//# sourceMappingURL=NativeTabsView.android.js.map
|