@react-navigation/native 7.0.0-alpha.1 → 7.0.0-alpha.11
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 +13 -5
- package/lib/commonjs/Link.js.map +1 -1
- package/lib/commonjs/LinkingContext.js +7 -5
- package/lib/commonjs/LinkingContext.js.map +1 -1
- package/lib/commonjs/LocaleDirContext.js +12 -0
- package/lib/commonjs/LocaleDirContext.js.map +1 -0
- package/lib/commonjs/NavigationContainer.js +57 -19
- package/lib/commonjs/NavigationContainer.js.map +1 -1
- package/lib/commonjs/ServerContainer.js +3 -4
- package/lib/commonjs/ServerContainer.js.map +1 -1
- package/lib/commonjs/ServerContext.js +3 -4
- package/lib/commonjs/ServerContext.js.map +1 -1
- package/lib/commonjs/UnhandledLinkingContext.js +20 -0
- package/lib/commonjs/UnhandledLinkingContext.js.map +1 -0
- package/lib/commonjs/__stubs__/createStackNavigator.js +19 -0
- package/lib/commonjs/__stubs__/createStackNavigator.js.map +1 -0
- package/lib/commonjs/__stubs__/window.js +79 -0
- package/lib/commonjs/__stubs__/window.js.map +1 -0
- package/lib/commonjs/createMemoryHistory.js +4 -7
- package/lib/commonjs/createMemoryHistory.js.map +1 -1
- package/lib/commonjs/createStaticNavigation.js +6 -4
- package/lib/commonjs/createStaticNavigation.js.map +1 -1
- package/lib/commonjs/extractPathFromURL.js +3 -3
- package/lib/commonjs/extractPathFromURL.js.map +1 -1
- package/lib/commonjs/index.js +17 -17
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theming/DarkTheme.js +1 -2
- package/lib/commonjs/theming/DarkTheme.js.map +1 -1
- package/lib/commonjs/theming/DefaultTheme.js +1 -2
- package/lib/commonjs/theming/DefaultTheme.js.map +1 -1
- package/lib/commonjs/theming/fonts.js +1 -2
- package/lib/commonjs/theming/fonts.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useBackButton.js +3 -19
- package/lib/commonjs/useBackButton.js.map +1 -1
- package/lib/commonjs/useBackButton.native.js +27 -0
- package/lib/commonjs/useBackButton.native.js.map +1 -0
- package/lib/commonjs/useDocumentTitle.js +5 -5
- package/lib/commonjs/useDocumentTitle.js.map +1 -1
- package/lib/commonjs/useDocumentTitle.native.js.map +1 -1
- package/lib/commonjs/useLinkBuilder.js +80 -0
- package/lib/commonjs/useLinkBuilder.js.map +1 -0
- package/lib/commonjs/useLinkProps.js +20 -23
- package/lib/commonjs/useLinkProps.js.map +1 -1
- package/lib/commonjs/useLinkTo.js +30 -0
- package/lib/commonjs/useLinkTo.js.map +1 -0
- package/lib/commonjs/useLinking.js +34 -35
- package/lib/commonjs/useLinking.js.map +1 -1
- package/lib/commonjs/useLinking.native.js +30 -23
- package/lib/commonjs/useLinking.native.js.map +1 -1
- package/lib/commonjs/useLocale.js +23 -0
- package/lib/commonjs/useLocale.js.map +1 -0
- package/lib/commonjs/useScrollToTop.js +8 -6
- package/lib/commonjs/useScrollToTop.js.map +1 -1
- package/lib/commonjs/useThenable.js +3 -2
- package/lib/commonjs/useThenable.js.map +1 -1
- package/lib/commonjs/useUnhandledLinking.js +75 -0
- package/lib/commonjs/useUnhandledLinking.js.map +1 -0
- package/lib/module/Link.js +11 -3
- package/lib/module/Link.js.map +1 -1
- package/lib/module/LinkingContext.js +4 -1
- package/lib/module/LinkingContext.js.map +1 -1
- package/lib/module/LocaleDirContext.js +4 -0
- package/lib/module/LocaleDirContext.js.map +1 -0
- package/lib/module/NavigationContainer.js +53 -15
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/ServerContainer.js.map +1 -1
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/UnhandledLinkingContext.js +12 -0
- package/lib/module/UnhandledLinkingContext.js.map +1 -0
- package/lib/module/__stubs__/createStackNavigator.js +11 -0
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -0
- package/lib/module/__stubs__/window.js +73 -0
- package/lib/module/__stubs__/window.js.map +1 -0
- package/lib/module/createMemoryHistory.js +4 -7
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStaticNavigation.js +4 -2
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/extractPathFromURL.js +3 -3
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/DefaultTheme.js.map +1 -1
- package/lib/module/theming/fonts.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useBackButton.js +3 -17
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useBackButton.native.js +19 -0
- package/lib/module/useBackButton.native.js.map +1 -0
- package/lib/module/useDocumentTitle.js +3 -3
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useDocumentTitle.native.js.map +1 -1
- package/lib/module/{useLinkTools.js → useLinkBuilder.js} +10 -10
- package/lib/module/useLinkBuilder.js.map +1 -0
- package/lib/module/useLinkProps.js +18 -21
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +23 -0
- package/lib/module/useLinkTo.js.map +1 -0
- package/lib/module/useLinking.js +31 -34
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +28 -21
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useLocale.js +16 -0
- package/lib/module/useLocale.js.map +1 -0
- package/lib/module/useScrollToTop.js +7 -5
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +1 -0
- package/lib/module/useThenable.js.map +1 -1
- package/lib/module/useUnhandledLinking.js +69 -0
- package/lib/module/useUnhandledLinking.js.map +1 -0
- package/lib/typescript/src/Link.d.ts +3 -3
- 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/LocaleDirContext.d.ts +4 -0
- package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainer.d.ts +4 -4
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/ServerContainer.d.ts +1 -1
- package/lib/typescript/src/ServerContainer.d.ts.map +1 -1
- package/lib/typescript/src/UnhandledLinkingContext.d.ts +6 -0
- package/lib/typescript/src/UnhandledLinkingContext.d.ts.map +1 -0
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +32 -0
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -0
- package/lib/typescript/src/{__mocks__ → __stubs__}/window.d.ts +1 -1
- package/lib/typescript/src/{__mocks__ → __stubs__}/window.d.ts.map +1 -1
- package/lib/typescript/src/createStaticNavigation.d.ts +2 -2
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +37 -18
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.d.ts +2 -2
- package/lib/typescript/src/useBackButton.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.native.d.ts +4 -0
- package/lib/typescript/src/useBackButton.native.d.ts.map +1 -0
- package/lib/typescript/src/useLinkBuilder.d.ts +25 -0
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -0
- package/lib/typescript/src/useLinkProps.d.ts +2 -2
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- 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 +8 -20
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +4 -20
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useLocale.d.ts +7 -0
- package/lib/typescript/src/useLocale.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
- package/lib/typescript/src/useThenable.d.ts.map +1 -1
- package/lib/typescript/src/useUnhandledLinking.d.ts +7 -0
- package/lib/typescript/src/useUnhandledLinking.d.ts.map +1 -0
- package/package.json +15 -15
- package/src/Link.tsx +11 -2
- package/src/LinkingContext.tsx +8 -2
- package/src/LocaleDirContext.tsx +7 -0
- package/src/NavigationContainer.tsx +80 -24
- package/src/ServerContainer.tsx +1 -1
- package/src/UnhandledLinkingContext.tsx +18 -0
- package/src/{__mocks__ → __stubs__}/window.tsx +7 -5
- package/src/createStaticNavigation.tsx +11 -4
- package/src/extractPathFromURL.tsx +4 -1
- package/src/index.tsx +3 -3
- package/src/types.tsx +40 -18
- package/src/useBackButton.native.tsx +33 -0
- package/src/useBackButton.tsx +3 -25
- package/src/{useLinkTools.tsx → useLinkBuilder.tsx} +8 -8
- package/src/useLinkProps.tsx +20 -19
- package/src/useLinkTo.tsx +30 -0
- package/src/useLinking.native.tsx +26 -20
- package/src/useLinking.tsx +43 -41
- package/src/useLocale.tsx +18 -0
- package/src/useScrollToTop.tsx +13 -7
- package/src/useThenable.tsx +1 -0
- package/src/useUnhandledLinking.tsx +91 -0
- package/lib/commonjs/theming/ThemeContext.js +0 -14
- 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 +0 -15
- package/lib/commonjs/theming/useTheme.js.map +0 -1
- package/lib/commonjs/useLinkTools.js +0 -80
- 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/__mocks__/createStackNavigator.d.ts +0 -56
- package/lib/typescript/src/__mocks__/createStackNavigator.d.ts.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
- /package/src/{__mocks__ → __stubs__}/createStackNavigator.tsx +0 -0
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
|
|
1
|
+
import { type NavigationContainerRef, type ParamListBase } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { LinkingOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Run async function in series as it's called.
|
|
6
|
+
*/
|
|
7
|
+
export declare const series: (cb: () => Promise<void>) => () => void;
|
|
4
8
|
type Options = LinkingOptions<ParamListBase>;
|
|
5
|
-
export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: Options): {
|
|
9
|
+
export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: Options, onUnhandledLinking: (lastUnhandledLining: string | undefined) => void): {
|
|
6
10
|
getInitialState: () => PromiseLike<(Partial<Omit<Readonly<{
|
|
7
11
|
key: string;
|
|
8
12
|
index: number;
|
|
9
13
|
routeNames: string[];
|
|
10
14
|
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
|
-
})[];
|
|
15
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
20
16
|
type: string;
|
|
21
17
|
stale: false;
|
|
22
18
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -28,15 +24,7 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
28
24
|
index: number;
|
|
29
25
|
routeNames: string[];
|
|
30
26
|
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
|
-
})[];
|
|
27
|
+
routes: import("@react-navigation/core").NavigationRoute<ParamListBase, string>[];
|
|
40
28
|
type: string;
|
|
41
29
|
stale: false;
|
|
42
30
|
}>, "stale" | "routes">> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,sBAAsB,
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;EAgVtE"}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
|
|
1
|
+
import { type NavigationContainerRef, type ParamListBase } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { LinkingOptions } from './types';
|
|
4
4
|
type Options = LinkingOptions<ParamListBase>;
|
|
5
|
-
export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState, }: Options): {
|
|
5
|
+
export declare function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState, }: Options, onUnhandledLinking: (lastUnhandledLining: string | undefined) => void): {
|
|
6
6
|
getInitialState: () => PromiseLike<(Partial<Omit<Readonly<{
|
|
7
7
|
key: string;
|
|
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,sBAAsB,
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/useLocale.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,SAAS;;EAUxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollToTop.d.ts","sourceRoot":"","sources":["../../../src/useScrollToTop.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useScrollToTop.d.ts","sourceRoot":"","sources":["../../../src/useScrollToTop.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,KAAK,aAAa,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,KAAK,cAAc,GACf;IAAE,WAAW,IAAI,IAAI,CAAA;CAAE,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,GAC1C;IAAE,cAAc,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,GAC1E;IAAE,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9D,KAAK,iBAAiB,GAClB;IAAE,kBAAkB,IAAI,KAAK,CAAC,SAAS,GAAG,UAAU,CAAA;CAAE,GACtD;IAAE,OAAO,IAAI,cAAc,CAAA;CAAE,GAC7B,cAAc,CAAC;AA8BnB,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,QAoErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThenable.d.ts","sourceRoot":"","sources":["../../../src/useThenable.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useThenable.d.ts","sourceRoot":"","sources":["../../../src/useThenable.tsx"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,4BAuC1D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type NavigationState, type PartialState } from '@react-navigation/core';
|
|
2
|
+
export declare function UNSTABLE_useUnhandledLinking(): {
|
|
3
|
+
lastUnhandledLink: string | undefined;
|
|
4
|
+
getStateForRouteNamesChange: (currentState: NavigationState) => PartialState<NavigationState> | undefined;
|
|
5
|
+
clearUnhandledLink: () => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useUnhandledLinking.d.ts.map
|
|
@@ -0,0 +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;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.11",
|
|
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.10",
|
|
41
41
|
"escape-string-regexp": "^4.0.0",
|
|
42
42
|
"fast-deep-equal": "^3.1.3",
|
|
43
|
-
"nanoid": "
|
|
43
|
+
"nanoid": "3.3.7",
|
|
44
|
+
"use-latest-callback": "^0.1.9"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@testing-library/react-native": "^
|
|
47
|
-
"@types/react": "~18.
|
|
48
|
-
"@types/react-dom": "~18.0.
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"react": "18.1.0",
|
|
47
|
+
"@testing-library/react-native": "^12.4.3",
|
|
48
|
+
"@types/react": "~18.2.45",
|
|
49
|
+
"@types/react-dom": "~18.0.11",
|
|
50
|
+
"del-cli": "^5.1.0",
|
|
51
|
+
"react": "18.2.0",
|
|
52
52
|
"react-dom": "18.2.0",
|
|
53
|
-
"react-native": "0.
|
|
54
|
-
"react-native-builder-bob": "^0.
|
|
55
|
-
"typescript": "^
|
|
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
|
-
"react": "
|
|
59
|
-
"react-native": "
|
|
58
|
+
"react": ">= 18.2.0",
|
|
59
|
+
"react-native": ">= 0.72.0"
|
|
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": "b407411496a2eaeeeb29b563d66294e79ae31311"
|
|
76
76
|
}
|
package/src/Link.tsx
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { useTheme } from '@react-navigation/core';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type GestureResponderEvent,
|
|
5
|
+
Platform,
|
|
6
|
+
Text,
|
|
7
|
+
type TextProps,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
|
|
4
|
-
import { Props as LinkProps, useLinkProps } from './useLinkProps';
|
|
10
|
+
import { type Props as LinkProps, useLinkProps } from './useLinkProps';
|
|
5
11
|
|
|
6
12
|
type Props<ParamList extends ReactNavigation.RootParamList> =
|
|
7
13
|
LinkProps<ParamList> &
|
|
@@ -31,8 +37,10 @@ export function Link<ParamList extends ReactNavigation.RootParamList>({
|
|
|
31
37
|
params,
|
|
32
38
|
action,
|
|
33
39
|
href,
|
|
40
|
+
style,
|
|
34
41
|
...rest
|
|
35
42
|
}: Props<ParamList>) {
|
|
43
|
+
const { colors, fonts } = useTheme();
|
|
36
44
|
// @ts-expect-error: This is already type-checked by the prop types
|
|
37
45
|
const props = useLinkProps<ParamList>({ screen, params, action, href });
|
|
38
46
|
|
|
@@ -56,5 +64,6 @@ export function Link<ParamList extends ReactNavigation.RootParamList>({
|
|
|
56
64
|
web: { onClick: onPress } as any,
|
|
57
65
|
default: { onPress },
|
|
58
66
|
}),
|
|
67
|
+
style: [{ color: colors.primary }, fonts.regular, style],
|
|
59
68
|
});
|
|
60
69
|
}
|
package/src/LinkingContext.tsx
CHANGED
|
@@ -3,8 +3,14 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import type { LinkingOptions } from './types';
|
|
5
5
|
|
|
6
|
+
const MISSING_CONTEXT_ERROR = "Couldn't find a LinkingContext context.";
|
|
7
|
+
|
|
6
8
|
export const LinkingContext = React.createContext<{
|
|
7
|
-
options
|
|
8
|
-
}>({
|
|
9
|
+
options?: LinkingOptions<ParamListBase>;
|
|
10
|
+
}>({
|
|
11
|
+
get options(): any {
|
|
12
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
9
15
|
|
|
10
16
|
LinkingContext.displayName = 'LinkingContext';
|
|
@@ -3,23 +3,32 @@ import {
|
|
|
3
3
|
getActionFromState,
|
|
4
4
|
getPathFromState,
|
|
5
5
|
getStateFromPath,
|
|
6
|
-
NavigationContainerProps,
|
|
7
|
-
NavigationContainerRef,
|
|
8
|
-
|
|
6
|
+
type NavigationContainerProps,
|
|
7
|
+
type NavigationContainerRef,
|
|
8
|
+
type NavigationState,
|
|
9
|
+
type ParamListBase,
|
|
9
10
|
validatePathConfig,
|
|
10
11
|
} from '@react-navigation/core';
|
|
11
12
|
import * as React from 'react';
|
|
13
|
+
import { I18nManager } from 'react-native';
|
|
14
|
+
import useLatestCallback from 'use-latest-callback';
|
|
12
15
|
|
|
13
16
|
import { LinkingContext } from './LinkingContext';
|
|
17
|
+
import { LocaleDirContext } from './LocaleDirContext';
|
|
14
18
|
import { DefaultTheme } from './theming/DefaultTheme';
|
|
15
|
-
import {
|
|
16
|
-
|
|
19
|
+
import type {
|
|
20
|
+
DocumentTitleOptions,
|
|
21
|
+
LinkingOptions,
|
|
22
|
+
LocaleDirection,
|
|
23
|
+
} from './types';
|
|
24
|
+
import { UnhandledLinkingContext } from './UnhandledLinkingContext';
|
|
17
25
|
import { useBackButton } from './useBackButton';
|
|
18
26
|
import { useDocumentTitle } from './useDocumentTitle';
|
|
19
27
|
import { useLinking } from './useLinking';
|
|
20
28
|
import { useThenable } from './useThenable';
|
|
21
29
|
|
|
22
30
|
declare global {
|
|
31
|
+
// eslint-disable-next-line no-var
|
|
23
32
|
var REACT_NAVIGATION_DEVTOOLS: WeakMap<
|
|
24
33
|
NavigationContainerRef<any>,
|
|
25
34
|
{ readonly linking: LinkingOptions<any> }
|
|
@@ -29,7 +38,7 @@ declare global {
|
|
|
29
38
|
global.REACT_NAVIGATION_DEVTOOLS = new WeakMap();
|
|
30
39
|
|
|
31
40
|
type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
32
|
-
|
|
41
|
+
direction?: LocaleDirection;
|
|
33
42
|
linking?: LinkingOptions<ParamList>;
|
|
34
43
|
fallback?: React.ReactNode;
|
|
35
44
|
documentTitle?: DocumentTitleOptions;
|
|
@@ -43,7 +52,8 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
43
52
|
* @param props.onReady Callback which is called after the navigation tree mounts.
|
|
44
53
|
* @param props.onStateChange Callback which is called with the latest navigation state when it changes.
|
|
45
54
|
* @param props.onUnhandledAction Callback which is called when an action is not handled.
|
|
46
|
-
* @param props.
|
|
55
|
+
* @param props.direction Text direction of the components. Defaults to `'ltr'`.
|
|
56
|
+
* @param props.theme Theme object for the UI elements.
|
|
47
57
|
* @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.
|
|
48
58
|
* @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.
|
|
49
59
|
* @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.
|
|
@@ -52,10 +62,13 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
52
62
|
*/
|
|
53
63
|
function NavigationContainerInner(
|
|
54
64
|
{
|
|
65
|
+
direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
|
|
55
66
|
theme = DefaultTheme,
|
|
56
67
|
linking,
|
|
57
68
|
fallback = null,
|
|
58
69
|
documentTitle,
|
|
70
|
+
onReady,
|
|
71
|
+
onStateChange,
|
|
59
72
|
...rest
|
|
60
73
|
}: Props<ParamListBase>,
|
|
61
74
|
ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>
|
|
@@ -72,12 +85,52 @@ function NavigationContainerInner(
|
|
|
72
85
|
useBackButton(refContainer);
|
|
73
86
|
useDocumentTitle(refContainer, documentTitle);
|
|
74
87
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
const [lastUnhandledLink, setLastUnhandledLink] = React.useState<
|
|
89
|
+
string | undefined
|
|
90
|
+
>();
|
|
91
|
+
|
|
92
|
+
const { getInitialState } = useLinking(
|
|
93
|
+
refContainer,
|
|
94
|
+
{
|
|
95
|
+
enabled: isLinkingEnabled,
|
|
96
|
+
prefixes: [],
|
|
97
|
+
...linking,
|
|
98
|
+
},
|
|
99
|
+
setLastUnhandledLink
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
|
|
103
|
+
|
|
104
|
+
const unhandledLinkingContext = React.useMemo(
|
|
105
|
+
() => ({ lastUnhandledLink, setLastUnhandledLink }),
|
|
106
|
+
[lastUnhandledLink, setLastUnhandledLink]
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const onReadyForLinkingHandling = useLatestCallback(() => {
|
|
110
|
+
// If the screen path matches lastUnhandledLink, we do not track it
|
|
111
|
+
const path = refContainer.current?.getCurrentRoute()?.path;
|
|
112
|
+
setLastUnhandledLink((previousLastUnhandledLink) => {
|
|
113
|
+
if (previousLastUnhandledLink === path) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
return previousLastUnhandledLink;
|
|
117
|
+
});
|
|
118
|
+
onReady?.();
|
|
79
119
|
});
|
|
80
120
|
|
|
121
|
+
const onStateChangeForLinkingHandling = useLatestCallback(
|
|
122
|
+
(state: Readonly<NavigationState> | undefined) => {
|
|
123
|
+
// If the screen path matches lastUnhandledLink, we do not track it
|
|
124
|
+
const path = refContainer.current?.getCurrentRoute()?.path;
|
|
125
|
+
setLastUnhandledLink((previousLastUnhandledLink) => {
|
|
126
|
+
if (previousLastUnhandledLink === path) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
return previousLastUnhandledLink;
|
|
130
|
+
});
|
|
131
|
+
onStateChange?.(state);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
81
134
|
// Add additional linking related info to the ref
|
|
82
135
|
// This will be used by the devtools
|
|
83
136
|
React.useEffect(() => {
|
|
@@ -102,8 +155,6 @@ function NavigationContainerInner(
|
|
|
102
155
|
|
|
103
156
|
React.useImperativeHandle(ref, () => refContainer.current);
|
|
104
157
|
|
|
105
|
-
const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
|
|
106
|
-
|
|
107
158
|
const isLinkingReady =
|
|
108
159
|
rest.initialState != null || !isLinkingEnabled || isResolved;
|
|
109
160
|
|
|
@@ -114,17 +165,22 @@ function NavigationContainerInner(
|
|
|
114
165
|
}
|
|
115
166
|
|
|
116
167
|
return (
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
168
|
+
<LocaleDirContext.Provider value={direction}>
|
|
169
|
+
<UnhandledLinkingContext.Provider value={unhandledLinkingContext}>
|
|
170
|
+
<LinkingContext.Provider value={linkingContext}>
|
|
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
|
+
/>
|
|
181
|
+
</LinkingContext.Provider>
|
|
182
|
+
</UnhandledLinkingContext.Provider>
|
|
183
|
+
</LocaleDirContext.Provider>
|
|
128
184
|
);
|
|
129
185
|
}
|
|
130
186
|
|
package/src/ServerContainer.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CurrentRenderContext } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { ServerContext, ServerContextType } from './ServerContext';
|
|
4
|
+
import { ServerContext, type ServerContextType } from './ServerContext';
|
|
5
5
|
import type { ServerContainerRef } from './types';
|
|
6
6
|
|
|
7
7
|
type Props = ServerContextType & {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const MISSING_CONTEXT_ERROR =
|
|
4
|
+
"Couldn't find an UnhandledLinkingContext context.";
|
|
5
|
+
|
|
6
|
+
export const UnhandledLinkingContext = React.createContext<{
|
|
7
|
+
lastUnhandledLink: string | undefined;
|
|
8
|
+
setLastUnhandledLink: (lastUnhandledUrl: string | undefined) => void;
|
|
9
|
+
}>({
|
|
10
|
+
get lastUnhandledLink(): any {
|
|
11
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
12
|
+
},
|
|
13
|
+
get setLastUnhandledLink(): any {
|
|
14
|
+
throw new Error(MISSING_CONTEXT_ERROR);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
UnhandledLinkingContext.displayName = 'UnhandledLinkingContext';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let location = new URL('', 'http://example.com');
|
|
2
2
|
|
|
3
3
|
let listeners: (() => void)[] = [];
|
|
4
4
|
let entries = [{ state: null, href: location.href }];
|
|
@@ -12,7 +12,7 @@ const history = {
|
|
|
12
12
|
},
|
|
13
13
|
|
|
14
14
|
pushState(state: any, _: string, path: string) {
|
|
15
|
-
|
|
15
|
+
location = new URL(path, location.origin);
|
|
16
16
|
|
|
17
17
|
currentState = state;
|
|
18
18
|
entries = entries.slice(0, index + 1);
|
|
@@ -21,7 +21,7 @@ const history = {
|
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
replaceState(state: any, _: string, path: string) {
|
|
24
|
-
|
|
24
|
+
location = new URL(path, location.origin);
|
|
25
25
|
|
|
26
26
|
currentState = state;
|
|
27
27
|
entries[index] = { state, href: location.href };
|
|
@@ -35,7 +35,7 @@ const history = {
|
|
|
35
35
|
) {
|
|
36
36
|
index += n;
|
|
37
37
|
const entry = entries[index];
|
|
38
|
-
|
|
38
|
+
location = new URL(entry.href);
|
|
39
39
|
currentState = entry.state;
|
|
40
40
|
listeners.forEach((cb) => cb());
|
|
41
41
|
}
|
|
@@ -65,7 +65,9 @@ const removeEventListener = (type: 'popstate', listener: () => void) => {
|
|
|
65
65
|
|
|
66
66
|
export const window = {
|
|
67
67
|
document: { title: '' },
|
|
68
|
-
location
|
|
68
|
+
get location() {
|
|
69
|
+
return location;
|
|
70
|
+
},
|
|
69
71
|
history,
|
|
70
72
|
addEventListener,
|
|
71
73
|
removeEventListener,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createComponentForStaticNavigation,
|
|
3
3
|
createPathConfigForStaticNavigation,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type NavigationContainerRef,
|
|
5
|
+
type ParamListBase,
|
|
6
|
+
type StaticNavigation,
|
|
6
7
|
} from '@react-navigation/core';
|
|
7
8
|
import * as React from 'react';
|
|
8
9
|
|
|
@@ -34,14 +35,20 @@ export function createStaticNavigation(tree: StaticNavigation<any, any, any>) {
|
|
|
34
35
|
: {},
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
function Navigation(
|
|
39
|
+
{ linking, ...rest }: Props,
|
|
40
|
+
ref: React.Ref<NavigationContainerRef<ParamListBase>>
|
|
41
|
+
) {
|
|
38
42
|
return (
|
|
39
43
|
<NavigationContainer
|
|
40
44
|
{...rest}
|
|
45
|
+
ref={ref}
|
|
41
46
|
linking={linking ? { ...linking, config: linkingConfig } : undefined}
|
|
42
47
|
>
|
|
43
48
|
<Component />
|
|
44
49
|
</NavigationContainer>
|
|
45
50
|
);
|
|
46
|
-
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return React.forwardRef(Navigation);
|
|
47
54
|
}
|
|
@@ -15,7 +15,10 @@ export function extractPathFromURL(prefixes: string[], url: string) {
|
|
|
15
15
|
.join('\\.')}`
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const [originAndPath, searchParams] = url.split('?');
|
|
19
|
+
const normalizedURL = originAndPath
|
|
20
|
+
.replace(/\/+/g, '/')
|
|
21
|
+
.concat(searchParams ? `?${searchParams}` : '');
|
|
19
22
|
|
|
20
23
|
if (prefixRegex.test(normalizedURL)) {
|
|
21
24
|
return normalizedURL.replace(prefixRegex, '');
|
package/src/index.tsx
CHANGED
|
@@ -5,10 +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 {
|
|
11
|
+
export { useLocale } from './useLocale';
|
|
13
12
|
export { useScrollToTop } from './useScrollToTop';
|
|
13
|
+
export { UNSTABLE_useUnhandledLinking } from './useUnhandledLinking';
|
|
14
14
|
export * from '@react-navigation/core';
|
package/src/types.tsx
CHANGED
|
@@ -6,6 +6,31 @@ import type {
|
|
|
6
6
|
Route,
|
|
7
7
|
} from '@react-navigation/core';
|
|
8
8
|
|
|
9
|
+
declare global {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
11
|
+
namespace ReactNavigation {
|
|
12
|
+
interface Theme {
|
|
13
|
+
dark: boolean;
|
|
14
|
+
colors: {
|
|
15
|
+
primary: string;
|
|
16
|
+
background: string;
|
|
17
|
+
card: string;
|
|
18
|
+
text: string;
|
|
19
|
+
border: string;
|
|
20
|
+
notification: string;
|
|
21
|
+
};
|
|
22
|
+
fonts: {
|
|
23
|
+
regular: FontStyle;
|
|
24
|
+
medium: FontStyle;
|
|
25
|
+
bold: FontStyle;
|
|
26
|
+
heavy: FontStyle;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type LocaleDirection = 'ltr' | 'rtl';
|
|
33
|
+
|
|
9
34
|
type FontStyle = {
|
|
10
35
|
fontFamily: string;
|
|
11
36
|
fontWeight:
|
|
@@ -22,23 +47,7 @@ type FontStyle = {
|
|
|
22
47
|
| '900';
|
|
23
48
|
};
|
|
24
49
|
|
|
25
|
-
export type Theme =
|
|
26
|
-
dark: boolean;
|
|
27
|
-
colors: {
|
|
28
|
-
primary: string;
|
|
29
|
-
background: string;
|
|
30
|
-
card: string;
|
|
31
|
-
text: string;
|
|
32
|
-
border: string;
|
|
33
|
-
notification: string;
|
|
34
|
-
};
|
|
35
|
-
fonts: {
|
|
36
|
-
regular: FontStyle;
|
|
37
|
-
medium: FontStyle;
|
|
38
|
-
bold: FontStyle;
|
|
39
|
-
heavy: FontStyle;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
50
|
+
export type Theme = ReactNavigation.Theme;
|
|
42
51
|
|
|
43
52
|
export type LinkingOptions<ParamList extends {}> = {
|
|
44
53
|
/**
|
|
@@ -96,8 +105,21 @@ export type LinkingOptions<ParamList extends {}> = {
|
|
|
96
105
|
* ```
|
|
97
106
|
*/
|
|
98
107
|
config?: {
|
|
99
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Path string to match against for the whole navigation tree.
|
|
110
|
+
* It's not possible to specify params here since this doesn't belong to a screen.
|
|
111
|
+
* This is useful when the whole app is under a specific path.
|
|
112
|
+
* e.g. all of the screens are under `/admin` in `https://example.com/admin`
|
|
113
|
+
*/
|
|
114
|
+
path?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Path configuration for child screens.
|
|
117
|
+
*/
|
|
100
118
|
screens: PathConfigMap<ParamList>;
|
|
119
|
+
/**
|
|
120
|
+
* Name of the initial route to use for the root navigator.
|
|
121
|
+
*/
|
|
122
|
+
initialRouteName?: keyof ParamList;
|
|
101
123
|
};
|
|
102
124
|
/**
|
|
103
125
|
* Custom function to get the initial URL used for linking.
|