react-native-unistyles 2.0.0-rc.1 → 2.0.0-rc.3
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/cxx/cpp-adapter.cpp +26 -2
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +29 -3
- package/cxx/UnistylesRuntime.cpp +10 -0
- package/cxx/UnistylesRuntime.h +10 -2
- package/ios/UnistylesHelpers.h +1 -0
- package/ios/UnistylesHelpers.mm +32 -0
- package/ios/UnistylesModule.mm +39 -2
- package/lib/commonjs/common.js +21 -1
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/UnistyleRegistry.js +15 -25
- package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.js +190 -2
- package/lib/commonjs/core/UnistylesModule.js.map +1 -1
- package/lib/commonjs/core/UnistylesModule.native.js +9 -0
- package/lib/commonjs/core/UnistylesModule.native.js.map +1 -0
- package/lib/commonjs/core/UnistylesRuntime.js +8 -0
- package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
- package/lib/commonjs/hooks/useCSS.js +36 -1
- package/lib/commonjs/hooks/useCSS.js.map +1 -1
- package/lib/commonjs/hooks/useCSS.native.js +9 -0
- package/lib/commonjs/hooks/useCSS.native.js.map +1 -0
- package/lib/commonjs/hooks/useUnistyles.js +8 -1
- package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/normalizer/normalizer.js +1 -2
- package/lib/commonjs/normalizer/normalizer.js.map +1 -1
- package/lib/commonjs/useStyles.js +2 -3
- package/lib/commonjs/useStyles.js.map +1 -1
- package/lib/commonjs/utils/breakpoints.js +2 -11
- package/lib/commonjs/utils/breakpoints.js.map +1 -1
- package/lib/commonjs/utils/cssMediaQuery.js +3 -9
- package/lib/commonjs/utils/cssMediaQuery.js.map +1 -1
- package/lib/commonjs/utils/mq.js +12 -36
- package/lib/commonjs/utils/mq.js.map +1 -1
- package/lib/commonjs/utils/mqParser.js +1 -2
- package/lib/commonjs/utils/mqParser.js.map +1 -1
- package/lib/commonjs/utils/styles.js +34 -39
- package/lib/commonjs/utils/styles.js.map +1 -1
- package/lib/module/common.js +20 -0
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/UnistyleRegistry.js +15 -25
- package/lib/module/core/UnistyleRegistry.js.map +1 -1
- package/lib/module/core/UnistylesModule.js +189 -2
- package/lib/module/core/UnistylesModule.js.map +1 -1
- package/lib/module/core/UnistylesModule.native.js +3 -0
- package/lib/module/core/UnistylesModule.native.js.map +1 -0
- package/lib/module/core/UnistylesRuntime.js +8 -0
- package/lib/module/core/UnistylesRuntime.js.map +1 -1
- package/lib/module/hooks/useCSS.js +36 -1
- package/lib/module/hooks/useCSS.js.map +1 -1
- package/lib/module/hooks/useCSS.native.js +2 -0
- package/lib/module/hooks/useCSS.native.js.map +1 -0
- package/lib/module/hooks/useUnistyles.js +8 -1
- package/lib/module/hooks/useUnistyles.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/normalizer/normalizer.js +1 -2
- package/lib/module/normalizer/normalizer.js.map +1 -1
- package/lib/module/useStyles.js +2 -3
- package/lib/module/useStyles.js.map +1 -1
- package/lib/module/utils/breakpoints.js +2 -11
- package/lib/module/utils/breakpoints.js.map +1 -1
- package/lib/module/utils/cssMediaQuery.js +3 -9
- package/lib/module/utils/cssMediaQuery.js.map +1 -1
- package/lib/module/utils/mq.js +12 -36
- package/lib/module/utils/mq.js.map +1 -1
- package/lib/module/utils/mqParser.js +1 -2
- package/lib/module/utils/mqParser.js.map +1 -1
- package/lib/module/utils/styles.js +34 -39
- package/lib/module/utils/styles.js.map +1 -1
- package/lib/typescript/src/common.d.ts +19 -1
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.d.ts +17 -4
- package/lib/typescript/src/core/UnistylesModule.d.ts.map +1 -1
- package/lib/typescript/src/core/UnistylesModule.native.d.ts +6 -0
- package/lib/typescript/src/core/UnistylesModule.native.d.ts.map +1 -0
- package/lib/typescript/src/core/UnistylesRuntime.d.ts +5 -0
- package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCSS.d.ts +1 -1
- package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCSS.native.d.ts +3 -0
- package/lib/typescript/src/hooks/useCSS.native.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useUnistyles.d.ts +1 -0
- package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/unistyles.d.ts +9 -2
- package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
- package/package.json +6 -8
- package/src/common.ts +21 -1
- package/src/core/UnistylesModule.native.ts +7 -0
- package/src/core/UnistylesModule.ts +227 -4
- package/src/core/UnistylesRuntime.ts +8 -0
- package/src/hooks/useCSS.native.ts +3 -0
- package/src/hooks/useCSS.ts +49 -1
- package/src/hooks/useUnistyles.ts +9 -2
- package/src/index.ts +3 -1
- package/src/types/unistyles.ts +10 -2
- package/src/useStyles.ts +1 -1
- package/lib/commonjs/core/UnistylesModule.web.js +0 -199
- package/lib/commonjs/core/UnistylesModule.web.js.map +0 -1
- package/lib/commonjs/hooks/useCSS.web.js +0 -46
- package/lib/commonjs/hooks/useCSS.web.js.map +0 -1
- package/lib/module/core/UnistylesModule.web.js +0 -192
- package/lib/module/core/UnistylesModule.web.js.map +0 -1
- package/lib/module/hooks/useCSS.web.js +0 -39
- package/lib/module/hooks/useCSS.web.js.map +0 -1
- package/lib/typescript/src/core/UnistylesModule.web.d.ts +0 -19
- package/lib/typescript/src/core/UnistylesModule.web.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCSS.web.d.ts +0 -3
- package/lib/typescript/src/hooks/useCSS.web.d.ts.map +0 -1
- package/src/core/UnistylesModule.web.ts +0 -227
- package/src/hooks/useCSS.web.ts +0 -51
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["normalizeColor","isUnistylesMq","isValidMq","parseMq","generateReactNativeWebId","createMediaQueryForStyles","styles","runtime","withMediaQueries","Object","entries","filter","
|
1
|
+
{"version":3,"names":["normalizeColor","isUnistylesMq","isValidMq","parseMq","generateReactNativeWebId","createMediaQueryForStyles","styles","runtime","withMediaQueries","Object","entries","filter","value","reduce","acc","prop","objectKeys","keys","mediaQueries","key","breakpoints","length","className","breakpointsStyles","getBreakpointsStyles","mediaQueriesStyles","getMediaQueriesFromMQ","trim","getMaxWidthMediaQuery","width","to","Infinity","getMaxHeightMediaQuery","height","result","from","normalizePropName","normalizeWebValue","breakpoint","undefined","replace","toLowerCase"],"sourceRoot":"../../../src","sources":["utils/cssMediaQuery.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,aAAa,EAAEC,SAAS,EAAEC,OAAO,QAAgC,YAAY;AAEtF,SAASC,wBAAwB,QAAQ,cAAc;AAGvD,OAAO,MAAMC,yBAAyB,GAAGA,CAACC,MAAe,EAAEC,OAAyB,KAAc;EAC9F,MAAMC,gBAAgB,GAAGC,MAAM,CAC1BC,OAAO,CAACJ,MAAM,CAAC,CACfK,MAAM,CAAC,CAAC,GAAGC,KAAK,CAAC,KAAK,OAAOA,KAAK,KAAK,QAAQ,CAAC,CAChDC,MAAM,CAAC,CAACC,GAAG,EAAE,CAACC,IAAI,EAAEH,KAAK,CAAC,KAAK;IAC5B,MAAMI,UAAU,GAAGP,MAAM,CAACQ,IAAI,CAACL,KAAK,CAAC;IACrC,MAAMM,YAAY,GAAGF,UAAU,CAACL,MAAM,CAACQ,GAAG,IAAIlB,aAAa,CAACkB,GAAG,CAAC,CAAC;IACjE,MAAMC,WAAW,GAAGJ,UAAU,CAACL,MAAM,CAACQ,GAAG,IAAIZ,OAAO,CAACa,WAAW,CAACD,GAAG,CAAqC,CAA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vB,KAAK,mBAAmB;IACxB,KAAK,gBAAgB;IACrB,KAAK,iBAAiB;IACtB,KAAK,aAAa;IAClB,KAAK,cAAc;IACnB,KAAK,eAAe;IACpB,KAAK,cAAc;IACnB,KAAK,WAAW;IAChB,KAAK,iBAAiB;IACtB,KAAK,YAAY;IACjB,KAAK,kBAAkB;IACvB,KAAK,kBAAkB;IACvB,KAAK,iBAAiB;MAClB,OAAO,EAAE;;IAEb;IACA,KAAK,kBAAkB;IACvB,KAAK,gBAAgB;IACrB,KAAK,gBAAgB;IACrB,KAAK,uBAAuB;IAC5B,KAAK,yBAAyB;IAC9B,KAAK,aAAa;IAClB,KAAK,WAAW;IAChB,KAAK,oBAAoB;IACzB,KAAK,sBAAsB;IAC3B,KAAK,kBAAkB;IACvB,KAAK,OAAO;IACZ,KAAK,KAAK;IACV,KAAK,YAAY;IACjB,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,eAAe;IACpB,KAAK,kBAAkB;IACvB,KAAK,mBAAmB;IACxB,KAAK,oBAAoB;IACzB,KAAK,YAAY;IACjB,KAAK,cAAc;IACnB,KAAK,WAAW;IAChB;MACI,OAAO,EAAE;EACjB;AACJ,CAAC"}
|
package/lib/module/utils/mq.js
CHANGED
@@ -15,42 +15,18 @@ const getMQValue = value => {
|
|
15
15
|
*/
|
16
16
|
export const mq = {
|
17
17
|
only: {
|
18
|
-
width:
|
19
|
-
|
20
|
-
let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
21
|
-
return `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
|
22
|
-
},
|
23
|
-
height: function () {
|
24
|
-
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
25
|
-
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
26
|
-
return `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
27
|
-
}
|
28
|
-
},
|
29
|
-
width: 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 {
|
33
|
-
and: {
|
34
|
-
height: function () {
|
35
|
-
let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
36
|
-
let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
37
|
-
return `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
};
|
18
|
+
width: (wMin = 0, wMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`,
|
19
|
+
height: (hMin = 0, hMax = Infinity) => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
41
20
|
},
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}
|
53
|
-
};
|
54
|
-
}
|
21
|
+
width: (wMin = 0, wMax = Infinity) => ({
|
22
|
+
and: {
|
23
|
+
height: (hMin = 0, hMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
24
|
+
}
|
25
|
+
}),
|
26
|
+
height: (hMin = 0, hMax = Infinity) => ({
|
27
|
+
and: {
|
28
|
+
width: (wMin = 0, wMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
|
29
|
+
}
|
30
|
+
})
|
55
31
|
};
|
56
32
|
//# sourceMappingURL=mq.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["unistyles","getMQValue","value","registry","breakpoints","mq","only","width","wMin","
|
1
|
+
{"version":3,"names":["unistyles","getMQValue","value","registry","breakpoints","mq","only","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AAQ,KACvD,MAAKT,UAAU,CAACO,IAAI,CAAE,KAAIP,UAAU,CAACQ,IAAI,CAAE,OAAMR,UAAU,CAACW,IAAI,CAAE,KAAIX,UAAU,CAACY,IAAI,CAAE;IACjG;EACJ,CAAC;AACL,CAAC"}
|
@@ -63,8 +63,7 @@ const isWithinTheHeight = (height, screenHeight) => {
|
|
63
63
|
return screenHeight >= from && screenHeight <= to;
|
64
64
|
};
|
65
65
|
export const getKeyForUnistylesMediaQuery = (mediaQueries, screenSize) => {
|
66
|
-
const mq = mediaQueries.find(
|
67
|
-
let [key] = _ref;
|
66
|
+
const mq = mediaQueries.find(([key]) => {
|
68
67
|
if (!isUnistylesMq(key)) {
|
69
68
|
return false;
|
70
69
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","from","Number","to","undefined","isUnistylesMq","test","isValidMq","parsedMq","isWithinTheWidthAndHeight","screenSize","isWithinTheWidth","isWithinTheHeight","screenWidth","screenHeight","getKeyForUnistylesMediaQuery","mediaQueries","find","
|
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","key","at"],"sourceRoot":"../../../src","sources":["utils/mqParser.ts"],"mappings":"AAEA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAYpE,OAAO,MAAMC,OAAO,GAAIC,EAAU,IAAwB;EACtD,MAAM,GAAGC,KAAK,EAAEC,KA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C"}
|
@@ -10,50 +10,45 @@ export const isPlatformColor = value => {
|
|
10
10
|
}
|
11
11
|
return isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object';
|
12
12
|
};
|
13
|
-
export const parseStyle =
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
20
|
-
acc[key] = parseStyle(value, variant);
|
21
|
-
return acc;
|
22
|
-
}
|
13
|
+
export const parseStyle = (style, variant = {}, parseMediaQueries = true) => Object.entries(style || {}).reduce((acc, [key, value]) => {
|
14
|
+
// nested objects
|
15
|
+
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
16
|
+
acc[key] = parseStyle(value, variant);
|
17
|
+
return acc;
|
18
|
+
}
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
// transforms
|
21
|
+
if (key === 'transform' && Array.isArray(value)) {
|
22
|
+
acc[key] = value.map(value => parseStyle(value, variant));
|
23
|
+
return acc;
|
24
|
+
}
|
29
25
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
// values or platform colors
|
27
|
+
if (typeof value !== 'object' || isPlatformColor(value)) {
|
28
|
+
acc[key] = value;
|
29
|
+
return acc;
|
30
|
+
}
|
31
|
+
if (key === 'variants') {
|
32
|
+
return {
|
33
|
+
...acc,
|
34
|
+
...Object.keys(value).reduce((acc, key) => ({
|
37
35
|
...acc,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
};
|
44
|
-
}
|
36
|
+
// this will parse the styles of the selected variant (or default if it is undefined), if selected variant has no styles then it will fallback to default styles
|
37
|
+
...parseStyle(value[key][variant[key] || 'default'] ?? value[key].default ?? {})
|
38
|
+
}), {})
|
39
|
+
};
|
40
|
+
}
|
45
41
|
|
46
|
-
|
47
|
-
|
48
|
-
return {
|
49
|
-
...acc,
|
50
|
-
[key]: value
|
51
|
-
};
|
52
|
-
}
|
42
|
+
// don't parse media queries and breakpoints
|
43
|
+
if (!parseMediaQueries) {
|
53
44
|
return {
|
54
45
|
...acc,
|
55
|
-
[key]:
|
46
|
+
[key]: value
|
56
47
|
};
|
57
|
-
}
|
58
|
-
|
48
|
+
}
|
49
|
+
return {
|
50
|
+
...acc,
|
51
|
+
[key]: getValueForBreakpoint(value)
|
52
|
+
};
|
53
|
+
}, {});
|
59
54
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","
|
1
|
+
{"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","parseMediaQueries","Object","entries","reduce","acc","Array","isArray","map","keys","default"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,eAAe;AACrD,SAASC,SAAS,EAAEC,KAAK,QAAQ,WAAW;AAC5C,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAO,MAAMC,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA0C,KAC/B,IAAIC,KAAK,CAACF,EAAE,EAAE;EACzBG,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAAKT,WAAW,CAACE,GAAG,EAAEQ,UAAU,CAACH,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEL,OAAO,CAAC;AACzH,CAAC,CAAC;AAEF,OAAO,MAAMO,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIb,KAAK,EAAE;IACP,OAAO,UAAU,IAAIa,KAAK,IAAI,OAAOA,KAAK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S,CAAC,IAAKU,KAAK,CAAEV,GAAG,CAAC,CAACuB,OAAO,IAAI,CAAC,CAAC;MAC/G,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;EACL;;EAEA;EACA,IAAI,CAACT,iBAAiB,EAAE;IACpB,OAAO;MACH,GAAGI,GAAG;MACN,CAAClB,GAAG,GAAGU;IACX,CAAC;EACL;EAEA,OAAO;IACH,GAAGQ,GAAG;IACN,CAAClB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;EACjE,CAAC;AACL,CAAC,EAAE,CAAC,CAAM,CAAC"}
|
@@ -8,10 +8,28 @@ export declare const ScreenOrientation: {
|
|
8
8
|
readonly Landscape: "landscape";
|
9
9
|
readonly Portrait: "portrait";
|
10
10
|
};
|
11
|
+
export declare enum IOSContentSizeCategory {
|
12
|
+
ExtraExtraExtraLarge = "xxxLarge",
|
13
|
+
ExtraExtraLarge = "xxLarge",
|
14
|
+
ExtraLarge = "xLarge",
|
15
|
+
Large = "Large",
|
16
|
+
Medium = "Medium",
|
17
|
+
Small = "Small",
|
18
|
+
ExtraSmall = "xSmall",
|
19
|
+
Unspecified = "unspecified"
|
20
|
+
}
|
21
|
+
export declare enum AndroidContentSizeCategory {
|
22
|
+
Small = "Small",
|
23
|
+
Default = "Default",
|
24
|
+
Large = "Large",
|
25
|
+
ExtraLarge = "ExtraLarge",
|
26
|
+
Huge = "Huge"
|
27
|
+
}
|
11
28
|
export declare enum UnistylesEventType {
|
12
29
|
Theme = "theme",
|
13
30
|
Layout = "layout",
|
14
|
-
Plugin = "plugin"
|
31
|
+
Plugin = "plugin",
|
32
|
+
DynamicTypeSize = "dynamicTypeSize"
|
15
33
|
}
|
16
34
|
export declare enum UnistylesError {
|
17
35
|
RuntimeUnavailable = "Unistyles runtime is not available. Make sure you followed the installation instructions",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,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AwB,wDAAwD;IAChF,4BAA4B,mEAAoE;IAChG,iBAAiB,6DAA8D;IAC/E,mBAAmB,+EAA+E;IAClG,wBAAwB,0DAA0D;CACrF"}
|
@@ -1,6 +1,19 @@
|
|
1
|
-
|
1
|
+
export declare class UnistylesBridgeWeb {
|
2
|
+
#private;
|
3
|
+
constructor();
|
2
4
|
install(): boolean;
|
3
|
-
|
4
|
-
|
5
|
-
|
5
|
+
private useTheme;
|
6
|
+
private useBreakpoints;
|
7
|
+
private useAdaptiveThemes;
|
8
|
+
private addPlugin;
|
9
|
+
private removePlugin;
|
10
|
+
private getTheme;
|
11
|
+
private setupListeners;
|
12
|
+
private getBreakpointFromScreenWidth;
|
13
|
+
private getPreferredColorScheme;
|
14
|
+
private emitPluginChange;
|
15
|
+
private emitThemeChange;
|
16
|
+
private emitLayoutChange;
|
17
|
+
}
|
18
|
+
export declare const UnistylesModule: UnistylesBridgeWeb;
|
6
19
|
//# sourceMappingURL=UnistylesModule.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"UnistylesModule.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAwBpB,OAAO;IA+Dd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,4BAA4B;IAgBpC,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;CAe3B;AAED,eAAO,MAAM,eAAe,oBAA2B,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UnistylesModule.native.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.native.ts"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IACzB,OAAO,IAAI,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,eAAe,uBAAoD,CAAA"}
|
@@ -23,6 +23,11 @@ export declare class UnistylesRuntime {
|
|
23
23
|
* @returns - The current theme name
|
24
24
|
*/
|
25
25
|
get themeName(): never;
|
26
|
+
/**
|
27
|
+
* Get the current content size category
|
28
|
+
* @returns - The current content size category
|
29
|
+
*/
|
30
|
+
get contentSizeCategory(): import("../common").IOSContentSizeCategory | import("../common").AndroidContentSizeCategory;
|
26
31
|
/**
|
27
32
|
* Get the current breakpoint based on device size
|
28
33
|
* @returns - The current breakpoint
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D;;GAEG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG;;;OAGG;IACH,IAAW,WAAW,uCAErB;IAED;;;OAGG;IACH,IAAW,iBAAiB,YAE3B;IAED;;;OAGG;IACH,IAAW,SAAS,UAEnB;IAED;;;OAGG;IACH,IAAW,UAAU,mDAEpB;IAED;;;OAGG;IACH,IAAW,WAAW,6CAErB;IAED;;;OAGG;IACH,IAAW,cAAc,aAExB;IAED;;;OAGG;IACH,IAAW,MAAM;;;MAKhB;IAED;;;OAGG;IACH,IAAW,WAAW,6BAQrB;IAED;;;;OAIG;IACI,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAED;;;OAGG;IACI,iBAAiB,WAAY,OAAO,UAE1C;IAED;;;OAGG;IACI,SAAS,WAAY,eAAe,UAE1C;IAED;;;OAGG;IACI,YAAY,WAAY,eAAe,UAE7C;CACJ"}
|
1
|
+
{"version":3,"file":"UnistylesRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesRuntime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE1D;;GAEG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,eAAe;IAAmB,OAAO,CAAC,iBAAiB;gBAA3D,eAAe,EAAE,eAAe,EAAU,iBAAiB,EAAE,gBAAgB;IAEjG;;;OAGG;IACH,IAAW,WAAW,uCAErB;IAED;;;OAGG;IACH,IAAW,iBAAiB,YAE3B;IAED;;;OAGG;IACH,IAAW,SAAS,UAEnB;IAED;;;OAGG;IACH,IAAW,mBAAmB,gGAE7B;IAED;;;OAGG;IACH,IAAW,UAAU,mDAEpB;IAED;;;OAGG;IACH,IAAW,WAAW,6CAErB;IAED;;;OAGG;IACH,IAAW,cAAc,aAExB;IAED;;;OAGG;IACH,IAAW,MAAM;;;MAKhB;IAED;;;OAGG;IACH,IAAW,WAAW,6BAQrB;IAED;;;;OAIG;IACI,QAAQ,SAAU,MAAM,eAAe,sBAY7C;IAED;;;OAGG;IACI,iBAAiB,WAAY,OAAO,UAE1C;IAED;;;OAGG;IACI,SAAS,WAAY,eAAe,UAE1C;IAED;;;OAGG;IACI,YAAY,WAAY,eAAe,UAE7C;CACJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useCSS.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,eAAO,MAAM,MAAM,mDA6ClB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCSS.native.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCSS.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD,eAAO,MAAM,MAAM,gDAA+C,IAAU,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useUnistyles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY
|
1
|
+
{"version":3,"file":"useUnistyles.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useUnistyles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;;;CAuDxB,CAAA"}
|
@@ -2,7 +2,7 @@ import { mq } from './utils';
|
|
2
2
|
import { useInitialTheme } from './hooks';
|
3
3
|
import type { UnistylesPlugin } from './types';
|
4
4
|
import type { UnistylesThemes, UnistylesBreakpoints } from './global';
|
5
|
-
import { ScreenOrientation } from './common';
|
5
|
+
import { ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory } from './common';
|
6
6
|
import { useStyles } from './useStyles';
|
7
7
|
import { createStyleSheet } from './createStyleSheet';
|
8
8
|
/**
|
@@ -72,6 +72,6 @@ declare const UnistylesRegistry: {
|
|
72
72
|
};
|
73
73
|
};
|
74
74
|
declare const UnistylesRuntime: import("./core").UnistylesRuntime;
|
75
|
-
export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, UnistylesRegistry, UnistylesRuntime };
|
75
|
+
export { mq, useStyles, useInitialTheme, createStyleSheet, ScreenOrientation, AndroidContentSizeCategory, IOSContentSizeCategory, UnistylesRegistry, UnistylesRuntime };
|
76
76
|
export type { UnistylesThemes, UnistylesBreakpoints, UnistylesPlugin };
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
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,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;
|
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,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,QAAA,MAAM,iBAAiB;IACnB;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;CAEN,CAAA;AAED,QAAA,MAAM,gBAAgB,mCAAoB,CAAA;AAE1C,OAAO,EACH,EAAE,EACF,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACnB,CAAA;AAED,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,eAAe,EAClB,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { UnistylesEventType, ScreenOrientation } from '../common';
|
1
|
+
import { UnistylesEventType, ScreenOrientation, IOSContentSizeCategory, AndroidContentSizeCategory } from '../common';
|
2
2
|
import type { UnistylesThemes, UnistylesBreakpoints } from '../global';
|
3
3
|
import type { ScreenSize } from './core';
|
4
4
|
import type { UnistylesPlugin } from './plugin';
|
@@ -17,6 +17,7 @@ export type UnistylesBridge = {
|
|
17
17
|
themeName: keyof UnistylesThemes;
|
18
18
|
breakpoint: keyof UnistylesBreakpoints;
|
19
19
|
colorScheme: ColorSchemeName;
|
20
|
+
contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory;
|
20
21
|
sortedBreakpointPairs: Array<[keyof UnistylesBreakpoints, UnistylesBreakpoints[keyof UnistylesBreakpoints]]>;
|
21
22
|
themes: Array<keyof UnistylesThemes>;
|
22
23
|
useBreakpoints(breakpoints: UnistylesBreakpoints): void;
|
@@ -42,5 +43,11 @@ export type UnistylesMobileLayoutEvent = {
|
|
42
43
|
export type UnistylesPluginEvent = {
|
43
44
|
type: UnistylesEventType.Plugin;
|
44
45
|
};
|
45
|
-
export type
|
46
|
+
export type UnistylesDynamicTypeSizeEvent = {
|
47
|
+
type: UnistylesEventType.DynamicTypeSize;
|
48
|
+
payload: {
|
49
|
+
contentSizeCategory: IOSContentSizeCategory | AndroidContentSizeCategory;
|
50
|
+
};
|
51
|
+
};
|
52
|
+
export type UnistylesEvents = UnistylesThemeEvent | UnistylesMobileLayoutEvent | UnistylesPluginEvent | UnistylesDynamicTypeSizeEvent;
|
46
53
|
//# sourceMappingURL=unistyles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;
|
1
|
+
{"version":3,"file":"unistyles.d.ts","sourceRoot":"","sources":["../../../../src/types/unistyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACrH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,CAAA;AAE9D,MAAM,MAAM,eAAe,GAAG;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,eAAe,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACjC,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAE1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,MAAM,eAAe,CAAC;IACjC,UAAU,EAAE,MAAM,oBAAoB,CAAC;IACvC,WAAW,EAAE,eAAe,CAAC;IAC7B,mBAAmB,EAAE,sBAAsB,GAAG,0BAA0B,CAAC;IACzE,qBAAqB,EAAE,KAAK,CAAC,CAAC,MAAM,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAG7G,MAAM,EAA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"2.0.0-rc.3",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "jest",
|
@@ -56,17 +56,17 @@
|
|
56
56
|
"@release-it/conventional-changelog": "8.0.1",
|
57
57
|
"@testing-library/react-hooks": "8.0.1",
|
58
58
|
"@types/jest": "29.5.11",
|
59
|
-
"@types/react": "18.2.
|
59
|
+
"@types/react": "18.2.45",
|
60
60
|
"@typescript-eslint/eslint-plugin": "6.14.0",
|
61
61
|
"@typescript-eslint/eslint-plugin-tslint": "6.14.0",
|
62
62
|
"@typescript-eslint/parser": "6.14.0",
|
63
63
|
"commitlint": "18.4.3",
|
64
64
|
"concurrently": "8.2.2",
|
65
|
-
"eslint": "8.
|
65
|
+
"eslint": "8.56.0",
|
66
66
|
"eslint-config-codemask": "1.1.7",
|
67
67
|
"eslint-plugin-functional": "6.0.0",
|
68
|
-
"eslint-plugin-import": "2.29.
|
69
|
-
"eslint-plugin-jsdoc": "46.9.
|
68
|
+
"eslint-plugin-import": "2.29.1",
|
69
|
+
"eslint-plugin-jsdoc": "46.9.1",
|
70
70
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
71
71
|
"eslint-plugin-nested-if": "1.0.0",
|
72
72
|
"eslint-plugin-no-else": "0.2.2",
|
@@ -136,9 +136,7 @@
|
|
136
136
|
},
|
137
137
|
"plugins": {
|
138
138
|
"@release-it/conventional-changelog": {
|
139
|
-
"preset":
|
140
|
-
"name": "conventionalcommits"
|
141
|
-
}
|
139
|
+
"preset": "angular"
|
142
140
|
}
|
143
141
|
}
|
144
142
|
},
|
package/src/common.ts
CHANGED
@@ -15,10 +15,30 @@ export const ScreenOrientation = {
|
|
15
15
|
Portrait: 'portrait'
|
16
16
|
} as const
|
17
17
|
|
18
|
+
export enum IOSContentSizeCategory {
|
19
|
+
ExtraExtraExtraLarge = 'xxxLarge',
|
20
|
+
ExtraExtraLarge = 'xxLarge',
|
21
|
+
ExtraLarge = 'xLarge',
|
22
|
+
Large = 'Large',
|
23
|
+
Medium = 'Medium',
|
24
|
+
Small = 'Small',
|
25
|
+
ExtraSmall = 'xSmall',
|
26
|
+
Unspecified = 'unspecified'
|
27
|
+
}
|
28
|
+
|
29
|
+
export enum AndroidContentSizeCategory {
|
30
|
+
Small = 'Small',
|
31
|
+
Default = 'Default',
|
32
|
+
Large = 'Large',
|
33
|
+
ExtraLarge = 'ExtraLarge',
|
34
|
+
Huge = 'Huge'
|
35
|
+
}
|
36
|
+
|
18
37
|
export enum UnistylesEventType {
|
19
38
|
Theme = 'theme',
|
20
39
|
Layout = 'layout',
|
21
|
-
Plugin = 'plugin'
|
40
|
+
Plugin = 'plugin',
|
41
|
+
DynamicTypeSize = 'dynamicTypeSize'
|
22
42
|
}
|
23
43
|
|
24
44
|
export enum UnistylesError {
|