expo-router 4.0.0-preview.12 → 4.0.0-preview.13
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/build/ExpoRoot.js +2 -2
- package/build/ExpoRoot.js.map +1 -1
- package/build/exports.d.ts +1 -1
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +24 -2
- package/build/exports.js.map +1 -1
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +1 -2
- package/build/global-state/router-store.js.map +1 -1
- package/build/layouts/Drawer.d.ts +2 -142
- package/build/layouts/Drawer.d.ts.map +1 -1
- package/build/layouts/Drawer.js +8 -5
- package/build/layouts/Drawer.js.map +1 -1
- package/build/layouts/DrawerClient.d.ts +144 -0
- package/build/layouts/DrawerClient.d.ts.map +1 -0
- package/build/layouts/DrawerClient.js +10 -0
- package/build/layouts/DrawerClient.js.map +1 -0
- package/build/layouts/Stack.d.ts +2 -126
- package/build/layouts/Stack.d.ts.map +1 -1
- package/build/layouts/Stack.js +8 -6
- package/build/layouts/Stack.js.map +1 -1
- package/build/layouts/StackClient.d.ts +128 -0
- package/build/layouts/StackClient.d.ts.map +1 -0
- package/build/layouts/StackClient.js +10 -0
- package/build/layouts/StackClient.js.map +1 -0
- package/build/layouts/Tabs.d.ts +2 -134
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/layouts/Tabs.js +5 -37
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/TabsClient.d.ts +136 -0
- package/build/layouts/TabsClient.d.ts.map +1 -0
- package/build/layouts/TabsClient.js +44 -0
- package/build/layouts/TabsClient.js.map +1 -0
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +1 -2
- package/build/renderRootComponent.js.map +1 -1
- package/build/rsc/middleware.d.ts +1 -1
- package/build/rsc/middleware.d.ts.map +1 -1
- package/build/rsc/middleware.js +2 -1
- package/build/rsc/middleware.js.map +1 -1
- package/build/rsc/server.d.ts +3 -0
- package/build/rsc/server.d.ts.map +1 -1
- package/build/rsc/server.js +19 -1
- package/build/rsc/server.js.map +1 -1
- package/build/ui/TabContext.d.ts +3 -2
- package/build/ui/TabContext.d.ts.map +1 -1
- package/build/ui/TabContext.js.map +1 -1
- package/build/ui/TabList.d.ts +3 -3
- package/build/ui/TabList.js +2 -2
- package/build/ui/TabList.js.map +1 -1
- package/build/ui/TabSlot.d.ts +28 -14
- package/build/ui/TabSlot.d.ts.map +1 -1
- package/build/ui/TabSlot.js +9 -7
- package/build/ui/TabSlot.js.map +1 -1
- package/build/ui/TabTrigger.d.ts +22 -9
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +6 -4
- package/build/ui/TabTrigger.js.map +1 -1
- package/build/ui/Tabs.d.ts +16 -23
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js +15 -10
- package/build/ui/Tabs.js.map +1 -1
- package/build/utils/splash.d.ts +6 -0
- package/build/utils/splash.d.ts.map +1 -0
- package/build/utils/splash.js +51 -0
- package/build/utils/splash.js.map +1 -0
- package/build/views/Splash.d.ts +1 -1
- package/build/views/Splash.d.ts.map +1 -1
- package/build/views/Splash.js +3 -13
- package/build/views/Splash.js.map +1 -1
- package/build/views/Try.d.ts.map +1 -1
- package/build/views/Try.js +1 -1
- package/build/views/Try.js.map +1 -1
- package/package.json +3 -4
- package/rsc/headers.d.ts +3 -0
- package/rsc/headers.js +5 -0
package/build/layouts/Tabs.d.ts
CHANGED
|
@@ -1,136 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Href } from '../types';
|
|
5
|
-
type TabsProps = BottomTabNavigationOptions & {
|
|
6
|
-
href?: Href | null;
|
|
7
|
-
};
|
|
8
|
-
export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native").DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase>> & import("@react-navigation/native").DefaultRouterOptions & {
|
|
9
|
-
backBehavior?: import("@react-navigation/routers/lib/typescript/commonjs/src/TabRouter").BackBehavior | undefined;
|
|
10
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/commonjs/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenOptions" | "layout" | "screenListeners" | "screenLayout" | "UNSTABLE_getStateForRouteNamesChange"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
layout?: ((props: {
|
|
13
|
-
state: TabNavigationState<ParamListBase>;
|
|
14
|
-
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
|
|
15
|
-
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
18
|
-
screenListeners?: Partial<{
|
|
19
|
-
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
20
|
-
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
21
|
-
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
22
|
-
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
23
|
-
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
24
|
-
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
25
|
-
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
26
|
-
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
27
|
-
}> | ((props: {
|
|
28
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
29
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
30
|
-
}) => Partial<{
|
|
31
|
-
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
32
|
-
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
33
|
-
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
34
|
-
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
35
|
-
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
36
|
-
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
37
|
-
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
38
|
-
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
39
|
-
}>) | undefined;
|
|
40
|
-
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
41
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
42
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
43
|
-
theme: ReactNavigation.Theme;
|
|
44
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
45
|
-
screenLayout?: ((props: {
|
|
46
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
47
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
48
|
-
theme: ReactNavigation.Theme;
|
|
49
|
-
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
50
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
51
|
-
UNSTABLE_getStateForRouteNamesChange?: ((state: Readonly<{
|
|
52
|
-
key: string;
|
|
53
|
-
index: number;
|
|
54
|
-
routeNames: string[];
|
|
55
|
-
history?: unknown[] | undefined;
|
|
56
|
-
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
57
|
-
type: string;
|
|
58
|
-
stale: false;
|
|
59
|
-
}>) => import("@react-navigation/native").PartialState<Readonly<{
|
|
60
|
-
key: string;
|
|
61
|
-
index: number;
|
|
62
|
-
routeNames: string[];
|
|
63
|
-
history?: unknown[] | undefined;
|
|
64
|
-
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
65
|
-
type: string;
|
|
66
|
-
stale: false;
|
|
67
|
-
}>> | undefined) | undefined;
|
|
68
|
-
} & {
|
|
69
|
-
id?: undefined;
|
|
70
|
-
}, "children"> & Partial<Pick<Omit<import("@react-navigation/native").DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase>> & import("@react-navigation/native").DefaultRouterOptions & {
|
|
71
|
-
backBehavior?: import("@react-navigation/routers/lib/typescript/commonjs/src/TabRouter").BackBehavior | undefined;
|
|
72
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/commonjs/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenOptions" | "layout" | "screenListeners" | "screenLayout" | "UNSTABLE_getStateForRouteNamesChange"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
|
|
73
|
-
children: React.ReactNode;
|
|
74
|
-
layout?: ((props: {
|
|
75
|
-
state: TabNavigationState<ParamListBase>;
|
|
76
|
-
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
|
|
77
|
-
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
|
|
78
|
-
children: React.ReactNode;
|
|
79
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
80
|
-
screenListeners?: Partial<{
|
|
81
|
-
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
82
|
-
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
83
|
-
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
84
|
-
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
85
|
-
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
86
|
-
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
87
|
-
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
88
|
-
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
89
|
-
}> | ((props: {
|
|
90
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
91
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
92
|
-
}) => Partial<{
|
|
93
|
-
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
94
|
-
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
95
|
-
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
96
|
-
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
97
|
-
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
98
|
-
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
99
|
-
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
100
|
-
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
101
|
-
}>) | undefined;
|
|
102
|
-
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
103
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
104
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
105
|
-
theme: ReactNavigation.Theme;
|
|
106
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
107
|
-
screenLayout?: ((props: {
|
|
108
|
-
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
109
|
-
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
110
|
-
theme: ReactNavigation.Theme;
|
|
111
|
-
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
112
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
113
|
-
UNSTABLE_getStateForRouteNamesChange?: ((state: Readonly<{
|
|
114
|
-
key: string;
|
|
115
|
-
index: number;
|
|
116
|
-
routeNames: string[];
|
|
117
|
-
history?: unknown[] | undefined;
|
|
118
|
-
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
119
|
-
type: string;
|
|
120
|
-
stale: false;
|
|
121
|
-
}>) => import("@react-navigation/native").PartialState<Readonly<{
|
|
122
|
-
key: string;
|
|
123
|
-
index: number;
|
|
124
|
-
routeNames: string[];
|
|
125
|
-
history?: unknown[] | undefined;
|
|
126
|
-
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
127
|
-
type: string;
|
|
128
|
-
stale: false;
|
|
129
|
-
}>> | undefined) | undefined;
|
|
130
|
-
} & {
|
|
131
|
-
id?: undefined;
|
|
132
|
-
}, "children">> & React.RefAttributes<unknown>> & {
|
|
133
|
-
Screen: (props: import("..").ScreenProps<TabsProps, TabNavigationState<ParamListBase>, BottomTabNavigationEventMap>) => null;
|
|
134
|
-
};
|
|
1
|
+
import Tabs from './TabsClient';
|
|
2
|
+
export { Tabs };
|
|
135
3
|
export default Tabs;
|
|
136
4
|
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAKhC,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,eAAe,IAAI,CAAC"}
|
package/build/layouts/Tabs.js
CHANGED
|
@@ -1,44 +1,12 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
3
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
4
|
};
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.Tabs = void 0;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// This is the only way to access the navigator.
|
|
14
|
-
const BottomTabNavigator = (0, bottom_tabs_1.createBottomTabNavigator)().Navigator;
|
|
15
|
-
exports.Tabs = (0, withLayoutContext_1.withLayoutContext)(BottomTabNavigator, (screens) => {
|
|
16
|
-
// Support the `href` shortcut prop.
|
|
17
|
-
return screens.map((screen) => {
|
|
18
|
-
if (typeof screen.options !== 'function' && screen.options?.href !== undefined) {
|
|
19
|
-
const { href, ...options } = screen.options;
|
|
20
|
-
if (options.tabBarButton) {
|
|
21
|
-
throw new Error('Cannot use `href` and `tabBarButton` together.');
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
...screen,
|
|
25
|
-
options: {
|
|
26
|
-
...options,
|
|
27
|
-
tabBarItemStyle: href == null ? { display: 'none' } : options.tabBarItemStyle,
|
|
28
|
-
tabBarButton: (props) => {
|
|
29
|
-
if (href == null) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const children = react_native_1.Platform.OS === 'web' ? props.children : <react_native_1.Pressable>{props.children}</react_native_1.Pressable>;
|
|
33
|
-
// TODO: React Navigation types these props as Animated.WithAnimatedValue<StyleProp<ViewStyle>>
|
|
34
|
-
// While Link expects a TextStyle. We need to reconcile these types.
|
|
35
|
-
return (<Link_1.Link {...props} style={[{ display: 'flex' }, props.style]} href={href} asChild={react_native_1.Platform.OS !== 'web'} children={children}/>);
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return screen;
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
exports.default = exports.Tabs;
|
|
7
|
+
const TabsClient_1 = __importDefault(require("./TabsClient"));
|
|
8
|
+
exports.Tabs = TabsClient_1.default;
|
|
9
|
+
const Screen_1 = require("../views/Screen");
|
|
10
|
+
TabsClient_1.default.Screen = Screen_1.Screen;
|
|
11
|
+
exports.default = TabsClient_1.default;
|
|
44
12
|
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAKvB,eALF,oBAAI,CAKE;AAJb,4CAAyC;AAEzC,oBAAI,CAAC,MAAM,GAAG,eAAM,CAAC;AAIrB,kBAAe,oBAAI,CAAC","sourcesContent":["import Tabs from './TabsClient';\nimport { Screen } from '../views/Screen';\n\nTabs.Screen = Screen;\n\nexport { Tabs };\n\nexport default Tabs;\n"]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { BottomTabNavigationEventMap, BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
|
|
2
|
+
import { ParamListBase, TabNavigationState } from '@react-navigation/native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Href } from '../types';
|
|
5
|
+
type TabsProps = BottomTabNavigationOptions & {
|
|
6
|
+
href?: Href | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native").DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase>> & import("@react-navigation/native").DefaultRouterOptions & {
|
|
9
|
+
backBehavior?: import("@react-navigation/routers/lib/typescript/commonjs/src/TabRouter").BackBehavior | undefined;
|
|
10
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/commonjs/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenOptions" | "layout" | "screenListeners" | "screenLayout" | "UNSTABLE_getStateForRouteNamesChange"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
layout?: ((props: {
|
|
13
|
+
state: TabNavigationState<ParamListBase>;
|
|
14
|
+
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
|
|
15
|
+
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
18
|
+
screenListeners?: Partial<{
|
|
19
|
+
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
20
|
+
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
21
|
+
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
22
|
+
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
23
|
+
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
24
|
+
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
25
|
+
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
26
|
+
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
27
|
+
}> | ((props: {
|
|
28
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
29
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
30
|
+
}) => Partial<{
|
|
31
|
+
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
32
|
+
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
33
|
+
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
34
|
+
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
35
|
+
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
36
|
+
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
37
|
+
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
38
|
+
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
39
|
+
}>) | undefined;
|
|
40
|
+
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
41
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
42
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
43
|
+
theme: ReactNavigation.Theme;
|
|
44
|
+
}) => BottomTabNavigationOptions) | undefined;
|
|
45
|
+
screenLayout?: ((props: {
|
|
46
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
47
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
48
|
+
theme: ReactNavigation.Theme;
|
|
49
|
+
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
50
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
51
|
+
UNSTABLE_getStateForRouteNamesChange?: ((state: Readonly<{
|
|
52
|
+
key: string;
|
|
53
|
+
index: number;
|
|
54
|
+
routeNames: string[];
|
|
55
|
+
history?: unknown[] | undefined;
|
|
56
|
+
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
57
|
+
type: string;
|
|
58
|
+
stale: false;
|
|
59
|
+
}>) => import("@react-navigation/native").PartialState<Readonly<{
|
|
60
|
+
key: string;
|
|
61
|
+
index: number;
|
|
62
|
+
routeNames: string[];
|
|
63
|
+
history?: unknown[] | undefined;
|
|
64
|
+
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
65
|
+
type: string;
|
|
66
|
+
stale: false;
|
|
67
|
+
}>> | undefined) | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
id?: undefined;
|
|
70
|
+
}, "children"> & Partial<Pick<Omit<import("@react-navigation/native").DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase>> & import("@react-navigation/native").DefaultRouterOptions & {
|
|
71
|
+
backBehavior?: import("@react-navigation/routers/lib/typescript/commonjs/src/TabRouter").BackBehavior | undefined;
|
|
72
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/commonjs/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenOptions" | "layout" | "screenListeners" | "screenLayout" | "UNSTABLE_getStateForRouteNamesChange"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
layout?: ((props: {
|
|
75
|
+
state: TabNavigationState<ParamListBase>;
|
|
76
|
+
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
|
|
77
|
+
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
80
|
+
screenListeners?: Partial<{
|
|
81
|
+
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
82
|
+
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
83
|
+
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
84
|
+
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
85
|
+
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
86
|
+
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
87
|
+
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
88
|
+
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
89
|
+
}> | ((props: {
|
|
90
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
91
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
92
|
+
}) => Partial<{
|
|
93
|
+
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
|
|
94
|
+
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
|
|
95
|
+
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
|
|
96
|
+
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
|
|
97
|
+
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
|
|
98
|
+
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
|
|
99
|
+
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
|
|
100
|
+
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
|
|
101
|
+
}>) | undefined;
|
|
102
|
+
screenOptions?: BottomTabNavigationOptions | ((props: {
|
|
103
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
104
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
105
|
+
theme: ReactNavigation.Theme;
|
|
106
|
+
}) => BottomTabNavigationOptions) | undefined;
|
|
107
|
+
screenLayout?: ((props: {
|
|
108
|
+
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
|
|
109
|
+
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, undefined>;
|
|
110
|
+
theme: ReactNavigation.Theme;
|
|
111
|
+
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
112
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
113
|
+
UNSTABLE_getStateForRouteNamesChange?: ((state: Readonly<{
|
|
114
|
+
key: string;
|
|
115
|
+
index: number;
|
|
116
|
+
routeNames: string[];
|
|
117
|
+
history?: unknown[] | undefined;
|
|
118
|
+
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
119
|
+
type: string;
|
|
120
|
+
stale: false;
|
|
121
|
+
}>) => import("@react-navigation/native").PartialState<Readonly<{
|
|
122
|
+
key: string;
|
|
123
|
+
index: number;
|
|
124
|
+
routeNames: string[];
|
|
125
|
+
history?: unknown[] | undefined;
|
|
126
|
+
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
|
|
127
|
+
type: string;
|
|
128
|
+
stale: false;
|
|
129
|
+
}>> | undefined) | undefined;
|
|
130
|
+
} & {
|
|
131
|
+
id?: undefined;
|
|
132
|
+
}, "children">> & React.RefAttributes<unknown>> & {
|
|
133
|
+
Screen: (props: import("..").ScreenProps<TabsProps, TabNavigationState<ParamListBase>, BottomTabNavigationEventMap>) => null;
|
|
134
|
+
};
|
|
135
|
+
export default Tabs;
|
|
136
|
+
//# sourceMappingURL=TabsClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsClient.d.ts","sourceRoot":"","sources":["../../src/layouts/TabsClient.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAKhC,KAAK,SAAS,GAAG,0BAA0B,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC;AAErE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCf,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Tabs = void 0;
|
|
8
|
+
const bottom_tabs_1 = require("@react-navigation/bottom-tabs");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const react_native_1 = require("react-native");
|
|
11
|
+
const withLayoutContext_1 = require("./withLayoutContext");
|
|
12
|
+
const Link_1 = require("../link/Link");
|
|
13
|
+
// This is the only way to access the navigator.
|
|
14
|
+
const BottomTabNavigator = (0, bottom_tabs_1.createBottomTabNavigator)().Navigator;
|
|
15
|
+
exports.Tabs = (0, withLayoutContext_1.withLayoutContext)(BottomTabNavigator, (screens) => {
|
|
16
|
+
// Support the `href` shortcut prop.
|
|
17
|
+
return screens.map((screen) => {
|
|
18
|
+
if (typeof screen.options !== 'function' && screen.options?.href !== undefined) {
|
|
19
|
+
const { href, ...options } = screen.options;
|
|
20
|
+
if (options.tabBarButton) {
|
|
21
|
+
throw new Error('Cannot use `href` and `tabBarButton` together.');
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
...screen,
|
|
25
|
+
options: {
|
|
26
|
+
...options,
|
|
27
|
+
tabBarItemStyle: href == null ? { display: 'none' } : options.tabBarItemStyle,
|
|
28
|
+
tabBarButton: (props) => {
|
|
29
|
+
if (href == null) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const children = react_native_1.Platform.OS === 'web' ? props.children : <react_native_1.Pressable>{props.children}</react_native_1.Pressable>;
|
|
33
|
+
// TODO: React Navigation types these props as Animated.WithAnimatedValue<StyleProp<ViewStyle>>
|
|
34
|
+
// While Link expects a TextStyle. We need to reconcile these types.
|
|
35
|
+
return (<Link_1.Link {...props} style={[{ display: 'flex' }, props.style]} href={href} asChild={react_native_1.Platform.OS !== 'web'} children={children}/>);
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return screen;
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
exports.default = exports.Tabs;
|
|
44
|
+
//# sourceMappingURL=TabsClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsClient.js","sourceRoot":"","sources":["../../src/layouts/TabsClient.tsx"],"names":[],"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E,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,KAAY,CAAC,CAAC,CACjD,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,OAAO,CAAC,CAAC,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAC/B,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,kBAAe,YAAI,CAAC","sourcesContent":["'use client';\n\nimport {\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n createBottomTabNavigator,\n} from '@react-navigation/bottom-tabs';\nimport { ParamListBase, TabNavigationState } from '@react-navigation/native';\nimport React from 'react';\nimport { Pressable, Platform } from 'react-native';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { Link } from '../link/Link';\nimport { Href } from '../types';\n\n// This is the only way to access the navigator.\nconst BottomTabNavigator = createBottomTabNavigator().Navigator;\n\ntype TabsProps = BottomTabNavigationOptions & { href?: Href | null };\n\nexport const Tabs = withLayoutContext<\n TabsProps,\n typeof BottomTabNavigator,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationEventMap\n>(BottomTabNavigator, (screens) => {\n // Support the `href` shortcut prop.\n return screens.map((screen) => {\n if (typeof screen.options !== 'function' && screen.options?.href !== undefined) {\n const { href, ...options } = screen.options;\n if (options.tabBarButton) {\n throw new Error('Cannot use `href` and `tabBarButton` together.');\n }\n return {\n ...screen,\n options: {\n ...options,\n tabBarItemStyle: href == null ? { display: 'none' } : options.tabBarItemStyle,\n tabBarButton: (props) => {\n if (href == null) {\n return null;\n }\n const children =\n Platform.OS === 'web' ? props.children : <Pressable>{props.children}</Pressable>;\n // TODO: React Navigation types these props as Animated.WithAnimatedValue<StyleProp<ViewStyle>>\n // While Link expects a TextStyle. We need to reconcile these types.\n return (\n <Link\n {...(props as any)}\n style={[{ display: 'flex' }, props.style as any]}\n href={href}\n asChild={Platform.OS !== 'web'}\n children={children}\n />\n );\n },\n },\n };\n }\n return screen;\n });\n});\n\nexport default Tabs;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+C/B;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAwCtE"}
|
|
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.renderRootComponent = void 0;
|
|
27
27
|
const expo_1 = require("expo");
|
|
28
|
-
const SplashScreen = __importStar(require("expo-splash-screen"));
|
|
29
28
|
const React = __importStar(require("react"));
|
|
30
29
|
const react_native_1 = require("react-native");
|
|
30
|
+
const SplashScreen = __importStar(require("./utils/splash"));
|
|
31
31
|
function isBaseObject(obj) {
|
|
32
32
|
if (Object.prototype.toString.call(obj) !== '[object Object]') {
|
|
33
33
|
return false;
|
|
@@ -70,7 +70,6 @@ function renderRootComponent(Component) {
|
|
|
70
70
|
try {
|
|
71
71
|
// This must be delayed so the user has a chance to call it first.
|
|
72
72
|
setTimeout(() => {
|
|
73
|
-
// @ts-expect-error: This function is native-only and for internal-use only.
|
|
74
73
|
SplashScreen._internal_preventAutoHideAsync?.();
|
|
75
74
|
});
|
|
76
75
|
React.startTransition(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.js","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA6C;AAC7C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C,SAAmC;IACrE,IAAI;QACF,kEAAkE;QAClE,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,CAAC,8BAA8B,EAAE,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;YACzB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;gBACzC,MAAM,EAAE,gBAAgB,EAAE,GACxB,OAAO,CAAC,mCAAmC,CAAuD,CAAC;gBACrG,IAAA,4BAAqB,EAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;aACpD;iBAAM;gBACL,IAAA,4BAAqB,EAAC,SAAS,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,CAAC,EAAE;QACV,uEAAuE;QACvE,YAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9B,2CAA2C;QAC3C,mFAAmF;QACnF,yIAAyI;QACzI,+FAA+F;QAC/F,IAAA,4BAAqB,EAAC,GAAG,EAAE,CAAC,CAAC,mBAAI,CAAC,AAAD,EAAG,CAAC,CAAC;QAEtC,gFAAgF;QAChF,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;SACnF;QAED,+CAA+C;QAC/C,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,+CAA+C;KAChD;AACH,CAAC;AAxCD,kDAwCC","sourcesContent":["import { registerRootComponent } from 'expo';\nimport * as React from 'react';\nimport { View } from 'react-native';\n\nimport * as SplashScreen from './utils/splash';\n\nfunction isBaseObject(obj: any) {\n if (Object.prototype.toString.call(obj) !== '[object Object]') {\n return false;\n }\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) {\n return true;\n }\n return proto === Object.prototype;\n}\n\nfunction isErrorShaped(error: any): error is Error {\n return (\n error &&\n typeof error === 'object' &&\n typeof error.name === 'string' &&\n typeof error.message === 'string'\n );\n}\n\n/**\n * After we throw this error, any number of tools could handle it.\n * This check ensures the error is always in a reason state before surfacing it to the runtime.\n */\nfunction convertError(error: any) {\n if (isErrorShaped(error)) {\n return error;\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (error == null) {\n return new Error('A null/undefined error was thrown.');\n }\n }\n\n if (isBaseObject(error)) {\n return new Error(JSON.stringify(error));\n }\n\n return new Error(String(error));\n}\n\n/**\n * Register and mount the root component using the predefined rendering\n * method. This function ensures the Splash Screen and errors are handled correctly.\n */\nexport function renderRootComponent(Component: React.ComponentType<any>) {\n try {\n // This must be delayed so the user has a chance to call it first.\n setTimeout(() => {\n SplashScreen._internal_preventAutoHideAsync?.();\n });\n\n React.startTransition(() => {\n if (process.env.NODE_ENV !== 'production') {\n const { withErrorOverlay } =\n require('@expo/metro-runtime/error-overlay') as typeof import('@expo/metro-runtime/error-overlay');\n registerRootComponent(withErrorOverlay(Component));\n } else {\n registerRootComponent(Component);\n }\n });\n } catch (e) {\n // Hide the splash screen if there was an error so the user can see it.\n SplashScreen.hideAsync();\n\n const error = convertError(e);\n // Prevent the app from throwing confusing:\n // ERROR Invariant Violation: \"main\" has not been registered. This can happen if:\n // * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.\n // * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.\n registerRootComponent(() => <View />);\n\n // Console is pretty useless on native, on web you get interactive stack traces.\n if (process.env.EXPO_OS === 'web') {\n console.error(error);\n console.error(`A runtime error has occurred while rendering the root component.`);\n }\n\n // Give React a tick to render before throwing.\n setTimeout(() => {\n throw error;\n });\n\n // TODO: Render a production-only error screen.\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import type { RenderRscArgs } from '@expo/server/build/middleware/rsc';
|
|
|
9
9
|
type ImportMap = {
|
|
10
10
|
router: () => Promise<typeof import('./router/expo-definedRouter')>;
|
|
11
11
|
};
|
|
12
|
-
export declare function renderRscWithImportsAsync(distFolder: string, imports: ImportMap, { body, platform, searchParams, config, method, input, contentType }: RenderRscArgs): Promise<ReadableStream<any>>;
|
|
12
|
+
export declare function renderRscWithImportsAsync(distFolder: string, imports: ImportMap, { body, platform, searchParams, config, method, input, contentType, headers }: RenderRscArgs): Promise<ReadableStream<any>>;
|
|
13
13
|
export declare function renderRscAsync(distFolder: string, args: RenderRscArgs): Promise<ReadableStream<any>>;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAyEvE,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,OAAO,CAAC,cAAc,6BAA6B,CAAC,CAAC,CAAC;CACrE,CAAC;AAEF,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,SAAS,EAClB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAyEvE,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,OAAO,CAAC,cAAc,6BAA6B,CAAC,CAAC,CAAC;CACrE,CAAC;AAEF,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,SAAS,EAClB,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,aAAa,GAC3F,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAmE9B;AAED,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAa9B"}
|
package/build/rsc/middleware.js
CHANGED
|
@@ -37,11 +37,12 @@ async function getSSRManifest(distFolder, platform) {
|
|
|
37
37
|
const filePath = `../../rsc/${platform}/ssr-manifest.js`;
|
|
38
38
|
return interopDefault(await (0, _async_server_import_1.asyncServerImport)(filePath));
|
|
39
39
|
}
|
|
40
|
-
async function renderRscWithImportsAsync(distFolder, imports, { body, platform, searchParams, config, method, input, contentType }) {
|
|
40
|
+
async function renderRscWithImportsAsync(distFolder, imports, { body, platform, searchParams, config, method, input, contentType, headers }) {
|
|
41
41
|
if (method === 'POST' && !body) {
|
|
42
42
|
throw new Error('Server request must be provided when method is POST (server actions)');
|
|
43
43
|
}
|
|
44
44
|
const context = getRscRenderContext(platform);
|
|
45
|
+
context['__expo_requestHeaders'] = headers;
|
|
45
46
|
const entries = await imports.router();
|
|
46
47
|
const ssrManifest = await getSSRManifest(distFolder, platform);
|
|
47
48
|
const actionManifest = await getServerActionManifest(distFolder, platform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/rsc/middleware.ts"],"names":[],"mappings":";;;;;;AASA,2EAAqE;AACrE,0DAA6B;AAE7B,iDAA2C;AAE3C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAE3D,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAe,CAAC;AAEhD,SAAS,mBAAmB,CAAC,QAAgB;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,IAAA,wCAAiB,EAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;KACF,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAhBD,wCAgBC","sourcesContent":["/**\n * Copyright © 2024 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n// This module is bundled with Metro in web/react-server mode and redirects to platform specific renderers.\nimport type { RenderRscArgs } from '@expo/server/build/middleware/rsc';\nimport { asyncServerImport } from 'expo-router/_async-server-import';\nimport path from 'node:path';\n\nimport { renderRsc } from './rsc-renderer';\n\nconst debug = require('debug')('expo:server:rsc-renderer');\n\n// Tracking the implementation in expo/cli's MetroBundlerDevServer\nconst rscRenderContext = new Map<string, any>();\n\nfunction getRscRenderContext(platform: string) {\n // NOTE(EvanBacon): We memoize this now that there's a persistent server storage cache for Server Actions.\n if (rscRenderContext.has(platform)) {\n return rscRenderContext.get(platform)!;\n }\n\n const context = {};\n\n rscRenderContext.set(platform, context);\n return context;\n}\n\nfunction interopDefault(mod: any) {\n if ('default' in mod && typeof mod.default === 'object' && mod.default) {\n const def = mod.default;\n if ('default' in def && typeof def.default === 'object' && def.default) {\n return def.default;\n }\n return mod.default;\n }\n return mod;\n}\n\nasync function getServerActionManifest(\n distFolder: string,\n platform: string\n): Promise<\n Record<\n // Input ID\n string,\n [\n // Metro ID\n string,\n // Chunk location.\n string,\n ]\n >\n> {\n const filePath = `../../rsc/${platform}/action-manifest.js`;\n return interopDefault(await asyncServerImport(filePath));\n}\n\nasync function getSSRManifest(\n distFolder: string,\n platform: string\n): Promise<\n Record<\n // Input ID\n string,\n [\n // Metro ID\n string,\n // Chunk location.\n string,\n ]\n >\n> {\n const filePath = `../../rsc/${platform}/ssr-manifest.js`;\n return interopDefault(await asyncServerImport(filePath));\n}\n\n// The import map allows us to use external modules from different bundling contexts.\ntype ImportMap = {\n router: () => Promise<typeof import('./router/expo-definedRouter')>;\n};\n\nexport async function renderRscWithImportsAsync(\n distFolder: string,\n imports: ImportMap,\n { body, platform, searchParams, config, method, input, contentType, headers }: RenderRscArgs\n): Promise<ReadableStream<any>> {\n if (method === 'POST' && !body) {\n throw new Error('Server request must be provided when method is POST (server actions)');\n }\n\n const context = getRscRenderContext(platform);\n\n context['__expo_requestHeaders'] = headers;\n\n const entries = await imports.router();\n\n const ssrManifest = await getSSRManifest(distFolder, platform);\n const actionManifest = await getServerActionManifest(distFolder, platform);\n return renderRsc(\n {\n body: body ?? undefined,\n context,\n config,\n input,\n contentType,\n decodedBody: searchParams.get('x-expo-params'),\n },\n {\n isExporting: true,\n\n resolveClientEntry(file: string, isServer: boolean) {\n debug('resolveClientEntry', file, { isServer });\n\n if (isServer) {\n if (!(file in actionManifest)) {\n throw new Error(\n `Could not find file in server action manifest: ${file}. ${JSON.stringify(actionManifest)}`\n );\n }\n\n const [id, chunk] = actionManifest[file];\n return {\n id,\n chunks: chunk ? [chunk] : [],\n };\n }\n\n if (!(file in ssrManifest)) {\n throw new Error(`Could not find file in SSR manifest: ${file}`);\n }\n\n const [id, chunk] = ssrManifest[file];\n return {\n id,\n chunks: chunk ? [chunk] : [],\n };\n },\n async loadServerModuleRsc(file) {\n debug('loadServerModuleRsc', file);\n const filePath = path.join('../../../', file);\n const m = await asyncServerImport(filePath);\n\n // TODO: This is a hack to workaround a cloudflare/metro issue where there's an extra `default` wrapper.\n if (typeof caches !== 'undefined') {\n return m.default;\n }\n return m;\n },\n\n entries: entries!,\n }\n );\n}\n\nexport async function renderRscAsync(\n distFolder: string,\n args: RenderRscArgs\n): Promise<ReadableStream<any>> {\n const platform = args.platform;\n return renderRscWithImportsAsync(\n distFolder,\n {\n router: () => {\n // Assumes this file is saved to: `dist/server/_expo/functions/_flight/[...rsc].js`\n const filePath = `../../rsc/${platform}/router.js`;\n return asyncServerImport(filePath);\n },\n },\n args\n );\n}\n"]}
|
package/build/rsc/server.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { ReactNode } from 'react';
|
|
9
9
|
import type { PathSpec } from './path';
|
|
10
|
+
export declare const REQUEST_HEADERS = "__expo_requestHeaders";
|
|
10
11
|
type Config = any;
|
|
11
12
|
type Elements = Record<string, ReactNode>;
|
|
12
13
|
export type BuildConfig = {
|
|
@@ -58,5 +59,7 @@ type RenderStore = {
|
|
|
58
59
|
export declare const runWithRenderStore: <T>(renderStore: RenderStore, fn: () => T) => T;
|
|
59
60
|
export declare function rerender(input: string, params?: unknown): void;
|
|
60
61
|
export declare function getContext<RscContext extends Record<string, unknown> = Record<string, unknown>>(): RscContext;
|
|
62
|
+
/** Get the request headers used to make the server component or action request. */
|
|
63
|
+
export declare function unstable_headers(): Promise<Headers>;
|
|
61
64
|
export {};
|
|
62
65
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rsc/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAQvD,KAAK,MAAM,GAAG,GAAG,CAAC;AAElB,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE;QACR,KAAK,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