react-native-unistyles 3.0.0-alpha.40 → 3.0.0-alpha.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. package/README.md +7 -1
  2. package/android/CMakeLists.txt +3 -0
  3. package/android/build.gradle +10 -0
  4. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +10 -1
  5. package/cxx/core/UnistyleData.h +3 -2
  6. package/cxx/core/UnistylesRegistry.cpp +15 -5
  7. package/cxx/core/UnistylesRegistry.h +2 -2
  8. package/cxx/hybridObjects/HybridShadowRegistry.cpp +5 -2
  9. package/cxx/parser/Parser.cpp +10 -4
  10. package/cxx/shadowTree/ShadowLeafUpdate.h +1 -0
  11. package/cxx/shadowTree/ShadowTreeManager.cpp +4 -0
  12. package/ios/Extensions.swift +3 -1
  13. package/ios/NativePlatform+ios.swift +13 -2
  14. package/ios/NativePlatformListener+ios.swift +0 -1
  15. package/lib/commonjs/components/Display.js +2 -2
  16. package/lib/commonjs/components/Display.js.map +1 -1
  17. package/lib/commonjs/components/Hide.js +2 -2
  18. package/lib/commonjs/components/Hide.js.map +1 -1
  19. package/lib/commonjs/components/Pressable.js +64 -0
  20. package/lib/commonjs/components/Pressable.js.map +1 -0
  21. package/lib/commonjs/components/Pressable.web.js +97 -0
  22. package/lib/commonjs/components/Pressable.web.js.map +1 -0
  23. package/lib/commonjs/components/index.js +7 -0
  24. package/lib/commonjs/components/index.js.map +1 -1
  25. package/lib/commonjs/core/getBoundArgs.js +18 -0
  26. package/lib/commonjs/core/getBoundArgs.js.map +1 -0
  27. package/lib/commonjs/core/getId.js +9 -0
  28. package/lib/commonjs/core/getId.js.map +1 -0
  29. package/lib/commonjs/core/index.js +14 -0
  30. package/lib/commonjs/core/index.js.map +1 -1
  31. package/lib/commonjs/hooks/index.js +13 -0
  32. package/lib/commonjs/hooks/index.js.map +1 -0
  33. package/lib/commonjs/hooks/useMedia.js.map +1 -0
  34. package/lib/commonjs/hooks/useMedia.web.js.map +1 -0
  35. package/lib/commonjs/index.js +8 -1
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/mq.js +6 -6
  38. package/lib/commonjs/mq.js.map +1 -1
  39. package/lib/commonjs/specs/ShadowRegistry/index.js +3 -4
  40. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  41. package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
  42. package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
  43. package/lib/commonjs/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
  44. package/lib/commonjs/specs/index.web.js +0 -7
  45. package/lib/commonjs/specs/index.web.js.map +1 -1
  46. package/lib/commonjs/utils.js +1 -1
  47. package/lib/commonjs/utils.js.map +1 -1
  48. package/lib/commonjs/web/convert/types.js.map +1 -1
  49. package/lib/commonjs/web/convert/utils.js +1 -1
  50. package/lib/commonjs/web/convert/utils.js.map +1 -1
  51. package/lib/commonjs/web/create.js +4 -1
  52. package/lib/commonjs/web/create.js.map +1 -1
  53. package/lib/commonjs/web/index.js +7 -5
  54. package/lib/commonjs/web/index.js.map +1 -1
  55. package/lib/commonjs/web/listener.js.map +1 -1
  56. package/lib/commonjs/web/runtime.js +7 -7
  57. package/lib/commonjs/web/runtime.js.map +1 -1
  58. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  59. package/lib/commonjs/web/state.js +23 -16
  60. package/lib/commonjs/web/state.js.map +1 -1
  61. package/lib/commonjs/web/utils/common.js +3 -3
  62. package/lib/commonjs/web/utils/common.js.map +1 -1
  63. package/lib/commonjs/web/utils/unistyle.js +2 -4
  64. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  65. package/lib/commonjs/web/variants/getVariants.js +1 -1
  66. package/lib/commonjs/web/variants/getVariants.js.map +1 -1
  67. package/lib/commonjs/web/variants/useVariants.js +1 -1
  68. package/lib/module/components/Display.js +1 -1
  69. package/lib/module/components/Display.js.map +1 -1
  70. package/lib/module/components/Hide.js +1 -1
  71. package/lib/module/components/Hide.js.map +1 -1
  72. package/lib/module/components/Pressable.js +58 -0
  73. package/lib/module/components/Pressable.js.map +1 -0
  74. package/lib/module/components/Pressable.web.js +91 -0
  75. package/lib/module/components/Pressable.web.js.map +1 -0
  76. package/lib/module/components/index.js +1 -0
  77. package/lib/module/components/index.js.map +1 -1
  78. package/lib/module/core/getBoundArgs.js +13 -0
  79. package/lib/module/core/getBoundArgs.js.map +1 -0
  80. package/lib/module/core/getId.js +4 -0
  81. package/lib/module/core/getId.js.map +1 -0
  82. package/lib/module/core/index.js +2 -0
  83. package/lib/module/core/index.js.map +1 -1
  84. package/lib/module/hooks/index.js +4 -0
  85. package/lib/module/hooks/index.js.map +1 -0
  86. package/lib/module/hooks/useMedia.js.map +1 -0
  87. package/lib/module/hooks/useMedia.web.js.map +1 -0
  88. package/lib/module/index.js +1 -1
  89. package/lib/module/index.js.map +1 -1
  90. package/lib/module/mq.js +6 -6
  91. package/lib/module/mq.js.map +1 -1
  92. package/lib/module/specs/ShadowRegistry/index.js +3 -4
  93. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  94. package/lib/module/specs/StyleSheet/index.js.map +1 -1
  95. package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +1 -2
  96. package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +1 -1
  97. package/lib/module/specs/index.web.js +0 -1
  98. package/lib/module/specs/index.web.js.map +1 -1
  99. package/lib/module/utils.js +1 -1
  100. package/lib/module/utils.js.map +1 -1
  101. package/lib/module/web/convert/types.js.map +1 -1
  102. package/lib/module/web/convert/utils.js +1 -1
  103. package/lib/module/web/convert/utils.js.map +1 -1
  104. package/lib/module/web/create.js +5 -2
  105. package/lib/module/web/create.js.map +1 -1
  106. package/lib/module/web/index.js +7 -3
  107. package/lib/module/web/index.js.map +1 -1
  108. package/lib/module/web/listener.js.map +1 -1
  109. package/lib/module/web/runtime.js +8 -8
  110. package/lib/module/web/runtime.js.map +1 -1
  111. package/lib/module/web/shadowRegistry.js.map +1 -1
  112. package/lib/module/web/state.js +24 -17
  113. package/lib/module/web/state.js.map +1 -1
  114. package/lib/module/web/utils/common.js +1 -1
  115. package/lib/module/web/utils/common.js.map +1 -1
  116. package/lib/module/web/utils/unistyle.js +1 -2
  117. package/lib/module/web/utils/unistyle.js.map +1 -1
  118. package/lib/module/web/variants/getVariants.js +1 -1
  119. package/lib/module/web/variants/getVariants.js.map +1 -1
  120. package/lib/module/web/variants/useVariants.js +1 -1
  121. package/lib/typescript/src/components/Pressable.d.ts +7 -0
  122. package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
  123. package/lib/typescript/src/components/Pressable.web.d.ts +13 -0
  124. package/lib/typescript/src/components/Pressable.web.d.ts.map +1 -0
  125. package/lib/typescript/src/components/index.d.ts +1 -0
  126. package/lib/typescript/src/components/index.d.ts.map +1 -1
  127. package/lib/typescript/src/core/getBoundArgs.d.ts +2 -0
  128. package/lib/typescript/src/core/getBoundArgs.d.ts.map +1 -0
  129. package/lib/typescript/src/core/getId.d.ts +2 -0
  130. package/lib/typescript/src/core/getId.d.ts.map +1 -0
  131. package/lib/typescript/src/core/index.d.ts +2 -0
  132. package/lib/typescript/src/core/index.d.ts.map +1 -1
  133. package/lib/typescript/src/hooks/index.d.ts +2 -0
  134. package/lib/typescript/src/hooks/index.d.ts.map +1 -0
  135. package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -0
  136. package/lib/typescript/src/hooks/useMedia.web.d.ts.map +1 -0
  137. package/lib/typescript/src/index.d.ts +1 -1
  138. package/lib/typescript/src/index.d.ts.map +1 -1
  139. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +1 -1
  140. package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
  141. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +2 -2
  142. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  143. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +1 -0
  144. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  145. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +1 -1
  146. package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts.map +1 -1
  147. package/lib/typescript/src/specs/StyleSheet/index.d.ts +3 -2
  148. package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
  149. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +1 -1
  150. package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
  151. package/lib/typescript/src/specs/index.web.d.ts +0 -2
  152. package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
  153. package/lib/typescript/src/types/common.d.ts +1 -0
  154. package/lib/typescript/src/types/common.d.ts.map +1 -1
  155. package/lib/typescript/src/types/index.d.ts +1 -1
  156. package/lib/typescript/src/types/index.d.ts.map +1 -1
  157. package/lib/typescript/src/web/convert/types.d.ts +1 -1
  158. package/lib/typescript/src/web/convert/types.d.ts.map +1 -1
  159. package/lib/typescript/src/web/create.d.ts +1 -1
  160. package/lib/typescript/src/web/create.d.ts.map +1 -1
  161. package/lib/typescript/src/web/index.d.ts +8 -2
  162. package/lib/typescript/src/web/index.d.ts.map +1 -1
  163. package/lib/typescript/src/web/listener.d.ts.map +1 -1
  164. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  165. package/lib/typescript/src/web/state.d.ts.map +1 -1
  166. package/lib/typescript/src/web/utils/common.d.ts +1 -1
  167. package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
  168. package/lib/typescript/src/web/utils/unistyle.d.ts +0 -1
  169. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  170. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +1 -1
  171. package/package.json +14 -18
  172. package/plugin/common.js +1 -4
  173. package/plugin/import.js +29 -3
  174. package/plugin/index.js +16 -6
  175. package/plugin/ref.js +4 -54
  176. package/plugin/style.js +116 -43
  177. package/src/components/Display.tsx +1 -1
  178. package/src/components/Hide.tsx +1 -1
  179. package/src/components/Pressable.tsx +72 -0
  180. package/src/components/Pressable.web.tsx +103 -0
  181. package/src/components/index.ts +1 -0
  182. package/src/core/getBoundArgs.ts +15 -0
  183. package/src/core/getId.ts +1 -0
  184. package/src/core/index.ts +2 -0
  185. package/src/hooks/index.ts +1 -0
  186. package/src/index.ts +1 -1
  187. package/src/mq.ts +6 -6
  188. package/src/specs/NativePlatform/NativePlatform.nitro.ts +1 -1
  189. package/src/specs/ShadowRegistry/index.ts +5 -6
  190. package/src/specs/ShadowRegistry/types.ts +2 -1
  191. package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +1 -1
  192. package/src/specs/StyleSheet/index.ts +3 -2
  193. package/src/specs/TurboUnistyles/NativeTurboUnistyles.ts +1 -2
  194. package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +1 -1
  195. package/src/specs/UnistylesRuntime/index.ts +1 -1
  196. package/src/specs/index.web.ts +0 -4
  197. package/src/types/common.ts +1 -0
  198. package/src/types/index.ts +1 -1
  199. package/src/utils.ts +1 -1
  200. package/src/web/convert/types.ts +1 -1
  201. package/src/web/convert/utils.ts +2 -2
  202. package/src/web/create.ts +6 -2
  203. package/src/web/index.ts +7 -3
  204. package/src/web/listener.ts +2 -0
  205. package/src/web/registry.ts +1 -1
  206. package/src/web/runtime.ts +9 -9
  207. package/src/web/shadowRegistry.ts +2 -2
  208. package/src/web/state.ts +36 -17
  209. package/src/web/utils/common.ts +1 -1
  210. package/src/web/utils/unistyle.ts +3 -9
  211. package/src/web/variants/getVariants.ts +1 -1
  212. package/src/web/variants/useVariants.ts +1 -1
  213. package/lib/commonjs/components/useMedia.js.map +0 -1
  214. package/lib/commonjs/components/useMedia.web.js.map +0 -1
  215. package/lib/module/components/useMedia.js.map +0 -1
  216. package/lib/module/components/useMedia.web.js.map +0 -1
  217. package/lib/typescript/src/components/useMedia.d.ts.map +0 -1
  218. package/lib/typescript/src/components/useMedia.web.d.ts.map +0 -1
  219. /package/lib/commonjs/{components → hooks}/useMedia.js +0 -0
  220. /package/lib/commonjs/{components → hooks}/useMedia.web.js +0 -0
  221. /package/lib/module/{components → hooks}/useMedia.js +0 -0
  222. /package/lib/module/{components → hooks}/useMedia.web.js +0 -0
  223. /package/lib/typescript/src/{components → hooks}/useMedia.d.ts +0 -0
  224. /package/lib/typescript/src/{components → hooks}/useMedia.web.d.ts +0 -0
  225. /package/src/{components → hooks}/useMedia.ts +0 -0
  226. /package/src/{components → hooks}/useMedia.web.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_useMedia","require"],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_specs","_mq","useMedia","config","computeIsVisible","maybeMq","mq","isUnistylesMq","console","error","parsedMq","parseMq","isValidMq","width","height","UnistylesRuntime","screen","minWidth","undefined","maxWidth","minHeight","maxHeight","isVisible","setIsVisible","useState","useEffect","useLayoutEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","includes","UnistyleDependency","Breakpoints","exports"],"sourceRoot":"../../../src","sources":["hooks/useMedia.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,GAAA,GAAAF,OAAA;AAEO,MAAMG,QAAQ,GAAIC,MAAsB,IAAK;EAChD,MAAMC,gBAAgB,GAAGA,CAAA,KAAe;IACpC,MAAMC,OAAO,GAAGF,MAAM,CAACG,EAAuB;IAE9C,IAAI,CAAC,IAAAC,iBAAa,EAACF,OAAO,CAAC,EAAE;MACzBG,OAAO,CAACC,KAAK,CAAC,sCAAsCJ,OAAO,EAAE,CAAC;MAE9D,OAAO,KAAK;IAChB;IAEA,MAAMK,QAAQ,GAAG,IAAAC,WAAO,EAACN,OAAO,CAAC;IAEjC,IAAI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AC;IAC1B,CAAC;EACL,CAAC,EAAE,CAACxB,MAAM,CAACG,EAAE,CAAC,CAAC;EAEf,OAAO;IACHgB;EACJ,CAAC;AACL,CAAC;AAAAY,OAAA,CAAAhC,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_mq","useMedia","config","disposeRef","useRef","isVisible","setIsVisible","useState","maybeMq","mq","isUnistylesMq","console","error","parsedMq","parseMq","isValidMq","minWidth","maxWidth","minHeight","maxHeight","mediaQuery","undefined","filter","Boolean","join","media","window","matchMedia","handler","event","matches","addEventListener","current","removeEventListener","useEffect","exports"],"sourceRoot":"../../../src","sources":["hooks/useMedia.web.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,GAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAIC,MAAsB,IAAK;EAChD,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,MAAM,CAAC,CAAC,CAAC;EACnC,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAM;IAC7C,MAAMC,OAAO,GAAGN,MAAM,CAACO,EAAuB;IAE9C,IAAI,CAAC,IAAAC,iBAAa,EAACF,OAAO,CAAC,EAAE;MACzBG,OAAO,CAACC,KAAK,CAAC,sCAAsCJ,OAAO,EAAE,CAAC;MAE9D,OAAO,KAAK;IAChB;IAEA,MAAMK,QAAQ,GAAG,IAAAC,WAAO,EAACN,OAAO,CAAC;IAEjC,IAAI,CAAC,IAAAO,aAAS,EAACF,QAAQ,CAAC,EAAE;MACtBF,OAAO,CAACC,KAAK,CAAC,oEAAoEJ,OAAO,EAAE,CAAC;MAE5F,OAAO,KAAK;IAChB;IAEA,MAAM;MAAEQ,QAAQ;MAAEC,QAAQ;MAAEC,SAAS;MAAEC;IAAU,CAAC,GAAGN,QAAQ;IAE7D,MAAMO,UAAU,GAAG,CACfJ,QAAQ,KAAKK,SAAS,GAAG,eAAeL,QAAQ,KAAK,GAAGK,SAAS,EACjEJ,QAAQ,KAAKI,SAAS,GAAG,eAAeJ,QAAQ,KAAK,GAAGI,SAAS,EACjEH,SAAS,KAAKG,SAAS,GAAG,gBAAgBH,SAAS,KAAK,GAAGG,SAAS,EACpEF,SAAS,KAAKE,SAAS,GAAG,gBAAgBF,SAAS,KAAK,GAAGE,SAAS,CACvE,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,OAAO,CAAC;IAE/B,MAAMC,KAAK,GAAGC,MAAM,CAACC,UAAU,CAACP,UAAU,CAAC;IAC3C,MAAMQ,OAAO,GAAIC,KAA0B,IAAKvB,YAAY,CAACuB,KAAK,CAACC,OAAO,CAAC;IAE3EL,KAAK,CAACM,gBAAgB,CAAC,QAAQ,EAAEH,OAAO,CAAC;IACzCzB,UAAU,CAAC6B,OAAO,GAAG,MAAMP,KAAK,CAACQ,mBAAmB,CAAC,QAAQ,EAAEL,OAAO,CAAC;IAEvE,OAAOH,KAAK,CAACK,OAAO;EACxB,CAAC,CAAC;;EAEF;EACA,IAAAI,gBAAS,EAAC,MAAM,MAAM/B,UAAU,CAAC6B,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC;EAE/C,OAAO;IACH3B;EACJ,CAAC;AACL,CAAC;AAAA8B,OAAA,CAAAlC,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  mq: true,
8
- createUnistylesComponent: true
8
+ createUnistylesComponent: true,
9
+ getBoundArgs: true
9
10
  };
10
11
  Object.defineProperty(exports, "createUnistylesComponent", {
11
12
  enumerable: true,
@@ -13,6 +14,12 @@ Object.defineProperty(exports, "createUnistylesComponent", {
13
14
  return _core.createUnistylesComponent;
14
15
  }
15
16
  });
17
+ Object.defineProperty(exports, "getBoundArgs", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _core.getBoundArgs;
21
+ }
22
+ });
16
23
  Object.defineProperty(exports, "mq", {
17
24
  enumerable: true,
18
25
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"names":["_specs","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","_core","_components"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAb,OAAA;AAEA,IAAAc,KAAA,GAAAd,OAAA;AAEA,IAAAe,WAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,WAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,WAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,WAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_specs","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","_core","_components"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAb,OAAA;AAEA,IAAAc,KAAA,GAAAd,OAAA;AAEA,IAAAe,WAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,WAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,WAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,WAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -25,17 +25,17 @@ const getMQValue = value => {
25
25
  */
26
26
  const mq = exports.mq = {
27
27
  only: {
28
- width: (wMin = 0, wMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`,
29
- height: (hMin = 0, hMax = Infinity) => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
28
+ width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]`,
29
+ height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => `:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
30
30
  },
31
- width: (wMin = 0, wMax = Infinity) => ({
31
+ width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => ({
32
32
  and: {
33
- height: (hMin = 0, hMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
33
+ height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
34
34
  }
35
35
  }),
36
- height: (hMin = 0, hMax = Infinity) => ({
36
+ height: (hMin = 0, hMax = Number.POSITIVE_INFINITY) => ({
37
37
  and: {
38
- width: (wMin = 0, wMax = Infinity) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
38
+ width: (wMin = 0, wMax = Number.POSITIVE_INFINITY) => `:w[${getMQValue(wMin)}, ${getMQValue(wMax)}]:h[${getMQValue(hMin)}, ${getMQValue(hMax)}]`
39
39
  }
40
40
  })
41
41
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_specs","require","IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","getMQValue","value","breakpoints","UnistylesRuntime","mq","exports","only","width","wMin","wMax","Infinity","height","hMin","hMax","and","parseMq","fromW","toW","exec","fromH","toH","minWidth","undefined","Number","maxWidth","minHeight","maxHeight","isUnistylesMq","test","isValidMq","parsedMQ","isWidthValid","isHeightValid"],"sourceRoot":"../../src","sources":["mq.ts"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AAKC,SAAS,IAAIQ,QAAQ,CAACN,QAAQ,KAAKF,SAAS,IAAIQ,QAAQ,CAACT,QAAQ,IAAIS,QAAQ,CAACN,QAAQ;EACjI,MAAMQ,aAAa,GAAGF,QAAQ,CAACL,SAAS,KAAKH,SAAS,IAAIQ,QAAQ,CAACJ,SAAS,KAAKJ,SAAS,IAAIQ,QAAQ,CAACL,SAAS,IAAIK,QAAQ,CAACJ,SAAS;EAEtI,OAAOK,YAAY,IAAIC,aAAa;AACxC,CAAC;AAAA3B,OAAA,CAAAwB,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_specs","require","IS_UNISTYLES_REGEX","UNISTYLES_WIDTH_REGEX","UNISTYLES_HEIGHT_REGEX","getMQValue","value","breakpoints","UnistylesRuntime","mq","exports","only","width","wMin","wMax","Number","POSITIVE_INFINITY","height","hMin","hMax","and","parseMq","fromW","toW","exec","fromH","toH","minWidth","undefined","maxWidth","minHeight","maxHeight","isUnistylesMq","test","isValidMq","parsedMQ","isWidthValid","isHeightValid"],"sourceRoot":"../../src","sources":["mq.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,kBAAkB,GAAG,wCAAwC;AACnE,MAAMC,qBAAqB,GAAG,qCAAqC;AACnE,MAAMC,sBAAsB,GAAG,qCAAqC;AAqBpE,MAAMC,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;EACZ;EAEA,MAAMC,WAAW,GAAGC,uBAAgB,CAACD,WAAW;EAEhD,OAAOA,WAAW,CAACD,KAAK,CAAC,IAAI,CAAC;AAClC,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMG,EAAa,GAAAC,OAAA,CAAAD,EAAA,GAAG;EACzBE,IAAI,EAAE;IACFC,KAAK,EAAEA,CAACC,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AC,GAAGtB,sBAAsB,CAACoB,IAAI,CAACf,EAAE,CAAC,IAAI,EAAE;EAEpE,OAAO;IACHkB,QAAQ,EAAE,CAACf,KAAK,IAAIU,KAAK,KAAK,UAAU,GAAGM,SAAS,GAAGb,MAAM,CAACO,KAAK,CAAC;IACpEO,QAAQ,EAAE,CAACjB,KAAK,IAAIW,GAAG,KAAK,UAAU,GAAGK,SAAS,GAAGb,MAAM,CAACQ,GAAG,CAAC;IAChEO,SAAS,EAAE,CAACb,MAAM,IAAIQ,KAAK,KAAK,UAAU,GAAGG,SAAS,GAAGb,MAAM,CAACU,KAAK,CAAC;IACtEM,SAAS,EAAE,CAACd,MAAM,IAAIS,GAAG,KAAK,UAAU,GAAGE,SAAS,GAAGb,MAAM,CAACW,GAAG;EACrE,CAAC;AACL,CAAC;AAAAhB,OAAA,CAAAW,OAAA,GAAAA,OAAA;AAEM,MAAMW,aAAa,GAAIvB,EAAU,IAAKP,kBAAkB,CAAC+B,IAAI,CAACxB,EAAE,CAAC;AAAAC,OAAA,CAAAsB,aAAA,GAAAA,aAAA;AAEjE,MAAME,SAAS,GAAIC,QAAoC,IAAK;EAC/D,MAAMC,YAAY,GAAGD,QAAQ,CAACR,QAAQ,KAAKC,SAAS,IAAIO,QAAQ,CAACN,QAAQ,KAAKD,SAAS,IAAIO,QAAQ,CAACR,QAAQ,IAAIQ,QAAQ,CAACN,QAAQ;EACjI,MAAMQ,aAAa,GAAGF,QAAQ,CAACL,SAAS,KAAKF,SAAS,IAAIO,QAAQ,CAACJ,SAAS,KAAKH,SAAS,IAAIO,QAAQ,CAACL,SAAS,IAAIK,QAAQ,CAACJ,SAAS;EAEtI,OAAOK,YAAY,IAAIC,aAAa;AACxC,CAAC;AAAA3B,OAAA,CAAAwB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -9,12 +9,11 @@ const HybridShadowRegistry = _reactNativeNitroModules.NitroModules.createHybridO
9
9
  const findShadowNodeForHandle = handle => {
10
10
  const node = handle?.__internalInstanceHandle?.stateNode?.node ?? handle?.getScrollResponder?.()?.getNativeScrollRef?.()?.__internalInstanceHandle?.stateNode?.node ?? handle?.getNativeScrollRef?.()?.__internalInstanceHandle?.stateNode?.node;
11
11
  if (!node) {
12
- // todo extend log with file name / component name
13
- throw new Error('Could not find shadow node for one of your components');
12
+ throw new Error(`Unistyles: Could not find shadow node for one of your components of type ${handle?.__internalInstanceHandle?.elementType ?? 'unknown'}`);
14
13
  }
15
14
  return node;
16
15
  };
17
- HybridShadowRegistry.add = (handle, styles, variants, args) => {
16
+ HybridShadowRegistry.add = (handle, styles, variants, args, id) => {
18
17
  // virtualized nodes can be null
19
18
  if (!handle || !styles || !Array.isArray(styles)) {
20
19
  return;
@@ -22,7 +21,7 @@ HybridShadowRegistry.add = (handle, styles, variants, args) => {
22
21
 
23
22
  // filter Reanimated styles and styles that are undefined
24
23
  const filteredStyles = styles.filter(style => !style?.initial?.updater).filter(Boolean);
25
- HybridShadowRegistry.link(findShadowNodeForHandle(handle), filteredStyles, variants ?? {}, args ?? []);
24
+ HybridShadowRegistry.link(findShadowNodeForHandle(handle), filteredStyles, variants ?? {}, args ?? [], id);
26
25
  };
27
26
  HybridShadowRegistry.remove = handle => {
28
27
  if (!handle) {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","styles","variants","args","Array","isArray","filteredStyles","filter","style","initial","updater","Boolean","link","remove","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACW,GAAG,GAAG,CAACP,MAAM,EAAEQ,MAAM,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC3D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,MAAM,IAAI,CAACG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;IAC9C;EACJ;;EAEA;EACA,MAAMK,cAAc,GAAGL,MAAM,CACxBM,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CACzCH,MAAM,CAACI,OAAO,CAAC;EAEpBtB,oBAAoB,CAACuB,IAAI,CAACpB,uBAAuB,CAACC,MAAM,CAAC,EAAEa,cAAc,EAAEJ,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AAC1G,CAAC;AAEDd,oBAAoB,CAACwB,MAAM,GAAGpB,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAJ,oBAAoB,CAACyB,MAAM,CAACtB,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQM,MAAMsB,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG1B,oBAA4D","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","elementType","add","styles","variants","args","id","Array","isArray","filteredStyles","filter","style","initial","updater","Boolean","link","remove","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP,MAAM,IAAIK,KAAK,CAAC,4EAA4EN,MAAM,EAAEE,wBAAwB,EAAEK,WAAW,IAAI,SAAS,EAAE,CAAC;EAC7J;EAEA,OAAON,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACY,GAAG,GAAG,CAACR,MAAM,EAAES,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,EAAE,KAAK;EAC/D;EACA,IAAI,CAACZ,MAAM,IAAI,CAACS,MAAM,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IAC9C;EACJ;;EAEA;EACA,MAAMM,cAAc,GAAGN,MAAM,CACxBO,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CACzCH,MAAM,CAACI,OAAO,CAAC;EAEpBxB,oBAAoB,CAACyB,IAAI,CAACtB,uBAAuB,CAACC,MAAM,CAAC,EAAEe,cAAc,EAAEL,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,EAAEC,EAAE,CAAC;AAC9G,CAAC;AAEDhB,oBAAoB,CAAC0B,MAAM,GAAGtB,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAJ,oBAAoB,CAAC2B,MAAM,CAACxB,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQM,MAAMwB,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG5B,oBAA4D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","_reactNative","HybridUnistylesStyleSheet","NitroModules","createHybridObject","absoluteFillObject","NativeStyleSheet","absoluteFill","flatten","compose","jsMethods","processColor","init","StyleSheet","exports"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAgCA,MAAME,yBAAyB,GAAGC,qCAAY,CACzCC,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnEF,yBAAyB,CAACG,kBAAkB,GAAGC,uBAAgB,CAACD,kBAAkB;AAClFH,yBAAyB,CAACK,YAAY,GAAGD,uBAAgB,CAACC,YAAY;AACtEL,yBAAyB,CAACM,OAAO,GAAGF,uBAAgB,CAACE,OAAO;AAC5DN,yBAAyB,CAACO,OAAO,GAAGH,uBAAgB,CAACG,OAAO;AAC5DP,yBAAyB,CAACQ,SAAS,GAAG;EAClCC,YAAY,EAAZA;AACJ,CAAC;AAEDT,yBAAyB,CAACU,IAAI,CAAC,CAAC;AAIzB,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGX,yBAAsE","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","_reactNative","HybridUnistylesStyleSheet","NitroModules","createHybridObject","absoluteFillObject","NativeStyleSheet","absoluteFill","flatten","compose","jsMethods","processColor","init","StyleSheet","exports"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAiCA,MAAME,yBAAyB,GAAGC,qCAAY,CACzCC,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnEF,yBAAyB,CAACG,kBAAkB,GAAGC,uBAAgB,CAACD,kBAAkB;AAClFH,yBAAyB,CAACK,YAAY,GAAGD,uBAAgB,CAACC,YAAY;AACtEL,yBAAyB,CAACM,OAAO,GAAGF,uBAAgB,CAACE,OAAO;AAC5DN,yBAAyB,CAACO,OAAO,GAAGH,uBAAgB,CAACG,OAAO;AAC5DP,yBAAyB,CAACQ,SAAS,GAAG;EAClCC,YAAY,EAAZA;AACJ,CAAC;AAEDT,yBAAyB,CAACU,IAAI,CAAC,CAAC;AAIzB,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGX,yBAAsE","ignoreList":[]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _reactNative = require("react-native");
4
- // this is empty spec for TurboModule that is required to hook
5
- // Unistyles to Fabric
4
+ // this is empty spec for TurboModule that is required to hook Unistyles to Fabric
6
5
 
7
6
  _reactNative.TurboModuleRegistry.get('Unistyles');
8
7
  //# sourceMappingURL=NativeTurboUnistyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.ts"],"mappings":";;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;;AAGAC,gCAAmB,CAACC,GAAG,CAAO,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.ts"],"mappings":";;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA;;AAGAC,gCAAmB,CAACC,GAAG,CAAO,WAAW,CAAC","ignoreList":[]}
@@ -3,14 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- getSSRUnistyles: true
8
- };
9
- exports.getSSRUnistyles = void 0;
10
6
  var _web = require("../web");
11
7
  Object.keys(_web).forEach(function (key) {
12
8
  if (key === "default" || key === "__esModule") return;
13
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
14
9
  if (key in exports && exports[key] === _web[key]) return;
15
10
  Object.defineProperty(exports, key, {
16
11
  enumerable: true,
@@ -19,6 +14,4 @@ Object.keys(_web).forEach(function (key) {
19
14
  }
20
15
  });
21
16
  });
22
- const getSSRUnistyles = () => [];
23
- exports.getSSRUnistyles = getSSRUnistyles;
24
17
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_web","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;;;;;;;;AAIA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,IAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,IAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAFO,MAAMS,eAAe,GAAGA,CAAA,KAAM,EAAyB;AAAAJ,OAAA,CAAAI,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_web","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["specs/index.web.ts"],"mappings":";;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,IAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,IAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -10,7 +10,7 @@ const deepMergeObjects = (...sources) => {
10
10
  Object.keys(source).forEach(key => {
11
11
  const sourceValue = source[key];
12
12
  const targetValue = target[key];
13
- if (Object(sourceValue) == sourceValue && Object(targetValue) === targetValue) {
13
+ if (Object(sourceValue) === sourceValue && Object(targetValue) === targetValue) {
14
14
  // @ts-expect-error - can't assign to generic
15
15
  target[key] = deepMergeObjects(targetValue, sourceValue);
16
16
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["deepMergeObjects","sources","target","forEach","source","Object","keys","key","sourceValue","targetValue","exports"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAGA,CAAqC,GAAGC,OAAiB,KAAK;EAC1F,MAAMC,MAAM,GAAG,CAAC,CAAM;EAEtBD,OAAO,CAACE,OAAO,CAACC,MAAM,IAAI;IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACD,OAAO,CAACI,GAAG,IAAI;MAC/B,MAAMC,WAAW,GAAGJ,MAAM,CAACG,GAAG,CAAC;MAC/B,MAAME,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAC;MAE/B,IAAIF,MAAM,CAACG,WAAW,CAAC,IAAIA,WAAW,IAAIH,MAAM,CAACI,WAAW,CAAC,KAAKA,WAAW,EAAE;QAC3E;QACAP,MAAM,CAACK,GAAG,CAAC,GAAGP,gBAAgB,CAACS,WAAW,EAAED,WAAW,CAAC;QAExD;MACJ;;MAEA;MACAN,MAAM,CAACK,GAAG,CAAC,GAAGC,WAAW;IAC7B,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAON,MAAM;AACjB,CAAC;AAAAQ,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["deepMergeObjects","sources","target","forEach","source","Object","keys","key","sourceValue","targetValue","exports"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAGA,CAAqC,GAAGC,OAAiB,KAAK;EAC1F,MAAMC,MAAM,GAAG,CAAC,CAAM;EAEtBD,OAAO,CAACE,OAAO,CAACC,MAAM,IAAI;IACtBC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACD,OAAO,CAACI,GAAG,IAAI;MAC/B,MAAMC,WAAW,GAAGJ,MAAM,CAACG,GAAG,CAAC;MAC/B,MAAME,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAC;MAE/B,IAAIF,MAAM,CAACG,WAAW,CAAC,KAAKA,WAAW,IAAIH,MAAM,CAACI,WAAW,CAAC,KAAKA,WAAW,EAAE;QAC5E;QACAP,MAAM,CAACK,GAAG,CAAC,GAAGP,gBAAgB,CAACS,WAAW,EAAED,WAAW,CAAC;QAExD;MACJ;;MAEA;MACAN,MAAM,CAACK,GAAG,CAAC,GAAGC,WAAW;IAC7B,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAON,MAAM;AACjB,CAAC;AAAAQ,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["TEXT_SHADOW_STYLES","exports","BOX_SHADOW_STYLES"],"sourceRoot":"../../../../src","sources":["web/convert/types.ts"],"mappings":";;;;;;AAKO,MAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAU;AAI/F,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["TEXT_SHADOW_STYLES","exports","BOX_SHADOW_STYLES"],"sourceRoot":"../../../../src","sources":["web/convert/types.ts"],"mappings":";;;;;;AAMO,MAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAU;AAI/F,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAG,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,CAAU","ignoreList":[]}
@@ -35,7 +35,7 @@ const normalizeColor = (color, opacity = 1) => {
35
35
  }
36
36
  const hex = integer.toString(16).padStart(8, '0');
37
37
  if (hex.length === 8) {
38
- const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => parseInt(x, 16)).filter(num => !isNaN(num));
38
+ const [r = 0, g = 0, b = 0, a = 1] = hex.split(/(?=(?:..)*$)/).map(x => Number.parseInt(x, 16)).filter(num => !Number.isNaN(num));
39
39
  return `rgba(${r},${g},${b},${a / 255 * opacity})`;
40
40
  }
41
41
  return color;
@@ -1 +1 @@
1
- {"version":3,"names":["_normalizeColors","_interopRequireDefault","require","_types","e","__esModule","default","isTransform","key","value","Array","isArray","exports","isTextShadow","TEXT_SHADOW_STYLES","includes","isShadow","BOX_SHADOW_STYLES","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","normalizeColors","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":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBA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,KAAK,QAAQ,GAAGA,KAAK,CAACiC,UAAU,CAAC,GAAGjC,KAAK;AAChE,CAAC;AAAAG,OAAA,CAAA6B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_normalizeColors","_interopRequireDefault","require","_types","e","__esModule","default","isTransform","key","value","Array","isArray","exports","isTextShadow","TEXT_SHADOW_STYLES","includes","isShadow","BOX_SHADOW_STYLES","isFilter","isBoxShadow","normalizeNumericValue","normalizeColor","color","opacity","integer","normalizeColors","hex","toString","padStart","length","r","g","b","a","split","map","x","Number","parseInt","filter","num","isNaN","extractShadowValue","breakpoint","styles","width","height"],"sourceRoot":"../../../../src","sources":["web/convert/utils.ts"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAiH,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAHjH;AACA;;AAMO,MAAMG,WAAW,GAAGA,CAACC,GAAW,EAAEC,KAAU,KAAsCD,GAAG,KAAK,WAAW,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAAAG,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAE7H,MAAMM,YAAY,GAAIL,GAAW,IAAKM,yBAAkB,CAACC,QAAQ,CAACP,GAAwC,CAAC;AAAAI,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAE3G,MAAMG,QAAQ,GAAIR,GAAW,IAAKS,wBAAiB,CAACF,QAAQ,CAACP,GAAuC,CAAC;AAAAI,OAAA,CAAAI,QAAA,GAAAA,QAAA;AAErG,MAAME,QAAQ,GAAGA,CAACV,GAAW,EAAEC,KAAU,KAA8BD,GAAG,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAAAG,OAAA,CAAAM,QAAA,GAAAA,QAAA;AAE/G,MAAMC,W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,cAAA;AAEM,MAAMqB,kBAAkB,GAAGA,CAA6BlC,GAAS,EAAEmC,UAAkB,EAAEC,MAAW,KAAsB;EAC3H,MAAMnC,KAAK,GAAGmC,MAAM,CAACpC,GAAG,CAAC;EAEzB,IAAIA,GAAG,KAAK,kBAAkB,IAAIA,GAAG,KAAK,cAAc,EAAE;IACtD,MAAM;MAAEqC,KAAK;MAAEC;IAAO,CAAC,GAAGrC,KAAK;IAE/B,OAAO;MACHoC,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,OAAOrC,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACkC,UAAU,CAAC,GAAGlC,KAAK;AAChE,CAAC;AAAAG,OAAA,CAAA8B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -8,7 +8,10 @@ var _utils = require("./utils");
8
8
  var _utils2 = require("../utils");
9
9
  var _runtime = require("./runtime");
10
10
  var _variants = require("./variants");
11
- const create = stylesheet => {
11
+ const create = (stylesheet, id) => {
12
+ if (!id) {
13
+ throw (0, _utils.error)('Unistyles is not initialized correctly. Please add babel plugin to your babel config.');
14
+ }
12
15
  const computedStylesheet = typeof stylesheet === 'function' ? stylesheet(_runtime.UnistylesRuntime.theme, _runtime.UnistylesRuntime.miniRuntime) : stylesheet;
13
16
  const selectedVariants = new Map();
14
17
  const copyVariants = () => Object.fromEntries(selectedVariants.entries());
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_utils2","_runtime","_variants","create","stylesheet","computedStylesheet","UnistylesRuntime","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","assignSecrets","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","reduceObject","_key","String","dynamicStyle","result","variants","getVariants","resultWithVariants","deepMergeObjects","getStyles","createUseVariants","newVariants","forEach","set","exports"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEO,MAAMI,MAAM,GAAIC,UAAiD,IAAK;EACzE,MAAMC,kBAAkB,GAAG,OAAOD,UAAU,KAAK,UAAU,GACrDA,UAAU,CAACE,yBAAgB,CAACC,KAAK,EAAED,yBAAgB,CAACE,WAAW,CAAC,GAChEJ,UAAU;EAChB,MAAMK,gBAAgB,GAAG,IAAIC,GAAG,CAAc,CAAC;EAE/C,MAAMC,YAAY,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACJ,gBAAgB,CAACK,OAAO,CAAC,CAAC,CAAC;EACzE,MAAMC,UAAU,GAAGA,CAACC,KAAU,EAAEC,GAAW,EAAEC,IAAiB,KAAK,IAAAC,oBAAa,EAACH,KAAK,EAAE;IACpFI,UAAU,EAAEH,GAAG;IACfI,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IACtBC,iBAAiB,EAAEnB,UAAU;IAC7BoB,WAAW,EAAEN,IAAI;IACjBO,eAAe,EAAEd,YAAY,CAAC;EAClC,CAAC,CAAC;EAEF,MAAMe,MAAM,GAAG,IAAAC,mBAAY,EAACtB,kBAAkB,EAAE,CAACW,KAAK,EAAEY,IAAI,KAAK;IAC7D,MAAMX,GAAG,GAAGY,MAAM,CAACD,IAAI,CAAC;IAExB,IAAI,OAAOZ,KAAK,KAAK,UAAU,EAAE;MAC7B,MAAMc,YAAY,GAAGA,CAAC,GAAGZ,IAAgB,KAAK;QAC1C,MAAMa,MAAM,GAAGf,KAAK,CAAC,GAAGE,IAAI,CAAC;QAC7B,MAAMc,QAAQ,GAAGpB,MAAM,CAACC,WAAW,CAAC,IAAAoB,qBAAW,EAAC;UAAE,CAAChB,GAAG,GAAGc;QAAO,CAAC,EAAuCpB,YAAY,CAAC,CAAC,CAAC,CAAC;QACxH,MAAMuB,kBAAkB,GAAG,IAAAC,wBAAgB,EAACJ,MAAM,EAAEC,QAAQ,CAACf,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;;QAExE;QACA,OAAOF,UAAU,CAAC,IAAAqB,gBAAS,EAACF,kBAAkB,CAAC,EAAEjB,GAAG,EAAEC,IAAI,CAAC;MAC/D,CAAC;;MAED;MACA,OAAOH,UAAU,CAACe,YAAY,EAAEb,GAAG,CAAC;IACxC;;IAEA;IACA,OAAOF,UAAU,CAAC,IAAAqB,gBAAS,EAACpB,KAAK,CAAC,EAAEC,GAAG,CAAC;EAC5C,CAAC,CAAsC;;EAEvC;EACA,IAAAoB,2BAAiB,EAACX,MAAM,EAAEY,WAAW,IAAI1B,MAAM,CAACE,OAAO,CAACwB,WAAW,CAAC,CAACC,OAAO,CAAC,CAAC,CAACtB,GAAG,EAAED,KAAK,CAAC,KAAKP,gBAAgB,CAAC+B,GAAG,CAACvB,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOU,MAAM;AACjB,CAAC;AAAAe,OAAA,CAAAtC,MAAA,GAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_utils2","_runtime","_variants","create","stylesheet","id","error","computedStylesheet","UnistylesRuntime","theme","miniRuntime","selectedVariants","Map","copyVariants","Object","fromEntries","entries","addSecrets","value","key","args","assignSecrets","__uni__key","__uni__refs","Set","__uni__stylesheet","__uni__args","__uni__variants","styles","reduceObject","_key","String","dynamicStyle","result","variants","getVariants","resultWithVariants","deepMergeObjects","getStyles","createUseVariants","newVariants","forEach","set","exports"],"sourceRoot":"../../../src","sources":["web/create.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG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wBAAgB,EAACJ,MAAM,EAAEC,QAAQ,CAACf,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;;QAExE;QACA,OAAOF,UAAU,CAAC,IAAAqB,gBAAS,EAACF,kBAAkB,CAAC,EAAEjB,GAAG,EAAEC,IAAI,CAAC;MAC/D,CAAC;;MAED;MACA,OAAOH,UAAU,CAACe,YAAY,EAAEb,GAAG,CAAC;IACxC;;IAEA;IACA,OAAOF,UAAU,CAAC,IAAAqB,gBAAS,EAACpB,KAAK,CAAC,EAAEC,GAAG,CAAC;EAC5C,CAAC,CAAsC;;EAEvC;EACA,IAAAoB,2BAAiB,EAACX,MAAM,EAAEY,WAAW,IAAI1B,MAAM,CAACE,OAAO,CAACwB,WAAW,CAAC,CAACC,OAAO,CAAC,CAAC,CAACtB,GAAG,EAAED,KAAK,CAAC,KAAKP,gBAAgB,CAAC+B,GAAG,CAACvB,GAAG,EAAED,KAAK,CAAC,CAAC,CAAC;EAEjI,OAAOU,MAAM;AACjB,CAAC;AAAAe,OAAA,CAAAxC,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  StyleSheet: true,
8
- getSSRUnistyles: true,
9
8
  UnistylesRuntime: true,
10
9
  UnistylesShadowRegistry: true
11
10
  };
@@ -22,7 +21,6 @@ Object.defineProperty(exports, "UnistylesShadowRegistry", {
22
21
  return _shadowRegistry.UnistylesShadowRegistry;
23
22
  }
24
23
  });
25
- exports.getSSRUnistyles = void 0;
26
24
  var _create = require("./create");
27
25
  var _state = require("./state");
28
26
  var _utils = require("../utils");
@@ -50,11 +48,15 @@ const StyleSheet = exports.StyleSheet = {
50
48
  right: 0,
51
49
  bottom: 0
52
50
  },
51
+ absoluteFillObject: {
52
+ position: 'absolute',
53
+ left: 0,
54
+ top: 0,
55
+ right: 0,
56
+ bottom: 0
57
+ },
53
58
  compose: (a, b) => (0, _utils.deepMergeObjects)(a, b),
54
59
  flatten: (...styles) => (0, _utils.deepMergeObjects)(...styles),
55
60
  hairlineWidth: 1
56
61
  };
57
- // TODO: Work on SSR
58
- const getSSRUnistyles = () => [];
59
- exports.getSSRUnistyles = getSSRUnistyles;
60
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_create","require","_state","_utils","_runtime","_shadowRegistry","_mock","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","StyleSheet","configure","UnistylesState","init","create","absoluteFill","position","left","top","right","bottom","compose","a","b","deepMergeObjects","flatten","styles","hairlineWidth","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAiBA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAjBO,MAAMS,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG;EACtBC,SAAS,EAAEC,qBAAc,CAACC,IAAI;EAC9BC,MAAM,EAANA,cAAM;EACNC,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAK,IAAAC,uBAAgB,EAACF,CAAC,EAAEC,CAAC,CAAC;EACzDE,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAK,IAAAF,uBAAgB,EAAC,GAAGE,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAC;AAMD;AACO,MAAMC,eAAe,GAAGA,CAAA,KAAM,EAAE;AAAAtB,OAAA,CAAAsB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_create","require","_state","_utils","_runtime","_shadowRegistry","_mock","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","StyleSheet","configure","UnistylesState","init","create","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","deepMergeObjects","flatten","styles","hairlineWidth"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAwBA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAAM,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAxBO,MAAMS,UAAU,GAAAJ,OAAA,CAAAI,UAAA,GAAG;EACtBC,SAAS,EAAEC,qBAAc,CAACC,IAAI;EAC9BC,MAAM,EAANA,cAAM;EACNC,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAK,IAAAC,uBAAgB,EAACF,CAAC,EAAEC,CAAC,CAAC;EACzDE,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAK,IAAAF,uBAAgB,EAAC,GAAGE,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_NativePlatform","require","_runtime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","UnistyleDependency","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","UnistylesRuntime","darkMedia","addEventListener","event","matches","ColorScheme","hasAdaptiveThemes","Theme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener","exports"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,C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AkB,CAACe,KAAK,CAAC;MAC7C;IACJ,CAAC,CAAC;IACFE,MAAM,CAACP,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAACP,UAAU,CAACH,kCAAkB,CAACkB,WAAW,CAAC,CAAC;IACnGD,MAAM,CAACP,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAACP,UAAU,CAACH,kCAAkB,CAACmB,UAAU,CAAC,CAAC;EAC3F,CAAC;EAEDC,YAAY,GAAGA,CAACC,YAAuC,EAAEf,QAAsB,KAAK;IAChFe,YAAY,CAAChB,OAAO,CAACD,UAAU,IAAI,IAAI,CAACV,SAAS,CAACU,UAAU,CAAC,EAAEkB,GAAG,CAAChB,QAAQ,CAAC,CAAC;IAE7E,OAAO,MAAM;MACTe,YAAY,CAAChB,OAAO,CAACD,UAAU,IAAI,IAAI,CAACV,SAAS,CAACU,UAAU,CAAC,EAAEmB,MAAM,CAACjB,QAAQ,CAAC,CAAC;IACpF,CAAC;EACL,CAAC;EAEDkB,sBAAsB,GAAGA,CAACH,YAAuC,EAAEf,QAAsB,KAAK;IAC1Fe,YAAY,CAAChB,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEkB,GAAG,CAAChB,QAAQ,CAAC,CAAC;IAEvF,OAAO,MAAM;MACTe,YAAY,CAAChB,OAAO,CAACD,UAAU,IAAI,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEmB,MAAM,CAACjB,QAAQ,CAAC,CAAC;IAC9F,CAAC;EACL,CAAC;AACL;AAEO,MAAMmB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIjC,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_NativePlatform","require","_runtime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","UnistyleDependency","Set","stylesheetListeners","emitChange","dependency","forEach","listener","initListeners","UnistylesRuntime","darkMedia","addEventListener","event","matches","ColorScheme","hasAdaptiveThemes","Theme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","addStylesheetListeners","UnistylesListener","exports"],"sourceRoot":"../../../src","sources":["web/listener.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EACnBC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACC,kCAAkB,CAAC,CAACH,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAII,GAAG,CAAe,CAAC,CAAC;EAC7GC,mBAAmB,GAAGP,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEC,MAAM,CAACC,IAAI,CAACC,kCAAkB,CAAC,CAACH,MAAM,GAAG;EAAE,CAAC,EAAE,MAAM,IAAII,GAAG,CAAe,CAAC,CAAC;EAE/HE,UAAU,GAAIC,UAA8B,IAAK;IAC7C,IAAI,CAACF,mBAAmB,CAACE,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;IACrE,IAAI,CAACZ,SAAS,CAACU,UAAU,CAAC,EAAEC,OAAO,CAACC,QAAQ,IAAIA,QAAQ,CAAC,CAAC,CAAC;EAC/D,CAAC;EAEDC,aAAa,GAAGA,CAAA,KAAM;IAClB,IAAI,IAAI,CAACd,aAAa,EAAE;MACpB;IACJ;IAEA,IAAI,CAACA,aAAa,GAAG,IAAI;IAEzBe,yBAAgB,CAACC,SAAS,EAAEC,gBAAgB,CAAC,QAAQ,EAAEC,KAAK,IAAI;MAC5D,IAAI,CAACA,KAAK,CAACC,OAAO,EAAE;QAChB;MACJ;MAEA,IAAI,CAACT,UAAU,CAACH,kCAAkB,CAACa,WAAW,CAAC;MAE/C,IAAIL,yBAAgB,CAACM,iBAAiB,EAAE;QACpC,IAAI,CA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,CAAC,EAAEmB,MAAM,CAACjB,QAAQ,CAAC,CAAC;IAC9F,CAAC;EACL,CAAC;AACL;AAEO,MAAMmB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIjC,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -130,6 +130,9 @@ class UnistylesRuntimeBuilder {
130
130
  };
131
131
  }
132
132
  setTheme = themeName => {
133
+ if (this.hasAdaptiveThemes) {
134
+ throw (0, _utils.error)(`You're trying to set theme to: '${themeName}', but adaptiveThemes are enabled.`);
135
+ }
133
136
  if (themeName === UnistylesRuntime.themeName) {
134
137
  return;
135
138
  }
@@ -154,17 +157,14 @@ class UnistylesRuntimeBuilder {
154
157
  updateTheme = (themeName, updater) => {
155
158
  const oldTheme = _state.UnistylesState.themes.get(themeName);
156
159
  if (!oldTheme) {
157
- throw new Error(`🦄 Theme "${themeName}" is not registered!`);
160
+ throw (0, _utils.error)(`Unistyles: You're trying to update theme "${themeName}" but it wasn't registered.`);
158
161
  }
159
162
  _state.UnistylesState.themes.set(themeName, updater(oldTheme));
160
163
  };
161
164
  getTheme = (themeName = this.themeName) => {
162
- if (!themeName) {
163
- throw new Error('🦄 No theme selected!');
164
- }
165
- const theme = _state.UnistylesState.themes.get(themeName);
166
- if (!theme) {
167
- throw new Error(`🦄 Theme "${this.themeName}" is not registered!`);
165
+ const theme = _state.UnistylesState.themes.get(themeName ?? '');
166
+ if (!themeName || !theme) {
167
+ throw (0, _utils.error)(`You're trying to get theme "${themeName}" but it wasn't registered.`);
168
168
  }
169
169
  return theme;
170
170
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_NativePlatform","require","_types","_types2","_listener","_mock","_state","_utils","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","isServer","window","matchMedia","colorScheme","matches","ColorScheme","Light","Dark","Unspecified","themeName","UnistylesState","hasAdaptiveThemes","schemeToTheme","contentSizeCategory","WebContentSizeCategory","breakpoints","breakpoint","orientation","Orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","StatusBar","rtl","document","documentElement","dir","navigationBar","NavigationBar","miniRuntime","isLandscape","isPortrait","setTheme","UnistylesRuntime","UnistylesListener","emitChange","UnistyleDependency","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","color","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","Error","set","exports"],"sourceRoot":"../../../src","sources":["web/runtime.ts"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA,MAAMO,uBAAuB,CAAC;EAC1BC,UAAU,GAAG,IAAI,CAACC,aAAa,CAAC,CAAC;EACjCC,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;EAEvBF,aAAaA,CAAA,EAA0B;IAC3C,IAAI,IAAAG,eAAQ,EAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACJ,UAAU,EAAE;MAClB,IAAI,CAACA,UAAU,GAAGK,MAAM,CAACC,UAAU,CAAC,+BAA+B,CAAC;IACxE;IAEA,OAAO,IAAI,CAACN,UAAU;EAC1B;EAEQG,YAAYA,CAAA,EAA0B;IAC1C,IAAI,IAAAC,eAAQ,EAAC,CAAC,EAAE;MACZ,OAAO,IAAI;IACf;IAEA,IAAI,CAAC,IAAI,CAACF,SAAS,EAAE;MACjB,IAAI,CAACA,SAAS,GAAGG,MAAM,CAACC,UAAU,CAAC,8BAA8B,CAAC;IACtE;IAEA,OAAO,IAAI,CAACJ,SAAS;EACzB;EAEA,IAAIK,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E;MACX,MAAM,IAAIG,KAAK,CAAC,aAAa5D,SAAS,sBAAsB,CAAC;IACjE;IAEAC,qBAAc,CAACyD,MAAM,CAACG,GAAG,CAAC7D,SAAS,EAAEwD,OAAO,CAACC,QAAQ,CAAC,CAAC;EAC3D,CAAC;EAEDzC,QAAQ,GAAGA,CAAChB,SAAS,GAAG,IAAI,CAACA,SAAS,KAAK;IACvC,IAAI,CAACA,SAAS,EAAE;MACZ,MAAM,IAAI4D,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,MAAM7C,KAAK,GAAGd,qBAAc,CAACyD,MAAM,CAACC,GAAG,CAAC3D,SAAS,CAAC;IAElD,IAAI,CAACe,KAAK,EAAE;MACR,MAAM,IAAI6C,KAAK,CAAC,aAAa,IAAI,CAAC5D,SAAS,sBAAsB,CAAC;IACtE;IAEA,OAAOe,KAAK;EAChB,CAAC;AACL;AAEO,MAAM2B,gBAAgB,GAAAoB,OAAA,CAAApB,gBAAA,GAAG,IAAIxD,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_NativePlatform","require","_types","_types2","_listener","_mock","_state","_utils","UnistylesRuntimeBuilder","lightMedia","getLightMedia","darkMedia","getDarkMedia","isServer","window","matchMedia","colorScheme","matches","ColorScheme","Light","Dark","Unspecified","themeName","UnistylesState","hasAdaptiveThemes","schemeToTheme","contentSizeCategory","WebContentSizeCategory","breakpoints","breakpoint","orientation","Orientation","Portrait","screen","type","includes","Landscape","theme","getTheme","pixelRatio","devicePixelRatio","width","height","innerWidth","innerHeight","fontScale","insets","top","bottom","left","right","ime","statusBar","StatusBar","rtl","document","documentElement","dir","navigationBar","NavigationBar","miniRuntime","isLandscape","isPortrait","setTheme","error","UnistylesRuntime","UnistylesListener","emitChange","UnistyleDependency","Theme","ThemeName","setAdaptiveThemes","isEnabled","setRootViewBackgroundColor","color","style","backgroundColor","setImmersiveMode","updateTheme","updater","oldTheme","themes","get","set","exports"],"sourceRoot":"../../../src","sources":["web/runtime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SAAS,KAAK;IACvC,MAAMe,KAAK,GAAGd,qBAAc,CAAC0D,MAAM,CAACC,GAAG,CAAC5D,SAAS,IAAI,EAAE,CAAC;IAExD,IAAI,CAACA,SAAS,IAAI,CAACe,KAAK,EAAE;MACtB,MAAM,IAAA2B,YAAK,EAAC,+BAA+B1C,SAAS,6BAA6B,CAAC;IACtF;IAEA,OAAOe,KAAK;EAChB,CAAC;AACL;AAEO,MAAM4B,gBAAgB,GAAAmB,OAAA,CAAAnB,gBAAA,GAAG,IAAIzD,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_convert","require","_listener","_registry","_utils","_utils2","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","Map","hashMap","classNamesMap","add","ref","_style","_variants","_args","secrets","extractSecrets","forEach","__uni__refs","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","styles","filter","style","Object","keys","some","key","startsWith","length","parsedStyles","flatMap","styleIndex","map","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","variants","args","result","variantsResult","fromEntries","getVariants","resultWithVariants","deepMergeObjects","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesListener","addListeners","hash","newComputedStyleSheet","newValue","applyStyles","convertUnistyles","combinedStyles","oldStyles","equal","oldClassNames","className","classList","set","existingHash","injectedClassNames","_web","_classNames","newClassNames","Array","isArray","concat","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAIA,MAAMM,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;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G,CAACV,GAAG,CAAC;;IAEjD;IACA,IAAIsD,SAAS,EAAE;MACX1C,2BAAiB,CAACC,MAAM,CAACyC,SAAS,CAAC;IACvC;;IAEA;IACAE,aAAa,EAAElD,OAAO,CAACmD,SAAS,IAAIzD,GAAG,CAAC0D,SAAS,CAAC7C,MAAM,CAAC4C,SAAS,CAAC,CAAC;IACpE,IAAI,CAAC9D,UAAU,CAACgE,GAAG,CAAC3D,GAAG,EAAEqD,cAAc,CAAC;IAExC,MAAM;MAAEL,IAAI;MAAEY;IAAa,CAAC,GAAGhD,2BAAiB,CAACb,GAAG,CAACsD,cAAc,CAAC;IACpE,MAAMQ,kBAAkB,GAAGR,cAAc,EAAES,IAAI,EAAEC,WAAW,IAAI,EAAE;IAClE,MAAMC,aAAa,GAAG,CAACC,KAAK,CAACC,OAAO,CAACL,kBAAkB,CAAC,GAAGA,kBAAkB,GAAG,CAACA,kBAAkB,CAAC,EAAEM,MAAM,CAACnB,IAAI,CAAC;IAElH,IAAI,CAAClD,aAAa,CAAC6D,GAAG,CAAC3D,GAAG,EAAEgE,aAAa,CAAC;IAC1C;IACAhE,GAAG,CAAC0D,SAAS,CAAC3D,GAAG,CAAC,GAAGiE,aAAa,CAAC;;IAEnC;IACA,IAAI,CAACJ,YAAY,EAAE;MACf,IAAI,CAAC/D,OAAO,CAAC8D,GAAG,CAAC3D,GAAG,EAAEgD,IAAI,CAAC;IAC/B;IAEA,OAAOgB,aAAa;EACxB,CAAC;EAEDnD,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAMuD,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI/E,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_convert","require","_listener","_registry","_utils","_utils2","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","resultsMap","Map","hashMap","classNamesMap","add","ref","_style","_variants","_args","secrets","extractSecrets","forEach","__uni__refs","isInDocument","oldResult","get","delete","UnistylesRegistry","remove","HTMLElement","styles","filter","style","Object","keys","some","key","startsWith","length","parsedStyles","flatMap","styleIndex","map","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","getComputedStylesheet","variants","args","result","variantsResult","fromEntries","getVariants","resultWithVariants","deepMergeObjects","dependencies","extractUnistyleDependencies","addDependenciesToStylesheet","UnistylesListener","addListeners","hash","newComputedStyleSheet","newValue","applyStyles","convertUnistyles","combinedStyles","oldStyles","equal","oldClassNames","className","classList","set","existingHash","injectedClassNames","_web","_classNames","newClassNames","Array","isArray","concat","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAIA,MAAMM,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,IAAIC,GAAG,CAA+B,CAAC;EACpDC,OAAO,GAAG,IAAID,GAAG,CAAsB,CAAC;EACxCE,aAAa,GAAG,IAAIF,GAAG,CAA6B,CAAC;EAE7DG,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAAoB,EAAEC,SAA0C,EAAEC,KAAwB,KAAK;IAC5G;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAID,GAAG,KAAK,IAAI,EAAE;MACd,MAAMI,OAAO,GAAG,IAAAC,sBAAc,EAACJ,MAAM,CAAC;MAEtCG,OAAO,CAACE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,kBAAkB,GAAG,CAACA,kBAAkB,CAAC,EAAEM,MAAM,CAACnB,IAAI,CAAC;IAElH,IAAI,CAAClD,aAAa,CAAC6D,GAAG,CAAC3D,GAAG,EAAEgE,aAAa,CAAC;IAC1C;IACAhE,GAAG,CAAC0D,SAAS,CAAC3D,GAAG,CAAC,GAAGiE,aAAa,CAAC;;IAEnC;IACA,IAAI,CAACJ,YAAY,EAAE;MACf,IAAI,CAAC/D,OAAO,CAAC8D,GAAG,CAAC3D,GAAG,EAAEgD,IAAI,CAAC;IAC/B;IAEA,OAAOgB,aAAa;EACxB,CAAC;EAEDnD,MAAM,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB;AAEO,MAAMuD,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAI/E,8BAA8B,CAAC,CAAC","ignoreList":[]}
@@ -19,7 +19,9 @@ class UnistylesStateBuilder {
19
19
  init = config => {
20
20
  this.initThemes(config.themes);
21
21
  this.initBreakpoints(config.breakpoints);
22
- this.initSettings(config.settings);
22
+ if (config.settings) {
23
+ this.initSettings(config.settings);
24
+ }
23
25
  if ((0, _utils.isServer)()) {
24
26
  return;
25
27
  }
@@ -32,31 +34,36 @@ class UnistylesStateBuilder {
32
34
  };
33
35
  initSettings = settings => {
34
36
  this.hasAdaptiveThemes = settings?.adaptiveThemes ?? false;
35
- const themeNames = Array.from(this.themes.keys());
36
-
37
- // Single theme + no settings
38
- if (!settings?.adaptiveThemes && !settings?.initialTheme && themeNames.length === 1) {
39
- this.themeName = themeNames[0];
40
- return;
41
- }
42
-
43
- // No settings
44
- if (!settings?.adaptiveThemes && !settings?.initialTheme) {
45
- throw new Error('🦄 You need to specify either "initialTheme" or "adaptiveThemes" in your config');
37
+ if (settings.initialTheme && settings.adaptiveThemes) {
38
+ throw (0, _utils.error)('You\'re trying to set initial theme and enable adaptiveThemes, but these options are mutually exclusive.');
46
39
  }
47
40
 
48
41
  // Adaptive themes
49
42
  if (settings.adaptiveThemes) {
43
+ if (!this.themes.get('light') || !this.themes.get('dark')) {
44
+ throw (0, _utils.error)(`You're trying to enable adaptiveThemes, but you didn't register both 'light' and 'dark' themes.`);
45
+ }
50
46
  this.themeName = (0, _utils.schemeToTheme)(_runtime.UnistylesRuntime.colorScheme);
51
47
  return;
52
48
  }
53
-
54
- // Initial theme
55
- this.themeName = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
49
+ if (settings.initialTheme) {
50
+ const initialTheme = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
51
+ if (!this.themes.get(initialTheme)) {
52
+ throw (0, _utils.error)(`You're trying to select theme "${initialTheme}" but it wasn't registered.`);
53
+ }
54
+ this.themeName = initialTheme;
55
+ }
56
56
  };
57
57
  initBreakpoints = (breakpoints = {}) => {
58
58
  this.breakpoints = breakpoints;
59
- Object.entries(breakpoints).sort(([, a], [, b]) => a - b).forEach(([breakpoint, value]) => {
59
+ const breakpointsEntries = Object.entries(breakpoints);
60
+ if (breakpointsEntries.length === 0) {
61
+ throw (0, _utils.error)('StyleSheet.configure\'s breakpoints can\'t be empty.');
62
+ }
63
+ if (breakpointsEntries?.[0]?.[1] !== 0) {
64
+ throw (0, _utils.error)('StyleSheet.configure\'s first breakpoint must start from 0.');
65
+ }
66
+ breakpointsEntries.sort(([, a], [, b]) => a - b).forEach(([breakpoint, value]) => {
60
67
  if ((0, _utils.isServer)()) {
61
68
  return;
62
69
  }
@@ -1 +1 @@
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","UnistyleD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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":[]}
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","settings","initSettings","isServer","UnistylesListener","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","initialTheme","error","get","schemeToTheme","UnistylesRuntime","colorScheme","breakpointsEntries","length","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;AAKA,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,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U,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,15 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.warn = exports.reduceObject = exports.keyInObject = exports.isServer = exports.hyphenate = exports.generateHash = exports.equal = void 0;
6
+ exports.reduceObject = exports.keyInObject = exports.isServer = exports.hyphenate = exports.generateHash = exports.error = exports.equal = void 0;
7
7
  const reduceObject = (obj, reducer) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, reducer(value, key)]));
8
8
  exports.reduceObject = reduceObject;
9
9
  const keyInObject = (obj, key) => key in obj;
10
10
  exports.keyInObject = keyInObject;
11
11
  const isServer = () => typeof window === 'undefined';
12
12
  exports.isServer = isServer;
13
- const warn = message => console.warn(`🦄 [react-native-unistyles] ${message}`);
14
- exports.warn = warn;
13
+ const error = message => new Error(`Unistyles: ${message}`);
14
+ exports.error = error;
15
15
  const equal = (a, b) => {
16
16
  if (Object.is(a, b)) {
17
17
  return true;
@@ -1 +1 @@
1
- {"version":3,"names":["reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","isServer","window","warn","message","console","equal","a","b","is","keysA","keys","length","every","prototype","hasOwnProperty","call","generateHash","str","JSON","stringify","hasher","charCodeAt","toString","hyphenate","propertyName","replace","m","toLowerCase"],"sourceRoot":"../../../../src","sources":["web/utils/common.ts"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAA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W,CAAC,CAACX,GAAG,CAAC,CAAC,IAAIJ,MAAM,CAACqB,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,CAAC,EAAEX,GAAG,CAAC,CAAC;AACxG,CAAC;AAAAE,OAAA,CAAAO,KAAA,GAAAA,KAAA;AAEM,MAAMW,YAAY,GAAInB,KAAU,IAAK;EACxC,MAAMoB,GAAG,GAAGC,IAAI,CAACC,SAAS,CAACtB,KAAK,CAAC;EACjC,IAAIuB,MAAM,GAAG,IAAI;EACjB,IAAIT,MAAM,GAAGM,GAAG,CAACN,MAAM;EAEvB,OAAOA,MAAM,EAAE,EAAES,MAAM,GAAIA,MAAM,GAAG,EAAE,GAAIH,GAAG,CAACI,UAAU,CAACV,MAAM,CAAC;EAEhE,OAAO,aAAa,CAACS,MAAM,KAAK,CAAC,EAAEE,QAAQ,CAAC,EAAE,CAAC,EAAE;AACrD,CAAC;AAAAxB,OAAA,CAAAkB,YAAA,GAAAA,YAAA;AAEM,MAAMO,SAAS,GAAIC,YAAoB,IAAKA,YAAY,CAACC,OAAO,CAAC,QAAQ,EAAGC,CAAS,IAAK,IAAIA,CAAC,CAACC,WAAW,CAAC,CAAC,EAAE,CAAC;AAAA7B,OAAA,CAAAyB,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["reduceObject","obj","reducer","Object","fromEntries","entries","map","key","value","exports","keyInObject","isServer","window","error","message","Error","equal","a","b","is","keysA","keys","length","every","prototype","hasOwnProperty","call","generateHash","str","JSON","stringify","hasher","charCodeAt","toString","hyphenate","propertyName","replace","m","toLowerCase"],"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,O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Y,GAAInB,KAAU,IAAK;EACxC,MAAMoB,GAAG,GAAGC,IAAI,CAACC,SAAS,CAACtB,KAAK,CAAC;EACjC,IAAIuB,MAAM,GAAG,IAAI;EACjB,IAAIT,MAAM,GAAGM,GAAG,CAACN,MAAM;EAEvB,OAAOA,MAAM,EAAE,EAAES,MAAM,GAAIA,MAAM,GAAG,EAAE,GAAIH,GAAG,CAACI,UAAU,CAACV,MAAM,CAAC;EAEhE,OAAO,aAAa,CAACS,MAAM,KAAK,CAAC,EAAEE,QAAQ,CAAC,EAAE,CAAC,EAAE;AACrD,CAAC;AAAAxB,OAAA,CAAAkB,YAAA,GAAAA,YAAA;AAEM,MAAMO,SAAS,GAAIC,YAAoB,IAAKA,YAAY,CAACC,OAAO,CAAC,QAAQ,EAAGC,CAAS,IAAK,IAAIA,CAAC,CAACC,WAAW,CAAC,CAAC,EAAE,CAAC;AAAA7B,OAAA,CAAAyB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.schemeToTheme = exports.isInDocument = exports.hexToRGBA = exports.getStyles = exports.getMediaQuery = exports.extractUnistyleDependencies = exports.extractSecrets = exports.extractMediaQueryValue = exports.assignSecrets = void 0;
6
+ exports.schemeToTheme = exports.isInDocument = exports.getStyles = exports.getMediaQuery = exports.extractUnistyleDependencies = exports.extractSecrets = exports.extractMediaQueryValue = exports.assignSecrets = void 0;
7
7
  var _types = require("../../specs/types");
8
8
  var _mq = require("../../mq");
9
9
  var _state = require("../state");
@@ -18,8 +18,6 @@ const schemeToTheme = scheme => {
18
18
  }
19
19
  };
20
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
21
  const assignSecrets = (object, secrets) => {
24
22
  // @ts-expect-error - assign secrets to object
25
23
  object[`__uni__secrets__${Math.random().toString(16).slice(2)}`] = secrets;
@@ -54,7 +52,7 @@ const extractMediaQueryValue = query => {
54
52
  return undefined;
55
53
  }
56
54
  const value = Number(px);
57
- return isNaN(value) ? undefined : value;
55
+ return Number.isNaN(value) ? undefined : value;
58
56
  };
59
57
  exports.extractMediaQueryValue = extractMediaQueryValue;
60
58
  const getMediaQuery = query => {