react-native-unistyles 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/java/com/unistyles/Platform.kt +6 -1
- package/lib/commonjs/utils/parseColor.js +5 -0
- package/lib/commonjs/utils/parseColor.js.map +1 -1
- package/lib/module/utils/parseColor.js +5 -0
- package/lib/module/utils/parseColor.js.map +1 -1
- package/lib/typescript/src/utils/parseColor.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/utils/parseColor.ts +6 -0
- package/windows/ReactNativeUnistyles/packages.lock.json +31 -31
@@ -99,7 +99,12 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
|
|
99
99
|
|
100
100
|
val insets = insetsCompat.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
|
101
101
|
|
102
|
-
|
102
|
+
// reports inset bottom as 0 when keyboard is visible
|
103
|
+
// otherwise it will break other libraries that manipulates bottom insets
|
104
|
+
val imeInsets = insetsCompat.getInsets(WindowInsetsCompat.Type.ime())
|
105
|
+
val insetsBottom = if (imeInsets.bottom > 0) 0 else insets.bottom
|
106
|
+
|
107
|
+
this.insets = Insets(statusBarTopInset, insetsBottom, insets.left, insets.right)
|
103
108
|
}
|
104
109
|
|
105
110
|
fun getInsets(): Insets {
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.parseColor = void 0;
|
7
|
+
var _common = require("../common");
|
7
8
|
const parseAlpha = alpha => {
|
8
9
|
if (alpha > 1 || alpha < 0) {
|
9
10
|
return 1;
|
@@ -22,7 +23,11 @@ const parseColor = (color, alpha = 1) => {
|
|
22
23
|
if (color.startsWith('#') && color.length === 7) {
|
23
24
|
return [color, parseAlpha(alpha)];
|
24
25
|
}
|
26
|
+
if (_common.isIOS && color === 'transparent') {
|
27
|
+
return ['#000000', 0];
|
28
|
+
}
|
25
29
|
|
30
|
+
// todo remove this with Unistyles 3.0
|
26
31
|
// named colors
|
27
32
|
return [color, 1];
|
28
33
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["parseAlpha","alpha","parseColor","color","startsWith","length","exports"],"sourceRoot":"../../../src","sources":["utils/parseColor.ts"],"mappings":";;;;;;AAEA,
|
1
|
+
{"version":3,"names":["_common","require","parseAlpha","alpha","parseColor","color","startsWith","length","isIOS","exports"],"sourceRoot":"../../../src","sources":["utils/parseColor.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,UAAU,GAAIC,KAAa,IAAK;EAClC,IAAIA,KAAK,GAAG,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;IACxB,OAAO,CAAC;EACZ;EAEA,OAAOA,KAAK;AAChB,CAAC;AAEM,MAAMC,UAAU,GAAGA,CAACC,KAAa,EAAEF,KAAa,GAAG,CAAC,KAAuB;EAC9E,IAAI,CAACE,KAAK,EAAE;IACR,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;EAClB;;EAEA;EACA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAE,CAAC,CAAC;EACrB;EAEA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAEH,UAAU,CAACC,KAAK,CAAC,CAAC;EACrC;EAEA,IAAIK,aAAK,IAAIH,KAAK,KAAK,aAAa,EAAE;IAClC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;EACzB;;EAEA;EACA;EACA,OAAO,CAACA,KAAK,EAAE,CAAC,CAAC;AACrB,CAAC;AAAAI,OAAA,CAAAL,UAAA,GAAAA,UAAA","ignoreList":[]}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { isIOS } from '../common';
|
1
2
|
const parseAlpha = alpha => {
|
2
3
|
if (alpha > 1 || alpha < 0) {
|
3
4
|
return 1;
|
@@ -16,7 +17,11 @@ export const parseColor = (color, alpha = 1) => {
|
|
16
17
|
if (color.startsWith('#') && color.length === 7) {
|
17
18
|
return [color, parseAlpha(alpha)];
|
18
19
|
}
|
20
|
+
if (isIOS && color === 'transparent') {
|
21
|
+
return ['#000000', 0];
|
22
|
+
}
|
19
23
|
|
24
|
+
// todo remove this with Unistyles 3.0
|
20
25
|
// named colors
|
21
26
|
return [color, 1];
|
22
27
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["parseAlpha","alpha","parseColor","color","startsWith","length"],"sourceRoot":"../../../src","sources":["utils/parseColor.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["isIOS","parseAlpha","alpha","parseColor","color","startsWith","length"],"sourceRoot":"../../../src","sources":["utils/parseColor.ts"],"mappings":"AACA,SAASA,KAAK,QAAQ,WAAW;AAEjC,MAAMC,UAAU,GAAIC,KAAa,IAAK;EAClC,IAAIA,KAAK,GAAG,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;IACxB,OAAO,CAAC;EACZ;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAMC,UAAU,GAAGA,CAACC,KAAa,EAAEF,KAAa,GAAG,CAAC,KAAuB;EAC9E,IAAI,CAACE,KAAK,EAAE;IACR,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;EAClB;;EAEA;EACA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAE,CAAC,CAAC;EACrB;EAEA,IAAIA,KAAK,CAACC,UAAU,CAAC,GAAG,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC,EAAE;IAC7C,OAAO,CAACF,KAAK,EAAEH,UAAU,CAACC,KAAK,CAAC,CAAC;EACrC;EAEA,IAAIF,KAAK,IAAII,KAAK,KAAK,aAAa,EAAE;IAClC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;EACzB;;EAEA;EACA;EACA,OAAO,CAACA,KAAK,EAAE,CAAC,CAAC;AACrB,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parseColor.d.ts","sourceRoot":"","sources":["../../../../src/utils/parseColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
1
|
+
{"version":3,"file":"parseColor.d.ts","sourceRoot":"","sources":["../../../../src/utils/parseColor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAWrC,eAAO,MAAM,UAAU,WAAY,KAAK,UAAS,MAAM,KAAO,CAAC,MAAM,EAAE,MAAM,CAqB5E,CAAA"}
|
package/package.json
CHANGED
package/src/utils/parseColor.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { Color } from '../types'
|
2
|
+
import { isIOS } from '../common'
|
2
3
|
|
3
4
|
const parseAlpha = (alpha: number) => {
|
4
5
|
if (alpha > 1 || alpha < 0) {
|
@@ -22,6 +23,11 @@ export const parseColor = (color?: Color, alpha: number = 1): [string, number] =
|
|
22
23
|
return [color, parseAlpha(alpha)]
|
23
24
|
}
|
24
25
|
|
26
|
+
if (isIOS && color === 'transparent') {
|
27
|
+
return ['#000000', 0]
|
28
|
+
}
|
29
|
+
|
30
|
+
// todo remove this with Unistyles 3.0
|
25
31
|
// named colors
|
26
32
|
return [color, 1]
|
27
33
|
}
|
@@ -4,17 +4,17 @@
|
|
4
4
|
"native,Version=v0.0": {
|
5
5
|
"Microsoft.ReactNative": {
|
6
6
|
"type": "Direct",
|
7
|
-
"requested": "[0.
|
8
|
-
"resolved": "0.
|
9
|
-
"contentHash": "
|
7
|
+
"requested": "[0.74.9, )",
|
8
|
+
"resolved": "0.74.9",
|
9
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
10
10
|
},
|
11
11
|
"Microsoft.ReactNative.Cxx": {
|
12
12
|
"type": "Direct",
|
13
|
-
"requested": "[0.
|
14
|
-
"resolved": "0.
|
15
|
-
"contentHash": "
|
13
|
+
"requested": "[0.74.9, )",
|
14
|
+
"resolved": "0.74.9",
|
15
|
+
"contentHash": "C+Z2fmjDc7SJXeOWyD/9ImqooU7yX3ALB1Yno2UNYo+Li2SImeG6DdEfcNfSCS2fek1R3znpd6yNEkar/t1n5w==",
|
16
16
|
"dependencies": {
|
17
|
-
"Microsoft.ReactNative": "0.
|
17
|
+
"Microsoft.ReactNative": "0.74.9"
|
18
18
|
}
|
19
19
|
},
|
20
20
|
"Microsoft.UI.Xaml": {
|
@@ -28,9 +28,9 @@
|
|
28
28
|
},
|
29
29
|
"Microsoft.Windows.CppWinRT": {
|
30
30
|
"type": "Direct",
|
31
|
-
"requested": "[2.0.
|
32
|
-
"resolved": "2.0.
|
33
|
-
"contentHash": "
|
31
|
+
"requested": "[2.0.230706.1, )",
|
32
|
+
"resolved": "2.0.230706.1",
|
33
|
+
"contentHash": "l0D7oCw/5X+xIKHqZTi62TtV+1qeSz7KVluNFdrJ9hXsst4ghvqQ/Yhura7JqRdZWBXAuDS0G0KwALptdoxweQ=="
|
34
34
|
},
|
35
35
|
"Microsoft.Web.WebView2": {
|
36
36
|
"type": "Transitive",
|
@@ -41,9 +41,9 @@
|
|
41
41
|
"native,Version=v0.0/win10-arm": {
|
42
42
|
"Microsoft.ReactNative": {
|
43
43
|
"type": "Direct",
|
44
|
-
"requested": "[0.
|
45
|
-
"resolved": "0.
|
46
|
-
"contentHash": "
|
44
|
+
"requested": "[0.74.9, )",
|
45
|
+
"resolved": "0.74.9",
|
46
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
47
47
|
},
|
48
48
|
"Microsoft.Web.WebView2": {
|
49
49
|
"type": "Transitive",
|
@@ -54,9 +54,9 @@
|
|
54
54
|
"native,Version=v0.0/win10-arm-aot": {
|
55
55
|
"Microsoft.ReactNative": {
|
56
56
|
"type": "Direct",
|
57
|
-
"requested": "[0.
|
58
|
-
"resolved": "0.
|
59
|
-
"contentHash": "
|
57
|
+
"requested": "[0.74.9, )",
|
58
|
+
"resolved": "0.74.9",
|
59
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
60
60
|
},
|
61
61
|
"Microsoft.Web.WebView2": {
|
62
62
|
"type": "Transitive",
|
@@ -67,9 +67,9 @@
|
|
67
67
|
"native,Version=v0.0/win10-arm64-aot": {
|
68
68
|
"Microsoft.ReactNative": {
|
69
69
|
"type": "Direct",
|
70
|
-
"requested": "[0.
|
71
|
-
"resolved": "0.
|
72
|
-
"contentHash": "
|
70
|
+
"requested": "[0.74.9, )",
|
71
|
+
"resolved": "0.74.9",
|
72
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
73
73
|
},
|
74
74
|
"Microsoft.Web.WebView2": {
|
75
75
|
"type": "Transitive",
|
@@ -80,9 +80,9 @@
|
|
80
80
|
"native,Version=v0.0/win10-x64": {
|
81
81
|
"Microsoft.ReactNative": {
|
82
82
|
"type": "Direct",
|
83
|
-
"requested": "[0.
|
84
|
-
"resolved": "0.
|
85
|
-
"contentHash": "
|
83
|
+
"requested": "[0.74.9, )",
|
84
|
+
"resolved": "0.74.9",
|
85
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
86
86
|
},
|
87
87
|
"Microsoft.Web.WebView2": {
|
88
88
|
"type": "Transitive",
|
@@ -93,9 +93,9 @@
|
|
93
93
|
"native,Version=v0.0/win10-x64-aot": {
|
94
94
|
"Microsoft.ReactNative": {
|
95
95
|
"type": "Direct",
|
96
|
-
"requested": "[0.
|
97
|
-
"resolved": "0.
|
98
|
-
"contentHash": "
|
96
|
+
"requested": "[0.74.9, )",
|
97
|
+
"resolved": "0.74.9",
|
98
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
99
99
|
},
|
100
100
|
"Microsoft.Web.WebView2": {
|
101
101
|
"type": "Transitive",
|
@@ -106,9 +106,9 @@
|
|
106
106
|
"native,Version=v0.0/win10-x86": {
|
107
107
|
"Microsoft.ReactNative": {
|
108
108
|
"type": "Direct",
|
109
|
-
"requested": "[0.
|
110
|
-
"resolved": "0.
|
111
|
-
"contentHash": "
|
109
|
+
"requested": "[0.74.9, )",
|
110
|
+
"resolved": "0.74.9",
|
111
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
112
112
|
},
|
113
113
|
"Microsoft.Web.WebView2": {
|
114
114
|
"type": "Transitive",
|
@@ -119,9 +119,9 @@
|
|
119
119
|
"native,Version=v0.0/win10-x86-aot": {
|
120
120
|
"Microsoft.ReactNative": {
|
121
121
|
"type": "Direct",
|
122
|
-
"requested": "[0.
|
123
|
-
"resolved": "0.
|
124
|
-
"contentHash": "
|
122
|
+
"requested": "[0.74.9, )",
|
123
|
+
"resolved": "0.74.9",
|
124
|
+
"contentHash": "BmRwnI3nOZu8V78pBRQmkBfg09sKcM8dtqSUmGtH3W2auQtJjioa7cbnARkDhOb1cPCC+qELJHtQstHhSW2aoA=="
|
125
125
|
},
|
126
126
|
"Microsoft.Web.WebView2": {
|
127
127
|
"type": "Transitive",
|