react-native-unistyles 1.0.0-beta.3 → 1.0.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +342 -35
- package/lib/commonjs/createUnistyles.js +25 -13
- package/lib/commonjs/createUnistyles.js.map +1 -1
- package/lib/commonjs/mediaQueries.js +2 -0
- package/lib/commonjs/mediaQueries.js.map +1 -0
- package/lib/commonjs/utils/breakpoints.js +12 -16
- package/lib/commonjs/utils/breakpoints.js.map +1 -1
- package/lib/commonjs/utils/breakpoints.spec.js +20 -15
- package/lib/commonjs/utils/breakpoints.spec.js.map +1 -1
- package/lib/commonjs/utils/common.js +8 -1
- package/lib/commonjs/utils/common.js.map +1 -1
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mediaQueries.spec.js +1 -1
- package/lib/commonjs/utils/mediaQueries.spec.js.map +1 -1
- package/lib/commonjs/utils/normalizeStyles.js +10 -0
- package/lib/commonjs/utils/normalizeStyles.js.map +1 -0
- package/lib/commonjs/utils/normalizeStyles.web.js +59 -0
- package/lib/commonjs/utils/normalizeStyles.web.js.map +1 -0
- package/lib/commonjs/utils/styles.js +14 -12
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/commonjs/utils/styles.spec.js +17 -7
- package/lib/commonjs/utils/styles.spec.js.map +1 -1
- package/lib/module/createUnistyles.js +25 -13
- package/lib/module/createUnistyles.js.map +1 -1
- package/lib/module/mediaQueries.js +2 -0
- package/lib/module/mediaQueries.js.map +1 -0
- package/lib/module/utils/breakpoints.js +12 -16
- package/lib/module/utils/breakpoints.js.map +1 -1
- package/lib/module/utils/breakpoints.spec.js +20 -15
- package/lib/module/utils/breakpoints.spec.js.map +1 -1
- package/lib/module/utils/common.js +5 -0
- package/lib/module/utils/common.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mediaQueries.spec.js +1 -1
- package/lib/module/utils/mediaQueries.spec.js.map +1 -1
- package/lib/module/utils/normalizeStyles.js +3 -0
- package/lib/module/utils/normalizeStyles.js.map +1 -0
- package/lib/module/utils/normalizeStyles.web.js +52 -0
- package/lib/module/utils/normalizeStyles.web.js.map +1 -0
- package/lib/module/utils/styles.js +14 -12
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/module/utils/styles.spec.js +17 -7
- package/lib/module/utils/styles.spec.js.map +1 -1
- package/lib/typescript/src/createUnistyles.d.ts +7 -3
- package/lib/typescript/src/createUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/mediaQueries.d.ts +2 -0
- package/lib/typescript/src/mediaQueries.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +53 -13
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/breakpoints.d.ts +6 -6
- 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/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/normalizeStyles.d.ts +2 -0
- package/lib/typescript/src/utils/normalizeStyles.d.ts.map +1 -0
- package/lib/typescript/src/utils/normalizeStyles.web.d.ts +2 -0
- package/lib/typescript/src/utils/normalizeStyles.web.d.ts.map +1 -0
- package/lib/typescript/src/utils/styles.d.ts +5 -5
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/package.json +9 -2
- package/src/createUnistyles.ts +38 -16
- package/src/mediaQueries.ts +33 -0
- package/src/types.ts +96 -25
- package/src/utils/breakpoints.ts +15 -15
- package/src/utils/common.ts +8 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/normalizeStyles.ts +2 -0
- package/src/utils/normalizeStyles.web.ts +103 -0
- package/src/utils/styles.ts +32 -17
@@ -54,17 +54,18 @@ describe('breakpoints', () => {
|
|
54
54
|
md: 500,
|
55
55
|
xl: 1200
|
56
56
|
};
|
57
|
-
|
58
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
59
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
60
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
61
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
62
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
63
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
64
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
65
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
66
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
67
|
-
expect((0, _breakpoints.getBreakpointFromScreenWidth)(
|
57
|
+
const breakpointPairs = Object.entries(breakpoints);
|
58
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(0, breakpointPairs)).toEqual('xs');
|
59
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(20, breakpointPairs)).toEqual('xs');
|
60
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(100, breakpointPairs)).toEqual('xs');
|
61
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(101, breakpointPairs)).toEqual('xs');
|
62
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(250, breakpointPairs)).toEqual('xs');
|
63
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(300, breakpointPairs)).toEqual('sm');
|
64
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(499, breakpointPairs)).toEqual('sm');
|
65
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(500, breakpointPairs)).toEqual('md');
|
66
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(799, breakpointPairs)).toEqual('md');
|
67
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(1200, breakpointPairs)).toEqual('xl');
|
68
|
+
expect((0, _breakpoints.getBreakpointFromScreenWidth)(2000, breakpointPairs)).toEqual('xl');
|
68
69
|
});
|
69
70
|
});
|
70
71
|
describe('getValueForBreakpoint', () => {
|
@@ -75,6 +76,7 @@ describe('breakpoints', () => {
|
|
75
76
|
sm: 200,
|
76
77
|
md: 500
|
77
78
|
};
|
79
|
+
const breakpointPairs = Object.entries(breakpoints);
|
78
80
|
const style = {
|
79
81
|
':w[, 200]': 'green',
|
80
82
|
':w[201]': 'orange',
|
@@ -84,7 +86,7 @@ describe('breakpoints', () => {
|
|
84
86
|
width: 200,
|
85
87
|
height: 800
|
86
88
|
};
|
87
|
-
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize,
|
89
|
+
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize, breakpointPairs)).toEqual('green');
|
88
90
|
});
|
89
91
|
});
|
90
92
|
it('should match breakpoint if media query doesnt exist', () => {
|
@@ -94,6 +96,7 @@ describe('breakpoints', () => {
|
|
94
96
|
sm: 200,
|
95
97
|
md: 500
|
96
98
|
};
|
99
|
+
const breakpointPairs = Object.entries(breakpoints);
|
97
100
|
const style = {
|
98
101
|
':w[, 200]': 'green',
|
99
102
|
':w[201, 499]': 'orange',
|
@@ -104,7 +107,7 @@ describe('breakpoints', () => {
|
|
104
107
|
width: 500,
|
105
108
|
height: 1200
|
106
109
|
};
|
107
|
-
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize,
|
110
|
+
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize, breakpointPairs)).toEqual('red');
|
108
111
|
});
|
109
112
|
it('should match breakpoint even if value is undefined', () => {
|
110
113
|
const breakpoint = 'md';
|
@@ -113,6 +116,7 @@ describe('breakpoints', () => {
|
|
113
116
|
sm: 200,
|
114
117
|
md: 500
|
115
118
|
};
|
119
|
+
const breakpointPairs = Object.entries(breakpoints);
|
116
120
|
const style = {
|
117
121
|
':w[, 200]': 'green',
|
118
122
|
':w[201, 499]': 'orange',
|
@@ -123,7 +127,7 @@ describe('breakpoints', () => {
|
|
123
127
|
width: 500,
|
124
128
|
height: 1200
|
125
129
|
};
|
126
|
-
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize,
|
130
|
+
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize, breakpointPairs)).toEqual(undefined);
|
127
131
|
});
|
128
132
|
it('should match lower breakpoint to match css cascading', () => {
|
129
133
|
const breakpoint = 'xl';
|
@@ -133,6 +137,7 @@ describe('breakpoints', () => {
|
|
133
137
|
md: 500,
|
134
138
|
xl: 600
|
135
139
|
};
|
140
|
+
const breakpointPairs = Object.entries(breakpoints);
|
136
141
|
const style = {
|
137
142
|
':w[, 200]': 'green',
|
138
143
|
':w[201, 499]': 'orange',
|
@@ -143,7 +148,7 @@ describe('breakpoints', () => {
|
|
143
148
|
width: 500,
|
144
149
|
height: 1200
|
145
150
|
};
|
146
|
-
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize,
|
151
|
+
expect((0, _breakpoints.getValueForBreakpoint)(style, breakpoint, screenSize, breakpointPairs)).toEqual('red');
|
147
152
|
});
|
148
153
|
});
|
149
154
|
//# sourceMappingURL=breakpoints.spec.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_breakpoints","require","describe","it","breakpoints","expect","sortAndValidateBreakpoints","toThrow","sm","md","lg","xl","toEqual","xs","getBreakpointFromScreenWidth","breakpoint","style","screenSize","width","height","getValueForBreakpoint","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.spec.ts"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGAC,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC1BA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IACzCC,EAAE,CAAC,0CAA0C,EAAE,MAAM;MACjD,MAAMC,WAAW,GAAG,CAAC,CAAC;MAEtBC,MAAM,CAAC,MAAM,IAAAC,uCAA0B,EAACF,WAAW,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC;IAEFJ,EAAE,CAA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,GAAG;QAChBS,EAAE,EAAE,CAAC;QACLL,EAAE,EAAE,GAAG;QACPC,EAAE,EAAE,GAAG;QACPE,EAAE,EAAE;MACR,CAAC;
|
1
|
+
{"version":3,"names":["_breakpoints","require","describe","it","breakpoints","expect","sortAndValidateBreakpoints","toThrow","sm","md","lg","xl","toEqual","xs","breakpointPairs","Object","entries","getBreakpointFromScreenWidth","breakpoint","style","screenSize","width","height","getValueForBreakpoint","undefined"],"sourceRoot":"../../../src","sources":["utils/breakpoints.spec.ts"],"mappings":";;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGAC,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC1BA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IACzCC,EAAE,CAAC,0CAA0C,EAAE,MAAM;MACjD,MAAMC,WAAW,GAAG,CAAC,CAAC;MAEtBC,MAAM,CAAC,MAAM,IAAAC,uCAA0B,EAACF,WAAW,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC;IAEFJ,EAAE,CAAC,6DAA6D,EAAE,MAAM;MACpE,MAAMC,WAAW,GAAG;QAChBI,EAAE,EAAE,CAAC;MACT,CAAC;MAEDH,MAAM,CAAC,MAAM,IAAAC,uCAA0B,EAACF,WAAW,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC;IAEFJ,EAAE,CAAC,8CAA8C,EAAE,MAAM;MACrD,MAAMC,WAAW,GAAG;QAChBI,EAAE,EAAE,CAAC;QACLC,EAAE,EAAE,GAAG;QACPC,EAAE,EAAE,GAAG;QACPC,EAAE,EAAE;MACR,CAAC;MAEDN,MAAM,CAAC,IAAAC,uCAA0B,EAACF,WAAW,CAAC,CAAC,CAACQ,OAAO,CAACR,WAAW,CAAC;IACxE,CAAC,CAAC;IAEFD,EAAE,CAAC,sCAAsC,EAAE,MAAM;MAC7C,MAAMC,WAAW,GAAG;QAChBK,EAAE,EAAE,GAAG;QACPD,EAAE,EAAE,CAAC;QAC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AAAkB,kCAAqB,EAACJ,KAAK,EAAED,UAAU,EAAEE,UAAU,EAAEN,eAAe,CAAC,CAAC,CAACF,OAAO,CAACY,SAAS,CAAC;EACpG,CAAC,CAAC;EAEFrB,EAAE,CAAC,sDAAsD,EAAE,MAAM;IAC7D,MAAMe,UAAU,GAAG,IAAI;IACvB,MAAMd,WAAW,GAAG;MAChBS,EAAE,EAAE,CAAC;MACLL,EAAE,EAAE,GAAG;MACPC,EAAE,EAAE,GAAG;MACPE,EAAE,EAAE;IACR,CAAC;IACD,MAAMG,eAAe,GAAGC,MAAM,CACzBC,OAAO,CAACZ,WAAW,CAAgD;IACxE,MAAMe,KAAyC,GAAG;MAC9C,WAAW,EAAE,OAAO;MACpB,cAAc,EAAE,QAAQ;MACxBX,EAAE,EAAE,MAAM;MACVC,EAAE,EAAE;IACR,CAAC;IACD,MAAMW,UAAsB,GAAG;MAC3BC,KAAK,EAAE,GAAG;MACVC,MAAM,EAAE;IACZ,CAAC;IAEDjB,MAAM,CAAC,IAAAkB,kCAAqB,EAACJ,KAAK,EAAED,UAAU,EAAEE,UAAU,EAAEN,eAAe,CAAC,CAAC,CAACF,OAAO,CAAC,KAAK,CAAC;EAChG,CAAC,CAAC;AACN,CAAC,CAAC"}
|
@@ -3,9 +3,16 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.throwError = void 0;
|
6
|
+
exports.warn = exports.throwError = exports.isWeb = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
7
8
|
const throwError = message => {
|
8
9
|
throw new Error(`🦄 [react-native-unistyles]: ${message}`);
|
9
10
|
};
|
10
11
|
exports.throwError = throwError;
|
12
|
+
const warn = message => {
|
13
|
+
console.warn(`🦄 [react-native-unistyles]: ${message}`);
|
14
|
+
};
|
15
|
+
exports.warn = warn;
|
16
|
+
const isWeb = () => _reactNative.Platform.OS === 'web';
|
17
|
+
exports.isWeb = isWeb;
|
11
18
|
//# sourceMappingURL=common.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["throwError","message","Error","exports"],"sourceRoot":"../../../src","sources":["utils/common.ts"],"mappings":";;;;;;
|
1
|
+
{"version":3,"names":["_reactNative","require","throwError","message","Error","exports","warn","console","isWeb","Platform","OS"],"sourceRoot":"../../../src","sources":["utils/common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,UAAU,GAAIC,OAAe,IAAK;EAC3C,MAAM,IAAIC,KAAK,CAAE,gCAA+BD,OAAQ,EAAC,CAAC;AAC9D,CAAC;AAAAE,OAAA,CAAAH,UAAA,GAAAA,UAAA;AAEM,MAAMI,IAAI,GAAIH,OAAe,IAAK;EACrCI,OAAO,CAACD,IAAI,CAAE,gCAA+BH,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAC,IAAA,GAAAA,IAAA;AAEM,MAAME,KAAK,GAAGA,CAAA,KAAMC,qBAAQ,CAACC,EAAE,KAAK,KAAK;AAAAL,OAAA,CAAAG,KAAA,GAAAA,KAAA"}
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "getBreakpointFromScreenWidth", {
|
|
9
9
|
return _breakpoints.getBreakpointFromScreenWidth;
|
10
10
|
}
|
11
11
|
});
|
12
|
+
Object.defineProperty(exports, "normalizeStyles", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _normalizeStyles.normalizeStyles;
|
16
|
+
}
|
17
|
+
});
|
12
18
|
Object.defineProperty(exports, "parseStyle", {
|
13
19
|
enumerable: true,
|
14
20
|
get: function () {
|
@@ -27,6 +33,7 @@ Object.defineProperty(exports, "sortAndValidateBreakpoints", {
|
|
27
33
|
return _breakpoints.sortAndValidateBreakpoints;
|
28
34
|
}
|
29
35
|
});
|
36
|
+
var _normalizeStyles = require("./normalizeStyles");
|
30
37
|
var _breakpoints = require("./breakpoints");
|
31
38
|
var _styles = require("./styles");
|
32
39
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_normalizeStyles","require","_breakpoints","_styles"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA"}
|
@@ -176,7 +176,7 @@ describe('utils', () => {
|
|
176
176
|
});
|
177
177
|
});
|
178
178
|
it('should detect incorrect media queries', () => {
|
179
|
-
const incorrectMediaQueries = [':w100]', ':w[100, 200', ':p[, 300]', ':&[200]', ':h[0 500]', ':h[p, 750]', ':w[0]:l[200]', ':[100]:w[200]', ':h(100, 200):w[400]', ':w[2OO]:h[200, 400]', '', 'x', '>300', ']]w200[['];
|
179
|
+
const incorrectMediaQueries = [':w100]', ':w[100, 200', ':p[, 300]', ':&[200]', ':h[0 500]', ':h[p, 750]', ':w[0]:l[200]', ':[100]:w[200]', ':h(100, 200):w[400]', ':w[2OO]:h[200, 400]', '', 'x', '>300', ']]w200[[', ':w[ 100]', ':w[ , 300]', ':w[ , 200]:h[ 200 , 400]'];
|
180
180
|
incorrectMediaQueries.forEach(query => {
|
181
181
|
expect((0, _mediaQueries.isMediaQuery)(query)).toEqual(false);
|
182
182
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_mediaQueries","require","describe","it","mediaQuery","expect","extractValues","toEqual","pairs","width","query","forEach","_ref","isWithinTheWidth","_ref2","height","_ref3","isWithinTheHeight","_ref4","screenSize","_ref5","isWithinTheWidthAndHeight","_ref6","correctMediaQueries","isMediaQuery","incorrectMediaQueries","mediaQueries","getKeyForCustomMediaQuery","undefined"],"sourceRoot":"../../../src","sources":["utils/mediaQueries.spec.ts"],"mappings":";;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAUAC,QAAQ,CAAC,OAAO,EAAE,MAAM;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C,CAAC,CAAC;IACN,CAAC,CAAC;IAEFJ,EAAE,CAAC,uCAAuC,EAAE,MAAM;MAC9C,MAAMsB,qBAAqB,GAAG,CAC1B,QAAQ,EACR,aAAa,EACb,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,EAAE,EACF,GAAG,EACH,MAAM,EACN,UAAU,
|
1
|
+
{"version":3,"names":["_mediaQueries","require","describe","it","mediaQuery","expect","extractValues","toEqual","pairs","width","query","forEach","_ref","isWithinTheWidth","_ref2","height","_ref3","isWithinTheHeight","_ref4","screenSize","_ref5","isWithinTheWidthAndHeight","_ref6","correctMediaQueries","isMediaQuery","incorrectMediaQueries","mediaQueries","getKeyForCustomMediaQuery","undefined"],"sourceRoot":"../../../src","sources":["utils/mediaQueries.spec.ts"],"mappings":";;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAUAC,QAAQ,CAAC,OAAO,EAAE,MAAM;EACpBA,QAAQ,CAAC,eAAe,EAAE,MAAM;IAC5BC,EAAE,CAAC,mDAAmD,EAAE,MAAM;MAC1D,MAAMC,UAAU,GAAG,aAAa;MAEhCC,MAAM,CAAC,IAAAC,2BAAa,EAACF,UAAU,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC,CAAC;IAEFJ,EAAE,CAAC,8DAA8D,EAAE,MAAM;MACrE,MAAMC,UAAU,GAAG,WAAW;MAE9BC,MAAM,CAAC,IAAAC,2BAAa,EAACF,UAAU,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACvD,CAAC,CAAC;IAEFJ,EAAE,CAAC,qDAAqD,EAAE,MAAM;MAC5D,MAAMC,UAAU,GAAG,QAAQ;MAE3BC,MAAM,CAAC,IAAAC,2BAAa,EAACF,UAAU,CAAC,CAAC,CAACG,OAAO,CAAC,CAAC,GAAG,CAA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CACkB;MACrC,MAAMP,UAAsB,GAAG;QAC3BV,KAAK,EAAE,GAAG;QACVM,MAAM,EAAE;MACZ,CAAC;MAEDV,MAAM,CAAC,IAAAsB,uCAAyB,EAACD,YAAY,EAAEP,UAAU,CAAC,CAAC,CAACZ,OAAO,CAAC,oBAAoB,CAAC;IAC7F,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.normalizeStyles = void 0;
|
7
|
+
// nothing to do here
|
8
|
+
const normalizeStyles = styles => styles;
|
9
|
+
exports.normalizeStyles = normalizeStyles;
|
10
|
+
//# sourceMappingURL=normalizeStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["normalizeStyles","styles","exports"],"sourceRoot":"../../../src","sources":["utils/normalizeStyles.ts"],"mappings":";;;;;;AAAA;AACO,MAAMA,eAAe,GAAOC,MAAS,IAAKA,MAAW;AAAAC,OAAA,CAAAF,eAAA,GAAAA,eAAA"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.normalizeStyles = void 0;
|
7
|
+
var _common = require("./common");
|
8
|
+
const preprocessor = require('react-native-web/src/exports/StyleSheet/preprocess.js');
|
9
|
+
const normalizeBoxShadow = styles => {
|
10
|
+
const requiredBoxShadowProperties = ['shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius'];
|
11
|
+
if (!requiredBoxShadowProperties.every(prop => prop in styles)) {
|
12
|
+
(0, _common.warn)(`can't apply box shadow as you miss at least one of these properties: ${requiredBoxShadowProperties.join(', ')}`);
|
13
|
+
return {
|
14
|
+
shadowColor: undefined,
|
15
|
+
shadowOffset: undefined,
|
16
|
+
shadowOpacity: undefined,
|
17
|
+
shadowRadius: undefined
|
18
|
+
};
|
19
|
+
}
|
20
|
+
return {
|
21
|
+
boxShadow: preprocessor.createBoxShadowValue(styles),
|
22
|
+
shadowColor: undefined,
|
23
|
+
shadowOffset: undefined,
|
24
|
+
shadowOpacity: undefined,
|
25
|
+
shadowRadius: undefined
|
26
|
+
};
|
27
|
+
};
|
28
|
+
const normalizeTextShadow = styles => {
|
29
|
+
const requiredTextShadowProperties = ['textShadowColor', 'textShadowOffset', 'textShadowRadius'];
|
30
|
+
if (!requiredTextShadowProperties.every(prop => prop in styles)) {
|
31
|
+
(0, _common.warn)(`can't apply text shadow as you miss at least one of these properties: ${requiredTextShadowProperties.join(', ')}`);
|
32
|
+
return {
|
33
|
+
textShadowColor: undefined,
|
34
|
+
textShadowOffset: undefined,
|
35
|
+
textShadowRadius: undefined
|
36
|
+
};
|
37
|
+
}
|
38
|
+
return {
|
39
|
+
textShadow: preprocessor.createTextShadowValue(styles),
|
40
|
+
textShadowColor: undefined,
|
41
|
+
textShadowOffset: undefined,
|
42
|
+
textShadowRadius: undefined
|
43
|
+
};
|
44
|
+
};
|
45
|
+
const normalizeStyles = styles => {
|
46
|
+
const normalizedTransform = 'transform' in styles && Array.isArray(styles.transform) ? {
|
47
|
+
transform: preprocessor.createTransformValue(styles.transform)
|
48
|
+
} : {};
|
49
|
+
const normalizedBoxShadow = 'shadowColor' in styles || 'shadowOffset' in styles || 'shadowOpacity' in styles || 'shadowRadius' in styles ? normalizeBoxShadow(styles) : {};
|
50
|
+
const normalizedTextShadow = 'textShadowColor' in styles || 'textShadowOffset' in styles || 'textShadowRadius' in styles ? normalizeTextShadow(styles) : {};
|
51
|
+
return {
|
52
|
+
...styles,
|
53
|
+
...normalizedTransform,
|
54
|
+
...normalizedBoxShadow,
|
55
|
+
...normalizedTextShadow
|
56
|
+
};
|
57
|
+
};
|
58
|
+
exports.normalizeStyles = normalizeStyles;
|
59
|
+
//# sourceMappingURL=normalizeStyles.web.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_common","require","preprocessor","normalizeBoxShadow","styles","requiredBoxShadowProperties","every","prop","warn","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyles","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow","exports"],"sourceRoot":"../../../src","sources":["utils/normalizeStyles.web.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,YAA0B,GAAGD,OAAO,CAAC,uDAAuD,CAAC;AAuBnG,MAAME,kBAAkB,GAAkBC,MAAS,IAA0B;EACzE,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,MAAM,CAAC,EAAE;IAC5D,IAAAI,YAAI,EAAE,wEAAuEH,2BAA2B,CAACI,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC,SAAS;MACtBC,YAAY,EAAED,SAAS;MACvBE,aAAa,EAAEF,SAAS;MACxBG,YAAY,EAAEH;IAClB,CAAC;EACL;EAEA,OAAO;IACHI,SAAS,EAAEb,YAAY,CAACc,oBAAoB,CAACZ,MAAM,CAAC;IACpDM,WAAW,EAAEC,SAAS;IACtBC,YAAY,EAAED,SAAS;IACvBE,aAAa,EAAEF,SAAS;IACxBG,YAAY,EAAEH;EAClB,CAAC;AACL,CAAC;AAED,MAAMM,mBAAmB,GAAkBb,MAAS,IAA2B;EAC3E,MAAMc,4BAA4B,GAAG,CACjC,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,CACrB;EAED,IAAI,CAACA,4BAA4B,CAACZ,KAAK,CAACC,IAAI,IAAIA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exports.parseStyle = void 0;
|
7
7
|
var _breakpoints = require("./breakpoints");
|
8
|
+
var _normalizeStyles = require("./normalizeStyles");
|
9
|
+
var _common = require("./common");
|
8
10
|
/**
|
9
11
|
* Proxies a function to parse its return value for custom media queries or breakpoints.
|
10
12
|
*
|
@@ -13,7 +15,7 @@ var _breakpoints = require("./breakpoints");
|
|
13
15
|
* @param {Function} fn - The function to be proxified.
|
14
16
|
* @param {keyof B & string} breakpoint - The breakpoint name to check against.
|
15
17
|
* @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
|
16
|
-
* @param
|
18
|
+
* @param breakpointPairs - sorted pairs of breakpoints
|
17
19
|
*
|
18
20
|
* @returns {Function} Returns the proxified function
|
19
21
|
*
|
@@ -26,8 +28,8 @@ var _breakpoints = require("./breakpoints");
|
|
26
28
|
* const proxifiedFunction = proxifyFunction(myFunction, 'sm', screenSize, breakpoints)
|
27
29
|
* proxifiedFunction() // parsed style based on screenSize and breakpoints
|
28
30
|
*/
|
29
|
-
const proxifyFunction = (fn, breakpoint, screenSize,
|
30
|
-
apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize,
|
31
|
+
const proxifyFunction = (fn, breakpoint, screenSize, breakpointPairs) => new Proxy(fn, {
|
32
|
+
apply: (target, thisArg, argumentsList) => parseStyle(target.apply(thisArg, argumentsList), breakpoint, screenSize, breakpointPairs)
|
31
33
|
});
|
32
34
|
|
33
35
|
/**
|
@@ -42,7 +44,7 @@ const proxifyFunction = (fn, breakpoint, screenSize, breakpoints) => new Proxy(f
|
|
42
44
|
* @param {CustomNamedStyles<T, B>} style - The style object to be parsed.
|
43
45
|
* @param {keyof B & string} breakpoint - The breakpoint name to check against.
|
44
46
|
* @param {ScreenSize} screenSize - An object representing the screen size to be checked against the media queries.
|
45
|
-
* @param
|
47
|
+
* @param breakpointPairs - sorted pairs of breakpoints
|
46
48
|
*
|
47
49
|
* @returns {Record<string, string | number | Function>} Returns the parsed style object with resolved custom media queries or breakpoints.
|
48
50
|
*
|
@@ -56,26 +58,26 @@ const proxifyFunction = (fn, breakpoint, screenSize, breakpoints) => new Proxy(f
|
|
56
58
|
* // { fontSize: '12px' }
|
57
59
|
*/
|
58
60
|
exports.proxifyFunction = proxifyFunction;
|
59
|
-
const parseStyle = (style, breakpoint, screenSize,
|
61
|
+
const parseStyle = (style, breakpoint, screenSize, breakpointPairs) => {
|
60
62
|
const entries = Object.entries(style);
|
61
|
-
|
63
|
+
const parsedStyles = Object.fromEntries(entries.map(_ref => {
|
62
64
|
let [key, value] = _ref;
|
63
|
-
const
|
64
|
-
if (
|
65
|
-
return [key, parseStyle(value, breakpoint, screenSize,
|
65
|
+
const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
|
66
|
+
if (hasNestedProperties) {
|
67
|
+
return [key, parseStyle(value, breakpoint, screenSize, breakpointPairs)];
|
66
68
|
}
|
67
69
|
const isTransform = key === 'transform';
|
68
70
|
if (isTransform && Array.isArray(value)) {
|
69
|
-
return [key, value.map(value => parseStyle(value, breakpoint, screenSize,
|
71
|
+
return [key, value.map(value => parseStyle(value, breakpoint, screenSize, breakpointPairs))];
|
70
72
|
}
|
71
73
|
const isDynamicFunction = typeof value === 'function';
|
72
74
|
const isValidStyle = typeof value !== 'object';
|
73
75
|
if (isDynamicFunction || isValidStyle) {
|
74
76
|
return [key, value];
|
75
77
|
}
|
76
|
-
|
77
|
-
return [key, (0, _breakpoints.getValueForBreakpoint)(valueWithBreakpoint, breakpoint, screenSize, breakpoints)];
|
78
|
+
return [key, (0, _breakpoints.getValueForBreakpoint)(value, breakpoint, screenSize, breakpointPairs)];
|
78
79
|
}));
|
80
|
+
return (0, _common.isWeb)() ? (0, _normalizeStyles.normalizeStyles)(parsedStyles) : parsedStyles;
|
79
81
|
};
|
80
82
|
exports.parseStyle = parseStyle;
|
81
83
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_breakpoints","require","proxifyFunction","fn","breakpoint","screenSize","
|
1
|
+
{"version":3,"names":["_breakpoints","require","_normalizeStyles","_common","proxifyFunction","fn","breakpoint","screenSize","breakpointPairs","Proxy","apply","target","thisArg","argumentsList","parseStyle","exports","style","entries","Object","parsedStyles","fromEntries","map","_ref","key","value","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle","getValueForBreakpoint","isWeb","normalizeStyles"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA4B,EAC1CC,UAAsB,EACtBC,eAA2C,KAChC,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,UAAU,EAAEC,UAAU,EAAEC,eAAe;AAChG,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBAO,OAAA,CAAAX,eAAA,GAAAA,eAAA;AAyBO,MAAMU,UAAU,GAAGA,CACtBE,KAA8B,EAC9BV,UAA4B,EAC5BC,UAAsB,EACtBC,eAA2C,KACvC;EACJ,MAAMS,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACD,KAAK,CAGnC;EAED,MAAMG,YAAY,GAAGD,MAAM,CACtBE,WAAW,CAACH,OAAO,CACfI,GAAG,CAACC,IAAA,IAAkB;IAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IACd,MAAMG,mBAAmB,GAAGF,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB;IAEhF,IAAIE,mBAAmB,EAAE;MACrB,OAAO,CACHF,GAAG,EACHT,UAAU,CAACU,KAAK,EAA6BlB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CACxF;IACL;IAEA,MAAMkB,WAAW,GAAGH,GAAG,KAAK,WAAW;IAEvC,IAAIG,WAAW,IAAIC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;MACrC,OAAO,CACHD,GAAG,EACHC,KAAK,CAACH,GAAG,CAACG,KAAK,IAAIV,UAAU,CAACU,KAAK,EAAElB,UAAU,EAAEC,UAAU,EAAEC,eAAe,CAAC,CAAC,CACjF;IACL;IAEA,MAAMqB,iBAAiB,GAAG,OAAOL,KAAK,KAAK,UAAU;IACrD,MAAMM,YAAY,GAAG,OAAON,KAAK,KAAK,QAAQ;IAE9C,IAAIK,iBAAiB,IAAIC,YAAY,EAAE;MACnC,OAAO,CAACP,GAAG,EAAEC,KAAK,CAAC;IACvB;IAEA,OAAO,CACHD,GAAG,EACH,IAAAQ,kCAAqB,EACjBP,KAAK,EACLlB,UAAU,EACVC,UAAU,EACVC,eACJ,CAAC,CACJ;EACL,CAAC,CACL,CAAC;EAEL,OAAO,IAAAwB,aAAK,EAAC,CAAC,GACR,IAAAC,gCAAe,EAACd,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC;AAAAJ,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
|
@@ -14,13 +14,14 @@ describe('styles', () => {
|
|
14
14
|
sm: 400,
|
15
15
|
md: 800
|
16
16
|
};
|
17
|
+
const breakpointPairs = Object.entries(breakpoints);
|
17
18
|
const dynamicFunction = isEven => ({
|
18
19
|
backgroundColor: {
|
19
20
|
sm: isEven ? 'green' : 'red',
|
20
21
|
md: isEven ? 'orange' : 'pink'
|
21
22
|
}
|
22
23
|
});
|
23
|
-
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize,
|
24
|
+
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize, breakpointPairs)(true)).toEqual({
|
24
25
|
backgroundColor: 'green'
|
25
26
|
});
|
26
27
|
});
|
@@ -35,13 +36,14 @@ describe('styles', () => {
|
|
35
36
|
sm: 400,
|
36
37
|
md: 800
|
37
38
|
};
|
39
|
+
const breakpointPairs = Object.entries(breakpoints);
|
38
40
|
const dynamicFunction = isEven => ({
|
39
41
|
backgroundColor: {
|
40
42
|
':w[,399]': isEven ? 'green' : 'red',
|
41
43
|
':w[400]': isEven ? 'orange' : 'pink'
|
42
44
|
}
|
43
45
|
});
|
44
|
-
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize,
|
46
|
+
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize, breakpointPairs)(false)).toEqual({
|
45
47
|
backgroundColor: 'pink'
|
46
48
|
});
|
47
49
|
});
|
@@ -56,10 +58,11 @@ describe('styles', () => {
|
|
56
58
|
sm: 400,
|
57
59
|
md: 800
|
58
60
|
};
|
61
|
+
const breakpointPairs = Object.entries(breakpoints);
|
59
62
|
const dynamicFunction = isEven => ({
|
60
63
|
backgroundColor: isEven ? 'pink' : 'purple'
|
61
64
|
});
|
62
|
-
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize,
|
65
|
+
expect((0, _styles.proxifyFunction)(dynamicFunction, breakpoint, screenSize, breakpointPairs)(false)).toEqual({
|
63
66
|
backgroundColor: 'purple'
|
64
67
|
});
|
65
68
|
});
|
@@ -76,6 +79,7 @@ describe('styles', () => {
|
|
76
79
|
sm: 400,
|
77
80
|
md: 800
|
78
81
|
};
|
82
|
+
const breakpointPairs = Object.entries(breakpoints);
|
79
83
|
const style = {
|
80
84
|
fontSize: {
|
81
85
|
sm: 12,
|
@@ -87,7 +91,8 @@ describe('styles', () => {
|
|
87
91
|
},
|
88
92
|
fontWeight: 'bold'
|
89
93
|
};
|
90
|
-
|
94
|
+
const parsedStyles = (0, _styles.parseStyle)(style, breakpoint, screenSize, breakpointPairs);
|
95
|
+
expect(parsedStyles).toEqual({
|
91
96
|
fontSize: 12,
|
92
97
|
backgroundColor: 'pink',
|
93
98
|
fontWeight: 'bold'
|
@@ -104,6 +109,7 @@ describe('styles', () => {
|
|
104
109
|
sm: 400,
|
105
110
|
md: 800
|
106
111
|
};
|
112
|
+
const breakpointPairs = Object.entries(breakpoints);
|
107
113
|
const style = {
|
108
114
|
transform: [{
|
109
115
|
translateX: {
|
@@ -113,7 +119,8 @@ describe('styles', () => {
|
|
113
119
|
translateY: 200
|
114
120
|
}]
|
115
121
|
};
|
116
|
-
|
122
|
+
const parsedStyles = (0, _styles.parseStyle)(style, breakpoint, screenSize, breakpointPairs);
|
123
|
+
expect(parsedStyles).toEqual({
|
117
124
|
transform: [{
|
118
125
|
translateX: 120,
|
119
126
|
translateY: 200
|
@@ -131,6 +138,7 @@ describe('styles', () => {
|
|
131
138
|
sm: 400,
|
132
139
|
md: 800
|
133
140
|
};
|
141
|
+
const breakpointPairs = Object.entries(breakpoints);
|
134
142
|
const style = {
|
135
143
|
shadowOffset: {
|
136
144
|
width: 0,
|
@@ -146,13 +154,15 @@ describe('styles', () => {
|
|
146
154
|
}
|
147
155
|
}
|
148
156
|
};
|
149
|
-
|
157
|
+
const parsedStyles = (0, _styles.parseStyle)(style, breakpoint, screenSize, breakpointPairs);
|
158
|
+
const parsedStylesWithBreakpoints = (0, _styles.parseStyle)(styleWithBreakpoints, breakpoint, screenSize, breakpointPairs);
|
159
|
+
expect(parsedStyles).toEqual({
|
150
160
|
shadowOffset: {
|
151
161
|
width: 0,
|
152
162
|
height: 4
|
153
163
|
}
|
154
164
|
});
|
155
|
-
expect(
|
165
|
+
expect(parsedStylesWithBreakpoints).toEqual({
|
156
166
|
shadowOffset: {
|
157
167
|
width: 0,
|
158
168
|
height: 10
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_styles","require","describe","it","screenSize","width","height","breakpoint","breakpoints","xs","sm","md","dynamicFunction","isEven","backgroundColor","expect","proxifyFunction","toEqual","style","fontSize","fontWeight","parseStyle","transform","translateX","translateY","shadowOffset","styleWithBreakpoints"],"sourceRoot":"../../../src","sources":["utils/styles.spec.ts"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;
|
1
|
+
{"version":3,"names":["_styles","require","describe","it","screenSize","width","height","breakpoint","breakpoints","xs","sm","md","breakpointPairs","Object","entries","dynamicFunction","isEven","backgroundColor","expect","proxifyFunction","toEqual","style","fontSize","fontWeight","parsedStyles","parseStyle","transform","translateX","translateY","shadowOffset","styleWithBreakpoints","parsedStylesWithBreakpoints"],"sourceRoot":"../../../src","sources":["utils/styles.spec.ts"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;EACrBA,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAC9BC,EAAE,CAAC,yCAAyC,EAAE,MAAM;MAChD,MAAMC,UAAsB,GAAG;QAC3BC,KAAK,EAAE,GAAG;QACVC,MAAM,EAAE;MACZ,CAAC;MACD,MAAMC,UAAU,GAAG,IAAI;MACvB,MAAMC,WAAW,GAAG;QAChBC,EAAE,EAAE,CAAC;QACLC,EAAE,EAAE,GAAG;QACPC,EAAE,EAAE;MACR,CAAC;MACD,MAAMC,eAAe,GAAGC,MAAM,CACzBC,OAAO,CAACN,WAAW,CAAgD;MACxE,MAAMO,eAAe,GAAIC,MAAe,KAAM;QAC1CC,eAAe,EAAE;UACbP,EAAE,EAAEM,MAAM,GACJ,OAAO,GACP,KAAK;UACXL,EAAE,EAAEK,MAAM,GACJ,QAAQ,GACR;QACV;MACJ,CAAC,CAAC;MAEFE,MAAM,CAAC,IAAAC,uBAAe,EAACJ,eAAe,EAAER,UAAU,EAAEH,UAAU,EAAEQ,eAAe,CAAC,CAAC,IAAI,CAA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U,EACVH,UAAU,EACVQ,eACJ,CAAC;MAEDM,MAAM,CAACM,YAAY,CAAC,CAACJ,OAAO,CAAC;QACzBS,YAAY,EAAE;UACVxB,KAAK,EAAE,CAAC;UACRC,MAAM,EAAE;QACZ;MACJ,CAAC,CAAC;MACFY,MAAM,CAACa,2BAA2B,CAAC,CAACX,OAAO,CAAC;QACxCS,YAAY,EAAE;UACVxB,KAAK,EAAE,CAAC;UACRC,MAAM,EAAE;QACZ;MACJ,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,19 +1,30 @@
|
|
1
1
|
import { useContext } from 'react';
|
2
|
+
import { StyleSheet } from 'react-native';
|
2
3
|
import { UnistylesContext } from './UnistylesTheme';
|
3
|
-
import { getBreakpointFromScreenWidth, proxifyFunction, parseStyle, sortAndValidateBreakpoints } from './utils';
|
4
4
|
import { useDimensions } from './hooks';
|
5
|
+
import { getBreakpointFromScreenWidth, proxifyFunction, parseStyle, sortAndValidateBreakpoints } from './utils';
|
5
6
|
export const createUnistyles = breakpoints => {
|
6
7
|
const sortedBreakpoints = sortAndValidateBreakpoints(breakpoints);
|
8
|
+
const sortedBreakpointEntries = Object.entries(sortedBreakpoints);
|
7
9
|
return {
|
8
|
-
|
10
|
+
/**
|
11
|
+
* @deprecated The method should not be used, proposed version by the community is createStyleSheet, will be removed in RC
|
12
|
+
*/
|
13
|
+
createStyles: styles => {
|
14
|
+
if (typeof styles === 'function') {
|
15
|
+
return styles;
|
16
|
+
}
|
17
|
+
return styles;
|
18
|
+
},
|
19
|
+
createStyleSheet: styles => {
|
20
|
+
if (typeof styles === 'function') {
|
21
|
+
return styles;
|
22
|
+
}
|
23
|
+
return styles;
|
24
|
+
},
|
9
25
|
useStyles: stylesheet => {
|
10
26
|
const theme = useContext(UnistylesContext);
|
11
|
-
const
|
12
|
-
const breakpoint = getBreakpointFromScreenWidth(dimensions.width, sortedBreakpoints);
|
13
|
-
const screenSize = {
|
14
|
-
width: dimensions.width,
|
15
|
-
height: dimensions.height
|
16
|
-
};
|
27
|
+
const screenSize = useDimensions();
|
17
28
|
if (!stylesheet) {
|
18
29
|
return {
|
19
30
|
theme,
|
@@ -21,19 +32,20 @@ export const createUnistyles = breakpoints => {
|
|
21
32
|
};
|
22
33
|
}
|
23
34
|
const parsedStyles = typeof stylesheet === 'function' ? stylesheet(theme) : stylesheet;
|
35
|
+
const breakpoint = getBreakpointFromScreenWidth(screenSize.width, sortedBreakpointEntries);
|
24
36
|
const dynamicStyleSheet = Object.entries(parsedStyles).reduce((acc, _ref) => {
|
25
37
|
let [key, value] = _ref;
|
26
|
-
const
|
38
|
+
const style = value;
|
27
39
|
if (typeof value === 'function') {
|
28
40
|
return {
|
29
41
|
...acc,
|
30
|
-
[key]: proxifyFunction(value, breakpoint, screenSize,
|
42
|
+
[key]: proxifyFunction(value, breakpoint, screenSize, sortedBreakpointEntries)
|
31
43
|
};
|
32
44
|
}
|
33
|
-
return {
|
45
|
+
return StyleSheet.create({
|
34
46
|
...acc,
|
35
|
-
[key]: parseStyle(
|
36
|
-
};
|
47
|
+
[key]: parseStyle(style, breakpoint, screenSize, sortedBreakpointEntries)
|
48
|
+
});
|
37
49
|
}, {});
|
38
50
|
return {
|
39
51
|
theme,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useContext","UnistylesContext","getBreakpointFromScreenWidth","proxifyFunction","parseStyle","sortAndValidateBreakpoints","
|
1
|
+
{"version":3,"names":["useContext","StyleSheet","UnistylesContext","useDimensions","getBreakpointFromScreenWidth","proxifyFunction","parseStyle","sortAndValidateBreakpoints","createUnistyles","breakpoints","sortedBreakpoints","sortedBreakpointEntries","Object","entries","createStyles","styles","createStyleSheet","useStyles","stylesheet","theme","screenSize","parsedStyles","breakpoint","width","dynamicStyleSheet","reduce","acc","_ref","key","value","style","create"],"sourceRoot":"../../src","sources":["createUnistyles.ts"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC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