@react-navigation/native 8.0.0-alpha.11 → 8.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- package/ios/ReactNavigationCornerInsetView.h +14 -0
- package/ios/ReactNavigationCornerInsetView.mm +182 -0
- package/ios/ReactNavigationCornerInsetView.swift +193 -0
- package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
- package/ios/ReactNavigationCornerInsetViewState.h +19 -0
- package/lib/module/ServerContext.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +61 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +15 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +2 -23
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/typescript/src/ServerContext.d.ts +1 -1
- package/lib/typescript/src/ServerContext.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +40 -0
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/native/types.d.ts +21 -21
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +13 -13
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +54 -66
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +10 -10
- package/lib/typescript/src/useLinking.native.d.ts +20 -20
- package/package.json +12 -9
- package/src/ServerContext.tsx +6 -4
- package/src/index.tsx +5 -0
- package/src/native/CornerInset.ios.tsx +82 -0
- package/src/native/CornerInset.tsx +41 -0
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +32 -0
- package/src/native/types.tsx +26 -22
- package/src/types.tsx +38 -36
- package/src/useLinkBuilder.tsx +7 -1
- package/src/useLinkProps.tsx +5 -38
|
@@ -13,70 +13,64 @@ export declare function useBuildAction(): (href: string) => {
|
|
|
13
13
|
key: string;
|
|
14
14
|
index: number;
|
|
15
15
|
routeNames: string[];
|
|
16
|
-
history?: unknown[];
|
|
16
|
+
history?: unknown[] | undefined;
|
|
17
17
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
18
18
|
type: string;
|
|
19
19
|
stale: false;
|
|
20
20
|
}>>;
|
|
21
|
-
path?: string;
|
|
21
|
+
path?: string | undefined;
|
|
22
22
|
};
|
|
23
23
|
} | {
|
|
24
24
|
type: "GO_BACK";
|
|
25
|
-
source?: string;
|
|
26
|
-
target?: string;
|
|
25
|
+
source?: string | undefined;
|
|
26
|
+
target?: string | undefined;
|
|
27
27
|
} | {
|
|
28
28
|
type: "NAVIGATE";
|
|
29
29
|
payload: {
|
|
30
30
|
name: string;
|
|
31
|
-
params?: object;
|
|
32
|
-
path
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
|
-
? /**
|
|
37
|
-
* Helper to build a href for a screen based on the linking options.
|
|
38
|
-
*/: string;
|
|
39
|
-
merge?: boolean;
|
|
40
|
-
pop?: boolean;
|
|
31
|
+
params?: object | undefined;
|
|
32
|
+
path?: string | undefined;
|
|
33
|
+
merge?: boolean | undefined;
|
|
34
|
+
pop?: boolean | undefined;
|
|
41
35
|
};
|
|
42
|
-
source?: string;
|
|
43
|
-
target?: string;
|
|
36
|
+
source?: string | undefined;
|
|
37
|
+
target?: string | undefined;
|
|
44
38
|
} | {
|
|
45
39
|
type: "SET_PARAMS";
|
|
46
40
|
payload: {
|
|
47
|
-
params?: object;
|
|
41
|
+
params?: object | undefined;
|
|
48
42
|
};
|
|
49
|
-
source?: string;
|
|
50
|
-
target?: string;
|
|
43
|
+
source?: string | undefined;
|
|
44
|
+
target?: string | undefined;
|
|
51
45
|
} | {
|
|
52
46
|
type: "REPLACE_PARAMS";
|
|
53
47
|
payload: {
|
|
54
|
-
params?: object;
|
|
48
|
+
params?: object | undefined;
|
|
55
49
|
};
|
|
56
|
-
source?: string;
|
|
57
|
-
target?: string;
|
|
50
|
+
source?: string | undefined;
|
|
51
|
+
target?: string | undefined;
|
|
58
52
|
} | {
|
|
59
53
|
type: "PUSH_PARAMS";
|
|
60
54
|
payload: {
|
|
61
|
-
params?: object;
|
|
55
|
+
params?: object | undefined;
|
|
62
56
|
};
|
|
63
|
-
source?: string;
|
|
64
|
-
target?: string;
|
|
57
|
+
source?: string | undefined;
|
|
58
|
+
target?: string | undefined;
|
|
65
59
|
} | {
|
|
66
60
|
type: "PRELOAD";
|
|
67
61
|
payload: {
|
|
68
62
|
name: string;
|
|
69
|
-
params?: object;
|
|
63
|
+
params?: object | undefined;
|
|
70
64
|
};
|
|
71
|
-
source?: string;
|
|
72
|
-
target?: string;
|
|
65
|
+
source?: string | undefined;
|
|
66
|
+
target?: string | undefined;
|
|
73
67
|
} | {
|
|
74
68
|
readonly type: "RESET";
|
|
75
|
-
readonly payload:
|
|
69
|
+
readonly payload: Readonly<{
|
|
76
70
|
key: string;
|
|
77
71
|
index: number;
|
|
78
72
|
routeNames: string[];
|
|
79
|
-
history?: unknown[];
|
|
73
|
+
history?: unknown[] | undefined;
|
|
80
74
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
81
75
|
type: string;
|
|
82
76
|
stale: false;
|
|
@@ -84,7 +78,7 @@ export declare function useBuildAction(): (href: string) => {
|
|
|
84
78
|
key: string;
|
|
85
79
|
index: number;
|
|
86
80
|
routeNames: string[];
|
|
87
|
-
history?: unknown[];
|
|
81
|
+
history?: unknown[] | undefined;
|
|
88
82
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
89
83
|
type: string;
|
|
90
84
|
stale: false;
|
|
@@ -92,13 +86,13 @@ export declare function useBuildAction(): (href: string) => {
|
|
|
92
86
|
key: string;
|
|
93
87
|
index: number;
|
|
94
88
|
routeNames: string[];
|
|
95
|
-
history?: unknown[];
|
|
89
|
+
history?: unknown[] | undefined;
|
|
96
90
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
97
91
|
type: string;
|
|
98
92
|
stale: false;
|
|
99
93
|
}>, "routes"> & {
|
|
100
94
|
routes: Omit<import("@react-navigation/routers").Route<string>, "key">[];
|
|
101
|
-
})
|
|
95
|
+
});
|
|
102
96
|
};
|
|
103
97
|
/**
|
|
104
98
|
* Helpers to build href or action based on the linking options.
|
|
@@ -115,70 +109,64 @@ export declare function useLinkBuilder(): {
|
|
|
115
109
|
key: string;
|
|
116
110
|
index: number;
|
|
117
111
|
routeNames: string[];
|
|
118
|
-
history?: unknown[];
|
|
112
|
+
history?: unknown[] | undefined;
|
|
119
113
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
120
114
|
type: string;
|
|
121
115
|
stale: false;
|
|
122
116
|
}>>;
|
|
123
|
-
path?: string;
|
|
117
|
+
path?: string | undefined;
|
|
124
118
|
};
|
|
125
119
|
} | {
|
|
126
120
|
type: "GO_BACK";
|
|
127
|
-
source?: string;
|
|
128
|
-
target?: string;
|
|
121
|
+
source?: string | undefined;
|
|
122
|
+
target?: string | undefined;
|
|
129
123
|
} | {
|
|
130
124
|
type: "NAVIGATE";
|
|
131
125
|
payload: {
|
|
132
126
|
name: string;
|
|
133
|
-
params?: object;
|
|
134
|
-
path
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*/
|
|
138
|
-
? /**
|
|
139
|
-
* Helper to build a href for a screen based on the linking options.
|
|
140
|
-
*/: string;
|
|
141
|
-
merge?: boolean;
|
|
142
|
-
pop?: boolean;
|
|
127
|
+
params?: object | undefined;
|
|
128
|
+
path?: string | undefined;
|
|
129
|
+
merge?: boolean | undefined;
|
|
130
|
+
pop?: boolean | undefined;
|
|
143
131
|
};
|
|
144
|
-
source?: string;
|
|
145
|
-
target?: string;
|
|
132
|
+
source?: string | undefined;
|
|
133
|
+
target?: string | undefined;
|
|
146
134
|
} | {
|
|
147
135
|
type: "SET_PARAMS";
|
|
148
136
|
payload: {
|
|
149
|
-
params?: object;
|
|
137
|
+
params?: object | undefined;
|
|
150
138
|
};
|
|
151
|
-
source?: string;
|
|
152
|
-
target?: string;
|
|
139
|
+
source?: string | undefined;
|
|
140
|
+
target?: string | undefined;
|
|
153
141
|
} | {
|
|
154
142
|
type: "REPLACE_PARAMS";
|
|
155
143
|
payload: {
|
|
156
|
-
params?: object;
|
|
144
|
+
params?: object | undefined;
|
|
157
145
|
};
|
|
158
|
-
source?: string;
|
|
159
|
-
target?: string;
|
|
146
|
+
source?: string | undefined;
|
|
147
|
+
target?: string | undefined;
|
|
160
148
|
} | {
|
|
161
149
|
type: "PUSH_PARAMS";
|
|
162
150
|
payload: {
|
|
163
|
-
params?: object;
|
|
151
|
+
params?: object | undefined;
|
|
164
152
|
};
|
|
165
|
-
source?: string;
|
|
166
|
-
target?: string;
|
|
153
|
+
source?: string | undefined;
|
|
154
|
+
target?: string | undefined;
|
|
167
155
|
} | {
|
|
168
156
|
type: "PRELOAD";
|
|
169
157
|
payload: {
|
|
170
158
|
name: string;
|
|
171
|
-
params?: object;
|
|
159
|
+
params?: object | undefined;
|
|
172
160
|
};
|
|
173
|
-
source?: string;
|
|
174
|
-
target?: string;
|
|
161
|
+
source?: string | undefined;
|
|
162
|
+
target?: string | undefined;
|
|
175
163
|
} | {
|
|
176
164
|
readonly type: "RESET";
|
|
177
|
-
readonly payload:
|
|
165
|
+
readonly payload: Readonly<{
|
|
178
166
|
key: string;
|
|
179
167
|
index: number;
|
|
180
168
|
routeNames: string[];
|
|
181
|
-
history?: unknown[];
|
|
169
|
+
history?: unknown[] | undefined;
|
|
182
170
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
183
171
|
type: string;
|
|
184
172
|
stale: false;
|
|
@@ -186,7 +174,7 @@ export declare function useLinkBuilder(): {
|
|
|
186
174
|
key: string;
|
|
187
175
|
index: number;
|
|
188
176
|
routeNames: string[];
|
|
189
|
-
history?: unknown[];
|
|
177
|
+
history?: unknown[] | undefined;
|
|
190
178
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
191
179
|
type: string;
|
|
192
180
|
stale: false;
|
|
@@ -194,13 +182,13 @@ export declare function useLinkBuilder(): {
|
|
|
194
182
|
key: string;
|
|
195
183
|
index: number;
|
|
196
184
|
routeNames: string[];
|
|
197
|
-
history?: unknown[];
|
|
185
|
+
history?: unknown[] | undefined;
|
|
198
186
|
routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
|
|
199
187
|
type: string;
|
|
200
188
|
stale: false;
|
|
201
189
|
}>, "routes"> & {
|
|
202
190
|
routes: Omit<import("@react-navigation/routers").Route<string>, "key">[];
|
|
203
|
-
})
|
|
191
|
+
});
|
|
204
192
|
};
|
|
205
193
|
};
|
|
206
194
|
//# sourceMappingURL=useLinkBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkBuilder.d.ts","sourceRoot":"","sources":["../../../src/useLinkBuilder.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLinkBuilder.d.ts","sourceRoot":"","sources":["../../../src/useLinkBuilder.tsx"],"names":[],"mappings":"AAwBA;;GAEG;AACH,wBAAgB,YAAY,WAWjB,MAAM,WAAW,MAAM,wBAmEjC;AAED;;GAEG;AACH,wBAAgB,cAAc,WAOnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;cAlGX,CAAL;YAAkC,CAAC;aAMzB,CAAC;WAAkC,CAAC;;;;;;;cAUxB,CAAC;;;;;;;cAKhB,CAAA;;;;;;;cAMK,CAAC;;;;;;;;cAIJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFT;AAED;;;;GAIG;AACH,wBAAgB,cAAc;sBAvGnB,MAAM,WAAW,MAAM;wBA+EvB,MAAM;;;;;;;;;;;;;;;;;;;;;;;kBAlGX,CAAL;gBAAkC,CAAC;iBAMzB,CAAC;eAAkC,CAAC;;;;;;;kBAUxB,CAAC;;;;;;;kBAKhB,CAAA;;;;;;;kBAMK,CAAC;;;;;;;;kBAIJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmGT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"useLinkProps.d.ts","sourceRoot":"","sources":["../../../src/useLinkProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EAGrB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAIpE,MAAM,MAAM,SAAS,CACnB,SAAS,SAAS,EAAE,GAAG,aAAa,EACpC,SAAS,SAAS,MAAM,SAAS,GAAG,MAAM,SAAS,IAEjD,CAAC;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,GAAG,CAAC,SAAS,SAAS,OAAO,GAC1B,SAAS,SAAS,SAAS,CAAC,SAAS,CAAC,GACpC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GACpD;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,GACrD,KAAK,CAAC,CAAC,GACX;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEN;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,CAAC,SAAS,SAAS,EAAE,GAAG,aAAa,EAC1C,KAAK,CAAC,SAAS,SAAS,MAAM,SAAS,GAAG,MAAM,SAAS,EACzD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;;;kBAM3D,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,qBAAqB;EAuG9E"}
|
|
@@ -12,46 +12,46 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
12
12
|
key: string;
|
|
13
13
|
index: number;
|
|
14
14
|
routeNames: string[];
|
|
15
|
-
history?: unknown[];
|
|
15
|
+
history?: unknown[] | undefined;
|
|
16
16
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
17
17
|
type: string;
|
|
18
18
|
stale: false;
|
|
19
19
|
}>, "stale" | "routes">> & Readonly<{
|
|
20
|
-
stale?: true;
|
|
20
|
+
stale?: true | undefined;
|
|
21
21
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
22
22
|
key: string;
|
|
23
23
|
name: string;
|
|
24
|
-
path?: string;
|
|
24
|
+
path?: string | undefined;
|
|
25
25
|
history?: {
|
|
26
26
|
type: "params";
|
|
27
27
|
params: object;
|
|
28
|
-
}[];
|
|
28
|
+
}[] | undefined;
|
|
29
29
|
} & Readonly<{
|
|
30
30
|
params?: Readonly<object | undefined>;
|
|
31
31
|
}>>>[];
|
|
32
32
|
}> & {
|
|
33
|
-
state?: Partial<Omit<Readonly<{
|
|
33
|
+
state?: (Partial<Omit<Readonly<{
|
|
34
34
|
key: string;
|
|
35
35
|
index: number;
|
|
36
36
|
routeNames: string[];
|
|
37
|
-
history?: unknown[];
|
|
37
|
+
history?: unknown[] | undefined;
|
|
38
38
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
39
39
|
type: string;
|
|
40
40
|
stale: false;
|
|
41
41
|
}>, "stale" | "routes">> & Readonly<{
|
|
42
|
-
stale?: true;
|
|
42
|
+
stale?: true | undefined;
|
|
43
43
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
44
44
|
key: string;
|
|
45
45
|
name: string;
|
|
46
|
-
path?: string;
|
|
46
|
+
path?: string | undefined;
|
|
47
47
|
history?: {
|
|
48
48
|
type: "params";
|
|
49
49
|
params: object;
|
|
50
|
-
}[];
|
|
50
|
+
}[] | undefined;
|
|
51
51
|
} & Readonly<{
|
|
52
52
|
params?: Readonly<object | undefined>;
|
|
53
53
|
}>>>[];
|
|
54
|
-
}> & /*elided*/ any;
|
|
54
|
+
}> & /*elided*/ any) | undefined;
|
|
55
55
|
}) | undefined>;
|
|
56
56
|
};
|
|
57
57
|
export {};
|
|
@@ -8,90 +8,90 @@ export declare function useLinking(ref: React.RefObject<NavigationContainerRef<P
|
|
|
8
8
|
key: string;
|
|
9
9
|
index: number;
|
|
10
10
|
routeNames: string[];
|
|
11
|
-
history?: unknown[];
|
|
11
|
+
history?: unknown[] | undefined;
|
|
12
12
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
13
13
|
type: string;
|
|
14
14
|
stale: false;
|
|
15
15
|
}>, "stale" | "routes">> & Readonly<{
|
|
16
|
-
stale?: true;
|
|
16
|
+
stale?: true | undefined;
|
|
17
17
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
18
18
|
key: string;
|
|
19
19
|
name: string;
|
|
20
|
-
path?: string;
|
|
20
|
+
path?: string | undefined;
|
|
21
21
|
history?: {
|
|
22
22
|
type: "params";
|
|
23
23
|
params: object;
|
|
24
|
-
}[];
|
|
24
|
+
}[] | undefined;
|
|
25
25
|
} & Readonly<{
|
|
26
26
|
params?: Readonly<object | undefined>;
|
|
27
27
|
}>>>[];
|
|
28
28
|
}> & {
|
|
29
|
-
state?: Partial<Omit<Readonly<{
|
|
29
|
+
state?: (Partial<Omit<Readonly<{
|
|
30
30
|
key: string;
|
|
31
31
|
index: number;
|
|
32
32
|
routeNames: string[];
|
|
33
|
-
history?: unknown[];
|
|
33
|
+
history?: unknown[] | undefined;
|
|
34
34
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
35
35
|
type: string;
|
|
36
36
|
stale: false;
|
|
37
37
|
}>, "stale" | "routes">> & Readonly<{
|
|
38
|
-
stale?: true;
|
|
38
|
+
stale?: true | undefined;
|
|
39
39
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
40
40
|
key: string;
|
|
41
41
|
name: string;
|
|
42
|
-
path?: string;
|
|
42
|
+
path?: string | undefined;
|
|
43
43
|
history?: {
|
|
44
44
|
type: "params";
|
|
45
45
|
params: object;
|
|
46
|
-
}[];
|
|
46
|
+
}[] | undefined;
|
|
47
47
|
} & Readonly<{
|
|
48
48
|
params?: Readonly<object | undefined>;
|
|
49
49
|
}>>>[];
|
|
50
|
-
}> & /*elided*/ any;
|
|
50
|
+
}> & /*elided*/ any) | undefined;
|
|
51
51
|
}) | undefined> | Promise<(Partial<Omit<Readonly<{
|
|
52
52
|
key: string;
|
|
53
53
|
index: number;
|
|
54
54
|
routeNames: string[];
|
|
55
|
-
history?: unknown[];
|
|
55
|
+
history?: unknown[] | undefined;
|
|
56
56
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
57
57
|
type: string;
|
|
58
58
|
stale: false;
|
|
59
59
|
}>, "stale" | "routes">> & Readonly<{
|
|
60
|
-
stale?: true;
|
|
60
|
+
stale?: true | undefined;
|
|
61
61
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
62
62
|
key: string;
|
|
63
63
|
name: string;
|
|
64
|
-
path?: string;
|
|
64
|
+
path?: string | undefined;
|
|
65
65
|
history?: {
|
|
66
66
|
type: "params";
|
|
67
67
|
params: object;
|
|
68
|
-
}[];
|
|
68
|
+
}[] | undefined;
|
|
69
69
|
} & Readonly<{
|
|
70
70
|
params?: Readonly<object | undefined>;
|
|
71
71
|
}>>>[];
|
|
72
72
|
}> & {
|
|
73
|
-
state?: Partial<Omit<Readonly<{
|
|
73
|
+
state?: (Partial<Omit<Readonly<{
|
|
74
74
|
key: string;
|
|
75
75
|
index: number;
|
|
76
76
|
routeNames: string[];
|
|
77
|
-
history?: unknown[];
|
|
77
|
+
history?: unknown[] | undefined;
|
|
78
78
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
79
79
|
type: string;
|
|
80
80
|
stale: false;
|
|
81
81
|
}>, "stale" | "routes">> & Readonly<{
|
|
82
|
-
stale?: true;
|
|
82
|
+
stale?: true | undefined;
|
|
83
83
|
routes: import("@react-navigation/routers").PartialRoute<Readonly<{
|
|
84
84
|
key: string;
|
|
85
85
|
name: string;
|
|
86
|
-
path?: string;
|
|
86
|
+
path?: string | undefined;
|
|
87
87
|
history?: {
|
|
88
88
|
type: "params";
|
|
89
89
|
params: object;
|
|
90
|
-
}[];
|
|
90
|
+
}[] | undefined;
|
|
91
91
|
} & Readonly<{
|
|
92
92
|
params?: Readonly<object | undefined>;
|
|
93
93
|
}>>>[];
|
|
94
|
-
}> & /*elided*/ any;
|
|
94
|
+
}> & /*elided*/ any) | undefined;
|
|
95
95
|
}) | undefined>;
|
|
96
96
|
};
|
|
97
97
|
export {};
|
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.12",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"react-navigation",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"clean": "del lib"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@react-navigation/core": "^8.0.0-alpha.
|
|
60
|
+
"@react-navigation/core": "^8.0.0-alpha.5",
|
|
61
61
|
"escape-string-regexp": "^4.0.0",
|
|
62
62
|
"fast-deep-equal": "^3.1.3",
|
|
63
63
|
"nanoid": "^3.3.11",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@jest/globals": "^30.0.0",
|
|
69
|
-
"@testing-library/react-native": "^13.
|
|
70
|
-
"@types/react": "~19.
|
|
69
|
+
"@testing-library/react-native": "^13.3.3",
|
|
70
|
+
"@types/react": "~19.2.2",
|
|
71
71
|
"@types/react-dom": "~19.1.7",
|
|
72
72
|
"del-cli": "^6.0.0",
|
|
73
|
-
"react": "19.
|
|
74
|
-
"react-dom": "19.
|
|
75
|
-
"react-native": "0.
|
|
73
|
+
"react": "19.2.0",
|
|
74
|
+
"react-dom": "19.2.0",
|
|
75
|
+
"react-native": "0.83.2",
|
|
76
76
|
"react-native-builder-bob": "^0.40.12",
|
|
77
|
-
"react-test-renderer": "19.
|
|
77
|
+
"react-test-renderer": "19.2.0",
|
|
78
78
|
"typescript": "^5.9.2"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -114,9 +114,12 @@
|
|
|
114
114
|
"components": {
|
|
115
115
|
"ReactNavigationSFSymbolView": {
|
|
116
116
|
"className": "ReactNavigationSFSymbolView"
|
|
117
|
+
},
|
|
118
|
+
"ReactNavigationCornerInsetView": {
|
|
119
|
+
"className": "ReactNavigationCornerInsetView"
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
},
|
|
121
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "4ac6c41c1f751fba9dd82db050865bc71f3310f5"
|
|
122
125
|
}
|
package/src/ServerContext.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
export type ServerContextType = {
|
|
4
|
-
location?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
location?:
|
|
5
|
+
| {
|
|
6
|
+
pathname: string;
|
|
7
|
+
search: string;
|
|
8
|
+
}
|
|
9
|
+
| undefined;
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
export const ServerContext = React.createContext<ServerContextType | undefined>(
|
package/src/index.tsx
CHANGED
|
@@ -2,6 +2,11 @@ export { createStaticNavigation } from './createStaticNavigation';
|
|
|
2
2
|
export { Link } from './Link';
|
|
3
3
|
export { LinkingContext } from './LinkingContext';
|
|
4
4
|
export { LocaleDirContext } from './LocaleDirContext';
|
|
5
|
+
export {
|
|
6
|
+
type CornerInsetProps,
|
|
7
|
+
type CornerInsetRef,
|
|
8
|
+
CornerInset as UNSTABLE_CornerInset,
|
|
9
|
+
} from './native/CornerInset';
|
|
5
10
|
export {
|
|
6
11
|
MaterialSymbol,
|
|
7
12
|
type MaterialSymbolProps,
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { NavigationContainerRefContext } from '@react-navigation/core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dimensions } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line import-x/extensions
|
|
6
|
+
import type { CornerInsetProps, CornerInsetRef } from './CornerInset.tsx';
|
|
7
|
+
import ReactNavigationCornerInsetViewNativeComponent, {
|
|
8
|
+
Commands,
|
|
9
|
+
} from './ReactNavigationCornerInsetViewNativeComponent';
|
|
10
|
+
|
|
11
|
+
function CornerInsetIOS(
|
|
12
|
+
props: CornerInsetProps,
|
|
13
|
+
ref: React.Ref<CornerInsetRef>
|
|
14
|
+
) {
|
|
15
|
+
const root = React.use(NavigationContainerRefContext);
|
|
16
|
+
|
|
17
|
+
const nativeRef =
|
|
18
|
+
React.useRef<
|
|
19
|
+
React.ElementRef<typeof ReactNavigationCornerInsetViewNativeComponent>
|
|
20
|
+
>(null);
|
|
21
|
+
|
|
22
|
+
const relayout = React.useCallback(() => {
|
|
23
|
+
if (nativeRef.current) {
|
|
24
|
+
Commands.relayout(nativeRef.current);
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (root == null) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let animationFrameHandle: number | null = null;
|
|
34
|
+
|
|
35
|
+
// We freeze the corner insets after initial measurements
|
|
36
|
+
// This is to avoid the insets getting out of sync during transitions
|
|
37
|
+
// We trigger a relayout explicitly on window resize and transition end
|
|
38
|
+
const unsubscribeWindowResize = Dimensions.addEventListener(
|
|
39
|
+
'change',
|
|
40
|
+
() => {
|
|
41
|
+
if (animationFrameHandle) {
|
|
42
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// When window is unmaximized, calling relayout immediately doesn't work
|
|
46
|
+
// So we delay it to the next frame as a workaround
|
|
47
|
+
animationFrameHandle = requestAnimationFrame(() => {
|
|
48
|
+
relayout();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const unsubscribeTransition = root.addListener('__unsafe_event__', (e) => {
|
|
54
|
+
if (e.data.type === 'transitionEnd') {
|
|
55
|
+
relayout();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
if (animationFrameHandle) {
|
|
61
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
unsubscribeWindowResize.remove();
|
|
65
|
+
unsubscribeTransition();
|
|
66
|
+
};
|
|
67
|
+
}, [root, relayout]);
|
|
68
|
+
|
|
69
|
+
React.useImperativeHandle(
|
|
70
|
+
ref,
|
|
71
|
+
() => ({
|
|
72
|
+
relayout,
|
|
73
|
+
}),
|
|
74
|
+
[relayout]
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<ReactNavigationCornerInsetViewNativeComponent {...props} ref={nativeRef} />
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const CornerInset = React.forwardRef(CornerInsetIOS);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type CornerInsetProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The direction of the content that should be inset.
|
|
7
|
+
*/
|
|
8
|
+
direction: 'vertical' | 'horizontal';
|
|
9
|
+
/**
|
|
10
|
+
* The edge where the inset should be applied.
|
|
11
|
+
*/
|
|
12
|
+
edge: 'top' | 'right' | 'bottom' | 'left';
|
|
13
|
+
/**
|
|
14
|
+
* Whether to collapse to 0 when corner inset matches the baseline inset.
|
|
15
|
+
* e.g. it will be 0 for corners without traffic lights on iPadOS.
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
adaptive?: boolean;
|
|
20
|
+
} & React.ComponentProps<typeof View>;
|
|
21
|
+
|
|
22
|
+
export type CornerInsetRef = {
|
|
23
|
+
relayout(): void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function CornerInsetBase(
|
|
27
|
+
props: CornerInsetProps,
|
|
28
|
+
ref: React.Ref<CornerInsetRef>
|
|
29
|
+
) {
|
|
30
|
+
React.useImperativeHandle(
|
|
31
|
+
ref,
|
|
32
|
+
() => ({
|
|
33
|
+
relayout() {},
|
|
34
|
+
}),
|
|
35
|
+
[]
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return <View {...props} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const CornerInset = React.forwardRef(CornerInsetBase);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable import-x/no-default-export */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
codegenNativeCommands,
|
|
5
|
+
codegenNativeComponent,
|
|
6
|
+
CodegenTypes,
|
|
7
|
+
type HostComponent,
|
|
8
|
+
type ViewProps,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
|
|
11
|
+
export interface NativeProps extends ViewProps {
|
|
12
|
+
direction?: CodegenTypes.WithDefault<'vertical' | 'horizontal', 'vertical'>;
|
|
13
|
+
edge?: CodegenTypes.WithDefault<'top' | 'right' | 'bottom' | 'left', 'top'>;
|
|
14
|
+
adaptive?: CodegenTypes.WithDefault<boolean, true>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface NativeCommands {
|
|
18
|
+
// FIXME: codegen fails with ComponentRef
|
|
19
|
+
// so we currently use the deprecated ElementRef
|
|
20
|
+
relayout(viewRef: React.ElementRef<HostComponent<NativeProps>>): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
24
|
+
supportedCommands: ['relayout'],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default codegenNativeComponent<NativeProps>(
|
|
28
|
+
'ReactNavigationCornerInsetView',
|
|
29
|
+
{
|
|
30
|
+
interfaceOnly: true,
|
|
31
|
+
}
|
|
32
|
+
) as HostComponent<NativeProps>;
|