expo-router 0.0.6 → 0.0.8

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/babel.js CHANGED
@@ -58,6 +58,21 @@ module.exports = function (api) {
58
58
  return;
59
59
  }
60
60
 
61
+ // Used for log box and stuff
62
+ if (
63
+ t.isIdentifier(parent.node.property, {
64
+ name: "EXPO_PROJECT_ROOT",
65
+ }) &&
66
+ !parent.parentPath.isAssignmentExpression()
67
+ ) {
68
+ parent.replaceWith(
69
+ t.stringLiteral(
70
+ process.env.EXPO_PROJECT_ROOT || state.file.opts.root || ""
71
+ )
72
+ );
73
+ return;
74
+ }
75
+
61
76
  if (
62
77
  !t.isIdentifier(parent.node.property, {
63
78
  name: "EXPO_ROUTER_APP_ROOT",
@@ -1 +1 @@
1
- {"version":3,"file":"ContextNavigator.d.ts","sourceRoot":"","sources":["../src/ContextNavigator.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA0DzC,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,eAsBxE"}
1
+ {"version":3,"file":"ContextNavigator.d.ts","sourceRoot":"","sources":["../src/ContextNavigator.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA0DzC,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,eAmBxE"}
@@ -45,9 +45,9 @@ export function ContextNavigator({ context }) {
45
45
  if (Tutorial) {
46
46
  return React.createElement(Tutorial, null);
47
47
  }
48
- const children = useMemo(() => (React.createElement(Route, { filename: "./" },
49
- React.createElement(ContextNavigationContainer, null,
50
- React.createElement(NativeStack, { screenOptions: { animation: "none", headerShown: false } })))), []);
51
- return (React.createElement(RoutesContextProvider, { context: context }, children));
48
+ return (React.createElement(RoutesContextProvider, { context: context },
49
+ React.createElement(Route, { filename: "./" },
50
+ React.createElement(ContextNavigationContainer, null,
51
+ React.createElement(NativeStack, { screenOptions: { animation: "none", headerShown: false } })))));
52
52
  }
53
53
  //# sourceMappingURL=ContextNavigator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextNavigator.js","sourceRoot":"","sources":["../src/ContextNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,SAAS,wBAAwB,CAAC,OAAuB;IACrD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,qBAAqB,CAAC,EAC3B,OAAO,EACP,QAAQ,GAIX;IACG,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,CACH,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,IAAG,QAAQ,CAA0B,CAC7E,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAC/B,SAAc;IAEd,OAAO,CACH,CAAC,CAAC,SAAS;QACX,CAAC,OAAO,SAAS,KAAK,UAAU;YAC5B,SAAS,EAAE,SAAS,EAAE,gBAAgB;YACtC,SAAS,CAAC,QAAQ,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qBAAqB,IAAC,OAAO,EAAE,OAAO,IAClC,QAAQ,CACW,CAC3B,CAAC;AACN,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { RoutesContext } from './context';\nimport { ContextNavigationContainer } from './ContextNavigationContainer';\nimport { getRoutes } from './getRoutes';\nimport { NativeStack } from './layouts/NativeStack';\nimport { Route } from './Route';\nimport { RequireContext } from './types';\n\n\nfunction useContextModuleAsRoutes(context: RequireContext) {\n // TODO: Is this an optimal hook dependency?\n const keys = useMemo(() => context.keys(), [context]);\n return useMemo(() => getRoutes(context), [keys]);\n}\n\nfunction RoutesContextProvider({\n context,\n children,\n}: {\n context: RequireContext;\n children: React.ReactNode;\n}) {\n const routes = useContextModuleAsRoutes(context);\n return (\n <RoutesContext.Provider value={routes}>{children}</RoutesContext.Provider>\n );\n}\n\nfunction isFunctionOrReactComponent(\n Component: any\n): Component is React.ComponentType {\n return (\n !!Component &&\n (typeof Component === \"function\" ||\n Component?.prototype?.isReactComponent ||\n Component.$$typeof === Symbol.for(\"react.forward_ref\"))\n );\n}\n\n/** Returns the Tutorial component if there are no React components exported as default from any files in the provided context module. */\nfunction useTutorial(context: RequireContext) {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n\n const keys = useMemo(() => context.keys(), [context]);\n const hasAnyValidComponent = useMemo(() => {\n for (const key of keys) {\n // NOTE(EvanBacon): This should only ever occur in development as it breaks lazily loading.\n const component = context(key)?.default;\n if (isFunctionOrReactComponent(component)) {\n return true;\n }\n }\n return false;\n }, [keys]);\n\n if (hasAnyValidComponent) {\n return null;\n }\n\n return require(\"./onboard/Tutorial\").Tutorial;\n}\n\nexport function ContextNavigator({ context }: { context: RequireContext }) {\n const Tutorial = useTutorial(context);\n if (Tutorial) {\n return <Tutorial />;\n }\n\n const children = useMemo(() => (\n <Route filename=\"./\">\n <ContextNavigationContainer>\n {/* Using a switch navigator at the root to host all pages. */}\n <NativeStack\n screenOptions={{ animation: \"none\", headerShown: false }}\n />\n </ContextNavigationContainer>\n </Route>\n ), []);\n\n return (\n <RoutesContextProvider context={context}>\n {children}\n </RoutesContextProvider>\n );\n}\n\n"]}
1
+ {"version":3,"file":"ContextNavigator.js","sourceRoot":"","sources":["../src/ContextNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,SAAS,wBAAwB,CAAC,OAAuB;IACrD,4CAA4C;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,qBAAqB,CAAC,EAC3B,OAAO,EACP,QAAQ,GAIX;IACG,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,CACH,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,IAAG,QAAQ,CAA0B,CAC7E,CAAC;AACN,CAAC;AAED,SAAS,0BAA0B,CAC/B,SAAc;IAEd,OAAO,CACH,CAAC,CAAC,SAAS;QACX,CAAC,OAAO,SAAS,KAAK,UAAU;YAC5B,SAAS,EAAE,SAAS,EAAE,gBAAgB;YACtC,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAC9D,CAAC;AACN,CAAC;AAED,yIAAyI;AACzI,SAAS,WAAW,CAAC,OAAuB;IACxC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACvC,OAAO,IAAI,CAAC;KACf;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACpB,2FAA2F;YAC3F,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;YACxC,IAAI,0BAA0B,CAAC,SAAS,CAAC,EAAE;gBACvC,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAI,oBAAoB,EAAE;QACtB,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAA+B;IACrE,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,QAAQ,EAAE;QACV,OAAO,oBAAC,QAAQ,OAAG,CAAC;KACvB;IAGD,OAAO,CACH,oBAAC,qBAAqB,IAAC,OAAO,EAAE,OAAO;QACnC,oBAAC,KAAK,IAAC,QAAQ,EAAC,IAAI;YAChB,oBAAC,0BAA0B;gBAEvB,oBAAC,WAAW,IACR,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAC1D,CACuB,CACzB,CACY,CAC3B,CAAC;AACN,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { RoutesContext } from './context';\nimport { ContextNavigationContainer } from './ContextNavigationContainer';\nimport { getRoutes } from './getRoutes';\nimport { NativeStack } from './layouts/NativeStack';\nimport { Route } from './Route';\nimport { RequireContext } from './types';\n\n\nfunction useContextModuleAsRoutes(context: RequireContext) {\n // TODO: Is this an optimal hook dependency?\n const keys = useMemo(() => context.keys(), [context]);\n return useMemo(() => getRoutes(context), [keys]);\n}\n\nfunction RoutesContextProvider({\n context,\n children,\n}: {\n context: RequireContext;\n children: React.ReactNode;\n}) {\n const routes = useContextModuleAsRoutes(context);\n return (\n <RoutesContext.Provider value={routes}>{children}</RoutesContext.Provider>\n );\n}\n\nfunction isFunctionOrReactComponent(\n Component: any\n): Component is React.ComponentType {\n return (\n !!Component &&\n (typeof Component === \"function\" ||\n Component?.prototype?.isReactComponent ||\n Component.$$typeof === Symbol.for(\"react.forward_ref\"))\n );\n}\n\n/** Returns the Tutorial component if there are no React components exported as default from any files in the provided context module. */\nfunction useTutorial(context: RequireContext) {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n\n const keys = useMemo(() => context.keys(), [context]);\n const hasAnyValidComponent = useMemo(() => {\n for (const key of keys) {\n // NOTE(EvanBacon): This should only ever occur in development as it breaks lazily loading.\n const component = context(key)?.default;\n if (isFunctionOrReactComponent(component)) {\n return true;\n }\n }\n return false;\n }, [keys]);\n\n if (hasAnyValidComponent) {\n return null;\n }\n\n return require(\"./onboard/Tutorial\").Tutorial;\n}\n\nexport function ContextNavigator({ context }: { context: RequireContext }) {\n const Tutorial = useTutorial(context);\n if (Tutorial) {\n return <Tutorial />;\n }\n\n\n return (\n <RoutesContextProvider context={context}>\n <Route filename=\"./\">\n <ContextNavigationContainer>\n {/* Using a switch navigator at the root to host all pages. */}\n <NativeStack\n screenOptions={{ animation: \"none\", headerShown: false }}\n />\n </ContextNavigationContainer>\n </Route>\n </RoutesContextProvider>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";AAmCA,wBAAgB,QAAQ,gBAoDvB"}
1
+ {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";AAmCA,wBAAgB,QAAQ,gBAsDvB"}
@@ -4,7 +4,7 @@ import { View, Text, Pressable, StyleSheet } from "@bacons/react-views";
4
4
  import { createEntryFileAsync } from "./createEntryFile";
5
5
  // TODO: Use openLinkFromBrowser thing
6
6
  function Header() {
7
- return (React.createElement(Pressable, null, ({ hovered }) => (React.createElement(Text, { accessibilityRole: "heading", accessibilityLevel: 1, style: [styles.title, Platform.OS !== "web" && { textAlign: "left" }] },
7
+ return (React.createElement(Pressable, null, ({ hovered }) => (React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 1, style: [styles.title, Platform.OS !== "web" && { textAlign: "left" }] },
8
8
  "Welcome to",
9
9
  " ",
10
10
  React.createElement(Text, { href: "https://github.com/expo/expo-router/", style: [
@@ -17,16 +17,18 @@ function Header() {
17
17
  const canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;
18
18
  export function Tutorial() {
19
19
  React.useEffect(() => {
20
- // Reset the route on web so the initial route isn't a 404 after
21
- // the user has created the entry file.
22
- // This is useful for cases where you are testing the tutorial.
23
- // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.
24
- // you should see the tutorial again and be able to create the entry file once more.
25
- if (typeof location !== "undefined" && location.pathname !== "/") {
26
- location.replace("/");
27
- }
28
- if (typeof window !== "undefined") {
29
- window.document.title = "npx expo start";
20
+ if (Platform.OS === "web") {
21
+ // Reset the route on web so the initial route isn't a 404 after
22
+ // the user has created the entry file.
23
+ // This is useful for cases where you are testing the tutorial.
24
+ // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.
25
+ // you should see the tutorial again and be able to create the entry file once more.
26
+ if (typeof location !== "undefined" && location.pathname !== "/") {
27
+ location.replace("/");
28
+ }
29
+ if (typeof window !== "undefined" && typeof window.document !== "undefined") {
30
+ window.document.title = "npx expo start";
31
+ }
30
32
  }
31
33
  }, []);
32
34
  return (React.createElement(View, { style: {
@@ -45,7 +47,7 @@ export function Tutorial() {
45
47
  } },
46
48
  React.createElement(View, { accessibilityRole: "main", style: styles.container },
47
49
  React.createElement(Header, null),
48
- React.createElement(Text, { accessibilityRole: "heading", accessibilityLevel: 2, style: styles.subtitle },
50
+ React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 2, style: styles.subtitle },
49
51
  "Get started by creating a file",
50
52
  "\n",
51
53
  "in the",
@@ -1 +1 @@
1
- {"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,sCAAsC;AACtC,SAAS,MAAM;IACX,OAAO,CACH,oBAAC,SAAS,QACL,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACd,oBAAC,IAAI,IACD,iBAAiB,EAAC,SAAS,EAC3B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;;QAE1D,GAAG;QACd,oBAAC,IAAI,IACD,IAAI,EAAC,sCAAsC,EAC3C,KAAK,EAAE;gBACH,OAAO,IAAI;oBACP,mBAAmB,EAAE,OAAO;oBAC5B,kBAAkB,EAAE,WAAW;iBAClC;aACJ,WAGE,CACJ,CACV,CACO,CACf,CAAC;AACN,CAAC;AAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAElE,MAAM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QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,MAAM;KACrB;IACD,UAAU,EAAE;QACR,KAAK,EAAE,OAAO;KACjB;IACD,IAAI,EAAE;QACF,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACvB,CAAC;KACL;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,OAAO;QACnB,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,GAAG;KAChB;CACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { SafeAreaView, StatusBar, Platform } from \"react-native\";\nimport { View, Text, Pressable, StyleSheet } from \"@bacons/react-views\";\nimport { createEntryFileAsync } from \"./createEntryFile\";\n\n// TODO: Use openLinkFromBrowser thing\nfunction Header() {\n return (\n <Pressable>\n {({ hovered }) => (\n <Text\n accessibilityRole=\"heading\"\n accessibilityLevel={1}\n style={[styles.title, Platform.OS !== \"web\" && { textAlign: \"left\" }]}\n >\n Welcome to{\" \"}\n <Text\n href=\"https://github.com/expo/expo-router/\"\n style={[\n hovered && {\n textDecorationColor: \"white\",\n textDecorationLine: \"underline\",\n },\n ]}\n >\n Expo\n </Text>\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 // 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\") {\n window.document.title = \"npx expo start\";\n }\n }, []);\n\n return (\n <View\n style={{\n backgroundColor: \"black\",\n flex: 1,\n backgroundImage:\n \"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)\",\n backgroundPosition: \"-3px -3px\",\n backgroundSize: \"40px 40px\",\n }}\n >\n <StatusBar barStyle=\"light-content\" />\n\n <SafeAreaView\n style={{\n flex: 1,\n maxWidth: 960,\n marginHorizontal: \"auto\",\n alignItems: \"stretch\",\n }}\n >\n <View accessibilityRole=\"main\" style={styles.container}>\n <Header />\n <Text\n accessibilityRole=\"heading\"\n accessibilityLevel={2}\n style={styles.subtitle}\n >\n Get started by creating a file{\"\\n\"}in the{\" \"}\n <Text style={{ fontWeight: \"bold\" }}>app</Text> directory{\"\\n\"}that\n exports a React component.\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n </View>\n );\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={{\n ...Platform.select({\n native: {\n position: \"absolute\",\n bottom: 8,\n left: 24,\n right: 24,\n },\n }),\n }}\n >\n {({ pressed, hovered }) => (\n <View\n style={[\n {\n transitionDuration: \"200ms\",\n backgroundColor: \"transparent\",\n borderColor: \"white\",\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n },\n hovered && {\n backgroundColor: \"white\",\n },\n pressed && {\n backgroundColor: \"rgba(255,255,255,0.7)\",\n },\n ]}\n >\n <Text\n selectable={false}\n style={[\n {\n fontSize: 18,\n transitionDuration: \"200ms\",\n fontWeight: \"bold\",\n color: \"white\",\n },\n styles.code,\n hovered && { color: \"black\" },\n ]}\n >\n <Text style={{ color: \"#BCC3CD\" }}>$</Text> touch app/index.js\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 24,\n alignItems: \"start\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 64,\n paddingBottom: 24,\n fontWeight: \"bold\",\n },\n buttonText: {\n color: \"black\",\n },\n code: {\n fontFamily: Platform.select({\n default: \"Courier\",\n ios: \"Courier New\",\n android: \"monospace\",\n }),\n },\n subtitle: {\n color: \"#BCC3CD\",\n fontSize: 36,\n fontWeight: \"light\",\n paddingBottom: 36,\n maxWidth: 960,\n },\n});\n"]}
1
+ {"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,sCAAsC;AACtC,SAAS,MAAM;IACX,OAAO,CACH,oBAAC,SAAS,QACL,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACd,oBAAC,IAAI,IACD,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;;QAE1D,GAAG;QACd,oBAAC,IAAI,IACD,IAAI,EAAC,sCAAsC,EAC3C,KAAK,EAAE;gBACH,OAAO,IAAI;oBACP,mBAAmB,EAAE,OAAO;oBAC5B,kBAAkB,EAAE,WAAW;iBAClC;aACJ,WAGE,CACJ,CACV,CACO,CACf,CAAC;AACN,CAAC;AAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAElE,MAAM,UAAU,QAAQ;IACpB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;YACvB,gEAAgE;YAChE,uCAAuC;YACvC,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AE;QACjB,UAAU,EAAE,MAAM;KACrB;IACD,UAAU,EAAE;QACR,KAAK,EAAE,OAAO;KACjB;IACD,IAAI,EAAE;QACF,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACvB,CAAC;KACL;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,OAAO;QACnB,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,GAAG;KAChB;CACJ,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { SafeAreaView, StatusBar, Platform } from \"react-native\";\nimport { View, Text, Pressable, StyleSheet } from \"@bacons/react-views\";\nimport { createEntryFileAsync } from \"./createEntryFile\";\n\n// TODO: Use openLinkFromBrowser thing\nfunction Header() {\n return (\n <Pressable>\n {({ hovered }) => (\n <Text\n accessibilityRole=\"header\"\n accessibilityLevel={1}\n style={[styles.title, Platform.OS !== \"web\" && { textAlign: \"left\" }]}\n >\n Welcome to{\" \"}\n <Text\n href=\"https://github.com/expo/expo-router/\"\n style={[\n hovered && {\n textDecorationColor: \"white\",\n textDecorationLine: \"underline\",\n },\n ]}\n >\n Expo\n </Text>\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\n style={{\n backgroundColor: \"black\",\n flex: 1,\n backgroundImage:\n \"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)\",\n backgroundPosition: \"-3px -3px\",\n backgroundSize: \"40px 40px\",\n }}\n >\n <StatusBar barStyle=\"light-content\" />\n\n <SafeAreaView\n style={{\n flex: 1,\n maxWidth: 960,\n marginHorizontal: \"auto\",\n alignItems: \"stretch\",\n }}\n >\n <View accessibilityRole=\"main\" style={styles.container}>\n <Header />\n <Text\n accessibilityRole=\"header\"\n accessibilityLevel={2}\n style={styles.subtitle}\n >\n Get started by creating a file{\"\\n\"}in the{\" \"}\n <Text style={{ fontWeight: \"bold\" }}>app</Text> directory{\"\\n\"}that\n exports a React component.\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n </View>\n );\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={{\n ...Platform.select({\n native: {\n position: \"absolute\",\n bottom: 8,\n left: 24,\n right: 24,\n },\n }),\n }}\n >\n {({ pressed, hovered }) => (\n <View\n style={[\n {\n transitionDuration: \"200ms\",\n backgroundColor: \"transparent\",\n borderColor: \"white\",\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n },\n hovered && {\n backgroundColor: \"white\",\n },\n pressed && {\n backgroundColor: \"rgba(255,255,255,0.7)\",\n },\n ]}\n >\n <Text\n selectable={false}\n style={[\n {\n fontSize: 18,\n transitionDuration: \"200ms\",\n fontWeight: \"bold\",\n color: \"white\",\n },\n styles.code,\n hovered && { color: \"black\" },\n ]}\n >\n <Text style={{ color: \"#BCC3CD\" }}>$</Text> touch app/index.js\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 24,\n alignItems: \"start\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 64,\n paddingBottom: 24,\n fontWeight: \"bold\",\n },\n buttonText: {\n color: \"black\",\n },\n code: {\n fontFamily: Platform.select({\n default: \"Courier\",\n ios: \"Courier New\",\n android: \"monospace\",\n }),\n },\n subtitle: {\n color: \"#BCC3CD\",\n fontSize: 36,\n fontWeight: \"light\",\n paddingBottom: 36,\n maxWidth: 960,\n },\n});\n"]}
@@ -7,7 +7,7 @@ export function ErrorBoundary({ error, retry }) {
7
7
  return (React.createElement(View, { accessibilityRole: 'main', style: [styles.container] },
8
8
  React.createElement(SafeAreaView, { style: { flex: 1, maxWidth: 720, marginHorizontal: 'auto' } },
9
9
  React.createElement(View, { style: { marginBottom: 12, flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center' } },
10
- React.createElement(Text, { accessibilityRole: "heading", accessibilityLevel: 1, style: styles.title }, "Something went wrong"),
10
+ React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 1, style: styles.title }, "Something went wrong"),
11
11
  React.createElement(View, { style: { flexDirection: 'row', alignItems: 'center' } },
12
12
  React.createElement(Pressable, null, ({ hovered }) => (React.createElement(TouchableOpacity, { onPress: retry },
13
13
  React.createElement(View, { style: [{ transitionDuration: '100ms', paddingVertical: 12, paddingHorizontal: 24, borderColor: 'white', borderWidth: 2, marginLeft: 8 }, hovered && { backgroundColor: 'white' }] },
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAsB;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AE,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC7I,CAAC,CAAC","sourcesContent":["import { Pressable, StyleSheet, Text, View } from '@bacons/react-views';\nimport React from 'react';\nimport { Platform, ScrollView, TouchableOpacity } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from './Link';\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n return (\n <View accessibilityRole='main' style={[styles.container]}>\n <SafeAreaView style={{ flex: 1, maxWidth: 720, marginHorizontal: 'auto' }}>\n <View style={{ marginBottom: 12, flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center' }}>\n <Text\n accessibilityRole=\"heading\" accessibilityLevel={1}\n style={styles.title}\n >\n Something went wrong\n </Text>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n <Pressable>\n {({ hovered }) => (\n <TouchableOpacity onPress={retry}>\n <View style={[{ transitionDuration: '100ms', paddingVertical: 12, paddingHorizontal: 24, borderColor: 'white', borderWidth: 2, marginLeft: 8 }, hovered && { backgroundColor: 'white' }]}>\n <Text style={[styles.buttonText, { transitionDuration: '100ms', color: hovered ? 'black' : 'white' }]}>\n Retry\n </Text>\n </View>\n </TouchableOpacity>\n )}\n </Pressable>\n </View>\n </View>\n\n <StackTrace error={error} />\n {process.env.NODE_ENV === 'development' && <Link href={'/__index'} style={styles.link}>\n Sitemap\n </Link>}\n </SafeAreaView>\n </View>\n );\n}\n\nfunction StackTrace({ error }: { error: Error }) {\n return (\n <ScrollView style={{ marginVertical: 8, borderColor: 'rgba(255,255,255,0.5)', borderWidth: 1, padding: 12, }}>\n <Text style={[styles.code, { color: 'white' }]}>\n {error.stack}\n </Text>\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: \"black\",\n padding: 24,\n alignItems: \"stretch\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 36,\n\n // textAlign: \"center\",\n fontWeight: \"bold\",\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n },\n code: {\n fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),\n fontWeight: '500',\n },\n subtitle: {\n color: \"white\",\n fontSize: 14,\n marginBottom: 12,\n // textAlign: \"center\",\n },\n link: { color: \"rgba(255,255,255,0.4)\", textDecorationStyle: 'solid', textDecorationLine: 'underline', fontSize: 14, textAlign: \"center\" },\n});\n"]}
1
+ {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAsB;IAC9D,OAAO,CACH,oBAAC,IAAI,IAAC,iBAAiB,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;QACpD,oBAAC,YAAY,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE;YACrE,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,UAA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AG;QACxG,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IACzC,KAAK,CAAC,KAAK,CACT,CACE,CAChB,CAAC;AACN,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE;QACP,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,QAAQ;KAC3B;IACD,KAAK,EAAE;QACH,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QAEZ,uBAAuB;QACvB,UAAU,EAAE,MAAM;KACrB;IACD,UAAU,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,OAAO;KACjB;IACD,IAAI,EAAE;QACF,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QAC7F,UAAU,EAAE,KAAK;KACpB;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,uBAAuB;KAC1B;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC7I,CAAC,CAAC","sourcesContent":["import { Pressable, StyleSheet, Text, View } from '@bacons/react-views';\nimport React from 'react';\nimport { Platform, ScrollView, TouchableOpacity } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from './Link';\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n return (\n <View accessibilityRole='main' style={[styles.container]}>\n <SafeAreaView style={{ flex: 1, maxWidth: 720, marginHorizontal: 'auto' }}>\n <View style={{ marginBottom: 12, flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center' }}>\n <Text\n accessibilityRole=\"header\" accessibilityLevel={1}\n style={styles.title}\n >\n Something went wrong\n </Text>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n <Pressable>\n {({ hovered }) => (\n <TouchableOpacity onPress={retry}>\n <View style={[{ transitionDuration: '100ms', paddingVertical: 12, paddingHorizontal: 24, borderColor: 'white', borderWidth: 2, marginLeft: 8 }, hovered && { backgroundColor: 'white' }]}>\n <Text style={[styles.buttonText, { transitionDuration: '100ms', color: hovered ? 'black' : 'white' }]}>\n Retry\n </Text>\n </View>\n </TouchableOpacity>\n )}\n </Pressable>\n </View>\n </View>\n\n <StackTrace error={error} />\n {process.env.NODE_ENV === 'development' && <Link href={'/__index'} style={styles.link}>\n Sitemap\n </Link>}\n </SafeAreaView>\n </View>\n );\n}\n\nfunction StackTrace({ error }: { error: Error }) {\n return (\n <ScrollView style={{ marginVertical: 8, borderColor: 'rgba(255,255,255,0.5)', borderWidth: 1, padding: 12, }}>\n <Text style={[styles.code, { color: 'white' }]}>\n {error.stack}\n </Text>\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: \"black\",\n padding: 24,\n alignItems: \"stretch\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 36,\n\n // textAlign: \"center\",\n fontWeight: \"bold\",\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n },\n code: {\n fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),\n fontWeight: '500',\n },\n subtitle: {\n color: \"white\",\n fontSize: 14,\n marginBottom: 12,\n // textAlign: \"center\",\n },\n link: { color: \"rgba(255,255,255,0.4)\", textDecorationStyle: 'solid', textDecorationLine: 'underline', fontSize: 14, textAlign: \"center\" },\n});\n"]}
@@ -21,6 +21,6 @@ declare type Props<ParamList extends ReactNavigation.RootParamList> = {
21
21
  * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
22
22
  * @param props.children Child elements to render the content.
23
23
  */
24
- export declare const Link: React.ForwardRefExoticComponent<Pick<Props<ReactNavigation.RootParamList>, "children" | "key" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onLayout" | "onTextLayout" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "adjustsFontSizeToFit" | "minimumFontScale" | "suppressHighlighting" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "asChild" | "to" | "action" | keyof import("@bacons/react-views/build/Text").WebTextProps> & React.RefAttributes<Text>>;
24
+ export declare const Link: React.ForwardRefExoticComponent<Pick<Props<ReactNavigation.RootParamList>, "children" | "key" | "action" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onLayout" | "onTextLayout" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "adjustsFontSizeToFit" | "minimumFontScale" | "suppressHighlighting" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "asChild" | "to" | keyof import("@bacons/react-views/build/Text").WebTextProps> & React.RefAttributes<Text>>;
25
25
  export {};
26
26
  //# sourceMappingURL=Link.d.ts.map
@@ -26,6 +26,7 @@ function BaseLink({ to, href, action, asChild, ...rest }, ref) {
26
26
  return resolved;
27
27
  }, [href, to]);
28
28
  const props = useLinkProps({ to: resolvedTo, action });
29
+ console.log('link props', resolvedTo, action, props);
29
30
  const onPress = (e) => {
30
31
  if ('onPress' in rest) {
31
32
  rest.onPress?.(e);
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/views/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAa,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,YAAY,GAAG,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAc3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE/C,SAAS,QAAQ,CAAkD,EAC/D,EAAE,EACF,IAAI,EACJ,MAAM,EACN,OAAO,EACP,GAAG,IAAI,EACQ,EAAE,GAA6B;IAC9C,6CAA6C;IAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAClC,IAAI,QAAQ,IAAI,IAAI,EAAE;YAClB,MAAM,IAAI,KAAK,CACX,4DAA4D,CAC/D,CAAC;SACL;QACD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAC3D,yCAAyC;YACzC,OAAO,GAAG,CAAA;SACb;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACf,MAAM,KAAK,GAAG,YAAY,CAAY,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;IAElE,MAAM,OAAO,GAAG,CACZ,CAA0E,EAC5E,EAAE;QACA,IAAI,SAAS,IAAI,IAAI,EAAE;YACnB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;SACrB;QAED,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC,aAAa;IACtB,0CAA0C;IAC1C,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACrB;QACI,GAAG;QACH,GAAG,KAAK;QACR,GAAG,IAAI;QACP,GAAG,QAAQ,CAAC,MAAM,CAAC;YACf,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAS;YAChC,OAAO,EAAE,EAAE,OAAO,EAAE;SACvB,CAAC;KACL,CAAC,CAAC;AACX,CAAC","sourcesContent":["// Fork of @react-navigation/native Link.tsx\nimport type { NavigationAction } from '@react-navigation/core';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform } from 'react-native';\nimport { Text, TextProps } from '@bacons/react-views'\nimport { useLinkProps, } from '@react-navigation/native';\nimport { Slot } from '@radix-ui/react-slot'\nimport type { To } from '@react-navigation/native/src/useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n asChild?: boolean;\n href?: string;\n to?: To<ParamList>;\n action?: NavigationAction;\n target?: string;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (TextProps & { children: React.ReactNode });\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.href Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport const Link = React.forwardRef(BaseLink);\n\nfunction BaseLink<ParamList extends ReactNavigation.RootParamList>({\n to,\n href,\n action,\n asChild,\n ...rest\n}: Props<ParamList>, ref: React.ForwardedRef<Text>) {\n // TODO: Auto use router's client-side event.\n const resolvedTo = React.useMemo(() => {\n const resolved = href ? href : to;\n if (resolved == null) {\n throw new Error(\n `You must specify either 'href' or 'to' prop in a <Link />.`\n );\n }\n if (typeof resolved === 'string' && !resolved.startsWith('/')) {\n // TODO: Auto delegate out external links\n return '/'\n }\n return resolved;\n }, [href, to]);\n const props = useLinkProps<ParamList>({ to: resolvedTo, action });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n props.onPress(e);\n };\n\n return React.createElement(\n // @ts-expect-error: slot is not type-safe\n asChild ? Slot : Text,\n {\n ref,\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n });\n}\n"]}
1
+ {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/views/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAa,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,YAAY,GAAG,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAc3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAE/C,SAAS,QAAQ,CAAkD,EAC/D,EAAE,EACF,IAAI,EACJ,MAAM,EACN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ork of @react-navigation/native Link.tsx\nimport type { NavigationAction } from '@react-navigation/core';\nimport * as React from 'react';\nimport { GestureResponderEvent, Platform } from 'react-native';\nimport { Text, TextProps } from '@bacons/react-views'\nimport { useLinkProps, } from '@react-navigation/native';\nimport { Slot } from '@radix-ui/react-slot'\nimport type { To } from '@react-navigation/native/src/useLinkTo';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> = {\n asChild?: boolean;\n href?: string;\n to?: To<ParamList>;\n action?: NavigationAction;\n target?: string;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (TextProps & { children: React.ReactNode });\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.href Absolute path to screen (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport const Link = React.forwardRef(BaseLink);\n\nfunction BaseLink<ParamList extends ReactNavigation.RootParamList>({\n to,\n href,\n action,\n asChild,\n ...rest\n}: Props<ParamList>, ref: React.ForwardedRef<Text>) {\n // TODO: Auto use router's client-side event.\n const resolvedTo = React.useMemo(() => {\n const resolved = href ? href : to;\n if (resolved == null) {\n throw new Error(\n `You must specify either 'href' or 'to' prop in a <Link />.`\n );\n }\n if (typeof resolved === 'string' && !resolved.startsWith('/')) {\n // TODO: Auto delegate out external links\n return '/'\n }\n return resolved;\n }, [href, to]);\n const props = useLinkProps<ParamList>({ to: resolvedTo, action });\n\n console.log('link props', resolvedTo, action, props);\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n props.onPress(e);\n };\n\n return React.createElement(\n // @ts-expect-error: slot is not type-safe\n asChild ? Slot : Text,\n {\n ref,\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n });\n}\n"]}
@@ -9,8 +9,8 @@ export const Unmatched = forwardRef((props, ref) => {
9
9
  return (
10
10
  // @ts-ignore
11
11
  React.createElement(View, { ref: ref, accessibilityRole: "main", style: styles.container },
12
- React.createElement(Text, { accessibilityRole: "heading", accessibilityLevel: 1, style: styles.title }, "Unmatched Route"),
13
- React.createElement(Text, { accessibilityRole: "heading", accessibilityLevel: 2, style: styles.subtitle },
12
+ React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 1, style: styles.title }, "Unmatched Route"),
13
+ React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 2, style: styles.subtitle },
14
14
  "Page could not be found.",
15
15
  " ",
16
16
  React.createElement(Link, { href: "/", style: styles.link }, "Go back.")),
@@ -1 +1 @@
1
- {"version":3,"file":"Unmatched.js","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEjD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAC1B,OAAO;IACH,aAAa;IACb,oBAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAC,MAAM,EAAC,KAAK,EAAE,MAAM,CAAC,SAAS;QAC5D,oBAAC,IAAI,IACD,iBAAiB,EAAC,SAAS,EAC3B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,MAAM,CAAC,KAAK,sBAGhB;QACP,oBAAC,IAAI,IACD,iBAAiB,EAAC,SAAS,EAC3B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,MAAM,CAAC,QAAQ;;YAEG,GAAG;YAC5B,oBAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,eAE1B,CACJ;QAEP,oBAAC,IAAI,IAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IAC9B,GAAG,CACD;QAEN,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,CACvC,oBAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,cAEnC,CACV,CACE,CACV,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE;QACP,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KAC3B;IACD,KAAK,EAAE;QACH,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,SAAS;QAC5B,iBAAiB,EAAE,CAAC;QACpB,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;KACrB;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,QAAQ;KACtB;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE;CAChE,CAAC,CAAC","sourcesContent":["import React, { forwardRef } from \"react\";\nimport { createURL } from \"expo-linking\";\nimport { StyleSheet } from \"@bacons/react-views\";\nimport { Link } from \"./Link\";\nimport { Text, View } from \"@bacons/react-views\";\n\n/** Default screen for unmatched routes. */\nexport const Unmatched = forwardRef((props, ref) => {\n const url = createURL(\"\");\n return (\n // @ts-ignore\n <View ref={ref} accessibilityRole=\"main\" style={styles.container}>\n <Text\n accessibilityRole=\"heading\"\n accessibilityLevel={1}\n style={styles.title}\n >\n Unmatched Route\n </Text>\n <Text\n accessibilityRole=\"heading\"\n accessibilityLevel={2}\n style={styles.subtitle}\n >\n Page could not be found.{\" \"}\n <Link href=\"/\" style={styles.link}>\n Go back.\n </Link>\n </Text>\n\n <Link href={\"/\"} style={styles.link}>\n {url}\n </Link>\n\n {process.env.NODE_ENV === \"development\" && (\n <Link href={\"/__index\"} style={styles.link}>\n Sitemap\n </Link>\n )}\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: \"black\",\n padding: 24,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 36,\n paddingBottom: 12,\n marginBottom: 12,\n borderBottomColor: \"#323232\",\n borderBottomWidth: 1,\n textAlign: \"center\",\n fontWeight: \"bold\",\n },\n subtitle: {\n color: \"white\",\n fontSize: 18,\n marginBottom: 12,\n textAlign: \"center\",\n },\n link: { color: \"rgba(255,255,255,0.4)\", textAlign: \"center\" },\n});\n"]}
1
+ {"version":3,"file":"Unmatched.js","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEjD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE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AQ,EAAE;QACN,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,QAAQ;KACtB;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE;CAChE,CAAC,CAAC","sourcesContent":["import React, { forwardRef } from \"react\";\nimport { createURL } from \"expo-linking\";\nimport { StyleSheet } from \"@bacons/react-views\";\nimport { Link } from \"./Link\";\nimport { Text, View } from \"@bacons/react-views\";\n\n/** Default screen for unmatched routes. */\nexport const Unmatched = forwardRef((props, ref) => {\n const url = createURL(\"\");\n return (\n // @ts-ignore\n <View ref={ref} accessibilityRole=\"main\" style={styles.container}>\n <Text\n accessibilityRole=\"header\"\n accessibilityLevel={1}\n style={styles.title}\n >\n Unmatched Route\n </Text>\n <Text\n accessibilityRole=\"header\"\n accessibilityLevel={2}\n style={styles.subtitle}\n >\n Page could not be found.{\" \"}\n <Link href=\"/\" style={styles.link}>\n Go back.\n </Link>\n </Text>\n\n <Link href={\"/\"} style={styles.link}>\n {url}\n </Link>\n\n {process.env.NODE_ENV === \"development\" && (\n <Link href={\"/__index\"} style={styles.link}>\n Sitemap\n </Link>\n )}\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: \"black\",\n padding: 24,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 36,\n paddingBottom: 12,\n marginBottom: 12,\n borderBottomColor: \"#323232\",\n borderBottomWidth: 1,\n textAlign: \"center\",\n fontWeight: \"bold\",\n },\n subtitle: {\n color: \"white\",\n fontSize: 18,\n marginBottom: 12,\n textAlign: \"center\",\n },\n link: { color: \"rgba(255,255,255,0.4)\", textAlign: \"center\" },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "build/index.js",
5
5
  "files": [
6
6
  "entry.js",