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.
- package/build/ExpoRoot.d.ts.map +1 -1
- package/build/ExpoRoot.js +57 -15
- package/build/ExpoRoot.js.map +1 -1
- package/build/LocationProvider.d.ts +3 -2
- package/build/LocationProvider.d.ts.map +1 -1
- package/build/LocationProvider.js +17 -5
- package/build/LocationProvider.js.map +1 -1
- package/build/Route.d.ts +1 -0
- package/build/Route.d.ts.map +1 -1
- package/build/Route.js +1 -1
- package/build/Route.js.map +1 -1
- package/build/fork/NavigationContainer.native.js +5 -3
- package/build/fork/NavigationContainer.native.js.map +1 -1
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.js +17 -16
- package/build/fork/extractPathFromURL.js.map +1 -1
- package/build/fork/getPathFromState.d.ts +1 -1
- package/build/fork/getPathFromState.d.ts.map +1 -1
- package/build/fork/getPathFromState.js +10 -35
- package/build/fork/getPathFromState.js.map +1 -1
- package/build/fork/getStateFromPath.d.ts +2 -2
- package/build/fork/getStateFromPath.d.ts.map +1 -1
- package/build/fork/getStateFromPath.js +59 -48
- package/build/fork/getStateFromPath.js.map +1 -1
- package/build/getDevServer/index.d.ts +0 -3
- package/build/getDevServer/index.d.ts.map +1 -1
- package/build/getDevServer/index.js +1 -28
- package/build/getDevServer/index.js.map +1 -1
- package/build/getReactNavigationConfig.d.ts.map +1 -1
- package/build/getReactNavigationConfig.js +3 -0
- package/build/getReactNavigationConfig.js.map +1 -1
- package/build/getRoutes.d.ts +1 -2
- package/build/getRoutes.d.ts.map +1 -1
- package/build/getRoutes.js +51 -49
- package/build/getRoutes.js.map +1 -1
- package/build/getServerManifest.d.ts +4 -0
- package/build/getServerManifest.d.ts.map +1 -1
- package/build/getServerManifest.js +6 -5
- package/build/getServerManifest.js.map +1 -1
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +28 -2
- package/build/global-state/router-store.js.map +1 -1
- package/build/global-state/routing.d.ts +0 -4
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +75 -95
- package/build/global-state/routing.js.map +1 -1
- package/build/head/ExpoHead.ios.js +4 -4
- package/build/head/ExpoHead.ios.js.map +1 -1
- package/build/head/ExpoHead.js +1 -1
- package/build/head/ExpoHead.js.map +1 -1
- package/build/head/url.d.ts.map +1 -1
- package/build/head/url.js +5 -6
- package/build/head/url.js.map +1 -1
- package/build/layouts/Tabs.js +2 -2
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/withLayoutContext.js +1 -1
- package/build/layouts/withLayoutContext.js.map +1 -1
- package/build/link/Link.d.ts +54 -1
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +54 -12
- package/build/link/Link.js.map +1 -1
- package/build/link/useLinkToPathProps.js +2 -2
- package/build/link/useLinkToPathProps.js.map +1 -1
- package/build/matchers.js +1 -1
- package/build/matchers.js.map +1 -1
- package/build/onboard/Tutorial.js +41 -34
- package/build/onboard/Tutorial.js.map +1 -1
- package/build/qualified-entry.js +3 -2
- package/build/qualified-entry.js.map +1 -1
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +28 -4
- package/build/renderRootComponent.js.map +1 -1
- package/build/routes-manifest.d.ts +1 -0
- package/build/routes-manifest.d.ts.map +1 -1
- package/build/routes-manifest.js.map +1 -1
- package/build/sortRoutes.d.ts.map +1 -1
- package/build/sortRoutes.js +21 -2
- package/build/sortRoutes.js.map +1 -1
- package/build/static/html.js +11 -9
- package/build/static/html.js.map +1 -1
- package/build/static/renderStaticContent.d.ts +39 -2
- package/build/static/renderStaticContent.d.ts.map +1 -1
- package/build/static/renderStaticContent.js +28 -6
- package/build/static/renderStaticContent.js.map +1 -1
- package/build/testing-library/index.js +2 -2
- package/build/testing-library/index.js.map +1 -1
- package/build/testing-library/mocks.d.ts +1 -3
- package/build/testing-library/mocks.d.ts.map +1 -1
- package/build/testing-library/mocks.js +7 -5
- package/build/testing-library/mocks.js.map +1 -1
- package/build/testing-library/require-context-ponyfill.js +3 -3
- package/build/testing-library/require-context-ponyfill.js.map +1 -1
- package/build/useScreens.js +19 -16
- package/build/useScreens.js.map +1 -1
- package/build/views/EmptyRoute.js +5 -2
- package/build/views/EmptyRoute.js.map +1 -1
- package/build/views/ErrorBoundary.js +43 -28
- package/build/views/ErrorBoundary.js.map +1 -1
- package/build/views/Navigator.js +16 -10
- package/build/views/Navigator.js.map +1 -1
- package/build/views/Sitemap.js +49 -35
- package/build/views/Sitemap.js.map +1 -1
- package/build/views/Splash.d.ts +1 -27
- package/build/views/Splash.d.ts.map +1 -1
- package/build/views/Splash.js +2 -112
- package/build/views/Splash.js.map +1 -1
- package/build/views/SuspenseFallback.js +3 -2
- package/build/views/SuspenseFallback.js.map +1 -1
- package/build/views/Toast.js +23 -18
- package/build/views/Toast.js.map +1 -1
- package/build/views/Try.js +1 -1
- package/build/views/Try.js.map +1 -1
- package/build/views/Unmatched.js +29 -17
- package/build/views/Unmatched.js.map +1 -1
- package/ios/ExpoHead.podspec +1 -1
- package/package.json +7 -18
- package/build/fork/react-native-web-container.d.ts +0 -8
- package/build/fork/react-native-web-container.d.ts.map +0 -1
- package/build/fork/react-native-web-container.js +0 -8
- package/build/fork/react-native-web-container.js.map +0 -1
- package/build/link/stateOperations.d.ts +0 -81
- package/build/link/stateOperations.d.ts.map +0 -1
- package/build/link/stateOperations.js +0 -105
- package/build/link/stateOperations.js.map +0 -1
- package/types/global.d.ts +0 -38
- package/types/metro-require.d.ts +0 -52
- package/types/react-native-web.d.ts +0 -295
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmD","sourcesContent":["export * as SplashScreen from 'expo-splash-screen';\n"]}
|
|
@@ -7,8 +7,9 @@ exports.SuspenseFallback = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Toast_1 = require("./Toast");
|
|
9
9
|
function SuspenseFallback({ route }) {
|
|
10
|
-
return (
|
|
11
|
-
|
|
10
|
+
return (<Toast_1.ToastWrapper>
|
|
11
|
+
<Toast_1.Toast filename={route?.contextKey}>Bundling...</Toast_1.Toast>
|
|
12
|
+
</Toast_1.ToastWrapper>);
|
|
12
13
|
}
|
|
13
14
|
exports.SuspenseFallback = SuspenseFallback;
|
|
14
15
|
//# sourceMappingURL=SuspenseFallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseFallback.js","sourceRoot":"","sources":["../../src/views/SuspenseFallback.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,mCAA8C;AAG9C,SAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAwB;IAC9D,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"SuspenseFallback.js","sourceRoot":"","sources":["../../src/views/SuspenseFallback.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,mCAA8C;AAG9C,SAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAwB;IAC9D,OAAO,CACL,CAAC,oBAAY,CACX;MAAA,CAAC,aAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,WAAW,EAAE,aAAK,CACxD;IAAA,EAAE,oBAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAND,4CAMC","sourcesContent":["import React from 'react';\n\nimport { Toast, ToastWrapper } from './Toast';\nimport { RouteNode } from '../Route';\n\nexport function SuspenseFallback({ route }: { route: RouteNode }) {\n return (\n <ToastWrapper>\n <Toast filename={route?.contextKey}>Bundling...</Toast>\n </ToastWrapper>\n );\n}\n"]}
|
package/build/views/Toast.js
CHANGED
|
@@ -28,7 +28,9 @@ function useFadeIn() {
|
|
|
28
28
|
function ToastWrapper({ children }) {
|
|
29
29
|
const inTabBar = react_1.default.useContext(bottom_tabs_1.BottomTabBarHeightContext);
|
|
30
30
|
const Wrapper = inTabBar ? react_native_1.View : react_native_safe_area_context_1.SafeAreaView;
|
|
31
|
-
return (
|
|
31
|
+
return (<Wrapper collapsable={false} style={{ flex: 1 }}>
|
|
32
|
+
{children}
|
|
33
|
+
</Wrapper>);
|
|
32
34
|
}
|
|
33
35
|
exports.ToastWrapper = ToastWrapper;
|
|
34
36
|
function Toast({ children, filename, warning, }) {
|
|
@@ -38,23 +40,26 @@ function Toast({ children, filename, warning, }) {
|
|
|
38
40
|
return 'app' + filename.replace(/^\./, '');
|
|
39
41
|
}, [filename]);
|
|
40
42
|
const value = useFadeIn();
|
|
41
|
-
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
return (<react_native_1.View style={styles.container}>
|
|
44
|
+
<react_native_1.Animated.View style={[
|
|
45
|
+
styles.toast,
|
|
46
|
+
// @ts-expect-error: fixed is supported on web.
|
|
47
|
+
{
|
|
48
|
+
position: react_native_1.Platform.select({
|
|
49
|
+
web: 'fixed',
|
|
50
|
+
default: 'absolute',
|
|
51
|
+
}),
|
|
52
|
+
opacity: value,
|
|
53
|
+
},
|
|
54
|
+
]}>
|
|
55
|
+
{!warning && <react_native_1.ActivityIndicator color="white"/>}
|
|
56
|
+
{warning && <react_native_1.Image source={require('expo-router/assets/error.png')} style={styles.icon}/>}
|
|
57
|
+
<react_native_1.View style={{ marginLeft: 8 }}>
|
|
58
|
+
<react_native_1.Text style={styles.text}>{children}</react_native_1.Text>
|
|
59
|
+
{filenamePretty && <react_native_1.Text style={styles.filename}>{filenamePretty}</react_native_1.Text>}
|
|
60
|
+
</react_native_1.View>
|
|
61
|
+
</react_native_1.Animated.View>
|
|
62
|
+
</react_native_1.View>);
|
|
58
63
|
}
|
|
59
64
|
exports.Toast = Toast;
|
|
60
65
|
const styles = react_native_1.StyleSheet.create({
|
package/build/views/Toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/views/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,+DAA0E;AAC1E,kDAA0B;AAC1B,+CAAoG;AACpG,mFAA8D;AAEjD,QAAA,SAAS,GAAG,uBAAQ,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,aAAa;IAClB,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,sDAAsD;IACtD,MAAM,CAAC,KAAK,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,uBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,uBAAQ,CAAC,MAAM,CAAC,KAAK,EAAE;YACrB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,GAAG;YACb,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC,KAAK,EAAE,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,YAAY,CAAC,EAAE,QAAQ,EAAiC;IACtE,MAAM,QAAQ,GAAG,eAAK,CAAC,UAAU,CAAC,uCAAyB,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,mBAAI,CAAC,CAAC,CAAC,6CAAY,CAAC;IAE/C,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"Toast.js","sour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J,CAAC;AArCD,sBAqCC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,eAAe,EAAE,aAAa;QAC9B,IAAI,EAAE,CAAC;KACR;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;IACtD,KAAK,EAAE;QACL,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,uBAAuB;QACpC,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;QACf,eAAe,EAAE,OAAO;KACzB;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtC,QAAQ,EAAE;QACR,UAAU,EAAE,iBAAS;QACrB,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE,EAAE,UAAU,EAAE,iBAAS,EAAE;CAChC,CAAC,CAAC","sourcesContent":["import { BottomTabBarHeightContext } from '@react-navigation/bottom-tabs';\nimport React from 'react';\nimport { ActivityIndicator, Animated, Image, Platform, StyleSheet, Text, View } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nexport const CODE_FONT = Platform.select({\n default: 'Courier',\n ios: 'Courier New',\n android: 'monospace',\n});\n\nfunction useFadeIn() {\n // Returns a React Native Animated value for fading in\n const [value] = React.useState(() => new Animated.Value(0));\n React.useEffect(() => {\n Animated.timing(value, {\n toValue: 1,\n duration: 200,\n useNativeDriver: true,\n }).start();\n }, []);\n return value;\n}\n\nexport function ToastWrapper({ children }: { children: React.ReactNode }) {\n const inTabBar = React.useContext(BottomTabBarHeightContext);\n const Wrapper = inTabBar ? View : SafeAreaView;\n\n return (\n <Wrapper collapsable={false} style={{ flex: 1 }}>\n {children}\n </Wrapper>\n );\n}\n\nexport function Toast({\n children,\n filename,\n warning,\n}: {\n children: React.ReactNode;\n filename?: string;\n warning?: boolean;\n}) {\n const filenamePretty = React.useMemo(() => {\n if (!filename) return undefined;\n return 'app' + filename.replace(/^\\./, '');\n }, [filename]);\n const value = useFadeIn();\n return (\n <View style={styles.container}>\n <Animated.View\n style={[\n styles.toast,\n // @ts-expect-error: fixed is supported on web.\n {\n position: Platform.select({\n web: 'fixed',\n default: 'absolute',\n }),\n opacity: value,\n },\n ]}>\n {!warning && <ActivityIndicator color=\"white\" />}\n {warning && <Image source={require('expo-router/assets/error.png')} style={styles.icon} />}\n <View style={{ marginLeft: 8 }}>\n <Text style={styles.text}>{children}</Text>\n {filenamePretty && <Text style={styles.filename}>{filenamePretty}</Text>}\n </View>\n </Animated.View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'transparent',\n flex: 1,\n },\n icon: { width: 20, height: 20, resizeMode: 'contain' },\n toast: {\n alignItems: 'center',\n borderWidth: 1,\n borderColor: 'rgba(255,255,255,0.2)',\n flexDirection: 'row',\n bottom: 8,\n left: 8,\n paddingVertical: 8,\n paddingHorizontal: 12,\n borderRadius: 4,\n backgroundColor: 'black',\n },\n text: { color: 'white', fontSize: 16 },\n filename: {\n fontFamily: CODE_FONT,\n opacity: 0.8,\n color: 'white',\n fontSize: 12,\n },\n code: { fontFamily: CODE_FONT },\n});\n"]}
|
package/build/views/Try.js
CHANGED
|
@@ -27,7 +27,7 @@ class Try extends react_1.default.Component {
|
|
|
27
27
|
if (!error) {
|
|
28
28
|
return children;
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return <ErrorBoundary error={error} retry={this.retry}/>;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
exports.Try = Try;
|
package/build/views/Try.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,qCAAwC;AAUxC,kFAAkF;AAClF,MAAa,GAAI,SAAQ,eAAK,CAAC,SAM9B;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,mDAAmD;QACnD,qBAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,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,
|
|
1
|
+
{"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,qCAAwC;AAUxC,kFAAkF;AAClF,MAAa,GAAI,SAAQ,eAAK,CAAC,SAM9B;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,mDAAmD;QACnD,qBAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,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,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAG,CAAC;IAC5D,CAAC;CACF;AAhCD,kBAgCC","sourcesContent":["import React from 'react';\n\nimport { SplashScreen } from './Splash';\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 // Force hide the splash screen if an error occurs.\n SplashScreen.hideAsync();\n\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"]}
|
package/build/views/Unmatched.js
CHANGED
|
@@ -19,7 +19,7 @@ function NoSSR({ children }) {
|
|
|
19
19
|
if (!render) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return <>{children}</>;
|
|
23
23
|
}
|
|
24
24
|
/** Default screen for unmatched routes. */
|
|
25
25
|
function Unmatched() {
|
|
@@ -32,22 +32,34 @@ function Unmatched() {
|
|
|
32
32
|
title: 'Not Found',
|
|
33
33
|
});
|
|
34
34
|
}, [navigation]);
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
return (<react_native_1.View style={styles.container}>
|
|
36
|
+
<react_native_1.Text role="heading" aria-level={1} style={styles.title}>
|
|
37
|
+
Unmatched Route
|
|
38
|
+
</react_native_1.Text>
|
|
39
|
+
<react_native_1.Text role="heading" aria-level={2} style={styles.subtitle}>
|
|
40
|
+
Page could not be found.{' '}
|
|
41
|
+
<react_native_1.Text onPress={() => {
|
|
42
|
+
if (router.canGoBack()) {
|
|
43
|
+
router.back();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
router.replace('/');
|
|
47
|
+
}
|
|
48
|
+
}} style={styles.link}>
|
|
49
|
+
Go back.
|
|
50
|
+
</react_native_1.Text>
|
|
51
|
+
</react_native_1.Text>
|
|
52
|
+
|
|
53
|
+
<NoSSR>
|
|
54
|
+
<Link_1.Link href={pathname} replace style={styles.link}>
|
|
55
|
+
{url}
|
|
56
|
+
</Link_1.Link>
|
|
57
|
+
</NoSSR>
|
|
58
|
+
|
|
59
|
+
<Link_1.Link href="/_sitemap" replace style={[styles.link, { marginTop: 8 }]}>
|
|
60
|
+
Sitemap
|
|
61
|
+
</Link_1.Link>
|
|
62
|
+
</react_native_1.View>);
|
|
51
63
|
}
|
|
52
64
|
exports.Unmatched = Unmatched;
|
|
53
65
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Unmatched.js","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAAyC;AACzC,kDAA0B;AAC1B,+CAAsD;AAEtD,oCAAkD;AAClD,uCAAoC;AACpC,oDAAiD;AAEjD,MAAM,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,CAAC,cAAa,CAAC,CAAC;AAE/F,SAAS,KAAK,CAAC,EAAE,QAAQ,EAAiC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,OAAO,
|
|
1
|
+
{"version":3,"file":"Unmatched.js","sourceRoot":"","sources":["../../src/views/Unmatched.tsx"],"names":[],"mappings":";;;;;;AAAA,+CAAyC;AACzC,kDAA0B;AAC1B,+CAAsD;AAEtD,oCAAkD;AAClD,uCAAoC;AACpC,oDAAiD;AAEjD,MAAM,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,CAAC,cAAa,CAAC,CAAC;AAE/F,SAAS,KAAK,CAAC,EAAE,QAAQ,EAAiC;IACxD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC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CAAC,KAAK,CACJ;QAAA,CAAC,WAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC/C;UAAA,CAAC,GAAG,CACN;QAAA,EAAE,WAAI,CACR;MAAA,EAAE,KAAK,CAEP;;MAAA,CAAC,WAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CACpE;;MACF,EAAE,WAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC;AA3CD,8BA2CC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,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;KACnB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE;CAC9D,CAAC,CAAC","sourcesContent":["import { createURL } from 'expo-linking';\nimport React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { usePathname, useRouter } from '../hooks';\nimport { Link } from '../link/Link';\nimport { useNavigation } from '../useNavigation';\n\nconst useLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : function () {};\n\nfunction NoSSR({ children }: { children: React.ReactNode }) {\n const [render, setRender] = React.useState(false);\n React.useEffect(() => {\n setRender(true);\n }, []);\n\n if (!render) {\n return null;\n }\n\n return <>{children}</>;\n}\n\n/** Default screen for unmatched routes. */\nexport function Unmatched() {\n const router = useRouter();\n const navigation = useNavigation();\n const pathname = usePathname();\n const url = createURL(pathname);\n\n useLayoutEffect(() => {\n navigation.setOptions({\n title: 'Not Found',\n });\n }, [navigation]);\n\n return (\n <View style={styles.container}>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Unmatched Route\n </Text>\n <Text role=\"heading\" aria-level={2} style={styles.subtitle}>\n Page could not be found.{' '}\n <Text\n onPress={() => {\n if (router.canGoBack()) {\n router.back();\n } else {\n router.replace('/');\n }\n }}\n style={styles.link}>\n Go back.\n </Text>\n </Text>\n\n <NoSSR>\n <Link href={pathname} replace style={styles.link}>\n {url}\n </Link>\n </NoSSR>\n\n <Link href=\"/_sitemap\" replace style={[styles.link, { marginTop: 8 }]}>\n Sitemap\n </Link>\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/ios/ExpoHead.podspec
CHANGED
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '13.
|
|
13
|
+
s.platform = :ios, '13.4'
|
|
14
14
|
s.swift_version = '5.4'
|
|
15
15
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
16
16
|
s.static_framework = true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,15 +59,6 @@
|
|
|
59
59
|
"react-native",
|
|
60
60
|
"expo"
|
|
61
61
|
],
|
|
62
|
-
"jest": {
|
|
63
|
-
"preset": "jest-expo",
|
|
64
|
-
"roots": [
|
|
65
|
-
"src"
|
|
66
|
-
],
|
|
67
|
-
"setupFilesAfterEnv": [
|
|
68
|
-
"./build/testing-library/mocks.js"
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
62
|
"peerDependencies": {
|
|
72
63
|
"@react-navigation/drawer": "^6.5.8",
|
|
73
64
|
"expo": "^49.0.0",
|
|
@@ -93,22 +84,20 @@
|
|
|
93
84
|
"devDependencies": {
|
|
94
85
|
"@react-navigation/drawer": "^6.5.0",
|
|
95
86
|
"@testing-library/jest-native": "^5.4.2",
|
|
87
|
+
"@testing-library/react": "^14.0.0",
|
|
96
88
|
"@testing-library/react-native": "^12.0.1",
|
|
97
|
-
"@types/url-parse": "^1.4.8",
|
|
98
89
|
"tsd": "^0.28.1"
|
|
99
90
|
},
|
|
100
91
|
"dependencies": {
|
|
101
|
-
"@expo/
|
|
102
|
-
"@expo/
|
|
92
|
+
"@expo/metro-runtime": "3.0.4",
|
|
93
|
+
"@expo/server": "^0.2.0",
|
|
103
94
|
"@radix-ui/react-slot": "1.0.1",
|
|
104
95
|
"@react-navigation/bottom-tabs": "~6.5.7",
|
|
105
96
|
"@react-navigation/native": "~6.1.6",
|
|
106
97
|
"@react-navigation/native-stack": "~6.9.12",
|
|
107
|
-
"expo-splash-screen": "0.
|
|
108
|
-
"query-string": "7.1.3",
|
|
98
|
+
"expo-splash-screen": "0.25.0",
|
|
109
99
|
"react-helmet-async": "^1.3.0",
|
|
110
|
-
"schema-utils": "^4.0.1"
|
|
111
|
-
"url": "^0.11.0"
|
|
100
|
+
"schema-utils": "^4.0.1"
|
|
112
101
|
},
|
|
113
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "3142a086578deffd8704a8f1b6f0f661527d836c"
|
|
114
103
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-native-web-container.d.ts","sourceRoot":"","sources":["../../src/fork/react-native-web-container.tsx"],"names":[],"mappings":"AAAA,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE;;CAAA,OAEjC;kBAFQ,YAAY;;;AAMrB,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function AppContainer({ children }) {
|
|
4
|
-
return children;
|
|
5
|
-
}
|
|
6
|
-
AppContainer.displayName = 'AppContainer';
|
|
7
|
-
exports.default = AppContainer;
|
|
8
|
-
//# sourceMappingURL=react-native-web-container.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-native-web-container.js","sourceRoot":"","sources":["../../src/fork/react-native-web-container.tsx"],"names":[],"mappings":";;AAAA,SAAS,YAAY,CAAC,EAAE,QAAQ,EAAE;IAChC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,kBAAe,YAAY,CAAC","sourcesContent":["function AppContainer({ children }) {\n return children;\n}\n\nAppContainer.displayName = 'AppContainer';\n\nexport default AppContainer;\n"]}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { InitialState, NavigationState, ParamListBase, PartialState, getActionFromState } from '@react-navigation/native';
|
|
2
|
-
import { ResultState } from '../fork/getStateFromPath';
|
|
3
|
-
export type NavigateAction = Extract<ReturnType<typeof getActionFromState>, {
|
|
4
|
-
type: 'NAVIGATE';
|
|
5
|
-
}> & {
|
|
6
|
-
payload: NavigateActionParams;
|
|
7
|
-
};
|
|
8
|
-
export type NavigateActionParams = {
|
|
9
|
-
params?: NavigateActionParams;
|
|
10
|
-
path: string;
|
|
11
|
-
initial: boolean;
|
|
12
|
-
screen: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
};
|
|
15
|
-
/** Return the absolute last route to move to. */
|
|
16
|
-
export declare function findTopRouteForTarget(state: ResultState): Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & {
|
|
17
|
-
state?: Readonly<Partial<Omit<Readonly<{
|
|
18
|
-
key: string;
|
|
19
|
-
index: number;
|
|
20
|
-
routeNames: string[];
|
|
21
|
-
history?: unknown[] | undefined;
|
|
22
|
-
routes: (Readonly<{
|
|
23
|
-
key: string;
|
|
24
|
-
name: string;
|
|
25
|
-
path?: string | undefined;
|
|
26
|
-
}> & Readonly<{
|
|
27
|
-
params?: Readonly<object | undefined>;
|
|
28
|
-
}> & {
|
|
29
|
-
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
30
|
-
})[];
|
|
31
|
-
type: string;
|
|
32
|
-
stale: false;
|
|
33
|
-
}>, "stale" | "routes">> & {
|
|
34
|
-
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & any)[];
|
|
35
|
-
}> | undefined;
|
|
36
|
-
};
|
|
37
|
-
/** @returns true if moving to a sibling inside the same navigator. */
|
|
38
|
-
export declare function isMovingToSiblingRoute(currentState: NavigationState | PartialState<NavigationState> | undefined, targetState: ResultState | undefined): boolean;
|
|
39
|
-
export declare function getQualifiedStateForTopOfTargetState(rootState: InitialState, targetState: ResultState): Readonly<Partial<Omit<Readonly<{
|
|
40
|
-
key: string;
|
|
41
|
-
index: number;
|
|
42
|
-
routeNames: string[];
|
|
43
|
-
history?: unknown[] | undefined;
|
|
44
|
-
routes: (Readonly<{
|
|
45
|
-
key: string;
|
|
46
|
-
name: string;
|
|
47
|
-
path?: string | undefined;
|
|
48
|
-
}> & Readonly<{
|
|
49
|
-
params?: Readonly<object | undefined>;
|
|
50
|
-
}> & {
|
|
51
|
-
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
52
|
-
})[];
|
|
53
|
-
type: string;
|
|
54
|
-
stale: false;
|
|
55
|
-
}>, "stale" | "routes">> & {
|
|
56
|
-
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & {
|
|
57
|
-
state?: Readonly<Partial<Omit<Readonly<{
|
|
58
|
-
key: string;
|
|
59
|
-
index: number;
|
|
60
|
-
routeNames: string[];
|
|
61
|
-
history?: unknown[] | undefined;
|
|
62
|
-
routes: (Readonly<{
|
|
63
|
-
key: string;
|
|
64
|
-
name: string;
|
|
65
|
-
path?: string | undefined;
|
|
66
|
-
}> & Readonly<{
|
|
67
|
-
params?: Readonly<object | undefined>;
|
|
68
|
-
}> & {
|
|
69
|
-
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
70
|
-
})[];
|
|
71
|
-
type: string;
|
|
72
|
-
stale: false;
|
|
73
|
-
}>, "stale" | "routes">> & any> | undefined;
|
|
74
|
-
})[];
|
|
75
|
-
}>;
|
|
76
|
-
export declare function getEarliestMismatchedRoute<T extends ParamListBase>(rootState: NavigationState<T> | undefined, actionParams: NavigateActionParams): {
|
|
77
|
-
name: string;
|
|
78
|
-
params?: any;
|
|
79
|
-
type?: string;
|
|
80
|
-
} | null;
|
|
81
|
-
//# sourceMappingURL=stateOperations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateOperations.d.ts","sourceRoot":"","sources":["../../src/link/stateOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,OAAO,CAClC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EACrC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CACrB,GAAG;IACF,OAAO,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAqBF,iDAAiD;AACjD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;EAIvD;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG,SAAS,EACzE,WAAW,EAAE,WAAW,GAAG,SAAS,GACnC,OAAO,CAgCT;AAKD,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyBzB;AAKD,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,aAAa,EAChE,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,EACzC,YAAY,EAAE,oBAAoB,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgCtD"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEarliestMismatchedRoute = exports.getQualifiedStateForTopOfTargetState = exports.isMovingToSiblingRoute = exports.findTopRouteForTarget = void 0;
|
|
4
|
-
// Get the last state for a given target state (generated from a path).
|
|
5
|
-
function findTopStateForTarget(state) {
|
|
6
|
-
let current = state;
|
|
7
|
-
let previous = state;
|
|
8
|
-
while (current?.routes?.[current?.routes?.length - 1].state != null) {
|
|
9
|
-
previous = current;
|
|
10
|
-
current = current?.routes[current?.routes.length - 1].state;
|
|
11
|
-
}
|
|
12
|
-
// If the last route in the target state is an index route, return the previous state (parent).
|
|
13
|
-
// NOTE: This may need to be updated to support initial route name being a non-standard value.
|
|
14
|
-
if (previous && current?.routes?.[current.routes.length - 1].name === 'index') {
|
|
15
|
-
return previous;
|
|
16
|
-
}
|
|
17
|
-
return current;
|
|
18
|
-
}
|
|
19
|
-
/** Return the absolute last route to move to. */
|
|
20
|
-
function findTopRouteForTarget(state) {
|
|
21
|
-
const nextState = findTopStateForTarget(state);
|
|
22
|
-
// Ensure we get the last route to prevent returning the initial route.
|
|
23
|
-
return nextState.routes?.[nextState.routes.length - 1];
|
|
24
|
-
}
|
|
25
|
-
exports.findTopRouteForTarget = findTopRouteForTarget;
|
|
26
|
-
/** @returns true if moving to a sibling inside the same navigator. */
|
|
27
|
-
function isMovingToSiblingRoute(currentState, targetState) {
|
|
28
|
-
if (!currentState || !targetState) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
// Need to type this, as the current types are not compaitble with the `find`
|
|
32
|
-
const targetRoute = targetState.routes[0];
|
|
33
|
-
// Make sure we're in the same navigator
|
|
34
|
-
if (!currentState.routeNames?.includes(targetRoute.name)) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
// If there's no state, we're at the end of the path
|
|
38
|
-
if (!targetRoute.state) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
// Coerce the types into a more common form
|
|
42
|
-
const currentRoutes = currentState?.routes;
|
|
43
|
-
const locatedState = currentRoutes?.find((r) => r.name === targetRoute.name);
|
|
44
|
-
if (!locatedState) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return isMovingToSiblingRoute(locatedState.state, targetRoute.state);
|
|
48
|
-
}
|
|
49
|
-
exports.isMovingToSiblingRoute = isMovingToSiblingRoute;
|
|
50
|
-
// Given the root state and a target state from `getStateFromPath`,
|
|
51
|
-
// return the root state containing the highest target route matching the root state.
|
|
52
|
-
// This can be used to determine what type of navigator action should be used.
|
|
53
|
-
function getQualifiedStateForTopOfTargetState(rootState, targetState) {
|
|
54
|
-
let current = targetState;
|
|
55
|
-
let currentRoot = rootState;
|
|
56
|
-
while (current?.routes?.[current?.routes?.length - 1].state != null) {
|
|
57
|
-
const nextRoute = current?.routes?.[current?.routes?.length - 1];
|
|
58
|
-
const nextCurrentRoot = currentRoot?.routes?.find((route) => route.name === nextRoute.name)?.state;
|
|
59
|
-
if (nextCurrentRoot == null) {
|
|
60
|
-
return currentRoot;
|
|
61
|
-
// Not sure what to do -- we're tracking against the assumption that
|
|
62
|
-
// all routes in the target state are in the root state
|
|
63
|
-
// currentRoot = undefined;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
currentRoot = nextCurrentRoot;
|
|
67
|
-
}
|
|
68
|
-
current = nextRoute.state;
|
|
69
|
-
}
|
|
70
|
-
return currentRoot;
|
|
71
|
-
}
|
|
72
|
-
exports.getQualifiedStateForTopOfTargetState = getQualifiedStateForTopOfTargetState;
|
|
73
|
-
// Given the root state and a target state from `getStateFromPath`,
|
|
74
|
-
// return the root state containing the highest target route matching the root state.
|
|
75
|
-
// This can be used to determine what type of navigator action should be used.
|
|
76
|
-
function getEarliestMismatchedRoute(rootState, actionParams) {
|
|
77
|
-
const actionName = actionParams.name ?? actionParams.screen;
|
|
78
|
-
if (!rootState?.routes || rootState.index == null) {
|
|
79
|
-
// This should never happen where there's more action than state.
|
|
80
|
-
return {
|
|
81
|
-
name: actionName,
|
|
82
|
-
type: 'stack',
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
const nextCurrentRoot = rootState.routes[rootState.index];
|
|
86
|
-
if (actionName === nextCurrentRoot.name) {
|
|
87
|
-
if (!actionParams.params) {
|
|
88
|
-
// All routes match all the way up, no change required.
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
return getEarliestMismatchedRoute(
|
|
92
|
-
// @react-navigation/native types this as NavigationState | Partial<NavigationState> | undefined
|
|
93
|
-
// In our usage, it's always a NavigationState | undefined
|
|
94
|
-
nextCurrentRoot.state, actionParams.params);
|
|
95
|
-
}
|
|
96
|
-
// There's a selected state but it doesn't match the action state
|
|
97
|
-
// this is now the lowest point of change.
|
|
98
|
-
return {
|
|
99
|
-
name: actionName,
|
|
100
|
-
params: actionParams.params,
|
|
101
|
-
type: rootState.type,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
exports.getEarliestMismatchedRoute = getEarliestMismatchedRoute;
|
|
105
|
-
//# sourceMappingURL=stateOperations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateOperations.js","sourceRoot":"","sources":["../../src/link/stateOperations.ts"],"names":[],"mappings":";;;AAyBA,uEAAuE;AACvE,SAAS,qBAAqB,CAAC,KAAkB;IAC/C,IAAI,OAAO,GAAsC,KAAK,CAAC;IACvD,IAAI,QAAQ,GAAsC,KAAK,CAAC;IAExD,OAAO,OAAO,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,EAAE;QACnE,QAAQ,GAAG,OAAO,CAAC;QACnB,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;KAC7D;IAED,+FAA+F;IAC/F,8FAA8F;IAC9F,IAAI,QAAQ,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,IAAI,KAAK,OAAO,EAAE;QAC9E,OAAO,QAAQ,CAA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gG;QAChG,0DAA0D;QAC1D,eAAe,CAAC,KAAuC,EACvD,YAAY,CAAC,MAAM,CACpB,CAAC;KACH;IAED,iEAAiE;IACjE,0CAA0C;IAC1C,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,IAAI,EAAE,SAAS,CAAC,IAAI;KACrB,CAAC;AACJ,CAAC;AAnCD,gEAmCC","sourcesContent":["import {\n InitialState,\n NavigationState,\n ParamListBase,\n PartialState,\n getActionFromState,\n} from '@react-navigation/native';\n\nimport { ResultState } from '../fork/getStateFromPath';\n\nexport type NavigateAction = Extract<\n ReturnType<typeof getActionFromState>,\n { type: 'NAVIGATE' }\n> & {\n payload: NavigateActionParams;\n};\n\nexport type NavigateActionParams = {\n params?: NavigateActionParams;\n path: string;\n initial: boolean;\n screen: string;\n name?: string;\n};\n\n// Get the last state for a given target state (generated from a path).\nfunction findTopStateForTarget(state: ResultState) {\n let current: Partial<InitialState> | undefined = state;\n let previous: Partial<InitialState> | undefined = state;\n\n while (current?.routes?.[current?.routes?.length - 1].state != null) {\n previous = current;\n current = current?.routes[current?.routes.length - 1].state;\n }\n\n // If the last route in the target state is an index route, return the previous state (parent).\n // NOTE: This may need to be updated to support initial route name being a non-standard value.\n if (previous && current?.routes?.[current.routes.length - 1]!.name === 'index') {\n return previous;\n }\n\n return current;\n}\n\n/** Return the absolute last route to move to. */\nexport function findTopRouteForTarget(state: ResultState) {\n const nextState = findTopStateForTarget(state)!;\n // Ensure we get the last route to prevent returning the initial route.\n return nextState.routes?.[nextState.routes.length - 1]!;\n}\n\n/** @returns true if moving to a sibling inside the same navigator. */\nexport function isMovingToSiblingRoute(\n currentState: NavigationState | PartialState<NavigationState> | undefined,\n targetState: ResultState | undefined\n): boolean {\n if (!currentState || !targetState) {\n return false;\n }\n\n // Need to type this, as the current types are not compaitble with the `find`\n const targetRoute = targetState.routes[0];\n\n // Make sure we're in the same navigator\n if (!currentState.routeNames?.includes(targetRoute.name)) {\n return false;\n }\n\n // If there's no state, we're at the end of the path\n if (!targetRoute.state) {\n return true;\n }\n\n // Coerce the types into a more common form\n const currentRoutes:\n | {\n name: string;\n state?: NavigationState | PartialState<NavigationState>;\n }[]\n | undefined = currentState?.routes;\n const locatedState = currentRoutes?.find((r) => r.name === targetRoute.name);\n\n if (!locatedState) {\n return false;\n }\n\n return isMovingToSiblingRoute(locatedState.state, targetRoute.state);\n}\n\n// Given the root state and a target state from `getStateFromPath`,\n// return the root state containing the highest target route matching the root state.\n// This can be used to determine what type of navigator action should be used.\nexport function getQualifiedStateForTopOfTargetState(\n rootState: InitialState,\n targetState: ResultState\n) {\n let current: InitialState | undefined = targetState;\n let currentRoot: InitialState | undefined = rootState;\n\n while (current?.routes?.[current?.routes?.length - 1].state != null) {\n const nextRoute: any = current?.routes?.[current?.routes?.length - 1];\n\n const nextCurrentRoot: InitialState | undefined = currentRoot?.routes?.find(\n (route) => route.name === nextRoute.name\n )?.state;\n\n if (nextCurrentRoot == null) {\n return currentRoot;\n // Not sure what to do -- we're tracking against the assumption that\n // all routes in the target state are in the root state\n // currentRoot = undefined;\n } else {\n currentRoot = nextCurrentRoot;\n }\n\n current = nextRoute.state;\n }\n\n return currentRoot;\n}\n\n// Given the root state and a target state from `getStateFromPath`,\n// return the root state containing the highest target route matching the root state.\n// This can be used to determine what type of navigator action should be used.\nexport function getEarliestMismatchedRoute<T extends ParamListBase>(\n rootState: NavigationState<T> | undefined,\n actionParams: NavigateActionParams\n): { name: string; params?: any; type?: string } | null {\n const actionName = actionParams.name ?? actionParams.screen;\n if (!rootState?.routes || rootState.index == null) {\n // This should never happen where there's more action than state.\n return {\n name: actionName,\n type: 'stack',\n };\n }\n\n const nextCurrentRoot = rootState.routes[rootState.index];\n if (actionName === nextCurrentRoot.name) {\n if (!actionParams.params) {\n // All routes match all the way up, no change required.\n return null;\n }\n\n return getEarliestMismatchedRoute(\n // @react-navigation/native types this as NavigationState | Partial<NavigationState> | undefined\n // In our usage, it's always a NavigationState | undefined\n nextCurrentRoot.state as NavigationState<T> | undefined,\n actionParams.params\n );\n }\n\n // There's a selected state but it doesn't match the action state\n // this is now the lowest point of change.\n return {\n name: actionName,\n params: actionParams.params,\n type: rootState.type,\n };\n}\n"]}
|
package/types/global.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
// Extend the NodeJS namespace
|
|
4
|
-
declare namespace NodeJS {
|
|
5
|
-
interface ProcessEnv {
|
|
6
|
-
readonly NODE_ENV: 'development' | 'production' | 'test';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Create types for CSS modules
|
|
11
|
-
declare module '*.module.css' {
|
|
12
|
-
/** **Experimental:** Import styles that can be used with `react-native-web` components, using the `style` prop. */
|
|
13
|
-
export const unstable_styles: { readonly [key: string]: object };
|
|
14
|
-
|
|
15
|
-
const classes: { readonly [key: string]: string };
|
|
16
|
-
export default classes;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '*.module.sass' {
|
|
20
|
-
/** **Experimental:** Import styles that can be used with `react-native-web` components, using the `style` prop. */
|
|
21
|
-
export const unstable_styles: { readonly [key: string]: object };
|
|
22
|
-
|
|
23
|
-
const classes: { readonly [key: string]: string };
|
|
24
|
-
export default classes;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
declare module '*.module.scss' {
|
|
28
|
-
/** **Experimental:** Import styles that can be used with `react-native-web` components, using the `style` prop. */
|
|
29
|
-
export const unstable_styles: { readonly [key: string]: object };
|
|
30
|
-
|
|
31
|
-
const classes: { readonly [key: string]: string };
|
|
32
|
-
export default classes;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Allow for css imports, but don't export anything
|
|
36
|
-
declare module '*.css';
|
|
37
|
-
declare module '*.sass';
|
|
38
|
-
declare module '*.scss';
|