expo-router 4.0.0-preview.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/error.png +0 -0
- package/assets/file.png +0 -0
- package/assets/forward.png +0 -0
- package/assets/logotype.png +0 -0
- package/assets/pkg.png +0 -0
- package/assets/sitemap.png +0 -0
- package/build/ExpoRoot.js +2 -2
- package/build/ExpoRoot.js.map +1 -1
- package/build/doctor/index.d.ts +16 -0
- package/build/doctor/index.d.ts.map +1 -0
- package/build/doctor/index.js +66 -0
- package/build/doctor/index.js.map +1 -0
- 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/fast-refresh.d.ts.map +1 -1
- package/build/fast-refresh.js.map +1 -1
- package/build/getRoutesCore.d.ts +1 -0
- package/build/getRoutesCore.d.ts.map +1 -1
- package/build/getRoutesCore.js +3 -1
- package/build/getRoutesCore.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/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +4 -0
- package/build/global-state/routing.js.map +1 -1
- package/build/head/url.d.ts +1 -0
- package/build/head/url.d.ts.map +1 -1
- package/build/head/url.js +21 -4
- package/build/head/url.js.map +1 -1
- package/build/hooks.d.ts +90 -38
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +46 -39
- package/build/hooks.js.map +1 -1
- package/build/imperative-api.d.ts +58 -15
- package/build/imperative-api.d.ts.map +1 -1
- package/build/imperative-api.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/layouts/withLayoutContext.d.ts +4 -1
- package/build/layouts/withLayoutContext.d.ts.map +1 -1
- package/build/layouts/withLayoutContext.js +4 -1
- package/build/layouts/withLayoutContext.js.map +1 -1
- package/build/link/Link.d.ts +48 -4
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +47 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/href.d.ts +1 -1
- package/build/link/href.d.ts.map +1 -1
- package/build/link/href.js.map +1 -1
- package/build/link/useLinkHooks.d.ts +122 -29
- package/build/link/useLinkHooks.d.ts.map +1 -1
- package/build/link/useLinkHooks.js.map +1 -1
- package/build/onboard/Tutorial.d.ts.map +1 -1
- package/build/onboard/Tutorial.js +140 -86
- package/build/onboard/Tutorial.js.map +1 -1
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +1 -2
- package/build/renderRootComponent.js.map +1 -1
- package/build/rsc/exports.d.ts +3 -1
- package/build/rsc/exports.d.ts.map +1 -1
- package/build/rsc/exports.js +3 -1
- package/build/rsc/exports.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/router/client.d.ts +2 -2
- package/build/rsc/router/client.d.ts.map +1 -1
- package/build/rsc/router/client.js.map +1 -1
- package/build/rsc/router/host.d.ts.map +1 -1
- package/build/rsc/router/host.js +20 -15
- package/build/rsc/router/host.js.map +1 -1
- package/build/rsc/rsc-renderer.d.ts +1 -1
- package/build/rsc/rsc-renderer.d.ts.map +1 -1
- package/build/rsc/rsc-renderer.js +1 -1
- package/build/rsc/rsc-renderer.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/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js +3 -1
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/testing-library/mocks.js +14 -13
- package/build/testing-library/mocks.js.map +1 -1
- package/build/typed-routes/generate.d.ts +5 -1
- package/build/typed-routes/generate.d.ts.map +1 -1
- package/build/typed-routes/generate.js +129 -64
- package/build/typed-routes/generate.js.map +1 -1
- package/build/typed-routes/index.d.ts +5 -0
- package/build/typed-routes/index.d.ts.map +1 -1
- package/build/typed-routes/index.js +8 -3
- package/build/typed-routes/index.js.map +1 -1
- package/build/typed-routes/testSetup.d.ts +1 -1
- package/build/typed-routes/testSetup.d.ts.map +1 -1
- package/build/typed-routes/testSetup.js +29 -17
- package/build/typed-routes/testSetup.js.map +1 -1
- package/build/typed-routes/types.d.ts +43 -145
- package/build/typed-routes/types.d.ts.map +1 -1
- package/build/typed-routes/types.js.map +1 -1
- package/build/types.d.ts +33 -0
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/ui/TabContext.d.ts +158 -1
- package/build/ui/TabContext.d.ts.map +1 -1
- package/build/ui/TabContext.js +25 -1
- package/build/ui/TabContext.js.map +1 -1
- package/build/ui/TabList.d.ts +17 -1
- package/build/ui/TabList.d.ts.map +1 -1
- package/build/ui/TabList.js +16 -0
- package/build/ui/TabList.js.map +1 -1
- package/build/ui/TabSlot.d.ts +55 -5
- package/build/ui/TabSlot.d.ts.map +1 -1
- package/build/ui/TabSlot.js +38 -14
- package/build/ui/TabSlot.js.map +1 -1
- package/build/ui/TabTrigger.d.ts +65 -70
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +25 -1
- package/build/ui/TabTrigger.js.map +1 -1
- package/build/ui/Tabs.d.ts +89 -132
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js +53 -8
- package/build/ui/Tabs.js.map +1 -1
- package/build/ui/common.d.ts +3 -3
- package/build/ui/common.d.ts.map +1 -1
- package/build/ui/common.js.map +1 -1
- package/build/useFocusEffect.d.ts +15 -6
- package/build/useFocusEffect.d.ts.map +1 -1
- package/build/useFocusEffect.js +15 -6
- package/build/useFocusEffect.js.map +1 -1
- package/build/useNavigation.d.ts +11 -5
- package/build/useNavigation.d.ts.map +1 -1
- package/build/useNavigation.js +11 -5
- package/build/useNavigation.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/utils/url.js +2 -2
- package/build/utils/url.js.map +1 -1
- package/build/views/Navigator.d.ts +6 -5
- package/build/views/Navigator.d.ts.map +1 -1
- package/build/views/Navigator.js +6 -5
- package/build/views/Navigator.js.map +1 -1
- package/build/views/Sitemap.d.ts.map +1 -1
- package/build/views/Sitemap.js +93 -46
- package/build/views/Sitemap.js.map +1 -1
- 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 +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/doctor.js +1 -0
- package/entry-classic.js +0 -6
- package/package.json +23 -24
- package/plugin/build/index.d.ts +2 -0
- package/plugin/options.json +74 -73
- package/plugin/src/index.ts +64 -0
- package/rsc/entry.js +0 -6
- package/rsc/headers.d.ts +3 -0
- package/rsc/headers.js +5 -0
- package/build/rsc/runtime.d.ts +0 -9
- package/build/rsc/runtime.d.ts.map +0 -1
- package/build/rsc/runtime.js +0 -36
- package/build/rsc/runtime.js.map +0 -1
- package/virtual-client-boundaries.js +0 -1
|
@@ -6,12 +6,13 @@ import { Href } from '../types';
|
|
|
6
6
|
*/
|
|
7
7
|
export type WebAnchorProps = {
|
|
8
8
|
/**
|
|
9
|
-
* Specifies where to open the `href
|
|
9
|
+
* Specifies where to open the [`href`](#href).
|
|
10
10
|
*
|
|
11
11
|
* - **_self**: the current tab.
|
|
12
12
|
* - **_blank**: opens in a new tab or window.
|
|
13
13
|
* - **_parent**: opens in the parent browsing context. If no parent, defaults to **_self**.
|
|
14
|
-
* - **_top**: opens in the highest browsing context ancestor. If no ancestors,
|
|
14
|
+
* - **_top**: opens in the highest browsing context ancestor. If no ancestors,
|
|
15
|
+
* defaults to **_self**.
|
|
15
16
|
*
|
|
16
17
|
* This property is passed to the underlying anchor (`<a>`) tag.
|
|
17
18
|
*
|
|
@@ -24,17 +25,22 @@ export type WebAnchorProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
target?: '_self' | '_blank' | '_parent' | '_top' | (string & object);
|
|
26
27
|
/**
|
|
27
|
-
* Specifies the relationship between the `href` and the current route.
|
|
28
|
+
* Specifies the relationship between the [`href`](#href) and the current route.
|
|
28
29
|
*
|
|
29
30
|
* Common values:
|
|
30
|
-
* - **nofollow**: Indicates to search engines that they should not follow the `href`.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* - **nofollow**: Indicates to search engines that they should not follow the `href`.
|
|
32
|
+
* This is often used for user-generated content or links that should not influence
|
|
33
|
+
* search engine rankings.
|
|
34
|
+
* - **noopener**: Suggests that the `href` should not have access to the opening
|
|
35
|
+
* window's `window.opener` object, which is a security measure to prevent potentially
|
|
36
|
+
* harmful behavior in cases of links that open new tabs or windows.
|
|
37
|
+
* - **noreferrer**: Requests that the browser does not send the `Referer` HTTP header
|
|
38
|
+
* when navigating to the `href`. This can enhance user privacy.
|
|
33
39
|
*
|
|
34
40
|
* The `rel` property is primarily used for informational and instructive purposes, helping browsers and web
|
|
35
|
-
* crawlers make better decisions about how to handle and interpret the links on a web
|
|
36
|
-
* to use appropriate `rel` values to ensure that links behave as intended and adhere
|
|
37
|
-
* development and SEO (Search Engine Optimization).
|
|
41
|
+
* crawlers make better decisions about how to handle and interpret the links on a web
|
|
42
|
+
* page. It is important to use appropriate `rel` values to ensure that links behave as intended and adhere
|
|
43
|
+
* to best practices for web development and SEO (Search Engine Optimization).
|
|
38
44
|
*
|
|
39
45
|
* This property is passed to the underlying anchor (`<a>`) tag.
|
|
40
46
|
*
|
|
@@ -45,12 +51,12 @@ export type WebAnchorProps = {
|
|
|
45
51
|
*/
|
|
46
52
|
rel?: string;
|
|
47
53
|
/**
|
|
48
|
-
* Specifies that the `href` should be downloaded when the user clicks on the
|
|
49
|
-
* instead of navigating to it. It is typically used for links that point to
|
|
50
|
-
* such as PDFs, images, documents,
|
|
54
|
+
* Specifies that the [`href`](#href) should be downloaded when the user clicks on the
|
|
55
|
+
* link, instead of navigating to it. It is typically used for links that point to
|
|
56
|
+
* files that the user should download, such as PDFs, images, documents, and more.
|
|
51
57
|
*
|
|
52
|
-
* The value of the `download` property, which represents the filename for the
|
|
53
|
-
* This property is passed to the underlying anchor (`<a>`) tag.
|
|
58
|
+
* The value of the `download` property, which represents the filename for the
|
|
59
|
+
* downloaded file. This property is passed to the underlying anchor (`<a>`) tag.
|
|
54
60
|
*
|
|
55
61
|
* @example
|
|
56
62
|
* ```jsx
|
|
@@ -59,28 +65,115 @@ export type WebAnchorProps = {
|
|
|
59
65
|
*/
|
|
60
66
|
download?: string;
|
|
61
67
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
export interface LinkProps extends Omit<TextProps, 'href'>, WebAnchorProps {
|
|
69
|
+
/**
|
|
70
|
+
* The path of the route to navigate to. It can either be:
|
|
71
|
+
* - **string**: A full path like `/profile/settings` or a relative path like `../settings`.
|
|
72
|
+
* - **object**: An object with a `pathname` and optional `params`. The `pathname` can be
|
|
73
|
+
* a full path like `/profile/settings` or a relative path like `../settings`. The
|
|
74
|
+
* params can be an object of key-value pairs.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx Dynamic
|
|
78
|
+
* import { Link } from 'expo-router';
|
|
79
|
+
* import { View } from 'react-native';
|
|
80
|
+
*
|
|
81
|
+
* export default function Route() {
|
|
82
|
+
* return (
|
|
83
|
+
* <View>
|
|
84
|
+
* <Link href="/about">About</Link>
|
|
85
|
+
* <Link
|
|
86
|
+
* href={{
|
|
87
|
+
* pathname: '/user/[id]',
|
|
88
|
+
* params: { id: 'bacon' }
|
|
89
|
+
* }}>
|
|
90
|
+
* View user
|
|
91
|
+
* </Link>
|
|
92
|
+
* </View>
|
|
93
|
+
* );
|
|
94
|
+
*}
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
href: Href;
|
|
98
|
+
/**
|
|
99
|
+
* Used to customize the `Link` component. It will forward all props to the
|
|
100
|
+
* first child of the `Link`. Note that the child component must accept
|
|
101
|
+
* `onPress` or `onClick` props. The `href` and `role` are also
|
|
102
|
+
* passed to the child.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* import { Link } from 'expo-router';
|
|
107
|
+
* import { Pressable, Text } from 'react-native';
|
|
108
|
+
*
|
|
109
|
+
* export default function Route() {
|
|
110
|
+
* return (
|
|
111
|
+
* <View>
|
|
112
|
+
* <Link href="/home" asChild>
|
|
113
|
+
* <Pressable>
|
|
114
|
+
* <Text>Home</Text>
|
|
115
|
+
* </Pressable>
|
|
116
|
+
* </Link>
|
|
117
|
+
* </View>
|
|
118
|
+
* );
|
|
119
|
+
*}
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
69
122
|
asChild?: boolean;
|
|
70
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Removes the current route from the history and replace it with the
|
|
125
|
+
* specified URL. This is useful for [redirects](/router/reference/redirects/).
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
*```tsx
|
|
129
|
+
* import { Link } from 'expo-router';
|
|
130
|
+
* import { View } from 'react-native';
|
|
131
|
+
*
|
|
132
|
+
* export default function Route() {
|
|
133
|
+
* return (
|
|
134
|
+
* <View>
|
|
135
|
+
* <Link replace href="/feed">Login</Link>
|
|
136
|
+
* </View>
|
|
137
|
+
* );
|
|
138
|
+
*}
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
71
141
|
replace?: boolean;
|
|
72
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Always pushes a new route, and never pops or replaces to existing route.
|
|
144
|
+
* You can push the current route multiple times or with new parameters.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
*```tsx
|
|
148
|
+
* import { Link } from 'expo-router';
|
|
149
|
+
* import { View } from 'react-native';
|
|
150
|
+
*
|
|
151
|
+
* export default function Route() {
|
|
152
|
+
* return (
|
|
153
|
+
* <View>
|
|
154
|
+
* <Link push href="/feed">Login</Link>
|
|
155
|
+
* </View>
|
|
156
|
+
* );
|
|
157
|
+
*}
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
73
160
|
push?: boolean;
|
|
74
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* On native, this can be used with CSS interop tools like Nativewind.
|
|
163
|
+
* On web, this sets the HTML `class` directly.
|
|
164
|
+
*/
|
|
75
165
|
className?: string;
|
|
76
166
|
onPress?: (e: MouseEvent<HTMLAnchorElement> | GestureResponderEvent) => void;
|
|
77
167
|
/**
|
|
78
|
-
* Relative URL references are either relative to the directory or the document.
|
|
168
|
+
* Relative URL references are either relative to the directory or the document.
|
|
169
|
+
* By default, relative paths are relative to the document.
|
|
79
170
|
*
|
|
80
|
-
* @see [Resolving relative references in Mozilla's documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references)
|
|
171
|
+
* @see [Resolving relative references in Mozilla's documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references).
|
|
81
172
|
*/
|
|
82
173
|
relativeToDirectory?: boolean;
|
|
83
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Replaces the initial screen with the current route.
|
|
176
|
+
*/
|
|
84
177
|
withAnchor?: boolean;
|
|
85
178
|
}
|
|
86
179
|
export declare function useInteropClassName(props: {
|
|
@@ -90,7 +183,7 @@ export declare function useInteropClassName(props: {
|
|
|
90
183
|
$$css: boolean;
|
|
91
184
|
__routerLinkClassName: string;
|
|
92
185
|
})[] | null | undefined;
|
|
93
|
-
export declare const useHrefAttrs: (props: Partial<LinkProps
|
|
186
|
+
export declare const useHrefAttrs: (props: Partial<LinkProps>) => {
|
|
94
187
|
hrefAttrs?: any;
|
|
95
|
-
} & Partial<LinkProps
|
|
188
|
+
} & Partial<LinkProps>;
|
|
96
189
|
//# sourceMappingURL=useLinkHooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkHooks.d.ts","sourceRoot":"","sources":["../../src/link/useLinkHooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B
|
|
1
|
+
{"version":3,"file":"useLinkHooks.d.ts","sourceRoot":"","sources":["../../src/link/useLinkHooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,UAAU,EAAE,MAAM,OAAO,CAAC;AAC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M,YAAY,UACf,QAAQ,SAAS,CAAC,KAAK;IAAE,SAAS,CAAC,EAAE,GAAG,CAAA;CAAE,GAAG,QAAQ,SAAS,CAoBtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkHooks.js","sourceRoot":"","sources":["../../src/link/useLinkHooks.ts"],"names":[],"mappings":";;;AAAA,wFAAwF;AACxF,mCAAmC;AACnC,iCAA4C;AAC5C,+CAA0E;
|
|
1
|
+
{"version":3,"file":"useLinkHooks.js","sourceRoot":"","sources":["../../src/link/useLinkHooks.ts"],"names":[],"mappings":";;;AAAA,wFAAwF;AACxF,mCAAmC;AACnC,iCAA4C;AAC5C,+CAA0E;AAgM1E,qDAAqD;AACrD,SAAgB,mBAAmB,CAAC,KAAyD;IAC3F,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,KAAK,CAAC,KAAK,CAAC;KACpB;IAED,sDAAsD;IACtD,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,EAAE;YAC3B,OAAO,KAAK,CAAC,KAAK,CAAC;SACpB;QACD,MAAM,QAAQ,GAAG;YACf,KAAK,EAAE,IAAI;YACX,qBAAqB,EAAE,KAAK,CAAC,SAAS;SACvC,CAAC;QAEF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC9B,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;SACnC;QACD,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACrC,CAAC;AApBD,kDAoBC;AAEY,QAAA,YAAY,GAAG,uBAAQ,CAAC,MAAM,CAEzC;IACA,GAAG,EAAE,SAAS,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAsB;QAC/E,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;YAClB,MAAM,SAAS,GAAG;gBAChB,GAAG;gBACH,MAAM;gBACN,QAAQ;aACT,CAAC;YACF,IAAI,OAAO,EAAE;gBACX,OAAO,SAAS,CAAC;aAClB;YACD,OAAO;gBACL,SAAS;aACV,CAAC;QACJ,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,SAAS,YAAY;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC","sourcesContent":["// Fork of @react-navigation/native Link.tsx with `href` and `replace` support added and\n// `to` / `action` support removed.\nimport { useMemo, MouseEvent } from 'react';\nimport { TextProps, GestureResponderEvent, Platform } from 'react-native';\n\nimport { Href } from '../types';\n\n// docsMissing\n/**\n * @platform web\n */\nexport type WebAnchorProps = {\n /**\n * Specifies where to open the [`href`](#href).\n *\n * - **_self**: the current tab.\n * - **_blank**: opens in a new tab or window.\n * - **_parent**: opens in the parent browsing context. If no parent, defaults to **_self**.\n * - **_top**: opens in the highest browsing context ancestor. If no ancestors,\n * defaults to **_self**.\n *\n * This property is passed to the underlying anchor (`<a>`) tag.\n *\n * @default '_self'\n *\n * @example\n * ```jsx\n * <Link href=\"https://expo.dev\" target=\"_blank\">Go to Expo in new tab</Link>\n * ```\n */\n target?: '_self' | '_blank' | '_parent' | '_top' | (string & object);\n\n /**\n * Specifies the relationship between the [`href`](#href) and the current route.\n *\n * Common values:\n * - **nofollow**: Indicates to search engines that they should not follow the `href`.\n * This is often used for user-generated content or links that should not influence\n * search engine rankings.\n * - **noopener**: Suggests that the `href` should not have access to the opening\n * window's `window.opener` object, which is a security measure to prevent potentially\n * harmful behavior in cases of links that open new tabs or windows.\n * - **noreferrer**: Requests that the browser does not send the `Referer` HTTP header\n * when navigating to the `href`. This can enhance user privacy.\n *\n * The `rel` property is primarily used for informational and instructive purposes, helping browsers and web\n * crawlers make better decisions about how to handle and interpret the links on a web\n * page. It is important to use appropriate `rel` values to ensure that links behave as intended and adhere\n * to best practices for web development and SEO (Search Engine Optimization).\n *\n * This property is passed to the underlying anchor (`<a>`) tag.\n *\n * @example\n * ```jsx\n * <Link href=\"https://expo.dev\" rel=\"nofollow\">Go to Expo</Link>`\n * ```\n */\n rel?: string;\n\n /**\n * Specifies that the [`href`](#href) should be downloaded when the user clicks on the\n * link, instead of navigating to it. It is typically used for links that point to\n * files that the user should download, such as PDFs, images, documents, and more.\n *\n * The value of the `download` property, which represents the filename for the\n * downloaded file. This property is passed to the underlying anchor (`<a>`) tag.\n *\n * @example\n * ```jsx\n * <Link href=\"/image.jpg\" download=\"my-image.jpg\">Download image</Link>\n * ```\n */\n download?: string;\n};\n\n// @docsMissing\nexport interface LinkProps extends Omit<TextProps, 'href'>, WebAnchorProps {\n /**\n * The path of the route to navigate to. It can either be:\n * - **string**: A full path like `/profile/settings` or a relative path like `../settings`.\n * - **object**: An object with a `pathname` and optional `params`. The `pathname` can be\n * a full path like `/profile/settings` or a relative path like `../settings`. The\n * params can be an object of key-value pairs.\n *\n * @example\n * ```tsx Dynamic\n * import { Link } from 'expo-router';\n * import { View } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link href=\"/about\">About</Link>\n * <Link\n * href={{\n * pathname: '/user/[id]',\n * params: { id: 'bacon' }\n * }}>\n * View user\n * </Link>\n * </View>\n * );\n *}\n * ```\n */\n href: Href;\n\n // TODO(EvanBacon): This may need to be extracted for React Native style support.\n /**\n * Used to customize the `Link` component. It will forward all props to the\n * first child of the `Link`. Note that the child component must accept\n * `onPress` or `onClick` props. The `href` and `role` are also\n * passed to the child.\n *\n * @example\n * ```tsx\n * import { Link } from 'expo-router';\n * import { Pressable, Text } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link href=\"/home\" asChild>\n * <Pressable>\n * <Text>Home</Text>\n * </Pressable>\n * </Link>\n * </View>\n * );\n *}\n * ```\n */\n asChild?: boolean;\n\n /**\n * Removes the current route from the history and replace it with the\n * specified URL. This is useful for [redirects](/router/reference/redirects/).\n *\n * @example\n *```tsx\n * import { Link } from 'expo-router';\n * import { View } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link replace href=\"/feed\">Login</Link>\n * </View>\n * );\n *}\n * ```\n */\n replace?: boolean;\n /**\n * Always pushes a new route, and never pops or replaces to existing route.\n * You can push the current route multiple times or with new parameters.\n *\n * @example\n *```tsx\n * import { Link } from 'expo-router';\n * import { View } from 'react-native';\n *\n * export default function Route() {\n * return (\n * <View>\n * <Link push href=\"/feed\">Login</Link>\n * </View>\n * );\n *}\n * ```\n */\n push?: boolean;\n\n /**\n * On native, this can be used with CSS interop tools like Nativewind.\n * On web, this sets the HTML `class` directly.\n */\n className?: string;\n\n onPress?: (e: MouseEvent<HTMLAnchorElement> | GestureResponderEvent) => void;\n\n /**\n * Relative URL references are either relative to the directory or the document.\n * By default, relative paths are relative to the document.\n *\n * @see [Resolving relative references in Mozilla's documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references).\n */\n relativeToDirectory?: boolean;\n\n /**\n * Replaces the initial screen with the current route.\n */\n withAnchor?: boolean;\n}\n\n// Mutate the style prop to add the className on web.\nexport function useInteropClassName(props: { style?: TextProps['style']; className?: string }) {\n if (Platform.OS !== 'web') {\n return props.style;\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMemo(() => {\n if (props.className == null) {\n return props.style;\n }\n const cssStyle = {\n $$css: true,\n __routerLinkClassName: props.className,\n };\n\n if (Array.isArray(props.style)) {\n return [...props.style, cssStyle];\n }\n return [props.style, cssStyle];\n }, [props.style, props.className]);\n}\n\nexport const useHrefAttrs = Platform.select<\n (props: Partial<LinkProps>) => { hrefAttrs?: any } & Partial<LinkProps>\n>({\n web: function useHrefAttrs({ asChild, rel, target, download }: Partial<LinkProps>) {\n return useMemo(() => {\n const hrefAttrs = {\n rel,\n target,\n download,\n };\n if (asChild) {\n return hrefAttrs;\n }\n return {\n hrefAttrs,\n };\n }, [asChild, rel, target, download]);\n },\n default: function useHrefAttrs() {\n return {};\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,wBAAgB,QAAQ,sBAgEvB"}
|
|
@@ -10,22 +10,6 @@ const react_native_safe_area_context_1 = require("react-native-safe-area-context
|
|
|
10
10
|
const createEntryFile_1 = require("./createEntryFile");
|
|
11
11
|
const exports_1 = require("../exports");
|
|
12
12
|
const Pressable_1 = require("../views/Pressable");
|
|
13
|
-
// TODO: Use openLinkFromBrowser thing
|
|
14
|
-
function Header() {
|
|
15
|
-
return (<Pressable_1.Pressable>
|
|
16
|
-
{({ hovered }) => (<react_native_1.Text role="heading" aria-level={1} style={[styles.title, react_native_1.Platform.OS !== 'web' && { textAlign: 'left' }]}>
|
|
17
|
-
Welcome to{' '}
|
|
18
|
-
<exports_1.Link href="https://github.com/expo/expo-router/" style={[
|
|
19
|
-
hovered && {
|
|
20
|
-
textDecorationColor: 'white',
|
|
21
|
-
textDecorationLine: 'underline',
|
|
22
|
-
},
|
|
23
|
-
]}>
|
|
24
|
-
Expo
|
|
25
|
-
</exports_1.Link>
|
|
26
|
-
</react_native_1.Text>)}
|
|
27
|
-
</Pressable_1.Pressable>);
|
|
28
|
-
}
|
|
29
13
|
const canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;
|
|
30
14
|
function Tutorial() {
|
|
31
15
|
react_1.default.useEffect(() => {
|
|
@@ -39,24 +23,50 @@ function Tutorial() {
|
|
|
39
23
|
location.replace('/');
|
|
40
24
|
}
|
|
41
25
|
if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {
|
|
42
|
-
window.document.title = '
|
|
26
|
+
window.document.title = 'Welcome to Expo';
|
|
43
27
|
}
|
|
44
28
|
}
|
|
45
29
|
}, []);
|
|
46
|
-
return (<
|
|
30
|
+
return (<react_native_safe_area_context_1.SafeAreaView style={styles.background}>
|
|
47
31
|
<react_native_1.StatusBar barStyle="light-content"/>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<Header />
|
|
52
|
-
<react_native_1.Text role="heading" aria-level={2} style={styles.subtitle}>
|
|
53
|
-
Start by creating a file{'\n'}in the{' '}
|
|
54
|
-
<react_native_1.Text style={{ fontWeight: 'bold' }}>{getRootDir()}</react_native_1.Text> directory.
|
|
55
|
-
</react_native_1.Text>
|
|
56
|
-
{canAutoTouchFile && <Button />}
|
|
32
|
+
<react_native_1.View style={styles.container}>
|
|
33
|
+
<react_native_1.View style={styles.logotypeWrapper}>
|
|
34
|
+
<react_native_1.Image style={styles.logotype} source={require('expo-router/assets/logotype.png')}/>
|
|
57
35
|
</react_native_1.View>
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
<react_native_1.Text role="heading" aria-level={1} style={styles.title}>
|
|
37
|
+
Welcome to Expo
|
|
38
|
+
</react_native_1.Text>
|
|
39
|
+
<react_native_1.Text role="heading" aria-level={2} style={[styles.subtitle, styles.textSecondary]}>
|
|
40
|
+
Start by creating a file{react_native_1.Platform.OS !== 'web' ? '\n' : ' '}in the{' '}
|
|
41
|
+
<react_native_1.Text style={{ fontWeight: '600' }}>{getRootDir()}</react_native_1.Text> directory.
|
|
42
|
+
</react_native_1.Text>
|
|
43
|
+
<react_native_1.Text>
|
|
44
|
+
<exports_1.Link href="https://docs.expo.dev/router/introduction/" {...react_native_1.Platform.select({ web: { target: '_blank' }, native: { asChild: true } })}>
|
|
45
|
+
<Pressable_1.Pressable>
|
|
46
|
+
{({ hovered, pressed }) => (<react_native_1.Text style={[
|
|
47
|
+
styles.link,
|
|
48
|
+
react_native_1.Platform.select({
|
|
49
|
+
web: {
|
|
50
|
+
transitionDuration: '200ms',
|
|
51
|
+
marginBottom: 12,
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
hovered && {
|
|
55
|
+
opacity: 0.8,
|
|
56
|
+
textDecorationLine: 'underline',
|
|
57
|
+
},
|
|
58
|
+
pressed && {
|
|
59
|
+
opacity: 0.8,
|
|
60
|
+
},
|
|
61
|
+
]}>
|
|
62
|
+
Learn more about Expo Router in the documentation.
|
|
63
|
+
</react_native_1.Text>)}
|
|
64
|
+
</Pressable_1.Pressable>
|
|
65
|
+
</exports_1.Link>
|
|
66
|
+
</react_native_1.Text>
|
|
67
|
+
{canAutoTouchFile && <Button />}
|
|
68
|
+
</react_native_1.View>
|
|
69
|
+
</react_native_safe_area_context_1.SafeAreaView>);
|
|
60
70
|
}
|
|
61
71
|
exports.Tutorial = Tutorial;
|
|
62
72
|
function getRootDir() {
|
|
@@ -72,111 +82,155 @@ function getRootDir() {
|
|
|
72
82
|
function Button() {
|
|
73
83
|
return (<Pressable_1.Pressable onPress={() => {
|
|
74
84
|
(0, createEntryFile_1.createEntryFileAsync)();
|
|
75
|
-
}} style={
|
|
76
|
-
...react_native_1.Platform.select({
|
|
77
|
-
web: {
|
|
78
|
-
// subtle white shadow
|
|
79
|
-
boxShadow: 'rgba(255, 255, 255, 0.15) 0px 0px 20px 5px',
|
|
80
|
-
},
|
|
81
|
-
native: {
|
|
82
|
-
position: 'absolute',
|
|
83
|
-
bottom: 24,
|
|
84
|
-
left: 24,
|
|
85
|
-
right: 24,
|
|
86
|
-
overflow: 'hidden',
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
}}>
|
|
85
|
+
}} style={styles.button}>
|
|
90
86
|
{({ pressed, hovered }) => (<react_native_1.View style={[
|
|
91
87
|
styles.buttonContainer,
|
|
92
88
|
hovered && {
|
|
93
|
-
backgroundColor: '
|
|
94
|
-
},
|
|
95
|
-
pressed && {
|
|
96
|
-
backgroundColor: 'rgba(255,255,255,0.7)',
|
|
89
|
+
backgroundColor: '#fff',
|
|
97
90
|
},
|
|
91
|
+
pressed &&
|
|
92
|
+
react_native_1.Platform.select({
|
|
93
|
+
web: {
|
|
94
|
+
transform: 'scale(0.98)',
|
|
95
|
+
transitionDuration: '200ms',
|
|
96
|
+
},
|
|
97
|
+
default: {
|
|
98
|
+
backgroundColor: '#fff',
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
]}>
|
|
102
|
+
<react_native_1.Text style={[
|
|
103
|
+
styles.code,
|
|
104
|
+
hovered && { color: '#000' },
|
|
105
|
+
pressed &&
|
|
106
|
+
react_native_1.Platform.select({
|
|
107
|
+
native: { color: '#000' },
|
|
108
|
+
}),
|
|
98
109
|
]}>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/index.js
|
|
110
|
+
<react_native_1.Text style={styles.textSecondary}>$</react_native_1.Text> touch {getRootDir()}
|
|
111
|
+
/index.tsx
|
|
102
112
|
</react_native_1.Text>
|
|
103
113
|
</react_native_1.View>)}
|
|
104
114
|
</Pressable_1.Pressable>);
|
|
105
115
|
}
|
|
106
116
|
const styles = react_native_1.StyleSheet.create({
|
|
107
117
|
background: {
|
|
108
|
-
|
|
109
|
-
web: {
|
|
110
|
-
backgroundImage: 'radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)',
|
|
111
|
-
backgroundPositionX: -3,
|
|
112
|
-
backgroundPositionY: -3,
|
|
113
|
-
backgroundSize: '40px 40px',
|
|
114
|
-
},
|
|
115
|
-
}),
|
|
116
|
-
backgroundColor: 'black',
|
|
118
|
+
backgroundColor: '#000',
|
|
117
119
|
flex: 1,
|
|
118
120
|
},
|
|
119
|
-
safeArea: {
|
|
120
|
-
flex: 1,
|
|
121
|
-
maxWidth: 960,
|
|
122
|
-
marginHorizontal: 'auto',
|
|
123
|
-
alignItems: 'stretch',
|
|
124
|
-
},
|
|
125
121
|
container: {
|
|
126
122
|
flex: 1,
|
|
127
123
|
padding: 24,
|
|
128
|
-
|
|
124
|
+
paddingBottom: 64,
|
|
125
|
+
alignItems: 'center',
|
|
129
126
|
justifyContent: 'center',
|
|
127
|
+
marginHorizontal: 'auto',
|
|
128
|
+
gap: 16,
|
|
129
|
+
...react_native_1.Platform.select({
|
|
130
|
+
web: {
|
|
131
|
+
maxWidth: 960,
|
|
132
|
+
},
|
|
133
|
+
native: {
|
|
134
|
+
width: '100%',
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
logotypeWrapper: {
|
|
139
|
+
alignItems: 'center',
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
backgroundColor: '#151718',
|
|
142
|
+
borderRadius: 12,
|
|
143
|
+
borderWidth: 1,
|
|
144
|
+
borderStyle: 'solid',
|
|
145
|
+
borderColor: '#313538',
|
|
146
|
+
width: 78,
|
|
147
|
+
height: 78,
|
|
148
|
+
marginBottom: 8,
|
|
149
|
+
},
|
|
150
|
+
logotype: {
|
|
151
|
+
width: 48,
|
|
152
|
+
height: 44,
|
|
130
153
|
},
|
|
131
154
|
title: {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
...react_native_1.Platform.select({
|
|
156
|
+
web: {
|
|
157
|
+
fontSize: 64,
|
|
158
|
+
lineHeight: 68,
|
|
159
|
+
},
|
|
160
|
+
default: {
|
|
161
|
+
fontSize: 56,
|
|
162
|
+
lineHeight: 60,
|
|
163
|
+
},
|
|
164
|
+
}),
|
|
165
|
+
color: '#fff',
|
|
166
|
+
fontWeight: '800',
|
|
167
|
+
textAlign: 'center',
|
|
136
168
|
},
|
|
137
169
|
buttonContainer: {
|
|
138
170
|
...react_native_1.Platform.select({
|
|
139
171
|
web: {
|
|
140
172
|
transitionDuration: '200ms',
|
|
141
|
-
backgroundColor: 'transparent',
|
|
142
|
-
},
|
|
143
|
-
default: {
|
|
144
|
-
backgroundColor: 'white',
|
|
145
173
|
},
|
|
146
174
|
}),
|
|
147
|
-
|
|
175
|
+
backgroundColor: 'transparent',
|
|
176
|
+
borderColor: '#fff',
|
|
148
177
|
borderWidth: 2,
|
|
149
178
|
paddingVertical: 12,
|
|
150
179
|
paddingHorizontal: 24,
|
|
180
|
+
borderRadius: 8,
|
|
151
181
|
},
|
|
152
|
-
|
|
153
|
-
|
|
182
|
+
button: {
|
|
183
|
+
...react_native_1.Platform.select({
|
|
184
|
+
web: {
|
|
185
|
+
marginTop: 12,
|
|
186
|
+
},
|
|
187
|
+
native: {
|
|
188
|
+
position: 'absolute',
|
|
189
|
+
bottom: 24,
|
|
190
|
+
left: 32,
|
|
191
|
+
right: 32,
|
|
192
|
+
overflow: 'hidden',
|
|
193
|
+
},
|
|
194
|
+
}),
|
|
154
195
|
},
|
|
155
196
|
code: {
|
|
156
197
|
...react_native_1.Platform.select({
|
|
157
198
|
web: {
|
|
158
199
|
transitionDuration: '200ms',
|
|
159
|
-
|
|
160
|
-
fontFamily: 'Courier',
|
|
200
|
+
fontFamily: 'Courier, monospace',
|
|
161
201
|
},
|
|
162
202
|
default: {
|
|
163
|
-
color: 'black',
|
|
164
203
|
fontFamily: react_native_1.Platform.select({
|
|
165
204
|
ios: 'Courier New',
|
|
166
205
|
android: 'monospace',
|
|
167
206
|
}),
|
|
168
207
|
},
|
|
169
208
|
}),
|
|
209
|
+
color: '#fff',
|
|
210
|
+
textAlign: 'center',
|
|
170
211
|
userSelect: 'none',
|
|
171
212
|
fontSize: 18,
|
|
172
213
|
fontWeight: 'bold',
|
|
173
214
|
},
|
|
174
215
|
subtitle: {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
216
|
+
fontSize: 34,
|
|
217
|
+
fontWeight: '200',
|
|
218
|
+
textAlign: 'center',
|
|
219
|
+
},
|
|
220
|
+
link: {
|
|
221
|
+
fontSize: 20,
|
|
222
|
+
lineHeight: 26,
|
|
223
|
+
textAlign: 'center',
|
|
224
|
+
color: '#52a9ff',
|
|
225
|
+
marginTop: 12,
|
|
226
|
+
...react_native_1.Platform.select({
|
|
227
|
+
web: {
|
|
228
|
+
marginBottom: 24,
|
|
229
|
+
},
|
|
230
|
+
}),
|
|
231
|
+
},
|
|
232
|
+
textSecondary: {
|
|
233
|
+
color: '#9ba1a6',
|
|
180
234
|
},
|
|
181
235
|
});
|
|
182
236
|
//# sourceMappingURL=Tutorial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAA2E;AAC3E,mFAA8D;AAE9D,uDAAyD;AACzD,wCAAkC;AAClC,kDAA+C;AAE/C,sCAAsC;AACtC,SAAS,MAAM;IACb,OAAO,CACL,CAAC,qBAAS,CACR;MAAA,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChB,CAAC,mBAAI,CACH,IAAI,CAAC,SAAS,CACd,UAAU,CAAC,CAAC,CAAC,CAAC,CACd,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CACtE;oBAAU,CAAC,GAAG,CACd;UAAA,CAAC,cAAI,CACH,IAAI,CAAC,sCAAsC,CAC3C,KAAK,CAAC,CAAC;gBACL,OAAO,IAAI;oBACT,mBAAmB,EAAE,OAAO;oBAC5B,kBAAkB,EAAE,WAAW;iBAChC;aACF,CAAC,CACF;;UACF,EAAE,cAAI,CACR;QAAA,EAAE,mBAAI,CAAC,CACR,CACH;IAAA,EAAE,qBAAS,CAAC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,o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;QACd,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;KACtB;IACD,UAAU,EAAE;QACV,KAAK,EAAE,OAAO;KACf;IACD,IAAI,EAAE;QACJ,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;gBAC3B,KAAK,EAAE,OAAO;gBACd,UAAU,EAAE,SAAS;aACtB;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO;gBACd,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;oBAC1B,GAAG,EAAE,aAAa;oBAClB,OAAO,EAAE,WAAW;iBACrB,CAAC;aACH;SACF,CAAC;QAEF,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,GAAG;KACd;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StatusBar, StyleSheet, Text, View } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { createEntryFileAsync } from './createEntryFile';\nimport { Link } from '../exports';\nimport { Pressable } from '../views/Pressable';\n\n// TODO: Use openLinkFromBrowser thing\nfunction Header() {\n return (\n <Pressable>\n {({ hovered }) => (\n <Text\n role=\"heading\"\n aria-level={1}\n style={[styles.title, Platform.OS !== 'web' && { textAlign: 'left' }]}>\n Welcome to{' '}\n <Link\n href=\"https://github.com/expo/expo-router/\"\n style={[\n hovered && {\n textDecorationColor: 'white',\n textDecorationLine: 'underline',\n },\n ]}>\n Expo\n </Link>\n </Text>\n )}\n </Pressable>\n );\n}\n\nconst canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;\n\nexport function Tutorial() {\n React.useEffect(() => {\n if (Platform.OS === 'web') {\n // Reset the route on web so the initial route isn't a 404 after\n // the user has created the entry file.\n // This is useful for cases where you are testing the tutorial.\n // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.\n // you should see the tutorial again and be able to create the entry file once more.\n if (typeof location !== 'undefined' && location.pathname !== '/') {\n location.replace('/');\n }\n if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {\n window.document.title = 'npx expo start';\n }\n }\n }, []);\n\n return (\n <View style={styles.background}>\n <StatusBar barStyle=\"light-content\" />\n\n <SafeAreaView style={styles.safeArea}>\n <View style={styles.container}>\n <Header />\n <Text role=\"heading\" aria-level={2} style={styles.subtitle}>\n Start by creating a file{'\\n'}in the{' '}\n <Text style={{ fontWeight: 'bold' }}>{getRootDir()}</Text> directory.\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n </View>\n );\n}\n\nfunction getRootDir() {\n const dir = process.env.EXPO_ROUTER_ABS_APP_ROOT!;\n if (dir.match(/\\/src\\/app$/)) {\n return 'src/app';\n } else if (dir.match(/\\/app$/)) {\n return 'app';\n }\n return dir.split('/').pop() ?? dir;\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={{\n ...Platform.select({\n web: {\n // subtle white shadow\n boxShadow: 'rgba(255, 255, 255, 0.15) 0px 0px 20px 5px',\n },\n native: {\n position: 'absolute',\n bottom: 24,\n left: 24,\n right: 24,\n overflow: 'hidden',\n },\n }),\n }}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.buttonContainer,\n hovered && {\n backgroundColor: 'white',\n },\n pressed && {\n backgroundColor: 'rgba(255,255,255,0.7)',\n },\n ]}>\n <Text style={[styles.code, hovered && { color: 'black' }]}>\n <Text style={{ color: '#BCC3CD' }}>$</Text> touch {getRootDir()}\n /index.js\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n background: {\n ...Platform.select({\n web: {\n backgroundImage:\n 'radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)',\n backgroundPositionX: -3,\n backgroundPositionY: -3,\n backgroundSize: '40px 40px',\n },\n }),\n backgroundColor: 'black',\n flex: 1,\n },\n safeArea: {\n flex: 1,\n maxWidth: 960,\n marginHorizontal: 'auto',\n alignItems: 'stretch',\n },\n container: {\n flex: 1,\n padding: 24,\n alignItems: 'flex-start',\n justifyContent: 'center',\n },\n title: {\n color: 'white',\n fontSize: 64,\n paddingBottom: 24,\n fontWeight: 'bold',\n },\n buttonContainer: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n backgroundColor: 'transparent',\n },\n default: {\n backgroundColor: 'white',\n },\n }),\n\n borderColor: 'white',\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n },\n buttonText: {\n color: 'black',\n },\n code: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n color: 'white',\n fontFamily: 'Courier',\n },\n default: {\n color: 'black',\n fontFamily: Platform.select({\n ios: 'Courier New',\n android: 'monospace',\n }),\n },\n }),\n\n userSelect: 'none',\n fontSize: 18,\n fontWeight: 'bold',\n },\n subtitle: {\n color: '#BCC3CD',\n fontSize: 36,\n fontWeight: '100',\n paddingBottom: 36,\n maxWidth: 960,\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAkF;AAClF,mFAA8D;AAE9D,uDAAyD;AACzD,wCAAkC;AAClC,kDAA+C;AAE/C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAElE,SAAgB,QAAQ;IACtB,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;YACzB,gEAAgE;YAChE,uCAAuC;YACvC,+DAA+D;YAC/D,uGAAuG;YACvG,oFAAoF;YACpF,IAAI,OAAO,QAAQ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;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,MAAM,EAAE;QACN,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,SAAS,EAAE,EAAE;aACd;YACD,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAC;KACH;IACD,IAAI,EAAE;QACJ,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;gBAC3B,UAAU,EAAE,oBAAoB;aACjC;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;oBAC1B,GAAG,EAAE,aAAa;oBAClB,OAAO,EAAE,WAAW;iBACrB,CAAC;aACH;SACF,CAAC;QACF,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,EAAE;QACb,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,YAAY,EAAE,EAAE;aACjB;SACF,CAAC;KACH;IACD,aAAa,EAAE;QACb,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StatusBar, StyleSheet, Text, View, Image } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { createEntryFileAsync } from './createEntryFile';\nimport { Link } from '../exports';\nimport { Pressable } from '../views/Pressable';\n\nconst canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;\n\nexport function Tutorial() {\n React.useEffect(() => {\n if (Platform.OS === 'web') {\n // Reset the route on web so the initial route isn't a 404 after\n // the user has created the entry file.\n // This is useful for cases where you are testing the tutorial.\n // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.\n // you should see the tutorial again and be able to create the entry file once more.\n if (typeof location !== 'undefined' && location.pathname !== '/') {\n location.replace('/');\n }\n if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {\n window.document.title = 'Welcome to Expo';\n }\n }\n }, []);\n\n return (\n <SafeAreaView style={styles.background}>\n <StatusBar barStyle=\"light-content\" />\n <View style={styles.container}>\n <View style={styles.logotypeWrapper}>\n <Image style={styles.logotype} source={require('expo-router/assets/logotype.png')} />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Welcome to Expo\n </Text>\n <Text role=\"heading\" aria-level={2} style={[styles.subtitle, styles.textSecondary]}>\n Start by creating a file{Platform.OS !== 'web' ? '\\n' : ' '}in the{' '}\n <Text style={{ fontWeight: '600' }}>{getRootDir()}</Text> directory.\n </Text>\n <Text>\n <Link\n href=\"https://docs.expo.dev/router/introduction/\"\n {...Platform.select({ web: { target: '_blank' }, native: { asChild: true } })}>\n <Pressable>\n {({ hovered, pressed }) => (\n <Text\n style={[\n styles.link,\n Platform.select({\n web: {\n transitionDuration: '200ms',\n marginBottom: 12,\n },\n }),\n hovered && {\n opacity: 0.8,\n textDecorationLine: 'underline',\n },\n pressed && {\n opacity: 0.8,\n },\n ]}>\n Learn more about Expo Router in the documentation.\n </Text>\n )}\n </Pressable>\n </Link>\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n );\n}\n\nfunction getRootDir() {\n const dir = process.env.EXPO_ROUTER_ABS_APP_ROOT!;\n if (dir.match(/\\/src\\/app$/)) {\n return 'src/app';\n } else if (dir.match(/\\/app$/)) {\n return 'app';\n }\n return dir.split('/').pop() ?? dir;\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={styles.button}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.buttonContainer,\n hovered && {\n backgroundColor: '#fff',\n },\n pressed &&\n Platform.select({\n web: {\n transform: 'scale(0.98)',\n transitionDuration: '200ms',\n },\n default: {\n backgroundColor: '#fff',\n },\n }),\n ]}>\n <Text\n style={[\n styles.code,\n hovered && { color: '#000' },\n pressed &&\n Platform.select({\n native: { color: '#000' },\n }),\n ]}>\n <Text style={styles.textSecondary}>$</Text> touch {getRootDir()}\n /index.tsx\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n background: {\n backgroundColor: '#000',\n flex: 1,\n },\n container: {\n flex: 1,\n padding: 24,\n paddingBottom: 64,\n alignItems: 'center',\n justifyContent: 'center',\n marginHorizontal: 'auto',\n gap: 16,\n ...Platform.select({\n web: {\n maxWidth: 960,\n },\n native: {\n width: '100%',\n },\n }),\n },\n logotypeWrapper: {\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#151718',\n borderRadius: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: '#313538',\n width: 78,\n height: 78,\n marginBottom: 8,\n },\n logotype: {\n width: 48,\n height: 44,\n },\n title: {\n ...Platform.select({\n web: {\n fontSize: 64,\n lineHeight: 68,\n },\n default: {\n fontSize: 56,\n lineHeight: 60,\n },\n }),\n color: '#fff',\n fontWeight: '800',\n textAlign: 'center',\n },\n buttonContainer: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n },\n }),\n backgroundColor: 'transparent',\n borderColor: '#fff',\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderRadius: 8,\n },\n button: {\n ...Platform.select({\n web: {\n marginTop: 12,\n },\n native: {\n position: 'absolute',\n bottom: 24,\n left: 32,\n right: 32,\n overflow: 'hidden',\n },\n }),\n },\n code: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n fontFamily: 'Courier, monospace',\n },\n default: {\n fontFamily: Platform.select({\n ios: 'Courier New',\n android: 'monospace',\n }),\n },\n }),\n color: '#fff',\n textAlign: 'center',\n userSelect: 'none',\n fontSize: 18,\n fontWeight: 'bold',\n },\n subtitle: {\n fontSize: 34,\n fontWeight: '200',\n textAlign: 'center',\n },\n link: {\n fontSize: 20,\n lineHeight: 26,\n textAlign: 'center',\n color: '#52a9ff',\n marginTop: 12,\n ...Platform.select({\n web: {\n marginBottom: 24,\n },\n }),\n },\n textSecondary: {\n color: '#9ba1a6',\n },\n});\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(() => {
|