react-native-unistyles 2.0.0-alpha.5 → 2.0.0-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/UnistylesRuntime.cpp +262 -0
- package/cxx/UnistylesRuntime.h +61 -0
- package/lib/commonjs/Unistyles.js +1 -1
- package/lib/commonjs/Unistyles.js.map +1 -1
- package/lib/commonjs/UnistylesEngine.js +9 -5
- package/lib/commonjs/UnistylesEngine.js.map +1 -1
- package/lib/commonjs/createStyleSheet.js.map +1 -1
- package/lib/commonjs/types/cxx.js.map +1 -1
- package/lib/commonjs/useStyles.js +0 -2
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/breakpoints.js +11 -68
- package/lib/commonjs/utils/breakpoints.js.map +1 -1
- package/lib/commonjs/utils/common.js +3 -1
- package/lib/commonjs/utils/common.js.map +1 -1
- package/lib/commonjs/utils/mediaQueries.js +57 -155
- package/lib/commonjs/utils/mediaQueries.js.map +1 -1
- package/lib/commonjs/utils/styles.js +11 -51
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/module/Unistyles.js +2 -2
- package/lib/module/Unistyles.js.map +1 -1
- package/lib/module/UnistylesEngine.js +7 -3
- package/lib/module/UnistylesEngine.js.map +1 -1
- package/lib/module/createStyleSheet.js.map +1 -1
- package/lib/module/types/cxx.js.map +1 -1
- package/lib/module/useStyles.js +0 -3
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/breakpoints.js +11 -68
- package/lib/module/utils/breakpoints.js.map +1 -1
- package/lib/module/utils/common.js +2 -0
- package/lib/module/utils/common.js.map +1 -1
- package/lib/module/utils/mediaQueries.js +57 -155
- package/lib/module/utils/mediaQueries.js.map +1 -1
- package/lib/module/utils/styles.js +10 -51
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/typescript/src/Unistyles.d.ts +2 -2
- package/lib/typescript/src/Unistyles.d.ts.map +1 -1
- package/lib/typescript/src/UnistylesEngine.d.ts +4 -1
- package/lib/typescript/src/UnistylesEngine.d.ts.map +1 -1
- package/lib/typescript/src/createStyleSheet.d.ts +2 -5
- package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +2 -1
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/core.d.ts +18 -16
- package/lib/typescript/src/types/core.d.ts.map +1 -1
- package/lib/typescript/src/types/cxx.d.ts +7 -1
- package/lib/typescript/src/types/cxx.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/mediaQueries.d.ts +5 -3
- package/lib/typescript/src/types/mediaQueries.d.ts.map +1 -1
- package/lib/typescript/src/useStyles.d.ts +1 -3
- package/lib/typescript/src/useStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/breakpoints.d.ts +2 -60
- package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/utils/common.d.ts +2 -0
- package/lib/typescript/src/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/utils/mediaQueries.d.ts +8 -127
- package/lib/typescript/src/utils/mediaQueries.d.ts.map +1 -1
- package/lib/typescript/src/utils/styles.d.ts +1 -46
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/package.json +10 -1
- package/src/Unistyles.ts +3 -3
- package/src/UnistylesEngine.ts +12 -3
- package/src/createStyleSheet.ts +2 -5
- package/src/types/breakpoints.ts +6 -3
- package/src/types/core.ts +25 -22
- package/src/types/cxx.ts +8 -1
- package/src/types/index.ts +1 -1
- package/src/types/mediaQueries.ts +9 -4
- package/src/useStyles.ts +3 -6
- package/src/utils/breakpoints.ts +14 -71
- package/src/utils/common.ts +2 -0
- package/src/utils/mediaQueries.ts +102 -163
- package/src/utils/styles.ts +13 -55
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","throwError","message","Error","warn","console","isMobile","OS","isWeb","isServer","window","Orientation","Landscape","Portrait"],"sourceRoot":"../../../src","sources":["utils/common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,UAAU,GAAIC,OAAe,IAAK;EAC3C,MAAM,IAAIC,KAAK,CAAE,gCAA+BD,OAAQ,EAAC,CAAC;AAC9D,CAAC;AAED,OAAO,MAAME,IAAI,GAAIF,OAAe,IAAK;EACrCG,OAAO,CAACD,IAAI,CAAE,gCAA+BF,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAMI,QAAQ,GAAGN,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIP,QAAQ,CAACO,EAAE,KAAK,KAAK;AAC1E,OAAO,MAAMC,KAAK,GAAGR,QAAQ,CAACO,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,WAAW,GAAG;EACvBC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU"}
|
1
|
+
{"version":3,"names":["Platform","throwError","message","Error","warn","console","isMobile","OS","isWeb","isIOS","isAndroid","isServer","window","Orientation","Landscape","Portrait"],"sourceRoot":"../../../src","sources":["utils/common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,UAAU,GAAIC,OAAe,IAAK;EAC3C,MAAM,IAAIC,KAAK,CAAE,gCAA+BD,OAAQ,EAAC,CAAC;AAC9D,CAAC;AAED,OAAO,MAAME,IAAI,GAAIF,OAAe,IAAK;EACrCG,OAAO,CAACD,IAAI,CAAE,gCAA+BF,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAMI,QAAQ,GAAGN,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIP,QAAQ,CAACO,EAAE,KAAK,KAAK;AAC1E,OAAO,MAAMC,KAAK,GAAGR,QAAQ,CAACO,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,KAAK,GAAGT,QAAQ,CAACO,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMG,SAAS,GAAGV,QAAQ,CAACO,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMI,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,WAAW,GAAG;EACvBC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU"}
|
@@ -1,182 +1,84 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
* @example
|
11
|
-
* extractValues("w[100,200]") // returns [100, 200]
|
12
|
-
* extractValues("h[300]") // returns [300]
|
13
|
-
* extractValues("h[,300]") // returns [0,300]
|
14
|
-
* extractValues("h[100,]") // returns [100]
|
15
|
-
*/
|
16
|
-
export const extractValues = codedValue => {
|
17
|
-
const cleanedValue = codedValue.replace(/[wh ]/g, '');
|
18
|
-
const [left, right] = cleanedValue.split(',');
|
19
|
-
if (!right) {
|
20
|
-
const lh = left.startsWith('[') ? Number(left.replace(/[[\]()]/g, '')) : Number(left.replace(/[[\]()]/g, '')) + 1;
|
21
|
-
return [lh];
|
1
|
+
const parseLhs = (lhs, breakpoints, hasRhs) => {
|
2
|
+
const matches = lhs.match(/([([])|([^[\]()]+)|([\])])/g);
|
3
|
+
if (!hasRhs) {
|
4
|
+
const [openBracket, value, closeBracket] = matches;
|
5
|
+
const spacelessValue = value?.trim();
|
6
|
+
const parsedNumber = Number(spacelessValue);
|
7
|
+
const parsedValue = isNaN(parsedNumber) ? breakpoints[spacelessValue] : parsedNumber;
|
8
|
+
return [Number(openBracket === '('), closeBracket === ')' ? parsedValue - 1 : parsedValue];
|
22
9
|
}
|
23
|
-
const
|
24
|
-
|
25
|
-
|
10
|
+
const [openBracket, value] = matches;
|
11
|
+
if (!value) {
|
12
|
+
return [Number(openBracket === '(')];
|
13
|
+
}
|
14
|
+
const spacelessValue = value?.trim();
|
15
|
+
const parsedNumber = Number(spacelessValue);
|
16
|
+
const parsedValue = isNaN(parsedNumber) ? breakpoints[spacelessValue] : parsedNumber;
|
17
|
+
return openBracket === '(' ? [parsedValue - 1] : [parsedValue];
|
18
|
+
};
|
19
|
+
const parseRhs = (rhs, breakpoints) => {
|
20
|
+
const matches = rhs.match(/([([])|([^[\]()]+)|([\])])/g);
|
21
|
+
const [value, closeBrackets] = matches;
|
22
|
+
const spacelessValue = value.trim();
|
23
|
+
const parsedNumber = Number(spacelessValue);
|
24
|
+
const parsedValue = isNaN(parsedNumber) ? breakpoints[spacelessValue] : parsedNumber;
|
25
|
+
return [closeBrackets === ')' ? parsedValue - 1 : parsedValue];
|
26
|
+
};
|
27
|
+
export const extractValues = (pattern, breakpoints) => {
|
28
|
+
const [lhs, rhs] = pattern.replace(/(:w|:h)/g, '').split(',');
|
29
|
+
if (!rhs) {
|
30
|
+
return parseLhs(lhs, breakpoints, false);
|
31
|
+
}
|
32
|
+
const [parsedLhs] = parseLhs(lhs, breakpoints, true);
|
33
|
+
if (parsedLhs === undefined || isNaN(parsedLhs)) {
|
34
|
+
return [];
|
35
|
+
}
|
36
|
+
const [parsedRhs] = parseRhs(rhs, breakpoints);
|
37
|
+
if (parsedRhs === undefined || isNaN(parsedRhs)) {
|
38
|
+
return [];
|
39
|
+
}
|
40
|
+
return [parsedLhs, parsedRhs];
|
26
41
|
};
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
* specified by the breakpoint query. The query can specify width (using 'w'), height (using 'h'),
|
33
|
-
* or both.
|
34
|
-
*
|
35
|
-
* @param {string} query - The breakpoint query string. Examples: 'w[100,200]', 'h[300]', 'w[100,200]h[300,400]'.
|
36
|
-
* @param {ScreenSize} screenSize - The screen size to check against the breakpoint query.
|
37
|
-
* @returns {boolean} True if the screen size matches the breakpoint query, false otherwise.
|
38
|
-
*
|
39
|
-
* @example
|
40
|
-
* const screenSize = { width: 150, height: 350 }
|
41
|
-
* isWithinBreakpoint('w[100,200]', screenSize) // returns true
|
42
|
-
* isWithinBreakpoint('h[400]', screenSize) // returns false
|
43
|
-
*/
|
44
|
-
export const isWithinBreakpoint = (query, screenSize) => {
|
45
|
-
if (query.includes('w') && query.includes('h')) {
|
46
|
-
return isWithinTheWidthAndHeight(query, screenSize);
|
42
|
+
export const isWithinBreakpoint = (query, screenSize, breakpoints) => {
|
43
|
+
const hasWidthBreakpoint = query.includes(':w');
|
44
|
+
const hasHeightBreakpoint = query.includes(':h');
|
45
|
+
if (hasWidthBreakpoint && hasHeightBreakpoint) {
|
46
|
+
return isWithinTheWidthAndHeight(query, screenSize, breakpoints);
|
47
47
|
}
|
48
|
-
if (
|
49
|
-
return isWithinTheWidth(query, screenSize.width);
|
48
|
+
if (hasWidthBreakpoint) {
|
49
|
+
return isWithinTheWidth(query, screenSize.width, breakpoints);
|
50
50
|
}
|
51
|
-
if (
|
52
|
-
return isWithinTheHeight(query, screenSize.height);
|
51
|
+
if (hasHeightBreakpoint) {
|
52
|
+
return isWithinTheHeight(query, screenSize.height, breakpoints);
|
53
53
|
}
|
54
54
|
return false;
|
55
55
|
};
|
56
|
-
|
57
|
-
|
58
|
-
* Determines if the given width matches the specified width range in the query.
|
59
|
-
*
|
60
|
-
* The function checks if the provided width falls within the range specified by the query.
|
61
|
-
* The query specifies a width range using a format like 'w[100,200]'. If only one value is provided,
|
62
|
-
* it's treated as a minimum width.
|
63
|
-
*
|
64
|
-
* @param {string} query - The width query string. Examples: 'w[100,200]' or 'w[100]'.
|
65
|
-
* @param {number} width - The width to check against the query.
|
66
|
-
* @returns {boolean} True if the width matches the query range, false otherwise.
|
67
|
-
*
|
68
|
-
* @example
|
69
|
-
* isWithinTheWidth('w[100,200]', 150) // returns true
|
70
|
-
* isWithinTheWidth('w[100]', 50) // returns false
|
71
|
-
* isWithinTheWidth('w[100]', 150) // returns true
|
72
|
-
*/
|
73
|
-
export const isWithinTheWidth = (query, width) => {
|
74
|
-
const [minWidth, maxWidth] = extractValues(query);
|
56
|
+
export const isWithinTheWidth = (query, width, breakpoints) => {
|
57
|
+
const [minWidth, maxWidth] = extractValues(query, breakpoints);
|
75
58
|
if (maxWidth && width >= minWidth && width <= maxWidth) {
|
76
59
|
return true;
|
77
60
|
}
|
78
61
|
return !maxWidth && width >= minWidth;
|
79
62
|
};
|
80
|
-
|
81
|
-
|
82
|
-
* Determines if the given height matches the specified height range in the query.
|
83
|
-
*
|
84
|
-
* The function checks if the provided height falls within the range specified by the query.
|
85
|
-
* The query specifies a height range using a format like 'h[100,200]'. If only one value is provided,
|
86
|
-
* it's treated as a minimum height.
|
87
|
-
*
|
88
|
-
* @param {string} query - The height query string. Examples: 'h[100,200]' or 'h[100]'.
|
89
|
-
* @param {number} height - The height to check against the query.
|
90
|
-
* @returns {boolean} True if the height matches the query range, false otherwise.
|
91
|
-
*
|
92
|
-
* @example
|
93
|
-
* isWithinTheHeight('h[100,200]', 150) // returns true
|
94
|
-
* isWithinTheHeight('h[100]', 50) // returns false
|
95
|
-
* isWithinTheHeight('h[100]', 150) // returns true
|
96
|
-
*/
|
97
|
-
export const isWithinTheHeight = (query, height) => {
|
98
|
-
const [minHeight, maxHeight] = extractValues(query);
|
63
|
+
export const isWithinTheHeight = (query, height, breakpoints) => {
|
64
|
+
const [minHeight, maxHeight] = extractValues(query, breakpoints);
|
99
65
|
if (maxHeight && height >= minHeight && height <= maxHeight) {
|
100
66
|
return true;
|
101
67
|
}
|
102
68
|
return !maxHeight && height >= minHeight;
|
103
69
|
};
|
104
|
-
|
105
|
-
|
106
|
-
* Determines if the given screen size matches both the specified width and height ranges in the query.
|
107
|
-
*
|
108
|
-
* The function checks if the provided screen size (both width and height) falls within the ranges
|
109
|
-
* specified by the query. The query can specify both width and height using a format like 'w[100,200]:h[300,400]'.
|
110
|
-
*
|
111
|
-
* @param {string} query - The combined width and height query string. Example: 'w[100,200]:h[300,400]'.
|
112
|
-
* @param {ScreenSize} screenSize - The screen size to check against the query.
|
113
|
-
* @returns {boolean} True if the screen size matches both the width and height ranges in the query, false otherwise.
|
114
|
-
*
|
115
|
-
* @example
|
116
|
-
* const screenSize = { width: 150, height: 350 }
|
117
|
-
* isWithinTheWidthAndHeight('w[100,200]:h[300,400]', screenSize) // returns true
|
118
|
-
* isWithinTheWidthAndHeight('w[100,200]:h[400,500]', screenSize) // returns false
|
119
|
-
*/
|
120
|
-
export const isWithinTheWidthAndHeight = (query, screenSize) => {
|
121
|
-
const result = query.split(':').filter(Boolean).map(q => isWithinBreakpoint(q, screenSize)).filter(Boolean);
|
70
|
+
export const isWithinTheWidthAndHeight = (query, screenSize, breakpoints) => {
|
71
|
+
const result = query.split(':').filter(Boolean).map(q => isWithinBreakpoint(`:${q}`, screenSize, breakpoints)).filter(Boolean);
|
122
72
|
return result.length === 2;
|
123
73
|
};
|
124
|
-
|
125
|
-
/**
|
126
|
-
* Checks if the given query string is a valid custom media query.
|
127
|
-
*
|
128
|
-
* The valid custom media query formats include:
|
129
|
-
* - :w[200]
|
130
|
-
* - :w[0, 200]
|
131
|
-
* - :w[, 300]
|
132
|
-
* - :h[200]
|
133
|
-
* - :h[0, 500]
|
134
|
-
* - :h[,200]
|
135
|
-
* - :w[100, 300]:h[200,500]
|
136
|
-
* - :h[200,500]:w[100, 300]
|
137
|
-
*
|
138
|
-
* @param {string} query - The query string to be checked.
|
139
|
-
* @returns {boolean} Returns `true` if the query is a valid custom media query, otherwise `false`.
|
140
|
-
* @example
|
141
|
-
*
|
142
|
-
* isMediaQuery(':w[200]') // true
|
143
|
-
* isMediaQuery(':w100]') // false
|
144
|
-
*/
|
145
74
|
export const isMediaQuery = query => {
|
146
|
-
const regex =
|
75
|
+
const regex = /(:w|:h)/;
|
147
76
|
return query.length > 0 && regex.test(query);
|
148
77
|
};
|
149
|
-
|
150
|
-
/**
|
151
|
-
* Retrieves the first matching custom media query key based on the provided screen size.
|
152
|
-
*
|
153
|
-
* The function processes an array of media queries and returns the first query that matches
|
154
|
-
* the given screen size. The media queries can be in formats like:
|
155
|
-
* - w[200]
|
156
|
-
* - w[0, 200]
|
157
|
-
* - w[, 300]
|
158
|
-
* - h[200]
|
159
|
-
* - h[0, 500]
|
160
|
-
* - h[,200]
|
161
|
-
* - w[100, 300]:h[200,500]
|
162
|
-
* - h[200,500]:w[100, 300]
|
163
|
-
*
|
164
|
-
* @param {Array<[string, string | number]>} mediaQueries - An array of tuples containing media query keys and associated values.
|
165
|
-
* @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
|
166
|
-
* @returns {string | undefined} Returns the first matching media query key or `undefined` if no match is found.
|
167
|
-
* @example
|
168
|
-
*
|
169
|
-
* const queries = [[':w[200]', 'value1'], [':h[300,500]', 'value2']]
|
170
|
-
* const size = { width: 250, height: 400 }
|
171
|
-
* getKeyForCustomMediaQuery(queries, size) // ':w[200]
|
172
|
-
*/
|
173
|
-
export const getKeyForCustomMediaQuery = (mediaQueries, screenSize) => {
|
78
|
+
export const getKeyForCustomMediaQuery = (mediaQueries, screenSize, breakpoints) => {
|
174
79
|
const [matchedQuery] = mediaQueries.flatMap(_ref => {
|
175
80
|
let [key] = _ref;
|
176
|
-
|
177
|
-
return isWithinBreakpoint(key, screenSize) ? key : undefined;
|
178
|
-
}
|
179
|
-
return key.split(':').filter(Boolean).map(query => isWithinBreakpoint(query, screenSize) ? key : undefined);
|
81
|
+
return isWithinBreakpoint(key, screenSize, breakpoints) ? key : undefined;
|
180
82
|
}).filter(Boolean);
|
181
83
|
return matchedQuery;
|
182
84
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["parseLhs","lhs","breakpoints","hasRhs","matches","match","openBracket","value","closeBracket","spacelessValue","trim","parsedNumber","Number","parsedValue","isNaN","parseRhs","rhs","closeBrackets","extractValues","pattern","replace","split","parsedLhs","undefined","parsedRhs","isWithinBreakpoint","query","screenSize","hasWidthBreakpoint","includes","hasHeightBreakpoint","isWithinTheWidthAndHeight","isWithinTheWidth","width","isWithinTheHeight","height","minWidth","maxWidth","minHeight","maxHeight","result","filter","Boolean","map","q","length","isMediaQuery","regex","test","getKeyForCustomMediaQuery","mediaQueries","matchedQuery","flatMap","_ref","key"],"sourceRoot":"../../../src","sources":["utils/mediaQueries.ts"],"mappings":"AAIA,MAAMA,QAAQ,GAAGA,CAACC,GAAW,EAAEC,WAAiC,EAAEC,MAAe,KAAK;EAClF,MAAMC,OAAO,GAAGH,GAAG,CAACI,KAAK,CAAC,6BAA6B,CAAC;EAExD,IAAI,CAACF,MAAM,EAAE;IACT,MAAM,CAACG,WAAW,EAAEC,KAAK,EAAEC,YAAY,CAAC,GAAGJ,OAAoC;IAC/E,MAAMK,cAAc,GAAGF,KAAK,EAAEG,IAAI,CAAC,CAAC;IACpC,MAAMC,YAAY,GAAGC,MAAM,CAACH,cAAc,CAAC;IAE3C,MAAMI,WAAW,GAAGC,KAAK,CAACH,YAAY,CAAC,GACjCT,WAAW,CAACO,cAAc,CAA+B,GACzDE,YAAY;IAElB,OAAO,CACHC,MAAM,CAACN,WAAW,KAAK,GAAG,CAAC,EAC3BE,YAAY,KAAK,GAAG,GACdK,WAAW,GAAG,CAAC,GACfA,WAAW,CACpB;EACL;EAEA,MAAM,CAACP,WAAW,EAAEC,KAAK,CAAC,GAAGH,OAA2B;EAExD,IAAI,CAACG,KAAK,EAAE;IACR,OAAO,CAACK,MAAM,CAACN,WAAW,KAAK,GAAG,CAAC,CAAC;EACxC;EAEA,MAAMG,cAAc,GAAGF,KAAK,EAAEG,IAAI,CAAC,CAAC;EACpC,MAAMC,YAAY,GAAGC,MAAM,CAACH,cAAc,CAAC;EAE3C,MAAMI,WAAW,GAAGC,KAAK,CAACH,YAAY,CAAC,GACjCT,WAAW,CAACO,cAAc,CAA+B,GACzDE,YAAY;EAElB,OAAOL,WAAW,KAAK,GAAG,GACpB,CAACO,WAAW,GAAG,CAAC,CAAC,GACjB,CAACA,WAAW,CAAC;AACvB,CAAC;AAED,MAAME,QAAQ,GAAGA,CAACC,GAAW,EAAEd,WAAiC,KAAK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,EAAEC,UAAsB,EAAEzB,WAAiC,KAAc;EAC5H,MAAMsC,MAAM,GAAGd,KAAK,CACfL,KAAK,CAAC,GAAG,CAAC,CACVoB,MAAM,CAACC,OAAO,CAAC,CACfC,GAAG,CAACC,CAAC,IAAInB,kBAAkB,CAAE,IAAGmB,CAAE,EAAC,EAAEjB,UAAU,EAAEzB,WAAW,CAAC,CAAC,CAC9DuC,MAAM,CAACC,OAAO,CAAC;EAEpB,OAAOF,MAAM,CAACK,MAAM,KAAK,CAAC;AAC9B,CAAC;AAED,OAAO,MAAMC,YAAY,GAAIpB,KAAa,IAAc;EACpD,MAAMqB,KAAK,GAAG,SAAS;EAEvB,OAAOrB,KAAK,CAACmB,MAAM,GAAG,CAAC,IAAIE,KAAK,CAACC,IAAI,CAACtB,KAAK,CAAC;AAChD,CAAC;AAED,OAAO,MAAMuB,yBAAyB,GAAGA,CACrCC,YAA6F,EAC7FvB,UAAsB,EACtBzB,WAAiC,KACZ;EACrB,MAAM,CAACiD,YAAY,CAAC,GAAGD,YAAY,CAC9BE,OAAO,CAACC,IAAA;IAAA,IAAC,CAACC,GAAG,CAAC,GAAAD,IAAA;IAAA,OAAK5B,kBAAkB,CAAC6B,GAAG,EAAE3B,UAAU,EAAEzB,WAAW,CAAC,GAAGoD,GAAG,GAAG/B,SAAS;EAAA,EAAC,CACtFkB,MAAM,CAACC,OAAO,CAAC;EAEpB,OAAOS,YAAY;AACvB,CAAC"}
|
@@ -1,58 +1,17 @@
|
|
1
1
|
import { getValueForBreakpoint } from './breakpoints';
|
2
2
|
import { normalizeStyles } from './normalizeStyles';
|
3
|
-
import { isWeb } from './common';
|
4
|
-
/**
|
5
|
-
* Proxies a function to parse its return value for custom media queries or breakpoints.
|
6
|
-
*
|
7
|
-
* @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
|
8
|
-
*
|
9
|
-
* @param {Function} fn - The function to be proxified.
|
10
|
-
* @param {keyof B & string} breakpoint - The breakpoint name to check against.
|
11
|
-
* @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
|
12
|
-
* @param breakpointPairs - sorted pairs of breakpoints
|
13
|
-
*
|
14
|
-
* @returns {Function} Returns the proxified function
|
15
|
-
*
|
16
|
-
* @example
|
17
|
-
*
|
18
|
-
* const myFunction = () => ({ ':w[200]': 'value1', sm: 'value2' })
|
19
|
-
* const screenSize = { width: 250, height: 400 }
|
20
|
-
* const breakpoints = { sm: 300, md: 600 }
|
21
|
-
*
|
22
|
-
* const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
|
23
|
-
* proxifiedFunction() // parsed style based on screenSize and breakpoints
|
24
|
-
*/
|
3
|
+
import { isAndroid, isIOS, isWeb } from './common';
|
25
4
|
export const proxifyFunction = (fn, breakpoint, screenSize) => new Proxy(fn, {
|
26
5
|
apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize)
|
27
6
|
});
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
*
|
35
|
-
* @template T - The type of the style object.
|
36
|
-
* @template B - An object type where keys represent breakpoint names and values represent breakpoint values.
|
37
|
-
*
|
38
|
-
* @param {CustomNamedStyles<T, B>} style - The style object to be parsed.
|
39
|
-
* @param {keyof B & string} breakpoint - The breakpoint name to check against.
|
40
|
-
* @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
|
41
|
-
* @param breakpointPairs - sorted pairs of breakpoints
|
42
|
-
*
|
43
|
-
* @returns {Record<string, string | number | Function>} Returns the parsed style object with resolved custom media queries or breakpoints.
|
44
|
-
*
|
45
|
-
* @example
|
46
|
-
*
|
47
|
-
* const style = { fontSize: { sm: '12px', md: '16px' } }
|
48
|
-
* const screenSize = { width: 300, height: 400 }
|
49
|
-
* const breakpoints = { xs: 0, sm: 300, md: 600 }
|
50
|
-
*
|
51
|
-
* const parsedStyle = parseStyle(style, 'sm', screenSize, breakpoints)
|
52
|
-
* // { fontSize: '12px' }
|
53
|
-
*/
|
7
|
+
export const isPlatformColor = value => {
|
8
|
+
if (isIOS) {
|
9
|
+
return 'semantic' in value && typeof value.semantic === 'object';
|
10
|
+
}
|
11
|
+
return isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object';
|
12
|
+
};
|
54
13
|
export const parseStyle = (style, breakpoint, screenSize) => {
|
55
|
-
const entries = Object.entries(style);
|
14
|
+
const entries = Object.entries(style || {});
|
56
15
|
const parsedStyles = Object.fromEntries(entries.map(_ref => {
|
57
16
|
let [key, value] = _ref;
|
58
17
|
const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
|
@@ -64,11 +23,11 @@ export const parseStyle = (style, breakpoint, screenSize) => {
|
|
64
23
|
return [key, value.map(value => parseStyle(value, breakpoint, screenSize))];
|
65
24
|
}
|
66
25
|
const isDynamicFunction = typeof value === 'function';
|
67
|
-
const isValidStyle = typeof value !== 'object';
|
26
|
+
const isValidStyle = typeof value !== 'object' || isPlatformColor(value);
|
68
27
|
if (isDynamicFunction || isValidStyle) {
|
69
28
|
return [key, value];
|
70
29
|
}
|
71
|
-
return [key, getValueForBreakpoint(value
|
30
|
+
return [key, getValueForBreakpoint(value)];
|
72
31
|
}));
|
73
32
|
return isWeb ? normalizeStyles(parsedStyles) : parsedStyles;
|
74
33
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getValueForBreakpoint","normalizeStyles","isWeb","proxifyFunction","fn","breakpoint","screenSize","Proxy","apply","target","thisArg","argumentsList","parseStyle","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","
|
1
|
+
{"version":3,"names":["getValueForBreakpoint","normalizeStyles","isAndroid","isIOS","isWeb","proxifyFunction","fn","breakpoint","screenSize","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle"],"sourceRoot":"../../../src","sources":["utils/sty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WAAW;IAEvC,IAAIE,WAAW,IAAIC,KAAK,CAACC,OAAO,CAACd,KAAK,CAAC,EAAE;MACrC,OAAO,CACHU,GAAG,EACHV,KAAK,CAACQ,GAAG,CAACR,KAAK,IAAIF,UAAU,CAACE,KAAK,EAAET,UAAU,EAAEC,UAAU,CAAC,CAAC,CAChE;IACL;IAEA,MAAMuB,iBAAiB,GAAG,OAAOf,KAAK,KAAK,UAAU;IACrD,MAAMgB,YAAY,GAAG,OAAOhB,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC;IAExE,IAAIe,iBAAiB,IAAIC,YAAY,EAAE;MACnC,OAAO,CAACN,GAAG,EAAEV,KAAK,CAAC;IACvB;IAEA,OAAO,CACHU,GAAG,EACH1B,qBAAqB,CAACgB,KAAuF,CAAC,CACjH;EACL,CAAC,CACL,CAAC;EAEL,OAAOZ,KAAK,GACNH,eAAe,CAACqB,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { UnistylesRuntime } from './UnistylesRuntime';
|
2
|
-
import {
|
2
|
+
import { UnistylesBuiltInEngine } from './UnistylesEngine';
|
3
3
|
import { UnistyleRegistry } from './UnistyleRegistry';
|
4
4
|
declare class Unistyles {
|
5
5
|
private _runtime;
|
@@ -9,7 +9,7 @@ declare class Unistyles {
|
|
9
9
|
constructor();
|
10
10
|
get registry(): UnistyleRegistry;
|
11
11
|
get runtime(): UnistylesRuntime;
|
12
|
-
get engine():
|
12
|
+
get engine(): UnistylesBuiltInEngine;
|
13
13
|
}
|
14
14
|
export declare const unistyles: Unistyles;
|
15
15
|
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../src/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../src/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,cAAM,SAAS;IACX,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;;IAgBhC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;IAED,IAAW,MAAM,2BAEhB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import type { UnistyleRegistry } from './UnistyleRegistry';
|
2
2
|
import type { UnistylesRuntime } from './UnistylesRuntime';
|
3
|
-
|
3
|
+
import type { UnistylesEngine, NestedKeys } from './types';
|
4
|
+
export declare class UnistylesBuiltInEngine implements UnistylesEngine {
|
4
5
|
private registry;
|
5
6
|
private runtime;
|
6
7
|
constructor(registry: UnistyleRegistry, runtime: UnistylesRuntime);
|
8
|
+
isMediaQuery: (key: string) => boolean;
|
9
|
+
didMatchMediaQuery: (keys: NestedKeys) => string | undefined;
|
7
10
|
}
|
8
11
|
//# sourceMappingURL=UnistylesEngine.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesEngine.d.ts","sourceRoot":"","sources":["../../../src/UnistylesEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;
|
1
|
+
{"version":3,"file":"UnistylesEngine.d.ts","sourceRoot":"","sources":["../../../src/UnistylesEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAE1D,qBAAa,sBAAuB,YAAW,eAAe;IAC9C,OAAO,CAAC,QAAQ;IAAoB,OAAO,CAAC,OAAO;gBAA3C,QAAQ,EAAE,gBAAgB,EAAU,OAAO,EAAE,gBAAgB;IAK1E,YAAY,QAAS,MAAM,aAIjC;IAEM,kBAAkB,2CAC0D;CAKtF"}
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import type { CustomNamedStyles } from './types';
|
2
|
-
|
3
|
-
type T = UnistylesThemes[keyof UnistylesThemes];
|
4
|
-
export declare const createStyleSheet: <S extends CustomNamedStyles<S>, X>(styles: S | X | CustomNamedStyles<S> | ((theme: T) => X | CustomNamedStyles<X>)) => S | X;
|
5
|
-
export {};
|
1
|
+
import type { CustomNamedStyles, UnistylesTheme } from './types';
|
2
|
+
export declare const createStyleSheet: <S, X>(styles: S | X | CustomNamedStyles<S> | ((theme: UnistylesTheme) => X | CustomNamedStyles<X>)) => S | X;
|
6
3
|
//# sourceMappingURL=createStyleSheet.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
1
|
+
{"version":3,"file":"createStyleSheet.d.ts","sourceRoot":"","sources":["../../../src/createStyleSheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEhE,eAAO,MAAM,gBAAgB,yDAA0D,cAAc,wCAMpG,CAAA"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { OpaqueColorValue } from 'react-native';
|
1
2
|
import type { UnistylesBreakpoints } from '../global';
|
2
3
|
import type { MediaQueries } from './mediaQueries';
|
3
4
|
export type ScreenSize = {
|
@@ -9,7 +10,7 @@ type WithEmptyObject<V> = keyof V extends never ? {} : V;
|
|
9
10
|
export type ExtractBreakpoints<T> = T extends Partial<Record<keyof UnistylesBreakpoints & string, infer V>> ? WithEmptyObject<V> : T extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : {
|
10
11
|
[K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => ExtractBreakpoints<R> : T[K] extends object ? ExtractBreakpoints<T[K]> : T[K];
|
11
12
|
};
|
12
|
-
export type RemoveKeysWithPrefix<T> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R> : T extends object ? T extends Record<string, infer _V> ? {
|
13
|
+
export type RemoveKeysWithPrefix<T> = T extends (...args: Array<any>) => infer R ? (...args: Parameters<T>) => RemoveKeysWithPrefix<R> : T extends object ? T extends OpaqueColorValue ? string : T extends Record<string, infer _V> ? {
|
13
14
|
[K in keyof T as K extends MediaQueries ? keyof UnistylesBreakpoints & string : K]: RemoveKeysWithPrefix<T[K]>;
|
14
15
|
} : {
|
15
16
|
[K in keyof T]: RemoveKeysWithPrefix<T[K]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,EAAE,CAAA;AAEjE,KAAK,eAAe,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS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GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAC1E,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,oBAAoB,CAAC,CAAC,CAAC,GACnD,CAAC,SAAS,MAAM,GACZ,CAAC,SAAS,gBAAgB,GACtB,MAAM,GACN,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAC9B;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClH;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtD,CAAC,CAAA"}
|
@@ -1,32 +1,34 @@
|
|
1
1
|
import type { MatrixTransform, PerpectiveTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, SkewXTransform, SkewYTransform, TranslateXTransform, TranslateYTransform } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
|
2
2
|
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
3
3
|
import type { MediaQueries } from './mediaQueries';
|
4
|
-
import type { UnistylesBreakpoints } from '../global';
|
4
|
+
import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
|
5
5
|
type ShadowOffset = {
|
6
6
|
width: number;
|
7
7
|
height: number;
|
8
8
|
};
|
9
9
|
type TransformStyles = PerpectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform & MatrixTransform;
|
10
|
-
type UnistyleNested
|
11
|
-
shadowOffset?: DeepUniStyle<ShadowOffset
|
12
|
-
textShadowOffset?: DeepUniStyle<ShadowOffset
|
13
|
-
transform?: Array<DeepUniStyle<TransformStyles
|
10
|
+
type UnistyleNested = {
|
11
|
+
shadowOffset?: DeepUniStyle<ShadowOffset>;
|
12
|
+
textShadowOffset?: DeepUniStyle<ShadowOffset>;
|
13
|
+
transform?: Array<DeepUniStyle<TransformStyles>>;
|
14
14
|
};
|
15
|
-
type UniStyle<V
|
16
|
-
[innerKey in keyof
|
15
|
+
type UniStyle<V> = {
|
16
|
+
[innerKey in keyof UnistylesBreakpoints]: V;
|
17
17
|
} | {
|
18
|
-
[innerKey in MediaQueries]
|
19
|
-
}
|
20
|
-
type DeepUniStyle<T
|
21
|
-
[K in keyof T]?: UniStyle<T[K]
|
18
|
+
[innerKey in MediaQueries]: V;
|
19
|
+
};
|
20
|
+
type DeepUniStyle<T> = {
|
21
|
+
[K in keyof T]?: UniStyle<T[K]> | T[K];
|
22
22
|
};
|
23
23
|
type NestedTypes = 'shadowOffset' | 'transform' | 'textShadowOffset';
|
24
|
-
type UnistyleView
|
25
|
-
type UnistyleText
|
26
|
-
type UnistyleImage
|
27
|
-
export type StaticStyles
|
24
|
+
type UnistyleView = DeepUniStyle<Omit<ViewStyle, NestedTypes>>;
|
25
|
+
type UnistyleText = DeepUniStyle<Omit<TextStyle, NestedTypes>>;
|
26
|
+
type UnistyleImage = DeepUniStyle<Omit<ImageStyle, NestedTypes>>;
|
27
|
+
export type StaticStyles = UnistyleView | UnistyleText | UnistyleImage & UnistyleNested;
|
28
28
|
export type CustomNamedStyles<T> = {
|
29
|
-
[K in keyof T]: T[K] extends (...args: infer A) => StaticStyles
|
29
|
+
[K in keyof T]: T[K] extends (...args: infer A) => StaticStyles ? (...args: A) => StaticStyles : StaticStyles;
|
30
30
|
};
|
31
|
+
export type NestedKeys = Array<[keyof UnistylesBreakpoints | MediaQueries, string | number | undefined]>;
|
32
|
+
export type UnistylesTheme = UnistylesThemes[keyof UnistylesThemes];
|
31
33
|
export {};
|
32
34
|
//# sourceMappingURL=core.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEtE,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,eAAe,GACd,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,cAAc,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,oBAAoB,GAAG,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;AACxG,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
|
2
2
|
import type { ScreenSize } from './breakpoints';
|
3
|
+
import type { NestedKeys } from './core';
|
4
|
+
export type Optional<T> = T | undefined;
|
3
5
|
export type Nullable<T> = T | null;
|
4
|
-
export type ColorSchemeName = 'light' | 'dark'
|
6
|
+
export type ColorSchemeName = Optional<'light' | 'dark'>;
|
5
7
|
export type UnistylesConfig = {
|
6
8
|
adaptiveThemes?: boolean;
|
7
9
|
};
|
@@ -50,4 +52,8 @@ export declare enum UnistylesError {
|
|
50
52
|
BreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY",
|
51
53
|
BreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO"
|
52
54
|
}
|
55
|
+
export interface UnistylesEngine {
|
56
|
+
isMediaQuery(key: string): boolean;
|
57
|
+
didMatchMediaQuery(keys: NestedKeys): Optional<string>;
|
58
|
+
}
|
53
59
|
//# sourceMappingURL=cxx.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cxx.d.ts","sourceRoot":"","sources":["../../../../src/types/cxx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"cxx.d.ts","sourceRoot":"","sources":["../../../../src/types/cxx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EA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,CAAA;KACnC,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE;QACL,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,MAAM,oBAAoB,CAAC;QACvC,WAAW,EAAE,iBAAiB,CAAA;KACjC,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,0BAA0B,CAAA;AAE9E,oBAAY,cAAc;IACtB,kBAAkB,wCAAwC;IAC1D,aAAa,oCAAoC;IACjD,kBAAkB,yCAAyC;IAC3D,mBAAmB,2CAA2C;IAC9D,wBAAwB,gDAAgD;IACxE,4BAA4B,qDAAqD;CACpF;AAED,MAAM,WAAW,eAAe;IAC5B,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC1D"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from './normalizer';
|
2
2
|
export * from './cxx';
|
3
|
-
export type { CustomNamedStyles } from './core';
|
3
|
+
export type { CustomNamedStyles, NestedKeys, UnistylesTheme } from './core';
|
4
4
|
export type { MediaQueries } from './mediaQueries';
|
5
5
|
export type { ScreenSize, CreateStylesFactory, ExtractBreakpoints, RemoveKeysWithPrefix } from './breakpoints';
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC3E,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EACR,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACvB,MAAM,eAAe,CAAA"}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
type Optional<TOptional extends string> = TOptional | '';
|
2
2
|
type Separator = ',' | ', ';
|
3
|
-
type
|
4
|
-
type
|
5
|
-
type
|
3
|
+
type OpeningBracket = '(' | '[';
|
4
|
+
type ClosingBracket = ')' | ']';
|
5
|
+
type NumericMediaQuery = `${OpeningBracket}${Separator}${bigint}${ClosingBracket}` | `${OpeningBracket}${bigint}${Optional<`${Separator}${bigint}`>}${ClosingBracket}`;
|
6
|
+
type WidthMediaQuery = `:w${NumericMediaQuery}`;
|
7
|
+
type HeightMediaQuery = `:h${NumericMediaQuery}`;
|
6
8
|
export type MediaQueries = `${WidthMediaQuery}${Optional<HeightMediaQuery>}` | `${HeightMediaQuery}${Optional<WidthMediaQuery>}`;
|
7
9
|
export {};
|
8
10
|
//# sourceMappingURL=mediaQueries.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mediaQueries.d.ts","sourceRoot":"","sources":["../../../../src/types/mediaQueries.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,SAAS,SAAS,MAAM,IAAI,SAAS,GAAG,EAAE,CAAA;AACxD,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAA;
|
1
|
+
{"version":3,"file":"mediaQueries.d.ts","sourceRoot":"","sources":["../../../../src/types/mediaQueries.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,SAAS,SAAS,MAAM,IAAI,SAAS,GAAG,EAAE,CAAA;AACxD,KAAK,SAAS,GAAG,GAAG,GAAG,IAAI,CAAA;AAC3B,KAAK,cAAc,GAAG,GAAG,GAAG,GAAG,CAAA;AAC/B,KAAK,cAAc,GAAG,GAAG,GAAG,GAAG,CAAA;AAE/B,KAAK,iBAAiB,GAChB,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,cAAc,EAAE,GACzD,GAAG,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,SAAS,GAAG,MAAM,EAAE,CAAC,GAAG,cAAc,EAAE,CAAA;AAEvF,KAAK,eAAe,GAAG,KAAK,iBAAiB,EAAE,CAAA;AAC/C,KAAK,gBAAgB,GAAG,KAAK,iBAAiB,EAAE,CAAA;AAEhD,MAAM,MAAM,YAAY,GAClB,GAAG,eAAe,GAAG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GACjD,GAAG,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAA"}
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import type { CreateStylesFactory, CustomNamedStyles, ExtractBreakpoints, RemoveKeysWithPrefix } from './types';
|
2
|
-
import type {
|
3
|
-
type T = UnistylesThemes[keyof UnistylesThemes];
|
2
|
+
import type { UnistylesTheme } from './types';
|
4
3
|
export declare const useStyles: <ST extends CustomNamedStyles<ST>>(stylesheet?: ST | CreateStylesFactory<ST, never> | undefined) => {
|
5
4
|
theme: never;
|
6
5
|
breakpoint: "landscape" | "portrait";
|
7
6
|
styles: ExtractBreakpoints<RemoveKeysWithPrefix<ST>>;
|
8
7
|
};
|
9
|
-
export {};
|
10
8
|
//# sourceMappingURL=useStyles.d.ts.map
|