expo-router 1.7.1 → 1.7.3
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/_entry.tsx +4 -3
- package/build/ExpoRoot.d.ts +2 -4
- package/build/ExpoRoot.d.ts.map +1 -1
- package/build/LocationProvider.d.ts +3 -4
- package/build/LocationProvider.d.ts.map +1 -1
- package/build/exports.d.ts +1 -1
- package/build/exports.d.ts.map +1 -1
- package/build/fork/findFocusedRoute.d.ts +1 -1
- package/build/fork/useLinking.native.d.ts +2 -2
- package/build/getLinkingConfig.d.ts +6 -1
- package/build/getLinkingConfig.d.ts.map +1 -1
- package/build/getRoutes.d.ts.map +1 -1
- package/build/hooks.d.ts +76 -0
- package/build/hooks.d.ts.map +1 -0
- package/build/layouts/Drawer.d.ts +2 -2
- package/build/layouts/Stack.d.ts +2 -2
- package/build/layouts/Tabs.d.ts +2 -2
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/stateOperations.d.ts +8 -8
- package/build/link/stateOperations.d.ts.map +1 -1
- package/build/link/useLinkToPath.d.ts.map +1 -1
- package/build/link/useRouter.d.ts.map +1 -1
- package/build/static/renderStaticContent.d.ts.map +1 -1
- package/build/testing-library/context-stubs.d.ts +20 -0
- package/build/testing-library/context-stubs.d.ts.map +1 -0
- package/build/testing-library/index.d.ts +9 -10
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/mocks.d.ts +5 -0
- package/build/testing-library/mocks.d.ts.map +1 -1
- package/build/useCreateExpoRouterContext.d.ts +23 -0
- package/build/useCreateExpoRouterContext.d.ts.map +1 -0
- package/build/useNavigation.d.ts +1 -1
- package/build/useNavigation.d.ts.map +1 -1
- package/build/views/ErrorBoundary.d.ts.map +1 -1
- package/build/views/Sitemap.d.ts.map +1 -1
- package/entry.js +3 -1
- package/package.json +8 -4
- package/plugin/build/index.js +15 -0
- package/plugin/src/index.ts +19 -1
- package/src/ExpoRoot.tsx +91 -30
- package/src/LocationProvider.tsx +6 -19
- package/src/exports.ts +3 -1
- package/src/fork/getPathFromState.ts +11 -1
- package/src/getLinkingConfig.ts +19 -4
- package/src/getRoutes.ts +2 -0
- package/src/hooks.ts +139 -0
- package/src/layouts/Tabs.tsx +0 -1
- package/src/link/Link.tsx +5 -1
- package/src/link/href.ts +11 -9
- package/src/link/linking.ts +2 -2
- package/src/link/stateOperations.ts +28 -25
- package/src/link/useLinkToPath.ts +7 -6
- package/src/link/useLoadedNavigation.ts +2 -2
- package/src/link/useRouter.ts +4 -2
- package/src/static/renderStaticContent.tsx +17 -7
- package/src/testing-library/context-stubs.ts +47 -0
- package/src/testing-library/index.tsx +34 -81
- package/src/testing-library/mocks.ts +34 -0
- package/src/useCreateExpoRouterContext.ts +88 -0
- package/src/useNavigation.ts +3 -3
- package/src/views/ErrorBoundary.tsx +94 -52
- package/src/views/Sitemap.tsx +5 -12
- package/src/views/Unmatched.tsx +1 -1
- package/build/link/useHref.d.ts +0 -10
- package/build/link/useHref.d.ts.map +0 -1
- package/build/navigationStore/index.d.ts +0 -82
- package/build/navigationStore/index.d.ts.map +0 -1
- package/build/navigationStore/initialState.d.ts +0 -43
- package/build/navigationStore/initialState.d.ts.map +0 -1
- package/src/link/useHref.ts +0 -21
- package/src/navigationStore/index.ts +0 -223
- package/src/navigationStore/initialState.ts +0 -25
package/_entry.tsx
CHANGED
|
@@ -18,15 +18,16 @@ export const ctx = require.context(
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
// Must be exported or Fast Refresh won't update the context >:[
|
|
21
|
-
export default function ExpoRouterRoot() {
|
|
22
|
-
return <ExpoRoot context={ctx} />;
|
|
21
|
+
export default function ExpoRouterRoot({ location }: { location: URL }) {
|
|
22
|
+
return <ExpoRoot context={ctx} location={location} />;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** Get the linking manifest from a Node.js process. */
|
|
26
26
|
export async function getManifest(options: any) {
|
|
27
27
|
const routeTree = getRoutes(ctx, options);
|
|
28
|
+
|
|
28
29
|
if (!routeTree) {
|
|
29
|
-
|
|
30
|
+
throw new Error("No routes found");
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// Evaluate all static params
|
package/build/ExpoRoot.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare function ExpoRoot({ context }:
|
|
4
|
-
context: RequireContext;
|
|
5
|
-
}): JSX.Element;
|
|
2
|
+
import { ExpoRootProps } from "./useCreateExpoRouterContext";
|
|
3
|
+
export declare function ExpoRoot({ context, location }: ExpoRootProps): JSX.Element;
|
|
6
4
|
//# sourceMappingURL=ExpoRoot.d.ts.map
|
package/build/ExpoRoot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoRoot.d.ts","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ExpoRoot.d.ts","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";AAaA,OAAO,EACL,aAAa,EAEd,MAAM,8BAA8B,CAAC;AA8BtC,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,aAAa,eAa5D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { State } from "./fork/getPathFromState";
|
|
2
2
|
type SearchParams = Record<string, string | string[]>;
|
|
3
|
-
type UrlObject = {
|
|
3
|
+
export type UrlObject = {
|
|
4
|
+
unstable_globalHref: string;
|
|
4
5
|
pathname: string;
|
|
5
6
|
readonly params: SearchParams;
|
|
6
7
|
segments: string[];
|
|
@@ -9,11 +10,9 @@ export declare function getRouteInfoFromState(getPathFromState: (state: State, a
|
|
|
9
10
|
path: string;
|
|
10
11
|
params: any;
|
|
11
12
|
}, state: State): UrlObject;
|
|
12
|
-
export declare function compareRouteInfo(a: UrlObject, b: UrlObject): boolean;
|
|
13
|
-
export declare function compareUrlSearchParams(a: SearchParams, b: SearchParams): boolean;
|
|
14
13
|
export declare function getNormalizedStatePath({ path: statePath, params, }: {
|
|
15
14
|
path: string;
|
|
16
15
|
params: any;
|
|
17
|
-
}):
|
|
16
|
+
}): Pick<UrlObject, "segments" | "params">;
|
|
18
17
|
export {};
|
|
19
18
|
//# sourceMappingURL=LocationProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,CAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,OAAO,KACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,EAClC,KAAK,EAAE,KAAK,GACX,SAAS,CASX;AAGD,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EAAE,SAAS,EACf,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;CACb,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC,CAgBzC"}
|
package/build/exports.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Navigator, Slot } from "./views/Navigator";
|
|
2
2
|
export { useRouter } from "./link/useRouter";
|
|
3
|
-
export { usePathname, useLocalSearchParams, useSearchParams, useSegments, useRootNavigation, useRootNavigationState, } from "./
|
|
3
|
+
export { useUnstableGlobalHref, usePathname, useGlobalSearchParams, useLocalSearchParams, useSearchParams, useSegments, useRootNavigation, useRootNavigationState, } from "./hooks";
|
|
4
4
|
export { Link, Redirect } from "./link/Link";
|
|
5
5
|
export { withLayoutContext } from "./layouts/withLayoutContext";
|
|
6
6
|
export { Navigator, Slot };
|
package/build/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -16,7 +16,7 @@ export declare function findFocusedRoute(state: InitialState): (Omit<import("@re
|
|
|
16
16
|
})[];
|
|
17
17
|
type: string;
|
|
18
18
|
stale: false;
|
|
19
|
-
}>, "
|
|
19
|
+
}>, "routes" | "stale">> & {
|
|
20
20
|
routes: (Omit<import("@react-navigation/routers").Route<string, object | undefined>, "key"> & any)[];
|
|
21
21
|
}> | undefined;
|
|
22
22
|
}) | undefined;
|
|
@@ -19,7 +19,7 @@ export default function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
19
19
|
})[];
|
|
20
20
|
type: string;
|
|
21
21
|
stale: false;
|
|
22
|
-
}>, "
|
|
22
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
23
23
|
stale?: true | undefined;
|
|
24
24
|
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
25
25
|
}> & {
|
|
@@ -39,7 +39,7 @@ export default function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
39
39
|
})[];
|
|
40
40
|
type: string;
|
|
41
41
|
stale: false;
|
|
42
|
-
}>, "
|
|
42
|
+
}>, "routes" | "stale">> & Readonly<{
|
|
43
43
|
stale?: true | undefined;
|
|
44
44
|
routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
|
|
45
45
|
}> & any) | undefined;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { LinkingOptions } from "@react-navigation/native";
|
|
2
2
|
import { RouteNode } from "./Route";
|
|
3
3
|
import { Screen } from "./getReactNavigationConfig";
|
|
4
|
+
import { getPathFromState } from "./link/linking";
|
|
4
5
|
export declare function getNavigationConfig(routes: RouteNode): {
|
|
5
6
|
initialRouteName?: string;
|
|
6
7
|
screens: Record<string, Screen>;
|
|
7
8
|
};
|
|
8
|
-
export
|
|
9
|
+
export type ExpoLinkingOptions = LinkingOptions<object> & {
|
|
10
|
+
getPathFromState?: typeof getPathFromState;
|
|
11
|
+
};
|
|
12
|
+
export declare function getLinkingConfig(routes: RouteNode): ExpoLinkingOptions;
|
|
13
|
+
export declare const stateCache: Map<string, any>;
|
|
9
14
|
//# sourceMappingURL=getLinkingConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAA4B,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAGL,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAExB,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAEA;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IACxD,gBAAgB,CAAC,EAAE,OAAO,g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,wBAAgB,cAAc,CAC5B,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,SAAS,GAAG,IAAI,CAIlB;AAYD,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAI3B;AA4CD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,GAChB,SAAS,GAAG,IAAI,CAkBlB"}
|
package/build/hooks.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NavigationContainerRefWithCurrent } from "@react-navigation/native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { UrlObject } from "./LocationProvider";
|
|
4
|
+
import { RouteNode } from "./Route";
|
|
5
|
+
import { ResultState } from "./fork/getStateFromPath";
|
|
6
|
+
import { ExpoLinkingOptions } from "./getLinkingConfig";
|
|
7
|
+
type SearchParams = Record<string, string | string[]>;
|
|
8
|
+
export type ExpoRouterContextType = {
|
|
9
|
+
routeNode: RouteNode;
|
|
10
|
+
linking: ExpoLinkingOptions;
|
|
11
|
+
navigationRef: NavigationContainerRefWithCurrent<ReactNavigation.RootParamList>;
|
|
12
|
+
initialState: ResultState | undefined;
|
|
13
|
+
getRouteInfo: (state: ResultState) => UrlObject;
|
|
14
|
+
};
|
|
15
|
+
export type OnboardingExpoRouterContextType = Omit<ExpoRouterContextType, "routeNode"> & {
|
|
16
|
+
routeNode: null;
|
|
17
|
+
};
|
|
18
|
+
export declare const ExpoRouterContext: React.Context<ExpoRouterContextType | undefined>;
|
|
19
|
+
export type RootStateContextType = {
|
|
20
|
+
state?: ResultState;
|
|
21
|
+
routeInfo?: UrlObject;
|
|
22
|
+
};
|
|
23
|
+
export declare const RootStateContext: React.Context<RootStateContextType>;
|
|
24
|
+
export declare function useRootNavigationState(): RootStateContextType;
|
|
25
|
+
export declare function useRouteInfo(): UrlObject;
|
|
26
|
+
export declare function useExpoRouterContext(): ExpoRouterContextType;
|
|
27
|
+
export declare function useRootNavigation(): import("@react-navigation/native").NavigationContainerRef<ReactNavigation.RootParamList> | null;
|
|
28
|
+
export declare function useLinkingContext(): ExpoLinkingOptions;
|
|
29
|
+
/**
|
|
30
|
+
* @private
|
|
31
|
+
* @returns the current global pathname with query params attached. This may change in the future to include the hostname from a predefined universal link, i.e. `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`
|
|
32
|
+
*/
|
|
33
|
+
export declare function useUnstableGlobalHref(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get a list of selected file segments for the currently selected route. Segments are not normalized, so they will be the same as the file path. e.g. /[id]?id=normal -> ["[id]"]
|
|
36
|
+
*
|
|
37
|
+
* `useSegments` can be typed using an abstract.
|
|
38
|
+
* Consider the following file structure, and strictly typed `useSegments` function:
|
|
39
|
+
*
|
|
40
|
+
* ```md
|
|
41
|
+
* - app
|
|
42
|
+
* - [user]
|
|
43
|
+
* - index.js
|
|
44
|
+
* - followers.js
|
|
45
|
+
* - settings.js
|
|
46
|
+
* ```
|
|
47
|
+
* This can be strictly typed using the following abstract:
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function useSegments<TSegments extends string[] = string[]>(): TSegments;
|
|
54
|
+
/** @returns global selected pathname without query parameters. */
|
|
55
|
+
export declare function usePathname(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get the globally selected query parameters, including dynamic path segments. This function will update even when the route is not focused.
|
|
58
|
+
* Useful for analytics or other background operations that don't draw to the screen.
|
|
59
|
+
*
|
|
60
|
+
* When querying search params in a stack, opt-towards using `useLocalSearchParams` as these will only
|
|
61
|
+
* update when the route is focused.
|
|
62
|
+
*
|
|
63
|
+
* @see `useLocalSearchParams`
|
|
64
|
+
*/
|
|
65
|
+
export declare function useGlobalSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
66
|
+
/** @deprecated renamed to `useGlobalSearchParams` */
|
|
67
|
+
export declare function useSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the URL search parameters for the contextually focused route. e.g. `/acme?foo=bar` -> `{ foo: "bar" }`.
|
|
70
|
+
* This is useful for stacks where you may push a new screen that changes the query parameters.
|
|
71
|
+
*
|
|
72
|
+
* To observe updates even when the invoking route is not focused, use `useGlobalSearchParams()`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function useLocalSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EAIlC,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,aAAa,EAAE,iCAAiC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAChF,YAAY,EAAE,WAAW,GAAG,SAAS,CAAC;IACtC,YAAY,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,SAAS,CAAC;CACjD,CAAC;AAGF,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,qBAAqB,EACrB,WAAW,CACZ,GAAG;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAExB,eAAO,MAAM,iBAAiB,kDAElB,CAAC;AAEb,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,qCAAgD,CAAC;AAE9E,wBAAgB,sBAAsB,yBAErC;AAED,wBAAgB,YAAY,cAE3B;AAED,wBAAgB,oBAAoB,0BAEnC;AAED,wBAAgB,iBAAiB,oGAGhC;AAED,wBAAgB,iBAAiB,uBAEhC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,SAAS,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,KAClC,SAAS,CAEb;AAED,kEAAkE;AAClE,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,YAAY,GAAG,YAAY,KACxC,OAAO,CAAC,OAAO,CAAC,CAEpB;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAC7B,OAAO,SAAS,YAAY,GAAG,YAAY,KACxC,OAAO,CAAC,OAAO,CAAC,CAEpB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,SAAS,YAAY,GAAG,YAAY,KACxC,OAAO,CAAC,OAAO,CAAC,CAEpB"}
|
|
@@ -27,7 +27,7 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
27
27
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
28
28
|
} & {
|
|
29
29
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
30
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "
|
|
30
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
31
31
|
id?: string | undefined;
|
|
32
32
|
children: import("react").ReactNode;
|
|
33
33
|
screenListeners?: Partial<{
|
|
@@ -77,7 +77,7 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
77
77
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
78
78
|
} & {
|
|
79
79
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
80
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "
|
|
80
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
81
81
|
id?: string | undefined;
|
|
82
82
|
children: import("react").ReactNode;
|
|
83
83
|
screenListeners?: Partial<{
|
package/build/layouts/Stack.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
25
25
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
26
26
|
navigation: any;
|
|
27
27
|
}) => NativeStackNavigationOptions) | undefined;
|
|
28
|
-
} & import("@react-navigation/routers").StackRouterOptions, "
|
|
28
|
+
} & import("@react-navigation/routers").StackRouterOptions, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
29
29
|
id?: string | undefined;
|
|
30
30
|
children: import("react").ReactNode;
|
|
31
31
|
screenListeners?: Partial<{
|
|
@@ -75,7 +75,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
75
75
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
76
76
|
navigation: any;
|
|
77
77
|
}) => NativeStackNavigationOptions) | undefined;
|
|
78
|
-
} & import("@react-navigation/routers").StackRouterOptions, "
|
|
78
|
+
} & import("@react-navigation/routers").StackRouterOptions, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
79
79
|
id?: string | undefined;
|
|
80
80
|
children: import("react").ReactNode;
|
|
81
81
|
screenListeners?: Partial<{
|
package/build/layouts/Tabs.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
28
28
|
}) => BottomTabNavigationOptions) | undefined;
|
|
29
29
|
} & import("@react-navigation/routers").DefaultRouterOptions & {
|
|
30
30
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
31
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "
|
|
31
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
32
32
|
id?: string | undefined;
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
screenListeners?: Partial<{
|
|
@@ -80,7 +80,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
80
80
|
}) => BottomTabNavigationOptions) | undefined;
|
|
81
81
|
} & import("@react-navigation/routers").DefaultRouterOptions & {
|
|
82
82
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
83
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "
|
|
83
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
84
84
|
id?: string | undefined;
|
|
85
85
|
children: React.ReactNode;
|
|
86
86
|
screenListeners?: Partial<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAMpC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAMpC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cf,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
package/build/link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],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AK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,qBAAqB,KACvE,IAAI,CAAC;CACX;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,QAUhD;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;IACzD,6DAA6D;IAC7D,WAAW,EAAE,OAAO,WAAW,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,eAEY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InitialState, NavigationState, ParamListBase, getActionFromState } from "@react-navigation/native";
|
|
1
|
+
import { InitialState, NavigationState, ParamListBase, PartialState, getActionFromState } from "@react-navigation/native";
|
|
2
2
|
import { ResultState } from "../fork/getStateFromPath";
|
|
3
3
|
export type NavigateAction = Extract<ReturnType<typeof getActionFromState>, {
|
|
4
4
|
type: "NAVIGATE";
|
|
@@ -26,16 +26,16 @@ export declare function findTopRouteForTarget(state: ResultState): Omit<import("
|
|
|
26
26
|
}> & Readonly<{
|
|
27
27
|
params?: Readonly<object | undefined>;
|
|
28
28
|
}> & {
|
|
29
|
-
state?: Readonly<any> |
|
|
29
|
+
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
30
30
|
})[];
|
|
31
31
|
type: string;
|
|
32
32
|
stale: false;
|
|
33
|
-
}>, "
|
|
33
|
+
}>, "routes" | "stale">> & {
|
|
34
34
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & any)[];
|
|
35
35
|
}> | undefined;
|
|
36
36
|
};
|
|
37
37
|
/** @returns true if moving to a sibling inside the same navigator. */
|
|
38
|
-
export declare function isMovingToSiblingRoute(
|
|
38
|
+
export declare function isMovingToSiblingRoute(currentState: NavigationState | PartialState<NavigationState> | undefined, targetState: ResultState | undefined): boolean;
|
|
39
39
|
export declare function getQualifiedStateForTopOfTargetState(rootState: InitialState, targetState: ResultState): Readonly<Partial<Omit<Readonly<{
|
|
40
40
|
key: string;
|
|
41
41
|
index: number;
|
|
@@ -48,11 +48,11 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
48
48
|
}> & Readonly<{
|
|
49
49
|
params?: Readonly<object | undefined>;
|
|
50
50
|
}> & {
|
|
51
|
-
state?: Readonly<any> |
|
|
51
|
+
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
52
52
|
})[];
|
|
53
53
|
type: string;
|
|
54
54
|
stale: false;
|
|
55
|
-
}>, "
|
|
55
|
+
}>, "routes" | "stale">> & {
|
|
56
56
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & {
|
|
57
57
|
state?: Readonly<Partial<Omit<Readonly<{
|
|
58
58
|
key: string;
|
|
@@ -66,11 +66,11 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
66
66
|
}> & Readonly<{
|
|
67
67
|
params?: Readonly<object | undefined>;
|
|
68
68
|
}> & {
|
|
69
|
-
state?: Readonly<any> |
|
|
69
|
+
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
70
70
|
})[];
|
|
71
71
|
type: string;
|
|
72
72
|
stale: false;
|
|
73
|
-
}>, "
|
|
73
|
+
}>, "routes" | "stale">> & any> | undefined;
|
|
74
74
|
})[];
|
|
75
75
|
}>;
|
|
76
76
|
export declare function getEarliestMismatchedRoute<T extends ParamListBase>(rootState: NavigationState<T> | undefined, actionParams: NavigateActionParams): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateOperations.d.ts","sourceRoot":"","sources":["../../src/link/stateOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE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;;;;;;;;;;;;;;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkToPath.d.ts","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAKL,cAAc,EACf,MAAM,mBAAmB,CAAC;AAc3B,wBAAgB,aAAa,WAIlB,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"useLinkToPath.d.ts","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAKL,cAAc,EACf,MAAM,mBAAmB,CAAC;AAc3B,wBAAgB,aAAa,WAIlB,MAAM,UAAU,MAAM,UAoHhC;AAED,uGAAuG;AACvG,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,GAC5C,MAAM,IAAI,cAAc,CAqB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../src/link/useRouter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAK3C,wBAAgB,OAAO,WAGtB;AAED,KAAK,MAAM,GAAG;IACZ,qCAAqC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,SAAS,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../src/link/useRouter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAK3C,wBAAgB,OAAO,WAGtB;AAED,KAAK,MAAM,GAAG;IACZ,qCAAqC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,SAAS,IAAI,MAAM,CA+BlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStaticContent.d.ts","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderStaticContent.d.ts","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAqBtD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CA+CtD;AA0BD,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import requireContext from "./require-context-ponyfill";
|
|
3
|
+
export type ReactComponent = () => React.ReactElement<any, any> | null;
|
|
4
|
+
export type FileStub = {
|
|
5
|
+
default: ReactComponent;
|
|
6
|
+
} | ReactComponent;
|
|
7
|
+
export { requireContext };
|
|
8
|
+
export declare function inMemoryContext(context: Record<string, FileStub>): ((id: string) => ReactComponent | {
|
|
9
|
+
default: FileStub;
|
|
10
|
+
}) & {
|
|
11
|
+
keys: () => string[];
|
|
12
|
+
resolve: (key: string) => string;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function requireContextWithOverrides(dir: string, overrides: Record<string, FileStub>): ((id: string) => any) & {
|
|
16
|
+
keys: () => string[];
|
|
17
|
+
resolve: (key: string) => string;
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=context-stubs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";AAEA,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,QAAQ,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,cAAc,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAE/C,MAAM;;;;mBAQH,MAAM;;EAI1B;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAKnB,MAAM;;mBAUH,MAAM;;EAI1B"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import "./mocks";
|
|
2
1
|
import "./expect";
|
|
3
2
|
import { render } from "@testing-library/react-native";
|
|
4
|
-
import
|
|
3
|
+
import { FileStub } from "./context-stubs";
|
|
5
4
|
export * from "@testing-library/react-native";
|
|
6
5
|
type RenderRouterOptions = Parameters<typeof render>[1] & {
|
|
7
6
|
initialUrl?: string;
|
|
8
7
|
};
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export declare function renderRouter(context?: string, options?: RenderRouterOptions):
|
|
14
|
-
export declare function renderRouter(context: Record<string,
|
|
8
|
+
type Result = ReturnType<typeof render> & {
|
|
9
|
+
getPathname(): string;
|
|
10
|
+
getSearchParams(): URLSearchParams;
|
|
11
|
+
};
|
|
12
|
+
export declare function renderRouter(context?: string, options?: RenderRouterOptions): Result;
|
|
13
|
+
export declare function renderRouter(context: Record<string, FileStub>, options?: RenderRouterOptions): Result;
|
|
15
14
|
export declare function renderRouter(context: {
|
|
16
15
|
appDir: string;
|
|
17
|
-
overrides: Record<string,
|
|
18
|
-
}, options?: RenderRouterOptions):
|
|
16
|
+
overrides: Record<string, FileStub>;
|
|
17
|
+
}, options?: RenderRouterOptions): Result;
|
|
19
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":"AACA,OAAO,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAgB,MAAM,+BAA+B,CAAC;AAQrE,OAAO,EACL,QAAQ,EAIT,MAAM,iBAAiB,CAAC;AAIzB,cAAc,+BAA+B,CAAC;AAE9C,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,GAAG;IACxC,WAAW,IAAI,MAAM,CAAC;IACtB,eAAe,IAAI,eAAe,CAAC;CACpC,CAAC;AAQF,wBAAgB,YAAY,CAC1B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAAC;AACV,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACjC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAAC;AACV,wBAAgB,YAAY,CAC1B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAAE,EAChE,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AAgBpD,eAAO,MAAM,aAAa;;0BAEF,MAAM,KAAK,MAAM;;CAUxC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResultState } from "./fork/getStateFromPath";
|
|
2
|
+
import { ExpoRouterContextType, OnboardingExpoRouterContextType } from "./hooks";
|
|
3
|
+
import { RequireContext } from "./types";
|
|
4
|
+
export type ExpoRootProps = {
|
|
5
|
+
context: RequireContext;
|
|
6
|
+
location?: URL;
|
|
7
|
+
};
|
|
8
|
+
/** @private */
|
|
9
|
+
export declare function createExpoRouterContext({ context, location, }: ExpoRootProps): {
|
|
10
|
+
routeNode: null;
|
|
11
|
+
linking: {
|
|
12
|
+
prefixes: never[];
|
|
13
|
+
};
|
|
14
|
+
initialState: undefined;
|
|
15
|
+
getRouteInfo(): never;
|
|
16
|
+
} | {
|
|
17
|
+
routeNode: import("./Route").RouteNode;
|
|
18
|
+
linking: import("./getLinkingConfig").ExpoLinkingOptions;
|
|
19
|
+
initialState: ResultState | undefined;
|
|
20
|
+
getRouteInfo: (state: ResultState) => import("./LocationProvider").UrlObject;
|
|
21
|
+
};
|
|
22
|
+
export declare function useCreateExpoRouterContext(props: ExpoRootProps): Omit<ExpoRouterContextType, "navigationRef"> | Omit<OnboardingExpoRouterContextType, "navigationRef">;
|
|
23
|
+
//# sourceMappingURL=useCreateExpoRouterContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateExpoRouterContext.d.ts","sourceRoot":"","sources":["../src/useCreateExpoRouterContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAOF,eAAe;AACf,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,QAAqB,GACtB,EAAE,aAAa;;;;;;;;;;;0BAyBe,WAAW;EAsBzC;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,aAAa,yGAO9D"}
|
package/build/useNavigation.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { NavigationProp } from "@react-navigation/native";
|
|
|
4
4
|
* @param parent Provide an absolute path like `/(root)` to the parent route or a relative path like `../../` to the parent route.
|
|
5
5
|
* @returns the navigation object for the provided route.
|
|
6
6
|
*/
|
|
7
|
-
export declare function useNavigation(parent?: string):
|
|
7
|
+
export declare function useNavigation<T = NavigationProp<ReactNavigation.RootParamList>>(parent?: string): T;
|
|
8
8
|
export declare function resolveParentId(contextKey: string, parentId?: string | null): string | null;
|
|
9
9
|
//# sourceMappingURL=useNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACf,MAAM,0BAA0B,CAAC;AAMlC;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,
|
|
1
|
+
{"version":3,"file":"useNavigation.d.ts","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACf,MAAM,0BAA0B,CAAC;AAMlC;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,CAAC,GAAG,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,EACjD,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAgCpB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAmC3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,eA2DjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"Sitemap.d.ts","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AA+B9E,wBAAgB,aAAa,IAAI,4BAA4B,CAqB5D;AAED,wBAAgB,OAAO,gBA6BtB"}
|
package/entry.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// `@expo/metro-runtime` MUST be the first import to ensure Fast Refresh works
|
|
2
|
+
// on web.
|
|
3
|
+
import "@expo/metro-runtime";
|
|
1
4
|
import { ExpoRoot } from "expo-router";
|
|
2
5
|
import Head from "expo-router/head";
|
|
3
|
-
import "@expo/metro-runtime";
|
|
4
6
|
import { renderRootComponent } from "expo-router/src/renderRootComponent";
|
|
5
7
|
|
|
6
8
|
const ctx = require.context(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"main": "src/index.tsx",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
"preset": "jest-expo",
|
|
53
53
|
"roots": [
|
|
54
54
|
"src"
|
|
55
|
+
],
|
|
56
|
+
"setupFilesAfterEnv": [
|
|
57
|
+
"./src/testing-library/mocks.ts"
|
|
55
58
|
]
|
|
56
59
|
},
|
|
57
60
|
"peerDependencies": {
|
|
@@ -94,16 +97,17 @@
|
|
|
94
97
|
"react-native-reanimated": "~2.14.4",
|
|
95
98
|
"react-native-safe-area-context": "~4.5.0",
|
|
96
99
|
"react-native-screens": "~3.20.0",
|
|
97
|
-
"tree-kill": "^1.2.2"
|
|
100
|
+
"tree-kill": "^1.2.2",
|
|
101
|
+
"tsd": "^0.28.1"
|
|
98
102
|
},
|
|
99
103
|
"dependencies": {
|
|
100
104
|
"@bacons/react-views": "^1.1.3",
|
|
101
|
-
"@expo/metro-runtime": "2.1.
|
|
105
|
+
"@expo/metro-runtime": "2.1.2",
|
|
102
106
|
"@radix-ui/react-slot": "^1.0.0",
|
|
103
107
|
"@react-navigation/bottom-tabs": "~6.5.7",
|
|
104
108
|
"@react-navigation/native": "~6.1.6",
|
|
105
109
|
"@react-navigation/native-stack": "~6.9.12",
|
|
106
|
-
"expo-head": "0.0.
|
|
110
|
+
"expo-head": "0.0.4",
|
|
107
111
|
"expo-splash-screen": "*",
|
|
108
112
|
"query-string": "7.1.3",
|
|
109
113
|
"react-helmet-async": "^1.3.0",
|
package/plugin/build/index.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
3
4
|
const schema_utils_1 = require("schema-utils");
|
|
4
5
|
const schema = require("../options.json");
|
|
6
|
+
const withExpoHeadIos = (config) => {
|
|
7
|
+
return (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
8
|
+
// $(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route
|
|
9
|
+
if (!Array.isArray(config.modResults.NSUserActivityTypes)) {
|
|
10
|
+
config.modResults.NSUserActivityTypes = [];
|
|
11
|
+
}
|
|
12
|
+
// This ensures that stored `NSUserActivityType`s can be opened in-app.
|
|
13
|
+
// This is important for moving between native devices or from opening a link that was saved
|
|
14
|
+
// in a Quick Note or Siri Reminder.
|
|
15
|
+
config.modResults.NSUserActivityTypes.push("$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route");
|
|
16
|
+
return config;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
5
19
|
const withRouter = (config, props) => {
|
|
6
20
|
(0, schema_utils_1.validate)(schema, props);
|
|
21
|
+
withExpoHeadIos(config);
|
|
7
22
|
return {
|
|
8
23
|
...config,
|
|
9
24
|
extra: {
|