expo-system-ui 2.9.4 → 3.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 +7 -3
- package/android/build.gradle +7 -93
- package/android/src/main/java/expo/modules/systemui/SystemUIModule.kt +1 -1
- package/android/src/main/java/expo/modules/systemui/SystemUIReactActivityLifecycleListener.kt +0 -2
- package/build/ExpoSystemUI.web.d.ts +0 -1
- package/build/ExpoSystemUI.web.d.ts.map +1 -1
- package/build/ExpoSystemUI.web.js +4 -11
- package/build/ExpoSystemUI.web.js.map +1 -1
- package/build/SystemUI.js.map +1 -1
- package/ios/ExpoSystemUI.podspec +1 -0
- package/package.json +3 -3
- package/plugin/build/withAndroidRootViewBackgroundColor.js +2 -2
- package/plugin/build/withAndroidUserInterfaceStyle.js +3 -3
- package/plugin/build/withIosRootViewBackgroundColor.js +5 -5
- package/plugin/build/withIosUserInterfaceStyle.js +3 -3
- package/plugin/src/withIosRootViewBackgroundColor.ts +1 -1
- package/src/ExpoSystemUI.web.ts +4 -11
package/CHANGELOG.md
CHANGED
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 3.0.0 — 2024-04-18
|
|
14
14
|
|
|
15
15
|
### 💡 Others
|
|
16
16
|
|
|
17
17
|
- [iOS] Add privacy manifest describing required reason API usage. ([#27770](https://github.com/expo/expo/pull/27770) by [@aleqsio](https://github.com/aleqsio))
|
|
18
|
+
- Use `typeof window` checks for removing server code. ([#27514](https://github.com/expo/expo/pull/27514) by [@EvanBacon](https://github.com/EvanBacon))
|
|
19
|
+
- drop unused web `name` property. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
|
|
20
|
+
- Migrated dependency from `@react-native/normalize-color` to `@react-native/normalize-colors`. ([#27736](https://github.com/expo/expo/pull/27736) by [@kudo](https://github.com/kudo))
|
|
21
|
+
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
|
|
18
22
|
|
|
19
|
-
## 2.9.3
|
|
23
|
+
## 2.9.3 - 2024-01-10
|
|
20
24
|
|
|
21
25
|
### 💡 Others
|
|
22
26
|
|
|
23
27
|
- Replace deprecated `com.facebook.react:react-native:+` Android dependency with `com.facebook.react:react-android`. ([#26237](https://github.com/expo/expo/pull/26237) by [@kudo](https://github.com/kudo))
|
|
24
28
|
|
|
25
|
-
## 2.9.2
|
|
29
|
+
## 2.9.2 - 2023-12-19
|
|
26
30
|
|
|
27
31
|
_This version does not introduce any user-facing changes._
|
|
28
32
|
|
package/android/build.gradle
CHANGED
|
@@ -1,110 +1,24 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven-publish'
|
|
4
2
|
|
|
5
3
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '
|
|
4
|
+
version = '3.0.0'
|
|
7
5
|
|
|
8
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
useExpoPublishing()
|
|
15
|
-
useCoreDependencies()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
buildscript {
|
|
20
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
21
|
-
ext.safeExtGet = { prop, fallback ->
|
|
22
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensures backward compatibility
|
|
26
|
-
ext.getKotlinVersion = {
|
|
27
|
-
if (ext.has("kotlinVersion")) {
|
|
28
|
-
ext.kotlinVersion()
|
|
29
|
-
} else {
|
|
30
|
-
ext.safeExtGet("kotlinVersion", "1.8.10")
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
repositories {
|
|
35
|
-
mavenCentral()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
dependencies {
|
|
39
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
44
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
45
|
-
afterEvaluate {
|
|
46
|
-
publishing {
|
|
47
|
-
publications {
|
|
48
|
-
release(MavenPublication) {
|
|
49
|
-
from components.release
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
repositories {
|
|
53
|
-
maven {
|
|
54
|
-
url = mavenLocal().url
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
7
|
+
apply from: expoModulesCorePlugin
|
|
8
|
+
applyKotlinExpoModulesCorePlugin()
|
|
9
|
+
useCoreDependencies()
|
|
10
|
+
useDefaultAndroidSdkVersions()
|
|
11
|
+
useExpoPublishing()
|
|
60
12
|
|
|
61
13
|
android {
|
|
62
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
63
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
64
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
65
|
-
|
|
66
|
-
defaultConfig {
|
|
67
|
-
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
68
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
publishing {
|
|
72
|
-
singleVariant("release") {
|
|
73
|
-
withSourcesJar()
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
lintOptions {
|
|
78
|
-
abortOnError false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
83
|
-
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
84
|
-
compileOptions {
|
|
85
|
-
sourceCompatibility JavaVersion.VERSION_11
|
|
86
|
-
targetCompatibility JavaVersion.VERSION_11
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
kotlinOptions {
|
|
90
|
-
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
14
|
namespace "expo.modules.systemui"
|
|
95
15
|
defaultConfig {
|
|
96
16
|
versionCode 1
|
|
97
|
-
versionName '
|
|
17
|
+
versionName '3.0.0'
|
|
98
18
|
}
|
|
99
19
|
}
|
|
100
20
|
|
|
101
21
|
dependencies {
|
|
102
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
103
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
104
|
-
implementation project(':expo-modules-core')
|
|
105
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
22
|
implementation 'com.facebook.react:react-android'
|
|
109
23
|
implementation 'androidx.core:core:1.6.0'
|
|
110
24
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
@@ -50,7 +50,7 @@ class SystemUIModule : Module() {
|
|
|
50
50
|
setBackgroundColor(color ?: systemBackgroundColor)
|
|
51
51
|
}.runOnQueue(Queues.MAIN)
|
|
52
52
|
|
|
53
|
-
AsyncFunction("getBackgroundColorAsync") {
|
|
53
|
+
AsyncFunction<String?>("getBackgroundColorAsync") {
|
|
54
54
|
val background = currentActivity.window.decorView.background
|
|
55
55
|
return@AsyncFunction if (background is ColorDrawable) {
|
|
56
56
|
colorToHex((background.mutate() as ColorDrawable).color)
|
package/android/src/main/java/expo/modules/systemui/SystemUIReactActivityLifecycleListener.kt
CHANGED
|
@@ -6,8 +6,6 @@ import android.os.Bundle
|
|
|
6
6
|
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
7
7
|
import expo.modules.systemui.singletons.SystemUI
|
|
8
8
|
|
|
9
|
-
// EXPO_VERSIONING_NEEDS_PACKAGE_R
|
|
10
|
-
|
|
11
9
|
class SystemUIReactActivityLifecycleListener(activityContext: Context) : ReactActivityLifecycleListener {
|
|
12
10
|
override fun onCreate(activity: Activity, savedInstanceState: Bundle?) {
|
|
13
11
|
SystemUI.setUserInterfaceStyle(getUserInterfaceStyle(activity))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSystemUI.web.d.ts","sourceRoot":"","sources":["../src/ExpoSystemUI.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoSystemUI.web.d.ts","sourceRoot":"","sources":["../src/ExpoSystemUI.web.ts"],"names":[],"mappings":";;mCAQiC,MAAM,GAAG,IAAI;;AAR9C,wBAaE"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { Platform } from 'expo-modules-core';
|
|
2
|
-
// @ts-ignore: untyped
|
|
3
|
-
import normalizeColor from 'react-native-web/dist/cjs/modules/normalizeColor';
|
|
4
1
|
export default {
|
|
5
|
-
get name() {
|
|
6
|
-
return 'ExpoSystemUI';
|
|
7
|
-
},
|
|
8
2
|
getBackgroundColorAsync() {
|
|
9
|
-
if (
|
|
10
|
-
return normalizeColor(document.body.style.backgroundColor);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
3
|
+
if (typeof window === 'undefined') {
|
|
13
4
|
return null;
|
|
14
5
|
}
|
|
6
|
+
const normalizeColor = require('react-native-web/dist/cjs/modules/normalizeColor');
|
|
7
|
+
return normalizeColor(document.body.style.backgroundColor);
|
|
15
8
|
},
|
|
16
9
|
setBackgroundColorAsync(color) {
|
|
17
|
-
if (
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
18
11
|
document.body.style.backgroundColor = color ?? 'white';
|
|
19
12
|
}
|
|
20
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSystemUI.web.js","sourceRoot":"","sources":["../src/ExpoSystemUI.web.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ExpoSystemUI.web.js","sourceRoot":"","sources":["../src/ExpoSystemUI.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,uBAAuB;QACrB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,cAAc,GAAG,OAAO,CAAC,kDAAkD,CAAC,CAAC;QACnF,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;IACD,uBAAuB,CAAC,KAAoB;QAC1C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,KAAK,IAAI,OAAO,CAAC;QACzD,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["export default {\n getBackgroundColorAsync() {\n if (typeof window === 'undefined') {\n return null;\n }\n const normalizeColor = require('react-native-web/dist/cjs/modules/normalizeColor');\n return normalizeColor(document.body.style.backgroundColor);\n },\n setBackgroundColorAsync(color: string | null) {\n if (typeof window !== 'undefined') {\n document.body.style.backgroundColor = color ?? 'white';\n }\n },\n};\n"]}
|
package/build/SystemUI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemUI.js","sourceRoot":"","sources":["../src/SystemUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,KAAwB;IACpE,IAAI,KAAK,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"SystemUI.js","sourceRoot":"","sources":["../src/SystemUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,KAAwB;IACpE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,MAAM,WAAW,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACxE,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,OAAO,MAAM,YAAY,CAAC,uBAAuB,EAAE,CAAC;AACtD,CAAC","sourcesContent":["import { ColorValue, Platform, processColor } from 'react-native';\n\nimport ExpoSystemUI from './ExpoSystemUI';\n\n/**\n * Changes the root view background color.\n * Call this function in the root file outside of you component.\n *\n * @example\n * ```ts\n * SystemUI.setBackgroundColorAsync(\"black\");\n * ```\n * @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).\n */\nexport async function setBackgroundColorAsync(color: ColorValue | null): Promise<void> {\n if (color == null) {\n return await ExpoSystemUI.setBackgroundColorAsync(null);\n } else {\n const colorNumber = Platform.OS === 'web' ? color : processColor(color);\n return await ExpoSystemUI.setBackgroundColorAsync(colorNumber);\n }\n}\n\n/**\n * Gets the root view background color.\n *\n * @example\n * ```ts\n * const color = await SystemUI.getBackgroundColorAsync();\n * ```\n * @returns Current root view background color in hex format. Returns `null` if the background color is not set.\n */\nexport async function getBackgroundColorAsync(): Promise<ColorValue | null> {\n return await ExpoSystemUI.getBackgroundColorAsync();\n}\n"]}
|
package/ios/ExpoSystemUI.podspec
CHANGED
|
@@ -24,6 +24,7 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
|
|
25
25
|
s.resource_bundles = {'ExpoSystemUI_privacy' => ['PrivacyInfo.xcprivacy']}
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
28
29
|
s.source_files = "#{s.name}/**/*.h"
|
|
29
30
|
s.vendored_frameworks = "#{s.name}.xcframework"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-system-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Interact with system UI elements",
|
|
5
5
|
"main": "build/SystemUI.js",
|
|
6
6
|
"types": "build/SystemUI.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/system-ui",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@react-native/normalize-
|
|
35
|
+
"@react-native/normalize-colors": "~0.74.80",
|
|
36
36
|
"debug": "^4.3.2"
|
|
37
37
|
},
|
|
38
38
|
"jest": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"expo": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
|
|
48
48
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = void 0;
|
|
4
|
+
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
4
5
|
const config_plugins_1 = require("expo/config-plugins");
|
|
5
6
|
const { assignColorValue } = config_plugins_1.AndroidConfig.Colors;
|
|
6
7
|
const { assignStylesValue, getAppThemeLightNoActionBarGroup } = config_plugins_1.AndroidConfig.Styles;
|
|
@@ -37,4 +38,3 @@ exports.withRootViewBackgroundColorStyles = withRootViewBackgroundColorStyles;
|
|
|
37
38
|
function getRootViewBackgroundColor(config) {
|
|
38
39
|
return config.android?.backgroundColor || config.backgroundColor || null;
|
|
39
40
|
}
|
|
40
|
-
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.withAndroidUserInterfaceStyle = void 0;
|
|
7
|
+
exports.resolveProps = resolveProps;
|
|
8
|
+
exports.setStrings = setStrings;
|
|
7
9
|
const assert_1 = __importDefault(require("assert"));
|
|
8
10
|
const config_plugins_1 = require("expo/config-plugins");
|
|
9
11
|
// strings.xml keys, this should not change.
|
|
@@ -20,7 +22,6 @@ function resolveProps(config) {
|
|
|
20
22
|
(0, assert_1.default)(!userInterfaceStyle || ['automatic', 'light', 'dark'].includes(userInterfaceStyle), `expo-system-ui: Invalid userInterfaceStyle: "${userInterfaceStyle}"`);
|
|
21
23
|
return { userInterfaceStyle };
|
|
22
24
|
}
|
|
23
|
-
exports.resolveProps = resolveProps;
|
|
24
25
|
function setStrings(strings, { userInterfaceStyle }) {
|
|
25
26
|
const pairs = [[USER_INTERFACE_STYLE_KEY, userInterfaceStyle]];
|
|
26
27
|
const stringItems = [];
|
|
@@ -39,4 +40,3 @@ function setStrings(strings, { userInterfaceStyle }) {
|
|
|
39
40
|
}
|
|
40
41
|
return config_plugins_1.AndroidConfig.Strings.setStringItem(stringItems, strings);
|
|
41
42
|
}
|
|
42
|
-
exports.setStrings = setStrings;
|
|
@@ -3,9 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.withIosRootViewBackgroundColor = void 0;
|
|
7
|
+
exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
|
|
8
|
+
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
7
9
|
// @ts-ignore: uses flow
|
|
8
|
-
const
|
|
10
|
+
const normalize_colors_1 = __importDefault(require("@react-native/normalize-colors"));
|
|
9
11
|
const config_plugins_1 = require("expo/config-plugins");
|
|
10
12
|
// Maps to the template AppDelegate.m
|
|
11
13
|
const BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';
|
|
@@ -24,7 +26,7 @@ function setRootViewBackgroundColor(config, infoPlist) {
|
|
|
24
26
|
delete infoPlist[BACKGROUND_COLOR_KEY];
|
|
25
27
|
}
|
|
26
28
|
else {
|
|
27
|
-
let color = (0,
|
|
29
|
+
let color = (0, normalize_colors_1.default)(backgroundColor);
|
|
28
30
|
if (!color) {
|
|
29
31
|
throw new Error('Invalid background color on iOS');
|
|
30
32
|
}
|
|
@@ -34,8 +36,6 @@ function setRootViewBackgroundColor(config, infoPlist) {
|
|
|
34
36
|
}
|
|
35
37
|
return infoPlist;
|
|
36
38
|
}
|
|
37
|
-
exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
|
|
38
39
|
function getRootViewBackgroundColor(config) {
|
|
39
40
|
return config.ios?.backgroundColor || config.backgroundColor || null;
|
|
40
41
|
}
|
|
41
|
-
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withIosUserInterfaceStyle = void 0;
|
|
4
|
+
exports.getUserInterfaceStyle = getUserInterfaceStyle;
|
|
5
|
+
exports.setUserInterfaceStyle = setUserInterfaceStyle;
|
|
4
6
|
const config_plugins_1 = require("expo/config-plugins");
|
|
5
7
|
const withIosUserInterfaceStyle = (config) => {
|
|
6
8
|
return (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
@@ -12,7 +14,6 @@ exports.withIosUserInterfaceStyle = withIosUserInterfaceStyle;
|
|
|
12
14
|
function getUserInterfaceStyle(config) {
|
|
13
15
|
return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';
|
|
14
16
|
}
|
|
15
|
-
exports.getUserInterfaceStyle = getUserInterfaceStyle;
|
|
16
17
|
function setUserInterfaceStyle(config, { UIUserInterfaceStyle, ...infoPlist }) {
|
|
17
18
|
const userInterfaceStyle = getUserInterfaceStyle(config);
|
|
18
19
|
const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);
|
|
@@ -24,7 +25,6 @@ function setUserInterfaceStyle(config, { UIUserInterfaceStyle, ...infoPlist }) {
|
|
|
24
25
|
UIUserInterfaceStyle: style,
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
exports.setUserInterfaceStyle = setUserInterfaceStyle;
|
|
28
28
|
function mapUserInterfaceStyleForInfoPlist(userInterfaceStyle) {
|
|
29
29
|
switch (userInterfaceStyle) {
|
|
30
30
|
case 'light':
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-ignore: uses flow
|
|
2
|
-
import normalizeColor from '@react-native/normalize-
|
|
2
|
+
import normalizeColor from '@react-native/normalize-colors';
|
|
3
3
|
import { ExpoConfig } from 'expo/config';
|
|
4
4
|
import { ConfigPlugin, InfoPlist, withInfoPlist } from 'expo/config-plugins';
|
|
5
5
|
|
package/src/ExpoSystemUI.web.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { Platform } from 'expo-modules-core';
|
|
2
|
-
// @ts-ignore: untyped
|
|
3
|
-
import normalizeColor from 'react-native-web/dist/cjs/modules/normalizeColor';
|
|
4
|
-
|
|
5
1
|
export default {
|
|
6
|
-
get name(): string {
|
|
7
|
-
return 'ExpoSystemUI';
|
|
8
|
-
},
|
|
9
2
|
getBackgroundColorAsync() {
|
|
10
|
-
if (
|
|
11
|
-
return normalizeColor(document.body.style.backgroundColor);
|
|
12
|
-
} else {
|
|
3
|
+
if (typeof window === 'undefined') {
|
|
13
4
|
return null;
|
|
14
5
|
}
|
|
6
|
+
const normalizeColor = require('react-native-web/dist/cjs/modules/normalizeColor');
|
|
7
|
+
return normalizeColor(document.body.style.backgroundColor);
|
|
15
8
|
},
|
|
16
9
|
setBackgroundColorAsync(color: string | null) {
|
|
17
|
-
if (
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
18
11
|
document.body.style.backgroundColor = color ?? 'white';
|
|
19
12
|
}
|
|
20
13
|
},
|