react-native-unistyles 2.0.0-alpha.13 → 2.0.0-alpha.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. package/cxx/UnistylesRuntime.h +6 -6
  2. package/lib/commonjs/common.js +15 -15
  3. package/lib/commonjs/common.js.map +1 -1
  4. package/lib/commonjs/core/UnistyleRegistry.js +3 -2
  5. package/lib/commonjs/core/UnistyleRegistry.js.map +1 -1
  6. package/lib/commonjs/core/UnistylesRuntime.js +1 -1
  7. package/lib/commonjs/core/UnistylesRuntime.js.map +1 -1
  8. package/lib/commonjs/createStyleSheet.js +1 -6
  9. package/lib/commonjs/createStyleSheet.js.map +1 -1
  10. package/lib/commonjs/hooks/index.js +7 -0
  11. package/lib/commonjs/hooks/index.js.map +1 -1
  12. package/lib/commonjs/hooks/useUnistyles.js +4 -7
  13. package/lib/commonjs/hooks/useUnistyles.js.map +1 -1
  14. package/lib/commonjs/hooks/useVariants.js +24 -0
  15. package/lib/commonjs/hooks/useVariants.js.map +1 -0
  16. package/lib/commonjs/plugins/normalizer/normalizer.js +1 -1
  17. package/lib/commonjs/plugins/normalizer/normalizer.js.map +1 -1
  18. package/lib/commonjs/plugins/withPlugins.js +2 -6
  19. package/lib/commonjs/plugins/withPlugins.js.map +1 -1
  20. package/lib/commonjs/types/stylesheet.js +6 -0
  21. package/lib/commonjs/types/stylesheet.js.map +1 -0
  22. package/lib/commonjs/useStyles.js +8 -11
  23. package/lib/commonjs/useStyles.js.map +1 -1
  24. package/lib/commonjs/utils/index.js +22 -5
  25. package/lib/commonjs/utils/index.js.map +1 -1
  26. package/lib/commonjs/utils/mq.js +42 -28
  27. package/lib/commonjs/utils/mq.js.map +1 -1
  28. package/lib/commonjs/utils/styles.js +19 -23
  29. package/lib/commonjs/utils/styles.js.map +1 -1
  30. package/lib/commonjs/utils/variants.js +43 -8
  31. package/lib/commonjs/utils/variants.js.map +1 -1
  32. package/lib/module/common.js +14 -14
  33. package/lib/module/common.js.map +1 -1
  34. package/lib/module/core/UnistyleRegistry.js +4 -3
  35. package/lib/module/core/UnistyleRegistry.js.map +1 -1
  36. package/lib/module/core/UnistylesRuntime.js +1 -1
  37. package/lib/module/core/UnistylesRuntime.js.map +1 -1
  38. package/lib/module/createStyleSheet.js +1 -6
  39. package/lib/module/createStyleSheet.js.map +1 -1
  40. package/lib/module/hooks/index.js +1 -0
  41. package/lib/module/hooks/index.js.map +1 -1
  42. package/lib/module/hooks/useUnistyles.js +5 -8
  43. package/lib/module/hooks/useUnistyles.js.map +1 -1
  44. package/lib/module/hooks/useVariants.js +17 -0
  45. package/lib/module/hooks/useVariants.js.map +1 -0
  46. package/lib/module/plugins/normalizer/normalizer.js +1 -1
  47. package/lib/module/plugins/normalizer/normalizer.js.map +1 -1
  48. package/lib/module/plugins/withPlugins.js +2 -6
  49. package/lib/module/plugins/withPlugins.js.map +1 -1
  50. package/lib/module/types/stylesheet.js +2 -0
  51. package/lib/module/types/stylesheet.js.map +1 -0
  52. package/lib/module/useStyles.js +9 -12
  53. package/lib/module/useStyles.js.map +1 -1
  54. package/lib/module/utils/index.js +1 -2
  55. package/lib/module/utils/index.js.map +1 -1
  56. package/lib/module/utils/mq.js +41 -27
  57. package/lib/module/utils/mq.js.map +1 -1
  58. package/lib/module/utils/styles.js +20 -24
  59. package/lib/module/utils/styles.js.map +1 -1
  60. package/lib/module/utils/variants.js +41 -6
  61. package/lib/module/utils/variants.js.map +1 -1
  62. package/lib/typescript/src/common.d.ts +10 -10
  63. package/lib/typescript/src/common.d.ts.map +1 -1
  64. package/lib/typescript/src/core/UnistyleRegistry.d.ts.map +1 -1
  65. package/lib/typescript/src/createStyleSheet.d.ts +2 -2
  66. package/lib/typescript/src/createStyleSheet.d.ts.map +1 -1
  67. package/lib/typescript/src/global.d.ts.map +1 -1
  68. package/lib/typescript/src/hooks/index.d.ts +1 -0
  69. package/lib/typescript/src/hooks/index.d.ts.map +1 -1
  70. package/lib/typescript/src/hooks/useUnistyles.d.ts.map +1 -1
  71. package/lib/typescript/src/hooks/useVariants.d.ts +3 -0
  72. package/lib/typescript/src/hooks/useVariants.d.ts.map +1 -0
  73. package/lib/typescript/src/plugins/normalizer/normalizer.d.ts.map +1 -1
  74. package/lib/typescript/src/plugins/withPlugins.d.ts +3 -2
  75. package/lib/typescript/src/plugins/withPlugins.d.ts.map +1 -1
  76. package/lib/typescript/src/types/breakpoints.d.ts +20 -14
  77. package/lib/typescript/src/types/breakpoints.d.ts.map +1 -1
  78. package/lib/typescript/src/types/core.d.ts +3 -26
  79. package/lib/typescript/src/types/core.d.ts.map +1 -1
  80. package/lib/typescript/src/types/index.d.ts +2 -1
  81. package/lib/typescript/src/types/index.d.ts.map +1 -1
  82. package/lib/typescript/src/types/mq.d.ts +2 -2
  83. package/lib/typescript/src/types/mq.d.ts.map +1 -1
  84. package/lib/typescript/src/types/stylesheet.d.ts +47 -0
  85. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -0
  86. package/lib/typescript/src/types/unistyles.d.ts +5 -6
  87. package/lib/typescript/src/types/unistyles.d.ts.map +1 -1
  88. package/lib/typescript/src/types/variants.d.ts +13 -7
  89. package/lib/typescript/src/types/variants.d.ts.map +1 -1
  90. package/lib/typescript/src/useStyles.d.ts +3 -3
  91. package/lib/typescript/src/useStyles.d.ts.map +1 -1
  92. package/lib/typescript/src/utils/index.d.ts +1 -2
  93. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  94. package/lib/typescript/src/utils/mq.d.ts +19 -13
  95. package/lib/typescript/src/utils/mq.d.ts.map +1 -1
  96. package/lib/typescript/src/utils/styles.d.ts +4 -4
  97. package/lib/typescript/src/utils/styles.d.ts.map +1 -1
  98. package/lib/typescript/src/utils/variants.d.ts +2 -2
  99. package/lib/typescript/src/utils/variants.d.ts.map +1 -1
  100. package/package.json +14 -14
  101. package/src/common.ts +10 -10
  102. package/src/core/UnistyleRegistry.ts +6 -3
  103. package/src/core/UnistylesRuntime.ts +1 -1
  104. package/src/createStyleSheet.ts +2 -8
  105. package/src/global.ts +1 -0
  106. package/src/hooks/index.ts +1 -0
  107. package/src/hooks/useUnistyles.ts +5 -8
  108. package/src/hooks/useVariants.ts +23 -0
  109. package/src/plugins/normalizer/normalizer.ts +3 -3
  110. package/src/plugins/withPlugins.ts +13 -15
  111. package/src/types/breakpoints.ts +47 -26
  112. package/src/types/core.ts +6 -42
  113. package/src/types/index.ts +1 -1
  114. package/src/types/mq.ts +2 -2
  115. package/src/types/stylesheet.ts +56 -0
  116. package/src/types/unistyles.ts +5 -6
  117. package/src/types/variants.ts +17 -9
  118. package/src/useStyles.ts +22 -16
  119. package/src/utils/index.ts +1 -2
  120. package/src/utils/mq.ts +56 -41
  121. package/src/utils/styles.ts +28 -45
  122. package/src/utils/variants.ts +55 -7
@@ -8,8 +8,8 @@ var _breakpoints = require("./breakpoints");
8
8
  var _common = require("../common");
9
9
  var _variants = require("./variants");
10
10
  var _plugins = require("../plugins");
11
- const proxifyFunction = (key, fn, breakpoint, screenSize, variant) => new Proxy(fn, {
12
- apply: (target, thisArg, argumentsList) => parseStyle(key, target.apply(thisArg, argumentsList), breakpoint, screenSize, variant)
11
+ const proxifyFunction = (key, fn, plugins, runtime, variant) => new Proxy(fn, {
12
+ apply: (target, thisArg, argumentsList) => parseStyle(key, target.apply(thisArg, argumentsList), plugins, runtime, variant)
13
13
  });
14
14
  exports.proxifyFunction = proxifyFunction;
15
15
  const isPlatformColor = value => {
@@ -19,36 +19,32 @@ const isPlatformColor = value => {
19
19
  return _common.isAndroid && 'resource_paths' in value && typeof value.resource_paths === 'object';
20
20
  };
21
21
  exports.isPlatformColor = isPlatformColor;
22
- const parseStyle = (key, style, breakpoint, screenSize, variant) => {
23
- const entries = Object.entries(style || {}).map(_ref => {
22
+ const parseStyle = (key, style, plugins, runtime, variant) => {
23
+ const entries = Object.entries((0, _variants.getStyleWithVariants)(style || {}, variant));
24
+ const parsedStyles = Object.fromEntries(entries.map(_ref => {
24
25
  let [key, value] = _ref;
25
- if (key !== 'variants') {
26
+ // dynamic functions
27
+ if (typeof value === 'function') {
26
28
  return [key, value];
27
29
  }
28
- const variantKey = (0, _variants.getKeyForVariant)(value, variant);
29
- if (!variantKey) {
30
- return undefined;
31
- }
32
- return Object.entries(value[variantKey]).flat();
33
- }).filter(Boolean);
34
- const parsedStyles = Object.fromEntries(entries.map(_ref2 => {
35
- let [key, value] = _ref2;
36
- const hasNestedProperties = key === 'shadowOffset' || key === 'textShadowOffset';
37
- if (hasNestedProperties) {
38
- return [key, parseStyle(key, value, breakpoint, screenSize, variant)];
30
+
31
+ // nested objects
32
+ if (key === 'shadowOffset' || key === 'textShadowOffset') {
33
+ return [key, parseStyle(key, value, plugins, runtime, variant)];
39
34
  }
40
- const isTransform = key === 'transform';
41
- if (isTransform && Array.isArray(value)) {
42
- return [key, value.map(value => parseStyle(key, value, breakpoint, screenSize, variant))];
35
+
36
+ // transforms
37
+ if (key === 'transform' && Array.isArray(value)) {
38
+ return [key, value.map(value => parseStyle(key, value, plugins, runtime, variant))];
43
39
  }
44
- const isDynamicFunction = typeof value === 'function';
45
- const isValidStyle = typeof value !== 'object' || isPlatformColor(value);
46
- if (isDynamicFunction || isValidStyle) {
40
+
41
+ // values or platform colors
42
+ if (typeof value !== 'object' || isPlatformColor(value)) {
47
43
  return [key, value];
48
44
  }
49
45
  return [key, (0, _breakpoints.getValueForBreakpoint)(value)];
50
46
  }));
51
- return (0, _plugins.withPlugins)(key, parsedStyles);
47
+ return (0, _plugins.withPlugins)(key, parsedStyles, plugins, runtime);
52
48
  };
53
49
  exports.parseStyle = parseStyle;
54
50
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_breakpoints","require","_common","_variants","_plugins","proxifyFunction","key","fn","breakpoint","screenSize","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","entries","Object","map","_ref","variantKey","getKeyForVariant","undefined","flat","filter","Boolean","parsedStyles","fromEntries","_ref2","hasNestedProperties","isTransform","Array","isArray","isDynamicFunction","isValidStyle","getValueForBreakpoint","withPlugins"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEO,MAAMI,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EAAEC,UAA+C,EAC7DC,UAAsB,EACtBC,OAAgB,KACL,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACV,GAAG,EAAEO,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,UAAU,EAAEC,UAAU,EAAEC,OAAO;AAC7F,CAAC,CAAC;AAAAO,OAAA,CAAAZ,eAAA,GAAAA,eAAA;AAEK,MAAMa,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIC,aAAK,EAAE;IACP,OAAO,UAAU,IAAID,KAAK,IAAI,OAAOA,KAAK,CAACE,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOC,iBAAS,IAAI,gBAAgB,IAAIH,KAAK,IAAI,OAAOA,KAAK,CAACI,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAAAN,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAEM,MAAMF,UAAU,GAAGA,CACtBV,GAAW,EACXkB,KAA2B,EAC3BhB,UAA+C,EAC/CC,UAAsB,EACtBC,OAAgB,KACZ;EACJ,MAAMe,OAAO,GAAIC,MAAM,CAClBD,OAAO,CAACD,KAAK,IAAI,CAAC,CAAC,CAAC,CACpBG,GAAG,CAACC,IAAA,IAAkB;IAAA,IAAjB,CAACtB,GAAG,EAAEa,KAAK,CAAC,GAAAS,IAAA;IACd,IAAItB,GAAG,KAAK,UAAU,EAAE;MACpB,OAAO,CAACA,GAAG,EAAE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zB,KAAoB,CAAC,CAC9C;EACL,CAAC,CACL,CAAM;EAEV,OAAO,IAAA0B,oBAAW,EAACvC,GAAG,EAAE6B,YAAY,CAAC;AACzC,CAAC;AAAAlB,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
1
+ {"version":3,"names":["_breakpoints","require","_common","_variants","_plugins","proxifyFunction","key","fn","plugins","runtime","variant","Proxy","apply","target","thisArg","argumentsList","parseStyle","exports","isPlatformColor","value","isIOS","semantic","isAndroid","resource_paths","style","entries","Object","getStyleWithVariants","parsedStyles","fromEntries","map","_ref","Array","isArray","getValueForBreakpoint","withPlugins"],"sourceRoot":"../../../src","sources":["utils/styles.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEO,MAAMI,eAAe,GAAGA,CAC3BC,GAAW,EACXC,EAAY,EACZC,OAA+B,EAC/BC,OAAyB,EACzBC,OAA0C,KAC/B,IAAIC,KAAK,CAACJ,EAAE,EAAE;EACzBK,KAAK,EAAEA,CAACC,MAAM,EAAEC,OAAO,EAAEC,aAAa,KAClCC,UAAU,CAACV,GAAG,EAAEO,MAAM,CAACD,KAAK,CAACE,OAAO,EAAEC,aAAa,CAAC,EAAEP,OAAO,EAAEC,OAAO,EAAEC,OAAO;AACvF,CAAC,CAAC;AAAAO,OAAA,CAAAZ,eAAA,GAAAA,eAAA;AAEK,MAAMa,eAAe,GAAkBC,KAAQ,IAAc;EAChE,IAAIC,aAAK,EAAE;IACP,OAAO,UAAU,IAAID,KAAK,IAAI,OAAOA,KAAK,CAACE,QAAQ,KAAK,QAAQ;EACpE;EAEA,OAAOC,iBAAS,IAAI,gBAAgB,IAAIH,KAAK,IAAI,OAAOA,KAAK,CAACI,cAAc,KAAK,QAAQ;AAC7F,CAAC;AAAAN,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAEM,MAA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AC;AAAAQ,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
@@ -3,15 +3,50 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getKeyForVariant = void 0;
7
- const getKeyForVariant = (value, variant) => {
8
- if (variant && variant in value) {
9
- return variant;
6
+ exports.getStyleWithVariants = void 0;
7
+ const getKeysForVariants = (value, variants) => {
8
+ // case for no specified variants by user, we should fallback to 'default'
9
+ if (!variants.length) {
10
+ return Object.entries(value).map(_ref => {
11
+ let [key, value] = _ref;
12
+ if ('default' in value) {
13
+ return [key, 'default'];
14
+ }
15
+ return undefined;
16
+ }).filter(Boolean);
10
17
  }
11
- if ('default' in value) {
12
- return 'default';
18
+ return variants.map(_ref2 => {
19
+ let [variantKey, variantValue] = _ref2;
20
+ const variantStyle = value[variantKey];
21
+ if (variantStyle && variantValue && variantValue in variantStyle) {
22
+ return [variantKey, variantValue];
23
+ }
24
+ if (variantStyle && 'default' in variantStyle) {
25
+ return [variantKey, 'default'];
26
+ }
27
+ return undefined;
28
+ }).filter(Boolean);
29
+ };
30
+ const getStyleWithVariants = (style, variantValues) => {
31
+ if (!('variants' in style)) {
32
+ return style;
13
33
  }
14
- return undefined;
34
+ const keys = getKeysForVariants(style.variants, Object.entries(variantValues || {}));
35
+ const variantsValues = keys.map(_ref3 => {
36
+ let [key, nestedKey] = _ref3;
37
+ return style.variants[key][nestedKey];
38
+ }).reduce((acc, styles) => ({
39
+ ...acc,
40
+ ...styles
41
+ }), {});
42
+ const {
43
+ variants,
44
+ ...otherStyles
45
+ } = style;
46
+ return {
47
+ ...otherStyles,
48
+ ...variantsValues
49
+ };
15
50
  };
16
- exports.getKeyForVariant = getKeyForVariant;
51
+ exports.getStyleWithVariants = getStyleWithVariants;
17
52
  //# sourceMappingURL=variants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getKeyForVariant","value","variant","undefined","exports"],"sourceRoot":"../../../src","sources":["utils/variants.ts"],"mappings":";;;;;;AAEO,MAAMA,gBAAgB,GAAGA,CAACC,KAAkB,EAAEC,OAAgB,KAAuB;EACxF,IAAIA,OAAO,IAAIA,OAAO,IAAID,KAAK,EAAE;IAC7B,OAAOC,OAAO;EAClB;EAEA,IAAI,SAAS,IAAID,KAAK,EAAE;IACpB,OAAO,SAAS;EACpB;EAEA,OAAOE,SAAS;AACpB,CAAC;AAAAC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["getKeysForVariants","value","variants","length","Object","entries","map","_ref","key","undefined","filter","Boolean","_ref2","variantKey","variantValue","variantStyle","getStyleWithVariants","style","variantValues","keys","variantsValues","_ref3","nestedKey","reduce","acc","styles","otherStyles","exports"],"sourceRoot":"../../../src","sources":["utils/variants.ts"],"mappings":";;;;;;AAEA,MAAMA,kBAAkB,GAAGA,CACvBC,KAAkC,EAClCC,QAA2C,KACjB;EAC1B;EACA,IAAI,CAACA,QAAQ,CAACC,MAAM,EAAE;IAClB,OAAOC,MAAM,CACRC,OAAO,CAACJ,KAAK,CAAC,CACdK,GAAG,CAACC,IAAA,IAAkB;MAAA,IAAjB,CAACC,GAAG,EAAEP,KAAK,CAAC,GAAAM,IAAA;MACd,IAAI,SAAS,IAAIN,KAAK,EAAE;QACpB,OAAO,CAACO,GAAG,EAAE,SAAS,CAAC;MAC3B;MAEA,OAAOC,SAAS;IACpB,CAAC,CAAC,CACDC,MAAM,CAACC,OAAO,CAAC;EACxB;EAEA,OAAOT,QAAQ,CACVI,GAAG,CAACM,KAAA,IAAgC;IAAA,IAA/B,CAACC,UAAU,EAAEC,YAAY,CAAC,GAAAF,KAAA;IAC5B,MAAMG,YAAY,GAAGd,KAAK,CAACY,UAAU,CAAC;IAEtC,IAAIE,YAAY,IAAID,YAAY,IAAIA,YAAY,IAAIC,YAAY,EAAE;MAC9D,OAAO,CAACF,UAAU,EAAEC,YAAY,CAAC;IACrC;IAEA,IAAIC,YAAY,IAAI,SAAS,IAAIA,YAAY,EAAE;MAC3C,OAAO,CAACF,UAAU,EAAE,SAAS,CAAC;IAClC;IAEA,OAAOJ,SAAS;EACpB,CAAC,CAAC,CACDC,MAAM,CAACC,OAAO,CAAC;AACxB,CAAC;AAEM,MAAMK,oBAAoB,GAAGA,CAChCC,KAAiB,EACjBC,aAAgD,KAC/C;EACD,IAAI,EAAE,UAAU,IAAID,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK;EAChB;EAEA,MAAME,IAAI,GAAGnB,kBAAkB,CAC3BiB,KAAK,CAACf,QAAQ,EACdE,MAAM,CAACC,OAAO,CAACa,aAAa,IAAI,CAAC,CAAC,CACtC,CAAC;EAED,MAAME,cAAc,GAAGD,IAAI,CACtBb,GAAG,CAACe,KAAA;IAAA,IAAC,CAACb,GAAG,EAAEc,SAAS,CAAC,GAAAD,KAAA;IAAA,OAAOJ,KAAK,CAACf,QAAQ,CAAiDM,GAAG,CAAC,CAAiCc,SAAS,CAAC;EAAA,EAAC,CAC3IC,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,MAAM;IAAE,GAAGD,GAAG;IAAE,GAAGC;EAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAEzD,MAAM;IAAEvB,QAAQ;IAAE,GAAGwB;EAAY,CAAC,GAAGT,KAAK;EAE1C,OAAO;IACH,GAAGS,WAAW;IACd,GAAGN;EACP,CAAC;AACL,CAAC;AAAAO,OAAA,CAAAX,oBAAA,GAAAA,oBAAA"}
@@ -11,22 +11,22 @@ export const ScreenOrientation = {
11
11
  Landscape: 'landscape',
12
12
  Portrait: 'portrait'
13
13
  };
14
- export let CxxUnistylesEventTypes = /*#__PURE__*/function (CxxUnistylesEventTypes) {
15
- CxxUnistylesEventTypes["Theme"] = "theme";
16
- CxxUnistylesEventTypes["Layout"] = "layout";
17
- CxxUnistylesEventTypes["Plugin"] = "plugin";
18
- return CxxUnistylesEventTypes;
14
+ export let UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
15
+ UnistylesEventType["Theme"] = "theme";
16
+ UnistylesEventType["Layout"] = "layout";
17
+ UnistylesEventType["Plugin"] = "plugin";
18
+ return UnistylesEventType;
19
19
  }({});
20
20
  export let UnistylesError = /*#__PURE__*/function (UnistylesError) {
21
- UnistylesError["RuntimeUnavailable"] = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE";
22
- UnistylesError["ThemeNotFound"] = "UNISTYLES_ERROR_THEME_NOT_FOUND";
23
- UnistylesError["ThemeNotRegistered"] = "UNISTYLES_ERROR_THEME_NOT_REGISTERED";
24
- UnistylesError["ThemesCannotBeEmpty"] = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY";
25
- UnistylesError["BreakpointsCannotBeEmpty"] = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY";
26
- UnistylesError["BreakpointsMustStartFromZero"] = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO";
27
- UnistylesError["InvalidPluginName"] = "UNISTYLES_ERROR_INVALID_PLUGIN_NAME";
28
- UnistylesError["DuplicatePluginName"] = "UNISTYLES_ERROR_DUPLICATE_PLUGIN_NAME";
29
- UnistylesError["CantRemoveInternalPlugin"] = "UNISTYLES_ERROR_CANT_REMOVE_INTERNAL_PLUGIN";
21
+ UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions.";
22
+ UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered.";
23
+ UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that is not registered.";
24
+ UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register an empty themes object.";
25
+ UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register an empty breakpoints object.";
26
+ UnistylesError["BreakpointsMustStartFromZero"] = "One breakpoint must start from 0.";
27
+ UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix. Use another name.";
28
+ UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered.";
29
+ UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin.";
30
30
  return UnistylesError;
31
31
  }({});
32
32
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","warn","message","console","isMobile","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","CxxUnistylesEventTypes","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAME,QAAQ,GAAGJ,QAAQ,CAACK,EAAE,KAAK,SAAS,IAAIL,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1E,OAAO,MAAMC,KAAK,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,KAAK,GAAGP,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMG,SAAS,GAAGR,QAAQ,CAACK,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMI,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAEV,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAMlC,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
1
+ {"version":3,"names":["Platform","warn","message","console","isMobile","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","UnistylesEventType","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAME,QAAQ,GAAGJ,QAAQ,CAACK,EAAE,KAAK,SAAS,IAAIL,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1E,OAAO,MAAMC,KAAK,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAME,KAAK,GAAGP,QAAQ,CAACK,EAAE,KAAK,KAAK;AAC1C,OAAO,MAAMG,SAAS,GAAGR,QAAQ,CAACK,EAAE,KAAK,SAAS;AAClD,OAAO,MAAMI,QAAQ,GAAG,OAAOC,MAAM,KAAK,WAAW;AAErD,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAEV,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAM9B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
@@ -1,7 +1,8 @@
1
- import { UnistylesError } from '../common';
1
+ import { isWeb, UnistylesError } from '../common';
2
+ import { normalizeWebStylesPlugin } from '../plugins';
2
3
  export class UnistyleRegistry {
3
4
  config = {};
4
- plugins = [];
5
+ plugins = isWeb ? [normalizeWebStylesPlugin] : [];
5
6
  themeNames = [];
6
7
  themes = {};
7
8
  breakpoints = {};
@@ -58,7 +59,7 @@ export class UnistyleRegistry {
58
59
  })) {
59
60
  throw new Error(UnistylesError.DuplicatePluginName);
60
61
  }
61
- _this.plugins = _this.plugins.concat([plugin]);
62
+ _this.plugins = [plugin].concat(_this.plugins);
62
63
  _this.unistylesBridge.addPlugin(plugin.name, notify);
63
64
  };
64
65
  })();
@@ -1 +1 @@
1
- {"version":3,"names":["UnistylesError","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","useBreakpoints","addConfig","adaptiveThemes","useAdaptiveThemes","experimentalPlugins","forEach","plugin","addPlugin","initialTheme","useTheme","getTheme","forName","length","hasTheme","Error","ThemeNotFound","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":"AAEA,SAASA,cAAc,QAAQ,WAAW;AAE1C,OAAO,MAAMC,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2B,EAAE;EACpCC,UAAU,GAAiC,EAAE;EAC7CC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,WAAW,GAAyB,CAAC,CAAC;EACtCC,qBAAqB,GAA0F,EAAE;EAExHC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEhDC,SAAS,GAAIL,MAAuB,IAAK;IAC5C,IAAI,CAACA,MAAM,GAAGA,MAAM;IAEpB,MAAMM,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACN,MAAM,CAAiC;IAEhE,IAAI,CAACI,eAAe,CAACJ,MAAM,GAAGM,IAAI;IAClC,IAAI,CAACP,UAAU,GAAGO,IAAI;IAEtB,OAAO,IAAI;EACf,CAAC;EAEME,cAAc,GAAIP,WAAiC,IAAK;IAC3D,IAAI,CAACA,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACG,eAAe,CAACK,cAA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CAAC3B,OAAO,CAACkC,IAAI,CAACC,IAAA;QAAA,IAAC;UAAEJ;QAAK,CAAC,GAAAI,IAAA;QAAA,OAAKJ,IAAI,KAAKd,MAAM,CAACc,IAAI;MAAA,EAAC,EAAE;QACvD,MAAM,IAAIN,KAAK,CAAC5B,cAAc,CAACuC,mBAAmB,CAAC;MACvD;MAEAT,KAAI,CAAC3B,OAAO,GAAG2B,KAAI,CAAC3B,OAAO,CAACqC,MAAM,CAAC,CAACpB,MAAM,CAAC,CAAC;MAC5CU,KAAI,CAACrB,eAAe,CAACY,SAAS,CAACD,MAAM,CAACc,IAAI,EAAEH,MAAM,CAAC;IACvD,CAAC;EAAA;EAEMU,YAAY,GAAIrB,MAAuB,IAAK;IAC/C,IAAIA,MAAM,CAACc,IAAI,CAACC,UAAU,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIP,KAAK,CAAC5B,cAAc,CAAC0C,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAACvC,OAAO,GAAG,IAAI,CAACA,OAAO,CAACwC,MAAM,CAACC,KAAA;MAAA,IAAC;QAAEV;MAAK,CAAC,GAAAU,KAAA;MAAA,OAAKV,IAAI,KAAKd,MAAM,CAACc,IAAI;IAAA,EAAC;IACtE,IAAI,CAACzB,eAAe,CAACgC,YAAY,CAACrB,MAAM,CAACc,IAAI,CAAC;EAClD,CAAC;EAEMP,QAAQ,GAAIO,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAAC7B,MAAM;AAC1E"}
1
+ {"version":3,"names":["isWeb","UnistylesError","normalizeWebStylesPlugin","UnistyleRegistry","config","plugins","themeNames","themes","breakpoints","sortedBreakpointPairs","constructor","unistylesBridge","addThemes","keys","Object","addBreakpoints","useBreakpoints","addConfig","adaptiveThemes","useAdaptiveThemes","experimentalPlugins","forEach","plugin","addPlugin","initialTheme","useTheme","getTheme","forName","length","hasTheme","Error","ThemeNotFound","_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,CAAC,CAAC;EACtCC,qBAAqB,GAA0F,EAAE;EAExHC,WAAWA,CAASC,eAAgC,EAAE;IAAA,KAAlCA,eAAgC,GAAhCA,eAAgC;EAAG;EAEhDC,SAAS,GAAIL,MAAuB,IAAK;IAC5C,IAAI,CAACA,MAAM,GAAGA,MAAM;IAEpB,MAAMM,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACN,MAAM,CAAiC;IAEhE,IAAI,CAACI,eAAe,CAACJ,MAAM,GAAGM,IAAI;IAClC,IAAI,CAACP,UAAU,GAAGO,IAAI;IAEtB,OAAO,IAAI;EACf,CAAC;EAEME,cAAc,GAAIP,WAAiC,IAAK;IAC3D,IAAI,CAACA,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACG,eAAe,CAACK,cAAc,CAACR,WAAW,CAAC;IAChD,IAAI,CAACC,qBAAqB,GAAG,IAAI,CAACE,eAAe,CAACF,qBAAqB;IAEvE,OAAO,IAAI;EACf,CAAC;EAEMQ,SAAS,GAAIb,MAAuB,IAAK;IAC5C,IAAI,CAACA,MAAM,GAAGA,MAAM;IAEpB,IAAIA,MAAM,CAACc,cAAc,EAAE;MACvB,IAAI,CAACP,eAAe,CAACQ,iBAAiB,CAACf,MAAM,CAACc,cAAc,CAAC;IACjE;IAEA,IAAId,MAAM,CAACgB,mBAAmB,EAAE;MAC5BhB,MAAM,CAACgB,mBA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AACc,IAAI,EAAEH,MAAM,CAAC;IACvD,CAAC;EAAA;EAEMU,YAAY,GAAIrB,MAAuB,IAAK;IAC/C,IAAIA,MAAM,CAACc,IAAI,CAACC,UAAU,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIP,KAAK,CAAC7B,cAAc,CAAC2C,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAACvC,OAAO,GAAG,IAAI,CAACA,OAAO,CAACwC,MAAM,CAACC,KAAA;MAAA,IAAC;QAAEV;MAAK,CAAC,GAAAU,KAAA;MAAA,OAAKV,IAAI,KAAKd,MAAM,CAACc,IAAI;IAAA,EAAC;IACtE,IAAI,CAACzB,eAAe,CAACgC,YAAY,CAACrB,MAAM,CAACc,IAAI,CAAC;EAClD,CAAC;EAEMP,QAAQ,GAAIO,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAAC7B,MAAM;AAC1E"}
@@ -36,7 +36,7 @@ export class UnistylesRuntime {
36
36
  return ScreenOrientation.Portrait;
37
37
  }
38
38
  setTheme = name => {
39
- if (this.unistylesRegistry.hasTheme(name)) {
39
+ if (name !== this.themeName && this.unistylesRegistry.hasTheme(name)) {
40
40
  this.unistylesBridge.useTheme(name);
41
41
  return true;
42
42
  }
@@ -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,GAAh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C,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","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,IAAI,IAAI,CAACH,iBAAiB,CAACgB,QAAQ,CAACD,IAAI,CAAC,EAAE;MAClE,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,7 +1,2 @@
1
- export const createStyleSheet = styles => {
2
- if (typeof styles === 'function') {
3
- return styles;
4
- }
5
- return styles;
6
- };
1
+ export const createStyleSheet = stylesheet => stylesheet;
7
2
  //# sourceMappingURL=createStyleSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStyleSheet","styles"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,GAAUC,MAA4F,IAAY;EAC3I,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAC9B,OAAOA,MAAM;EACjB;EAEA,OAAOA,MAAM;AACjB,CAAC"}
1
+ {"version":3,"names":["createStyleSheet","stylesheet"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,GAAyCC,UAAa,IAAQA,UAAU"}
@@ -1,3 +1,4 @@
1
1
  export { useInitialTheme } from './useInitialTheme';
2
2
  export { useUnistyles } from './useUnistyles';
3
+ export { useVariants } from './useVariants';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useInitialTheme","useUnistyles"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,YAAY,QAAQ,gBAAgB"}
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,7 +1,7 @@
1
1
  import { NativeEventEmitter, NativeModules } from 'react-native';
2
2
  import { useEffect, useState } from 'react';
3
3
  import { unistyles } from '../core';
4
- import { CxxUnistylesEventTypes } from '../common';
4
+ import { UnistylesEventType } from '../common';
5
5
  const unistylesEvents = new NativeEventEmitter(NativeModules.Unistyles);
6
6
  export const useUnistyles = () => {
7
7
  const [plugins, setPlugins] = useState(unistyles.runtime.enabledPlugins);
@@ -17,24 +17,21 @@ export const useUnistyles = () => {
17
17
  useEffect(() => {
18
18
  const subscription = unistylesEvents.addListener('onChange', event => {
19
19
  switch (event.type) {
20
- case CxxUnistylesEventTypes.Theme:
20
+ case UnistylesEventType.Theme:
21
21
  {
22
22
  const themeEvent = event;
23
23
  return setTheme(unistyles.registry.getTheme(themeEvent.payload.themeName));
24
24
  }
25
- case CxxUnistylesEventTypes.Layout:
25
+ case UnistylesEventType.Layout:
26
26
  {
27
27
  const layoutEvent = event;
28
28
  return setLayout({
29
29
  breakpoint: layoutEvent.payload.breakpoint,
30
30
  orientation: layoutEvent.payload.orientation,
31
- screenSize: {
32
- width: layoutEvent.payload.screen.width,
33
- height: layoutEvent.payload.screen.height
34
- }
31
+ screenSize: layoutEvent.payload.screen
35
32
  });
36
33
  }
37
- case CxxUnistylesEventTypes.Plugin:
34
+ case UnistylesEventType.Plugin:
38
35
  {
39
36
  return setPlugins(unistyles.runtime.enabledPlugins);
40
37
  }
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","CxxUnistylesEventTypes","unistylesEvents","Unistyles","useUnistyles","plugins","setPlugins","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","subscription","addListener","event","type","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,sBAAsB,QAAQ,WAAW;AAGlD,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAACC,SAAS,CAACO,OAAO,CAACC,cAAc,CAAC;EACxE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGX,QAAQ,CAACC,SAAS,CAACW,QAAQ,CAACC,QAAQ,CAACZ,SAAS,CAACO,OAAO,CAACM,SAAS,CAAC,CAAC;EAC5F,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGhB,QAAQ,CAAC;IACjCiB,UAAU,EAAEhB,SAAS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["NativeEventEmitter","NativeModules","useEffect","useState","unistyles","UnistylesEventType","unistylesEvents","Unistyles","useUnistyles","plugins","setPlugins","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","subscription","addListener","event","type","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAChE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,kBAAkB,QAAQ,WAAW;AAG9C,MAAMC,eAAe,GAAG,IAAIN,kBAAkB,CAACC,aAAa,CAACM,SAAS,CAAC;AAEvE,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAACC,SAAS,CAACO,OAAO,CAACC,cAAc,CAAC;EACxE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGX,QAAQ,CAACC,SAAS,CAACW,QAAQ,CAACC,QAAQ,CAACZ,SAAS,CAACO,OAAO,CAACM,SAAS,CAAC,CAAC;EAC5F,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGhB,QAAQ,CAAC;IACjCiB,UAAU,EAAEhB,SAAS,CAACO,OAAO,CAACS,UAAU;IACxCC,WAAW,EAAEjB,SAAS,CAACO,OAAO,CAACU,WAAW;IAC1CC,UAAU,EAAE;MACRC,KAAK,EAAEnB,SAAS,CAACO,OAAO,CAACa,MAAM,CAACD,KAAK;MACrCE,MAAM,EAAErB,SAAS,CAACO,OAAO,CAACa,MAAM,CAACC;IACrC;EACJ,CAAC,CAAC;EAEFvB,SAAS,CAAC,MAAM;IACZ,MAAMwB,YAAY,GAAGpB,eAAe,CAACqB,WAAW,CAC5C,UAAU,EACTC,KAAsB,IAAK;MACxB,QAAQA,KAAK,CAACC,IAAI;QACd,KAAKxB,kBAAkB,CAACyB,KAAK;UAAE;YAC3B,MAAMC,UAAU,GAAGH,KAA4B;YAE/C,OAAOd,QAAQ,CAACV,SAAS,CAACW,QAAQ,CAACC,QAAQ,CAACe,UAAU,CAACC,OAAO,CAACf,SAAS,CAAC,CAAC;UAC9E;QACA,KAAKZ,kBAAkB,CAAC4B,MAAM;UAAE;YAC5B,MAAMC,WAAW,GAAGN,KAAmC;YAEvD,OAAOT,SAAS,CAAC;cACbC,UAAU,EAAEc,WAAW,CAACF,OAAO,CAACZ,UAAU;cAC1CC,WAAW,EAAEa,WAAW,CAACF,OAAO,CAACX,WAAW;cAC5CC,UAAU,EAAEY,WAAW,CAACF,OAAO,CAACR;YACpC,CAAC,CAAC;UACN;QACA,KAAKnB,kBAAkB,CAAC8B,MAAM;UAAE;YAC5B,OAAOzB,UAAU,CAACN,SAAS,CAACO,OAAO,CAACC,cAAc,CAAC;UACvD;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOc,YAAY,CAACU,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH3B,OAAO;IACPI,KAAK;IACLK;EACJ,CAAC;AACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { useRef } from 'react';
2
+ const compareVariants = (prevVariants, nextVariants) => {
3
+ const keysA = Object.keys(prevVariants ?? {});
4
+ const keysB = Object.keys(nextVariants ?? {});
5
+ if (keysA.length !== keysB.length) {
6
+ return false;
7
+ }
8
+ return keysA.every(key => prevVariants[key] === (nextVariants ?? {})[key]);
9
+ };
10
+ export const useVariants = variantsMap => {
11
+ const variantsRef = useRef(variantsMap);
12
+ if (!compareVariants(variantsRef.current, variantsMap)) {
13
+ variantsRef.current = variantsMap;
14
+ }
15
+ return variantsRef.current;
16
+ };
17
+ //# sourceMappingURL=useVariants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRef","compareVariants","prevVariants","nextVariants","keysA","Object","keys","keysB","length","every","key","useVariants","variantsMap","variantsRef","current"],"sourceRoot":"../../../src","sources":["hooks/useVariants.ts"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAG9B,MAAMC,eAAe,GAAGA,CAACC,YAA+C,EAAEC,YAA+C,KAAK;EAC1H,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,YAAY,IAAI,CAAC,CAAC,CAAC;EAC7C,MAAMK,KAAK,GAAGF,MAAM,CAACC,IAAI,CAACH,YAAY,IAAI,CAAC,CAAC,CAAC;EAE7C,IAAIC,KAAK,CAACI,MAAM,KAAKD,KAAK,CAACC,MAAM,EAAE;IAC/B,OAAO,KAAK;EAChB;EAEA,OAAOJ,KAAK,CAACK,KAAK,CAACC,GAAG,IAAIR,YAAY,CAAEQ,GAAG,CAAC,KAAK,CAACP,YAAY,IAAI,CAAC,CAAC,EAAEO,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED,OAAO,MAAMC,WAAW,GAAIC,WAA8C,IAAK;EAC3E,MAAMC,WAAW,GAAGb,MAAM,CAA6CY,WAAW,CAAC;EAEnF,IAAI,CAACX,eAAe,CAACY,WAAW,CAACC,OAAO,EAAEF,WAAW,CAAC,EAAE;IACpDC,WAAW,CAACC,OAAO,GAAGF,WAAW;EACrC;EAEA,OAAOC,WAAW,CAACC,OAAO;AAC9B,CAAC"}
@@ -9,7 +9,7 @@ export const normalizeColor = function (color) {
9
9
  }
10
10
  const integer = normalizeColors(color);
11
11
 
12
- // If the colour is an unknown format, the return value is null
12
+ // If the color is an unknown format, the return value is null
13
13
  if (integer === null) {
14
14
  return color;
15
15
  }
@@ -1 +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":["plugins/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,CAAkB;;EAEvD;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,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC;IAE/B,OAAQ,QAAOT,CAAE,IAAGC,CAAE,IAAGC,CAAE,IAAKC,CAAC,GAAc,GAAG,GAAIX,OAAQ,GAAE;EACpE;EAEA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAMoB,qBAAqB,GAAIC,KAAa,IAAKA,KAAK,GAAI,GAAEA,KAAM,IAAG,GAAGA,KAAK;AACpF,MAAMC,kBAAkB,GAAG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D3B,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"}
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":["plugins/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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AAG,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"}
@@ -1,10 +1,6 @@
1
- import { normalizeWebStylesPlugin } from './normalizeWebStylesPlugin';
2
- import { isWeb } from '../common';
3
- import { unistyles } from '../core';
4
- const UNISTYLES_PLUGINS = isWeb ? [normalizeWebStylesPlugin] : [];
5
- export const withPlugins = (key, style) => unistyles.registry.plugins.concat(UNISTYLES_PLUGINS).reduce((acc, plugin) => {
1
+ export const withPlugins = (key, style, plugins, runtime) => plugins.reduce((acc, plugin) => {
6
2
  if (plugin.onParsedStyle) {
7
- return plugin.onParsedStyle(key, acc, unistyles.runtime);
3
+ return plugin.onParsedStyle(key, acc, runtime);
8
4
  }
9
5
  return acc;
10
6
  }, style);
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeWebStylesPlugin","isWeb","unistyles","UNISTYLES_PLUGINS","withPlugins","key","style","registry","plugins","concat","reduce","acc","plugin","onParsedStyle","runtime"],"sourceRoot":"../../../src","sources":["plugins/withPlugins.ts"],"mappings":"AACA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,SAAS,QAAQ,SAAS;AAEnC,MAAMC,iBAAiB,GAAGF,KAAK,GACzB,CAACD,wBAAwB,CAAC,GAC1B,EAAE;AAER,OAAO,MAAMI,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAc,KAAKJ,SAAS,CAACK,QAAQ,CAACC,OAAO,CAACC,MAAM,CAACN,iBAAiB,CAAC,CAC3GO,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;EACrB,IAAIA,MAAM,CAACC,aAAa,EAAE;IACtB,OAAOD,MAAM,CAACC,aAAa,CAACR,GAAG,EAAEM,GAAG,EAAET,SAAS,CAACY,OAAO,CAAC;EAC5D;EAEA,OAAOH,GAAG;AACd,CAAC,EAAEL,KAAK,CAAC"}
1
+ {"version":3,"names":["withPlugins","key","style","plugins","runtime","reduce","acc","plugin","onParsedStyle"],"sourceRoot":"../../../src","sources":["plugins/withPlugins.ts"],"mappings":"AAGA,OAAO,MAAMA,WAAW,GAAGA,CACvBC,GAAW,EACXC,KAAc,EACdC,OAA+B,EAC/BC,OAAyB,KACxBD,OAAO,CAACE,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;EACjC,IAAIA,MAAM,CAACC,aAAa,EAAE;IACtB,OAAOD,MAAM,CAACC,aAAa,CAACP,GAAG,EAAEK,GAAG,EAAEF,OAAO,CAAC;EAClD;EAEA,OAAOE,GAAG;AACd,CAAC,EAAEJ,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stylesheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":""}
@@ -1,42 +1,39 @@
1
1
  import { useMemo } from 'react';
2
2
  import { StyleSheet } from 'react-native';
3
3
  import { parseStyle, proxifyFunction } from './utils';
4
- import { useUnistyles } from './hooks';
5
- export const useStyles = (stylesheet, variant) => {
4
+ import { useUnistyles, useVariants } from './hooks';
5
+ import { unistyles } from './core';
6
+ export const useStyles = (stylesheet, variantsMap) => {
6
7
  const {
7
8
  theme,
8
9
  layout,
9
10
  plugins
10
11
  } = useUnistyles();
11
- const {
12
- screenSize,
13
- breakpoint
14
- } = layout;
15
12
  if (!stylesheet) {
16
13
  return {
17
14
  theme,
18
- breakpoint,
15
+ breakpoint: layout.breakpoint,
19
16
  styles: {}
20
17
  };
21
18
  }
19
+ const variants = useVariants(variantsMap);
22
20
  const parsedStyles = useMemo(() => typeof stylesheet === 'function' ? stylesheet(theme) : stylesheet, [theme, stylesheet, layout]);
23
21
  const dynamicStyleSheet = useMemo(() => Object.entries(parsedStyles).reduce((acc, _ref) => {
24
22
  let [key, value] = _ref;
25
- const style = value;
26
23
  if (typeof value === 'function') {
27
24
  return {
28
25
  ...acc,
29
- [key]: proxifyFunction(key, value, breakpoint, screenSize, variant)
26
+ [key]: proxifyFunction(key, value, unistyles.registry.plugins, unistyles.runtime, variants)
30
27
  };
31
28
  }
32
29
  return StyleSheet.create({
33
30
  ...acc,
34
- [key]: parseStyle(key, style, breakpoint, screenSize, variant)
31
+ [key]: parseStyle(key, value, unistyles.registry.plugins, unistyles.runtime, variants)
35
32
  });
36
- }, {}), [breakpoint, screenSize, parsedStyles, variant, plugins]);
33
+ }, {}), [layout, parsedStyles, variants, plugins]);
37
34
  return {
38
35
  theme,
39
- breakpoint,
36
+ breakpoint: layout.breakpoint,
40
37
  styles: dynamicStyleSheet
41
38
  };
42
39
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","useUnistyles","useStyles","stylesheet","variant","theme","layout","plugins","screenSize","breakpoint","styles","parsedStyles","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","style","create"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,QAAQ,SAAS;AAQrD,SAASC,YAAY,QAAQ,SAAS;AAStC,OAAO,MAAMC,SAAS,GAAGA,CACrBC,UAAyD,EACzDC,OAAyD,KAClC;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGN,YAAY,CAAC,CAAC;EACjD,MAAM;IAAEO,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAEzC,IAAI,CAACH,UAAU,EAAE;IACb,OAAO;MACHE,KAAK;MACLI,UAAU;MACVC,MAAM,EAAE,CAAC;IACb,CAAC;EACL;EAEA,MAAMC,YAAY,GAAGd,OAAO,CAAC,MAAM,OAAOM,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,CAAC,GACjBF,UAAU,EAAE,CAACE,KAAK,EAAEF,UAAU,EAAEG,MAAM,CAAC,CAAC;EAE9C,MAAMM,iBAAiB,GAAGf,OAAO,CAAC,MAAMgB,MAAM,CACzCC,OAAO,CAACH,YAAY,CAAC,CACrBI,MAAM,CAAC,CAACC,GAAG,EAAAC,IAAA,KAAmB;IAAA,IAAjB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IACtB,MAAMG,KAAK,GAAGD,KAA8B;IAE5C,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;MAC7B,OAAO;QACH,GAAGH,GAAG;QACN,CAACE,GAAG,GAAGlB,eAAe,CAACkB,GAAG,EAAEC,KAAK,EAAEV,UAAU,EAAED,UAAU,EAAEJ,OAAO;MACtE,CAAC;IACL;IAEA,OAAON,UAAU,CAACuB,MAAM,CAAC;MACrB,GAAGL,GAAG;MACN,CAACE,GAAG,GAAGnB,UAAU,CAAKmB,GAAG,EAAEE,KAAK,EAAEX,UAAU,EAAED,UAAU,EAAEJ,OAAO;IACrE,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAO,CAAC,EAAE,CAACK,UAAU,EAAED,UAAU,EAAEG,YAAY,EAAEP,OAAO,EAAEG,OAAO,CAAC,CAA8B;EAExG,OAAO;IACHF,KAAK;IACLI,UAAU;IACVC,MAAM,EAAEE;EACZ,CAAC;AACL,CAAC"}
1
+ {"version":3,"names":["useMemo","StyleSheet","parseStyle","proxifyFunction","useUnistyles","useVariants","unistyles","useStyles","stylesheet","variantsMap","theme","layout","plugins","breakpoint","styles","variants","parsedStyles","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","registry","runtime","create"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,EAAEC,eAAe,QA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AAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EACV,CAACJ,MAAM,EAAEK,YAAY,EAAED,QAAQ,EAAEH,OAAO,CACxC,CAA8B;EAE9B,OAAO;IACHF,KAAK;IACLG,UAAU,EAAEF,MAAM,CAACE,UAAU;IAC7BC,MAAM,EAAEG;EACZ,CAAC;AACL,CAAC"}
@@ -1,5 +1,4 @@
1
- export { mq, MQSymbol } from './mq';
2
- export { getKeyForVariant } from './variants';
1
+ export { mq, MQSymbol, MQHeight, MQWidth, MQHeightAndWidth, MQWidthAndHeight } from './mq';
3
2
  export { getKeyForUnistylesMediaQuery, isWithinTheWidthAndHeight, isValidMq, parseMq } from './mqParser';
4
3
  export { getValueForBreakpoint } from './breakpoints';
5
4
  export { proxifyFunction, parseStyle } from './styles';
@@ -1 +1 @@
1
- {"version":3,"names":["mq","MQSymbol","getKeyForVariant","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","getValueForBreakpoint","proxifyFunction","parseStyle"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,EAAEC,QAAQ,QAAQ,MAAM;AACnC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,QAAQ,YAAY;AACxG,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU"}
1
+ {"version":3,"names":["mq","MQSymbol","MQHeight","MQWidth","MQHeightAndWidth","MQWidthAndHeight","getKeyForUnistylesMediaQuery","isWithinTheWidthAndHeight","isValidMq","parseMq","getValueForBreakpoint","proxifyFunction","parseStyle"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"AAAA,SAASA,EAAE,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,MAAM;AAC1F,SAASC,4BAA4B,EAAEC,yBAAyB,EAAEC,SAAS,EAAEC,OAAO,QAAQ,YAAY;AACxG,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SAASC,eAAe,EAAEC,UAAU,QAAQ,UAAU"}