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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) 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/Unistyles.js +2 -1
  4. package/lib/commonjs/core/Unistyles.js.map +1 -1
  5. package/lib/commonjs/core/UnistylesModule.web.js +18 -6
  6. package/lib/commonjs/core/UnistylesModule.web.js.map +1 -1
  7. package/lib/commonjs/core/UnistylesRuntime.js +3 -0
  8. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  9. package/lib/commonjs/hooks/index.js +7 -0
  10. package/lib/commonjs/hooks/index.js.map +1 -1
  11. package/lib/commonjs/hooks/useCSS.js +9 -0
  12. package/lib/commonjs/hooks/useCSS.js.map +1 -0
  13. package/lib/commonjs/hooks/useCSS.web.js +46 -0
  14. package/lib/commonjs/hooks/useCSS.web.js.map +1 -0
  15. package/lib/commonjs/normalizer/index.js.map +1 -0
  16. package/lib/commonjs/normalizer/module.d.js.map +1 -0
  17. package/lib/commonjs/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  18. package/lib/commonjs/normalizer/normalizeStyle.js.map +1 -0
  19. package/lib/commonjs/normalizer/normalizer.js.map +1 -0
  20. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js +14 -0
  21. package/lib/commonjs/plugins/cssMediaQueriesPlugin.js.map +1 -0
  22. package/lib/commonjs/plugins/index.js +3 -21
  23. package/lib/commonjs/plugins/index.js.map +1 -1
  24. package/lib/commonjs/plugins/normalizeWebStylesPlugin.js +1 -1
  25. package/lib/commonjs/useStyles.js +4 -1
  26. package/lib/commonjs/useStyles.js.map +1 -1
  27. package/lib/commonjs/utils/cssMediaQuery.js +250 -0
  28. package/lib/commonjs/utils/cssMediaQuery.js.map +1 -0
  29. package/lib/commonjs/utils/generateId.js +15 -0
  30. package/lib/commonjs/utils/generateId.js.map +1 -0
  31. package/lib/commonjs/utils/hash32.js +43 -0
  32. package/lib/commonjs/utils/hash32.js.map +1 -0
  33. package/lib/commonjs/utils/index.js +13 -0
  34. package/lib/commonjs/utils/index.js.map +1 -1
  35. package/lib/commonjs/utils/mqParser.js +2 -1
  36. package/lib/commonjs/utils/mqParser.js.map +1 -1
  37. package/lib/commonjs/utils/styles.js +11 -1
  38. package/lib/commonjs/utils/styles.js.map +1 -1
  39. package/lib/module/core/UnistyleRegistry.js +7 -3
  40. package/lib/module/core/UnistyleRegistry.js.map +1 -1
  41. package/lib/module/core/Unistyles.js +2 -1
  42. package/lib/module/core/Unistyles.js.map +1 -1
  43. package/lib/module/core/UnistylesModule.web.js +18 -6
  44. package/lib/module/core/UnistylesModule.web.js.map +1 -1
  45. package/lib/module/core/UnistylesRuntime.js +3 -0
  46. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  47. package/lib/module/hooks/index.js +1 -0
  48. package/lib/module/hooks/index.js.map +1 -1
  49. package/lib/module/hooks/useCSS.js +2 -0
  50. package/lib/module/hooks/useCSS.js.map +1 -0
  51. package/lib/module/hooks/useCSS.web.js +39 -0
  52. package/lib/module/hooks/useCSS.web.js.map +1 -0
  53. package/lib/module/normalizer/index.js.map +1 -0
  54. package/lib/module/normalizer/module.d.js.map +1 -0
  55. package/lib/module/{plugins/normalizer → normalizer}/normalizeStyle.js +1 -1
  56. package/lib/module/normalizer/normalizeStyle.js.map +1 -0
  57. package/lib/module/normalizer/normalizer.js.map +1 -0
  58. package/lib/module/plugins/cssMediaQueriesPlugin.js +7 -0
  59. package/lib/module/plugins/cssMediaQueriesPlugin.js.map +1 -0
  60. package/lib/module/plugins/index.js +1 -1
  61. package/lib/module/plugins/index.js.map +1 -1
  62. package/lib/module/plugins/normalizeWebStylesPlugin.js +1 -1
  63. package/lib/module/plugins/normalizeWebStylesPlugin.js.map +1 -1
  64. package/lib/module/useStyles.js +5 -2
  65. package/lib/module/useStyles.js.map +1 -1
  66. package/lib/module/utils/cssMediaQuery.js +243 -0
  67. package/lib/module/utils/cssMediaQuery.js.map +1 -0
  68. package/lib/module/utils/generateId.js +7 -0
  69. package/lib/module/utils/generateId.js.map +1 -0
  70. package/lib/module/utils/hash32.js +36 -0
  71. package/lib/module/utils/hash32.js.map +1 -0
  72. package/lib/module/utils/index.js +2 -1
  73. package/lib/module/utils/index.js.map +1 -1
  74. package/lib/module/utils/mqParser.js +1 -1
  75. package/lib/module/utils/mqParser.js.map +1 -1
  76. package/lib/module/utils/styles.js +11 -1
  77. package/lib/module/utils/styles.js.map +1 -1
  78. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
  79. package/lib/typescript/src/core/Unistyles.d.ts.map +1 -1
  80. package/lib/typescript/src/core/UnistylesModule.web.d.ts.map +1 -1
  81. package/lib/typescript/src/core/UnistylesRuntime.d.ts +1 -0
  82. package/lib/typescript/src/core/UnistylesRuntime.d.ts.map +1 -1
  83. package/lib/typescript/src/hooks/index.d.ts +1 -0
  84. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  85. package/lib/typescript/src/hooks/useCSS.d.ts +3 -0
  86. package/lib/typescript/src/hooks/useCSS.d.ts.map +1 -0
  87. package/lib/typescript/src/hooks/useCSS.web.d.ts +3 -0
  88. package/lib/typescript/src/hooks/useCSS.web.d.ts.map +1 -0
  89. package/lib/typescript/src/normalizer/index.d.ts.map +1 -0
  90. package/lib/typescript/src/normalizer/normalizeStyle.d.ts +3 -0
  91. package/lib/typescript/src/normalizer/normalizeStyle.d.ts.map +1 -0
  92. package/lib/typescript/src/{plugins/normalizer → normalizer}/normalizer.d.ts +1 -1
  93. package/lib/typescript/src/normalizer/normalizer.d.ts.map +1 -0
  94. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts +3 -0
  95. package/lib/typescript/src/plugins/cssMediaQueriesPlugin.d.ts.map +1 -0
  96. package/lib/typescript/src/plugins/index.d.ts +1 -1
  97. package/lib/typescript/src/plugins/index.d.ts.map +1 -1
  98. package/lib/typescript/src/types/unistyles.d.ts +2 -1
  99. package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
  100. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  101. package/lib/typescript/src/utils/cssMediaQuery.d.ts +4 -0
  102. package/lib/typescript/src/utils/cssMediaQuery.d.ts.map +1 -0
  103. package/lib/typescript/src/utils/generateId.d.ts +2 -0
  104. package/lib/typescript/src/utils/generateId.d.ts.map +1 -0
  105. package/lib/typescript/src/utils/hash32.d.ts +2 -0
  106. package/lib/typescript/src/utils/hash32.d.ts.map +1 -0
  107. package/lib/typescript/src/utils/index.d.ts +3 -1
  108. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  109. package/lib/typescript/src/utils/mqParser.d.ts +2 -1
  110. package/lib/typescript/src/utils/mqParser.d.ts.map +1 -1
  111. package/lib/typescript/src/utils/styles.d.ts +1 -1
  112. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  113. package/package.json +3 -2
  114. package/src/core/UnistyleRegistry.ts +8 -3
  115. package/src/core/Unistyles.ts +2 -1
  116. package/src/core/UnistylesModule.web.ts +20 -7
  117. package/src/core/UnistylesRuntime.ts +4 -0
  118. package/src/hooks/index.ts +1 -0
  119. package/src/hooks/useCSS.ts +3 -0
  120. package/src/hooks/useCSS.web.ts +51 -0
  121. package/src/{plugins/normalizer → normalizer}/normalizeStyle.ts +2 -2
  122. package/src/{plugins/normalizer → normalizer}/normalizer.ts +2 -1
  123. package/src/plugins/cssMediaQueriesPlugin.ts +8 -0
  124. package/src/plugins/index.ts +1 -1
  125. package/src/plugins/normalizeWebStylesPlugin.ts +1 -1
  126. package/src/types/unistyles.ts +3 -2
  127. package/src/useStyles.ts +10 -2
  128. package/src/utils/cssMediaQuery.ts +268 -0
  129. package/src/utils/generateId.ts +10 -0
  130. package/src/utils/hash32.ts +53 -0
  131. package/src/utils/index.ts +3 -1
  132. package/src/utils/mqParser.ts +2 -2
  133. package/src/utils/styles.ts +12 -2
  134. package/lib/commonjs/plugins/normalizer/index.js.map +0 -1
  135. package/lib/commonjs/plugins/normalizer/module.d.js.map +0 -1
  136. package/lib/commonjs/plugins/normalizer/normalizeStyle.js.map +0 -1
  137. package/lib/commonjs/plugins/normalizer/normalizer.js.map +0 -1
  138. package/lib/module/plugins/normalizer/index.js.map +0 -1
  139. package/lib/module/plugins/normalizer/module.d.js.map +0 -1
  140. package/lib/module/plugins/normalizer/normalizeStyle.js.map +0 -1
  141. package/lib/module/plugins/normalizer/normalizer.js.map +0 -1
  142. package/lib/typescript/src/plugins/normalizer/index.d.ts.map +0 -1
  143. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts +0 -3
  144. package/lib/typescript/src/plugins/normalizer/normalizeStyle.d.ts.map +0 -1
  145. package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +0 -1
  146. /package/lib/commonjs/{plugins/normalizer → normalizer}/index.js +0 -0
  147. /package/lib/commonjs/{plugins/normalizer → normalizer}/module.d.js +0 -0
  148. /package/lib/commonjs/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  149. /package/lib/module/{plugins/normalizer → normalizer}/index.js +0 -0
  150. /package/lib/module/{plugins/normalizer → normalizer}/module.d.js +0 -0
  151. /package/lib/module/{plugins/normalizer → normalizer}/normalizer.js +0 -0
  152. /package/lib/typescript/src/{plugins/normalizer → normalizer}/index.d.ts +0 -0
  153. /package/src/{plugins/normalizer → normalizer}/index.ts +0 -0
  154. /package/src/{plugins/normalizer → normalizer}/module.d.ts +0 -0
@@ -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,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;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,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,2BAA2B,EAAE;MACxD;IACJ;IAEAC,MAAM,CACDC,OAAO,CAACN,UAAU,CAAC,CACnBO,OAAO,CAACC,IAAA,IAAmB;MAAA,IAAlB,CAACC,IAAI,EAAEC,KAAK,CAAC,GAAAF,IAAA;MACnBH,MAAM,CAACC,OAAO,CAACI,KAAM,CAAC,CACjBH,OAAO,CAACI,KAAA,IAAiB;QAAA,IAAhB,CAACC,IAAI,EAAEC,GAAG,CAAC,GAAAF,KAAA;QACjB,IAAI,CAACE,GAAG,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,QAAQ,CAAC,EAAE;UACpC;QACJ;QAEA,MAAMC,EAAE,GAAGlB,wBAAwB,CAACc,IAAI,EAAE,IAAI,CAAC;QAE/C,IAAIX,WAAW,CAACgB,OAAO,CAACF,QAAQ,CAACC,EAAE,CAAC,EAAE;UAClC;QACJ;QAEA,MAAME,KAAK,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;QAE7CF,KAAK,CAACF,EAAE,GAAGA,EAAE;QACbE,KAAK,CAACG,SAAS,GAAGR,GAAG;QAErBM,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACL,KAAK,CAAC;QAChCjB,WAAW,CAACgB,OAAO,GAAG,CAAC,GAAGhB,WAAW,CAACgB,OAAO,EAAED,EAAE,CAAC;MACtD,CAAC,CAAC;IACV,CAAC,CAAC;IAEN,OAAO,MAAM;MACTf,WAAW,CAACgB,OAAO,CAACV,OAAO,CAACS,EAAE,IAAI;QAC9B,MAAME,KAAK,GAAGC,QAAQ,CAACK,cAAc,CAACR,EAAE,CAAC;QAEzC,IAAIE,KAAK,EAAE;UACPA,KAAK,CAACO,MAAM,CAAC,CAAC;QAClB;MACJ,CAAC,CAAC;MAEFxB,WAAW,CAACgB,OAAO,GAAG,EAAE;IAC5B,CAAC;EACL,CAAC,EAAE,CAACjB,UAAU,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeStyle","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,EAAEF,SAAS;MACxBG,YAAY,EAAEH;IAClB,CAAC;EACL;EAEA,OAAO;IACHI,SAAS,EAAEb,YAAY,CAACc,oBAAoB,CAACX,KAAK,CAAC;IACnDK,WAAW,EAAEC,SAAS;IACtBC,YAAY,EAAED,SAAS;IACvBE,aAAa,EAAEF,SAAS;IACxBG,YAAY,EAAEH;EAClB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AAGoB,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,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGN,GAAG,CACnCO,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAA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AACiB,YAAY,CAACJ,MAAM,CAAC;EAC1D,MAAMC,MAAM,GAAGd,qBAAqB,CAACmB,YAAY,CAAC;EAClD,MAAMvC,KAAK,GAAGD,cAAc,CAACqC,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAQ,GAAER,OAAQ,IAAGE,OAAQ,IAAGE,MAAO,IAAGlC,KAAM,EAAC;AACrD,CAAC;AAED,MAAMwC,oBAAoB,GAAIC,UAAsB,IAAKA,UAAU,CAC9D3B,GAAG,CAAC4B,SAAS,IAAI;EACd,MAAM,CAACnB,GAAG,CAAC,GAAGoB,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;EAEpC,IAAI,CAACnB,GAAG,EAAE;IACN,OAAOnB,SAAS;EACpB;EAEA,MAAMiB,KAAK,GAAGqB,SAAS,CAACnB,GAAG,CAA2B;EAEtD,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAQ,GAAEA,GAAI,IAAIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDJ,MAAM,CAAC6B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAME,YAA0B,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ // prevent recursive import
2
+ import { createMediaQueryForStyles } from '../utils/cssMediaQuery';
3
+ export const cssMediaQueriesPlugin = {
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;A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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,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,GAAGrB,eAAe,CAACqB,GAAG,EAAEC,KAAK;MACrC,CAAC;IACL;IAEA,OAAOxB,UAAU,CAACyB,MAAM,CAAC;MACrB,GAAGJ,GAAG;MACN,CAACE,GAAG,GAAGpB,WAAW,CAACoB,GAAG,EAAEtB,UAAU,CAC9BuB,KAAK,EACLT,QAAQ,EACR,CAACP,KAAK,IAAI,CAACD,SAAS,CAACmB,QAAQ,CAACC,MAAM,CAACC,2BAA2B,CACpE;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAACZ,YAAY,EAAED,QAAQ,EAAED,OAAO,CAC5C,CAAC;EAEDV,MAAM,CAACa,iBAA8C,CAAC;EAEtD,OAAO;IACHL,KAAK;IACLiB,UAAU,EAAEhB,MAAM,CAACgB,UAAU;IAC7BC,MAAM,EAAEb;EACZ,CAAC;AACL,CAAC"}
@@ -0,0 +1,243 @@
1
+ import { normalizeColor } from '../normalizer';
2
+ import { isUnistylesMq, isValidMq, parseMq } from './mqParser';
3
+ import { generateReactNativeWebId } from './generateId';
4
+ export const createMediaQueryForStyles = (styles, runtime) => {
5
+ const withMediaQueries = Object.entries(styles).filter(_ref => {
6
+ let [, value] = _ref;
7
+ return typeof value === 'object';
8
+ }).reduce((acc, _ref2) => {
9
+ let [prop, value] = _ref2;
10
+ const objectKeys = Object.keys(value);
11
+ const mediaQueries = objectKeys.filter(key => isUnistylesMq(key));
12
+ const breakpoints = objectKeys.filter(key => runtime.breakpoints[key]);
13
+ if (mediaQueries.length === 0 && breakpoints.length === 0) {
14
+ return acc;
15
+ }
16
+ const className = generateReactNativeWebId(prop, '""');
17
+ const breakpointsStyles = getBreakpointsStyles(prop, value, runtime, className);
18
+ const mediaQueriesStyles = getMediaQueriesFromMQ(prop, value, className);
19
+ return {
20
+ ...acc,
21
+ [prop]: `
22
+ ${breakpointsStyles}
23
+ ${mediaQueriesStyles}
24
+ `.trim()
25
+ };
26
+ }, {});
27
+ return {
28
+ ...styles,
29
+ ...withMediaQueries
30
+ };
31
+ };
32
+ const getMaxWidthMediaQuery = width => {
33
+ if (!width) {
34
+ return '';
35
+ }
36
+ if (width.to === Infinity) {
37
+ return '';
38
+ }
39
+ return `and (max-width: ${width.to}px)`;
40
+ };
41
+ const getMaxHeightMediaQuery = height => {
42
+ if (!height) {
43
+ return '';
44
+ }
45
+ if (height.to === Infinity) {
46
+ return '';
47
+ }
48
+ return `and (max-height: ${height.to}px)`;
49
+ };
50
+ const getMediaQueriesFromMQ = (prop, value, className) => Object.entries(value).reduce((acc, _ref3) => {
51
+ let [key, value] = _ref3;
52
+ const result = parseMq(key);
53
+ if (!isValidMq(result)) {
54
+ return acc;
55
+ }
56
+ if (result.width && result.height) {
57
+ return `${acc}
58
+
59
+ @media screen and (min-width: ${result.width.from}px) and (min-height: ${result.height.from}px) ${getMaxWidthMediaQuery(result.width)} ${getMaxHeightMediaQuery(result.height)} {
60
+ .${className} {
61
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
62
+ }
63
+ }
64
+ `;
65
+ }
66
+ if (result.width) {
67
+ return `${acc}
68
+
69
+ @media screen and (min-width: ${result.width.from}px) ${getMaxWidthMediaQuery(result.width)} {
70
+ .${className} {
71
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
72
+ }
73
+ }
74
+ `;
75
+ }
76
+ if (result.height) {
77
+ return `${acc}
78
+
79
+ @media screen and (min-height: ${result.height.from}px) ${getMaxHeightMediaQuery(result.height)} {
80
+ .${className} {
81
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
82
+ }
83
+ }
84
+ `;
85
+ }
86
+ return acc;
87
+ }, '');
88
+ const getBreakpointsStyles = (prop, value, runtime, className) => Object.entries(value).reduce((acc, _ref4) => {
89
+ let [key, value] = _ref4;
90
+ const breakpoint = runtime.breakpoints[key];
91
+ if (breakpoint === undefined) {
92
+ return acc;
93
+ }
94
+ return `${acc}
95
+
96
+ @media screen and (min-width: ${breakpoint}px) {
97
+ .${className} {
98
+ ${normalizePropName(prop)}: ${normalizeWebValue(prop, value)};
99
+ }
100
+ }
101
+ `;
102
+ }, '');
103
+ const normalizePropName = prop => prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
104
+ const normalizeWebValue = (prop, value) => {
105
+ if (value === undefined) {
106
+ return 'unset';
107
+ }
108
+ switch (prop) {
109
+ // colors
110
+ case 'color':
111
+ case 'backgroundColor':
112
+ case 'borderColor':
113
+ case 'borderBottomColor':
114
+ case 'borderLeftColor':
115
+ case 'borderRightColor':
116
+ case 'borderTopColor':
117
+ case 'borderBlockColor':
118
+ case 'borderBlockEndColor':
119
+ case 'borderBlockStartColor':
120
+ case 'textDecorationColor':
121
+ return normalizeColor(value);
122
+
123
+ // dimensions
124
+ case 'width':
125
+ case 'height':
126
+ case 'minWidth':
127
+ case 'minHeight':
128
+ case 'maxWidth':
129
+ case 'maxHeight':
130
+ case 'borderRadius':
131
+ case 'borderWidth':
132
+ case 'borderBottomLeftRadius':
133
+ case 'borderBottomRightRadius':
134
+ case 'borderEndEndRadius':
135
+ case 'borderEndStartRadius':
136
+ case 'borderStartEndRadius':
137
+ case 'borderStartStartRadius':
138
+ case 'borderTopLeftRadius':
139
+ case 'borderTopRightRadius':
140
+ case 'borderBottomWidth':
141
+ case 'borderLeftWidth':
142
+ case 'borderRightWidth':
143
+ case 'borderTopWidth':
144
+ case 'bottom':
145
+ case 'left':
146
+ case 'right':
147
+ case 'top':
148
+ case 'marginTop':
149
+ case 'marginBottom':
150
+ case 'marginLeft':
151
+ case 'marginRight':
152
+ case 'paddingTop':
153
+ case 'paddingBottom':
154
+ case 'paddingLeft':
155
+ case 'paddingRight':
156
+ case 'flexBasis':
157
+ case 'rowGap':
158
+ case 'columnGap':
159
+ case 'gap':
160
+ case 'margin':
161
+ case 'padding':
162
+ case 'fontSize':
163
+ case 'letterSpacing':
164
+ return `${value}px`;
165
+
166
+ // without unit
167
+ case 'borderStyle':
168
+ case 'pointerEvents':
169
+ case 'backfaceVisibility':
170
+ case 'alignContent':
171
+ case 'alignItems':
172
+ case 'alignSelf':
173
+ case 'flexDirection':
174
+ case 'flexWrap':
175
+ case 'flex':
176
+ case 'aspectRatio':
177
+ case 'opacity':
178
+ case 'direction':
179
+ case 'zIndex':
180
+ case 'justifyContent':
181
+ case 'overflow':
182
+ case 'display':
183
+ case 'position':
184
+ case 'flexGrow':
185
+ case 'flexShrink':
186
+ case 'fontFamily':
187
+ case 'fontStyle':
188
+ case 'textDecorationLine':
189
+ case 'textAlign':
190
+ case 'textDecorationStyle':
191
+ case 'lineHeight':
192
+ case 'textTransform':
193
+ case 'fontVariant':
194
+ case 'verticalAlign':
195
+ case 'objectFit':
196
+ return value;
197
+
198
+ // to be transformed for now
199
+ // not supported
200
+ case 'marginHorizontal':
201
+ case 'paddingHorizontal':
202
+ case 'marginVertical':
203
+ case 'paddingVertical':
204
+ case 'shadowColor':
205
+ case 'shadowOffset':
206
+ case 'shadowOpacity':
207
+ case 'shadowRadius':
208
+ case 'transform':
209
+ case 'transformMatrix':
210
+ case 'fontWeight':
211
+ case 'textShadowOffset':
212
+ case 'textShadowRadius':
213
+ case 'textShadowColor':
214
+ return '';
215
+
216
+ // unsupported
217
+ case 'borderStartColor':
218
+ case 'borderEndColor':
219
+ case 'borderEndWidth':
220
+ case 'borderBottomEndRadius':
221
+ case 'borderBottomStartRadius':
222
+ case 'borderCurve':
223
+ case 'elevation':
224
+ case 'borderTopEndRadius':
225
+ case 'borderTopStartRadius':
226
+ case 'borderStartWidth':
227
+ case 'start':
228
+ case 'end':
229
+ case 'margin-end':
230
+ case 'margin-start':
231
+ case 'padding-end':
232
+ case 'padding-start':
233
+ case 'writingDirection':
234
+ case 'textAlignVertical':
235
+ case 'includeFontPadding':
236
+ case 'resizeMode':
237
+ case 'overlayColor':
238
+ case 'tintColor':
239
+ default:
240
+ return '';
241
+ }
242
+ };
243
+ //# sourceMappingURL=cssMediaQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeColor","isUnistylesMq","isValidMq","parseMq","generateReactNativeWebId","createMediaQueryForStyles","styles","runtime","withMediaQueries","Object","entries","filter","_ref","value","reduce","acc","_ref2","prop","objectKeys","keys","mediaQueries","key","breakpoints","length","className","breakpointsStyles","getBreakpointsStyles","mediaQueriesStyles","getMediaQueriesFromMQ","trim","getMaxWidthMediaQuery","width","to","Infinity","getMaxHeightMediaQuery","height","_ref3","result","from","normalizePropName","normalizeWebValue","_ref4","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,CAACC,IAAA;IAAA,IAAC,GAAGC,KAAK,CAAC,GAAAD,IAAA;IAAA,OAAK,OAAOC,KAAK,KAAK,QAAQ;EAAA,EAAC,CAChDC,MAAM,CAAC,CAACC,GAAG,EAAAC,KAAA,KAAoB;IAAA,IAAlB,CAACC,IAAI,EAAEJ,KAAK,CAAC,GAAAG,KAAA;IACvB,MAAME,UAAU,GAAGT,MAAM,CAACU,IAAI,CAACN,KAAK,CAAC;IACrC,MAAMO,YAAY,GAAGF,UAAU,CAACP,MAAM,CAACU,GAAG,IAAIpB,aAAa,CAACoB,GAAG,CAAC,CAAC;IACjE,MAAMC,WAAW,GAAGJ,UAAU,CAACP,MAAM,CAACU,GAAG,IAAId,OAAO,CAACe,WAAW,CAACD,GAAG,CAAqC,CAAC;IAE1G,IAAID,YAAY,CAACG,MAAM,KAAK,CAAC,IAAID,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;MACvD,OAAOR,GAAG;IACd;IAEA,MAAMS,SAAS,GAAGpB,wBAAwB,CAACa,IAAI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;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"}
@@ -0,0 +1,7 @@
1
+ // eslint-disable-next-line camelcase
2
+ import { murmurhash2_32_gc } from './hash32';
3
+ export const generateReactNativeWebId = (key, value) => {
4
+ const hashedString = murmurhash2_32_gc(key + value, 1).toString(36);
5
+ return process.env.NODE_ENV !== 'production' ? `r-${key}-${hashedString}` : `r-${hashedString}`;
6
+ };
7
+ //# sourceMappingURL=generateId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["murmurhash2_32_gc","generateReactNativeWebId","key","value","hashedString","toString","process","env","NODE_ENV"],"sourceRoot":"../../../src","sources":["utils/generateId.ts"],"mappings":"AAAA;AACA,SAASA,iBAAiB,QAAQ,UAAU;AAE5C,OAAO,MAAMC,wBAAwB,GAAGA,CAACC,GAAW,EAAEC,KAAa,KAAa;EAC5E,MAAMC,YAAY,GAAGJ,iBAAiB,CAACE,GAAG,GAAGC,KAAK,EAAE,CAAC,CAAC,CAACE,QAAQ,CAAC,EAAE,CAAC;EAEnE,OAAOC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACrC,KAAIN,GAAI,IAAGE,YAAa,EAAC,GACzB,KAAIA,YAAa,EAAC;AAC7B,CAAC"}
@@ -0,0 +1,36 @@
1
+ /*
2
+ Authors: Gary Court and Austin Appleby
3
+ Compatible with React Native Web
4
+ https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/compiler/hash.js#L65
5
+ */
6
+ export const murmurhash2_32_gc = (str, seed) => {
7
+ let l = str.length;
8
+ let h = seed ^ l;
9
+ let i = 0;
10
+ let k;
11
+ while (l >= 4) {
12
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
13
+ k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
14
+ k ^= k >>> 24;
15
+ k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
16
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
17
+ l -= 4;
18
+ ++i;
19
+ }
20
+ switch (l) {
21
+ // @ts-ignore
22
+ case 3:
23
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
24
+ // @ts-ignore
25
+ case 2:
26
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
27
+ case 1:
28
+ h ^= str.charCodeAt(i) & 0xff;
29
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
30
+ }
31
+ h ^= h >>> 13;
32
+ h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
33
+ h ^= h >>> 15;
34
+ return h >>> 0;
35
+ };
36
+ //# sourceMappingURL=hash32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["murmurhash2_32_gc","str","seed","l","length","h","i","k","charCodeAt"],"sourceRoot":"../../../src","sources":["utils/hash32.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,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"}
@@ -1,6 +1,7 @@
1
1
  export { mq } from './mq';
2
- export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq } from './mqParser';
2
+ export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq, isUnistylesMq } from './mqParser';
3
3
  export { getValueForBreakpoint } from './breakpoints';
4
4
  export { proxifyFunction, parseStyle } from './styles';
5
5
  export { withPlugins } from './withPlugins';
6
+ export { generateReactNativeWebId } from './generateId';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","getValueForBreakpoint","proxifyFunction","parseStyle","withPlugins"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AACzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,QAAQ,YAAY;AACxG,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SAASC,WAAW,QAAQ,eAAe"}
1
+ {"version":3,"names":["mq","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","isUnistylesMq","getValueForBreakpoint","proxifyFunction","parseStyle","withPlugins","generateReactNativeWebId"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,QAAQ,MAAM;AAEzB,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,EAAEC,aAAa,QAAQ,YAAY;AACvH,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU;AACtD,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,wBAAwB,QAAQ,cAAc"}
@@ -15,7 +15,7 @@ export const parseMq = mq => {
15
15
  } : undefined
16
16
  };
17
17
  };
18
- const isUnistylesMq = mq => IS_UNISTYLES_REGEX.test(mq);
18
+ export const isUnistylesMq = mq => IS_UNISTYLES_REGEX.test(mq);
19
19
  export const isValidMq = parsedMq => {
20
20
  const {
21
21
  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","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,MAAM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OAAOC,yBAAyB,CAACD,QAAQ,EAAEE,UAAU,CAAC;EAC1D,CAAC,CAAC;EAEF,OAAOjB,EAAE,EAAE2B,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"}
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,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAYpE,OAAO,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,CAAC,GAAGI;EACR,CAAC;AACL,CAAC;AAED,OAAO,MAAMC,aAAa,GAAIZ,EAAU,IAAKJ,kBAAkB,CAACiB,IAAI,CAACb,EAAE,CAAC;AAExE,OAA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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,YAAsC,EAAEN,UAAsB,KAAuB;EAC9H,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"}
@@ -12,6 +12,7 @@ export const isPlatformColor = value => {
12
12
  };
13
13
  export const parseStyle = function (style) {
14
14
  let variant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15
+ let parseMediaQueries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
15
16
  return Object.entries(style || {}).reduce((acc, _ref) => {
16
17
  let [key, value] = _ref;
17
18
  // nested objects
@@ -36,10 +37,19 @@ export const parseStyle = function (style) {
36
37
  ...acc,
37
38
  ...Object.keys(value).reduce((acc, key) => ({
38
39
  ...acc,
39
- ...parseStyle(value[key][variant[key] || 'default'] ?? {})
40
+ // 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
41
+ ...parseStyle(value[key][variant[key] || 'default'] ?? value[key].default ?? {})
40
42
  }), {})
41
43
  };
42
44
  }
45
+
46
+ // don't parse media queries and breakpoints
47
+ if (!parseMediaQueries) {
48
+ return {
49
+ ...acc,
50
+ [key]: value
51
+ };
52
+ }
43
53
  return {
44
54
  ...acc,
45
55
  [key]: getValueForBreakpoint(value)
@@ -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","arguments","length","undefined","Object","entries","reduce","acc","_ref","Array","isArray","map","keys"],"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,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,GAAG,SAAAA,CACtBK,KAAQ;EAAA,IACRX,OAAyC,GAAAY,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAC1CG,MAAM,CACTC,OAAO,CAACL,KAAK,IAAI,CAAC,CAAC,CAAC,CACpBM,MAAM,CAAC,CAACC,GAAG,EAAAC,IAAA,KAAmB;IAAA,IAAjB,CAACrB,GAAG,EAAEU,KAAK,CAAC,GAAAW,IAAA;IACtB;IACA,IAAIrB,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAM,kBAAkB,EAAE;MACvDoB,GAAG,CAACpB,GAAG,CAAC,GAAGQ,UAAU,CAACE,KAAK,EAAER,OAAO,CAAC;MAErC,OAAOkB,GAAG;IACd;;IAEA;IACA,IAAIpB,GAAG,KAAK,WAAW,IAAIsB,KAAK,CAACC,OAAO,CAACb,KAAK,CAAC,EAAE;MAC7CU,GAAG,CAACpB,GAAG,CAAC,GAAGU,KAAK,CAACc,GAAG,CAACd,KAAK,IAAIF,UAAU,CAACE,KAAK,EAAER,OAAO,CAAC,CAAC;MAEzD,OAAOkB,GAAG;IACd;;IAEA;IACA,IAAI,OAAOV,KAAK,KAAK,QAAQ,IAAID,eAAe,CAACC,KAAK,CAAC,EAAE;MACrDU,GAAG,CAACpB,GAAG,CAAY,GAAGU,KAAK;MAE3B,OAAOU,GAAG;IACd;IAEA,IAAIpB,GAAG,KAAK,UAAU,EAAE;MACpB,OAAO;QACH,GAAGoB,GAAG;QACN,GAAIH,MAAM,CACLQ,IAAI,CAACf,KAAK,CAAC,CACXS,MAAM,CAAC,CAACC,GAAG,EAAEpB,GAAG,MAAM;UACnB,GAAGoB,GAAG;UACN,GAAGZ,UAAU,CAAEE,KAAK,CAAEV,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,GAAGoB,GAAG;MACN,CAACpB,GAAG,GAAGL,qBAAqB,CAACe,KAAgC;IACjE,CAAC;EACL,CAAC,EAAE,CAAC,CAAM,CAAC;AAAA"}
1
+ {"version":3,"names":["getValueForBreakpoint","isAndroid","isIOS","withPlugins","proxifyFunction","key","fn","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","isPlatformColor","value","semantic","resource_paths","style","arguments","length","undefined","parseMediaQueries","Object","entries","reduce","acc","_ref","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,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,GAAG,SAAAA,CACtBK,KAAQ;EAAA,IACRX,OAAyC,GAAAY,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,IAC9CG,iBAAiB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAAA,OACpBI,MAAM,CACTC,OAAO,CAACN,KAAK,IAAI,CAAC,CAAC,CAAC,CACpBO,MAAM,CAAC,CAACC,GAAG,EAAAC,IAAA,KAAmB;IAAA,IAAjB,CAACtB,GAAG,E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CAAC;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAItE,qBAAa,gBAAgB;IAUb,OAAO,CAAC,eAAe;IAT5B,MAAM,EAAE,eAAe,CAAK;IAC5B,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAE9B;IACD,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;sCAcL,oBAAoB;;gCAW9B,eAAe;;;;;4BAAf,eAAe;;;;MAb1C;IAEM,cAAc,gBAAiB,oBAAoB;4BAd9B,eAAe;;gCAyBf,eAAe;;;;;4BAAf,eAAe;;;;MAF1C;IAEM,SAAS,WAAY,eAAe;sCAXL,oBAAoB;gCAd9B,eAAe;;;;;;4BAAf,eAAe;;;;MA4C1C;IAEM,QAAQ,YAAa,MAAM,eAAe,WAchD;IAEM,SAAS,WAAY,eAAe,WAAU,OAAO,UAW3D;IAEM,YAAY,WAAY,eAAe,UAO7C;IAEM,QAAQ,SAAU,MAAM,eAAe,aAAwB;CACzE"}
1
+ {"version":3,"file":"UnistyleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistyleRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,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AO,qBAEjB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
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;;IAgBhC,IAAW,QAAQ,qBAElB;IAED,IAAW,OAAO,qBAEjB;CACJ;AAED,eAAO,MAAM,SAAS,WAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnistylesModule.web.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.web.ts"],"names":[],"mappings":"AAKA,qBAAa,kBAAkB;;;IAkBpB,OAAO;IA0Dd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,cAAc;IAOtB,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"}
1
+ {"version":3,"file":"UnistylesModule.web.d.ts","sourceRoot":"","sources":["../../../../src/core/UnistylesModule.web.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;;;IAuBpB,OAAO;IA6Dd,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"}