expo-router 56.2.20 → 56.2.21
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/android/build.gradle +2 -2
- package/build/standard-navigation/index.d.ts +9 -5
- package/build/standard-navigation/index.d.ts.map +1 -1
- package/build/standard-navigation/index.js +5 -3
- package/build/standard-navigation/index.js.map +1 -1
- package/build/standard-navigation/types.d.ts +42 -26
- package/build/standard-navigation/types.d.ts.map +1 -1
- package/build/standard-navigation/types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.module → 56.2.21/expo.modules.router-56.2.21.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.pom → 56.2.21/expo.modules.router-56.2.21.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.21/expo.modules.router-56.2.21.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +5 -5
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar → 56.2.21/expo.modules.router-56.2.21-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.md5 → 56.2.21/expo.modules.router-56.2.21-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha1 → 56.2.21/expo.modules.router-56.2.21-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha256 → 56.2.21/expo.modules.router-56.2.21-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha512 → 56.2.21/expo.modules.router-56.2.21-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar → 56.2.21/expo.modules.router-56.2.21.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.md5 → 56.2.21/expo.modules.router-56.2.21.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha1 → 56.2.21/expo.modules.router-56.2.21.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha256 → 56.2.21/expo.modules.router-56.2.21.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha512 → 56.2.21/expo.modules.router-56.2.21.aar.sha512} +0 -0
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'expo.modules.router'
|
|
7
|
-
version = '56.2.
|
|
7
|
+
version = '56.2.21'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "56.2.
|
|
13
|
+
versionName "56.2.21"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
2
|
import type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigator, StandardNavigatorEventMapBase, StandardRouterNavigatorProps } from './types';
|
|
3
|
+
import { withLayoutContext } from '../layouts/withLayoutContext';
|
|
3
4
|
import { type DefaultRouterOptions, type EventMapBase, type NavigationAction, type NavigationState, type RouterFactory } from '../react-navigation/native';
|
|
4
5
|
export type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigatorEventMapBase, StandardUseNavigationBuilderOptions, } from './types';
|
|
6
|
+
type IntegrateWithRouterOptionsTuple<State extends NavigationState, CreateProps extends object> = [
|
|
7
|
+
keyof CreateProps
|
|
8
|
+
] extends [never] ? [options?: IntegrateWithRouterOptions<State, CreateProps>] : [options: IntegrateWithRouterOptions<State, CreateProps>];
|
|
9
|
+
type StandardRouterNavigatorComponent<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions> = ReturnType<typeof withLayoutContext<NavigatorOptions, ComponentType<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>>, State, EventMap & EventMapBase>>;
|
|
5
10
|
/**
|
|
6
11
|
* > **warning** This API is unstable and may change between minor releases.
|
|
7
12
|
*
|
|
8
13
|
* Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and
|
|
9
14
|
* wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already
|
|
10
15
|
* have a navigator from `createStandardNavigator`.
|
|
16
|
+
* Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types
|
|
17
|
+
* produce `never` rather than a type error at this call.
|
|
11
18
|
*
|
|
12
19
|
* @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,
|
|
13
20
|
* `descriptors`, `actions`, and `emitter`.
|
|
@@ -21,10 +28,7 @@ export type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigat
|
|
|
21
28
|
* export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);
|
|
22
29
|
* ```
|
|
23
30
|
*/
|
|
24
|
-
export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(NavigatorContent: ComponentType<NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>>, router: RouterFactory<State, NavigationAction, RouterOptions>, options
|
|
25
|
-
Screen: (props: import("..").ScreenProps<NavigatorOptions, State, EventMap & EventMapBase>) => null;
|
|
26
|
-
Protected: typeof import("../views/Protected").Protected;
|
|
27
|
-
};
|
|
31
|
+
export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions, CreateProps extends object = object>(NavigatorContent: ComponentType<NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps, CreateProps>>, router: RouterFactory<State, NavigationAction, RouterOptions>, ...options: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>): StandardRouterNavigatorComponent<NavigatorOptions, State, EventMap, NavigatorProps, RouterOptions>;
|
|
28
32
|
/**
|
|
29
33
|
* > **warning** This API is unstable and may change between minor releases.
|
|
30
34
|
*
|
|
@@ -45,7 +49,7 @@ export declare function unstable_createStandardRouterNavigator<NavigatorOptions
|
|
|
45
49
|
* export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);
|
|
46
50
|
* ```
|
|
47
51
|
*/
|
|
48
|
-
export declare function unstable_integrateWithRouter<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>, router: RouterFactory<State, NavigationAction, RouterOptions>, options
|
|
52
|
+
export declare function unstable_integrateWithRouter<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions, CreateProps extends object = object>(navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps & CreateProps>, router: RouterFactory<State, NavigationAction, RouterOptions>, ...[options]: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("..").PickPartial<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
|
|
49
53
|
Screen: (props: import("..").ScreenProps<NavigatorOptions, State, EventMap & EventMapBase>) => null;
|
|
50
54
|
Protected: typeof import("../views/Protected").Protected;
|
|
51
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,OAAO,CAAC;AAIpD,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,4BAA4B,EAE7B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,OAAO,CAAC;AAIpD,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,4BAA4B,EAE7B,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,SAAS,CAAC;AAOjB,KAAK,+BAA+B,CAAC,KAAK,SAAS,eAAe,EAAE,WAAW,SAAS,MAAM,IAAI;IAChG,MAAM,WAAW;CAClB,SAAS,CAAC,KAAK,CAAC,GACb,CAAC,OAAO,CAAC,EAAE,0BAA0B,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,GAC1D,CAAC,OA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E,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,GAAG,WAAW,CAAC,EACtF,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAC7D,GAAG,CAAC,OAAO,CAAC,EAAE,+BAA+B,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;;;EAoE3E"}
|
|
@@ -20,6 +20,8 @@ const STANDARD_NAVIGATOR_TYPE = 'standard';
|
|
|
20
20
|
* Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and
|
|
21
21
|
* wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already
|
|
22
22
|
* have a navigator from `createStandardNavigator`.
|
|
23
|
+
* Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types
|
|
24
|
+
* produce `never` rather than a type error at this call.
|
|
23
25
|
*
|
|
24
26
|
* @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,
|
|
25
27
|
* `descriptors`, `actions`, and `emitter`.
|
|
@@ -33,9 +35,9 @@ const STANDARD_NAVIGATOR_TYPE = 'standard';
|
|
|
33
35
|
* export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);
|
|
34
36
|
* ```
|
|
35
37
|
*/
|
|
36
|
-
function unstable_createStandardRouterNavigator(NavigatorContent, router, options) {
|
|
38
|
+
function unstable_createStandardRouterNavigator(NavigatorContent, router, ...options) {
|
|
37
39
|
const navigator = (0, standard_navigation_1.createStandardNavigator)(NavigatorContent);
|
|
38
|
-
return unstable_integrateWithRouter(navigator, router, options);
|
|
40
|
+
return unstable_integrateWithRouter(navigator, router, ...options);
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* > **warning** This API is unstable and may change between minor releases.
|
|
@@ -57,7 +59,7 @@ function unstable_createStandardRouterNavigator(NavigatorContent, router, option
|
|
|
57
59
|
* export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);
|
|
58
60
|
* ```
|
|
59
61
|
*/
|
|
60
|
-
function unstable_integrateWithRouter(navigator, router, options) {
|
|
62
|
+
function unstable_integrateWithRouter(navigator, router, ...[options]) {
|
|
61
63
|
assertStandardNavigator(navigator);
|
|
62
64
|
const { NavigatorContent } = navigator;
|
|
63
65
|
function StandardRouterNavigator(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAyDb,wFAuBC;AAsBD,oEA2EC;;AA/KD,iCAAoD;AACpD,6DAA8D;AAW9D,uEAAoE;AACpE,6DAA0D;AAC1D,6DAA0D;AAC1D,yDAAsD;AACtD,oEAAiE;AACjE,uDAOoC;AASpC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,sCAAsC,CAOpD,gBAEC,EACD,MAA6D,EAC7D,OAA2D;IAE3D,MAAM,SAAS,GAAG,IAAA,6CAAuB,EACvC,gBAAgB,CACjB,CAAC;IACF,OAAO,4BAA4B,CAMjC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,4BAA4B,CAO1C,SAAwE,EACxE,MAA6D,EAC7D,OAA2D;IAE3D,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACnC,MAAM,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAUvC,SAAS,uBAAuB,CAAC,KAAmB;QAClD,MAAM,EAAE,UAAU,EAAE,yBAAyB,EAAE,GAAG,uBAAuB,CAMvE,KAAK,CAAC,CAAC;QACT,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAA,6BAAoB,EAM1F,MAAM,EAAE,yBAAyB,CAAC,CA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AI3B;QACF,EAAE;QACF,QAAQ;QACR,gBAAgB;QAChB,MAAM;QACN,YAAY;QACZ,eAAe;QACf,aAAa;QACb,iCAAiC;QACjC,eAAe;KAChB,CAAC;IACF,OAAO;QACL,UAAU;QACV,uFAAuF;QACvF,yFAAyF;QACzF,yBAAyB,EAAE;YACzB,GAAG,UAAU;YACb,GAAG,yBAAyB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAkB;IAGjD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigator,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n NavigatorContent: ComponentType<\n NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n const navigator = createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>(\n NavigatorContent\n );\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(navigator, router, options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<NavigatorProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n {...derivedProps}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":";AAAA,Y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AED,SAAS,uBAAuB,CAAC,SAAkB;IAGjD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigator,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n// A rest tuple is the only way to make the whole argument optional for empty `CreateProps` and\n// required otherwise; a normal optional parameter would accept `undefined` in both cases.\ntype IntegrateWithRouterOptionsTuple<State extends NavigationState, CreateProps extends object> = [\n keyof CreateProps,\n] extends [never]\n ? [options?: IntegrateWithRouterOptions<State, CreateProps>]\n : [options: IntegrateWithRouterOptions<State, CreateProps>];\n\ntype StandardRouterNavigatorComponent<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = ReturnType<\n typeof withLayoutContext<\n NavigatorOptions,\n ComponentType<\n StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>\n >,\n State,\n EventMap & EventMapBase\n >\n>;\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n * Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types\n * produce `never` rather than a type error at this call.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n CreateProps extends object = object,\n>(\n NavigatorContent: ComponentType<\n NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps, CreateProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n ...options: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>\n): StandardRouterNavigatorComponent<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n> {\n const navigator = createStandardNavigator<\n NavigatorOptions,\n EventMap,\n NavigatorProps & CreateProps\n >(NavigatorContent);\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions,\n CreateProps\n >(navigator, router, ...options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n CreateProps extends object = object,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps & CreateProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n ...[options]: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<CreateProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n // `derivedProps` is partial only when `CreateProps` is empty; otherwise `createProps` is\n // required and returns the complete shape.\n {...(derivedProps as CreateProps)}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
|
|
@@ -13,47 +13,61 @@ export interface StandardNavigatorCreatePropsFactoryDeps<State extends Navigatio
|
|
|
13
13
|
dispatch: (action: NavigationAction) => void;
|
|
14
14
|
navigation: NavigationHelpers<ParamListBase>;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Allows router-specific information to be exposed via navigator props alongside the standard
|
|
18
|
+
* `state` and `actions`.
|
|
19
|
+
*
|
|
20
|
+
* Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small
|
|
21
|
+
* breaking changes between releases, so prefer the `state` and `actions` passed to
|
|
22
|
+
* `NavigatorContent` when they suffice.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* createProps: ({ state, dispatch }) => ({
|
|
27
|
+
* activeRouteKey: state.routes[state.index].key,
|
|
28
|
+
* preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
type CreatePropsFn<State extends NavigationState, CreateProps extends object> = (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => CreateProps;
|
|
33
|
+
type CreatePropsOption<State extends NavigationState, CreateProps extends object> = [
|
|
34
|
+
keyof CreateProps
|
|
35
|
+
] extends [never] ? {
|
|
36
|
+
/**
|
|
37
|
+
* Declare injected props with the fourth type argument of `NavigatorContentProps` before
|
|
38
|
+
* providing this factory.
|
|
39
|
+
*/
|
|
40
|
+
createProps?: never;
|
|
41
|
+
} : {
|
|
42
|
+
createProps: CreatePropsFn<State, CreateProps>;
|
|
43
|
+
};
|
|
44
|
+
export type IntegrateWithRouterOptions<State extends NavigationState = NavigationState, CreateProps extends object = object> = {
|
|
17
45
|
/**
|
|
18
46
|
* When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;
|
|
19
47
|
* routes discovered from the filesystem that were not declared are ignored.
|
|
20
48
|
*/
|
|
21
49
|
useOnlyUserDefinedScreens?: boolean;
|
|
22
|
-
|
|
23
|
-
* Allows router-specific information to be exposed via navigator props alongside the standard
|
|
24
|
-
* `state` and `actions`.
|
|
25
|
-
*
|
|
26
|
-
* Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small
|
|
27
|
-
* breaking changes between releases, so prefer the `state` and `actions` passed to
|
|
28
|
-
* `NavigatorContent` when they suffice.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* createProps: ({ state, dispatch }) => ({
|
|
33
|
-
* activeRouteKey: state.routes[state.index].key,
|
|
34
|
-
* preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
createProps?: (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => Partial<NavigatorProps>;
|
|
39
|
-
}
|
|
50
|
+
} & CreatePropsOption<State, CreateProps>;
|
|
40
51
|
export type StandardNavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = NavigatorArgs<NavigatorOptions, EventMap> & Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;
|
|
41
52
|
/**
|
|
42
|
-
* Lets TypeScript infer `EventMap` and `
|
|
53
|
+
* Lets TypeScript infer `EventMap`, `NavigatorProps`, and `CreateProps` from a `NavigatorContent`
|
|
54
|
+
* component.
|
|
43
55
|
*
|
|
44
56
|
* On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,
|
|
45
|
-
*
|
|
46
|
-
* read a type back out of. Without these
|
|
47
|
-
* shapes, rejecting components that declare specific events or extra props.
|
|
57
|
+
* while `NavigatorProps` and `CreateProps` are combined inside an intersection and `Omit` — none
|
|
58
|
+
* are positions TypeScript can read a type back out of. Without these properties it gives up and
|
|
59
|
+
* falls back to the base shapes, rejecting components that declare specific events or extra props.
|
|
48
60
|
*
|
|
49
61
|
* The properties are phantom: they never exist at runtime and are never read. They exist only to
|
|
50
62
|
* put each type somewhere TypeScript will infer it from.
|
|
51
63
|
*/
|
|
52
|
-
type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = {
|
|
64
|
+
type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, CreateProps extends object> = {
|
|
53
65
|
/** @internal */
|
|
54
66
|
readonly __eventMap__?: EventMap;
|
|
55
67
|
/** @internal */
|
|
56
68
|
readonly __navigatorProps__?: NavigatorProps;
|
|
69
|
+
/** @internal */
|
|
70
|
+
readonly __createProps__?: CreateProps;
|
|
57
71
|
};
|
|
58
72
|
/**
|
|
59
73
|
* Props for a standard navigator's `NavigatorContent` component. Annotate your content component
|
|
@@ -68,11 +82,13 @@ type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMap
|
|
|
68
82
|
* // Typed events:
|
|
69
83
|
* type TabsContentProps = NavigatorContentProps<
|
|
70
84
|
* { title?: string },
|
|
71
|
-
* { tabPress: { data: undefined; canPreventDefault: true } }
|
|
85
|
+
* { tabPress: { data: undefined; canPreventDefault: true } },
|
|
86
|
+
* { tintColor?: string },
|
|
87
|
+
* { activeRouteKey: string }
|
|
72
88
|
* >;
|
|
73
89
|
* ```
|
|
74
90
|
*/
|
|
75
|
-
export type NavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase = Record<string, never>, NavigatorProps extends object = object> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps> & NavigatorContentInferenceCarrier<EventMap, NavigatorProps>;
|
|
91
|
+
export type NavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase = Record<string, never>, NavigatorProps extends object = object, CreateProps extends object = object> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps & CreateProps> & NavigatorContentInferenceCarrier<EventMap, NavigatorProps, CreateProps>;
|
|
76
92
|
export type StandardRouterNavigatorProps<State extends NavigationState, NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> & NavigatorProps & RouterOptions;
|
|
77
93
|
export {};
|
|
78
94
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE9F,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD,MAAM,EACN;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,CACzD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE,MAAM,MAAM,iBAAiB,CAC3B,gBAAgB,SAAS,MAAM,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standard-navigation/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\n/**\n * Allows router-specific information to be exposed via navigator props alongside the standard\n * `state` and `actions`.\n *\n * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small\n * breaking changes between releases, so prefer the `state` and `actions` passed to\n * `NavigatorContent` when they suffice.\n *\n * @example\n * ```tsx\n * createProps: ({ state, dispatch }) => ({\n * activeRouteKey: state.routes[state.index].key,\n * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),\n * })\n * ```\n */\ntype CreatePropsFn<State extends NavigationState, CreateProps extends object> = (\n deps: StandardNavigatorCreatePropsFactoryDeps<State>\n) => CreateProps;\n\ntype CreatePropsOption<State extends NavigationState, CreateProps extends object> = [\n keyof CreateProps,\n] extends [never]\n ? {\n /**\n * Declare injected props with the fourth type argument of `NavigatorContentProps` before\n * providing this factory.\n */\n createProps?: never;\n }\n : { createProps: CreatePropsFn<State, CreateProps> };\n\nexport type IntegrateWithRouterOptions<\n State extends NavigationState = NavigationState,\n CreateProps extends object = object,\n> = {\n /**\n * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;\n * routes discovered from the filesystem that were not declared are ignored.\n */\n useOnlyUserDefinedScreens?: boolean;\n} & CreatePropsOption<State, CreateProps>;\n\nexport type StandardNavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = NavigatorArgs<NavigatorOptions, EventMap> &\n Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;\n\n/**\n * Lets TypeScript infer `EventMap`, `NavigatorProps`, and `CreateProps` from a `NavigatorContent`\n * component.\n *\n * On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,\n * while `NavigatorProps` and `CreateProps` are combined inside an intersection and `Omit` — none\n * are positions TypeScript can read a type back out of. Without these properties it gives up and\n * falls back to the base shapes, rejecting components that declare specific events or extra props.\n *\n * The properties are phantom: they never exist at runtime and are never read. They exist only to\n * put each type somewhere TypeScript will infer it from.\n */\ntype NavigatorContentInferenceCarrier<\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n CreateProps extends object,\n> = {\n /** @internal */\n readonly __eventMap__?: EventMap;\n /** @internal */\n readonly __navigatorProps__?: NavigatorProps;\n /** @internal */\n readonly __createProps__?: CreateProps;\n};\n\n/**\n * Props for a standard navigator's `NavigatorContent` component. Annotate your content component\n * with this type to declare the events it emits, so `unstable_createStandardRouterNavigator` can\n * type `emitter.emit` for you.\n *\n * @example\n * ```tsx\n * // No events:\n * type TabsContentProps = NavigatorContentProps<{ title?: string }>;\n *\n * // Typed events:\n * type TabsContentProps = NavigatorContentProps<\n * { title?: string },\n * { tabPress: { data: undefined; canPreventDefault: true } },\n * { tintColor?: string },\n * { activeRouteKey: string }\n * >;\n * ```\n */\nexport type NavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase = Record<string, never>,\n NavigatorProps extends object = object,\n CreateProps extends object = object,\n> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps & CreateProps> &\n NavigatorContentInferenceCarrier<EventMap, NavigatorProps, CreateProps>;\n\nexport type StandardRouterNavigatorProps<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> &\n NavigatorProps &\n RouterOptions;\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.router",
|
|
5
5
|
"module": "expo.modules.router",
|
|
6
|
-
"version": "56.2.
|
|
6
|
+
"version": "56.2.21",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.router-56.2.
|
|
28
|
-
"url": "expo.modules.router-56.2.
|
|
27
|
+
"name": "expo.modules.router-56.2.21.aar",
|
|
28
|
+
"url": "expo.modules.router-56.2.21.aar",
|
|
29
29
|
"size": 15835,
|
|
30
30
|
"sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
|
|
31
31
|
"sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
],
|
|
75
75
|
"files": [
|
|
76
76
|
{
|
|
77
|
-
"name": "expo.modules.router-56.2.
|
|
78
|
-
"url": "expo.modules.router-56.2.
|
|
77
|
+
"name": "expo.modules.router-56.2.21.aar",
|
|
78
|
+
"url": "expo.modules.router-56.2.21.aar",
|
|
79
79
|
"size": 15835,
|
|
80
80
|
"sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
|
|
81
81
|
"sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
},
|
|
95
95
|
"files": [
|
|
96
96
|
{
|
|
97
|
-
"name": "expo.modules.router-56.2.
|
|
98
|
-
"url": "expo.modules.router-56.2.
|
|
97
|
+
"name": "expo.modules.router-56.2.21-sources.jar",
|
|
98
|
+
"url": "expo.modules.router-56.2.21-sources.jar",
|
|
99
99
|
"size": 2326,
|
|
100
100
|
"sha512": "a1a1537b57bc0d66efbf2bdfd5f514684400b9598e549eaf53c528d1bf32ff42b7826e74fb6e115f8ec0490b9e06ffbb3c3efe9f2f703652c13291ef82b0fa03",
|
|
101
101
|
"sha256": "2add0f802e663eb9b5f90e086dca0e0e337a1442e15fb372a05945e01ee0d289",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c2bd0d09c6577e961ebccab78a2e283c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b66de2018aa9ba7c0c5481902c272bb2d34d1412
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
89137741955949e441b2fbab020ba3c5ac38661088c62601c9fe7612c319f0d4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b8dc48f6a2db6635497321e0d6acb5877aa427007af15448b562ea5d5252af95cecc177774b4497a6ee04a8e951f751f07829c25dc2bcce8793637d42c8a832d
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.router</groupId>
|
|
11
11
|
<artifactId>expo.modules.router</artifactId>
|
|
12
|
-
<version>56.2.
|
|
12
|
+
<version>56.2.21</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.router</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4afddaf8735bc5af7faeb7fda026a754
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
949c4ddbd510bac9003a757cea3f233fbfeb45ab
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9a8cc190f50a1a1b86e6a5ea32b657c1bfc307eeebd1b0810823c1ae56766e48
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6e5f0819c14942778e016a24406f357c0002278b420986f9642cbcf770397a2dcb6637de190cb5ad739ea5b249d817148b15b85a6639607b2110a435ee029d15
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.router</groupId>
|
|
4
4
|
<artifactId>expo.modules.router</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>56.2.
|
|
7
|
-
<release>56.2.
|
|
6
|
+
<latest>56.2.21</latest>
|
|
7
|
+
<release>56.2.21</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>56.2.
|
|
9
|
+
<version>56.2.21</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260917220049</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1882b7b962b2e8adbfd6ec2bd9959ebe
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8f3d239b14a4dbc3f7c612510a3a97d387810b74
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5ab4cbfaef3ec995f267bdabf62a7e16bf103b00c66c5d6b2a81e2dbe4c53ffd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1115ec92e7d09b2e6c1125914b59c9b27b33d08ece914e818cc4951959426e7567af62c6bf21a7aa6528a44750a64e8ec3d2b34d9d237f52cdda3a3ecf8e491f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "56.2.
|
|
3
|
+
"version": "56.2.21",
|
|
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",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@expo/metro-runtime": "^56.0.21",
|
|
83
83
|
"@testing-library/react-native": ">= 13.2.0",
|
|
84
84
|
"expo": "*",
|
|
85
|
-
"expo-constants": "^56.0.
|
|
86
|
-
"expo-linking": "^56.0.
|
|
85
|
+
"expo-constants": "^56.0.26",
|
|
86
|
+
"expo-linking": "^56.0.18",
|
|
87
87
|
"react": "*",
|
|
88
88
|
"react-dom": "*",
|
|
89
89
|
"react-native": "*",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"react-native-web": "~0.21.0",
|
|
137
137
|
"react-server-dom-webpack": "~19.0.6",
|
|
138
138
|
"tsd": "^0.33.0",
|
|
139
|
-
"expo": "56.0.
|
|
139
|
+
"expo": "56.0.22"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
142
|
"@expo/log-box": "^56.0.14",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"standard-navigation": "^0.0.5",
|
|
170
170
|
"vaul": "^1.1.2"
|
|
171
171
|
},
|
|
172
|
-
"gitHead": "
|
|
172
|
+
"gitHead": "6a613ddc65139388dc1d25ccef2e88721fc66384",
|
|
173
173
|
"scripts": {
|
|
174
174
|
"build": "node ./scripts/build.js",
|
|
175
175
|
"clean": "expo-module clean",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c166b9ef47ab199db92d702a1cf1aae8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6a88f3209056224f10764fa4a8ec06e3629a8dc8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0b5bd5cc9620b03701effd8a55d5a9788d8ed376b7ab945e8d44ad1ede010851
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
97bc8e9123f105e1b71af93cf31b2acef4c03690869e0fc635ae366d142d3bfffaaf6eba32c4437438430485c881e56e0ea4ddcf6d7e73f585a659d210746441
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b04bbc8812958bbc36c6c3cbc966a14c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bb0c1c450f85fad65e15310c02a663a7bcea777b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8081e237bd5f0f3ab91c75ed1ff3ac9cf6d51c398af9ef60e4f45321be992988
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
73ca3ccd589b549346ac69d2fc43bbce74a01f6e5649aeffba6f3b3653e7ae86686e883e038ba1a8af40913a3cebba75eb7562fb9b90eeb269b32a12b2f4bdaa
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|