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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. package/cxx/hybridObjects/HybridStyleSheet.cpp +1 -1
  2. package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
  3. package/lib/commonjs/web/convert/boxShadow.js +13 -13
  4. package/lib/commonjs/web/convert/boxShadow.js.map +1 -1
  5. package/lib/commonjs/web/convert/index.js +9 -11
  6. package/lib/commonjs/web/convert/index.js.map +1 -1
  7. package/lib/commonjs/web/convert/pseudo.js.map +1 -0
  8. package/lib/commonjs/web/convert/style.js +11 -7
  9. package/lib/commonjs/web/convert/style.js.map +1 -1
  10. package/lib/commonjs/web/convert/textShadow.js +12 -12
  11. package/lib/commonjs/web/convert/textShadow.js.map +1 -1
  12. package/lib/commonjs/web/convert/transform.js +5 -5
  13. package/lib/commonjs/web/convert/transform.js.map +1 -1
  14. package/lib/commonjs/web/{listener/listener.js → listener.js} +2 -2
  15. package/lib/commonjs/web/listener.js.map +1 -0
  16. package/lib/commonjs/web/mq.js.map +1 -1
  17. package/lib/commonjs/web/registry.js +159 -21
  18. package/lib/commonjs/web/registry.js.map +1 -1
  19. package/lib/commonjs/web/shadowRegistry.js +50 -48
  20. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  21. package/lib/commonjs/web/state.js +8 -16
  22. package/lib/commonjs/web/state.js.map +1 -1
  23. package/lib/commonjs/web/{utils.js → utils/common.js} +9 -47
  24. package/lib/commonjs/web/utils/common.js.map +1 -0
  25. package/lib/commonjs/web/utils/index.js +28 -0
  26. package/lib/commonjs/web/utils/index.js.map +1 -0
  27. package/lib/commonjs/web/utils/unistyle.js +82 -0
  28. package/lib/commonjs/web/utils/unistyle.js.map +1 -0
  29. package/lib/module/web/convert/boxShadow.js +13 -13
  30. package/lib/module/web/convert/boxShadow.js.map +1 -1
  31. package/lib/module/web/convert/index.js +7 -9
  32. package/lib/module/web/convert/index.js.map +1 -1
  33. package/lib/module/web/convert/pseudo.js.map +1 -0
  34. package/lib/module/web/convert/style.js +11 -7
  35. package/lib/module/web/convert/style.js.map +1 -1
  36. package/lib/module/web/convert/textShadow.js +12 -12
  37. package/lib/module/web/convert/textShadow.js.map +1 -1
  38. package/lib/module/web/convert/transform.js +5 -5
  39. package/lib/module/web/convert/transform.js.map +1 -1
  40. package/lib/module/web/{listener/listener.js → listener.js} +2 -2
  41. package/lib/module/web/listener.js.map +1 -0
  42. package/lib/module/web/mq.js.map +1 -1
  43. package/lib/module/web/registry.js +160 -22
  44. package/lib/module/web/registry.js.map +1 -1
  45. package/lib/module/web/shadowRegistry.js +51 -49
  46. package/lib/module/web/shadowRegistry.js.map +1 -1
  47. package/lib/module/web/state.js +8 -16
  48. package/lib/module/web/state.js.map +1 -1
  49. package/lib/module/web/{utils.js → utils/common.js} +7 -39
  50. package/lib/module/web/utils/common.js.map +1 -0
  51. package/lib/module/web/utils/index.js +5 -0
  52. package/lib/module/web/utils/index.js.map +1 -0
  53. package/lib/module/web/utils/unistyle.js +69 -0
  54. package/lib/module/web/utils/unistyle.js.map +1 -0
  55. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
  56. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  57. package/lib/typescript/src/types/stylesheet.d.ts +1 -1
  58. package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
  59. package/lib/typescript/src/web/convert/boxShadow.d.ts +7 -2
  60. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -1
  61. package/lib/typescript/src/web/convert/index.d.ts +1 -2
  62. package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
  63. package/lib/typescript/src/web/convert/pseudo.d.ts.map +1 -0
  64. package/lib/typescript/src/web/convert/style.d.ts +1 -2
  65. package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
  66. package/lib/typescript/src/web/convert/textShadow.d.ts +7 -2
  67. package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -1
  68. package/lib/typescript/src/web/convert/transform.d.ts +1 -2
  69. package/lib/typescript/src/web/convert/transform.d.ts.map +1 -1
  70. package/lib/typescript/src/web/{listener/listener.d.ts → listener.d.ts} +1 -1
  71. package/lib/typescript/src/web/listener.d.ts.map +1 -0
  72. package/lib/typescript/src/web/mq.d.ts +6 -2
  73. package/lib/typescript/src/web/mq.d.ts.map +1 -1
  74. package/lib/typescript/src/web/registry.d.ts +21 -8
  75. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  76. package/lib/typescript/src/web/shadowRegistry.d.ts +3 -4
  77. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  78. package/lib/typescript/src/web/state.d.ts +2 -2
  79. package/lib/typescript/src/web/state.d.ts.map +1 -1
  80. package/lib/typescript/src/web/{utils.d.ts → utils/common.d.ts} +2 -20
  81. package/lib/typescript/src/web/utils/common.d.ts.map +1 -0
  82. package/lib/typescript/src/web/utils/index.d.ts +3 -0
  83. package/lib/typescript/src/web/utils/index.d.ts.map +1 -0
  84. package/lib/typescript/src/web/utils/unistyle.d.ts +20 -0
  85. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -0
  86. package/nitrogen/generated/android/c++/JColorScheme.hpp +1 -1
  87. package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +8 -8
  88. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +22 -22
  89. package/nitrogen/generated/android/c++/JOrientation.hpp +1 -1
  90. package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +1 -1
  91. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +2 -2
  92. package/nitrogen/generated/android/{UnistylesOnLoad.cpp → unistylesOnLoad.cpp} +2 -2
  93. package/nitrogen/generated/android/{UnistylesOnLoad.hpp → unistylesOnLoad.hpp} +1 -1
  94. package/nitrogen/generated/ios/Unistyles+autolinking.rb +5 -3
  95. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +25 -0
  96. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +32 -32
  97. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +0 -29
  98. package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +0 -12
  99. package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +134 -110
  100. package/nitrogen/generated/shared/c++/ColorScheme.hpp +2 -2
  101. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
  102. package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
  103. package/nitrogen/generated/shared/c++/Orientation.hpp +2 -2
  104. package/package.json +4 -15
  105. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
  106. package/src/types/stylesheet.ts +1 -1
  107. package/src/web/convert/boxShadow.ts +14 -15
  108. package/src/web/convert/index.ts +6 -13
  109. package/src/web/convert/style.ts +61 -10
  110. package/src/web/convert/textShadow.ts +13 -14
  111. package/src/web/convert/transform.ts +7 -8
  112. package/src/web/{listener/listener.ts → listener.ts} +2 -2
  113. package/src/web/mq.ts +1 -3
  114. package/src/web/registry.ts +202 -23
  115. package/src/web/shadowRegistry.ts +49 -49
  116. package/src/web/state.ts +13 -23
  117. package/src/web/{utils.ts → utils/common.ts} +6 -68
  118. package/src/web/utils/index.ts +2 -0
  119. package/src/web/utils/unistyle.ts +104 -0
  120. package/lib/commonjs/web/convert/breakpoint.js +0 -25
  121. package/lib/commonjs/web/convert/breakpoint.js.map +0 -1
  122. package/lib/commonjs/web/createUnistylesComponent.js +0 -61
  123. package/lib/commonjs/web/createUnistylesComponent.js.map +0 -1
  124. package/lib/commonjs/web/listener/index.js +0 -20
  125. package/lib/commonjs/web/listener/index.js.map +0 -1
  126. package/lib/commonjs/web/listener/listenToDependencies.js +0 -38
  127. package/lib/commonjs/web/listener/listenToDependencies.js.map +0 -1
  128. package/lib/commonjs/web/listener/listener.js.map +0 -1
  129. package/lib/commonjs/web/pseudo.js.map +0 -1
  130. package/lib/commonjs/web/utils.js.map +0 -1
  131. package/lib/module/web/convert/breakpoint.js +0 -20
  132. package/lib/module/web/convert/breakpoint.js.map +0 -1
  133. package/lib/module/web/createUnistylesComponent.js +0 -54
  134. package/lib/module/web/createUnistylesComponent.js.map +0 -1
  135. package/lib/module/web/listener/index.js +0 -5
  136. package/lib/module/web/listener/index.js.map +0 -1
  137. package/lib/module/web/listener/listenToDependencies.js +0 -33
  138. package/lib/module/web/listener/listenToDependencies.js.map +0 -1
  139. package/lib/module/web/listener/listener.js.map +0 -1
  140. package/lib/module/web/pseudo.js.map +0 -1
  141. package/lib/module/web/utils.js.map +0 -1
  142. package/lib/typescript/src/web/convert/breakpoint.d.ts +0 -3
  143. package/lib/typescript/src/web/convert/breakpoint.d.ts.map +0 -1
  144. package/lib/typescript/src/web/createUnistylesComponent.d.ts +0 -3
  145. package/lib/typescript/src/web/createUnistylesComponent.d.ts.map +0 -1
  146. package/lib/typescript/src/web/listener/index.d.ts +0 -3
  147. package/lib/typescript/src/web/listener/index.d.ts.map +0 -1
  148. package/lib/typescript/src/web/listener/listenToDependencies.d.ts +0 -12
  149. package/lib/typescript/src/web/listener/listenToDependencies.d.ts.map +0 -1
  150. package/lib/typescript/src/web/listener/listener.d.ts.map +0 -1
  151. package/lib/typescript/src/web/pseudo.d.ts.map +0 -1
  152. package/lib/typescript/src/web/utils.d.ts.map +0 -1
  153. package/src/web/convert/breakpoint.ts +0 -21
  154. package/src/web/createUnistylesComponent.tsx +0 -54
  155. package/src/web/listener/index.ts +0 -2
  156. package/src/web/listener/listenToDependencies.ts +0 -45
  157. /package/lib/commonjs/web/{pseudo.js → convert/pseudo.js} +0 -0
  158. /package/lib/module/web/{pseudo.js → convert/pseudo.js} +0 -0
  159. /package/lib/typescript/src/web/{pseudo.d.ts → convert/pseudo.d.ts} +0 -0
  160. /package/nitrogen/generated/android/{UnistylesOnLoad.kt → unistylesOnLoad.kt} +0 -0
  161. /package/src/web/{pseudo.ts → convert/pseudo.ts} +0 -0
@@ -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,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,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,IAA0B;EACnF,MAAMC,aAAa,GAAGC,wBAAiB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAEvE,IAAIC,aAAa,CAACI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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,MAAM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C;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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nB,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,YAA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
@@ -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,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,8BAA8B,EAC9B,qCAAqC,EACrC,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,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,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,KAAa,KAAM;IACzCa,sBAAsB,EAAEb;EAC5B,CAAC,CAAC;EACFc,cAAc,EAAGd,KAAa,KAAM;IAChCe,oBAAoB,EAAEf;EAC1B,CAAC,CAAC;EACFgB,gBAAgB,EAAGhB,KAAa,KAAM;IAClCiB,sBAAsB,EAAEjB;EAC5B,CAAC,CAAC;EACFkB,kBAAkB,EAAGlB,KAAa,KAAM;IACpCmB,oBAAoB,EAAEnB;EAC1B,CAAC,CAAC;EACFoB,oBAAoB,EAAGpB,KAAa,KAAM;IACtCqB,mBAAmB,EAAErB;EACzB,CAAC,CAAC;EACFsB,cAAc,EAAGtB,KAAa,KAAM;IAChCuB,oBAAoB,EAAEvB;EAC1B,CAAC,CAAC;EACFwB,gBAAgB,EAAGxB,KAAa,KAAM;IAClCyB,sBAAsB,EAAEzB;EAC5B,CAAC,CAAC;EACF0B,GAAG,EAAG1B,KAAa,KAAM;IACrB2B,KAAK,EAAE3B;EACX,CAAC,CAAC;EACF4B,KAAK,EAAG5B,KAAa,KAAM;IACvB6B,IAAI,EAAE7B;EACV,CAAC,CAAC;EACF8B,SAAS,EAAG9B,KAAa,KAAM;IAC3B+B,WAAW,EAAE/B;EACjB,CAAC,CAAC;EACFgC,WAAW,EAAGhC,KAAa,KAAM;IAC7BiC,UAAU,EAAEjC;EAChB,CAAC,CAAC;EACFkC,UAAU,EAAGlC,KAAa,KAAM;IAC5BmC,YAAY,EAAEnC;EAClB,CAAC,CAAC;EACFoC,YAAY,EAAGpC,KAAa,KAAM;IAC9BqC,WAAW,EAAErC;EACjB,CAAC,CAAC;EACFsC,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,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,EACT,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACP,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,CAChB;AAED,MAAMC,UAAU,GAAG;EACfC,gBAAgB,EAAGC,KAAa,KAAM;IAClCC,YAAY,EAAED;EAClB,CAAC,CAAC;EACFE,cAAc,EAAGF,KAAa,KAA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nC;EAClB,CAAC,CAAC;EACFoC,YAAY,EAAGpC,KAAa,KAAM;IAC9BqC,WAAW,EAAErC;EACjB,CAAC,CAAC;EACFsC,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;AACL,CAA6D;AAE7D,MAAM2C,aAAa,GAAGA,CAACC,GAAW,EAAE5C,KAAU,KAAK;EAC/C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOH,eAAe,CAACgD,QAAQ,CAACD,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,6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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,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AC;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,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,IAA0B;EAC9E,MAAMU,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EACrC,MAAMC,gBAA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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,CAAm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I,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,CAAC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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":[]}
@@ -4,13 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnistylesRegistry = void 0;
7
- var _typestyle = require("typestyle");
8
- var _convert = require("./convert");
9
7
  var _runtime = require("./runtime");
10
8
  var _utils = require("./utils");
11
9
  var _listener = require("./listener");
10
+ var _convert = require("./convert");
11
+ var _variants = require("./variants");
12
12
  class UnistylesRegistryBuilder {
13
13
  stylesheets = new Map();
14
+ stylesCounter = new Map();
15
+ #styleTag = null;
16
+ disposeListenersMap = new Map();
17
+ dependenciesMap = new Map();
18
+ get styleTag() {
19
+ const tag = this.#styleTag;
20
+ if (!tag) {
21
+ const newTag = document.createElement('style');
22
+ newTag.id = 'unistyles-web';
23
+ this.#styleTag = newTag;
24
+ document.head.appendChild(newTag);
25
+ return newTag;
26
+ }
27
+ return tag;
28
+ }
14
29
  getComputedStylesheet = stylesheet => {
15
30
  if (typeof stylesheet !== 'function') {
16
31
  return stylesheet;
@@ -20,30 +35,153 @@ class UnistylesRegistryBuilder {
20
35
  return computedStylesheet;
21
36
  }
22
37
  const createdStylesheet = stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime);
23
- // @ts-expect-error uni__dependencies is hidden
24
- const dependencies = Object.values(createdStylesheet).flatMap(value => (0, _utils.keyInObject)(value, 'uni__dependencies') ? value.uni__dependencies : []);
25
- _listener.UnistylesListener.addListeners(dependencies, () => {
38
+ const dependencies = Object.values(createdStylesheet).flatMap(value => (0, _utils.extractUnistyleDependencies)(value));
39
+ this.addDependenciesToStylesheet(stylesheet, dependencies);
40
+ this.stylesheets.set(stylesheet, createdStylesheet);
41
+ return createdStylesheet;
42
+ };
43
+ addDependenciesToStylesheet = (stylesheet, dependencies) => {
44
+ this.disposeListenersMap.get(stylesheet)?.();
45
+ const dependenciesMap = this.dependenciesMap.get(stylesheet) ?? new Set(dependencies);
46
+ dependencies.forEach(dependency => dependenciesMap.add(dependency));
47
+ const dispose = _listener.UnistylesListener.addListeners(Array.from(dependenciesMap), () => {
26
48
  const newComputedStylesheet = stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime);
27
49
  this.stylesheets.set(stylesheet, newComputedStylesheet);
28
50
  });
29
- this.stylesheets.set(stylesheet, createdStylesheet);
30
- return createdStylesheet;
51
+ this.dependenciesMap.set(stylesheet, dependenciesMap);
52
+ this.disposeListenersMap.set(stylesheet, dispose);
53
+ };
54
+ add = ({
55
+ key,
56
+ value,
57
+ stylesheet,
58
+ args,
59
+ variants
60
+ }) => {
61
+ const hash = (0, _utils.generateHash)(value);
62
+ const existingCounter = this.stylesCounter.get(hash);
63
+ if (!existingCounter || existingCounter.size === 0) {
64
+ const counter = new Set();
65
+ const dependencies = (0, _utils.extractUnistyleDependencies)(value);
66
+ counter.add(value);
67
+ this.stylesCounter.set(hash, counter);
68
+ this.applyStyles(hash, (0, _convert.convertUnistyles)(value));
69
+ _listener.UnistylesListener.addListeners(dependencies, async () => {
70
+ // Move this callback to the end of the event loop
71
+ await Promise.resolve();
72
+ const newComputedStyleSheet = this.getComputedStylesheet(stylesheet);
73
+ const newValue = newComputedStyleSheet[key];
74
+ const result = typeof newValue === 'function' ? newValue(...args) : newValue;
75
+ const {
76
+ variantsResult
77
+ } = Object.fromEntries((0, _variants.getVariants)({
78
+ variantsResult: result
79
+ }, variants));
80
+ const resultWithVariants = {
81
+ ...result,
82
+ ...variantsResult
83
+ };
84
+ this.applyStyles(hash, (0, _convert.convertUnistyles)(resultWithVariants));
85
+ });
86
+ return hash;
87
+ }
88
+ existingCounter.add(value);
89
+ return hash;
31
90
  };
32
- createStyles = (stylesheet, key) => {
33
- const unistyles = (0, _typestyle.createTypeStyle)();
34
- const typestyleStylesheet = (0, _convert.convertToTypeStyle)(stylesheet);
35
- const className = unistyles.style({
36
- $debugName: `${key}-${Math.random().toString(16).slice(10)}`
37
- }, typestyleStylesheet);
38
- return {
39
- className,
40
- unistyles
41
- };
91
+ applyStyles = (hash, styles) => {
92
+ Object.entries(styles).forEach(([key, value]) => {
93
+ if (!this.styleTag.sheet) {
94
+ return;
95
+ }
96
+ if (typeof value === 'object' && !key.startsWith('_')) {
97
+ const mediaQuery = (0, _utils.getMediaQuery)(key);
98
+ const cssRules = Array.from(this.styleTag.sheet.cssRules);
99
+ let queryRule = cssRules.find(rule => {
100
+ if (!(rule instanceof CSSMediaRule)) {
101
+ return false;
102
+ }
103
+ return rule.media.item(0)?.includes(mediaQuery);
104
+ }) ?? null;
105
+ if (!queryRule) {
106
+ const mediaQueryValue = (0, _utils.extractMediaQueryValue)(mediaQuery);
107
+ const ruleIndex = mediaQueryValue ? cssRules.reduce((acc, rule, ruleIndex) => {
108
+ if (!(rule instanceof CSSMediaRule)) {
109
+ return acc;
110
+ }
111
+ const ruleMediaQueryValue = (0, _utils.extractMediaQueryValue)(rule.conditionText);
112
+ if (ruleMediaQueryValue === undefined) {
113
+ return;
114
+ }
115
+ return ruleMediaQueryValue > mediaQueryValue ? ruleIndex : acc;
116
+ }, cssRules.length) : undefined;
117
+ queryRule = this.styleTag.sheet.cssRules.item(this.styleTag.sheet.insertRule(`@media ${mediaQuery} {.${hash} {}}`, ruleIndex));
118
+ }
119
+ if (queryRule instanceof CSSMediaRule) {
120
+ Object.entries(value).forEach(([mqKey, mqValue]) => {
121
+ this.applyRule({
122
+ hash,
123
+ key: mqKey,
124
+ value: mqValue,
125
+ sheet: queryRule
126
+ });
127
+ });
128
+ }
129
+ return;
130
+ }
131
+
132
+ // Pseudo
133
+ if (typeof value === 'object') {
134
+ Object.entries(value).forEach(([pseudoKey, pseudoValue]) => {
135
+ this.applyRule({
136
+ hash: `${hash}${key.replace('_', ':')}`,
137
+ key: pseudoKey,
138
+ value: pseudoValue,
139
+ sheet: this.styleTag.sheet
140
+ });
141
+ });
142
+ return;
143
+ }
144
+ this.applyRule({
145
+ hash,
146
+ key,
147
+ value,
148
+ sheet: this.styleTag.sheet
149
+ });
150
+ });
42
151
  };
43
- updateStyles = (unistyles, stylesheet, className) => {
44
- const typestyleStylesheet = (0, _convert.convertToTypeStyle)(stylesheet);
45
- unistyles.reinit();
46
- unistyles.cssRule(`.${className}`, typestyleStylesheet);
152
+ applyRule = ({
153
+ hash,
154
+ key,
155
+ value,
156
+ sheet
157
+ }) => {
158
+ let rule = Array.from(sheet.cssRules).find(rule => {
159
+ if (!(rule instanceof CSSStyleRule)) {
160
+ return false;
161
+ }
162
+
163
+ // In unistyles pseudos are prefixed with ':' but in css some of them are prefixed with '::'
164
+ return rule.selectorText.replace('::', ':').includes(hash);
165
+ }) ?? null;
166
+ if (!rule) {
167
+ rule = sheet.cssRules.item(sheet.insertRule(`.${hash} {}`));
168
+ }
169
+ if (!(rule instanceof CSSStyleRule) || !(0, _utils.keyInObject)(rule.style, key)) {
170
+ return;
171
+ }
172
+ rule.style[key] = value;
173
+ };
174
+ remove = value => {
175
+ const hash = (0, _utils.generateHash)(value);
176
+ const existingStyles = this.stylesCounter.get(hash);
177
+ if (!existingStyles) {
178
+ return;
179
+ }
180
+ existingStyles.delete(value);
181
+ if (existingStyles.size === 0) {
182
+ const ruleIndex = Array.from(this.styleTag.sheet?.cssRules ?? []).findIndex(rule => rule.cssText.includes(`.${hash}`));
183
+ this.styleTag.sheet?.deleteRule(ruleIndex);
184
+ }
47
185
  };
48
186
  }
49
187
  const UnistylesRegistry = exports.UnistylesRegistry = new UnistylesRegistryBuilder();
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_convert","_runtime","_utils","_listener","UnistylesRegistryBuilder","stylesheets","Map","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","UnistylesRuntime","theme","miniRuntime","dependencies","Object","values","flatMap","value","keyInObject","uni__dependencies","UnistylesListener","addListeners","newComputedStylesheet","set","createStyles","key","unistyles","createTypeStyle","typestyleStylesheet","convertToTypeStyle","className","style","$debugName","Math","random","toString","slice","updateStyles","reinit","cssRule","UnistylesRegistry","exports"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,MAAMK,wBAAwB,CAAC;EACnBC,WAAW,GAAG,IAAIC,GAAG,CAAoD,CAAC;EAElFC,qBAAqB,GAAIC,UAAiD,IAAK;IAC3E,IAAI,OAAOA,UAAU,KAAK,UAAU,EAAE;MAClC,OAAOA,UAAU;IACrB;IAEA,MAAMC,kBAAkB,GAAG,IAAI,CAACJ,WAAW,CAACK,GAAG,CAACF,UAAU,CAAC;IAE3D,IAAIC,kBAAkB,EAAE;MACpB,OAAOA,kBAAkB;IAC7B;IAEA,MAAME,iBAAiB,GAAGH,UAAU,CAACI,yBAAgB,CAACC,KAAK,EAAED,yBAAgB,CAACE,WAAW,CAAC;IAC1F;IACA,MAAMC,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACN,iBAAiB,CAAC,CAACO,OAAO,CAACC,KAAK,IAAI,IAAAC,kBAAW,EAACD,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACE,iBAAiB,GAAG,EAAE,CAAC;IAE9IC,2BAAiB,CAACC,YAAY,CAACR,YAAY,EAAE,MAAM;MAC/C,MAAMS,qBAAqB,GAAGhB,UAAU,CAACI,yBAAgB,CAACC,KAAK,EAAED,yBAAgB,CAACE,WAAW,CAAC;MAE9F,IAAI,CAACT,WAAW,CAACoB,GAAG,CAACjB,UAAU,EAAEgB,qBAAqB,CAAC;IAC3D,CAAC,CAAC;IAEF,IAAI,CAACnB,WAAW,CAACoB,GAAG,CAACjB,UAAU,EAAEG,iBAAiB,CAAC;IAEnD,OAAOA,iBAAiB;EAC5B,CAAC;EAEDe,YAAY,GAAGA,CAAClB,UAA2B,EAAEmB,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAG,IAAAC,0BAAe,EAAC,CAAC;IACnC,MAAMC,mBAAmB,GAAG,IAAAC,2BAAkB,EAACvB,UAAU,CAAC;IAE1D,MAAMwB,SAAS,GAAGJ,SAAS,CAACK,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGP,GAAG,IAAIQ,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAER,mBAAmB,CAAC;IAEvB,OAAO;MACHE,SAAS;MACTJ;IACJ,CAAC;EACL,CAAC;EAEDW,YAAY,GAAGA,CAACX,SAAoB,EAAEpB,UAA2B,EAAEwB,SAAiB,KAAK;IACrF,MAAMF,mBAAmB,GAAG,IAAAC,2BAAkB,EAACvB,UAAU,CAAC;IAE1DoB,SAAS,CAACY,MAAM,CAAC,CAAC;IAClBZ,SAAS,CAACa,OAAO,CAAC,IAAIT,SAAS,EAAE,EAAEF,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEO,MAAMY,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAItC,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_runtime","require","_utils","_listener","_convert","_variants","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","UnistylesRuntime","theme","miniRuntime","dependencies","Object","values","flatMap","value","extractUnistyleDependencies","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","UnistylesListener","addListeners","Array","from","newComputedStylesheet","key","args","variants","hash","generateHash","existingCounter","size","counter","applyStyles","convertUnistyles","Promise","resolve","newComputedStyleSheet","newValue","result","variantsResult","fromEntries","getVariants","resultWithVariants","styles","entries","sheet","startsWith","mediaQuery","getMediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","extractMediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","keyInObject","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry","exports"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAGA,IAAAI,SAAA,GAAAJ,OAAA;AAmBA,MAAMK,wBAAwB,CAAC;EACVC,WAAW,GAAG,IAAIC,GAAG,CAAoD,CAAC;EAC1EC,aAAa,GAAG,IAAID,GAAG,CAA+B,CAAC;EACxE,CAACE,QAAQ,GAA4B,IAAI;EACxBC,mBAAmB,GAAG,IAAIH,GAAG,CAAuB,CAAC;EACrDI,eAAe,GAAG,IAAIJ,GAAG,CAAiE,CAAC;EAE5G,IAAYE,QAAQA,CAAA,EAAG;IACnB,MAAMG,GAAG,GAAG,IAAI,CAAC,CAACH,QAAQ;IAE1B,IAAI,CAACG,GAAG,EAAE;MACN,MAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;MAE9CF,MAAM,CAACG,EAAE,GAAG,eAAe;MAC3B,IAAI,CAAC,CAACP,QAAQ,GAAGI,MAAM;MACvBC,QAAQ,CAACG,IAAI,CAACC,WAAW,CAACL,MAAM,CAAC;MAEjC,OAAOA,MAAM;IACjB;IAEA,OAAOD,GAAG;EACd;EAEAO,qBAAqB,GAAIC,UAAiD,IAAK;IAC3E,IAAI,OAAOA,UAAU,KAAK,UAAU,EAAE;MAClC,OAAOA,UAAU;IACrB;IAEA,MAAMC,kBAAkB,GAAG,IAAI,CAACf,WAAW,CAACgB,GAAG,CAACF,UAAU,CAAC;IAE3D,IAAIC,k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