react-native-unistyles 3.0.0-alpha.21 → 3.0.0-alpha.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. package/cxx/core/UnistylesRegistry.cpp +26 -0
  2. package/cxx/core/UnistylesRegistry.h +1 -0
  3. package/cxx/hybridObjects/HybridStyleSheet.cpp +11 -5
  4. package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
  5. package/cxx/parser/Parser.cpp +27 -1
  6. package/cxx/parser/Parser.h +1 -1
  7. package/lib/commonjs/web/convert/boxShadow.js +13 -13
  8. package/lib/commonjs/web/convert/boxShadow.js.map +1 -1
  9. package/lib/commonjs/web/convert/index.js +9 -11
  10. package/lib/commonjs/web/convert/index.js.map +1 -1
  11. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  12. package/lib/commonjs/web/convert/style.js +11 -7
  13. package/lib/commonjs/web/convert/style.js.map +1 -1
  14. package/lib/commonjs/web/convert/textShadow.js +12 -12
  15. package/lib/commonjs/web/convert/textShadow.js.map +1 -1
  16. package/lib/commonjs/web/convert/transform.js +5 -5
  17. package/lib/commonjs/web/convert/transform.js.map +1 -1
  18. package/lib/commonjs/web/{listener/listener.js → listener.js} +2 -2
  19. package/lib/commonjs/web/listener.js.map +1 -0
  20. package/lib/commonjs/web/mq.js.map +1 -1
  21. package/lib/commonjs/web/registry.js +159 -21
  22. package/lib/commonjs/web/registry.js.map +1 -1
  23. package/lib/commonjs/web/shadowRegistry.js +50 -48
  24. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  25. package/lib/commonjs/web/state.js +8 -16
  26. package/lib/commonjs/web/state.js.map +1 -1
  27. package/lib/commonjs/web/{utils.js → utils/common.js} +9 -47
  28. package/lib/commonjs/web/utils/common.js.map +1 -0
  29. package/lib/commonjs/web/utils/index.js +28 -0
  30. package/lib/commonjs/web/utils/index.js.map +1 -0
  31. package/lib/commonjs/web/utils/unistyle.js +82 -0
  32. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  33. package/lib/module/web/convert/boxShadow.js +13 -13
  34. package/lib/module/web/convert/boxShadow.js.map +1 -1
  35. package/lib/module/web/convert/index.js +7 -9
  36. package/lib/module/web/convert/index.js.map +1 -1
  37. package/lib/module/web/convert/pseudo.js.map +1 -0
  38. package/lib/module/web/convert/style.js +11 -7
  39. package/lib/module/web/convert/style.js.map +1 -1
  40. package/lib/module/web/convert/textShadow.js +12 -12
  41. package/lib/module/web/convert/textShadow.js.map +1 -1
  42. package/lib/module/web/convert/transform.js +5 -5
  43. package/lib/module/web/convert/transform.js.map +1 -1
  44. package/lib/module/web/{listener/listener.js → listener.js} +2 -2
  45. package/lib/module/web/listener.js.map +1 -0
  46. package/lib/module/web/mq.js.map +1 -1
  47. package/lib/module/web/registry.js +160 -22
  48. package/lib/module/web/registry.js.map +1 -1
  49. package/lib/module/web/shadowRegistry.js +51 -49
  50. package/lib/module/web/shadowRegistry.js.map +1 -1
  51. package/lib/module/web/state.js +8 -16
  52. package/lib/module/web/state.js.map +1 -1
  53. package/lib/module/web/{utils.js → utils/common.js} +7 -39
  54. package/lib/module/web/utils/common.js.map +1 -0
  55. package/lib/module/web/utils/index.js +5 -0
  56. package/lib/module/web/utils/index.js.map +1 -0
  57. package/lib/module/web/utils/unistyle.js +69 -0
  58. package/lib/module/web/utils/unistyle.js.map +1 -0
  59. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
  60. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  61. package/lib/typescript/src/types/stylesheet.d.ts +1 -1
  62. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  63. package/lib/typescript/src/web/convert/boxShadow.d.ts +7 -2
  64. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -1
  65. package/lib/typescript/src/web/convert/index.d.ts +1 -2
  66. package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
  67. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  68. package/lib/typescript/src/web/convert/style.d.ts +1 -2
  69. package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
  70. package/lib/typescript/src/web/convert/textShadow.d.ts +7 -2
  71. package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -1
  72. package/lib/typescript/src/web/convert/transform.d.ts +1 -2
  73. package/lib/typescript/src/web/convert/transform.d.ts.map +1 -1
  74. package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +1 -1
  75. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  76. package/lib/typescript/src/web/mq.d.ts +6 -2
  77. package/lib/typescript/src/web/mq.d.ts.map +1 -1
  78. package/lib/typescript/src/web/registry.d.ts +21 -8
  79. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  80. package/lib/typescript/src/web/shadowRegistry.d.ts +3 -4
  81. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  82. package/lib/typescript/src/web/state.d.ts +2 -2
  83. package/lib/typescript/src/web/state.d.ts.map +1 -1
  84. package/lib/typescript/src/web/{utils.d.ts → utils/common.d.ts} +2 -20
  85. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  86. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  87. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  88. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  89. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  90. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  91. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +8 -8
  92. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +22 -22
  93. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  94. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +1 -1
  95. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +2 -2
  96. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +2 -2
  97. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  98. package/nitrogen/generated/ios/Unistyles+autolinking.rb +5 -3
  99. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  100. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +32 -32
  101. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  102. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +0 -12
  103. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +134 -110
  104. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  105. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  106. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  107. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  108. package/package.json +4 -15
  109. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
  110. package/src/types/stylesheet.ts +1 -1
  111. package/src/web/convert/boxShadow.ts +14 -15
  112. package/src/web/convert/index.ts +6 -13
  113. package/src/web/convert/style.ts +61 -10
  114. package/src/web/convert/textShadow.ts +13 -14
  115. package/src/web/convert/transform.ts +7 -8
  116. package/src/web/{listener/listener.ts → listener.ts} +2 -2
  117. package/src/web/mq.ts +1 -3
  118. package/src/web/registry.ts +202 -23
  119. package/src/web/shadowRegistry.ts +49 -49
  120. package/src/web/state.ts +13 -23
  121. package/src/web/{utils.ts → utils/common.ts} +6 -68
  122. package/src/web/utils/index.ts +2 -0
  123. package/src/web/utils/unistyle.ts +104 -0
  124. package/lib/commonjs/web/convert/breakpoint.js +0 -25
  125. package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
  126. package/lib/commonjs/web/createUnistylesComponent.js +0 -61
  127. package/lib/commonjs/web/createUnistylesComponent.js.map +0 -1
  128. package/lib/commonjs/web/listener/index.js +0 -20
  129. package/lib/commonjs/web/listener/index.js.map +0 -1
  130. package/lib/commonjs/web/listener/listenToDependencies.js +0 -38
  131. package/lib/commonjs/web/listener/listenToDependencies.js.map +0 -1
  132. package/lib/commonjs/web/listener/listener.js.map +0 -1
  133. package/lib/commonjs/web/pseudo.js.map +0 -1
  134. package/lib/commonjs/web/utils.js.map +0 -1
  135. package/lib/module/web/convert/breakpoint.js +0 -20
  136. package/lib/module/web/convert/breakpoint.js.map +0 -1
  137. package/lib/module/web/createUnistylesComponent.js +0 -54
  138. package/lib/module/web/createUnistylesComponent.js.map +0 -1
  139. package/lib/module/web/listener/index.js +0 -5
  140. package/lib/module/web/listener/index.js.map +0 -1
  141. package/lib/module/web/listener/listenToDependencies.js +0 -33
  142. package/lib/module/web/listener/listenToDependencies.js.map +0 -1
  143. package/lib/module/web/listener/listener.js.map +0 -1
  144. package/lib/module/web/pseudo.js.map +0 -1
  145. package/lib/module/web/utils.js.map +0 -1
  146. package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
  147. package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
  148. package/lib/typescript/src/web/createUnistylesComponent.d.ts +0 -3
  149. package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +0 -1
  150. package/lib/typescript/src/web/listener/index.d.ts +0 -3
  151. package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
  152. package/lib/typescript/src/web/listener/listenToDependencies.d.ts +0 -12
  153. package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +0 -1
  154. package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
  155. package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
  156. package/lib/typescript/src/web/utils.d.ts.map +0 -1
  157. package/src/web/convert/breakpoint.ts +0 -21
  158. package/src/web/createUnistylesComponent.tsx +0 -54
  159. package/src/web/listener/index.ts +0 -2
  160. package/src/web/listener/listenToDependencies.ts +0 -45
  161. /package/lib/commonjs/web/{pseudo.js → convert/pseudo.js} +0 -0
  162. /package/lib/module/web/{pseudo.js → convert/pseudo.js} +0 -0
  163. /package/lib/typescript/src/web/{pseudo.d.ts → convert/pseudo.d.ts} +0 -0
  164. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  165. /package/src/web/{pseudo.ts → convert/pseudo.ts} +0 -0
@@ -149,3 +149,29 @@ core::DependencyMap core::UnistylesRegistry::buildDependencyMap(jsi::Runtime& rt
149
149
 
150
150
  return dependencyMap;
151
151
  }
152
+
153
+ std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange) {
154
+ std::vector<std::shared_ptr<core::StyleSheet>> stylesheetsToRefresh{};
155
+
156
+ if (!themeDidChange && !runtimeDidChange) {
157
+ return stylesheetsToRefresh;
158
+ }
159
+
160
+ auto& styleSheets = this->_styleSheetRegistry[&rt];
161
+
162
+ std::for_each(styleSheets.begin(), styleSheets.end(), [&](std::pair<int, std::shared_ptr<core::StyleSheet>> pair){
163
+ auto& [_, styleSheet] = pair;
164
+
165
+ if (styleSheet->type == StyleSheetType::ThemableWithMiniRuntime && runtimeDidChange) {
166
+ stylesheetsToRefresh.emplace_back(styleSheet);
167
+
168
+ return;
169
+ }
170
+
171
+ if (styleSheet->type == StyleSheetType::Themable && themeDidChange) {
172
+ stylesheetsToRefresh.emplace_back(styleSheet);
173
+ }
174
+ });
175
+
176
+ return stylesheetsToRefresh;
177
+ }
@@ -36,6 +36,7 @@ struct UnistylesRegistry: public StyleSheetRegistry {
36
36
 
37
37
  UnistylesState& getState(jsi::Runtime& rt);
38
38
  void createState(jsi::Runtime& rt);
39
+ std::vector<std::shared_ptr<core::StyleSheet>> getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange);
39
40
  void linkShadowNodeWithUnistyle(jsi::Runtime& rt, const ShadowNodeFamily*, std::vector<core::Unistyle::Shared>& unistyles, Variants& variants, std::vector<folly::dynamic>&);
40
41
  void unlinkShadowNodeWithUnistyles(jsi::Runtime& rt, const ShadowNodeFamily*);
41
42
  std::shared_ptr<core::StyleSheet> addStyleSheet(jsi::Runtime& rt, int tag, core::StyleSheetType type, jsi::Object&& rawValue);
@@ -9,7 +9,7 @@ double HybridStyleSheet::getHairlineWidth() {
9
9
  return nearestPixel / pixelRatio;
10
10
  }
11
11
 
12
- double HybridStyleSheet::get__unid() {
12
+ double HybridStyleSheet::getUnid() {
13
13
  return this->__unid;
14
14
  }
15
15
 
@@ -223,18 +223,24 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
223
223
 
224
224
  // check if color scheme changed and then if Unistyles state depend on it (adaptive themes)
225
225
  auto colorSchemeIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::COLORSCHEME);
226
-
227
- if (colorSchemeIt != dependencies.end()) {
226
+ auto hasNewColorScheme = colorSchemeIt != dependencies.end();
227
+
228
+ // in a later step, we will rebuild only Unistyles with mounted StyleSheets
229
+ // however, user may have StyleSheets with components that haven't mounted yet
230
+ // we need to rebuild all dependent StyleSheets as well
231
+ auto dependentStyleSheets = registry.getStyleSheetsToRefresh(rt, hasNewColorScheme, dependencies.size() > 1);
232
+
233
+ if (hasNewColorScheme) {
228
234
  this->_unistylesRuntime->includeDependenciesForColorSchemeChange(dependencies);
229
235
  }
230
-
236
+
231
237
  auto dependencyMap = registry.buildDependencyMap(rt, dependencies);
232
238
 
233
239
  if (dependencyMap.size() == 0) {
234
240
  return;
235
241
  }
236
242
 
237
- parser.rebuildUnistylesInDependencyMap(rt, dependencyMap);
243
+ parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets);
238
244
 
239
245
  // this is required, otherwise shadow tree will ignore Unistyles commit
240
246
  registry.trafficController.setHasUnistylesCommit(true);
@@ -43,7 +43,7 @@ struct HybridStyleSheet: public HybridUnistylesStyleSheetSpec {
43
43
  };
44
44
 
45
45
  double getHairlineWidth() override;
46
- double get__unid() override;
46
+ double getUnid() override;
47
47
 
48
48
  private:
49
49
  void parseSettings(jsi::Runtime& rt, jsi::Object settings);
@@ -99,9 +99,16 @@ void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_
99
99
  }
100
100
 
101
101
  // rebuild all unistyles that are affected by platform event
102
- void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap) {
102
+ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>> styleSheets) {
103
103
  std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheets{};
104
+ std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
104
105
 
106
+ // parse all stylesheets that depends on changes
107
+ for (auto styleSheet : styleSheets) {
108
+ parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet));
109
+ }
110
+
111
+ // then parse all visible Unistyles
105
112
  for (auto& [shadowNode, unistyles] : dependencyMap) {
106
113
  auto styleSheet = unistyles.begin()->get()->unistyle->parent;
107
114
 
@@ -116,6 +123,10 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
116
123
  // for RN styles or inline styles, compute styles only once
117
124
  if (unistyle->styleKey == helpers::EXOTIC_STYLE_KEY.c_str() && !unistyleData->parsedStyle.has_value()) {
118
125
  unistyleData->parsedStyle = jsi::Value(rt, unistyle->rawValue).asObject(rt);
126
+
127
+ if (!parsedUnistyles.contains(unistyle)) {
128
+ parsedUnistyles.emplace(unistyle, true);
129
+ }
119
130
 
120
131
  continue;
121
132
  }
@@ -128,6 +139,21 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
128
139
  unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
129
140
  this->rebuildUnistyle(rt, styleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
130
141
  unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
142
+
143
+ if (!parsedUnistyles.contains(unistyle)) {
144
+ parsedUnistyles.emplace(unistyle, true);
145
+ }
146
+ }
147
+ }
148
+
149
+ // parse whatever left in StyleSheets
150
+ for (auto styleSheet : styleSheets) {
151
+ for (auto& [_, unistyle] : styleSheet->unistyles) {
152
+ if (!parsedUnistyles.contains(unistyle)) {
153
+ parsedUnistyles.emplace(unistyle, true);
154
+ unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
155
+ this->rebuildUnistyle(rt, styleSheet, unistyle, {}, std::nullopt);
156
+ }
131
157
  }
132
158
  }
133
159
  }
@@ -24,7 +24,7 @@ struct Parser {
24
24
  void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
25
25
  void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
26
26
  void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
27
- void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
27
+ void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>> styleSheets);
28
28
  shadow::ShadowLeafUpdates dependencyMapToShadowLeafUpdates(core::DependencyMap& dependencyMap);
29
29
 
30
30
  private:
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBoxShadowStyle = void 0;
7
- var _typestyle = require("typestyle");
8
7
  var _utils = require("../utils");
9
8
  var _shadow = require("./shadow");
10
- var _breakpoint = require("./breakpoint");
11
9
  var _types = require("./types");
12
10
  var _utils2 = require("./utils");
13
11
  const createBoxShadowValue = style => {
@@ -57,17 +55,19 @@ const getBoxShadowStyle = styles => {
57
55
  } = (0, _utils2.extractShadowValue)('shadowOffset', breakpoint, styles);
58
56
  const radius = (0, _utils2.extractShadowValue)('shadowRadius', breakpoint, styles);
59
57
  const opacity = (0, _utils2.extractShadowValue)('shadowOpacity', breakpoint, styles);
60
- return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpoint), {
61
- boxShadow: createBoxShadowValue({
62
- shadowColor: color,
63
- shadowOffset: {
64
- width,
65
- height
66
- },
67
- shadowRadius: radius,
68
- shadowOpacity: opacity
69
- })
70
- });
58
+ return {
59
+ [breakpoint]: {
60
+ boxShadow: createBoxShadowValue({
61
+ shadowColor: color,
62
+ shadowOffset: {
63
+ width,
64
+ height
65
+ },
66
+ shadowRadius: radius,
67
+ shadowOpacity: opacity
68
+ })
69
+ }
70
+ };
71
71
  });
72
72
 
73
73
  // Merge all breakpoints styles into one
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_utils","_shadow","_breakpoint","_types","_utils2","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getBoxShadowStyle","styles","missingStyles","BOX_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","extractShadowValue","opacity","media","convertBreakpoint","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,MAAMM,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KA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GAAG,IAAAsB,0BAAkB,EAAC,aAAa,EAAED,UAAU,EAAElB,MAAM,CAAC;IACnE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IAChF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IACrE,MAAMoB,OAAO,GAAG,IAAAD,0BAAkB,EAAC,eAAe,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEvE,OAAO,IAAAqB,gBAAK,EAAC,IAAAC,6BAAiB,EAACJ,UAAU,CAAC,EAAE;MACxCH,SAAS,EAAE9B,oBAAoB,CAAC;QAC5BE,WAAW,EAAEU,KAAK;QAClBT,YAAY,EAAE;UACVK,KAAK;UACLE;QACJ,CAAC;QACDL,YAAY,EAAEM,MAAM;QACpBP,aAAa,EAAE+B;MACnB,CAAC;IACL,CAAC,CAAC;EACN,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAG,uBAAgB,EAAC,GAAGP,gBAAgB,CAAC;AAChD,CAAC;AAAAQ,OAAA,CAAAzB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_shadow","_types","_utils2","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getBoxShadowStyle","styles","missingStyles","BOX_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","extractShadowValue","opacity","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAM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,MAAmB;IACvD,CAAC;EACL;;EAEA;EACA,MAAMgB,gBAAgB,GAAGJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMrB,KAAK,GAAG,IAAAsB,0BAAkB,EAAC,aAAa,EAAED,UAAU,EAAElB,MAAM,CAAC;IACnE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IAChF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,cAAc,EAAED,UAAU,EAAElB,MAAM,CAAC;IACrE,MAAMoB,OAAO,GAAG,IAAAD,0BAAkB,EAAC,eAAe,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEvE,OAAO;MACH,CAACkB,UAAU,GAAG;QACVH,SAAS,EAAE9B,oBAAoB,CAAC;UAC5BE,WAAW,EAAEU,KAAK;UAClBT,YAAY,EAAE;YACVK,KAAK;YACLE;UACJ,CAAC;UACDL,YAAY,EAAEM,MAAM;UACpBP,aAAa,EAAE+B;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAC,uBAAgB,EAAC,GAAGL,gBAAgB,CAAC;AAChD,CAAC;AAAAM,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -3,17 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.convertToTypeStyle = void 0;
7
- var _typestyle = require("typestyle");
8
- var _pseudo = require("../pseudo");
9
- var _breakpoint = require("./breakpoint");
6
+ exports.convertUnistyles = void 0;
7
+ var _pseudo = require("./pseudo");
10
8
  var _style = require("./style");
11
9
  var _utils = require("../utils");
12
10
  var _transform = require("./transform");
13
11
  var _utils2 = require("./utils");
14
12
  var _textShadow = require("./textShadow");
15
13
  var _boxShadow = require("./boxShadow");
16
- const convertToTypeStyle = value => {
14
+ const convertUnistyles = value => {
17
15
  // Flag to mark if textShadow is already created
18
16
  let hasTextShadow = false;
19
17
  // Flag to mark if boxShadow is already created
@@ -29,11 +27,9 @@ const convertToTypeStyle = value => {
29
27
 
30
28
  // Pseudo classes :hover, :before etc.
31
29
  if ((0, _pseudo.isPseudo)(unistylesKey)) {
32
- const typestyleValues = convertToTypeStyle(unistylesValue);
30
+ const flattenValues = convertUnistyles(unistylesValue);
33
31
  return {
34
- $nest: {
35
- [unistylesKey.replace('_', '&:')]: typestyleValues
36
- }
32
+ [unistylesKey]: flattenValues
37
33
  };
38
34
  }
39
35
 
@@ -63,7 +59,9 @@ const convertToTypeStyle = value => {
63
59
  // Breakpoints
64
60
  if (typeof unistylesValue === 'object' && unistylesValue !== null) {
65
61
  return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
66
- return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpointKey), (0, _style.getStyle)(unistylesKey, breakpointValue));
62
+ return {
63
+ [breakpointKey]: (0, _style.getStyle)(unistylesKey, breakpointValue)
64
+ };
67
65
  });
68
66
  }
69
67
 
@@ -72,5 +70,5 @@ const convertToTypeStyle = value => {
72
70
  });
73
71
  return (0, _utils.deepMergeObjects)(...stylesArray);
74
72
  };
75
- exports.convertToTypeStyle = convertToTypeStyle;
73
+ exports.convertUnistyles = convertUnistyles;
76
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAA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E;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAO,IAAAiB,4BAAiB,EAACnB,KAAK,CAAC;IACnC;;IAEA;IACA,IAAI,IAAAoB,mBAAW,EAACZ,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAO,IAAAY,4BAAiB,EAACZ,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO,IAAAC,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,aAAa,CAAC,EAAE,IAAAI,eAAQ,EAACnB,YAAY,EAAEgB,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAG,eAAQ,EAACnB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAmB,uBAAgB,EAAC,GAAGzB,WAAW,CAAC;AAC3C,CAAC;AAAA0B,OAAA,CAAA9B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_pseudo","require","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","flattenValues","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAA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AAiB,EAACV,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACW,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAG,IAAAE,eAAQ,EAACf,YAAY,EAAEc,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAC,eAAQ,EAACf,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAe,uBAAgB,EAAC,GAAGrB,WAAW,CAAC;AAC3C,CAAC;AAAAsB,OAAA,CAAA1B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pseudos","exports","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.ts"],"mappings":";;;;;;AAAO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WA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CAAAC,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getStyle = void 0;
7
7
  var _utils = require("../utils");
8
- const stylesToSkip = ['borderCurve', 'elevation', 'textAlignVertical', 'includeFontPadding', 'overlayColor', 'tintColor'];
8
+ const SKIP_STYLES = ['borderCurve', 'elevation', 'textAlignVertical', 'includeFontPadding', 'overlayColor', 'tintColor'];
9
+ const CSS_NUMBER_KEYS = ['animationIterationCount', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'boxFlex', 'boxFlexGroup', 'boxOrdinalGroup', 'columnCount', 'columns', 'counterIncrement', 'counterReset', 'flex', 'flexGrow', 'flexPositive', 'flexShrink', 'flexNegative', 'flexOrder', 'fontWeight', 'gridArea', 'gridColumn', 'gridColumnEnd', 'gridColumnSpan', 'gridColumnStart', 'gridRow', 'gridRowEnd', 'gridRowSpan', 'gridRowStart', 'line-clamp', 'line-height', 'opacity', 'order', 'orphans', 'tabSize', 'widows', 'zIndex', 'zoom', 'fillOpacity', 'floodOpacity', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth'];
9
10
  const convertMap = {
10
11
  marginHorizontal: value => ({
11
12
  marginInline: value
@@ -69,20 +70,23 @@ const convertMap = {
69
70
  }),
70
71
  resizeMode: value => ({
71
72
  backgroundSize: value
72
- }),
73
- lineHeight: value => ({
74
- lineHeight: `${value}px`
75
73
  })
76
74
  };
75
+ const convertNumber = (key, value) => {
76
+ if (typeof value === 'number') {
77
+ return CSS_NUMBER_KEYS.includes(key, value) ? value : `${value}px`;
78
+ }
79
+ return value;
80
+ };
77
81
  const getStyle = (key, value) => {
78
- if (stylesToSkip.includes(key)) {
82
+ if (SKIP_STYLES.includes(key)) {
79
83
  return {};
80
84
  }
81
85
  if ((0, _utils.keyInObject)(convertMap, key)) {
82
- return convertMap[key]?.(value) ?? {};
86
+ return convertMap[key]?.(convertNumber(key, value)) ?? {};
83
87
  }
84
88
  return {
85
- [key]: value
89
+ [key]: convertNumber(key, value)
86
90
  };
87
91
  };
88
92
  exports.getStyle = getStyle;
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","stylesToSkip","convertMap","marginHorizontal","value","marginInline","marginVertical","marginBlock","paddingHorizontal","paddingInline","paddingVertical","paddingBlock","writingDirection","direction","borderBottomEndRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomLeftRadius","borderEndColor","borderInlineEndColor","borderStartColor","borderInlineStartColor","borderTopEndRadius","borderTopRightRadius","borderTopStartRadius","borderTopLeftRadius","borderEndWidth","borderInlineEndWidth","borderStartWidth","borderInlineStartWidth","end","right","start","left","marginEnd","marginRight","marginStart","marginLeft","paddingEnd","paddingRight","paddingStart","paddingLeft","transformMatrix","transform","join","resizeMode","backgroundSize","lineHeight","getStyle","key","includes","keyInObject","exports"],"sourceRoot":"../../../../src","sources":["web/convert/style.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,MAAMC,YAAY,GAAG,CACjB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,WAAW,CACd;AAED,MAAMC,UAAU,GAAG;EACfC,gBAAgB,EAAGC,KAAa,KAAM;IAClCC,YAAY,EAAED;EAClB,CAAC,CAAC;EACFE,cAAc,EAAGF,KAAa,KAAM;IAChCG,WAAW,EAAEH;EACjB,CAAC,CAAC;EACFI,iBAAiB,EAAGJ,KAAa,KAAM;IACnCK,aAAa,EAAEL;EACnB,CAAC,CAAC;EACFM,eAAe,EAAGN,KAAa,KAAM;IACjCO,YAAY,EAAEP;EAClB,CAAC,CAAC;EACFQ,gBAAgB,EAAGR,KAAa,KAAM;IAClCS,SAAS,EAAET;EACf,CAAC,CAAC;EACFU,qBAAqB,EAAGV,KAAa,KAAM;IACvCW,uBAAuB,EAAEX;EAC7B,CAAC,CAAC;EACFY,uBAAuB,EAAGZ,K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AAK;EACxB,CAAC;AACL,CAA6D;AAEtD,MAAM4C,QAAQ,GAAGA,CAACC,GAAW,EAAE7C,KAAU,KAAK;EACjD,IAAIH,YAAY,CAACiD,QAAQ,CAACD,GAAG,CAAC,EAAE;IAC5B,OAAO,CAAC,CAAC;EACb;EAEA,IAAI,IAAAE,kBAAW,EAACjD,UAAU,EAAE+C,GAAG,CAAC,EAAE;IAC9B,OAAO/C,UAAU,CAAC+C,GAAG,CAAC,GAAG7C,KAAK,CAAC,IAAI,CAAC,CAAC;EACzC;EAEA,OAAO;IACH,CAAC6C,GAAG,GAAG7C;EACX,CAAC;AACL,CAAC;AAAAgD,OAAA,CAAAJ,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","SKIP_STYLES","CSS_NUMBER_KEYS","convertMap","marginHorizontal","value","marginInline","marginVertical","marginBlock","paddingHorizontal","paddingInline","paddingVertical","paddingBlock","writingDirection","direction","borderBottomEndRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomLeftRadius","borderEndColor","borderInlineEndColor","borderStartColor","borderInlineStartColor","borderTopEndRadius","borderTopRightRadius","borderTopStartRadius","borderTopLeftRadius","borderEndWidth","borderInlineEndWidth","borderStartWidth","borderInlineStartWidth","end","right","start","left","marginEnd","marginRight","marginStart","marginLeft","paddingEnd","paddingRight","paddingStart","paddingLeft","transformMatrix","transform","join","resizeMode","backgroundSize","convertNumber","key","includes","getStyle","keyInObject","exports"],"sourceRoot":"../../../../src","sources":["web/convert/style.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,WAAW,GAAG,CAChB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,WAAW,CACd;AAED,MAAMC,eAAe,GAAG,CACpB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,E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b;EAEA,IAAI,IAAAG,kBAAW,EAACjD,UAAU,EAAE8C,GAAG,CAAC,EAAE;IAC9B,OAAO9C,UAAU,CAAC8C,GAAG,CAAC,GAAGD,aAAa,CAACC,GAAG,EAAE5C,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;EAC7D;EAEA,OAAO;IACH,CAAC4C,GAAG,GAAGD,aAAa,CAACC,GAAG,EAAE5C,KAAK;EACnC,CAAC;AACL,CAAC;AAAAgD,OAAA,CAAAF,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getTextShadowStyle = void 0;
7
- var _typestyle = require("typestyle");
8
7
  var _utils = require("../utils");
9
8
  var _shadow = require("./shadow");
10
- var _breakpoint = require("./breakpoint");
11
9
  var _types = require("./types");
12
10
  var _utils2 = require("./utils");
13
11
  const createTextShadowValue = style => {
@@ -54,16 +52,18 @@ const getTextShadowStyle = styles => {
54
52
  height
55
53
  } = (0, _utils2.extractShadowValue)('textShadowOffset', breakpoint, styles);
56
54
  const radius = (0, _utils2.extractShadowValue)('textShadowRadius', breakpoint, styles);
57
- return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpoint), {
58
- textShadow: createTextShadowValue({
59
- textShadowColor: color,
60
- textShadowOffset: {
61
- width,
62
- height
63
- },
64
- textShadowRadius: radius
65
- })
66
- });
55
+ return {
56
+ [breakpoint]: {
57
+ textShadow: createTextShadowValue({
58
+ textShadowColor: color,
59
+ textShadowOffset: {
60
+ width,
61
+ height
62
+ },
63
+ textShadowRadius: radius
64
+ })
65
+ }
66
+ };
67
67
  });
68
68
 
69
69
  // Merge all breakpoints styles into one
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_utils","_shadow","_breakpoint","_types","_utils2","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getTextShadowStyle","styles","missingStyles","TEXT_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","textShadow","breakpointStyles","map","breakpoint","extractShadowValue","media","convertBreakpoint","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/textShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,MAAMM,qBAAqB,GAAIC,KAAiB,IAAK;EACjD,MAAM;IAAEC,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGH,KAAK;EACrE,MAAMI,OAAO,GAAG,IAAAC,6BAAqB,EAACH,gBAAgB,CAACI,KAAK,CAAC;EAC7D,MAAMC,OAAO,GAAG,IAAAF,6BAAqB,EAACH,gBAAgB,CAACM,MAAM,CAAC;EAC9D,MAAMC,MAAM,GAAG,IAAAJ,6BAAqB,EAACF,gBAAgB,CAAC;EACtD,MAAMO,KAAK,GAAG,IAAAC,sBAAc,EAACV,eAAyB,CAAC;EAEvD,OAAO,GAAGG,OAAO,IAAIG,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAEM,MAAME,kBAAkB,GAAIC,MAA2B,IAA0B;EACpF,MAAMC,aAAa,GAAGC,yBAAkB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAExE,IAAIC,aAAa,CAACI,MAAM,EAAE;IACtB,IAAAC,WAAI,EAAC,yDAAyDL,aAAa,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAEzF,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAExC,IAAI;IACA,IAAAC,sBAAc,EAACR,yBAAkB,EAAEF,MAAM,EAAEQ,cAAc,CAAC;EAC9D,CAAC,CAAC,OAAOG,KAAK,EAAE;IACZ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC3B,IAAAL,WAAI,EAACK,KAAK,CAAC;IACf;IAEA,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,WAAW,GAAGC,KAAK,CAACC,IAAI,CAACN,cAAc,CAAC;;EAE9C;EACA,IAAII,WAAW,CAACP,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHU,UAAU,EAAE7B,qBAAqB,CAACc,MAAoB;IAC1D,CAAC;EACL;;EAEA;EACA,MAAMgB,gBAAgB,GAAGJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMrB,KAAK,GAAG,IAAAsB,0BAAkB,EAAC,iBAAiB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACvE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACpF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEzE,OAAO,IAAAoB,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,UAAU,CAAC,EAAE;MACxCH,UAAU,EAAE7B,qBAAqB,CAAC;QAC9BE,eAAe,EAAES,KAAK;QACtBR,gBAAgB,EAAE;UACdI,KAAK;UACLE;QACJ,CAAC;QACDL,gBAAgB,EAAEM;MACtB,CAAC;IACL,CAAC,CAAC;EACN,CAAC,CAAC;;EAEF;EACA,OAAO,IAAA0B,uBAAgB,EAAC,GAAGN,gBAAgB,CAAC;AAChD,CAAC;AAAAO,OAAA,CAAAxB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_shadow","_types","_utils2","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getTextShadowStyle","styles","missingStyles","TEXT_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","textShadow","breakpointStyles","map","breakpoint","extractShadowValue","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/textShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAMI,qBAAqB,GAAIC,KAAiB,IAAK;EACjD,MAAM;IAAEC,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGH,KAAK;EACrE,MAAMI,OAAO,GAAG,IAAAC,6BAAqB,EAACH,gBAAgB,CAACI,KAAK,CAAC;EAC7D,MAAMC,OAAO,GAAG,IAAAF,6BAAqB,EAACH,gBAAgB,CAACM,MAAM,CAAC;EAC9D,MAAMC,MAAM,GAAG,IAAAJ,6BAAqB,EAACF,gBAAgB,CAAC;EACtD,MAAMO,KAAK,GAAG,IAAAC,sBAAc,EAACV,eAAyB,CAAC;EAEvD,OAAO,GAAGG,OAAO,IAAIG,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAEM,MAAME,kBAAkB,GAAIC,MAA2B,IAAK;EAC/D,MAAMC,aAAa,GAAGC,yBAAkB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAExE,IAAIC,aAAa,CAACI,MAAM,EAAE;IACtB,IAAAC,WAAI,EAAC,yDAAyDL,aAAa,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAEzF,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAExC,IAAI;IACA,IAAAC,sBAAc,EAACR,yBAAkB,EAAEF,MAAM,EAAEQ,cAAc,CAAC;EAC9D,CAAC,CAAC,OAAOG,KAAK,EAAE;IACZ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC3B,IAAAL,WAAI,EAACK,KAAK,CAAC;IACf;IAEA,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,WAAW,GAAGC,KAAK,CAACC,IAAI,CAACN,cAAc,CAAC;;EAE9C;EACA,IAAII,WAAW,CAACP,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHU,UAAU,EAAE7B,qBAAqB,CAACc,MAAoB;IAC1D,CAAC;EACL;;EAEA;EACA,MAAMgB,gBAAgB,GAAGJ,WAAW,CAACK,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMrB,KAAK,GAAG,IAAAsB,0BAAkB,EAAC,iBAAiB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACvE,MAAM;MAAEP,KAAK;MAAEE;IAAO,CAAC,GAAG,IAAAwB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IACpF,MAAMJ,MAAM,GAAG,IAAAuB,0BAAkB,EAAC,kBAAkB,EAAED,UAAU,EAAElB,MAAM,CAAC;IAEzE,OAAO;MACH,CAACkB,UAAU,GAAG;QACVH,UAAU,EAAE7B,qBAAqB,CAAC;UAC9BE,eAAe,EAAES,KAAK;UACtBR,gBAAgB,EAAE;YACdI,KAAK;YACLE;UACJ,CAAC;UACDL,gBAAgB,EAAEM;QACtB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAwB,uBAAgB,EAAC,GAAGJ,gBAAgB,CAAC;AAChD,CAAC;AAAAK,OAAA,CAAAtB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getTransformStyle = void 0;
7
- var _typestyle = require("typestyle");
8
7
  var _utils = require("../utils");
9
8
  var _utils2 = require("./utils");
10
- var _breakpoint = require("./breakpoint");
11
9
  const normalizeTransform = (key, value) => {
12
10
  if (key.includes('scale')) {
13
11
  return value;
@@ -60,9 +58,11 @@ const getTransformStyle = transforms => {
60
58
  }
61
59
  return [];
62
60
  });
63
- return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpoint), {
64
- transform: createTransformValue(transformsPerBreakpoint)
65
- });
61
+ return [{
62
+ [breakpoint]: {
63
+ transform: createTransformValue(transformsPerBreakpoint)
64
+ }
65
+ }];
66
66
  });
67
67
  return (0, _utils.deepMergeObjects)({
68
68
  transform: createTransformValue(normalTransforms)
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_utils","_utils2","_breakpoint","normalizeTransform","key","value","includes","normalizeNumericValue","createTransformValue","transforms","map","transform","Object","keys","undefined","join","filter","Boolean","getTransformStyle","breakpoints","Set","normalTransforms","forEach","property","Array","isArray","breakpoint","add","push","breakpointTransforms","from","flatMap","transformsPerBreakpoint","keyInObject","media","convertBreakpoint","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/transform.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAIA,MAAMI,kBAAkB,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAK;EACpD,IAAID,GAAG,CAACE,QAAQ,CAAC,OAAO,CAAC,EAAE;IACvB,OAAOD,KAAK;EAChB;EAEA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAO,IAAAE,6BAAqB,EAACF,KAAK,CAAC;EACvC;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,MAAMG,oBAAoB,GAAIC,UAAsB,IAAKA,UAAU,CAC9DC,GAAG,CAACC,SAAS,IAAI;EACd,MAAM,CAACP,GAAG,CAAC,GAAGQ,MAAM,CAACC,IAAI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C5D,MAAM,CAACY,QAAQ,CAAC,GAAGX,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;MAEzC,IAAI,CAACY,QAAQ,EAAE;QACX,OAAO,EAAE;MACb;MAEA,MAAMlB,KAAK,GAAGM,SAAS,CAACY,QAAQ,CAAC;MAEjC,IAAI,OAAOlB,KAAK,KAAK,QAAQ,IAAI,CAACmB,KAAK,CAACC,OAAO,CAACpB,KAAK,CAAC,EAAE;QACpD,OAAO,IAAA4B,kBAAW,EAAC5B,KAAK,EAAEqB,UAAU,CAAC,GAAG,CAAC;UAAE,CAACH,QAAQ,GAAGlB,KAAK,CAACqB,UAAU;QAAE,CAAC,CAAC,GAAG,EAAE;MACpF;MAEA,OAAO,EAAE;IACb,CAAC,CAAC;IAEF,OAAO,IAAAQ,gBAAK,EAAC,IAAAC,6BAAiB,EAACT,UAAU,CAAC,EAAE;MACxCf,SAAS,EAAEH,oBAAoB,CAACwB,uBAAuB;IAC3D,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO,IAAAI,uBAAgB,EAAC;IACpBzB,SAAS,EAAEH,oBAAoB,CAACa,gBAAgB;EACpD,CAAC,EAAE,GAAGQ,oBAAoB,CAAC;AAC/B,CAAC;AAAAQ,OAAA,CAAAnB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_utils2","normalizeTransform","key","value","includes","normalizeNumericValue","createTransformValue","transforms","map","transform","Object","keys","undefined","join","filter","Boolean","getTransformStyle","breakpoints","Set","normalTransforms","forEach","property","Array","isArray","breakpoint","add","push","breakpointTransforms","from","flatMap","transformsPerBreakpoint","keyInObject","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/transform.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAIA,MAAME,kBAAkB,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAK;EACpD,IAAID,GAAG,CAACE,QAAQ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OAAO,CAACI,UAAU,IAAIP,WAAW,CAACQ,GAAG,CAACD,UAAU,CAAC,CAAC;MAErE;IACJ;IAEAL,gBAAgB,CAACO,IAAI,CAACjB,SAAS,CAAC;EACpC,CAAC,CAAC;EAEF,MAAMkB,oBAAoB,GAAGL,KAAK,CAACM,IAAI,CAACX,WAAW,CAAC,CAACY,OAAO,CAACL,UAAU,IAAI;IACvE,MAAMM,uBAAuB,GAAGvB,UAAU,CAACsB,OAAO,CAACpB,SAAS,IAAI;MAC5D,MAAM,CAACY,QAAQ,CAAC,GAAGX,MAAM,CAACC,IAAI,CAACF,SAAS,CAAC;MAEzC,IAAI,CAACY,QAAQ,EAAE;QACX,OAAO,EAAE;MACb;MAEA,MAAMlB,KAAK,GAAGM,SAAS,CAACY,QAAQ,CAAC;MAEjC,IAAI,OAAOlB,KAAK,KAAK,QAAQ,IAAI,CAACmB,KAAK,CAACC,OAAO,CAACpB,KAAK,CAAC,EAAE;QACpD,OAAO,IAAA4B,kBAAW,EAAC5B,KAAK,EAAEqB,UAAU,CAAC,GAAG,CAAC;UAAE,CAACH,QAAQ,GAAGlB,KAAK,CAACqB,UAAU;QAAE,CAAC,CAAC,GAAG,EAAE;MACpF;MAEA,OAAO,EAAE;IACb,CAAC,CAAC;IAEF,OAAO,CAAC;MACJ,CAACA,UAAU,GAAG;QACVf,SAAS,EAAEH,oBAAoB,CAACwB,uBAAuB;MAC3D;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO,IAAAE,uBAAgB,EAAsB;IACzCvB,SAAS,EAAEH,oBAAoB,CAACa,gBAAgB;EACpD,CAAC,EAAE,GAAGQ,oBAAoB,CAAC;AAC/B,CAAC;AAAAM,OAAA,CAAAjB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnistylesListener = void 0;
7
- var _NativePlatform = require("../../specs/NativePlatform");
8
- var _runtime = require("../runtime");
7
+ var _NativePlatform = require("../specs/NativePlatform");
8
+ var _runtime = require("./runtime");
9
9
  class UnistylesListenerBuilder {
10
10
  isInitialized = false;
11
11
  listeners = Array.from({
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativePlatform","require","_runtime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","UnistyleDependency","Set","emitChange","dependency","forEach","listener","initListeners","UnistylesRuntime","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener","exports"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACC,kCAAkB,CAAC,CAACH,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAII,GAAG,CAAe,CAAC,CAAC;EAErHC,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACb,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;IACzBc,yBAAgB,CAACC,SAAS,EAAEC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACU,WAAW,CAAC,CAAC;IAC7GH,yBAAgB,CAACI,UAAU,EAAEF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACU,WAAW,CAAC,CAAC;IAC9GE,MAAM,CAACH,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACa,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACF,kCAAkB,CAACc,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEX,QAAsB,KAAK;IAChFW,YAAY,CAACZ,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEc,GAAG,CAACZ,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTW,YAAY,CAACZ,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEe,MAAM,CAACb,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;AACL;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAI3B,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","minWidth","undefined","Number","maxWidth","minHeight","maxHeight","exports","isUnistylesMq","test"],"sourceRoot":"../../../src","sources":["web/mq.ts"],"mappings":";;;;;;AAEA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAE7D,MAAMC,OAAO,GAAIC,EAAU,IAAiB;EAC/C,MAAM,GAAGC,KAAK,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGN,qBAAqB,CAACO,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAClE,MAAM,GAAGK,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGT,sBAAsB,CAACM,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHQ,QAAQ,EAAE,CAACP,KAAK,IAAIC,KAAK,KAAK,UAAU,GAAGO,SAAS,GAAGC,MAAM,CAACR,KAAK,CAAC;IACpES,QAAQ,EAAE,CAACV,KAAK,IAAIE,GAAG,KAAK,UAAU,GAAGM,SAAS,GAAGC,MAAM,CAACP,GAAG,CAAC;IAChES,SAAS,EAAE,CAACP,MAAM,IAAIC,KAAK,KAAK,UAAU,GAAGG,SAAS,GAAGC,MAAM,CAACJ,KAAK,CAAC;IACtEO,SAAS,EAAE,CAACR,MAAM,IAAIE,GAAG,KAAK,UAAU,GAAGE,SAAS,GAAGC,MAAM,CAACH,GAAG;EACrE,CAAC;AACL,CAAC;AAAAO,OAAA,CAAAf,OAAA,GAAAA,OAAA;AAEM,MAAMgB,aAAa,GAAIf,EAAU,IAAKJ,kBAAkB,CAACoB,IAAI,CAAChB,EAAE,CAAC;AAAAc,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","parseMq","mq","width","fromW","toW","exec","height","fromH","toH","minWidth","undefined","Number","maxWidth","minHeight","maxHeight","exports","isUnistylesMq","test"],"sourceRoot":"../../../src","sources":["web/mq.ts"],"mappings":";;;;;;AAAA,MAAMA,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAE7D,MAAMC,OAAO,GAAIC,EAAU,IAAK;EACnC,MAAM,GAAGC,KAAK,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGN,qBAAqB,CAACO,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAClE,MAAM,GAAGK,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,GAAGT,sBAAsB,CAACM,IAAI,CAACJ,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHQ,QAAQ,EAAE,CAACP,KAAK,IAAIC,KAAK,KAAK,UAAU,GAAGO,SAAS,GAAGC,MAAM,CAACR,KAAK,CAAC;IACpES,QAAQ,EAAE,CAACV,KAAK,IAAIE,GAAG,KAAK,UAAU,GAAGM,SAAS,GAAGC,MAAM,CAACP,GAAG,CAAC;IAChES,SAAS,EAAE,CAACP,MAAM,IAAIC,KAAK,KAAK,UAAU,GAAGG,SAAS,GAAGC,MAAM,CAACJ,KAAK,CAAC;IACtEO,SAAS,EAAE,CAACR,MAAM,IAAIE,GAAG,KAAK,UAAU,GAAGE,SAAS,GAAGC,MAAM,CAACH,GAAG;EACrE,CAAC;AACL,CAAC;AAAAO,OAAA,CAAAf,OAAA,GAAAA,OAAA;AAEM,MAAMgB,aAAa,GAAIf,EAAU,IAAKJ,kBAAkB,CAACoB,IAAI,CAAChB,EAAE,CAAC;AAAAc,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}