@react-navigation/native 8.0.0-alpha.39 → 8.0.0-alpha.40
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/ios/ReactNavigationSFSymbolView.swift +6 -2
- package/lib/module/Link.js +65 -29
- package/lib/module/Link.js.map +1 -1
- package/lib/module/Link.native.js +72 -0
- package/lib/module/Link.native.js.map +1 -0
- package/lib/module/NavigationContainer.js +3 -3
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/constants.native.js +6 -0
- package/lib/module/constants.native.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.js +2 -7
- package/lib/module/native/CornerInset.js.map +1 -1
- package/lib/module/theming/DarkTheme.js +1 -1
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/LightTheme.js +1 -1
- package/lib/module/theming/LightTheme.js.map +1 -1
- package/lib/module/theming/MaterialFallbackTheme.js +1 -1
- package/lib/module/theming/MaterialFallbackTheme.js.map +1 -1
- package/lib/module/theming/MaterialTheme.android.js +1 -1
- package/lib/module/theming/MaterialTheme.android.js.map +1 -1
- package/lib/module/theming/fonts.js +15 -54
- package/lib/module/theming/fonts.js.map +1 -1
- package/lib/module/theming/fonts.native.js +42 -0
- package/lib/module/theming/fonts.native.js.map +1 -0
- package/lib/module/useLinkProps.js +5 -5
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinking.js +1 -1
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/typescript/src/Link.d.ts +12 -6
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/Link.native.d.ts +4 -0
- package/lib/typescript/src/Link.native.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/constants.d.ts +4 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/constants.native.d.ts +4 -0
- package/lib/typescript/src/constants.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +3 -3
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/theming/DarkTheme.d.ts +0 -34
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/LightTheme.d.ts +0 -34
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts +0 -68
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +0 -136
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.d.ts +0 -34
- package/lib/typescript/src/theming/fonts.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.native.d.ts +36 -0
- package/lib/typescript/src/theming/fonts.native.d.ts.map +1 -0
- package/lib/typescript/src/useLinkBuilder.d.ts +30 -30
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts +1 -1
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +3 -39
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +4 -76
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/Link.native.tsx +69 -0
- package/src/Link.tsx +102 -34
- package/src/NavigationContainer.tsx +3 -4
- package/src/constants.native.tsx +10 -0
- package/src/constants.tsx +5 -0
- package/src/native/CornerInset.tsx +4 -4
- package/src/native/MaterialSymbol.tsx +1 -1
- package/src/theming/fonts.native.tsx +41 -0
- package/src/theming/fonts.tsx +15 -54
- package/src/useLinkProps.tsx +6 -5
- package/src/useLinking.native.tsx +6 -5
- package/src/useLinking.tsx +9 -12
- package/lib/module/__stubs__/window.js +0 -78
- package/lib/module/__stubs__/window.js.map +0 -1
- package/lib/typescript/src/__stubs__/window.d.ts +0 -18
- package/lib/typescript/src/__stubs__/window.d.ts.map +0 -1
- package/src/__stubs__/window.tsx +0 -82
|
@@ -25,40 +25,6 @@ export declare const MaterialLightTheme: {
|
|
|
25
25
|
readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
26
26
|
readonly fontWeight: "700";
|
|
27
27
|
};
|
|
28
|
-
} | {
|
|
29
|
-
readonly regular: {
|
|
30
|
-
readonly fontFamily: "System";
|
|
31
|
-
readonly fontWeight: "400";
|
|
32
|
-
};
|
|
33
|
-
readonly medium: {
|
|
34
|
-
readonly fontFamily: "System";
|
|
35
|
-
readonly fontWeight: "500";
|
|
36
|
-
};
|
|
37
|
-
readonly bold: {
|
|
38
|
-
readonly fontFamily: "System";
|
|
39
|
-
readonly fontWeight: "600";
|
|
40
|
-
};
|
|
41
|
-
readonly heavy: {
|
|
42
|
-
readonly fontFamily: "System";
|
|
43
|
-
readonly fontWeight: "700";
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
readonly regular: {
|
|
47
|
-
readonly fontFamily: "sans-serif";
|
|
48
|
-
readonly fontWeight: "normal";
|
|
49
|
-
};
|
|
50
|
-
readonly medium: {
|
|
51
|
-
readonly fontFamily: "sans-serif-medium";
|
|
52
|
-
readonly fontWeight: "normal";
|
|
53
|
-
};
|
|
54
|
-
readonly bold: {
|
|
55
|
-
readonly fontFamily: "sans-serif";
|
|
56
|
-
readonly fontWeight: "600";
|
|
57
|
-
};
|
|
58
|
-
readonly heavy: {
|
|
59
|
-
readonly fontFamily: "sans-serif";
|
|
60
|
-
readonly fontWeight: "700";
|
|
61
|
-
};
|
|
62
28
|
};
|
|
63
29
|
} | {
|
|
64
30
|
readonly dark: false;
|
|
@@ -87,40 +53,6 @@ export declare const MaterialLightTheme: {
|
|
|
87
53
|
readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
88
54
|
readonly fontWeight: "700";
|
|
89
55
|
};
|
|
90
|
-
} | {
|
|
91
|
-
readonly regular: {
|
|
92
|
-
readonly fontFamily: "System";
|
|
93
|
-
readonly fontWeight: "400";
|
|
94
|
-
};
|
|
95
|
-
readonly medium: {
|
|
96
|
-
readonly fontFamily: "System";
|
|
97
|
-
readonly fontWeight: "500";
|
|
98
|
-
};
|
|
99
|
-
readonly bold: {
|
|
100
|
-
readonly fontFamily: "System";
|
|
101
|
-
readonly fontWeight: "600";
|
|
102
|
-
};
|
|
103
|
-
readonly heavy: {
|
|
104
|
-
readonly fontFamily: "System";
|
|
105
|
-
readonly fontWeight: "700";
|
|
106
|
-
};
|
|
107
|
-
} | {
|
|
108
|
-
readonly regular: {
|
|
109
|
-
readonly fontFamily: "sans-serif";
|
|
110
|
-
readonly fontWeight: "normal";
|
|
111
|
-
};
|
|
112
|
-
readonly medium: {
|
|
113
|
-
readonly fontFamily: "sans-serif-medium";
|
|
114
|
-
readonly fontWeight: "normal";
|
|
115
|
-
};
|
|
116
|
-
readonly bold: {
|
|
117
|
-
readonly fontFamily: "sans-serif";
|
|
118
|
-
readonly fontWeight: "600";
|
|
119
|
-
};
|
|
120
|
-
readonly heavy: {
|
|
121
|
-
readonly fontFamily: "sans-serif";
|
|
122
|
-
readonly fontWeight: "700";
|
|
123
|
-
};
|
|
124
56
|
};
|
|
125
57
|
};
|
|
126
58
|
export declare const MaterialDarkTheme: {
|
|
@@ -150,40 +82,6 @@ export declare const MaterialDarkTheme: {
|
|
|
150
82
|
readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
151
83
|
readonly fontWeight: "700";
|
|
152
84
|
};
|
|
153
|
-
} | {
|
|
154
|
-
readonly regular: {
|
|
155
|
-
readonly fontFamily: "System";
|
|
156
|
-
readonly fontWeight: "400";
|
|
157
|
-
};
|
|
158
|
-
readonly medium: {
|
|
159
|
-
readonly fontFamily: "System";
|
|
160
|
-
readonly fontWeight: "500";
|
|
161
|
-
};
|
|
162
|
-
readonly bold: {
|
|
163
|
-
readonly fontFamily: "System";
|
|
164
|
-
readonly fontWeight: "600";
|
|
165
|
-
};
|
|
166
|
-
readonly heavy: {
|
|
167
|
-
readonly fontFamily: "System";
|
|
168
|
-
readonly fontWeight: "700";
|
|
169
|
-
};
|
|
170
|
-
} | {
|
|
171
|
-
readonly regular: {
|
|
172
|
-
readonly fontFamily: "sans-serif";
|
|
173
|
-
readonly fontWeight: "normal";
|
|
174
|
-
};
|
|
175
|
-
readonly medium: {
|
|
176
|
-
readonly fontFamily: "sans-serif-medium";
|
|
177
|
-
readonly fontWeight: "normal";
|
|
178
|
-
};
|
|
179
|
-
readonly bold: {
|
|
180
|
-
readonly fontFamily: "sans-serif";
|
|
181
|
-
readonly fontWeight: "600";
|
|
182
|
-
};
|
|
183
|
-
readonly heavy: {
|
|
184
|
-
readonly fontFamily: "sans-serif";
|
|
185
|
-
readonly fontWeight: "700";
|
|
186
|
-
};
|
|
187
85
|
};
|
|
188
86
|
} | {
|
|
189
87
|
readonly dark: true;
|
|
@@ -212,40 +110,6 @@ export declare const MaterialDarkTheme: {
|
|
|
212
110
|
readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
213
111
|
readonly fontWeight: "700";
|
|
214
112
|
};
|
|
215
|
-
} | {
|
|
216
|
-
readonly regular: {
|
|
217
|
-
readonly fontFamily: "System";
|
|
218
|
-
readonly fontWeight: "400";
|
|
219
|
-
};
|
|
220
|
-
readonly medium: {
|
|
221
|
-
readonly fontFamily: "System";
|
|
222
|
-
readonly fontWeight: "500";
|
|
223
|
-
};
|
|
224
|
-
readonly bold: {
|
|
225
|
-
readonly fontFamily: "System";
|
|
226
|
-
readonly fontWeight: "600";
|
|
227
|
-
};
|
|
228
|
-
readonly heavy: {
|
|
229
|
-
readonly fontFamily: "System";
|
|
230
|
-
readonly fontWeight: "700";
|
|
231
|
-
};
|
|
232
|
-
} | {
|
|
233
|
-
readonly regular: {
|
|
234
|
-
readonly fontFamily: "sans-serif";
|
|
235
|
-
readonly fontWeight: "normal";
|
|
236
|
-
};
|
|
237
|
-
readonly medium: {
|
|
238
|
-
readonly fontFamily: "sans-serif-medium";
|
|
239
|
-
readonly fontWeight: "normal";
|
|
240
|
-
};
|
|
241
|
-
readonly bold: {
|
|
242
|
-
readonly fontFamily: "sans-serif";
|
|
243
|
-
readonly fontWeight: "600";
|
|
244
|
-
};
|
|
245
|
-
readonly heavy: {
|
|
246
|
-
readonly fontFamily: "sans-serif";
|
|
247
|
-
readonly fontWeight: "700";
|
|
248
|
-
};
|
|
249
113
|
};
|
|
250
114
|
};
|
|
251
115
|
//# sourceMappingURL=MaterialTheme.android.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialTheme.android.d.ts","sourceRoot":"","sources":["../../../../src/theming/MaterialTheme.android.tsx"],"names":[],"mappings":"AAsCA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"MaterialTheme.android.d.ts","sourceRoot":"","sources":["../../../../src/theming/MaterialTheme.android.tsx"],"names":[],"mappings":"AAsCA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAED,CAAC;AAE/B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAED,CAAC"}
|
|
@@ -15,39 +15,5 @@ export declare const fonts: {
|
|
|
15
15
|
readonly fontFamily: "system-ui, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"";
|
|
16
16
|
readonly fontWeight: "700";
|
|
17
17
|
};
|
|
18
|
-
} | {
|
|
19
|
-
readonly regular: {
|
|
20
|
-
readonly fontFamily: "System";
|
|
21
|
-
readonly fontWeight: "400";
|
|
22
|
-
};
|
|
23
|
-
readonly medium: {
|
|
24
|
-
readonly fontFamily: "System";
|
|
25
|
-
readonly fontWeight: "500";
|
|
26
|
-
};
|
|
27
|
-
readonly bold: {
|
|
28
|
-
readonly fontFamily: "System";
|
|
29
|
-
readonly fontWeight: "600";
|
|
30
|
-
};
|
|
31
|
-
readonly heavy: {
|
|
32
|
-
readonly fontFamily: "System";
|
|
33
|
-
readonly fontWeight: "700";
|
|
34
|
-
};
|
|
35
|
-
} | {
|
|
36
|
-
readonly regular: {
|
|
37
|
-
readonly fontFamily: "sans-serif";
|
|
38
|
-
readonly fontWeight: "normal";
|
|
39
|
-
};
|
|
40
|
-
readonly medium: {
|
|
41
|
-
readonly fontFamily: "sans-serif-medium";
|
|
42
|
-
readonly fontWeight: "normal";
|
|
43
|
-
};
|
|
44
|
-
readonly bold: {
|
|
45
|
-
readonly fontFamily: "sans-serif";
|
|
46
|
-
readonly fontWeight: "600";
|
|
47
|
-
};
|
|
48
|
-
readonly heavy: {
|
|
49
|
-
readonly fontFamily: "sans-serif";
|
|
50
|
-
readonly fontWeight: "700";
|
|
51
|
-
};
|
|
52
18
|
};
|
|
53
19
|
//# sourceMappingURL=fonts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../../src/theming/fonts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../../src/theming/fonts.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;CAiBiB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const fonts: {
|
|
2
|
+
readonly regular: {
|
|
3
|
+
readonly fontFamily: "System";
|
|
4
|
+
readonly fontWeight: "400";
|
|
5
|
+
};
|
|
6
|
+
readonly medium: {
|
|
7
|
+
readonly fontFamily: "System";
|
|
8
|
+
readonly fontWeight: "500";
|
|
9
|
+
};
|
|
10
|
+
readonly bold: {
|
|
11
|
+
readonly fontFamily: "System";
|
|
12
|
+
readonly fontWeight: "600";
|
|
13
|
+
};
|
|
14
|
+
readonly heavy: {
|
|
15
|
+
readonly fontFamily: "System";
|
|
16
|
+
readonly fontWeight: "700";
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
readonly regular: {
|
|
20
|
+
readonly fontFamily: "sans-serif";
|
|
21
|
+
readonly fontWeight: "normal";
|
|
22
|
+
};
|
|
23
|
+
readonly medium: {
|
|
24
|
+
readonly fontFamily: "sans-serif-medium";
|
|
25
|
+
readonly fontWeight: "normal";
|
|
26
|
+
};
|
|
27
|
+
readonly bold: {
|
|
28
|
+
readonly fontFamily: "sans-serif";
|
|
29
|
+
readonly fontWeight: "600";
|
|
30
|
+
};
|
|
31
|
+
readonly heavy: {
|
|
32
|
+
readonly fontFamily: "sans-serif";
|
|
33
|
+
readonly fontWeight: "700";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=fonts.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.native.d.ts","sourceRoot":"","sources":["../../../../src/theming/fonts.native.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCkC,CAAC"}
|
|
@@ -6,6 +6,21 @@ export declare function useBuildHref(): (name: string, params?: object) => strin
|
|
|
6
6
|
* Helper to build a navigation action from a href based on the linking options.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useBuildAction(): (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/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
18
|
+
type: string;
|
|
19
|
+
stale: false;
|
|
20
|
+
}>> | undefined;
|
|
21
|
+
path?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
9
24
|
type: "GO_BACK";
|
|
10
25
|
source?: string | undefined;
|
|
11
26
|
target?: string | undefined;
|
|
@@ -49,21 +64,6 @@ export declare function useBuildAction(): (href: string) => {
|
|
|
49
64
|
};
|
|
50
65
|
source?: string | undefined;
|
|
51
66
|
target?: string | undefined;
|
|
52
|
-
} | {
|
|
53
|
-
type: "NAVIGATE";
|
|
54
|
-
payload: {
|
|
55
|
-
name: string;
|
|
56
|
-
params?: import("@react-navigation/core").NavigatorScreenParams<Readonly<{
|
|
57
|
-
key: string;
|
|
58
|
-
index: number;
|
|
59
|
-
routeNames: string[];
|
|
60
|
-
history?: unknown[] | undefined;
|
|
61
|
-
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
62
|
-
type: string;
|
|
63
|
-
stale: false;
|
|
64
|
-
}>> | undefined;
|
|
65
|
-
path?: string | undefined;
|
|
66
|
-
};
|
|
67
67
|
} | {
|
|
68
68
|
readonly type: "RESET";
|
|
69
69
|
readonly payload: Readonly<{
|
|
@@ -102,6 +102,21 @@ export declare function useBuildAction(): (href: string) => {
|
|
|
102
102
|
export declare function useLinkBuilder(): {
|
|
103
103
|
buildHref: (name: string, params?: object) => string | undefined;
|
|
104
104
|
buildAction: (href: string) => {
|
|
105
|
+
type: "NAVIGATE";
|
|
106
|
+
payload: {
|
|
107
|
+
name: string;
|
|
108
|
+
params?: import("@react-navigation/core").NavigatorScreenParams<Readonly<{
|
|
109
|
+
key: string;
|
|
110
|
+
index: number;
|
|
111
|
+
routeNames: string[];
|
|
112
|
+
history?: unknown[] | undefined;
|
|
113
|
+
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
114
|
+
type: string;
|
|
115
|
+
stale: false;
|
|
116
|
+
}>> | undefined;
|
|
117
|
+
path?: string | undefined;
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
105
120
|
type: "GO_BACK";
|
|
106
121
|
source?: string | undefined;
|
|
107
122
|
target?: string | undefined;
|
|
@@ -145,21 +160,6 @@ export declare function useLinkBuilder(): {
|
|
|
145
160
|
};
|
|
146
161
|
source?: string | undefined;
|
|
147
162
|
target?: string | undefined;
|
|
148
|
-
} | {
|
|
149
|
-
type: "NAVIGATE";
|
|
150
|
-
payload: {
|
|
151
|
-
name: string;
|
|
152
|
-
params?: import("@react-navigation/core").NavigatorScreenParams<Readonly<{
|
|
153
|
-
key: string;
|
|
154
|
-
index: number;
|
|
155
|
-
routeNames: string[];
|
|
156
|
-
history?: unknown[] | undefined;
|
|
157
|
-
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
158
|
-
type: string;
|
|
159
|
-
stale: false;
|
|
160
|
-
}>> | undefined;
|
|
161
|
-
path?: string | undefined;
|
|
162
|
-
};
|
|
163
163
|
} | {
|
|
164
164
|
readonly type: "RESET";
|
|
165
165
|
readonly payload: Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkBuilder.d.ts","sourceRoot":"","sources":["../../../src/useLinkBuilder.tsx"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wBAAgB,YAAY,WAWjB,MAAM,WAAW,MAAM,wBAmEjC;AAED;;GAEG;AACH,wBAAgB,cAAc,WAQnB,MAAM
|
|
1
|
+
{"version":3,"file":"useLinkBuilder.d.ts","sourceRoot":"","sources":["../../../src/useLinkBuilder.tsx"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wBAAgB,YAAY,WAWjB,MAAM,WAAW,MAAM,wBAmEjC;AAED;;GAEG;AACH,wBAAgB,cAAc,WAQnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;cApGX,CAAA;YACA,CAAA;aACF,CAAF;WAKc,CAAC;;;;;;;cAUH,CAAC;;;;;;;cAIuB,CAAC;;;;;;;cASjC,CAFD;;;;;;;;cAIK,CAAT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqFA;AAED;;;;GAIG;AACH,wBAAgB,cAAc;sBAxGnB,MAAM,WAAW,MAAM;wBAgFvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;kBApGX,CAAA;gBACA,CAAA;iBACF,CAAF;eAKc,CAAC;;;;;;;kBAUH,CAAC;;;;;;;kBAIuB,CAAC;;;;;;;kBASjC,CAFD;;;;;;;;kBAIK,CAAT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoGA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type NavigationAction, type NavigatorScreenParams, type ParamListForNavigator, type RootParamList } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
4
4
|
type LinkScreenTargetProps<ParamList extends {}, RouteName extends Extract<keyof ParamList, string> = Extract<keyof ParamList, string>> = RouteName extends unknown ? undefined extends ParamList[RouteName] ? {
|
|
5
5
|
href?: string | undefined;
|
|
6
6
|
action?: NavigationAction | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EAQrB,KAAK,qBAAqB,EAE1B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NavigationContainerRef, type ParamListBase } from '@react-navigation/core';
|
|
1
|
+
import { type NavigationContainerRef, type ParamListBase, type PartialState } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { LinkingOptions } from './types.js';
|
|
4
4
|
import type { Thenable } from './useThenable.js';
|
|
@@ -7,7 +7,7 @@ import type { Thenable } from './useThenable.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const series: (cb: () => Promise<void>) => () => void;
|
|
9
9
|
export declare function useLinking<ParamList extends ParamListBase>(ref: React.RefObject<NavigationContainerRef<ParamList> | null>, { enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: LinkingOptions<ParamList>): {
|
|
10
|
-
getInitialState: () => Thenable<
|
|
10
|
+
getInitialState: () => Thenable<PartialState<Readonly<{
|
|
11
11
|
key: string;
|
|
12
12
|
index: number;
|
|
13
13
|
routeNames: string[];
|
|
@@ -15,42 +15,6 @@ export declare function useLinking<ParamList extends ParamListBase>(ref: React.R
|
|
|
15
15
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
16
16
|
type: string;
|
|
17
17
|
stale: false;
|
|
18
|
-
}
|
|
19
|
-
stale?: true | undefined;
|
|
20
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
21
|
-
key: string;
|
|
22
|
-
name: string;
|
|
23
|
-
path?: string | undefined;
|
|
24
|
-
history?: {
|
|
25
|
-
type: "params";
|
|
26
|
-
params: Readonly<object | undefined>;
|
|
27
|
-
}[] | undefined;
|
|
28
|
-
} & {
|
|
29
|
-
params?: Readonly<object | undefined>;
|
|
30
|
-
}>>[];
|
|
31
|
-
}> & {
|
|
32
|
-
state?: (Partial<Omit<Readonly<{
|
|
33
|
-
key: string;
|
|
34
|
-
index: number;
|
|
35
|
-
routeNames: string[];
|
|
36
|
-
history?: unknown[] | undefined;
|
|
37
|
-
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
38
|
-
type: string;
|
|
39
|
-
stale: false;
|
|
40
|
-
}>, "stale" | "routes">> & Readonly<{
|
|
41
|
-
stale?: true | undefined;
|
|
42
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
43
|
-
key: string;
|
|
44
|
-
name: string;
|
|
45
|
-
path?: string | undefined;
|
|
46
|
-
history?: {
|
|
47
|
-
type: "params";
|
|
48
|
-
params: Readonly<object | undefined>;
|
|
49
|
-
}[] | undefined;
|
|
50
|
-
} & {
|
|
51
|
-
params?: Readonly<object | undefined>;
|
|
52
|
-
}>>[];
|
|
53
|
-
}> & /*elided*/ any) | undefined;
|
|
54
|
-
}) | undefined>;
|
|
18
|
+
}>> | undefined>;
|
|
55
19
|
};
|
|
56
20
|
//# sourceMappingURL=useLinking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useLinking.d.ts","sourceRoot":"","sources":["../../../src/useLinking.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAe,CAAC;AAkK9C;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC,eAW7C,CAAC;AAIF,wBAAgB,UAAU,CAAC,SAAS,SAAS,aAAa,EACxD,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,EAC9D,EACE,OAAc,EACd,MAAM,EACN,gBAA0C,EAC1C,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,cAAc,CAAC,SAAS,CAAC;;;;;;;;;;EAyf7B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type NavigationContainerRef, type ParamListBase } from '@react-navigation/core';
|
|
1
|
+
import { type NavigationContainerRef, type ParamListBase, type PartialState } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { LinkingOptions } from './types.js';
|
|
4
4
|
import type { Thenable } from './useThenable.js';
|
|
5
5
|
export declare function useLinking<ParamList extends ParamListBase>(ref: React.RefObject<NavigationContainerRef<ParamList> | null>, { enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState, }: LinkingOptions<ParamListBase>): {
|
|
6
|
-
getInitialState: () => Thenable<
|
|
6
|
+
getInitialState: () => Thenable<PartialState<Readonly<{
|
|
7
7
|
key: string;
|
|
8
8
|
index: number;
|
|
9
9
|
routeNames: string[];
|
|
@@ -11,43 +11,7 @@ export declare function useLinking<ParamList extends ParamListBase>(ref: React.R
|
|
|
11
11
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
12
12
|
type: string;
|
|
13
13
|
stale: false;
|
|
14
|
-
}
|
|
15
|
-
stale?: true | undefined;
|
|
16
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
17
|
-
key: string;
|
|
18
|
-
name: string;
|
|
19
|
-
path?: string | undefined;
|
|
20
|
-
history?: {
|
|
21
|
-
type: "params";
|
|
22
|
-
params: Readonly<object | undefined>;
|
|
23
|
-
}[] | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
params?: Readonly<object | undefined>;
|
|
26
|
-
}>>[];
|
|
27
|
-
}> & {
|
|
28
|
-
state?: (Partial<Omit<Readonly<{
|
|
29
|
-
key: string;
|
|
30
|
-
index: number;
|
|
31
|
-
routeNames: string[];
|
|
32
|
-
history?: unknown[] | undefined;
|
|
33
|
-
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
34
|
-
type: string;
|
|
35
|
-
stale: false;
|
|
36
|
-
}>, "stale" | "routes">> & Readonly<{
|
|
37
|
-
stale?: true | undefined;
|
|
38
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
39
|
-
key: string;
|
|
40
|
-
name: string;
|
|
41
|
-
path?: string | undefined;
|
|
42
|
-
history?: {
|
|
43
|
-
type: "params";
|
|
44
|
-
params: Readonly<object | undefined>;
|
|
45
|
-
}[] | undefined;
|
|
46
|
-
} & {
|
|
47
|
-
params?: Readonly<object | undefined>;
|
|
48
|
-
}>>[];
|
|
49
|
-
}> & /*elided*/ any) | undefined;
|
|
50
|
-
}) | undefined> | Promise<(Partial<Omit<Readonly<{
|
|
14
|
+
}>> | undefined> | Promise<PartialState<Readonly<{
|
|
51
15
|
key: string;
|
|
52
16
|
index: number;
|
|
53
17
|
routeNames: string[];
|
|
@@ -55,42 +19,6 @@ export declare function useLinking<ParamList extends ParamListBase>(ref: React.R
|
|
|
55
19
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
56
20
|
type: string;
|
|
57
21
|
stale: false;
|
|
58
|
-
}
|
|
59
|
-
stale?: true | undefined;
|
|
60
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
61
|
-
key: string;
|
|
62
|
-
name: string;
|
|
63
|
-
path?: string | undefined;
|
|
64
|
-
history?: {
|
|
65
|
-
type: "params";
|
|
66
|
-
params: Readonly<object | undefined>;
|
|
67
|
-
}[] | undefined;
|
|
68
|
-
} & {
|
|
69
|
-
params?: Readonly<object | undefined>;
|
|
70
|
-
}>>[];
|
|
71
|
-
}> & {
|
|
72
|
-
state?: (Partial<Omit<Readonly<{
|
|
73
|
-
key: string;
|
|
74
|
-
index: number;
|
|
75
|
-
routeNames: string[];
|
|
76
|
-
history?: unknown[] | undefined;
|
|
77
|
-
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
78
|
-
type: string;
|
|
79
|
-
stale: false;
|
|
80
|
-
}>, "stale" | "routes">> & Readonly<{
|
|
81
|
-
stale?: true | undefined;
|
|
82
|
-
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
83
|
-
key: string;
|
|
84
|
-
name: string;
|
|
85
|
-
path?: string | undefined;
|
|
86
|
-
history?: {
|
|
87
|
-
type: "params";
|
|
88
|
-
params: Readonly<object | undefined>;
|
|
89
|
-
}[] | undefined;
|
|
90
|
-
} & {
|
|
91
|
-
params?: Readonly<object | undefined>;
|
|
92
|
-
}>>[];
|
|
93
|
-
}> & /*elided*/ any) | undefined;
|
|
94
|
-
}) | undefined>;
|
|
22
|
+
}>> | undefined>;
|
|
95
23
|
};
|
|
96
24
|
//# sourceMappingURL=useLinking.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"useLinking.native.d.ts","sourceRoot":"","sources":["../../../src/useLinking.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAE3B,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAe,CAAC;AAI9C,wBAAgB,UAAU,CAAC,SAAS,SAAS,aAAa,EACxD,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,EAC9D,EACE,OAAc,EACd,QAAgB,EAChB,MAAM,EACN,MAAM,EACN,aAQI,EACJ,SAQC,EACD,gBAA0C,EAC1C,kBAA8C,GAC/C,EAAE,cAAc,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;EAiLjC"}
|
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": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.40",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"react-navigation",
|
|
@@ -62,17 +62,20 @@
|
|
|
62
62
|
"clean": "del lib"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@react-navigation/core": "^8.0.0-alpha.
|
|
65
|
+
"@react-navigation/core": "^8.0.0-alpha.31",
|
|
66
66
|
"escape-string-regexp": "^5.0.0",
|
|
67
67
|
"fast-deep-equal": "^3.1.3",
|
|
68
68
|
"nanoid": "^5.1.11",
|
|
69
69
|
"sf-symbols-typescript": "^2.2.0",
|
|
70
70
|
"standard-navigation": "^0.0.8",
|
|
71
|
-
"use-latest-callback": "^0.3.
|
|
71
|
+
"use-latest-callback": "^0.3.5"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@jest/globals": "^
|
|
74
|
+
"@jest/globals": "^30.4.1",
|
|
75
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
76
|
+
"@testing-library/react": "^16.3.2",
|
|
75
77
|
"@testing-library/react-native": "^14.0.0",
|
|
78
|
+
"@testing-library/user-event": "^14.6.1",
|
|
76
79
|
"@types/react": "~19.2.17",
|
|
77
80
|
"@types/react-dom": "~19.2.3",
|
|
78
81
|
"del-cli": "^7.0.0",
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"react-dom": "19.2.3",
|
|
81
84
|
"react-native": "0.85.3",
|
|
82
85
|
"react-native-builder-bob": "^0.43.0",
|
|
86
|
+
"react-native-web": "~0.21.2",
|
|
83
87
|
"test-renderer": "1.2.0",
|
|
84
88
|
"typescript": "^6.0.3"
|
|
85
89
|
},
|
|
@@ -127,5 +131,5 @@
|
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "f8dd4e8fa7b0c7ec159f9f58ab31660aca8f1bf6"
|
|
131
135
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type RootParamList, useTheme } from '@react-navigation/core';
|
|
2
|
+
import { type GestureResponderEvent, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line import-x/extensions
|
|
5
|
+
import type { Props } from './Link.tsx';
|
|
6
|
+
import { useLinkProps } from './useLinkProps';
|
|
7
|
+
|
|
8
|
+
export function Link<
|
|
9
|
+
ParamList extends {} = RootParamList,
|
|
10
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
11
|
+
keyof ParamList,
|
|
12
|
+
string
|
|
13
|
+
>,
|
|
14
|
+
>({
|
|
15
|
+
in: parent,
|
|
16
|
+
screen,
|
|
17
|
+
params,
|
|
18
|
+
action,
|
|
19
|
+
href,
|
|
20
|
+
style,
|
|
21
|
+
disabled,
|
|
22
|
+
children,
|
|
23
|
+
onPress,
|
|
24
|
+
id,
|
|
25
|
+
numberOfLines,
|
|
26
|
+
testID,
|
|
27
|
+
'aria-label': ariaLabel,
|
|
28
|
+
'aria-busy': ariaBusy,
|
|
29
|
+
'aria-expanded': ariaExpanded,
|
|
30
|
+
'aria-hidden': ariaHidden,
|
|
31
|
+
'aria-labelledby': ariaLabelledBy,
|
|
32
|
+
'aria-live': ariaLive,
|
|
33
|
+
}: Props<ParamList, RouteName>) {
|
|
34
|
+
// @ts-expect-error: destructuring loses the relationship between target props
|
|
35
|
+
const props = useLinkProps({ in: parent, screen, params, action, href });
|
|
36
|
+
|
|
37
|
+
// Keep usage of `useTheme` after `useLinkProps`
|
|
38
|
+
// This ensures proper error when used outside of navigation container
|
|
39
|
+
const { colors, fonts } = useTheme();
|
|
40
|
+
|
|
41
|
+
const onLinkPress = (e: GestureResponderEvent) => {
|
|
42
|
+
onPress?.(e);
|
|
43
|
+
|
|
44
|
+
// Let user prevent default behavior
|
|
45
|
+
if (!e.defaultPrevented) {
|
|
46
|
+
props.onPress(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Text
|
|
52
|
+
{...props}
|
|
53
|
+
aria-busy={ariaBusy}
|
|
54
|
+
aria-expanded={ariaExpanded}
|
|
55
|
+
aria-hidden={ariaHidden}
|
|
56
|
+
aria-label={ariaLabel}
|
|
57
|
+
accessibilityLabelledBy={ariaLabelledBy}
|
|
58
|
+
accessibilityLiveRegion={ariaLive === 'off' ? 'none' : ariaLive}
|
|
59
|
+
disabled={disabled}
|
|
60
|
+
id={id}
|
|
61
|
+
testID={testID}
|
|
62
|
+
numberOfLines={numberOfLines}
|
|
63
|
+
onPress={onLinkPress}
|
|
64
|
+
style={[{ color: colors.primary }, fonts.regular, style]}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</Text>
|
|
68
|
+
);
|
|
69
|
+
}
|