@react-navigation/native 7.0.0-alpha.6 → 7.0.0-alpha.8
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/lib/commonjs/Link.js +2 -2
- package/lib/commonjs/Link.js.map +1 -1
- package/lib/commonjs/LinkingContext.js.map +1 -1
- package/lib/commonjs/NavigationContainer.js +3 -5
- package/lib/commonjs/NavigationContainer.js.map +1 -1
- package/lib/commonjs/createStaticNavigation.js +3 -2
- package/lib/commonjs/createStaticNavigation.js.map +1 -1
- package/lib/commonjs/index.js +9 -25
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/{useLinkTools.js → useLinkBuilder.js} +7 -7
- package/lib/commonjs/useLinkBuilder.js.map +1 -0
- package/lib/commonjs/{theming/useTheme.js → useLinkTo.js} +21 -6
- package/lib/commonjs/useLinkTo.js.map +1 -0
- package/lib/commonjs/useUnhandledLinking.js +3 -2
- package/lib/commonjs/useUnhandledLinking.js.map +1 -1
- package/lib/module/Link.js +1 -1
- package/lib/module/Link.js.map +1 -1
- package/lib/module/LinkingContext.js.map +1 -1
- package/lib/module/NavigationContainer.js +3 -5
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/createStaticNavigation.js +3 -2
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/index.js +2 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/{useLinkTools.js → useLinkBuilder.js} +6 -6
- package/lib/module/useLinkBuilder.js.map +1 -0
- package/lib/module/useLinkTo.js +23 -0
- package/lib/module/useLinkTo.js.map +1 -0
- package/lib/module/useUnhandledLinking.js +3 -1
- package/lib/module/useUnhandledLinking.js.map +1 -1
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/LinkingContext.d.ts +1 -1
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +1 -3
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +3 -27
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/createStaticNavigation.d.ts +1 -1
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +22 -17
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +25 -0
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -0
- package/lib/typescript/src/useLinkTo.d.ts +6 -0
- package/lib/typescript/src/useLinkTo.d.ts.map +1 -0
- package/lib/typescript/src/useLinking.d.ts +2 -18
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +2 -18
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useUnhandledLinking.d.ts +1 -1
- package/lib/typescript/src/useUnhandledLinking.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/Link.tsx +1 -1
- package/src/LinkingContext.tsx +2 -1
- package/src/NavigationContainer.tsx +11 -15
- package/src/createStaticNavigation.tsx +4 -2
- package/src/index.tsx +2 -4
- package/src/types.tsx +24 -17
- package/src/{useLinkTools.tsx → useLinkBuilder.tsx} +5 -5
- package/src/useLinkTo.tsx +30 -0
- package/src/useUnhandledLinking.tsx +2 -1
- package/lib/commonjs/theming/ThemeContext.js +0 -13
- package/lib/commonjs/theming/ThemeContext.js.map +0 -1
- package/lib/commonjs/theming/ThemeProvider.js +0 -20
- package/lib/commonjs/theming/ThemeProvider.js.map +0 -1
- package/lib/commonjs/theming/useTheme.js.map +0 -1
- package/lib/commonjs/useLinkTools.js.map +0 -1
- package/lib/module/theming/ThemeContext.js +0 -5
- package/lib/module/theming/ThemeContext.js.map +0 -1
- package/lib/module/theming/ThemeProvider.js +0 -12
- package/lib/module/theming/ThemeProvider.js.map +0 -1
- package/lib/module/theming/useTheme.js +0 -7
- package/lib/module/theming/useTheme.js.map +0 -1
- package/lib/module/useLinkTools.js.map +0 -1
- package/lib/typescript/src/theming/ThemeContext.d.ts +0 -4
- package/lib/typescript/src/theming/ThemeContext.d.ts.map +0 -1
- package/lib/typescript/src/theming/ThemeProvider.d.ts +0 -9
- package/lib/typescript/src/theming/ThemeProvider.d.ts.map +0 -1
- package/lib/typescript/src/theming/useTheme.d.ts +0 -2
- package/lib/typescript/src/theming/useTheme.d.ts.map +0 -1
- package/lib/typescript/src/useLinkTools.d.ts +0 -33
- package/lib/typescript/src/useLinkTools.d.ts.map +0 -1
- package/src/theming/ThemeContext.tsx +0 -8
- package/src/theming/ThemeProvider.tsx +0 -15
- package/src/theming/useTheme.tsx +0 -9
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NavigationContainerRefContext } from '@react-navigation/core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useLinkBuilder } from './useLinkBuilder';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Helper to navigate to a screen using a href based on the linking options.
|
|
7
|
+
* @returns function that receives the href to navigate to.
|
|
8
|
+
*/
|
|
9
|
+
export function useLinkTo() {
|
|
10
|
+
const navigation = React.useContext(NavigationContainerRefContext);
|
|
11
|
+
const {
|
|
12
|
+
buildAction
|
|
13
|
+
} = useLinkBuilder();
|
|
14
|
+
const linkTo = React.useCallback(href => {
|
|
15
|
+
if (navigation === undefined) {
|
|
16
|
+
throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
|
|
17
|
+
}
|
|
18
|
+
const action = buildAction(href);
|
|
19
|
+
navigation.dispatch(action);
|
|
20
|
+
}, [buildAction, navigation]);
|
|
21
|
+
return linkTo;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=useLinkTo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NavigationContainerRefContext","React","useLinkBuilder","useLinkTo","navigation","useContext","buildAction","linkTo","useCallback","href","undefined","Error","action","dispatch"],"sourceRoot":"../../src","sources":["useLinkTo.tsx"],"mappings":"AAAA,SAASA,6BAA6B,QAAQ,wBAAwB;AACtE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,cAAc,QAAQ,kBAAkB;;AAEjD;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAG;EAC1B,MAAMC,UAAU,GAAGH,KAAK,CAACI,UAAU,CAACL,6BAA6B,CAAC;EAClE,MAAM;IAAEM;EAAY,CAAC,GAAGJ,cAAc,CAAC,CAAC;EAExC,MAAMK,MAAM,GAAGN,KAAK,CAACO,WAAW,CAC7BC,IAAY,IAAK;IAChB,IAAIL,UAAU,KAAKM,SAAS,EAAE;MAC5B,MAAM,IAAIC,KAAK,CACb,kFACF,CAAC;IACH;IAEA,MAAMC,MAAM,GAAGN,WAAW,CAACG,IAAI,CAAC;IAEhCL,UAAU,CAACS,QAAQ,CAACD,MAAM,CAAC;EAC7B,CAAC,EACD,CAACN,WAAW,EAAEF,UAAU,CAC1B,CAAC;EAED,OAAOG,MAAM;AACf"}
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import useLatestCallback from 'use-latest-callback';
|
|
4
4
|
import { LinkingContext } from './LinkingContext';
|
|
5
5
|
import { UnhandledLinkingContext } from './UnhandledLinkingContext';
|
|
6
|
+
|
|
7
|
+
// FIXME: don't rely on depth only to get the navigator state
|
|
6
8
|
function extractNavigatorSpecificState(_, pathState, depth) {
|
|
7
9
|
let partialPathState = pathState;
|
|
8
10
|
let currentDepth = depth;
|
|
@@ -15,7 +17,7 @@ function extractNavigatorSpecificState(_, pathState, depth) {
|
|
|
15
17
|
}
|
|
16
18
|
return partialPathState;
|
|
17
19
|
}
|
|
18
|
-
export function
|
|
20
|
+
export function UNSTABLE_useUnhandledLinking() {
|
|
19
21
|
const navigation = React.useContext(NavigationContext);
|
|
20
22
|
const linking = React.useContext(LinkingContext);
|
|
21
23
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getStateFromPath","NavigationContext","React","useLatestCallback","LinkingContext","UnhandledLinkingContext","extractNavigatorSpecificState","_","pathState","depth","partialPathState","currentDepth","undefined","routes","length","state","
|
|
1
|
+
{"version":3,"names":["getStateFromPath","NavigationContext","React","useLatestCallback","LinkingContext","UnhandledLinkingContext","extractNavigatorSpecificState","_","pathState","depth","partialPathState","currentDepth","undefined","routes","length","state","UNSTABLE_useUnhandledLinking","navigation","useContext","linking","setLastUnhandledLink","lastUnhandledLink","options","getStateForRouteNamesChange","currentState","path","getStateFromPathHelper","config","parent","getParent","clearUnhandledLink"],"sourceRoot":"../../src","sources":["useUnhandledLinking.tsx"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,iBAAiB,QAGZ,wBAAwB;AAC/B,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,iBAAiB,MAAM,qBAAqB;AAEnD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,uBAAuB,QAAQ,2BAA2B;;AAEnE;AACA,SAASC,6BAA6BA,CACpCC,CAAkB,EAClBC,SAAwC,EACxCC,KAAa,EACb;EACA,IAAIC,gBAA2D,GAAGF,SAAS;EAE3E,IAAIG,YAAY,GAAGF,KAAK;EACxB,OAAOE,YAAY,EAAE;IACnB,IAAI,CAACD,gBAAgB,EAAE;MACrB,OAAOE,SAAS;IAClB;IACAF,gBAAgB,GACdA,gBAAgB,CAACG,MAAM,CAACH,gBAAgB,CAACG,MAAM,CAACC,MAAM,GAAG,CAAC,CAAC,CAACC,KAAK;IACnEJ,YAAY,EAAE;EAChB;EACA,OAAOD,gBAAgB;AACzB;AAEA,OAAO,SAASM,4BAA4BA,CAAA,EAAG;EAC7C,MAAMC,UAAU,GAAGf,KAAK,CAACgB,UAAU,CAACjB,iBAAiB,CAAC;EACtD,MAAMkB,OAAO,GAAGjB,KAAK,CAACgB,UAAU,CAACd,cAAc,CAAC;EAChD,MAAM;IAAEgB,oBAAoB;IAAEC;EAAkB,CAAC,GAAGnB,KAAK,CAACgB,UAAU,CAClEb,uBACF,CAAC;EAED,MAAM;IAAEiB;EAAQ,CAAC,GAAGH,OAAO;EAE3B,MAAMI,2BAA2B,GAC/BC,YAA6B,IACiB;IAC9C,IAAIH,iBAAiB,IAAI,IAAI,EAAE;MAC7B;MACA;IACF;;IAEA;IACA,MAAMI,IAAI,GAAGJ,iBAAiB;IAC9B,IAAI,CAACA,iBAAiB,EAAE;MACtB;IACF;;IAEA;IACA,MAAMK,sBAAsB,GAC1BJ,OAAO,EAAEtB,gBAAgB,IAAIA,gBAAgB;IAE/C,MAAMQ,SAAS,GAAGkB,sBAAsB,CAACD,IAAI,EAAEH,OAAO,EAAEK,MAAM,CAAC;IAE/D,IAAI,CAACnB,SAAS,EAAE;MACd;IACF;IAEA,IAAIC,KAAK,GAAG,CAAC;IACb,IAAImB,MAAM,GAAGX,UAAU;IACvB,OAAOW,MAAM,EAAE;MACbnB,KAAK,EAAE;MACPmB,MAAM,GAAGA,MAAM,CAACC,SAAS,CAAC,CAAC;IAC7B;IAEA,MAAMd,KAAK,GAAGT,6BAA6B,CAACkB,YAAY,EAAEhB,SAAS,EAAEC,KAAK,CAAC;IAE3E,IAAI,CAACM,KAAK,EAAE;MACV;IACF;IAEA,OAAOA,KAAK;EACd,CAAC;EAED,MAAMe,kBAAkB,GAAG3B,iBAAiB,CAAC,MAAM;IACjDiB,oBAAoB,CAACR,SAAS,CAAC;EACjC,CAAC,CAAC;EAEF,OAAO;IACLS,iBAAiB;IACjBE,2BAA2B;IAC3BO;EACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/Link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,qBAAqB,EAE1B,IAAI,EACJ,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAgB,MAAM,gBAAgB,CAAC;AAEvE,KAAK,KAAK,CAAC,SAAS,SAAS,eAAe,CAAC,aAAa,IACxD,SAAS,CAAC,SAAS,CAAC,GAClB,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CACR,CAAC,EACG,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAC/C,qBAAqB,KACtB,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEN;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,SAAS,SAAS,eAAe,CAAC,aAAa,EAAE,EACpE,MAAM,EACN,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,GAAG,IAAI,EACR,EAAE,KAAK,CAAC,SAAS,CAAC,mCA2BlB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ParamListBase } from '@react-navigation/core';
|
|
2
|
-
import type { LinkingOptions } from '@react-navigation/native/src/types';
|
|
3
2
|
import * as React from 'react';
|
|
3
|
+
import type { LinkingOptions } from './types';
|
|
4
4
|
export declare const LinkingContext: React.Context<{
|
|
5
5
|
options?: LinkingOptions<ParamListBase> | undefined;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkingContext.d.ts","sourceRoot":"","sources":["../../../src/LinkingContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"LinkingContext.d.ts","sourceRoot":"","sources":["../../../src/LinkingContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;;EAMzB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NavigationContainerProps, type NavigationContainerRef } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { DocumentTitleOptions, LinkingOptions, LocaleDirection
|
|
3
|
+
import type { DocumentTitleOptions, LinkingOptions, LocaleDirection } from './types';
|
|
4
4
|
declare global {
|
|
5
5
|
var REACT_NAVIGATION_DEVTOOLS: WeakMap<NavigationContainerRef<any>, {
|
|
6
6
|
readonly linking: LinkingOptions<any>;
|
|
@@ -8,14 +8,12 @@ declare global {
|
|
|
8
8
|
}
|
|
9
9
|
type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
10
10
|
direction?: LocaleDirection;
|
|
11
|
-
theme?: Theme;
|
|
12
11
|
linking?: LinkingOptions<ParamList>;
|
|
13
12
|
fallback?: React.ReactNode;
|
|
14
13
|
documentTitle?: DocumentTitleOptions;
|
|
15
14
|
};
|
|
16
15
|
export declare const NavigationContainer: <RootParamList extends {} = ReactNavigation.RootParamList>(props: NavigationContainerProps & {
|
|
17
16
|
direction?: LocaleDirection | undefined;
|
|
18
|
-
theme?: Theme | undefined;
|
|
19
17
|
linking?: LinkingOptions<RootParamList> | undefined;
|
|
20
18
|
fallback?: React.ReactNode;
|
|
21
19
|
documentTitle?: DocumentTitleOptions | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationContainer.d.ts","sourceRoot":"","sources":["../../../src/NavigationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAI5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationContainer.d.ts","sourceRoot":"","sources":["../../../src/NavigationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAI5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,eAAe,EAChB,MAAM,SAAS,CAAC;AAOjB,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,yBAAyB,EAAE,OAAO,CACpC,sBAAsB,CAAC,GAAG,CAAC,EAC3B;QAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;KAAE,CAC1C,CAAC;CACH;AAID,KAAK,KAAK,CAAC,SAAS,SAAS,EAAE,IAAI,wBAAwB,GAAG;IAC5D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,CAAC;AA8IF,eAAO,MAAM,mBAAmB;;;eAhJnB,MAAM,SAAS;;;;MAsJvB,MAAM,YAAY,CAAC"}
|
|
@@ -5,15 +5,7 @@ export declare const createStackNavigator: {
|
|
|
5
5
|
index: number;
|
|
6
6
|
routeNames: string[];
|
|
7
7
|
history?: unknown[] | undefined;
|
|
8
|
-
routes: (
|
|
9
|
-
key: string;
|
|
10
|
-
name: string;
|
|
11
|
-
path?: string | undefined;
|
|
12
|
-
}> & Readonly<{
|
|
13
|
-
params?: Readonly<object | undefined>;
|
|
14
|
-
}> & {
|
|
15
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
16
|
-
})[];
|
|
8
|
+
routes: import("@react-navigation/core").NavigationRoute<import("@react-navigation/core").ParamListBase, string>[];
|
|
17
9
|
type: string;
|
|
18
10
|
stale: false;
|
|
19
11
|
}>, {}, import("@react-navigation/core").EventMapBase, (props: any) => React.JSX.Element>;
|
|
@@ -22,15 +14,7 @@ export declare const createStackNavigator: {
|
|
|
22
14
|
index: number;
|
|
23
15
|
routeNames: string[];
|
|
24
16
|
history?: unknown[] | undefined;
|
|
25
|
-
routes: (
|
|
26
|
-
key: string;
|
|
27
|
-
name: string;
|
|
28
|
-
path?: string | undefined;
|
|
29
|
-
}> & Readonly<{
|
|
30
|
-
params?: Readonly<object | undefined>;
|
|
31
|
-
}> & {
|
|
32
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
33
|
-
})[];
|
|
17
|
+
routes: import("@react-navigation/core").NavigationRoute<import("@react-navigation/core").ParamListBase, string>[];
|
|
34
18
|
type: string;
|
|
35
19
|
stale: false;
|
|
36
20
|
}>, {}, import("@react-navigation/core").EventMapBase, (props: any) => React.JSX.Element>>(config: Config): import("@react-navigation/core").TypedNavigator<ParamList_1, Readonly<{
|
|
@@ -38,15 +22,7 @@ export declare const createStackNavigator: {
|
|
|
38
22
|
index: number;
|
|
39
23
|
routeNames: string[];
|
|
40
24
|
history?: unknown[] | undefined;
|
|
41
|
-
routes: (
|
|
42
|
-
key: string;
|
|
43
|
-
name: string;
|
|
44
|
-
path?: string | undefined;
|
|
45
|
-
}> & Readonly<{
|
|
46
|
-
params?: Readonly<object | undefined>;
|
|
47
|
-
}> & {
|
|
48
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
49
|
-
})[];
|
|
25
|
+
routes: import("@react-navigation/core").NavigationRoute<import("@react-navigation/core").ParamListBase, string>[];
|
|
50
26
|
type: string;
|
|
51
27
|
stale: false;
|
|
52
28
|
}>, {}, import("@react-navigation/core").EventMapBase, (props: any) => React.JSX.Element> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStackNavigator.d.ts","sourceRoot":"","sources":["../../../../src/__stubs__/createStackNavigator.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"createStackNavigator.d.ts","sourceRoot":"","sources":["../../../../src/__stubs__/createStackNavigator.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW/B,CAAC"}
|
|
@@ -15,6 +15,6 @@ type Props = Omit<React.ComponentProps<typeof NavigationContainer>, 'linking' |
|
|
|
15
15
|
* @param tree Static navigation config.
|
|
16
16
|
* @returns Navigation component to use in your app.
|
|
17
17
|
*/
|
|
18
|
-
export declare function createStaticNavigation(tree: StaticNavigation<any, any, any>):
|
|
18
|
+
export declare function createStaticNavigation(tree: StaticNavigation<any, any, any>): React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<unknown>>;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=createStaticNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStaticNavigation.d.ts","sourceRoot":"","sources":["../../../src/createStaticNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,KAAK,GAAG,IAAI,CACf,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,EAChD,SAAS,GAAG,UAAU,CACvB,GAAG;IACF;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"createStaticNavigation.d.ts","sourceRoot":"","sources":["../../../src/createStaticNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,KAAK,GAAG,IAAI,CACf,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,EAChD,SAAS,GAAG,UAAU,CACvB,GAAG;IACF;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,sFAoB3E"}
|
|
@@ -5,13 +5,11 @@ export { NavigationContainer } from './NavigationContainer';
|
|
|
5
5
|
export { ServerContainer } from './ServerContainer';
|
|
6
6
|
export { DarkTheme } from './theming/DarkTheme';
|
|
7
7
|
export { DefaultTheme } from './theming/DefaultTheme';
|
|
8
|
-
export { ThemeProvider } from './theming/ThemeProvider';
|
|
9
|
-
export { useTheme } from './theming/useTheme';
|
|
10
8
|
export * from './types';
|
|
9
|
+
export { useLinkBuilder } from './useLinkBuilder';
|
|
11
10
|
export { useLinkProps } from './useLinkProps';
|
|
12
|
-
export { useLinkTools } from './useLinkTools';
|
|
13
11
|
export { useLocale } from './useLocale';
|
|
14
12
|
export { useScrollToTop } from './useScrollToTop';
|
|
15
|
-
export {
|
|
13
|
+
export { UNSTABLE_useUnhandledLinking } from './useUnhandledLinking';
|
|
16
14
|
export * from '@react-navigation/core';
|
|
17
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import type { getActionFromState as getActionFromStateDefault, getPathFromState as getPathFromStateDefault, getStateFromPath as getStateFromPathDefault, PathConfigMap, Route } from '@react-navigation/core';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace ReactNavigation {
|
|
4
|
+
interface Theme {
|
|
5
|
+
dark: boolean;
|
|
6
|
+
colors: {
|
|
7
|
+
primary: string;
|
|
8
|
+
background: string;
|
|
9
|
+
card: string;
|
|
10
|
+
text: string;
|
|
11
|
+
border: string;
|
|
12
|
+
notification: string;
|
|
13
|
+
};
|
|
14
|
+
fonts: {
|
|
15
|
+
regular: FontStyle;
|
|
16
|
+
medium: FontStyle;
|
|
17
|
+
bold: FontStyle;
|
|
18
|
+
heavy: FontStyle;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
2
23
|
export type LocaleDirection = 'ltr' | 'rtl';
|
|
3
24
|
type FontStyle = {
|
|
4
25
|
fontFamily: string;
|
|
5
26
|
fontWeight: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
6
27
|
};
|
|
7
|
-
export type Theme =
|
|
8
|
-
dark: boolean;
|
|
9
|
-
colors: {
|
|
10
|
-
primary: string;
|
|
11
|
-
background: string;
|
|
12
|
-
card: string;
|
|
13
|
-
text: string;
|
|
14
|
-
border: string;
|
|
15
|
-
notification: string;
|
|
16
|
-
};
|
|
17
|
-
fonts: {
|
|
18
|
-
regular: FontStyle;
|
|
19
|
-
medium: FontStyle;
|
|
20
|
-
bold: FontStyle;
|
|
21
|
-
heavy: FontStyle;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
28
|
+
export type Theme = ReactNavigation.Theme;
|
|
24
29
|
export type LinkingOptions<ParamList extends {}> = {
|
|
25
30
|
/**
|
|
26
31
|
* Whether deep link handling should be enabled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,IAAI,yBAAyB,EAC/C,gBAAgB,IAAI,uBAAuB,EAC3C,gBAAgB,IAAI,uBAAuB,EAC3C,aAAa,EACb,KAAK,EACN,MAAM,wBAAwB,CAAC;AAEhC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,IAAI,yBAAyB,EAC/C,gBAAgB,IAAI,uBAAuB,EAC3C,gBAAgB,IAAI,uBAAuB,EAC3C,aAAa,EACb,KAAK,EACN,MAAM,wBAAwB,CAAC;AAEhC,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,eAAe,CAAC;QACxB,UAAU,KAAK;YACb,IAAI,EAAE,OAAO,CAAC;YACd,MAAM,EAAE;gBACN,OAAO,EAAE,MAAM,CAAC;gBAChB,UAAU,EAAE,MAAM,CAAC;gBACnB,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;gBACb,MAAM,EAAE,MAAM,CAAC;gBACf,YAAY,EAAE,MAAM,CAAC;aACtB,CAAC;YACF,KAAK,EAAE;gBACL,OAAO,EAAE,SAAS,CAAC;gBACnB,MAAM,EAAE,SAAS,CAAC;gBAClB,IAAI,EAAE,SAAS,CAAC;gBAChB,KAAK,EAAE,SAAS,CAAC;aAClB,CAAC;SACH;KACF;CACF;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5C,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,MAAM,MAAM,cAAc,CAAC,SAAS,SAAS,EAAE,IAAI;IACjD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE;QACP;;;;;WAKG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAClC;;WAEG;QACH,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;KACpC,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,MACZ,MAAM,GACN,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACvC;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,EAAE,CACV,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KAC5B,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IACrC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,uBAAuB,CAAC;IAClD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,uBAAuB,CAAC;IAClD;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,yBAAyB,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,CACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,KAC7B,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CACtD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CommonActions, type ParamListBase } from '@react-navigation/core';
|
|
2
|
+
/**
|
|
3
|
+
* Helpers to build href or action based on the linking options.
|
|
4
|
+
* @returns `buildHref` to build an `href` for screen and `buildAction` to build an action from an `href`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useLinkBuilder(): {
|
|
7
|
+
buildHref: (name: string, params?: object) => string | undefined;
|
|
8
|
+
buildAction: (href: string) => {
|
|
9
|
+
type: "NAVIGATE";
|
|
10
|
+
payload: {
|
|
11
|
+
name: string;
|
|
12
|
+
params?: import("@react-navigation/core").NavigatorScreenParams<Readonly<{
|
|
13
|
+
key: string;
|
|
14
|
+
index: number;
|
|
15
|
+
routeNames: string[];
|
|
16
|
+
history?: unknown[] | undefined;
|
|
17
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
18
|
+
type: string;
|
|
19
|
+
stale: false;
|
|
20
|
+
}>>;
|
|
21
|
+
path?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
} | CommonActions.Action;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useLinkBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkBuilder.d.ts","sourceRoot":"","sources":["../../../src/useLinkBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAOb,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAqChC;;;GAGG;AACH,wBAAgB,cAAc;sBAKnB,MAAM,WAAW,MAAM;wBA6BvB,MAAM;;;;;;;;;;;;;;;;EA0BhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkTo.d.ts","sourceRoot":"","sources":["../../../src/useLinkTo.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,SAAS,WAKd,MAAM,UAehB"}
|
|
@@ -12,15 +12,7 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
12
12
|
index: number;
|
|
13
13
|
routeNames: string[];
|
|
14
14
|
history?: unknown[] | undefined;
|
|
15
|
-
routes: (
|
|
16
|
-
key: string;
|
|
17
|
-
name: string;
|
|
18
|
-
path?: string | undefined;
|
|
19
|
-
}> & Readonly<{
|
|
20
|
-
params?: Readonly<object | undefined>;
|
|
21
|
-
}> & {
|
|
22
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
23
|
-
})[];
|
|
15
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
24
16
|
type: string;
|
|
25
17
|
stale: false;
|
|
26
18
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -32,15 +24,7 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
32
24
|
index: number;
|
|
33
25
|
routeNames: string[];
|
|
34
26
|
history?: unknown[] | undefined;
|
|
35
|
-
routes: (
|
|
36
|
-
key: string;
|
|
37
|
-
name: string;
|
|
38
|
-
path?: string | undefined;
|
|
39
|
-
}> & Readonly<{
|
|
40
|
-
params?: Readonly<object | undefined>;
|
|
41
|
-
}> & {
|
|
42
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
43
|
-
})[];
|
|
27
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
44
28
|
type: string;
|
|
45
29
|
stale: false;
|
|
46
30
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAEnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA4C9C;;GAEG;AACH,eAAO,MAAM,MAAM,OAAQ,MAAM,QAAQ,IAAI,CAAC,eAO7C,CAAC;AAIF,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAE7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,MAAM,EACN,gBAA0C,EAC1C,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO,EACV,kBAAkB,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI
|
|
1
|
+
{"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAEnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA4C9C;;GAEG;AACH,eAAO,MAAM,MAAM,OAAQ,MAAM,QAAQ,IAAI,CAAC,eAO7C,CAAC;AAIF,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAE7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,MAAM,EACN,gBAA0C,EAC1C,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO,EACV,kBAAkB,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;EA2UtE"}
|
|
@@ -8,15 +8,7 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
8
8
|
index: number;
|
|
9
9
|
routeNames: string[];
|
|
10
10
|
history?: unknown[] | undefined;
|
|
11
|
-
routes: (
|
|
12
|
-
key: string;
|
|
13
|
-
name: string;
|
|
14
|
-
path?: string | undefined;
|
|
15
|
-
}> & Readonly<{
|
|
16
|
-
params?: Readonly<object | undefined>;
|
|
17
|
-
}> & {
|
|
18
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
19
|
-
})[];
|
|
11
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
20
12
|
type: string;
|
|
21
13
|
stale: false;
|
|
22
14
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -28,15 +20,7 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
28
20
|
index: number;
|
|
29
21
|
routeNames: string[];
|
|
30
22
|
history?: unknown[] | undefined;
|
|
31
|
-
routes: (
|
|
32
|
-
key: string;
|
|
33
|
-
name: string;
|
|
34
|
-
path?: string | undefined;
|
|
35
|
-
}> & Readonly<{
|
|
36
|
-
params?: Readonly<object | undefined>;
|
|
37
|
-
}> & {
|
|
38
|
-
state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
|
|
39
|
-
})[];
|
|
23
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
40
24
|
type: string;
|
|
41
25
|
stale: false;
|
|
42
26
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAEnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAI7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAmBC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO,EACV,kBAAkB,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI
|
|
1
|
+
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAEnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,KAAK,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;AAI7C,wBAAgB,UAAU,CACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,EAC3D,EACE,OAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAmBC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,OAAO,EACV,kBAAkB,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;EAkKtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type NavigationState, type PartialState } from '@react-navigation/core';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function UNSTABLE_useUnhandledLinking(): {
|
|
3
3
|
lastUnhandledLink: string | undefined;
|
|
4
4
|
getStateForRouteNamesChange: (currentState: NavigationState) => PartialState<NavigationState> | undefined;
|
|
5
5
|
clearUnhandledLink: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnhandledLinking.d.ts","sourceRoot":"","sources":["../../../src/useUnhandledLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useUnhandledLinking.d.ts","sourceRoot":"","sources":["../../../src/useUnhandledLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAC;AA2BhC,wBAAgB,4BAA4B;;gDAU1B,eAAe,KAC5B,aAAa,eAAe,CAAC,GAAG,SAAS;;EA+C7C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/native",
|
|
3
3
|
"description": "React Native integration for React Navigation",
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.8",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"react-navigation",
|
|
@@ -37,26 +37,26 @@
|
|
|
37
37
|
"clean": "del lib"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@react-navigation/core": "^7.0.0-alpha.
|
|
40
|
+
"@react-navigation/core": "^7.0.0-alpha.8",
|
|
41
41
|
"escape-string-regexp": "^4.0.0",
|
|
42
42
|
"fast-deep-equal": "^3.1.3",
|
|
43
|
-
"nanoid": "3.3.
|
|
43
|
+
"nanoid": "3.3.7",
|
|
44
44
|
"use-latest-callback": "^0.1.9"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@testing-library/react-native": "^12.3
|
|
48
|
-
"@types/react": "~18.2.
|
|
49
|
-
"@types/react-dom": "~18.0.
|
|
47
|
+
"@testing-library/react-native": "^12.4.3",
|
|
48
|
+
"@types/react": "~18.2.45",
|
|
49
|
+
"@types/react-dom": "~18.0.11",
|
|
50
50
|
"del-cli": "^5.1.0",
|
|
51
51
|
"react": "18.2.0",
|
|
52
52
|
"react-dom": "18.2.0",
|
|
53
|
-
"react-native": "0.
|
|
54
|
-
"react-native-builder-bob": "^0.23.
|
|
55
|
-
"typescript": "^5.
|
|
53
|
+
"react-native": "0.73.2",
|
|
54
|
+
"react-native-builder-bob": "^0.23.2",
|
|
55
|
+
"typescript": "^5.3.3"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": "*",
|
|
59
|
-
"react-native": "0.
|
|
59
|
+
"react-native": "0.73.2"
|
|
60
60
|
},
|
|
61
61
|
"react-native-builder-bob": {
|
|
62
62
|
"source": "src",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
]
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "e4e445810a3a958c35cc34486b5499baa595500e"
|
|
76
76
|
}
|
package/src/Link.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTheme } from '@react-navigation/core';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
type GestureResponderEvent,
|
|
@@ -6,7 +7,6 @@ import {
|
|
|
6
7
|
type TextProps,
|
|
7
8
|
} from 'react-native';
|
|
8
9
|
|
|
9
|
-
import { useTheme } from './theming/useTheme';
|
|
10
10
|
import { type Props as LinkProps, useLinkProps } from './useLinkProps';
|
|
11
11
|
|
|
12
12
|
type Props<ParamList extends ReactNavigation.RootParamList> =
|
package/src/LinkingContext.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ParamListBase } from '@react-navigation/core';
|
|
2
|
-
import type { LinkingOptions } from '@react-navigation/native/src/types';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
|
|
4
|
+
import type { LinkingOptions } from './types';
|
|
5
|
+
|
|
5
6
|
const MISSING_CONTEXT_ERROR = "Couldn't find a LinkingContext context.";
|
|
6
7
|
|
|
7
8
|
export const LinkingContext = React.createContext<{
|
|
@@ -16,12 +16,10 @@ import useLatestCallback from 'use-latest-callback';
|
|
|
16
16
|
import { LinkingContext } from './LinkingContext';
|
|
17
17
|
import { LocaleDirContext } from './LocaleDirContext';
|
|
18
18
|
import { DefaultTheme } from './theming/DefaultTheme';
|
|
19
|
-
import { ThemeProvider } from './theming/ThemeProvider';
|
|
20
19
|
import type {
|
|
21
20
|
DocumentTitleOptions,
|
|
22
21
|
LinkingOptions,
|
|
23
22
|
LocaleDirection,
|
|
24
|
-
Theme,
|
|
25
23
|
} from './types';
|
|
26
24
|
import { UnhandledLinkingContext } from './UnhandledLinkingContext';
|
|
27
25
|
import { useBackButton } from './useBackButton';
|
|
@@ -41,7 +39,6 @@ global.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
|
|
|
41
39
|
|
|
42
40
|
type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
43
41
|
direction?: LocaleDirection;
|
|
44
|
-
theme?: Theme;
|
|
45
42
|
linking?: LinkingOptions<ParamList>;
|
|
46
43
|
fallback?: React.ReactNode;
|
|
47
44
|
documentTitle?: DocumentTitleOptions;
|
|
@@ -56,7 +53,7 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
56
53
|
* @param props.onStateChange Callback which is called with the latest navigation state when it changes.
|
|
57
54
|
* @param props.onUnhandledAction Callback which is called when an action is not handled.
|
|
58
55
|
* @param props.direction Text direction of the components. Defaults to `'ltr'`.
|
|
59
|
-
* @param props.theme Theme object for the
|
|
56
|
+
* @param props.theme Theme object for the UI elements.
|
|
60
57
|
* @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.
|
|
61
58
|
* @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.
|
|
62
59
|
* @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.
|
|
@@ -171,17 +168,16 @@ function NavigationContainerInner(
|
|
|
171
168
|
<LocaleDirContext.Provider value={direction}>
|
|
172
169
|
<UnhandledLinkingContext.Provider value={unhandledLinkingContext}>
|
|
173
170
|
<LinkingContext.Provider value={linkingContext}>
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
</ThemeProvider>
|
|
171
|
+
<BaseNavigationContainer
|
|
172
|
+
{...rest}
|
|
173
|
+
theme={theme}
|
|
174
|
+
onReady={onReadyForLinkingHandling}
|
|
175
|
+
onStateChange={onStateChangeForLinkingHandling}
|
|
176
|
+
initialState={
|
|
177
|
+
rest.initialState == null ? initialState : rest.initialState
|
|
178
|
+
}
|
|
179
|
+
ref={refContainer}
|
|
180
|
+
/>
|
|
185
181
|
</LinkingContext.Provider>
|
|
186
182
|
</UnhandledLinkingContext.Provider>
|
|
187
183
|
</LocaleDirContext.Provider>
|
|
@@ -34,7 +34,7 @@ export function createStaticNavigation(tree: StaticNavigation<any, any, any>) {
|
|
|
34
34
|
: {},
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
function Navigation({ linking, ...rest }: Props) {
|
|
38
38
|
return (
|
|
39
39
|
<NavigationContainer
|
|
40
40
|
{...rest}
|
|
@@ -43,5 +43,7 @@ export function createStaticNavigation(tree: StaticNavigation<any, any, any>) {
|
|
|
43
43
|
<Component />
|
|
44
44
|
</NavigationContainer>
|
|
45
45
|
);
|
|
46
|
-
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return React.forwardRef(Navigation);
|
|
47
49
|
}
|
package/src/index.tsx
CHANGED
|
@@ -5,12 +5,10 @@ export { NavigationContainer } from './NavigationContainer';
|
|
|
5
5
|
export { ServerContainer } from './ServerContainer';
|
|
6
6
|
export { DarkTheme } from './theming/DarkTheme';
|
|
7
7
|
export { DefaultTheme } from './theming/DefaultTheme';
|
|
8
|
-
export { ThemeProvider } from './theming/ThemeProvider';
|
|
9
|
-
export { useTheme } from './theming/useTheme';
|
|
10
8
|
export * from './types';
|
|
9
|
+
export { useLinkBuilder } from './useLinkBuilder';
|
|
11
10
|
export { useLinkProps } from './useLinkProps';
|
|
12
|
-
export { useLinkTools } from './useLinkTools';
|
|
13
11
|
export { useLocale } from './useLocale';
|
|
14
12
|
export { useScrollToTop } from './useScrollToTop';
|
|
15
|
-
export {
|
|
13
|
+
export { UNSTABLE_useUnhandledLinking } from './useUnhandledLinking';
|
|
16
14
|
export * from '@react-navigation/core';
|