expo-router 4.0.0-preview.13 → 4.0.0-preview.14
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/onboard/Tutorial.d.ts.map +1 -1
- package/build/onboard/Tutorial.js +140 -86
- package/build/onboard/Tutorial.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/package.json +7 -7
package/assets/error.png
CHANGED
|
Binary file
|
package/assets/file.png
CHANGED
|
Binary file
|
package/assets/forward.png
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/pkg.png
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -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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Y;QACxB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,MAAM;KACnB;IACD,eAAe,EAAE;QACf,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;gBAC3B,eAAe,EAAE,aAAa;aAC/B;YACD,OAAO,EAAE;gBACP,eAAe,EAAE,OAAO;aACzB;SACF,CAAC;QAEF,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,CAAC;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":[],"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,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":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,wBAAgB,aAAa,IAAI,4BAA4B,CAiC5D;AAED,wBAAgB,OAAO,sBAStB"}
|
package/build/views/Sitemap.js
CHANGED
|
@@ -15,11 +15,10 @@ const imperative_api_1 = require("../imperative-api");
|
|
|
15
15
|
const Link_1 = require("../link/Link");
|
|
16
16
|
const matchers_1 = require("../matchers");
|
|
17
17
|
const statusbar_1 = require("../utils/statusbar");
|
|
18
|
-
const INDENT =
|
|
18
|
+
const INDENT = 20;
|
|
19
19
|
function getNavOptions() {
|
|
20
20
|
return {
|
|
21
21
|
title: 'sitemap',
|
|
22
|
-
headerShown: false,
|
|
23
22
|
presentation: 'modal',
|
|
24
23
|
headerLargeTitle: false,
|
|
25
24
|
headerTitleStyle: {
|
|
@@ -34,40 +33,36 @@ function getNavOptions() {
|
|
|
34
33
|
// @ts-expect-error: mistyped
|
|
35
34
|
borderBottomColor: '#323232',
|
|
36
35
|
},
|
|
36
|
+
header: () => {
|
|
37
|
+
const WrapperElement = react_native_1.Platform.OS === 'android' ? react_native_safe_area_context_1.SafeAreaView : react_native_1.View;
|
|
38
|
+
return (<WrapperElement style={styles.header}>
|
|
39
|
+
<react_native_1.View style={styles.headerContent}>
|
|
40
|
+
<react_native_1.View style={styles.headerIcon}>
|
|
41
|
+
<SitemapIcon />
|
|
42
|
+
</react_native_1.View>
|
|
43
|
+
<react_native_1.Text role="heading" aria-level={1} style={styles.title}>
|
|
44
|
+
Sitemap
|
|
45
|
+
</react_native_1.Text>
|
|
46
|
+
</react_native_1.View>
|
|
47
|
+
</WrapperElement>);
|
|
48
|
+
},
|
|
37
49
|
};
|
|
38
50
|
}
|
|
39
51
|
exports.getNavOptions = getNavOptions;
|
|
40
52
|
function Sitemap() {
|
|
41
|
-
const { top, bottom } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
42
|
-
const { width } = (0, react_native_1.useWindowDimensions)();
|
|
43
53
|
return (<react_native_1.View style={styles.container}>
|
|
44
54
|
{!statusbar_1.hasViewControllerBasedStatusBarAppearance && <react_native_1.StatusBar barStyle="light-content"/>}
|
|
45
|
-
<react_native_1.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
minWidth: Math.min(960, width * 0.9),
|
|
49
|
-
},
|
|
50
|
-
]}>
|
|
51
|
-
<react_native_1.ScrollView contentContainerStyle={[
|
|
52
|
-
styles.scroll,
|
|
53
|
-
{
|
|
54
|
-
paddingTop: top + 12,
|
|
55
|
-
paddingBottom: bottom + 12,
|
|
56
|
-
},
|
|
57
|
-
]} style={{ flex: 1 }}>
|
|
58
|
-
<FileSystemView />
|
|
59
|
-
</react_native_1.ScrollView>
|
|
60
|
-
</react_native_1.View>
|
|
55
|
+
<react_native_1.ScrollView contentContainerStyle={styles.scroll}>
|
|
56
|
+
<FileSystemView />
|
|
57
|
+
</react_native_1.ScrollView>
|
|
61
58
|
</react_native_1.View>);
|
|
62
59
|
}
|
|
63
60
|
exports.Sitemap = Sitemap;
|
|
64
61
|
function FileSystemView() {
|
|
65
62
|
const routes = (0, router_store_1.useExpoRouter)().getSortedRoutes();
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</react_native_1.View>))}
|
|
70
|
-
</>);
|
|
63
|
+
return routes.map((route) => (<react_native_1.View key={route.contextKey} style={styles.itemContainer}>
|
|
64
|
+
<FileItem route={route}/>
|
|
65
|
+
</react_native_1.View>));
|
|
71
66
|
}
|
|
72
67
|
function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
|
|
73
68
|
const disabled = route.children.length > 0;
|
|
@@ -75,13 +70,13 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
|
|
|
75
70
|
const href = react_1.default.useMemo(() => {
|
|
76
71
|
return ('/' +
|
|
77
72
|
segments
|
|
78
|
-
.map((
|
|
73
|
+
.map((segment) => {
|
|
79
74
|
// add an extra layer of entropy to the url for deep dynamic routes
|
|
80
|
-
if ((0, matchers_1.matchDeepDynamicRouteName)(
|
|
81
|
-
return
|
|
75
|
+
if ((0, matchers_1.matchDeepDynamicRouteName)(segment)) {
|
|
76
|
+
return segment + '/' + Date.now();
|
|
82
77
|
}
|
|
83
78
|
// index must be erased but groups can be preserved.
|
|
84
|
-
return
|
|
79
|
+
return segment === 'index' ? '' : segment;
|
|
85
80
|
})
|
|
86
81
|
.filter(Boolean)
|
|
87
82
|
.join('/'));
|
|
@@ -92,10 +87,10 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
|
|
|
92
87
|
if (route.contextKey.match(/_layout\.[jt]sx?$/)) {
|
|
93
88
|
return segments[segments.length - 2] + '/' + segments[segments.length - 1];
|
|
94
89
|
}
|
|
95
|
-
const
|
|
90
|
+
const routeSegmentsCount = route.route.split('/').length;
|
|
96
91
|
// Join the segment count in reverse order
|
|
97
92
|
// This presents files without layout routes as children with all relevant segments.
|
|
98
|
-
return segments.slice(-
|
|
93
|
+
return segments.slice(-routeSegmentsCount).join('/');
|
|
99
94
|
}, [route]);
|
|
100
95
|
const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';
|
|
101
96
|
return (<>
|
|
@@ -104,17 +99,17 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
|
|
|
104
99
|
// Ensure the modal pops
|
|
105
100
|
imperative_api_1.router.back();
|
|
106
101
|
}
|
|
107
|
-
}}
|
|
102
|
+
}} disabled={disabled} asChild
|
|
108
103
|
// Ensure we replace the history so you can't go back to this page.
|
|
109
104
|
replace>
|
|
110
|
-
<Pressable_1.Pressable
|
|
105
|
+
<Pressable_1.Pressable>
|
|
111
106
|
{({ pressed, hovered }) => (<react_native_1.View style={[
|
|
112
107
|
styles.itemPressable,
|
|
113
108
|
{
|
|
114
109
|
paddingLeft: INDENT + level * INDENT,
|
|
115
|
-
backgroundColor: hovered ? '
|
|
110
|
+
backgroundColor: hovered ? '#202425' : 'transparent',
|
|
116
111
|
},
|
|
117
|
-
pressed && { backgroundColor: '#
|
|
112
|
+
pressed && { backgroundColor: '#26292b' },
|
|
118
113
|
disabled && { opacity: 0.4 },
|
|
119
114
|
]}>
|
|
120
115
|
<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
@@ -141,27 +136,70 @@ function PkgIcon() {
|
|
|
141
136
|
function ForwardIcon() {
|
|
142
137
|
return <react_native_1.Image style={styles.image} source={require('expo-router/assets/forward.png')}/>;
|
|
143
138
|
}
|
|
139
|
+
function SitemapIcon() {
|
|
140
|
+
return <react_native_1.Image style={styles.image} source={require('expo-router/assets/sitemap.png')}/>;
|
|
141
|
+
}
|
|
144
142
|
const styles = react_native_1.StyleSheet.create({
|
|
145
143
|
container: {
|
|
146
144
|
backgroundColor: 'black',
|
|
147
145
|
flex: 1,
|
|
148
146
|
alignItems: 'stretch',
|
|
149
147
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
header: {
|
|
149
|
+
backgroundColor: '#151718',
|
|
150
|
+
paddingVertical: 16,
|
|
151
|
+
borderBottomWidth: 1,
|
|
152
|
+
borderColor: '#313538',
|
|
153
|
+
shadowColor: '#000',
|
|
154
|
+
shadowOffset: {
|
|
155
|
+
width: 0,
|
|
156
|
+
height: 3,
|
|
157
|
+
},
|
|
158
|
+
shadowOpacity: 0.33,
|
|
159
|
+
shadowRadius: 3,
|
|
160
|
+
elevation: 8,
|
|
161
|
+
},
|
|
162
|
+
headerContent: {
|
|
163
|
+
flexDirection: 'row',
|
|
164
|
+
alignItems: 'center',
|
|
165
|
+
gap: 14,
|
|
166
|
+
paddingHorizontal: '5%',
|
|
167
|
+
...react_native_1.Platform.select({
|
|
168
|
+
web: {
|
|
169
|
+
width: '100%',
|
|
170
|
+
maxWidth: 960,
|
|
171
|
+
marginHorizontal: 'auto',
|
|
172
|
+
},
|
|
173
|
+
}),
|
|
174
|
+
},
|
|
175
|
+
title: {
|
|
176
|
+
color: 'white',
|
|
177
|
+
fontSize: 28,
|
|
178
|
+
fontWeight: 'bold',
|
|
154
179
|
},
|
|
155
180
|
scroll: {
|
|
156
|
-
paddingHorizontal:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
181
|
+
paddingHorizontal: '5%',
|
|
182
|
+
paddingVertical: 16,
|
|
183
|
+
...react_native_1.Platform.select({
|
|
184
|
+
ios: {
|
|
185
|
+
paddingBottom: 24,
|
|
186
|
+
},
|
|
187
|
+
web: {
|
|
188
|
+
width: '100%',
|
|
189
|
+
maxWidth: 960,
|
|
190
|
+
marginHorizontal: 'auto',
|
|
191
|
+
paddingBottom: 24,
|
|
192
|
+
},
|
|
193
|
+
default: {
|
|
194
|
+
paddingBottom: 12,
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
160
197
|
},
|
|
161
198
|
itemContainer: {
|
|
162
199
|
borderWidth: 1,
|
|
163
|
-
borderColor: '#
|
|
164
|
-
|
|
200
|
+
borderColor: '#313538',
|
|
201
|
+
backgroundColor: '#151718',
|
|
202
|
+
borderRadius: 12,
|
|
165
203
|
marginBottom: 12,
|
|
166
204
|
overflow: 'hidden',
|
|
167
205
|
},
|
|
@@ -179,6 +217,15 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
179
217
|
},
|
|
180
218
|
filename: { color: 'white', fontSize: 20, marginLeft: 12 },
|
|
181
219
|
virtual: { textAlign: 'right', color: 'white' },
|
|
182
|
-
image: { width: 24, height: 24, resizeMode: 'contain' },
|
|
220
|
+
image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },
|
|
221
|
+
headerIcon: {
|
|
222
|
+
width: 40,
|
|
223
|
+
height: 40,
|
|
224
|
+
backgroundColor: '#202425',
|
|
225
|
+
borderRadius: 8,
|
|
226
|
+
flexDirection: 'row',
|
|
227
|
+
alignItems: 'center',
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
},
|
|
183
230
|
});
|
|
184
231
|
//# sourceMappingURL=Sitemap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;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OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\nimport { hasViewControllerBasedStatusBarAppearance } from '../utils/statusbar';\n\nconst INDENT = 24;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n headerShown: false,\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n {!hasViewControllerBasedStatusBarAppearance && <StatusBar barStyle=\"light-content\" />}\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}>\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}>\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === 'index' ? '' : v;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const segmentCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n style={{ flex: 1, display: 'flex' }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable style={{ flex: 1 }}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? 'rgba(255,255,255,0.1)' : 'transparent',\n },\n pressed && { backgroundColor: '#323232' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n main: {\n marginHorizontal: 'auto',\n flex: 1,\n\n alignItems: 'stretch',\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: 'stretch',\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#323232',\n borderRadius: 19,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain' },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;AAGb,kDAA0B;AAC1B,+CAA8F;AAC9F,mFAA8D;AAE9D,2CAAwC;AAExC,+DAA6D;AAC7D,sDAA2C;AAC3C,uCAAoC;AACpC,0CAAwD;AACxD,kDAA+E;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,GAAG,EAAE;gBACH,aAAa,EAAE,EAAE;aAClB;YACD,GAAG,EAAE;gBACH,KAAK,EAAE,MAAM;gBACb,QAAQ,EAAE,GAAG;gBACb,gBAAgB,EAAE,MAAM;gBACxB,aAAa,EAAE,EAAE;aAClB;YACD,OAAO,EAAE;gBACP,aAAa,EAAE,EAAE;aAClB;SACF,CAAC;KACH;IACD,aAAa,EAAE;QACb,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,QAAQ;KACnB;IACD,aAAa,EAAE;QACb,iBAAiB,EAAE,MAAM;QACzB,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;aAC5B;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE;IACrE,UAAU,EAAE;QACV,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,SAAS;QAC1B,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport { Image, StyleSheet, Text, View, ScrollView, Platform, StatusBar } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\nimport { hasViewControllerBasedStatusBarAppearance } from '../utils/statusbar';\n\nconst INDENT = 20;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n header: () => {\n const WrapperElement = Platform.OS === 'android' ? SafeAreaView : View;\n return (\n <WrapperElement style={styles.header}>\n <View style={styles.headerContent}>\n <View style={styles.headerIcon}>\n <SitemapIcon />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Sitemap\n </Text>\n </View>\n </WrapperElement>\n );\n },\n };\n}\n\nexport function Sitemap() {\n return (\n <View style={styles.container}>\n {!hasViewControllerBasedStatusBarAppearance && <StatusBar barStyle=\"light-content\" />}\n <ScrollView contentContainerStyle={styles.scroll}>\n <FileSystemView />\n </ScrollView>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n return routes.map((route) => (\n <View key={route.contextKey} style={styles.itemContainer}>\n <FileItem route={route} />\n </View>\n ));\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((segment) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(segment)) {\n return segment + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return segment === 'index' ? '' : segment;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const routeSegmentsCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-routeSegmentsCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? '#202425' : 'transparent',\n },\n pressed && { backgroundColor: '#26292b' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nfunction SitemapIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/sitemap.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n header: {\n backgroundColor: '#151718',\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: '#313538',\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 3,\n },\n shadowOpacity: 0.33,\n shadowRadius: 3,\n elevation: 8,\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 14,\n paddingHorizontal: '5%',\n ...Platform.select({\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n },\n }),\n },\n title: {\n color: 'white',\n fontSize: 28,\n fontWeight: 'bold',\n },\n scroll: {\n paddingHorizontal: '5%',\n paddingVertical: 16,\n ...Platform.select({\n ios: {\n paddingBottom: 24,\n },\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n paddingBottom: 24,\n },\n default: {\n paddingBottom: 12,\n },\n }),\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },\n headerIcon: {\n width: 40,\n height: 40,\n backgroundColor: '#202425',\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "4.0.0-preview.
|
|
3
|
+
"version": "4.0.0-preview.14",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"expo"
|
|
74
74
|
],
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@react-navigation/drawer": "7.0.0
|
|
76
|
+
"@react-navigation/drawer": "7.0.0",
|
|
77
77
|
"expo": "*",
|
|
78
78
|
"expo-constants": "*",
|
|
79
79
|
"expo-linking": "*",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@react-navigation/drawer": "7.0.0
|
|
96
|
+
"@react-navigation/drawer": "7.0.0",
|
|
97
97
|
"@testing-library/jest-native": "^5.4.2",
|
|
98
98
|
"@testing-library/react": "^15.0.7",
|
|
99
99
|
"@testing-library/react-native": "^12.5.1",
|
|
@@ -105,14 +105,14 @@
|
|
|
105
105
|
"@expo/metro-runtime": "4.0.0-preview.2",
|
|
106
106
|
"@expo/server": "^0.5.0-preview.0",
|
|
107
107
|
"@radix-ui/react-slot": "1.0.1",
|
|
108
|
-
"@react-navigation/bottom-tabs": "7.0.0
|
|
109
|
-
"@react-navigation/native": "7.0.0
|
|
110
|
-
"@react-navigation/native-stack": "7.0.0
|
|
108
|
+
"@react-navigation/bottom-tabs": "7.0.0",
|
|
109
|
+
"@react-navigation/native": "7.0.0",
|
|
110
|
+
"@react-navigation/native-stack": "7.0.0",
|
|
111
111
|
"client-only": "^0.0.1",
|
|
112
112
|
"react-helmet-async": "^1.3.0",
|
|
113
113
|
"react-native-helmet-async": "2.0.4",
|
|
114
114
|
"schema-utils": "^4.0.1",
|
|
115
115
|
"server-only": "^0.0.1"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "c0899e56c5be08b0142f06f05aa7bac8d6bc18b8"
|
|
118
118
|
}
|