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
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnistylesShadowRegistry = void 0;
7
- var _listener = require("./listener");
8
7
  var _registry = require("./registry");
9
8
  var _utils = require("./utils");
10
9
  var _variants2 = require("./variants");
@@ -17,9 +16,8 @@ class UnistylesShadowRegistryBuilder {
17
16
  dispose = () => {};
18
17
  // END MOCKS
19
18
 
20
- webUnistylesMap = (0, _utils.createDoubleMap)();
21
- disposeMap = (0, _utils.createDoubleMap)();
22
- stylesMap = (0, _utils.createDoubleMap)();
19
+ resultsMap = (0, _utils.createDoubleMap)();
20
+ classNamesMap = (0, _utils.createDoubleMap)();
23
21
  add = (ref, _style, _variants, _args) => {
24
22
  // Style is not provided
25
23
  if (!_style) {
@@ -41,13 +39,19 @@ class UnistylesShadowRegistryBuilder {
41
39
  if (ref === null) {
42
40
  const secrets = (0, _utils.extractSecrets)(_style);
43
41
  secrets.forEach(({
44
- __uni__refs
42
+ __uni__refs,
43
+ __uni__key
45
44
  }) => {
46
45
  __uni__refs.forEach(ref => {
47
46
  if ((0, _utils.isInDocument)(ref)) {
48
47
  return;
49
48
  }
50
- this.remove(ref, _style);
49
+ const oldResult = this.resultsMap.get(ref, __uni__key);
50
+ this.resultsMap.delete(ref, __uni__key);
51
+ this.classNamesMap.delete(ref, __uni__key);
52
+ if (oldResult) {
53
+ _registry.UnistylesRegistry.remove(oldResult);
54
+ }
51
55
  });
52
56
  });
53
57
  return;
@@ -61,63 +65,61 @@ class UnistylesShadowRegistryBuilder {
61
65
  const {
62
66
  __uni__key,
63
67
  __uni__stylesheet,
64
- __uni__refs,
65
68
  __uni__variants,
66
- __uni__args = []
69
+ __uni__args = [],
70
+ __uni__refs
67
71
  } = secret;
68
72
  const newComputedStylesheet = _registry.UnistylesRegistry.getComputedStylesheet(__uni__stylesheet);
69
73
  const style = newComputedStylesheet[__uni__key];
70
74
  const args = _args ?? __uni__args;
71
- const resultHidden = typeof style === 'function' ? style(...args) : style;
72
- const result = (0, _utils.extractHiddenProperties)(resultHidden);
75
+ const variants = _variants && Object.keys(_variants).length > 0 ? _variants : __uni__variants;
76
+ const result = typeof style === 'function' ? style(...args) : style;
73
77
  const {
74
- variants
78
+ variantsResult
75
79
  } = Object.fromEntries((0, _variants2.getVariants)({
76
- variants: result
77
- }, _variants && Object.keys(_variants).length > 0 ? _variants : __uni__variants));
80
+ variantsResult: result
81
+ }, variants));
78
82
  const resultWithVariants = {
79
83
  ...result,
80
- ...variants
84
+ ...variantsResult
81
85
  };
82
- const storedWebUnistyle = this.webUnistylesMap.get(ref, __uni__key);
83
- const webUnistyle = storedWebUnistyle ?? _registry.UnistylesRegistry.createStyles(resultWithVariants, __uni__key);
84
- this.webUnistylesMap.set(ref, __uni__key, webUnistyle);
85
- this.disposeMap.get(ref, __uni__key)?.();
86
- this.disposeMap.set(ref, __uni__key, (0, _listener.listenToDependencies)({
86
+ const oldResult = this.resultsMap.get(ref, __uni__key);
87
+
88
+ // If results are the same do nothing
89
+ if ((0, _utils.equal)(oldResult, resultWithVariants)) {
90
+ return;
91
+ }
92
+ const oldClassNames = this.classNamesMap.get(ref, __uni__key);
93
+
94
+ // Remove old styles
95
+ if (oldResult) {
96
+ _registry.UnistylesRegistry.remove(oldResult);
97
+ }
98
+
99
+ // Remove old classnames from the ref
100
+ oldClassNames?.forEach(className => ref.classList.remove(className));
101
+ this.resultsMap.set(ref, __uni__key, resultWithVariants);
102
+ const className = _registry.UnistylesRegistry.add({
87
103
  key: __uni__key,
88
- stylesheet: __uni__stylesheet,
89
104
  args,
90
- className: webUnistyle.className,
91
- unistyles: webUnistyle.unistyles
92
- }));
93
- if (!storedWebUnistyle) {
94
- const styleTag = document.createElement('style');
95
- const additionalClasses = resultWithVariants?._web?._classNames;
96
- if (additionalClasses) {
97
- ref.classList.add(...(Array.isArray(additionalClasses) ? additionalClasses : [additionalClasses]));
98
- }
99
- ref.classList.add(webUnistyle.className);
100
- webUnistyle.unistyles.setStylesTarget(styleTag);
101
- document.head.appendChild(styleTag);
102
- __uni__refs.add(ref);
103
- this.stylesMap.set(ref, __uni__key, styleTag);
104
- }
105
- if (storedWebUnistyle) {
106
- _registry.UnistylesRegistry.updateStyles(webUnistyle.unistyles, resultWithVariants, webUnistyle.className);
105
+ stylesheet: __uni__stylesheet,
106
+ value: resultWithVariants,
107
+ variants
108
+ });
109
+ const injectedClassNames = resultWithVariants?._web?._classNames ?? [];
110
+ const newClassNames = injectedClassNames.concat(className);
111
+ const dependencies = (0, _utils.extractUnistyleDependencies)(resultWithVariants);
112
+ if (typeof __uni__stylesheet === 'function') {
113
+ // Add dependencies from dynamic styles to stylesheet
114
+ _registry.UnistylesRegistry.addDependenciesToStylesheet(__uni__stylesheet, dependencies);
107
115
  }
116
+ __uni__refs.add(ref);
117
+ this.classNamesMap.set(ref, __uni__key, newClassNames);
118
+ // Add new classnames to the ref
119
+ ref.classList.add(...newClassNames);
108
120
  });
109
121
  };
110
- remove = (ref, style) => {
111
- (0, _utils.extractSecrets)(style).forEach(({
112
- __uni__key
113
- }) => {
114
- this.webUnistylesMap.delete(ref, __uni__key);
115
- this.disposeMap.get(ref, __uni__key)?.();
116
- this.disposeMap.delete(ref, __uni__key);
117
- this.stylesMap.get(ref, __uni__key)?.remove();
118
- this.stylesMap.delete(ref, __uni__key);
119
- });
120
- };
122
+ remove = () => {};
121
123
  }
122
124
  const UnistylesShadowRegistry = exports.UnistylesShadowRegistry = new UnistylesShadowRegistryBuilder();
123
125
  //# sourceMappingURL=shadowRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_listener","require","_registry","_utils","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","webUnistylesMap","createDoubleMap","disposeMap","stylesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","extractSecrets","__uni__refs","isInDocument","remove","HTMLElement","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","UnistylesRegistry","getComputedStylesheet","args","resultHidden","result","extractHiddenProperties","variants","fromEntries","getVariants","length","resultWithVariants","storedWebUnistyle","get","webUnistyle","createStyles","set","listenToDependencies","stylesheet","className","unistyles","styleTag","document","createElement","additionalClasses","_web","_classNames","classList","setStylesTarget","head","appendChild","updateStyles","delete","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAMA,MAAMI,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEiBC,eAAe,GAAG,IAAAC,sBAAe,EAAmC,CAAC;EACrEC,UAAU,GAAG,IAAAD,sBAAe,EAAgD,CAAC;EAC7EE,SAAS,GAAG,IAAAF,sBAAe,EAAwC,CAAC;EAErFG,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAA6B,EAAEC,SAA+B,EAAEC,KAAkB,KAAK;IACpG;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;MACvBA,MAAM,CAACK,OAAO,CAACC,KAAK,IAAI,IAAI,CAACR,GAAG,CAACC,GAAG,EAAEO,KAAK,EAAEL,SAAS,EAAEC,KAAK,CAAC,CAAC;MAE/D;IACJ;;IAEA;IACA,IAAI,CAACK,MAAM,CAACC,IAAI,CAACR,MAAM,CAAC,CAACS,IAAI,CAACC,GAAG,IAAIA,GAAG,C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I,CAACC,WAAW,CAACT,QAAQ,CAAC;QACnC9B,WAAW,CAAChB,GAAG,CAACC,GAAG,CAAC;QACpB,IAAI,CAACF,SAAS,CAAC0C,GAAG,CAACxC,GAAG,EAAEoB,UAAU,EAAEyB,QAAQ,CAAC;MACjD;MAEA,IAAIT,iBAAiB,EAAE;QACnBX,2BAAiB,CAAC8B,YAAY,CAACjB,WAAW,CAACM,SAAS,EAAET,kBAAkB,EAAEG,WAAW,CAACK,SAAS,CAAC;MACpG;IACJ,CAAC,CAAC;EACN,CAAC;EAED1B,MAAM,GAAGA,CAACjB,GAAgB,EAAEO,KAAY,KAAK;IACzC,IAAAO,qBAAc,EAACP,KAAK,CAAC,CAACD,OAAO,CAAC,CAAC;MAAEc;IAAW,CAAC,KAAK;MAC9C,IAAI,CAACzB,eAAe,CAAC6D,MAAM,CAACxD,GAAG,EAAEoB,UAAU,CAAC;MAC5C,IAAI,CAACvB,UAAU,CAACwC,GAAG,CAACrC,GAAG,EAAEoB,UAAU,CAAC,GAAG,CAAC;MACxC,IAAI,CAACvB,UAAU,CAAC2D,MAAM,CAACxD,GAAG,EAAEoB,UAAU,CAAC;MACvC,IAAI,CAACtB,SAAS,CAACuC,GAAG,CAACrC,GAAG,EAAEoB,UAAU,CAAC,EAAEH,MAAM,CAAC,CAAC;MAC7C,IAAI,CAACnB,SAAS,CAAC0D,MAAM,CAACxD,GAAG,EAAEoB,UAAU,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC;AACL;AAEO,MAAMqC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAIpE,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_registry","require","_utils","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","createDoubleMap","classNamesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","extractSecrets","__uni__refs","__uni__key","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","secret","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","args","variants","length","result","variantsResult","fromEntries","getVariants","resultWithVariants","equal","oldClassNames","className","classList","set","stylesheet","value","injectedClassNames","_web","_classNames","newClassNames","concat","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAIA,MAAMG,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEQC,UAAU,GAAG,IAAAC,sBAAe,EAAuC,CAAC;EACpEC,aAAa,GAAG,IAAAD,sBAAe,EAAqC,CAAC;EAE7EE,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAA6B,EAAEC,SAA+B,EAAEC,KAAkB,KAAK;IACpG;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;MACvBA,MAAM,CAACK,OAAO,CAACC,KAAK,IAAI,IAAI,CAACR,GAAG,CAACC,GAAG,EAAEO,KAAK,EAAEL,SAAS,EAAEC,KAAK,CAAC,CAAC;MAE/D;IACJ;;IAEA;IACA,IAAI,CAACK,MAAM,CAACC,IAAI,CAACR,MAAM,CAAC,CAACS,IAAI,CAACC,GAAG,IAAIA,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE;MAC7D;IACJ;;IAEA;IACA,IAAIZ,GAAG,KAAK,IAAI,EAAE;MACd,MAAMa,OAAO,GAAG,IA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2BAAiB,CAAC+B,2BAA2B,CAAC3B,iBAAiB,EAAEyB,YAAY,CAAC;MAClF;MAEAnC,WAAW,CAAChB,GAAG,CAACC,GAAG,CAAC;MACpB,IAAI,CAACF,aAAa,CAAC4C,GAAG,CAAC1C,GAAG,EAAEgB,UAAU,EAAEgC,aAAa,CAAC;MACtD;MACAhD,GAAG,CAACyC,SAAS,CAAC1C,GAAG,CAAC,GAAGiD,aAAa,CAAC;IACvC,CAAC,CAAC;EACN,CAAC;EAED1B,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAM+B,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI/D,8BAA8B,CAAC,CAAC","ignoreList":[]}
@@ -9,14 +9,18 @@ var _utils = require("./utils");
9
9
  var _listener = require("./listener");
10
10
  var _NativePlatform = require("../specs/NativePlatform");
11
11
  class UnistylesStateBuilder {
12
- isSSR = (0, _utils.isServer)();
13
12
  themes = new Map();
13
+ matchingBreakpoints = new Map();
14
+ get breakpoint() {
15
+ const [currentBreakpoint] = Array.from(this.matchingBreakpoints).reverse().find(([_key, value]) => value) ?? [];
16
+ return currentBreakpoint;
17
+ }
14
18
  hasAdaptiveThemes = false;
15
19
  init = config => {
16
20
  this.initThemes(config.themes);
17
21
  this.initBreakpoints(config.breakpoints);
18
22
  this.initSettings(config.settings);
19
- if (this.isSSR) {
23
+ if ((0, _utils.isServer)()) {
20
24
  return;
21
25
  }
22
26
  _listener.UnistylesListener.initListeners();
@@ -51,27 +55,15 @@ class UnistylesStateBuilder {
51
55
  this.themeName = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
52
56
  };
53
57
  initBreakpoints = (breakpoints = {}) => {
54
- const breakpointsMap = new Map();
55
58
  this.breakpoints = breakpoints;
56
59
  Object.entries(breakpoints).sort(([, a], [, b]) => a - b).forEach(([breakpoint, value]) => {
57
60
  if ((0, _utils.isServer)()) {
58
61
  return;
59
62
  }
60
63
  const mediaQuery = window.matchMedia(`(min-width: ${value}px)`);
61
- breakpointsMap.set(breakpoint, mediaQuery);
62
- if (mediaQuery.matches) {
63
- this.breakpoint = breakpoint;
64
- }
64
+ this.matchingBreakpoints.set(breakpoint, mediaQuery.matches);
65
65
  mediaQuery.addEventListener('change', event => {
66
- if (!event.matches) {
67
- const [currentBreakpoint] = Array.from(breakpointsMap).find(([, mq]) => mq.matches) ?? [];
68
- if (currentBreakpoint) {
69
- this.breakpoint = currentBreakpoint;
70
- _listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
71
- }
72
- return;
73
- }
74
- this.breakpoint = breakpoint;
66
+ this.matchingBreakpoints.set(breakpoint, event.matches);
75
67
  _listener.UnistylesListener.emitChange(_NativePlatform.UnistyleDependency.Breakpoints);
76
68
  });
77
69
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_runtime","require","_utils","_listener","_NativePlatform","UnistylesStateBuilder","isSSR","isServer","themes","Map","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","UnistylesListener","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","Array","from","keys","initialTheme","length","Error","schemeToTheme","UnistylesRuntime","colorScheme","breakpointsMap","sort","a","b","breakpoint","value","mediaQuery","window","matchMedia","matches","addEventListener","event","currentBreakpoint","find","mq","emitChange","UnistyleDependency","Breakpoints","UnistylesState","exports"],"sourceRoot":"../../../src","sources":["web/state.ts"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,qBAAqB,CAAC;EACPC,KAAK,GAAG,IAAAC,eAAQ,EAAC,CAAC;EAEnCC,MAAM,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAM1CC,iBAAiB,GAAG,KAAK;EAEzBC,IAAI,GAAIC,MAAuB,IAAK;IAChC,IAAI,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kCAAkB,CAACC,WAAW,CAAC;MAChE,CAAC,CAAC;IACN,CAAC,CAAC;EACV,CAAC;AACL;AAEO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAIlD,qBAAqB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_runtime","require","_utils","_listener","_NativePlatform","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","isServer","UnistylesListener","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","schemeToTheme","UnistylesRuntime","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","UnistyleDependency","Breakpoints","UnistylesState","exports"],"sourceRoot":"../../../src","sources":["web/state.ts"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,qBAAqB,CAAC;EACxBC,MAAM,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAGlCC,mBAAmB,GAAG,IAAID,GAAG,CAAkB,CAAC;EAExD,IAAIE,UAAUA,CAAA,EAAG;IACb,MAAM,CAACC,iBAAiB,CAAC,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACJ,mBAAmB,CAAC,CAC3DK,OAAO,CAAC,CAAC,CACTC,IAAI,CAAC,CAAC,CAACC,IAAI,EAAEC,KAAK,CAAC,KAAKA,KAAK,CAAC,IAAI,EAAE;IAEzC,OAAON,iBAAiB;EAC5B;EAIAO,iBAAiB,GAAG,KAAK;EAEzBC,IAAI,GAAIC,MAAuB,IAAK;IAChC,IAAI,CAACC,UAAU,CAACD,MAAM,CAACb,MAAM,CAAC;IAC9B,IAAI,CAACe,eAAe,CAACF,MAAM,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Gb,QAAQ,CAACa,YAAY;EAClH,CAAC;EAEOhB,eAAe,GAAGA,CAACC,WAAW,GAAG,CAAC,CAAyB,KAAK;IACpE,IAAI,CAACA,WAAW,GAAGA,WAAW;IAE9BM,MAAM,CAACC,OAAO,CAACP,WAAW,CAAC,CACtBqB,IAAI,CAAC,CAAC,GAAGC,CAAC,CAAC,EAAE,GAAGC,CAAC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC,CAC7Bf,OAAO,CAAC,CAAC,CAACrB,UAAU,EAAEO,KAAK,CAAC,KAAK;MAC9B,IAAI,IAAAS,eAAQ,EAAC,CAAC,EAAE;QACZ;MACJ;MAEA,MAAMqB,UAAU,GAAGC,MAAM,CAACC,UAAU,CAAC,eAAehC,KAAK,KAAK,CAAC;MAC/D,IAAI,CAACR,mBAAmB,CAACyB,GAAG,CAACxB,UAAU,EAAEqC,UAAU,CAACG,OAAO,CAAC;MAE5DH,UAAU,CAACI,gBAAgB,CAAC,QAAQ,EAAEC,KAAK,IAAI;QAC3C,IAAI,CAAC3C,mBAAmB,CAACyB,GAAG,CAACxB,UAAU,EAAE0C,KAAK,CAACF,OAAO,CAAC;QACvDvB,2BAAiB,CAAC0B,UAAU,CAACC,kCAAkB,CAACC,WAAW,CAAC;MAChE,CAAC,CAAC;IACN,CAAC,CAAC;EACV,CAAC;AACL;AAEO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAIlD,qBAAqB,CAAC,CAAC","ignoreList":[]}
@@ -3,24 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.warn = exports.schemeToTheme = exports.reduceObject = exports.keyInObject = exports.isServer = exports.isInDocument = exports.hexToRGBA = exports.getStyles = exports.extractSecrets = exports.extractHiddenProperties = exports.equal = exports.deepMergeObjects = exports.createDoubleMap = exports.assignSecrets = void 0;
7
- var _types = require("../specs/types");
6
+ exports.warn = exports.reduceObject = exports.keyInObject = exports.isServer = exports.generateHash = exports.equal = exports.deepMergeObjects = exports.createDoubleMap = void 0;
8
7
  const reduceObject = (obj, reducer) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, reducer(value, key)]));
9
8
  exports.reduceObject = reduceObject;
10
9
  const keyInObject = (obj, key) => key in obj;
11
10
  exports.keyInObject = keyInObject;
12
- const schemeToTheme = scheme => {
13
- switch (scheme) {
14
- case _types.ColorScheme.Dark:
15
- return 'dark';
16
- case _types.ColorScheme.Light:
17
- default:
18
- return 'light';
19
- }
20
- };
21
- exports.schemeToTheme = schemeToTheme;
22
- const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
23
- exports.hexToRGBA = hexToRGBA;
24
11
  const isServer = () => typeof window === 'undefined';
25
12
 
26
13
  /**
@@ -62,32 +49,14 @@ const equal = (a, b) => {
62
49
  return keysA.every(key => Object.is(a[key], b[key]) && Object.prototype.hasOwnProperty.call(b, key));
63
50
  };
64
51
  exports.equal = equal;
65
- const assignSecrets = (object, secrets) => {
66
- // @ts-expect-error - assign secrets to object
67
- object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets;
68
- return object;
69
- };
70
- exports.assignSecrets = assignSecrets;
71
- const extractSecrets = object => {
72
- const secrets = Object.entries(object).reduce((acc, [key, value]) => {
73
- if (key.startsWith('__uni__secrets__')) {
74
- acc.push(value);
75
- }
76
- return acc;
77
- }, []);
78
- return secrets;
79
- };
80
- exports.extractSecrets = extractSecrets;
81
- const getStyles = values => {
82
- const returnValue = {};
83
- Object.defineProperties(returnValue, reduceObject(values, value => ({
84
- value,
85
- enumerable: false,
86
- configurable: true
87
- })));
88
- return returnValue;
52
+ const generateHash = value => {
53
+ const str = JSON.stringify(value);
54
+ let hasher = 5381;
55
+ let length = str.length;
56
+ while (length--) hasher = hasher * 33 ^ str.charCodeAt(length);
57
+ return `unistyles-${(hasher >>> 0).toString(36)}`;
89
58
  };
90
- exports.getStyles = getStyles;
59
+ exports.generateHash = generateHash;
91
60
  const createDoubleMap = () => {
92
61
  const map = new Map();
93
62
  return {
@@ -120,11 +89,4 @@ const createDoubleMap = () => {
120
89
  };
121
90
  };
122
91
  exports.createDoubleMap = createDoubleMap;
123
- const extractHiddenProperties = object => {
124
- const hiddenProperties = Object.getOwnPropertyNames(object);
125
- return Object.fromEntries(hiddenProperties.filter(key => !key.startsWith('__uni__')).map(key => [key, object[key]]));
126
- };
127
- exports.extractHiddenProperties = extractHiddenProperties;
128
- const isInDocument = element => document.body.contains(element);
129
- exports.isInDocument = isInDocument;
130
- //# sourceMappingURL=utils.js.map
92
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","isServer","window","deepMergeObjects","sources","target","forEach","source","keys","sourceValue","targetValue","warn","message","console","equal","a","b","is","keysA","length","every","prototype","hasOwnProperty","call","generateHash","str","JSON","stringify","hasher","charCodeAt","toString","createDoubleMap","Map","get","secondKey","mapForKey","undefined","set","delete","callback"],"sourceRoot":"../../../../src","sources":["web/utils/common.ts"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAAGA,CACxBC,GAAS,EACTC,OAA+D,KAC9DC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACJ,GAAG,CAAC,CAACK,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEL,OAAO,CAACM,KAAK,EAAsBD,GAAG,CAAC,CAAC,CAAC,CAAoC;AAAAE,OAAA,CAAAT,YAAA,GAAAA,YAAA;AAE9I,MAAMU,WAAW,GAAGA,CAAgCT,GAAM,EAAEM,GAAgB,KAAqBA,GAAG,IAAIN,GAAG;AAAAQ,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAE3G,MAAMC,QAAQ,GAAGA,CAAA,KAAM,OA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AAS,EAAEqC,SAAqB,EAAEpC,KAAa,KAAK;MACtD,MAAMqC,SAAS,GAAGvC,GAAG,CAACqC,GAAG,CAACpC,GAAG,CAAC,IAAI,IAAImC,GAAG,CAAqB,CAAC;MAE/DpC,GAAG,CAACyC,GAAG,CAACxC,GAAG,EAAEsC,SAAS,CAAC;MACvBA,SAAS,CAACE,GAAG,CAACH,SAAS,EAAEpC,KAAK,CAAC;IACnC,CAAC;IACDwC,MAAM,EAAEA,CAACzC,GAAS,EAAEqC,SAAqB,KAAK;MAC1C,MAAMC,SAAS,GAAGvC,GAAG,CAACqC,GAAG,CAACpC,GAAG,CAAC;MAE9B,IAAI,CAACsC,SAAS,EAAE;QACZ;MACJ;MAEAA,SAAS,CAACG,MAAM,CAACJ,SAAS,CAAC;IAC/B,CAAC;IACD5B,OAAO,EAAGiC,QAAmE,IAAK;MAC9E3C,GAAG,CAACU,OAAO,CAAC,CAAC6B,SAAS,EAAEtC,GAAG,KAAK;QAC5BsC,SAAS,CAAC7B,OAAO,CAAC,CAACR,KAAK,EAAEoC,SAAS,KAAK;UACpCK,QAAQ,CAAC1C,GAAG,EAAEqC,SAAS,EAAEpC,KAAK,CAAC;QACnC,CAAC,CAAC;MACN,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAAAC,OAAA,CAAAgC,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _common = require("./common");
7
+ Object.keys(_common).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _common[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _common[key];
14
+ }
15
+ });
16
+ });
17
+ var _unistyle = require("./unistyle");
18
+ Object.keys(_unistyle).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _unistyle[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _unistyle[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_common","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_unistyle"],"sourceRoot":"../../../../src","sources":["web/utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,SAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,SAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,SAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.schemeToTheme = exports.isInDocument = exports.hexToRGBA = exports.getStyles = exports.getMediaQuery = exports.extractUnistyleDependencies = exports.extractSecrets = exports.extractMediaQueryValue = exports.assignSecrets = void 0;
7
+ var _types = require("../../specs/types");
8
+ var _mq = require("../mq");
9
+ var _state = require("../state");
10
+ var _common = require("./common");
11
+ const schemeToTheme = scheme => {
12
+ switch (scheme) {
13
+ case _types.ColorScheme.Dark:
14
+ return 'dark';
15
+ case _types.ColorScheme.Light:
16
+ default:
17
+ return 'light';
18
+ }
19
+ };
20
+ exports.schemeToTheme = schemeToTheme;
21
+ const hexToRGBA = (hex, opacity) => hex.replace('#', '').split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num)).reduce((acc, color) => `${acc}${color},`, 'rgba(').concat(`${opacity})`);
22
+ exports.hexToRGBA = hexToRGBA;
23
+ const assignSecrets = (object, secrets) => {
24
+ // @ts-expect-error - assign secrets to object
25
+ object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets;
26
+ return object;
27
+ };
28
+ exports.assignSecrets = assignSecrets;
29
+ const extractSecrets = object => {
30
+ const secrets = Object.entries(object).reduce((acc, [key, value]) => {
31
+ if (key.startsWith('__uni__secrets__')) {
32
+ acc.push(value);
33
+ }
34
+ return acc;
35
+ }, []);
36
+ return secrets;
37
+ };
38
+ exports.extractSecrets = extractSecrets;
39
+ const getStyles = values => {
40
+ const returnValue = {};
41
+ Object.defineProperties(returnValue, (0, _common.reduceObject)(values, value => ({
42
+ value,
43
+ enumerable: false,
44
+ configurable: true
45
+ })));
46
+ return returnValue;
47
+ };
48
+ exports.getStyles = getStyles;
49
+ const isInDocument = element => document.body.contains(element);
50
+ exports.isInDocument = isInDocument;
51
+ const extractMediaQueryValue = query => {
52
+ const [_, px] = query.match(/(\d+)px/) ?? [];
53
+ if (!px) {
54
+ return undefined;
55
+ }
56
+ const value = Number(px);
57
+ return isNaN(value) ? undefined : value;
58
+ };
59
+ exports.extractMediaQueryValue = extractMediaQueryValue;
60
+ const getMediaQuery = query => {
61
+ if (Object.values(_types.Orientation).includes(query)) {
62
+ return `(orientation: ${query})`;
63
+ }
64
+ if ((0, _mq.isUnistylesMq)(query)) {
65
+ const {
66
+ minWidth,
67
+ maxWidth,
68
+ minHeight,
69
+ maxHeight
70
+ } = (0, _mq.parseMq)(query);
71
+ return [minWidth ? `(min-width: ${minWidth}px)` : undefined, maxWidth ? `(max-width: ${maxWidth}px)` : undefined, minHeight ? `(min-height: ${minHeight}px)` : undefined, maxHeight ? `(max-height: ${maxHeight}px)` : undefined].filter(Boolean).join(' and ');
72
+ }
73
+ const minWidth = _state.UnistylesState.breakpoints && (0, _common.keyInObject)(_state.UnistylesState.breakpoints, query) ? _state.UnistylesState.breakpoints[query] : undefined;
74
+ return `(min-width: ${minWidth ?? 0}px)`;
75
+ };
76
+ exports.getMediaQuery = getMediaQuery;
77
+ const extractUnistyleDependencies = value => {
78
+ const dependencies = (0, _common.keyInObject)(value, 'uni__dependencies') ? value.uni__dependencies : [];
79
+ return dependencies;
80
+ };
81
+ exports.extractUnistyleDependencies = extractUnistyleDependencies;
82
+ //# sourceMappingURL=unistyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_mq","_state","_common","schemeToTheme","scheme","ColorScheme","Dark","Light","exports","hexToRGBA","hex","opacity","replace","split","map","x","parseInt","filter","num","isNaN","reduce","acc","color","concat","assignSecrets","object","secrets","Math","random","toString","slice","extractSecrets","Object","entries","key","value","startsWith","push","getStyles","values","returnValue","defineProperties","reduceObject","enumerable","configurable","isInDocument","element","document","body","contains","extractMediaQueryValue","query","_","px","match","undefined","Number","getMediaQuery","Orientation","includes","isUnistylesMq","minWidth","maxWidth","minHeight","maxHeight","parseMq","Boolean","join","UnistylesState","breakpoints","keyInObject","extractUnistyleDependencies","dependencies","uni__dependencies"],"sourceRoot":"../../../../src","sources":["web/utils/unistyle.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEO,MAAMI,aAAa,GAAIC,MAAmB,IAAmB;EAChE,QAAQA,MAAM;IACV,KAAKC,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AC,WAAO,EAACd,KAAK,CAAC;IAEnE,OAAO,CACHU,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGN,SAAS,EACnDO,QAAQ,GAAG,eAAeA,QAAQ,KAAK,GAAGP,SAAS,EACnDQ,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGR,SAAS,EACtDS,SAAS,GAAG,gBAAgBA,SAAS,KAAK,GAAGT,SAAS,CACzD,CAACtC,MAAM,CAACiD,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;EACnC;EAEA,MAAMN,QAAQ,GAAGO,qBAAc,CAACC,WAAW,IAAI,IAAAC,mBAAW,EAACF,qBAAc,CAACC,WAAW,EAAElB,KAAK,CAAC,GAAGiB,qBAAc,CAACC,WAAW,CAAClB,KAAK,CAAC,GAAGI,SAAS;EAE7I,OAAO,eAAeM,QAAQ,IAAI,CAAC,KAAK;AAC5C,CAAC;AAAArD,OAAA,CAAAiD,aAAA,GAAAA,aAAA;AAEM,MAAMc,2BAA2B,GAAIpC,KAAU,IAAK;EACvD,MAAMqC,YAAuC,GAAG,IAAAF,mBAAW,EAACnC,KAAK,EAAE,mBAAmB,CAAC,GAAGA,KAAK,CAACsC,iBAAiB,GAAG,EAAE;EAEtH,OAAOD,YAAY;AACvB,CAAC;AAAAhE,OAAA,CAAA+D,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
- import { media } from 'typestyle';
4
3
  import { deepMergeObjects, warn } from '../utils';
5
4
  import { validateShadow } from './shadow';
6
- import { convertBreakpoint } from './breakpoint';
7
5
  import { BOX_SHADOW_STYLES } from './types';
8
6
  import { extractShadowValue, normalizeColor, normalizeNumericValue } from './utils';
9
7
  const createBoxShadowValue = style => {
@@ -53,17 +51,19 @@ export const getBoxShadowStyle = styles => {
53
51
  } = extractShadowValue('shadowOffset', breakpoint, styles);
54
52
  const radius = extractShadowValue('shadowRadius', breakpoint, styles);
55
53
  const opacity = extractShadowValue('shadowOpacity', breakpoint, styles);
56
- return media(convertBreakpoint(breakpoint), {
57
- boxShadow: createBoxShadowValue({
58
- shadowColor: color,
59
- shadowOffset: {
60
- width,
61
- height
62
- },
63
- shadowRadius: radius,
64
- shadowOpacity: opacity
65
- })
66
- });
54
+ return {
55
+ [breakpoint]: {
56
+ boxShadow: createBoxShadowValue({
57
+ shadowColor: color,
58
+ shadowOffset: {
59
+ width,
60
+ height
61
+ },
62
+ shadowRadius: radius,
63
+ shadowOpacity: opacity
64
+ })
65
+ }
66
+ };
67
67
  });
68
68
 
69
69
  // Merge all breakpoints styles into one
@@ -1 +1 @@
1
- {"version":3,"names":["media","deepMergeObjects","warn","validateShadow","convertBreakpoint","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","missingStyles","filter","key","length","join","breakpointsSet","Set","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,WAAW;AAEjC,SAASC,gBAAgB,EAAEC,IAAI,QAAQ,UAAU;AACjD,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,iBAAiB,QAAwB,SAAS;AAC3D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,SAAS;AAEnF,MAAMC,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAGP,qBAAqB,CAACI,YAAY,CAACI,KAAK,CAAC;EACzD,MAAMC,OAAO,GAAGT,qBAAqB,CAACI,YAAY,CAACM,MAAM,CAAC;EAC1D,MAAMC,MAA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AM,GAAGb,kBAAkB,CAAC,cAAc,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IACrE,MAAMgB,OAAO,GAAGhC,kBAAkB,CAAC,eAAe,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IAEvE,OAAOtB,KAAK,CAACI,iBAAiB,CAACiC,UAAU,CAAC,EAAE;MACxCH,SAAS,EAAEzB,oBAAoB,CAAC;QAC5BE,WAAW,EAAES,KAAK;QAClBR,YAAY,EAAE;UACVI,KAAK;UACLE;QACJ,CAAC;QACDJ,YAAY,EAAEK,MAAM;QACpBN,aAAa,EAAEyB;MACnB,CAAC;IACL,CAAC,CAAC;EACN,CAAC,CAAC;;EAEF;EACA,OAAOrC,gBAAgB,CAAC,GAAGkC,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["deepMergeObjects","warn","validateShadow","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","missingStyles","filter","key","length","join","breakpointsSet","Set","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,IAAI,QAAQ,UAAU;AACjD,SAASC,cAAc,QAAQ,UAAU;AACzC,SAASC,iBAAiB,QAAwB,SAAS;AAC3D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,SAAS;AAEnF,MAAMC,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAGP,qBAAqB,CAACI,YAAY,CAACI,KAAK,CAAC;EACzD,MAAMC,OAAO,GAAGT,qBAAqB,CAACI,YAAY,CAACM,MAA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AAM,CAAC;IAChF,MAAMH,MAAM,GAAGb,kBAAkB,CAAC,cAAc,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IACrE,MAAMgB,OAAO,GAAGhC,kBAAkB,CAAC,eAAe,EAAE+B,UAAU,EAAEf,MAAM,CAAC;IAEvE,OAAO;MACH,CAACe,UAAU,GAAG;QACVH,SAAS,EAAEzB,oBAAoB,CAAC;UAC5BE,WAAW,EAAES,KAAK;UAClBR,YAAY,EAAE;YACVI,KAAK;YACLE;UACJ,CAAC;UACDJ,YAAY,EAAEK,MAAM;UACpBN,aAAa,EAAEyB;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAOpC,gBAAgB,CAAC,GAAGiC,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import { media } from 'typestyle';
4
- import { isPseudo } from '../pseudo';
5
- import { convertBreakpoint } from './breakpoint';
3
+ import { isPseudo } from './pseudo';
6
4
  import { getStyle } from './style';
7
5
  import { deepMergeObjects } from '../utils';
8
6
  import { getTransformStyle } from './transform';
9
7
  import { isBoxShadow, isTextShadow, isTransform } from './utils';
10
8
  import { getTextShadowStyle } from './textShadow';
11
9
  import { getBoxShadowStyle } from './boxShadow';
12
- export const convertToTypeStyle = value => {
10
+ export const convertUnistyles = value => {
13
11
  // Flag to mark if textShadow is already created
14
12
  let hasTextShadow = false;
15
13
  // Flag to mark if boxShadow is already created
@@ -25,11 +23,9 @@ export const convertToTypeStyle = value => {
25
23
 
26
24
  // Pseudo classes :hover, :before etc.
27
25
  if (isPseudo(unistylesKey)) {
28
- const typestyleValues = convertToTypeStyle(unistylesValue);
26
+ const flattenValues = convertUnistyles(unistylesValue);
29
27
  return {
30
- $nest: {
31
- [unistylesKey.replace('_', '&:')]: typestyleValues
32
- }
28
+ [unistylesKey]: flattenValues
33
29
  };
34
30
  }
35
31
 
@@ -59,7 +55,9 @@ export const convertToTypeStyle = value => {
59
55
  // Breakpoints
60
56
  if (typeof unistylesValue === 'object' && unistylesValue !== null) {
61
57
  return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
62
- return media(convertBreakpoint(breakpointKey), getStyle(unistylesKey, breakpointValue));
58
+ return {
59
+ [breakpointKey]: getStyle(unistylesKey, breakpointValue)
60
+ };
63
61
  });
64
62
  }
65
63
 
@@ -1 +1 @@
1
- {"version":3,"names":["media","isPseudo","convertBreakpoint","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","typestyleValues","$nest","replace","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AAEA,SAASA,KAAK,QAAQ,WAAW;AACjC,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAChE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,OAAO,MAAMC,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,m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BAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isPseudo","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","flattenValues","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AACA,SAASA,QAAQ,QAAQ,UAAU;AACnC,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAChE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,OAAO,MAAMC,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,IAAIrB,QAAQ,CAACkB,YAAY,CAAC,EAAE;MACxB,MAAMI,aAAa,GAAGb,gBAAgB,CAACU,cAAiC,CAAC;MAEzE,OAAO;QAAE,CAACD,YAAY,GAAGI;MAAc,CAAC;IAC5C;;IAEA;IACA,IAAIjB,YAAY,CAACa,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAOJ,kBAAkB,CAACG,KAAK,CAAC;IACpC;;IAEA;IACA,IAAIN,WAAW,CAACc,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAOJ,iBAAiB,CAACE,KAAK,CAAC;IACnC;;IAEA;IACA,IAAIJ,WAAW,CAACY,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOhB,iBAAiB,CAACgB,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAGvB,QAAQ,CAACiB,YAAY,EAAEO,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;;IAEA;IACA,OAAOxB,QAAQ,CAACiB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.ts"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,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,k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