expo-navigation-bar 5.0.0-canary-20250404-87e2506 → 5.0.0
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 +68 -4
- 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 +18 -0
- package/build/NavigationBar.android.d.ts.map +1 -0
- package/build/NavigationBar.android.js +127 -0
- package/build/NavigationBar.android.js.map +1 -0
- package/build/NavigationBar.d.ts +34 -2
- package/build/NavigationBar.d.ts.map +1 -1
- package/build/NavigationBar.js +56 -140
- package/build/NavigationBar.js.map +1 -1
- package/build/NavigationBar.types.d.ts +9 -0
- package/build/NavigationBar.types.d.ts.map +1 -1
- package/build/NavigationBar.types.js.map +1 -1
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +3 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +7 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.module +101 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.pom +47 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/5.0.0/expo.modules.navigationbar-5.0.0.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml +13 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.navigationbar/maven-metadata.xml.sha512 +1 -0
- package/package.json +10 -8
- package/plugin/build/withNavigationBar.js +5 -5
- package/src/ExpoNavigationBar.ts +35 -1
- package/src/NavigationBar.android.ts +174 -0
- package/src/NavigationBar.ts +60 -151
- package/src/NavigationBar.types.ts +10 -0
- package/src/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,18 +2,82 @@
|
|
|
2
2
|
|
|
3
3
|
## Unpublished
|
|
4
4
|
|
|
5
|
-
- Warn about potential edge-to-edge interferences. ([#34478](https://github.com/expo/expo/pull/34478) by [@zoontek](https://github.com/zoontek))
|
|
6
|
-
|
|
7
5
|
### 🛠 Breaking changes
|
|
8
6
|
|
|
9
|
-
- upgrade RN to 0.78 ([#35050](https://github.com/expo/expo/pull/35050) by [@vonovak](https://github.com/vonovak))
|
|
10
|
-
|
|
11
7
|
### 🎉 New features
|
|
12
8
|
|
|
13
9
|
### 🐛 Bug fixes
|
|
14
10
|
|
|
15
11
|
### 💡 Others
|
|
16
12
|
|
|
13
|
+
## 5.0.0 — 2025-08-13
|
|
14
|
+
|
|
15
|
+
### ⚠️ Notices
|
|
16
|
+
|
|
17
|
+
- Added support for React Native 0.80.x. ([#37400](https://github.com/expo/expo/pull/37400) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
18
|
+
|
|
19
|
+
## 4.2.7 - 2025-07-02
|
|
20
|
+
|
|
21
|
+
_This version does not introduce any user-facing changes._
|
|
22
|
+
|
|
23
|
+
## 4.2.6 - 2025-06-18
|
|
24
|
+
|
|
25
|
+
_This version does not introduce any user-facing changes._
|
|
26
|
+
|
|
27
|
+
## 4.2.5 - 2025-06-04
|
|
28
|
+
|
|
29
|
+
### 🐛 Bug fixes
|
|
30
|
+
|
|
31
|
+
- Fix broken OS recognition. ([#36965](https://github.com/expo/expo/pull/36965) by [@behenate](https://github.com/behenate))
|
|
32
|
+
|
|
33
|
+
### 💡 Others
|
|
34
|
+
|
|
35
|
+
- Fix inconsistencies with the docs. ([#36966](https://github.com/expo/expo/pull/36966) by [@behenate](https://github.com/behenate))
|
|
36
|
+
|
|
37
|
+
## 4.2.4 — 2025-05-01
|
|
38
|
+
|
|
39
|
+
_This version does not introduce any user-facing changes._
|
|
40
|
+
|
|
41
|
+
## 4.2.3 — 2025-04-30
|
|
42
|
+
|
|
43
|
+
_This version does not introduce any user-facing changes._
|
|
44
|
+
|
|
45
|
+
## 4.2.2 — 2025-04-25
|
|
46
|
+
|
|
47
|
+
_This version does not introduce any user-facing changes._
|
|
48
|
+
|
|
49
|
+
## 4.2.1 — 2025-04-23
|
|
50
|
+
|
|
51
|
+
- 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))
|
|
52
|
+
|
|
53
|
+
## 4.2.0 — 2025-04-21
|
|
54
|
+
|
|
55
|
+
### 🎉 New features
|
|
56
|
+
|
|
57
|
+
- Use wrappers for methods from `react-native-edge-to-edge.SystemBars` when edge-to-edge is enabled. ([#36163](https://github.com/expo/expo/pull/36163) by [@behenate](https://github.com/behenate))
|
|
58
|
+
|
|
59
|
+
## 4.1.3 — 2025-04-14
|
|
60
|
+
|
|
61
|
+
_This version does not introduce any user-facing changes._
|
|
62
|
+
|
|
63
|
+
## 4.1.2 — 2025-04-09
|
|
64
|
+
|
|
65
|
+
_This version does not introduce any user-facing changes._
|
|
66
|
+
|
|
67
|
+
## 4.1.1 — 2025-04-08
|
|
68
|
+
|
|
69
|
+
_This version does not introduce any user-facing changes._
|
|
70
|
+
|
|
71
|
+
## 4.1.0 — 2025-04-04
|
|
72
|
+
|
|
73
|
+
- Warn about potential edge-to-edge interferences. ([#34478](https://github.com/expo/expo/pull/34478) by [@zoontek](https://github.com/zoontek))
|
|
74
|
+
|
|
75
|
+
### 🛠 Breaking changes
|
|
76
|
+
|
|
77
|
+
- upgrade RN to 0.78 ([#35050](https://github.com/expo/expo/pull/35050) by [@vonovak](https://github.com/vonovak))
|
|
78
|
+
|
|
79
|
+
### 💡 Others
|
|
80
|
+
|
|
17
81
|
- [Android] Started using expo modules gradle plugin. ([#34176](https://github.com/expo/expo/pull/34176) by [@lukmccall](https://github.com/lukmccall))
|
|
18
82
|
- [apple] Migrate remaining `expo-module.config.json` to unified platform syntax. ([#34445](https://github.com/expo/expo/pull/34445) by [@reichhartd](https://github.com/reichhartd))
|
|
19
83
|
|
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,18 @@
|
|
|
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
|
+
//# sourceMappingURL=NavigationBar.android.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationBar.android.d.ts","sourceRoot":"","sources":["../src/NavigationBar.android.ts"],"names":[],"mappings":"AAAA,O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a,IAAI,uBAAuB,GAAG,IAAI,CAyB9D"}
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
return ExpoNavigationBar.addListener('ExpoNavigationBar.didChange', listener);
|
|
16
|
+
}
|
|
17
|
+
export async function setBackgroundColorAsync(color) {
|
|
18
|
+
if (SystemBars != null) {
|
|
19
|
+
console.warn('`setBackgroundColorAsync` is not supported with edge-to-edge enabled.');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const colorNumber = processColor(color);
|
|
23
|
+
await ExpoNavigationBar.setBackgroundColorAsync(colorNumber);
|
|
24
|
+
}
|
|
25
|
+
export async function getBackgroundColorAsync() {
|
|
26
|
+
if (SystemBars != null) {
|
|
27
|
+
console.warn('`getBackgroundColorAsync` is not supported with edge-to-edge enabled.');
|
|
28
|
+
return `#00000000`;
|
|
29
|
+
}
|
|
30
|
+
return await ExpoNavigationBar.getBackgroundColorAsync();
|
|
31
|
+
}
|
|
32
|
+
export async function setBorderColorAsync(color) {
|
|
33
|
+
if (SystemBars != null) {
|
|
34
|
+
console.warn('`setBorderColorAsync` is not supported with edge-to-edge enabled.');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const colorNumber = processColor(color);
|
|
38
|
+
await ExpoNavigationBar.setBorderColorAsync(colorNumber);
|
|
39
|
+
}
|
|
40
|
+
export async function getBorderColorAsync() {
|
|
41
|
+
if (SystemBars != null) {
|
|
42
|
+
console.warn('`getBorderColorAsync` is not supported with edge-to-edge enabled.');
|
|
43
|
+
return `#00000000`;
|
|
44
|
+
}
|
|
45
|
+
return await ExpoNavigationBar.getBorderColorAsync();
|
|
46
|
+
}
|
|
47
|
+
export async function setVisibilityAsync(visibility) {
|
|
48
|
+
if (SystemBars != null) {
|
|
49
|
+
SystemBars.setHidden({ navigationBar: visibility === 'hidden' });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await ExpoNavigationBar.setVisibilityAsync(visibility);
|
|
53
|
+
}
|
|
54
|
+
export async function getVisibilityAsync() {
|
|
55
|
+
return ExpoNavigationBar.getVisibilityAsync();
|
|
56
|
+
}
|
|
57
|
+
export async function setButtonStyleAsync(style) {
|
|
58
|
+
if (SystemBars != null) {
|
|
59
|
+
SystemBars.setStyle({ navigationBar: style });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
await ExpoNavigationBar.setButtonStyleAsync(style);
|
|
63
|
+
}
|
|
64
|
+
export async function getButtonStyleAsync() {
|
|
65
|
+
if (SystemBars != null) {
|
|
66
|
+
console.warn('`getButtonStyleAsync` is not supported with edge-to-edge enabled.');
|
|
67
|
+
return 'light';
|
|
68
|
+
}
|
|
69
|
+
return await ExpoNavigationBar.getButtonStyleAsync();
|
|
70
|
+
}
|
|
71
|
+
export async function setPositionAsync(position) {
|
|
72
|
+
if (SystemBars != null) {
|
|
73
|
+
console.warn('`setPositionAsync` is not supported with edge-to-edge enabled.');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
await ExpoNavigationBar.setPositionAsync(position);
|
|
77
|
+
}
|
|
78
|
+
export async function unstable_getPositionAsync() {
|
|
79
|
+
if (SystemBars != null) {
|
|
80
|
+
console.warn('`unstable_getPositionAsync` is not supported with edge-to-edge enabled.');
|
|
81
|
+
return 'relative';
|
|
82
|
+
}
|
|
83
|
+
return await ExpoNavigationBar.unstable_getPositionAsync();
|
|
84
|
+
}
|
|
85
|
+
export async function setBehaviorAsync(behavior) {
|
|
86
|
+
if (SystemBars != null) {
|
|
87
|
+
console.warn('`setBehaviorAsync` is not supported with edge-to-edge enabled.');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
await ExpoNavigationBar.setBehaviorAsync(behavior);
|
|
91
|
+
}
|
|
92
|
+
export async function getBehaviorAsync() {
|
|
93
|
+
if (SystemBars != null) {
|
|
94
|
+
console.warn('`getBehaviorAsync` is not supported with edge-to-edge enabled.');
|
|
95
|
+
return 'inset-touch';
|
|
96
|
+
}
|
|
97
|
+
return await ExpoNavigationBar.getBehaviorAsync();
|
|
98
|
+
}
|
|
99
|
+
export function setStyle(style) {
|
|
100
|
+
if (SystemBars != null) {
|
|
101
|
+
SystemBars.setStyle({ navigationBar: style });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
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.');
|
|
105
|
+
}
|
|
106
|
+
export function useVisibility() {
|
|
107
|
+
const [visibility, setVisible] = useState(null);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
let isMounted = true;
|
|
110
|
+
getVisibilityAsync().then((visibility) => {
|
|
111
|
+
if (isMounted) {
|
|
112
|
+
setVisible(visibility);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const listener = addVisibilityListener(({ visibility }) => {
|
|
116
|
+
if (isMounted) {
|
|
117
|
+
setVisible(visibility);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return () => {
|
|
121
|
+
listener.remove();
|
|
122
|
+
isMounted = false;
|
|
123
|
+
};
|
|
124
|
+
}, []);
|
|
125
|
+
return visibility;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=NavigationBar.android.js.map
|
|
@@ -0,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IAAyI,CAC1I,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiC,IAAI,CAAC,CAAC;IAEhF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,GAAG,IAAI,CAAC;QAErB,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE;YACvC,IAAI,SAAS,EAAE,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","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 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 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 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"]}
|
package/build/NavigationBar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EventSubscription } from 'expo-modules-core';
|
|
2
|
-
import {
|
|
2
|
+
import type { NavigationBarBehavior, NavigationBarButtonStyle, NavigationBarPosition, NavigationBarStyle, NavigationBarVisibility, NavigationBarVisibilityEvent } from './NavigationBar.types';
|
|
3
3
|
/**
|
|
4
4
|
* Observe changes to the system navigation bar.
|
|
5
5
|
* Due to platform constraints, this callback will also be triggered when the status bar visibility changes.
|
|
@@ -15,6 +15,8 @@ export declare function addVisibilityListener(listener: (event: NavigationBarVis
|
|
|
15
15
|
/**
|
|
16
16
|
* Changes the navigation bar's background color.
|
|
17
17
|
*
|
|
18
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
19
|
+
*
|
|
18
20
|
* @example
|
|
19
21
|
* ```ts
|
|
20
22
|
* NavigationBar.setBackgroundColorAsync("white");
|
|
@@ -25,16 +27,21 @@ export declare function setBackgroundColorAsync(color: string): Promise<void>;
|
|
|
25
27
|
/**
|
|
26
28
|
* Gets the navigation bar's background color.
|
|
27
29
|
*
|
|
30
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
31
|
+
*
|
|
28
32
|
* @example
|
|
29
33
|
* ```ts
|
|
30
34
|
* const color = await NavigationBar.getBackgroundColorAsync();
|
|
31
35
|
* ```
|
|
32
36
|
* @returns Current navigation bar color in hex format. Returns `#00000000` (transparent) on unsupported platforms (iOS, web).
|
|
37
|
+
*
|
|
33
38
|
*/
|
|
34
39
|
export declare function getBackgroundColorAsync(): Promise<string>;
|
|
35
40
|
/**
|
|
36
41
|
* Changes the navigation bar's border color.
|
|
37
42
|
*
|
|
43
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
44
|
+
*
|
|
38
45
|
* @example
|
|
39
46
|
* ```ts
|
|
40
47
|
* NavigationBar.setBorderColorAsync("red");
|
|
@@ -45,6 +52,8 @@ export declare function setBorderColorAsync(color: string): Promise<void>;
|
|
|
45
52
|
/**
|
|
46
53
|
* Gets the navigation bar's top border color, also known as the "divider color".
|
|
47
54
|
*
|
|
55
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
56
|
+
*
|
|
48
57
|
* @example
|
|
49
58
|
* ```ts
|
|
50
59
|
* const color = await NavigationBar.getBorderColorAsync();
|
|
@@ -60,11 +69,13 @@ export declare function getBorderColorAsync(): Promise<string>;
|
|
|
60
69
|
* NavigationBar.setVisibilityAsync("hidden");
|
|
61
70
|
* ```
|
|
62
71
|
* @param visibility Based on CSS visibility property.
|
|
72
|
+
* @platform android
|
|
63
73
|
*/
|
|
64
74
|
export declare function setVisibilityAsync(visibility: NavigationBarVisibility): Promise<void>;
|
|
65
75
|
/**
|
|
66
76
|
* Get the navigation bar's visibility.
|
|
67
77
|
*
|
|
78
|
+
*
|
|
68
79
|
* @example
|
|
69
80
|
* ```ts
|
|
70
81
|
* const visibility = await NavigationBar.getVisibilityAsync("hidden");
|
|
@@ -85,6 +96,8 @@ export declare function setButtonStyleAsync(style: NavigationBarButtonStyle): Pr
|
|
|
85
96
|
/**
|
|
86
97
|
* Gets the navigation bar's button color styles.
|
|
87
98
|
*
|
|
99
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
100
|
+
*
|
|
88
101
|
* @example
|
|
89
102
|
* ```ts
|
|
90
103
|
* const style = await NavigationBar.getButtonStyleAsync();
|
|
@@ -99,6 +112,8 @@ export declare function getButtonStyleAsync(): Promise<NavigationBarButtonStyle>
|
|
|
99
112
|
*
|
|
100
113
|
* When drawing behind the status and navigation bars, ensure the safe area insets are adjusted accordingly.
|
|
101
114
|
*
|
|
115
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
116
|
+
*
|
|
102
117
|
* @example
|
|
103
118
|
* ```ts
|
|
104
119
|
* // enables edge-to-edge mode
|
|
@@ -116,6 +131,8 @@ export declare function setPositionAsync(position: NavigationBarPosition): Promi
|
|
|
116
131
|
* This method is unstable because the position can be set via another native module and get out of sync.
|
|
117
132
|
* Alternatively, you can get the position by measuring the insets returned by `react-native-safe-area-context`.
|
|
118
133
|
*
|
|
134
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
135
|
+
*
|
|
119
136
|
* @example
|
|
120
137
|
* ```ts
|
|
121
138
|
* await NavigationBar.unstable_getPositionAsync()
|
|
@@ -133,6 +150,8 @@ export declare function unstable_getPositionAsync(): Promise<NavigationBarPositi
|
|
|
133
150
|
* - `'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.
|
|
134
151
|
* - `'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.
|
|
135
152
|
*
|
|
153
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
154
|
+
*
|
|
136
155
|
* @example
|
|
137
156
|
* ```ts
|
|
138
157
|
* await NavigationBar.setBehaviorAsync('overlay-swipe')
|
|
@@ -143,6 +162,8 @@ export declare function setBehaviorAsync(behavior: NavigationBarBehavior): Promi
|
|
|
143
162
|
/**
|
|
144
163
|
* Gets the behavior of the status and navigation bars when the user swipes or touches the screen.
|
|
145
164
|
*
|
|
165
|
+
* > This method is supported only when edge-to-edge is disabled.
|
|
166
|
+
*
|
|
146
167
|
* @example
|
|
147
168
|
* ```ts
|
|
148
169
|
* await NavigationBar.getBehaviorAsync()
|
|
@@ -150,6 +171,18 @@ export declare function setBehaviorAsync(behavior: NavigationBarBehavior): Promi
|
|
|
150
171
|
* @returns Navigation bar interaction behavior. Returns `inset-touch` on unsupported platforms (iOS, web).
|
|
151
172
|
*/
|
|
152
173
|
export declare function getBehaviorAsync(): Promise<NavigationBarBehavior>;
|
|
174
|
+
/**
|
|
175
|
+
* Sets the style of the navigation bar.
|
|
176
|
+
* > This will have an effect when the following conditions are met:
|
|
177
|
+
* > - Edge-to-edge is enabled
|
|
178
|
+
* > - The `enforceNavigationBarContrast` option of the `react-native-edge-to-edge` plugin is set to `false`.
|
|
179
|
+
* > - The device is using the three-button navigation bar.
|
|
180
|
+
*
|
|
181
|
+
* > Due to a bug in the Android 15 emulator this function may have no effect. Try a physical device or an emulator with a different version of Android.
|
|
182
|
+
*
|
|
183
|
+
* @platform android
|
|
184
|
+
*/
|
|
185
|
+
export declare function setStyle(style: NavigationBarStyle): void;
|
|
153
186
|
/**
|
|
154
187
|
* React hook that statefully updates with the visibility of the system navigation bar.
|
|
155
188
|
*
|
|
@@ -163,5 +196,4 @@ export declare function getBehaviorAsync(): Promise<NavigationBarBehavior>;
|
|
|
163
196
|
* @returns Visibility of the navigation bar, `null` during async initialization.
|
|
164
197
|
*/
|
|
165
198
|
export declare function useVisibility(): NavigationBarVisibility | null;
|
|
166
|
-
export * from './NavigationBar.types';
|
|
167
199
|
//# sourceMappingURL=NavigationBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../src/NavigationBar.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;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