@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
package/src/__stubs__/window.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
let location = new URL('', 'http://example.com');
|
|
2
|
-
|
|
3
|
-
let listeners: (() => void)[] = [];
|
|
4
|
-
let entries = [{ state: null, href: location.href }];
|
|
5
|
-
let index = 0;
|
|
6
|
-
|
|
7
|
-
let currentState: any = null;
|
|
8
|
-
|
|
9
|
-
const history = {
|
|
10
|
-
get state() {
|
|
11
|
-
return currentState;
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
pushState(state: any, _: string, path: string) {
|
|
15
|
-
location = new URL(path, location.origin);
|
|
16
|
-
|
|
17
|
-
currentState = state;
|
|
18
|
-
entries = entries.slice(0, index + 1);
|
|
19
|
-
entries.push({ state, href: location.href });
|
|
20
|
-
index = entries.length - 1;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
replaceState(state: any, _: string, path: string) {
|
|
24
|
-
location = new URL(path, location.origin);
|
|
25
|
-
|
|
26
|
-
currentState = state;
|
|
27
|
-
entries[index] = { state, href: location.href };
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
go(n: number) {
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
if (
|
|
33
|
-
(n > 0 && n < entries.length - index) ||
|
|
34
|
-
(n < 0 && Math.abs(n) <= index)
|
|
35
|
-
) {
|
|
36
|
-
index += n;
|
|
37
|
-
const entry = entries[index];
|
|
38
|
-
|
|
39
|
-
if (entry == null) {
|
|
40
|
-
throw new Error(`Couldn't find a history entry at index ${index}.`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
location = new URL(entry.href);
|
|
44
|
-
currentState = entry.state;
|
|
45
|
-
listeners.forEach((cb) => cb());
|
|
46
|
-
}
|
|
47
|
-
}, 0);
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
back() {
|
|
51
|
-
this.go(-1);
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
forward() {
|
|
55
|
-
this.go(1);
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const addEventListener = (type: 'popstate', listener: () => void) => {
|
|
60
|
-
if (type === 'popstate') {
|
|
61
|
-
listeners.push(listener);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const removeEventListener = (type: 'popstate', listener: () => void) => {
|
|
66
|
-
if (type === 'popstate') {
|
|
67
|
-
listeners = listeners.filter((cb) => cb !== listener);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const window = {
|
|
72
|
-
document: { title: '' },
|
|
73
|
-
get location() {
|
|
74
|
-
return location;
|
|
75
|
-
},
|
|
76
|
-
history,
|
|
77
|
-
addEventListener,
|
|
78
|
-
removeEventListener,
|
|
79
|
-
get window() {
|
|
80
|
-
return window;
|
|
81
|
-
},
|
|
82
|
-
};
|