expo-router 4.0.0-preview.11 → 4.0.0-preview.13
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.js +2 -2
- package/build/ExpoRoot.js.map +1 -1
- package/build/exports.d.ts +1 -1
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +24 -2
- package/build/exports.js.map +1 -1
- package/build/fast-refresh.d.ts.map +1 -1
- package/build/fast-refresh.js.map +1 -1
- package/build/getRoutesCore.d.ts +1 -0
- package/build/getRoutesCore.d.ts.map +1 -1
- package/build/getRoutesCore.js +3 -1
- package/build/getRoutesCore.js.map +1 -1
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +1 -2
- package/build/global-state/router-store.js.map +1 -1
- package/build/head/url.d.ts +1 -0
- package/build/head/url.d.ts.map +1 -1
- package/build/head/url.js +21 -4
- package/build/head/url.js.map +1 -1
- package/build/hooks.d.ts +90 -38
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +46 -39
- package/build/hooks.js.map +1 -1
- package/build/imperative-api.d.ts +58 -15
- package/build/imperative-api.d.ts.map +1 -1
- package/build/imperative-api.js.map +1 -1
- package/build/layouts/Drawer.d.ts +2 -142
- package/build/layouts/Drawer.d.ts.map +1 -1
- package/build/layouts/Drawer.js +8 -5
- package/build/layouts/Drawer.js.map +1 -1
- package/build/layouts/DrawerClient.d.ts +144 -0
- package/build/layouts/DrawerClient.d.ts.map +1 -0
- package/build/layouts/DrawerClient.js +10 -0
- package/build/layouts/DrawerClient.js.map +1 -0
- package/build/layouts/Stack.d.ts +2 -126
- package/build/layouts/Stack.d.ts.map +1 -1
- package/build/layouts/Stack.js +8 -6
- package/build/layouts/Stack.js.map +1 -1
- package/build/layouts/StackClient.d.ts +128 -0
- package/build/layouts/StackClient.d.ts.map +1 -0
- package/build/layouts/StackClient.js +10 -0
- package/build/layouts/StackClient.js.map +1 -0
- package/build/layouts/Tabs.d.ts +2 -134
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/layouts/Tabs.js +5 -37
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/TabsClient.d.ts +136 -0
- package/build/layouts/TabsClient.d.ts.map +1 -0
- package/build/layouts/TabsClient.js +44 -0
- package/build/layouts/TabsClient.js.map +1 -0
- package/build/layouts/withLayoutContext.d.ts +4 -1
- package/build/layouts/withLayoutContext.d.ts.map +1 -1
- package/build/layouts/withLayoutContext.js +4 -1
- package/build/layouts/withLayoutContext.js.map +1 -1
- package/build/link/Link.d.ts +48 -4
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +47 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/href.d.ts +1 -1
- package/build/link/href.d.ts.map +1 -1
- package/build/link/href.js.map +1 -1
- package/build/link/useLinkHooks.d.ts +122 -29
- package/build/link/useLinkHooks.d.ts.map +1 -1
- package/build/link/useLinkHooks.js.map +1 -1
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +1 -2
- package/build/renderRootComponent.js.map +1 -1
- package/build/rsc/exports.d.ts +3 -1
- package/build/rsc/exports.d.ts.map +1 -1
- package/build/rsc/exports.js +3 -1
- package/build/rsc/exports.js.map +1 -1
- package/build/rsc/middleware.d.ts +1 -1
- package/build/rsc/middleware.d.ts.map +1 -1
- package/build/rsc/middleware.js +2 -1
- package/build/rsc/middleware.js.map +1 -1
- package/build/rsc/router/client.d.ts +2 -2
- package/build/rsc/router/client.d.ts.map +1 -1
- package/build/rsc/router/client.js.map +1 -1
- package/build/rsc/router/host.d.ts.map +1 -1
- package/build/rsc/router/host.js +20 -15
- package/build/rsc/router/host.js.map +1 -1
- package/build/rsc/rsc-renderer.d.ts +1 -1
- package/build/rsc/rsc-renderer.d.ts.map +1 -1
- package/build/rsc/rsc-renderer.js +1 -1
- package/build/rsc/rsc-renderer.js.map +1 -1
- package/build/rsc/server.d.ts +3 -0
- package/build/rsc/server.d.ts.map +1 -1
- package/build/rsc/server.js +19 -1
- package/build/rsc/server.js.map +1 -1
- package/build/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js +3 -1
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/testing-library/mocks.js +14 -13
- package/build/testing-library/mocks.js.map +1 -1
- package/build/typed-routes/generate.d.ts +5 -1
- package/build/typed-routes/generate.d.ts.map +1 -1
- package/build/typed-routes/generate.js +129 -64
- package/build/typed-routes/generate.js.map +1 -1
- package/build/typed-routes/index.d.ts +5 -0
- package/build/typed-routes/index.d.ts.map +1 -1
- package/build/typed-routes/index.js +8 -3
- package/build/typed-routes/index.js.map +1 -1
- package/build/typed-routes/testSetup.d.ts +1 -1
- package/build/typed-routes/testSetup.d.ts.map +1 -1
- package/build/typed-routes/testSetup.js +29 -17
- package/build/typed-routes/testSetup.js.map +1 -1
- package/build/typed-routes/types.d.ts +43 -145
- package/build/typed-routes/types.d.ts.map +1 -1
- package/build/typed-routes/types.js.map +1 -1
- package/build/types.d.ts +33 -0
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/ui/TabContext.d.ts +158 -1
- package/build/ui/TabContext.d.ts.map +1 -1
- package/build/ui/TabContext.js +25 -1
- package/build/ui/TabContext.js.map +1 -1
- package/build/ui/TabList.d.ts +17 -1
- package/build/ui/TabList.d.ts.map +1 -1
- package/build/ui/TabList.js +16 -0
- package/build/ui/TabList.js.map +1 -1
- package/build/ui/TabSlot.d.ts +55 -5
- package/build/ui/TabSlot.d.ts.map +1 -1
- package/build/ui/TabSlot.js +38 -14
- package/build/ui/TabSlot.js.map +1 -1
- package/build/ui/TabTrigger.d.ts +65 -70
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +25 -1
- package/build/ui/TabTrigger.js.map +1 -1
- package/build/ui/Tabs.d.ts +89 -132
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js +53 -8
- package/build/ui/Tabs.js.map +1 -1
- package/build/ui/common.d.ts +3 -3
- package/build/ui/common.d.ts.map +1 -1
- package/build/ui/common.js.map +1 -1
- package/build/useFocusEffect.d.ts +15 -6
- package/build/useFocusEffect.d.ts.map +1 -1
- package/build/useFocusEffect.js +15 -6
- package/build/useFocusEffect.js.map +1 -1
- package/build/useNavigation.d.ts +11 -5
- package/build/useNavigation.d.ts.map +1 -1
- package/build/useNavigation.js +11 -5
- package/build/useNavigation.js.map +1 -1
- package/build/utils/splash.d.ts +6 -0
- package/build/utils/splash.d.ts.map +1 -0
- package/build/utils/splash.js +51 -0
- package/build/utils/splash.js.map +1 -0
- package/build/views/Navigator.d.ts +6 -5
- package/build/views/Navigator.d.ts.map +1 -1
- package/build/views/Navigator.js +6 -5
- package/build/views/Navigator.js.map +1 -1
- package/build/views/Splash.d.ts +1 -1
- package/build/views/Splash.d.ts.map +1 -1
- package/build/views/Splash.js +3 -13
- package/build/views/Splash.js.map +1 -1
- package/build/views/Try.d.ts +1 -1
- package/build/views/Try.d.ts.map +1 -1
- package/build/views/Try.js +1 -1
- package/build/views/Try.js.map +1 -1
- package/entry-classic.js +0 -6
- package/package.json +3 -5
- package/plugin/build/index.d.ts +2 -0
- package/plugin/options.json +74 -73
- package/rsc/entry.js +0 -6
- package/rsc/headers.d.ts +3 -0
- package/rsc/headers.js +5 -0
- package/build/rsc/runtime.d.ts +0 -9
- package/build/rsc/runtime.d.ts.map +0 -1
- package/build/rsc/runtime.js +0 -36
- package/build/rsc/runtime.js.map +0 -1
- package/virtual-client-boundaries.js +0 -1
package/build/useFocusEffect.js
CHANGED
|
@@ -30,9 +30,12 @@ exports.useFocusEffect = void 0;
|
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const useLoadedNavigation_1 = require("./link/useLoadedNavigation");
|
|
32
32
|
/**
|
|
33
|
-
* Hook to run an effect whenever a route is
|
|
33
|
+
* Hook to run an effect whenever a route is **focused**. Similar to
|
|
34
|
+
* [`React.useEffect`](https://react.dev/reference/react/useEffect).
|
|
35
|
+
*
|
|
34
36
|
* This can be used to perform side-effects such as fetching data or subscribing to events.
|
|
35
|
-
* The passed callback should be wrapped in `React.useCallback`
|
|
37
|
+
* The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)
|
|
38
|
+
* to avoid running the effect too often.
|
|
36
39
|
*
|
|
37
40
|
* @example
|
|
38
41
|
* ```tsx
|
|
@@ -44,10 +47,16 @@ const useLoadedNavigation_1 = require("./link/useLoadedNavigation");
|
|
|
44
47
|
* // Callback should be wrapped in `React.useCallback` to avoid running the effect too often.
|
|
45
48
|
* useCallback(() => {
|
|
46
49
|
* // Invoked whenever the route is focused.
|
|
47
|
-
* console.log('Hello')
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
50
|
+
* console.log('Hello, I'm focused!');
|
|
51
|
+
*
|
|
52
|
+
* // Return function is invoked whenever the route gets out of focus.
|
|
53
|
+
* return () => {
|
|
54
|
+
* console.log('This route is now unfocused.');
|
|
55
|
+
* };
|
|
56
|
+
* }, []);
|
|
57
|
+
* );
|
|
58
|
+
*
|
|
59
|
+
* return </>;
|
|
51
60
|
* }
|
|
52
61
|
*```
|
|
53
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AAOnE
|
|
1
|
+
{"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AAOnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,cAAc,CAAC,MAAsB,EAA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CAAC;aACxB;QACH,CAAC,CAAC;QAEF,mFAAmF;QACnF,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE;YAC1B,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;SAClB;QAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;YAC5D,mEAAmE;YACnE,gGAAgG;YAChG,IAAI,SAAS,EAAE;gBACb,OAAO;aACR;YAED,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE;YAC1D,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,SAAS,CAAC;YACpB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAC3B,CAAC;AAtGD,wCAsGC","sourcesContent":["'use client';\n// A fork of `useFocusEffect` that waits for the navigation state to load before\n// running the effect. This is especially useful for native redirects.\nimport * as React from 'react';\n\nimport { useOptionalNavigation } from './link/useLoadedNavigation';\n\n/**\n * Memoized callback containing the effect, should optionally return a cleanup function.\n */\nexport type EffectCallback = () => undefined | void | (() => void);\n\n/**\n * Hook to run an effect whenever a route is **focused**. Similar to\n * [`React.useEffect`](https://react.dev/reference/react/useEffect).\n *\n * This can be used to perform side-effects such as fetching data or subscribing to events.\n * The passed callback should be wrapped in [`React.useCallback`](https://react.dev/reference/react/useCallback)\n * to avoid running the effect too often.\n *\n * @example\n * ```tsx\n * import { useFocusEffect } from 'expo-router';\n * import { useCallback } from 'react';\n *\n * export default function Route() {\n * useFocusEffect(\n * // Callback should be wrapped in `React.useCallback` to avoid running the effect too often.\n * useCallback(() => {\n * // Invoked whenever the route is focused.\n * console.log('Hello, I'm focused!');\n *\n * // Return function is invoked whenever the route gets out of focus.\n * return () => {\n * console.log('This route is now unfocused.');\n * };\n * }, []);\n * );\n *\n * return </>;\n * }\n *```\n *\n * @param effect Memoized callback containing the effect, should optionally return a cleanup function.\n * @param do_not_pass_a_second_prop\n */\nexport function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never) {\n const navigation = useOptionalNavigation();\n\n if (do_not_pass_a_second_prop !== undefined) {\n const message =\n \"You passed a second argument to 'useFocusEffect', but it only accepts one argument. \" +\n \"If you want to pass a dependency array, you can use 'React.useCallback':\\n\\n\" +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' // Your code here\\n' +\n ' }, [depA, depB])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n\n console.error(message);\n }\n\n React.useEffect(() => {\n if (!navigation) {\n return;\n }\n\n let isFocused = false;\n let cleanup: undefined | void | (() => void);\n\n const callback = () => {\n const destroy = effect();\n\n if (destroy === undefined || typeof destroy === 'function') {\n return destroy;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let message =\n 'An effect function must not return anything besides a function, which is used for clean-up.';\n\n if (destroy === null) {\n message +=\n \" You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing).\";\n } else if (typeof (destroy as any).then === 'function') {\n message +=\n \"\\n\\nIt looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. \" +\n 'Instead, write the async function inside your effect ' +\n 'and call it immediately:\\n\\n' +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' async function fetchData() {\\n' +\n ' // You can await here\\n' +\n ' const response = await MyAPI.getData(someId);\\n' +\n ' // ...\\n' +\n ' }\\n\\n' +\n ' fetchData();\\n' +\n ' }, [someId])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n } else {\n message += ` You returned '${JSON.stringify(destroy)}'.`;\n }\n\n console.error(message);\n }\n };\n\n // We need to run the effect on initial render/dep changes if the screen is focused\n if (navigation.isFocused()) {\n cleanup = callback();\n isFocused = true;\n }\n\n const unsubscribeFocus = navigation.addListener('focus', () => {\n // If callback was already called for focus, avoid calling it again\n // The focus event may also fire on initial render, so we guard against running the effect twice\n if (isFocused) {\n return;\n }\n\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = callback();\n isFocused = true;\n });\n\n const unsubscribeBlur = navigation.addListener('blur', () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = undefined;\n isFocused = false;\n });\n\n return () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [effect, navigation]);\n}\n"]}
|
package/build/useNavigation.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NavigationProp } from '@react-navigation/native';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Returns the underlying React Navigation [`navigation` prop](https://reactnavigation.org/docs/navigation-prop)
|
|
4
|
+
* to imperatively access layout-specific functionality like `navigation.openDrawer()` in a
|
|
5
|
+
* [Drawer](/router/advanced/drawer/) layout.
|
|
4
6
|
*
|
|
5
7
|
* @example
|
|
6
|
-
* ```tsx
|
|
8
|
+
* ```tsx app/index.tsx
|
|
7
9
|
* import { useNavigation } from 'expo-router';
|
|
8
10
|
*
|
|
9
11
|
* export default function Route() {
|
|
@@ -23,7 +25,8 @@ import { NavigationProp } from '@react-navigation/native';
|
|
|
23
25
|
* }
|
|
24
26
|
* ```
|
|
25
27
|
*
|
|
26
|
-
* When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.
|
|
28
|
+
* When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.
|
|
29
|
+
* For example, `/menu/_layout.tsx` is nested inside `/app/orders/`, you can use `useNavigation('/orders/menu/')`.
|
|
27
30
|
*
|
|
28
31
|
* @example
|
|
29
32
|
* ```tsx app/orders/menu/index.tsx
|
|
@@ -38,12 +41,15 @@ import { NavigationProp } from '@react-navigation/native';
|
|
|
38
41
|
* }
|
|
39
42
|
* ```
|
|
40
43
|
*
|
|
41
|
-
* If you attempt to access a layout that doesn't exist, an error such as
|
|
44
|
+
* If you attempt to access a layout that doesn't exist, an error such as
|
|
45
|
+
* `Could not find parent navigation with route "/non-existent"` is thrown.
|
|
42
46
|
*
|
|
43
|
-
* See React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-prop/#navigator-dependent-functions) for more information.
|
|
44
47
|
*
|
|
45
48
|
* @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.
|
|
46
49
|
* @returns The navigation object for the current route.
|
|
50
|
+
*
|
|
51
|
+
* @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-prop/#navigator-dependent-functions)
|
|
52
|
+
* for more information.
|
|
47
53
|
*/
|
|
48
54
|
export declare function useNavigation<T = NavigationProp<ReactNavigation.RootParamList>>(parent?: string): T;
|
|
49
55
|
export declare function resolveParentId(contextKey: string, parentId?: string | null): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAMlG
|
|
1
|
+
{"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAMlG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,EAC7E,MAAM,CAAC,EAAE,MAAM,GACd,CAAC,CA8BH;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAS3F"}
|
package/build/useNavigation.js
CHANGED
|
@@ -10,10 +10,12 @@ const react_1 = __importDefault(require("react"));
|
|
|
10
10
|
const Route_1 = require("./Route");
|
|
11
11
|
const matchers_1 = require("./matchers");
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Returns the underlying React Navigation [`navigation` prop](https://reactnavigation.org/docs/navigation-prop)
|
|
14
|
+
* to imperatively access layout-specific functionality like `navigation.openDrawer()` in a
|
|
15
|
+
* [Drawer](/router/advanced/drawer/) layout.
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
|
-
* ```tsx
|
|
18
|
+
* ```tsx app/index.tsx
|
|
17
19
|
* import { useNavigation } from 'expo-router';
|
|
18
20
|
*
|
|
19
21
|
* export default function Route() {
|
|
@@ -33,7 +35,8 @@ const matchers_1 = require("./matchers");
|
|
|
33
35
|
* }
|
|
34
36
|
* ```
|
|
35
37
|
*
|
|
36
|
-
* When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.
|
|
38
|
+
* When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.
|
|
39
|
+
* For example, `/menu/_layout.tsx` is nested inside `/app/orders/`, you can use `useNavigation('/orders/menu/')`.
|
|
37
40
|
*
|
|
38
41
|
* @example
|
|
39
42
|
* ```tsx app/orders/menu/index.tsx
|
|
@@ -48,12 +51,15 @@ const matchers_1 = require("./matchers");
|
|
|
48
51
|
* }
|
|
49
52
|
* ```
|
|
50
53
|
*
|
|
51
|
-
* If you attempt to access a layout that doesn't exist, an error such as
|
|
54
|
+
* If you attempt to access a layout that doesn't exist, an error such as
|
|
55
|
+
* `Could not find parent navigation with route "/non-existent"` is thrown.
|
|
52
56
|
*
|
|
53
|
-
* See React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-prop/#navigator-dependent-functions) for more information.
|
|
54
57
|
*
|
|
55
58
|
* @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.
|
|
56
59
|
* @returns The navigation object for the current route.
|
|
60
|
+
*
|
|
61
|
+
* @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-prop/#navigator-dependent-functions)
|
|
62
|
+
* for more information.
|
|
57
63
|
*/
|
|
58
64
|
function useNavigation(parent) {
|
|
59
65
|
const navigation = (0, native_1.useNavigation)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AACb,qDAAkG;AAClG,kDAA0B;AAE1B,mCAAwC;AACxC,yCAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AACb,qDAAkG;AAClG,kDAA0B;AAE1B,mCAAwC;AACxC,yCAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,SAAgB,aAAa,CAC3B,MAAe;IAEf,MAAM,UAAU,GAAG,IAAA,sBAAqB,GAAO,CAAC;IAEhD,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IACnC,MAAM,gBAAgB,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1C,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC;SACb;QACD,MAAM,UAAU,GAAG,IAAA,8BAAmB,EAAC,MAAM,CAAC,CAAC;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AC1B,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,kBAAkB,IAAI,GAAG,CAAC,CAAC;aACtE;YACD,SAAS,CAAC,GAAG,EAAE,CAAC;SACjB;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE;YACvB,SAAS;SACV;aAAM;YACL,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;KACF;IAED,OAAO,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC","sourcesContent":["'use client';\nimport { useNavigation as useUpstreamNavigation, NavigationProp } from '@react-navigation/native';\nimport React from 'react';\n\nimport { useContextKey } from './Route';\nimport { getNameFromFilePath } from './matchers';\n\n/**\n * Returns the underlying React Navigation [`navigation` prop](https://reactnavigation.org/docs/navigation-prop)\n * to imperatively access layout-specific functionality like `navigation.openDrawer()` in a\n * [Drawer](/router/advanced/drawer/) layout.\n *\n * @example\n * ```tsx app/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function Route() {\n * // Access the current navigation object for the current route.\n * const navigation = useNavigation();\n *\n * return (\n * <View>\n * <Text onPress={() => {\n * // Open the drawer view.\n * navigation.openDrawer();\n * }}>\n * Open Drawer\n * </Text>\n * </View>\n * );\n * }\n * ```\n *\n * When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.\n * For example, `/menu/_layout.tsx` is nested inside `/app/orders/`, you can use `useNavigation('/orders/menu/')`.\n *\n * @example\n * ```tsx app/orders/menu/index.tsx\n * import { useNavigation } from 'expo-router';\n *\n * export default function MenuRoute() {\n * const rootLayout = useNavigation('/');\n * const ordersLayout = useNavigation('/orders');\n *\n * // Same as the default results of `useNavigation()` when invoked in this route.\n * const parentLayout = useNavigation('/orders/menu');\n * }\n * ```\n *\n * If you attempt to access a layout that doesn't exist, an error such as\n * `Could not find parent navigation with route \"/non-existent\"` is thrown.\n *\n *\n * @param parent Provide an absolute path such as `/(root)` to the parent route or a relative path like `../../` to the parent route.\n * @returns The navigation object for the current route.\n *\n * @see React Navigation documentation on [navigation dependent functions](https://reactnavigation.org/docs/navigation-prop/#navigator-dependent-functions)\n * for more information.\n */\nexport function useNavigation<T = NavigationProp<ReactNavigation.RootParamList>>(\n parent?: string\n): T {\n const navigation = useUpstreamNavigation<any>();\n\n const contextKey = useContextKey();\n const normalizedParent = React.useMemo(() => {\n if (!parent) {\n return null;\n }\n const normalized = getNameFromFilePath(parent);\n\n if (parent.startsWith('.')) {\n return relativePaths(contextKey, parent);\n }\n return normalized;\n }, [contextKey, parent]);\n\n if (normalizedParent != null) {\n const parentNavigation = navigation.getParent(normalizedParent);\n\n // TODO: Maybe print a list of parents...\n\n if (!parentNavigation) {\n throw new Error(\n `Could not find parent navigation with route \"${parent}\".` +\n (normalizedParent !== parent ? ` (normalized: ${normalizedParent})` : '')\n );\n }\n return parentNavigation;\n }\n return navigation;\n}\n\nexport function resolveParentId(contextKey: string, parentId?: string | null): string | null {\n if (!parentId) {\n return null;\n }\n\n if (parentId.startsWith('.')) {\n return getNameFromFilePath(relativePaths(contextKey, parentId));\n }\n return getNameFromFilePath(parentId);\n}\n\n// Resolve a path like `../` relative to a path like `/foo/bar`\nfunction relativePaths(from: string, to: string): string {\n const fromParts = from.split('/').filter(Boolean);\n const toParts = to.split('/').filter(Boolean);\n\n for (const part of toParts) {\n if (part === '..') {\n if (fromParts.length === 0) {\n throw new Error(`Cannot resolve path \"${to}\" relative to \"${from}\"`);\n }\n fromParts.pop();\n } else if (part === '.') {\n // Ignore\n } else {\n fromParts.push(part);\n }\n }\n\n return '/' + fromParts.join('/');\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function hide(): void;
|
|
2
|
+
export declare function hideAsync(): Promise<void>;
|
|
3
|
+
export declare function preventAutoHideAsync(): Promise<any>;
|
|
4
|
+
export declare function _internal_preventAutoHideAsync(): Promise<boolean>;
|
|
5
|
+
export declare function _internal_maybeHideAsync(): Promise<any>;
|
|
6
|
+
//# sourceMappingURL=splash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splash.d.ts","sourceRoot":"","sources":["../../src/utils/splash.ts"],"names":[],"mappings":"AAMA,wBAAgB,IAAI,SAMnB;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,oBAAoB,iBAMzC;AAED,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,OAAO,CAAC,CAoBvE;AAED,wBAAsB,wBAAwB,iBAM7C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._internal_maybeHideAsync = exports._internal_preventAutoHideAsync = exports.preventAutoHideAsync = exports.hideAsync = exports.hide = void 0;
|
|
4
|
+
const expo_1 = require("expo");
|
|
5
|
+
const SplashModule = (0, expo_1.requireOptionalNativeModule)('ExpoSplashScreen');
|
|
6
|
+
let _initializedErrorHandler = false;
|
|
7
|
+
function hide() {
|
|
8
|
+
if (!SplashModule) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
SplashModule.hide();
|
|
12
|
+
}
|
|
13
|
+
exports.hide = hide;
|
|
14
|
+
async function hideAsync() {
|
|
15
|
+
hide();
|
|
16
|
+
}
|
|
17
|
+
exports.hideAsync = hideAsync;
|
|
18
|
+
async function preventAutoHideAsync() {
|
|
19
|
+
if (!SplashModule) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return SplashModule.preventAutoHideAsync();
|
|
23
|
+
}
|
|
24
|
+
exports.preventAutoHideAsync = preventAutoHideAsync;
|
|
25
|
+
async function _internal_preventAutoHideAsync() {
|
|
26
|
+
if (!SplashModule) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (!_initializedErrorHandler) {
|
|
30
|
+
// Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
|
|
31
|
+
// This prevents the splash screen from floating over error screens.
|
|
32
|
+
if (ErrorUtils?.getGlobalHandler) {
|
|
33
|
+
const originalHandler = ErrorUtils.getGlobalHandler();
|
|
34
|
+
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
35
|
+
hide();
|
|
36
|
+
originalHandler(error, isFatal);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
_initializedErrorHandler = true;
|
|
40
|
+
}
|
|
41
|
+
return SplashModule.internalPreventAutoHideAsync();
|
|
42
|
+
}
|
|
43
|
+
exports._internal_preventAutoHideAsync = _internal_preventAutoHideAsync;
|
|
44
|
+
async function _internal_maybeHideAsync() {
|
|
45
|
+
if (!SplashModule) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return SplashModule.internalMaybeHideAsync();
|
|
49
|
+
}
|
|
50
|
+
exports._internal_maybeHideAsync = _internal_maybeHideAsync;
|
|
51
|
+
//# sourceMappingURL=splash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splash.js","sourceRoot":"","sources":["../../src/utils/splash.ts"],"names":[],"mappings":";;;AAAA,+BAAmD;AAEnD,MAAM,YAAY,GAAG,IAAA,kCAA2B,EAAC,kBAAkB,CAAC,CAAC;AAErE,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,SAAgB,IAAI;IAClB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAND,oBAMC;AAEM,KAAK,UAAU,SAAS;IAC7B,IAAI,EAAE,CAAC;AACT,CAAC;AAFD,8BAEC;AAEM,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC;AAND,oDAMC;AAEM,KAAK,UAAU,8BAA8B;IAClD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,CAAC,wBAAwB,EAAE;QAC7B,oGAAoG;QACpG,oEAAoE;QACpE,IAAI,UAAU,EAAE,gBAAgB,EAAE;YAChC,MAAM,eAAe,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;YACtD,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC7C,IAAI,EAAE,CAAC;gBACP,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;SACJ;QAED,wBAAwB,GAAG,IAAI,CAAC;KACjC;IAED,OAAO,YAAY,CAAC,4BAA4B,EAAE,CAAC;AACrD,CAAC;AApBD,wEAoBC;AAEM,KAAK,UAAU,wBAAwB;IAC5C,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,YAAY,CAAC,sBAAsB,EAAE,CAAC;AAC/C,CAAC;AAND,4DAMC","sourcesContent":["import { requireOptionalNativeModule } from 'expo';\n\nconst SplashModule = requireOptionalNativeModule('ExpoSplashScreen');\n\nlet _initializedErrorHandler = false;\n\nexport function hide() {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.hide();\n}\n\nexport async function hideAsync(): Promise<void> {\n hide();\n}\n\nexport async function preventAutoHideAsync() {\n if (!SplashModule) {\n return;\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n\nexport async function _internal_preventAutoHideAsync(): Promise<boolean> {\n if (!SplashModule) {\n return false;\n }\n\n if (!_initializedErrorHandler) {\n // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.\n // This prevents the splash screen from floating over error screens.\n if (ErrorUtils?.getGlobalHandler) {\n const originalHandler = ErrorUtils.getGlobalHandler();\n ErrorUtils.setGlobalHandler((error, isFatal) => {\n hide();\n originalHandler(error, isFatal);\n });\n }\n\n _initializedErrorHandler = true;\n }\n\n return SplashModule.internalPreventAutoHideAsync();\n}\n\nexport async function _internal_maybeHideAsync() {\n if (!SplashModule) {\n return false;\n }\n\n return SplashModule.internalMaybeHideAsync();\n}\n"]}
|
|
@@ -32,12 +32,13 @@ export declare function useNavigatorContext(): NavigatorContextValue;
|
|
|
32
32
|
/**
|
|
33
33
|
* Renders the currently selected content.
|
|
34
34
|
*
|
|
35
|
-
* There are actually two different implementations of Slot
|
|
36
|
-
* - Used inside a _layout as the Navigator
|
|
37
|
-
* - Used inside a Navigator as the content
|
|
35
|
+
* There are actually two different implementations of `<Slot/>`:
|
|
36
|
+
* - Used inside a `_layout` as the `Navigator`
|
|
37
|
+
* - Used inside a `Navigator` as the content
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* Since a custom `Navigator` will set the `NavigatorContext.contextKey` to
|
|
40
|
+
* the current `_layout`, you can use this to determine if you are inside
|
|
41
|
+
* a custom navigator or not.
|
|
41
42
|
*/
|
|
42
43
|
export declare function Slot(props: Omit<NavigatorProps<any>, 'children'>): React.JSX.Element;
|
|
43
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigator.d.ts","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,gBAAgB,6CAA0D,CAAC;AAMxF,KAAK,0BAA0B,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,KAA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AAC,CAAC;AAC7E,KAAK,2BAA2B,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,0BAA0B,IAAI;IACjE,gBAAgB,CAAC,EAAE,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;IACnE,aAAa,CAAC,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,aAAa,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,0BAA0B,GAAG,OAAO,WAAW,EAAE,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACd,EAAE,cAAc,CAAC,CAAC,CAAC,4BAsCnB;yBA5Ce,SAAS;;;;;AA8CzB;;GAEG;AACH,wBAAgB,mBAAmB,0BAMlC;AAqBD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,qBAchE;AAED;;GAEG;AACH,iBAAS,aAAa,gBAMrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,sBAM/B"}
|
package/build/views/Navigator.js
CHANGED
|
@@ -100,12 +100,13 @@ function SlotNavigator(props) {
|
|
|
100
100
|
/**
|
|
101
101
|
* Renders the currently selected content.
|
|
102
102
|
*
|
|
103
|
-
* There are actually two different implementations of Slot
|
|
104
|
-
* - Used inside a _layout as the Navigator
|
|
105
|
-
* - Used inside a Navigator as the content
|
|
103
|
+
* There are actually two different implementations of `<Slot/>`:
|
|
104
|
+
* - Used inside a `_layout` as the `Navigator`
|
|
105
|
+
* - Used inside a `Navigator` as the content
|
|
106
106
|
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
107
|
+
* Since a custom `Navigator` will set the `NavigatorContext.contextKey` to
|
|
108
|
+
* the current `_layout`, you can use this to determine if you are inside
|
|
109
|
+
* a custom navigator or not.
|
|
109
110
|
*/
|
|
110
111
|
function Slot(props) {
|
|
111
112
|
const contextKey = (0, Route_1.useContextKey)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigator.js","sourceRoot":"","sources":["../../src/views/Navigator.tsx"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,qDAA4F;AAC5F,6CAA+B;AAC/B,mFAA8D;AAE9D,qCAAkC;AAClC,oCAAyC;AACzC,oEAAuE;AACvE,8CAAiD;AAOpC,QAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC;AAExF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,wBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;CACnD;AAaD;;;;GAIG;AACH,SAAgB,SAAS,CAA4D,EACnF,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,GACK;IAClB,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IAEnC,+FAA+F;IAC/F,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAA,2CAAuB,EAAC,QAAQ,EAAE;QACjF,iBAAiB,EAAE,IAAI;QACvB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAA,6BAAgB,EAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAEtD,MAAM,KAAK,oBAA2B,CAAC;IAEvC,MAAM,UAAU,GAAG,IAAA,6BAAoB,EAAC,MAAM,EAAE;QAC9C,4EAA4E;QA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B,CAAC,CAC7F,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,IAAI,CAAC,KAA4C;IAC/D,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;IAEnD,IAAI,OAAO,EAAE,UAAU,KAAK,UAAU,EAAE;QACtC,mDAAmD;QACnD,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;KACrC;IAED;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAC,AAAD,EAAG,CAAC;AAC3B,CAAC;AAdD,oBAcC;AAED;;GAEG;AACH,SAAS,aAAa;IACpB,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IAEtC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;AACtE,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,CACL,CAAC,6CAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAC/B;MAAA,CAAC,aAAa,CAAC,AAAD,EAChB;IAAA,EAAE,6CAAY,CAAC,CAChB,CAAC;AACJ,CAAC;AAND,4CAMC;AAED,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC;AAC/B,SAAS,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { 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\nexport type NavigatorContextValue = ReturnType<typeof useNavigationBuilder> & {\n contextKey: string;\n router: RouterFactory<any, any, any>;\n};\n\nexport const NavigatorContext = React.createContext<NavigatorContextValue | null>(null);\n\nif (process.env.NODE_ENV !== 'production') {\n NavigatorContext.displayName = 'NavigatorContext';\n}\n\ntype UseNavigationBuilderRouter = Parameters<typeof useNavigationBuilder>[0];\ntype UseNavigationBuilderOptions = Parameters<typeof useNavigationBuilder>[1];\n\nexport type NavigatorProps<T extends UseNavigationBuilderRouter> = {\n initialRouteName?: UseNavigationBuilderOptions['initialRouteName'];\n screenOptions?: UseNavigationBuilderOptions['screenOptions'];\n children?: UseNavigationBuilderOptions['children'];\n router?: T;\n routerOptions?: Omit<Parameters<T>[0], 'initialRouteName'>;\n};\n\n/**\n * An unstyled custom navigator. Good for basic web layouts.\n *\n * @hidden\n */\nexport function Navigator<T extends UseNavigationBuilderRouter = typeof StackRouter>({\n initialRouteName,\n screenOptions,\n children,\n router,\n routerOptions,\n}: NavigatorProps<T>) {\n const contextKey = useContextKey();\n\n // A custom navigator can have a mix of Screen and other components (like a Slot inside a View)\n const { screens, children: nonScreenChildren } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sortedScreens = useSortedScreens(screens ?? []);\n\n router ||= StackRouter as unknown as T;\n\n const navigation = useNavigationBuilder(router, {\n // Used for getting the parent with navigation.getParent('/normalized/path')\n ...routerOptions,\n id: contextKey,\n children: sortedScreens || [<Screen key=\"default\" />],\n screenOptions,\n initialRouteName,\n });\n\n // useNavigationBuilder requires at least one screen to be defined otherwise it will throw.\n if (!sortedScreens.length) {\n console.warn(`Navigator at \"${contextKey}\" has no children.`);\n return null;\n }\n\n return (\n <NavigatorContext.Provider\n value={{\n ...navigation,\n contextKey,\n router,\n }}>\n {nonScreenChildren}\n </NavigatorContext.Provider>\n );\n}\n\n/**\n * @hidden\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\nfunction SlotNavigator(props: NavigatorProps<any>) {\n const contextKey = useContextKey();\n\n // Allows adding Screen components as children to configure routes.\n const { screens } = useFilterScreenChildren([], {\n contextKey,\n });\n\n const { state, descriptors, NavigationContent } = useNavigationBuilder(StackRouter, {\n ...props,\n id: contextKey,\n children: useSortedScreens(screens ?? []),\n });\n\n return (\n <NavigationContent>{descriptors[state.routes[state.index].key].render()}</NavigationContent>\n );\n}\n\n/**\n * Renders the currently selected content.\n *\n * There are actually two different implementations of `<Slot/>`:\n * - Used inside a `_layout` as the `Navigator`\n * - Used inside a `Navigator` as the content\n *\n * Since a custom `Navigator` will set the `NavigatorContext.contextKey` to\n * the current `_layout`, you can use this to determine if you are inside\n * a custom navigator or not.\n */\nexport function Slot(props: Omit<NavigatorProps<any>, 'children'>) {\n const contextKey = useContextKey();\n const context = React.useContext(NavigatorContext);\n\n if (context?.contextKey !== contextKey) {\n // The _layout has changed since the last navigator\n return <SlotNavigator {...props} />;\n }\n\n /*\n * The user has defined a custom navigator\n * <Navigator><Slot /></Navigator>\n */\n return <NavigatorSlot />;\n}\n\n/**\n * Render the current navigator content.\n */\nfunction NavigatorSlot() {\n const context = useNavigatorContext();\n\n const { state, descriptors } = context;\n\n return descriptors[state.routes[state.index].key]?.render() ?? null;\n}\n\n/**\n * The default navigator for the app when no root _layout is provided.\n */\nexport function DefaultNavigator() {\n return (\n <SafeAreaView style={{ flex: 1 }}>\n <SlotNavigator />\n </SafeAreaView>\n );\n}\n\nNavigator.Slot = NavigatorSlot;\nNavigator.useContext = useNavigatorContext;\n\n/** Used to configure route settings. */\nNavigator.Screen = Screen;\n"]}
|
package/build/views/Splash.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export *
|
|
1
|
+
export * from '../utils/splash';
|
|
2
2
|
//# sourceMappingURL=Splash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"Splash.d.ts","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC"}
|
package/build/views/Splash.js
CHANGED
|
@@ -11,19 +11,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
25
16
|
};
|
|
26
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports
|
|
28
|
-
exports.SplashScreen = __importStar(require("expo-splash-screen"));
|
|
18
|
+
__exportStar(require("../utils/splash"), exports);
|
|
29
19
|
//# sourceMappingURL=Splash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;AACb,kDAAgC","sourcesContent":["'use client';\nexport * from '../utils/splash';\n"]}
|
package/build/views/Try.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component, type ComponentType, type PropsWithChildren } from 'react';
|
|
2
2
|
/** Props passed to a page's `ErrorBoundary` export. */
|
|
3
3
|
export type ErrorBoundaryProps = {
|
|
4
|
-
/**
|
|
4
|
+
/** A function that will re-render the route component by clearing the `error` state. */
|
|
5
5
|
retry: () => Promise<void>;
|
|
6
6
|
/** The error that was thrown. */
|
|
7
7
|
error: Error;
|
package/build/views/Try.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKrF,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wFAAwF;IACxF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,qBAAa,GAAI,SAAQ,SAAS,CAChC,iBAAiB,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC1C,CAAC,EACF;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClB;IACC,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAY5C,KAAK,sBAMH;IAEF,MAAM;CAQP"}
|
package/build/views/Try.js
CHANGED
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.Try = void 0;
|
|
28
|
-
const SplashScreen = __importStar(require("expo-splash-screen"));
|
|
29
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
+
const SplashScreen = __importStar(require("./Splash"));
|
|
30
30
|
const errors_1 = require("../rsc/router/errors");
|
|
31
31
|
// No way to access `getDerivedStateFromError` from a function component afaict.
|
|
32
32
|
class Try extends react_1.Component {
|
package/build/views/Try.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb
|
|
1
|
+
{"version":3,"file":"Try.js","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAqF;AAErF,uDAAyC;AACzC,iDAAwD;AAUxD,gFAAgF;AAChF,MAAa,GAAI,SAAQ,iBAKxB;IACC,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,mDAAmD;QACnD,YAAY,CAAC,SAAS,EAAE,CAAC;QAEzB,IAAI,OAAO,IAAI,KAAK,YAAY,yBAAgB,EAAE;YAChD,0BAA0B;YAC1B,OAAO,IAAI,CAAC;SACb;QAED,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;AApCD,kBAoCC","sourcesContent":["'use client';\n\nimport React, { Component, type ComponentType, type PropsWithChildren } from 'react';\n\nimport * as SplashScreen from './Splash';\nimport { MetroServerError } from '../rsc/router/errors';\n\n/** Props passed to a page's `ErrorBoundary` export. */\nexport type ErrorBoundaryProps = {\n /** A function that will re-render the route 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 function component afaict.\nexport class Try extends Component<\n PropsWithChildren<{\n catch: ComponentType<ErrorBoundaryProps>;\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 if (__DEV__ && error instanceof MetroServerError) {\n // Throw up to the LogBox.\n return null;\n }\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/entry-classic.js
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
// on web.
|
|
3
3
|
import '@expo/metro-runtime';
|
|
4
4
|
|
|
5
|
-
// Hook for the virtual client modules.
|
|
6
|
-
// TODO: Remove this in favor of the webpack runtime one.
|
|
7
|
-
import 'expo-router/virtual-client-boundaries';
|
|
8
|
-
// Add server component support.
|
|
9
|
-
import 'expo-router/build/rsc/runtime';
|
|
10
|
-
|
|
11
5
|
import { App } from 'expo-router/build/qualified-entry';
|
|
12
6
|
import { renderRootComponent } from 'expo-router/build/renderRootComponent';
|
|
13
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "4.0.0-preview.
|
|
3
|
+
"version": "4.0.0-preview.13",
|
|
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",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"_ctx-shared.js",
|
|
27
27
|
"_error.js",
|
|
28
28
|
"app.plugin.js",
|
|
29
|
-
"virtual-client-boundaries.js",
|
|
30
29
|
"babel.js",
|
|
31
30
|
"drawer.js",
|
|
32
31
|
"drawer.d.ts",
|
|
@@ -103,18 +102,17 @@
|
|
|
103
102
|
"tsd": "^0.28.1"
|
|
104
103
|
},
|
|
105
104
|
"dependencies": {
|
|
106
|
-
"@expo/metro-runtime": "4.0.0-preview.
|
|
105
|
+
"@expo/metro-runtime": "4.0.0-preview.2",
|
|
107
106
|
"@expo/server": "^0.5.0-preview.0",
|
|
108
107
|
"@radix-ui/react-slot": "1.0.1",
|
|
109
108
|
"@react-navigation/bottom-tabs": "7.0.0-rc.36",
|
|
110
109
|
"@react-navigation/native": "7.0.0-rc.21",
|
|
111
110
|
"@react-navigation/native-stack": "7.0.0-rc.30",
|
|
112
111
|
"client-only": "^0.0.1",
|
|
113
|
-
"expo-splash-screen": "0.29.1",
|
|
114
112
|
"react-helmet-async": "^1.3.0",
|
|
115
113
|
"react-native-helmet-async": "2.0.4",
|
|
116
114
|
"schema-utils": "^4.0.1",
|
|
117
115
|
"server-only": "^0.0.1"
|
|
118
116
|
},
|
|
119
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "a64603dce90981bf7688657f87dfa4be3e24f58b"
|
|
120
118
|
}
|
package/plugin/build/index.d.ts
CHANGED