react-native-unistyles 3.0.0-alpha.20 → 3.0.0-alpha.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/cxx/common/Constants.h +1 -0
  2. package/cxx/core/UnistyleWrapper.h +21 -41
  3. package/cxx/hybridObjects/HybridStyleSheet.cpp +1 -1
  4. package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
  5. package/lib/commonjs/web/convert/boxShadow.js +13 -13
  6. package/lib/commonjs/web/convert/boxShadow.js.map +1 -1
  7. package/lib/commonjs/web/convert/index.js +9 -11
  8. package/lib/commonjs/web/convert/index.js.map +1 -1
  9. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  10. package/lib/commonjs/web/convert/style.js +11 -7
  11. package/lib/commonjs/web/convert/style.js.map +1 -1
  12. package/lib/commonjs/web/convert/textShadow.js +12 -12
  13. package/lib/commonjs/web/convert/textShadow.js.map +1 -1
  14. package/lib/commonjs/web/convert/transform.js +5 -5
  15. package/lib/commonjs/web/convert/transform.js.map +1 -1
  16. package/lib/commonjs/web/{listener/listener.js → listener.js} +2 -2
  17. package/lib/commonjs/web/listener.js.map +1 -0
  18. package/lib/commonjs/web/mq.js.map +1 -1
  19. package/lib/commonjs/web/registry.js +159 -21
  20. package/lib/commonjs/web/registry.js.map +1 -1
  21. package/lib/commonjs/web/shadowRegistry.js +50 -48
  22. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  23. package/lib/commonjs/web/state.js +8 -16
  24. package/lib/commonjs/web/state.js.map +1 -1
  25. package/lib/commonjs/web/{utils.js → utils/common.js} +9 -47
  26. package/lib/commonjs/web/utils/common.js.map +1 -0
  27. package/lib/commonjs/web/utils/index.js +28 -0
  28. package/lib/commonjs/web/utils/index.js.map +1 -0
  29. package/lib/commonjs/web/utils/unistyle.js +82 -0
  30. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  31. package/lib/module/web/convert/boxShadow.js +13 -13
  32. package/lib/module/web/convert/boxShadow.js.map +1 -1
  33. package/lib/module/web/convert/index.js +7 -9
  34. package/lib/module/web/convert/index.js.map +1 -1
  35. package/lib/module/web/convert/pseudo.js.map +1 -0
  36. package/lib/module/web/convert/style.js +11 -7
  37. package/lib/module/web/convert/style.js.map +1 -1
  38. package/lib/module/web/convert/textShadow.js +12 -12
  39. package/lib/module/web/convert/textShadow.js.map +1 -1
  40. package/lib/module/web/convert/transform.js +5 -5
  41. package/lib/module/web/convert/transform.js.map +1 -1
  42. package/lib/module/web/{listener/listener.js → listener.js} +2 -2
  43. package/lib/module/web/listener.js.map +1 -0
  44. package/lib/module/web/mq.js.map +1 -1
  45. package/lib/module/web/registry.js +160 -22
  46. package/lib/module/web/registry.js.map +1 -1
  47. package/lib/module/web/shadowRegistry.js +51 -49
  48. package/lib/module/web/shadowRegistry.js.map +1 -1
  49. package/lib/module/web/state.js +8 -16
  50. package/lib/module/web/state.js.map +1 -1
  51. package/lib/module/web/{utils.js → utils/common.js} +7 -39
  52. package/lib/module/web/utils/common.js.map +1 -0
  53. package/lib/module/web/utils/index.js +5 -0
  54. package/lib/module/web/utils/index.js.map +1 -0
  55. package/lib/module/web/utils/unistyle.js +69 -0
  56. package/lib/module/web/utils/unistyle.js.map +1 -0
  57. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts +3 -0
  58. package/lib/typescript/expo-example/app/(tabs)/_layout.d.ts.map +1 -0
  59. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts +3 -0
  60. package/lib/typescript/expo-example/app/(tabs)/explore.d.ts.map +1 -0
  61. package/lib/typescript/expo-example/app/(tabs)/index.d.ts +3 -0
  62. package/lib/typescript/expo-example/app/(tabs)/index.d.ts.map +1 -0
  63. package/lib/typescript/expo-example/app/+html.d.ts +4 -0
  64. package/lib/typescript/expo-example/app/+html.d.ts.map +1 -0
  65. package/lib/typescript/expo-example/app/+not-found.d.ts +3 -0
  66. package/lib/typescript/expo-example/app/+not-found.d.ts.map +1 -0
  67. package/lib/typescript/expo-example/app/_layout.d.ts +3 -0
  68. package/lib/typescript/expo-example/app/_layout.d.ts.map +1 -0
  69. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
  70. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  71. package/lib/typescript/src/types/stylesheet.d.ts +1 -1
  72. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  73. package/lib/typescript/src/web/convert/boxShadow.d.ts +7 -2
  74. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -1
  75. package/lib/typescript/src/web/convert/index.d.ts +1 -2
  76. package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
  77. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  78. package/lib/typescript/src/web/convert/style.d.ts +1 -2
  79. package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
  80. package/lib/typescript/src/web/convert/textShadow.d.ts +7 -2
  81. package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -1
  82. package/lib/typescript/src/web/convert/transform.d.ts +1 -2
  83. package/lib/typescript/src/web/convert/transform.d.ts.map +1 -1
  84. package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +1 -1
  85. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  86. package/lib/typescript/src/web/mq.d.ts +6 -2
  87. package/lib/typescript/src/web/mq.d.ts.map +1 -1
  88. package/lib/typescript/src/web/registry.d.ts +21 -8
  89. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  90. package/lib/typescript/src/web/shadowRegistry.d.ts +3 -4
  91. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  92. package/lib/typescript/src/web/state.d.ts +2 -2
  93. package/lib/typescript/src/web/state.d.ts.map +1 -1
  94. package/lib/typescript/src/web/{utils.d.ts → utils/common.d.ts} +2 -20
  95. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  96. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  97. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  98. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  99. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  100. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  101. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +8 -8
  102. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +22 -22
  103. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  104. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +1 -1
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +2 -2
  106. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +2 -2
  107. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  108. package/nitrogen/generated/ios/Unistyles+autolinking.rb +5 -3
  109. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  110. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +32 -32
  111. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  112. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +0 -12
  113. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +134 -110
  114. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  115. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  116. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  117. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  118. package/package.json +4 -15
  119. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
  120. package/src/types/stylesheet.ts +1 -1
  121. package/src/web/convert/boxShadow.ts +14 -15
  122. package/src/web/convert/index.ts +6 -13
  123. package/src/web/convert/style.ts +61 -10
  124. package/src/web/convert/textShadow.ts +13 -14
  125. package/src/web/convert/transform.ts +7 -8
  126. package/src/web/{listener/listener.ts → listener.ts} +2 -2
  127. package/src/web/mq.ts +1 -3
  128. package/src/web/registry.ts +202 -23
  129. package/src/web/shadowRegistry.ts +49 -49
  130. package/src/web/state.ts +13 -23
  131. package/src/web/{utils.ts → utils/common.ts} +6 -68
  132. package/src/web/utils/index.ts +2 -0
  133. package/src/web/utils/unistyle.ts +104 -0
  134. package/lib/commonjs/web/convert/breakpoint.js +0 -25
  135. package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
  136. package/lib/commonjs/web/createUnistylesComponent.js +0 -61
  137. package/lib/commonjs/web/createUnistylesComponent.js.map +0 -1
  138. package/lib/commonjs/web/listener/index.js +0 -20
  139. package/lib/commonjs/web/listener/index.js.map +0 -1
  140. package/lib/commonjs/web/listener/listenToDependencies.js +0 -38
  141. package/lib/commonjs/web/listener/listenToDependencies.js.map +0 -1
  142. package/lib/commonjs/web/listener/listener.js.map +0 -1
  143. package/lib/commonjs/web/pseudo.js.map +0 -1
  144. package/lib/commonjs/web/utils.js.map +0 -1
  145. package/lib/module/web/convert/breakpoint.js +0 -20
  146. package/lib/module/web/convert/breakpoint.js.map +0 -1
  147. package/lib/module/web/createUnistylesComponent.js +0 -54
  148. package/lib/module/web/createUnistylesComponent.js.map +0 -1
  149. package/lib/module/web/listener/index.js +0 -5
  150. package/lib/module/web/listener/index.js.map +0 -1
  151. package/lib/module/web/listener/listenToDependencies.js +0 -33
  152. package/lib/module/web/listener/listenToDependencies.js.map +0 -1
  153. package/lib/module/web/listener/listener.js.map +0 -1
  154. package/lib/module/web/pseudo.js.map +0 -1
  155. package/lib/module/web/utils.js.map +0 -1
  156. package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
  157. package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
  158. package/lib/typescript/src/web/createUnistylesComponent.d.ts +0 -3
  159. package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +0 -1
  160. package/lib/typescript/src/web/listener/index.d.ts +0 -3
  161. package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
  162. package/lib/typescript/src/web/listener/listenToDependencies.d.ts +0 -12
  163. package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +0 -1
  164. package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
  165. package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
  166. package/lib/typescript/src/web/utils.d.ts.map +0 -1
  167. package/src/web/convert/breakpoint.ts +0 -21
  168. package/src/web/createUnistylesComponent.tsx +0 -54
  169. package/src/web/listener/index.ts +0 -2
  170. package/src/web/listener/listenToDependencies.ts +0 -45
  171. /package/lib/commonjs/web/{pseudo.js → convert/pseudo.js} +0 -0
  172. /package/lib/module/web/{pseudo.js → convert/pseudo.js} +0 -0
  173. /package/lib/typescript/src/web/{pseudo.d.ts → convert/pseudo.d.ts} +0 -0
  174. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  175. /package/src/web/{pseudo.ts → convert/pseudo.ts} +0 -0
@@ -8,5 +8,6 @@ static const std::string STYLE_DEPENDENCIES = "uni__dependencies";
8
8
  static const std::string STYLE_VARIANTS = "uni__variants";
9
9
  static const std::string WEB_STYLE_KEY = "_web";
10
10
  static const std::string EXOTIC_STYLE_KEY = "_exotic";
11
+ static const std::string NAME_STYLE_KEY = "__unistyles_name";
11
12
 
12
13
  }
@@ -17,34 +17,6 @@ struct UnistyleWrapper: public jsi::NativeState {
17
17
  Unistyle::Shared unistyle;
18
18
  };
19
19
 
20
- inline static std::string generateStyleKey(std::string& key, int tag) {
21
- return std::string("__unid_").append(std::to_string(tag)).append("_").append(key).c_str();
22
- }
23
-
24
- inline static Unistyle::Shared unistyleFromKey(jsi::Runtime& rt, const std::string& key) {
25
- std::string prefix = "__unid_";
26
-
27
- if (key.substr(0, prefix.length()) != prefix) {
28
- return nullptr;
29
- }
30
-
31
- std::string remaining = key.substr(prefix.length());
32
-
33
- size_t underscorePos = remaining.find('_');
34
-
35
- if (underscorePos == std::string::npos) {
36
- return nullptr;
37
- }
38
-
39
- std::string tagStr = remaining.substr(0, underscorePos);
40
-
41
- auto& registry = UnistylesRegistry::get();
42
- auto tag = std::stoi(tagStr);
43
- auto styleKey = remaining.substr(underscorePos + 1);
44
-
45
- return registry.findUnistyleFromKey(rt, styleKey, tag);
46
- }
47
-
48
20
  inline static Unistyle::Shared unistyleFromStaticStyleSheet(jsi::Runtime& rt, jsi::Object& value) {
49
21
  auto exoticUnistyle = std::make_shared<Unistyle>(
50
22
  UnistyleType::Object,
@@ -60,21 +32,29 @@ inline static Unistyle::Shared unistyleFromStaticStyleSheet(jsi::Runtime& rt, js
60
32
 
61
33
 
62
34
  inline static std::vector<Unistyle::Shared> unistylesFromNonExistentNativeState(jsi::Runtime& rt, jsi::Object& value) {
63
- std::vector<Unistyle::Shared> foundUnistyles{};
64
-
65
- helpers::enumerateJSIObject(rt, value, [&](const std::string& key, jsi::Value& value){
66
- auto maybeUnistyle = unistyleFromKey(rt, key);
35
+ auto hasUnistyleName = value.hasProperty(rt, helpers::NAME_STYLE_KEY.c_str());
67
36
 
68
- if (maybeUnistyle != nullptr) {
69
- foundUnistyles.emplace_back(maybeUnistyle);
70
- }
71
- });
72
-
73
- if (foundUnistyles.size() == 0) {
37
+ // return wrapped RN/inline style
38
+ if (!hasUnistyleName) {
74
39
  return {unistyleFromStaticStyleSheet(rt, value)};
75
40
  }
76
41
 
77
- return foundUnistyles;
42
+ throw jsi::JSError(rt, R"(Unistyles: Style is not bound!
43
+
44
+ Potential reasons:
45
+ - You likely used the spread operator on a Unistyle style outside of a JSX component
46
+
47
+ If you need to merge styles, do it within the style prop of your JSX component:
48
+
49
+ style={{...styles.container, ...styles.otherProp}}
50
+ or
51
+ style={[styles.container, styles.otherProp]}
52
+
53
+ If you pass computed style prop to component use array syntax:
54
+
55
+ customStyleProp={[styles.container, styles.otherProp]}
56
+
57
+ Copying a Unistyle style outside of a JSX element will remove its internal C++ state, leading to unexpected behavior.)");
78
58
  }
79
59
 
80
60
  inline static std::vector<Unistyle::Shared> unistyleFromValue(jsi::Runtime& rt, const jsi::Value& value) {
@@ -99,7 +79,7 @@ inline static jsi::Value valueFromUnistyle(jsi::Runtime& rt, Unistyle::Shared un
99
79
  jsi::Object obj = jsi::Object(rt);
100
80
 
101
81
  obj.setNativeState(rt, std::move(wrappedUnistyle));
102
- obj.setProperty(rt, std::string("__unid_").append(std::to_string(tag)).append("_").append(unistyle->styleKey).c_str(), jsi::Value::undefined());
82
+ obj.setProperty(rt, helpers::NAME_STYLE_KEY.c_str(), jsi::String::createFromUtf8(rt, unistyle->styleKey));
103
83
 
104
84
  helpers::mergeJSIObjects(rt, obj, unistyle->parsedStyle.value());
105
85
 
@@ -110,7 +90,7 @@ inline static jsi::Value valueFromUnistyle(jsi::Runtime& rt, Unistyle::Shared un
110
90
  auto hostFn = jsi::Value(rt, unistyleFn->proxiedFunction.value()).asObject(rt).asFunction(rt);
111
91
 
112
92
  hostFn.setNativeState(rt, std::move(wrappedUnistyle));
113
- hostFn.setProperty(rt, std::string("__unid_").append(std::to_string(tag)).append("_").append(unistyleFn->styleKey).c_str(), jsi::Value::undefined());
93
+ hostFn.setProperty(rt, helpers::NAME_STYLE_KEY.c_str(), jsi::String::createFromUtf8(rt, unistyleFn->styleKey));
114
94
 
115
95
  return std::move(hostFn);
116
96
  }
@@ -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
 
@@ -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);
@@ -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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,CAACC,IAAI,CAACN,cAAc,CAAC;;EAE9C;EACA,IAAII,WAAW,CAACP,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHU,SAAS,EAAE9B,oBAAoB,CAACe,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,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,MAAMI,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAG,IAAAC,6BAAqB,EAACJ,YAAY,CAACK,KAAK,CAAC;EACzD,MAAMC,OAAO,GAAG,IAAAF,6BAAqB,EAACJ,YAAY,CAACO,MAAM,CAAC;EAC1D,MAAMC,MAAM,GAAG,IAAAJ,6BAAqB,EAACF,YAAY,CAAC;EAClD,MAAMO,KAAK,GAAG,IAAAC,sBAAc,EAACX,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAO,GAAGE,OAAO,IAAIG,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAEM,MAAME,iBAAiB,GAAIC,MAA2B,IAAK;EAC9D,MAAMC,aAAa,GAAGC,wBAAiB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAEvE,IAAIC,aAAa,CAACI,MAAM,EAAE;IACtB,IAAAC,WAAI,EAAC,wDAAwDL,aAAa,CAACM,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAExF,OAAO,CAAC,CAAC;EACb;EAEA,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAExC,IAAI;IACA,IAAAC,sBAAc,EAACR,wBAAiB,EAAEF,MAAM,EAAEQ,cAAc,CAAC;EAC7D,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,SAAS,EAAE9B,oBAAoB,CAACe,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,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEO,MAAMS,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACG,UAAU,CAAC,UAAU,CAAC,EAAE;MACrK,OAAO,EAAE;IACb;;IAEA;IACA,IAAI,IAAAC,gBAAQ,EAACJ,YAAY,CAAC,EAAE;MACxB,MAAMK,eAAe,GAAGd,kBAAkB,CAACU,cAAiC,CAAC;MAE7E,OAAO;QACHK,KAAK,EAAE;UACH,CAACN,YAAY,CAACO,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAGF;QACvC;MACJ,CAAC;IACL;;IAEA;IACA,IAAI,IAAAG,oBAAY,EAACR,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAO,IAAAgB,8BAAkB,EAACjB,KAAK,CAAC;IACpC;;IAEA;IACA,IAAI,IAAAkB,mBAAW,EAACV,YAAY,CAAC,EAAE;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,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAEO,MAAMO,gBAAgB,GAAIC,KAAsB,IAAK;EACxD;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACG,UAAU,CAAC,UAAU,CAAC,EAAE;MACrK,OAAO,EAAE;IACb;;IAEA;IACA,IAAI,IAAAC,gBAAQ,EAACJ,YAAY,CAAC,EAAE;MACxB,MAAMK,aAAa,GAAGd,gBAAgB,CAACU,cAAiC,CAAC;MAEzE,OAAO;QAAE,CAACD,YAAY,GAAGK;MAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,IAAAC,oBAAY,EAACN,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAO,IAAAc,8BAAkB,EAACf,KAAK,CAAC;IACpC;;IAEA;IACA,IAAI,IAAAgB,mBAAW,EAACR,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAO,IAAAe,4BAAiB,EAACjB,KAAK,CAAC;IACnC;;IAEA;IACA,IAAI,IAAAkB,mBAAW,EAACV,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAO,IAAAU,4BAAiB,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,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,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,CAChB;AAEH,MAAME,QAAQ,GAAIC,QAAgB,IAAKH,OAAO,CAACI,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC;AAAAJ,OAAA,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,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,eAAe,EAAGtC,KAAoB,KAAM;IACxCuC,SAAS,EAAE,UAAUvC,KAAK,CAACwC,IAAI,CAAC,IAAI,CAAC;EACzC,CAAC,CAAC;EACFC,UAAU,EAAGzC,KAAa,KAAM;IAC5B0C,cAAc,EAAE1C;EACpB,CAAC,CAAC;EACF2C,UAAU,EAAG3C,KAAa,KAAM;IAC5B2C,UAAU,EAAE,GAAG3C,KAAK;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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D,GAAG,EAAE5C,KAAK,CAAC,GAAGA,KAAK,GAAG,GAAGA,KAAK,IAAI;EACtE;EAEA,OAAOA,KAAK;AAChB,CAAC;AAEM,MAAM8C,QAAQ,GAAGA,CAACF,GAAW,EAAE5C,KAAU,KAAK;EACjD,IAAIJ,WAAW,CAACiD,QAAQ,CAACD,GAAG,CAAC,EAAE;IAC3B,OAAO,CAAC,CAAC;EACb;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,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B,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,C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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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C,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,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,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,CAACF,SAAS,CAAC;EAEpC,IAAI,CAACP,GAAG,EAAE;IACN,OAAOU,SAAS;EACpB;EAEA,MAAMT,KAAK,GAAGM,SAAS,CAACP,GAAG,CAAC;EAE5B,QAAOA,GAAG;IACN,KAAK,QAAQ;IACb,KAAK,UAAU;MACX,OAAO,GAAGA,GAAG,IAAKC,KAAK,CAAmBU,IAAI,CAAC,GAAG,CAAC,GAAG;IAC1D;MACI,OAAO,GAAGX,GAAG,IAAID,kBAAkB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAG;EAC1D;AACJ,CAAC,CAAC,CACDW,MAAM,CAACC,OAAO,CAAC,CACfF,IAAI,CAAC,GAAG,CAAC;AAEP,MAAMG,iBAAiB,GAAIT,UAAsB,IAAK;EACzD,MAAMU,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EACrC,MAAMC,gBAA4B,GAAG,EAAE;EAEvCZ,UAAU,CAACa,OAAO,CAACX,SAAS,IAAI;IAC5B,MAAM,CAACY,QAAQ,CAAC,GAAGX,MAAM,CAACC,IAAI,CAACF,SAA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a,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":[]}