expo-system-ui 1.2.0 → 1.3.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 +10 -0
- package/android/build.gradle +2 -2
- package/build/SystemUI.d.ts.map +1 -1
- package/build/SystemUI.js +2 -2
- package/build/SystemUI.js.map +1 -1
- package/ios/ExpoSystemUI/ExpoSystemUIModule.swift +4 -4
- package/package.json +3 -3
- package/src/SystemUI.ts +2 -2
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 1.3.0 — 2022-07-07
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fix color setting on web. ([#17558](https://github.com/expo/expo/pull/17558) by [@EvanBacon](https://github.com/EvanBacon))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Migrated Expo modules definitions to the new naming convention. ([#17193](https://github.com/expo/expo/pull/17193) by [@tsapeta](https://github.com/tsapeta))
|
|
22
|
+
|
|
13
23
|
## 1.2.0 — 2022-04-18
|
|
14
24
|
|
|
15
25
|
### 💡 Others
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '1.
|
|
6
|
+
version = '1.3.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 1
|
|
77
|
-
versionName '1.
|
|
77
|
+
versionName '1.3.0'
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
package/build/SystemUI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemUI.d.ts","sourceRoot":"","sources":["../src/SystemUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"SystemUI.d.ts","sourceRoot":"","sources":["../src/SystemUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAIlE;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9E;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAE1E"}
|
package/build/SystemUI.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { processColor } from 'react-native';
|
|
1
|
+
import { Platform, processColor } from 'react-native';
|
|
2
2
|
import ExpoSystemUI from './ExpoSystemUI';
|
|
3
3
|
/**
|
|
4
4
|
* Changes the root view background color.
|
|
@@ -10,7 +10,7 @@ import ExpoSystemUI from './ExpoSystemUI';
|
|
|
10
10
|
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
11
11
|
*/
|
|
12
12
|
export async function setBackgroundColorAsync(color) {
|
|
13
|
-
const colorNumber = processColor(color);
|
|
13
|
+
const colorNumber = Platform.OS === 'web' ? color : processColor(color);
|
|
14
14
|
return await ExpoSystemUI.setBackgroundColorAsync(colorNumber);
|
|
15
15
|
}
|
|
16
16
|
/**
|
package/build/SystemUI.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemUI.js","sourceRoot":"","sources":["../src/SystemUI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
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;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,KAAiB;IAC7D,MAAM,WAAW,GAAG,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACxE,OAAO,MAAM,YAAY,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;AACjE,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 *\n * @example\n * ```ts\n * SystemUI.setBackgroundColorAsync(\"white\");\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): Promise<void> {\n const colorNumber = Platform.OS === 'web' ? color : processColor(color);\n return await ExpoSystemUI.setBackgroundColorAsync(colorNumber);\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"]}
|
|
@@ -4,20 +4,20 @@ import ExpoModulesCore
|
|
|
4
4
|
|
|
5
5
|
public class ExpoSystemUIModule: Module {
|
|
6
6
|
public func definition() -> ModuleDefinition {
|
|
7
|
-
|
|
7
|
+
Name("ExpoSystemUI")
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
OnCreate {
|
|
10
10
|
// TODO: Maybe read from the app manifest instead of from Info.plist.
|
|
11
11
|
// Set / reset the initial color on reload and app start.
|
|
12
12
|
let color = Bundle.main.object(forInfoDictionaryKey: "RCTRootViewBackgroundColor") as? Int
|
|
13
13
|
Self.setBackgroundColorAsync(color: color)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
AsyncFunction("getBackgroundColorAsync") { () -> String? in
|
|
17
17
|
Self.getBackgroundColor()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
AsyncFunction("setBackgroundColorAsync") { (color: Int) in
|
|
21
21
|
Self.setBackgroundColorAsync(color: color)
|
|
22
22
|
}
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-system-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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
|
-
"@expo/config-plugins": "
|
|
35
|
+
"@expo/config-plugins": "~5.0.0",
|
|
36
36
|
"@react-native/normalize-color": "^2.0.0",
|
|
37
37
|
"debug": "^4.3.2"
|
|
38
38
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"expo": "*"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
|
|
49
49
|
}
|
package/src/SystemUI.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorValue, processColor } from 'react-native';
|
|
1
|
+
import { ColorValue, Platform, processColor } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import ExpoSystemUI from './ExpoSystemUI';
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ import ExpoSystemUI from './ExpoSystemUI';
|
|
|
12
12
|
* @param color Any valid [CSS 3 (SVG) color](http://www.w3.org/TR/css3-color/#svg-color).
|
|
13
13
|
*/
|
|
14
14
|
export async function setBackgroundColorAsync(color: ColorValue): Promise<void> {
|
|
15
|
-
const colorNumber = processColor(color);
|
|
15
|
+
const colorNumber = Platform.OS === 'web' ? color : processColor(color);
|
|
16
16
|
return await ExpoSystemUI.setBackgroundColorAsync(colorNumber);
|
|
17
17
|
}
|
|
18
18
|
|
package/tsconfig.json
CHANGED