react-native-unistyles 2.0.0-alpha.7 → 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 +8 -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 +10 -38
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/mq.js +67 -53
- package/lib/commonjs/utils/mq.js.map +1 -1
- 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 -7
- 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 -2
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/mq.js +65 -51
- package/lib/module/utils/mq.js.map +1 -1
- 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 -10
- 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 -2
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/mq.d.ts +15 -9
- package/lib/typescript/src/utils/mq.d.ts.map +1 -1
- 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 -8
- 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 -9
- package/src/utils/mq.ts +75 -46
- 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 -10
- 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 -61
- 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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["unistyles","isMobile","Orientation","throwError","ScreenOrientation","sortAndValidateBreakpoints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","
|
1
|
+
{"version":3,"names":["unistyles","isMobile","Orientation","throwError","ScreenOrientation","getKeyForUnistylesMediaQuery","sortAndValidateBreakpoints","breakpoints","sortedPairs","Object","entries","sort","breakpoint1","breakpoint2","value1","value2","sortedBreakpoints","freeze","fromEntries","breakpointValues","values","firstBreakpoint","length","Set","size","getBreakpointFromScreenWidth","width","breakpointEntries","key","find","_ref","index","otherBreakpoints","value","minVal","maxVal","getValueForBreakpoint","customMediaQueryKey","runtime","screen","hasBreakpoints","Landscape","Portrait","orientation","breakpoint","undefined","directBreakpoint","breakpointPairs","currentBreakpoint","findIndex","_ref2","availableBreakpoints","filter","_ref3","map","_ref4"],"sourceRoot":"../../../src","sources":["utils/breakpoints.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,SAAS;AACnC,SAASC,QAAQ,EAAEC,WAAW,EAAEC,UAAU,QAAQ,UAAU;AAG5D,SAASC,iBAAiB,QAAQ,WAAW;AAC7C,SAASC,4BAA4B,QAAQ,YAAY;AAEzD,OAAO,MAAMC,0BAA0B,GAAIC,WAAiC,IAA2B;EACnG,MAAMC,WAAW,GAAGC,MAAM,CACrBC,OAAO,CAACH,WAAW,CAAC,CACpBI,IAAI,CAAC,CAACC,WAAW,EAAEC,WAAW,KAAK;IAChC,MAAM,GAAGC,MAAM,CAAC,GAAGF,WAAW;IAC9B,MAAM,GAAGG,MAAM,CAAC,GAAGF,WAAW;IAE9B,OAAQC,MAAM,GAAeC,MAAiB;EAClD,CAAC,CAAC;EAEN,MAAMC,iBAAiB,GAAIP,MAAM,CAACQ,MAAM,CAACR,MAAM,CAACS,WAAW,CAACV,WAAW,CAAC,CAAyB;EACjG,MAAMW,gBAAgB,GAAGV,MAAM,CAACW,MAAM,CAACJ,iBAAiB,CAAC;EACzD,MAAM,CAACK,eAAe,CAAC,GAAGF,gBAAgB;EAE1C,IAAIE,eAAe,KAAK,CAAC,EAAE;IACvBlB,UAAU,CAAC,oCAAoC,CAAC;EACpD;EAEA,IAAIgB,gBAAgB,CAACG,MAAM,KAAK,IAAIC,GAAG,CAACJ,gBAAgB,CAAC,CAACK,IAAI,EAAE;IAC5DrB,UAAU,CAAC,kCAAkC,CAAC;EAClD;EAEA,OAAOa,iBAAiB;AAC5B,CAAC;AAED,OAAO,MAAMS,4BAA4B,GAAGA,CAACC,KAAa,EAAEC,iBAAwG,KAA0C;EAC1M,MAAM,CAACC,GAAG,CAAC,GAAGD,iBAAiB,CAC1BE,IAA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IAAIE,gBAAgB,IAAKF,UAAU,IAAIX,KAAM,EAAE;IAC3C,OAAOa,gBAAgB;EAC3B;;EAEA;EACA,MAAMC,eAAe,GAAG/C,SAAS,CAACsC,OAAO,CAACtB,iBAAiB;EAC3D,MAAMgC,iBAAiB,GAAGD,eAAe,CACpCE,SAAS,CAACC,KAAA;IAAA,IAAC,CAACtB,GAAG,CAAC,GAAAsB,KAAA;IAAA,OAAKtB,GAAG,KAAKgB,UAAU;EAAA,EAAC;EAE7C,MAAMO,oBAAoB,GAAGJ,eAAe,CACvCK,MAAM,CAAC,CAAAC,KAAA,EAAQtB,KAAK;IAAA,IAAZ,CAACH,GAAG,CAAC,GAAAyB,KAAA;IAAA,OAAYtB,KAAK,GAAGiB,iBAAiB,IAAIpB,GAAG,IAAIA,GAAG,IAAIK,KAAK;EAAA,EAAC,CAC1EqB,GAAG,CAACC,KAAA;IAAA,IAAC,CAAC3B,GAAG,CAAC,GAAA2B,KAAA;IAAA,OAAK3B,GAAG;EAAA,EAAC;EAExB,OAAOmB,eAAe,CAACzB,MAAM,GAAG,CAAC,GAC3BW,KAAK,CAACkB,oBAAoB,CAACA,oBAAoB,CAAC7B,MAAM,GAAG,CAAC,CAAC,CAAwC,GACnGuB,SAAS;AACnB,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
export { normalizeStyles } from './normalizeStyles';
|
2
2
|
export * from './normalizer';
|
3
|
-
export { mq } from './mq';
|
3
|
+
export { mq, MQSymbol } from './mq';
|
4
|
+
export { getKeyForUnistylesMediaQuery } from './mqParser';
|
4
5
|
export { getBreakpointFromScreenWidth, sortAndValidateBreakpoints, getValueForBreakpoint } from './breakpoints';
|
5
6
|
export { proxifyFunction, parseStyle } from './styles';
|
6
7
|
export { isServer, Orientation } from './common';
|
7
|
-
export { extractValues, getKeyForCustomMediaQuery, isMediaQuery, isWithinTheHeight, isWithinTheWidth, isWithinTheWidthAndHeight } from './mediaQueries';
|
8
8
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["normalizeStyles","mq","getBreakpointFromScreenWidth","sortAndValidateBreakpoints","getValueForBreakpoint","proxifyFunction","parseStyle","isServer","Orientation"
|
1
|
+
{"version":3,"names":["normalizeStyles","mq","MQSymbol","getKeyForUnistylesMediaQuery","getBreakpointFromScreenWidth","sortAndValidateBreakpoints","getValueForBreakpoint","proxifyFunction","parseStyle","isServer","Orientation"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,cAAc,cAAc;AAC5B,SAASC,EAAE,EAAEC,QAAQ,QAAQ,MAAM;AACnC,SAASC,4BAA4B,QAAQ,YAAY;AACzD,SAASC,4BAA4B,EAAEC,0BAA0B,EAAEC,qBAAqB,QAAQ,eAAe;AAC/G,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SAASC,QAAQ,EAAEC,WAAW,QAAQ,UAAU"}
|
package/lib/module/utils/mq.js
CHANGED
@@ -1,69 +1,83 @@
|
|
1
|
-
import { unistyles } from '../
|
2
|
-
const MQSymbol = Symbol('unistyles-mq');
|
1
|
+
import { unistyles } from '../core';
|
2
|
+
export const MQSymbol = Symbol('unistyles-mq');
|
3
3
|
var MQProp = /*#__PURE__*/function (MQProp) {
|
4
4
|
MQProp["toString"] = "toString";
|
5
5
|
MQProp["width"] = "width";
|
6
6
|
MQProp["height"] = "height";
|
7
|
+
MQProp["shortW"] = "w";
|
8
|
+
MQProp["shortH"] = "h";
|
7
9
|
return MQProp;
|
8
10
|
}(MQProp || {});
|
9
11
|
const getMQValue = value => {
|
10
12
|
if (typeof value === 'number') {
|
11
13
|
return value;
|
12
14
|
}
|
15
|
+
if (value === null) {
|
16
|
+
return 0;
|
17
|
+
}
|
13
18
|
return unistyles.registry.breakpoints[value] ?? 0;
|
14
19
|
};
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
32
|
-
}
|
33
|
-
return Reflect.get(target, prop, receiver);
|
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)}]`;
|
34
36
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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)}]`;
|
39
53
|
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
49
|
-
}
|
50
|
-
if (prop === MQProp.height) {
|
51
|
-
return function () {
|
52
|
-
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
53
|
-
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
54
|
-
return new Proxy({}, {
|
55
|
-
get: (target, prop, receiver) => {
|
56
|
-
if (prop === Symbol.toPrimitive || MQProp.toString) {
|
57
|
-
return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
58
|
-
}
|
59
|
-
return Reflect.get(target, prop, receiver);
|
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)}]`;
|
60
62
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
return Reflect.get(target, prop, receiver);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
};
|
65
67
|
}
|
66
|
-
|
67
|
-
|
68
|
+
return Reflect.get(target, prop, receiver);
|
69
|
+
}
|
70
|
+
});
|
68
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
|
+
});
|
69
83
|
//# sourceMappingURL=mq.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["unistyles","MQSymbol","Symbol","MQProp","getMQValue","value","registry","breakpoints","
|
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;EACZ;EAEA,OAAOL,SAAS,CAACM,QAAQ,CAACC,WAAW,CAACF,KAAK,CAAC,IAAI,CAAC;AACrD,CAAC;AAED,MAAMG,YAAY,GAAG,SAAAA,CAAA;EAAA,IAACC,IAAuB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAAA,IAAEG,IAAa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U,CAACS,IAAI,CAAE,GAAE;cAC3G;cAEA,OAAOa,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;YAC9C;UACJ,CAAC,CAAC;QAAA;MACN;MAEA,OAAOO,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;IAC9C;EACJ,CAAC,CAAC;AAAA;AAEF,OAAO,MAAMW,EAAE,GAAG,IAAIf,KAAK,CAAC,CAAC,CAAC,EAAe;EACzCC,GAAG,EAAEA,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,KAAK;IAC7B,IAAID,IAAI,KAAKf,MAAM,CAACoB,MAAM,IAAIL,IAAI,KAAKf,MAAM,CAACmB,KAAK,EAAE;MACjD,OAAOK,aAAa;IACxB;IAEA,IAAIT,IAAI,KAAKf,MAAM,CAAC0B,MAAM,IAAIX,IAAI,KAAKf,MAAM,CAACyB,MAAM,EAAE;MAClD,OAAOpB,YAAY;IACvB;IAEA,OAAOkB,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;EAC9C;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
const IS_UNISTYLES_REGEX = /:([hw])\[(\d+)(?:,\s*(\d+|Infinity))?]/;
|
2
|
+
const UNISTYLES_WIDTH_REGEX = /:(w)\[(\d+)(?:,\s*(\d+|Infinity))?]/g;
|
3
|
+
const UNISTYLES_HEIGHT_REGEX = /:(h)\[(\d+)(?:,\s*(\d+|Infinity))?]/g;
|
4
|
+
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;MACnBQ,EAAE,EAAED,MAAM,CAACN,GAAG;IAClB,CAAC,GAAGQ,SAAS;IACbN,MAAM,EAAEA,MAAM,GAAG;MACbG,IAAI,EAAEC,MAAM,CAACH,KAAK,CAAC;MACnBI,EAAE,EAAED,MAAM,CAACF,GAAG;IAClB,CAAC,GAAGI;EACR,CAAC;AACL,CAAC;AAED,MAAMC,aAAa,GAAIZ,E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,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/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,EA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Of,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,KAAK,EAAE;IACP,OAAO,UAAU,IAAIa,KAAK,IAAI,OAAOA,KAAK,CAACC,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOf,SAAS,IAAI,gBAAgB,IAAIc,KAAK,IAAI,OAAOA,KAAK,CAACE,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAED,OAAO,MAAMJ,UAAU,GAAGA,CACtBK,KAA2B,EA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um 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,17 +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
|
-
export { createStyleSheet } from './createStyleSheet';
|
7
|
-
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;
|
8
8
|
declare const UnistylesRegistry: {
|
9
|
-
addThemes: (themes: UnistylesThemes) => import("./UnistyleRegistry").UnistyleRegistry;
|
10
|
-
addBreakpoints: (breakpoints: UnistylesBreakpoints) => import("./UnistyleRegistry").UnistyleRegistry;
|
11
|
-
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;
|
12
12
|
};
|
13
13
|
export declare const __dangerouslyUnregister: () => void;
|
14
14
|
export { UnistylesRuntime, UnistylesRegistry };
|
15
|
-
export { ScreenOrientation };
|
15
|
+
export { mq, useInitialTheme, useStyles, createStyleSheet, ScreenOrientation };
|
16
16
|
export type { UnistylesThemes, UnistylesBreakpoints };
|
17
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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,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,MAA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-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"}
|