react-native-unistyles 2.0.0-beta.2 → 2.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/core/UnistyleRegistry.js +6 -2
- package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.web.js +4 -0
- package/lib/commonjs/core/UnistylesModule.web.js.map +1 -1
- package/lib/commonjs/core/UnistylesRuntime.js +3 -0
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/hooks/index.js +7 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useCSS.js +9 -0
- package/lib/commonjs/hooks/useCSS.js.map +1 -0
- package/lib/commonjs/hooks/useCSS.web.js +46 -0
- package/lib/commonjs/hooks/useCSS.web.js.map +1 -0
- package/lib/commonjs/normalizer/index.js.map +1 -0
- package/lib/commonjs/normalizer/module.d.js.map +1 -0
- package/lib/commonjs/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
- package/lib/commonjs/normalizer/normalizeStyle.js.map +1 -0
- package/lib/commonjs/normalizer/normalizer.js.map +1 -0
- package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +14 -0
- package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +1 -0
- package/lib/commonjs/plugins/index.js +3 -21
- package/lib/commonjs/plugins/index.js.map +1 -1
- package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +1 -1
- package/lib/commonjs/useStyles.js +4 -1
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/cssMediaQuery.js +250 -0
- package/lib/commonjs/utils/cssMediaQuery.js.map +1 -0
- package/lib/commonjs/utils/generateId.js +15 -0
- package/lib/commonjs/utils/generateId.js.map +1 -0
- package/lib/commonjs/utils/hash32.js +43 -0
- package/lib/commonjs/utils/hash32.js.map +1 -0
- package/lib/commonjs/utils/index.js +13 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mqParser.js +2 -1
- package/lib/commonjs/utils/mqParser.js.map +1 -1
- package/lib/commonjs/utils/styles.js +9 -0
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/module/core/UnistyleRegistry.js +7 -3
- package/lib/module/core/UnistyleRegistry.js.map +1 -1
- package/lib/module/core/UnistylesModule.web.js +4 -0
- package/lib/module/core/UnistylesModule.web.js.map +1 -1
- package/lib/module/core/UnistylesRuntime.js +3 -0
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useCSS.js +2 -0
- package/lib/module/hooks/useCSS.js.map +1 -0
- package/lib/module/hooks/useCSS.web.js +39 -0
- package/lib/module/hooks/useCSS.web.js.map +1 -0
- package/lib/module/normalizer/index.js.map +1 -0
- package/lib/module/normalizer/module.d.js.map +1 -0
- package/lib/module/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
- package/lib/module/normalizer/normalizeStyle.js.map +1 -0
- package/lib/module/normalizer/normalizer.js.map +1 -0
- package/lib/module/plugins/cssMediaQueriesPlugin.js +7 -0
- package/lib/module/plugins/cssMediaQueriesPlugin.js.map +1 -0
- package/lib/module/plugins/index.js +1 -1
- package/lib/module/plugins/index.js.map +1 -1
- package/lib/module/plugins/normalizeWebStylesPlugin.js +1 -1
- package/lib/module/plugins/normalizeWebStylesPlugin.js.map +1 -1
- package/lib/module/useStyles.js +5 -2
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/cssMediaQuery.js +243 -0
- package/lib/module/utils/cssMediaQuery.js.map +1 -0
- package/lib/module/utils/generateId.js +7 -0
- package/lib/module/utils/generateId.js.map +1 -0
- package/lib/module/utils/hash32.js +36 -0
- package/lib/module/utils/hash32.js.map +1 -0
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mqParser.js +1 -1
- package/lib/module/utils/mqParser.js.map +1 -1
- package/lib/module/utils/styles.js +9 -0
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.web.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +1 -0
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCSS.d.ts +3 -0
- package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCSS.web.d.ts +3 -0
- package/lib/typescript/src/hooks/useCSS.web.d.ts.map +1 -0
- package/lib/typescript/src/normalizer/index.d.ts.map +1 -0
- package/lib/typescript/src/normalizer/normalizeStyle.d.ts +3 -0
- package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -0
- package/lib/typescript/src/{plugins/normalizer → normalizer}/normalizer.d.ts +1 -1
- package/lib/typescript/src/normalizer/normalizer.d.ts.map +1 -0
- package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +3 -0
- package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +1 -0
- package/lib/typescript/src/plugins/index.d.ts +1 -1
- package/lib/typescript/src/plugins/index.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +2 -1
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/lib/typescript/src/useStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/cssMediaQuery.d.ts +4 -0
- package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +1 -0
- package/lib/typescript/src/utils/generateId.d.ts +2 -0
- package/lib/typescript/src/utils/generateId.d.ts.map +1 -0
- package/lib/typescript/src/utils/hash32.d.ts +2 -0
- package/lib/typescript/src/utils/hash32.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +3 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/mqParser.d.ts +2 -1
- package/lib/typescript/src/utils/mqParser.d.ts.map +1 -1
- package/lib/typescript/src/utils/styles.d.ts +1 -1
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/core/UnistyleRegistry.ts +8 -3
- package/src/core/UnistylesModule.web.ts +4 -0
- package/src/core/UnistylesRuntime.ts +4 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCSS.ts +3 -0
- package/src/hooks/useCSS.web.ts +51 -0
- package/src/{plugins/normalizer → normalizer}/normalizeStyle.ts +2 -2
- package/src/{plugins/normalizer → normalizer}/normalizer.ts +2 -1
- package/src/plugins/cssMediaQueriesPlugin.ts +8 -0
- package/src/plugins/index.ts +1 -1
- package/src/plugins/normalizeWebStylesPlugin.ts +1 -1
- package/src/types/unistyles.ts +3 -2
- package/src/useStyles.ts +10 -2
- package/src/utils/cssMediaQuery.ts +268 -0
- package/src/utils/generateId.ts +10 -0
- package/src/utils/hash32.ts +53 -0
- package/src/utils/index.ts +3 -1
- package/src/utils/mqParser.ts +2 -2
- package/src/utils/styles.ts +10 -1
- package/lib/commonjs/plugins/normalizer/index.js.map +0 -1
- package/lib/commonjs/plugins/normalizer/module.d.js.map +0 -1
- package/lib/commonjs/plugins/normalizer/normalizeStyle.js.map +0 -1
- package/lib/commonjs/plugins/normalizer/normalizer.js.map +0 -1
- package/lib/module/plugins/normalizer/index.js.map +0 -1
- package/lib/module/plugins/normalizer/module.d.js.map +0 -1
- package/lib/module/plugins/normalizer/normalizeStyle.js.map +0 -1
- package/lib/module/plugins/normalizer/normalizer.js.map +0 -1
- package/lib/typescript/src/plugins/normalizer/index.d.ts.map +0 -1
- package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts +0 -3
- package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts.map +0 -1
- package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +0 -1
- /package/lib/commonjs/{plugins/normalizer → normalizer}/index.js +0 -0
- /package/lib/commonjs/{plugins/normalizer → normalizer}/module.d.js +0 -0
- /package/lib/commonjs/{plugins/normalizer → normalizer}/normalizer.js +0 -0
- /package/lib/module/{plugins/normalizer → normalizer}/index.js +0 -0
- /package/lib/module/{plugins/normalizer → normalizer}/module.d.js +0 -0
- /package/lib/module/{plugins/normalizer → normalizer}/normalizer.js +0 -0
- /package/lib/typescript/src/{plugins/normalizer → normalizer}/index.d.ts +0 -0
- /package/src/{plugins/normalizer → normalizer}/index.ts +0 -0
- /package/src/{plugins/normalizer → normalizer}/module.d.ts +0 -0
@@ -0,0 +1,243 @@
|
|
1
|
+
import { normalizeColor } from '../normalizer';
|
2
|
+
import { isUnistylesMq, isValidMq, parseMq } from './mqParser';
|
3
|
+
import { generateReactNativeWebId } from './generateId';
|
4
|
+
export const createMediaQueryForStyles = (styles, runtime) => {
|
5
|
+
const withMediaQueries = Object.entries(styles).filter(_ref => {
|
6
|
+
let [, value] = _ref;
|
7
|
+
return typeof value === 'object';
|
8
|
+
}).reduce((acc, _ref2) => {
|
9
|
+
let [prop, value] = _ref2;
|
10
|
+
const objectKeys = Object.keys(value);
|
11
|
+
const mediaQueries = objectKeys.filter(key => isUnistylesMq(key));
|
12
|
+
const breakpoints = objectKeys.filter(key => runtime.breakpoints[key]);
|
13
|
+
if (mediaQueries.length === 0 && breakpoints.length === 0) {
|
14
|
+
return acc;
|
15
|
+
}
|
16
|
+
const className = generateReactNativeWebId(prop, '""');
|
17
|
+
const breakpointsStyles = getBreakpointsStyles(prop, value, runtime, className);
|
18
|
+
const mediaQueriesStyles = getMediaQueriesFromMQ(prop, value, className);
|
19
|
+
return {
|
20
|
+
...acc,
|
21
|
+
[prop]: `
|
22
|
+
${breakpointsStyles}
|
23
|
+
${mediaQueriesStyles}
|
24
|
+
`.trim()
|
25
|
+
};
|
26
|
+
}, {});
|
27
|
+
return {
|
28
|
+
...styles,
|
29
|
+
...withMediaQueries
|
30
|
+
};
|
31
|
+
};
|
32
|
+
const getMaxWidthMediaQuery = width => {
|
33
|
+
if (!width) {
|
34
|
+
return '';
|
35
|
+
}
|
36
|
+
if (width.to === Infinity) {
|
37
|
+
return '';
|
38
|
+
}
|
39
|
+
return `and (max-width: ${width.to}px)`;
|
40
|
+
};
|
41
|
+
const getMaxHeightMediaQuery = height => {
|
42
|
+
if (!height) {
|
43
|
+
return '';
|
44
|
+
}
|
45
|
+
if (height.to === Infinity) {
|
46
|
+
return '';
|
47
|
+
}
|
48
|
+
return `and (max-height: ${height.to}px)`;
|
49
|
+
};
|
50
|
+
const getMediaQueriesFromMQ = (prop, value, className) => Object.entries(value).reduce((acc, _ref3) => {
|
51
|
+
let [key, value] = _ref3;
|
52
|
+
const result = parseMq(key);
|
53
|
+
if (!isValidMq(result)) {
|
54
|
+
return acc;
|
55
|
+
}
|
56
|
+
if (result.width && result.height) {
|
57
|
+
return `${acc}
|
58
|
+
|
59
|
+
@media screen and (min-width: ${result.width.from}px) and (min-height: ${result.height.from}px) ${getMaxWidthMediaQuery(result.width)} ${getMaxHeightMediaQuery(result.height)} {
|
60
|
+
.${className} {
|
61
|
+
${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
|
62
|
+
}
|
63
|
+
}
|
64
|
+
`;
|
65
|
+
}
|
66
|
+
if (result.width) {
|
67
|
+
return `${acc}
|
68
|
+
|
69
|
+
@media screen and (min-width: ${result.width.from}px) ${getMaxWidthMediaQuery(result.width)} {
|
70
|
+
.${className} {
|
71
|
+
${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
|
72
|
+
}
|
73
|
+
}
|
74
|
+
`;
|
75
|
+
}
|
76
|
+
if (result.height) {
|
77
|
+
return `${acc}
|
78
|
+
|
79
|
+
@media screen and (min-height: ${result.height.from}px) ${getMaxHeightMediaQuery(result.height)} {
|
80
|
+
.${className} {
|
81
|
+
${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
|
82
|
+
}
|
83
|
+
}
|
84
|
+
`;
|
85
|
+
}
|
86
|
+
return acc;
|
87
|
+
}, '');
|
88
|
+
const getBreakpointsStyles = (prop, value, runtime, className) => Object.entries(value).reduce((acc, _ref4) => {
|
89
|
+
let [key, value] = _ref4;
|
90
|
+
const breakpoint = runtime.breakpoints[key];
|
91
|
+
if (breakpoint === undefined) {
|
92
|
+
return acc;
|
93
|
+
}
|
94
|
+
return `${acc}
|
95
|
+
|
96
|
+
@media screen and (min-width: ${breakpoint}px) {
|
97
|
+
.${className} {
|
98
|
+
${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
|
99
|
+
}
|
100
|
+
}
|
101
|
+
`;
|
102
|
+
}, '');
|
103
|
+
const normalizePropName = prop => prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
104
|
+
const normalizeWebValue = (prop, value) => {
|
105
|
+
if (value === undefined) {
|
106
|
+
return 'unset';
|
107
|
+
}
|
108
|
+
switch (prop) {
|
109
|
+
// colors
|
110
|
+
case 'color':
|
111
|
+
case 'backgroundColor':
|
112
|
+
case 'borderColor':
|
113
|
+
case 'borderBottomColor':
|
114
|
+
case 'borderLeftColor':
|
115
|
+
case 'borderRightColor':
|
116
|
+
case 'borderTopColor':
|
117
|
+
case 'borderBlockColor':
|
118
|
+
case 'borderBlockEndColor':
|
119
|
+
case 'borderBlockStartColor':
|
120
|
+
case 'textDecorationColor':
|
121
|
+
return normalizeColor(value);
|
122
|
+
|
123
|
+
// dimensions
|
124
|
+
case 'width':
|
125
|
+
case 'height':
|
126
|
+
case 'minWidth':
|
127
|
+
case 'minHeight':
|
128
|
+
case 'maxWidth':
|
129
|
+
case 'maxHeight':
|
130
|
+
case 'borderRadius':
|
131
|
+
case 'borderWidth':
|
132
|
+
case 'borderBottomLeftRadius':
|
133
|
+
case 'borderBottomRightRadius':
|
134
|
+
case 'borderEndEndRadius':
|
135
|
+
case 'borderEndStartRadius':
|
136
|
+
case 'borderStartEndRadius':
|
137
|
+
case 'borderStartStartRadius':
|
138
|
+
case 'borderTopLeftRadius':
|
139
|
+
case 'borderTopRightRadius':
|
140
|
+
case 'borderBottomWidth':
|
141
|
+
case 'borderLeftWidth':
|
142
|
+
case 'borderRightWidth':
|
143
|
+
case 'borderTopWidth':
|
144
|
+
case 'bottom':
|
145
|
+
case 'left':
|
146
|
+
case 'right':
|
147
|
+
case 'top':
|
148
|
+
case 'marginTop':
|
149
|
+
case 'marginBottom':
|
150
|
+
case 'marginLeft':
|
151
|
+
case 'marginRight':
|
152
|
+
case 'paddingTop':
|
153
|
+
case 'paddingBottom':
|
154
|
+
case 'paddingLeft':
|
155
|
+
case 'paddingRight':
|
156
|
+
case 'flexBasis':
|
157
|
+
case 'rowGap':
|
158
|
+
case 'columnGap':
|
159
|
+
case 'gap':
|
160
|
+
case 'margin':
|
161
|
+
case 'padding':
|
162
|
+
case 'fontSize':
|
163
|
+
case 'letterSpacing':
|
164
|
+
return `${value}px`;
|
165
|
+
|
166
|
+
// without unit
|
167
|
+
case 'borderStyle':
|
168
|
+
case 'pointerEvents':
|
169
|
+
case 'backfaceVisibility':
|
170
|
+
case 'alignContent':
|
171
|
+
case 'alignItems':
|
172
|
+
case 'alignSelf':
|
173
|
+
case 'flexDirection':
|
174
|
+
case 'flexWrap':
|
175
|
+
case 'flex':
|
176
|
+
case 'aspectRatio':
|
177
|
+
case 'opacity':
|
178
|
+
case 'direction':
|
179
|
+
case 'zIndex':
|
180
|
+
case 'justifyContent':
|
181
|
+
case 'overflow':
|
182
|
+
case 'display':
|
183
|
+
case 'position':
|
184
|
+
case 'flexGrow':
|
185
|
+
case 'flexShrink':
|
186
|
+
case 'fontFamily':
|
187
|
+
case 'fontStyle':
|
188
|
+
case 'textDecorationLine':
|
189
|
+
case 'textAlign':
|
190
|
+
case 'textDecorationStyle':
|
191
|
+
case 'lineHeight':
|
192
|
+
case 'textTransform':
|
193
|
+
case 'fontVariant':
|
194
|
+
case 'verticalAlign':
|
195
|
+
case 'objectFit':
|
196
|
+
return value;
|
197
|
+
|
198
|
+
// to be transformed for now
|
199
|
+
// not supported
|
200
|
+
case 'marginHorizontal':
|
201
|
+
case 'paddingHorizontal':
|
202
|
+
case 'marginVertical':
|
203
|
+
case 'paddingVertical':
|
204
|
+
case 'shadowColor':
|
205
|
+
case 'shadowOffset':
|
206
|
+
case 'shadowOpacity':
|
207
|
+
case 'shadowRadius':
|
208
|
+
case 'transform':
|
209
|
+
case 'transformMatrix':
|
210
|
+
case 'fontWeight':
|
211
|
+
case 'textShadowOffset':
|
212
|
+
case 'textShadowRadius':
|
213
|
+
case 'textShadowColor':
|
214
|
+
return '';
|
215
|
+
|
216
|
+
// unsupported
|
217
|
+
case 'borderStartColor':
|
218
|
+
case 'borderEndColor':
|
219
|
+
case 'borderEndWidth':
|
220
|
+
case 'borderBottomEndRadius':
|
221
|
+
case 'borderBottomStartRadius':
|
222
|
+
case 'borderCurve':
|
223
|
+
case 'elevation':
|
224
|
+
case 'borderTopEndRadius':
|
225
|
+
case 'borderTopStartRadius':
|
226
|
+
case 'borderStartWidth':
|
227
|
+
case 'start':
|
228
|
+
case 'end':
|
229
|
+
case 'margin-end':
|
230
|
+
case 'margin-start':
|
231
|
+
case 'padding-end':
|
232
|
+
case 'padding-start':
|
233
|
+
case 'writingDirection':
|
234
|
+
case 'textAlignVertical':
|
235
|
+
case 'includeFontPadding':
|
236
|
+
case 'resizeMode':
|
237
|
+
case 'overlayColor':
|
238
|
+
case 'tintColor':
|
239
|
+
default:
|
240
|
+
return '';
|
241
|
+
}
|
242
|
+
};
|
243
|
+
//# sourceMappingURL=cssMediaQuery.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["normalizeColor","isUnistylesMq","isValidMq","parseMq","generateReactNativeWebId","createMediaQueryForStyles","styles","runtime","withMediaQueries","Object","entries","filter","_ref","value","reduce","acc","_ref2","prop","objectKeys","keys","mediaQueries","key","breakpoints","length","className","breakpointsStyles","getBreakpointsStyles","mediaQueriesStyles","getMediaQueriesFromMQ","trim","getMaxWidthMediaQuery","width","to","Infinity","getMaxHeightMediaQuery","height","_ref3","result","from","normalizePropName","normal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gBAAgB;IACrB,KAAK,gBAAgB;IACrB,KAAK,uBAAuB;IAC5B,KAAK,yBAAyB;IAC9B,KAAK,aAAa;IAClB,KAAK,WAAW;IAChB,KAAK,oBAAoB;IACzB,KAAK,sBAAsB;IAC3B,KAAK,kBAAkB;IACvB,KAAK,OAAO;IACZ,KAAK,KAAK;IACV,KAAK,YAAY;IACjB,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,eAAe;IACpB,KAAK,kBAAkB;IACvB,KAAK,mBAAmB;IACxB,KAAK,oBAAoB;IACzB,KAAK,YAAY;IACjB,KAAK,cAAc;IACnB,KAAK,WAAW;IAChB;MACI,OAAO,EAAE;EACjB;AACJ,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
// eslint-disable-next-line camelcase
|
2
|
+
import { murmurhash2_32_gc } from './hash32';
|
3
|
+
export const generateReactNativeWebId = (key, value) => {
|
4
|
+
const hashedString = murmurhash2_32_gc(key + value, 1).toString(36);
|
5
|
+
return process.env.NODE_ENV !== 'production' ? `r-${key}-${hashedString}` : `r-${hashedString}`;
|
6
|
+
};
|
7
|
+
//# sourceMappingURL=generateId.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["murmurhash2_32_gc","generateReactNativeWebId","key","value","hashedString","toString","process","env","NODE_ENV"],"sourceRoot":"../../../src","sources":["utils/generateId.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,UAAU;AAE5C,OAAO,MAAMC,wBAAwB,GAAGA,CAACC,GAAW,EAAEC,KAAa,KAAa;EAC5E,MAAMC,YAAY,GAAGJ,iBAAiB,CAACE,GAAG,GAAGC,KAAK,EAAE,CAAC,CAAC,CAACE,QAAQ,CAAC,EAAE,CAAC;EAEnE,OAAOC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACrC,KAAIN,GAAI,IAAGE,YAAa,EAAC,GACzB,KAAIA,YAAa,EAAC;AAC7B,CAAC"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/*
|
2
|
+
Authors: Gary Court and Austin Appleby
|
3
|
+
Compatible with React Native Web
|
4
|
+
https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/compiler/hash.js#L65
|
5
|
+
*/
|
6
|
+
export const murmurhash2_32_gc = (str, seed) => {
|
7
|
+
let l = str.length;
|
8
|
+
let h = seed ^ l;
|
9
|
+
let i = 0;
|
10
|
+
let k;
|
11
|
+
while (l >= 4) {
|
12
|
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
13
|
+
k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
|
14
|
+
k ^= k >>> 24;
|
15
|
+
k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
|
16
|
+
h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
|
17
|
+
l -= 4;
|
18
|
+
++i;
|
19
|
+
}
|
20
|
+
switch (l) {
|
21
|
+
// @ts-ignore
|
22
|
+
case 3:
|
23
|
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
24
|
+
// @ts-ignore
|
25
|
+
case 2:
|
26
|
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
27
|
+
case 1:
|
28
|
+
h ^= str.charCodeAt(i) & 0xff;
|
29
|
+
h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
|
30
|
+
}
|
31
|
+
h ^= h >>> 13;
|
32
|
+
h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
|
33
|
+
h ^= h >>> 15;
|
34
|
+
return h >>> 0;
|
35
|
+
};
|
36
|
+
//# sourceMappingURL=hash32.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["murmurhash2_32_gc","str","seed","l","length","h","i","k","charCodeAt"],"sourceRoot":"../../../src","sources":["utils/hash32.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAGA,CAACC,GAAW,EAAEC,IAAY,KAAK;EAC5D,IAAIC,CAAC,GAAGF,GAAG,CAACG,MAAM;EAClB,IAAIC,CAAC,GAAGH,IAAI,GAAGC,CAAC;EAChB,IAAIG,CAAC,GAAG,CAAC;EACT,IAAIC,CAAC;EAEL,OAAOJ,CAAC,IAAI,CAAC,EAAE;IACXI,CAAC,GACAN,GAAG,CAACO,UAAU,CAACF,CAAC,CAAC,GAAG,IAAI,GACxB,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,CAAE,GAClC,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,EAAG,GACnC,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,EAAG;IAEpCC,CAAC,GACD,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;IACxEA,CAAC,IAAIA,CAAC,KAAK,EAAE;IACbA,CAAC,GACD,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;IAExEF,CAAC,GACA,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IACvB,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC,GAC9CE,CAAC;IAEDJ,CAAC,IAAI,CAAC;IACN,EAAEG,CAAC;EACP;EAEA,QAAQH,CAAC;IACL;IACA,KAAK,CAAC;MACFE,CAAC,IAAI,CAACJ,GAAG,CAACO,UAAU,CAACF,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,EAAE;IAC7C;IACA,KAAK,CAAC;MACFD,CAAC,IAAI,CAACJ,GAAG,CAACO,UAAU,CAACF,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC;IAC5C,KAAK,CAAC;MACFD,CAAC,IAAIJ,GAAG,CAACO,UAAU,CAACF,CAAC,CAAC,GAAG,IAAI;MAC7BD,CAAC,GACH,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IACxB,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;EAClD;EAEAA,CAAC,IAAIA,CAAC,KAAK,EAAE;EACbA,CAAC,GAAG,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;EAC5EA,CAAC,IAAIA,CAAC,KAAK,EAAE;EAEb,OAAOA,CAAC,KAAK,CAAC;AAClB,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { mq } from './mq';
|
2
|
-
export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq } from './mqParser';
|
2
|
+
export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq, isUnistylesMq } from './mqParser';
|
3
3
|
export { getValueForBreakpoint } from './breakpoints';
|
4
4
|
export { proxifyFunction, parseStyle } from './styles';
|
5
5
|
export { withPlugins } from './withPlugins';
|
6
|
+
export { generateReactNativeWebId } from './generateId';
|
6
7
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","getValueForBreakpoint","proxifyFunction","parseStyle","withPlugins"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;
|
1
|
+
{"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","isUnistylesMq","getValueForBreakpoint","proxifyFunction","parseStyle","withPlugins","generateReactNativeWebId"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,EAAEC,aAAa,QAAQ,YAAY;AACvH,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,wBAAwB,QAAQ,cAAc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","from","Number","to","undefined","isUnistylesMq","test","isValidMq","parsedMq","isWithinTheWidthAndHeight","screenSize","isWithinTheWidth","isWithinTheHeight","screenWidth","screenHeight","getKeyForUnistylesMediaQuery","mediaQueries","find","_ref","key","at"],"sourceRoot":"../../../src","sources":["utils/mqParser.ts"],"mappings":"AAEA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAYpE,OAAO,MAAMC,OAAO,GAAIC,EAAU,IAAwB;EACtD,MAAM,GAAGC,KAAK,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGN,qBAAqB,CAACO,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAClE,MAAM,GAAGK,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGT,sBAAsB,CAACM,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHC,KAAK,EAAEA,KAAK,GAAG;MACXO,IAAI,EAAEC,MAAM,CAACP,KAAK,CAAC;MACnBQ,EAAE,EAAED,MAAM,CAACN,GAAG;IAClB,CAAC,GAAGQ,SAAS;IACbN,MAAM,EAAEA,MAAM,GAAG;MACbG,IAAI,EAAEC,MAAM,CAACH,KAAK,CAAC;MACnBI,EAAE,EAAED,MAAM,CAACF,GAAG;IAClB,CAAC,GAAGI;EACR,CAAC;AACL,CAAC;AAED,MAAMC,aAAa,GAAIZ,EAAU,IAAKJ,kBAAkB,CAACiB,IAAI,CAACb,EAAE,CAAC;
|
1
|
+
{"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","from","Number","to","undefined","isUnistylesMq","test","isValidMq","parsedMq","isWithinTheWidthAndHeight","screenSize","isWithinTheWidth","isWithinTheHeight","screenWidth","screenHeight","getKeyForUnistylesMediaQuery","mediaQueries","find","_ref","key","at"],"sourceRoot":"../../../src","sources":["utils/mqParser.ts"],"mappings":"AAEA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAYpE,OAAO,MAAMC,OAAO,GAAIC,EAAU,IAAwB;EACtD,MAAM,GAAGC,KAAK,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGN,qBAAqB,CAACO,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAClE,MAAM,GAAGK,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGT,sBAAsB,CAACM,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHC,KAAK,EAAEA,KAAK,GAAG;MACXO,IAAI,EAAEC,MAAM,CAACP,KAAK,CAAC;MACnBQ,EAAE,EAAED,MAAM,CAACN,GAAG;IAClB,CAAC,GAAGQ,SAAS;IACb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,gBAAgB,GAAGA,CAACjB,KAAiC,EAAEmB,WAAmB,KAAc;EAC1F,MAAM;IAAEZ,IAAI;IAAEE;EAAG,CAAC,GAAGT,KAA0B;EAE/C,OAAOmB,WAAW,IAAIZ,IAAI,IAAIY,WAAW,IAAIV,EAAE;AACnD,CAAC;AAED,MAAMS,iBAAiB,GAAGA,CAACd,MAAmC,EAAEgB,YAAoB,KAAc;EAC9F,MAAM;IAAEb,IAAI;IAAEE;EAAG,CAAC,GAAGL,MAA2B;EAEhD,OAAOgB,YAAY,IAAIb,IAAI,IAAIa,YAAY,IAAIX,EAAE;AACrD,CAAC;AAED,OAAO,MAAMY,4BAA4B,GAAGA,CAACC,YAAsC,EAAEN,UAAsB,KAAuB;EAC9H,MAAMjB,EAAE,GAAGuB,YAAY,CAACC,IAAI,CAACC,IAAA,IAAW;IAAA,IAAV,CAACC,GAAG,CAAC,GAAAD,IAAA;IAC/B,IAAI,CAACb,aAAa,CAACc,GAAa,CAAC,EAAE;MAC/B,OAAO,KAAK;IAChB;IAEA,MAAMX,QAAQ,GAAGhB,OAAO,CAAC2B,GAAa,CAAC;IAEvC,IAAI,CAACZ,SAAS,CAACC,QAAQ,CAAC,EAAE;MACtB,OAAO,KAAK;IAChB;IAEA,OAAOC,yBAAyB,CAACD,QAAQ,EAAEE,UAAU,CAAC;EAC1D,CAAC,CAAC;EAEF,OAAOjB,EAAE,EAAE2B,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"}
|
@@ -12,6 +12,7 @@ export const isPlatformColor = value => {
|
|
12
12
|
};
|
13
13
|
export const parseStyle = function (style) {
|
14
14
|
let variant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
15
|
+
let parseMediaQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
15
16
|
return Object.entries(style || {}).reduce((acc, _ref) => {
|
16
17
|
let [key, value] = _ref;
|
17
18
|
// nested objects
|
@@ -40,6 +41,14 @@ export const parseStyle = function (style) {
|
|
40
41
|
}), {})
|
41
42
|
};
|
42
43
|
}
|
44
|
+
|
45
|
+
// don't parse media queries and breakpoints
|
46
|
+
if (!parseMediaQueries) {
|
47
|
+
return {
|
48
|
+
...acc,
|
49
|
+
[key]: value
|
50
|
+
};
|
51
|
+
}
|
43
52
|
return {
|
44
53
|
...acc,
|
45
54
|
[key]: getValueForBreakpoint(value)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","arguments","length","undefined","Object","entries","reduce","acc","_ref","Array","isArray","map","keys"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAKT,WAAW,CAACE,GAAG,EAAEQ,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIb,KAAK,EAAE;IACP,OAAO,UAAU,IAAIa,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOf,SAAS,IAAI,gBAAgB,IAAIc,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAAO,MAAMJ,UAAU,GAAG,SAAAA,CACtBK,KAAQ;EAAA,IACRX,OAAyC,GAAAY,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,
|
1
|
+
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","arguments","length","undefined","parseMediaQueries","Object","entries","reduce","acc","_ref","Array","isArray","map","keys"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAKT,WAAW,CAACE,GAAG,EAAEQ,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIb,KAAK,EAAE;IACP,OAAO,UAAU,IAAIa,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOf,SAAS,IAAI,gBAAgB,IAAIc,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAAO,MAAMJ,UAAU,GAAG,SAAAA,CACtBK,KAAQ;EAAA,IACRX,OAAyC,GAAAY,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,IAC9CG,iBAAiB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IA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AGW,GAAG;MACN,CAACrB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;IACjE,CAAC;EACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAItE,qBAAa,gBAAgB;IAUb,OAAO,CAAC,eAAe;IAT5B,MAAM,EAAE,eAAe,CAAK;IAC5B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAE9B;IACD,UAAU,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAK;IAC7C,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe;sCAcL,oBAAoB;;gCAW9B,eAAe;;;;;4BAAf,eAAe;;;;MAb1C;IAEM,cAAc,gBAAiB,oBAAoB;4BAd9B,eAAe;;gCAyBf,eAAe;;;;;4BAAf,eAAe;;;;MAF1C;IAEM,SAAS,WAAY,eAAe;sCAXL,oBAAoB;gCAd9B,eAAe;;;;;;4BAAf,eAAe;;;;
|
1
|
+
{"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAItE,qBAAa,gBAAgB;IAUb,OAAO,CAAC,eAAe;IAT5B,MAAM,EAAE,eAAe,CAAK;IAC5B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAE9B;IACD,UAAU,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAK;IAC7C,MAAM,EAAE,eAAe,CAAwB;IAC/C,WAAW,EAAE,oBAAoB,CAA6B;IAC9D,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAK;gBAEpG,eAAe,EAAE,eAAe;IAE7C,SAAS,WAAY,eAAe;sCAcL,oBAAoB;;gCAW9B,eAAe;;;;;4BAAf,eAAe;;;;MAb1C;IAEM,cAAc,gBAAiB,oBAAoB;4BAd9B,eAAe;;gCAyBf,eAAe;;;;;4BAAf,eAAe;;;;MAF1C;IAEM,SAAS,WAAY,eAAe;sCAXL,oBAAoB;gCAd9B,eAAe;;;;;;4BAAf,eAAe;;;;MAiD1C;IAEM,QAAQ,YAAa,MAAM,eAAe,WAchD;IAEM,SAAS,WAAY,eAAe,WAAU,OAAO,UAW3D;IAEM,YAAY,WAAY,eAAe,UAO7C;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAwB;CACzE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesModule.web.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.web.ts"],"names":[],"mappings":"AAKA,qBAAa,kBAAkB;;;
|
1
|
+
{"version":3,"file":"UnistylesModule.web.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.web.ts"],"names":[],"mappings":"AAKA,qBAAa,kBAAkB;;;IAmBpB,OAAO;IA4Dd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
|
@@ -9,6 +9,7 @@ export declare class UnistylesRuntime {
|
|
9
9
|
get hasAdaptiveThemes(): boolean;
|
10
10
|
get themeName(): never;
|
11
11
|
get breakpoint(): keyof import("../global").UnistylesBreakpoints;
|
12
|
+
get breakpoints(): import("../global").UnistylesBreakpoints;
|
12
13
|
get enabledPlugins(): string[];
|
13
14
|
get screen(): {
|
14
15
|
width: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG,IAAW,WAAW,uCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,SAAS,UAEnB;IAED,IAAW,UAAU,mDAEpB;IAED,IAAW,cAAc,aAExB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,6BAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAEM,SAAS,WAAY,eAAe,UAE1C;IAEM,YAAY,WAAY,eAAe,UAE7C;CACJ"}
|
1
|
+
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG,IAAW,WAAW,uCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,SAAS,UAEnB;IAED,IAAW,UAAU,mDAEpB;IAED,IAAW,WAAW,6CAErB;IAED,IAAW,cAAc,aAExB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,6BAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAEM,SAAS,WAAY,eAAe,UAE1C;IAEM,YAAY,WAAY,eAAe,UAE7C;CACJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,MAAM,gDAA+C,IAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCSS.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.web.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,eAAO,MAAM,MAAM,mDA6ClB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"normalizeStyle.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizeStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoE,OAAO,EAAE,MAAM,UAAU,CAAA;AAuDzG,eAAO,MAAM,cAAc,oCAwB1B,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { TextShadow, Transforms, BoxShadow } from '
|
1
|
+
import type { TextShadow, Transforms, BoxShadow } from '../types';
|
2
2
|
type Preprocessor = {
|
3
3
|
createTextShadowValue(style: TextShadow): string;
|
4
4
|
createBoxShadowValue(style: Required<BoxShadow>): string;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../../src/normalizer/normalizer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAY,MAAM,UAAU,CAAA;AAE3E,KAAK,YAAY,GAAG;IAChB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC;IACjD,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IACzD,oBAAoB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;CAClE,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,MAAM,YAAW,MAAM,WAyB5D,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,MAAM,oBAAiC,CAAA;AAyDpF,eAAO,MAAM,YAAY,EAAE,YAI1B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cssMediaQueriesPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/cssMediaQueriesPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,eAAO,MAAM,qBAAqB,EAAE,eAGnC,CAAA"}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export { normalizeWebStylesPlugin } from './normalizeWebStylesPlugin';
|
2
|
-
export {
|
2
|
+
export { cssMediaQueriesPlugin } from './cssMediaQueriesPlugin';
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA"}
|
@@ -5,8 +5,9 @@ import type { UnistylesPlugin } from './plugin';
|
|
5
5
|
export type ColorSchemeName = 'light' | 'dark' | 'unspecified';
|
6
6
|
export type UnistylesConfig = {
|
7
7
|
adaptiveThemes?: boolean;
|
8
|
-
experimentalPlugins?: Array<UnistylesPlugin>;
|
9
8
|
initialTheme?: keyof UnistylesThemes;
|
9
|
+
plugins?: Array<UnistylesPlugin>;
|
10
|
+
experimentalCSSMediaQueries?: boolean;
|
10
11
|
};
|
11
12
|
export type UnistylesBridge = {
|
12
13
|
screenWidth: number;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAA;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,
|
1
|
+
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAA;AAE9D,MAAM,MAAM,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U,CAAC;QACnB,UAAU,EAAE,MAAM,oBAAoB,CAAC;QACvC,WAAW,EAAE,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAA;KACxE,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,0BAA0B,GAAG,oBAAoB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIpH,KAAK,gBAAgB,CAAC,EAAE,SAAS,yBAAyB,IAAI;IAC1D,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,gJAsCrB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cssMediaQuery.d.ts","sourceRoot":"","sources":["../../../../src/utils/cssMediaQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,eAAO,MAAM,yBAAyB,WAAY,OAAO,WAAW,gBAAgB,KAAG,OA8BtF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generateId.d.ts","sourceRoot":"","sources":["../../../../src/utils/generateId.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,QAAS,MAAM,SAAS,MAAM,KAAG,MAMrE,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hash32.d.ts","sourceRoot":"","sources":["../../../../src/utils/hash32.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,QAAS,MAAM,QAAQ,MAAM,WA+C1D,CAAA"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
export { mq } from './mq';
|
2
|
-
export {
|
2
|
+
export type { UnistylesParsedMq } from './mqParser';
|
3
|
+
export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq, isUnistylesMq } from './mqParser';
|
3
4
|
export { getValueForBreakpoint } from './breakpoints';
|
4
5
|
export { proxifyFunction, parseStyle } from './styles';
|
5
6
|
export { withPlugins } from './withPlugins';
|
7
|
+
export { generateReactNativeWebId } from './generateId';
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA"}
|
@@ -3,11 +3,12 @@ type ParsedMqDimension = {
|
|
3
3
|
from: number;
|
4
4
|
to: number;
|
5
5
|
};
|
6
|
-
type UnistylesParsedMq = {
|
6
|
+
export type UnistylesParsedMq = {
|
7
7
|
width?: ParsedMqDimension;
|
8
8
|
height?: ParsedMqDimension;
|
9
9
|
};
|
10
10
|
export declare const parseMq: (mq: string) => UnistylesParsedMq;
|
11
|
+
export declare const isUnistylesMq: (mq: string) => boolean;
|
11
12
|
export declare const isValidMq: (parsedMq: UnistylesParsedMq) => boolean;
|
12
13
|
export declare const isWithinTheWidthAndHeight: (parsedMq: UnistylesParsedMq, screenSize: ScreenSize) => boolean;
|
13
14
|
export declare const getKeyForUnistylesMediaQuery: (mediaQueries: Array<[string, RNValue]>, screenSize: ScreenSize) => Optional<string>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mqParser.d.ts","sourceRoot":"","sources":["../../../../src/utils/mqParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAM7D,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AAED,
|
1
|
+
{"version":3,"file":"mqParser.d.ts","sourceRoot":"","sources":["../../../../src/utils/mqParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAM7D,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,OAAO,OAAQ,MAAM,KAAG,iBAcpC,CAAA;AAED,eAAO,MAAM,aAAa,OAAQ,MAAM,YAAgC,CAAA;AAExE,eAAO,MAAM,SAAS,aAAc,iBAAiB,YAgBpD,CAAA;AAED,eAAO,MAAM,yBAAyB,aAAc,iBAAiB,cAAc,UAAU,KAAG,OAgB/F,CAAA;AAcD,eAAO,MAAM,4BAA4B,iBAAkB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,cAAc,UAAU,KAAG,SAAS,MAAM,CAgB5H,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Optional, RNStyle } from '../types';
|
2
2
|
export declare const proxifyFunction: (key: string, fn: Function, variant?: Record<string, Optional<string>>) => Function;
|
3
3
|
export declare const isPlatformColor: <T extends {}>(value: T) => boolean;
|
4
|
-
export declare const parseStyle: <T extends RNStyle>(style: T, variant?: Record<string, Optional<string
|
4
|
+
export declare const parseStyle: <T extends RNStyle>(style: T, variant?: Record<string, Optional<string>>, parseMediaQueries?: boolean) => T;
|
5
5
|
//# sourceMappingURL=styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,8BAA6B,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,0CAEV,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAW,MAAM,UAAU,CAAA;AAK1D,eAAO,MAAM,eAAe,QACnB,MAAM,MACP,QAAQ,YACF,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,KAC3C,QAED,CAAA;AAEF,eAAO,MAAM,eAAe,8BAA6B,OAMxD,CAAA;AAED,eAAO,MAAM,UAAU,0CAEV,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC,CAAC,mCAkD9B,CAAA"}
|