expo-system-ui 3.0.0 → 3.0.2

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,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 3.0.2 — 2024-04-23
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 3.0.1 — 2024-04-22
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 3.0.0 — 2024-04-18
14
22
 
15
23
  ### 💡 Others
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '3.0.0'
4
+ version = '3.0.2'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.systemui"
15
15
  defaultConfig {
16
16
  versionCode 1
17
- versionName '3.0.0'
17
+ versionName '3.0.2'
18
18
  }
19
19
  }
20
20
 
@@ -1 +1 @@
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
+ {"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;YACjC,OAAO,IAAI,CAAC;SACb;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;YACjC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,KAAK,IAAI,OAAO,CAAC;SACxD;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,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"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-system-ui",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
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-colors": "~0.74.80",
35
+ "@react-native/normalize-colors": "~0.74.81",
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": "4165b8d72e1b9a1889c2767534cc619e21468110"
47
+ "gitHead": "ee4f30ef3b5fa567ad1bf94794197f7683fdd481"
48
48
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = void 0;
4
- exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
3
+ exports.getRootViewBackgroundColor = exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = void 0;
5
4
  const config_plugins_1 = require("expo/config-plugins");
6
5
  const { assignColorValue } = config_plugins_1.AndroidConfig.Colors;
7
6
  const { assignStylesValue, getAppThemeLightNoActionBarGroup } = config_plugins_1.AndroidConfig.Styles;
@@ -38,3 +37,4 @@ exports.withRootViewBackgroundColorStyles = withRootViewBackgroundColorStyles;
38
37
  function getRootViewBackgroundColor(config) {
39
38
  return config.android?.backgroundColor || config.backgroundColor || null;
40
39
  }
40
+ exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
@@ -3,9 +3,7 @@ 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.withAndroidUserInterfaceStyle = void 0;
7
- exports.resolveProps = resolveProps;
8
- exports.setStrings = setStrings;
6
+ exports.setStrings = exports.resolveProps = exports.withAndroidUserInterfaceStyle = void 0;
9
7
  const assert_1 = __importDefault(require("assert"));
10
8
  const config_plugins_1 = require("expo/config-plugins");
11
9
  // strings.xml keys, this should not change.
@@ -22,6 +20,7 @@ function resolveProps(config) {
22
20
  (0, assert_1.default)(!userInterfaceStyle || ['automatic', 'light', 'dark'].includes(userInterfaceStyle), `expo-system-ui: Invalid userInterfaceStyle: "${userInterfaceStyle}"`);
23
21
  return { userInterfaceStyle };
24
22
  }
23
+ exports.resolveProps = resolveProps;
25
24
  function setStrings(strings, { userInterfaceStyle }) {
26
25
  const pairs = [[USER_INTERFACE_STYLE_KEY, userInterfaceStyle]];
27
26
  const stringItems = [];
@@ -40,3 +39,4 @@ function setStrings(strings, { userInterfaceStyle }) {
40
39
  }
41
40
  return config_plugins_1.AndroidConfig.Strings.setStringItem(stringItems, strings);
42
41
  }
42
+ exports.setStrings = setStrings;
@@ -3,9 +3,7 @@ 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.withIosRootViewBackgroundColor = void 0;
7
- exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
8
- exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
6
+ exports.getRootViewBackgroundColor = exports.setRootViewBackgroundColor = exports.withIosRootViewBackgroundColor = void 0;
9
7
  // @ts-ignore: uses flow
10
8
  const normalize_colors_1 = __importDefault(require("@react-native/normalize-colors"));
11
9
  const config_plugins_1 = require("expo/config-plugins");
@@ -36,6 +34,8 @@ function setRootViewBackgroundColor(config, infoPlist) {
36
34
  }
37
35
  return infoPlist;
38
36
  }
37
+ exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
39
38
  function getRootViewBackgroundColor(config) {
40
39
  return config.ios?.backgroundColor || config.backgroundColor || null;
41
40
  }
41
+ exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withIosUserInterfaceStyle = void 0;
4
- exports.getUserInterfaceStyle = getUserInterfaceStyle;
5
- exports.setUserInterfaceStyle = setUserInterfaceStyle;
3
+ exports.setUserInterfaceStyle = exports.getUserInterfaceStyle = exports.withIosUserInterfaceStyle = void 0;
6
4
  const config_plugins_1 = require("expo/config-plugins");
7
5
  const withIosUserInterfaceStyle = (config) => {
8
6
  return (0, config_plugins_1.withInfoPlist)(config, (config) => {
@@ -14,6 +12,7 @@ exports.withIosUserInterfaceStyle = withIosUserInterfaceStyle;
14
12
  function getUserInterfaceStyle(config) {
15
13
  return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';
16
14
  }
15
+ exports.getUserInterfaceStyle = getUserInterfaceStyle;
17
16
  function setUserInterfaceStyle(config, { UIUserInterfaceStyle, ...infoPlist }) {
18
17
  const userInterfaceStyle = getUserInterfaceStyle(config);
19
18
  const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);
@@ -25,6 +24,7 @@ function setUserInterfaceStyle(config, { UIUserInterfaceStyle, ...infoPlist }) {
25
24
  UIUserInterfaceStyle: style,
26
25
  };
27
26
  }
27
+ exports.setUserInterfaceStyle = setUserInterfaceStyle;
28
28
  function mapUserInterfaceStyleForInfoPlist(userInterfaceStyle) {
29
29
  switch (userInterfaceStyle) {
30
30
  case 'light':