expo-router 3.4.7 → 3.4.9
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/global-state/router-store.d.ts +3 -0
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +3 -0
- package/build/global-state/router-store.js.map +1 -1
- package/build/global-state/routing.d.ts +3 -0
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +24 -1
- package/build/global-state/routing.js.map +1 -1
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +3 -0
- package/build/hooks.js.map +1 -1
- package/build/imperative-api.d.ts.map +1 -1
- package/build/imperative-api.js +3 -0
- package/build/imperative-api.js.map +1 -1
- package/build/layouts/Drawer.d.ts +40 -40
- package/build/layouts/Stack.d.ts +48 -48
- package/build/layouts/Tabs.d.ts +48 -48
- package/build/link/useLoadedNavigation.d.ts.map +1 -1
- package/build/link/useLoadedNavigation.js +1 -0
- package/build/link/useLoadedNavigation.js.map +1 -1
- package/build/testing-library/context-stubs.d.ts +1 -1
- package/build/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js +7 -2
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/testing-library/index.d.ts +8 -4
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/index.js +23 -12
- package/build/testing-library/index.js.map +1 -1
- package/build/testing-library/mocks.d.ts +0 -1
- package/build/testing-library/mocks.d.ts.map +1 -1
- package/build/testing-library/mocks.js +7 -1
- package/build/testing-library/mocks.js.map +1 -1
- package/build/types.d.ts +7 -1
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/package.json +3 -3
- package/build/utils/mockState.d.ts +0 -7
- package/build/utils/mockState.d.ts.map +0 -1
- package/build/utils/mockState.js +0 -29
- package/build/utils/mockState.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAI;IACF,OAAO,CAAC,4CAA4C,CAAC,CAAC;CACvD;AAAC,MAAM,GAAE;AAEV,gGAAgG;AAChG,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACxC,IAAI;QACF,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;QAE3D,wEAAwE;QACxE,iCAAiC;QACjC,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QAEnC,OAAO,UAAU,CAAC;KACnB;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC,CAAC;AAEH,kHAAkH;AAClH,IAAI,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;AAElE,IAAI,cAAc,GAA6B,EAAE,CAAC;AAElD,SAAgB,aAAa,CAAC,KAAa;IACzC,cAAc,GAAG,KAAK,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAkC;QAC5C,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;QACrC,SAAS,CAAC,IAAY;YACpB,OAAO,eAAe,GAAG,IAAI,CAAC;QAChC,CAAC;QACD,aAAa;YACX,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,gBAAgB;YACd,OAAO,EAAE,MAAM,KAAI,CAAC,EAAS,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,aAAa;YACjB,OAAO,cAAc,CAAC;QACxB,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Optionally enable @testing-library/jest-native/extend-expect. We use this internally for the `toBeOnTheScreen` matcher()\n */\ntry {\n require('@testing-library/jest-native/extend-expect');\n} catch {}\n\n// include this section and the NativeAnimatedHelper section for mocking react-native-reanimated\njest.mock('react-native-reanimated', () => {\n try {\n const Reanimated = require('react-native-reanimated/mock');\n\n // The mock for `call` immediately calls the callback which is incorrect\n // So we override it with a no-op\n Reanimated.default.call = () => {};\n\n return Reanimated;\n } catch {\n return {};\n }\n});\n\n// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing\njest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');\n\nlet mockInitialUrl: string | Promise<string> = '';\n\nexport function setInitialUrl(value: string) {\n mockInitialUrl = value;\n}\n\njest.mock('expo-linking', () => {\n const module: typeof import('expo-linking') = {\n ...jest.requireActual('expo-linking'),\n createURL(path: string) {\n return 'yourscheme://' + path;\n },\n resolveScheme() {\n return 'yourscheme';\n },\n addEventListener() {\n return { remove() {} } as any;\n },\n async getInitialURL() {\n return mockInitialUrl;\n },\n };\n\n return module;\n});\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -12,16 +12,22 @@ export interface RequireContext {
|
|
|
12
12
|
/** The list of input keys will become optional, everything else will remain the same. */
|
|
13
13
|
export type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
14
14
|
export type Router = {
|
|
15
|
-
/** Navigate to the provided href using a
|
|
15
|
+
/** Navigate to the provided href using a dismiss operation if possible. */
|
|
16
16
|
push: (href: Href) => void;
|
|
17
|
+
/** Navigate to the provided href using a push operation if possible. */
|
|
18
|
+
dismiss: (count?: number) => void;
|
|
17
19
|
/** Navigate to the provided href. */
|
|
18
20
|
navigate: (href: Href) => void;
|
|
19
21
|
/** Navigate to route without appending to the history. */
|
|
20
22
|
replace: (href: Href) => void;
|
|
23
|
+
/** Navigate to first screen within the lowest stack */
|
|
24
|
+
dismissAll: () => void;
|
|
21
25
|
/** Go back in the history. */
|
|
22
26
|
back: () => void;
|
|
23
27
|
/** If there's history that supports invoking the `back` function. */
|
|
24
28
|
canGoBack: () => boolean;
|
|
29
|
+
/** If there's history that supports invoking the `dismiss` and `dismissAll` function. */
|
|
30
|
+
canDismiss: () => boolean;
|
|
25
31
|
/** Update the current route query params. */
|
|
26
32
|
setParams: (params?: Record<string, string>) => void;
|
|
27
33
|
};
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,yFAAyF;AACzF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,MAAM,GAAG;IACnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,yFAAyF;AACzF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,MAAM,MAAM,GAAG;IACnB,2EAA2E;IAC3E,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3B,wEAAwE;IACxE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qCAAqC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,uDAAuD;IACvD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,qEAAqE;IACrE,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,yFAAyF;IACzF,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACtD,CAAC"}
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Href } from './link/href';\n\n// TODO: Use the global type\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type Router = {\n /** Navigate to the provided href using a
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Href } from './link/href';\n\n// TODO: Use the global type\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport type Router = {\n /** Navigate to the provided href using a dismiss operation if possible. */\n push: (href: Href) => void;\n /** Navigate to the provided href using a push operation if possible. */\n dismiss: (count?: number) => void;\n /** Navigate to the provided href. */\n navigate: (href: Href) => void;\n /** Navigate to route without appending to the history. */\n replace: (href: Href) => void;\n /** Navigate to first screen within the lowest stack */\n dismissAll: () => void;\n /** Go back in the history. */\n back: () => void;\n /** If there's history that supports invoking the `back` function. */\n canGoBack: () => boolean;\n /** If there's history that supports invoking the `dismiss` and `dismissAll` function. */\n canDismiss: () => boolean;\n /** Update the current route query params. */\n setParams: (params?: Record<string, string>) => void;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.9",
|
|
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",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"@react-navigation/bottom-tabs": "~6.5.7",
|
|
98
98
|
"@react-navigation/native": "~6.1.6",
|
|
99
99
|
"@react-navigation/native-stack": "~6.9.12",
|
|
100
|
-
"expo-splash-screen": "0.26.
|
|
100
|
+
"expo-splash-screen": "~0.26.5",
|
|
101
101
|
"react-helmet-async": "^1.3.0",
|
|
102
102
|
"schema-utils": "^4.0.1"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "b9ac45425665ef16e6900c627fe9eba5de60f2ed"
|
|
105
105
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RequireContext } from '../types';
|
|
2
|
-
export declare function createMockContextModule(map?: Record<string, Record<string, any>>): RequireContext;
|
|
3
|
-
export declare function configFromFs(map?: (string | [string, object])[]): {
|
|
4
|
-
initialRouteName?: string | undefined;
|
|
5
|
-
screens: Record<string, import("../getReactNavigationConfig").Screen>;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=mockState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockState.d.ts","sourceRoot":"","sources":["../../src/utils/mockState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM,kBAQpF;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAO;;;EAiBnE"}
|
package/build/utils/mockState.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configFromFs = exports.createMockContextModule = void 0;
|
|
4
|
-
const getLinkingConfig_1 = require("../getLinkingConfig");
|
|
5
|
-
const getRoutes_1 = require("../getRoutes");
|
|
6
|
-
function createMockContextModule(map = {}) {
|
|
7
|
-
const contextModule = jest.fn((key) => map[key]);
|
|
8
|
-
Object.defineProperty(contextModule, 'keys', {
|
|
9
|
-
value: () => Object.keys(map),
|
|
10
|
-
});
|
|
11
|
-
return contextModule;
|
|
12
|
-
}
|
|
13
|
-
exports.createMockContextModule = createMockContextModule;
|
|
14
|
-
function configFromFs(map = []) {
|
|
15
|
-
const ctx = map.reduce((acc, value) => {
|
|
16
|
-
if (typeof value === 'string') {
|
|
17
|
-
acc[value] = { default: () => { } };
|
|
18
|
-
return acc;
|
|
19
|
-
}
|
|
20
|
-
acc[value[0]] = {
|
|
21
|
-
default: () => { },
|
|
22
|
-
...value[1],
|
|
23
|
-
};
|
|
24
|
-
return acc;
|
|
25
|
-
}, {});
|
|
26
|
-
return (0, getLinkingConfig_1.getNavigationConfig)((0, getRoutes_1.getExactRoutes)(createMockContextModule(ctx)));
|
|
27
|
-
}
|
|
28
|
-
exports.configFromFs = configFromFs;
|
|
29
|
-
//# sourceMappingURL=mockState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mockState.js","sourceRoot":"","sources":["../../src/utils/mockState.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC1D,4CAA8C;AAG9C,SAAgB,uBAAuB,CAAC,MAA2C,EAAE;IACnF,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE;QAC3C,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;KAC9B,CAAC,CAAC;IAEH,OAAO,aAA0C,CAAC;AACpD,CAAC;AARD,0DAQC;AAED,SAAgB,YAAY,CAAC,MAAqC,EAAE;IAClE,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CACpB,CAAC,GAAG,EAAE,KAAU,EAAE,EAAE;QAClB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;YACnC,OAAO,GAAG,CAAC;SACZ;QACD,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG;YACd,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,GAAG,KAAK,CAAC,CAAC,CAAC;SACZ,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAyC,CAC1C,CAAC;IAEF,OAAO,IAAA,sCAAmB,EAAC,IAAA,0BAAc,EAAC,uBAAuB,CAAC,GAAG,CAAC,CAAE,CAAC,CAAC;AAC5E,CAAC;AAjBD,oCAiBC","sourcesContent":["import { getNavigationConfig } from '../getLinkingConfig';\nimport { getExactRoutes } from '../getRoutes';\nimport { RequireContext } from '../types';\n\nexport function createMockContextModule(map: Record<string, Record<string, any>> = {}) {\n const contextModule = jest.fn((key) => map[key]);\n\n Object.defineProperty(contextModule, 'keys', {\n value: () => Object.keys(map),\n });\n\n return contextModule as unknown as RequireContext;\n}\n\nexport function configFromFs(map: (string | [string, object])[] = []) {\n const ctx = map.reduce(\n (acc, value: any) => {\n if (typeof value === 'string') {\n acc[value] = { default: () => {} };\n return acc;\n }\n acc[value[0]] = {\n default: () => {},\n ...value[1],\n };\n return acc;\n },\n {} as Record<string, Record<string, any>>\n );\n\n return getNavigationConfig(getExactRoutes(createMockContextModule(ctx))!);\n}\n"]}
|