expo-navigation-bar 4.2.0 → 4.2.1
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/CHANGELOG.md +4 -0
- package/android/build.gradle +2 -2
- package/build/ExpoNavigationBar.d.ts +18 -1
- package/build/ExpoNavigationBar.d.ts.map +1 -1
- package/build/ExpoNavigationBar.js.map +1 -1
- package/build/NavigationBar.android.d.ts +19 -0
- package/build/NavigationBar.android.d.ts.map +1 -0
- package/build/NavigationBar.android.js +140 -0
- package/build/NavigationBar.android.js.map +1 -0
- package/build/NavigationBar.d.ts +182 -7
- package/build/NavigationBar.d.ts.map +1 -1
- package/build/NavigationBar.js +221 -42
- package/build/NavigationBar.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.module → 4.2.1/expo.modules.navigationbar-4.2.1.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.pom → 4.2.1/expo.modules.navigationbar-4.2.1.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.1/expo.modules.navigationbar-4.2.1.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/ExpoNavigationBar.ts +35 -1
- package/src/NavigationBar.android.ts +191 -0
- package/src/NavigationBar.ts +245 -51
- package/build/NativeNavigationBarWrapper.d.ts +0 -178
- package/build/NativeNavigationBarWrapper.d.ts.map +0 -1
- package/build/NativeNavigationBarWrapper.js +0 -316
- package/build/NativeNavigationBarWrapper.js.map +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/4.2.0/expo.modules.navigationbar-4.2.0.pom.sha512 +0 -1
- package/src/NativeNavigationBarWrapper.ts +0 -366
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0-sources.jar → 4.2.1/expo.modules.navigationbar-4.2.1-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.md5 → 4.2.1/expo.modules.navigationbar-4.2.1-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha1 → 4.2.1/expo.modules.navigationbar-4.2.1-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha256 → 4.2.1/expo.modules.navigationbar-4.2.1-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0-sources.jar.sha512 → 4.2.1/expo.modules.navigationbar-4.2.1-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.aar → 4.2.1/expo.modules.navigationbar-4.2.1.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.aar.md5 → 4.2.1/expo.modules.navigationbar-4.2.1.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.aar.sha1 → 4.2.1/expo.modules.navigationbar-4.2.1.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.aar.sha256 → 4.2.1/expo.modules.navigationbar-4.2.1.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/{4.2.0/expo.modules.navigationbar-4.2.0.aar.sha512 → 4.2.1/expo.modules.navigationbar-4.2.1.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 4.2.1 — 2025-04-23
|
|
14
|
+
|
|
15
|
+
- Make `NavigationBar` methods no-op when edge-to-edge is enabled. ([#36330](https://github.com/expo/expo/pull/36330) by [@zoontek](https://github.com/zoontek))
|
|
16
|
+
|
|
13
17
|
## 4.2.0 — 2025-04-21
|
|
14
18
|
|
|
15
19
|
### 🎉 New features
|
package/android/build.gradle
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import type { EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { processColor } from 'react-native';
|
|
3
|
+
import type { NavigationBarBehavior, NavigationBarButtonStyle, NavigationBarPosition, NavigationBarVisibility, NavigationBarVisibilityEvent } from './NavigationBar.types';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
addListener: (event: "ExpoNavigationBar.didChange", listener: (event: NavigationBarVisibilityEvent) => void) => EventSubscription;
|
|
6
|
+
setBackgroundColorAsync: (color: ReturnType<typeof processColor>) => Promise<void>;
|
|
7
|
+
getBackgroundColorAsync: () => Promise<string>;
|
|
8
|
+
setBehaviorAsync: (behavior: NavigationBarBehavior) => Promise<void>;
|
|
9
|
+
getBehaviorAsync: () => Promise<NavigationBarBehavior>;
|
|
10
|
+
setBorderColorAsync: (color: ReturnType<typeof processColor>) => Promise<void>;
|
|
11
|
+
getBorderColorAsync: () => Promise<string>;
|
|
12
|
+
setButtonStyleAsync: (style: NavigationBarButtonStyle) => Promise<void>;
|
|
13
|
+
getButtonStyleAsync: () => Promise<NavigationBarButtonStyle>;
|
|
14
|
+
setPositionAsync: (position: NavigationBarPosition) => Promise<void>;
|
|
15
|
+
unstable_getPositionAsync: () => Promise<NavigationBarPosition>;
|
|
16
|
+
setVisibilityAsync: (visibility: NavigationBarVisibility) => Promise<void>;
|
|
17
|
+
getVisibilityAsync: () => Promise<NavigationBarVisibility>;
|
|
18
|
+
};
|
|
2
19
|
export default _default;
|
|
3
20
|
//# sourceMappingURL=ExpoNavigationBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoNavigationBar.d.ts","sourceRoot":"","sources":["../src/ExpoNavigationBar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoNavigationBar.d.ts","sourceRoot":"","sources":["../src/ExpoNavigationBar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;wBAEV;IACnB,WAAW,EAAE,CACX,KAAK,EAAE,6BAA6B,EACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,IAAI,KACpD,iBAAiB,CAAC;IAEvB,uBAAuB,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,uBAAuB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,gBAAgB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEvD,mBAAmB,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,mBAAmB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C,mBAAmB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,mBAAmB,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAE7D,gBAAgB,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,yBAAyB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEhE,kBAAkB,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,kBAAkB,EAAE,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC5D;AAvBD,wBAuBE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoNavigationBar.js","sourceRoot":"","sources":["../src/ExpoNavigationBar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoNavigationBar.js","sourceRoot":"","sources":["../src/ExpoNavigationBar.ts"],"names":[],"mappings":"AAWA,eAAe,EAuBd,CAAC","sourcesContent":["import type { EventSubscription } from 'expo-modules-core';\nimport type { processColor } from 'react-native';\n\nimport type {\n NavigationBarBehavior,\n NavigationBarButtonStyle,\n NavigationBarPosition,\n NavigationBarVisibility,\n NavigationBarVisibilityEvent,\n} from './NavigationBar.types';\n\nexport default {} as {\n addListener: (\n event: 'ExpoNavigationBar.didChange',\n listener: (event: NavigationBarVisibilityEvent) => void\n ) => EventSubscription;\n\n setBackgroundColorAsync: (color: ReturnType<typeof processColor>) => Promise<void>;\n getBackgroundColorAsync: () => Promise<string>;\n\n setBehaviorAsync: (behavior: NavigationBarBehavior) => Promise<void>;\n getBehaviorAsync: () => Promise<NavigationBarBehavior>;\n\n setBorderColorAsync: (color: ReturnType<typeof processColor>) => Promise<void>;\n getBorderColorAsync: () => Promise<string>;\n\n setButtonStyleAsync: (style: NavigationBarButtonStyle) => Promise<void>;\n getButtonStyleAsync: () => Promise<NavigationBarButtonStyle>;\n\n setPositionAsync: (position: NavigationBarPosition) => Promise<void>;\n unstable_getPositionAsync: () => Promise<NavigationBarPosition>;\n\n setVisibilityAsync: (visibility: NavigationBarVisibility) => Promise<void>;\n getVisibilityAsync: () => Promise<NavigationBarVisibility>;\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { NavigationBarBehavior, NavigationBarButtonStyle, NavigationBarPosition, NavigationBarStyle, NavigationBarVisibility, NavigationBarVisibilityEvent } from './NavigationBar.types';
|
|
3
|
+
export declare function addVisibilityListener(listener: (event: NavigationBarVisibilityEvent) => void): EventSubscription;
|
|
4
|
+
export declare function setBackgroundColorAsync(color: string): Promise<void>;
|
|
5
|
+
export declare function getBackgroundColorAsync(): Promise<string>;
|
|
6
|
+
export declare function setBorderColorAsync(color: string): Promise<void>;
|
|
7
|
+
export declare function getBorderColorAsync(): Promise<string>;
|
|
8
|
+
export declare function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<void>;
|
|
9
|
+
export declare function getVisibilityAsync(): Promise<NavigationBarVisibility>;
|
|
10
|
+
export declare function setButtonStyleAsync(style: NavigationBarButtonStyle): Promise<void>;
|
|
11
|
+
export declare function getButtonStyleAsync(): Promise<NavigationBarButtonStyle>;
|
|
12
|
+
export declare function setPositionAsync(position: NavigationBarPosition): Promise<void>;
|
|
13
|
+
export declare function unstable_getPositionAsync(): Promise<NavigationBarPosition>;
|
|
14
|
+
export declare function setBehaviorAsync(behavior: NavigationBarBehavior): Promise<void>;
|
|
15
|
+
export declare function getBehaviorAsync(): Promise<NavigationBarBehavior>;
|
|
16
|
+
export declare function setStyle(style: NavigationBarStyle): void;
|
|
17
|
+
export declare function useVisibility(): NavigationBarVisibility | null;
|
|
18
|
+
export * from './NavigationBar.types';
|
|
19
|
+
//# sourceMappingURL=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,CAOrF;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAOvE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,QASjD;AAED,wBAAgB,aAAa,IAAI,uBAAuB,GAAG,IAAI,CA8B9D;AAED,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { processColor } from 'react-native';
|
|
3
|
+
import { isEdgeToEdge } from 'react-native-is-edge-to-edge';
|
|
4
|
+
import ExpoNavigationBar from './ExpoNavigationBar';
|
|
5
|
+
// This line only imports the type information for TypeScript type checking. It
|
|
6
|
+
// doesn't import the actual module in the compiled JavaScript code. The actual
|
|
7
|
+
// module is imported conditionally with require() below, in order to avoid
|
|
8
|
+
// importing the module if edge-to-edge is not enabled (which could throw if
|
|
9
|
+
// it's not linked).
|
|
10
|
+
let SystemBars = null;
|
|
11
|
+
if (isEdgeToEdge()) {
|
|
12
|
+
SystemBars = require('react-native-edge-to-edge').SystemBars;
|
|
13
|
+
}
|
|
14
|
+
export function addVisibilityListener(listener) {
|
|
15
|
+
if (SystemBars != null) {
|
|
16
|
+
console.warn('`addVisibilityListener` is not supported with edge-to-edge enabled.');
|
|
17
|
+
return { remove: () => { } };
|
|
18
|
+
}
|
|
19
|
+
return ExpoNavigationBar.addListener('ExpoNavigationBar.didChange', listener);
|
|
20
|
+
}
|
|
21
|
+
export async function setBackgroundColorAsync(color) {
|
|
22
|
+
if (SystemBars != null) {
|
|
23
|
+
console.warn('`setBackgroundColorAsync` is not supported with edge-to-edge enabled.');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const colorNumber = processColor(color);
|
|
27
|
+
await ExpoNavigationBar.setBackgroundColorAsync(colorNumber);
|
|
28
|
+
}
|
|
29
|
+
export async function getBackgroundColorAsync() {
|
|
30
|
+
if (SystemBars != null) {
|
|
31
|
+
console.warn('`getBackgroundColorAsync` is not supported with edge-to-edge enabled.');
|
|
32
|
+
return `#00000000`;
|
|
33
|
+
}
|
|
34
|
+
return await ExpoNavigationBar.getBackgroundColorAsync();
|
|
35
|
+
}
|
|
36
|
+
export async function setBorderColorAsync(color) {
|
|
37
|
+
if (SystemBars != null) {
|
|
38
|
+
console.warn('`setBorderColorAsync` is not supported with edge-to-edge enabled.');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const colorNumber = processColor(color);
|
|
42
|
+
await ExpoNavigationBar.setBorderColorAsync(colorNumber);
|
|
43
|
+
}
|
|
44
|
+
export async function getBorderColorAsync() {
|
|
45
|
+
if (SystemBars != null) {
|
|
46
|
+
console.warn('`getBorderColorAsync` is not supported with edge-to-edge enabled.');
|
|
47
|
+
return `#00000000`;
|
|
48
|
+
}
|
|
49
|
+
return await ExpoNavigationBar.getBorderColorAsync();
|
|
50
|
+
}
|
|
51
|
+
export async function setVisibilityAsync(visibility) {
|
|
52
|
+
if (SystemBars != null) {
|
|
53
|
+
SystemBars.setHidden({ navigationBar: visibility === 'hidden' });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
await ExpoNavigationBar.setVisibilityAsync(visibility);
|
|
57
|
+
}
|
|
58
|
+
export async function getVisibilityAsync() {
|
|
59
|
+
if (SystemBars != null) {
|
|
60
|
+
console.warn('`getVisibilityAsync` is not supported with edge-to-edge enabled.');
|
|
61
|
+
return 'hidden';
|
|
62
|
+
}
|
|
63
|
+
return ExpoNavigationBar.getVisibilityAsync();
|
|
64
|
+
}
|
|
65
|
+
export async function setButtonStyleAsync(style) {
|
|
66
|
+
if (SystemBars != null) {
|
|
67
|
+
SystemBars.setStyle({ navigationBar: style });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await ExpoNavigationBar.setButtonStyleAsync(style);
|
|
71
|
+
}
|
|
72
|
+
export async function getButtonStyleAsync() {
|
|
73
|
+
if (SystemBars != null) {
|
|
74
|
+
console.warn('`getButtonStyleAsync` is not supported with edge-to-edge enabled.');
|
|
75
|
+
return 'light';
|
|
76
|
+
}
|
|
77
|
+
return await ExpoNavigationBar.getButtonStyleAsync();
|
|
78
|
+
}
|
|
79
|
+
export async function setPositionAsync(position) {
|
|
80
|
+
if (SystemBars != null) {
|
|
81
|
+
console.warn('`setPositionAsync` is not supported with edge-to-edge enabled.');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
await ExpoNavigationBar.setPositionAsync(position);
|
|
85
|
+
}
|
|
86
|
+
export async function unstable_getPositionAsync() {
|
|
87
|
+
if (SystemBars != null) {
|
|
88
|
+
console.warn('`unstable_getPositionAsync` is not supported with edge-to-edge enabled.');
|
|
89
|
+
return 'relative';
|
|
90
|
+
}
|
|
91
|
+
return await ExpoNavigationBar.unstable_getPositionAsync();
|
|
92
|
+
}
|
|
93
|
+
export async function setBehaviorAsync(behavior) {
|
|
94
|
+
if (SystemBars != null) {
|
|
95
|
+
console.warn('`setBehaviorAsync` is not supported with edge-to-edge enabled.');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
await ExpoNavigationBar.setBehaviorAsync(behavior);
|
|
99
|
+
}
|
|
100
|
+
export async function getBehaviorAsync() {
|
|
101
|
+
if (SystemBars != null) {
|
|
102
|
+
console.warn('`getBehaviorAsync` is not supported with edge-to-edge enabled.');
|
|
103
|
+
return 'inset-touch';
|
|
104
|
+
}
|
|
105
|
+
return await ExpoNavigationBar.getBehaviorAsync();
|
|
106
|
+
}
|
|
107
|
+
export function setStyle(style) {
|
|
108
|
+
if (SystemBars != null) {
|
|
109
|
+
SystemBars.setStyle({ navigationBar: style });
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
throw new Error('`setStyle` is only supported on Android when edge-to-edge is enabled. Enable edge-to-edge or use the `setButtonStyle` function instead.');
|
|
113
|
+
}
|
|
114
|
+
export function useVisibility() {
|
|
115
|
+
const [visibility, setVisible] = useState(null);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (SystemBars != null) {
|
|
118
|
+
console.warn('`useVisibility` is not supported with edge-to-edge enabled.');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
let isMounted = true;
|
|
122
|
+
getVisibilityAsync().then((visibility) => {
|
|
123
|
+
if (isMounted) {
|
|
124
|
+
setVisible(visibility);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const listener = addVisibilityListener(({ visibility }) => {
|
|
128
|
+
if (isMounted) {
|
|
129
|
+
setVisible(visibility);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return () => {
|
|
133
|
+
listener.remove();
|
|
134
|
+
isMounted = false;
|
|
135
|
+
};
|
|
136
|
+
}, []);
|
|
137
|
+
return visibility;
|
|
138
|
+
}
|
|
139
|
+
export * from './NavigationBar.types';
|
|
140
|
+
//# sourceMappingURL=NavigationBar.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationBar.android.js","sourceRoot":"","sources":["../src/NavigationBar.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAUpD,gFAAgF;AAChF,gFAAgF;AAChF,2EAA2E;AAC3E,4EAA4E;AAC5E,oBAAoB;AACpB,IAAI,UAAU,GAAiE,IAAI,CAAC;AAEpF,IAAI,YAAY,EAAE,EAAE,CAAC;IACnB,UAAU,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC,UAAU,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,QAAuD;IAEvD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;QACpF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE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AAE,CAAC;gBACd,UAAU,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,qBAAqB,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;YACxD,IAAI,SAAS,EAAE,CAAC;gBACd,UAAU,CAAC,UAAU,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,cAAc,uBAAuB,CAAC","sourcesContent":["import { type EventSubscription } from 'expo-modules-core';\nimport { useEffect, useState } from 'react';\nimport { processColor } from 'react-native';\nimport { isEdgeToEdge } from 'react-native-is-edge-to-edge';\n\nimport ExpoNavigationBar from './ExpoNavigationBar';\nimport type {\n NavigationBarBehavior,\n NavigationBarButtonStyle,\n NavigationBarPosition,\n NavigationBarStyle,\n NavigationBarVisibility,\n NavigationBarVisibilityEvent,\n} from './NavigationBar.types';\n\n// This line only imports the type information for TypeScript type checking. It\n// doesn't import the actual module in the compiled JavaScript code. The actual\n// module is imported conditionally with require() below, in order to avoid\n// importing the module if edge-to-edge is not enabled (which could throw if\n// it's not linked).\nlet SystemBars: typeof import('react-native-edge-to-edge').SystemBars | null = null;\n\nif (isEdgeToEdge()) {\n SystemBars = require('react-native-edge-to-edge').SystemBars;\n}\n\nexport function addVisibilityListener(\n listener: (event: NavigationBarVisibilityEvent) => void\n): EventSubscription {\n if (SystemBars != null) {\n console.warn('`addVisibilityListener` is not supported with edge-to-edge enabled.');\n return { remove: () => {} };\n }\n\n return ExpoNavigationBar.addListener('ExpoNavigationBar.didChange', listener);\n}\n\nexport async function setBackgroundColorAsync(color: string): Promise<void> {\n if (SystemBars != null) {\n console.warn('`setBackgroundColorAsync` is not supported with edge-to-edge enabled.');\n return;\n }\n\n const colorNumber = processColor(color);\n await ExpoNavigationBar.setBackgroundColorAsync(colorNumber);\n}\n\nexport async function getBackgroundColorAsync(): Promise<string> {\n if (SystemBars != null) {\n console.warn('`getBackgroundColorAsync` is not supported with edge-to-edge enabled.');\n return `#00000000`;\n }\n\n return await ExpoNavigationBar.getBackgroundColorAsync();\n}\n\nexport async function setBorderColorAsync(color: string): Promise<void> {\n if (SystemBars != null) {\n console.warn('`setBorderColorAsync` is not supported with edge-to-edge enabled.');\n return;\n }\n\n const colorNumber = processColor(color);\n await ExpoNavigationBar.setBorderColorAsync(colorNumber);\n}\n\nexport async function getBorderColorAsync(): Promise<string> {\n if (SystemBars != null) {\n console.warn('`getBorderColorAsync` is not supported with edge-to-edge enabled.');\n return `#00000000`;\n }\n\n return await ExpoNavigationBar.getBorderColorAsync();\n}\n\nexport async function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<void> {\n if (SystemBars != null) {\n SystemBars.setHidden({ navigationBar: visibility === 'hidden' });\n return;\n }\n\n await ExpoNavigationBar.setVisibilityAsync(visibility);\n}\n\nexport async function getVisibilityAsync(): Promise<NavigationBarVisibility> {\n if (SystemBars != null) {\n console.warn('`getVisibilityAsync` is not supported with edge-to-edge enabled.');\n return 'hidden';\n }\n\n return ExpoNavigationBar.getVisibilityAsync();\n}\n\nexport async function setButtonStyleAsync(style: NavigationBarButtonStyle): Promise<void> {\n if (SystemBars != null) {\n SystemBars.setStyle({ navigationBar: style });\n return;\n }\n\n await ExpoNavigationBar.setButtonStyleAsync(style);\n}\n\nexport async function getButtonStyleAsync(): Promise<NavigationBarButtonStyle> {\n if (SystemBars != null) {\n console.warn('`getButtonStyleAsync` is not supported with edge-to-edge enabled.');\n return 'light';\n }\n\n return await ExpoNavigationBar.getButtonStyleAsync();\n}\n\nexport async function setPositionAsync(position: NavigationBarPosition): Promise<void> {\n if (SystemBars != null) {\n console.warn('`setPositionAsync` is not supported with edge-to-edge enabled.');\n return;\n }\n\n await ExpoNavigationBar.setPositionAsync(position);\n}\n\nexport async function unstable_getPositionAsync(): Promise<NavigationBarPosition> {\n if (SystemBars != null) {\n console.warn('`unstable_getPositionAsync` is not supported with edge-to-edge enabled.');\n return 'relative';\n }\n\n return await ExpoNavigationBar.unstable_getPositionAsync();\n}\n\nexport async function setBehaviorAsync(behavior: NavigationBarBehavior): Promise<void> {\n if (SystemBars != null) {\n console.warn('`setBehaviorAsync` is not supported with edge-to-edge enabled.');\n return;\n }\n\n await ExpoNavigationBar.setBehaviorAsync(behavior);\n}\n\nexport async function getBehaviorAsync(): Promise<NavigationBarBehavior> {\n if (SystemBars != null) {\n console.warn('`getBehaviorAsync` is not supported with edge-to-edge enabled.');\n return 'inset-touch';\n }\n\n return await ExpoNavigationBar.getBehaviorAsync();\n}\n\nexport function setStyle(style: NavigationBarStyle) {\n if (SystemBars != null) {\n SystemBars.setStyle({ navigationBar: style });\n return;\n }\n\n throw new Error(\n '`setStyle` is only supported on Android when edge-to-edge is enabled. Enable edge-to-edge or use the `setButtonStyle` function instead.'\n );\n}\n\nexport function useVisibility(): NavigationBarVisibility | null {\n const [visibility, setVisible] = useState<NavigationBarVisibility | null>(null);\n\n useEffect(() => {\n if (SystemBars != null) {\n console.warn('`useVisibility` is not supported with edge-to-edge enabled.');\n return;\n }\n\n let isMounted = true;\n\n getVisibilityAsync().then((visibility) => {\n if (isMounted) {\n setVisible(visibility);\n }\n });\n\n const listener = addVisibilityListener(({ visibility }) => {\n if (isMounted) {\n setVisible(visibility);\n }\n });\n\n return () => {\n listener.remove();\n isMounted = false;\n };\n }, []);\n\n return visibility;\n}\n\nexport * from './NavigationBar.types';\n"]}
|
package/build/NavigationBar.d.ts
CHANGED
|
@@ -1,4 +1,178 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type EventSubscription } from 'expo-modules-core';
|
|
2
|
+
import type { NavigationBarBehavior, NavigationBarButtonStyle, NavigationBarPosition, NavigationBarStyle, NavigationBarVisibility, NavigationBarVisibilityEvent } from './NavigationBar.types';
|
|
3
|
+
/**
|
|
4
|
+
* Observe changes to the system navigation bar.
|
|
5
|
+
* Due to platform constraints, this callback will also be triggered when the status bar visibility changes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* NavigationBar.addVisibilityListener(({ visibility }) => {
|
|
10
|
+
* // ...
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function addVisibilityListener(listener: (event: NavigationBarVisibilityEvent) => void): EventSubscription;
|
|
15
|
+
/**
|
|
16
|
+
* Changes the navigation bar's background color.
|
|
17
|
+
*
|
|
18
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* NavigationBar.setBackgroundColorAsync("white");
|
|
23
|
+
* ```
|
|
24
|
+
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
25
|
+
*/
|
|
26
|
+
export declare function setBackgroundColorAsync(color: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the navigation bar's background color.
|
|
29
|
+
*
|
|
30
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const color = await NavigationBar.getBackgroundColorAsync();
|
|
35
|
+
* ```
|
|
36
|
+
* @returns Current navigation bar color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
export declare function getBackgroundColorAsync(): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Changes the navigation bar's border color.
|
|
42
|
+
*
|
|
43
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* NavigationBar.setBorderColorAsync("red");
|
|
48
|
+
* ```
|
|
49
|
+
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
50
|
+
*/
|
|
51
|
+
export declare function setBorderColorAsync(color: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the navigation bar's top border color, also known as the "divider color".
|
|
54
|
+
*
|
|
55
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const color = await NavigationBar.getBorderColorAsync();
|
|
60
|
+
* ```
|
|
61
|
+
* @returns Navigation bar top border color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
62
|
+
*/
|
|
63
|
+
export declare function getBorderColorAsync(): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Set the navigation bar's visibility.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* NavigationBar.setVisibilityAsync("hidden");
|
|
70
|
+
* ```
|
|
71
|
+
* @param visibility Based on CSS visibility property.
|
|
72
|
+
* @platform android
|
|
73
|
+
*/
|
|
74
|
+
export declare function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Get the navigation bar's visibility.
|
|
77
|
+
*
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const visibility = await NavigationBar.getVisibilityAsync("hidden");
|
|
82
|
+
* ```
|
|
83
|
+
* @returns Navigation bar's current visibility status. Returns `hidden` on unsupported platforms (iOS, web).
|
|
84
|
+
*/
|
|
85
|
+
export declare function getVisibilityAsync(): Promise<NavigationBarVisibility>;
|
|
86
|
+
/**
|
|
87
|
+
* Changes the navigation bar's button colors between white (`light`) and a dark gray color (`dark`).
|
|
88
|
+
*
|
|
89
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* NavigationBar.setButtonStyleAsync("light");
|
|
94
|
+
* ```
|
|
95
|
+
* @param style Dictates the color of the foreground element color.
|
|
96
|
+
*/
|
|
97
|
+
export declare function setButtonStyleAsync(style: NavigationBarButtonStyle): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the navigation bar's button color styles.
|
|
100
|
+
*
|
|
101
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const style = await NavigationBar.getButtonStyleAsync();
|
|
106
|
+
* ```
|
|
107
|
+
* @returns Navigation bar foreground element color settings. Returns `light` on unsupported platforms (iOS, web).
|
|
108
|
+
*/
|
|
109
|
+
export declare function getButtonStyleAsync(): Promise<NavigationBarButtonStyle>;
|
|
110
|
+
/**
|
|
111
|
+
* Sets positioning method used for the navigation bar (and status bar).
|
|
112
|
+
* Setting position `absolute` will float the navigation bar above the content,
|
|
113
|
+
* whereas position `relative` will shrink the screen to inline the navigation bar.
|
|
114
|
+
*
|
|
115
|
+
* When drawing behind the status and navigation bars, ensure the safe area insets are adjusted accordingly.
|
|
116
|
+
*
|
|
117
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* // enables edge-to-edge mode
|
|
122
|
+
* await NavigationBar.setPositionAsync('absolute')
|
|
123
|
+
* // transparent backgrounds to see through
|
|
124
|
+
* await NavigationBar.setBackgroundColorAsync('#ffffff00')
|
|
125
|
+
* ```
|
|
126
|
+
* @param position Based on CSS position property.
|
|
127
|
+
*/
|
|
128
|
+
export declare function setPositionAsync(position: NavigationBarPosition): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the navigation and status bars float above the app (absolute) or sit inline with it (relative).
|
|
131
|
+
* This value can be incorrect if `androidNavigationBar.visible` is used instead of the config plugin `position` property.
|
|
132
|
+
*
|
|
133
|
+
* This method is unstable because the position can be set via another native module and get out of sync.
|
|
134
|
+
* Alternatively, you can get the position by measuring the insets returned by `react-native-safe-area-context`.
|
|
135
|
+
*
|
|
136
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* await NavigationBar.unstable_getPositionAsync()
|
|
141
|
+
* ```
|
|
142
|
+
* @returns Navigation bar positional rendering mode. Returns `relative` on unsupported platforms (iOS, web).
|
|
143
|
+
*/
|
|
144
|
+
export declare function unstable_getPositionAsync(): Promise<NavigationBarPosition>;
|
|
145
|
+
/**
|
|
146
|
+
* Sets the behavior of the status bar and navigation bar when they are hidden and the user wants to reveal them.
|
|
147
|
+
*
|
|
148
|
+
* For example, if the navigation bar is hidden (`setVisibilityAsync(false)`) and the behavior
|
|
149
|
+
* is `'overlay-swipe'`, the user can swipe from the bottom of the screen to temporarily reveal the navigation bar.
|
|
150
|
+
*
|
|
151
|
+
* - `'overlay-swipe'`: Temporarily reveals the System UI after a swipe gesture (bottom or top) without insetting your App's content.
|
|
152
|
+
* - `'inset-swipe'`: Reveals the System UI after a swipe gesture (bottom or top) and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
153
|
+
* - `'inset-touch'`: Reveals the System UI after a touch anywhere on the screen and insets your App's content (Safe Area). The System UI is visible until you explicitly hide it again.
|
|
154
|
+
*
|
|
155
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* await NavigationBar.setBehaviorAsync('overlay-swipe')
|
|
160
|
+
* ```
|
|
161
|
+
* @param behavior Dictates the interaction behavior of the navigation bar.
|
|
162
|
+
*/
|
|
163
|
+
export declare function setBehaviorAsync(behavior: NavigationBarBehavior): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Gets the behavior of the status and navigation bars when the user swipes or touches the screen.
|
|
166
|
+
*
|
|
167
|
+
* > This method is supported only when edge-to-edge is disabled. Using it in edge-to-edge app may lead to unexpected behavior.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* await NavigationBar.getBehaviorAsync()
|
|
172
|
+
* ```
|
|
173
|
+
* @returns Navigation bar interaction behavior. Returns `inset-touch` on unsupported platforms (iOS, web).
|
|
174
|
+
*/
|
|
175
|
+
export declare function getBehaviorAsync(): Promise<NavigationBarBehavior>;
|
|
2
176
|
/**
|
|
3
177
|
* Sets the style of the navigation bar.
|
|
4
178
|
* > This will have an effect when the following conditions are met:
|
|
@@ -12,16 +186,17 @@ import { NavigationBarStyle, NavigationBarVisibility } from './NavigationBar.typ
|
|
|
12
186
|
*/
|
|
13
187
|
export declare function setStyle(style: NavigationBarStyle): void;
|
|
14
188
|
/**
|
|
15
|
-
*
|
|
189
|
+
* React hook that statefully updates with the visibility of the system navigation bar.
|
|
16
190
|
*
|
|
17
191
|
* @example
|
|
18
192
|
* ```ts
|
|
19
|
-
*
|
|
193
|
+
* function App() {
|
|
194
|
+
* const visibility = NavigationBar.useVisibility()
|
|
195
|
+
* // React Component...
|
|
196
|
+
* }
|
|
20
197
|
* ```
|
|
21
|
-
* @
|
|
22
|
-
* @platform android
|
|
198
|
+
* @returns Visibility of the navigation bar, `null` during async initialization.
|
|
23
199
|
*/
|
|
24
|
-
export declare function
|
|
25
|
-
export * from './NativeNavigationBarWrapper';
|
|
200
|
+
export declare function useVisibility(): NavigationBarVisibility | null;
|
|
26
201
|
export * from './NavigationBar.types';
|
|
27
202
|
//# sourceMappingURL=NavigationBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,mBAAmB,CAAC;AAGhF,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,IAAI,GACtD,iBAAiB,CAEnB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAG/D;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3F;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAG3E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAExF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,IAAI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