expo-router 0.0.19 → 0.0.21

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.
Files changed (121) hide show
  1. package/build/ContextNavigationContainer.d.ts +3 -3
  2. package/build/ContextNavigationContainer.d.ts.map +1 -1
  3. package/build/ContextNavigationContainer.js +33 -12
  4. package/build/ContextNavigationContainer.js.map +1 -1
  5. package/build/ContextNavigator.d.ts +1 -1
  6. package/build/ContextNavigator.d.ts.map +1 -1
  7. package/build/ContextNavigator.js +8 -6
  8. package/build/ContextNavigator.js.map +1 -1
  9. package/build/Route.d.ts +1 -1
  10. package/build/Route.d.ts.map +1 -1
  11. package/build/Route.js +3 -3
  12. package/build/Route.js.map +1 -1
  13. package/build/aasa.js +1 -1
  14. package/build/aasa.js.map +1 -1
  15. package/build/fork/getPathFromState.d.ts +3 -3
  16. package/build/fork/getPathFromState.d.ts.map +1 -1
  17. package/build/fork/getPathFromState.js +9 -11
  18. package/build/fork/getPathFromState.js.map +1 -1
  19. package/build/fork/getStateFromPath.d.ts +3 -3
  20. package/build/fork/getStateFromPath.d.ts.map +1 -1
  21. package/build/fork/getStateFromPath.js +3 -4
  22. package/build/fork/getStateFromPath.js.map +1 -1
  23. package/build/getLinkingConfig.d.ts +3 -3
  24. package/build/getLinkingConfig.d.ts.map +1 -1
  25. package/build/getLinkingConfig.js +3 -3
  26. package/build/getLinkingConfig.js.map +1 -1
  27. package/build/getRoutes.d.ts.map +1 -1
  28. package/build/getRoutes.js.map +1 -1
  29. package/build/index.d.ts +3 -3
  30. package/build/index.d.ts.map +1 -1
  31. package/build/index.js +3 -3
  32. package/build/index.js.map +1 -1
  33. package/build/layouts/Drawer.d.ts +1 -1
  34. package/build/layouts/Drawer.d.ts.map +1 -1
  35. package/build/layouts/Drawer.js +2 -2
  36. package/build/layouts/Drawer.js.map +1 -1
  37. package/build/layouts/NativeStack.d.ts +1 -1
  38. package/build/layouts/NativeStack.d.ts.map +1 -1
  39. package/build/layouts/NativeStack.js +2 -2
  40. package/build/layouts/NativeStack.js.map +1 -1
  41. package/build/layouts/Stack.d.ts +1 -1
  42. package/build/layouts/Stack.d.ts.map +1 -1
  43. package/build/layouts/Stack.js +2 -2
  44. package/build/layouts/Stack.js.map +1 -1
  45. package/build/layouts/Tabs.d.ts +1 -1
  46. package/build/layouts/Tabs.d.ts.map +1 -1
  47. package/build/layouts/Tabs.js +2 -2
  48. package/build/layouts/Tabs.js.map +1 -1
  49. package/build/layouts/withLayoutContext.d.ts +2 -2
  50. package/build/layouts/withLayoutContext.d.ts.map +1 -1
  51. package/build/layouts/withLayoutContext.js +10 -10
  52. package/build/layouts/withLayoutContext.js.map +1 -1
  53. package/build/link/Link.d.ts +26 -0
  54. package/build/link/Link.d.ts.map +1 -0
  55. package/build/link/Link.js +40 -0
  56. package/build/link/Link.js.map +1 -0
  57. package/build/link/href.d.ts +9 -0
  58. package/build/link/href.d.ts.map +1 -0
  59. package/build/link/href.js +34 -0
  60. package/build/link/href.js.map +1 -0
  61. package/build/{linking.d.ts → link/linking.d.ts} +2 -2
  62. package/build/link/linking.d.ts.map +1 -0
  63. package/build/{linking.js → link/linking.js} +2 -2
  64. package/build/link/linking.js.map +1 -0
  65. package/build/{useLink.d.ts → link/useLink.d.ts} +2 -1
  66. package/build/link/useLink.d.ts.map +1 -0
  67. package/build/{useLink.js → link/useLink.js} +9 -4
  68. package/build/link/useLink.js.map +1 -0
  69. package/build/link/useLinkToPath.d.ts +2 -0
  70. package/build/link/useLinkToPath.d.ts.map +1 -0
  71. package/build/link/useLinkToPath.js +45 -0
  72. package/build/link/useLinkToPath.js.map +1 -0
  73. package/build/link/useLinkToPathProps.d.ts +11 -0
  74. package/build/link/useLinkToPathProps.d.ts.map +1 -0
  75. package/build/link/useLinkToPathProps.js +31 -0
  76. package/build/link/useLinkToPathProps.js.map +1 -0
  77. package/build/matchers.d.ts.map +1 -1
  78. package/build/matchers.js +2 -1
  79. package/build/matchers.js.map +1 -1
  80. package/build/onboard/Tutorial.d.ts.map +1 -1
  81. package/build/onboard/Tutorial.js +1 -1
  82. package/build/onboard/Tutorial.js.map +1 -1
  83. package/build/primitives.d.ts.map +1 -1
  84. package/build/primitives.js +1 -1
  85. package/build/primitives.js.map +1 -1
  86. package/build/useScreens.js +1 -1
  87. package/build/useScreens.js.map +1 -1
  88. package/build/views/Directory.d.ts.map +1 -1
  89. package/build/views/Directory.js +4 -4
  90. package/build/views/Directory.js.map +1 -1
  91. package/build/views/ErrorBoundary.d.ts +1 -1
  92. package/build/views/ErrorBoundary.d.ts.map +1 -1
  93. package/build/views/ErrorBoundary.js +56 -19
  94. package/build/views/ErrorBoundary.js.map +1 -1
  95. package/build/views/Layout.d.ts +1 -1
  96. package/build/views/Layout.d.ts.map +1 -1
  97. package/build/views/Layout.js +1 -1
  98. package/build/views/Layout.js.map +1 -1
  99. package/build/views/Root.d.ts +1 -1
  100. package/build/views/Root.d.ts.map +1 -1
  101. package/build/views/Root.js +4 -3
  102. package/build/views/Root.js.map +1 -1
  103. package/build/views/Screen.d.ts +1 -1
  104. package/build/views/Screen.d.ts.map +1 -1
  105. package/build/views/Screen.js +2 -1
  106. package/build/views/Screen.js.map +1 -1
  107. package/build/views/Try.d.ts.map +1 -1
  108. package/build/views/Try.js.map +1 -1
  109. package/build/views/Unmatched.d.ts.map +1 -1
  110. package/build/views/Unmatched.js +3 -4
  111. package/build/views/Unmatched.js.map +1 -1
  112. package/package.json +2 -3
  113. package/build/linking.d.ts.map +0 -1
  114. package/build/linking.js.map +0 -1
  115. package/build/useLink.d.ts.map +0 -1
  116. package/build/useLink.js.map +0 -1
  117. package/build/views/Link.d.ts +0 -36
  118. package/build/views/Link.d.ts.map +0 -1
  119. package/build/views/Link.js +0 -87
  120. package/build/views/Link.js.map +0 -1
  121. package/metro-config.js +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"Directory.js","sourceRoot":"","sources":["../../src/views/Directory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG;oBACnD,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,IAAG,KAAK,CAAC,UAAU,CAAQ,CACpD;gBAEN,CAAC,QAAQ,IAAI,oBAAC,WAAW,OAAG;gBAC5B,KAAK,CAAC,SAAS,IAAI,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,cAAgB,CAC5D,CACV,CACO,CACT;QACN,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAClC,oBAAC,QAAQ,IACL,GAAG,EAAE,KAAK,CAAC,UAAU,EACrB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAClC,KAAK,EAAE,KAAK,GAAG,CAAC,GAClB,CACL,CAAC,CACH,CACN,CAAC;AACN,CAAC;AAED,SAAS,QAAQ;IACb,OAAO,CACH,oBAAC,KAAK,IACF,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAChD,CACL,CAAC;AACN,CAAC;AAED,SAAS,OAAO;IACZ,OAAO,CACH,oBAAC,KAAK,IACF,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,OAAO,CAAC,4BAA4B,CAAC,GAC/C,CACL,CAAC;AACN,CAAC;AAED,SAAS,WAAW;IAChB,OAAO,CACH,oBAAC,KAAK,IACF,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,OAAO,CAAC,gCAAgC,CAAC,GACnD,CACL,CAAC;AACN,CAAC","sourcesContent":["import { Image, Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport { useNavigation } from \"@react-navigation/native\";\nimport { NativeStackNavigationOptions } from \"@react-navigation/native-stack\";\nimport React from \"react\";\nimport { ScrollView, Platform, StatusBar, useWindowDimensions } from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { useRoutesContext } from \"../context\";\nimport { matchDeepDynamicRouteName, matchFragmentName } from \"../matchers\";\nimport { RouteNode } from \"../Route\";\nimport { Link } from \"./Link\";\n\nconst INDENT = 18;\n\nfunction useSortedRoutes() {\n const ctx = useRoutesContext();\n\n const routes = React.useMemo(\n () =>\n ctx\n .filter((route) => !route.internal)\n .sort((a, b) => {\n // Emulate vscode's sorting\n if (a.route < b.route) {\n return -1;\n }\n if (a.route > b.route) {\n return 1;\n }\n return 0;\n }),\n [ctx]\n );\n return routes;\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 padding: 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 transitionDuration: \"100ms\",\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\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: \"Index\",\n headerShown: true,\n presentation: \"modal\",\n animation: \"default\",\n headerLargeTitle: true,\n headerTitleStyle: {\n color: \"white\",\n },\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 Directory() {\n const routes = useSortedRoutes();\n const { bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}\n >\n <ScrollView\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={[\n styles.scroll,\n {\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}\n >\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n}) {\n const disabled = route.children.length > 0;\n\n const navigation = useNavigation();\n const href = React.useMemo(() => {\n return (\n \"/\" +\n [...parents, route.route]\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 // groups and index must be erased\n return !!matchFragmentName(v) || v === \"index\" ? \"\" : v;\n })\n .filter(Boolean)\n .join(\"/\")\n );\n }, [parents, route.route]);\n\n return (\n <>\n <Link href={href} onPress={() => {\n if (Platform.OS !== 'web') {\n // Ensure the modal pops\n navigation.goBack();\n }\n }}\n // @ts-expect-error: disabled not on type\n disabled={disabled} asChild>\n <Pressable>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered\n ? \"rgba(255,255,255,0.1)\"\n : \"transparent\",\n },\n pressed && { backgroundColor: \"#323232\" },\n disabled && { opacity: 0.4 },\n ]}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{route.contextKey}</Text>\n </View>\n\n {!disabled && <ForwardIcon />}\n {route.generated && <Text style={styles.virtual}>Virtual</Text>}\n </View>\n )}\n </Pressable>\n </Link>\n {route.children.map((child, index) => (\n <FileItem\n key={child.contextKey}\n route={child}\n parents={[...parents, route.route]}\n level={level + 1}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/file.png\")}\n />\n );\n}\n\nfunction PkgIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/pkg.png\")}\n />\n );\n}\n\nfunction ForwardIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/forward.png\")}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Directory.js","sourceRoot":"","sources":["../../src/views/Directory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,eAAe;IACtB,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CACH,GAAG;SACA,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;SAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,2BA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CAAC;AACJ,CAAC;AAED,SAAS,OAAO;IACd,OAAO,CACL,oBAAC,KAAK,IACJ,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,OAAO,CAAC,4BAA4B,CAAC,GAC7C,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW;IAClB,OAAO,CACL,oBAAC,KAAK,IACJ,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,EAAE,OAAO,CAAC,gCAAgC,CAAC,GACjD,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { Image, Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport { useNavigation } from \"@react-navigation/native\";\nimport { NativeStackNavigationOptions } from \"@react-navigation/native-stack\";\nimport React from \"react\";\nimport {\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { RouteNode } from \"../Route\";\nimport { useRoutesContext } from \"../context\";\nimport { Link } from \"../link/Link\";\nimport { matchDeepDynamicRouteName, matchFragmentName } from \"../matchers\";\n\nconst INDENT = 18;\n\nfunction useSortedRoutes() {\n const ctx = useRoutesContext();\n\n const routes = React.useMemo(\n () =>\n ctx\n .filter((route) => !route.internal)\n .sort((a, b) => {\n // Emulate vscode's sorting\n if (a.route < b.route) {\n return -1;\n }\n if (a.route > b.route) {\n return 1;\n }\n return 0;\n }),\n [ctx]\n );\n return routes;\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 padding: 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 transitionDuration: \"100ms\",\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\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: \"Index\",\n headerShown: true,\n presentation: \"modal\",\n animation: \"default\",\n headerLargeTitle: true,\n headerTitleStyle: {\n color: \"white\",\n },\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 Directory() {\n const routes = useSortedRoutes();\n const { bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}\n >\n <ScrollView\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={[\n styles.scroll,\n {\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}\n >\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n}) {\n const disabled = route.children.length > 0;\n\n const navigation = useNavigation();\n const href = React.useMemo(() => {\n return (\n \"/\" +\n [...parents, route.route]\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 // groups and index must be erased\n return !!matchFragmentName(v) || v === \"index\" ? \"\" : v;\n })\n .filter(Boolean)\n .join(\"/\")\n );\n }, [parents, route.route]);\n\n return (\n <>\n <Link\n href={href}\n onPress={() => {\n if (Platform.OS !== \"web\") {\n // Ensure the modal pops\n navigation.goBack();\n }\n }}\n // @ts-expect-error: disabled not on type\n disabled={disabled}\n asChild\n >\n <Pressable>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered\n ? \"rgba(255,255,255,0.1)\"\n : \"transparent\",\n },\n pressed && { backgroundColor: \"#323232\" },\n disabled && { opacity: 0.4 },\n ]}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{route.contextKey}</Text>\n </View>\n\n {!disabled && <ForwardIcon />}\n {route.generated && <Text style={styles.virtual}>Virtual</Text>}\n </View>\n )}\n </Pressable>\n </Link>\n {route.children.map((child, index) => (\n <FileItem\n key={child.contextKey}\n route={child}\n parents={[...parents, route.route]}\n level={level + 1}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/file.png\")}\n />\n );\n}\n\nfunction PkgIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/pkg.png\")}\n />\n );\n}\n\nfunction ForwardIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/forward.png\")}\n />\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ErrorBoundaryProps } from './Try';
2
+ import { ErrorBoundaryProps } from "./Try";
3
3
  export declare function ErrorBoundary({ error, retry }: ErrorBoundaryProps): JSX.Element;
4
4
  //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,eAiCjE"}
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,eAkEjE"}
@@ -1,23 +1,50 @@
1
- import { Pressable, StyleSheet, Text, View } from '@bacons/react-views';
2
- import React from 'react';
3
- import { Platform, ScrollView, TouchableOpacity } from 'react-native';
4
- import { SafeAreaView } from 'react-native-safe-area-context';
5
- import { Link } from './Link';
1
+ import { Pressable, StyleSheet, Text, View } from "@bacons/react-views";
2
+ import React from "react";
3
+ import { Platform, ScrollView, TouchableOpacity } from "react-native";
4
+ import { SafeAreaView } from "react-native-safe-area-context";
5
+ import { Link } from "../link/Link";
6
6
  export function ErrorBoundary({ error, retry }) {
7
- return (React.createElement(View, { accessibilityRole: 'main', style: [styles.container] },
8
- React.createElement(SafeAreaView, { style: { flex: 1, maxWidth: 720, marginHorizontal: 'auto' } },
9
- React.createElement(View, { style: { marginBottom: 12, flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'center' } },
7
+ return (React.createElement(View, { accessibilityRole: "main", style: [styles.container] },
8
+ React.createElement(SafeAreaView, { style: { flex: 1, maxWidth: 720, marginHorizontal: "auto" } },
9
+ React.createElement(View, { style: {
10
+ marginBottom: 12,
11
+ flexDirection: "row",
12
+ flexWrap: "wrap",
13
+ justifyContent: "space-between",
14
+ alignItems: "center",
15
+ } },
10
16
  React.createElement(Text, { accessibilityRole: "header", accessibilityLevel: 1, style: styles.title }, "Something went wrong"),
11
- React.createElement(View, { style: { flexDirection: 'row', alignItems: 'center' } },
17
+ React.createElement(View, { style: { flexDirection: "row", alignItems: "center" } },
12
18
  React.createElement(Pressable, null, ({ hovered }) => (React.createElement(TouchableOpacity, { onPress: retry },
13
- React.createElement(View, { style: [{ transitionDuration: '100ms', paddingVertical: 12, paddingHorizontal: 24, borderColor: 'white', borderWidth: 2, marginLeft: 8 }, hovered && { backgroundColor: 'white' }] },
14
- React.createElement(Text, { style: [styles.buttonText, { transitionDuration: '100ms', color: hovered ? 'black' : 'white' }] }, "Retry"))))))),
19
+ React.createElement(View, { style: [
20
+ {
21
+ transitionDuration: "100ms",
22
+ paddingVertical: 12,
23
+ paddingHorizontal: 24,
24
+ borderColor: "white",
25
+ borderWidth: 2,
26
+ marginLeft: 8,
27
+ },
28
+ hovered && { backgroundColor: "white" },
29
+ ] },
30
+ React.createElement(Text, { style: [
31
+ styles.buttonText,
32
+ {
33
+ transitionDuration: "100ms",
34
+ color: hovered ? "black" : "white",
35
+ },
36
+ ] }, "Retry"))))))),
15
37
  React.createElement(StackTrace, { error: error }),
16
- process.env.NODE_ENV === 'development' && React.createElement(Link, { href: '/__index', style: styles.link }, "Sitemap"))));
38
+ process.env.NODE_ENV === "development" && (React.createElement(Link, { href: "/__index", style: styles.link }, "Sitemap")))));
17
39
  }
18
40
  function StackTrace({ error }) {
19
- return (React.createElement(ScrollView, { style: { marginVertical: 8, borderColor: 'rgba(255,255,255,0.5)', borderWidth: 1, padding: 12, } },
20
- React.createElement(Text, { style: [styles.code, { color: 'white' }] }, error.stack)));
41
+ return (React.createElement(ScrollView, { style: {
42
+ marginVertical: 8,
43
+ borderColor: "rgba(255,255,255,0.5)",
44
+ borderWidth: 1,
45
+ padding: 12,
46
+ } },
47
+ React.createElement(Text, { style: [styles.code, { color: "white" }] }, error.stack)));
21
48
  }
22
49
  const styles = StyleSheet.create({
23
50
  container: {
@@ -35,12 +62,16 @@ const styles = StyleSheet.create({
35
62
  },
36
63
  buttonText: {
37
64
  fontSize: 18,
38
- fontWeight: 'bold',
39
- color: 'black',
65
+ fontWeight: "bold",
66
+ color: "black",
40
67
  },
41
68
  code: {
42
- fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),
43
- fontWeight: '500',
69
+ fontFamily: Platform.select({
70
+ default: "Courier",
71
+ ios: "Courier New",
72
+ android: "monospace",
73
+ }),
74
+ fontWeight: "500",
44
75
  },
45
76
  subtitle: {
46
77
  color: "white",
@@ -48,6 +79,12 @@ const styles = StyleSheet.create({
48
79
  marginBottom: 12,
49
80
  // textAlign: "center",
50
81
  },
51
- link: { color: "rgba(255,255,255,0.4)", textDecorationStyle: 'solid', textDecorationLine: 'underline', fontSize: 14, textAlign: "center" },
82
+ link: {
83
+ color: "rgba(255,255,255,0.4)",
84
+ textDecorationStyle: "solid",
85
+ textDecorationLine: "underline",
86
+ fontSize: 14,
87
+ textAlign: "center",
88
+ },
52
89
  });
53
90
  //# sourceMappingURL=ErrorBoundary.js.map
@@ -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;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,MA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AAE,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG;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"]}
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;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAsB;IAChE,OAAO,CACL,oBAAC,IAAI,IAAC,iBAAiB,EAAC,MAAM,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;QACtD,oBAAC,YAAY,IACX,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE;YAE3D,oBAAC,IAAI,IACH,KAAK,EAAE;oBACL,YAAY,EAAE,EAAE;oBAChB,aAAa,EAAE,KAAK;oBACpB,QAAQ,EAAE,MAAM;oBAChB,cAAc,EAAE,eAAe;oBAC/B,UAAU,EAAE,QAAQ;iBACrB;gBAED,oBAAC,IAAI,IACH,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,MAAM,CAAC,KAAK,2BAGd;gBACP,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE;oBACzD,oBAAC,SAAS,QACP,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAChB,oBAAC,gBAAgB,IAAC,OA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SAAS;QACrB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QAEZ,uBAAuB;QACvB,UAAU,EAAE,MAAM;KACnB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,OAAO;KACf;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,uBAAuB;KACxB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,mBAAmB,EAAE,OAAO;QAC5B,kBAAkB,EAAE,WAAW;QAC/B,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,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 { Link } from \"../link/Link\";\nimport { ErrorBoundaryProps } from \"./Try\";\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n return (\n <View accessibilityRole=\"main\" style={[styles.container]}>\n <SafeAreaView\n style={{ flex: 1, maxWidth: 720, marginHorizontal: \"auto\" }}\n >\n <View\n style={{\n marginBottom: 12,\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <Text\n accessibilityRole=\"header\"\n 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\n style={[\n {\n transitionDuration: \"100ms\",\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: \"white\",\n borderWidth: 2,\n marginLeft: 8,\n },\n hovered && { backgroundColor: \"white\" },\n ]}\n >\n <Text\n style={[\n styles.buttonText,\n {\n transitionDuration: \"100ms\",\n color: hovered ? \"black\" : \"white\",\n },\n ]}\n >\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\" && (\n <Link href=\"/__index\" style={styles.link}>\n Sitemap\n </Link>\n )}\n </SafeAreaView>\n </View>\n );\n}\n\nfunction StackTrace({ error }: { error: Error }) {\n return (\n <ScrollView\n style={{\n marginVertical: 8,\n borderColor: \"rgba(255,255,255,0.5)\",\n borderWidth: 1,\n padding: 12,\n }}\n >\n <Text style={[styles.code, { color: \"white\" }]}>{error.stack}</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({\n default: \"Courier\",\n ios: \"Courier New\",\n android: \"monospace\",\n }),\n fontWeight: \"500\",\n },\n subtitle: {\n color: \"white\",\n fontSize: 14,\n marginBottom: 12,\n // textAlign: \"center\",\n },\n link: {\n color: \"rgba(255,255,255,0.4)\",\n textDecorationStyle: \"solid\",\n textDecorationLine: \"underline\",\n fontSize: 14,\n textAlign: \"center\",\n },\n});\n"]}
@@ -30,7 +30,7 @@ export declare function useLayoutContext(): {
30
30
  };
31
31
  export declare function useChild(): any;
32
32
  /** Renders the currently selected content. */
33
- export declare function Children(props: Omit<LayoutProps, "children">): any;
33
+ export declare function Children(props: Omit<LayoutProps, "children">): JSX.Element;
34
34
  export declare function TrustedChildren(): any;
35
35
  export declare function DefaultLayout(): JSX.Element;
36
36
  //# sourceMappingURL=Layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,aAAa;gBACZ,MAAM;cACR,MAAM;WACT,GAAG;gBACE,GAAG;iBACF,GAAG;YACR,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACvB,CAAC;AAMhB,oBAAY,WAAW,GAAG;IACxB,gBAAgB,CAAC,EAAE,UAAU,CAC3B,OAAO,oBAAoB,CAC5B,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,EACrB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAoB,GACrB,EAAE,WAAW,eA2Bb;yBAhCe,MAAM;;;;AAkCtB,wBAAgB,gBAAgB;;;;;;;EAM/B;AAED,wBAAgB,QAAQ,QAcvB;AAED,8CAA8C;AAC9C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,OAc5D;AAED,wBAAgB,eAAe,QAE9B;AAED,wBAAgB,aAAa,gBAM5B"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,aAAa;gBACZ,MAAM;cACR,MAAM;WACT,GAAG;gBACE,GAAG;iBACF,GAAG;YACR,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACvB,CAAC;AAMhB,oBAAY,WAAW,GAAG;IACxB,gBAAgB,CAAC,EAAE,UAAU,CAC3B,OAAO,oBAAoB,CAC5B,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,EACrB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAoB,GACrB,EAAE,WAAW,eA2Bb;yBAhCe,MAAM;;;;AAkCtB,wBAAgB,gBAAgB;;;;;;;EAM/B;AAED,wBAAgB,QAAQ,QAcvB;AAED,8CAA8C;AAC9C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,eAc5D;AAED,wBAAgB,eAAe,QAE9B;AAED,wBAAgB,aAAa,gBAM5B"}
@@ -55,7 +55,7 @@ export function Children(props) {
55
55
  return (React.createElement(Layout, { ...props },
56
56
  React.createElement(TrustedChildren, null)));
57
57
  }
58
- return useChild();
58
+ return React.createElement(TrustedChildren, null);
59
59
  }
60
60
  export function TrustedChildren() {
61
61
  return useChild();
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qFAAqF;AACrF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAOtC,IAAI,CAAC,CAAC;AAEhB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;CAC7C;AAWD,+DAA+D;AAC/D,MAAM,UAAU,MAAM,CAAC,EACrB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,GAAG,WAAW,GACR;IACZ,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GACzD,oBAAoB,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,OAAO;QACjB,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAEL,MAAM,QAAQ,GAAG,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IAElD,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IACrB,KAAK,EAAE;YACL,QAAQ,EAAE,QAAQ,IAAI,EAAE;YACxB,UAAU;YACV,KAAK;YACL,UAAU;YACV,WAAW;YACX,MAAM;SACP;QAED,oBAAC,iBAAiB,QAAE,QAA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,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,MAAM,CAAC,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["import {\n RouterFactory,\n StackRouter,\n useNavigationBuilder,\n} from \"@react-navigation/native\";\nimport * as React from \"react\";\n\nimport { useContextKey } from \"../Route\";\nimport { useScreens } from \"../useScreens\";\n\n// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?\nexport const LayoutContext = React.createContext<{\n contextKey: string;\n pathname: string;\n state: any;\n navigation: any;\n descriptors: any;\n router: RouterFactory<any, any, any>;\n} | null>(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n LayoutContext.displayName = \"LayoutContext\";\n}\n\nexport type LayoutProps = {\n initialRouteName?: Parameters<\n typeof useNavigationBuilder\n >[1][\"initialRouteName\"];\n screenOptions?: Parameters<typeof useNavigationBuilder>[1][\"screenOptions\"];\n children?: Parameters<typeof useNavigationBuilder>[1][\"children\"];\n router?: Parameters<typeof useNavigationBuilder>[0];\n};\n\n/** An unstyled custom navigator. Good for basic web layouts */\nexport function Layout({\n initialRouteName,\n screenOptions,\n children,\n router = StackRouter,\n}: LayoutProps) {\n const contextKey = useContextKey();\n const screens = useScreens();\n\n const { state, navigation, descriptors, NavigationContent } =\n useNavigationBuilder(router, {\n children: screens,\n screenOptions,\n initialRouteName,\n });\n\n const selected = state?.routes[state.index]?.name;\n\n return (\n <LayoutContext.Provider\n value={{\n pathname: selected ?? \"\",\n contextKey,\n state,\n navigation,\n descriptors,\n router,\n }}\n >\n <NavigationContent>{children}</NavigationContent>\n </LayoutContext.Provider>\n );\n}\n\nexport function useLayoutContext() {\n const context = React.useContext(LayoutContext);\n if (!context) {\n throw new Error(\"useLayoutContext must be used within a <Layout />\");\n }\n return context;\n}\n\nexport function useChild() {\n const context = useLayoutContext();\n\n const { state, descriptors } = context;\n\n const current = state.routes.find((route, i) => {\n return state.index === i;\n });\n\n if (!current) {\n return null;\n }\n\n return descriptors[current.key]?.render() ?? null;\n}\n\n/** Renders the currently selected content. */\nexport function Children(props: Omit<LayoutProps, \"children\">) {\n const contextKey = useContextKey();\n const context = React.useContext(LayoutContext);\n // Ensure the context is for the current contextKey\n if (context?.contextKey !== contextKey) {\n // Qualify the content and re-export.\n return (\n <Layout {...props}>\n <TrustedChildren />\n </Layout>\n );\n }\n\n return useChild();\n}\n\nexport function TrustedChildren() {\n return useChild();\n}\n\nexport function DefaultLayout() {\n return (\n <Layout>\n <TrustedChildren />\n </Layout>\n );\n}\n\nLayout.Children = Children;\nLayout.useContext = useLayoutContext;\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qFAAqF;AACrF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAOtC,IAAI,CAAC,CAAC;AAEhB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;CAC7C;AAWD,+DAA+D;AAC/D,MAAM,UAAU,MAAM,CAAC,EACrB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,GAAG,WAAW,GACR;IACZ,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GACzD,oBAAoB,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,OAAO;QACjB,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAEL,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,OAAO,CACL,oBAAC,MAAM,OAAK,KAAK;YACf,oBAAC,eAAe,OAAG,CACZ,CACV,CAAC;KACH;IAED,OAAO,oBAAC,eAAe,OAAG,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,QAAQ,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,CACL,oBAAC,MAAM;QACL,oBAAC,eAAe,OAAG,CACZ,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,MAAM,CAAC,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["import {\n RouterFactory,\n StackRouter,\n useNavigationBuilder,\n} from \"@react-navigation/native\";\nimport * as React from \"react\";\n\nimport { useContextKey } from \"../Route\";\nimport { useScreens } from \"../useScreens\";\n\n// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?\nexport const LayoutContext = React.createContext<{\n contextKey: string;\n pathname: string;\n state: any;\n navigation: any;\n descriptors: any;\n router: RouterFactory<any, any, any>;\n} | null>(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n LayoutContext.displayName = \"LayoutContext\";\n}\n\nexport type LayoutProps = {\n initialRouteName?: Parameters<\n typeof useNavigationBuilder\n >[1][\"initialRouteName\"];\n screenOptions?: Parameters<typeof useNavigationBuilder>[1][\"screenOptions\"];\n children?: Parameters<typeof useNavigationBuilder>[1][\"children\"];\n router?: Parameters<typeof useNavigationBuilder>[0];\n};\n\n/** An unstyled custom navigator. Good for basic web layouts */\nexport function Layout({\n initialRouteName,\n screenOptions,\n children,\n router = StackRouter,\n}: LayoutProps) {\n const contextKey = useContextKey();\n const screens = useScreens();\n\n const { state, navigation, descriptors, NavigationContent } =\n useNavigationBuilder(router, {\n children: screens,\n screenOptions,\n initialRouteName,\n });\n\n const selected = state?.routes[state.index]?.name;\n\n return (\n <LayoutContext.Provider\n value={{\n pathname: selected ?? \"\",\n contextKey,\n state,\n navigation,\n descriptors,\n router,\n }}\n >\n <NavigationContent>{children}</NavigationContent>\n </LayoutContext.Provider>\n );\n}\n\nexport function useLayoutContext() {\n const context = React.useContext(LayoutContext);\n if (!context) {\n throw new Error(\"useLayoutContext must be used within a <Layout />\");\n }\n return context;\n}\n\nexport function useChild() {\n const context = useLayoutContext();\n\n const { state, descriptors } = context;\n\n const current = state.routes.find((route, i) => {\n return state.index === i;\n });\n\n if (!current) {\n return null;\n }\n\n return descriptors[current.key]?.render() ?? null;\n}\n\n/** Renders the currently selected content. */\nexport function Children(props: Omit<LayoutProps, \"children\">) {\n const contextKey = useContextKey();\n const context = React.useContext(LayoutContext);\n // Ensure the context is for the current contextKey\n if (context?.contextKey !== contextKey) {\n // Qualify the content and re-export.\n return (\n <Layout {...props}>\n <TrustedChildren />\n </Layout>\n );\n }\n\n return <TrustedChildren />;\n}\n\nexport function TrustedChildren() {\n return useChild();\n}\n\nexport function DefaultLayout() {\n return (\n <Layout>\n <TrustedChildren />\n </Layout>\n );\n}\n\nLayout.Children = Children;\nLayout.useContext = useLayoutContext;\n"]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { RequireContext } from '../types';
2
+ import { RequireContext } from "../types";
3
3
  export declare function ExpoRoot({ context }: {
4
4
  context: RequireContext;
5
5
  }): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../src/views/Root.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAU1C,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,eAYhE"}
1
+ {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../src/views/Root.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAW1C,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,eAehE"}
@@ -1,10 +1,11 @@
1
+ import { StatusBar } from "expo-status-bar";
1
2
  import React from "react";
2
3
  import { SafeAreaProvider } from "react-native-safe-area-context";
3
- import { StatusBar } from 'expo-status-bar';
4
- import { ContextNavigator } from '../ContextNavigator';
4
+ import { ContextNavigator } from "../ContextNavigator";
5
5
  function getGestureHandlerRootView() {
6
6
  try {
7
- return require("react-native-gesture-handler").GestureHandlerRootView;
7
+ return require("react-native-gesture-handler")
8
+ .GestureHandlerRootView;
8
9
  }
9
10
  catch {
10
11
  return React.Fragment;
@@ -1 +1 @@
1
- {"version":3,"file":"Root.js","sourceRoot":"","sources":["../../src/views/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,SAAS,yBAAyB;IAC9B,IAAI;QACA,OAAO,OAAO,CAAC,8BAA8B,CAAC,CAAC,sBAA8F,CAAC;KACjJ;IAAC,MAAM;QACJ,OAAO,KAAK,CAAC,QAAQ,CAAC;KACzB;AACL,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAA+B;IAC7D,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,yBAAyB,EAAE,EAAE,EAAE,CAAC,CAAC;IAEpF,OAAO,CACH,oBAAC,sBAAsB,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACtC,oBAAC,gBAAgB;YACb,oBAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,GAAI;YAEtC,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM,GAAG,CACX,CACE,CAC5B,CAAC;AACN,CAAC","sourcesContent":["import React from \"react\";\n\nimport { SafeAreaProvider } from \"react-native-safe-area-context\";\nimport { StatusBar } from 'expo-status-bar';\n\nimport { ContextNavigator } from '../ContextNavigator';\nimport { RequireContext } from '../types';\n\nfunction getGestureHandlerRootView() {\n try {\n return require(\"react-native-gesture-handler\").GestureHandlerRootView as typeof import('react-native-gesture-handler').GestureHandlerRootView;\n } catch {\n return React.Fragment;\n }\n}\n\nexport function ExpoRoot({ context }: { context: RequireContext }) {\n const GestureHandlerRootView = React.useMemo(() => getGestureHandlerRootView(), []);\n\n return (\n <GestureHandlerRootView style={{ flex: 1 }}>\n <SafeAreaProvider>\n <ContextNavigator context={context} />\n {/* Users can override this by adding another StatusBar element anywhere higher in the component tree. */}\n <StatusBar style=\"auto\" />\n </SafeAreaProvider>\n </GestureHandlerRootView>\n );\n}\n"]}
1
+ {"version":3,"file":"Root.js","sourceRoot":"","sources":["../../src/views/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,SAAS,yBAAyB;IAChC,IAAI;QACF,OAAO,OAAO,CAAC,8BAA8B,CAAC;aAC3C,sBAA8F,CAAC;KACnG;IAAC,MAAM;QACN,OAAO,KAAK,CAAC,QAAQ,CAAC;KACvB;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAA+B;IAC/D,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,CAC1C,GAAG,EAAE,CAAC,yBAAyB,EAAE,EACjC,EAAE,CACH,CAAC;IAEF,OAAO,CACL,oBAAC,sBAAsB,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxC,oBAAC,gBAAgB;YACf,oBAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,GAAI;YAEtC,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM,GAAG,CACT,CACI,CAC1B,CAAC;AACJ,CAAC","sourcesContent":["import { StatusBar } from \"expo-status-bar\";\nimport React from \"react\";\nimport { SafeAreaProvider } from \"react-native-safe-area-context\";\n\nimport { ContextNavigator } from \"../ContextNavigator\";\nimport { RequireContext } from \"../types\";\n\nfunction getGestureHandlerRootView() {\n try {\n return require(\"react-native-gesture-handler\")\n .GestureHandlerRootView as typeof import(\"react-native-gesture-handler\").GestureHandlerRootView;\n } catch {\n return React.Fragment;\n }\n}\n\nexport function ExpoRoot({ context }: { context: RequireContext }) {\n const GestureHandlerRootView = React.useMemo(\n () => getGestureHandlerRootView(),\n []\n );\n\n return (\n <GestureHandlerRootView style={{ flex: 1 }}>\n <SafeAreaProvider>\n <ContextNavigator context={context} />\n {/* Users can override this by adding another StatusBar element anywhere higher in the component tree. */}\n <StatusBar style=\"auto\" />\n </SafeAreaProvider>\n </GestureHandlerRootView>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /** Component for setting the current screen's options dynamically. */
2
- export declare function Screen<TOptions extends {} = {}>({ name, options }: {
2
+ export declare function Screen<TOptions extends object = object>({ name, options, }: {
3
3
  name?: string;
4
4
  initialParams?: Record<string, any>;
5
5
  options?: TOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAGA,sEAAsE;AACtE,wBAAgB,MAAM,CAAC,QAAQ,SAAS,EAAE,GAAG,EAAE,EAAE,EAC7C,IAAI,EACJ,OAAO,EACV,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,CAAA;CAAE,QAmB5E"}
1
+ {"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAGA,sEAAsE;AACtE,wBAAgB,MAAM,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB,QAoBA"}
@@ -1,13 +1,14 @@
1
1
  import { useNavigation } from "@react-navigation/native";
2
2
  import React from "react";
3
3
  /** Component for setting the current screen's options dynamically. */
4
- export function Screen({ name, options }) {
4
+ export function Screen({ name, options, }) {
5
5
  // TODO: Maybe disable all this hook stuff when name is defined.
6
6
  const navigation = useNavigation();
7
7
  React.useLayoutEffect(() => {
8
8
  navigation.setOptions(options ?? {});
9
9
  }, [navigation, options]);
10
10
  if (process.env.NODE_ENV !== "production") {
11
+ // eslint-disable-next-line react-hooks/rules-of-hooks
11
12
  React.useEffect(() => {
12
13
  if (name != null) {
13
14
  throw new Error("Screen components should only use the name prop when nested directly inside a Layout. When a Screen is used for dynamic options it uses the nearest navigation context.");
@@ -1 +1 @@
1
- {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,sEAAsE;AACtE,MAAM,UAAU,MAAM,CAA2B,EAC7C,IAAI,EACJ,OAAO,EACkE;IACzE,gEAAgE;IAChE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACvB,UAAU,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAE1B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACvC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YACjB,IAAI,IAAI,IAAI,IAAI,EAAE;gBACd,MAAM,IAAI,KAAK,CACX,yKAAyK,CAC5K,CAAC;aACL;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { useNavigation } from \"@react-navigation/native\";\nimport React from \"react\";\n\n/** Component for setting the current screen's options dynamically. */\nexport function Screen<TOptions extends {} = {}>({\n name,\n options\n}: { name?: string, initialParams?: Record<string, any>; options?: TOptions }) {\n // TODO: Maybe disable all this hook stuff when name is defined.\n const navigation = useNavigation();\n\n React.useLayoutEffect(() => {\n navigation.setOptions(options ?? {});\n }, [navigation, options]);\n\n if (process.env.NODE_ENV !== \"production\") {\n React.useEffect(() => {\n if (name != null) {\n throw new Error(\n \"Screen components should only use the name prop when nested directly inside a Layout. When a Screen is used for dynamic options it uses the nearest navigation context.\"\n );\n }\n }, [name]);\n }\n\n return null;\n}\n"]}
1
+ {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,sEAAsE;AACtE,MAAM,UAAU,MAAM,CAAmC,EACvD,IAAI,EACJ,OAAO,GAKR;IACC,gEAAgE;IAChE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,UAAU,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAE1B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACzC,sDAAsD;QACtD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YACnB,IAAI,IAAI,IAAI,IAAI,EAAE;gBAChB,MAAM,IAAI,KAAK,CACb,yKAAyK,CAC1K,CAAC;aACH;QACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;KACZ;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { useNavigation } from \"@react-navigation/native\";\nimport React from \"react\";\n\n/** Component for setting the current screen's options dynamically. */\nexport function Screen<TOptions extends object = object>({\n name,\n options,\n}: {\n name?: string;\n initialParams?: Record<string, any>;\n options?: TOptions;\n}) {\n // TODO: Maybe disable all this hook stuff when name is defined.\n const navigation = useNavigation();\n\n React.useLayoutEffect(() => {\n navigation.setOptions(options ?? {});\n }, [navigation, options]);\n\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (name != null) {\n throw new Error(\n \"Screen components should only use the name prop when nested directly inside a Layout. When a Screen is used for dynamic options it uses the nearest navigation context.\"\n );\n }\n }, [name]);\n }\n\n return null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,uDAAuD;AACvD,oBAAY,kBAAkB,GAAG;IAC7B,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC;AAGF,qBAAa,GAAI,SAAQ,KAAK,CAAC,SAAS,CACpC;IACI,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,EACD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CACpB;IACG,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAI5C,KAAK,sBAMH;IAEF,MAAM;CAQT"}
1
+ {"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,uDAAuD;AACvD,oBAAY,kBAAkB,GAAG;IAC/B,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,qBAAa,GAAI,SAAQ,KAAK,CAAC,SAAS,CACtC;IACE,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,EACD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClB;IACC,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAI5C,KAAK,sBAMH;IAEF,MAAM;CAQP"}
@@ -1 +1 @@
1
- {"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,kFAAkF;AAClF,MAAM,OAAO,GAAI,SAAQ,KAAK,CAAC,SAM9B;IACG,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QACxC,OAAO,EAAE,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,GAAG,GAAG,EAAE;QACT,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE;gBACrC,OAAO,EAAE,CAAC;YACd,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM;QACF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,QAAQ,CAAC;SACnB;QACD,OAAO,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,CAAC;IAC9D,CAAC;CACJ","sourcesContent":["import React from \"react\";\n\n/** Props passed to a page's `ErrorBoundary` export. */\nexport type ErrorBoundaryProps = {\n /** Retry rendering the component by clearing the `error` state. */\n retry: () => Promise<void>;\n /** The error that was thrown. */\n error: Error;\n};\n\n// No way to access `getDerivedStateFromError` from a functional component afaict.\nexport class Try extends React.Component<\n {\n catch: React.ComponentType<ErrorBoundaryProps>;\n children: React.ReactNode;\n },\n { error?: Error }\n> {\n state = { error: undefined };\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n retry = () => {\n return new Promise<void>((resolve) => {\n this.setState({ error: undefined }, () => {\n resolve();\n });\n });\n };\n\n render() {\n const { error } = this.state;\n const { catch: ErrorBoundary, children } = this.props;\n if (!error) {\n return children;\n }\n return <ErrorBoundary error={error} retry={this.retry} />;\n }\n}\n"]}
1
+ {"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,kFAAkF;AAClF,MAAM,OAAO,GAAI,SAAQ,KAAK,CAAC,SAM9B;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,KAAK,GAAG,GAAG,EAAE;QACX,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE;gBACvC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACJ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtD,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,QAAQ,CAAC;SACjB;QACD,OAAO,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import React from \"react\";\n\n/** Props passed to a page's `ErrorBoundary` export. */\nexport type ErrorBoundaryProps = {\n /** Retry rendering the component by clearing the `error` state. */\n retry: () => Promise<void>;\n /** The error that was thrown. */\n error: Error;\n};\n\n// No way to access `getDerivedStateFromError` from a functional component afaict.\nexport class Try extends React.Component<\n {\n catch: React.ComponentType<ErrorBoundaryProps>;\n children: React.ReactNode;\n },\n { error?: Error }\n> {\n state = { error: undefined };\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n retry = () => {\n return new Promise<void>((resolve) => {\n this.setState({ error: undefined }, () => {\n resolve();\n });\n });\n };\n\n render() {\n const { error } = this.state;\n const { catch: ErrorBoundary, children } = this.props;\n if (!error) {\n return children;\n }\n return <ErrorBoundary error={error} retry={this.retry} />;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Unmatched.d.ts","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,2CAA2C;AAC3C,eAAO,MAAM,SAAS,+DAkCpB,CAAC"}
1
+ {"version":3,"file":"Unmatched.d.ts","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,2CAA2C;AAC3C,eAAO,MAAM,SAAS,+DAkCpB,CAAC"}
@@ -1,8 +1,7 @@
1
- import React, { forwardRef } from "react";
1
+ import { StyleSheet, Text, View } from "@bacons/react-views";
2
2
  import { createURL } from "expo-linking";
3
- import { StyleSheet } from "@bacons/react-views";
4
- import { Link } from "./Link";
5
- import { Text, View } from "@bacons/react-views";
3
+ import React, { forwardRef } from "react";
4
+ import { Link } from "../link/Link";
6
5
  /** Default screen for unmatched routes. */
7
6
  export const Unmatched = forwardRef((props, ref) => {
8
7
  const url = createURL("");
@@ -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,KAAK,EAAE,MAAM,CAAC,SAAS;QACnC,oBAAC,IAAI,IACD,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAE,CAAC,EACrB,KAAK,EAAE,MAAM,CAAC,KAAK,sBAGhB;QACP,oBAAC,IAAI,IACD,iBAAiB,EAAC,QAAQ,EAC1B,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} 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"]}
1
+ {"version":3,"file":"Unmatched.js","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAC1B,OAAO;IACL,aAAa;IACb,oBAAC,IAAI,IAAC,GAAG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E,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC9D,CAAC,CAAC","sourcesContent":["import { StyleSheet, Text, View } from \"@bacons/react-views\";\nimport { createURL } from \"expo-linking\";\nimport React, { forwardRef } from \"react\";\n\nimport { Link } from \"../link/Link\";\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} 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,13 +1,12 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "main": "build/index.js",
5
5
  "files": [
6
6
  "entry.js",
7
7
  "build",
8
8
  "babel.js",
9
- "assets",
10
- "metro-config.js"
9
+ "assets"
11
10
  ],
12
11
  "repository": {
13
12
  "url": "https://github.com/expo/router.git",
@@ -1 +0,0 @@
1
- {"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../src/linking.ts"],"names":[],"mappings":"AAGA,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAOvD,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CA+BrD;AAID,wBAAgB,UAAU,WAKzB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,cAiC/D;AAED,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"linking.js","sourceRoot":"","sources":["../src/linking.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAEvD,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,8GAA8G;AAC9G,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAS;QACrC,CAAC,KAAK,IAAI,EAAE;YACV,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;YAE1C,gFAAgF;YAChF,oDAAoD;YAEpD,2DAA2D;YAC3D,IACE,GAAG;gBACH,SAAS,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,WAAW,EACnE;gBACA,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClC,+EAA+E;gBAC/E,oFAAoF;gBACpF,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;o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Y,GAAG,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAEhD,CAAC;IAEd,2FAA2F;IAC3F,MAAM,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAEvE,OAAO,GAAG,EAAE;QACV,2FAA2F;QAC3F,IAAI,YAAY,EAAE,MAAM,EAAE;YACxB,YAAY,CAAC,MAAM,EAAE,CAAC;SACvB;aAAM;YACL,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;SACxC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import Constants, { ExecutionEnvironment } from \"expo-constants\";\nimport * as Linking from \"expo-linking\";\n\nimport getPathFromState from \"./fork/getPathFromState\";\nimport getStateFromPath from \"./fork/getStateFromPath\";\n\n// A custom getInitialURL is used on native to ensure the app always starts at\n// the root path if it's launched from something other than a deep link.\n// This helps keep the native functionality working like the web functionality.\n// For example, if you had a root navigator where the first screen was `/settings` and the second was `/index`\n// then `/index` would be used on web and `/settings` would be used on native.\nexport async function getInitialURL(): Promise<string> {\n const url = await Promise.race<string>([\n (async () => {\n const url = await Linking.getInitialURL();\n\n // NOTE(EvanBacon): This could probably be wrapped with the development boundary\n // since Expo Go is mostly just used in development.\n\n // Expo Go is weird and requires the root path to be `/--/`\n if (\n url &&\n Constants.executionEnvironment === ExecutionEnvironment.StoreClient\n ) {\n const parsed = Linking.parse(url);\n // If the URL is defined (default in Expo Go dev apps) and the URL has no path:\n // `exp://192.168.87.39:19000/` then use the default `exp://192.168.87.39:19000/--/`\n if (parsed.path === null || [\"\", \"/\"].includes(parsed.path)) {\n return getRootURL();\n }\n }\n // The path will be nullish in bare apps when the app is launched from the home screen.\n // TODO(EvanBacon): define some policy around notifications.\n return url ?? getRootURL();\n })(),\n new Promise<string>((resolve) =>\n // Timeout in 150ms if `getInitialState` doesn't resolve\n // Workaround for https://github.com/facebook/react-native/issues/25675\n setTimeout(() => resolve(getRootURL()), 150)\n ),\n ]);\n return url;\n}\n\nlet _rootURL: string | undefined;\n\nexport function getRootURL() {\n if (_rootURL === undefined) {\n _rootURL = Linking.createURL(\"/\");\n }\n return _rootURL;\n}\n\nexport function addEventListener(listener: (url: string) => void) {\n let callback: (({ url }: { url: string }) => void) | undefined = undefined;\n\n if (Constants.executionEnvironment === ExecutionEnvironment.StoreClient) {\n // This extra work is only done in the Expo Go app.\n callback = ({ url }: { url: string }) => {\n const parsed = Linking.parse(url);\n // If the URL is defined (default in Expo Go dev apps) and the URL has no path:\n // `exp://192.168.87.39:19000/` then use the default `exp://192.168.87.39:19000/--/`\n if (parsed.path === null || [\"\", \"/\"].includes(parsed.path)) {\n listener(getRootURL());\n } else {\n listener(url);\n }\n };\n } else {\n callback = ({ url }: { url: string }) => listener(url);\n }\n const subscription = Linking.addEventListener(\"url\", callback) as\n | { remove(): void }\n | undefined;\n\n // Storing this in a local variable stops Jest from complaining about import after teardown\n const removeEventListener = Linking.removeEventListener?.bind(Linking);\n\n return () => {\n // https://github.com/facebook/react-native/commit/6d1aca806cee86ad76de771ed3a1cc62982ebcd7\n if (subscription?.remove) {\n subscription.remove();\n } else {\n removeEventListener?.(\"url\", callback);\n }\n };\n}\n\nexport { getStateFromPath, getPathFromState };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLink.d.ts","sourceRoot":"","sources":["../src/useLink.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAgB,OAAO,IAAI;IACzB,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,OAAO,WAAW,CAAC;CAC3B,CAiBA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLink.js","sourceRoot":"","sources":["../src/useLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjD,4EAA4E;AAC5E,MAAM,UAAU,OAAO;IAKrB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,IAAI,EAAE,CAAC,GAAS,EAAE,EAAE;YAClB,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE;QAChC,KAAK,EAAE,WAAW;QAClB,sEAAsE;QACtE,sEAAsE;KACvE,CAAC,EACF,CAAC,UAAU,EAAE,MAAM,CAAC,CACrB,CAAC;AACJ,CAAC","sourcesContent":["import { useLinkTo, useNavigation } from \"@react-navigation/native\";\nimport { useMemo } from \"react\";\n\nimport { Href, resolveHref } from \"./views/Link\";\n\n// Wraps useLinkTo to provide an API which is similar to the Link component.\nexport function useLink(): {\n push: (href: Href) => void;\n back: () => void;\n parse: typeof resolveHref;\n} {\n const linkTo = useLinkTo();\n const navigation = useNavigation();\n\n return useMemo(\n () => ({\n push: (url: Href) => {\n const href = resolveHref(url);\n linkTo(href);\n },\n back: () => navigation?.goBack(),\n parse: resolveHref,\n // TODO(EvanBacon): add `replace`, `pathname`, `query`, maybe `reload`\n // TODO(EvanBacon): add `canGoBack` but maybe more like a `hasContext`\n }),\n [navigation, linkTo]\n );\n}\n"]}
@@ -1,36 +0,0 @@
1
- import { TextProps } from "@bacons/react-views";
2
- import * as React from "react";
3
- import { GestureResponderEvent } from "react-native";
4
- import type { NavigationAction } from "@react-navigation/core";
5
- import type { To } from "@react-navigation/native/src/useLinkTo";
6
- export declare type Href = string | {
7
- pathname?: string;
8
- query?: Record<string, any>;
9
- };
10
- declare type Props<ParamList extends ReactNavigation.RootParamList> = {
11
- /** Add a property which is familiar to */
12
- href?: Href;
13
- /** Forward props to child component. Useful for custom buttons. */
14
- asChild?: boolean;
15
- to?: To<ParamList>;
16
- action?: NavigationAction;
17
- target?: string;
18
- onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
19
- } & (TextProps & {
20
- children: React.ReactNode;
21
- });
22
- /**
23
- * Component to render link to another screen using a path.
24
- * Uses an anchor tag on the web.
25
- *
26
- * @param props.href Absolute path to screen (e.g. `/feeds/hot`).
27
- * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
28
- * @param props.children Child elements to render the content.
29
- */
30
- 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>>;
31
- export declare const resolveHref: (href: {
32
- pathname?: string;
33
- query?: Record<string, any>;
34
- } | string) => string;
35
- export {};
36
- //# sourceMappingURL=Link.d.ts.map
@@ -1 +0,0 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