expo-router 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/build/ExpoRoot.d.ts.map +1 -1
  2. package/build/ExpoRoot.js +57 -15
  3. package/build/ExpoRoot.js.map +1 -1
  4. package/build/LocationProvider.d.ts +3 -2
  5. package/build/LocationProvider.d.ts.map +1 -1
  6. package/build/LocationProvider.js +17 -5
  7. package/build/LocationProvider.js.map +1 -1
  8. package/build/Route.d.ts +1 -0
  9. package/build/Route.d.ts.map +1 -1
  10. package/build/Route.js +1 -1
  11. package/build/Route.js.map +1 -1
  12. package/build/fork/NavigationContainer.native.js +5 -3
  13. package/build/fork/NavigationContainer.native.js.map +1 -1
  14. package/build/fork/extractPathFromURL.d.ts.map +1 -1
  15. package/build/fork/extractPathFromURL.js +17 -16
  16. package/build/fork/extractPathFromURL.js.map +1 -1
  17. package/build/fork/getPathFromState.d.ts +1 -1
  18. package/build/fork/getPathFromState.d.ts.map +1 -1
  19. package/build/fork/getPathFromState.js +10 -35
  20. package/build/fork/getPathFromState.js.map +1 -1
  21. package/build/fork/getStateFromPath.d.ts +2 -2
  22. package/build/fork/getStateFromPath.d.ts.map +1 -1
  23. package/build/fork/getStateFromPath.js +59 -48
  24. package/build/fork/getStateFromPath.js.map +1 -1
  25. package/build/getDevServer/index.d.ts +0 -3
  26. package/build/getDevServer/index.d.ts.map +1 -1
  27. package/build/getDevServer/index.js +1 -28
  28. package/build/getDevServer/index.js.map +1 -1
  29. package/build/getReactNavigationConfig.d.ts.map +1 -1
  30. package/build/getReactNavigationConfig.js +3 -0
  31. package/build/getReactNavigationConfig.js.map +1 -1
  32. package/build/getRoutes.d.ts +1 -2
  33. package/build/getRoutes.d.ts.map +1 -1
  34. package/build/getRoutes.js +51 -49
  35. package/build/getRoutes.js.map +1 -1
  36. package/build/getServerManifest.d.ts +4 -0
  37. package/build/getServerManifest.d.ts.map +1 -1
  38. package/build/getServerManifest.js +6 -5
  39. package/build/getServerManifest.js.map +1 -1
  40. package/build/global-state/router-store.d.ts.map +1 -1
  41. package/build/global-state/router-store.js +28 -2
  42. package/build/global-state/router-store.js.map +1 -1
  43. package/build/global-state/routing.d.ts +0 -4
  44. package/build/global-state/routing.d.ts.map +1 -1
  45. package/build/global-state/routing.js +75 -95
  46. package/build/global-state/routing.js.map +1 -1
  47. package/build/head/ExpoHead.ios.js +4 -4
  48. package/build/head/ExpoHead.ios.js.map +1 -1
  49. package/build/head/ExpoHead.js +1 -1
  50. package/build/head/ExpoHead.js.map +1 -1
  51. package/build/head/url.d.ts.map +1 -1
  52. package/build/head/url.js +5 -6
  53. package/build/head/url.js.map +1 -1
  54. package/build/layouts/Tabs.js +2 -2
  55. package/build/layouts/Tabs.js.map +1 -1
  56. package/build/layouts/withLayoutContext.js +1 -1
  57. package/build/layouts/withLayoutContext.js.map +1 -1
  58. package/build/link/Link.d.ts +54 -1
  59. package/build/link/Link.d.ts.map +1 -1
  60. package/build/link/Link.js +54 -12
  61. package/build/link/Link.js.map +1 -1
  62. package/build/link/useLinkToPathProps.js +2 -2
  63. package/build/link/useLinkToPathProps.js.map +1 -1
  64. package/build/matchers.js +1 -1
  65. package/build/matchers.js.map +1 -1
  66. package/build/onboard/Tutorial.js +41 -34
  67. package/build/onboard/Tutorial.js.map +1 -1
  68. package/build/qualified-entry.js +3 -2
  69. package/build/qualified-entry.js.map +1 -1
  70. package/build/renderRootComponent.d.ts.map +1 -1
  71. package/build/renderRootComponent.js +28 -4
  72. package/build/renderRootComponent.js.map +1 -1
  73. package/build/routes-manifest.d.ts +1 -0
  74. package/build/routes-manifest.d.ts.map +1 -1
  75. package/build/routes-manifest.js.map +1 -1
  76. package/build/sortRoutes.d.ts.map +1 -1
  77. package/build/sortRoutes.js +21 -2
  78. package/build/sortRoutes.js.map +1 -1
  79. package/build/static/html.js +11 -9
  80. package/build/static/html.js.map +1 -1
  81. package/build/static/renderStaticContent.d.ts +39 -2
  82. package/build/static/renderStaticContent.d.ts.map +1 -1
  83. package/build/static/renderStaticContent.js +28 -6
  84. package/build/static/renderStaticContent.js.map +1 -1
  85. package/build/testing-library/index.js +2 -2
  86. package/build/testing-library/index.js.map +1 -1
  87. package/build/testing-library/mocks.d.ts +1 -3
  88. package/build/testing-library/mocks.d.ts.map +1 -1
  89. package/build/testing-library/mocks.js +7 -5
  90. package/build/testing-library/mocks.js.map +1 -1
  91. package/build/testing-library/require-context-ponyfill.js +3 -3
  92. package/build/testing-library/require-context-ponyfill.js.map +1 -1
  93. package/build/useScreens.js +19 -16
  94. package/build/useScreens.js.map +1 -1
  95. package/build/views/EmptyRoute.js +5 -2
  96. package/build/views/EmptyRoute.js.map +1 -1
  97. package/build/views/ErrorBoundary.js +43 -28
  98. package/build/views/ErrorBoundary.js.map +1 -1
  99. package/build/views/Navigator.js +16 -10
  100. package/build/views/Navigator.js.map +1 -1
  101. package/build/views/Sitemap.js +49 -35
  102. package/build/views/Sitemap.js.map +1 -1
  103. package/build/views/Splash.d.ts +1 -27
  104. package/build/views/Splash.d.ts.map +1 -1
  105. package/build/views/Splash.js +2 -112
  106. package/build/views/Splash.js.map +1 -1
  107. package/build/views/SuspenseFallback.js +3 -2
  108. package/build/views/SuspenseFallback.js.map +1 -1
  109. package/build/views/Toast.js +23 -18
  110. package/build/views/Toast.js.map +1 -1
  111. package/build/views/Try.js +1 -1
  112. package/build/views/Try.js.map +1 -1
  113. package/build/views/Unmatched.js +29 -17
  114. package/build/views/Unmatched.js.map +1 -1
  115. package/ios/ExpoHead.podspec +1 -1
  116. package/package.json +7 -18
  117. package/build/fork/react-native-web-container.d.ts +0 -8
  118. package/build/fork/react-native-web-container.d.ts.map +0 -1
  119. package/build/fork/react-native-web-container.js +0 -8
  120. package/build/fork/react-native-web-container.js.map +0 -1
  121. package/build/link/stateOperations.d.ts +0 -81
  122. package/build/link/stateOperations.d.ts.map +0 -1
  123. package/build/link/stateOperations.js +0 -105
  124. package/build/link/stateOperations.js.map +0 -1
  125. package/types/global.d.ts +0 -38
  126. package/types/metro-require.d.ts +0 -52
  127. package/types/react-native-web.d.ts +0 -295
@@ -9,8 +9,11 @@ const Toast_1 = require("./Toast");
9
9
  const Route_1 = require("../Route");
10
10
  function EmptyRoute() {
11
11
  const route = (0, Route_1.useRouteNode)();
12
- return (react_1.default.createElement(Toast_1.ToastWrapper, null,
13
- react_1.default.createElement(Toast_1.Toast, { warning: true, filename: route?.contextKey }, "Missing default export")));
12
+ return (<Toast_1.ToastWrapper>
13
+ <Toast_1.Toast warning filename={route?.contextKey}>
14
+ Missing default export
15
+ </Toast_1.Toast>
16
+ </Toast_1.ToastWrapper>);
14
17
  }
15
18
  exports.EmptyRoute = EmptyRoute;
16
19
  //# sourceMappingURL=EmptyRoute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyRoute.js","sourceRoot":"","sources":["../../src/views/EmptyRoute.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,mCAA8C;AAC9C,oCAAwC;AAExC,SAAgB,UAAU;IACxB,MAAM,KAAK,GAAG,IAAA,oBAAY,GAAE,CAAC;IAE7B,OAAO,CACL,8BAAC,oBAAY;QACX,8BAAC,aAAK,IAAC,OAAO,QAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,6BAElC,CACK,CAChB,CAAC;AACJ,CAAC;AAVD,gCAUC","sourcesContent":["import React from 'react';\n\nimport { Toast, ToastWrapper } from './Toast';\nimport { useRouteNode } from '../Route';\n\nexport function EmptyRoute() {\n const route = useRouteNode();\n\n return (\n <ToastWrapper>\n <Toast warning filename={route?.contextKey}>\n Missing default export\n </Toast>\n </ToastWrapper>\n );\n}\n"]}
1
+ {"version":3,"file":"EmptyRoute.js","sourceRoot":"","sources":["../../src/views/EmptyRoute.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,mCAA8C;AAC9C,oCAAwC;AAExC,SAAgB,UAAU;IACxB,MAAM,KAAK,GAAG,IAAA,oBAAY,GAAE,CAAC;IAE7B,OAAO,CACL,CAAC,oBAAY,CACX;MAAA,CAAC,aAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CACzC;;MACF,EAAE,aAAK,CACT;IAAA,EAAE,oBAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAVD,gCAUC","sourcesContent":["import React from 'react';\n\nimport { Toast, ToastWrapper } from './Toast';\nimport { useRouteNode } from '../Route';\n\nexport function EmptyRoute() {\n const route = useRouteNode();\n\n return (\n <ToastWrapper>\n <Toast warning filename={route?.contextKey}>\n Missing default export\n </Toast>\n </ToastWrapper>\n );\n}\n"]}
@@ -54,44 +54,59 @@ if (process.env.NODE_ENV === 'development') {
54
54
  if (!logData?.symbolicated?.stack?.stack) {
55
55
  return null;
56
56
  }
57
- return (react_1.default.createElement(react_native_1.ScrollView, { style: { flex: 1 } },
58
- react_1.default.createElement(LogContext.Provider, { value: {
59
- isDisabled: false,
60
- logs: [logData],
61
- selectedLogIndex: 0,
62
- } },
63
- react_1.default.createElement(LogBoxInspectorStackFrames, { onRetry: function () { }, type: "stack" }))));
57
+ return (<react_native_1.ScrollView style={{ flex: 1 }}>
58
+ <LogContext.Provider value={{
59
+ isDisabled: false,
60
+ logs: [logData],
61
+ selectedLogIndex: 0,
62
+ }}>
63
+ <LogBoxInspectorStackFrames onRetry={function () { }} type="stack"/>
64
+ </LogContext.Provider>
65
+ </react_native_1.ScrollView>);
64
66
  };
65
67
  }
66
68
  else {
67
69
  StackTrace = function () {
68
- return react_1.default.createElement(react_native_1.View, { style: { flex: 1 } });
70
+ return <react_native_1.View style={{ flex: 1 }}/>;
69
71
  };
70
72
  }
71
73
  function ErrorBoundary({ error, retry }) {
72
74
  const logBoxLog = useMetroSymbolication(error);
73
75
  const inTabBar = react_1.default.useContext(bottom_tabs_1.BottomTabBarHeightContext);
74
76
  const Wrapper = inTabBar ? react_native_1.View : react_native_safe_area_context_1.SafeAreaView;
75
- return (react_1.default.createElement(react_native_1.View, { style: styles.container },
76
- react_1.default.createElement(Wrapper, { style: { flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' } },
77
- react_1.default.createElement(react_native_1.View, { style: {
78
- marginBottom: 12,
79
- gap: 4,
80
- flexWrap: 'wrap',
81
- } },
82
- react_1.default.createElement(react_native_1.Text, { role: "heading", "aria-level": 1, style: styles.title }, "Something went wrong"),
83
- react_1.default.createElement(react_native_1.Text, { role: "heading", "aria-level": 2, style: styles.errorMessage },
84
- "Error: ",
85
- error.message)),
86
- react_1.default.createElement(StackTrace, { logData: logBoxLog }),
87
- process.env.NODE_ENV === 'development' && (react_1.default.createElement(Link_1.Link, { href: "/_sitemap", style: styles.link }, "Sitemap")),
88
- react_1.default.createElement(Pressable_1.Pressable, { onPress: retry }, ({ hovered, pressed }) => (react_1.default.createElement(react_native_1.View, { style: [styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }] },
89
- react_1.default.createElement(react_native_1.Text, { style: [
90
- styles.buttonText,
91
- {
92
- color: hovered || pressed ? 'black' : 'white',
93
- },
94
- ] }, "Retry")))))));
77
+ return (<react_native_1.View style={styles.container}>
78
+ <Wrapper style={{ flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' }}>
79
+ <react_native_1.View style={{
80
+ marginBottom: 12,
81
+ gap: 4,
82
+ flexWrap: 'wrap',
83
+ }}>
84
+ <react_native_1.Text role="heading" aria-level={1} style={styles.title}>
85
+ Something went wrong
86
+ </react_native_1.Text>
87
+ <react_native_1.Text role="heading" aria-level={2} style={styles.errorMessage}>
88
+ Error: {error.message}
89
+ </react_native_1.Text>
90
+ </react_native_1.View>
91
+
92
+ <StackTrace logData={logBoxLog}/>
93
+ {process.env.NODE_ENV === 'development' && (<Link_1.Link href="/_sitemap" style={styles.link}>
94
+ Sitemap
95
+ </Link_1.Link>)}
96
+ <Pressable_1.Pressable onPress={retry}>
97
+ {({ hovered, pressed }) => (<react_native_1.View style={[styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }]}>
98
+ <react_native_1.Text style={[
99
+ styles.buttonText,
100
+ {
101
+ color: hovered || pressed ? 'black' : 'white',
102
+ },
103
+ ]}>
104
+ Retry
105
+ </react_native_1.Text>
106
+ </react_native_1.View>)}
107
+ </Pressable_1.Pressable>
108
+ </Wrapper>
109
+ </react_native_1.View>);
95
110
  }
96
111
  exports.ErrorBoundary = ErrorBoundary;
97
112
  const styles = react_native_1.StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";;;;;;AACA,+DAA0E;AAC1E,kDAA0B;AAC1B,+CAA4E;AAC5E,mFAA8D;AAE9D,2CAAwC;AAExC,uCAAoC;AAEpC,IAAI,qBAAyD,CAAC;AAE9D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;IAC1C,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAClC,OAAO,CAAC,iCAAiC,CAAqD,CAAC;IACjG,qBAAqB,GAAG,UAAU,KAAY;QAC5C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAmB,IAAI,CAAC,CAAC;QAEzE,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC;YACrB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAE3C,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC;gBACxB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,aAAa,EAAE,EAAE;iBAClB;gBACD,gBAAgB,EAAE,KAAK;gBACvB,KAAK;gBACL,QAAQ,EAAE,KAAK,CAAC,OAAO;gBACvB,cAAc,EAAE,EAAE;aACnB,CAAC,CAAC;YAEH,GAAG,CAAC,WAAW,CAAC,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Y,EAAE;QACZ,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;KACb;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 type { LogBoxLog } from '@expo/metro-runtime/symbolicate';\nimport { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';\nimport React from 'react';\nimport { StyleSheet, Text, View, Platform, ScrollView } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from '../link/Link';\n\nlet useMetroSymbolication: (error: Error) => LogBoxLog | null;\n\nif (process.env.NODE_ENV === 'development') {\n const { LogBoxLog, parseErrorStack } =\n require('@expo/metro-runtime/symbolicate') as typeof import('@expo/metro-runtime/symbolicate');\n useMetroSymbolication = function (error: Error) {\n const [logBoxLog, setLogBoxLog] = React.useState<LogBoxLog | null>(null);\n\n React.useEffect(() => {\n let isMounted = true;\n const stack = parseErrorStack(error.stack);\n\n const log = new LogBoxLog({\n level: 'error',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: error.message,\n componentStack: [],\n });\n\n log.symbolicate('stack', (symbolicatedLog) => {\n if (isMounted) {\n setLogBoxLog(log);\n }\n });\n\n return () => {\n isMounted = false;\n };\n }, [error]);\n\n return logBoxLog;\n };\n} else {\n useMetroSymbolication = function () {\n return null;\n };\n}\n\nlet StackTrace: React.FC<{ logData: LogBoxLog | null }>;\n\nif (process.env.NODE_ENV === 'development') {\n const { LogContext } = require('@expo/metro-runtime/src/error-overlay/Data/LogContext');\n const {\n LogBoxInspectorStackFrames,\n } = require('@expo/metro-runtime/src/error-overlay/overlay/LogBoxInspectorStackFrames');\n\n StackTrace = function ({ logData }: { logData: LogBoxLog | null }) {\n if (!logData?.symbolicated?.stack?.stack) {\n return null;\n }\n return (\n <ScrollView style={{ flex: 1 }}>\n <LogContext.Provider\n value={{\n isDisabled: false,\n logs: [logData],\n selectedLogIndex: 0,\n }}>\n <LogBoxInspectorStackFrames onRetry={function () {}} type=\"stack\" />\n </LogContext.Provider>\n </ScrollView>\n );\n };\n} else {\n StackTrace = function () {\n return <View style={{ flex: 1 }} />;\n };\n}\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n const logBoxLog = useMetroSymbolication(error);\n const inTabBar = React.useContext(BottomTabBarHeightContext);\n const Wrapper = inTabBar ? View : SafeAreaView;\n\n return (\n <View style={styles.container}>\n <Wrapper style={{ flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' }}>\n <View\n style={{\n marginBottom: 12,\n gap: 4,\n flexWrap: 'wrap',\n }}>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Something went wrong\n </Text>\n <Text role=\"heading\" aria-level={2} style={styles.errorMessage}>\n Error: {error.message}\n </Text>\n </View>\n\n <StackTrace logData={logBoxLog} />\n {process.env.NODE_ENV === 'development' && (\n <Link href=\"/_sitemap\" style={styles.link}>\n Sitemap\n </Link>\n )}\n <Pressable onPress={retry}>\n {({ hovered, pressed }) => (\n <View\n style={[styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }]}>\n <Text\n style={[\n styles.buttonText,\n {\n color: hovered || pressed ? 'black' : 'white',\n },\n ]}>\n Retry\n </Text>\n </View>\n )}\n </Pressable>\n </Wrapper>\n </View>\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: Platform.select({ web: 32, default: 24 }),\n fontWeight: 'bold',\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n buttonInner: {\n transitionDuration: '100ms',\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: 'white',\n borderWidth: 2,\n marginLeft: 8,\n justifyContent: 'center',\n alignItems: 'center',\n },\n code: {\n fontFamily: Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n errorMessage: {\n color: 'white',\n fontSize: 16,\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"]}
1
+ {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";;;;;;AACA,+DAA0E;AAC1E,kDAA0B;AAC1B,+CAA4E;AAC5E,mFAA8D;AAE9D,2CAAwC;AAExC,uCAAoC;AAEpC,IAAI,qBAAyD,CAAC;AAE9D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;IAC1C,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAClC,OAAO,CAAC,iCAAiC,CAAqD,CAAC;IACjG,qBAAqB,GAAG,UAAU,KAAY;QAC5C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAmB,IAAI,CAAC,CAAC;QAEzE,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC;YACrB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAE3C,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC;gBACxB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE;oB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Q,EAAE,uBAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACnD,UAAU,EAAE,MAAM;KACnB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,OAAO;QACd,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;aAC5B;SACF,CAAC;KACH;IACD,WAAW,EAAE;QACX,kBAAkB,EAAE,OAAO;QAC3B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;KACb;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 type { LogBoxLog } from '@expo/metro-runtime/symbolicate';\nimport { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';\nimport React from 'react';\nimport { StyleSheet, Text, View, Platform, ScrollView } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { ErrorBoundaryProps } from './Try';\nimport { Link } from '../link/Link';\n\nlet useMetroSymbolication: (error: Error) => LogBoxLog | null;\n\nif (process.env.NODE_ENV === 'development') {\n const { LogBoxLog, parseErrorStack } =\n require('@expo/metro-runtime/symbolicate') as typeof import('@expo/metro-runtime/symbolicate');\n useMetroSymbolication = function (error: Error) {\n const [logBoxLog, setLogBoxLog] = React.useState<LogBoxLog | null>(null);\n\n React.useEffect(() => {\n let isMounted = true;\n const stack = parseErrorStack(error.stack);\n\n const log = new LogBoxLog({\n level: 'error',\n message: {\n content: error.message,\n substitutions: [],\n },\n isComponentError: false,\n stack,\n category: error.message,\n componentStack: [],\n });\n\n log.symbolicate('stack', (symbolicatedLog) => {\n if (isMounted) {\n setLogBoxLog(log);\n }\n });\n\n return () => {\n isMounted = false;\n };\n }, [error]);\n\n return logBoxLog;\n };\n} else {\n useMetroSymbolication = function () {\n return null;\n };\n}\n\nlet StackTrace: React.FC<{ logData: LogBoxLog | null }>;\n\nif (process.env.NODE_ENV === 'development') {\n const { LogContext } = require('@expo/metro-runtime/src/error-overlay/Data/LogContext');\n const {\n LogBoxInspectorStackFrames,\n } = require('@expo/metro-runtime/src/error-overlay/overlay/LogBoxInspectorStackFrames');\n\n StackTrace = function ({ logData }: { logData: LogBoxLog | null }) {\n if (!logData?.symbolicated?.stack?.stack) {\n return null;\n }\n return (\n <ScrollView style={{ flex: 1 }}>\n <LogContext.Provider\n value={{\n isDisabled: false,\n logs: [logData],\n selectedLogIndex: 0,\n }}>\n <LogBoxInspectorStackFrames onRetry={function () {}} type=\"stack\" />\n </LogContext.Provider>\n </ScrollView>\n );\n };\n} else {\n StackTrace = function () {\n return <View style={{ flex: 1 }} />;\n };\n}\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n const logBoxLog = useMetroSymbolication(error);\n const inTabBar = React.useContext(BottomTabBarHeightContext);\n const Wrapper = inTabBar ? View : SafeAreaView;\n\n return (\n <View style={styles.container}>\n <Wrapper style={{ flex: 1, gap: 8, maxWidth: 720, marginHorizontal: 'auto' }}>\n <View\n style={{\n marginBottom: 12,\n gap: 4,\n flexWrap: 'wrap',\n }}>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Something went wrong\n </Text>\n <Text role=\"heading\" aria-level={2} style={styles.errorMessage}>\n Error: {error.message}\n </Text>\n </View>\n\n <StackTrace logData={logBoxLog} />\n {process.env.NODE_ENV === 'development' && (\n <Link href=\"/_sitemap\" style={styles.link}>\n Sitemap\n </Link>\n )}\n <Pressable onPress={retry}>\n {({ hovered, pressed }) => (\n <View\n style={[styles.buttonInner, (hovered || pressed) && { backgroundColor: 'white' }]}>\n <Text\n style={[\n styles.buttonText,\n {\n color: hovered || pressed ? 'black' : 'white',\n },\n ]}>\n Retry\n </Text>\n </View>\n )}\n </Pressable>\n </Wrapper>\n </View>\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: Platform.select({ web: 32, default: 24 }),\n fontWeight: 'bold',\n },\n buttonText: {\n fontSize: 18,\n fontWeight: 'bold',\n color: 'black',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n buttonInner: {\n transitionDuration: '100ms',\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: 'white',\n borderWidth: 2,\n marginLeft: 8,\n justifyContent: 'center',\n alignItems: 'center',\n },\n code: {\n fontFamily: Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n errorMessage: {\n color: 'white',\n fontSize: 16,\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"]}
@@ -49,7 +49,9 @@ function Navigator({ initialRouteName, screenOptions, children, router }) {
49
49
  console.warn(`Navigator at "${contextKey}" has no children.`);
50
50
  return null;
51
51
  }
52
- return (React.createElement(QualifiedNavigator, { initialRouteName: initialRouteName, screenOptions: screenOptions, screens: sorted, contextKey: contextKey, router: router }, otherSlot));
52
+ return (<QualifiedNavigator initialRouteName={initialRouteName} screenOptions={screenOptions} screens={sorted} contextKey={contextKey} router={router}>
53
+ {otherSlot}
54
+ </QualifiedNavigator>);
53
55
  }
54
56
  exports.Navigator = Navigator;
55
57
  function QualifiedNavigator({ initialRouteName, screenOptions, children, screens, contextKey, router = native_1.StackRouter, }) {
@@ -60,14 +62,15 @@ function QualifiedNavigator({ initialRouteName, screenOptions, children, screens
60
62
  screenOptions,
61
63
  initialRouteName,
62
64
  });
63
- return (React.createElement(exports.NavigatorContext.Provider, { value: {
65
+ return (<exports.NavigatorContext.Provider value={{
64
66
  contextKey,
65
67
  state,
66
68
  navigation,
67
69
  descriptors,
68
70
  router,
69
- } },
70
- React.createElement(NavigationContent, null, children)));
71
+ }}>
72
+ <NavigationContent>{children}</NavigationContent>
73
+ </exports.NavigatorContext.Provider>);
71
74
  }
72
75
  function useNavigatorContext() {
73
76
  const context = React.useContext(exports.NavigatorContext);
@@ -96,10 +99,11 @@ function Slot(props) {
96
99
  // Ensure the context is for the current contextKey
97
100
  if (context?.contextKey !== contextKey) {
98
101
  // Qualify the content and re-export.
99
- return (React.createElement(Navigator, { ...props },
100
- React.createElement(QualifiedSlot, null)));
102
+ return (<Navigator {...props}>
103
+ <QualifiedSlot />
104
+ </Navigator>);
101
105
  }
102
- return React.createElement(QualifiedSlot, null);
106
+ return <QualifiedSlot />;
103
107
  }
104
108
  exports.Slot = Slot;
105
109
  function QualifiedSlot() {
@@ -107,9 +111,11 @@ function QualifiedSlot() {
107
111
  }
108
112
  exports.QualifiedSlot = QualifiedSlot;
109
113
  function DefaultNavigator() {
110
- return (React.createElement(react_native_safe_area_context_1.SafeAreaView, { style: { flex: 1 } },
111
- React.createElement(Navigator, null,
112
- React.createElement(QualifiedSlot, null))));
114
+ return (<react_native_safe_area_context_1.SafeAreaView style={{ flex: 1 }}>
115
+ <Navigator>
116
+ <QualifiedSlot />
117
+ </Navigator>
118
+ </react_native_safe_area_context_1.SafeAreaView>);
113
119
  }
114
120
  exports.DefaultNavigator = DefaultNavigator;
115
121
  Navigator.Slot = Slot;
@@ -1 +1 @@
1
- {"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4F;AAC5F,6CAA+B;AAC/B,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,oEAAuE;AACvE,8CAAiD;AAIjD,qFAAqF;AACxE,QAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAMzC,IAAI,CAAC,CAAC;AAEhB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;CACnD;AASD,+DAA+D;AAC/D,SAAgB,SAAS,CAAC,EAAE,gBAAgB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAkB;IAC7F,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IAEnC,mEAAmE;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,2CAAuB,EAAC,QAAQ,EAAE;QACzE,iBAAiB,EAAE,IAAI;QACvB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,6BAAgB,EAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAE/C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QAClB,OAAO,CAAC,IAAI,CAAC,iBAAiB,UAAU,oBAAoB,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,OAAO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AC,CAAC,CAAC;IAEH,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,IAAI,CAAC;KACb;IAED,OAAO,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;AACpD,CAAC;AAdD,0BAcC;AAED,8CAA8C;AAC9C,SAAgB,IAAI,CAAC,KAAuC;IAC1D,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;IACnD,mDAAmD;IACnD,IAAI,OAAO,EAAE,UAAU,KAAK,UAAU,EAAE;QACtC,qCAAqC;QACrC,OAAO,CACL,oBAAC,SAAS,OAAK,KAAK;YAClB,oBAAC,aAAa,OAAG,CACP,CACb,CAAC;KACH;IAED,OAAO,oBAAC,aAAa,OAAG,CAAC;AAC3B,CAAC;AAdD,oBAcC;AAED,SAAgB,aAAa;IAC3B,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB;IAC9B,OAAO,CACL,oBAAC,6CAAY,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QAC9B,oBAAC,SAAS;YACR,oBAAC,aAAa,OAAG,CACP,CACC,CAChB,CAAC;AACJ,CAAC;AARD,4CAQC;AAED,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AACtB,SAAS,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC","sourcesContent":["import { RouterFactory, StackRouter, useNavigationBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Screen } from './Screen';\nimport { useContextKey } from '../Route';\nimport { useFilterScreenChildren } from '../layouts/withLayoutContext';\nimport { useSortedScreens } from '../useScreens';\n\ntype NavigatorTypes = ReturnType<typeof useNavigationBuilder>;\n\n// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?\nexport const NavigatorContext = React.createContext<{\n contextKey: string;\n state: NavigatorTypes['state'];\n navigation: NavigatorTypes['navigation'];\n descriptors: NavigatorTypes['descriptors'];\n router: RouterFactory<any, any, any>;\n} | null>(null);\n\nif (process.env.NODE_ENV !== 'production') {\n NavigatorContext.displayName = 'NavigatorContext';\n}\n\nexport type NavigatorProps = {\n initialRouteName?: Parameters<typeof useNavigationBuilder>[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 Navigator({ initialRouteName, screenOptions, children, router }: NavigatorProps) {\n const contextKey = useContextKey();\n\n // Allows adding Screen components as children to configure routes.\n const { screens, children: otherSlot } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sorted = useSortedScreens(screens ?? []);\n\n if (!sorted.length) {\n console.warn(`Navigator at \"${contextKey}\" has no children.`);\n return null;\n }\n\n return (\n <QualifiedNavigator\n initialRouteName={initialRouteName}\n screenOptions={screenOptions}\n screens={sorted}\n contextKey={contextKey}\n router={router}>\n {otherSlot}\n </QualifiedNavigator>\n );\n}\n\nfunction QualifiedNavigator({\n initialRouteName,\n screenOptions,\n children,\n screens,\n contextKey,\n router = StackRouter,\n}: NavigatorProps & { contextKey: string; screens: React.ReactNode[] }) {\n const { state, navigation, descriptors, NavigationContent } = useNavigationBuilder(router, {\n // Used for getting the parent with navigation.getParent('/normalized/path')\n id: contextKey,\n children: screens,\n screenOptions,\n initialRouteName,\n });\n\n return (\n <NavigatorContext.Provider\n value={{\n contextKey,\n state,\n navigation,\n descriptors,\n router,\n }}>\n <NavigationContent>{children}</NavigationContent>\n </NavigatorContext.Provider>\n );\n}\n\nexport function useNavigatorContext() {\n const context = React.useContext(NavigatorContext);\n if (!context) {\n throw new Error('useNavigatorContext must be used within a <Navigator />');\n }\n return context;\n}\n\nexport function useSlot() {\n const context = useNavigatorContext();\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 Slot(props: Omit<NavigatorProps, 'children'>) {\n const contextKey = useContextKey();\n const context = React.useContext(NavigatorContext);\n // Ensure the context is for the current contextKey\n if (context?.contextKey !== contextKey) {\n // Qualify the content and re-export.\n return (\n <Navigator {...props}>\n <QualifiedSlot />\n </Navigator>\n );\n }\n\n return <QualifiedSlot />;\n}\n\nexport function QualifiedSlot() {\n return useSlot();\n}\n\nexport function DefaultNavigator() {\n return (\n <SafeAreaView style={{ flex: 1 }}>\n <Navigator>\n <QualifiedSlot />\n </Navigator>\n </SafeAreaView>\n );\n}\n\nNavigator.Slot = Slot;\nNavigator.useContext = useNavigatorContext;\n\n/** Used to configure route settings. */\nNavigator.Screen = Screen;\n"]}
1
+ {"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4F;AAC5F,6CAA+B;AAC/B,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,oEAAuE;AACvE,8CAAiD;AAIjD,qFAAqF;AACxE,QAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAMzC,IAAI,CAAC,CAAC;AAEhB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;CACnD;AASD,+DAA+D;AAC/D,SAAgB,SAAS,CAAC,EAAE,gBAAgB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAkB;IAC7F,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IAEnC,mEAAmE;IACnE,MAAM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AAFD,sCAEC;AAED,SAAgB,gBAAgB;IAC9B,OAAO,CACL,CAAC,6CAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAC/B;MAAA,CAAC,SAAS,CACR;QAAA,CAAC,aAAa,CAAC,AAAD,EAChB;MAAA,EAAE,SAAS,CACb;IAAA,EAAE,6CAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AARD,4CAQC;AAED,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AACtB,SAAS,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC","sourcesContent":["import { RouterFactory, StackRouter, useNavigationBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Screen } from './Screen';\nimport { useContextKey } from '../Route';\nimport { useFilterScreenChildren } from '../layouts/withLayoutContext';\nimport { useSortedScreens } from '../useScreens';\n\ntype NavigatorTypes = ReturnType<typeof useNavigationBuilder>;\n\n// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?\nexport const NavigatorContext = React.createContext<{\n contextKey: string;\n state: NavigatorTypes['state'];\n navigation: NavigatorTypes['navigation'];\n descriptors: NavigatorTypes['descriptors'];\n router: RouterFactory<any, any, any>;\n} | null>(null);\n\nif (process.env.NODE_ENV !== 'production') {\n NavigatorContext.displayName = 'NavigatorContext';\n}\n\nexport type NavigatorProps = {\n initialRouteName?: Parameters<typeof useNavigationBuilder>[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 Navigator({ initialRouteName, screenOptions, children, router }: NavigatorProps) {\n const contextKey = useContextKey();\n\n // Allows adding Screen components as children to configure routes.\n const { screens, children: otherSlot } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sorted = useSortedScreens(screens ?? []);\n\n if (!sorted.length) {\n console.warn(`Navigator at \"${contextKey}\" has no children.`);\n return null;\n }\n\n return (\n <QualifiedNavigator\n initialRouteName={initialRouteName}\n screenOptions={screenOptions}\n screens={sorted}\n contextKey={contextKey}\n router={router}>\n {otherSlot}\n </QualifiedNavigator>\n );\n}\n\nfunction QualifiedNavigator({\n initialRouteName,\n screenOptions,\n children,\n screens,\n contextKey,\n router = StackRouter,\n}: NavigatorProps & { contextKey: string; screens: React.ReactNode[] }) {\n const { state, navigation, descriptors, NavigationContent } = useNavigationBuilder(router, {\n // Used for getting the parent with navigation.getParent('/normalized/path')\n id: contextKey,\n children: screens,\n screenOptions,\n initialRouteName,\n });\n\n return (\n <NavigatorContext.Provider\n value={{\n contextKey,\n state,\n navigation,\n descriptors,\n router,\n }}>\n <NavigationContent>{children}</NavigationContent>\n </NavigatorContext.Provider>\n );\n}\n\nexport function useNavigatorContext() {\n const context = React.useContext(NavigatorContext);\n if (!context) {\n throw new Error('useNavigatorContext must be used within a <Navigator />');\n }\n return context;\n}\n\nexport function useSlot() {\n const context = useNavigatorContext();\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 Slot(props: Omit<NavigatorProps, 'children'>) {\n const contextKey = useContextKey();\n const context = React.useContext(NavigatorContext);\n // Ensure the context is for the current contextKey\n if (context?.contextKey !== contextKey) {\n // Qualify the content and re-export.\n return (\n <Navigator {...props}>\n <QualifiedSlot />\n </Navigator>\n );\n }\n\n return <QualifiedSlot />;\n}\n\nexport function QualifiedSlot() {\n return useSlot();\n}\n\nexport function DefaultNavigator() {\n return (\n <SafeAreaView style={{ flex: 1 }}>\n <Navigator>\n <QualifiedSlot />\n </Navigator>\n </SafeAreaView>\n );\n}\n\nNavigator.Slot = Slot;\nNavigator.useContext = useNavigatorContext;\n\n/** Used to configure route settings. */\nNavigator.Screen = Screen;\n"]}
@@ -38,28 +38,34 @@ exports.getNavOptions = getNavOptions;
38
38
  function Sitemap() {
39
39
  const { top, bottom } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
40
40
  const { width } = (0, react_native_1.useWindowDimensions)();
41
- return (react_1.default.createElement(react_native_1.View, { style: styles.container },
42
- react_1.default.createElement(react_native_1.StatusBar, { barStyle: "light-content" }),
43
- react_1.default.createElement(react_native_1.View, { style: [
44
- styles.main,
45
- {
46
- minWidth: Math.min(960, width * 0.9),
47
- },
48
- ] },
49
- react_1.default.createElement(react_native_1.ScrollView, { contentContainerStyle: [
50
- styles.scroll,
51
- {
52
- paddingTop: top + 12,
53
- paddingBottom: bottom + 12,
54
- },
55
- ], style: { flex: 1 } },
56
- react_1.default.createElement(FileSystemView, null)))));
41
+ return (<react_native_1.View style={styles.container}>
42
+ <react_native_1.StatusBar barStyle="light-content"/>
43
+ <react_native_1.View style={[
44
+ styles.main,
45
+ {
46
+ minWidth: Math.min(960, width * 0.9),
47
+ },
48
+ ]}>
49
+ <react_native_1.ScrollView contentContainerStyle={[
50
+ styles.scroll,
51
+ {
52
+ paddingTop: top + 12,
53
+ paddingBottom: bottom + 12,
54
+ },
55
+ ]} style={{ flex: 1 }}>
56
+ <FileSystemView />
57
+ </react_native_1.ScrollView>
58
+ </react_native_1.View>
59
+ </react_native_1.View>);
57
60
  }
58
61
  exports.Sitemap = Sitemap;
59
62
  function FileSystemView() {
60
63
  const routes = (0, router_store_1.useExpoRouter)().getSortedRoutes();
61
- return (react_1.default.createElement(react_1.default.Fragment, null, routes.map((child) => (react_1.default.createElement(react_native_1.View, { key: child.contextKey, style: styles.itemContainer },
62
- react_1.default.createElement(FileItem, { route: child }))))));
64
+ return (<>
65
+ {routes.map((child) => (<react_native_1.View key={child.contextKey} style={styles.itemContainer}>
66
+ <FileItem route={child}/>
67
+ </react_native_1.View>))}
68
+ </>);
63
69
  }
64
70
  function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
65
71
  const disabled = route.children.length > 0;
@@ -90,16 +96,17 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
90
96
  return segments.slice(-segmentCount).join('/');
91
97
  }, [route]);
92
98
  const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';
93
- return (react_1.default.createElement(react_1.default.Fragment, null,
94
- !route.internal && (react_1.default.createElement(Link_1.Link, { accessibilityLabel: route.contextKey, href: href, onPress: () => {
99
+ return (<>
100
+ {!route.internal && (<Link_1.Link accessibilityLabel={route.contextKey} href={href} onPress={() => {
95
101
  if (react_native_1.Platform.OS !== 'web' && imperative_api_1.router.canGoBack()) {
96
102
  // Ensure the modal pops
97
103
  imperative_api_1.router.back();
98
104
  }
99
- }, style: { flex: 1, display: 'flex' }, disabled: disabled, asChild: true,
100
- // Ensure we replace the history so you can't go back to this page.
101
- replace: true },
102
- react_1.default.createElement(Pressable_1.Pressable, { style: { flex: 1 } }, ({ pressed, hovered }) => (react_1.default.createElement(react_native_1.View, { style: [
105
+ }} style={{ flex: 1, display: 'flex' }} disabled={disabled} asChild
106
+ // Ensure we replace the history so you can't go back to this page.
107
+ replace>
108
+ <Pressable_1.Pressable style={{ flex: 1 }}>
109
+ {({ pressed, hovered }) => (<react_native_1.View style={[
103
110
  styles.itemPressable,
104
111
  {
105
112
  paddingLeft: INDENT + level * INDENT,
@@ -107,23 +114,30 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
107
114
  },
108
115
  pressed && { backgroundColor: '#323232' },
109
116
  disabled && { opacity: 0.4 },
110
- ] },
111
- react_1.default.createElement(react_native_1.View, { style: { flexDirection: 'row', alignItems: 'center' } },
112
- route.children.length ? react_1.default.createElement(PkgIcon, null) : react_1.default.createElement(FileIcon, null),
113
- react_1.default.createElement(react_native_1.Text, { style: styles.filename }, filename)),
114
- react_1.default.createElement(react_native_1.View, { style: { flexDirection: 'row', alignItems: 'center' } },
115
- !!info && (react_1.default.createElement(react_native_1.Text, { style: [styles.virtual, !disabled && { marginRight: 8 }] }, info)),
116
- !disabled && react_1.default.createElement(ForwardIcon, null))))))),
117
- route.children.map((child) => (react_1.default.createElement(FileItem, { key: child.contextKey, route: child, isInitial: route.initialRouteName === child.route, parents: segments, level: level + (route.generated ? 0 : 1) })))));
117
+ ]}>
118
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
119
+ {route.children.length ? <PkgIcon /> : <FileIcon />}
120
+ <react_native_1.Text style={styles.filename}>{filename}</react_native_1.Text>
121
+ </react_native_1.View>
122
+
123
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center' }}>
124
+ {!!info && (<react_native_1.Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</react_native_1.Text>)}
125
+ {!disabled && <ForwardIcon />}
126
+ </react_native_1.View>
127
+ </react_native_1.View>)}
128
+ </Pressable_1.Pressable>
129
+ </Link_1.Link>)}
130
+ {route.children.map((child) => (<FileItem key={child.contextKey} route={child} isInitial={route.initialRouteName === child.route} parents={segments} level={level + (route.generated ? 0 : 1)}/>))}
131
+ </>);
118
132
  }
119
133
  function FileIcon() {
120
- return react_1.default.createElement(react_native_1.Image, { style: styles.image, source: require('expo-router/assets/file.png') });
134
+ return <react_native_1.Image style={styles.image} source={require('expo-router/assets/file.png')}/>;
121
135
  }
122
136
  function PkgIcon() {
123
- return react_1.default.createElement(react_native_1.Image, { style: styles.image, source: require('expo-router/assets/pkg.png') });
137
+ return <react_native_1.Image style={styles.image} source={require('expo-router/assets/pkg.png')}/>;
124
138
  }
125
139
  function ForwardIcon() {
126
- return react_1.default.createElement(react_native_1.Image, { style: styles.image, source: require('expo-router/assets/forward.png') });
140
+ return <react_native_1.Image style={styles.image} source={require('expo-router/assets/forward.png')}/>;
127
141
  }
128
142
  const styles = react_native_1.StyleSheet.create({
129
143
  container: {
@@ -1 +1 @@
1
- {"version":3,"file":"Sitemap.js","sourceRoot":"","sources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AAS;QACtB,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,QAAQ;KACnB;IACD,aAAa,EAAE;QACb,iBAAiB,EAAE,MAAM;QACzB,eAAe,EAAE,EAAE;QACnB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,kBAAkB,EAAE,OAAO;KAC5B;IACD,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\n\nconst INDENT = 24;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n headerShown: false,\n presentation: 'modal',\n animation: 'default',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}>\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}>\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === 'index' ? '' : v;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const segmentCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n style={{ flex: 1, display: 'flex' }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable style={{ flex: 1 }}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? 'rgba(255,255,255,0.1)' : 'transparent',\n },\n pressed && { backgroundColor: '#323232' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n main: {\n marginHorizontal: 'auto',\n flex: 1,\n\n alignItems: 'stretch',\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: 'stretch',\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#323232',\n borderRadius: 19,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n 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"]}
1
+ {"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,+CASsB;AACtB,mFAAmE;AAEnE,2CAAwC;AAExC,+DAA6D;AAC7D,sDAA2C;AAC3C,uCAAoC;AACpC,0CAAwD;AAExD,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAgB,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,OAAO;QACrB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE;YAChB,KAAK,EAAE,OAAO;SACf;QACD,eAAe,EAAE,OAAO;QACxB,qBAAqB,EAAE;YACrB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE;YACX,eAAe,EAAE,OAAO;YACxB,6BAA6B;YAC7B,iBAAiB,EAAE,SAAS;SAC7B;KACF,CAAC;AACJ,CAAC;AApBD,sCAoBC;AAED,SAAgB,OAAO;IACrB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,kCAAmB,GAAE,CAAC;IACxC,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,wBAAS,CAAC,QAAQ,CAAC,eAAe,EACnC;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX;gBACE,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,CAAC;aACrC;SACF,CAAC,CACF;QAAA,CAAC,yBAAU,CACT,qBAAqB,CAAC,CAAC;YACrB,MAAM,CAAC,MAAM;YACb;gBACE,UAAU,EAAE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,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Pressable } from './Pressable';\nimport { RouteNode } from '../Route';\nimport { useExpoRouter } from '../global-state/router-store';\nimport { router } from '../imperative-api';\nimport { Link } from '../link/Link';\nimport { matchDeepDynamicRouteName } from '../matchers';\n\nconst INDENT = 24;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n headerShown: false,\n presentation: 'modal',\n animation: 'default',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}>\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}>\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useExpoRouter().getSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split('/')],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n '/' +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + '/' + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === 'index' ? '' : v;\n })\n .filter(Boolean)\n .join('/')\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split('/');\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return segments[segments.length - 2] + '/' + segments[segments.length - 1];\n }\n\n const segmentCount = route.route.split('/').length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join('/');\n }, [route]);\n\n const info = isInitial ? 'Initial' : route.generated ? 'Virtual' : '';\n\n return (\n <>\n {!route.internal && (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== 'web' && router.canGoBack()) {\n // Ensure the modal pops\n router.back();\n }\n }}\n style={{ flex: 1, display: 'flex' }}\n disabled={disabled}\n asChild\n // Ensure we replace the history so you can't go back to this page.\n replace>\n <Pressable style={{ flex: 1 }}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? 'rgba(255,255,255,0.1)' : 'transparent',\n },\n pressed && { backgroundColor: '#323232' },\n disabled && { opacity: 0.4 },\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && (\n <Text style={[styles.virtual, !disabled && { marginRight: 8 }]}>{info}</Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n )}\n </Pressable>\n </Link>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n main: {\n marginHorizontal: 'auto',\n flex: 1,\n\n alignItems: 'stretch',\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: 'stretch',\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#323232',\n borderRadius: 19,\n marginBottom: 12,\n overflow: 'hidden',\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n 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"]}
@@ -1,28 +1,2 @@
1
- /**
2
- * A stack based component for keeping the splash screen visible.
3
- * Useful for stacked requests that need to be completed before the app is ready.
4
- * After all instances have been unmounted, the splash screen will be hidden.
5
- *
6
- * @example
7
- * ```tsx
8
- * function App() {
9
- * const [isLoading, setIsLoading] = React.useState(true);
10
- *
11
- * if (isLoading) {
12
- * return <SplashScreen />
13
- * }
14
- *
15
- * return <Text>Ready!</Text>
16
- * }
17
- * ```
18
- */
19
- export declare function SplashScreen(): null;
20
- export declare namespace SplashScreen {
21
- var hideAsync: () => void;
22
- var preventAutoHideAsync: () => void;
23
- var _pushEntry: () => any;
24
- var _popEntry: (entry: string) => void;
25
- }
26
- export declare const _internal_preventAutoHideAsync: () => void;
27
- export declare const _internal_maybeHideAsync: () => void;
1
+ export * as SplashScreen from 'expo-splash-screen';
28
2
  //# sourceMappingURL=Splash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,SAM3B;yBANe,YAAY;;;;;;AAmC5B,eAAO,MAAM,8BAA8B,YAe1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAOpC,CAAC"}
1
+ {"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC"}
@@ -23,116 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports._internal_maybeHideAsync = exports._internal_preventAutoHideAsync = exports.SplashScreen = void 0;
27
- const SplashModule = __importStar(require("expo-splash-screen"));
28
- const non_secure_1 = require("nanoid/non-secure");
29
- const React = __importStar(require("react"));
30
- const react_native_1 = require("react-native");
31
- const useDeprecated_1 = require("../useDeprecated");
32
- const globalStack = [];
33
- /**
34
- * A stack based component for keeping the splash screen visible.
35
- * Useful for stacked requests that need to be completed before the app is ready.
36
- * After all instances have been unmounted, the splash screen will be hidden.
37
- *
38
- * @example
39
- * ```tsx
40
- * function App() {
41
- * const [isLoading, setIsLoading] = React.useState(true);
42
- *
43
- * if (isLoading) {
44
- * return <SplashScreen />
45
- * }
46
- *
47
- * return <Text>Ready!</Text>
48
- * }
49
- * ```
50
- */
51
- function SplashScreen() {
52
- useGlobalSplash();
53
- (0, useDeprecated_1.useDeprecated)('The <SplashScreen /> component is deprecated. Use `SplashScreen.preventAutoHideAsync()` and `SplashScreen.hideAsync` from `expo-router` instead.');
54
- return null;
55
- }
56
- exports.SplashScreen = SplashScreen;
57
- function useGlobalSplash() {
58
- const stack = React.useRef(null);
59
- React.useEffect(() => {
60
- // Create a stack entry on component mount
61
- stack.current = SplashScreen._pushEntry();
62
- return () => {
63
- if (stack.current) {
64
- // Update on component unmount
65
- SplashScreen._popEntry(stack.current);
66
- }
67
- };
68
- }, []);
69
- }
70
- SplashScreen.hideAsync = () => {
71
- forceHideAsync();
72
- globalStack.length = 0;
73
- };
74
- let _userControlledAutoHideEnabled = false;
75
- let _preventAutoHideAsyncInvoked = false;
76
- // Expo Router uses this internal method to ensure that we can detect if the user
77
- // has explicitly opted into preventing the splash screen from hiding. This means
78
- // they will also explicitly hide it. If they don't, we will hide it for them after
79
- // the navigation render completes.
80
- const _internal_preventAutoHideAsync = () => {
81
- // Memoize, this should only be called once.
82
- if (_preventAutoHideAsyncInvoked) {
83
- return;
84
- }
85
- _preventAutoHideAsyncInvoked = true;
86
- // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
87
- if (react_native_1.Platform.OS !== 'web' && ErrorUtils?.getGlobalHandler) {
88
- const originalHandler = ErrorUtils.getGlobalHandler();
89
- ErrorUtils.setGlobalHandler((error, isFatal) => {
90
- SplashScreen.hideAsync();
91
- originalHandler(error, isFatal);
92
- });
93
- }
94
- SplashModule.preventAutoHideAsync();
95
- };
96
- exports._internal_preventAutoHideAsync = _internal_preventAutoHideAsync;
97
- const _internal_maybeHideAsync = () => {
98
- // If the user has explicitly opted into preventing the splash screen from hiding,
99
- // we should not hide it for them. This is often used for animated splash screens.
100
- if (_userControlledAutoHideEnabled) {
101
- return;
102
- }
103
- SplashScreen.hideAsync();
104
- };
105
- exports._internal_maybeHideAsync = _internal_maybeHideAsync;
106
- async function forceHideAsync() {
107
- return SplashModule.hideAsync().catch((error) => {
108
- // Hide this very unfortunate error.
109
- if (
110
- // Only throw the error is something unexpected happened.
111
- _preventAutoHideAsyncInvoked &&
112
- error.message.includes('No native splash screen registered for ')) {
113
- return;
114
- }
115
- throw error;
116
- });
117
- }
118
- SplashScreen.preventAutoHideAsync = () => {
119
- _userControlledAutoHideEnabled = true;
120
- (0, exports._internal_preventAutoHideAsync)();
121
- };
122
- SplashScreen._pushEntry = () => {
123
- const entry = (0, non_secure_1.nanoid)();
124
- globalStack.push(entry);
125
- SplashScreen.preventAutoHideAsync();
126
- return entry;
127
- };
128
- SplashScreen._popEntry = (entry) => {
129
- const index = globalStack.indexOf(entry);
130
- if (index !== -1) {
131
- globalStack.splice(index, 1);
132
- }
133
- if (globalStack.length === 0) {
134
- SplashScreen.hideAsync();
135
- }
136
- };
137
- // TODO: Add some detection for if the splash screen is visible
26
+ exports.SplashScreen = void 0;
27
+ exports.SplashScreen = __importStar(require("expo-splash-screen"));
138
28
  //# sourceMappingURL=Splash.js.map