rn-css 1.11.5 → 1.11.7

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.
@@ -34,7 +34,11 @@ export declare function placeContent(value: string): {
34
34
  justifyContent: string;
35
35
  };
36
36
  export declare function background(value: string): {
37
+ background: string;
38
+ backgroundColor?: undefined;
39
+ } | {
37
40
  backgroundColor: string | undefined;
41
+ background?: undefined;
38
42
  };
39
43
  export declare function textDecoration(value: string): {
40
44
  textDecorationLine: string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cornerValue = exports.sideValue = exports.font = exports.transform = exports.textDecoration = exports.background = exports.placeContent = exports.flexFlow = exports.flex = exports.shadow = exports.borderLike = exports.border = void 0;
4
+ const react_native_1 = require("../react-native");
4
5
  /**
5
6
  * Check if the value is a number. Numbers start with a digit, a decimal point or calc(, max( ou min(.
6
7
  * Optionally accept "auto" value (for margins)
@@ -134,10 +135,15 @@ function placeContent(value) {
134
135
  }
135
136
  exports.placeContent = placeContent;
136
137
  function background(value) {
137
- const values = value.split(/\s+/mg);
138
- const color = values.pop();
139
- // The background-color is the only one that we support and it's the last value
140
- return { backgroundColor: isColor(color) ? color : 'transparent' };
138
+ // We support everything on web
139
+ if (react_native_1.Platform.OS === 'web')
140
+ return { background: value };
141
+ else {
142
+ const values = value.split(/\s+/mg);
143
+ const color = values.pop();
144
+ // The background-color is the only one that we support on RN and it's the last value
145
+ return { backgroundColor: isColor(color) ? color : 'transparent' };
146
+ }
141
147
  }
142
148
  exports.background = background;
143
149
  function textDecoration(value) {
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "rn-css",
3
- "version": "1.11.5",
3
+ "version": "1.11.7",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.js",
7
- "types": "./dist/index.d.ts"
7
+ "require": "./dist/index.js"
8
8
  },
9
9
  "./*": {
10
10
  "import": "./dist/*/index.js",
11
- "require": "./dist/*/index.js",
12
- "types": "./dist/*/index.d.ts"
11
+ "require": "./dist/*/index.js"
12
+ }
13
+ },
14
+ "typesVersions": {
15
+ "*": {
16
+ ".": [
17
+ "dist/index.d.ts"
18
+ ],
19
+ "./*": [
20
+ "dist/*/index.d.ts"
21
+ ]
13
22
  }
14
23
  },
15
24
  "scripts": {
@@ -1,3 +1,4 @@
1
+ import { Platform } from '../react-native'
1
2
  import type { Style, Transform } from '../types'
2
3
 
3
4
  /**
@@ -117,10 +118,14 @@ export function placeContent (value: string) {
117
118
  }
118
119
 
119
120
  export function background (value: string) {
120
- const values = value.split(/\s+/mg)
121
- const color = values.pop()
122
- // The background-color is the only one that we support and it's the last value
123
- return { backgroundColor: isColor(color) ? color : 'transparent' }
121
+ // We support everything on web
122
+ if (Platform.OS === 'web') return { background: value }
123
+ else {
124
+ const values = value.split(/\s+/mg)
125
+ const color = values.pop()
126
+ // The background-color is the only one that we support on RN and it's the last value
127
+ return { backgroundColor: isColor(color) ? color : 'transparent' }
128
+ }
124
129
  }
125
130
 
126
131
  export function textDecoration (value: string) {