expo-router 1.5.3 → 1.7.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/_entry.tsx +1 -1
- package/_error.js +6 -0
- package/_html-ctx.tsx +1 -1
- package/babel.js +6 -0
- package/build/ExpoRoot.d.ts.map +1 -1
- package/build/LocationProvider.d.ts +6 -12
- package/build/LocationProvider.d.ts.map +1 -1
- package/build/exports.d.ts +1 -2
- package/build/exports.d.ts.map +1 -1
- package/build/fork/findFocusedRoute.d.ts +1 -1
- package/build/fork/getStateFromPath.d.ts.map +1 -1
- package/build/fork/useLinking.native.d.ts +2 -2
- package/build/fork/useLinking.native.d.ts.map +1 -1
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/linking.d.ts +1 -1
- package/build/link/linking.d.ts.map +1 -1
- package/build/link/stateOperations.d.ts +3 -3
- package/build/link/useHref.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/navigationStore/index.d.ts +82 -0
- package/build/navigationStore/index.d.ts.map +1 -0
- package/build/{static/useServerState.d.ts → navigationStore/initialState.d.ts} +9 -8
- package/build/navigationStore/initialState.d.ts.map +1 -0
- package/build/static/renderStaticContent.d.ts.map +1 -1
- package/build/testing-library/expect.d.ts +2 -0
- package/build/testing-library/expect.d.ts.map +1 -0
- package/build/testing-library/index.d.ts +19 -0
- package/build/testing-library/index.d.ts.map +1 -0
- package/build/testing-library/mocks.d.ts +2 -0
- package/build/testing-library/mocks.d.ts.map +1 -0
- package/build/testing-library/require-context-ponyfill.d.ts +3 -0
- package/build/testing-library/require-context-ponyfill.d.ts.map +1 -0
- package/build/useScreens.d.ts.map +1 -1
- package/build/views/ErrorBoundary.d.ts.map +1 -1
- package/build/views/Sitemap.d.ts.map +1 -1
- package/build/views/SuspenseFallback.d.ts.map +1 -1
- package/entry.js +1 -2
- package/head.ts +5 -2
- package/index.d.ts +3 -1
- package/package.json +7 -2
- package/src/ExpoRoot.tsx +28 -26
- package/src/LocationProvider.tsx +3 -149
- package/src/exports.ts +3 -2
- package/src/fork/getStateFromPath.ts +2 -2
- package/src/fork/useLinking.native.ts +2 -1
- package/src/layouts/Tabs.tsx +1 -1
- package/src/link/Link.tsx +1 -1
- package/src/link/linking.ts +5 -1
- package/src/link/useHref.ts +1 -1
- package/src/link/useLinkToPath.ts +13 -15
- package/src/link/useLinkToPathProps.tsx +1 -1
- package/src/link/useLoadedNavigation.ts +6 -6
- package/src/link/useRouter.ts +2 -4
- package/src/navigationStore/index.ts +215 -0
- package/src/navigationStore/initialState.ts +25 -0
- package/src/static/renderStaticContent.tsx +6 -8
- package/src/testing-library/expect.ts +15 -0
- package/src/testing-library/index.tsx +159 -0
- package/src/testing-library/mocks.ts +15 -0
- package/src/testing-library/require-context-ponyfill.ts +44 -0
- package/src/useScreens.tsx +1 -6
- package/src/views/EmptyRoute.tsx +1 -1
- package/src/views/ErrorBoundary.tsx +1 -1
- package/src/views/Navigator.tsx +1 -1
- package/src/views/Sitemap.tsx +17 -6
- package/src/views/SuspenseFallback.tsx +1 -1
- package/src/views/Unmatched.tsx +1 -1
- package/types/expect.d.ts +4 -0
- package/types/global.d.ts +29 -0
- package/types/index.d.ts +3 -0
- package/types/jest.d.ts +9 -0
- package/types/react-native-web.d.ts +299 -0
- package/build/NavigationContainer.d.ts +0 -8
- package/build/NavigationContainer.d.ts.map +0 -1
- package/build/head/Head.d.ts +0 -7
- package/build/head/Head.d.ts.map +0 -1
- package/build/head/Head.native.d.ts +0 -11
- package/build/head/Head.native.d.ts.map +0 -1
- package/build/link/useLinkingContext.d.ts +0 -7
- package/build/link/useLinkingContext.d.ts.map +0 -1
- package/build/onboard/useTutorial.d.ts +0 -4
- package/build/onboard/useTutorial.d.ts.map +0 -1
- package/build/static/useServerState.d.ts.map +0 -1
- package/build/static/useServerState.native.d.ts +0 -2
- package/build/static/useServerState.native.d.ts.map +0 -1
- package/build/useInitialRootState.d.ts +0 -42
- package/build/useInitialRootState.d.ts.map +0 -1
- package/build/useInitialRootState.native.d.ts +0 -3
- package/build/useInitialRootState.native.d.ts.map +0 -1
- package/build/useInitialRootStateContext.d.ts +0 -13
- package/build/useInitialRootStateContext.d.ts.map +0 -1
- package/build/useRootNavigation.d.ts +0 -9
- package/build/useRootNavigation.d.ts.map +0 -1
- package/build/useRootRouteNodeContext.d.ts +0 -11
- package/build/useRootRouteNodeContext.d.ts.map +0 -1
- package/src/NavigationContainer.tsx +0 -43
- package/src/head/Head.native.tsx +0 -78
- package/src/head/Head.tsx +0 -12
- package/src/link/useLinkingContext.ts +0 -35
- package/src/onboard/useTutorial.tsx +0 -45
- package/src/static/useServerState.native.ts +0 -4
- package/src/static/useServerState.ts +0 -52
- package/src/useInitialRootState.native.tsx +0 -35
- package/src/useInitialRootState.tsx +0 -16
- package/src/useInitialRootStateContext.tsx +0 -46
- package/src/useRootNavigation.ts +0 -42
- package/src/useRootRouteNodeContext.tsx +0 -40
- package/types/react-native.d.ts +0 -179
- /package/{metro-require.d.ts → types/metro-require.d.ts} +0 -0
package/_entry.tsx
CHANGED
package/_error.js
ADDED
package/_html-ctx.tsx
CHANGED
package/babel.js
CHANGED
|
@@ -189,6 +189,12 @@ module.exports = function (api) {
|
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
// Skip loading the app root in tests.
|
|
193
|
+
// This is handled by the testing-library utils
|
|
194
|
+
if (process.env.NODE_ENV === "test") {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
192
198
|
parent.replaceWith(
|
|
193
199
|
// This is defined in Expo CLI when using Metro. It points to the relative path for the project app directory.
|
|
194
200
|
t.stringLiteral(getExpoRouterAppRoot(projectRoot))
|
package/build/ExpoRoot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoRoot.d.ts","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoRoot.d.ts","sourceRoot":"","sources":["../src/ExpoRoot.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAwBzC,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,eAchE"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { State } from "./fork/getPathFromState";
|
|
2
2
|
type SearchParams = Record<string, string | string[]>;
|
|
3
3
|
type UrlObject = {
|
|
4
4
|
pathname: string;
|
|
5
5
|
readonly params: SearchParams;
|
|
6
6
|
segments: string[];
|
|
7
7
|
};
|
|
8
|
+
export declare function getRouteInfoFromState(getPathFromState: (state: State, asPath: boolean) => {
|
|
9
|
+
path: string;
|
|
10
|
+
params: any;
|
|
11
|
+
}, state: State): UrlObject;
|
|
12
|
+
export declare function compareRouteInfo(a: UrlObject, b: UrlObject): boolean;
|
|
8
13
|
export declare function compareUrlSearchParams(a: SearchParams, b: SearchParams): boolean;
|
|
9
14
|
export declare function getNormalizedStatePath({ path: statePath, params, }: {
|
|
10
15
|
path: string;
|
|
11
16
|
params: any;
|
|
12
17
|
}): Omit<UrlObject, "pathname">;
|
|
13
|
-
export declare function LocationProvider({ children }: {
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}): JSX.Element;
|
|
16
|
-
/** @returns Currently selected route as a normalized string without search parameters. e.g. `/acme?foo=bar` -> `/acme`. Segments will be normalized: `/[id]?id=normal` -> `/normal` */
|
|
17
|
-
export declare function usePathname(): string;
|
|
18
|
-
/** @returns Current URL Search Parameters. */
|
|
19
|
-
export declare function useSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
20
|
-
/** @returns Current URL Search Parameters that only update when the path matches the current route. */
|
|
21
|
-
export declare function useLocalSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
22
|
-
/** @returns Array of selected segments. */
|
|
23
|
-
export declare function useSegments(): string[];
|
|
24
18
|
export {};
|
|
25
19
|
//# sourceMappingURL=LocationProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,yBAAyB,CAAC;AAE3D,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAEtD,KAAK,SAAS,GAAG;IACf,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,CAOX;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,WAO1D;AAED,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,YAAY,GACd,OAAO,CAET;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,CAAC,CAgB9B"}
|
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, } from "./
|
|
3
|
+
export { usePathname, useLocalSearchParams, useSearchParams, useSegments, useRootNavigation, useRootNavigationState, } from "./navigationStore";
|
|
4
4
|
export { Link, Redirect } from "./link/Link";
|
|
5
5
|
export { withLayoutContext } from "./layouts/withLayoutContext";
|
|
6
6
|
export { Navigator, Slot };
|
|
@@ -10,6 +10,5 @@ export { ErrorBoundaryProps } from "./views/Try";
|
|
|
10
10
|
export { ErrorBoundary } from "./views/ErrorBoundary";
|
|
11
11
|
export { SplashScreen } from "./views/Splash";
|
|
12
12
|
export { useNavigation } from "./useNavigation";
|
|
13
|
-
export { useRootNavigation, useRootNavigationState } from "./useRootNavigation";
|
|
14
13
|
export { useFocusEffect } from "./useFocusEffect";
|
|
15
14
|
//# sourceMappingURL=exports.d.ts.map
|
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,
|
|
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,mBAAmB,CAAC;AAC3B,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
|
+
}>, "stale" | "routes">> & {
|
|
20
20
|
routes: (Omit<import("@react-navigation/routers").Route<string, object | undefined>, "key"> & any)[];
|
|
21
21
|
}> | undefined;
|
|
22
22
|
}) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrC,KAAK,OAAO,CAAC,SAAS,SAAS,MAAM,IAAI;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,CAAC;AAe1D,KAAK,kBAAkB,GAAG;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG;IACxD,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,SAAS,SAAS,MAAM,EAC/D,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC3B,WAAW,GAAG,SAAS,CAIzB;AAED,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,MAAM,EAC/D,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;;;;;;;;;;;;;;EA+C7B"}
|
|
@@ -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
|
+
}>, "stale" | "routes">> & 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
|
+
}>, "stale" | "routes">> & 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../src/fork/useLinking.native.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAI7C,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EAGE,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAUC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../src/fork/useLinking.native.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,sBAAsB,EACtB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAI7C,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EAGE,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAUC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4KX"}
|
|
@@ -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;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Cf,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":[],"mappings":"AAEA,OAAO,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAG/D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI3C,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC;IACvE,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IAGX,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,CACR,CAAC,EAAE,KAAK,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,QAMhD;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"}
|
package/build/link/linking.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import getPathFromState from "../fork/getPathFromState";
|
|
2
2
|
import getStateFromPath from "../fork/getStateFromPath";
|
|
3
|
-
export declare function getInitialURL(): Promise<string
|
|
3
|
+
export declare function getInitialURL(): Promise<string | null> | string;
|
|
4
4
|
export declare function getRootURL(): string;
|
|
5
5
|
export declare function addEventListener(listener: (url: string) => void): () => void;
|
|
6
6
|
export { getStateFromPath, getPathFromState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../../src/link/linking.ts"],"names":[],"mappings":"AAKA,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAOxD,
|
|
1
|
+
{"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../../src/link/linking.ts"],"names":[],"mappings":"AAKA,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAOxD,wBAAgB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,CAiD/D;AAID,wBAAgB,UAAU,IAAI,MAAM,CAKnC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,cA8B/D;AAED,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -30,7 +30,7 @@ export declare function findTopRouteForTarget(state: ResultState): Omit<import("
|
|
|
30
30
|
})[];
|
|
31
31
|
type: string;
|
|
32
32
|
stale: false;
|
|
33
|
-
}>, "
|
|
33
|
+
}>, "stale" | "routes">> & {
|
|
34
34
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & any)[];
|
|
35
35
|
}> | undefined;
|
|
36
36
|
};
|
|
@@ -52,7 +52,7 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
52
52
|
})[];
|
|
53
53
|
type: string;
|
|
54
54
|
stale: false;
|
|
55
|
-
}>, "
|
|
55
|
+
}>, "stale" | "routes">> & {
|
|
56
56
|
routes: (Omit<import("@react-navigation/native").Route<string, object | undefined>, "key"> & {
|
|
57
57
|
state?: Readonly<Partial<Omit<Readonly<{
|
|
58
58
|
key: string;
|
|
@@ -70,7 +70,7 @@ export declare function getQualifiedStateForTopOfTargetState(rootState: InitialS
|
|
|
70
70
|
})[];
|
|
71
71
|
type: string;
|
|
72
72
|
stale: false;
|
|
73
|
-
}>, "
|
|
73
|
+
}>, "stale" | "routes">> & 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":"useHref.d.ts","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHref.d.ts","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,kBAAkB;AAClB,KAAK,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,GAAG;IACrD,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,kBAAkB;AAClB,wBAAgB,OAAO,IAAI,SAAS,CAUnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkToPath.d.ts","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,
|
|
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,UAmHhC;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":"
|
|
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,CA6BlC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { LinkingOptions, NavigationState, ParamListBase, PartialState } from "@react-navigation/native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { RouteNode } from "../Route";
|
|
4
|
+
import getPathFromState from "../fork/getPathFromState";
|
|
5
|
+
import { ResultState } from "../fork/getStateFromPath";
|
|
6
|
+
import { RequireContext } from "../types";
|
|
7
|
+
export declare const navigationRef: import("@react-navigation/native").NavigationContainerRefWithCurrent<Record<string, unknown>>;
|
|
8
|
+
type SearchParams = Record<string, string | string[]>;
|
|
9
|
+
type UrlObject = {
|
|
10
|
+
pathname: string;
|
|
11
|
+
readonly params: SearchParams;
|
|
12
|
+
segments: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare class NavigationStore {
|
|
15
|
+
subscriptionMap: Map<string, Set<() => void>>;
|
|
16
|
+
ssrLocation: URL | undefined;
|
|
17
|
+
navigationRef: import("@react-navigation/native").NavigationContainerRefWithCurrent<Record<string, unknown>>;
|
|
18
|
+
routeNode: RouteNode;
|
|
19
|
+
linking: LinkingOptions<object>;
|
|
20
|
+
rootState: NavigationState | PartialState<NavigationState> | undefined;
|
|
21
|
+
initialRootState: ResultState | undefined;
|
|
22
|
+
url: URL;
|
|
23
|
+
routeInfo: UrlObject;
|
|
24
|
+
shouldShowTutorial: boolean;
|
|
25
|
+
_onReady?: () => void;
|
|
26
|
+
constructor(ssrLocation?: URL);
|
|
27
|
+
initialise: (context: RequireContext, onReady: () => void) => void;
|
|
28
|
+
handleRouteInfoChange: (data?: NavigationState | PartialState<NavigationState>) => void;
|
|
29
|
+
onReady: () => void;
|
|
30
|
+
notifiySubscribers: (topic: string) => void;
|
|
31
|
+
subscribeFactory: (key: string) => (callback: () => void) => () => void;
|
|
32
|
+
subscribeRouteInfo: (callback: () => void) => () => void;
|
|
33
|
+
subscribeRootState: (callback: () => void) => () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const NavigationStoreContext: React.Context<NavigationStore>;
|
|
36
|
+
export declare function useNavigationStore(context: RequireContext): NavigationStore & {
|
|
37
|
+
shouldShowSplash: boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare function useRootNavigation(): import("@react-navigation/native").NavigationContainerRefWithCurrent<Record<string, unknown>>;
|
|
40
|
+
export declare function useLinkingContext(): Required<Omit<LinkingOptions<ParamListBase>, "filter" | "enabled">> & {
|
|
41
|
+
getPathFromState: typeof getPathFromState;
|
|
42
|
+
};
|
|
43
|
+
export declare function useRootNavigationState(): Readonly<{
|
|
44
|
+
key: string;
|
|
45
|
+
index: number;
|
|
46
|
+
routeNames: string[];
|
|
47
|
+
history?: unknown[] | undefined;
|
|
48
|
+
routes: (Readonly<{
|
|
49
|
+
key: string;
|
|
50
|
+
name: string;
|
|
51
|
+
path?: string | undefined;
|
|
52
|
+
}> & Readonly<{
|
|
53
|
+
params?: Readonly<object | undefined>;
|
|
54
|
+
}> & {
|
|
55
|
+
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
56
|
+
})[];
|
|
57
|
+
type: string;
|
|
58
|
+
stale: false;
|
|
59
|
+
}> | PartialState<Readonly<{
|
|
60
|
+
key: string;
|
|
61
|
+
index: number;
|
|
62
|
+
routeNames: string[];
|
|
63
|
+
history?: unknown[] | undefined;
|
|
64
|
+
routes: (Readonly<{
|
|
65
|
+
key: string;
|
|
66
|
+
name: string;
|
|
67
|
+
path?: string | undefined;
|
|
68
|
+
}> & Readonly<{
|
|
69
|
+
params?: Readonly<object | undefined>;
|
|
70
|
+
}> & {
|
|
71
|
+
state?: Readonly<any> | PartialState<Readonly<any>> | undefined;
|
|
72
|
+
})[];
|
|
73
|
+
type: string;
|
|
74
|
+
stale: false;
|
|
75
|
+
}>> | undefined;
|
|
76
|
+
export declare function useRouteInfo(): UrlObject;
|
|
77
|
+
export declare function useSegments(): string[];
|
|
78
|
+
export declare function usePathname(): string;
|
|
79
|
+
export declare function useSearchParams(): SearchParams;
|
|
80
|
+
export declare function useLocalSearchParams<TParams extends SearchParams = SearchParams>(): Partial<TParams>;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigationStore/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EAGb,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,gBAEN,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,eAAO,MAAM,aAAa,+FAC+B,CAAC;AAE1D,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAEtD,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,qBAAa,eAAe;IAC1B,eAAe,wBAA6B,IAAI,GAI7C;IAEH,WAAW,EAAE,GAAG,GAAG,SAAS,CAAC;IAE7B,aAAa,gGAAiB;IAC9B,SAAS,EAAG,SAAS,CAAC;IACtB,OAAO,EAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACjC,SAAS,EAAE,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;IACvE,gBAAgB,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAG,GAAG,CAAC;IACV,SAAS,EAAG,SAAS,CAAC;IAEtB,kBAAkB,UAAS;IAC3B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;gBAEV,WAAW,CAAC,EAAE,GAAG;IAI7B,UAAU,YAAa,cAAc,WAAW,MAAM,IAAI,UAoBxD;IAEF,qBAAqB,UACZ,eAAe,GAAG,aAAa,eAAe,CAAC,UA6BtD;IAEF,OAAO,aAWL;IAEF,kBAAkB,UAAW,MAAM,UAIjC;IAEF,gBAAgB,QAAS,MAAM,gBACX,MAAM,IAAI,gBAM5B;IAEF,kBAAkB,aARE,MAAM,IAAI,gBAQ0B;IACxD,kBAAkB,aATE,MAAM,IAAI,gBAS0B;CACzD;AAED,eAAO,MAAM,sBAAsB,gCAElC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc;;EAezD;AAED,wBAAgB,iBAAiB,kGAEhC;AAED,wBAAgB,iBAAiB;sBASX,uBAAuB;EAE5C;AAED,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAOrC;AAED,wBAAgB,YAAY,cAO3B;AAED,wBAAgB,WAAW,aAE1B;AAED,wBAAgB,WAAW,WAE1B;AAED,wBAAgB,eAAe,iBAE9B;AAED,wBAAgB,oBAAoB,CAClC,OAAO,SAAS,YAAY,GAAG,YAAY,KACxC,OAAO,CAAC,OAAO,CAAC,CAEpB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { LinkingOptions } from "@react-navigation/native";
|
|
2
|
+
export declare function getInitialState(linking: LinkingOptions<object>, ssrLocation?: URL): (Partial<Omit<Readonly<{
|
|
2
3
|
key: string;
|
|
3
4
|
index: number;
|
|
4
5
|
routeNames: string[];
|
|
@@ -10,13 +11,13 @@ export declare function useServerState(): (Partial<Omit<Readonly<{
|
|
|
10
11
|
}> & Readonly<{
|
|
11
12
|
params?: Readonly<object | undefined>;
|
|
12
13
|
}> & {
|
|
13
|
-
state?: Readonly<any> | import("@react-navigation/
|
|
14
|
+
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
|
|
14
15
|
})[];
|
|
15
16
|
type: string;
|
|
16
17
|
stale: false;
|
|
17
|
-
}>, "
|
|
18
|
+
}>, "stale" | "routes">> & Readonly<{
|
|
18
19
|
stale?: true | undefined;
|
|
19
|
-
routes: import("@react-navigation/
|
|
20
|
+
routes: import("@react-navigation/native").PartialRoute<import("@react-navigation/native").Route<string, object | undefined>>[];
|
|
20
21
|
}> & {
|
|
21
22
|
state?: (Partial<Omit<Readonly<{
|
|
22
23
|
key: string;
|
|
@@ -30,13 +31,13 @@ export declare function useServerState(): (Partial<Omit<Readonly<{
|
|
|
30
31
|
}> & Readonly<{
|
|
31
32
|
params?: Readonly<object | undefined>;
|
|
32
33
|
}> & {
|
|
33
|
-
state?: Readonly<any> | import("@react-navigation/
|
|
34
|
+
state?: Readonly<any> | import("@react-navigation/native").PartialState<Readonly<any>> | undefined;
|
|
34
35
|
})[];
|
|
35
36
|
type: string;
|
|
36
37
|
stale: false;
|
|
37
|
-
}>, "
|
|
38
|
+
}>, "stale" | "routes">> & Readonly<{
|
|
38
39
|
stale?: true | undefined;
|
|
39
|
-
routes: import("@react-navigation/
|
|
40
|
+
routes: import("@react-navigation/native").PartialRoute<import("@react-navigation/native").Route<string, object | undefined>>[];
|
|
40
41
|
}> & any) | undefined;
|
|
41
42
|
}) | undefined;
|
|
42
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=initialState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialState.d.ts","sourceRoot":"","sources":["../../src/navigationStore/initialState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,WAAW,CAAC,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAoBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStaticContent.d.ts","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
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;AAWtD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,CA+CtD;AA0BD,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/testing-library/expect.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./mocks";
|
|
2
|
+
import "./expect";
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
4
|
+
import React from "react";
|
|
5
|
+
export * from "@testing-library/react-native";
|
|
6
|
+
type RenderRouterOptions = Parameters<typeof render>[1] & {
|
|
7
|
+
initialUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
type RouteOverrideFunction = () => React.ReactElement<any, any> | null;
|
|
10
|
+
type RouteOverride = {
|
|
11
|
+
default: RouteOverrideFunction;
|
|
12
|
+
} | RouteOverrideFunction;
|
|
13
|
+
export declare function renderRouter(context?: string, options?: RenderRouterOptions): ReturnType<typeof render>;
|
|
14
|
+
export declare function renderRouter(context: Record<string, RouteOverride>, options?: RenderRouterOptions): ReturnType<typeof render>;
|
|
15
|
+
export declare function renderRouter(context: {
|
|
16
|
+
appDir: string;
|
|
17
|
+
overrides: Record<string, RouteOverride>;
|
|
18
|
+
}, options?: RenderRouterOptions): ReturnType<typeof render>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,CAAC;AACjB,OAAO,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAgB,MAAM,+BAA+B,CAAC;AAGrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,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,qBAAqB,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AAEvE,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE,qBAAqB,CAAA;CAAE,GAAG,qBAAqB,CAAC;AAoChF,wBAAgB,YAAY,CAC1B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAC7B,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACtC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAC7B,wBAAgB,YAAY,CAC1B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;CAAE,EACrE,OAAO,CAAC,EAAE,mBAAmB,GAC5B,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-context-ponyfill.d.ts","sourceRoot":"","sources":["../../src/testing-library/require-context-ponyfill.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,IAAI,SAAM,EACV,kBAAkB,UAAO,EACzB,iBAAiB,SAAe,kBAmCjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAIL,SAAS,EAGV,MAAM,SAAS,CAAC;AAMjB,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACxD;IACF,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAGnB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AA8DF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAUxE;AA6BD,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,kIAuE1D;AAED,oGAAoG;AACpG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;;sCA0B5C"}
|
|
@@ -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":";AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,eAkEjE"}
|
|
@@ -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;AAsC9E,wBAAgB,aAAa,IAAI,4BAA4B,CAqB5D;AAED,wBAAgB,OAAO,gBA6BtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseFallback.d.ts","sourceRoot":"","sources":["../../src/views/SuspenseFallback.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SuspenseFallback.d.ts","sourceRoot":"","sources":["../../src/views/SuspenseFallback.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,eAM/D"}
|
package/entry.js
CHANGED
package/head.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore: TODO -- monorepo issue
|
|
2
|
+
import { Head } from "expo-head";
|
|
2
3
|
|
|
3
|
-
export default Head
|
|
4
|
+
export default Head as unknown as React.FC<{ children?: React.ReactNode }> & {
|
|
5
|
+
Provider: React.FC<{ children?: React.ReactNode; context: any }>;
|
|
6
|
+
};
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"main": "src/index.tsx",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"files": [
|
|
7
|
+
"_error.js",
|
|
7
8
|
"_entry.tsx",
|
|
8
9
|
"_html-ctx.tsx",
|
|
9
10
|
"assets",
|
|
@@ -69,6 +70,9 @@
|
|
|
69
70
|
},
|
|
70
71
|
"@react-navigation/drawer": {
|
|
71
72
|
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@testing-library/jest-native": {
|
|
75
|
+
"optional": true
|
|
72
76
|
}
|
|
73
77
|
},
|
|
74
78
|
"devDependencies": {
|
|
@@ -92,11 +96,12 @@
|
|
|
92
96
|
},
|
|
93
97
|
"dependencies": {
|
|
94
98
|
"@bacons/react-views": "^1.1.3",
|
|
95
|
-
"@expo/metro-runtime": "2.
|
|
99
|
+
"@expo/metro-runtime": "2.1.1",
|
|
96
100
|
"@radix-ui/react-slot": "^1.0.0",
|
|
97
101
|
"@react-navigation/bottom-tabs": "~6.5.7",
|
|
98
102
|
"@react-navigation/native": "~6.1.6",
|
|
99
103
|
"@react-navigation/native-stack": "~6.9.12",
|
|
104
|
+
"expo-head": "0.0.1",
|
|
100
105
|
"expo-splash-screen": "*",
|
|
101
106
|
"query-string": "7.1.3",
|
|
102
107
|
"react-helmet-async": "^1.3.0",
|
package/src/ExpoRoot.tsx
CHANGED
|
@@ -2,14 +2,9 @@ import { StatusBar } from "expo-status-bar";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import UpstreamNavigationContainer from "./fork/NavigationContainer";
|
|
6
|
+
import { useNavigationStore } from "./navigationStore";
|
|
7
7
|
import { RequireContext } from "./types";
|
|
8
|
-
import { InitialRootStateProvider } from "./useInitialRootStateContext";
|
|
9
|
-
import {
|
|
10
|
-
RootRouteNodeProvider,
|
|
11
|
-
useRootRouteNodeContext,
|
|
12
|
-
} from "./useRootRouteNodeContext";
|
|
13
8
|
import { getQualifiedRouteComponent } from "./useScreens";
|
|
14
9
|
import { SplashScreen } from "./views/Splash";
|
|
15
10
|
|
|
@@ -37,6 +32,7 @@ export function ExpoRoot({ context }: { context: RequireContext }) {
|
|
|
37
32
|
return (
|
|
38
33
|
<GestureHandlerRootView>
|
|
39
34
|
<SafeAreaProvider
|
|
35
|
+
testID="test"
|
|
40
36
|
// SSR support
|
|
41
37
|
initialMetrics={INITIAL_METRICS}
|
|
42
38
|
>
|
|
@@ -49,27 +45,33 @@ export function ExpoRoot({ context }: { context: RequireContext }) {
|
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
function ContextNavigator({ context }: { context: RequireContext }) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
const {
|
|
49
|
+
shouldShowTutorial,
|
|
50
|
+
shouldShowSplash,
|
|
51
|
+
linking,
|
|
52
|
+
navigationRef,
|
|
53
|
+
onReady,
|
|
54
|
+
routeNode,
|
|
55
|
+
} = useNavigationStore(context);
|
|
56
|
+
|
|
57
|
+
if (shouldShowTutorial) {
|
|
58
|
+
const Tutorial = require("./onboard/Tutorial").Tutorial;
|
|
59
|
+
SplashScreen.hideAsync();
|
|
60
|
+
return <Tutorial />;
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
const Component = getQualifiedRouteComponent(routeNode);
|
|
64
|
+
|
|
61
65
|
return (
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
<>
|
|
67
|
+
{shouldShowSplash && <SplashScreen />}
|
|
68
|
+
<UpstreamNavigationContainer
|
|
69
|
+
linking={linking}
|
|
70
|
+
ref={navigationRef}
|
|
71
|
+
onReady={onReady}
|
|
72
|
+
>
|
|
73
|
+
<Component />
|
|
74
|
+
</UpstreamNavigationContainer>
|
|
75
|
+
</>
|
|
69
76
|
);
|
|
70
77
|
}
|
|
71
|
-
|
|
72
|
-
function RootRoute() {
|
|
73
|
-
const Component = getQualifiedRouteComponent(useRootRouteNodeContext());
|
|
74
|
-
return <Component />;
|
|
75
|
-
}
|