expo-system-ui 2.9.3 → 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 CHANGED
@@ -10,13 +10,23 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 2.9.3 — 2024-01-10
13
+ ## 3.0.0 — 2024-04-18
14
+
15
+ ### 💡 Others
16
+
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))
22
+
23
+ ## 2.9.3 - 2024-01-10
14
24
 
15
25
  ### 💡 Others
16
26
 
17
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))
18
28
 
19
- ## 2.9.2 2023-12-19
29
+ ## 2.9.2 - 2023-12-19
20
30
 
21
31
  _This version does not introduce any user-facing changes._
22
32
 
@@ -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 = '2.9.3'
4
+ version = '3.0.0'
7
5
 
8
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
- if (expoModulesCorePlugin.exists()) {
10
- apply from: expoModulesCorePlugin
11
- applyKotlinExpoModulesCorePlugin()
12
- // Remove this check, but keep the contents after SDK49 support is dropped
13
- if (safeExtGet("expoProvidesDefaultConfig", false)) {
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 '2.9.3'
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)
@@ -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,5 +1,4 @@
1
1
  declare const _default: {
2
- readonly name: string;
3
2
  getBackgroundColorAsync(): any;
4
3
  setBackgroundColorAsync(color: string | null): void;
5
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoSystemUI.web.d.ts","sourceRoot":"","sources":["../src/ExpoSystemUI.web.ts"],"names":[],"mappings":";;;mCAeiC,MAAM,GAAG,IAAI;;AAX9C,wBAgBE"}
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 (Platform.isDOMAvailable) {
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 (Platform.isDOMAvailable) {
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,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,sBAAsB;AACtB,OAAO,cAAc,MAAM,kDAAkD,CAAC;AAE9E,eAAe;IACb,IAAI,IAAI;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,uBAAuB;QACrB,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;SAC5D;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IACD,uBAAuB,CAAC,KAAoB;QAC1C,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,KAAK,IAAI,OAAO,CAAC;SACxD;IACH,CAAC;CACF,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\n// @ts-ignore: untyped\nimport normalizeColor from 'react-native-web/dist/cjs/modules/normalizeColor';\n\nexport default {\n get name(): string {\n return 'ExpoSystemUI';\n },\n getBackgroundColorAsync() {\n if (Platform.isDOMAvailable) {\n return normalizeColor(document.body.style.backgroundColor);\n } else {\n return null;\n }\n },\n setBackgroundColorAsync(color: string | null) {\n if (Platform.isDOMAvailable) {\n document.body.style.backgroundColor = color ?? 'white';\n }\n },\n};\n"]}
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"]}
@@ -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;QACjB,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;KACzD;SAAM;QACL,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;KAChE;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"]}
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"]}
@@ -43,6 +43,7 @@ public class ExpoSystemUIModule: Module {
43
43
  EXUtilities.performSynchronously {
44
44
  if color == nil {
45
45
  if let window = UIApplication.shared.delegate?.window {
46
+ // Uses required reason API based on the following reason: CA92.1
46
47
  UserDefaults.standard.removeObject(forKey: colorKey)
47
48
  let interfaceStyle = window?.traitCollection.userInterfaceStyle
48
49
  window?.backgroundColor = nil
@@ -22,6 +22,9 @@ Pod::Spec.new do |s|
22
22
  'DEFINES_MODULE' => 'YES'
23
23
  }
24
24
 
25
+ s.resource_bundles = {'ExpoSystemUI_privacy' => ['PrivacyInfo.xcprivacy']}
26
+
27
+
25
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')
26
29
  s.source_files = "#{s.name}/**/*.h"
27
30
  s.vendored_frameworks = "#{s.name}.xcframework"
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>NSPrivacyCollectedDataTypes</key>
6
+ <array>
7
+ </array>
8
+ <key>NSPrivacyTracking</key>
9
+ <false/>
10
+ <key>NSPrivacyTrackingDomains</key>
11
+ <array/>
12
+ <key>NSPrivacyAccessedAPITypes</key>
13
+ <array>
14
+ <dict>
15
+ <key>NSPrivacyAccessedAPIType</key>
16
+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
17
+ <key>NSPrivacyAccessedAPITypeReasons</key>
18
+ <array>
19
+ <string>CA92.1</string>
20
+ </array>
21
+ </dict>
22
+ </array>
23
+ </dict>
24
+ </plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-system-ui",
3
- "version": "2.9.3",
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-color": "^2.0.0",
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": "ca014bf2516c7644ef303f4c21fdd68de4d99f76"
47
+ "gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
48
48
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRootViewBackgroundColor = exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = void 0;
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.setStrings = exports.resolveProps = exports.withAndroidUserInterfaceStyle = void 0;
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.getRootViewBackgroundColor = exports.setRootViewBackgroundColor = exports.withIosRootViewBackgroundColor = void 0;
6
+ exports.withIosRootViewBackgroundColor = void 0;
7
+ exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
8
+ exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
7
9
  // @ts-ignore: uses flow
8
- const normalize_color_1 = __importDefault(require("@react-native/normalize-color"));
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, normalize_color_1.default)(backgroundColor);
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.setUserInterfaceStyle = exports.getUserInterfaceStyle = exports.withIosUserInterfaceStyle = void 0;
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-color';
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
 
@@ -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 (Platform.isDOMAvailable) {
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 (Platform.isDOMAvailable) {
10
+ if (typeof window !== 'undefined') {
18
11
  document.body.style.backgroundColor = color ?? 'white';
19
12
  }
20
13
  },