rn-css 1.6.14-0 → 1.6.14-1
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.
|
@@ -101,7 +101,7 @@ function parseConstraintValue(constraintString) {
|
|
|
101
101
|
return (context) => evaluateConstraint(constraint, context);
|
|
102
102
|
}
|
|
103
103
|
function parse(constraint, previous) {
|
|
104
|
-
const result = constraint.match(/\sand\s|,|\sonly\s|\(|\snot\s/
|
|
104
|
+
const result = constraint.match(/\sand\s|,|\sonly\s|\(|\snot\s/im);
|
|
105
105
|
if (!result) {
|
|
106
106
|
// If we reached the end of the string, we just return the last constraint
|
|
107
107
|
if (constraint.match(/\w/))
|
|
@@ -147,7 +147,8 @@ function parse(constraint, previous) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
const createMedia = (query) => {
|
|
150
|
-
|
|
150
|
+
// We use [\s\S] instead of dotall flag (s) because it is not supported by react-native-windows
|
|
151
|
+
const parsed = query.match(/@media([\s\S]*?){([^{}]*)}/mi);
|
|
151
152
|
if (!parsed)
|
|
152
153
|
throw new Error(`Parsing error: check the syntax of media query ${query}.`);
|
|
153
154
|
const [, constraints, css] = parsed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-css",
|
|
3
|
-
"version": "1.6.14-
|
|
3
|
+
"version": "1.6.14-1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"test": "jest",
|
|
6
6
|
"prepare": "tsc",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"start": "react-native start",
|
|
10
10
|
"lint": "eslint --fix .",
|
|
11
11
|
"build": "webpack",
|
|
12
|
-
"release": "release-it",
|
|
12
|
+
"release": "npm run prepare && release-it",
|
|
13
13
|
"web": "webpack serve --open --mode development"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
@@ -159,7 +159,7 @@ function parseConstraintValue (constraintString: string): Evaluation {
|
|
|
159
159
|
export type Evaluation = (context: Context) => boolean
|
|
160
160
|
|
|
161
161
|
function parse (constraint: string, previous?: Evaluation): Evaluation {
|
|
162
|
-
const result = constraint.match(/\sand\s|,|\sonly\s|\(|\snot\s/
|
|
162
|
+
const result = constraint.match(/\sand\s|,|\sonly\s|\(|\snot\s/im)
|
|
163
163
|
|
|
164
164
|
if (!result) {
|
|
165
165
|
// If we reached the end of the string, we just return the last constraint
|
|
@@ -206,7 +206,8 @@ function parse (constraint: string, previous?: Evaluation): Evaluation {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
export const createMedia = (query: string) => {
|
|
209
|
-
|
|
209
|
+
// We use [\s\S] instead of dotall flag (s) because it is not supported by react-native-windows
|
|
210
|
+
const parsed = query.match(/@media([\s\S]*?){([^{}]*)}/mi)
|
|
210
211
|
if (!parsed) throw new Error(`Parsing error: check the syntax of media query ${query}.`)
|
|
211
212
|
const [, constraints, css] = parsed
|
|
212
213
|
const isValid = parse(constraints)
|