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
@@ -12,9 +12,9 @@ const std::string UnistylesDarkScheme = "dark";
12
12
  const std::string UnistylesLightScheme = "light";
13
13
  const std::string UnistylesUnspecifiedScheme = "unspecified";
14
14
 
15
- const std::string UnistylesErrorBreakpointsCannotBeEmpty = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY'";
16
- const std::string UnistylesErrorBreakpointsMustStartFromZero = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZER0";
17
- const std::string UnistylesErrorThemesCannotBeEmpty = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY";
15
+ const std::string UnistylesErrorBreakpointsCannotBeEmpty = "You are trying to register an empty breakpoints object.";
16
+ const std::string UnistylesErrorBreakpointsMustStartFromZero = "One breakpoint must start from 0.";
17
+ const std::string UnistylesErrorThemesCannotBeEmpty = "You are trying to register an empty themes object.";
18
18
 
19
19
  class JSI_EXPORT UnistylesRuntime : public jsi::HostObject {
20
20
  private:
@@ -41,15 +41,15 @@ public:
41
41
  std::vector<std::string> pluginNames;
42
42
  std::vector<std::string> themes;
43
43
  std::vector<std::pair<std::string, double>> sortedBreakpointPairs;
44
-
44
+
45
45
  void onThemeChange(std::function<void(std::string)> callback) {
46
46
  this->onThemeChangeCallback = callback;
47
47
  }
48
-
48
+
49
49
  void onLayoutChange(std::function<void(std::string breakpoint, std::string orientation, int screenWidth, int screenHeight)> callback) {
50
50
  this->onLayoutChangeCallback = callback;
51
51
  }
52
-
52
+
53
53
  void onPluginChange(std::function<void()> callback) {
54
54
  this->onPluginChangeCallback = callback;
55
55
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.warn = exports.isWeb = exports.isServer = exports.isMobile = exports.isIOS = exports.isAndroid = exports.UnistylesError = exports.ScreenOrientation = exports.CxxUnistylesEventTypes = void 0;
6
+ exports.warn = exports.isWeb = exports.isServer = exports.isMobile = exports.isIOS = exports.isAndroid = exports.UnistylesEventType = exports.UnistylesError = exports.ScreenOrientation = void 0;
7
7
  var _reactNative = require("react-native");
8
8
  const warn = message => {
9
9
  console.warn(`🦄 [react-native-unistyles]: ${message}`);
@@ -18,22 +18,22 @@ const ScreenOrientation = exports.ScreenOrientation = {
18
18
  Landscape: 'landscape',
19
19
  Portrait: 'portrait'
20
20
  };
21
- let CxxUnistylesEventTypes = exports.CxxUnistylesEventTypes = /*#__PURE__*/function (CxxUnistylesEventTypes) {
22
- CxxUnistylesEventTypes["Theme"] = "theme";
23
- CxxUnistylesEventTypes["Layout"] = "layout";
24
- CxxUnistylesEventTypes["Plugin"] = "plugin";
25
- return CxxUnistylesEventTypes;
21
+ let UnistylesEventType = exports.UnistylesEventType = /*#__PURE__*/function (UnistylesEventType) {
22
+ UnistylesEventType["Theme"] = "theme";
23
+ UnistylesEventType["Layout"] = "layout";
24
+ UnistylesEventType["Plugin"] = "plugin";
25
+ return UnistylesEventType;
26
26
  }({});
27
27
  let UnistylesError = exports.UnistylesError = /*#__PURE__*/function (UnistylesError) {
28
- UnistylesError["RuntimeUnavailable"] = "UNISTYLES_ERROR_RUNTIME_UNAVAILABLE";
29
- UnistylesError["ThemeNotFound"] = "UNISTYLES_ERROR_THEME_NOT_FOUND";
30
- UnistylesError["ThemeNotRegistered"] = "UNISTYLES_ERROR_THEME_NOT_REGISTERED";
31
- UnistylesError["ThemesCannotBeEmpty"] = "UNISTYLES_ERROR_THEMES_CANNOT_BE_EMPTY";
32
- UnistylesError["BreakpointsCannotBeEmpty"] = "UNISTYLES_ERROR_BREAKPOINTS_CANNOT_BE_EMPTY";
33
- UnistylesError["BreakpointsMustStartFromZero"] = "UNISTYLES_ERROR_BREAKPOINTS_MUST_START_FROM_ZERO";
34
- UnistylesError["InvalidPluginName"] = "UNISTYLES_ERROR_INVALID_PLUGIN_NAME";
35
- UnistylesError["DuplicatePluginName"] = "UNISTYLES_ERROR_DUPLICATE_PLUGIN_NAME";
36
- UnistylesError["CantRemoveInternalPlugin"] = "UNISTYLES_ERROR_CANT_REMOVE_INTERNAL_PLUGIN";
28
+ UnistylesError["RuntimeUnavailable"] = "Unistyles runtime is not available. Make sure you followed the installation instructions.";
29
+ UnistylesError["ThemeNotFound"] = "You are trying to get a theme that is not registered.";
30
+ UnistylesError["ThemeNotRegistered"] = "You are trying to set a theme that is not registered.";
31
+ UnistylesError["ThemesCannotBeEmpty"] = "You are trying to register an empty themes object.";
32
+ UnistylesError["BreakpointsCannotBeEmpty"] = "You are trying to register an empty breakpoints object.";
33
+ UnistylesError["BreakpointsMustStartFromZero"] = "One breakpoint must start from 0.";
34
+ UnistylesError["InvalidPluginName"] = "Plugin name can't start from reserved prefix. Use another name.";
35
+ UnistylesError["DuplicatePluginName"] = "You are trying to register a plugin with a name that is already registered.";
36
+ UnistylesError["CantRemoveInternalPlugin"] = "You are trying to remove an internal unistyles plugin.";
37
37
  return UnistylesError;
38
38
  }({});
39
39
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","warn","message","console","exports","isMobile","Platform","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","CxxUnistylesEventTypes","UnistylesError"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,IAAI,GAAIC,OAAe,IAAK;EACrCC,OAAO,CAACF,IAAI,CAAE,gCAA+BC,OAAQ,EAAC,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA;AAEM,MAAMI,QAAQ,GAAAD,OAAA,CAAAC,QAAA,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnE,MAAMC,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAGF,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAME,KAAK,GAAAL,OAAA,CAAAK,KAAA,GAAGH,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAMG,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGJ,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMI,QAAQ,GAAAP,OAAA,CAAAO,QAAA,GAAG,OAAOC,MAAM,KAAK,WAAW;AAE9C,MAAMC,iBAAiB,GAAAT,OAAA,CAAAS,iBAAA,GAAG;EAC7BC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE;AACd,CAAU;AAAA,IAEEC,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAAA,IAMtBC,cAAc,GAAAb,OAAA,CAAAa,cAAA,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":["_reactNative","require","warn","message","console","exports","isMobile","Platform","OS","isWeb","isIOS","isAndroid","isServer","window","ScreenOrientation","Landscape","Portrait","UnistylesEventType","UnistylesError"],"sourceRoot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
  var _common = require("../common");
8
+ var _plugins = require("../plugins");
8
9
  class UnistyleRegistry {
9
10
  config = {};
10
- plugins = [];
11
+ plugins = _common.isWeb ? [_plugins.normalizeWebStylesPlugin] : [];
11
12
  themeNames = [];
12
13
  themes = {};
13
14
  breakpoints = {};
@@ -64,7 +65,7 @@ class UnistyleRegistry {
64
65
  })) {
65
66
  throw new Error(_common.UnistylesError.DuplicatePluginName);
66
67
  }
67
- _this.plugins = _this.plugins.concat([plugin]);
68
+ _this.plugins = [plugin].concat(_this.plugins);
68
69
  _this.unistylesBridge.addPlugin(plugin.name, notify);
69
70
  };
70
71
  })();
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","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","UnistylesError","ThemeNotFound","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAEO,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,M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Registry","config","plugins","isWeb","normalizeWebStylesPlugin","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","UnistylesError","ThemeNotFound","_this","notify","arguments","undefined","name","startsWith","InvalidPluginName","some","_ref","DuplicatePluginName","concat","removePlugin","CantRemoveInternalPlugin","filter","_ref2","exports"],"sourceRoot":"../../../src","sources":["core/UnistyleRegistry.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,CAAC;EACnBC,MAAM,GAAoB,CAAC,CAAC;EAC5BC,OAAO,GAA2BC,aAAK,GACxC,CAACC,iCAAwB,CAAC,GAC1B,EAAE;EACDC,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,I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IAAI,KAAKf,MAAM,CAACe,IAAI;MAAA,EAAC,EAAE;QACvD,MAAM,IAAIP,KAAK,CAACC,sBAAc,CAACW,mBAAmB,CAAC;MACvD;MAEAT,KAAI,CAAC9B,OAAO,GAAG,CAACmB,MAAM,CAAC,CAACqB,MAAM,CAACV,KAAI,CAAC9B,OAAO,CAAC;MAC5C8B,KAAI,CAACtB,eAAe,CAACY,SAAS,CAACD,MAAM,CAACe,IAAI,EAAEH,MAAM,CAAC;IACvD,CAAC;EAAA;EAEMU,YAAY,GAAItB,MAAuB,IAAK;IAC/C,IAAIA,MAAM,CAACe,IAAI,CAACC,UAAU,CAAC,aAAa,CAAC,EAAE;MACvC,MAAM,IAAIR,KAAK,CAACC,sBAAc,CAACc,wBAAwB,CAAC;IAC5D;IAEA,IAAI,CAAC1C,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC2C,MAAM,CAACC,KAAA;MAAA,IAAC;QAAEV;MAAK,CAAC,GAAAU,KAAA;MAAA,OAAKV,IAAI,KAAKf,MAAM,CAACe,IAAI;IAAA,EAAC;IACtE,IAAI,CAAC1B,eAAe,CAACiC,YAAY,CAACtB,MAAM,CAACe,IAAI,CAAC;EAClD,CAAC;EAEMR,QAAQ,GAAIQ,IAA2B,IAAKA,IAAI,IAAI,IAAI,CAAC9B,MAAM;AAC1E;AAACyC,OAAA,CAAA/C,gBAAA,GAAAA,gBAAA"}
@@ -42,7 +42,7 @@ class UnistylesRuntime {
42
42
  return _common.ScreenOrientation.Portrait;
43
43
  }
44
44
  setTheme = name => {
45
- if (this.unistylesRegistry.hasTheme(name)) {
45
+ if (name !== this.themeName && this.unistylesRegistry.hasTheme(name)) {
46
46
  this.unistylesBridge.useTheme(name);
47
47
  return true;
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKO,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,OAAOG,yBAAiB,CAACC,SAAS;IACtC;IAEA,OAAOD,yBAAiB,CAACE,QAAQ;EACrC;EAEOC,QAAQ,GAAIC,IAA2B,IAAK;IAC/C,IAAI,IAAI,CAAChB,iBAAiB,CAACiB,QAAQ,CAACD,IAAI,CAAC,EAAE;MACvC,IAAI,CAACjB,eAAe,CAACmB,QAAQ,CAACF,IAAI,CAAC;MAEnC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIG,KAAK,CAACC,sBAAc,CAACC,kBAAkB,CAAC;EACtD,CAAC;EAEMC,iBAAiB,GAAIC,MAAe,IAAK;IAC5C,IAAI,CAACxB,eAAe,CAACyB,iBAAiB,CAACD,MAAM,CAAC;EAClD,CAAC;EAEME,SAAS,GAAIC,MAAuB,IAAK;IAC5C,IAAI,CAAC1B,iBAAiB,CAACyB,SAAS,CAACC,MAAM,CAAC;EAC5C,CAAC;EAEMC,YAAY,GAAID,MAAuB,IAAK;IAC/C,IAAI,CAAC1B,iBAAiB,CAAC2B,YAAY,CAACD,MAAM,CAAC;EAC/C,CAAC;AACL;AAACE,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_common","require","UnistylesRuntime","constructor","unistylesBridge","unistylesRegistry","colorScheme","hasAdaptiveThemes","themeName","breakpoint","enabledPlugins","screen","width","screenWidth","height","screenHeight","orientation","ScreenOrientation","Landscape","Portrait","setTheme","name","hasTheme","useTheme","Error","UnistylesError","ThemeNotRegistered","setAdaptiveThemes","enable","useAdaptiveThemes","addPlugin","plugin","removePlugin","exports"],"sourceRoot":"../../../src","sources":["core/UnistylesRuntime.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKO,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,IAA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;AAACE,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA"}
@@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createStyleSheet = void 0;
7
- const createStyleSheet = styles => {
8
- if (typeof styles === 'function') {
9
- return styles;
10
- }
11
- return styles;
12
- };
7
+ const createStyleSheet = stylesheet => stylesheet;
13
8
  exports.createStyleSheet = createStyleSheet;
14
9
  //# sourceMappingURL=createStyleSheet.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStyleSheet","styles","exports"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":";;;;;;AAEO,MAAMA,gBAAgB,GAAUC,MAA4F,IAAY;EAC3I,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAC9B,OAAOA,MAAM;EACjB;EAEA,OAAOA,MAAM;AACjB,CAAC;AAAAC,OAAA,CAAAF,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["createStyleSheet","stylesheet","exports"],"sourceRoot":"../../src","sources":["createStyleSheet.ts"],"mappings":";;;;;;AAEO,MAAMA,gBAAgB,GAAyCC,UAAa,IAAQA,UAAU;AAAAC,OAAA,CAAAF,gBAAA,GAAAA,gBAAA"}
@@ -15,6 +15,13 @@ Object.defineProperty(exports, "useUnistyles", {
15
15
  return _useUnistyles.useUnistyles;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "useVariants", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _useVariants.useVariants;
22
+ }
23
+ });
18
24
  var _useInitialTheme = require("./useInitialTheme");
19
25
  var _useUnistyles = require("./useUnistyles");
26
+ var _useVariants = require("./useVariants");
20
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_useInitialTheme","require","_useUnistyles"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA"}
1
+ {"version":3,"names":["_useInitialTheme","require","_useUnistyles","_useVariants"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA"}
@@ -23,24 +23,21 @@ const useUnistyles = () => {
23
23
  (0, _react.useEffect)(() => {
24
24
  const subscription = unistylesEvents.addListener('onChange', event => {
25
25
  switch (event.type) {
26
- case _common.CxxUnistylesEventTypes.Theme:
26
+ case _common.UnistylesEventType.Theme:
27
27
  {
28
28
  const themeEvent = event;
29
29
  return setTheme(_core.unistyles.registry.getTheme(themeEvent.payload.themeName));
30
30
  }
31
- case _common.CxxUnistylesEventTypes.Layout:
31
+ case _common.UnistylesEventType.Layout:
32
32
  {
33
33
  const layoutEvent = event;
34
34
  return setLayout({
35
35
  breakpoint: layoutEvent.payload.breakpoint,
36
36
  orientation: layoutEvent.payload.orientation,
37
- screenSize: {
38
- width: layoutEvent.payload.screen.width,
39
- height: layoutEvent.payload.screen.height
40
- }
37
+ screenSize: layoutEvent.payload.screen
41
38
  });
42
39
  }
43
- case _common.CxxUnistylesEventTypes.Plugin:
40
+ case _common.UnistylesEventType.Plugin:
44
41
  {
45
42
  return setPlugins(_core.unistyles.runtime.enabledPlugins);
46
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","useEffect","subscription","addListener","event","type","CxxUnistylesEventTypes","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove","exports"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAA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,UAAU,EAAEgB,WAAW,CAACF,OAAO,CAACd,UAAU;cAC1CC,WAAW,EAAEe,WAAW,CAACF,OAAO,CAACb,WAAW;cAC5CC,UAAU,EAAE;gBACRC,KAAK,EAAEa,WAAW,CAACF,OAAO,CAACV,MAAM,CAACD,KAAK;gBACvCE,MAAM,EAAEW,WAAW,CAACF,OAAO,CAACV,MAAM,CAACC;cACvC;YACJ,CAAC,CAAC;UACN;QACA,KAAKM,8BAAsB,CAACM,MAAM;UAAE;YAChC,OAAO7B,UAAU,CAACE,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;UACvD;QACA;UACI;MACR;IACJ,CACJ,CAAC;IAED,OAAOe,YAAY,CAACW,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH/B,OAAO;IACPM,KAAK;IACLK;EACJ,CAAC;AACL,CAAC;AAAAqB,OAAA,CAAAjC,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["_reactNative","require","_react","_core","_common","unistylesEvents","NativeEventEmitter","NativeModules","Unistyles","useUnistyles","plugins","setPlugins","useState","unistyles","runtime","enabledPlugins","theme","setTheme","registry","getTheme","themeName","layout","setLayout","breakpoint","orientation","screenSize","width","screen","height","useEffect","subscription","addListener","event","type","UnistylesEventType","Theme","themeEvent","payload","Layout","layoutEvent","Plugin","remove","exports"],"sourceRoot":"../../../src","sources":["hooks/useUnistyles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAGA,MAAMI,eAAe,GAAG,IAAIC,+BAAkB,CAACC,0BAAa,CAACC,SAAS,CAAC;AAEhE,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAACC,eAAS,CAACC,OAAO,CAACC,cAAc,CAAC;EAC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;IAED,OAAOe,YAAY,CAACW,MAAM;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACH/B,OAAO;IACPM,KAAK;IACLK;EACJ,CAAC;AACL,CAAC;AAAAqB,OAAA,CAAAjC,YAAA,GAAAA,YAAA"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useVariants = void 0;
7
+ var _react = require("react");
8
+ const compareVariants = (prevVariants, nextVariants) => {
9
+ const keysA = Object.keys(prevVariants ?? {});
10
+ const keysB = Object.keys(nextVariants ?? {});
11
+ if (keysA.length !== keysB.length) {
12
+ return false;
13
+ }
14
+ return keysA.every(key => prevVariants[key] === (nextVariants ?? {})[key]);
15
+ };
16
+ const useVariants = variantsMap => {
17
+ const variantsRef = (0, _react.useRef)(variantsMap);
18
+ if (!compareVariants(variantsRef.current, variantsMap)) {
19
+ variantsRef.current = variantsMap;
20
+ }
21
+ return variantsRef.current;
22
+ };
23
+ exports.useVariants = useVariants;
24
+ //# sourceMappingURL=useVariants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","compareVariants","prevVariants","nextVariants","keysA","Object","keys","keysB","length","every","key","useVariants","variantsMap","variantsRef","useRef","current","exports"],"sourceRoot":"../../../src","sources":["hooks/useVariants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,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;AAEM,MAAMC,WAAW,GAAIC,WAA8C,IAAK;EAC3E,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAA6CF,WAAW,CAAC;EAEnF,IAAI,CAACX,eAAe,CAACY,WAAW,CAACE,OAAO,EAAEH,WAAW,CAAC,EAAE;IACpDC,WAAW,CAACE,OAAO,GAAGH,WAAW;EACrC;EAEA,OAAOC,WAAW,CAACE,OAAO;AAC9B,CAAC;AAAAC,OAAA,CAAAL,WAAA,GAAAA,WAAA"}
@@ -17,7 +17,7 @@ const normalizeColor = function (color) {
17
17
  }
18
18
  const integer = (0, _normalizeColors.default)(color);
19
19
 
20
- // If the colour is an unknown format, the return value is null
20
+ // If the color is an unknown format, the return value is null
21
21
  if (integer === null) {
22
22
  return color;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_normalizeColors","_interopRequireDefault","require","obj","__esModule","default","normalizeColor","color","opacity","arguments","length","undefined","integer","normalizeColors","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","exports","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":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5D;AACA;;AAUO,MAAMG,cAAc,GAAG,SAAAA,CAACC,KAAa,EAA0B;EAAA,IAAxBC,OAAe,GAAAC,S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A,MAAMmB,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,CACDL,MAAM,CAAC8B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEP,MAAME,YAA0B,GAAA5B,OAAA,CAAA4B,YAAA,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
1
+ {"version":3,"names":["_normalizeColors","_interopRequireDefault","require","obj","__esModule","default","normalizeColor","color","opacity","arguments","length","undefined","integer","normalizeColors","hex","toString","padStart","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","exports","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":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5D;AACA;;AAUO,MAAMG,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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AIF,KAAK,CAAmBwB,IAAI,CAAC,GAAG,CAAE,GAAE;IAC1D;MACI,OAAQ,GAAEtB,GAAI,IAAGD,kBAAkB,CAACC,GAAG,EAAEF,KAAK,CAAE,GAAE;EAC1D;AACJ,CAAC,CAAC,CACDL,MAAM,CAAC8B,OAAO,CAAC,CACfD,IAAI,CAAC,GAAG,CAAC;AAEP,MAAME,YAA0B,GAAA5B,OAAA,CAAA4B,YAAA,GAAG;EACtCtB,qBAAqB;EACrBU,oBAAoB;EACpBK;AACJ,CAAC"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.withPlugins = void 0;
7
- var _normalizeWebStylesPlugin = require("./normalizeWebStylesPlugin");
8
- var _common = require("../common");
9
- var _core = require("../core");
10
- const UNISTYLES_PLUGINS = _common.isWeb ? [_normalizeWebStylesPlugin.normalizeWebStylesPlugin] : [];
11
- const withPlugins = (key, style) => _core.unistyles.registry.plugins.concat(UNISTYLES_PLUGINS).reduce((acc, plugin) => {
7
+ const withPlugins = (key, style, plugins, runtime) => plugins.reduce((acc, plugin) => {
12
8
  if (plugin.onParsedStyle) {
13
- return plugin.onParsedStyle(key, acc, _core.unistyles.runtime);
9
+ return plugin.onParsedStyle(key, acc, runtime);
14
10
  }
15
11
  return acc;
16
12
  }, style);
@@ -1 +1 @@
1
- {"version":3,"names":["_normalizeWebStylesPlugin","require","_common","_core","UNISTYLES_PLUGINS","isWeb","normalizeWebStylesPlugin","withPlugins","key","style","unistyles","registry","plugins","concat","reduce","acc","plugin","onParsedStyle","runtime","exports"],"sourceRoot":"../../../src","sources":["plugins/withPlugins.ts"],"mappings":";;;;;;AACA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,iBAAiB,GAAGC,aAAK,GACzB,CAACC,kDAAwB,CAAC,GAC1B,EAAE;AAED,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAc,KAAKC,eAAS,CAACC,QAAQ,CAACC,OAAO,CAACC,MAAM,CAACT,iBAAiB,CAAC,CAC3GU,MAAM,CAAC,CAACC,GAAG,EAAEC,MAAM,KAAK;EACrB,IAAIA,MAAM,CAACC,aAAa,EAAE;IACtB,OAAOD,MAAM,CAACC,aAAa,CAACT,GAAG,EAAEO,GAAG,EAAEL,eAAS,CAACQ,OAAO,CAAC;EAC5D;EAEA,OAAOH,GAAG;AACd,CAAC,EAAEN,KAAK,CAAC;AAAAU,OAAA,CAAAZ,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"names":["withPlugins","key","style","plugins","runtime","reduce","acc","plugin","onParsedStyle","exports"],"sourceRoot":"../../../src","sources":["plugins/withPlugins.ts"],"mappings":";;;;;;AAGO,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;AAAAO,OAAA,CAAAT,WAAA,GAAAA,WAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=stylesheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/stylesheet.ts"],"mappings":""}
@@ -8,41 +8,38 @@ var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  var _utils = require("./utils");
10
10
  var _hooks = require("./hooks");
11
- const useStyles = (stylesheet, variant) => {
11
+ var _core = require("./core");
12
+ const useStyles = (stylesheet, variantsMap) => {
12
13
  const {
13
14
  theme,
14
15
  layout,
15
16
  plugins
16
17
  } = (0, _hooks.useUnistyles)();
17
- const {
18
- screenSize,
19
- breakpoint
20
- } = layout;
21
18
  if (!stylesheet) {
22
19
  return {
23
20
  theme,
24
- breakpoint,
21
+ breakpoint: layout.breakpoint,
25
22
  styles: {}
26
23
  };
27
24
  }
25
+ const variants = (0, _hooks.useVariants)(variantsMap);
28
26
  const parsedStyles = (0, _react.useMemo)(() => typeof stylesheet === 'function' ? stylesheet(theme) : stylesheet, [theme, stylesheet, layout]);
29
27
  const dynamicStyleSheet = (0, _react.useMemo)(() => Object.entries(parsedStyles).reduce((acc, _ref) => {
30
28
  let [key, value] = _ref;
31
- const style = value;
32
29
  if (typeof value === 'function') {
33
30
  return {
34
31
  ...acc,
35
- [key]: (0, _utils.proxifyFunction)(key, value, breakpoint, screenSize, variant)
32
+ [key]: (0, _utils.proxifyFunction)(key, value, _core.unistyles.registry.plugins, _core.unistyles.runtime, variants)
36
33
  };
37
34
  }
38
35
  return _reactNative.StyleSheet.create({
39
36
  ...acc,
40
- [key]: (0, _utils.parseStyle)(key, style, breakpoint, screenSize, variant)
37
+ [key]: (0, _utils.parseStyle)(key, value, _core.unistyles.registry.plugins, _core.unistyles.runtime, variants)
41
38
  });
42
- }, {}), [breakpoint, screenSize, parsedStyles, variant, plugins]);
39
+ }, {}), [layout, parsedStyles, variants, plugins]);
43
40
  return {
44
41
  theme,
45
- breakpoint,
42
+ breakpoint: layout.breakpoint,
46
43
  styles: dynamicStyleSheet
47
44
  };
48
45
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_utils","_hooks","useStyles","stylesheet","variant","theme","layout","plugins","useUnistyles","screenSize","breakpoint","styles","parsedStyles","useMemo","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","style","proxifyFunction","StyleSheet","create","parseStyle","exports"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YA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,UAAU,EAAED,UAAU,EAAEG,YAAY,EAAER,OAAO,EAAEG,OAAO,CAAC,CAA8B;EAExG,OAAO;IACHF,KAAK;IACLK,UAAU;IACVC,MAAM,EAAEG;EACZ,CAAC;AACL,CAAC;AAAAa,OAAA,CAAAzB,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"names":["_react","require","_reactNative","_utils","_hooks","_core","useStyles","stylesheet","variantsMap","theme","layout","plugins","useUnistyles","breakpoint","styles","variants","useVariants","parsedStyles","useMemo","dynamicStyleSheet","Object","entries","reduce","acc","_ref","key","value","proxifyFunction","unistyles","registry","runtime","StyleSheet","create","parseStyle","exports"],"sourceRoot":"../../src","sources":["useStyles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AAcO,MAAMK,SAAS,GAAGA,CACrBC,UAAe,EACfC,WAAoD,KAC7B;EACvB,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,mBAAY,EAAC,CAAC;EAEjD,IAAI,CAACL,UAAU,EAAE;IACb,OAAO;MACHE,KAAK;MACLI,UAAU,EAAEH,MAAM,CAACG,UAAU;MAC7BC,MAAM,EAAE,CAAC;IACb,CAAC;EACL;EAEA,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EAACR,WAAW,CAAC;EACzC,MAAMS,YAAY,GAAG,IAAAC,cAAO,EAAC,MAAM,OAAOX,UAAU,KAAK,UAAU,GAC7DA,UAAU,CAACE,KAAK,CAAC,GACjBF,UAAU,EAAE,CAACE,KAAK,EAAEF,UAAU,EAAEG,MAAM,CAAC,CAAC;EAE9C,MAAMS,iBAAiB,GAAG,IAAAD,cAAO,EAAC,MAAME,MAAM,CACzCC,OAAO,CAACJ,YAAY,CAAC,CACrBK,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,GAAG,IAAAE,sBAAe,EAACF,GAAG,EAAEC,KAAK,EAACE,eAAS,CAACC,QAAQ,CAAClB,OAAO,EAAEiB,eAAS,CAACE,OAAO,EAAEf,QAAQ;MAC7F,CAAC;IACL;IAEA,OAAOgB,uBAAU,CAACC,MAAM,CAAC;MACrB,GAAGT,GAAG;MACN,CAACE,GAAG,GAAG,IAAAQ,iBAAU,EACbR,GAAG,EACHC,KAAK,EACLE,eAAS,CAACC,QAAQ,CAAClB,OAAO,EAC1BiB,eAAS,CAACE,OAAO,EACjBf,QACJ;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAAC,CAAC,CAAC,EACV,CAACL,MAAM,EAAEO,YAAY,EAAEF,QAAQ,EAAEJ,OAAO,CACxC,CAA8B;EAE9B,OAAO;IACHF,KAAK;IACLI,UAAU,EAAEH,MAAM,CAACG,UAAU;IAC7BC,MAAM,EAAEK;EACZ,CAAC;AACL,CAAC;AAAAe,OAAA,CAAA5B,SAAA,GAAAA,SAAA"}
@@ -3,22 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "MQHeight", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _mq.MQHeight;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "MQHeightAndWidth", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _mq.MQHeightAndWidth;
16
+ }
17
+ });
6
18
  Object.defineProperty(exports, "MQSymbol", {
7
19
  enumerable: true,
8
20
  get: function () {
9
21
  return _mq.MQSymbol;
10
22
  }
11
23
  });
12
- Object.defineProperty(exports, "getKeyForUnistylesMediaQuery", {
24
+ Object.defineProperty(exports, "MQWidth", {
13
25
  enumerable: true,
14
26
  get: function () {
15
- return _mqParser.getKeyForUnistylesMediaQuery;
27
+ return _mq.MQWidth;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "MQWidthAndHeight", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _mq.MQWidthAndHeight;
16
34
  }
17
35
  });
18
- Object.defineProperty(exports, "getKeyForVariant", {
36
+ Object.defineProperty(exports, "getKeyForUnistylesMediaQuery", {
19
37
  enumerable: true,
20
38
  get: function () {
21
- return _variants.getKeyForVariant;
39
+ return _mqParser.getKeyForUnistylesMediaQuery;
22
40
  }
23
41
  });
24
42
  Object.defineProperty(exports, "getValueForBreakpoint", {
@@ -64,7 +82,6 @@ Object.defineProperty(exports, "proxifyFunction", {
64
82
  }
65
83
  });
66
84
  var _mq = require("./mq");
67
- var _variants = require("./variants");
68
85
  var _mqParser = require("./mqParser");
69
86
  var _breakpoints = require("./breakpoints");
70
87
  var _styles = require("./styles");
@@ -1 +1 @@
1
- {"version":3,"names":["_mq","require","_variants","_mqParser","_breakpoints","_styles"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA"}
1
+ {"version":3,"names":["_mq","require","_mqParser","_breakpoints","_styles"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA"}
@@ -3,15 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.mq = exports.MQSymbol = void 0;
6
+ exports.mq = exports.MQWidthAndHeight = exports.MQWidth = exports.MQSymbol = exports.MQHeightAndWidth = exports.MQHeight = void 0;
7
7
  var _core = require("../core");
8
8
  const MQSymbol = exports.MQSymbol = Symbol('unistyles-mq');
9
+ const MQWidth = exports.MQWidth = Symbol('unistyles-mq-width');
10
+ const MQHeight = exports.MQHeight = Symbol('unistyles-mq-height');
11
+ const MQWidthAndHeight = exports.MQWidthAndHeight = Symbol('unistyles-mq-width-and-height');
12
+ const MQHeightAndWidth = exports.MQHeightAndWidth = Symbol('unistyles-mq-height-and-width');
9
13
  var MQProp = /*#__PURE__*/function (MQProp) {
10
14
  MQProp["toString"] = "toString";
11
15
  MQProp["width"] = "width";
12
16
  MQProp["height"] = "height";
13
- MQProp["shortW"] = "w";
14
- MQProp["shortH"] = "h";
17
+ MQProp["only"] = "only";
18
+ MQProp["and"] = "and";
15
19
  return MQProp;
16
20
  }(MQProp || {});
17
21
  const getMQValue = value => {
@@ -31,18 +35,20 @@ const widthHandler = function () {
31
35
  if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
32
36
  return () => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
33
37
  }
34
- if (prop === MQProp.width || prop === MQProp.shortW) {
35
- return function () {
36
- let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
37
- let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
38
- return new Proxy({}, {
39
- get: (target, prop, receiver) => {
40
- if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
41
- return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
38
+ if (prop === MQProp.and) {
39
+ return {
40
+ width: function () {
41
+ let wMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
42
+ let wMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
43
+ return new Proxy({}, {
44
+ get: (target, prop, receiver) => {
45
+ if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
46
+ return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
47
+ }
48
+ return Reflect.get(target, prop, receiver);
42
49
  }
43
- return Reflect.get(target, prop, receiver);
44
- }
45
- });
50
+ });
51
+ }
46
52
  };
47
53
  }
48
54
  return Reflect.get(target, prop, receiver);
@@ -57,18 +63,20 @@ const heightHandler = function () {
57
63
  if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
58
64
  return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`;
59
65
  }
60
- if (prop === MQProp.height || prop === MQProp.shortH) {
61
- return function () {
62
- let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
63
- let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
64
- return new Proxy({}, {
65
- get: (target, prop, receiver) => {
66
- if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
67
- return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
66
+ if (prop === MQProp.and) {
67
+ return {
68
+ height: function () {
69
+ let hMin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
70
+ let hMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
71
+ return new Proxy({}, {
72
+ get: (target, prop, receiver) => {
73
+ if (prop === Symbol.toPrimitive || prop === MQProp.toString) {
74
+ return () => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`;
75
+ }
76
+ return Reflect.get(target, prop, receiver);
68
77
  }
69
- return Reflect.get(target, prop, receiver);
70
- }
71
- });
78
+ });
79
+ }
72
80
  };
73
81
  }
74
82
  return Reflect.get(target, prop, receiver);
@@ -77,12 +85,18 @@ const heightHandler = function () {
77
85
  };
78
86
  const mq = exports.mq = new Proxy({}, {
79
87
  get: (target, prop, receiver) => {
80
- if (prop === MQProp.shortW || prop === MQProp.width) {
81
- return heightHandler;
88
+ if (prop === MQProp.only) {
89
+ return {
90
+ width: heightHandler,
91
+ height: widthHandler
92
+ };
82
93
  }
83
- if (prop === MQProp.shortH || prop === MQProp.height) {
94
+ if (prop === MQProp.height) {
84
95
  return widthHandler;
85
96
  }
97
+ if (prop === MQProp.width) {
98
+ return heightHandler;
99
+ }
86
100
  return Reflect.get(target, prop, receiver);
87
101
  }
88
102
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","MQSymbol","exports","Symbol","MQProp","getMQValue","value","unistyles","registry","breakpoints","widthHandler","hMin","arguments","length","undefined","hMax","Infinity","Proxy","get","target","prop","receiver","toPrimitive","toString","width","shortW","wMin","wMax","Reflect","heightHandler","height","shortH","mq"],"sourceRoot":"../../../src","sources":["utils/mq.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAAC,cAAc,CAAC;AAAA,IAyBzCC,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA,EAANA,MAAM;AAQX,MAAMC,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;EACZ;EAEA,OAAOC,eAAS,CAACC,QAAQ,CAACC,WAAW,CAACH,KAAK,CAAC,IAAI,CAAC;AACrD,CAAC;AAED,MAAMI,YAAY,GAAG,SAAAA,CAAA;EAAA,IAACC,IAAuB,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O,MAAO,MAAKlB,UAAU,CAACqB,IAAI,CAAE,KAAIrB,UAAU,CAACsB,IAAI,CAAE,OAAMtB,UAAU,CAACM,IAAI,CAAE,KAAIN,UAAU,CAACU,IAAI,CAAE,GAAE;cAC3G;cAEA,OAAOa,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;YAC9C;UACJ,CAAC,CAAC;QAAA;MACN;MAEA,OAAOO,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;IAC9C;EACJ,CAAC,CAAC;AAAA;AAEK,MAAMW,EAAE,GAAA9B,OAAA,CAAA8B,EAAA,GAAG,IAAIf,KAAK,CAAC,CAAC,CAAC,EAAe;EACzCC,GAAG,EAAEA,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,KAAK;IAC7B,IAAID,IAAI,KAAKhB,MAAM,CAACqB,MAAM,IAAIL,IAAI,KAAKhB,MAAM,CAACoB,KAAK,EAAE;MACjD,OAAOK,aAAa;IACxB;IAEA,IAAIT,IAAI,KAAKhB,MAAM,CAAC2B,MAAM,IAAIX,IAAI,KAAKhB,MAAM,CAAC0B,MAAM,EAAE;MAClD,OAAOpB,YAAY;IACvB;IAEA,OAAOkB,OAAO,CAACV,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;EAC9C;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_core","require","MQSymbol","exports","Symbol","MQWidth","MQHeight","MQWidthAndHeight","MQHeightAndWidth","MQProp","getMQValue","value","unistyles","registry","breakpoints","widthHandler","hMin","arguments","length","undefined","hMax","Infinity","Proxy","get","target","prop","receiver","toPrimitive","toString","and","width","wMin","wMax","Reflect","heightHandler","height","mq","only"],"sourceRoot":"../../../src","sources":["utils/mq.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,M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