react-native-unistyles 2.0.0-beta.2 → 2.0.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/lib/commonjs/core/UnistyleRegistry.js +6 -2
  2. package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
  3. package/lib/commonjs/core/UnistylesModule.web.js +4 -0
  4. package/lib/commonjs/core/UnistylesModule.web.js.map +1 -1
  5. package/lib/commonjs/core/UnistylesRuntime.js +3 -0
  6. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  7. package/lib/commonjs/hooks/index.js +7 -0
  8. package/lib/commonjs/hooks/index.js.map +1 -1
  9. package/lib/commonjs/hooks/useCSS.js +9 -0
  10. package/lib/commonjs/hooks/useCSS.js.map +1 -0
  11. package/lib/commonjs/hooks/useCSS.web.js +46 -0
  12. package/lib/commonjs/hooks/useCSS.web.js.map +1 -0
  13. package/lib/commonjs/normalizer/index.js.map +1 -0
  14. package/lib/commonjs/normalizer/module.d.js.map +1 -0
  15. package/lib/commonjs/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  16. package/lib/commonjs/normalizer/normalizeStyle.js.map +1 -0
  17. package/lib/commonjs/normalizer/normalizer.js.map +1 -0
  18. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +14 -0
  19. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +1 -0
  20. package/lib/commonjs/plugins/index.js +3 -21
  21. package/lib/commonjs/plugins/index.js.map +1 -1
  22. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +1 -1
  23. package/lib/commonjs/useStyles.js +4 -1
  24. package/lib/commonjs/useStyles.js.map +1 -1
  25. package/lib/commonjs/utils/cssMediaQuery.js +250 -0
  26. package/lib/commonjs/utils/cssMediaQuery.js.map +1 -0
  27. package/lib/commonjs/utils/generateId.js +15 -0
  28. package/lib/commonjs/utils/generateId.js.map +1 -0
  29. package/lib/commonjs/utils/hash32.js +43 -0
  30. package/lib/commonjs/utils/hash32.js.map +1 -0
  31. package/lib/commonjs/utils/index.js +13 -0
  32. package/lib/commonjs/utils/index.js.map +1 -1
  33. package/lib/commonjs/utils/mqParser.js +2 -1
  34. package/lib/commonjs/utils/mqParser.js.map +1 -1
  35. package/lib/commonjs/utils/styles.js +9 -0
  36. package/lib/commonjs/utils/styles.js.map +1 -1
  37. package/lib/module/core/UnistyleRegistry.js +7 -3
  38. package/lib/module/core/UnistyleRegistry.js.map +1 -1
  39. package/lib/module/core/UnistylesModule.web.js +4 -0
  40. package/lib/module/core/UnistylesModule.web.js.map +1 -1
  41. package/lib/module/core/UnistylesRuntime.js +3 -0
  42. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  43. package/lib/module/hooks/index.js +1 -0
  44. package/lib/module/hooks/index.js.map +1 -1
  45. package/lib/module/hooks/useCSS.js +2 -0
  46. package/lib/module/hooks/useCSS.js.map +1 -0
  47. package/lib/module/hooks/useCSS.web.js +39 -0
  48. package/lib/module/hooks/useCSS.web.js.map +1 -0
  49. package/lib/module/normalizer/index.js.map +1 -0
  50. package/lib/module/normalizer/module.d.js.map +1 -0
  51. package/lib/module/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  52. package/lib/module/normalizer/normalizeStyle.js.map +1 -0
  53. package/lib/module/normalizer/normalizer.js.map +1 -0
  54. package/lib/module/plugins/cssMediaQueriesPlugin.js +7 -0
  55. package/lib/module/plugins/cssMediaQueriesPlugin.js.map +1 -0
  56. package/lib/module/plugins/index.js +1 -1
  57. package/lib/module/plugins/index.js.map +1 -1
  58. package/lib/module/plugins/normalizeWebStylesPlugin.js +1 -1
  59. package/lib/module/plugins/normalizeWebStylesPlugin.js.map +1 -1
  60. package/lib/module/useStyles.js +5 -2
  61. package/lib/module/useStyles.js.map +1 -1
  62. package/lib/module/utils/cssMediaQuery.js +243 -0
  63. package/lib/module/utils/cssMediaQuery.js.map +1 -0
  64. package/lib/module/utils/generateId.js +7 -0
  65. package/lib/module/utils/generateId.js.map +1 -0
  66. package/lib/module/utils/hash32.js +36 -0
  67. package/lib/module/utils/hash32.js.map +1 -0
  68. package/lib/module/utils/index.js +2 -1
  69. package/lib/module/utils/index.js.map +1 -1
  70. package/lib/module/utils/mqParser.js +1 -1
  71. package/lib/module/utils/mqParser.js.map +1 -1
  72. package/lib/module/utils/styles.js +9 -0
  73. package/lib/module/utils/styles.js.map +1 -1
  74. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
  75. package/lib/typescript/src/core/UnistylesModule.web.d.ts.map +1 -1
  76. package/lib/typescript/src/core/UnistylesRuntime.d.ts +1 -0
  77. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
  78. package/lib/typescript/src/hooks/index.d.ts +1 -0
  79. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  80. package/lib/typescript/src/hooks/useCSS.d.ts +3 -0
  81. package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -0
  82. package/lib/typescript/src/hooks/useCSS.web.d.ts +3 -0
  83. package/lib/typescript/src/hooks/useCSS.web.d.ts.map +1 -0
  84. package/lib/typescript/src/normalizer/index.d.ts.map +1 -0
  85. package/lib/typescript/src/normalizer/normalizeStyle.d.ts +3 -0
  86. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -0
  87. package/lib/typescript/src/{plugins/normalizer → normalizer}/normalizer.d.ts +1 -1
  88. package/lib/typescript/src/normalizer/normalizer.d.ts.map +1 -0
  89. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +3 -0
  90. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +1 -0
  91. package/lib/typescript/src/plugins/index.d.ts +1 -1
  92. package/lib/typescript/src/plugins/index.d.ts.map +1 -1
  93. package/lib/typescript/src/types/unistyles.d.ts +2 -1
  94. package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
  95. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  96. package/lib/typescript/src/utils/cssMediaQuery.d.ts +4 -0
  97. package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +1 -0
  98. package/lib/typescript/src/utils/generateId.d.ts +2 -0
  99. package/lib/typescript/src/utils/generateId.d.ts.map +1 -0
  100. package/lib/typescript/src/utils/hash32.d.ts +2 -0
  101. package/lib/typescript/src/utils/hash32.d.ts.map +1 -0
  102. package/lib/typescript/src/utils/index.d.ts +3 -1
  103. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  104. package/lib/typescript/src/utils/mqParser.d.ts +2 -1
  105. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -1
  106. package/lib/typescript/src/utils/styles.d.ts +1 -1
  107. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  108. package/package.json +3 -2
  109. package/src/core/UnistyleRegistry.ts +8 -3
  110. package/src/core/UnistylesModule.web.ts +4 -0
  111. package/src/core/UnistylesRuntime.ts +4 -0
  112. package/src/hooks/index.ts +1 -0
  113. package/src/hooks/useCSS.ts +3 -0
  114. package/src/hooks/useCSS.web.ts +51 -0
  115. package/src/{plugins/normalizer → normalizer}/normalizeStyle.ts +2 -2
  116. package/src/{plugins/normalizer → normalizer}/normalizer.ts +2 -1
  117. package/src/plugins/cssMediaQueriesPlugin.ts +8 -0
  118. package/src/plugins/index.ts +1 -1
  119. package/src/plugins/normalizeWebStylesPlugin.ts +1 -1
  120. package/src/types/unistyles.ts +3 -2
  121. package/src/useStyles.ts +10 -2
  122. package/src/utils/cssMediaQuery.ts +268 -0
  123. package/src/utils/generateId.ts +10 -0
  124. package/src/utils/hash32.ts +53 -0
  125. package/src/utils/index.ts +3 -1
  126. package/src/utils/mqParser.ts +2 -2
  127. package/src/utils/styles.ts +10 -1
  128. package/lib/commonjs/plugins/normalizer/index.js.map +0 -1
  129. package/lib/commonjs/plugins/normalizer/module.d.js.map +0 -1
  130. package/lib/commonjs/plugins/normalizer/normalizeStyle.js.map +0 -1
  131. package/lib/commonjs/plugins/normalizer/normalizer.js.map +0 -1
  132. package/lib/module/plugins/normalizer/index.js.map +0 -1
  133. package/lib/module/plugins/normalizer/module.d.js.map +0 -1
  134. package/lib/module/plugins/normalizer/normalizeStyle.js.map +0 -1
  135. package/lib/module/plugins/normalizer/normalizer.js.map +0 -1
  136. package/lib/typescript/src/plugins/normalizer/index.d.ts.map +0 -1
  137. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts +0 -3
  138. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts.map +0 -1
  139. package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +0 -1
  140. /package/lib/commonjs/{plugins/normalizer → normalizer}/index.js +0 -0
  141. /package/lib/commonjs/{plugins/normalizer → normalizer}/module.d.js +0 -0
  142. /package/lib/commonjs/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  143. /package/lib/module/{plugins/normalizer → normalizer}/index.js +0 -0
  144. /package/lib/module/{plugins/normalizer → normalizer}/module.d.js +0 -0
  145. /package/lib/module/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  146. /package/lib/typescript/src/{plugins/normalizer → normalizer}/index.d.ts +0 -0
  147. /package/src/{plugins/normalizer → normalizer}/index.ts +0 -0
  148. /package/src/{plugins/normalizer → normalizer}/module.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_normalizer","require","_mqParser","_generateId","createMediaQueryForStyles","styles","runtime","withMediaQueries","Object","entries","filter","_ref","value","reduce","acc","_ref2","prop","objectKeys","keys","mediaQueries","key","isUnistylesMq","breakpoints","length","className","generateReactNativeWebId","breakpointsStyles","getBreakpointsStyles","mediaQueriesStyles","getMediaQueriesFromMQ","trim","exports","getMaxWidthMediaQuery","width","to","Infinity","getMaxHeightMediaQuery","height","_ref3","result","parseMq","isValidMq","from","normalizePropName","normalizeWebValue","_ref4","breakpoint","undefined","replace","toLowerCase","normalizeColor"],"sourceRoot":"../../../src","sources":["utils/cssMediaQuery.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAG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AK,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"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.generateReactNativeWebId = void 0;
7
+ var _hash = require("./hash32");
8
+ // eslint-disable-next-line camelcase
9
+
10
+ const generateReactNativeWebId = (key, value) => {
11
+ const hashedString = (0, _hash.murmurhash2_32_gc)(key + value, 1).toString(36);
12
+ return process.env.NODE_ENV !== 'production' ? `r-${key}-${hashedString}` : `r-${hashedString}`;
13
+ };
14
+ exports.generateReactNativeWebId = generateReactNativeWebId;
15
+ //# sourceMappingURL=generateId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hash","require","generateReactNativeWebId","key","value","hashedString","murmurhash2_32_gc","toString","process","env","NODE_ENV","exports"],"sourceRoot":"../../../src","sources":["utils/generateId.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA;;AAGO,MAAMC,wBAAwB,GAAGA,CAACC,GAAW,EAAEC,KAAa,KAAa;EAC5E,MAAMC,YAAY,GAAG,IAAAC,uBAAiB,EAACH,GAAG,GAAGC,KAAK,EAAE,CAAC,CAAC,CAACG,QAAQ,CAAC,EAAE,CAAC;EAEnE,OAAOC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACrC,KAAIP,GAAI,IAAGE,YAAa,EAAC,GACzB,KAAIA,YAAa,EAAC;AAC7B,CAAC;AAAAM,OAAA,CAAAT,wBAAA,GAAAA,wBAAA"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.murmurhash2_32_gc = void 0;
7
+ /*
8
+ Authors: Gary Court and Austin Appleby
9
+ Compatible with React Native Web
10
+ https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/compiler/hash.js#L65
11
+ */
12
+ const murmurhash2_32_gc = (str, seed) => {
13
+ let l = str.length;
14
+ let h = seed ^ l;
15
+ let i = 0;
16
+ let k;
17
+ while (l >= 4) {
18
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
19
+ k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
20
+ k ^= k >>> 24;
21
+ k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
22
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
23
+ l -= 4;
24
+ ++i;
25
+ }
26
+ switch (l) {
27
+ // @ts-ignore
28
+ case 3:
29
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
30
+ // @ts-ignore
31
+ case 2:
32
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
33
+ case 1:
34
+ h ^= str.charCodeAt(i) & 0xff;
35
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
36
+ }
37
+ h ^= h >>> 13;
38
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
39
+ h ^= h >>> 15;
40
+ return h >>> 0;
41
+ };
42
+ exports.murmurhash2_32_gc = murmurhash2_32_gc;
43
+ //# sourceMappingURL=hash32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["murmurhash2_32_gc","str","seed","l","length","h","i","k","charCodeAt","exports"],"sourceRoot":"../../../src","sources":["utils/hash32.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAGA,CAACC,GAAW,EAAEC,IAAY,KAAK;EAC5D,IAAIC,CAAC,GAAGF,GAAG,CAACG,MAAM;EAClB,IAAIC,CAAC,GAAGH,IAAI,GAAGC,CAAC;EAChB,IAAIG,CAAC,GAAG,CAAC;EACT,IAAIC,CAAC;EAEL,OAAOJ,CAAC,IAAI,CAAC,EAAE;IACXI,CAAC,GACAN,GAAG,CAACO,UAAU,CAACF,CAAC,CAAC,GAAG,IAAI,GACxB,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,CAAE,GAClC,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,EAAG,GACnC,CAACL,GAAG,CAACO,UAAU,CAAC,EAAEF,CAAC,CAAC,GAAG,IAAI,KAAK,EAAG;IAEpCC,CAAC,GACD,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;IACxEA,CAAC,IAAIA,CAAC,KAAK,EAAE;IACbA,CAAC,GACD,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;IAExEF,CAAC,GACA,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IACvB,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC,GAC9CE,CAAC;IAEDJ,CAAC,IAAI,CAAC;IACN,EAAEG,CAAC;EACP;EAEA,QAAQH,CAAC;IACL;IACA,KAAK,CAAC;MACFE,CAAC,IAAI,CAACJ,GAAG,CAACO,UAAU,CAACF,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,EAAE;IAC7C;IACA,KAAK,CAAC;MACFD,CAAC,IAAI,CAACJ,GAAG,CAACO,UAAU,CAACF,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC;IAC5C,KAAK,CAAC;MACFD,CAAC,IAAIJ,GAAG,CAACO,UAAU,CAACF,CAAC,CAAC,GAAG,IAAI;MAC7BD,CAAC,GACH,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IACxB,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;EAClD;EAEAA,CAAC,IAAIA,CAAC,KAAK,EAAE;EACbA,CAAC,GAAG,CAACA,CAAC,GAAG,MAAM,IAAI,UAAU,IAAI,CAAE,CAACA,CAAC,KAAK,EAAE,IAAI,UAAU,GAAI,MAAM,KAAK,EAAE,CAAC;EAC5EA,CAAC,IAAIA,CAAC,KAAK,EAAE;EAEb,OAAOA,CAAC,KAAK,CAAC;AAClB,CAAC;AAAAI,OAAA,CAAAT,iBAAA,GAAAA,iBAAA"}
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "generateReactNativeWebId", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _generateId.generateReactNativeWebId;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "getKeyForUnistylesMediaQuery", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -15,6 +21,12 @@ Object.defineProperty(exports, "getValueForBreakpoint", {
15
21
  return _breakpoints.getValueForBreakpoint;
16
22
  }
17
23
  });
24
+ Object.defineProperty(exports, "isUnistylesMq", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _mqParser.isUnistylesMq;
28
+ }
29
+ });
18
30
  Object.defineProperty(exports, "isValidMq", {
19
31
  enumerable: true,
20
32
  get: function () {
@@ -62,4 +74,5 @@ var _mqParser = require("./mqParser");
62
74
  var _breakpoints = require("./breakpoints");
63
75
  var _styles = require("./styles");
64
76
  var _withPlugins = require("./withPlugins");
77
+ var _generateId = require("./generateId");
65
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_mq","require","_mqParser","_breakpoints","_styles","_withPlugins"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA"}
1
+ {"version":3,"names":["_mq","require","_mqParser","_breakpoints","_styles","_withPlugins","_generateId"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.parseMq = exports.isWithinTheWidthAndHeight = exports.isValidMq = exports.getKeyForUnistylesMediaQuery = void 0;
6
+ exports.parseMq = exports.isWithinTheWidthAndHeight = exports.isValidMq = exports.isUnistylesMq = exports.getKeyForUnistylesMediaQuery = void 0;
7
7
  const IS_UNISTYLES_REGEX = /:([hw])\[(\d+)(?:,\s*(\d+|Infinity))?]/;
8
8
  const UNISTYLES_WIDTH_REGEX = /:(w)\[(\d+)(?:,\s*(\d+|Infinity))?]/;
9
9
  const UNISTYLES_HEIGHT_REGEX = /:(h)\[(\d+)(?:,\s*(\d+|Infinity))?]/;
@@ -23,6 +23,7 @@ const parseMq = mq => {
23
23
  };
24
24
  exports.parseMq = parseMq;
25
25
  const isUnistylesMq = mq => IS_UNISTYLES_REGEX.test(mq);
26
+ exports.isUnistylesMq = isUnistylesMq;
26
27
  const isValidMq = parsedMq => {
27
28
  const {
28
29
  width,
@@ -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","exports","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,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAY7D,MAAMC,OAAO,GAAIC,EAAU,IAAwB;EACtD,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,CAA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CAAClB,KAAiC,EAAEoB,WAAmB,KAAc;EAC1F,MAAM;IAAEb,IAAI;IAAEE;EAAG,CAAC,GAAGT,KAA0B;EAE/C,OAAOoB,WAAW,IAAIb,IAAI,IAAIa,WAAW,IAAIX,EAAE;AACnD,CAAC;AAED,MAAMU,iBAAiB,GAAGA,CAACf,MAAmC,EAAEiB,YAAoB,KAAc;EAC9F,MAAM;IAAEd,IAAI;IAAEE;EAAG,CAAC,GAAGL,MAA2B;EAEhD,OAAOiB,YAAY,IAAId,IAAI,IAAIc,YAAY,IAAIZ,EAAE;AACrD,CAAC;AAEM,MAAMa,4BAA4B,GAAGA,CAACC,YAAsC,EAAEN,UAAsB,KAAuB;EAC9H,MAAMlB,EAAE,GAAGwB,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,GAAGjB,OAAO,CAAC4B,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,OAAOlB,EAAE,EAAE4B,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC;AAAAhB,OAAA,CAAAW,4BAAA,GAAAA,4BAAA"}
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","exports","isUnistylesMq","test","isValidMq","parsedMq","isWithinTheWidthAndHeight","screenSize","isWithinTheWidth","isWithinTheHeight","screenWidth","screenHeight","getKeyForUnistylesMediaQuery","mediaQueries","find","_ref","key","at"],"sourceRoot":"../../../src","sources":["utils/mqParser.ts"],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AC,GAAAD,IAAA;IAC/B,IAAI,CAACb,aAAa,CAACc,GAAa,CAAC,EAAE;MAC/B,OAAO,KAAK;IAChB;IAEA,MAAMX,QAAQ,GAAGjB,OAAO,CAAC4B,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,OAAOlB,EAAE,EAAE4B,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC;AAAAhB,OAAA,CAAAW,4BAAA,GAAAA,4BAAA"}
@@ -20,6 +20,7 @@ const isPlatformColor = value => {
20
20
  exports.isPlatformColor = isPlatformColor;
21
21
  const parseStyle = function (style) {
22
22
  let variant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
23
+ let parseMediaQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
23
24
  return Object.entries(style || {}).reduce((acc, _ref) => {
24
25
  let [key, value] = _ref;
25
26
  // nested objects
@@ -48,6 +49,14 @@ const parseStyle = function (style) {
48
49
  }), {})
49
50
  };
50
51
  }
52
+
53
+ // don't parse media queries and breakpoints
54
+ if (!parseMediaQueries) {
55
+ return {
56
+ ...acc,
57
+ [key]: value
58
+ };
59
+ }
51
60
  return {
52
61
  ...acc,
53
62
  [key]: (0, _breakpoints.getValueForBreakpoint)(value)
@@ -1 +1 @@
1
- {"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","arguments","length","undefined","Object","entries","reduce","acc","_ref","Array","isArray","map","keys","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE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,KAAK,CAAC,EAAE;MAC7CY,GAAG,CAACxB,GAAG,CAAC,GAAGY,KAAK,CAACgB,GAAG,CAAChB,KAAK,IAAIH,UAAU,CAACG,KAAK,EAAEV,OAAO,CAAC,CAAC;MAEzD,OAAOsB,GAAG;IACd;;IAEA;IACA,IAAI,OAAOZ,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;MACrDY,GAAG,CAACxB,GAAG,CAAY,GAAGY,KAAK;MAE3B,OAAOY,GAAG;IACd;IAEA,IAAIxB,GAAG,KAAK,UAAU,EAAE;MACpB,OAAO;QACH,GAAGwB,GAAG;QACN,GAAIH,MAAM,CACLQ,IAAI,CAACjB,KAAK,CAAC,CACXW,MAAM,CAAC,CAACC,GAAG,EAAExB,GAAG,MAAM;UACnB,GAAGwB,GAAG;UACN,GAAGf,UAAU,CAAEG,KAAK,CAAEZ,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QACvF,CAAC,CAAC,EAAE,CAAC,CAAC;MACd,CAAC;IACL;IAEA,OAAO;MACH,GAAGwB,GAAG;MACN,CAACxB,GAAG,GAAG,IAAA8B,kCAAqB,EAAClB,KAAgC;IACjE,CAAC;EACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAA;AAAAF,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"names":["_breakpoints","require","_common","_withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","withPlugins","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","arguments","length","undefined","parseMediaQueries","Object","entries","reduce","acc","_ref","Array","isArray","map","keys","getValueForBreakpoint"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEO,MAAMG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IAEA;IACA,IAAIzB,GAAG,KAAK,WAAW,IAAI2B,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAC,EAAE;MAC7Ca,GAAG,CAACzB,GAAG,CAAC,GAAGY,KAAK,CAACiB,GAAG,CAACjB,KAAK,IAAIH,UAAU,CAACG,KAAK,EAAEV,OAAO,CAAC,CAAC;MAEzD,OAAOuB,GAAG;IACd;;IAEA;IACA,IAAI,OAAOb,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;MACrDa,GAAG,CAACzB,GAAG,CAAY,GAAGY,KAAK;MAE3B,OAAOa,GAAG;IACd;IAEA,IAAIzB,GAAG,KAAK,UAAU,EAAE;MACpB,OAAO;QACH,GAAGyB,GAAG;QACN,GAAIH,MAAM,CACLQ,IAAI,CAAClB,KAAK,CAAC,CACXY,MAAM,CAAC,CAACC,GAAG,EAAEzB,GAAG,MAAM;UACnB,GAAGyB,GAAG;UACN,GAAGhB,UAAU,CAAEG,KAAK,CAAEZ,GAAG,CAAC,CAACE,OAAO,CAACF,GAAG,CAAyB,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QACvF,CAAC,CAAC,EAAE,CAAC,CAAC;MACd,CAAC;IACL;;IAEA;IACA,IAAI,CAACqB,iBAAiB,EAAE;MACpB,OAAO;QACH,GAAGI,GAAG;QACN,CAACzB,GAAG,GAAGY;MACX,CAAC;IACL;IAEA,OAAO;MACH,GAAGa,GAAG;MACN,CAACzB,GAAG,GAAG,IAAA+B,kCAAqB,EAACnB,KAAgC;IACjE,CAAC;EACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAA;AAAAF,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
@@ -1,5 +1,5 @@
1
1
  import { isWeb, UnistylesError } from '../common';
2
- import { normalizeWebStylesPlugin } from '../plugins';
2
+ import { cssMediaQueriesPlugin, normalizeWebStylesPlugin } from '../plugins';
3
3
  export class UnistyleRegistry {
4
4
  config = {};
5
5
  plugins = isWeb ? [normalizeWebStylesPlugin] : [];
@@ -34,12 +34,16 @@ export class UnistyleRegistry {
34
34
  if (config.adaptiveThemes) {
35
35
  this.unistylesBridge.useAdaptiveThemes(config.adaptiveThemes);
36
36
  }
37
- if (config.experimentalPlugins) {
38
- config.experimentalPlugins.forEach(plugin => this.addPlugin(plugin, false));
37
+ if (config.plugins) {
38
+ config.plugins.forEach(plugin => this.addPlugin(plugin, false));
39
39
  }
40
40
  if (config.initialTheme) {
41
41
  this.unistylesBridge.useTheme(config.initialTheme);
42
42
  }
43
+ if (config.experimentalCSSMediaQueries) {
44
+ this.plugins = [cssMediaQueriesPlugin].concat(this.plugins);
45
+ this.unistylesBridge.addPlugin(cssMediaQueriesPlugin.name, false);
46
+ }
43
47
  return {
44
48
  addBreakpoints: this.addBreakpoints,
45
49
  addThemes: this.addThemes
@@ -1 +1 @@
1
- {"version":3,"names":["isWeb","UnistylesError","normalizeWebStylesPlugin","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","experimentalPlugins","forEach","plugin","addPlugin","initialTheme","useTheme","getTheme","forName","length","hasTheme","themeName","Error","ThemeNotFound","ThemeNotSelected","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":"AAEA,SAASA,KAAK,EAAEC,cAAc,QAAQ,WAAW;AACjD,SAASC,wBAAwB,QAAQ,YAAY;AAErD,OAAO,MAAMC,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BL,KAAK,GACxC,CAACE,wBAAwB,CAAC,GAC1B,EAAE;EACDI,UAAU,GAAiC,EAAE;EAC7CC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,WAAW,GAAyB,CA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C;IACvD,CAAC;EAAA;EAEMU,YAAY,GAAIvB,MAAuB,IAAK;IAC/C,IAAIA,MAAM,CAACgB,IAAI,CAACC,UAAU,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIR,KAAK,CAAC9B,cAAc,CAAC6C,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAACzC,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC0C,MAAM,CAACC,KAAA;MAAA,IAAC;QAAEV;MAAK,CAAC,GAAAU,KAAA;MAAA,OAAKV,IAAI,KAAKhB,MAAM,CAACgB,IAAI;IAAA,EAAC;IACtE,IAAI,CAAC3B,eAAe,CAACkC,YAAY,CAACvB,MAAM,CAACgB,IAAI,CAAC;EAClD,CAAC;EAEMT,QAAQ,GAAIS,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAAC/B,MAAM;AAC1E"}
1
+ {"version":3,"names":["isWeb","UnistylesError","cssMediaQueriesPlugin","normalizeWebStylesPlugin","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","addConfig","useBreakpoints","adaptiveThemes","useAdaptiveThemes","forEach","plugin","addPlugin","initialTheme","useTheme","experimentalCSSMediaQueries","concat","name","getTheme","forName","length","hasTheme","themeName","Error","ThemeNotFound","ThemeNotSelected","_this","notify","arguments","undefined","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","removePlugin","CantRemoveInternalPlugin","filter","_ref2"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":"AAEA,SAASA,KAAK,EAAEC,cAAc,QAAQ,WAAW;AACjD,SAASC,qBAAqB,EAAEC,wBAAwB,QAAQ,YAAY;AAE5E,OAAO,MAAMC,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BN,KAAK,GACxC,CAACG,wBAAwB,CAAC,GAC1B,EAAE;EACDI,UAAU,GAAiC,EAAE;EAC7CC,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AA,EAAC,EAAE;QACvD,MAAM,IAAIM,KAAK,CAACjC,cAAc,CAAC4C,mBAAmB,CAAC;MACvD;MAEAR,KAAI,CAAC/B,OAAO,GAAG,CAACgB,MAAM,CAAC,CAACK,MAAM,CAACU,KAAI,CAAC/B,OAAO,CAAC;MAC5C+B,KAAI,CAACzB,eAAe,CAACW,SAAS,CAACD,MAAM,CAACM,IAAI,EAAEU,MAAM,CAAC;IACvD,CAAC;EAAA;EAEMQ,YAAY,GAAIxB,MAAuB,IAAK;IAC/C,IAAIA,MAAM,CAACM,IAAI,CAACa,UAAU,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIP,KAAK,CAACjC,cAAc,CAAC8C,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAACzC,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC0C,MAAM,CAACC,KAAA;MAAA,IAAC;QAAErB;MAAK,CAAC,GAAAqB,KAAA;MAAA,OAAKrB,IAAI,KAAKN,MAAM,CAACM,IAAI;IAAA,EAAC;IACtE,IAAI,CAAChB,eAAe,CAACkC,YAAY,CAACxB,MAAM,CAACM,IAAI,CAAC;EAClD,CAAC;EAEMI,QAAQ,GAAIJ,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAACpB,MAAM;AAC1E"}
@@ -7,6 +7,7 @@ export class UnistylesBridgeWeb {
7
7
  #screenWidth = window.innerWidth;
8
8
  #screenHeight = window.innerHeight;
9
9
  #themes = [];
10
+ #breakpoints = {};
10
11
  #colorScheme = this.getPreferredColorScheme();
11
12
  #themeName = '';
12
13
  #enabledPlugins = [normalizeWebStylesPlugin.name];
@@ -29,6 +30,8 @@ export class UnistylesBridgeWeb {
29
30
  return this.#screenHeight;
30
31
  case 'breakpoint':
31
32
  return this.#breakpoint || undefined;
33
+ case 'breakpoints':
34
+ return this.#breakpoints;
32
35
  case 'hasAdaptiveThemes':
33
36
  return this.#hasAdaptiveThemes;
34
37
  case 'sortedBreakpointPairs':
@@ -77,6 +80,7 @@ export class UnistylesBridgeWeb {
77
80
  this.emitThemeChange();
78
81
  }
79
82
  useBreakpoints(breakpoints) {
83
+ this.#breakpoints = breakpoints;
80
84
  this.#sortedBreakpointPairs = Object.entries(breakpoints).sort((_ref, _ref2) => {
81
85
  let [, a] = _ref;
82
86
  let [, b] = _ref2;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","normalizeWebStylesPlugin","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","window","innerWidth","screenHeight","innerHeight","themes","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","name","unistylesEvents","Unistyles","sortedBreakpointPairs","breakpoint","constructor","setupListeners","install","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","breakpoints","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","_ref","_ref2","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","width","find","_ref3","index","otherBreakpoints","value","minVal","maxVal","emit","type","payload","orientation","screen","height","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.web.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,QAAQ,YAAY;AAErD,OAAO,MAAMC,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAWC,MAAM,CAACC,UAAU;EACxC,CAACC,YAAY,GAAWF,MAAM,CAACG,WAAW;EAC1C,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACt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mitter","NativeModules","normalizeWebStylesPlugin","UnistylesBridgeWeb","timerRef","undefined","hasAdaptiveThemes","supportsAutomaticColorScheme","screenWidth","window","innerWidth","screenHeight","innerHeight","themes","breakpoints","colorScheme","getPreferredColorScheme","themeName","enabledPlugins","name","unistylesEvents","Unistyles","sortedBreakpointPairs","breakpoint","constructor","setupListeners","install","__UNISTYLES__","Proxy","get","_target","prop","getTheme","useTheme","useBreakpoints","enable","useAdaptiveThemes","pluginName","notify","addPlugin","removePlugin","Reflect","set","target","newValue","receiver","includes","emitThemeChange","Object","entries","sort","_ref","_ref2","a","b","getBreakpointFromScreenWidth","concat","emitPluginChange","filter","length","at","addEventListener","clearTimeout","setTimeout","emitLayoutChange","matchMedia","event","matches","width","find","_ref3","index","otherBreakpoints","value","minVal","maxVal","emit","type","payload","orientation","screen","height","UnistylesModule"],"sourceRoot":"../../../src","sources":["core/UnistylesModule.web.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,SAASC,wBAAwB,QAAQ,YAAY;AAErD,OAAO,MAAMC,kBAAkB,CAAC;EAC5B,CAACC,QAAQ,GAAmCC,SAAS;EACrD,CAACC,iBAAiB,GAAY,KAAK;EACnC,CAACC,4BAA4B,GAAG,KAAK;EACrC,CAACC,WAAW,GAAWC,MAAM,CAACC,UAAU;EACxC,CAACC,YAAY,GAAWF,MAAM,CAACG,WAAW;EAC1C,CAACC,MAAM,GAAiC,EAAE;EAC1C,CAACC,WAAW,GAAyB,CAAC,CAAC;EACvC,CAACC,WAAW,GAAoB,IAAI,CAACC,uBAAuB,CAAC,CAAC;EAC9D,CAACC,SAAS,GAA0B,EAAE;EACtC,CAACC,cAAc,GAAkB,CAAChB,wBAAwB,CAACiB,IAAI,CAAC;EAChE,CAACC,eAAe,GAAG,IAAIpB,kBAAkB,CAACC,aAAa,CAACoB,SAAS,CAAC;EAClE,CAACC,qBAAqB,GAAgD,EAAE;EACxE,CAACC,UAAU,GAA+B,EAAE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AM,IAAIN,KAAK,GAAGO,MAAM;IAC5C,CAAC,CAAC;IAEN,OAAOpD,UAAU,EAAEqC,EAAE,CAAC,CAAC,CAAC;EAC5B;EAEQ5C,uBAAuBA,CAAA,EAAG;IAC9B,IAAIP,MAAM,CAACwD,UAAU,IAAIxD,MAAM,CAACwD,UAAU,CAAC,8BAA8B,CAAC,CAACE,OAAO,EAAE;MAChF,OAAO,MAAM;IACjB;IAEA,OAAO,OAAO;EAClB;EAEQV,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAACrC,eAAe,CAACwD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE;IACV,CAAC,CAAC;EACN;EAEQ9B,eAAeA,CAAA,EAAG;IACtB,IAAI,CAAC,CAAC3B,eAAe,CAACwD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,OAAO;MACbC,OAAO,EAAE;QACL7D,SAAS,EAAE,IAAI,CAAC,CAACA;MACrB;IACJ,CAAC,CAAC;EACN;EAEQ+C,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC,CAAC5C,eAAe,CAACwD,IAAI,CAAC,qBAAqB,EAAE;MAC9CC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE;QACLvD,UAAU,EAAE,IAAI,CAAC,CAACA,UAAU;QAC5BwD,WAAW,EAAE,IAAI,CAAC,CAACvE,WAAW,GAAG,IAAI,CAAC,CAACG,YAAY,GAC7C,WAAW,GACX,UAAU;QAChBqE,MAAM,EAAE;UACJZ,KAAK,EAAE,IAAI,CAAC,CAAC5D,WAAW;UACxByE,MAAM,EAAE,IAAI,CAAC,CAACtE;QAClB;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMuE,eAAe,GAAG,IAAI/E,kBAAkB,CAAC,CAAC"}
@@ -16,6 +16,9 @@ export class UnistylesRuntime {
16
16
  get breakpoint() {
17
17
  return this.unistylesBridge.breakpoint;
18
18
  }
19
+ get breakpoints() {
20
+ return this.unistylesRegistry.breakpoints;
21
+ }
19
22
  get enabledPlugins() {
20
23
  return this.unistylesBridge.enabledPlugins;
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC,EAAUC,iBAAmC,EAAE;IAAA,KAA/ED,eAAgC,GAAhCA,eAAgC;IAAA,KAAUC,iBAAmC,GAAnCA,iBAAmC;EAAG;EAEpG,IAAWC,WAAWA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACF,eAAe,CAACE,WAAW;EAC3C;EAEA,IAAWC,iBAAiBA,CAAA,EAAG;IAC3B,OAAO,IAAI,CAACH,eAAe,CAACG,iBAAiB;EACjD;EAEA,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACJ,eAAe,CAACI,SAAS;EACzC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACL,eAAe,CAACK,UAAU;EAC1C;EAEA,IAAWC,cAAcA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACN,eAAe,CAACM,cAAc;EAC9C;EAEA,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO;MACHC,KAAK,EAAE,IAAI,CAACR,eAAe,CAACS,WAAW;MACvCC,MAAM,EAAE,IAAI,CAACV,eAAe,CAACW;IACjC,CAAC;EACL;EAEA,IAAWC,WAAWA,CAAA,EAAG;IACrB,MAAM;MAAEJ,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAI,CAACH,MAAM;IAErC,IAAIC,KAAK,GAAGE,MAAM,EAAE;MAChB,OAAOd,iBAAiB,CAACiB,SAAS;IACtC;IAEA,OAAOjB,iBAAiB,CAACkB,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAIA,IAAI,KAAK,IAAI,CAACZ,SAAS,EAAE;MACzB;IACJ;IAEA,IAAI,IAAI,CAACH,iBAAiB,CAACgB,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAAChB,eAAe,CAACkB,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIG,KAAK,CAACtB,cAAc,CAACuB,kBAAkB,CAAC;EACtD,CAAC;EAEMC,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAACtB,eAAe,CAACuB,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;EAEME,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACxB,iBAAiB,CAACuB,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;EAEMC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACxB,iBAAiB,CAACyB,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL"}
1
+ {"version":3,"names":["ScreenOrientation","UnistylesError","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","breakpoints","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,cAAc,QAAQ,WAAW;AAK7D,OAAO,MAAMC,gBAAgB,CAAC;EAC1BC,WAAWA,CAASC,eAAgC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AEA,MAAM,IAAIG,KAAK,CAACvB,cAAc,CAACwB,kBAAkB,CAAC;EACtD,CAAC;EAEMC,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAACvB,eAAe,CAACwB,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;EAEME,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAACzB,iBAAiB,CAACwB,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;EAEMC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAACzB,iBAAiB,CAAC0B,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL"}
@@ -1,4 +1,5 @@
1
1
  export { useInitialTheme } from './useInitialTheme';
2
2
  export { useUnistyles } from './useUnistyles';
3
3
  export { useVariants } from './useVariants';
4
+ export { useCSS } from './useCSS';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useInitialTheme","useUnistyles","useVariants"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,eAAe"}
1
+ {"version":3,"names":["useInitialTheme","useUnistyles","useVariants","useCSS"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,MAAM,QAAQ,UAAU"}
@@ -0,0 +1,2 @@
1
+ export const useCSS = _stylesheet => {};
2
+ //# sourceMappingURL=useCSS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCSS","_stylesheet"],"sourceRoot":"../../../src","sources":["hooks/useCSS.ts"],"mappings":"AAEA,OAAO,MAAMA,MAAM,GAAOC,WAAqC,IAAW,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { useInsertionEffect, useRef } from 'react';
2
+ import { unistyles } from '../core';
3
+ import { generateReactNativeWebId } from '../utils';
4
+ export const useCSS = stylesheet => {
5
+ const insertedIds = useRef([]);
6
+ useInsertionEffect(() => {
7
+ if (!unistyles.registry.config.experimentalCSSMediaQueries) {
8
+ return;
9
+ }
10
+ Object.entries(stylesheet).forEach(_ref => {
11
+ let [_key, value] = _ref;
12
+ Object.entries(value).forEach(_ref2 => {
13
+ let [prop, val] = _ref2;
14
+ if (!val.toString().includes('@media')) {
15
+ return;
16
+ }
17
+ const id = generateReactNativeWebId(prop, '""');
18
+ if (insertedIds.current.includes(id)) {
19
+ return;
20
+ }
21
+ const style = document.createElement('style');
22
+ style.id = id;
23
+ style.innerHTML = val;
24
+ document.head.appendChild(style);
25
+ insertedIds.current = [...insertedIds.current, id];
26
+ });
27
+ });
28
+ return () => {
29
+ insertedIds.current.forEach(id => {
30
+ const style = document.getElementById(id);
31
+ if (style) {
32
+ style.remove();
33
+ }
34
+ });
35
+ insertedIds.current = [];
36
+ };
37
+ }, [stylesheet]);
38
+ };
39
+ //# sourceMappingURL=useCSS.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useInsertionEffect","useRef","unistyles","generateReactNativeWebId","useCSS","stylesheet","insertedIds","registry","config","experimentalCSSMediaQueries","Object","entries","forEach","_ref","_key","value","_ref2","prop","val","toString","includes","id","current","style","document","createElement","innerHTML","head","appendChild","getElementById","remove"],"sourceRoot":"../../../src","sources":["hooks/useCSS.web.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,MAAM,QAAQ,OAAO;AAClD,SAASC,SAAS,QAAQ,SAAS;AAEnC,SAASC,wBAAwB,QAAQ,UAAU;AAEnD,OAAO,MAAMC,MAAM,GAAOC,UAAoC,IAAK;EAC/D,MAAMC,WAAW,GAAGL,MAAM,CAAgB,EAAE,CAAC;EAE7CD,kBAAkB,CAAC,MAAM;IACrB,IAAI,CAACE,SAAS,CAACK,QAAQ,CAACC,MAAM,CAACC,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yle","preprocessor","normalizeNumericValue","normalizeColor"],"sourceRoot":"../../../src","sources":["normalizer/index.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,YAAY,EAAEC,qBAAqB,EAAEC,cAAc,QAAQ,cAAc"}
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["normalizer/module.d.ts"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { preprocessor } from './normalizer';
2
- import { warn } from '../../common';
2
+ import { warn } from '../common';
3
3
  const normalizeBoxShadow = style => {
4
4
  const requiredBoxShadowProperties = ['shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius'];
5
5
  if (!requiredBoxShadowProperties.every(prop => prop in style)) {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["preprocessor","warn","normalizeBoxShadow","style","requiredBoxShadowProperties","every","prop","join","shadowColor","undefined","shadowOffset","shadowOpacity","shadowRadius","boxShadow","createBoxShadowValue","normalizeTextShadow","requiredTextShadowProperties","textShadowColor","textShadowOffset","textShadowRadius","textShadow","createTextShadowValue","normalizeStyle","normalizedTransform","Array","isArray","transform","createTransformValue","normalizedBoxShadow","normalizedTextShadow"],"sourceRoot":"../../../src","sources":["normalizer/normalizeStyle.ts"],"mappings":"AAAA,SAASA,YAAY,QAAQ,cAAc;AAC3C,SAASC,IAAI,QAAQ,WAAW;AAGhC,MAAMC,kBAAkB,GAAyBC,KAAQ,IAA0B;EAC/E,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,CACjB;EAED,IAAI,CAACA,2BAA2B,CAACC,KAAK,CAACC,IAAI,IAAIA,IAAI,IAAIH,KAAK,CAAC,EAAE;IAC3DF,IAAI,CAAE,wEAAuEG,2BAA2B,CAACG,IAAI,CAAC,IAAI,CAAE,EAAC,CAAC;IAEtH,OAAO;MACHC,WAAW,EAAEC,SAAS;MACtBC,YAAY,EAAED,SAAS;MACvBE,aAAa,E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,GAAG,CAAC,CAAC;EAE/C,MAAM0B,oBAAoB,GACtB,iBAAiB,IAAI1B,KAAK,IAC1B,kBAAkB,IAAIA,KAAK,IAC3B,kBAAkB,IAAIA,KAAK,GAC3BY,mBAAmB,CAACZ,KAAmB,CAAC,GAAG,CAAC,CAAC;EAEjD,OAAO;IACH,GAAGA,KAAK;IACR,GAAGoB,mBAAmB;IACtB,GAAGK,mBAAmB;IACtB,GAAGC;EACP,CAAC;AACL,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeColors","normalizeColor","color","opacity","arguments","length","undefined","integer","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","normalizeNumericValue","value","normalizeTransform","key","includes","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","createBoxShadowValue","shadowColor","shadowOffset","shadowOpacity","shadowRadius","createTransformValue","transforms","transform","Object","keys","join","Boolean","preprocessor"],"sourceRoot":"../../../src","sources":["normalizer/normalizer.ts"],"mappings":"AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAS5D,OAAO,MAAMC,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC7D;EACA,IAAID,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAMK,OAAO,GAAGP,eAAe,CAACE,KAAK,CAAqB;;EAE1D;EACA,IAAIK,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOL,KAAK;EAChB;EAEA,MAAMM,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACH,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACM,CAAC,GAAG,CAAC,EAAEC,C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{
4
+ name: '__unistylesCSSMediaQueries',
5
+ onParsedStyle: (_key, styles, runtime) => createMediaQueryForStyles(styles, runtime)
6
+ };
7
+ //# sourceMappingURL=cssMediaQueriesPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createMediaQueryForStyles","cssMediaQueriesPlugin","name","onParsedStyle","_key","styles","runtime"],"sourceRoot":"../../../src","sources":["plugins/cssMediaQueriesPlugin.ts"],"mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,wBAAwB;AAGlE,OAAO,MAAMC,qBAAsC,GAAG;EAClDC,IAAI,EAAE,4BAA4B;EAClCC,aAAa,EAAEA,CAACC,IAAI,EAAEC,MAAM,EAAEC,OAAO,KAAKN,yBAAyB,CAACK,MAAM,EAAEC,OAAO;AACvF,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { normalizeWebStylesPlugin } from './normalizeWebStylesPlugin';
2
- export { preprocessor, normalizeNumericValue, normalizeColor, normalizeStyle } from './normalizer';
2
+ export { cssMediaQueriesPlugin } from './cssMediaQueriesPlugin';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeWebStylesPlugin","preprocessor","normalizeNumericValue","normalizeColor","normalizeStyle"],"sourceRoot":"../../../src","sources":["plugins/index.ts"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,EAAEC,qBAAqB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,cAAc"}
1
+ {"version":3,"names":["normalizeWebStylesPlugin","cssMediaQueriesPlugin"],"sourceRoot":"../../../src","sources":["plugins/index.ts"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,qBAAqB,QAAQ,yBAAyB"}
@@ -1,4 +1,4 @@
1
- import { normalizeStyle } from './normalizer';
1
+ import { normalizeStyle } from '../normalizer';
2
2
  export const normalizeWebStylesPlugin = {
3
3
  name: '__unistylesNormalizeWebStyles',
4
4
  onParsedStyle: (_key, styles) => normalizeStyle(styles)
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeStyle","normalizeWebStylesPlugin","name","onParsedStyle","_key","styles"],"sourceRoot":"../../../src","sources":["plugins/normalizeWebStylesPlugin.ts"],"mappings":"AACA,SAASA,cAAc,QAAQ,cAAc;AAE7C,OAAO,MAAMC,wBAAyC,GAAG;EACrDC,IAAI,EAAE,+BAA+B;EACrCC,aAAa,EAAEA,CAACC,IAAI,EAAEC,MAAM,KAAKL,cAAc,CAACK,MAAM;AAC1D,CAAC"}
1
+ {"version":3,"names":["normalizeStyle","normalizeWebStylesPlugin","name","onParsedStyle","_key","styles"],"sourceRoot":"../../../src","sources":["plugins/normalizeWebStylesPlugin.ts"],"mappings":"AACA,SAASA,cAAc,QAAQ,eAAe;AAE9C,OAAO,MAAMC,wBAAyC,GAAG;EACrDC,IAAI,EAAE,+BAA+B;EACrCC,aAAa,EAAEA,CAACC,IAAI,EAAEC,MAAM,KAAKL,cAAc,CAACK,MAAM;AAC1D,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { useMemo } from 'react';
2
2
  import { StyleSheet } from 'react-native';
3
3
  import { parseStyle, proxifyFunction, withPlugins } from './utils';
4
- import { useUnistyles, useVariants } from './hooks';
4
+ import { useCSS, useUnistyles, useVariants } from './hooks';
5
+ import { unistyles } from './core';
6
+ import { isWeb } from './common';
5
7
  export const useStyles = (stylesheet, variantsMap) => {
6
8
  const {
7
9
  theme,
@@ -20,9 +22,10 @@ export const useStyles = (stylesheet, variantsMap) => {
20
22
  }
21
23
  return StyleSheet.create({
22
24
  ...acc,
23
- [key]: withPlugins(key, parseStyle(value, variants))
25
+ [key]: withPlugins(key, parseStyle(value, variants, !isWeb || !unistyles.registry.config.experimentalCSSMediaQueries))
24
26
  });
25
27
  }, {}), [parsedStyles, variants, plugins]);
28
+ useCSS(dynamicStyleSheet);
26
29
  return {
27
30
  theme,
28
31
  breakpoint: layout.breakpoint,
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","withPlugins","useUnistyles","useVariants","useStyles","stylesheet","variantsMap","theme","layout","plugins","variants","parsedStyles","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","create","breakpoint","styles"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAUnD,OAAO,MAAMC,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGP,YAAY,CAAC,CAAC;EACjD,MAAMQ,QAAQ,GAAGP,WAAW,CAACG,WAAW,CAAC;EACzC,MAAMK,YAAY,GAAGd,OAAO,CAAC,MAAM,OAAOQ,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,CAAC,GACjBF,UAAU,EAAE,CAACE,KAAK,EAAEF,UAAU,EAAEG,MAAM,CAAC,CAAC;EAE9C,MAAMI,iBAAiB,GAAGf,OAAO,CAAC,MAAMgB,MAAM,CACzCC,OAAO,CAACH,YAAY,IAAI,CAAC,CAAC,CAAC,CAC3BI,MAAM,CAAC,CAACC,GAAG,EAAAC,IAAA,KAAmB;IAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IACtB,IAAI,OAAOE,KAAK,KAAK,UAAU,EAAE;MAC7B,OAAO;QACH,GAAGH,GAAG;QACN,CAACE,GAAG,GAAGlB,eAAe,CAACkB,GAAG,EAAEC,KAAK;MACrC,CAAC;IACL;IAEA,OAAOrB,UAAU,CAACsB,MAAM,CAAC;MACrB,GAAGJ,GAAG;MACN,CAACE,GAAG,GAAGjB,WAAW,CAACiB,GAAG,EAAEnB,UAAU,CAACoB,KAAK,EAAET,QAAQ,CAAC;IACvD,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAACC,YAAY,EAAED,QAAQ,EAAED,OAAO,CAC5C,CAAC;EAED,OAAO;IACHF,KAAK;IACLc,UAAU,EAAEb,MAAM,CAACa,UAAU;IAC7BC,MAAM,EAAEV;EACZ,CAAC;AACL,CAAC"}
1
+ {"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","withPlugins","useCSS","useUnistyles","useVariants","unistyles","isWeb","useStyles","stylesheet","variantsMap","theme","layout","plugins","variants","parsedStyles","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","create","registry","config","experimentalCSSMediaQueries","breakpoint","styles"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,MAAM,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAG3D,SAASC,SAAS,QAAQ,QAAQ;AAClC,SAASC,KAAK,QAAQ,UAAU;AAQhC,OAAO,MAAMC,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGT,YAAY,CAAC,CAAC;EACjD,MAAMU,QAAQ,GAAGT,WAAW,CAACK,WAAW,CAAC;EACzC,MAAMK,YAAY,GAAGjB,OAAO,CAAC,MAAM,OAAOW,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,CAAC,GACjBF,UAAU,EAAE,CAACE,KAAK,EAAEF,UAAU,EAAEG,MAAM,CAAC,CAAC;EAE9C,MAAMI,iBAAiB,GAAGlB,OAAO,CAAC,MAAMmB,MAAM,CACzCC,OAAO,CAACH,YAAY,IAAI,CAAC,CAAC,CAAC,CAC3BI,MAAM,CAAC,C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