react-native-unistyles 3.0.0-alpha.35 → 3.0.0-alpha.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. package/Unistyles.podspec +1 -1
  2. package/android/CMakeLists.txt +19 -36
  3. package/android/build.gradle +2 -1
  4. package/android/src/main/cxx/NativeUnistylesModule.cpp +71 -0
  5. package/android/src/main/cxx/NativeUnistylesModule.h +42 -0
  6. package/android/src/main/cxx/cpp-adapter.cpp +8 -86
  7. package/android/src/main/java/com/unistyles/Equatable.kt +61 -0
  8. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +302 -0
  9. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +148 -0
  10. package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +54 -0
  11. package/android/src/main/java/com/unistyles/UnistylesModule.kt +51 -0
  12. package/android/src/main/java/com/unistyles/UnistylesPackage.kt +16 -14
  13. package/cxx/NativePlatform.h +11 -0
  14. package/cxx/common/Helpers.h +1 -1
  15. package/cxx/core/Unistyle.h +1 -1
  16. package/cxx/core/UnistyleData.h +1 -1
  17. package/cxx/core/UnistyleWrapper.h +1 -2
  18. package/cxx/core/UnistylesCommitHook.cpp +1 -1
  19. package/cxx/core/UnistylesMountHook.cpp +1 -1
  20. package/cxx/core/UnistylesRegistry.cpp +4 -13
  21. package/cxx/core/UnistylesRegistry.h +2 -3
  22. package/cxx/core/UnistylesState.cpp +10 -7
  23. package/cxx/hybridObjects/HybridNavigationBar.h +3 -3
  24. package/cxx/hybridObjects/HybridStatusBar.h +3 -3
  25. package/cxx/hybridObjects/HybridStyleSheet.cpp +21 -18
  26. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +4 -8
  27. package/cxx/hybridObjects/HybridUnistylesRuntime.h +2 -3
  28. package/cxx/parser/Parser.cpp +3 -27
  29. package/cxx/parser/Parser.h +2 -3
  30. package/cxx/shadowTree/ShadowTrafficController.h +9 -5
  31. package/cxx/shadowTree/ShadowTreeManager.cpp +10 -5
  32. package/cxx/shadowTree/ShadowTreeManager.h +1 -1
  33. package/lib/commonjs/components/useMedia.js.map +1 -1
  34. package/lib/commonjs/components/useMedia.web.js +43 -0
  35. package/lib/commonjs/components/useMedia.web.js.map +1 -0
  36. package/lib/commonjs/core/createUnistylesComponent.js +57 -4
  37. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
  38. package/lib/commonjs/core/createUnistylesComponent.native.js +6 -5
  39. package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -1
  40. package/lib/commonjs/web/convert/index.js +16 -11
  41. package/lib/commonjs/web/convert/index.js.map +1 -1
  42. package/lib/commonjs/web/convert/object/boxShadow.js +58 -0
  43. package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -0
  44. package/lib/commonjs/web/convert/object/filter.js +42 -0
  45. package/lib/commonjs/web/convert/object/filter.js.map +1 -0
  46. package/lib/commonjs/web/convert/object/index.js +39 -0
  47. package/lib/commonjs/web/convert/object/index.js.map +1 -0
  48. package/lib/commonjs/web/convert/object/objectStyle.js +55 -0
  49. package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -0
  50. package/lib/commonjs/web/convert/object/transform.js +27 -0
  51. package/lib/commonjs/web/convert/object/transform.js.map +1 -0
  52. package/lib/commonjs/web/convert/{boxShadow.js → shadow/boxShadow.js} +9 -24
  53. package/lib/commonjs/web/convert/shadow/boxShadow.js.map +1 -0
  54. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js +38 -0
  55. package/lib/commonjs/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  56. package/lib/commonjs/web/convert/shadow/index.js +28 -0
  57. package/lib/commonjs/web/convert/shadow/index.js.map +1 -0
  58. package/lib/commonjs/web/convert/{textShadow.js → shadow/textShadow.js} +9 -23
  59. package/lib/commonjs/web/convert/shadow/textShadow.js.map +1 -0
  60. package/lib/commonjs/web/convert/utils.js +7 -3
  61. package/lib/commonjs/web/convert/utils.js.map +1 -1
  62. package/lib/commonjs/web/listener.js +10 -0
  63. package/lib/commonjs/web/listener.js.map +1 -1
  64. package/lib/commonjs/web/registry.js +13 -26
  65. package/lib/commonjs/web/registry.js.map +1 -1
  66. package/lib/commonjs/web/runtime.js +3 -0
  67. package/lib/commonjs/web/runtime.js.map +1 -1
  68. package/lib/commonjs/web/shadowRegistry.js +79 -39
  69. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  70. package/lib/commonjs/web/utils/common.js +3 -33
  71. package/lib/commonjs/web/utils/common.js.map +1 -1
  72. package/lib/commonjs/web/utils/unistyle.js +4 -1
  73. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  74. package/lib/module/components/useMedia.js.map +1 -1
  75. package/lib/module/components/useMedia.web.js +38 -0
  76. package/lib/module/components/useMedia.web.js.map +1 -0
  77. package/lib/module/core/createUnistylesComponent.js +55 -3
  78. package/lib/module/core/createUnistylesComponent.js.map +1 -1
  79. package/lib/module/core/createUnistylesComponent.native.js +6 -5
  80. package/lib/module/core/createUnistylesComponent.native.js.map +1 -1
  81. package/lib/module/web/convert/index.js +14 -9
  82. package/lib/module/web/convert/index.js.map +1 -1
  83. package/lib/module/web/convert/object/boxShadow.js +53 -0
  84. package/lib/module/web/convert/object/boxShadow.js.map +1 -0
  85. package/lib/module/web/convert/object/filter.js +37 -0
  86. package/lib/module/web/convert/object/filter.js.map +1 -0
  87. package/lib/module/web/convert/object/index.js +6 -0
  88. package/lib/module/web/convert/object/index.js.map +1 -0
  89. package/lib/module/web/convert/object/objectStyle.js +50 -0
  90. package/lib/module/web/convert/object/objectStyle.js.map +1 -0
  91. package/lib/module/web/convert/object/transform.js +22 -0
  92. package/lib/module/web/convert/object/transform.js.map +1 -0
  93. package/lib/module/web/convert/{boxShadow.js → shadow/boxShadow.js} +9 -24
  94. package/lib/module/web/convert/shadow/boxShadow.js.map +1 -0
  95. package/lib/module/web/convert/shadow/getShadowBreakpoints.js +33 -0
  96. package/lib/module/web/convert/shadow/getShadowBreakpoints.js.map +1 -0
  97. package/lib/module/web/convert/shadow/index.js +5 -0
  98. package/lib/module/web/convert/shadow/index.js.map +1 -0
  99. package/lib/module/web/convert/{textShadow.js → shadow/textShadow.js} +9 -23
  100. package/lib/module/web/convert/shadow/textShadow.js.map +1 -0
  101. package/lib/module/web/convert/utils.js +4 -2
  102. package/lib/module/web/convert/utils.js.map +1 -1
  103. package/lib/module/web/listener.js +10 -0
  104. package/lib/module/web/listener.js.map +1 -1
  105. package/lib/module/web/registry.js +14 -27
  106. package/lib/module/web/registry.js.map +1 -1
  107. package/lib/module/web/runtime.js +3 -0
  108. package/lib/module/web/runtime.js.map +1 -1
  109. package/lib/module/web/shadowRegistry.js +80 -40
  110. package/lib/module/web/shadowRegistry.js.map +1 -1
  111. package/lib/module/web/utils/common.js +1 -31
  112. package/lib/module/web/utils/common.js.map +1 -1
  113. package/lib/module/web/utils/unistyle.js +4 -1
  114. package/lib/module/web/utils/unistyle.js.map +1 -1
  115. package/lib/typescript/src/components/useMedia.web.d.ts +6 -0
  116. package/lib/typescript/src/components/useMedia.web.d.ts.map +1 -0
  117. package/lib/typescript/src/core/createUnistylesComponent.d.ts +4 -3
  118. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
  119. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +4 -3
  120. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -1
  121. package/lib/typescript/src/types/common.d.ts +1 -0
  122. package/lib/typescript/src/types/common.d.ts.map +1 -1
  123. package/lib/typescript/src/web/convert/index.d.ts.map +1 -1
  124. package/lib/typescript/src/web/convert/object/boxShadow.d.ts +9 -0
  125. package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -0
  126. package/lib/typescript/src/web/convert/object/filter.d.ts +3 -0
  127. package/lib/typescript/src/web/convert/object/filter.d.ts.map +1 -0
  128. package/lib/typescript/src/web/convert/object/index.d.ts +4 -0
  129. package/lib/typescript/src/web/convert/object/index.d.ts.map +1 -0
  130. package/lib/typescript/src/web/convert/object/objectStyle.d.ts +5 -0
  131. package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -0
  132. package/lib/typescript/src/web/convert/object/transform.d.ts +3 -0
  133. package/lib/typescript/src/web/convert/object/transform.d.ts.map +1 -0
  134. package/lib/typescript/src/web/convert/shadow/boxShadow.d.ts.map +1 -0
  135. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts +2 -0
  136. package/lib/typescript/src/web/convert/shadow/getShadowBreakpoints.d.ts.map +1 -0
  137. package/lib/typescript/src/web/convert/shadow/index.d.ts +3 -0
  138. package/lib/typescript/src/web/convert/shadow/index.d.ts.map +1 -0
  139. package/lib/typescript/src/web/convert/shadow/textShadow.d.ts.map +1 -0
  140. package/lib/typescript/src/web/convert/types.d.ts +7 -1
  141. package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
  142. package/lib/typescript/src/web/convert/utils.d.ts +8 -4
  143. package/lib/typescript/src/web/convert/utils.d.ts.map +1 -1
  144. package/lib/typescript/src/web/create.d.ts +8 -8
  145. package/lib/typescript/src/web/index.d.ts +8 -8
  146. package/lib/typescript/src/web/listener.d.ts +2 -0
  147. package/lib/typescript/src/web/listener.d.ts.map +1 -1
  148. package/lib/typescript/src/web/registry.d.ts +5 -9
  149. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  150. package/lib/typescript/src/web/runtime.d.ts +1 -0
  151. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  152. package/lib/typescript/src/web/shadowRegistry.d.ts +4 -1
  153. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  154. package/lib/typescript/src/web/utils/common.d.ts +1 -6
  155. package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
  156. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  157. package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +6 -0
  158. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +1 -0
  159. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void.kt +1 -0
  160. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency_.kt +1 -0
  161. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +1 -0
  162. package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +1 -0
  163. package/nitrogen/generated/android/unistyles+autolinking.gradle +2 -0
  164. package/nitrogen/generated/ios/Unistyles+autolinking.rb +1 -1
  165. package/package.json +3 -3
  166. package/src/components/useMedia.ts +1 -1
  167. package/src/components/useMedia.web.ts +47 -0
  168. package/src/core/createUnistylesComponent.native.tsx +12 -10
  169. package/src/core/createUnistylesComponent.tsx +72 -6
  170. package/src/types/common.ts +1 -0
  171. package/src/web/convert/index.ts +16 -9
  172. package/src/web/convert/object/boxShadow.ts +54 -0
  173. package/src/web/convert/object/filter.ts +39 -0
  174. package/src/web/convert/object/index.ts +3 -0
  175. package/src/web/convert/object/objectStyle.ts +68 -0
  176. package/src/web/convert/object/transform.ts +24 -0
  177. package/src/web/convert/{boxShadow.ts → shadow/boxShadow.ts} +9 -30
  178. package/src/web/convert/shadow/getShadowBreakpoints.ts +34 -0
  179. package/src/web/convert/shadow/index.ts +2 -0
  180. package/src/web/convert/{textShadow.ts → shadow/textShadow.ts} +9 -29
  181. package/src/web/convert/types.ts +8 -1
  182. package/src/web/convert/utils.ts +11 -5
  183. package/src/web/listener.ts +10 -0
  184. package/src/web/registry.ts +10 -31
  185. package/src/web/runtime.ts +4 -0
  186. package/src/web/shadowRegistry.ts +85 -46
  187. package/src/web/utils/common.ts +1 -37
  188. package/src/web/utils/unistyle.ts +5 -1
  189. package/android/src/main/cxx/helpers.cpp +0 -105
  190. package/android/src/main/cxx/helpers.h +0 -16
  191. package/android/src/main/cxx/platform.cpp +0 -170
  192. package/android/src/main/cxx/platform.h +0 -20
  193. package/lib/commonjs/web/convert/boxShadow.js.map +0 -1
  194. package/lib/commonjs/web/convert/shadow.js +0 -68
  195. package/lib/commonjs/web/convert/shadow.js.map +0 -1
  196. package/lib/commonjs/web/convert/textShadow.js.map +0 -1
  197. package/lib/commonjs/web/convert/transform.js +0 -72
  198. package/lib/commonjs/web/convert/transform.js.map +0 -1
  199. package/lib/module/web/convert/boxShadow.js.map +0 -1
  200. package/lib/module/web/convert/shadow.js +0 -63
  201. package/lib/module/web/convert/shadow.js.map +0 -1
  202. package/lib/module/web/convert/textShadow.js.map +0 -1
  203. package/lib/module/web/convert/transform.js +0 -67
  204. package/lib/module/web/convert/transform.js.map +0 -1
  205. package/lib/typescript/src/web/convert/boxShadow.d.ts.map +0 -1
  206. package/lib/typescript/src/web/convert/shadow.d.ts +0 -2
  207. package/lib/typescript/src/web/convert/shadow.d.ts.map +0 -1
  208. package/lib/typescript/src/web/convert/textShadow.d.ts.map +0 -1
  209. package/lib/typescript/src/web/convert/transform.d.ts +0 -4
  210. package/lib/typescript/src/web/convert/transform.d.ts.map +0 -1
  211. package/src/web/convert/shadow.ts +0 -68
  212. package/src/web/convert/transform.ts +0 -88
  213. /package/lib/typescript/src/web/convert/{boxShadow.d.ts → shadow/boxShadow.d.ts} +0 -0
  214. /package/lib/typescript/src/web/convert/{textShadow.d.ts → shadow/textShadow.d.ts} +0 -0
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ import { hyphenate } from '../../utils';
4
+ import { getObjectStyle } from './objectStyle';
5
+ import { normalizeColor, normalizeNumericValue } from '../utils';
6
+ import { UnistylesRuntime } from '../../runtime';
7
+ import { isUnistylesMq } from '../../../mq';
8
+ const getDropShadowStyle = dropShadow => {
9
+ const {
10
+ offsetX = 0,
11
+ offsetY = 0,
12
+ standardDeviation = 0,
13
+ color = '#000'
14
+ } = dropShadow;
15
+ return `${normalizeColor(String(color))} ${normalizeNumericValue(offsetX)} ${normalizeNumericValue(offsetY)} ${normalizeNumericValue(standardDeviation)}`;
16
+ };
17
+ export const getFilterStyle = filters => {
18
+ const restFilters = filters.filter(filter => Object.keys(filter)[0] !== 'dropShadow');
19
+ const dropShadow = (() => {
20
+ const dropShadowValue = filters.find(filter => Object.keys(filter)[0] === 'dropShadow')?.dropShadow;
21
+ if (typeof dropShadowValue !== 'object') {
22
+ return [];
23
+ }
24
+ const breakpoints = Object.keys(dropShadowValue).filter(key => Object.keys(UnistylesRuntime.breakpoints).includes(key) || isUnistylesMq(key));
25
+ const breakpointsDropShadow = Object.fromEntries(breakpoints.map(breakpoint => [breakpoint, getDropShadowStyle(dropShadowValue[breakpoint])]));
26
+ if (breakpoints.length === 0) {
27
+ return [{
28
+ dropShadow: getDropShadowStyle(dropShadowValue)
29
+ }];
30
+ }
31
+ return [{
32
+ dropShadow: breakpointsDropShadow
33
+ }];
34
+ })();
35
+ return getObjectStyle([...restFilters, ...dropShadow], 'filter', (key, value) => `${hyphenate(key)}(${normalizeNumericValue(value)})`);
36
+ };
37
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hyphenate","getObjectStyle","normalizeColor","normalizeNumericValue","UnistylesRuntime","isUnistylesMq","getDropShadowStyle","dropShadow","offsetX","offsetY","standardDeviation","color","String","getFilterStyle","filters","restFilters","filter","Object","keys","dropShadowValue","find","breakpoints","key","includes","breakpointsDropShadow","fromEntries","map","breakpoint","length","value"],"sourceRoot":"../../../../../src","sources":["web/convert/object/filter.ts"],"mappings":";;AACA,SAASA,SAAS,QAAQ,aAAa;AAEvC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AAChE,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,aAAa,QAAQ,aAAa;AAE3C,MAAMC,kBAAkB,GAAIC,UAA2B,IAAK;EACxD,MAAM;IAAEC,OAAO,GAAG,CAAC;IAAEC,OAAO,GAAG,CAAC;IAAEC,iBAAiB,GAAG,CAAC;IAAEC,KAAK,GAAG;EAAO,CAAC,GAAGJ,UAAU;EAEtF,OAAO,GAAGL,cAAc,CAACU,MAAM,CAACD,KAA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GAAGR,UAAU,CAAC,EAAE,QAAQ,EAAE,CAACe,GAAG,EAAEO,KAAK,KAAK,GAAG7B,SAAS,CAACsB,GAAG,CAAC,IAAInB,qBAAqB,CAAC0B,KAAwB,CAAC,GAAG,CAAC;AAC7J,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export * from './transform';
4
+ export * from './boxShadow';
5
+ export * from './filter';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["web/convert/object/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,UAAU","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ import { deepMergeObjects, keyInObject } from '../../utils';
4
+ const createStylesValue = (styles, normalize) => styles.map(style => {
5
+ const [key] = Object.keys(style);
6
+ if (!key) {
7
+ return undefined;
8
+ }
9
+ return normalize(key, style[key]);
10
+ }).filter(Boolean).join(' ');
11
+ export const getObjectStyle = (styles, styleKey, normalize) => {
12
+ const breakpoints = new Set();
13
+ const normalStyles = [];
14
+ styles.forEach(style => {
15
+ const [property] = Object.keys(style);
16
+ if (!property) {
17
+ return;
18
+ }
19
+ const value = style[property];
20
+ if (typeof value === 'object' && !Array.isArray(value)) {
21
+ Object.keys(value ?? {}).forEach(breakpoint => breakpoints.add(breakpoint));
22
+ return;
23
+ }
24
+ normalStyles.push(style);
25
+ });
26
+ const breakpointStyles = Array.from(breakpoints).flatMap(breakpoint => {
27
+ const stylesPerBreakpoint = styles.flatMap(style => {
28
+ const [property] = Object.keys(style);
29
+ if (!property) {
30
+ return [];
31
+ }
32
+ const value = style[property];
33
+ if (typeof value === 'object' && !Array.isArray(value)) {
34
+ return keyInObject(value, breakpoint) ? [{
35
+ [property]: value[breakpoint]
36
+ }] : [];
37
+ }
38
+ return [];
39
+ });
40
+ return [{
41
+ [breakpoint]: {
42
+ [styleKey]: createStylesValue(stylesPerBreakpoint, normalize)
43
+ }
44
+ }];
45
+ });
46
+ return deepMergeObjects({
47
+ [styleKey]: createStylesValue(normalStyles, normalize)
48
+ }, ...breakpointStyles);
49
+ };
50
+ //# sourceMappingURL=objectStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deepMergeObjects","keyInObject","createStylesValue","styles","normalize","map","style","key","Object","keys","undefined","filter","Boolean","join","getObjectStyle","styleKey","breakpoints","Set","normalStyles","forEach","property","value","Array","isArray","breakpoint","add","push","breakpointStyles","from","flatMap","stylesPerBreakpoint"],"sourceRoot":"../../../../../src","sources":["web/convert/object/objectStyle.ts"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,WAAW,QAAQ,aAAa;AAK3D,MAAMC,iBAAiB,GAAGA,CAAyBC,MAAsB,EAAEC,SAA6B,KAAKD,MAAM,CAC9GE,GAAG,CAACC,KAAK,IAAI;EACV,MAAM,CAACC,GAAG,CAAC,GAAGC,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC;EAEhC,IAAI,CAACC,GAAG,EAAE;IACN,OAAOG,SAAS;EACpB;EAEA,OAAON,SAAS,CAACG,GAAG,EAAED,KAAK,CAACC,GAAG,CAAC,CAAC;AACrC,CAAC,CAAC,CACDI,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC;AAEd,OAAO,MAAMC,cAAc,GAAGA,CAAyBX,MAAsB,EAAEY,QAAgB,EAAEX,SAA6B,KAAK;EAC/H,MAAMY,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EACrC,MAAMC,YAA4B,GAAG,EAAE;EAEvCf,MAAM,CAACgB,OAAO,CAACb,KAAK,IAAI;IACpB,MAAM,CAACc,QAAQ,CAAC,GAAGZ,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC;IAErC,IAAI,CAACc,QAAQ,EAAE;MACX;IACJ;IAEA,MAAMC,KAAK,GAAGf,KAAK,CAACc,QAAQ,CAAC;IAE7B,IAAI,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0 +1,22 @@
1
+ "use strict";
2
+
3
+ import { getObjectStyle } from './objectStyle';
4
+ import { normalizeNumericValue } from '../utils';
5
+ const normalizeTransform = (key, value) => {
6
+ if (key.includes('scale')) {
7
+ return value;
8
+ }
9
+ if (typeof value === 'number') {
10
+ return normalizeNumericValue(value);
11
+ }
12
+ return value;
13
+ };
14
+ export const getTransformStyle = transforms => getObjectStyle(transforms, 'transform', (key, value) => {
15
+ switch (key) {
16
+ case 'matrix':
17
+ return `${key}(${value.join(',')})`;
18
+ default:
19
+ return `${key}(${normalizeTransform(key, value)})`;
20
+ }
21
+ });
22
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getObjectStyle","normalizeNumericValue","normalizeTransform","key","value","includes","getTransformStyle","transforms","join"],"sourceRoot":"../../../../../src","sources":["web/convert/object/transform.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,qBAAqB,QAAQ,UAAU;AAGhD,MAAMC,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,OAAOH,qBAAqB,CAACG,KAAK,CAAC;EACvC;EAEA,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAME,iBAAiB,GAAIC,UAAkC,IAAKP,cAAc,CAACO,UAAU,EAAE,WAAW,EAAE,CAACJ,GAAG,EAAEC,KAAK,KAAK;EAC7H,QAAOD,GAAG;IACN,KAAK,QAAQ;MACT,OAAO,GAAGA,GAAG,IAAKC,KAAK,CAAmBI,IAAI,CAAC,GAAG,CAAC,GAAG;IAC1D;MACI,OAAO,GAAGL,GAAG,IAAID,kBAAkB,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAG;EAC1D;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,39 +1,24 @@
1
1
  "use strict";
2
2
 
3
- import { deepMergeObjects, warn } from '../utils';
4
- import { validateShadow } from './shadow';
5
- import { BOX_SHADOW_STYLES } from './types';
6
- import { extractShadowValue, normalizeColor, normalizeNumericValue } from './utils';
3
+ import { deepMergeObjects } from '../../utils';
4
+ import { BOX_SHADOW_STYLES } from '../types';
5
+ import { extractShadowValue, normalizeColor, normalizeNumericValue } from '../utils';
6
+ import { getShadowBreakpoints } from './getShadowBreakpoints';
7
7
  const createBoxShadowValue = style => {
8
- // at this point every prop is present
9
8
  const {
10
9
  shadowColor,
11
10
  shadowOffset,
12
11
  shadowOpacity,
13
12
  shadowRadius
14
13
  } = style;
15
- const offsetX = normalizeNumericValue(shadowOffset.width);
16
- const offsetY = normalizeNumericValue(shadowOffset.height);
17
- const radius = normalizeNumericValue(shadowRadius);
18
- const color = normalizeColor(shadowColor, shadowOpacity);
14
+ const offsetX = normalizeNumericValue(shadowOffset?.width ?? 0);
15
+ const offsetY = normalizeNumericValue(shadowOffset?.height ?? 0);
16
+ const radius = normalizeNumericValue(shadowRadius ?? 0);
17
+ const color = normalizeColor(shadowColor ?? '#000000', shadowOpacity ?? 1);
19
18
  return `${offsetX} ${offsetY} ${radius} ${color}`;
20
19
  };
21
20
  export const getBoxShadowStyle = styles => {
22
- const missingStyles = BOX_SHADOW_STYLES.filter(key => !(key in styles));
23
- if (missingStyles.length) {
24
- warn(`can't apply box shadow as you miss these properties: ${missingStyles.join(', ')}`);
25
- return {};
26
- }
27
- const breakpointsSet = new Set();
28
- try {
29
- validateShadow(BOX_SHADOW_STYLES, styles, breakpointsSet);
30
- } catch (error) {
31
- if (typeof error === 'string') {
32
- warn(error);
33
- }
34
- return {};
35
- }
36
- const breakpoints = Array.from(breakpointsSet);
21
+ const breakpoints = getShadowBreakpoints(BOX_SHADOW_STYLES, styles);
37
22
 
38
23
  // If no breakpoints were used return styles without media queries
39
24
  if (breakpoints.length === 0) {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deepMergeObjects","BOX_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","getShadowBreakpoints","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","width","offsetY","height","radius","color","getBoxShadowStyle","styles","breakpoints","length","boxShadow","breakpointStyles","map","breakpoint","opacity"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/boxShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,iBAAiB,QAAwB,UAAU;AAC5D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AACpF,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAGR,qBAAqB,CAACK,YAAY,EAAEI,KAAK,IAAI,CAAC,CAAC;EAC/D,MAAMC,OAAO,GAAGV,qBAAqB,CAACK,YAAY,EAAEM,MAAM,IAAI,CAAC,CAAC;EAChE,MAAMC,MAAM,GAAGZ,qBAAqB,CAACO,YAAY,IAAI,CAAC,CAAC;EACvD,MAAMM,KAAK,GAAGd,cAAc,CAAEK,WAAW,IAAI,SAAS,EAAcE,aAAa,IAAI,CAAY,CAAC;EAElG,OAAO,GAAGE,OAAO,IAAIE,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAIC,MAA2B,IAAK;EAC9D,MAAMC,WAAW,GAAGf,oBAAoB,CAACJ,iBAAiB,EAAEkB,MAAM,CAAC;;EAEnE;EACA,IAAIC,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHC,SAAS,EAAEhB,oBAAoB,CAACa,MAAmB;IACvD,CAAC;EACL;;EAEA;EACA,MAAMI,gBAAgB,GAAGH,WAAW,CAACI,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMR,KAAK,GAAGf,kBAAkB,CAAC,aAAa,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IACnE,MAAM;MAAEN,KAAK;MAAEE;IAAO,CAAC,GAAGb,kBAAkB,CAAC,cAAc,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IAChF,MAAMH,MAAM,GAAGd,kBAAkB,CAAC,cAAc,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IACrE,MAAMO,OAAO,GAAGxB,kBAAkB,CAAC,eAAe,EAAEuB,UAAU,EAAEN,MAAM,CAAC;IAEvE,OAAO;MACH,CAACM,UAAU,GAAG;QACVH,SAAS,EAAEhB,oBAAoB,CAAC;UAC5BE,WAAW,EAAES,KAAK;UAClBR,YAAY,EAAE;YACVI,KAAK;YACLE;UACJ,CAAC;UACDJ,YAAY,EAAEK,MAAM;UACpBN,aAAa,EAAEgB;QACnB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAO1B,gBAAgB,CAAC,GAAGuB,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ export const getShadowBreakpoints = (shadowProperties, styles) => {
4
+ const breakpoints = new Set();
5
+ shadowProperties.forEach(key => {
6
+ const value = styles[key];
7
+ if (typeof value !== 'object') {
8
+ return;
9
+ }
10
+ if (key === 'shadowOffset' || key === 'textShadowOffset') {
11
+ const {
12
+ width,
13
+ height
14
+ } = value;
15
+
16
+ // If shadowOffset.width has breakpoints
17
+ if (typeof width === 'object') {
18
+ Object.keys(width).forEach(breakpoint => breakpoints.add(breakpoint));
19
+ }
20
+
21
+ // If shadowOffset.height has breakpoints
22
+ if (typeof height === 'object') {
23
+ Object.keys(height).forEach(breakpoint => breakpoints.add(breakpoint));
24
+ }
25
+ return;
26
+ }
27
+
28
+ // Collect regular breakpoints
29
+ Object.keys(value).forEach(breakpoint => breakpoints.add(breakpoint));
30
+ });
31
+ return Array.from(breakpoints);
32
+ };
33
+ //# sourceMappingURL=getShadowBreakpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getShadowBreakpoints","shadowProperties","styles","breakpoints","Set","forEach","key","value","width","height","Object","keys","breakpoint","add","Array","from"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/getShadowBreakpoints.ts"],"mappings":";;AAEA,OAAO,MAAMA,oBAAoB,GAAGA,CAACC,gBAAuC,EAAEC,MAA2B,KAAK;EAC1G,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAS,CAAC;EAErCH,gBAAgB,CAACI,OAAO,CAACC,GAAG,IAAI;IAC5B,MAAMC,KAAK,GAAGL,MAAM,CAACI,GAAG,CAAC;IAEzB,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IAEA,IAAID,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB,EAAE;MACtD,MAAM;QAAEE,KAAK;QAAEC;MAAO,CAAC,GAAGF,KAAqB;;MAE/C;MACA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;QAC3BE,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAACH,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;MACzE;;MAEA;MACA,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE;QAC5BC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACJ,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;MAC1E;MAEA;IACJ;;IAEA;IACAF,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACF,OAAO,CAACO,UAAU,IAAIT,WAAW,CAACU,GAAG,CAACD,UAAU,CAAC,CAAC;EACzE,CAAC,CAAC;EAEF,OAAOE,KAAK,CAACC,IAAI,CAACZ,WAAW,CAAC;AAClC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export * from './boxShadow';
4
+ export * from './textShadow';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,cAAc","ignoreList":[]}
@@ -1,37 +1,23 @@
1
1
  "use strict";
2
2
 
3
- import { deepMergeObjects, warn } from '../utils';
4
- import { validateShadow } from './shadow';
5
- import { TEXT_SHADOW_STYLES } from './types';
6
- import { extractShadowValue, normalizeColor, normalizeNumericValue } from './utils';
3
+ import { deepMergeObjects } from '../../utils';
4
+ import { TEXT_SHADOW_STYLES } from '../types';
5
+ import { extractShadowValue, normalizeColor, normalizeNumericValue } from '../utils';
6
+ import { getShadowBreakpoints } from './getShadowBreakpoints';
7
7
  const createTextShadowValue = style => {
8
8
  const {
9
9
  textShadowColor,
10
10
  textShadowOffset,
11
11
  textShadowRadius
12
12
  } = style;
13
- const offsetX = normalizeNumericValue(textShadowOffset.width);
14
- const offsetY = normalizeNumericValue(textShadowOffset.height);
15
- const radius = normalizeNumericValue(textShadowRadius);
16
- const color = normalizeColor(textShadowColor);
13
+ const offsetX = normalizeNumericValue(textShadowOffset?.width ?? 0);
14
+ const offsetY = normalizeNumericValue(textShadowOffset?.height ?? 0);
15
+ const radius = normalizeNumericValue(textShadowRadius ?? 0);
16
+ const color = normalizeColor(textShadowColor ?? '#000000');
17
17
  return `${offsetX} ${offsetY} ${radius} ${color}`;
18
18
  };
19
19
  export const getTextShadowStyle = styles => {
20
- const missingStyles = TEXT_SHADOW_STYLES.filter(key => !(key in styles));
21
- if (missingStyles.length) {
22
- warn(`can't apply text shadow as you miss these properties: ${missingStyles.join(', ')}`);
23
- return {};
24
- }
25
- const breakpointsSet = new Set();
26
- try {
27
- validateShadow(TEXT_SHADOW_STYLES, styles, breakpointsSet);
28
- } catch (error) {
29
- if (typeof error === 'string') {
30
- warn(error);
31
- }
32
- return {};
33
- }
34
- const breakpoints = Array.from(breakpointsSet);
20
+ const breakpoints = getShadowBreakpoints(TEXT_SHADOW_STYLES, styles);
35
21
 
36
22
  // If no breakpoints were used return styles without media queries
37
23
  if (breakpoints.length === 0) {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["deepMergeObjects","TEXT_SHADOW_STYLES","extractShadowValue","normalizeColor","normalizeNumericValue","getShadowBreakpoints","createTextShadowValue","style","textShadowColor","textShadowOffset","textShadowRadius","offsetX","width","offsetY","height","radius","color","getTextShadowStyle","styles","breakpoints","length","textShadow","breakpointStyles","map","breakpoint"],"sourceRoot":"../../../../../src","sources":["web/convert/shadow/textShadow.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,kBAAkB,QAAyB,UAAU;AAC9D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,qBAAqB,QAAQ,UAAU;AACpF,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,qBAAqB,GAAIC,KAAiB,IAAK;EACjD,MAAM;IAAEC,eAAe;IAAEC,gBAAgB;IAAEC;EAAiB,CAAC,GAAGH,KAAK;EACrE,MAAMI,OAAO,GAAGP,qBAAqB,CAACK,gBAAgB,EAAEG,KAAK,IAAI,CAAC,CAAC;EACnE,MAAMC,OAAO,GAAGT,qBAAqB,CAACK,gBAAgB,EAAEK,MAAM,IAAI,CAAC,CAAC;EACpE,MAAMC,MAAM,GAAGX,qBAAqB,CAACM,gBAAgB,IAAI,CAAC,CAAC;EAC3D,MAAMM,KAAK,GAAGb,cAAc,CAAEK,eAAe,IAAI,SAAoB,CAAC;EAEtE,OAAO,GAAGG,OAAO,IAAIE,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAIC,MAA2B,IAAK;EAC/D,MAAMC,WAAW,GAAGd,oBAAoB,CAACJ,kBAAkB,EAAEiB,MAAM,CAAC;;EAEpE;EACA,IAAIC,WAAW,CAACC,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO;MACHC,UAAU,EAAEf,qBAAqB,CAACY,MAAoB;IAC1D,CAAC;EACL;;EAEA;EACA,MAAMI,gBAAgB,GAAGH,WAAW,CAACI,GAAG,CAACC,UAAU,IAAI;IACnD,MAAMR,KAAK,GAAGd,kBAAkB,CAAC,iBAAiB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IACvE,MAAM;MAAEN,KAAK;MAAEE;IAAO,CAAC,GAAGZ,kBAAkB,CAAC,kBAAkB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IACpF,MAAMH,MAAM,GAAGb,kBAAkB,CAAC,kBAAkB,EAAEsB,UAAU,EAAEN,MAAM,CAAC;IAEzE,OAAO;MACH,CAACM,UAAU,GAAG;QACVH,UAAU,EAAEf,qBAAqB,CAAC;UAC9BE,eAAe,EAAEQ,KAAK;UACtBP,gBAAgB,EAAE;YACdG,KAAK;YACLE;UACJ,CAAC;UACDJ,gBAAgB,EAAEK;QACtB,CAAC;MACL;IACJ,CAAC;EACL,CAAC,CAAC;;EAEF;EACA,OAAOf,gBAAgB,CAAC,GAAGsB,gBAAgB,CAAC;AAChD,CAAC","ignoreList":[]}
@@ -6,8 +6,10 @@ import normalizeColors from '@react-native/normalize-colors';
6
6
  import { BOX_SHADOW_STYLES, TEXT_SHADOW_STYLES } from './types';
7
7
  export const isTransform = (key, value) => key === 'transform' && Array.isArray(value);
8
8
  export const isTextShadow = key => TEXT_SHADOW_STYLES.includes(key);
9
- export const isBoxShadow = key => BOX_SHADOW_STYLES.includes(key);
10
- export const normalizeNumericValue = value => value ? `${value}px` : value;
9
+ export const isShadow = key => BOX_SHADOW_STYLES.includes(key);
10
+ export const isFilter = (key, value) => key === 'filter' && Array.isArray(value);
11
+ export const isBoxShadow = (key, value) => key === 'boxShadow' && Array.isArray(value);
12
+ export const normalizeNumericValue = value => value && typeof value === 'number' ? `${value}px` : value;
11
13
  export const normalizeColor = (color, opacity = 1) => {
12
14
  // If the opacity is 1 there's no need to normalize the color
13
15
  if (opacity === 1) {
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeColors","BOX_SHADOW_STYLES","TEXT_SHADOW_STYLES","isTransform","key","value","Array","isArray","isTextShadow","includes","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","hex","toString","padStart","length","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAC5D,SAASC,iBAAiB,EAAEC,kBAAkB,QAA4C,SAAS;AAEnG,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAA0CD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAExI,OAAO,MAAMG,YAAY,GAAIJ,GAAW,IAAKF,kBAAkB,CAACO,QAAQ,CAACL,GAAwC,CAAC;AAElH,OAAO,MAAMM,WAAW,GAAIN,GAAW,IAAKH,iBAAiB,CAACQ,QAAQ,CAACL,GAAuC,CAAC;AAE/G,OAAO,MAAMO,qBAAqB,GAAIN,KAAa,IAAKA,KAAK,GAAG,GAAGA,KAAK,IAAI,GAAGA,KAAK;AAEpF,OAAO,MAAMO,cAAc,GAAGA,CAACC,KAAa,EAAEC,OAAe,GAAG,CAAC,KAAK;EAClE;EACA,IAAIA,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAME,OAAO,GAAGf,eAAe,CAACa,KAAK,CAAC;;EAEtC;EACA,IAAIE,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOF,KAAK;EAChB;EAEA,MAAMG,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGP,GAAG,CACnCQ,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC;IAE/B,OAAO,QAAQT,CAAC,IAAIC,CAAC,IAAIC,CAAC,IAAKC,CAAC,GAAG,GAAG,GAAIT,OAAO,GAAG;EACxD;EAEA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAMkB,kBAAkB,GAAGA,CAA6B3B,GAAS,EAAE4B,UAAkB,EAAEC,MAAW,KAAsB;EAC3H,MAAM5B,KAAK,GAAG4B,MAAM,CAAC7B,GAAG,CAAC;EAEzB,IAAIA,GAAG,KAAK,kBAAkB,IAAIA,GAAG,KAAK,cAAc,EAAE;IACtD,MAAM;MAAE8B,KAAK;MAAEC;IAAO,CAAC,GAAG9B,KAAK;IAE/B,OAAO;MACH6B,KAAK,EAAE,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACF,UAAU,CAAC,GAAGE,KAAK;MAC5DC,MAAM,EAAE,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,CAACH,UAAU,CAAC,GAAGG;IAC9D,CAAC;EACL;EAEA,OAAO,OAAO9B,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAAC2B,UAAU,CAAC,GAAG3B,KAAK;AAChE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["normalizeColors","BOX_SHADOW_STYLES","TEXT_SHADOW_STYLES","isTransform","key","value","Array","isArray","isTextShadow","includes","isShadow","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","hex","toString","padStart","length","r","g","b","a","split","map","x","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;AAAA;AACA;AACA,OAAOA,eAAe,MAAM,gCAAgC;AAC5D,SAASC,iBAAiB,EAAEC,kBAAkB,QAA0D,SAAS;AAIjH,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAsCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEpI,OAAO,MAAMG,YAAY,GAAIJ,GAAW,IAAKF,kBAAkB,CAACO,QAAQ,CAACL,GAAwC,CAAC;AAElH,OAAO,MAAMM,QAAQ,GAAIN,GAAW,IAAKH,iBAAiB,CAACQ,QAAQ,CAACL,GAAuC,CAAC;AAE5G,OAAO,MAAMO,QAAQ,GAAGA,CAACP,GAAW,EAAEC,KAAU,KAA8BD,GAAG,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEtH,OAAO,MAAMO,WAAW,GAAGA,CAACR,GAAW,EAAEC,KAAU,KAAqCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEnI,OAAO,MAAMQ,qBAAqB,GAAIR,KAAsB,IAAKA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,GAAG,GAAGA,KAAK,IAAI,GAAGA,KAAK;AAE1H,OAAO,MAAMS,cAAc,GAAGA,CAACC,KAAa,EAAEC,OAAO,GAAG,CAAC,KAAK;EAC1D;EACA,IAAIA,OAAO,KAAK,CAAC,EAAE;IACf,OAAOD,KAAK;EAChB;EAEA,MAAME,OAAO,GAAGjB,eAAe,CAACe,KAAK,CAAC;;EAEtC;EACA,IAAIE,OAAO,KAAK,IAAI,EAAE;IAClB,OAAOF,KAAK;EAChB;EAEA,MAAMG,GAAG,GAAGD,OAAO,CAACE,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAEjD,IAAIF,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;IAClB,MAAM,CAACC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,CAAC,GAAGP,GAAG,CACnCQ,KAAK,CAAC,cAAc,CAAC,CACrBC,GAAG,CAACC,CAAC,IAAIC,QAAQ,CAACD,CAAC,EAAE,EAAE,CAAC,CAAC,CACzBE,MAAM,CAACC,GAAG,IAAI,CAACC,KAAK,CAACD,GAAG,CAAC,CAAC;IAE/B,OAAO,QAAQT,CAAC,IAAIC,CAAC,IAAIC,CAAC,IAAKC,CAAC,GAAG,GAAG,GAAIT,OAAO,GAAG;EACxD;EAEA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAMkB,kBAAkB,GAAGA,CAA6B7B,GAAS,EAAE8B,UAAkB,EAAEC,MAAW,KAAsB;EAC3H,MAAM9B,KAAK,GAAG8B,MAAM,CAAC/B,GAAG,CAAC;EAEzB,IAAIA,GAAG,KAAK,kBAAkB,IAAIA,GAAG,KAAK,cAAc,EAAE;IACtD,MAAM;MAAEgC,KAAK;MAAEC;IAAO,CAAC,GAAGhC,KAAK;IAE/B,OAAO;MACH+B,KAAK,EAAE,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACF,UAAU,CAAC,GAAGE,KAAK;MAC5DC,MAAM,EAAE,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,CAACH,UAAU,CAAC,GAAGG;IAC9D,CAAC;EACL;EAEA,OAAO,OAAOhC,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAAC6B,UAAU,CAAC,GAAG7B,KAAK;AAChE,CAAC","ignoreList":[]}
@@ -7,7 +7,11 @@ class UnistylesListenerBuilder {
7
7
  listeners = Array.from({
8
8
  length: Object.keys(UnistyleDependency).length / 2
9
9
  }, () => new Set());
10
+ stylesheetListeners = Array.from({
11
+ length: Object.keys(UnistyleDependency).length / 2
12
+ }, () => new Set());
10
13
  emitChange = dependency => {
14
+ this.stylesheetListeners[dependency]?.forEach(listener => listener());
11
15
  this.listeners[dependency]?.forEach(listener => listener());
12
16
  };
13
17
  initListeners = () => {
@@ -26,6 +30,12 @@ class UnistylesListenerBuilder {
26
30
  dependencies.forEach(dependency => this.listeners[dependency]?.delete(listener));
27
31
  };
28
32
  };
33
+ addStylesheetListeners = (dependencies, listener) => {
34
+ dependencies.forEach(dependency => this.stylesheetListeners[dependency]?.add(listener));
35
+ return () => {
36
+ dependencies.forEach(dependency => this.stylesheetListeners[dependency]?.delete(listener));
37
+ };
38
+ };
29
39
  }
30
40
  export const UnistylesListener = new UnistylesListenerBuilder();
31
41
  //# sourceMappingURL=listener.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,WAAW;AAE5C,MAAMC,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACO,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAIG,GAAG,CAAe,CAAC,CAAC;EAErHC,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACZ,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;IACzBF,gBAAgB,CAACe,SAAS,EAAEC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACkB,WAAW,CAAC,CAAC;IAC7GjB,gBAAgB,CAACkB,UAAU,EAAEF,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACkB,WAAW,CAAC,CAAC;IAC9GE,MAAM,CAACH,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACqB,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACX,kBAAkB,CAACsB,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEV,QAAsB,KAAK;IAChFU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEa,GAAG,CAACX,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACR,SAAS,CAACQ,UAAU,CAAC,EAAEc,MAAM,CAACZ,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMa,iBAAiB,GAAG,IAAIzB,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;AAAA,SAASA,kBAAk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AgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACN,UAAU,CAACZ,kBAAkB,CAACuB,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEV,QAAsB,KAAK;IAChFU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEa,GAAG,CAACX,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACT,SAAS,CAACS,UAAU,CAAC,EAAEc,MAAM,CAACZ,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;EAEDa,sBAAsB,GAAGA,CAACH,YAAuC,EAAEV,QAAsB,KAAK;IAC1FU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEa,GAAG,CAACX,QAAQ,CAAC,CAAC;IAEvF,OAAO,MAAM;MACTU,YAAY,CAACX,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEc,MAAM,CAACZ,QAAQ,CAAC,CAAC;IAC9F,CAAC;EACL,CAAC;AACL;AAEA,OAAO,MAAMc,iBAAiB,GAAG,IAAI3B,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  import { UnistylesRuntime } from './runtime';
4
- import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies, deepMergeObjects } from './utils';
4
+ import { extractMediaQueryValue, keyInObject, getMediaQuery, generateHash, extractUnistyleDependencies } from './utils';
5
5
  import { UnistylesListener } from './listener';
6
6
  import { convertUnistyles } from './convert';
7
- import { getVariants } from './variants';
8
7
  class UnistylesRegistryBuilder {
9
8
  stylesheets = new Map();
10
9
  stylesCounter = new Map();
@@ -40,46 +39,31 @@ class UnistylesRegistryBuilder {
40
39
  this.disposeListenersMap.get(stylesheet)?.();
41
40
  const dependenciesMap = this.dependenciesMap.get(stylesheet) ?? new Set(dependencies);
42
41
  dependencies.forEach(dependency => dependenciesMap.add(dependency));
43
- const dispose = UnistylesListener.addListeners(Array.from(dependenciesMap), () => {
42
+ const dispose = UnistylesListener.addStylesheetListeners(Array.from(dependenciesMap), () => {
44
43
  const newComputedStylesheet = stylesheet(UnistylesRuntime.theme, UnistylesRuntime.miniRuntime);
45
44
  this.stylesheets.set(stylesheet, newComputedStylesheet);
46
45
  });
47
46
  this.dependenciesMap.set(stylesheet, dependenciesMap);
48
47
  this.disposeListenersMap.set(stylesheet, dispose);
49
48
  };
50
- add = ({
51
- key,
52
- value,
53
- stylesheet,
54
- args,
55
- variants
56
- }) => {
49
+ add = value => {
57
50
  const hash = generateHash(value);
58
51
  const existingCounter = this.stylesCounter.get(hash);
59
52
  if (!existingCounter || existingCounter.size === 0) {
60
53
  const counter = new Set();
61
- const dependencies = extractUnistyleDependencies(value);
62
54
  counter.add(value);
63
55
  this.stylesCounter.set(hash, counter);
64
56
  this.applyStyles(hash, convertUnistyles(value));
65
- UnistylesListener.addListeners(dependencies, async () => {
66
- // Move this callback to the end of the event loop
67
- await Promise.resolve();
68
- const newComputedStyleSheet = this.getComputedStylesheet(stylesheet);
69
- const newValue = newComputedStyleSheet[key];
70
- const result = typeof newValue === 'function' ? newValue(...args) : newValue;
71
- const {
72
- variantsResult
73
- } = Object.fromEntries(getVariants({
74
- variantsResult: result
75
- }, variants));
76
- const resultWithVariants = deepMergeObjects(result, variantsResult ?? {});
77
- this.applyStyles(hash, convertUnistyles(resultWithVariants));
78
- });
79
- return hash;
57
+ return {
58
+ hash,
59
+ existingHash: false
60
+ };
80
61
  }
81
62
  existingCounter.add(value);
82
- return hash;
63
+ return {
64
+ hash,
65
+ existingHash: true
66
+ };
83
67
  };
84
68
  applyStyles = (hash, styles) => {
85
69
  Object.entries(styles).forEach(([key, value]) => {
@@ -173,6 +157,9 @@ class UnistylesRegistryBuilder {
173
157
  existingStyles.delete(value);
174
158
  if (existingStyles.size === 0) {
175
159
  const ruleIndex = Array.from(this.styleTag.sheet?.cssRules ?? []).findIndex(rule => rule.cssText.includes(`.${hash}`));
160
+ if (ruleIndex === -1) {
161
+ return;
162
+ }
176
163
  this.styleTag.sheet?.deleteRule(ruleIndex);
177
164
  }
178
165
  };
@@ -1 +1 @@
1
- {"version":3,"names":["UnistylesRuntime","extractMediaQueryValue","keyInObject","getMediaQuery","generateHash","extractUnistyleDependencies","deepMergeObjects","UnistylesListener","convertUnistyles","getVariants","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","theme","miniRuntime","dependencies","Object","values","flatMap","value","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","addListeners","Array","from","newComputedStylesheet","key","args","variants","hash","existingCounter","size","counter","applyStyles","Promise","resolve","newComputedStyleSheet","newValue","result","variantsResult","fromEntries","resultWithVariants","styles","entries","sheet","startsWith","mediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAEC,2BAA2B,EAAEC,gBAAgB,QAAQ,SAAS;AACzI,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,gBAAgB,QAAQ,WAAW;AAG5C,SAASC,WAAW,QAAQ,YAAY;AAmBxC,MAAMC,wBAAwB,CAAC;EACVC,WAAW,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ACf,QAAQ,CAACzB,IAAI,CAAC;IAC9D,CAAC,CAAC,IAAI,IAAI;IAEV,IAAI,CAACqB,IAAI,EAAE;MACPA,IAAI,GAAGN,KAAK,CAACG,QAAQ,CAACM,IAAI,CAACT,KAAK,CAACmB,UAAU,CAAC,IAAIlC,IAAI,KAAK,CAAC,CAAC;IAC/D;IAEA,IAAI,EAAEqB,IAAI,YAAYoB,YAAY,CAAC,IAAI,CAACzF,WAAW,CAACqE,IAAI,CAACsB,KAAK,EAAE9C,GAAG,CAAC,EAAE;MAClE;IACJ;IAEAwB,IAAI,CAACsB,KAAK,CAAC9C,GAAG,CAAwC,GAAGZ,KAAK;EAClE,CAAC;EAED2D,MAAM,GAAI3D,KAAsB,IAAK;IACjC,MAAMe,IAAI,GAAG9C,YAAY,CAAC+B,KAAK,CAAC;IAChC,MAAM4D,cAAc,GAAG,IAAI,CAAClF,aAAa,CAACc,GAAG,CAACuB,IAAI,CAAC;IAEnD,IAAI,CAAC6C,cAAc,EAAE;MACjB;IACJ;IAEAA,cAAc,CAACC,MAAM,CAAC7D,KAAK,CAAC;IAE5B,IAAI4D,cAAc,CAAC3C,IAAI,KAAK,CAAC,EAAE;MAC3B,MAAMyB,SAAS,GAAGjC,KAAK,CAACC,IAAI,CAAC,IAAI,CAAC/B,QAAQ,CAACmD,KAAK,EAAEG,QAAQ,IAAI,EAAE,CAAC,CAAC6B,SAAS,CAAC1B,IAAI,IAAIA,IAAI,CAAC2B,OAAO,CAACvB,QAAQ,CAAC,IAAIzB,IAAI,EAAE,CAAC,CAAC;MAEtH,IAAI,CAACpC,QAAQ,CAACmD,KAAK,EAAEkC,UAAU,CAACtB,SAAS,CAAC;IAC9C;EACJ,CAAC;AACL;AAEA,OAAO,MAAMuB,iBAAiB,GAAG,IAAI1F,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["UnistylesRuntime","extractMediaQueryValue","keyInObject","getMediaQuery","generateHash","extractUnistyleDependencies","UnistylesListener","convertUnistyles","UnistylesRegistryBuilder","stylesheets","Map","stylesCounter","styleTag","disposeListenersMap","dependenciesMap","tag","newTag","document","createElement","id","head","appendChild","getComputedStylesheet","stylesheet","computedStylesheet","get","createdStylesheet","theme","miniRuntime","dependencies","Object","values","flatMap","value","addDependenciesToStylesheet","set","Set","forEach","dependency","add","dispose","addStylesheetListeners","Array","from","newComputedStylesheet","hash","existingCounter","size","counter","applyStyles","existingHash","styles","entries","key","sheet","startsWith","mediaQuery","cssRules","queryRule","find","rule","CSSMediaRule","media","item","includes","mediaQueryValue","ruleIndex","reduce","acc","ruleMediaQueryValue","conditionText","undefined","length","insertRule","mqKey","mqValue","applyRule","pseudoKey","pseudoValue","replace","CSSStyleRule","selectorText","style","remove","existingStyles","delete","findIndex","cssText","deleteRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,sBAAsB,EAAEC,WAAW,EAAEC,aAAa,EAAEC,YAAY,EAAEC,2BAA2B,QAAQ,SAAS;AACvH,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,gBAAgB,QAAQ,WAAW;AAa5C,MAAMC,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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AAC","ignoreList":[]}
@@ -44,6 +44,9 @@ class UnistylesRuntimeBuilder {
44
44
  get contentSizeCategory() {
45
45
  return WebContentSizeCategory.Unspecified;
46
46
  }
47
+ get breakpoints() {
48
+ return UnistylesState.breakpoints ?? {};
49
+ }
47
50
  get breakpoint() {
48
51
  return UnistylesState.breakpoint;
49
52
  }
@@ -1 +1 @@
1
- {"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAE5D,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA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IAEAwC,QAAQ,CAACC,eAAe,CAACiB,KAAK,CAACC,eAAe,GAAGF,KAAK,GAAG1D,SAAS,CAACyD,GAAG,EAAEC,KAAK,CAAC,GAAGD,GAAG;EACxF,CAAC;EAEDI,gBAAgB,GAAGA,CAAA,KAAM,CAAC,CAAC;EAE3BC,WAAW,GAAGA,CAAC/C,SAAuB,EAAEgD,OAA6C,KAAK;IACtF,MAAMC,QAAQ,GAAGjE,cAAc,CAACkE,MAAM,CAACC,GAAG,CAACnD,SAAS,CAAC;IAErD,IAAI,CAACiD,QAAQ,EAAE;MACX,MAAM,IAAIG,KAAK,CAAC,aAAapD,SAAS,sBAAsB,CAAC;IACjE;IAEAhB,cAAc,CAACkE,MAAM,CAACG,GAAG,CAACrD,SAAS,EAAEgD,OAAO,CAACC,QAAQ,CAAC,CAAC;EAC3D,CAAC;EAEDvC,QAAQ,GAAGA,CAACV,SAAS,GAAG,IAAI,CAACA,SAAS,KAAK;IACvC,IAAI,CAACA,SAAS,EAAE;MACZ,MAAM,IAAIoD,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,MAAM3C,KAAK,GAAGzB,cAAc,CAACkE,MAAM,CAACC,GAAG,CAACnD,SAAS,CAAC;IAElD,IAAI,CAACS,KAAK,EAAE;MACR,MAAM,IAAI2C,KAAK,CAAC,aAAa,IAAI,CAACpD,SAAS,sBAAsB,CAAC;IACtE;IAEA,OAAOS,KAAK;EAChB,CAAC;AACL;AAEA,OAAO,MAAM0B,gBAAgB,GAAG,IAAI/C,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["UnistyleDependency","ColorScheme","Orientation","WebContentSizeCategory","UnistylesListener","NavigationBar","StatusBar","UnistylesState","hexToRGBA","isServer","schemeToTheme","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","window","matchMedia","colorScheme","matches","Light","Dark","Unspecified","themeName","contentSizeCategory","breakpoints","breakpoint","orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","rtl","document","documentElement","dir","hasAdaptiveThemes","navigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","emitChange","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","hex","alpha","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,EAAEC,WAAW,QAA0C,gBAAgB;AAE3F,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,EAAEC,SAAS,QAAQ,QAAQ;AACjD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,SAAS,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AAE5D,MAAMC,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAIJ,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACG,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGI,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACL,UAAU;EAC1B;EAEQG,YAAYA,CAAA,EAA0B;IAC1C,IAAIN,QAAQ,CAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACK,SAAS,EAAE;MACjB,IAAI,CAACA,SAAS,GAAGE,MAAM,CAACC,UAAU,CAAC,8BAA8B,CAAC;IACtE;IAEA,OAAO,IAAI,CAACH,SAAS;EACzB;EAEA,I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