react-native-unistyles 2.0.0-alpha.6 → 2.0.0-alpha.8
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/{types/cxx.js → common.js} +6 -6
- package/lib/commonjs/common.js.map +1 -0
- package/lib/commonjs/core/UnistyleRegistry.js.map +1 -0
- package/lib/commonjs/{Unistyles.js → core/Unistyles.js} +2 -7
- package/lib/commonjs/core/Unistyles.js.map +1 -0
- package/lib/commonjs/core/UnistylesModule.js.map +1 -0
- package/lib/commonjs/{UnistylesRuntime.js → core/UnistylesRuntime.js} +5 -5
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -0
- package/lib/commonjs/core/index.js +13 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/hooks/index.js +10 -3
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/{useInitialTheme.js → hooks/useInitialTheme.js} +2 -2
- package/lib/commonjs/hooks/useInitialTheme.js.map +1 -0
- package/lib/commonjs/hooks/useUnistyles.js +54 -0
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -0
- package/lib/commonjs/index.js +15 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/common.js +2 -0
- package/lib/commonjs/types/{mediaQueries.js.map → common.js.map} +1 -1
- package/lib/commonjs/types/index.js +4 -4
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/mq.js +6 -0
- package/lib/{module/types/mediaQueries.js.map → commonjs/types/mq.js.map} +1 -1
- package/lib/commonjs/types/unistyles.js +6 -0
- package/lib/commonjs/types/unistyles.js.map +1 -0
- package/lib/commonjs/useStyles.js +7 -4
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/breakpoints.js +18 -20
- package/lib/commonjs/utils/breakpoints.js.map +1 -1
- package/lib/commonjs/utils/index.js +14 -34
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mq.js +89 -0
- package/lib/commonjs/utils/mq.js.map +1 -0
- package/lib/commonjs/utils/mqParser.js +86 -0
- package/lib/commonjs/utils/mqParser.js.map +1 -0
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/module/{types/cxx.js → common.js} +6 -6
- package/lib/module/common.js.map +1 -0
- package/lib/module/core/UnistyleRegistry.js.map +1 -0
- package/lib/module/{Unistyles.js → core/Unistyles.js} +1 -6
- package/lib/module/core/Unistyles.js.map +1 -0
- package/lib/module/core/UnistylesModule.js.map +1 -0
- package/lib/module/{UnistylesRuntime.js → core/UnistylesRuntime.js} +1 -1
- package/lib/module/core/UnistylesRuntime.js.map +1 -0
- package/lib/module/core/index.js +2 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/hooks/index.js +2 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/{useInitialTheme.js → hooks/useInitialTheme.js} +1 -1
- package/lib/module/hooks/useInitialTheme.js.map +1 -0
- package/lib/module/hooks/useUnistyles.js +47 -0
- package/lib/module/hooks/useUnistyles.js.map +1 -0
- package/lib/module/index.js +7 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/mq.js +2 -0
- package/lib/module/types/mq.js.map +1 -0
- package/lib/module/types/unistyles.js +2 -0
- package/lib/module/types/unistyles.js.map +1 -0
- package/lib/module/useStyles.js +6 -3
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/breakpoints.js +14 -16
- package/lib/module/utils/breakpoints.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mq.js +83 -0
- package/lib/module/utils/mq.js.map +1 -0
- package/lib/module/utils/mqParser.js +79 -0
- package/lib/module/utils/mqParser.js.map +1 -0
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/typescript/src/common.d.ts +17 -0
- package/lib/typescript/src/common.d.ts.map +1 -0
- package/lib/typescript/src/{UnistyleRegistry.d.ts → core/UnistyleRegistry.d.ts} +2 -2
- package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -0
- package/lib/typescript/src/{Unistyles.d.ts → core/Unistyles.d.ts} +0 -3
- package/lib/typescript/src/core/Unistyles.d.ts.map +1 -0
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -0
- package/lib/typescript/src/{UnistylesRuntime.d.ts → core/UnistylesRuntime.d.ts} +6 -6
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +2 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/index.d.ts +2 -1
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useInitialTheme.d.ts +3 -0
- package/lib/typescript/src/hooks/useInitialTheme.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useUnistyles.d.ts +12 -0
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -9
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/breakpoints.d.ts +5 -9
- package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/types/common.d.ts +3 -0
- package/lib/typescript/src/types/common.d.ts.map +1 -0
- package/lib/typescript/src/types/core.d.ts +9 -4
- package/lib/typescript/src/types/core.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +5 -4
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/mq.d.ts +3 -0
- package/lib/typescript/src/types/mq.d.ts.map +1 -0
- package/lib/typescript/src/types/{cxx.d.ts → unistyles.d.ts} +4 -22
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -0
- package/lib/typescript/src/useStyles.d.ts +8 -6
- package/lib/typescript/src/useStyles.d.ts.map +1 -1
- package/lib/typescript/src/utils/breakpoints.d.ts +2 -2
- package/lib/typescript/src/utils/breakpoints.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/mq.d.ts +21 -0
- package/lib/typescript/src/utils/mq.d.ts.map +1 -0
- package/lib/typescript/src/utils/mqParser.d.ts +3 -0
- package/lib/typescript/src/utils/mqParser.d.ts.map +1 -0
- package/lib/typescript/src/utils/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +18 -0
- package/src/{UnistyleRegistry.ts → core/UnistyleRegistry.ts} +2 -2
- package/src/{Unistyles.ts → core/Unistyles.ts} +2 -9
- package/src/{UnistylesRuntime.ts → core/UnistylesRuntime.ts} +3 -3
- package/src/core/index.ts +1 -0
- package/src/hooks/index.ts +2 -1
- package/src/{useInitialTheme.ts → hooks/useInitialTheme.ts} +2 -2
- package/src/hooks/useUnistyles.ts +55 -0
- package/src/index.ts +10 -7
- package/src/types/breakpoints.ts +6 -11
- package/src/types/common.ts +2 -0
- package/src/types/core.ts +10 -4
- package/src/types/index.ts +5 -9
- package/src/types/mq.ts +3 -0
- package/src/types/{cxx.ts → unistyles.ts} +3 -24
- package/src/useStyles.ts +15 -8
- package/src/utils/breakpoints.ts +13 -12
- package/src/utils/index.ts +2 -8
- package/src/utils/mq.ts +106 -0
- package/src/utils/mqParser.ts +99 -0
- package/src/utils/styles.ts +2 -2
- package/lib/commonjs/UnistyleRegistry.js.map +0 -1
- package/lib/commonjs/Unistyles.js.map +0 -1
- package/lib/commonjs/UnistylesEngine.js +0 -26
- package/lib/commonjs/UnistylesEngine.js.map +0 -1
- package/lib/commonjs/UnistylesModule.js.map +0 -1
- package/lib/commonjs/UnistylesRuntime.js.map +0 -1
- package/lib/commonjs/hooks/useDimensions.js +0 -10
- package/lib/commonjs/hooks/useDimensions.js.map +0 -1
- package/lib/commonjs/hooks/useDimensions.web.js +0 -34
- package/lib/commonjs/hooks/useDimensions.web.js.map +0 -1
- package/lib/commonjs/types/cxx.js.map +0 -1
- package/lib/commonjs/types/mediaQueries.js +0 -2
- package/lib/commonjs/useInitialTheme.js.map +0 -1
- package/lib/commonjs/useUnistyles.js +0 -51
- package/lib/commonjs/useUnistyles.js.map +0 -1
- package/lib/commonjs/utils/mediaQueries.js +0 -98
- package/lib/commonjs/utils/mediaQueries.js.map +0 -1
- package/lib/module/UnistyleRegistry.js.map +0 -1
- package/lib/module/Unistyles.js.map +0 -1
- package/lib/module/UnistylesEngine.js +0 -19
- package/lib/module/UnistylesEngine.js.map +0 -1
- package/lib/module/UnistylesModule.js.map +0 -1
- package/lib/module/UnistylesRuntime.js.map +0 -1
- package/lib/module/hooks/useDimensions.js +0 -3
- package/lib/module/hooks/useDimensions.js.map +0 -1
- package/lib/module/hooks/useDimensions.web.js +0 -27
- package/lib/module/hooks/useDimensions.web.js.map +0 -1
- package/lib/module/types/cxx.js.map +0 -1
- package/lib/module/types/mediaQueries.js +0 -2
- package/lib/module/useInitialTheme.js.map +0 -1
- package/lib/module/useUnistyles.js +0 -44
- package/lib/module/useUnistyles.js.map +0 -1
- package/lib/module/utils/mediaQueries.js +0 -85
- package/lib/module/utils/mediaQueries.js.map +0 -1
- package/lib/typescript/src/UnistyleRegistry.d.ts.map +0 -1
- package/lib/typescript/src/Unistyles.d.ts.map +0 -1
- package/lib/typescript/src/UnistylesEngine.d.ts +0 -11
- package/lib/typescript/src/UnistylesEngine.d.ts.map +0 -1
- package/lib/typescript/src/UnistylesModule.d.ts.map +0 -1
- package/lib/typescript/src/UnistylesRuntime.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useDimensions.d.ts +0 -3
- package/lib/typescript/src/hooks/useDimensions.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useDimensions.web.d.ts +0 -3
- package/lib/typescript/src/hooks/useDimensions.web.d.ts.map +0 -1
- package/lib/typescript/src/types/cxx.d.ts.map +0 -1
- package/lib/typescript/src/types/mediaQueries.d.ts +0 -10
- package/lib/typescript/src/types/mediaQueries.d.ts.map +0 -1
- package/lib/typescript/src/useInitialTheme.d.ts +0 -3
- package/lib/typescript/src/useInitialTheme.d.ts.map +0 -1
- package/lib/typescript/src/useUnistyles.d.ts +0 -11
- package/lib/typescript/src/useUnistyles.d.ts.map +0 -1
- package/lib/typescript/src/utils/mediaQueries.d.ts +0 -11
- package/lib/typescript/src/utils/mediaQueries.d.ts.map +0 -1
- package/src/UnistylesEngine.ts +0 -24
- package/src/hooks/useDimensions.ts +0 -4
- package/src/hooks/useDimensions.web.ts +0 -34
- package/src/types/mediaQueries.ts +0 -15
- package/src/useUnistyles.ts +0 -54
- package/src/utils/mediaQueries.ts +0 -152
- /package/lib/commonjs/{UnistyleRegistry.js → core/UnistyleRegistry.js} +0 -0
- /package/lib/commonjs/{UnistylesModule.js → core/UnistylesModule.js} +0 -0
- /package/lib/module/{UnistyleRegistry.js → core/UnistyleRegistry.js} +0 -0
- /package/lib/module/{UnistylesModule.js → core/UnistylesModule.js} +0 -0
- /package/lib/typescript/src/{UnistylesModule.d.ts → core/UnistylesModule.d.ts} +0 -0
- /package/src/{UnistylesModule.ts → core/UnistylesModule.ts} +0 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
import { unistyles } from '../core';
|
2
|
+
export const MQSymbol = Symbol('unistyles-mq');
|
3
|
+
var MQProp = /*#__PURE__*/function (MQProp) {
|
4
|
+
MQProp["toString"] = "toString";
|
5
|
+
MQProp["width"] = "width";
|
6
|
+
MQProp["height"] = "height";
|
7
|
+
MQProp["shortW"] = "w";
|
8
|
+
MQProp["shortH"] = "h";
|
9
|
+
return MQProp;
|
10
|
+
}(MQProp || {});
|
11
|
+
const getMQValue = value => {
|
12
|
+
if (typeof value === 'number') {
|
13
|
+
return value;
|
14
|
+
}
|
15
|
+
if (value === null) {
|
16
|
+
return 0;
|
17
|
+
}
|
18
|
+
return unistyles.registry.breakpoints[value] ?? 0;
|
19
|
+
};
|
20
|
+
const widthHandler = function () {
|
21
|
+
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
22
|
+
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
23
|
+
return new Proxy({}, {
|
24
|
+
get: (target, prop, receiver) => {
|
25
|
+
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
26
|
+
return () => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
27
|
+
}
|
28
|
+
if (prop === MQProp.width || prop === MQProp.shortW) {
|
29
|
+
return function () {
|
30
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
31
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
32
|
+
return new Proxy({}, {
|
33
|
+
get: (target, prop, receiver) => {
|
34
|
+
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
35
|
+
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
36
|
+
}
|
37
|
+
return Reflect.get(target, prop, receiver);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
};
|
41
|
+
}
|
42
|
+
return Reflect.get(target, prop, receiver);
|
43
|
+
}
|
44
|
+
});
|
45
|
+
};
|
46
|
+
const heightHandler = function () {
|
47
|
+
let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
48
|
+
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
49
|
+
return new Proxy({}, {
|
50
|
+
get: (target, prop, receiver) => {
|
51
|
+
if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
|
52
|
+
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
53
|
+
}
|
54
|
+
if (prop === MQProp.height || prop === MQProp.shortH) {
|
55
|
+
return function () {
|
56
|
+
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
57
|
+
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
58
|
+
return new Proxy({}, {
|
59
|
+
get: (target, prop, receiver) => {
|
60
|
+
if (prop === Symbol.toPrimitive || MQProp.toString) {
|
61
|
+
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
62
|
+
}
|
63
|
+
return Reflect.get(target, prop, receiver);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
};
|
67
|
+
}
|
68
|
+
return Reflect.get(target, prop, receiver);
|
69
|
+
}
|
70
|
+
});
|
71
|
+
};
|
72
|
+
export const mq = new Proxy({}, {
|
73
|
+
get: (target, prop, receiver) => {
|
74
|
+
if (prop === MQProp.shortW || prop === MQProp.width) {
|
75
|
+
return heightHandler;
|
76
|
+
}
|
77
|
+
if (prop === MQProp.shortH || prop === MQProp.height) {
|
78
|
+
return widthHandler;
|
79
|
+
}
|
80
|
+
return Reflect.get(target, prop, receiver);
|
81
|
+
}
|
82
|
+
});
|
83
|
+
//# sourceMappingURL=mq.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["unistyles","MQSymbol","Symbol","MQProp","getMQValue","value","registry","breakpoints","widthHandler","hMin","arguments","length","undefined","hMax","Infinity","Proxy","get","target","prop","receiver","toPrimitive","toString","width","shortW","wMin","wMax","Reflect","heightHandler","height","shortH","mq"],"sourceRoot":"../../../src","sources":["utils/mq.ts"],"mappings":"AAEA,SAASA,SAAS,QAAQ,SAAS;AAEnC,OAAO,MAAMC,QAAQ,GAAGC,MAAM,CAAC,cAAc,CAAC;AAAA,IAyBzCC,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA,EAANA,MAAM;AAQX,MAAMC,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;E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+
const parseMq = mq => {
|
5
|
+
const [, width, fromW, toW] = UNISTYLES_WIDTH_REGEX.exec(mq) || [];
|
6
|
+
const [, height, fromH, toH] = UNISTYLES_HEIGHT_REGEX.exec(mq) || [];
|
7
|
+
return {
|
8
|
+
width: width ? {
|
9
|
+
from: Number(fromW),
|
10
|
+
to: Number(toW)
|
11
|
+
} : undefined,
|
12
|
+
height: height ? {
|
13
|
+
from: Number(fromH),
|
14
|
+
to: Number(toH)
|
15
|
+
} : undefined
|
16
|
+
};
|
17
|
+
};
|
18
|
+
const isUnistylesMq = mq => IS_UNISTYLES_REGEX.test(mq);
|
19
|
+
const isValidMq = parsedMq => {
|
20
|
+
const {
|
21
|
+
width,
|
22
|
+
height
|
23
|
+
} = parsedMq;
|
24
|
+
if (width && height) {
|
25
|
+
return width.from <= width.to && height.from <= height.to;
|
26
|
+
}
|
27
|
+
if (width) {
|
28
|
+
return width.from <= width.to;
|
29
|
+
}
|
30
|
+
if (height) {
|
31
|
+
return height.from <= height.to;
|
32
|
+
}
|
33
|
+
return false;
|
34
|
+
};
|
35
|
+
const isWithinTheWidthAndHeight = (parsedMq, screenSize) => {
|
36
|
+
const {
|
37
|
+
width,
|
38
|
+
height
|
39
|
+
} = parsedMq;
|
40
|
+
if (width && height) {
|
41
|
+
return isWithinTheWidth(width, screenSize.width) && isWithinTheHeight(height, screenSize.height);
|
42
|
+
}
|
43
|
+
if (width) {
|
44
|
+
return isWithinTheWidth(width, screenSize.width);
|
45
|
+
}
|
46
|
+
if (height) {
|
47
|
+
return isWithinTheHeight(height, screenSize.height);
|
48
|
+
}
|
49
|
+
return false;
|
50
|
+
};
|
51
|
+
const isWithinTheWidth = (width, screenWidth) => {
|
52
|
+
const {
|
53
|
+
from,
|
54
|
+
to
|
55
|
+
} = width;
|
56
|
+
return screenWidth >= from && screenWidth <= to;
|
57
|
+
};
|
58
|
+
const isWithinTheHeight = (height, screenHeight) => {
|
59
|
+
const {
|
60
|
+
from,
|
61
|
+
to
|
62
|
+
} = height;
|
63
|
+
return screenHeight >= from && screenHeight <= to;
|
64
|
+
};
|
65
|
+
export const getKeyForUnistylesMediaQuery = (mediaQueries, screenSize) => {
|
66
|
+
const mq = mediaQueries.find(_ref => {
|
67
|
+
let [key] = _ref;
|
68
|
+
if (!isUnistylesMq(key)) {
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
const parsedMq = parseMq(key);
|
72
|
+
if (!isValidMq(parsedMq)) {
|
73
|
+
return false;
|
74
|
+
}
|
75
|
+
return isWithinTheWidthAndHeight(parsedMq, screenSize);
|
76
|
+
});
|
77
|
+
return mq?.at(0);
|
78
|
+
};
|
79
|
+
//# sourceMappingURL=mqParser.js.map
|
@@ -0,0 +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,sCAAsC;AACpE,MAAMC,sBAAsB,GAAG,sCAAsC;AAYrE,MAAMC,OAAO,GAAIC,EAAU,IAAwB;EAC/C,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;M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AAC;EACvD;EAEA,OAAO,KAAK;AAChB,CAAC;AAED,MAAMa,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,YAAwB,EAAEN,UAAsB,KAAK;EAC9F,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"}
|
@@ -1 +1 @@
|
|
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/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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,
|
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/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,EAAEC,KAAK,EAAEC,KAAK,QAAQ,UAAU;AAElD,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,EAAY,EAAEC,UAA+C,EAC7DC,UAAsB,KACX,IAAIC,KAAK,CAACH,EAAE,EAAE;EACzBI,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEN,UAAU,EAAEC,UAAU;AAC/E,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIb,KAA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qF,CAAC,CAC/G;EACL,CAAC,CACL,CAAC;EAEL,OAAOZ,KAAK,GACNH,eAAe,CAACqB,YAAY,CAAC,GAC7BA,YAAY;AACtB,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export declare enum CxxUnistylesEventTypes {
|
2
|
+
Theme = "theme",
|
3
|
+
Layout = "layout"
|
4
|
+
}
|
5
|
+
export declare enum UnistylesError {
|
6
|
+
RuntimeUnavailable = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE",
|
7
|
+
ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND",
|
8
|
+
ThemeNotRegistered = "UNISTYLES_ERROR_THEME_NOT_REGISTERED",
|
9
|
+
ThemesCannotBeEmpty = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY",
|
10
|
+
BreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY",
|
11
|
+
BreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO"
|
12
|
+
}
|
13
|
+
export declare enum ScreenOrientation {
|
14
|
+
Portrait = 1,
|
15
|
+
Landscape = 2
|
16
|
+
}
|
17
|
+
//# sourceMappingURL=common.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAC9B,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED,oBAAY,cAAc;IACtB,kBAAkB,wCAAwC;IAC1D,aAAa,oCAAoC;IACjD,kBAAkB,yCAAyC;IAC3D,mBAAmB,2CAA2C;IAC9D,wBAAwB,gDAAgD;IACxE,4BAA4B,qDAAqD;CACpF;AAED,oBAAY,iBAAiB;IACzB,QAAQ,IAAI;IACZ,SAAS,IAAI;CAChB"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { UnistylesBridge, UnistylesConfig } from '
|
2
|
-
import type {
|
1
|
+
import type { UnistylesBridge, UnistylesConfig } from '../types';
|
2
|
+
import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
|
3
3
|
export declare class UnistyleRegistry {
|
4
4
|
private unistylesBridge;
|
5
5
|
config: UnistylesConfig;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEtE,qBAAa,gBAAgB;IAOb,OAAO,CAAC,eAAe;IAN5B,MAAM,EAAE,eAAe,CAAK;IAC5B,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,UAS1C;IAEM,cAAc,gBAAiB,oBAAoB,UAKzD;IAEM,SAAS,WAAY,eAAe,UAQ1C;IAEM,qBAAqB,aAQ3B;CACJ"}
|
@@ -1,15 +1,12 @@
|
|
1
1
|
import { UnistylesRuntime } from './UnistylesRuntime';
|
2
|
-
import { UnistylesBuiltInEngine } from './UnistylesEngine';
|
3
2
|
import { UnistyleRegistry } from './UnistyleRegistry';
|
4
3
|
declare class Unistyles {
|
5
4
|
private _runtime;
|
6
|
-
private _engine;
|
7
5
|
private _registry;
|
8
6
|
private _bridge;
|
9
7
|
constructor();
|
10
8
|
get registry(): UnistyleRegistry;
|
11
9
|
get runtime(): UnistylesRuntime;
|
12
|
-
get engine(): UnistylesBuiltInEngine;
|
13
10
|
}
|
14
11
|
export declare const unistyles: Unistyles;
|
15
12
|
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Unistyles.d.ts","sourceRoot":"","sources":["../../../../src/core/Unistyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAIrD,cAAM,SAAS;IACX,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;;IAehC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import
|
1
|
+
import { ScreenOrientation } from '../common';
|
2
|
+
import type { UnistylesBridge } from '../types';
|
3
|
+
import type { UnistylesThemes } from '../global';
|
2
4
|
import type { UnistyleRegistry } from './UnistyleRegistry';
|
3
|
-
import { ScreenOrientation } from './types';
|
4
|
-
import type { UnistylesThemes } from './global';
|
5
5
|
export declare class UnistylesRuntime {
|
6
6
|
private unistylesBridge;
|
7
7
|
private registry;
|
8
8
|
constructor(unistylesBridge: UnistylesBridge, registry: UnistyleRegistry);
|
9
|
-
get colorScheme(): import("
|
9
|
+
get colorScheme(): import("../types").ColorSchemeName;
|
10
10
|
get hasAdaptiveThemes(): boolean;
|
11
|
-
get sortedBreakpoints(): [keyof import("
|
11
|
+
get sortedBreakpoints(): [keyof import("../global").UnistylesBreakpoints, number | undefined][];
|
12
12
|
get themeName(): never;
|
13
|
-
get breakpoint(): keyof import("
|
13
|
+
get breakpoint(): keyof import("../global").UnistylesBreakpoints;
|
14
14
|
get screen(): {
|
15
15
|
width: number;
|
16
16
|
height: number;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,WAAW,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,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,QAAQ;gBAAlD,eAAe,EAAE,eAAe,EAAU,QAAQ,EAAE,gBAAgB;IAExF,IAAW,WAAW,uCAErB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,iBAAiB,2EAE3B;IAED,IAAW,SAAS,UAEnB;IAED,IAAW,UAAU,mDAEpB;IAED,IAAW,MAAM;;;MAKhB;IAED,IAAW,WAAW,sBAQrB;IAEM,QAAQ,SAAU,MAAM,eAAe,aAQ7C;IAEM,QAAQ,YAAa,MAAM,eAAe,WAUhD;IAEM,iBAAiB,WAAY,OAAO,UAE1C;IAED,OAAO,CAAC,QAAQ,CAAgE;CACnF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useInitialTheme.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useInitialTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,eAAO,MAAM,eAAe,YAAa,MAAM,eAAe,SAE7D,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export declare const useUnistyles: () => {
|
2
|
+
theme: never;
|
3
|
+
layout: {
|
4
|
+
breakpoint: keyof import("..").UnistylesBreakpoints;
|
5
|
+
orientation: import("../common").ScreenOrientation;
|
6
|
+
screenSize: {
|
7
|
+
width: number;
|
8
|
+
height: number;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=useUnistyles.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useUnistyles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;CA8CxB,CAAA"}
|
@@ -1,16 +1,17 @@
|
|
1
|
+
import { mq } from './utils';
|
2
|
+
import { useInitialTheme } from './hooks';
|
1
3
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global';
|
2
|
-
import { ScreenOrientation } from './
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
declare const UnistylesRuntime: import("./UnistylesRuntime").UnistylesRuntime;
|
4
|
+
import { ScreenOrientation } from './common';
|
5
|
+
import { useStyles } from './useStyles';
|
6
|
+
import { createStyleSheet } from './createStyleSheet';
|
7
|
+
declare const UnistylesRuntime: import("./core/UnistylesRuntime").UnistylesRuntime;
|
7
8
|
declare const UnistylesRegistry: {
|
8
|
-
addThemes: (themes: UnistylesThemes) => import("./UnistyleRegistry").UnistyleRegistry;
|
9
|
-
addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./UnistyleRegistry").UnistyleRegistry;
|
10
|
-
addConfig: (config: import("./types").UnistylesConfig) => import("./UnistyleRegistry").UnistyleRegistry;
|
9
|
+
addThemes: (themes: UnistylesThemes) => import("./core/UnistyleRegistry").UnistyleRegistry;
|
10
|
+
addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./core/UnistyleRegistry").UnistyleRegistry;
|
11
|
+
addConfig: (config: import("./types").UnistylesConfig) => import("./core/UnistyleRegistry").UnistyleRegistry;
|
11
12
|
};
|
12
13
|
export declare const __dangerouslyUnregister: () => void;
|
13
14
|
export { UnistylesRuntime, UnistylesRegistry };
|
14
|
-
export { ScreenOrientation };
|
15
|
+
export { mq, useInitialTheme, useStyles, createStyleSheet, ScreenOrientation };
|
15
16
|
export type { UnistylesThemes, UnistylesBreakpoints };
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,QAAA,MAAM,gBAAgB,oDAAoB,CAAA;AAC1C,QAAA,MAAM,iBAAiB;;;;CAItB,CAAA;AAED,eAAO,MAAM,uBAAuB,YAA2C,CAAA;AAE/E,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,OAAO,EACH,EAAE,EACF,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACpB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACvB,CAAA"}
|
@@ -1,19 +1,15 @@
|
|
1
1
|
import type { OpaqueColorValue } from 'react-native';
|
2
2
|
import type { UnistylesBreakpoints } from '../global';
|
3
|
-
import type {
|
4
|
-
export type ScreenSize = {
|
5
|
-
width: number;
|
6
|
-
height: number;
|
7
|
-
};
|
8
|
-
export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
|
3
|
+
import type { MediaQuery } from './mq';
|
9
4
|
type WithEmptyObject<V> = keyof V extends never ? {} : V;
|
10
|
-
|
5
|
+
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> : {
|
11
6
|
[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];
|
12
7
|
};
|
13
|
-
|
14
|
-
[K in keyof T as K extends
|
8
|
+
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> ? {
|
9
|
+
[K in keyof T as K extends MediaQuery ? keyof UnistylesBreakpoints & string : K]: RemoveKeysWithPrefix<T[K]>;
|
15
10
|
} : {
|
16
11
|
[K in keyof T]: RemoveKeysWithPrefix<T[K]>;
|
17
12
|
} : T;
|
13
|
+
export type ReactNativeStyleSheet<T> = ExtractBreakpoints<RemoveKeysWithPrefix<T>>;
|
18
14
|
export {};
|
19
15
|
//# sourceMappingURL=breakpoints.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/types/breakpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC,KAAK,eAAe,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,KAAK,GAAG,EAAE,GAAG,CAAC,CAAA;AAExD,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAC9F,eAAe,CAAC,CAAC,CAAC,GAClB,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACnC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,GACrC;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACpD,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,GACrC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACf,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,CAAC,CAAC,CAAC;CACjB,CAAA;AAET,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GACnE,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,UAAU,GAAG,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAChH;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtD,CAAC,CAAA;AAEX,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,kBAAkB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;AACvC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA"}
|
@@ -1,11 +1,15 @@
|
|
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
|
-
import type { MediaQueries } from './mediaQueries';
|
4
3
|
import type { UnistylesBreakpoints, UnistylesThemes } from '../global';
|
4
|
+
import type { MediaQuery } from './mq';
|
5
5
|
type ShadowOffset = {
|
6
6
|
width: number;
|
7
7
|
height: number;
|
8
8
|
};
|
9
|
+
export type ScreenSize = {
|
10
|
+
width: number;
|
11
|
+
height: number;
|
12
|
+
};
|
9
13
|
type TransformStyles = PerpectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform & MatrixTransform;
|
10
14
|
type UnistyleNested = {
|
11
15
|
shadowOffset?: DeepUniStyle<ShadowOffset>;
|
@@ -13,9 +17,9 @@ type UnistyleNested = {
|
|
13
17
|
transform?: Array<DeepUniStyle<TransformStyles>>;
|
14
18
|
};
|
15
19
|
type UniStyle<V> = {
|
16
|
-
[innerKey in keyof UnistylesBreakpoints]
|
20
|
+
[innerKey in keyof UnistylesBreakpoints]?: V;
|
17
21
|
} | {
|
18
|
-
[innerKey in
|
22
|
+
[innerKey in MediaQuery]: V;
|
19
23
|
};
|
20
24
|
type DeepUniStyle<T> = {
|
21
25
|
[K in keyof T]?: UniStyle<T[K]> | T[K];
|
@@ -28,7 +32,8 @@ export type StaticStyles = UnistyleView | UnistyleText | UnistyleImage & Unistyl
|
|
28
32
|
export type CustomNamedStyles<T> = {
|
29
33
|
[K in keyof T]: T[K] extends (...args: infer A) => StaticStyles ? (...args: A) => StaticStyles : StaticStyles;
|
30
34
|
};
|
31
|
-
export type NestedKeys = Array<[keyof UnistylesBreakpoints |
|
35
|
+
export type NestedKeys = Array<[keyof UnistylesBreakpoints | MediaQuery, string | number | undefined]>;
|
32
36
|
export type UnistylesTheme = UnistylesThemes[keyof UnistylesThemes];
|
37
|
+
export type CreateStylesFactory<ST, Theme> = (theme: Theme) => ST;
|
33
38
|
export {};
|
34
39
|
//# 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,
|
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,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEtC,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,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,GACd,eAAe,CAAA;AAErB,KAAK,cAAc,GAAG;IAClB,YAAY,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MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;AACtG,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,MAAM,eAAe,CAAC,CAAA;AACnE,MAAM,MAAM,mBAAmB,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,EAAE,CAAA"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export * from './normalizer';
|
2
|
-
export * from './
|
3
|
-
export type {
|
4
|
-
export type {
|
5
|
-
export type {
|
2
|
+
export * from './unistyles';
|
3
|
+
export type { Optional, Nullable } from './common';
|
4
|
+
export type { MediaQuery } from './mq';
|
5
|
+
export type { CustomNamedStyles, NestedKeys, UnistylesTheme, CreateStylesFactory, ScreenSize } from './core';
|
6
|
+
export type { ReactNativeStyleSheet } from './breakpoints';
|
6
7
|
//# 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,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACtC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAC5G,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mq.d.ts","sourceRoot":"","sources":["../../../../src/types/mq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,MAAM,UAAU,GAAG,OAAO,QAAQ,CAAA"}
|
@@ -1,16 +1,11 @@
|
|
1
|
+
import { CxxUnistylesEventTypes, ScreenOrientation } from '../common';
|
1
2
|
import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
|
2
|
-
import type { ScreenSize } from './
|
3
|
-
import type {
|
4
|
-
export type Optional<T> = T | undefined;
|
5
|
-
export type Nullable<T> = T | null;
|
3
|
+
import type { NestedKeys, ScreenSize } from './core';
|
4
|
+
import type { Optional } from './common';
|
6
5
|
export type ColorSchemeName = Optional<'light' | 'dark'>;
|
7
6
|
export type UnistylesConfig = {
|
8
7
|
adaptiveThemes?: boolean;
|
9
8
|
};
|
10
|
-
export declare enum ScreenOrientation {
|
11
|
-
Portrait = 1,
|
12
|
-
Landscape = 2
|
13
|
-
}
|
14
9
|
export type UnistylesBridge = {
|
15
10
|
screenWidth: number;
|
16
11
|
screenHeight: number;
|
@@ -25,10 +20,6 @@ export type UnistylesBridge = {
|
|
25
20
|
useAdaptiveThemes(enable: boolean): void;
|
26
21
|
unregister(): void;
|
27
22
|
};
|
28
|
-
export declare enum CxxUnistylesEventTypes {
|
29
|
-
Theme = "theme",
|
30
|
-
Layout = "layout"
|
31
|
-
}
|
32
23
|
export type UnistylesThemeEvent = {
|
33
24
|
type: CxxUnistylesEventTypes.Theme;
|
34
25
|
payload: {
|
@@ -44,16 +35,7 @@ export type UnistylesMobileLayoutEvent = {
|
|
44
35
|
};
|
45
36
|
};
|
46
37
|
export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent;
|
47
|
-
export declare enum UnistylesError {
|
48
|
-
RuntimeUnavailable = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE",
|
49
|
-
ThemeNotFound = "UNISTYLES_ERROR_THEME_NOT_FOUND",
|
50
|
-
ThemeNotRegistered = "UNISTYLES_ERROR_THEME_NOT_REGISTERED",
|
51
|
-
ThemesCannotBeEmpty = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY",
|
52
|
-
BreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY",
|
53
|
-
BreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO"
|
54
|
-
}
|
55
38
|
export interface UnistylesEngine {
|
56
|
-
isMediaQuery(key: string): boolean;
|
57
39
|
didMatchMediaQuery(keys: NestedKeys): Optional<string>;
|
58
40
|
}
|
59
|
-
//# sourceMappingURL=
|
41
|
+
//# sourceMappingURL=unistyles.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,CAAA;AAExD,MAAM,MAAM,eAAe,GAAG;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAE1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,MAAM,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,WAAW,EAAE,eAAe,CAAC;IAC7B,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAG7G,MAAM,EAAE,KAAK,CAAC,MAAM,eAAe,CAAC,CAAC;IACrC,cAAc,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,eAAe,GAAG,IAAI,CAAC;IAC5C,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAGzC,UAAU,IAAI,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC;IACnC,OAAO,EAAE;QACL,SAAS,EAAE,MAAM,eAAe,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,MAAM,WAAW,eAAe;IAC5B,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC1D"}
|
@@ -1,8 +1,10 @@
|
|
1
|
-
import type { CreateStylesFactory, CustomNamedStyles,
|
2
|
-
import type {
|
3
|
-
|
4
|
-
theme:
|
5
|
-
breakpoint:
|
6
|
-
styles:
|
1
|
+
import type { CreateStylesFactory, CustomNamedStyles, ReactNativeStyleSheet, UnistylesTheme } from './types';
|
2
|
+
import type { UnistylesBreakpoints } from './global';
|
3
|
+
type ParsedStylesheet<ST extends CustomNamedStyles<ST>> = {
|
4
|
+
theme: UnistylesTheme;
|
5
|
+
breakpoint: keyof UnistylesBreakpoints;
|
6
|
+
styles: ReactNativeStyleSheet<ST>;
|
7
7
|
};
|
8
|
+
export declare const useStyles: <ST extends CustomNamedStyles<ST>>(stylesheet?: ST | CreateStylesFactory<ST, never> | undefined) => ParsedStylesheet<ST>;
|
9
|
+
export {};
|
8
10
|
//# sourceMappingURL=useStyles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,
|
1
|
+
{"version":3,"file":"useStyles.d.ts","sourceRoot":"","sources":["../../../src/useStyles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,KAAK,gBAAgB,CAAC,EAAE,SAAS,iBAAiB,CAAC,EAAE,CAAC,IAAI;IACtD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,SAAS,0HAuCrB,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { MediaQuery } from '../types';
|
2
2
|
import type { UnistylesBreakpoints } from '../global';
|
3
3
|
export declare const sortAndValidateBreakpoints: (breakpoints: UnistylesBreakpoints) => UnistylesBreakpoints;
|
4
4
|
export declare const getBreakpointFromScreenWidth: (width: number, breakpointEntries: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>) => keyof UnistylesBreakpoints & string;
|
5
|
-
export declare const getValueForBreakpoint: (value: Record<keyof UnistylesBreakpoints |
|
5
|
+
export declare const getValueForBreakpoint: (value: Record<keyof UnistylesBreakpoints | MediaQuery, string | number | undefined>) => string | number | undefined;
|
6
6
|
//# sourceMappingURL=breakpoints.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/breakpoints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,UAAU,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAIrD,eAAO,MAAM,0BAA0B,gBAAiB,oBAAoB,KAAG,oBAuB9E,CAAA;AAED,eAAO,MAAM,4BAA4B,UAAW,MAAM,qBAAqB,MAAM,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,KAAG,MAAM,oBAAoB,GAAG,MAcnM,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,OAAO,MAAM,oBAAoB,GAAG,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,KAAG,MAAM,GAAG,MAAM,GAAG,SAmD7I,CAAA"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
export { normalizeStyles } from './normalizeStyles';
|
2
2
|
export * from './normalizer';
|
3
|
+
export { mq, MQSymbol } from './mq';
|
4
|
+
export { getKeyForUnistylesMediaQuery } from './mqParser';
|
3
5
|
export { getBreakpointFromScreenWidth, sortAndValidateBreakpoints, getValueForBreakpoint } from './breakpoints';
|
4
6
|
export { proxifyFunction, parseStyle } from './styles';
|
5
7
|
export { isServer, Orientation } from './common';
|
6
|
-
export { extractValues, getKeyForCustomMediaQuery, isMediaQuery, isWithinTheHeight, isWithinTheWidth, isWithinTheWidthAndHeight } from './mediaQueries';
|
7
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,mBAAmB,CAAA;AACnD,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC/G,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
|