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.
@@ -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
- this.insets = Insets(statusBarTopInset, insets.bottom, insets.left, insets.right)
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,MAAMA,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;EACA,OAAO,CAACE,KAAK,EAAE,CAAC,CAAC;AACrB,CAAC;AAAAG,OAAA,CAAAJ,UAAA,GAAAA,UAAA","ignoreList":[]}
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":"AAEA,MAAMA,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;EACA,OAAO,CAACE,KAAK,EAAE,CAAC,CAAC;AACrB,CAAC","ignoreList":[]}
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;AAUrC,eAAO,MAAM,UAAU,WAAY,KAAK,UAAS,MAAM,KAAO,CAAC,MAAM,EAAE,MAAM,CAgB5E,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -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.73.4, )",
8
- "resolved": "0.73.4",
9
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
14
- "resolved": "0.73.4",
15
- "contentHash": "wAXa85oSqbf46YRw+00NxWyGv4ABGTwNtutJG+Nfz3C1WzrovMI6kviGoOh2yY2cWeYYcHfuvvw6eKf1RsNCGw==",
13
+ "requested": "[0.74.9, )",
14
+ "resolved": "0.74.9",
15
+ "contentHash": "C+Z2fmjDc7SJXeOWyD/9ImqooU7yX3ALB1Yno2UNYo+Li2SImeG6DdEfcNfSCS2fek1R3znpd6yNEkar/t1n5w==",
16
16
  "dependencies": {
17
- "Microsoft.ReactNative": "0.73.4"
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.211028.7, )",
32
- "resolved": "2.0.211028.7",
33
- "contentHash": "JBGI0c3WLoU6aYJRy9Qo0MLDQfObEp+d4nrhR95iyzf7+HOgjRunHDp/6eGFREd7xq3OI1mll9ecJrMfzBvlyg=="
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.73.4, )",
45
- "resolved": "0.73.4",
46
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
58
- "resolved": "0.73.4",
59
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
71
- "resolved": "0.73.4",
72
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
84
- "resolved": "0.73.4",
85
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
97
- "resolved": "0.73.4",
98
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
110
- "resolved": "0.73.4",
111
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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.73.4, )",
123
- "resolved": "0.73.4",
124
- "contentHash": "F/ttB+b+/Hfpedp9FRQSWJdVExkhdTqcc3VohGez+lOPpdXQeZzNPpqQlO8G4LzK3XlcSs2hZO7WkWEoaxrgOQ=="
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",